이름: solution/front → solution/frontend

`backend` 옆에 `front` 가 있을 이유가 없었다. negosium 의 negodata/front 를 그대로
베꼈고 그게 왜 front 인지는 따져보지 않았다 — 근거 없이 들여온 이름이라 바로잡는다.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019uYhHQdssRubirPirrdJJC
This commit is contained in:
minaChoiandClaude Opus 5 committed 2026-08-31 15:27:16 +09:00
1 parent 06f6438d9b
commit c85c577349
480 files changed
+22 -22

No files matched your search

@@ -0,0 +1,145 @@
import React from 'react';
export interface SlateTextNode {
text: string;
bold?: boolean;
italic?: boolean;
underline?: boolean;
code?: boolean;
}
export interface SlateElementNode {
type?: string;
speaker?: string;
role?: 'buyer' | 'seller' | 'host' | 'guest' | 'ai' | 'customer';
time?: string;
children: (SlateElementNode | SlateTextNode)[];
}
interface SlateScriptRendererProps {
nodes?: (SlateElementNode | SlateTextNode)[];
primaryColor?: string;
className?: string;
}
export const SlateScriptRenderer: React.FC<SlateScriptRendererProps> = ({
nodes,
primaryColor = '#18181b',
className = '',
}) => {
if (!nodes || nodes.length === 0) {
return null;
}
const renderTextNode = (node: SlateTextNode, idx: number) => {
let content: React.ReactNode = node.text;
if (node.bold) content = <strong key={idx}>{content}</strong>;
if (node.italic) content = <em key={idx}>{content}</em>;
if (node.underline) content = <u key={idx}>{content}</u>;
if (node.code) {
content = (
<code key={idx} className="bg-slate-100 px-1 py-0.5 rounded text-[11px] font-mono">
{content}
</code>
);
}
return <React.Fragment key={idx}>{content}</React.Fragment>;
};
const renderElement = (node: SlateElementNode, idx: number) => {
switch (node.type) {
case 'chat-dialog':
case 'dialog':
case 'negotiation': {
const isHost = node.role === 'seller' || node.role === 'host' || node.role === 'ai';
return (
<div
key={idx}
className={`flex items-start gap-3 my-2.5 ${isHost ? 'flex-row-reverse' : 'flex-row'}`}
>
{/* Avatar */}
<div
className={`w-8 h-8 rounded-full flex items-center justify-center text-xs font-bold flex-shrink-0 shadow-2xs ${
isHost ? 'bg-slate-900 text-white' : 'bg-slate-200 text-slate-700'
}`}
>
{node.speaker ? node.speaker.slice(0, 1) : isHost ? '호' : '손'}
</div>
{/* Bubble */}
<div className={`max-w-[75%] space-y-1 ${isHost ? 'text-right' : 'text-left'}`}>
<div className="flex items-center gap-1.5 text-[11px] text-slate-400">
<span className="font-semibold text-slate-700">{node.speaker || (isHost ? '호스트' : '게스트')}</span>
{node.time && <span>· {node.time}</span>}
</div>
<div
className={`px-3.5 py-2.5 rounded-2xl text-xs leading-relaxed inline-block text-left ${
isHost
? 'bg-slate-900 text-white rounded-tr-xs shadow-2xs'
: 'bg-slate-100 text-slate-800 rounded-tl-xs'
}`}
>
{node.children.map((child, cIdx) =>
'text' in child ? renderTextNode(child, cIdx) : renderElement(child, cIdx)
)}
</div>
</div>
</div>
);
}
case 'heading-two':
case 'h2':
return (
<h3 key={idx} className="text-base font-bold text-slate-900 mt-4 mb-2">
{node.children.map((child, cIdx) =>
'text' in child ? renderTextNode(child, cIdx) : renderElement(child, cIdx)
)}
</h3>
);
case 'quote':
case 'blockquote':
return (
<blockquote
key={idx}
className="border-l-2 pl-3 my-3 text-xs italic text-slate-600 border-slate-400"
>
{node.children.map((child, cIdx) =>
'text' in child ? renderTextNode(child, cIdx) : renderElement(child, cIdx)
)}
</blockquote>
);
case 'callout':
case 'info-box':
return (
<div
key={idx}
className="p-3.5 my-3 bg-slate-50 border border-slate-200 rounded-xl text-xs text-slate-700 leading-relaxed"
>
{node.children.map((child, cIdx) =>
'text' in child ? renderTextNode(child, cIdx) : renderElement(child, cIdx)
)}
</div>
);
default:
return (
<p key={idx} className="text-xs text-slate-600 leading-relaxed my-1.5">
{node.children.map((child, cIdx) =>
'text' in child ? renderTextNode(child, cIdx) : renderElement(child, cIdx)
)}
</p>
);
}
};
return (
<div className={`slate-editor-script space-y-1 ${className}`}>
{nodes.map((node, idx) =>
'text' in node ? renderTextNode(node, idx) : renderElement(node, idx)
)}
</div>
);
};
@@ -0,0 +1,118 @@
import {useState} from 'react';
import {Check, Copy} from 'lucide-react';
import type {TemplateItem} from '@o2o/shared';
import {cn} from '@/lib/utils';
/**
* 주소 + 복사 + 지도 앱 링크.
*
* "오시는 길" 배리에이션들이 공통으로 쓰는 덩어리. 복사 성공 표시까지 여기 들어 있어서
* 레이아웃을 바꿔도 사장님이 확인하는 동작은 똑같이 남는다.
*/
export function AddressCard({
address,
searchName,
variant = 'card',
colors,
className,
}: {
address: string;
/** 네이버 지도에서 찾을 이름. 보통 상호. */
searchName: string;
variant?: 'card' | 'bar';
/**
* 템플릿 색 토큰. 주소 글자만 text 를 따른다.
*
* ★ 지도 버튼의 초록·노랑은 네이버/카카오의 색이라 토큰으로 바꾸지 않는다 —
* 손님이 "그 버튼"으로 알아보는 색이다.
*/
colors?: TemplateItem['colors'];
className?: string;
}) {
const [copied, setCopied] = useState(false);
const addressStyle = colors ? {color: colors.text} : undefined;
const handleCopy = (e: React.MouseEvent) => {
e.stopPropagation();
navigator.clipboard.writeText(address);
setCopied(true);
setTimeout(() => setCopied(false), 2000);
};
const links = (
<div className="flex items-center gap-2">
<a
href={`https://map.naver.com/v5/search/${encodeURIComponent(searchName)}`}
target="_blank"
rel="noopener noreferrer"
onClick={(e) => e.stopPropagation()}
className="rounded-lg bg-emerald-600 px-3.5 py-2 text-xs font-semibold text-white shadow-2xs transition-colors hover:bg-emerald-700"
>
네이버 지도 길찾기
</a>
<a
href={`https://map.kakao.com/link/search/${encodeURIComponent(address)}`}
target="_blank"
rel="noopener noreferrer"
onClick={(e) => e.stopPropagation()}
className="rounded-lg bg-amber-400 px-3.5 py-2 text-xs font-semibold text-stone-950 shadow-2xs transition-colors hover:bg-amber-500"
>
카카오맵
</a>
</div>
);
if (variant === 'bar') {
return (
<div
className={cn(
'flex flex-col items-start justify-between gap-3 rounded-xl border border-stone-200/80 bg-white px-4 py-3 sm:flex-row sm:items-center',
className,
)}
>
<span className="text-xs font-bold text-stone-900 sm:text-sm" style={addressStyle}>
{address}
</span>
<div className="flex items-center gap-2">
<button
type="button"
onClick={handleCopy}
className="inline-flex cursor-pointer items-center gap-1 rounded border border-stone-200 bg-white px-2.5 py-1 text-xs font-medium text-stone-700 shadow-2xs hover:bg-stone-100"
>
{copied ? <Check className="size-3.5 text-emerald-600" /> : <Copy className="size-3.5" />}
<span>{copied ? '복사완료' : '복사'}</span>
</button>
{links}
</div>
</div>
);
}
return (
<div
className={cn(
'flex flex-col justify-between gap-4 rounded-xl border border-stone-200/80 bg-stone-50/70 p-5 md:flex-row md:items-center',
className,
)}
>
<div className="space-y-1">
<span className="text-[11px] font-bold uppercase text-stone-400">도로명 주소</span>
<div className="flex items-center gap-2">
<strong className="text-sm font-bold text-stone-900 sm:text-base" style={addressStyle}>
{address}
</strong>
<button
type="button"
onClick={handleCopy}
className="inline-flex cursor-pointer items-center gap-1 rounded border border-stone-200 bg-white px-2.5 py-1 text-xs font-medium text-stone-700 shadow-2xs hover:bg-stone-100"
>
{copied ? <Check className="size-3.5 text-emerald-600" /> : <Copy className="size-3.5" />}
<span>{copied ? '복사완료' : '복사'}</span>
</button>
</div>
</div>
{links}
</div>
);
}
@@ -0,0 +1,80 @@
/**
* 캔버스 안의 행동 유도 링크.
*
* 캔버스는 클릭이 곧 "섹션 선택"이라, 링크는 반드시 stopPropagation 을 해야 한다.
* 그 한 줄을 배리에이션마다 손으로 쓰면 언젠가 빠진다 — 여기 한 곳에 가둔다.
*/
import type {ReactNode} from 'react';
import type {TemplateItem} from '@o2o/shared';
import {cn} from '@/lib/utils';
export type CtaStyle = 'solid' | 'outline' | 'pill' | 'ghost' | 'brand';
interface CtaLinkProps {
href: string;
children: ReactNode;
variant?: CtaStyle;
size?: 'sm' | 'md';
/** 템플릿 색 토큰. 넘기면 버튼이 브랜드 색을 따른다. */
colors?: TemplateItem['colors'];
block?: boolean;
className?: string;
}
const BASE =
'inline-flex items-center justify-center gap-1.5 font-semibold transition-all cursor-pointer';
const SIZE = {
sm: 'px-3 py-1.5 text-[11px]',
md: 'px-5 py-2.5 text-xs',
};
/**
* variant 마다 토큰이 닿는 자리가 다르다 — 채운 버튼은 배경, 흰 버튼은 글자색.
*
* ★ primary 는 이 서비스에서 "흰 글자를 얹는 어두운 색"이라는 계약이다.
* 그래서 배경으로 쓸 때는 primary 만 쓴다 — accent 를 배경에 깔면 흰 글자가 뜬다.
*/
function tokenStyle(variant: CtaStyle, colors?: TemplateItem['colors']) {
if (!colors) return undefined;
if (variant === 'brand' || variant === 'solid') return {backgroundColor: colors.primary};
if (variant === 'pill' || variant === 'outline') return {color: colors.primary};
return undefined;
}
export function CtaLink({
href,
children,
variant = 'solid',
size = 'md',
colors,
block,
className,
}: CtaLinkProps) {
return (
<a
href={href}
target="_blank"
rel="noopener noreferrer"
onClick={(e) => e.stopPropagation()}
style={tokenStyle(variant, colors)}
className={cn(
BASE,
SIZE[size],
block && 'w-full',
variant === 'solid' && 'rounded-xl bg-stone-900 text-white shadow-xs hover:bg-stone-800',
variant === 'brand' && 'rounded-xl text-white shadow-xs hover:opacity-90',
variant === 'outline' &&
'rounded-xl border border-stone-300 bg-white text-stone-800 hover:bg-stone-100',
variant === 'pill' &&
'rounded-full bg-white text-stone-900 shadow-md hover:bg-stone-100',
variant === 'ghost' && 'rounded-lg text-stone-500 hover:bg-stone-100 hover:text-stone-900',
// 배경을 인라인 스타일로 덮으면 hover 배경 클래스가 안 먹는다 — 투명도로 대신 반응시킨다.
variant === 'solid' && colors && 'hover:opacity-90',
className,
)}
>
{children}
</a>
);
}
@@ -0,0 +1,21 @@
import type {ReactNode} from 'react';
import {Clock3} from 'lucide-react';
/**
* "아직 준비 중" 한 줄.
*
* 실사업장은 객실·주변정보·영상 같은 목록이 아직 비어 있다(백엔드에 조회 창구가
* 없는 것도 있다). 목록만 조용히 비우면 에디터에서는 섹션이 통째로 사라진 것처럼 보여
* 사장님이 "내가 뭘 지웠나" 하고 되돌리려 든다 — 자리는 지키고 비었다는 사실만 말한다.
*
* 톤은 HiddenFieldsNotice 와 맞춘다: 사장님에게 하는 담백한 상태 보고지 손님용 카피가 아니다.
* (다만 저쪽은 "가리는 중"이라 경고색, 이쪽은 "아직 없음"이라 중립색이다.)
*/
export function EmptyStateNotice({children}: {children: ReactNode}) {
return (
<div className="flex items-center justify-center gap-2 rounded-xl border border-dashed border-stone-300/80 bg-stone-50/60 px-4 py-6 text-center text-xs text-stone-500">
<Clock3 className="size-3.5 shrink-0 text-stone-400" />
<span>{children}</span>
</div>
);
}
@@ -0,0 +1,47 @@
import type {LucideIcon} from 'lucide-react';
import type {TemplateItem} from '@o2o/shared';
import {cn} from '@/lib/utils';
/**
* 아이콘 + 제목 + 한 줄 설명. 주차/충전기/편의시설처럼 "있다/없다"를 알리는 칸.
*/
export function FeatureCard({
icon: Icon,
title,
description,
iconClassName,
colors,
className,
}: {
icon: LucideIcon;
title: string;
description?: string;
iconClassName?: string;
/** 템플릿 색 토큰. 제목과 아이콘이 브랜드 색을 따른다. */
colors?: TemplateItem['colors'];
className?: string;
}) {
// ★ iconClassName 은 "전기차 충전기는 초록" 처럼 뜻이 정해진 색을 넣는 자리다.
// 그 위에 토큰을 덮으면 의미가 사라지므로, 지정이 없을 때만 primary 를 쓴다.
const iconStyle = colors && !iconClassName ? {color: colors.primary} : undefined;
return (
<div
className={cn(
'flex items-start gap-3 rounded-xl border border-stone-200/80 bg-stone-50/70 p-4',
className,
)}
>
<Icon className={cn('size-5 shrink-0 text-stone-800', iconClassName)} style={iconStyle} />
<div>
<strong
className="block text-xs font-bold text-stone-900"
style={colors ? {color: colors.text} : undefined}
>
{title}
</strong>
{description && <p className="mt-0.5 text-[11px] text-stone-600">{description}</p>}
</div>
</div>
);
}
@@ -0,0 +1,18 @@
import {AlertCircle} from 'lucide-react';
/**
* "미확인 항목 N개 숨김 중" 배지.
*
* 미검증 값은 캔버스에서 아예 빼되, 빠졌다는 사실은 반드시 보여준다 —
* 조용히 사라지면 사장님은 "이미 나가고 있다"고 오해한다.
*/
export function HiddenFieldsNotice({count}: {count: number}) {
if (count <= 0) return null;
return (
<span className="flex items-center gap-1.5 rounded-lg border border-amber-200 bg-amber-50 px-2.5 py-1 text-[11px] text-amber-700">
<AlertCircle className="size-3.5 text-amber-600" />
<span>미확인 항목 {count}개 숨김 중</span>
</span>
);
}
@@ -0,0 +1,77 @@
/**
* 기본 정보 한 줄 — 라벨/값 한 쌍을 어떤 모양으로 낼지가 통째로 배리에이션이다.
* (표의 한 행 · 카드 한 장 · 문장 속 인라인)
*/
import {cn} from '@/lib/utils';
import type {InfoField, TemplateItem} from '@o2o/shared';
export type InfoRowStyle = 'row' | 'card' | 'inline';
export function InfoRow({
field,
variant = 'row',
colors,
className,
}: {
field: InfoField;
variant?: InfoRowStyle;
/** 템플릿 색 토큰. 값(굵은 글씨)만 text 를 따르고 라벨은 중립 회색으로 남는다. */
colors?: TemplateItem['colors'];
className?: string;
}) {
const valueStyle = colors ? {color: colors.text} : undefined;
if (variant === 'card') {
return (
<div
className={cn(
'space-y-1 rounded-xl border border-stone-200/80 bg-white p-4 shadow-2xs',
className,
)}
>
<span className="block text-[11px] font-semibold uppercase tracking-wide text-stone-400">
{field.label}
</span>
<span
className="block text-xs font-bold leading-relaxed text-stone-900 sm:text-sm"
style={valueStyle}
>
{field.value}
</span>
</div>
);
}
if (variant === 'inline') {
return (
<span
className={cn(
'inline-flex flex-wrap items-baseline gap-1.5 text-xs leading-relaxed',
className,
)}
>
<span className="font-semibold text-stone-400">{field.label}</span>
<span className="font-bold text-stone-900" style={valueStyle}>
{field.value}
</span>
</span>
);
}
return (
<div
className={cn(
'flex flex-col justify-between gap-1 p-4 transition-colors hover:bg-stone-100/50 sm:flex-row sm:items-center sm:gap-4',
className,
)}
>
<span className="text-xs font-semibold text-stone-500 sm:w-1/3">{field.label}</span>
<span
className="text-xs font-bold text-stone-900 sm:w-2/3 sm:text-right sm:text-sm"
style={valueStyle}
>
{field.value}
</span>
</div>
);
}
@@ -0,0 +1,80 @@
import {X, ChevronLeft, ChevronRight} from 'lucide-react';
import type {TilePhoto} from './PhotoTile';
/**
* 사진 확대 보기. 갤러리 배리에이션 세 개가 전부 이걸 그대로 쓴다 —
* 확대 동작까지 배리에이션마다 다르면 사장님이 레이아웃을 바꿀 때마다 조작법을 다시 배운다.
*/
export function Lightbox({
photos,
index,
onClose,
onMove,
}: {
photos: TilePhoto[];
index: number | null;
onClose: () => void;
onMove?: (next: number) => void;
}) {
if (index === null || !photos[index]) return null;
const photo = photos[index];
const step = (delta: number) => onMove?.((index + delta + photos.length) % photos.length);
return (
<div
onClick={(e) => {
e.stopPropagation();
onClose();
}}
className="fixed inset-0 z-50 flex items-center justify-center bg-black/90 p-4 backdrop-blur-md"
>
<button
type="button"
onClick={onClose}
aria-label="닫기"
className="absolute right-4 top-4 z-10 cursor-pointer rounded-full bg-white/10 p-2 text-white"
>
<X className="size-6" />
</button>
{onMove && photos.length > 1 && (
<>
<button
type="button"
aria-label="이전 사진"
onClick={(e) => {
e.stopPropagation();
step(-1);
}}
className="absolute left-3 z-10 cursor-pointer rounded-full bg-white/10 p-2 text-white hover:bg-white/20"
>
<ChevronLeft className="size-5" />
</button>
<button
type="button"
aria-label="다음 사진"
onClick={(e) => {
e.stopPropagation();
step(1);
}}
className="absolute right-3 z-10 cursor-pointer rounded-full bg-white/10 p-2 text-white hover:bg-white/20"
>
<ChevronRight className="size-5" />
</button>
</>
)}
<div
onClick={(e) => e.stopPropagation()}
className="flex max-h-[85vh] max-w-3xl items-center"
>
<img
src={photo.url}
alt={photo.alt ?? photo.caption ?? ''}
className="max-h-[70vh] max-w-full rounded-xl object-contain shadow-2xl"
/>
</div>
</div>
);
}
@@ -0,0 +1,72 @@
import {cn} from '@/lib/utils';
export interface TilePhoto {
id: string;
url: string;
alt?: string;
caption?: string;
category?: string;
}
type TileFit = 'square' | 'portrait' | 'landscape' | 'free';
const ASPECT: Record<TileFit, string> = {
square: 'aspect-square',
portrait: 'aspect-3/4',
landscape: 'aspect-4/3',
free: '',
};
/**
* 갤러리 한 칸. 격자든 벽돌쌓기든 슬라이드든 "칸 하나"의 모양은 같아야 한다 —
* 배리에이션이 바꾸는 건 칸의 배치이지 칸 자체가 아니다.
*/
export function PhotoTile({
photo,
fit = 'square',
onOpen,
showMeta = false,
className,
}: {
photo: TilePhoto;
fit?: TileFit;
onOpen?: () => void;
showMeta?: boolean;
className?: string;
}) {
return (
<div
onClick={(e) => {
e.stopPropagation();
onOpen?.();
}}
className={cn(
'group relative select-none overflow-hidden rounded-xl border border-stone-200/80 bg-stone-100',
ASPECT[fit],
onOpen && 'cursor-pointer',
className,
)}
>
<img
src={photo.url}
alt={photo.alt ?? photo.caption ?? ''}
loading="lazy"
className="size-full object-cover transition-transform duration-300 group-hover:scale-105"
/>
{showMeta && (photo.category || photo.caption) && (
<div className="absolute inset-0 flex flex-col justify-between bg-black/40 p-2 text-white opacity-0 transition-opacity group-hover:opacity-100">
{photo.category ? (
<span className="self-start rounded bg-black/50 px-1.5 py-0.5 text-[10px] font-medium">
{photo.category}
</span>
) : (
<span />
)}
{photo.caption && (
<span className="truncate text-[10px] font-light">{photo.caption}</span>
)}
</div>
)}
</div>
);
}
@@ -0,0 +1,38 @@
import type {ReactNode} from 'react';
import {cn} from '@/lib/utils';
type PillTone = 'neutral' | 'accent' | 'warn' | 'good' | 'dark';
const TONE: Record<PillTone, string> = {
neutral: 'bg-stone-100 text-stone-600 border-stone-200/70',
accent: 'bg-amber-100/80 text-amber-900 border-amber-200/70',
warn: 'bg-amber-50 text-amber-700 border-amber-200',
good: 'bg-emerald-50 text-emerald-700 border-emerald-200/60',
dark: 'bg-stone-900/85 text-white border-transparent',
};
/** 작은 라벨 하나. 거리·태그·가격대·"대표축제" 처럼 값 옆에 붙는 부가 정보 전용. */
export function Pill({
children,
tone = 'neutral',
mono,
className,
}: {
children: ReactNode;
tone?: PillTone;
mono?: boolean;
className?: string;
}) {
return (
<span
className={cn(
'inline-flex shrink-0 items-center gap-1 rounded border px-1.5 py-0.5 text-[10px] font-medium',
TONE[tone],
mono && 'font-mono',
className,
)}
>
{children}
</span>
);
}
@@ -0,0 +1,89 @@
import {ArrowUpRight} from 'lucide-react';
import type {TemplateItem} from '@o2o/shared';
import {cn} from '@/lib/utils';
import {Pill} from './Pill';
/**
* "이름 · 거리 · 한 줄 설명 · 바로가기" 한 행.
* 맛집 / 명소 / 축제가 전부 이 모양이라 하나로 묶는다.
*/
export function PlaceRow({
name,
meta,
description,
href,
actionLabel = '길찾기',
leading,
colors,
className,
}: {
name: string;
meta?: string;
description?: string;
href?: string;
actionLabel?: string;
leading?: React.ReactNode;
/** 템플릿 색 토큰. 상호명만 text 를 따른다 — 설명·바로가기는 중립 회색이어야 이름이 튄다. */
colors?: TemplateItem['colors'];
className?: string;
}) {
const body = (
<>
<div className="space-y-1 pr-3">
<div className="flex flex-wrap items-center gap-2">
{leading}
<span
className="text-xs font-bold text-stone-900 group-hover:text-stone-700 sm:text-sm"
style={colors ? {color: colors.text} : undefined}
>
{name}
</span>
{meta && <Pill mono>{meta}</Pill>}
</div>
{description && (
<p className="text-xs leading-relaxed text-stone-500">{description}</p>
)}
</div>
{href && (
<span className="flex shrink-0 items-center gap-0.5 text-xs font-medium text-stone-400 group-hover:text-stone-900">
<span>{actionLabel}</span>
<ArrowUpRight className="size-3.5" />
</span>
)}
</>
);
const shared = cn(
'group flex items-center justify-between p-4 transition-colors hover:bg-stone-50/80',
className,
);
if (!href) return <div className={shared}>{body}</div>;
return (
<a
href={href}
target="_blank"
rel="noopener noreferrer"
onClick={(e) => e.stopPropagation()}
className={shared}
>
{body}
</a>
);
}
/** 목록을 감싸는 카드. divide 로 행 사이 선을 긋는다. */
export function ListCard({children, className}: {children: React.ReactNode; className?: string}) {
return (
<div
className={cn(
'overflow-hidden rounded-xl border border-stone-200/80 bg-white shadow-2xs [&>*+*]:border-t [&>*+*]:border-stone-100',
className,
)}
>
{children}
</div>
);
}
@@ -0,0 +1,89 @@
import type {TemplateItem} from '@o2o/shared';
import {cn} from '@/lib/utils';
import {Pill} from './Pill';
export interface PricedItem {
name: string;
price?: string;
desc?: string;
tag?: string;
/** 소요시간 · 대상 같은 부가 스펙. 프로그램/코스에서 쓴다. */
meta?: string[];
}
/**
* "이름 · 태그 · 설명 · 가격" 한 줄.
* 메뉴 / 코스 / 체험 프로그램이 전부 같은 뼈대라 한 원자로 묶고, 배치만 배리에이션에 맡긴다.
*/
export function PriceRow({
item,
variant = 'row',
colors,
className,
}: {
item: PricedItem;
variant?: 'row' | 'card';
/** 템플릿 색 토큰. 품명은 text, 가격은 primary 를 따른다(가격이 이 원자의 주인공이다). */
colors?: TemplateItem['colors'];
className?: string;
}) {
const nameStyle = colors ? {color: colors.text} : undefined;
const priceStyle = colors ? {color: colors.primary} : undefined;
const head = (
<div className="flex flex-wrap items-center gap-2">
<span className="text-xs font-bold text-stone-900 sm:text-sm" style={nameStyle}>
{item.name}
</span>
{item.tag && <Pill tone="accent">{item.tag}</Pill>}
</div>
);
const specs = item.meta?.length ? (
<div className="flex flex-wrap gap-1.5 pt-0.5">
{item.meta.map((m) => (
<Pill key={m}>{m}</Pill>
))}
</div>
) : null;
if (variant === 'card') {
return (
<div
className={cn(
'flex flex-col justify-between gap-3 rounded-xl border border-stone-200/80 bg-white p-4 shadow-2xs',
className,
)}
>
<div className="space-y-1.5">
{head}
{item.desc && <p className="text-xs leading-relaxed text-stone-500">{item.desc}</p>}
{specs}
</div>
{item.price && (
<span className="font-mono text-sm font-extrabold text-stone-900" style={priceStyle}>
{item.price}
</span>
)}
</div>
);
}
return (
<div className={cn('flex items-start justify-between gap-4 p-4', className)}>
<div className="min-w-0 space-y-1">
{head}
{item.desc && <p className="text-xs leading-relaxed text-stone-500">{item.desc}</p>}
{specs}
</div>
{item.price && (
<span
className="shrink-0 font-mono text-xs font-extrabold text-stone-900 sm:text-sm"
style={priceStyle}
>
{item.price}
</span>
)}
</div>
);
}
@@ -0,0 +1,106 @@
/**
* 섹션 껍데기 — 배리에이션이 절대 다시 만들지 않는 부분.
*
* 앵커 id(모바일 탭이 스크롤하는 목표), 선택 링, "선택됨" 배지, 배경 톤이 여기 모여 있다.
* 배리에이션은 안쪽 내용만 책임진다 — 껍데기가 제각각이면 레이아웃을 바꿀 때마다
* 선택 표시가 사라지거나 앵커가 끊긴다.
*/
import type {ReactNode} from 'react';
import type {SectionItem} from '@o2o/shared';
import {cn} from '@/lib/utils';
import type {SectionTone} from '../types';
/**
* 섹션 배경 톤 → 실제 색.
*
* 화면 면적의 대부분이 이 네 색이라, 여기가 하드코딩이면 팔레트를 바꿔도 인상이 안 바뀐다.
* 그래서 템플릿 토큰(`--tpl-*`)을 읽고, 폴백으로 기존 색을 그대로 둔다 —
* ★ 토큰을 안 내려보내는 화면(발행 사이트·썸네일 등)에서는 지금과 픽셀 단위로 동일하다.
*/
const TONE_BG: Record<SectionTone, string> = {
paper: 'var(--tpl-surface, #faf7f2)',
// ★ 진짜 흰색으로 남긴다 — surface/surfaceAlt 와 세 단계가 있어야 섹션이 서로 구분된다.
white: 'var(--tpl-bg, #ffffff)',
tint: 'var(--tpl-surface-alt, #f4f1ec)',
dark: 'var(--tpl-inverse, #1c1917)',
};
interface SectionFrameProps {
section: SectionItem;
isSelected: boolean;
onSelect: () => void;
/** 배경 톤. 위아래 섹션과 다른 톤을 주면 경계선 없이도 구분된다. */
tone?: SectionTone;
/** 히어로처럼 자기 여백을 직접 잡는 배리에이션은 false. */
padded?: boolean;
className?: string;
children: ReactNode;
}
export function SectionFrame({
section,
isSelected,
onSelect,
tone = 'white',
padded = true,
className,
children,
}: SectionFrameProps) {
const isDark = tone === 'dark';
return (
<section
id={`canvas-section-${section.id}`}
onClick={onSelect}
className={cn(
'relative cursor-pointer transition-all',
padded && 'px-4 py-12 sm:px-6 sm:py-16 md:px-8',
isSelected
? 'ring-2 ring-stone-900 ring-offset-2'
: 'hover:outline-1 hover:outline-dashed hover:outline-stone-300',
className,
)}
style={{backgroundColor: TONE_BG[tone]}}
>
{isSelected && (
<span
className={cn(
'z-30 rounded bg-stone-900 px-2 py-0.5 text-[10px] font-semibold text-white',
padded ? 'mb-4 inline-block' : 'absolute left-3 top-3 shadow-xs',
isDark && 'bg-white text-stone-900',
)}
>
선택됨: {section.name}
{section.isLocked && ' (필수)'}
</span>
)}
{children}
</section>
);
}
/** 섹션 본문의 표준 폭. 배리에이션마다 폭이 다르면 스크롤할 때 글줄이 출렁인다. */
export function SectionBody({
children,
width = 'default',
className,
}: {
children: ReactNode;
width?: 'default' | 'wide' | 'narrow';
className?: string;
}) {
return (
<div
className={cn(
'mx-auto space-y-6',
width === 'wide' && 'max-w-[1120px]',
width === 'default' && 'max-w-[880px]',
width === 'narrow' && 'max-w-[640px]',
className,
)}
>
{children}
</div>
);
}
@@ -0,0 +1,126 @@
/**
* 섹션 제목 — 그 자체로 배리에이션을 갖는 원자.
*
* 섹션 배리에이션을 바꿔도 제목 스타일은 따로 고를 수 있어야 한다
* ("갤러리는 격자로, 제목은 가운데 정렬" 같은 조합이 실제로 나온다).
*/
import type {ReactNode} from 'react';
import type {TemplateItem} from '@o2o/shared';
import {cn} from '@/lib/utils';
export type HeadingStyle = 'underline' | 'centered' | 'eyebrow' | 'minimal';
interface SectionHeadingProps {
title: string;
subtitle?: string;
/** 제목 위에 얹는 작은 라벨. eyebrow · centered 스타일에서 쓴다. */
eyebrow?: string;
variant?: HeadingStyle;
/** 제목 오른쪽에 붙는 것(경고 배지, 추가 버튼 등). */
trailing?: ReactNode;
/**
* 템플릿 색 토큰. 넘기면 제목은 text, eyebrow 는 accent 를 따른다.
*
* ★ 부제·밑줄은 일부러 중립 회색으로 남긴다 — 여기까지 토큰을 먹이면
* accent 가 밝은 템플릿에서 부제가 배경에 묻힌다.
*/
colors?: TemplateItem['colors'];
className?: string;
}
export function SectionHeading({
title,
subtitle,
eyebrow,
variant = 'underline',
trailing,
colors,
className,
}: SectionHeadingProps) {
const titleStyle = colors ? {color: colors.text} : undefined;
const eyebrowStyle = colors ? {color: colors.accent} : undefined;
if (variant === 'centered') {
return (
<div className={cn('space-y-2 text-center', className)}>
{eyebrow && (
<span
className="text-[11px] font-semibold uppercase tracking-[0.2em] text-stone-400"
style={eyebrowStyle}
>
{eyebrow}
</span>
)}
<h2
className="serif-title text-xl font-bold tracking-tight text-stone-900 sm:text-2xl"
style={titleStyle}
>
{title}
</h2>
{subtitle && <p className="text-xs text-stone-500 sm:text-sm">{subtitle}</p>}
{trailing && <div className="flex justify-center pt-1">{trailing}</div>}
</div>
);
}
if (variant === 'eyebrow') {
return (
<div className={cn('flex items-start justify-between gap-3', className)}>
<div className="space-y-1">
{eyebrow && (
<span
className="block text-[11px] font-bold uppercase tracking-wider text-amber-700"
style={eyebrowStyle}
>
{eyebrow}
</span>
)}
<h2
className="serif-title text-xl font-bold tracking-tight text-stone-900 sm:text-2xl"
style={titleStyle}
>
{title}
</h2>
{subtitle && <p className="text-xs text-stone-500">{subtitle}</p>}
</div>
{trailing}
</div>
);
}
if (variant === 'minimal') {
// 여기서 제목은 사실상 작은 라벨이라 text 가 아니라 secondary 를 쓴다.
return (
<div className={cn('flex items-baseline justify-between gap-3', className)}>
<h2
className="text-sm font-bold uppercase tracking-[0.18em] text-stone-500"
style={colors ? {color: colors.secondary} : undefined}
>
{title}
</h2>
{trailing}
</div>
);
}
// underline — 기본. 아래 실선이 섹션의 시작을 확실히 끊어준다.
return (
<div
className={cn(
'flex flex-col justify-between gap-2 border-b border-stone-200/80 pb-4 sm:flex-row sm:items-baseline',
className,
)}
>
<div>
<h2
className="serif-title text-xl font-bold tracking-tight text-stone-900 sm:text-2xl"
style={titleStyle}
>
{title}
</h2>
{subtitle && <p className="mt-0.5 text-xs text-stone-500">{subtitle}</p>}
</div>
{trailing && <div className="self-start sm:self-auto">{trailing}</div>}
</div>
);
}
@@ -0,0 +1,19 @@
/**
* 캔버스 원자 모음.
*
* 배리에이션은 여기 있는 것만 조립한다 — 원자를 늘리면 모든 배리에이션이 같이 좋아지고,
* 배리에이션 안에서 직접 마크업을 쓰기 시작하면 레이아웃마다 디테일이 갈라진다.
*/
export {SectionFrame, SectionBody} from './SectionFrame';
export {SectionHeading, type HeadingStyle} from './SectionHeading';
export {InfoRow, type InfoRowStyle} from './InfoRow';
export {HiddenFieldsNotice} from './HiddenFieldsNotice';
export {EmptyStateNotice} from './EmptyStateNotice';
export {PhotoTile, type TilePhoto} from './PhotoTile';
export {Lightbox} from './Lightbox';
export {PlaceRow, ListCard} from './PlaceRow';
export {PriceRow, type PricedItem} from './PriceRow';
export {AddressCard} from './AddressCard';
export {FeatureCard} from './FeatureCard';
export {Pill} from './Pill';
export {CtaLink, type CtaStyle} from './CtaLink';
@@ -0,0 +1,444 @@
/**
* 배리에이션 레지스트리 — "이 섹션 타입에 어떤 레이아웃들이 있나"의 단일 출처.
*
* 캔버스 렌더러와 [디자인] 탭이 같은 표를 본다. 배리에이션을 하나 추가한다는 건
* 여기 한 줄을 더한다는 뜻이고, 그 순간 캔버스와 고르는 UI가 동시에 늘어난다.
*/
import type {IndustryType, SectionItem} from '@o2o/shared';
import type {SectionVariant} from './types';
import {HeroEditorial} from './variants/hero/HeroEditorial';
import {HeroSplit} from './variants/hero/HeroSplit';
import {HeroFullBleed} from './variants/hero/HeroFullBleed';
import {HeroTypeOnly} from './variants/hero/HeroTypeOnly';
import {IntroStory} from './variants/intro/IntroStory';
import {IntroCentered} from './variants/intro/IntroCentered';
import {IntroSideBySide} from './variants/intro/IntroSideBySide';
import {InfoTable} from './variants/info/InfoTable';
import {InfoCards} from './variants/info/InfoCards';
import {InfoInline} from './variants/info/InfoInline';
import {PhotosGrid} from './variants/photos/PhotosGrid';
import {PhotosMasonry} from './variants/photos/PhotosMasonry';
import {PhotosCarousel} from './variants/photos/PhotosCarousel';
import {PhotosWithVideos} from './variants/photos/PhotosWithVideos';
import {MapDetailed} from './variants/map/MapDetailed';
import {MapCompact} from './variants/map/MapCompact';
import {LocalFull} from './variants/local/LocalFull';
import {LocalTabs} from './variants/local/LocalTabs';
import {LocalCompact} from './variants/local/LocalCompact';
import {WeatherSection} from './variants/weather/WeatherSection';
import {FaqAccordion} from './variants/faq/FaqAccordion';
import {FaqOpenList} from './variants/faq/FaqOpenList';
import {FaqTwoColumn} from './variants/faq/FaqTwoColumn';
import {RoomsCarousel} from './variants/rooms/RoomsCarousel';
import {RoomsGrid} from './variants/rooms/RoomsGrid';
import {RoomsList} from './variants/rooms/RoomsList';
import {RulesList} from './variants/rules/RulesList';
import {RulesCards} from './variants/rules/RulesCards';
import {BookingCard} from './variants/booking/BookingCard';
import {BookingBanner} from './variants/booking/BookingBanner';
import {MenuList} from './variants/menu/MenuList';
import {MenuGrid} from './variants/menu/MenuGrid';
import {MenuPriceTable} from './variants/menu/MenuPriceTable';
import {SpaceZones} from './variants/space/SpaceZones';
import {SpaceList} from './variants/space/SpaceList';
import {InquiryCta} from './variants/inquiry/InquiryCta';
import {InquiryForm} from './variants/inquiry/InquiryForm';
import {ProgramsCards} from './variants/programs/ProgramsCards';
import {ProgramsTable} from './variants/programs/ProgramsTable';
import {ExhibitionGallery} from './variants/exhibition/ExhibitionGallery';
import {ExhibitionNotice} from './variants/exhibition/ExhibitionNotice';
export const SECTION_VARIANTS: Record<string, SectionVariant[]> = {
hero: [
{
id: 'hero.editorial',
name: '에디토리얼',
description: '상호 바 + 큰 사진 + 가운데 문구. 분위기부터 보여준다.',
thumb: 'fullbleed',
Component: HeroEditorial,
isDefault: true,
},
{
id: 'hero.split',
name: '좌우 분할',
description: '왼쪽 글 · 오른쪽 사진. 무엇을 파는 곳인지 글로 먼저 읽힌다.',
thumb: 'split',
Component: HeroSplit,
},
{
id: 'hero.full-bleed',
name: '풀스크린 사진',
description: '사진을 화면 끝까지. 사진 한 장의 힘이 강할 때.',
thumb: 'fullbleed',
Component: HeroFullBleed,
},
{
id: 'hero.type-only',
name: '타이포 중심',
description: '사진 없이 여백과 글자만. 쓸 사진이 없거나 조용한 인상을 원할 때.',
thumb: 'centered',
Component: HeroTypeOnly,
},
],
intro: [
{
id: 'intro.story',
name: '스토리',
description: '넓은 사진 아래로 문단이 흐르는 잡지식 구성.',
thumb: 'stack',
Component: IntroStory,
isDefault: true,
},
{
id: 'intro.centered',
name: '가운데 정렬',
description: '짧은 문단 하나. 가장 조용하고 짧다.',
thumb: 'centered',
Component: IntroCentered,
},
{
id: 'intro.side-by-side',
name: '사진 옆 글',
description: '세로 사진 옆에 문단과 특징 목록.',
thumb: 'split',
Component: IntroSideBySide,
},
],
info: [
{
id: 'info.table',
name: '표',
description: '라벨과 값을 선으로 나눈다. 항목이 많아도 안 흔들린다.',
thumb: 'table',
Component: InfoTable,
isDefault: true,
},
{
id: 'info.cards',
name: '카드',
description: '항목마다 한 장. 모바일에서 훑기 좋다.',
thumb: 'cards',
Component: InfoCards,
},
{
id: 'info.inline',
name: '한 줄 요약',
description: '값들을 이어 붙여 가장 좁게. 정보가 적을 때.',
thumb: 'compact',
Component: InfoInline,
},
],
photos: [
{
id: 'photos.grid',
name: '정사각 격자',
description: '같은 크기로 정렬. 장수가 많을수록 정돈돼 보인다.',
thumb: 'grid',
Component: PhotosGrid,
isDefault: true,
},
{
id: 'photos.masonry',
name: '벽돌쌓기',
description: '원본 비율 그대로 어긋나게. 사진을 잘라내지 않는다.',
thumb: 'masonry',
Component: PhotosMasonry,
},
{
id: 'photos.carousel',
name: '가로 슬라이드',
description: '큰 사진을 한 장씩. 장수가 적고 한 장이 좋을 때.',
thumb: 'carousel',
Component: PhotosCarousel,
},
{
id: 'photos.with-videos',
name: '사진 + 영상',
description: '격자 갤러리 아래 YouTube 영상까지. 영상이 더 잘 팔릴 때.',
thumb: 'stack',
Component: PhotosWithVideos,
},
],
map: [
{
id: 'map.detailed',
name: '상세 안내',
description: '주소 + 거점별 소요시간 표 + 주차/충전. 차로 오는 손님이 많을 때.',
thumb: 'table',
Component: MapDetailed,
isDefault: true,
},
{
id: 'map.compact',
name: '주소만',
description: '주소 한 줄과 길찾기 버튼. 도심처럼 찾기 쉬운 곳.',
thumb: 'compact',
Component: MapCompact,
},
],
local: [
{
id: 'local.full',
name: '전체',
description: '날씨 + 맛집 + 명소 + 축제를 전부 세로로.',
thumb: 'stack',
Component: LocalFull,
isDefault: true,
},
{
id: 'local.tabs',
name: '탭 전환',
description: '맛집/명소/축제를 탭으로. 화면 길이를 1/3 로 줄인다.',
thumb: 'accordion',
Component: LocalTabs,
},
{
id: 'local.compact',
name: '요약',
description: '날씨 한 줄과 추천 6곳만. 주인공이 아닐 때.',
thumb: 'compact',
Component: LocalCompact,
},
],
weather: [
{
id: 'weather.card',
name: '날씨 카드',
description: '현재 기온과 날씨 상태, 추천 문구를 한 장에 보여준다.',
thumb: 'compact',
Component: WeatherSection,
isDefault: true,
},
],
faq: [
{
id: 'faq.accordion',
name: '아코디언',
description: '질문만 보이고 누르면 답이 열린다. 화면이 짧다.',
thumb: 'accordion',
Component: FaqAccordion,
isDefault: true,
},
{
id: 'faq.open-list',
name: '펼친 목록',
description: '답까지 전부 열어 둔다. 훑고 지나가게 하고 싶을 때.',
thumb: 'list',
Component: FaqOpenList,
},
{
id: 'faq.two-column',
name: '2단',
description: '넓은 화면에서 두 줄씩. 세로 길이가 반으로 준다.',
thumb: 'two-column',
Component: FaqTwoColumn,
},
],
rooms: [
{
id: 'rooms.carousel',
name: '가로 슬라이드',
description: '모바일에서 한 칸씩 스와이프. 객실 2~4개일 때 자연스럽다.',
thumb: 'carousel',
Component: RoomsCarousel,
isDefault: true,
},
{
id: 'rooms.grid',
name: '격자',
description: '전부 한눈에. 객실이 많고 비교해서 고르게 할 때.',
thumb: 'cards',
Component: RoomsGrid,
},
{
id: 'rooms.list',
name: '가로 목록',
description: '사진 왼쪽 · 설명 오른쪽. 객실 설명이 길 때.',
thumb: 'list',
Component: RoomsList,
},
],
rules: [
{
id: 'rules.list',
name: '목록',
description: '한 덩어리로 짧게. 가장 눈에 덜 띈다.',
thumb: 'compact',
Component: RulesList,
isDefault: true,
},
{
id: 'rules.cards',
name: '번호 카드',
description: '규정 하나에 칸 하나. 클레임이 잦은 곳에.',
thumb: 'cards',
Component: RulesCards,
},
],
booking: [
{
id: 'booking.card',
name: '안내 카드',
description: '가운데 놓인 조용한 카드. 흐름을 끊지 않는다.',
thumb: 'centered',
Component: BookingCard,
isDefault: true,
},
{
id: 'booking.banner',
name: '띠배너',
description: '브랜드 색으로 화면을 가로지르는 강한 유도.',
thumb: 'banner',
Component: BookingBanner,
},
],
menu: [
{
id: 'menu.list',
name: '메뉴판',
description: '이름과 가격을 한 줄씩. 종이 메뉴판처럼.',
thumb: 'list',
Component: MenuList,
isDefault: true,
},
{
id: 'menu.grid',
name: '카드 격자',
description: '설명을 넉넉히. 시그니처가 몇 개뿐일 때.',
thumb: 'cards',
Component: MenuGrid,
},
{
id: 'menu.price-table',
name: '가격표',
description: '점선으로 이름과 가격만. 품목이 많을 때.',
thumb: 'table',
Component: MenuPriceTable,
},
],
space: [
{
id: 'space.zones',
name: '구역 카드',
description: '사진과 함께 자리별로. 좌석 구성이 궁금한 곳에.',
thumb: 'cards',
Component: SpaceZones,
isDefault: true,
},
{
id: 'space.list',
name: '목록',
description: '사진 없이 이름과 설명만. 사진이 부실할 때.',
thumb: 'list',
Component: SpaceList,
},
],
inquiry: [
{
id: 'inquiry.cta',
name: '연락 카드',
description: '전화 · 카카오로 바로. 폼을 받을 준비가 안 됐을 때.',
thumb: 'centered',
Component: InquiryCta,
isDefault: true,
},
{
id: 'inquiry.form',
name: '문의 양식',
description: '인원 · 일정 · 연락처를 받는 신청서.',
thumb: 'form',
Component: InquiryForm,
},
],
programs: [
{
id: 'programs.cards',
name: '카드',
description: '소요시간 · 대상까지 한 장씩. 처음 오는 손님이 고르기 쉽다.',
thumb: 'cards',
Component: ProgramsCards,
isDefault: true,
},
{
id: 'programs.table',
name: '비교표',
description: '시간 · 대상 · 가격을 열로. 조건을 견줘 고르는 곳에.',
thumb: 'table',
Component: ProgramsTable,
},
],
exhibition: [
{
id: 'exhibition.gallery',
name: '전시 갤러리',
description: '전시 사진을 크게 깔고 관람 정보를 붙인다.',
thumb: 'grid',
Component: ExhibitionGallery,
isDefault: true,
},
{
id: 'exhibition.notice',
name: '관람 공지',
description: '사진 없이 안내 문구만. 일정이 자주 바뀌는 곳에.',
thumb: 'timeline',
Component: ExhibitionNotice,
},
],
};
/** 그 업종에서 고를 수 있는 배리에이션. 업종 제한이 걸린 건 걸러낸다. */
export function variantsFor(sectionType: string, industry: IndustryType): SectionVariant[] {
const all = SECTION_VARIANTS[sectionType] ?? [];
return all.filter((v) => !v.industries || v.industries.includes(industry));
}
/** 그 타입의 기본 배리에이션. isDefault 가 없으면 첫 번째. */
export function defaultVariant(sectionType: string): SectionVariant | undefined {
const all = SECTION_VARIANTS[sectionType] ?? [];
return all.find((v) => v.isDefault) ?? all[0];
}
/**
* 실제로 그릴 배리에이션.
*
* 저장된 variantId 가 지워졌거나(배리에이션을 뺐거나) 업종이 바뀌어 못 쓰게 됐어도
* 기본값으로 떨어진다 — 빈 화면 대신 무언가는 반드시 그린다.
*/
export function resolveVariant(
section: SectionItem,
industry: IndustryType,
): SectionVariant | undefined {
const available = variantsFor(section.type, industry);
const picked = available.find((v) => v.id === section.variantId);
return picked ?? defaultVariant(section.type);
}
@@ -0,0 +1,175 @@
/**
* 배리에이션 와이어프레임 썸네일.
*
* 사장님은 "InfoTable" 이라는 이름으로 고르지 않는다 — 모양을 보고 고른다.
* 그래서 배리에이션 카드에는 반드시 그림이 붙고, 그 그림은 여기 한 곳에서만 그린다.
*/
import type {ThumbKey} from './types';
const BOX = 'fill-stone-300';
const LINE = 'fill-stone-200';
const ACCENT = 'fill-stone-500';
/** 40×28 좌표계 위에 회색 블록으로 레이아웃 얼개만 그린다. */
const SHAPES: Record<ThumbKey, React.ReactNode> = {
fullbleed: (
<>
<rect x="0" y="0" width="40" height="28" className={BOX} />
<rect x="3" y="18" width="20" height="3" className={ACCENT} />
<rect x="3" y="23" width="12" height="2" className={LINE} />
</>
),
split: (
<>
<rect x="2" y="6" width="16" height="3" className={ACCENT} />
<rect x="2" y="12" width="14" height="2" className={LINE} />
<rect x="2" y="16" width="10" height="2" className={LINE} />
<rect x="22" y="5" width="16" height="18" className={BOX} />
</>
),
stack: (
<>
<rect x="2" y="3" width="36" height="12" className={BOX} />
<rect x="2" y="18" width="24" height="2.5" className={ACCENT} />
<rect x="2" y="22" width="34" height="2" className={LINE} />
</>
),
centered: (
<>
<rect x="14" y="5" width="12" height="2" className={LINE} />
<rect x="9" y="10" width="22" height="3" className={ACCENT} />
<rect x="6" y="17" width="28" height="2" className={LINE} />
<rect x="10" y="21" width="20" height="2" className={LINE} />
</>
),
grid: (
<>
{[2, 11, 20, 29].map((x) =>
[4, 15].map((y) => (
<rect key={`${x}-${y}`} x={x} y={y} width="8" height="8" className={BOX} />
)),
)}
</>
),
masonry: (
<>
<rect x="2" y="3" width="11" height="13" className={BOX} />
<rect x="2" y="18" width="11" height="7" className={BOX} />
<rect x="15" y="3" width="11" height="8" className={BOX} />
<rect x="15" y="13" width="11" height="12" className={BOX} />
<rect x="28" y="3" width="10" height="14" className={BOX} />
<rect x="28" y="19" width="10" height="6" className={BOX} />
</>
),
carousel: (
<>
<rect x="1" y="6" width="6" height="14" className={LINE} />
<rect x="9" y="4" width="22" height="18" className={BOX} />
<rect x="33" y="6" width="6" height="14" className={LINE} />
<rect x="17" y="24" width="6" height="1.5" className={ACCENT} />
</>
),
list: (
<>
{[3, 11, 19].map((y) => (
<g key={y}>
<rect x="2" y={y} width="9" height="6" className={BOX} />
<rect x="13" y={y + 1} width="16" height="2" className={ACCENT} />
<rect x="13" y={y + 4} width="22" height="1.5" className={LINE} />
</g>
))}
</>
),
table: (
<>
<rect x="2" y="3" width="36" height="4" className={ACCENT} />
{[9, 14, 19, 24].map((y) => (
<g key={y}>
<rect x="2" y={y} width="14" height="2" className={LINE} />
<rect x="20" y={y} width="18" height="2" className={LINE} />
</g>
))}
</>
),
cards: (
<>
{[2, 21].map((x) =>
[3, 15].map((y) => (
<g key={`${x}-${y}`}>
<rect x={x} y={y} width="17" height="9" className={LINE} />
<rect x={x + 2} y={y + 2} width="9" height="2" className={ACCENT} />
<rect x={x + 2} y={y + 5.5} width="13" height="1.5" className={BOX} />
</g>
)),
)}
</>
),
accordion: (
<>
<rect x="2" y="3" width="36" height="4" className={ACCENT} />
<rect x="2" y="9" width="36" height="7" className={LINE} />
<rect x="2" y="18" width="36" height="4" className={ACCENT} />
<rect x="2" y="24" width="36" height="2" className={LINE} />
</>
),
'two-column': (
<>
{[2, 21].map((x) => (
<g key={x}>
<rect x={x} y="4" width="17" height="2.5" className={ACCENT} />
<rect x={x} y="8.5" width="15" height="1.5" className={LINE} />
<rect x={x} y="15" width="17" height="2.5" className={ACCENT} />
<rect x={x} y="19.5" width="15" height="1.5" className={LINE} />
</g>
))}
</>
),
banner: (
<>
<rect x="0" y="8" width="40" height="12" className={ACCENT} />
<rect x="4" y="11" width="16" height="2.5" className="fill-white/80" />
<rect x="26" y="11" width="10" height="5" className="fill-white/90" />
</>
),
form: (
<>
<rect x="2" y="3" width="20" height="2.5" className={ACCENT} />
<rect x="2" y="8" width="17" height="4" className={LINE} />
<rect x="21" y="8" width="17" height="4" className={LINE} />
<rect x="2" y="14" width="36" height="6" className={LINE} />
<rect x="2" y="22" width="36" height="4" className={ACCENT} />
</>
),
timeline: (
<>
<rect x="5" y="3" width="1.5" height="22" className={LINE} />
{[4, 12, 20].map((y) => (
<g key={y}>
<circle cx="5.75" cy={y + 1.5} r="2" className={ACCENT} />
<rect x="11" y={y} width="14" height="2" className={ACCENT} />
<rect x="11" y={y + 3.5} width="24" height="1.5" className={LINE} />
</g>
))}
</>
),
compact: (
<>
<rect x="2" y="8" width="12" height="2.5" className={ACCENT} />
<rect x="2" y="13" width="36" height="6" className={LINE} />
</>
),
};
export function VariantThumb({thumb, className}: {thumb: ThumbKey; className?: string}) {
return (
<svg
viewBox="0 0 40 28"
role="presentation"
className={className}
preserveAspectRatio="xMidYMid meet"
>
<rect x="0" y="0" width="40" height="28" className="fill-white" />
{SHAPES[thumb]}
</svg>
);
}
@@ -0,0 +1,76 @@
/**
* 캔버스 배리에이션 계약.
*
* 섹션 하나 = "무엇을 보여줄지"(데이터) + "어떻게 보여줄지"(배리에이션).
* 데이터는 이 props 로 고정하고, 배리에이션만 갈아끼운다 —
* 그래야 사장님이 레이아웃을 바꿔도 내용이 날아가지 않는다.
*/
import type {ComponentType, ReactNode} from 'react';
import type {
IndustryType,
InfoField,
PhotoItem,
SectionItem,
TemplateItem,
} from '@o2o/shared';
import type {WeatherLocation} from '@/stores/builder';
/** 모든 배리에이션이 동일하게 받는 입력. 배리에이션은 이 밖의 것을 요구하지 않는다. */
export interface SectionRenderProps {
/** 섹션 메타(id · type · name · variantId). 프레임의 앵커 id 와 배지 라벨이 여기서 나온다. */
section: SectionItem;
industryId: IndustryType;
storeName: string;
location: string;
weatherLocation?: WeatherLocation;
template: TemplateItem;
infoFields: InfoField[];
photos: PhotoItem[];
/** 에디터에서 선택된 섹션인가(미리보기 모드면 항상 false). */
isSelected: boolean;
onSelect: () => void;
}
export type SectionVariantComponent = ComponentType<SectionRenderProps>;
/** 디자인 탭이 카드로 그리는 배리에이션 한 칸. */
export interface SectionVariant {
/** 전역 유일. `<sectionType>.<slug>` 규칙 — 저장된 값이 어느 섹션 것인지 눈으로 읽힌다. */
id: string;
/** 사장님에게 보이는 이름. 개발 용어 말고 "왼쪽 사진 · 오른쪽 글" 같은 말로 쓴다. */
name: string;
/** 언제 이걸 고르면 좋은지 한 줄. */
description: string;
/** 와이어프레임 썸네일 키(`thumbs.tsx`). 글보다 그림이 빨리 읽힌다. */
thumb: ThumbKey;
Component: SectionVariantComponent;
/** 특정 업종에서만 의미 있는 배리에이션이면 여기로 좁힌다. 비우면 전 업종 공통. */
industries?: IndustryType[];
/** '기본'으로 표시할 배리에이션. 타입당 하나. */
isDefault?: boolean;
}
export type ThumbKey =
| 'fullbleed'
| 'split'
| 'stack'
| 'centered'
| 'grid'
| 'masonry'
| 'carousel'
| 'list'
| 'table'
| 'cards'
| 'accordion'
| 'two-column'
| 'banner'
| 'form'
| 'timeline'
| 'compact';
/** 섹션 프레임의 배경 톤. 배리에이션마다 다른 톤을 골라 리듬을 만든다. */
export type SectionTone = 'paper' | 'white' | 'tint' | 'dark';
export interface SectionFrameSlots {
children: ReactNode;
}
@@ -0,0 +1,36 @@
/**
* 예약 · 띠배너 — 브랜드 색으로 화면을 가로지르는 강한 전환 유도.
* 예약이 유일한 목표인 사이트에 맞는다(대신 자주 쓰면 광고처럼 보인다).
*/
import {Calendar} from 'lucide-react';
import {CtaLink, SectionFrame} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {bookingHref} from '../common';
export function BookingBanner(props: SectionRenderProps) {
const {section, isSelected, onSelect, industryId, storeName, template} = props;
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} padded={false}>
<div className="px-4 py-10 sm:px-6 sm:py-14" style={{backgroundColor: template.colors.primary}}>
<div className="mx-auto flex max-w-[880px] flex-col items-center justify-between gap-5 text-center sm:flex-row sm:text-left">
<div className="space-y-1.5 text-white">
<h3 className="serif-title text-lg font-bold sm:text-2xl">
{section.name}
</h3>
<p className="text-xs opacity-90 sm:text-sm">
{section.body || section.description || `${storeName} · 실시간 캘린더에서 남은 날짜를 확인할 수 있습니다`}
</p>
</div>
<div className="flex shrink-0 items-center gap-2">
<CtaLink href={bookingHref(industryId, storeName)} variant="pill">
<Calendar className="size-3.5" />
<span>예약 캘린더</span>
</CtaLink>
</div>
</div>
</div>
</SectionFrame>
);
}
@@ -0,0 +1,36 @@
/**
* 예약 · 카드 — 가운데 놓인 조용한 안내 카드. 다른 섹션의 흐름을 끊지 않는다.
*/
import {Calendar} from 'lucide-react';
import {CtaLink, SectionBody, SectionFrame, SectionHeading} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {bookingHref} from '../common';
export function BookingCard(props: SectionRenderProps) {
const {section, isSelected, onSelect, industryId, storeName, template} = props;
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="white">
<SectionBody>
<SectionHeading title={section.name} subtitle={section.description} colors={template.colors} />
<div className="mx-auto max-w-lg space-y-3 rounded-xl border border-stone-200/80 bg-white p-6 text-center shadow-2xs">
<h4 className="text-sm font-bold text-stone-900" style={{color: template.colors.text}}>
네이버 실시간 온라인 예약
</h4>
<p className="text-xs text-stone-500">
{section.body || '원하시는 날짜와 객실을 선택하여 캘린더에서 바로 확정 예약하실 수 있습니다.'}
</p>
<CtaLink
href={bookingHref(industryId, storeName)}
variant="solid"
colors={template.colors}
>
<Calendar className="size-3.5" />
<span>네이버 예약 캘린더 열기</span>
</CtaLink>
</div>
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,101 @@
/**
* 배리에이션들이 공유하는 데이터 갈무리.
*
* "어떤 사진을 대표로 쓰나 / 예약 링크는 어디로 가나" 같은 판단은 레이아웃과 무관하다.
* 배리에이션마다 따로 정하면 같은 섹션인데 배리에이션을 바꾼 순간 링크가 달라진다.
*
* ★ 시연용 폴백은 없다.
* 한때 이 파일은 달빛스테이(숙박 시연 세트)와 업종 시드 문구를 폴백으로 들고 있었고,
* `demoOnly()` 게이트가 "실사업장에서만" 그걸 껐다. 그 구조 자체를 걷어냈다 —
* 게이트가 한 곳이라도 빠지면 남의 가게 사진·전화번호·메뉴가 사장님 화면에 뜨고,
* 사장님은 그게 자기 가게 내용인 줄 알고 그대로 발행한다.
* 값이 없으면 **아무것도 그리지 않는다.** 발행 사이트(solution/site)와 같은 규칙이다.
*/
import type {IndustryType, InfoField, PhotoItem} from '@o2o/shared';
import {INDUSTRY_CONFIGS} from '@/data/industryData';
import type {TilePhoto} from '../primitives';
/** 화면에 찍히는 "언제 기준" 표기. 발행 사이트에서는 payload 의 updatedAt 이 이 자리를 대신한다. */
export const TODAY_KO = new Date().toLocaleDateString('ko-KR', {
year: 'numeric',
month: 'long',
day: 'numeric',
});
/**
* 업종 설정(섹션 목록 · 템플릿 · 채널).
*
* ★ 여기에는 **구조만** 남아 있다. 문구·메뉴·FAQ 같은 콘텐츠 시드는 전부 지웠다 —
* 가공의 가게 이름이 박힌 문장("포레스트 힐은 산자락 아래…")이 실사업장 화면에
* 자기 소개문처럼 떴기 때문이다. 콘텐츠는 서버(fact·unit·faq)만 소유한다.
*/
export function industryConfig(industryId: IndustryType) {
return INDUSTRY_CONFIGS[industryId];
}
/**
* 소개 문구.
*
* 수집·생성된 `intro` fact 만 쓴다. 없으면 빈 값을 돌려주고, 부르는 쪽이
* "아직 소개문이 없습니다"를 그린다 — 남의 문장으로 자리를 메우지 않는다.
*/
export function introParagraph(_industryId: IndustryType, infoFields: InfoField[]): string {
const collected = infoFields.find((f) => f.id === 'intro' || f.id === 'room_intro');
return collected?.value?.trim() ?? '';
}
/**
* 이용 규정으로 읽히는 fact 들. 순서가 곧 화면 순서다.
*
* ★ 스키마에 있는 key 만 적는다. 여기 없는 규정은 만들지 않는다 —
* 예전에는 '체크인 16:00 / 체크아웃 11:00' 같은 가공의 규정이 상수로 박혀 있어
* 모든 사업장 화면에 똑같이 떴다. 사장님은 그게 자기 규정인 줄 알고 발행했다.
*/
const RULE_FIELD_IDS = [
'check_in_time',
'check_out_time',
'cancel_policy',
'cooking_allowed',
'pet_allowed',
'smoking',
'extra_person_fee',
];
/** 확인된 fact 에서만 이용 규정 줄을 만든다. 없으면 빈 목록 — 부르는 쪽이 빈 상태를 그린다. */
export function ruleItems(infoFields: InfoField[]): string[] {
return RULE_FIELD_IDS.map((id) => infoFields.find((f) => f.id === id))
.filter((f): f is InfoField => Boolean(f?.value?.trim()))
.map((f) => `${f.label}: ${f.value.trim()}`);
}
/** 대표 사진. 지정이 없으면 첫 장으로 떨어진다 — 히어로가 빈 채로 나가지 않게. */
export function primaryPhoto(photos: PhotoItem[]) {
return photos.find((p) => p.isPrimary) ?? photos[0];
}
/** 수집된 사진(props)을 갤러리 타일 모양으로. 캡션은 사진 제목을 그대로 쓴다. */
function toTiles(photos: PhotoItem[]): TilePhoto[] {
return photos.map((p) => ({
id: p.id,
url: p.url,
alt: p.title,
caption: p.title,
category: p.category,
}));
}
/** 갤러리에 깔 사진 — 수집된 것만. 없으면 빈 목록이고, 부르는 쪽이 빈 상태를 그린다. */
export function galleryPhotos(_industryId: IndustryType, photos: PhotoItem[]): TilePhoto[] {
return toTiles(photos.filter((photo) => photo.isVisible !== false));
}
/**
* 예약 버튼이 향할 곳.
*
* ★ 실사업장의 예약 채널(place_links)은 SectionRenderProps 로 흘러오지 않는다.
* 그래서 상호 검색으로 떨어뜨린다 — 시연용 예약 링크를 붙이는 것보다 안전하다.
* (확정된 링크를 쓰려면 계약에 채널 URL 을 얹어야 한다.)
*/
export function bookingHref(_industryId: IndustryType, storeName: string) {
return `https://search.naver.com/search.naver?query=${encodeURIComponent(storeName)}`;
}
@@ -0,0 +1,57 @@
/**
* 관람 안내 · 갤러리 — 전시 사진을 크게 깔고 관람 정보를 옆에 붙인다.
*/
import {Clock, Ticket} from 'lucide-react';
import {
FeatureCard,
PhotoTile,
SectionBody,
SectionFrame,
SectionHeading,
} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {galleryPhotos} from '../common';
export function ExhibitionGallery(props: SectionRenderProps) {
const {section, isSelected, onSelect, industryId, template, photos, infoFields} = props;
const items = galleryPhotos(industryId, photos).slice(0, 4);
const hours = infoFields.find((f) => f.id === 'operating_hours');
const fee = infoFields.find((f) => f.id === 'admission' || f.id === 'price_range');
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="white">
<SectionBody>
<SectionHeading
title={section.name}
subtitle={section.description}
colors={template.colors}
/>
<div className="grid grid-cols-2 gap-2.5 sm:gap-3">
{items.map((photo) => (
<PhotoTile key={photo.id} photo={photo} fit="landscape" />
))}
</div>
<div className="grid grid-cols-1 gap-3 sm:grid-cols-2">
{hours && (
<FeatureCard
icon={Clock}
title="관람 시간"
description={hours.value}
colors={template.colors}
/>
)}
{fee && (
<FeatureCard
icon={Ticket}
title="관람료"
description={fee.value}
colors={template.colors}
/>
)}
</div>
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,44 @@
/**
* 관람 안내 · 공지 — 사진 없이 안내 문구만. 전시 일정이 자주 바뀌는 곳에 부담이 적다.
*/
import {Info} from 'lucide-react';
import {SectionBody, SectionFrame, SectionHeading} from '../../primitives';
import type {SectionRenderProps} from '../../types';
export function ExhibitionNotice(props: SectionRenderProps) {
const {section, isSelected, onSelect, storeName, template, infoFields} = props;
const notices = infoFields
.filter((f) => !f.requiresVerification || f.isVerified)
.slice(0, 4);
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="paper">
<SectionBody width="narrow">
<SectionHeading
variant="eyebrow"
eyebrow="NOTICE"
title={section.name}
trailing={<Info className="size-5 text-stone-400" />}
colors={template.colors}
/>
<div className="space-y-3 rounded-2xl border border-stone-200/80 bg-white p-5 shadow-2xs">
<p className="text-xs leading-relaxed text-stone-600">
{section.body || `${storeName}의 상설 전시와 아트숍은 별도 예약 없이 관람하실 수 있습니다. 기획 전시 일정은 변경될 수 있으니 방문 전 확인해 주세요.`}
</p>
<dl className="space-y-2 border-t border-stone-100 pt-3">
{notices.map((field) => (
<div key={field.id} className="flex gap-3 text-xs">
<dt className="w-20 shrink-0 font-semibold text-stone-400">{field.label}</dt>
<dd className="font-medium text-stone-800" style={{color: template.colors.text}}>
{field.value}
</dd>
</div>
))}
</dl>
</div>
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,68 @@
/**
* FAQ · 아코디언 — 질문만 보이고 누르면 답이 열린다. 항목이 많아도 화면이 짧다.
*/
import {useState} from 'react';
import {ChevronDown, ChevronUp} from 'lucide-react';
import {ListCard, SectionBody, SectionFrame, SectionHeading} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {faqEntries} from './useFaqList';
export function FaqAccordion(props: SectionRenderProps) {
const {section, isSelected, onSelect, industryId, template} = props;
const faqs = faqEntries(industryId);
const [openIdx, setOpenIdx] = useState<number | null>(0);
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="paper">
<SectionBody>
<SectionHeading
title={section.name}
subtitle={section.description}
colors={template.colors}
/>
<ListCard>
{faqs.map((faq, idx) => {
const isOpen = openIdx === idx;
return (
<div key={faq.question}>
<button
type="button"
onClick={(e) => {
e.stopPropagation();
setOpenIdx(isOpen ? null : idx);
}}
aria-expanded={isOpen}
style={{color: template.colors.text}}
className="flex w-full cursor-pointer items-center justify-between gap-3 p-4 text-left text-xs font-bold text-stone-900 hover:bg-stone-50 sm:text-sm"
>
<span className="flex items-center gap-2.5">
<span
className="serif-title font-normal text-stone-400"
style={{color: template.colors.accent}}
>
Q.
</span>
<span>{faq.question}</span>
</span>
{isOpen ? (
<ChevronUp className="size-4 shrink-0 text-stone-400" />
) : (
<ChevronDown className="size-4 shrink-0 text-stone-400" />
)}
</button>
{isOpen && (
<div className="border-t border-stone-50 bg-stone-50/40 px-4 pb-4 pt-1 text-xs leading-relaxed text-stone-600 sm:text-sm">
{faq.answer}
</div>
)}
</div>
);
})}
</ListCard>
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,50 @@
/**
* FAQ · 펼친 목록 — 질문과 답을 모두 열어 둔다.
* 손님이 클릭 없이 훑고 지나가게 하고 싶을 때(검색 노출에도 유리하다).
*/
import {SectionBody, SectionFrame, SectionHeading} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {faqEntries} from './useFaqList';
export function FaqOpenList(props: SectionRenderProps) {
const {section, isSelected, onSelect, industryId, template} = props;
const faqs = faqEntries(industryId);
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="paper">
<SectionBody>
<SectionHeading
title={section.name}
subtitle={section.description}
colors={template.colors}
/>
<dl className="space-y-4">
{faqs.map((faq) => (
<div
key={faq.question}
className="space-y-1.5 rounded-xl border border-stone-200/80 bg-white p-4 shadow-2xs"
>
<dt
className="flex items-start gap-2 text-xs font-bold text-stone-900 sm:text-sm"
style={{color: template.colors.text}}
>
<span
className="serif-title font-normal text-stone-400"
style={{color: template.colors.accent}}
>
Q.
</span>
<span>{faq.question}</span>
</dt>
<dd className="flex items-start gap-2 text-xs leading-relaxed text-stone-600 sm:text-sm">
<span className="serif-title font-normal text-stone-300">A.</span>
<span>{faq.answer}</span>
</dd>
</div>
))}
</dl>
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,39 @@
/**
* FAQ · 2단 — 넓은 화면에서 두 줄씩 나눠 세로 길이를 반으로 줄인다.
*/
import {SectionBody, SectionFrame, SectionHeading} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {faqEntries} from './useFaqList';
export function FaqTwoColumn(props: SectionRenderProps) {
const {section, isSelected, onSelect, industryId, template} = props;
const faqs = faqEntries(industryId);
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="white">
<SectionBody width="wide">
<SectionHeading
variant="centered"
eyebrow="FAQ"
title={section.name}
subtitle={section.description}
colors={template.colors}
/>
<dl className="grid grid-cols-1 gap-x-8 gap-y-5 md:grid-cols-2">
{faqs.map((faq) => (
<div key={faq.question} className="space-y-1.5 border-t border-stone-200/80 pt-4">
<dt
className="text-xs font-bold text-stone-900 sm:text-sm"
style={{color: template.colors.text}}
>
{faq.question}
</dt>
<dd className="text-xs leading-relaxed text-stone-600">{faq.answer}</dd>
</div>
))}
</dl>
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,24 @@
import type {IndustryType} from '@o2o/shared';
export interface FaqEntry {
question: string;
answer: string;
}
/**
* FAQ 원본.
*
* ★ 지금은 항상 빈 목록이다. 캔버스 계약(SectionRenderProps)에 FAQ 가 없기 때문이다 —
* 에디터는 구조적으로 실제 FAQ 를 받을 창구가 없다.
*
* ★ 업종 시드 FAQ 를 폴백으로 쓰던 코드를 걷어냈다. 그 안에는 가공의 값이 가격까지 붙어 있었고
* ("숯과 그릴 세트(25,000원)", "기준 2인 초과 시 1인당 30,000원"), 사장님이 팔지도 않는
* 조건을 자기 사이트로 읽었다. 손님이 그 금액으로 오면 클레임이다.
*
* 진짜 FAQ 는 COPY 잡이 **확인된 fact 만 근거로** 만들고 사장님 승인을 거쳐
* 서버(fact.faqs)에 들어간다 — 그게 유일한 출처다. 캔버스로 흘려보내려면
* SectionRenderProps 에 faqs 를 얹어야 한다.
*/
export function faqEntries(_industryId: IndustryType): FaqEntry[] {
return [];
}
@@ -0,0 +1,66 @@
/**
* 히어로 · 에디토리얼 — 상단 브랜드 바 + 큰 사진 + 가운데 세리프 카피.
* 감성 숙소/공방처럼 "분위기부터 보여주고 싶은" 곳의 기본값.
*/
import {Calendar} from 'lucide-react';
import {SectionFrame} from '../../primitives';
import {CtaLink} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {bookingHref, primaryPhoto} from '../common';
export function HeroEditorial(props: SectionRenderProps) {
const {section, isSelected, onSelect, industryId, storeName, location, template, photos} = props;
const cover = primaryPhoto(photos);
// 사진이 없으면 <img> 없이 어두운 판만 남긴다 — 시연용 사진으로 자리를 메우지 않는다.
const coverUrl = cover?.url;
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} padded={false}>
<div
className="flex w-full select-none flex-col"
style={{backgroundColor: template.colors.bg}}
>
<div className="mx-auto flex w-full max-w-[1120px] items-center justify-between border-b border-stone-200/60 bg-white/90 px-4 py-4 backdrop-blur-xs sm:px-6">
<span
className="serif-title text-base font-bold uppercase tracking-widest text-stone-800 sm:text-lg"
style={{color: template.colors.text}}
>
{storeName}
</span>
</div>
<div className="relative flex h-[50vh] w-full items-center justify-center overflow-hidden bg-stone-900 sm:h-[65vh]">
{coverUrl && (
<img
src={coverUrl}
alt={storeName}
className="absolute inset-0 size-full object-cover opacity-75"
/>
)}
<div className="absolute inset-0 bg-black/45" />
<div className="relative z-10 mx-auto w-full max-w-xl space-y-4 px-6 text-center text-white">
<h1 className="serif-title text-2xl font-bold leading-tight tracking-tight drop-shadow-xs sm:text-4xl md:text-5xl">
{storeName}
</h1>
<p className="text-xs font-light tracking-wide text-stone-200 sm:text-sm md:text-base">
{section.description || location}
</p>
<div className="flex items-center justify-center gap-2 pt-2">
<CtaLink
href={bookingHref(industryId, storeName)}
variant="pill"
colors={template.colors}
>
<Calendar className="size-3.5" />
<span>실시간 예약</span>
</CtaLink>
</div>
</div>
</div>
</div>
</SectionFrame>
);
}
@@ -0,0 +1,54 @@
/**
* 히어로 · 풀블리드 — 화면을 꽉 채운 사진 위에 왼쪽 아래로 붙는 큰 타이포.
* 사진 한 장의 힘이 강한 곳(뷰 좋은 스테이, 플레이팅이 강한 다이닝)에 맞는다.
*/
import {Calendar, MapPin} from 'lucide-react';
import {CtaLink, SectionFrame} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {bookingHref, primaryPhoto} from '../common';
export function HeroFullBleed(props: SectionRenderProps) {
const {section, isSelected, onSelect, industryId, storeName, location, template, photos} = props;
const cover = primaryPhoto(photos);
// 사진이 없으면 <img> 를 아예 렌더하지 않고 어두운 배경만 남긴다.
const coverUrl = cover?.url;
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} padded={false}>
<div className="relative h-[62vh] min-h-[380px] w-full select-none overflow-hidden bg-stone-900 sm:h-[78vh]">
{coverUrl && (
<img
src={coverUrl}
alt={storeName}
className="absolute inset-0 size-full object-cover"
/>
)}
<div className="absolute inset-0 bg-gradient-to-t from-black/85 via-black/25 to-black/10" />
<div className="absolute inset-x-0 bottom-0 px-6 pb-10 sm:px-10 sm:pb-14">
<div className="mx-auto max-w-[1120px] space-y-3 text-white">
<span className="inline-flex items-center gap-1.5 rounded-full border border-white/25 bg-white/10 px-3 py-1 text-[11px] font-medium backdrop-blur-xs">
<MapPin className="size-3" />
{section.description || location}
</span>
<h1 className="serif-title max-w-2xl text-3xl font-bold leading-[1.15] tracking-tight drop-shadow-sm sm:text-5xl md:text-6xl">
{storeName}
</h1>
<div className="flex flex-wrap items-center gap-2 pt-2">
<CtaLink
href={bookingHref(industryId, storeName)}
variant="brand"
colors={template.colors}
>
<Calendar className="size-3.5" />
<span>지금 예약하기</span>
</CtaLink>
</div>
</div>
</div>
</div>
</SectionFrame>
);
}
@@ -0,0 +1,50 @@
/**
* 히어로 · 좌우 분할 — 왼쪽 글, 오른쪽 사진.
* 첫 화면에서 "무엇을 파는 곳인지"를 글로 먼저 읽혀야 하는 업종에 맞는다.
*/
import {SectionFrame} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {industryConfig, primaryPhoto} from '../common';
export function HeroSplit(props: SectionRenderProps) {
const {section, isSelected, onSelect, industryId, storeName, location, template, photos} = props;
const config = industryConfig(industryId);
const cover = primaryPhoto(photos);
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} padded={false}>
<div className="p-6 sm:p-10" style={{backgroundColor: template.colors.bg}}>
<div className="mx-auto grid max-w-4xl grid-cols-1 items-center gap-6 md:grid-cols-12">
<div className="space-y-4 md:col-span-7">
<span
className="inline-flex items-center gap-2 rounded px-2.5 py-1 text-xs font-semibold"
style={{
backgroundColor: `${template.colors.primary}12`,
color: template.colors.primary,
}}
>
<span
className="size-1.5 rounded-full"
style={{backgroundColor: template.colors.primary}}
/>
{section.description || `${config.name} · ${location}`}
</span>
<h1
className="text-2xl font-extrabold leading-tight tracking-tight sm:text-4xl"
style={{color: template.colors.text}}
>
{storeName}
</h1>
</div>
<div className="md:col-span-5">
<div className="relative aspect-4/3 overflow-hidden rounded-lg border border-slate-200/60 shadow-xs">
<img src={cover?.url} alt={storeName} className="size-full object-cover" />
</div>
</div>
</div>
</div>
</SectionFrame>
);
}
@@ -0,0 +1,47 @@
/**
* 히어로 · 타이포 중심 — 사진 없이 여백과 글자만.
* 쓸 만한 사진이 아직 없거나, 조용한 인상을 주고 싶을 때 고른다.
*/
import {ArrowUpRight} from 'lucide-react';
import {CtaLink, SectionFrame} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {bookingHref, industryConfig} from '../common';
export function HeroTypeOnly(props: SectionRenderProps) {
const {section, isSelected, onSelect, industryId, storeName, location, template} = props;
const config = industryConfig(industryId);
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} padded={false}>
<div
className="px-6 py-20 sm:px-10 sm:py-28"
style={{backgroundColor: template.colors.bg}}
>
<div className="mx-auto max-w-2xl space-y-6 text-center">
<span
className="text-[11px] font-semibold uppercase tracking-[0.35em]"
style={{color: template.colors.accent}}
>
{section.description || `${config.name} · ${location}`}
</span>
<h1
className="serif-title text-3xl font-bold leading-[1.2] tracking-tight sm:text-5xl"
style={{color: template.colors.text}}
>
{storeName}
</h1>
<div className="mx-auto h-px w-12" style={{backgroundColor: template.colors.primary}} />
<div className="flex justify-center pt-2">
<CtaLink href={bookingHref(industryId, storeName)} variant="outline">
<span>{storeName} 둘러보기</span>
<ArrowUpRight className="size-3.5" />
</CtaLink>
</div>
</div>
</div>
</SectionFrame>
);
}
@@ -0,0 +1,41 @@
/**
* 기본 정보 · 카드 — 항목마다 한 장씩. 모바일에서 손가락으로 훑기 좋다.
*/
import {
HiddenFieldsNotice,
InfoRow,
SectionBody,
SectionFrame,
SectionHeading,
} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {TODAY_KO} from '../common';
export function InfoCards(props: SectionRenderProps) {
const {section, isSelected, onSelect, template, infoFields} = props;
const visible = infoFields.filter((f) => !f.requiresVerification || f.isVerified);
const hidden = infoFields.filter((f) => f.requiresVerification && !f.isVerified).length;
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="tint">
<SectionBody>
<SectionHeading
title={section.name}
subtitle={section.description}
trailing={<HiddenFieldsNotice count={hidden} />}
colors={template.colors}
/>
<div className="grid grid-cols-1 gap-2.5 sm:grid-cols-2">
{visible.map((field) => (
<InfoRow key={field.id} field={field} variant="card" colors={template.colors} />
))}
</div>
<div className="text-right">
<span className="font-mono text-[11px] text-stone-400">* {TODAY_KO} 기준 정보입니다.</span>
</div>
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,41 @@
/**
* 기본 정보 · 한 줄 요약 — 값들을 문장처럼 이어 붙인 가장 좁은 형태.
* 정보가 적거나, 아래 섹션으로 빨리 넘기고 싶을 때.
*/
import {
HiddenFieldsNotice,
InfoRow,
SectionBody,
SectionFrame,
SectionHeading,
} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {TODAY_KO} from '../common';
export function InfoInline(props: SectionRenderProps) {
const {section, isSelected, onSelect, template, infoFields} = props;
const visible = infoFields.filter((f) => !f.requiresVerification || f.isVerified);
const hidden = infoFields.filter((f) => f.requiresVerification && !f.isVerified).length;
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="white">
<SectionBody width="narrow">
<SectionHeading
variant="minimal"
title={section.name}
subtitle={section.description}
trailing={<HiddenFieldsNotice count={hidden} />}
colors={template.colors}
/>
<div className="flex flex-wrap gap-x-5 gap-y-2.5 rounded-xl border border-stone-200/70 bg-stone-50/60 p-4">
{visible.map((field) => (
<InfoRow key={field.id} field={field} variant="inline" colors={template.colors} />
))}
</div>
<span className="block font-mono text-[11px] text-stone-400">* {TODAY_KO} 기준</span>
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,42 @@
/**
* 기본 정보 · 표 — 라벨과 값을 선으로 나눈 가장 읽기 쉬운 형태.
* 항목이 많아도 눈이 안 흔들린다.
*/
import {
HiddenFieldsNotice,
InfoRow,
SectionBody,
SectionFrame,
SectionHeading,
} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {TODAY_KO} from '../common';
export function InfoTable(props: SectionRenderProps) {
const {section, isSelected, onSelect, template, infoFields} = props;
const visible = infoFields.filter((f) => !f.requiresVerification || f.isVerified);
const hidden = infoFields.filter((f) => f.requiresVerification && !f.isVerified).length;
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="white">
<SectionBody>
<SectionHeading
title={section.name}
subtitle={section.description}
trailing={<HiddenFieldsNotice count={hidden} />}
colors={template.colors}
/>
<div className="overflow-hidden rounded-xl border border-stone-200/80 bg-stone-50/60 [&>*+*]:border-t [&>*+*]:border-stone-200/70">
{visible.map((field) => (
<InfoRow key={field.id} field={field} variant="row" colors={template.colors} />
))}
</div>
<div className="text-right">
<span className="font-mono text-[11px] text-stone-400">* {TODAY_KO} 기준 정보입니다.</span>
</div>
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,49 @@
/**
* 문의 · 연락 카드 — 전화 / 카카오 / 인스타로 바로 보낸다.
* 폼을 받을 준비가 안 된 사장님에게는 이쪽이 사고가 없다.
*/
import {Phone} from 'lucide-react';
import {
EmptyStateNotice,
SectionBody,
SectionFrame,
SectionHeading,
} from '../../primitives';
import type {SectionRenderProps} from '../../types';
export function InquiryCta(props: SectionRenderProps) {
const {section, isSelected, onSelect, storeName, template} = props;
// ★ 연락처(place_links)는 SectionRenderProps 로 흘러오지 않는다. 값이 생기기 전까지
// 버튼째 숨긴다 — 시연용 번호를 붙이면 남의 가게로 전화가 간다.
const phone = props.infoFields.find((f) => f.id === 'phone')?.value?.trim();
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="white">
<SectionBody width="narrow">
<SectionHeading variant="centered" title={section.name} subtitle={section.description} />
<div className="flex flex-col items-center gap-3 rounded-2xl border border-stone-200/80 bg-stone-50/70 p-6 text-center">
<p className="text-xs leading-relaxed text-stone-600">
{section.body || `${storeName} 단체·대관 문의는 아래로 연락 주시면 담당자가 안내해 드립니다.`}
</p>
{phone ? (
<div className="flex flex-wrap items-center justify-center gap-2">
<a
href={`tel:${phone}`}
onClick={(e) => e.stopPropagation()}
className="inline-flex items-center gap-1.5 rounded-xl px-5 py-2.5 text-xs font-semibold text-white shadow-xs transition-opacity hover:opacity-90"
style={{backgroundColor: template.colors.primary}}
>
<Phone className="size-3.5" />
<span>{phone}</span>
</a>
</div>
) : (
<EmptyStateNotice>연락처는 아직 준비 중입니다.</EmptyStateNotice>
)}
</div>
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,71 @@
/**
* 문의 · 신청서 — 인원/일정/연락처를 받는 양식.
*
* ★ 캔버스는 미리보기다. 여기서 제출은 실제로 나가지 않는다 —
* 그 사실을 화면에 적어 둬야 사장님이 "접수됐겠지" 하고 넘어가지 않는다.
*/
import {Send} from 'lucide-react';
import {SectionBody, SectionFrame, SectionHeading} from '../../primitives';
import type {SectionRenderProps} from '../../types';
const FIELDS = [
{id: 'name', label: '성함 / 단체명', placeholder: '홍길동 / ○○기업 총무팀'},
{id: 'contact', label: '연락처', placeholder: '010-0000-0000'},
{id: 'date', label: '희망 일자', placeholder: '2026-09-14'},
{id: 'headcount', label: '예상 인원', placeholder: '20명'},
];
export function InquiryForm(props: SectionRenderProps) {
const {section, isSelected, onSelect, template} = props;
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="tint">
<SectionBody width="narrow">
<SectionHeading title={section.name} subtitle={section.description} />
<div
onClick={(e) => e.stopPropagation()}
role="presentation"
className="space-y-3 rounded-2xl border border-stone-200/80 bg-white p-5 shadow-2xs"
>
<div className="grid grid-cols-1 gap-3 sm:grid-cols-2">
{FIELDS.map((field) => (
<label key={field.id} className="space-y-1">
<span className="block text-[11px] font-semibold text-stone-500">
{field.label}
</span>
<input
type="text"
placeholder={field.placeholder}
className="w-full rounded-lg border border-stone-200 bg-stone-50 px-3 py-2 text-xs focus:bg-white focus:outline-none"
/>
</label>
))}
</div>
<label className="block space-y-1">
<span className="block text-[11px] font-semibold text-stone-500">문의 내용</span>
<textarea
rows={3}
placeholder="행사 성격, 필요한 준비물, 예산 등을 적어 주세요."
className="w-full resize-none rounded-lg border border-stone-200 bg-stone-50 px-3 py-2 text-xs focus:bg-white focus:outline-none"
/>
</label>
<button
type="button"
className="inline-flex w-full cursor-not-allowed items-center justify-center gap-1.5 rounded-xl px-5 py-2.5 text-xs font-semibold text-white opacity-90"
style={{backgroundColor: template.colors.primary}}
>
<Send className="size-3.5" />
<span>문의 보내기</span>
</button>
<p className="text-center text-[10px] text-stone-400">
미리보기 화면입니다 — 실제 접수는 발행 후 동작합니다.
</p>
</div>
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,35 @@
/**
* 소개 · 가운데 정렬 — 짧은 문단 하나로 끝내는 가장 조용한 구성.
*/
import {SectionBody, SectionFrame, SectionHeading} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {EmptyStateNotice} from '../../primitives';
import {introParagraph} from '../common';
export function IntroCentered(props: SectionRenderProps) {
const intro = props.section.body?.trim() || introParagraph(props.industryId, props.infoFields);
const {section, isSelected, onSelect, storeName, template} = props;
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="paper">
<SectionBody width="narrow">
<SectionHeading
variant="centered"
eyebrow="ABOUT US"
title={section.name}
subtitle={section.description}
colors={template.colors}
/>
{intro ? (
<p className="text-center text-xs leading-relaxed text-stone-600 sm:text-sm">
{intro}
</p>
) : (
<EmptyStateNotice>
아직 소개문이 없습니다 — 확인된 정보만 근거로 씁니다.
</EmptyStateNotice>
)}
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,48 @@
/**
* 소개 · 사진 옆 글 — 왼쪽 세로 사진, 오른쪽 문단 + 특징 목록.
* 사진과 설명을 같은 눈높이에서 함께 읽히고 싶을 때.
*/
import {EmptyStateNotice, SectionBody, SectionFrame, SectionHeading} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {primaryPhoto, introParagraph} from '../common';
export function IntroSideBySide(props: SectionRenderProps) {
const intro = props.section.body?.trim() || introParagraph(props.industryId, props.infoFields);
const {section, isSelected, onSelect, storeName, template, photos} = props;
const shot = photos[1] ?? primaryPhoto(photos);
// 사진이 없으면 회색 판만 남기고 <img> 는 렌더하지 않는다.
const shotUrl = shot?.url;
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="paper">
<SectionBody>
<SectionHeading
variant="eyebrow"
eyebrow="ABOUT"
title={section.name}
subtitle={section.description}
/>
<div className="grid grid-cols-1 items-center gap-6 md:grid-cols-12">
<div className="md:col-span-5">
<div className="relative aspect-3/4 overflow-hidden rounded-2xl border border-stone-200/80 bg-stone-100">
{shotUrl && (
<img src={shotUrl} alt={`${storeName} 공간`} className="size-full object-cover" />
)}
</div>
</div>
<div className="space-y-4 md:col-span-7">
{intro ? (
<p className="text-xs leading-relaxed text-stone-700 sm:text-sm">{intro}</p>
) : (
<EmptyStateNotice>
아직 소개문이 없습니다 — 확인된 정보만 근거로 씁니다.
</EmptyStateNotice>
)}
</div>
</div>
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,42 @@
/**
* 소개 · 스토리 — 넓은 사진 한 장 아래로 문단이 흐르는 잡지식 구성.
*/
import {EmptyStateNotice, SectionBody, SectionFrame, SectionHeading} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {introParagraph} from '../common';
export function IntroStory(props: SectionRenderProps) {
const intro = props.section.body?.trim() || introParagraph(props.industryId, props.infoFields);
const {section, isSelected, onSelect, storeName, template, photos} = props;
const shotUrl = photos[1]?.url;
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="paper">
<SectionBody>
<SectionHeading
title={section.name}
subtitle={section.description}
colors={template.colors}
/>
<div className="relative aspect-16/9 overflow-hidden rounded-xl border border-stone-200/80 bg-stone-100 sm:aspect-21/9">
{shotUrl && (
<img src={shotUrl} alt={`${storeName} 공간`} className="size-full object-cover" />
)}
</div>
<div className="space-y-4">
{intro ? (
<p className="font-sans text-xs leading-relaxed text-stone-700 sm:text-base">
{intro}
</p>
) : (
<EmptyStateNotice>
아직 소개문이 없습니다 — 확인된 정보만 근거로 씁니다.
</EmptyStateNotice>
)}
</div>
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,27 @@
import {useEffect, useState} from 'react';
/** "실시간 업데이트: 오후 4:41:56" 표시. 1초마다 갱신된다. */
export function LiveClock() {
const [clock, setClock] = useState('');
useEffect(() => {
const update = () => {
const now = new Date();
const period = now.getHours() >= 12 ? '오후' : '오전';
const hours = now.getHours() % 12 || 12;
const minutes = String(now.getMinutes()).padStart(2, '0');
const seconds = String(now.getSeconds()).padStart(2, '0');
setClock(`${period} ${hours}:${minutes}:${seconds}`);
};
update();
const timer = setInterval(update, 1000);
return () => clearInterval(timer);
}, []);
return (
<span className="flex items-center gap-1.5 rounded-full border border-stone-200/80 bg-white px-2.5 py-1 text-[11px] text-stone-500 shadow-2xs">
<span className="size-1.5 animate-pulse rounded-full bg-emerald-500" />
<span>실시간 업데이트: {clock}</span>
</span>
);
}
@@ -0,0 +1,50 @@
/**
* 지역 가이드 · 요약 — 날씨 한 줄과 추천 6곳만.
* 지역 정보가 주인공이 아닌 사이트에서 "있긴 하다" 정도로 둘 때.
*/
import {
EmptyStateNotice,
ListCard,
PlaceRow,
SectionBody,
SectionFrame,
SectionHeading,
} from '../../primitives';
import type {SectionRenderProps} from '../../types';
const naverSearch = (q: string) =>
`https://search.naver.com/search.naver?query=${encodeURIComponent(q)}`;
export function LocalCompact(props: SectionRenderProps) {
const {section, isSelected, onSelect, location, template} = props;
// 맛집·명소를 섞어 딱 6개만. 목록이 길어지면 요약이 아니게 된다.
// ★ 지역 정보는 서버(local.local_contents)가 소유하고 캔버스 계약(SectionRenderProps)에 없다.
// 시연용 목록(제주 애월)으로 자리를 메우지 않는다 — 남의 동네 맛집이 사장님 사이트에 붙는다.
const picks: {name: string; meta: string; description: string; q: string}[] = [];
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="paper">
<SectionBody width="narrow">
<SectionHeading variant="minimal" title="주변 안내" colors={template.colors} />
{picks.length === 0 ? (
<EmptyStateNotice>주변 추천은 아직 준비 중입니다.</EmptyStateNotice>
) : (
<ListCard>
{picks.map((p) => (
<PlaceRow
key={p.name}
name={p.name}
meta={p.meta}
description={p.description}
href={naverSearch(p.q)}
actionLabel="보기"
colors={template.colors}
/>
))}
</ListCard>
)}
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,163 @@
/**
* 지역 가이드 · 전체 — 날씨 카드 + 맛집 + 명소 + 월별 축제를 세로로 전부.
* "여기 오면 근처에 뭐가 있나"를 한 화면에서 다 보여주고 싶을 때.
*/
import {Calendar, MapPin, Sparkles, Utensils} from 'lucide-react';
import type {TemplateItem} from '@o2o/shared';
import {
EmptyStateNotice,
ListCard,
PlaceRow,
Pill,
SectionBody,
SectionFrame,
SectionHeading,
} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {LiveClock} from './LiveClock';
import type {FestivalItem, NearbyPlace} from './types';
const naverSearch = (q: string) =>
`https://search.naver.com/search.naver?query=${encodeURIComponent(q)}`;
function GroupHeading({
icon: Icon,
title,
note,
colors,
}: {
icon: typeof Utensils;
title: string;
note: string;
colors: TemplateItem['colors'];
}) {
return (
<div className="flex items-center justify-between">
<h3
className="serif-title flex items-center gap-2 text-base font-bold text-stone-900 sm:text-lg"
style={{color: colors.text}}
>
<Icon className="size-4 text-stone-600" style={{color: colors.primary}} />
<span>{title}</span>
</h3>
{/* 오른쪽 출처 문구는 부가 정보라 중립 회색 그대로 둔다. */}
<span className="text-[11px] text-stone-400">{note}</span>
</div>
);
}
export function LocalFull(props: SectionRenderProps) {
const {section, isSelected, onSelect, industryId, location, template} = props;
const isStay = industryId === 'stay';
const locName = location.split(' ')[0] || '주변';
// ★ 맛집·명소·축제는 전부 제주 애월 시연용 목록이다 — 실사업장은 빈 목록으로 떨어진다.
// (지역 큐레이션을 읽어올 백엔드 창구가 아직 없어 당분간 계속 빈다.)
// 지역 정보는 서버(local.local_contents)가 소유하고 캔버스 계약에 없다 — 시연용 목록을 깔지 않는다.
const foods: NearbyPlace[] = [];
const spots: NearbyPlace[] = [];
const festivals: FestivalItem[] = [];
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="paper">
<SectionBody className="space-y-8">
<SectionHeading
variant="eyebrow"
eyebrow="AI Local Guide"
title={`AI ${locName} 실시간 가이드`}
subtitle="실시간 날씨와 인근 미식·명소·축제를 AI가 큐레이션합니다"
trailing={<LiveClock />}
colors={template.colors}
/>
<div className="space-y-3.5">
<GroupHeading
icon={Utensils}
title="숙소 인근 엄선 맛집 & 카페"
note="호스트 & 네이버 플레이스 연동"
colors={template.colors}
/>
{foods.length === 0 ? (
<EmptyStateNotice>주변 맛집·카페 추천은 아직 준비 중입니다.</EmptyStateNotice>
) : (
<ListCard>
{foods.map((place) => (
<PlaceRow
key={place.name}
name={place.name}
meta={place.distance}
description={place.description}
href={naverSearch(place.searchQuery)}
colors={template.colors}
/>
))}
</ListCard>
)}
</div>
<div className="space-y-3.5">
<GroupHeading
icon={MapPin}
title="주변 힐링 명소 & 해변"
note="차량 5~20분 거리"
colors={template.colors}
/>
{spots.length === 0 ? (
<EmptyStateNotice>주변 명소 추천은 아직 준비 중입니다.</EmptyStateNotice>
) : (
<ListCard>
{spots.map((spot) => (
<PlaceRow
key={spot.name}
name={spot.name}
meta={spot.duration}
description={spot.description}
href={naverSearch(spot.searchQuery)}
actionLabel="상세정보"
colors={template.colors}
/>
))}
</ListCard>
)}
</div>
{isStay && (
<div className="space-y-3.5">
<GroupHeading
icon={Calendar}
title="월별 축제 & 문화 행사"
note="사계절 캘린더"
colors={template.colors}
/>
{festivals.length === 0 ? (
<EmptyStateNotice>월별 축제 안내는 아직 준비 중입니다.</EmptyStateNotice>
) : (
<ListCard>
{festivals.map((fest) => (
<PlaceRow
key={fest.name}
name={fest.name}
description={fest.description || fest.period}
href={naverSearch(fest.searchQuery)}
actionLabel="검색"
leading={
<>
<Pill tone="accent">{fest.month}</Pill>
{fest.isFeatured && (
<Pill tone="good">
<Sparkles className="size-2.5" />
대표축제
</Pill>
)}
</>
}
colors={template.colors}
/>
))}
</ListCard>
)}
</div>
)}
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,124 @@
/**
* 지역 가이드 · 탭 — 맛집/명소/축제를 탭으로 갈아 끼운다.
* 목록이 길어 스크롤이 부담스러울 때 화면 길이를 1/3 로 줄인다.
*/
import {useState} from 'react';
import {Calendar, MapPin, Utensils} from 'lucide-react';
import {cn} from '@/lib/utils';
import {
EmptyStateNotice,
ListCard,
Pill,
PlaceRow,
SectionBody,
SectionFrame,
SectionHeading,
} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import type {FestivalItem, NearbyPlace} from './types';
const naverSearch = (q: string) =>
`https://search.naver.com/search.naver?query=${encodeURIComponent(q)}`;
type TabKey = 'food' | 'spots' | 'festivals';
const TABS: {key: TabKey; label: string; icon: typeof Utensils}[] = [
{key: 'food', label: '맛집 · 카페', icon: Utensils},
{key: 'spots', label: '명소', icon: MapPin},
{key: 'festivals', label: '축제', icon: Calendar},
];
export function LocalTabs(props: SectionRenderProps) {
const {section, isSelected, onSelect, industryId, location, template} = props;
const [tab, setTab] = useState<TabKey>('food');
const isStay = industryId === 'stay';
const tabs = isStay ? TABS : TABS.filter((t) => t.key !== 'festivals');
const locName = location.split(' ')[0] || '주변';
// ★ 세 탭 모두 제주 애월 시연용 목록이다 — 실사업장은 빈 목록으로 떨어진다.
// 지역 정보는 서버(local.local_contents)가 소유하고 캔버스 계약에 없다 — 시연용 목록을 깔지 않는다.
const foods: NearbyPlace[] = [];
const spots: NearbyPlace[] = [];
const festivals: FestivalItem[] = [];
// 탭을 눌렀는데 아무것도 없으면 섹션이 사라진 것처럼 보인다 — 자리는 지키고 상태만 알린다.
const isEmpty = (tab === 'food' ? foods : tab === 'spots' ? spots : festivals).length === 0;
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="paper">
<SectionBody>
<SectionHeading
variant="eyebrow"
eyebrow="AI Local Guide"
title={`AI ${locName} 실시간 가이드`}
subtitle="탭을 눌러 원하는 정보만 보세요"
colors={template.colors}
/>
<div className="flex items-center gap-1 rounded-xl border border-stone-200/80 bg-white p-1">
{tabs.map(({key, label, icon: Icon}) => (
<button
key={key}
type="button"
onClick={(e) => {
e.stopPropagation();
setTab(key);
}}
aria-pressed={tab === key}
style={tab === key ? {backgroundColor: template.colors.primary} : undefined}
className={cn(
'flex flex-1 cursor-pointer items-center justify-center gap-1.5 rounded-lg py-2 text-xs font-semibold transition-colors',
tab === key ? 'text-white' : 'text-stone-500 hover:bg-stone-100',
)}
>
<Icon className="size-3.5" />
<span>{label}</span>
</button>
))}
</div>
{isEmpty ? (
<EmptyStateNotice>주변 정보는 아직 준비 중입니다.</EmptyStateNotice>
) : (
<ListCard>
{tab === 'food' &&
foods.map((place) => (
<PlaceRow
key={place.name}
name={place.name}
meta={place.distance}
description={place.description}
href={naverSearch(place.searchQuery)}
colors={template.colors}
/>
))}
{tab === 'spots' &&
spots.map((spot) => (
<PlaceRow
key={spot.name}
name={spot.name}
meta={spot.duration}
description={spot.description}
href={naverSearch(spot.searchQuery)}
actionLabel="상세정보"
colors={template.colors}
/>
))}
{tab === 'festivals' &&
festivals.map((fest) => (
<PlaceRow
key={fest.name}
name={fest.name}
description={fest.description || fest.period}
href={naverSearch(fest.searchQuery)}
actionLabel="검색"
leading={<Pill tone="accent">{fest.month}</Pill>}
colors={template.colors}
/>
))}
</ListCard>
)}
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,126 @@
/**
* 실시간 날씨 + AI 추천 한 덩어리.
*
* 지역 가이드 배리에이션 셋이 전부 이걸 쓴다 — 날씨 조회를 배리에이션마다 하면
* 레이아웃을 바꿀 때마다 API 를 다시 때린다.
*/
import {ArrowUpRight, Cloud, CloudRain, Snowflake, Sparkles, Sun} from 'lucide-react';
import {useWeather} from '@/hooks/useWeather';
import {cn} from '@/lib/utils';
import type {WeatherLocation} from '@/stores/builder';
import {EmptyStateNotice} from '../../primitives';
function WeatherIcon({condition, className}: {condition: string; className?: string}) {
switch (condition) {
case '맑음':
return <Sun className={cn('text-amber-500', className)} />;
case '구름많음':
return <Cloud className={cn('text-stone-500', className)} />;
case '비':
return <CloudRain className={cn('text-blue-500', className)} />;
case '눈':
return <Snowflake className={cn('text-cyan-400', className)} />;
default:
return <Cloud className={cn('text-stone-400', className)} />;
}
}
export function WeatherPanel({
location,
weatherLocation,
dense,
}: {
location: string;
weatherLocation?: WeatherLocation;
dense?: boolean;
}) {
const observed = useWeather(
weatherLocation?.regionCode,
weatherLocation?.latitude,
weatherLocation?.longitude,
);
const weather = weatherLocation ? observed : null;
if (dense) {
return (
<div className="flex flex-wrap items-center gap-3 rounded-xl border border-stone-200/80 bg-white px-4 py-3 shadow-2xs">
{weather ? (
<>
<WeatherIcon condition={weather.condition} className="size-5" />
<span className="text-lg font-extrabold tracking-tight text-stone-900">
{weather.temperature || '21.4'}°C
</span>
<span className="text-xs font-semibold text-stone-600">
{weather.condition || '구름많음'}
</span>
{weather.stale && <span className="text-[10px] text-amber-700">최근 관측값</span>}
<span className="min-w-0 flex-1 truncate text-[11px] text-stone-500">
{weather.recommendation}
</span>
</>
) : (
<span className="text-[11px] text-stone-500">
실시간 날씨는 아직 준비 중입니다.
</span>
)}
</div>
);
}
return (
<div className="space-y-4 rounded-2xl border border-stone-200/80 bg-white p-5 shadow-2xs sm:p-6">
<div className="flex flex-col justify-between gap-3 border-b border-stone-100 pb-4 sm:flex-row sm:items-center">
<div className="flex items-center gap-3.5">
<div className="flex size-12 shrink-0 items-center justify-center rounded-2xl bg-stone-100/80">
<WeatherIcon condition={weather?.condition ?? ''} className="size-6" />
</div>
<div>
<span className="block text-[11px] font-semibold text-stone-400">
{location || '제주 애월읍'} 실시간 기상
</span>
{weather ? (
<div className="mt-0.5 flex items-baseline gap-2">
<span className="font-sans text-2xl font-extrabold tracking-tight text-stone-900 sm:text-3xl">
{weather.temperature || '21.4'}°C
</span>
<span className="text-xs font-semibold text-stone-700 sm:text-sm">
{weather.condition || '구름많음'}
</span>
{weather.stale && (
<span className="text-[10px] font-medium text-amber-700">최근 관측값</span>
)}
</div>
) : (
<span className="mt-0.5 block text-xs text-stone-500">
실시간 날씨는 아직 준비 중입니다.
</span>
)}
</div>
</div>
<a
href={`https://search.naver.com/search.naver?query=${encodeURIComponent(`${location} 날씨`)}`}
target="_blank"
rel="noopener noreferrer"
onClick={(e) => e.stopPropagation()}
className="flex items-center gap-1 self-start rounded-lg border border-stone-200/60 bg-stone-50 px-3 py-1.5 text-xs text-stone-500 transition-colors hover:bg-stone-100 hover:text-stone-900 sm:self-auto"
>
<span>주간 날씨 예보</span>
<ArrowUpRight className="size-3.5" />
</a>
</div>
{weather ? (
<div className="flex items-start gap-2.5 rounded-xl border border-stone-200/60 bg-stone-50/70 p-3.5 text-xs leading-relaxed text-stone-700 sm:text-sm">
<Sparkles className="mt-0.5 size-4 shrink-0 text-amber-600" />
<div>
<strong className="font-semibold text-stone-900">AI 맞춤 추천: </strong>
<span>{weather.recommendation}</span>
</div>
</div>
) : (
<EmptyStateNotice>날씨 기반 AI 추천은 아직 준비 중입니다.</EmptyStateNotice>
)}
</div>
);
}
@@ -0,0 +1,32 @@
/**
* 지역 정보 항목의 모양.
*
* ★ 원래 이 타입들은 시연용 데이터 파일(data/stayData.ts)이 소유했다. 그 파일을 지우면서
* 실제로 쓰는 쪽인 여기로 옮겼다 — 타입이 데이터 시드에 매여 있을 이유가 없다.
*
* ★ 값은 서버(local.local_contents)가 소유한다. 지금은 캔버스 계약(SectionRenderProps)에
* 지역 정보가 없어서 배리에이션들이 빈 목록을 그린다. 흘려보낼 창구가 생기면
* 이 모양에 맞춰 매핑하면 된다.
*/
export interface NearbyPlace {
name: string;
category: string;
/** 거리 표기("차로 5분", "1.2km") — 원문 그대로 옮긴다. */
distance: string;
duration: string;
description: string;
/** 상세 페이지 대신 검색으로 보낸다 — 없는 주소를 지어내지 않기 위해서다. */
searchQuery: string;
tag: string;
}
export interface FestivalItem {
month: string;
name: string;
period: string;
location: string;
description: string;
isFeatured?: boolean;
officialUrl?: string;
searchQuery: string;
}
@@ -0,0 +1,50 @@
/**
* 오시는 길 · 간단 — 주소 한 줄과 길찾기 버튼만.
* 도심처럼 "주소만 알면 찾아오는" 곳이면 표까지 깔 이유가 없다.
*/
import {MapPin} from 'lucide-react';
import {
AddressCard,
EmptyStateNotice,
SectionBody,
SectionFrame,
SectionHeading,
} from '../../primitives';
import type {SectionRenderProps} from '../../types';
export function MapCompact(props: SectionRenderProps) {
const {section, isSelected, onSelect, storeName, location, template, infoFields} = props;
// ★ props 로 온 주소만 쓴다. 없으면 카드 대신 준비 중 안내를 둔다 —
// 시연용 주소로 떨어지면 손님을 남의 집으로 보낸다.
const address = infoFields.find((f) => f.id === 'address')?.value ?? '';
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="tint">
<SectionBody width="narrow">
<SectionHeading
variant="minimal"
title={section.name}
subtitle={section.description}
trailing={
<span className="flex items-center gap-1 text-[11px] text-stone-500">
<MapPin className="size-3.5" />
{location}
</span>
}
colors={template.colors}
/>
{address ? (
<AddressCard
address={address}
searchName={storeName}
variant="bar"
colors={template.colors}
/>
) : (
<EmptyStateNotice>주소는 아직 준비 중입니다.</EmptyStateNotice>
)}
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,111 @@
/**
* 오시는 길 · 상세 — 주소 카드 + 거점별 소요시간 표 + 주차/충전 안내.
* 차로 찾아오는 손님이 많은 곳(외곽 스테이, 교외 카페)에 맞는다.
*/
import {Car, CarFront, Zap} from 'lucide-react';
import {
AddressCard,
EmptyStateNotice,
FeatureCard,
SectionBody,
SectionFrame,
SectionHeading,
} from '../../primitives';
import type {SectionRenderProps} from '../../types';
export function MapDetailed(props: SectionRenderProps) {
const {section, isSelected, onSelect, industryId, storeName, template, infoFields} = props;
// ★ 주소도 소요시간표도 시연용(제주 애월)이다 — 실사업장에는 한 줄도 내보내지 않는다.
const address =
infoFields.find((f) => f.id === 'address')?.value ?? '';
/**
* 소요시간 표.
*
* ★ 서버(local.routes)의 산출물이고 캔버스 계약(SectionRenderProps)에 없다 —
* 흘러올 창구가 생기기 전까지 빈다. 시연용 표(제주 애월 기준)를 깔지 않는다:
* 남의 동네 소요시간을 보고 손님이 출발 시각을 정한다.
*/
const travelTimes: {
destination: string;
byCar: string;
byWalkOrTransit: string;
distance: string;
}[] = [];
const isStay = industryId === 'stay';
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="white">
<SectionBody>
<SectionHeading title={section.name} subtitle={section.description} colors={template.colors} />
{address ? (
<AddressCard
address={address}
searchName={storeName}
colors={template.colors}
/>
) : (
<EmptyStateNotice>주소는 아직 준비 중입니다.</EmptyStateNotice>
)}
{isStay && travelTimes.length === 0 && (
<EmptyStateNotice>주요 거점 소요시간은 아직 준비 중입니다.</EmptyStateNotice>
)}
{isStay && travelTimes.length > 0 && (
<div className="overflow-hidden rounded-xl border border-stone-200/80 bg-white shadow-2xs">
<div className="flex items-center gap-2 border-b border-stone-200 bg-stone-50 p-3.5 text-xs font-bold text-stone-800">
<Car className="size-4 text-stone-700" />
<span>주요 거점 이동 소요시간</span>
</div>
<div className="overflow-x-auto">
<table className="w-full text-left text-xs">
<thead className="border-b border-stone-100 bg-stone-50/50 font-medium text-stone-500">
<tr>
<th className="p-3">목적지</th>
<th className="p-3">차량</th>
<th className="p-3">도보 / 대중교통</th>
<th className="hidden p-3 sm:table-cell">거리</th>
</tr>
</thead>
<tbody className="text-stone-700 [&>tr+tr]:border-t [&>tr+tr]:border-stone-100">
{travelTimes.map((row) => (
<tr key={row.destination} className="hover:bg-stone-50/50">
<td className="p-3 font-bold text-stone-900">{row.destination}</td>
<td
className="p-3 font-semibold"
style={{color: template.colors.primary}}
>
{row.byCar}
</td>
<td className="p-3">{row.byWalkOrTransit}</td>
<td className="hidden p-3 font-mono text-stone-400 sm:table-cell">
{row.distance}
</td>
</tr>
))}
</tbody>
</table>
</div>
</div>
)}
<div className="grid grid-cols-1 gap-3 sm:grid-cols-2">
<FeatureCard
icon={CarFront}
title="전용 주차장 완비"
description="객실동 입구 전용 주차 공간 4대 무료 이용 가능"
colors={template.colors}
/>
<FeatureCard
icon={Zap}
title="전기차 완속 충전기"
description="스테이 전용 7kW 완속 충전기 1기 구비"
iconClassName="text-emerald-600"
colors={template.colors}
/>
</div>
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,31 @@
/**
* 메뉴 · 카드 격자 — 설명을 넉넉히 보여준다. 시그니처가 몇 개뿐일 때 강하다.
*/
import {PriceRow, SectionBody, SectionFrame, SectionHeading} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {menuItems} from './useMenuItems';
export function MenuGrid(props: SectionRenderProps) {
const {section, isSelected, onSelect, industryId, template} = props;
const items = menuItems(industryId);
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="tint">
<SectionBody>
<SectionHeading
variant="centered"
eyebrow="MENU"
title={section.name}
subtitle={section.description}
colors={template.colors}
/>
<div className="grid grid-cols-1 gap-3 sm:grid-cols-2">
{items.map((item) => (
<PriceRow key={item.name} item={item} variant="card" colors={template.colors} />
))}
</div>
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,29 @@
/**
* 메뉴 · 목록 — 이름과 가격을 한 줄씩. 종이 메뉴판처럼 읽힌다.
*/
import {ListCard, PriceRow, SectionBody, SectionFrame, SectionHeading} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {menuItems} from './useMenuItems';
export function MenuList(props: SectionRenderProps) {
const {section, isSelected, onSelect, industryId, template} = props;
const items = menuItems(industryId);
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="white">
<SectionBody>
<SectionHeading
title={section.name}
subtitle={section.description}
colors={template.colors}
/>
<ListCard>
{items.map((item) => (
<PriceRow key={item.name} item={item} colors={template.colors} />
))}
</ListCard>
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,45 @@
/**
* 메뉴 · 가격표 — 이름과 가격만 점선으로 이어 붙인 가장 압축된 형태.
* 품목이 많은 곳(코스 여러 개, 음료 다수)에 맞는다.
*/
import {Pill, SectionBody, SectionFrame, SectionHeading} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {menuItems} from './useMenuItems';
export function MenuPriceTable(props: SectionRenderProps) {
const {section, isSelected, onSelect, industryId, template} = props;
const items = menuItems(industryId);
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="paper">
<SectionBody width="narrow">
<SectionHeading variant="minimal" title={section.name} colors={template.colors} />
<ul className="space-y-3.5">
{items.map((item) => (
<li key={item.name} className="space-y-0.5">
<div className="flex items-baseline gap-2">
<span
className="flex items-center gap-2 text-xs font-bold text-stone-900 sm:text-sm"
style={{color: template.colors.text}}
>
{item.name}
{item.tag && <Pill tone="accent">{item.tag}</Pill>}
</span>
{/* 점선 리더 — 이름과 가격 사이를 눈으로 잇는다. 선 자체는 중립 회색으로 둔다. */}
<span className="min-w-4 flex-1 translate-y-[-3px] border-b border-dotted border-stone-300" />
<span
className="font-mono text-xs font-extrabold text-stone-900 sm:text-sm"
style={{color: template.colors.primary}}
>
{item.price}
</span>
</div>
{item.desc && <p className="text-[11px] leading-relaxed text-stone-500">{item.desc}</p>}
</li>
))}
</ul>
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,13 @@
import type {IndustryType} from '@o2o/shared';
import type {PricedItem} from '../../primitives';
/**
* 메뉴.
*
* ★ 지금은 항상 빈 목록이다. 메뉴는 unit(하위 단위)이고, 캔버스 계약에 units 가 없다.
* 업종 시드의 menuList/courseList 를 폴백으로 쓰던 코드를 걷어냈다 —
* "포레스트 크림라떼 7,500원" 이 실제로 모든 카페 화면에 떴다.
*/
export function menuItems(_industryId: IndustryType): PricedItem[] {
return [];
}
@@ -0,0 +1,52 @@
/**
* 사진 · 가로 슬라이드 — 큰 사진을 한 장씩 넘겨 본다.
* 장수가 적고 한 장 한 장이 좋을 때 가장 세게 보인다.
*/
import {useState} from 'react';
import {
Lightbox,
PhotoTile,
SectionBody,
SectionFrame,
SectionHeading,
} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {galleryPhotos} from '../common';
export function PhotosCarousel(props: SectionRenderProps) {
const {section, isSelected, onSelect, industryId, template, photos} = props;
const items = galleryPhotos(industryId, photos);
const [openIndex, setOpenIndex] = useState<number | null>(null);
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="white">
<SectionBody width="wide">
<SectionHeading title={section.name} subtitle={section.description} colors={template.colors} />
<div className="scrollbar-none flex snap-x snap-mandatory gap-3 overflow-x-auto px-1 pb-3">
{items.map((photo, idx) => (
<PhotoTile
key={photo.id}
photo={photo}
fit="landscape"
onOpen={() => setOpenIndex(idx)}
className="w-[78vw] max-w-[420px] shrink-0 snap-center"
/>
))}
</div>
<div className="flex items-center justify-center gap-1.5">
{items.map((photo) => (
<span
key={photo.id}
className="size-1.5 rounded-full"
style={{backgroundColor: `${template.colors.primary}40`}}
/>
))}
</div>
</SectionBody>
<Lightbox photos={items} index={openIndex} onClose={() => setOpenIndex(null)} onMove={setOpenIndex} />
</SectionFrame>
);
}
@@ -0,0 +1,39 @@
/**
* 사진 · 정사각 격자 — 모든 사진을 같은 크기로. 장수가 많을수록 정돈돼 보인다.
*/
import {useState} from 'react';
import {
Lightbox,
PhotoTile,
SectionBody,
SectionFrame,
SectionHeading,
} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {galleryPhotos} from '../common';
export function PhotosGrid(props: SectionRenderProps) {
const {section, isSelected, onSelect, industryId, template, photos} = props;
const items = galleryPhotos(industryId, photos);
const [openIndex, setOpenIndex] = useState<number | null>(null);
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="white">
<SectionBody>
<SectionHeading
title={section.name}
subtitle={section.description || `사진 ${items.length}장 · 클릭하면 크게 보입니다`}
colors={template.colors}
/>
<div className="grid grid-cols-2 gap-2.5 sm:grid-cols-3 sm:gap-3 md:grid-cols-4">
{items.map((photo, idx) => (
<PhotoTile key={photo.id} photo={photo} fit="square" onOpen={() => setOpenIndex(idx)} />
))}
</div>
</SectionBody>
<Lightbox photos={items} index={openIndex} onClose={() => setOpenIndex(null)} onMove={setOpenIndex} />
</SectionFrame>
);
}
@@ -0,0 +1,49 @@
/**
* 사진 · 벽돌쌓기 — 세로/가로 비율을 살려 어긋나게 쌓는다.
* 사진마다 구도가 다를 때 잘라내지 않고 보여줄 수 있다.
*/
import {useState} from 'react';
import {
Lightbox,
PhotoTile,
SectionBody,
SectionFrame,
SectionHeading,
} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {galleryPhotos} from '../common';
export function PhotosMasonry(props: SectionRenderProps) {
const {section, isSelected, onSelect, industryId, template, photos} = props;
const items = galleryPhotos(industryId, photos);
const [openIndex, setOpenIndex] = useState<number | null>(null);
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="paper">
<SectionBody>
<SectionHeading
variant="eyebrow"
eyebrow="GALLERY"
title={section.name}
subtitle={section.description}
colors={template.colors}
/>
{/* columns 로 쌓으면 사진 높이를 자르지 않고도 빈틈 없이 채워진다. */}
<div className="columns-2 gap-2.5 sm:columns-3 sm:gap-3 [&>*]:mb-2.5 sm:[&>*]:mb-3">
{items.map((photo, idx) => (
<PhotoTile
key={photo.id}
photo={photo}
fit="free"
onOpen={() => setOpenIndex(idx)}
className="break-inside-avoid"
/>
))}
</div>
</SectionBody>
<Lightbox photos={items} index={openIndex} onClose={() => setOpenIndex(null)} onMove={setOpenIndex} />
</SectionFrame>
);
}
@@ -0,0 +1,169 @@
/**
* 사진 · 사진 + 영상 — 격자 갤러리 아래에 YouTube 영상을 붙인다.
* 릴스·유튜브로 이미 알려진 곳이면 사진보다 영상이 더 잘 판다.
*/
import {useState} from 'react';
import {Plus} from 'lucide-react';
import {convertYouTubeToEmbed} from '@/lib/youtube';
import {
EmptyStateNotice,
Lightbox,
PhotoTile,
SectionBody,
SectionFrame,
SectionHeading,
} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {galleryPhotos} from '../common';
import {VideoCard, type VideoItem} from './VideoCard';
export function PhotosWithVideos(props: SectionRenderProps) {
const {section, isSelected, onSelect, industryId, template, photos} = props;
const items = galleryPhotos(industryId, photos);
const [openIndex, setOpenIndex] = useState<number | null>(null);
// 영상은 사장님이 이 화면에서 직접 추가한 것만 있다 — 시연용 목록을 깔지 않는다.
const [added, setAdded] = useState<VideoItem[]>([]);
const [removedIds, setRemovedIds] = useState<string[]>([]);
const videos = added.filter((v) => !removedIds.includes(v.id));
const [playingId, setPlayingId] = useState<string | null>(null);
const [isFormOpen, setIsFormOpen] = useState(false);
const [inputTitle, setInputTitle] = useState('');
const [inputUrl, setInputUrl] = useState('');
const [errorMsg, setErrorMsg] = useState('');
const handleAddVideo = (e: React.FormEvent) => {
e.preventDefault();
setErrorMsg('');
if (!inputTitle.trim() || !inputUrl.trim()) {
setErrorMsg('제목과 YouTube URL을 모두 입력해주세요.');
return;
}
const {embedUrl, isValid} = convertYouTubeToEmbed(inputUrl);
if (!isValid || !embedUrl) {
setErrorMsg('올바른 YouTube URL 형식이 아닙니다.');
return;
}
setAdded((prev) => [
{id: `canvas-v-${Date.now()}`, title: inputTitle.trim(), videoUrl: inputUrl.trim(), embedUrl},
...prev,
]);
setInputTitle('');
setInputUrl('');
setIsFormOpen(false);
};
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="paper">
<SectionBody className="space-y-8">
<div className="space-y-6">
<SectionHeading title={section.name} subtitle={section.description} colors={template.colors} />
<div className="grid grid-cols-2 gap-2.5 sm:grid-cols-3 sm:gap-3 md:grid-cols-4">
{items.map((photo, idx) => (
<PhotoTile
key={photo.id}
photo={photo}
fit="square"
onOpen={() => setOpenIndex(idx)}
/>
))}
</div>
</div>
<div className="space-y-6">
<SectionHeading
title="영상 갤러리"
subtitle="공간의 분위기를 영상으로 미리 확인해 보세요"
trailing={
<button
type="button"
title="영상 추가"
onClick={(e) => {
e.stopPropagation();
setIsFormOpen((v) => !v);
}}
className="flex size-8 cursor-pointer items-center justify-center rounded-full border border-stone-300 bg-white text-stone-700 shadow-2xs transition-colors hover:bg-stone-100 hover:text-stone-900"
>
<Plus className="size-4" />
</button>
}
colors={template.colors}
/>
{isFormOpen && (
<div
onClick={(e) => e.stopPropagation()}
role="presentation"
className="rounded-xl border border-stone-200 bg-white p-4 shadow-xs"
>
<form onSubmit={handleAddVideo} className="space-y-3">
<div className="grid grid-cols-1 gap-3 sm:grid-cols-2">
<input
type="text"
value={inputTitle}
onChange={(e) => setInputTitle(e.target.value)}
placeholder="영상 제목 (예: 스테이의 아침)"
className="rounded-lg border border-stone-200 bg-stone-50 px-3 py-2 text-xs focus:bg-white focus:outline-none"
/>
<input
type="text"
value={inputUrl}
onChange={(e) => setInputUrl(e.target.value)}
placeholder="YouTube URL (https://www.youtube.com/watch?v=...)"
className="rounded-lg border border-stone-200 bg-stone-50 px-3 py-2 text-xs focus:bg-white focus:outline-none"
/>
</div>
{errorMsg && <p className="text-[11px] text-rose-600">{errorMsg}</p>}
<div className="flex justify-end gap-2">
<button
type="button"
onClick={() => setIsFormOpen(false)}
className="cursor-pointer rounded-lg px-3 py-1.5 text-xs text-stone-500 hover:bg-stone-100"
>
취소
</button>
<button
type="submit"
className="cursor-pointer rounded-lg px-4 py-1.5 text-xs font-semibold text-white"
style={{backgroundColor: template.colors.primary}}
>
등록
</button>
</div>
</form>
</div>
)}
{videos.length === 0 ? (
<EmptyStateNotice>
등록된 영상이 아직 없습니다. + 버튼으로 추가할 수 있습니다.
</EmptyStateNotice>
) : (
<div className="grid grid-cols-1 gap-5 md:grid-cols-2">
{videos.map((video) => (
<VideoCard
key={video.id}
video={video}
isPlaying={playingId === video.id}
onPlay={() => setPlayingId(video.id)}
onRemove={() => setRemovedIds((prev) => [...prev, video.id])}
/>
))}
</div>
)}
</div>
</SectionBody>
<Lightbox
photos={items}
index={openIndex}
onClose={() => setOpenIndex(null)}
onMove={setOpenIndex}
/>
</SectionFrame>
);
}
@@ -0,0 +1,108 @@
import {ExternalLink, Trash2} from 'lucide-react';
/**
* 영상 한 건. 원래 시연용 데이터 파일이 소유하던 타입을 실제로 쓰는 여기로 옮겼다.
*/
export interface VideoItem {
id: string;
title: string;
videoUrl: string;
embedUrl: string;
duration?: string;
}
/** URL 에서 YouTube 영상 id 를 뽑는다. 못 뽑으면 썸네일을 대체 이미지로 떨어뜨린다. */
export function youTubeId(url: string): string | null {
const match = url.match(/^.*(youtu\.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/);
return match && match[2].length === 11 ? match[2] : null;
}
const FALLBACK_THUMB =
'https://images.unsplash.com/photo-1582719478250-c89cae4dc85b?auto=format&fit=crop&w=800&q=80';
/** 영상 한 칸 — 썸네일을 누르면 그 자리에서 iframe 으로 바뀐다. */
export function VideoCard({
video,
isPlaying,
onPlay,
onRemove,
}: {
video: VideoItem;
isPlaying: boolean;
onPlay: () => void;
onRemove: () => void;
}) {
const ytId = youTubeId(video.videoUrl || video.embedUrl || '');
const thumb = ytId ? `https://img.youtube.com/vi/${ytId}/hqdefault.jpg` : FALLBACK_THUMB;
return (
<div className="flex flex-col overflow-hidden rounded-xl border border-stone-200/90 bg-white shadow-2xs">
<div className="group relative aspect-16/9 overflow-hidden bg-stone-900">
{isPlaying ? (
<iframe
src={`${video.embedUrl}?autoplay=1&rel=0`}
title={video.title}
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowFullScreen
className="absolute inset-0 size-full border-0"
/>
) : (
<div
onClick={(e) => {
e.stopPropagation();
onPlay();
}}
className="absolute inset-0 cursor-pointer"
>
<img
src={thumb}
alt={video.title}
className="size-full object-cover opacity-90 transition-transform duration-300 group-hover:scale-105"
/>
<div className="absolute inset-0 flex items-center justify-center bg-black/40 transition-colors group-hover:bg-black/30">
<div className="flex size-12 items-center justify-center rounded-full bg-white/90 pl-1 text-stone-900 shadow-lg transition-transform group-hover:scale-110 group-active:scale-95">
<svg className="size-5 fill-current" viewBox="0 0 24 24">
<path d="M8 5v14l11-7z" />
</svg>
</div>
</div>
<div className="absolute left-3 top-3 flex items-center gap-1.5 rounded-md bg-black/60 px-2 py-1 text-[10px] font-medium text-white backdrop-blur-xs">
<span className="size-2 rounded-full bg-rose-500" />
<span>YouTube</span>
</div>
</div>
)}
</div>
<div className="flex items-center justify-between gap-2 border-t border-stone-100 bg-white p-3.5">
<span className="truncate text-xs font-semibold text-stone-900 sm:text-sm">
{video.title}
</span>
<div className="flex shrink-0 items-center gap-1">
<a
href={video.videoUrl || `https://www.youtube.com/watch?v=${ytId}`}
target="_blank"
rel="noopener noreferrer"
onClick={(e) => e.stopPropagation()}
title="YouTube에서 열기"
className="rounded p-1 text-stone-400 hover:text-stone-700"
>
<ExternalLink className="size-3.5" />
</a>
<button
type="button"
title="삭제"
onClick={(e) => {
e.stopPropagation();
onRemove();
}}
className="cursor-pointer p-1 text-stone-400 hover:text-rose-600"
>
<Trash2 className="size-3.5" />
</button>
</div>
</div>
</div>
);
}
@@ -0,0 +1,29 @@
/**
* 체험 프로그램 · 카드 — 소요시간·대상까지 붙여 한 장씩. 처음 오는 손님이 고르기 쉽다.
*/
import {PriceRow, SectionBody, SectionFrame, SectionHeading} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {programItems} from './useProgramItems';
export function ProgramsCards(props: SectionRenderProps) {
const {section, isSelected, onSelect, industryId, template} = props;
const items = programItems(industryId);
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="white">
<SectionBody>
<SectionHeading
title={section.name}
subtitle={section.description}
colors={template.colors}
/>
<div className="grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3">
{items.map((item) => (
<PriceRow key={item.name} item={item} variant="card" colors={template.colors} />
))}
</div>
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,60 @@
/**
* 체험 프로그램 · 표 — 프로그램/시간/대상/가격을 열로 세워 비교시킨다.
* 정규 클래스처럼 조건을 견줘 고르는 곳에 맞는다.
*/
import {SectionBody, SectionFrame, SectionHeading} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {programItems} from './useProgramItems';
export function ProgramsTable(props: SectionRenderProps) {
const {section, isSelected, onSelect, industryId, template} = props;
const items = programItems(industryId);
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="tint">
<SectionBody>
<SectionHeading variant="minimal" title={section.name} colors={template.colors} />
<div className="overflow-hidden rounded-xl border border-stone-200/80 bg-white shadow-2xs">
<div className="overflow-x-auto">
<table className="w-full text-left text-xs">
<thead className="border-b border-stone-100 bg-stone-50/60 font-medium text-stone-500">
<tr>
<th className="p-3">프로그램</th>
<th className="hidden p-3 sm:table-cell">소요 · 대상</th>
<th className="p-3 text-right">참가비</th>
</tr>
</thead>
<tbody className="text-stone-700 [&>tr+tr]:border-t [&>tr+tr]:border-stone-100">
{items.map((item) => (
<tr key={item.name} className="hover:bg-stone-50/50">
<td className="p-3">
<span
className="block font-bold text-stone-900"
style={{color: template.colors.text}}
>
{item.name}
</span>
{item.desc && (
<span className="mt-0.5 block text-[11px] text-stone-500">{item.desc}</span>
)}
</td>
<td className="hidden p-3 text-[11px] text-stone-500 sm:table-cell">
{item.meta?.join(' · ')}
</td>
<td
className="p-3 text-right font-mono font-extrabold text-stone-900"
style={{color: template.colors.primary}}
>
{item.price}
</td>
</tr>
))}
</tbody>
</table>
</div>
</div>
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,13 @@
import type {IndustryType} from '@o2o/shared';
import type {PricedItem} from '../../primitives';
/**
* 체험 프로그램.
*
* ★ 지금은 항상 빈 목록이다. 프로그램은 unit(하위 단위)이고, 캔버스 계약에 units 가 없다.
* 업종 시드의 programList 를 폴백으로 쓰던 코드를 걷어냈다 — 가공의 상품이 가격까지
* 붙어 모든 사업장 화면에 똑같이 떴다.
*/
export function programItems(_industryId: IndustryType): PricedItem[] {
return [];
}
@@ -0,0 +1,169 @@
/**
* 객실 한 칸.
*
* 슬라이드든 격자든 목록이든 "객실 한 개"를 보여주는 방식은 같아야 한다 —
* 카드 안쪽이 배리에이션마다 다르면 사장님이 레이아웃을 바꿀 때 정보가 사라진 것처럼 보인다.
*/
import {ExternalLink, Sparkles} from 'lucide-react';
import type {TemplateItem} from '@o2o/shared';
import {cn} from '@/lib/utils';
import {CtaLink, Pill} from '../../primitives';
/**
* 객실 한 건.
*
* ★ 이 타입은 원래 시연용 데이터 파일(data/stayData.ts)이 소유했다. 그 파일을 지우면서
* 실제로 쓰는 쪽인 여기로 옮겼다 — 타입이 데이터 시드에 매여 있을 이유가 없다.
* 서버 unit 이 캔버스로 흘러오게 되면 이 모양에 맞춰 매핑하면 된다.
*/
export interface Room {
slug: string;
name: string;
subName: string;
type: string;
capacity: string;
bedInfo: string;
size: string;
price: string;
weekdayPrice: string;
weekendPrice: string;
/** 다른 객실과의 차이 한 줄 */
difference: string;
description: string;
features: string[];
amenities: string[];
images: {url: string; alt: string}[];
}
export function RoomCard({
room,
index,
total,
bookingUrl,
layout = 'card',
colors,
className,
}: {
room: Room;
index: number;
total: number;
bookingUrl: string;
/** card = 사진 위 / 정보 아래, row = 사진 왼쪽 / 정보 오른쪽 */
layout?: 'card' | 'row';
/**
* 템플릿 색 토큰. 객실명·요금·예약 버튼이 브랜드 색을 따른다.
*
* ★ "차별점" 상자의 호박색은 그대로 둔다 — 카드 안에서 유일하게 눈을 끄는 자리라,
* 토큰을 먹이면 제목·요금과 같은 색이 되어 강조가 사라진다.
*/
colors?: TemplateItem['colors'];
className?: string;
}) {
const specs = (
<div className="space-y-1 border-t border-stone-200/60 pt-1 text-xs text-stone-600">
<p className="flex items-center gap-1.5">
<span className="text-stone-400">•</span>
<span>수용 인원: {room.capacity}</span>
</p>
<p className="flex items-center gap-1.5">
<span className="text-stone-400">•</span>
<span>침대 구성: {room.bedInfo}</span>
</p>
<p className="flex items-center gap-1.5">
<span className="text-stone-400">•</span>
<span>면적: {room.size}</span>
</p>
</div>
);
const highlight = (
<div className="flex items-start gap-2 rounded-xl border border-amber-200/70 bg-amber-50/80 p-3 text-xs text-amber-950">
<Sparkles className="mt-0.5 size-4 shrink-0 text-amber-600" />
<div className="break-keep leading-relaxed">
<strong className="font-bold">차별점: </strong>
<span>{room.difference}</span>
</div>
</div>
);
const cover = (
<div
className={cn(
'relative overflow-hidden bg-stone-100',
layout === 'row' ? 'aspect-4/3 sm:aspect-auto sm:h-full' : 'aspect-16/10',
)}
>
<img src={room.images[0].url} alt={room.images[0].alt} className="size-full object-cover" />
<Pill tone="dark" className="absolute left-3 top-3 rounded-full px-2.5 py-1 text-[11px] backdrop-blur-md">
{room.type}
</Pill>
{layout === 'card' && (
<span className="absolute bottom-2.5 right-2.5 rounded-lg bg-white/95 px-2.5 py-1 text-xs font-bold text-stone-900 shadow-2xs backdrop-blur-md">
{index + 1} / {total}
</span>
)}
</div>
);
const body = (
<div className="space-y-3 p-4 sm:p-5">
<div className="space-y-1">
<h3
className="serif-title text-base font-bold leading-snug text-stone-900 sm:text-lg"
style={colors ? {color: colors.text} : undefined}
>
{room.name}
</h3>
<div
className="font-mono text-sm font-extrabold text-stone-900 sm:text-base"
style={colors ? {color: colors.primary} : undefined}
>
{room.price}
</div>
</div>
{highlight}
{specs}
</div>
);
const action = (
<div className="p-4 pt-0 sm:p-5 sm:pt-0">
<CtaLink href={bookingUrl} variant="solid" size="sm" colors={colors} block>
<span>실시간 예약 신청</span>
<ExternalLink className="size-3.5" />
</CtaLink>
</div>
);
if (layout === 'row') {
return (
<div
className={cn(
'grid grid-cols-1 overflow-hidden rounded-2xl border border-stone-200/90 bg-stone-50/70 shadow-2xs sm:grid-cols-12',
className,
)}
>
<div className="sm:col-span-5">{cover}</div>
<div className="flex flex-col justify-between sm:col-span-7">
{body}
{action}
</div>
</div>
);
}
return (
<div
className={cn(
'flex flex-col justify-between overflow-hidden rounded-2xl border border-stone-200/90 bg-stone-50/70 shadow-2xs',
className,
)}
>
<div>
{cover}
{body}
</div>
{action}
</div>
);
}
@@ -0,0 +1,47 @@
/**
* 객실 · 가로 슬라이드 — 모바일에서 한 칸씩 스와이프, PC 에서는 2열.
* 객실이 2~4개일 때 가장 자연스럽다.
*/
import {EmptyStateNotice, SectionBody, SectionFrame, SectionHeading} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {bookingHref} from '../common';
import {RoomCard, type Room} from './RoomCard';
export function RoomsCarousel(props: SectionRenderProps) {
const {section, isSelected, onSelect, industryId, storeName, template} = props;
const url = bookingHref(industryId, storeName);
// ★ 객실(unit)은 캔버스 계약에 없다 — 시연용 세트로 자리를 메우지 않는다.
const rooms: Room[] = [];
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="white">
<SectionBody>
<SectionHeading title={section.name} subtitle="자연을 오롯이 품은 객실 타입" colors={template.colors} />
{rooms.length === 0 ? (
<EmptyStateNotice>객실 정보는 아직 준비 중입니다.</EmptyStateNotice>
) : (
<div className="space-y-4">
<div className="scrollbar-none flex snap-x snap-mandatory gap-4 overflow-x-auto px-1 pb-4 sm:grid sm:grid-cols-2 sm:gap-6 sm:overflow-visible sm:pb-0">
{rooms.map((room, idx) => (
<RoomCard
key={room.slug}
room={room}
index={idx}
total={rooms.length}
bookingUrl={url}
className="w-[85vw] max-w-[340px] shrink-0 snap-center sm:w-full"
colors={template.colors}
/>
))}
</div>
<div className="flex items-center justify-center gap-2 pt-1 text-[11px] text-stone-400 sm:hidden">
<span>← 좌우로 스와이프하여 다른 객실을 확인하세요 →</span>
</div>
</div>
)}
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,45 @@
/**
* 객실 · 격자 — 전부 한눈에 늘어놓는다. 객실이 많고 비교해서 고르게 하고 싶을 때.
*/
import {EmptyStateNotice, SectionBody, SectionFrame, SectionHeading} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {bookingHref} from '../common';
import {RoomCard, type Room} from './RoomCard';
export function RoomsGrid(props: SectionRenderProps) {
const {section, isSelected, onSelect, industryId, storeName, template} = props;
const url = bookingHref(industryId, storeName);
// ★ 객실(unit)은 캔버스 계약에 없다 — 시연용 세트로 자리를 메우지 않는다.
const rooms: Room[] = [];
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="white">
<SectionBody width="wide">
<SectionHeading
variant="centered"
eyebrow="ROOMS"
title={section.name}
subtitle="원하는 객실을 비교해 보세요"
colors={template.colors}
/>
{rooms.length === 0 ? (
<EmptyStateNotice>객실 정보는 아직 준비 중입니다.</EmptyStateNotice>
) : (
<div className="grid grid-cols-1 gap-5 sm:grid-cols-2 lg:grid-cols-3">
{rooms.map((room, idx) => (
<RoomCard
key={room.slug}
room={room}
index={idx}
total={rooms.length}
bookingUrl={url}
colors={template.colors}
/>
))}
</div>
)}
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,42 @@
/**
* 객실 · 가로 목록 — 사진 왼쪽, 설명 오른쪽으로 한 줄씩.
* 객실마다 설명이 길 때 글을 넉넉히 읽힌다.
*/
import {EmptyStateNotice, SectionBody, SectionFrame, SectionHeading} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {bookingHref} from '../common';
import {RoomCard, type Room} from './RoomCard';
export function RoomsList(props: SectionRenderProps) {
const {section, isSelected, onSelect, industryId, storeName, template} = props;
const url = bookingHref(industryId, storeName);
// ★ 객실(unit)은 캔버스 계약(SectionRenderProps)에 없다 — 흘러올 창구가 생기기 전까지 빈다.
// 시연용 세트로 자리를 메우지 않는다: 남의 객실·요금이 사장님 사이트로 발행된다.
const rooms: Room[] = [];
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="tint">
<SectionBody>
<SectionHeading title={section.name} subtitle="객실별 구성과 차이를 자세히" colors={template.colors} />
{rooms.length === 0 ? (
<EmptyStateNotice>객실 정보는 아직 준비 중입니다.</EmptyStateNotice>
) : (
<div className="space-y-4">
{rooms.map((room, idx) => (
<RoomCard
key={room.slug}
room={room}
index={idx}
total={rooms.length}
bookingUrl={url}
layout="row"
colors={template.colors}
/>
))}
</div>
)}
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,51 @@
/**
* 이용 규정 · 카드 — 규정 하나에 칸 하나. 번호가 붙어 "빠뜨리지 말라"는 인상이 강하다.
* 노쇼·소음 클레임이 잦은 곳에 맞는다.
*/
import {ShieldCheck} from 'lucide-react';
import {EmptyStateNotice, SectionBody, SectionFrame, SectionHeading} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {ruleItems} from '../common';
export function RulesCards(props: SectionRenderProps) {
const {section, isSelected, onSelect, template} = props;
// ★ 규정을 지어내지 않는다 — 확인된 fact 에서만 만든다.
const items = ruleItems(props.infoFields);
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="tint">
<SectionBody>
<SectionHeading
variant="eyebrow"
eyebrow="HOUSE RULES"
title={section.name}
subtitle="예약 전 꼭 확인해 주세요"
trailing={<ShieldCheck className="size-5 text-stone-400" />}
/>
{items.length === 0 && (
<EmptyStateNotice>
확인된 이용 규정이 아직 없습니다 — 정보 탭에서 확인하면 여기에 나옵니다.
</EmptyStateNotice>
)}
<ol className="grid grid-cols-1 gap-2.5 sm:grid-cols-2">
{items.map((rule, idx) => (
<li
key={rule}
className="flex items-start gap-3 rounded-xl border border-stone-200/80 bg-white p-4 shadow-2xs"
>
<span
className="flex size-6 shrink-0 items-center justify-center rounded-full text-[11px] font-bold text-white"
style={{backgroundColor: template.colors.primary}}
>
{idx + 1}
</span>
<span className="text-xs leading-relaxed text-stone-700">{rule}</span>
</li>
))}
</ol>
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,58 @@
/**
* 이용 규정 · 목록 — 지켜야 할 것을 한 덩어리로 짧게. 가장 눈에 덜 띄는 형태.
*/
import {
SlateScriptRenderer,
type SlateElementNode,
type SlateTextNode,
} from '../../SlateScriptRenderer';
import {SectionBody, SectionFrame, SectionHeading} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {EmptyStateNotice} from '../../primitives';
import {ruleItems} from '../common';
export function RulesList(props: SectionRenderProps) {
const {section, isSelected, onSelect, template} = props;
// ★ 규정을 지어내지 않는다. 확인된 fact(체크인·체크아웃·취소규정·취사·반려동물…)에서만 만든다 —
// 예전에는 '체크인 16:00 / 체크아웃 11:00' 같은 가공의 규정이 모든 사업장에 똑같이 떴다.
const items = ruleItems(props.infoFields);
const script: (SlateElementNode | SlateTextNode)[] | undefined = undefined;
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="white">
<SectionBody>
<SectionHeading title={section.name} subtitle="이용 안내 및 규정" />
{items.length === 0 ? (
<EmptyStateNotice>
확인된 이용 규정이 아직 없습니다 — 정보 탭에서 확인하면 여기에 나옵니다.
</EmptyStateNotice>
) : (
<div className="space-y-2 rounded-xl border border-stone-200/80 bg-stone-50/60 p-4 text-xs shadow-2xs">
<strong className="mb-2 block font-bold text-stone-900">투숙 및 이용 수칙</strong>
{items.map((rule) => (
<p key={rule} className="text-stone-600">
• {rule}
</p>
))}
</div>
)}
{script && (
<div className="space-y-3 rounded-xl border border-stone-200 bg-stone-50 p-4 sm:p-5">
<div className="flex items-center justify-between border-b border-stone-200 pb-2">
<span className="flex items-center gap-1.5 text-xs font-bold text-stone-800">
<span className="size-2 rounded-full bg-stone-900" />
호스트-게스트 실시간 문의 & 대화 가이드
</span>
<span className="rounded border border-stone-200 bg-white px-2 py-0.5 font-mono text-[11px] text-stone-400">
Slate editor_script
</span>
</div>
<SlateScriptRenderer nodes={script} primaryColor={template.colors.primary} />
</div>
)}
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,28 @@
/**
* 공간 안내 · 목록 — 사진 없이 구역 이름과 설명만. 사진이 부실할 때 더 깔끔하다.
*/
import {ListCard, PlaceRow, SectionBody, SectionFrame, SectionHeading} from '../../primitives';
import type {SectionRenderProps} from '../../types';
export function SpaceList(props: SectionRenderProps) {
const {section, isSelected, onSelect, template, photos} = props;
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="tint">
<SectionBody width="narrow">
<SectionHeading variant="minimal" title={section.name} colors={template.colors} />
<ListCard>
{photos.map((photo) => (
<PlaceRow
key={photo.id}
name={photo.title}
meta={photo.category}
colors={template.colors}
/>
))}
</ListCard>
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,51 @@
/**
* 공간 안내 · 구역 카드 — 수집된 사진을 "어떤 자리인지"로 묶어 보여준다.
* 좌석/층 구성이 궁금한 카페·다이닝에 맞는다.
*/
import {PhotoTile, SectionBody, SectionFrame, SectionHeading} from '../../primitives';
import type {SectionRenderProps} from '../../types';
export function SpaceZones(props: SectionRenderProps) {
const {section, isSelected, onSelect, template, photos, infoFields} = props;
const seats = infoFields.find((f) => f.id === 'seats');
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="white">
<SectionBody>
<SectionHeading
title={section.name}
subtitle={section.description}
trailing={
seats && !seats.requiresVerification ? (
<span className="rounded-lg border border-stone-200 bg-stone-50 px-2.5 py-1 text-[11px] font-medium text-stone-600">
{seats.value}
</span>
) : null
}
colors={template.colors}
/>
<div className="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3">
{photos.map((photo) => (
<div key={photo.id} className="space-y-2">
<PhotoTile
photo={{id: photo.id, url: photo.url, alt: photo.title}}
fit="landscape"
showMeta={false}
/>
<div className="space-y-0.5 px-0.5">
<span
className="block text-xs font-bold text-stone-900"
style={{color: template.colors.text}}
>
{photo.title}
</span>
<span className="block text-[11px] text-stone-500">{photo.category}</span>
</div>
</div>
))}
</div>
</SectionBody>
</SectionFrame>
);
}
@@ -0,0 +1,27 @@
import {SectionBody, SectionFrame, SectionHeading} from '../../primitives';
import type {SectionRenderProps} from '../../types';
import {WeatherPanel} from '../local/WeatherPanel';
/** 에디터에서 순서·노출을 독립적으로 관리하는 날씨 섹션. */
export function WeatherSection({
section,
isSelected,
onSelect,
location,
weatherLocation,
template,
}: SectionRenderProps) {
return (
<SectionFrame section={section} isSelected={isSelected} onSelect={onSelect} tone="paper">
<SectionBody width="narrow">
<SectionHeading
variant="minimal"
title="오늘의 날씨"
subtitle={`${location || '사업장 주변'}의 현재 기상 정보입니다.`}
colors={template.colors}
/>
<WeatherPanel location={location} weatherLocation={weatherLocation} />
</SectionBody>
</SectionFrame>
);
}