@t3q-ui/design-system 1.63.2 → 1.65.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -400,27 +400,29 @@ type ChatPageSidePanel = {
400
400
  width?: 'small' | 'medium';
401
401
  };
402
402
  type ChatPageProps = ChatShellProps & {
403
- /** 화면 제목 (h1) */
403
+ /** 화면 제목 (h1). `logo` 를 주지 않으면 로고 자리에 이 글자가 보인다 — 기록 바를 접었거나 화면이 좁으면 화면에는 보이지 않고 스크린리더용 제목으로만 남는다. 본문 구역과 메시지 목록의 접근성 이름으로도 쓰인다 */
404
404
  title: string;
405
- /** 제목 바로 옆 자리 — 모델 선택(`SelectTrigger appearance='none'`)이나 상태 Badge */
405
+ /** 로고(이미지·아이콘·워드마크). 주면 제목 글자 대신 그린다 — 왼쪽 기록 바 맨 위, `history` 가 없으면 대화 영역 왼쪽 위(`status` 앞), 좁은 화면에서는 기록 Drawer 맨 위. 장식으로 그려지고(스크린리더는 건너뛴다) 화면 이름은 계속 `title`(h1)이 맡는다. 높이 32px·폭 200px 안쪽, 링크·버튼은 넣지 않는다. 로고 파일이 없으면 주지 않는다 */
406
+ logo?: ReactNode;
407
+ /** 대화 영역 맨 위 줄의 왼쪽 자리 — 모델 선택(`SelectTrigger appearance='none'`)이나 상태 Badge. `history` 가 없으면 로고(제목) 바로 오른쪽에 놓인다 */
406
408
  status?: ReactNode;
407
- /** 헤더 오른쪽 자리. `actions` 왼쪽에 놓인다 */
409
+ /** 대화 영역 맨 위 줄의 오른쪽 자리. `actions` 왼쪽에 놓인다 */
408
410
  titleRight?: ReactNode;
409
- /** 헤더 오른쪽 끝의 행동 버튼. 버튼 사이 8px 로 그린다 */
411
+ /** 대화 영역 맨 위 줄 오른쪽 끝의 행동 버튼. 버튼 사이 8px 로 그린다. 파라미터·설정처럼 아이콘만으로 뜻이 통하는 보조 행동은 아이콘만 있는 `IconButton`(`aria-label` 필수, 아이콘 20)을 권장한다 — `Tooltip` 은 패턴이 `TooltipProvider`(기본 지연)로 감싸 두어 바로 쓸 수 있다 */
410
412
  actions?: ReactNode;
411
- /** 왼쪽 대화 기록. 주면 기록 바(280px)와 헤더의 접기 버튼(제목·`status` 오른쪽)이 생긴다. 화면이 좁으면 Drawer 로 열린다 */
413
+ /** 왼쪽 대화 기록. 주면 기록 바(280px)가 생기고 맨 위에 로고(없으면 제목)와 접기 버튼이 놓인다. 접으면 펼치기 버튼과 새 대화·검색 버튼(각각 `onNew`·`search` 가 있을 때)만 남은 좁은 레일이 되고, 화면이 좁으면(패턴 폭 960px 미만) 레일 없이 Drawer 로 열린다 */
412
414
  history?: Omit<ChatHistoryProps, 'className'>;
413
415
  /** 오른쪽 패널. 열 때 객체를 주고 닫으면 undefined 로. 화면이 좁으면 Drawer 로 열린다 */
414
416
  sidePanel?: ChatPageSidePanel;
415
417
  };
416
418
  /**
417
- * 챗 화면 패턴(전체 화면형). 얇은 헤더 → [대화 기록 | 대화 + 입력창 | 옆 패널] 을 배치하고 스크롤·빈 화면·생성 상태를 맡는다.
419
+ * 챗 화면 패턴(전체 화면형). 상단 바 없이 [대화 기록 | 대화 + 입력창 | 옆 패널] 을 배치하고 스크롤·빈 화면·생성 상태를 맡는다.
418
420
  *
419
421
  * 언제 쓰나: AI와 대화하는 독립 화면(프롬프트 테스트·어시스턴트). 메시지·기록·전송·스트리밍은 소비 앱이 넘기고, 패턴은 배치와 자동 스크롤, 대기·오류 표시, 접근성 알림을 책임진다.
420
422
  * 언제 안 쓰나: 다른 화면 옆에 붙는 좁은 대화(→ ChatPanel), 댓글·활동 이력, 알림 목록(→ EventList).
421
- * 대신/함께: 부모가 높이를 가져야 한다 — 패턴은 그 높이를 채우고 메시지 목록만 스크롤한다(높이가 없으면 문서가 스크롤되고 입력창이 화면 아래에 붙는다). AI 답변 본문은 `@t3q-ui/design-system/markdown` 의 `Markdown` 으로 `content` 에 넘긴다. 생성 중에는 `streaming` 을 켜고 `onStop` 을 준다. 답변 실패는 항목의 `error`, 지난 대화를 불러오는 중·실패는 `loading`·`error`. 삭제 확인은 `history.onDelete` 에서 AlertDialog 로. 모델 선택은 제목 옆 `status` 에 `SelectTrigger appearance='none'` 으로, 파일 첨부와 켜고 끄는 옵션은 입력창의 `+` 메뉴(`onAttach`·`menu`)에, 파라미터 패널은 `sidePanel`.
423
+ * 대신/함께: 부모가 높이를 가져야 한다 — 패턴은 그 높이를 채우고 메시지 목록만 스크롤한다(높이가 없으면 문서가 스크롤되고 입력창이 화면 아래에 붙는다). AI 답변 본문은 `@t3q-ui/design-system/markdown` 의 `Markdown` 으로 `content` 에 넘긴다. 생성 중에는 `streaming` 을 켜고 `onStop` 을 준다. 답변 실패는 항목의 `error`, 지난 대화를 불러오는 중·실패는 `loading`·`error`. 삭제 확인은 `history.onDelete` 에서 AlertDialog 로. 로고(`logo`, 없으면 `title` 글자)와 접기 버튼은 왼쪽 기록 바 맨 위에, 모델 선택은 대화 영역 왼쪽 위 `status` 에 `SelectTrigger appearance='none'` 으로 둔다. 파라미터·설정처럼 아이콘만으로 뜻이 통하는 보조 행동은 오른쪽 위 `actions` 에 아이콘만 있는 `IconButton`(`aria-label` + `Tooltip`)을 권장한다(뜻이 모호하면 글자 있는 `Button`). 이 패턴 위에 `PageHeader` 나 제목 줄을 따로 두지 않는다(앱 공통 상단 바는 해당 없음). 파일 첨부와 켜고 끄는 옵션은 입력창의 `+` 메뉴(`onAttach`·`menu`)에, 파라미터 패널은 `sidePanel`.
422
424
  */
423
- declare function ChatPage({ title, status, titleRight, actions, history, sidePanel, ...shell }: ChatPageProps): react_jsx_runtime.JSX.Element;
425
+ declare function ChatPage({ title, logo, status, titleRight, actions, history, sidePanel, ...shell }: ChatPageProps): react_jsx_runtime.JSX.Element;
424
426
 
425
427
  type ChatPanelProps = ChatShellProps & {
426
428
  /** 패널 제목 (h2). 주지 않으면 헤더를 그리지 않는다 — 제목과 닫기 버튼이 이미 있는 Drawer 안에서 쓸 때 */
@@ -400,27 +400,29 @@ type ChatPageSidePanel = {
400
400
  width?: 'small' | 'medium';
401
401
  };
402
402
  type ChatPageProps = ChatShellProps & {
403
- /** 화면 제목 (h1) */
403
+ /** 화면 제목 (h1). `logo` 를 주지 않으면 로고 자리에 이 글자가 보인다 — 기록 바를 접었거나 화면이 좁으면 화면에는 보이지 않고 스크린리더용 제목으로만 남는다. 본문 구역과 메시지 목록의 접근성 이름으로도 쓰인다 */
404
404
  title: string;
405
- /** 제목 바로 옆 자리 — 모델 선택(`SelectTrigger appearance='none'`)이나 상태 Badge */
405
+ /** 로고(이미지·아이콘·워드마크). 주면 제목 글자 대신 그린다 — 왼쪽 기록 바 맨 위, `history` 가 없으면 대화 영역 왼쪽 위(`status` 앞), 좁은 화면에서는 기록 Drawer 맨 위. 장식으로 그려지고(스크린리더는 건너뛴다) 화면 이름은 계속 `title`(h1)이 맡는다. 높이 32px·폭 200px 안쪽, 링크·버튼은 넣지 않는다. 로고 파일이 없으면 주지 않는다 */
406
+ logo?: ReactNode;
407
+ /** 대화 영역 맨 위 줄의 왼쪽 자리 — 모델 선택(`SelectTrigger appearance='none'`)이나 상태 Badge. `history` 가 없으면 로고(제목) 바로 오른쪽에 놓인다 */
406
408
  status?: ReactNode;
407
- /** 헤더 오른쪽 자리. `actions` 왼쪽에 놓인다 */
409
+ /** 대화 영역 맨 위 줄의 오른쪽 자리. `actions` 왼쪽에 놓인다 */
408
410
  titleRight?: ReactNode;
409
- /** 헤더 오른쪽 끝의 행동 버튼. 버튼 사이 8px 로 그린다 */
411
+ /** 대화 영역 맨 위 줄 오른쪽 끝의 행동 버튼. 버튼 사이 8px 로 그린다. 파라미터·설정처럼 아이콘만으로 뜻이 통하는 보조 행동은 아이콘만 있는 `IconButton`(`aria-label` 필수, 아이콘 20)을 권장한다 — `Tooltip` 은 패턴이 `TooltipProvider`(기본 지연)로 감싸 두어 바로 쓸 수 있다 */
410
412
  actions?: ReactNode;
411
- /** 왼쪽 대화 기록. 주면 기록 바(280px)와 헤더의 접기 버튼(제목·`status` 오른쪽)이 생긴다. 화면이 좁으면 Drawer 로 열린다 */
413
+ /** 왼쪽 대화 기록. 주면 기록 바(280px)가 생기고 맨 위에 로고(없으면 제목)와 접기 버튼이 놓인다. 접으면 펼치기 버튼과 새 대화·검색 버튼(각각 `onNew`·`search` 가 있을 때)만 남은 좁은 레일이 되고, 화면이 좁으면(패턴 폭 960px 미만) 레일 없이 Drawer 로 열린다 */
412
414
  history?: Omit<ChatHistoryProps, 'className'>;
413
415
  /** 오른쪽 패널. 열 때 객체를 주고 닫으면 undefined 로. 화면이 좁으면 Drawer 로 열린다 */
414
416
  sidePanel?: ChatPageSidePanel;
415
417
  };
416
418
  /**
417
- * 챗 화면 패턴(전체 화면형). 얇은 헤더 → [대화 기록 | 대화 + 입력창 | 옆 패널] 을 배치하고 스크롤·빈 화면·생성 상태를 맡는다.
419
+ * 챗 화면 패턴(전체 화면형). 상단 바 없이 [대화 기록 | 대화 + 입력창 | 옆 패널] 을 배치하고 스크롤·빈 화면·생성 상태를 맡는다.
418
420
  *
419
421
  * 언제 쓰나: AI와 대화하는 독립 화면(프롬프트 테스트·어시스턴트). 메시지·기록·전송·스트리밍은 소비 앱이 넘기고, 패턴은 배치와 자동 스크롤, 대기·오류 표시, 접근성 알림을 책임진다.
420
422
  * 언제 안 쓰나: 다른 화면 옆에 붙는 좁은 대화(→ ChatPanel), 댓글·활동 이력, 알림 목록(→ EventList).
421
- * 대신/함께: 부모가 높이를 가져야 한다 — 패턴은 그 높이를 채우고 메시지 목록만 스크롤한다(높이가 없으면 문서가 스크롤되고 입력창이 화면 아래에 붙는다). AI 답변 본문은 `@t3q-ui/design-system/markdown` 의 `Markdown` 으로 `content` 에 넘긴다. 생성 중에는 `streaming` 을 켜고 `onStop` 을 준다. 답변 실패는 항목의 `error`, 지난 대화를 불러오는 중·실패는 `loading`·`error`. 삭제 확인은 `history.onDelete` 에서 AlertDialog 로. 모델 선택은 제목 옆 `status` 에 `SelectTrigger appearance='none'` 으로, 파일 첨부와 켜고 끄는 옵션은 입력창의 `+` 메뉴(`onAttach`·`menu`)에, 파라미터 패널은 `sidePanel`.
423
+ * 대신/함께: 부모가 높이를 가져야 한다 — 패턴은 그 높이를 채우고 메시지 목록만 스크롤한다(높이가 없으면 문서가 스크롤되고 입력창이 화면 아래에 붙는다). AI 답변 본문은 `@t3q-ui/design-system/markdown` 의 `Markdown` 으로 `content` 에 넘긴다. 생성 중에는 `streaming` 을 켜고 `onStop` 을 준다. 답변 실패는 항목의 `error`, 지난 대화를 불러오는 중·실패는 `loading`·`error`. 삭제 확인은 `history.onDelete` 에서 AlertDialog 로. 로고(`logo`, 없으면 `title` 글자)와 접기 버튼은 왼쪽 기록 바 맨 위에, 모델 선택은 대화 영역 왼쪽 위 `status` 에 `SelectTrigger appearance='none'` 으로 둔다. 파라미터·설정처럼 아이콘만으로 뜻이 통하는 보조 행동은 오른쪽 위 `actions` 에 아이콘만 있는 `IconButton`(`aria-label` + `Tooltip`)을 권장한다(뜻이 모호하면 글자 있는 `Button`). 이 패턴 위에 `PageHeader` 나 제목 줄을 따로 두지 않는다(앱 공통 상단 바는 해당 없음). 파일 첨부와 켜고 끄는 옵션은 입력창의 `+` 메뉴(`onAttach`·`menu`)에, 파라미터 패널은 `sidePanel`.
422
424
  */
423
- declare function ChatPage({ title, status, titleRight, actions, history, sidePanel, ...shell }: ChatPageProps): react_jsx_runtime.JSX.Element;
425
+ declare function ChatPage({ title, logo, status, titleRight, actions, history, sidePanel, ...shell }: ChatPageProps): react_jsx_runtime.JSX.Element;
424
426
 
425
427
  type ChatPanelProps = ChatShellProps & {
426
428
  /** 패널 제목 (h2). 주지 않으면 헤더를 그리지 않는다 — 제목과 닫기 버튼이 이미 있는 Drawer 안에서 쓸 때 */
@@ -1,7 +1,7 @@
1
- import { ChatMessage, Skeleton, EmptyBoxIllustration, Button, LucideIcon, ToggleGroup, ToggleGroupItem, PageHeader, Alert, AlertDescription, AgGridTable, getSortedColumnState, Pagination, Panel, Form, FormSectionLevelContext, FormFooter, Card, Drawer, DrawerContent, DrawerHeader, DrawerTitle, DrawerDescription, DrawerBody, DrawerFooter, Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter, ChatHistory, TwoLineCellRenderer, ChatComposer, DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator } from '../chunk-S6TTWFNU.js';
1
+ import { ChatMessage, Skeleton, EmptyBoxIllustration, Button, LucideIcon, ToggleGroup, ToggleGroupItem, PageHeader, Alert, AlertDescription, AgGridTable, getSortedColumnState, Pagination, Panel, Form, FormSectionLevelContext, FormFooter, Card, Drawer, DrawerContent, DrawerHeader, DrawerTitle, DrawerDescription, DrawerBody, DrawerFooter, Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter, TooltipProvider, ChatHistory, TwoLineCellRenderer, Tooltip, TooltipTrigger, TooltipContent, ChatComposer, DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator } from '../chunk-M7ZUGQR6.js';
2
2
  import { cn, TablePagination, IconButton } from '../chunk-DWF6AFPQ.js';
3
3
  import { memo, useRef, useEffect, useMemo, useId, useState, useCallback, useLayoutEffect, isValidElement } from 'react';
4
- import { RotateCcw, X, PanelLeft, TriangleAlert, ArrowDown, Ellipsis } from 'lucide-react';
4
+ import { RotateCcw, X, PanelLeft, Plus, Search, TriangleAlert, ArrowDown, Ellipsis } from 'lucide-react';
5
5
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
6
6
 
7
7
  // src/patterns/listPageRules.ts
@@ -903,32 +903,11 @@ var STATUS = {
903
903
  stopped: "\uC751\uB2F5 \uC0DD\uC131\uC744 \uC911\uC9C0\uD588\uC2B5\uB2C8\uB2E4",
904
904
  failed: "\uC751\uB2F5\uC744 \uC0DD\uC131\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4"
905
905
  };
906
- function ChatHeader({
907
- title,
908
- level,
909
- historyToggle,
910
- status,
911
- titleRight,
912
- actions
913
- }) {
914
- if (title == null && !historyToggle && !titleRight && !actions) return null;
915
- const Heading = level === 1 ? "h1" : "h2";
906
+ function ChatHeader({ title, actions }) {
907
+ if (title == null && !actions) return null;
916
908
  return /* @__PURE__ */ jsxs("header", { className: "flex shrink-0 items-center justify-between gap-[12px] border-b border-sys-divider-subtler bg-sys-background px-[16px] py-[8px]", children: [
917
- /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-[8px]", children: [
918
- title != null ? /* @__PURE__ */ jsx(
919
- Heading,
920
- {
921
- className: cn("truncate text-sys-text-main", level === 1 ? "text-h4" : "text-h5"),
922
- children: title
923
- }
924
- ) : null,
925
- status ? /* @__PURE__ */ jsx("div", { className: "flex shrink-0 items-center", children: status }) : null,
926
- historyToggle
927
- ] }),
928
- titleRight || actions ? /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-[8px]", children: [
929
- titleRight,
930
- actions
931
- ] }) : null
909
+ /* @__PURE__ */ jsx("div", { className: "flex min-w-0 items-center gap-[8px]", children: title != null ? /* @__PURE__ */ jsx("h2", { className: "truncate text-sys-text-main text-h5", children: title }) : null }),
910
+ actions ? /* @__PURE__ */ jsx("div", { className: "flex shrink-0 items-center gap-[8px]", children: actions }) : null
932
911
  ] });
933
912
  }
934
913
  function ChatConversation({
@@ -1198,6 +1177,7 @@ var SIDE_WIDTH = {
1198
1177
  };
1199
1178
  var HISTORY_INLINE_MIN = 960;
1200
1179
  var SIDE_INLINE_MIN = 1280;
1180
+ var SLIDE = "duration-300 ease-in-out motion-reduce:transition-none";
1201
1181
  function useWidth(ref) {
1202
1182
  const [width, setWidth] = useState(Number.POSITIVE_INFINITY);
1203
1183
  useEffect(() => {
@@ -1211,8 +1191,48 @@ function useWidth(ref) {
1211
1191
  }, [ref]);
1212
1192
  return width;
1213
1193
  }
1194
+ function Brand({
1195
+ heading = false,
1196
+ logo,
1197
+ title
1198
+ }) {
1199
+ const Root = heading ? "h1" : "div";
1200
+ return /* @__PURE__ */ jsx(
1201
+ Root,
1202
+ {
1203
+ "aria-hidden": heading ? void 0 : true,
1204
+ className: "flex min-w-0 items-center text-h4 text-sys-text-main",
1205
+ children: logo ? /* @__PURE__ */ jsxs(Fragment, { children: [
1206
+ /* @__PURE__ */ jsx(
1207
+ "span",
1208
+ {
1209
+ "aria-hidden": true,
1210
+ className: "flex h-[32px] min-w-0 items-center overflow-clip [&_img]:max-h-[32px] [&_img]:object-contain [&_svg]:max-h-[32px]",
1211
+ children: logo
1212
+ }
1213
+ ),
1214
+ heading ? /* @__PURE__ */ jsx("span", { className: "sr-only", children: title }) : null
1215
+ ] }) : (
1216
+ // 말줄임된 제목 전체는 브라우저 기본 말풍선으로 본다 — 기록 줄(chatHistory)과 같은 방식
1217
+ /* @__PURE__ */ jsx("span", { className: "min-w-0 truncate", title, children: title })
1218
+ )
1219
+ }
1220
+ );
1221
+ }
1222
+ function IconAction({
1223
+ label,
1224
+ side,
1225
+ children,
1226
+ ...props
1227
+ }) {
1228
+ return /* @__PURE__ */ jsxs(Tooltip, { children: [
1229
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(IconButton, { "aria-label": label, ...props, children }) }),
1230
+ /* @__PURE__ */ jsx(TooltipContent, { side, children: label })
1231
+ ] });
1232
+ }
1214
1233
  function ChatPage({
1215
1234
  title,
1235
+ logo,
1216
1236
  status,
1217
1237
  titleRight,
1218
1238
  actions,
@@ -1230,123 +1250,267 @@ function ChatPage({
1230
1250
  if (sidePanel && sidePanel !== lastSide) setLastSide(sidePanel);
1231
1251
  const side = sidePanel ?? lastSide;
1232
1252
  const sideOpen = Boolean(sidePanel);
1233
- const toggle = history ? /* @__PURE__ */ jsx(
1234
- IconButton,
1235
- {
1236
- variant: "secondaryLink",
1237
- "aria-label": historyInline ? collapsed ? "\uB300\uD654 \uAE30\uB85D \uD3BC\uCE58\uAE30" : "\uB300\uD654 \uAE30\uB85D \uC811\uAE30" : "\uB300\uD654 \uAE30\uB85D \uC5F4\uAE30",
1238
- "aria-expanded": historyInline ? !collapsed : drawerOpen,
1239
- onClick: () => historyInline ? setCollapsed((v) => !v) : setDrawerOpen(true),
1240
- children: /* @__PURE__ */ jsx(PanelLeft, { size: 20 })
1253
+ const hasTopRow = !(history && historyInline) || Boolean(status || titleRight || actions);
1254
+ const bodyRef = useRef(null);
1255
+ const hasHistory = Boolean(history);
1256
+ const focusSearchRef = useRef(false);
1257
+ useEffect(() => {
1258
+ const body = bodyRef.current;
1259
+ if (!body) return;
1260
+ body.toggleAttribute("inert", collapsed);
1261
+ if (!collapsed && focusSearchRef.current) {
1262
+ focusSearchRef.current = false;
1263
+ body.querySelector('input[aria-label="\uB300\uD654 \uAC80\uC0C9"]')?.focus();
1241
1264
  }
1242
- ) : null;
1243
- return /* @__PURE__ */ jsxs("div", { ref: rootRef, className: "flex h-full min-h-0 w-full flex-col bg-sys-background", children: [
1244
- /* @__PURE__ */ jsx(
1245
- ChatHeader,
1246
- {
1247
- level: 1,
1248
- title,
1249
- historyToggle: toggle,
1250
- status,
1251
- titleRight,
1252
- actions
1253
- }
1254
- ),
1255
- /* @__PURE__ */ jsxs("section", { "aria-label": title, className: "flex min-h-0 flex-1", children: [
1256
- history && historyInline ? (
1257
- // 접기·펴기는 바깥 폭만 280 ↔ 0 으로 움직이고 안쪽은 280 그대로 잘라 낸다 — 글자가 줄바꿈되며 출렁이지 않게.
1258
- // 접힌 뒤에는 visibility:hidden 이라 Tab·스크린리더가 닿지 않는다(visibility 는 줄어드는 동안 보이다가 끝에 숨는다)
1259
- /* @__PURE__ */ jsx(
1265
+ }, [collapsed, historyInline, hasHistory]);
1266
+ return (
1267
+ // PageHeader 와 같은 방식(기본 지연) — `actions` 에 넣은 Tooltip 도 이 안에서 동작한다
1268
+ /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsxs("div", { ref: rootRef, className: "flex h-full min-h-0 w-full flex-col bg-sys-background", children: [
1269
+ /* @__PURE__ */ jsxs("section", { "aria-label": title, className: "flex min-h-0 flex-1", children: [
1270
+ history && historyInline ? (
1271
+ // 기록 바: 접기·펴기는 바깥 폭만 280 ↔ 56(레일)으로 움직인다.
1272
+ // overflow-clip — 잘린 내용에 포커스가 가도 상자가 옆으로 밀리지 않는다(hidden 은 스크롤된다)
1273
+ /* @__PURE__ */ jsxs(
1274
+ "div",
1275
+ {
1276
+ className: cn(
1277
+ "flex shrink-0 flex-col gap-[12px] overflow-clip p-[12px] transition-[width]",
1278
+ SLIDE,
1279
+ collapsed ? "w-[56px]" : "w-[280px]"
1280
+ ),
1281
+ children: [
1282
+ /* @__PURE__ */ jsxs("div", { className: "flex h-[32px] shrink-0 items-center", children: [
1283
+ /* @__PURE__ */ jsx(
1284
+ "div",
1285
+ {
1286
+ className: cn(
1287
+ "min-w-0 flex-1 overflow-x-clip transition-opacity",
1288
+ SLIDE,
1289
+ collapsed ? "opacity-0" : "opacity-100"
1290
+ ),
1291
+ children: /* @__PURE__ */ jsx("div", { className: "w-[224px] pr-[8px] pl-[12px]", children: /* @__PURE__ */ jsx(Brand, { heading: true, logo, title }) })
1292
+ }
1293
+ ),
1294
+ /* @__PURE__ */ jsx(
1295
+ IconAction,
1296
+ {
1297
+ variant: "secondaryLink",
1298
+ className: "shrink-0",
1299
+ label: collapsed ? "\uB300\uD654 \uAE30\uB85D \uD3BC\uCE58\uAE30" : "\uB300\uD654 \uAE30\uB85D \uC811\uAE30",
1300
+ side: collapsed ? "right" : "bottom",
1301
+ "aria-expanded": !collapsed,
1302
+ onClick: (e) => {
1303
+ e.currentTarget.focus();
1304
+ setCollapsed((v) => !v);
1305
+ },
1306
+ children: /* @__PURE__ */ jsx(PanelLeft, { size: 20 })
1307
+ }
1308
+ )
1309
+ ] }),
1310
+ /* @__PURE__ */ jsxs("div", { className: "relative flex min-h-0 flex-1", children: [
1311
+ collapsed && (history.onNew || history.search) ? (
1312
+ // 레일의 버튼들 — 접힌 동안에만 있다. 펼친 "새 대화"·검색창이 있던 높이에서 나타난다(버튼 32, 사이 12)
1313
+ /* @__PURE__ */ jsxs("div", { className: "absolute top-[2px] left-0 flex flex-col gap-[12px] animate-[fade-in_300ms_ease-in-out] motion-reduce:animate-none", children: [
1314
+ history.onNew ? /* @__PURE__ */ jsx(
1315
+ IconAction,
1316
+ {
1317
+ variant: "primaryLink",
1318
+ label: "\uC0C8 \uB300\uD654",
1319
+ side: "right",
1320
+ onClick: history.onNew,
1321
+ children: /* @__PURE__ */ jsx(Plus, { size: 20 })
1322
+ }
1323
+ ) : null,
1324
+ history.search ? /* @__PURE__ */ jsx(
1325
+ IconAction,
1326
+ {
1327
+ variant: "secondaryLink",
1328
+ label: "\uB300\uD654 \uAC80\uC0C9",
1329
+ side: "right",
1330
+ onClick: () => {
1331
+ focusSearchRef.current = true;
1332
+ setCollapsed(false);
1333
+ },
1334
+ children: /* @__PURE__ */ jsx(Search, { size: 20 })
1335
+ }
1336
+ ) : null
1337
+ ] })
1338
+ ) : null,
1339
+ /* @__PURE__ */ jsx(
1340
+ "div",
1341
+ {
1342
+ ref: bodyRef,
1343
+ "aria-hidden": collapsed || void 0,
1344
+ className: cn(
1345
+ "flex w-[256px] shrink-0 flex-col",
1346
+ SLIDE,
1347
+ // visibility 는 숨길 때만 전환에 넣는다(흐려지는 동안 보이다가 끝에 숨는다). 펼칠 때는 바로 보여야 한다 —
1348
+ // visibility 전환은 시작 순간에 아직 hidden 으로 계산돼서, 레일의 검색 버튼이 보내는 포커스가 검색창에 닿지 않는다
1349
+ collapsed ? "invisible opacity-0 transition-[opacity,visibility]" : "visible opacity-100 transition-opacity"
1350
+ ),
1351
+ children: /* @__PURE__ */ jsx(ChatHistory, { ...history, className: "flex-1" })
1352
+ }
1353
+ )
1354
+ ] })
1355
+ ]
1356
+ }
1357
+ )
1358
+ ) : null,
1359
+ /* @__PURE__ */ jsxs(
1260
1360
  "div",
1261
1361
  {
1262
1362
  className: cn(
1263
- "shrink-0 overflow-hidden transition-[width,visibility] duration-300 ease-in-out motion-reduce:transition-none",
1264
- collapsed ? "invisible w-0" : "visible w-[280px]"
1363
+ "flex min-h-0 min-w-0 flex-1 flex-col",
1364
+ history && historyInline && "border-l border-sys-divider-subtler"
1265
1365
  ),
1266
- children: /* @__PURE__ */ jsx("div", { className: "flex h-full w-[280px] flex-col border-r border-sys-divider-subtler p-[12px]", children: /* @__PURE__ */ jsx(ChatHistory, { ...history, className: "flex-1" }) })
1366
+ children: [
1367
+ hasTopRow ? (
1368
+ // 맨 위 줄: ChatConversation 의 형제라 로딩·오류 화면에서도 남는다. 아래에 선·배경을 두지 않는다 —
1369
+ // 빈 대화의 바탕 그라데이션은 위쪽 끝색이 바탕색과 같아 이음매가 없다.
1370
+ // 줄 높이는 32 — 36px 모델 선택은 위아래로 2px 씩 넘친다(Panel 제목 줄과 같은 방식)
1371
+ /* @__PURE__ */ jsx("div", { className: "shrink-0 px-[12px] pt-[12px] pb-[8px]", children: /* @__PURE__ */ jsxs("div", { className: "flex h-[32px] items-center justify-between gap-[12px]", children: [
1372
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-[8px]", children: [
1373
+ history && !historyInline ? (
1374
+ // 넓은 화면의 접기 버튼과는 다른 요소다 — 폭이 960 을 넘나들면 버튼에 있던 포커스는 이어지지 않는다
1375
+ // (다음 Tab 이 바로 이 버튼이라 따로 옮기지 않는다)
1376
+ /* @__PURE__ */ jsx(
1377
+ IconAction,
1378
+ {
1379
+ variant: "secondaryLink",
1380
+ className: "shrink-0",
1381
+ label: "\uB300\uD654 \uAE30\uB85D \uC5F4\uAE30",
1382
+ side: "bottom",
1383
+ "aria-expanded": drawerOpen,
1384
+ onClick: (e) => {
1385
+ e.currentTarget.focus();
1386
+ setDrawerOpen(true);
1387
+ },
1388
+ children: /* @__PURE__ */ jsx(PanelLeft, { size: 20 })
1389
+ }
1390
+ )
1391
+ ) : null,
1392
+ history && historyInline ? null : history ? (
1393
+ // 좁은 화면: 로고는 Drawer 안에 있고, 제목은 화면 밖 글자로 남긴다
1394
+ /* @__PURE__ */ jsx("h1", { className: "sr-only", children: title })
1395
+ ) : /* @__PURE__ */ jsx("div", { className: "min-w-0 pl-[4px]", children: /* @__PURE__ */ jsx(Brand, { heading: true, logo, title }) }),
1396
+ status ? /* @__PURE__ */ jsx("div", { className: "flex shrink-0 items-center", children: status }) : null
1397
+ ] }),
1398
+ titleRight || actions ? /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-[8px]", children: [
1399
+ titleRight,
1400
+ actions
1401
+ ] }) : null
1402
+ ] }) })
1403
+ ) : null,
1404
+ /* @__PURE__ */ jsx(ChatConversation, { variant: "page", label: `${title} \uB300\uD654`, ...shell })
1405
+ ]
1267
1406
  }
1268
- )
1269
- ) : null,
1270
- /* @__PURE__ */ jsx("div", { className: "flex min-h-0 min-w-0 flex-1 flex-col", children: /* @__PURE__ */ jsx(ChatConversation, { variant: "page", label: `${title} \uB300\uD654`, ...shell }) }),
1271
- sideInline ? (
1272
- // 열고 닫기는 기록 바와 같은 방식 — 바깥 폭만 0 ↔ 패널 폭으로 움직인다
1407
+ ),
1408
+ sideInline ? (
1409
+ // 열고 닫기는 기록 바와 같은 방식 — 바깥 폭만 0 ↔ 패널 폭으로 움직인다
1410
+ /* @__PURE__ */ jsx(
1411
+ "div",
1412
+ {
1413
+ className: cn(
1414
+ "shrink-0 overflow-hidden transition-[width,visibility] duration-300 ease-in-out motion-reduce:transition-none",
1415
+ sideOpen ? cn("visible", SIDE_WIDTH[side?.width ?? "medium"]) : "invisible w-0"
1416
+ ),
1417
+ onTransitionEnd: (e) => {
1418
+ if (e.target === e.currentTarget && e.propertyName === "width" && !sidePanel)
1419
+ setLastSide(void 0);
1420
+ },
1421
+ children: side ? (
1422
+ // <aside> 는 다른 landmark 안에 둘 수 없어(axe landmark-complementary-is-top-level) 이름 있는 section(Panel) — ListPage 의 detail 과 같다
1423
+ /* @__PURE__ */ jsx(
1424
+ Panel,
1425
+ {
1426
+ appearance: "none",
1427
+ padding: "large",
1428
+ title: side.title,
1429
+ description: side.description,
1430
+ titleRight: /* @__PURE__ */ jsx(
1431
+ IconButton,
1432
+ {
1433
+ type: "button",
1434
+ variant: "secondary",
1435
+ "aria-label": "\uB2EB\uAE30",
1436
+ onClick: side.onClose,
1437
+ children: /* @__PURE__ */ jsx(X, { size: 20 })
1438
+ }
1439
+ ),
1440
+ footer: side.footer,
1441
+ className: cn(
1442
+ "h-full min-h-0 border-l border-sys-divider-subtler px-[24px] pt-[16px] pb-[24px]",
1443
+ SIDE_WIDTH[side.width ?? "medium"]
1444
+ ),
1445
+ children: /* @__PURE__ */ jsx(
1446
+ "div",
1447
+ {
1448
+ tabIndex: 0,
1449
+ className: "-mx-[4px] min-h-0 flex-1 overflow-y-auto px-[4px] outline-none focus-visible:ring-[2px] focus-visible:ring-inset focus-visible:ring-sys-focus-ring-main",
1450
+ children: side.children
1451
+ }
1452
+ )
1453
+ }
1454
+ )
1455
+ ) : null
1456
+ }
1457
+ )
1458
+ ) : null
1459
+ ] }),
1460
+ history && !historyInline ? /* @__PURE__ */ jsx(Drawer, { open: drawerOpen, onOpenChange: setDrawerOpen, children: /* @__PURE__ */ jsxs(DrawerContent, { side: "left", size: "small", children: [
1461
+ /* @__PURE__ */ jsxs(DrawerHeader, { children: [
1462
+ /* @__PURE__ */ jsx(DrawerTitle, { className: "sr-only", children: "\uB300\uD654 \uAE30\uB85D" }),
1463
+ /* @__PURE__ */ jsx("div", { className: "flex h-[24px] min-w-0 items-center pr-[32px] pl-[12px]", children: /* @__PURE__ */ jsx(Brand, { logo, title }) })
1464
+ ] }),
1465
+ /* @__PURE__ */ jsx("div", { className: "flex min-h-0 flex-1 flex-col px-[24px] pb-[24px]", children: /* @__PURE__ */ jsx(
1466
+ ChatHistory,
1467
+ {
1468
+ ...history,
1469
+ className: "flex-1",
1470
+ onSelect: (id) => {
1471
+ history.onSelect(id);
1472
+ setDrawerOpen(false);
1473
+ },
1474
+ onNew: history.onNew ? () => {
1475
+ history.onNew?.();
1476
+ setDrawerOpen(false);
1477
+ } : void 0
1478
+ }
1479
+ ) })
1480
+ ] }) }) : null,
1481
+ side && !sideInline ? (
1482
+ // 닫을 때 Drawer 를 지우지 않고 open 만 내린다 — 지우면 닫힘 애니메이션이 돌 틈 없이 바로 사라진다.
1483
+ // 닫히는 동안에는 마지막으로 받은 패널(side)을 그대로 그린다
1273
1484
  /* @__PURE__ */ jsx(
1274
- "div",
1485
+ Drawer,
1275
1486
  {
1276
- className: cn(
1277
- "shrink-0 overflow-hidden transition-[width,visibility] duration-300 ease-in-out motion-reduce:transition-none",
1278
- sideOpen ? cn("visible", SIDE_WIDTH[side?.width ?? "medium"]) : "invisible w-0"
1279
- ),
1280
- onTransitionEnd: (e) => {
1281
- if (e.target === e.currentTarget && e.propertyName === "width" && !sidePanel)
1282
- setLastSide(void 0);
1487
+ open: sideOpen,
1488
+ onOpenChange: (open) => {
1489
+ if (!open) sidePanel?.onClose();
1283
1490
  },
1284
- children: side ? (
1285
- // <aside> 는 다른 landmark 안에 둘 수 없어(axe landmark-complementary-is-top-level) 이름 있는 section(Panel) — ListPage 의 detail 과 같다
1286
- /* @__PURE__ */ jsx(
1287
- Panel,
1288
- {
1289
- appearance: "none",
1290
- padding: "large",
1291
- title: side.title,
1292
- description: side.description,
1293
- titleRight: /* @__PURE__ */ jsx(
1294
- IconButton,
1295
- {
1296
- type: "button",
1297
- variant: "secondary",
1298
- "aria-label": "\uB2EB\uAE30",
1299
- onClick: side.onClose,
1300
- children: /* @__PURE__ */ jsx(X, { size: 20 })
1301
- }
1302
- ),
1303
- footer: side.footer,
1304
- className: cn(
1305
- "h-full min-h-0 border-l border-sys-divider-subtler p-[24px]",
1306
- SIDE_WIDTH[side.width ?? "medium"]
1307
- ),
1308
- children: /* @__PURE__ */ jsx(
1309
- "div",
1310
- {
1311
- tabIndex: 0,
1312
- className: "-mx-[4px] min-h-0 flex-1 overflow-y-auto px-[4px] outline-none focus-visible:ring-[2px] focus-visible:ring-inset focus-visible:ring-sys-focus-ring-main",
1313
- children: side.children
1314
- }
1315
- )
1316
- }
1317
- )
1318
- ) : null
1491
+ children: /* @__PURE__ */ jsxs(
1492
+ DrawerContent,
1493
+ {
1494
+ side: "right",
1495
+ size: side.width ?? "medium",
1496
+ onCloseAutoFocus: () => {
1497
+ if (!sidePanel) setLastSide(void 0);
1498
+ },
1499
+ children: [
1500
+ /* @__PURE__ */ jsxs(DrawerHeader, { children: [
1501
+ /* @__PURE__ */ jsx(DrawerTitle, { children: side.title }),
1502
+ side.description ? /* @__PURE__ */ jsx(DrawerDescription, { children: side.description }) : null
1503
+ ] }),
1504
+ /* @__PURE__ */ jsx(DrawerBody, { className: "px-[24px] pb-[24px]", children: side.children }),
1505
+ side.footer ? /* @__PURE__ */ jsx(DrawerFooter, { children: side.footer }) : null
1506
+ ]
1507
+ }
1508
+ )
1319
1509
  }
1320
1510
  )
1321
1511
  ) : null
1322
- ] }),
1323
- history && !historyInline ? /* @__PURE__ */ jsx(Drawer, { open: drawerOpen, onOpenChange: setDrawerOpen, children: /* @__PURE__ */ jsxs(DrawerContent, { side: "left", size: "small", children: [
1324
- /* @__PURE__ */ jsx(DrawerHeader, { children: /* @__PURE__ */ jsx(DrawerTitle, { children: "\uB300\uD654 \uAE30\uB85D" }) }),
1325
- /* @__PURE__ */ jsx("div", { className: "flex min-h-0 flex-1 flex-col px-[24px] pb-[24px]", children: /* @__PURE__ */ jsx(
1326
- ChatHistory,
1327
- {
1328
- ...history,
1329
- className: "flex-1",
1330
- onSelect: (id) => {
1331
- history.onSelect(id);
1332
- setDrawerOpen(false);
1333
- },
1334
- onNew: history.onNew ? () => {
1335
- history.onNew?.();
1336
- setDrawerOpen(false);
1337
- } : void 0
1338
- }
1339
- ) })
1340
- ] }) }) : null,
1341
- sidePanel && !sideInline ? /* @__PURE__ */ jsx(Drawer, { open: true, onOpenChange: (open) => open ? void 0 : sidePanel.onClose(), children: /* @__PURE__ */ jsxs(DrawerContent, { side: "right", size: sidePanel.width ?? "medium", children: [
1342
- /* @__PURE__ */ jsxs(DrawerHeader, { children: [
1343
- /* @__PURE__ */ jsx(DrawerTitle, { children: sidePanel.title }),
1344
- sidePanel.description ? /* @__PURE__ */ jsx(DrawerDescription, { children: sidePanel.description }) : null
1345
- ] }),
1346
- /* @__PURE__ */ jsx(DrawerBody, { className: "px-[24px] pb-[24px]", children: sidePanel.children }),
1347
- sidePanel.footer ? /* @__PURE__ */ jsx(DrawerFooter, { children: sidePanel.footer }) : null
1348
- ] }) }) : null
1349
- ] });
1512
+ ] }) })
1513
+ );
1350
1514
  }
1351
1515
  function ChatPanel({
1352
1516
  title,
@@ -1357,26 +1521,28 @@ function ChatPanel({
1357
1521
  ...shell
1358
1522
  }) {
1359
1523
  const name = typeof title === "string" ? title : label;
1360
- return /* @__PURE__ */ jsxs(
1361
- "section",
1362
- {
1363
- "aria-label": name,
1364
- className: cn("flex h-full min-h-0 w-full flex-col bg-sys-background", className),
1365
- children: [
1366
- /* @__PURE__ */ jsx(
1367
- ChatHeader,
1368
- {
1369
- level: 2,
1370
- title,
1371
- actions: actions || onClose ? /* @__PURE__ */ jsxs(Fragment, { children: [
1372
- actions,
1373
- onClose ? /* @__PURE__ */ jsx(IconButton, { type: "button", variant: "secondary", "aria-label": "\uB2EB\uAE30", onClick: onClose, children: /* @__PURE__ */ jsx(X, { size: 20 }) }) : null
1374
- ] }) : null
1375
- }
1376
- ),
1377
- /* @__PURE__ */ jsx(ChatConversation, { variant: "panel", label: `${name} \uB300\uD654`, ...shell })
1378
- ]
1379
- }
1524
+ return (
1525
+ // `actions` 에 Tooltip 을 단 아이콘 버튼을 넣어도 깨지지 않게 감싼다 — PageHeader·ChatPage 와 같은 방식(기본 지연)
1526
+ /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsxs(
1527
+ "section",
1528
+ {
1529
+ "aria-label": name,
1530
+ className: cn("flex h-full min-h-0 w-full flex-col bg-sys-background", className),
1531
+ children: [
1532
+ /* @__PURE__ */ jsx(
1533
+ ChatHeader,
1534
+ {
1535
+ title,
1536
+ actions: actions || onClose ? /* @__PURE__ */ jsxs(Fragment, { children: [
1537
+ actions,
1538
+ onClose ? /* @__PURE__ */ jsx(IconButton, { type: "button", variant: "secondary", "aria-label": "\uB2EB\uAE30", onClick: onClose, children: /* @__PURE__ */ jsx(X, { size: 20 }) }) : null
1539
+ ] }) : null
1540
+ }
1541
+ ),
1542
+ /* @__PURE__ */ jsx(ChatConversation, { variant: "panel", label: `${name} \uB300\uD654`, ...shell })
1543
+ ]
1544
+ }
1545
+ ) })
1380
1546
  );
1381
1547
  }
1382
1548