@t3q-ui/design-system 1.63.2 → 1.64.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.
- package/CHANGELOG.md +13 -0
- package/dist/{chunk-LIXLOSPF.cjs → chunk-LLVWCDR5.cjs} +56 -28
- package/dist/chunk-LLVWCDR5.cjs.map +1 -0
- package/dist/{chunk-S6TTWFNU.js → chunk-MWVKFIOX.js} +56 -28
- package/dist/chunk-MWVKFIOX.js.map +1 -0
- package/dist/index.cjs +223 -223
- package/dist/index.js +2 -2
- package/dist/patterns/index.cjs +332 -213
- package/dist/patterns/index.cjs.map +1 -1
- package/dist/patterns/index.d.cts +10 -8
- package/dist/patterns/index.d.ts +10 -8
- package/dist/patterns/index.js +274 -155
- package/dist/patterns/index.js.map +1 -1
- package/mcp/manifests/components.json +61 -35
- package/package.json +1 -1
- package/skills/tds/SKILL.md +2 -2
- package/skills/tds/examples/chat-page.tsx +26 -13
- package/skills/tds/reference/components.md +8 -7
- package/dist/chunk-LIXLOSPF.cjs.map +0 -1
- package/dist/chunk-S6TTWFNU.js.map +0 -1
|
@@ -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
|
-
/** 제목
|
|
405
|
+
/** 로고(이미지·아이콘·워드마크). 주면 제목 글자 대신 그린다 — 왼쪽 기록 바 맨 위, `history` 가 없으면 대화 영역 왼쪽 위(`status` 앞), 좁은 화면에서는 기록 Drawer 맨 위. 장식으로 그려지고(스크린리더는 건너뛴다) 화면 이름은 계속 `title`(h1)이 맡는다. 높이 32px·폭 200px 안쪽, 링크·버튼은 넣지 않는다. 로고 파일이 없으면 주지 않는다 */
|
|
406
|
+
logo?: ReactNode;
|
|
407
|
+
/** 대화 영역 맨 위 줄의 왼쪽 자리 — 모델 선택(`SelectTrigger appearance='none'`)이나 상태 Badge. `history` 가 없으면 로고(제목) 바로 오른쪽에 놓인다 */
|
|
406
408
|
status?: ReactNode;
|
|
407
|
-
/**
|
|
409
|
+
/** 대화 영역 맨 위 줄의 오른쪽 자리. `actions` 왼쪽에 놓인다 */
|
|
408
410
|
titleRight?: ReactNode;
|
|
409
|
-
/**
|
|
411
|
+
/** 대화 영역 맨 위 줄 오른쪽 끝의 행동 버튼. 버튼 사이 8px 로 그린다. 파라미터·설정처럼 아이콘만으로 뜻이 통하는 보조 행동은 아이콘만 있는 `IconButton`(`aria-label` 필수, 아이콘 20)을 권장한다 — `Tooltip` 은 패턴이 `TooltipProvider`(기본 지연)로 감싸 두어 바로 쓸 수 있다 */
|
|
410
412
|
actions?: ReactNode;
|
|
411
|
-
/** 왼쪽 대화 기록. 주면 기록 바(280px)와
|
|
413
|
+
/** 왼쪽 대화 기록. 주면 기록 바(280px)가 생기고 맨 위에 로고(없으면 제목)와 접기 버튼이 놓인다. 접으면 펼치기 버튼과 새 대화 버튼(`onNew` 가 있을 때)만 남은 좁은 레일이 되고, 화면이 좁으면(패턴 폭 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 로. 모델 선택은
|
|
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 안에서 쓸 때 */
|
package/dist/patterns/index.d.ts
CHANGED
|
@@ -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
|
-
/** 제목
|
|
405
|
+
/** 로고(이미지·아이콘·워드마크). 주면 제목 글자 대신 그린다 — 왼쪽 기록 바 맨 위, `history` 가 없으면 대화 영역 왼쪽 위(`status` 앞), 좁은 화면에서는 기록 Drawer 맨 위. 장식으로 그려지고(스크린리더는 건너뛴다) 화면 이름은 계속 `title`(h1)이 맡는다. 높이 32px·폭 200px 안쪽, 링크·버튼은 넣지 않는다. 로고 파일이 없으면 주지 않는다 */
|
|
406
|
+
logo?: ReactNode;
|
|
407
|
+
/** 대화 영역 맨 위 줄의 왼쪽 자리 — 모델 선택(`SelectTrigger appearance='none'`)이나 상태 Badge. `history` 가 없으면 로고(제목) 바로 오른쪽에 놓인다 */
|
|
406
408
|
status?: ReactNode;
|
|
407
|
-
/**
|
|
409
|
+
/** 대화 영역 맨 위 줄의 오른쪽 자리. `actions` 왼쪽에 놓인다 */
|
|
408
410
|
titleRight?: ReactNode;
|
|
409
|
-
/**
|
|
411
|
+
/** 대화 영역 맨 위 줄 오른쪽 끝의 행동 버튼. 버튼 사이 8px 로 그린다. 파라미터·설정처럼 아이콘만으로 뜻이 통하는 보조 행동은 아이콘만 있는 `IconButton`(`aria-label` 필수, 아이콘 20)을 권장한다 — `Tooltip` 은 패턴이 `TooltipProvider`(기본 지연)로 감싸 두어 바로 쓸 수 있다 */
|
|
410
412
|
actions?: ReactNode;
|
|
411
|
-
/** 왼쪽 대화 기록. 주면 기록 바(280px)와
|
|
413
|
+
/** 왼쪽 대화 기록. 주면 기록 바(280px)가 생기고 맨 위에 로고(없으면 제목)와 접기 버튼이 놓인다. 접으면 펼치기 버튼과 새 대화 버튼(`onNew` 가 있을 때)만 남은 좁은 레일이 되고, 화면이 좁으면(패턴 폭 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 로. 모델 선택은
|
|
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 안에서 쓸 때 */
|
package/dist/patterns/index.js
CHANGED
|
@@ -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-
|
|
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-MWVKFIOX.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, 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__ */
|
|
918
|
-
|
|
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,220 @@ function ChatPage({
|
|
|
1230
1250
|
if (sidePanel && sidePanel !== lastSide) setLastSide(sidePanel);
|
|
1231
1251
|
const side = sidePanel ?? lastSide;
|
|
1232
1252
|
const sideOpen = Boolean(sidePanel);
|
|
1233
|
-
const
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
// 접힌 뒤에는 visibility:hidden 이라 Tab·스크린리더가 닿지 않는다(visibility 는 줄어드는 동안 보이다가 끝에 숨는다)
|
|
1259
|
-
/* @__PURE__ */ jsx(
|
|
1260
|
-
"div",
|
|
1261
|
-
{
|
|
1262
|
-
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]"
|
|
1265
|
-
),
|
|
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" }) })
|
|
1267
|
-
}
|
|
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 ↔ 패널 폭으로 움직인다
|
|
1273
|
-
/* @__PURE__ */ jsx(
|
|
1274
|
-
"div",
|
|
1275
|
-
{
|
|
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);
|
|
1283
|
-
},
|
|
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,
|
|
1253
|
+
const hasTopRow = !(history && historyInline) || Boolean(status || titleRight || actions);
|
|
1254
|
+
const bodyRef = useRef(null);
|
|
1255
|
+
const hasHistory = Boolean(history);
|
|
1256
|
+
useEffect(() => {
|
|
1257
|
+
bodyRef.current?.toggleAttribute("inert", collapsed);
|
|
1258
|
+
}, [collapsed, historyInline, hasHistory]);
|
|
1259
|
+
return (
|
|
1260
|
+
// PageHeader 와 같은 방식(기본 지연) — `actions` 에 넣은 Tooltip 도 이 안에서 동작한다
|
|
1261
|
+
/* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsxs("div", { ref: rootRef, className: "flex h-full min-h-0 w-full flex-col bg-sys-background", children: [
|
|
1262
|
+
/* @__PURE__ */ jsxs("section", { "aria-label": title, className: "flex min-h-0 flex-1", children: [
|
|
1263
|
+
history && historyInline ? (
|
|
1264
|
+
// 기록 바: 접기·펴기는 바깥 폭만 280 ↔ 56(레일)으로 움직인다.
|
|
1265
|
+
// overflow-clip — 잘린 내용에 포커스가 가도 상자가 옆으로 밀리지 않는다(hidden 은 스크롤된다)
|
|
1266
|
+
/* @__PURE__ */ jsxs(
|
|
1267
|
+
"div",
|
|
1268
|
+
{
|
|
1269
|
+
className: cn(
|
|
1270
|
+
"flex shrink-0 flex-col gap-[12px] overflow-clip p-[12px] transition-[width]",
|
|
1271
|
+
SLIDE,
|
|
1272
|
+
collapsed ? "w-[56px]" : "w-[280px]"
|
|
1273
|
+
),
|
|
1274
|
+
children: [
|
|
1275
|
+
/* @__PURE__ */ jsxs("div", { className: "flex h-[32px] shrink-0 items-center", children: [
|
|
1276
|
+
/* @__PURE__ */ jsx(
|
|
1277
|
+
"div",
|
|
1295
1278
|
{
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1279
|
+
className: cn(
|
|
1280
|
+
"min-w-0 flex-1 overflow-x-clip transition-opacity",
|
|
1281
|
+
SLIDE,
|
|
1282
|
+
collapsed ? "opacity-0" : "opacity-100"
|
|
1283
|
+
),
|
|
1284
|
+
children: /* @__PURE__ */ jsx("div", { className: "w-[224px] pr-[8px] pl-[12px]", children: /* @__PURE__ */ jsx(Brand, { heading: true, logo, title }) })
|
|
1301
1285
|
}
|
|
1302
1286
|
),
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1287
|
+
/* @__PURE__ */ jsx(
|
|
1288
|
+
IconAction,
|
|
1289
|
+
{
|
|
1290
|
+
variant: "secondaryLink",
|
|
1291
|
+
className: "shrink-0",
|
|
1292
|
+
label: collapsed ? "\uB300\uD654 \uAE30\uB85D \uD3BC\uCE58\uAE30" : "\uB300\uD654 \uAE30\uB85D \uC811\uAE30",
|
|
1293
|
+
side: collapsed ? "right" : "bottom",
|
|
1294
|
+
"aria-expanded": !collapsed,
|
|
1295
|
+
onClick: (e) => {
|
|
1296
|
+
e.currentTarget.focus();
|
|
1297
|
+
setCollapsed((v) => !v);
|
|
1298
|
+
},
|
|
1299
|
+
children: /* @__PURE__ */ jsx(PanelLeft, { size: 20 })
|
|
1300
|
+
}
|
|
1301
|
+
)
|
|
1302
|
+
] }),
|
|
1303
|
+
/* @__PURE__ */ jsxs("div", { className: "relative flex min-h-0 flex-1", children: [
|
|
1304
|
+
collapsed && history.onNew ? (
|
|
1305
|
+
// 레일의 새 대화 — 접힌 동안에만 있다. 펼친 "새 대화" 가 있던 자리에서 나타난다
|
|
1306
|
+
/* @__PURE__ */ jsx("div", { className: "absolute top-[2px] left-0 animate-[fade-in_300ms_ease-in-out] motion-reduce:animate-none", children: /* @__PURE__ */ jsx(
|
|
1307
|
+
IconAction,
|
|
1308
|
+
{
|
|
1309
|
+
variant: "primaryLink",
|
|
1310
|
+
label: "\uC0C8 \uB300\uD654",
|
|
1311
|
+
side: "right",
|
|
1312
|
+
onClick: history.onNew,
|
|
1313
|
+
children: /* @__PURE__ */ jsx(Plus, { size: 20 })
|
|
1314
|
+
}
|
|
1315
|
+
) })
|
|
1316
|
+
) : null,
|
|
1317
|
+
/* @__PURE__ */ jsx(
|
|
1309
1318
|
"div",
|
|
1310
1319
|
{
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1320
|
+
ref: bodyRef,
|
|
1321
|
+
"aria-hidden": collapsed || void 0,
|
|
1322
|
+
className: cn(
|
|
1323
|
+
"flex w-[256px] shrink-0 flex-col transition-[opacity,visibility]",
|
|
1324
|
+
SLIDE,
|
|
1325
|
+
collapsed ? "invisible opacity-0" : "visible opacity-100"
|
|
1326
|
+
),
|
|
1327
|
+
children: /* @__PURE__ */ jsx(ChatHistory, { ...history, className: "flex-1" })
|
|
1314
1328
|
}
|
|
1315
1329
|
)
|
|
1316
|
-
}
|
|
1317
|
-
|
|
1318
|
-
|
|
1330
|
+
] })
|
|
1331
|
+
]
|
|
1332
|
+
}
|
|
1333
|
+
)
|
|
1334
|
+
) : null,
|
|
1335
|
+
/* @__PURE__ */ jsxs(
|
|
1336
|
+
"div",
|
|
1337
|
+
{
|
|
1338
|
+
className: cn(
|
|
1339
|
+
"flex min-h-0 min-w-0 flex-1 flex-col",
|
|
1340
|
+
history && historyInline && "border-l border-sys-divider-subtler"
|
|
1341
|
+
),
|
|
1342
|
+
children: [
|
|
1343
|
+
hasTopRow ? (
|
|
1344
|
+
// 맨 위 줄: ChatConversation 의 형제라 로딩·오류 화면에서도 남는다. 아래에 선·배경을 두지 않는다 —
|
|
1345
|
+
// 빈 대화의 바탕 그라데이션은 위쪽 끝색이 바탕색과 같아 이음매가 없다.
|
|
1346
|
+
// 줄 높이는 32 — 36px 모델 선택은 위아래로 2px 씩 넘친다(Panel 제목 줄과 같은 방식)
|
|
1347
|
+
/* @__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: [
|
|
1348
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-[8px]", children: [
|
|
1349
|
+
history && !historyInline ? (
|
|
1350
|
+
// 넓은 화면의 접기 버튼과는 다른 요소다 — 폭이 960 을 넘나들면 버튼에 있던 포커스는 이어지지 않는다
|
|
1351
|
+
// (다음 Tab 이 바로 이 버튼이라 따로 옮기지 않는다)
|
|
1352
|
+
/* @__PURE__ */ jsx(
|
|
1353
|
+
IconAction,
|
|
1354
|
+
{
|
|
1355
|
+
variant: "secondaryLink",
|
|
1356
|
+
className: "shrink-0",
|
|
1357
|
+
label: "\uB300\uD654 \uAE30\uB85D \uC5F4\uAE30",
|
|
1358
|
+
side: "bottom",
|
|
1359
|
+
"aria-expanded": drawerOpen,
|
|
1360
|
+
onClick: (e) => {
|
|
1361
|
+
e.currentTarget.focus();
|
|
1362
|
+
setDrawerOpen(true);
|
|
1363
|
+
},
|
|
1364
|
+
children: /* @__PURE__ */ jsx(PanelLeft, { size: 20 })
|
|
1365
|
+
}
|
|
1366
|
+
)
|
|
1367
|
+
) : null,
|
|
1368
|
+
history && historyInline ? null : history ? (
|
|
1369
|
+
// 좁은 화면: 로고는 Drawer 안에 있고, 제목은 화면 밖 글자로 남긴다
|
|
1370
|
+
/* @__PURE__ */ jsx("h1", { className: "sr-only", children: title })
|
|
1371
|
+
) : /* @__PURE__ */ jsx("div", { className: "min-w-0 pl-[4px]", children: /* @__PURE__ */ jsx(Brand, { heading: true, logo, title }) }),
|
|
1372
|
+
status ? /* @__PURE__ */ jsx("div", { className: "flex shrink-0 items-center", children: status }) : null
|
|
1373
|
+
] }),
|
|
1374
|
+
titleRight || actions ? /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-[8px]", children: [
|
|
1375
|
+
titleRight,
|
|
1376
|
+
actions
|
|
1377
|
+
] }) : null
|
|
1378
|
+
] }) })
|
|
1379
|
+
) : null,
|
|
1380
|
+
/* @__PURE__ */ jsx(ChatConversation, { variant: "page", label: `${title} \uB300\uD654`, ...shell })
|
|
1381
|
+
]
|
|
1319
1382
|
}
|
|
1320
|
-
)
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1383
|
+
),
|
|
1384
|
+
sideInline ? (
|
|
1385
|
+
// 열고 닫기는 기록 바와 같은 방식 — 바깥 폭만 0 ↔ 패널 폭으로 움직인다
|
|
1386
|
+
/* @__PURE__ */ jsx(
|
|
1387
|
+
"div",
|
|
1388
|
+
{
|
|
1389
|
+
className: cn(
|
|
1390
|
+
"shrink-0 overflow-hidden transition-[width,visibility] duration-300 ease-in-out motion-reduce:transition-none",
|
|
1391
|
+
sideOpen ? cn("visible", SIDE_WIDTH[side?.width ?? "medium"]) : "invisible w-0"
|
|
1392
|
+
),
|
|
1393
|
+
onTransitionEnd: (e) => {
|
|
1394
|
+
if (e.target === e.currentTarget && e.propertyName === "width" && !sidePanel)
|
|
1395
|
+
setLastSide(void 0);
|
|
1396
|
+
},
|
|
1397
|
+
children: side ? (
|
|
1398
|
+
// <aside> 는 다른 landmark 안에 둘 수 없어(axe landmark-complementary-is-top-level) 이름 있는 section(Panel) — ListPage 의 detail 과 같다
|
|
1399
|
+
/* @__PURE__ */ jsx(
|
|
1400
|
+
Panel,
|
|
1401
|
+
{
|
|
1402
|
+
appearance: "none",
|
|
1403
|
+
padding: "large",
|
|
1404
|
+
title: side.title,
|
|
1405
|
+
description: side.description,
|
|
1406
|
+
titleRight: /* @__PURE__ */ jsx(
|
|
1407
|
+
IconButton,
|
|
1408
|
+
{
|
|
1409
|
+
type: "button",
|
|
1410
|
+
variant: "secondary",
|
|
1411
|
+
"aria-label": "\uB2EB\uAE30",
|
|
1412
|
+
onClick: side.onClose,
|
|
1413
|
+
children: /* @__PURE__ */ jsx(X, { size: 20 })
|
|
1414
|
+
}
|
|
1415
|
+
),
|
|
1416
|
+
footer: side.footer,
|
|
1417
|
+
className: cn(
|
|
1418
|
+
"h-full min-h-0 border-l border-sys-divider-subtler px-[24px] pt-[16px] pb-[24px]",
|
|
1419
|
+
SIDE_WIDTH[side.width ?? "medium"]
|
|
1420
|
+
),
|
|
1421
|
+
children: /* @__PURE__ */ jsx(
|
|
1422
|
+
"div",
|
|
1423
|
+
{
|
|
1424
|
+
tabIndex: 0,
|
|
1425
|
+
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",
|
|
1426
|
+
children: side.children
|
|
1427
|
+
}
|
|
1428
|
+
)
|
|
1429
|
+
}
|
|
1430
|
+
)
|
|
1431
|
+
) : null
|
|
1432
|
+
}
|
|
1433
|
+
)
|
|
1434
|
+
) : null
|
|
1345
1435
|
] }),
|
|
1346
|
-
/* @__PURE__ */ jsx(
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1436
|
+
history && !historyInline ? /* @__PURE__ */ jsx(Drawer, { open: drawerOpen, onOpenChange: setDrawerOpen, children: /* @__PURE__ */ jsxs(DrawerContent, { side: "left", size: "small", children: [
|
|
1437
|
+
/* @__PURE__ */ jsxs(DrawerHeader, { children: [
|
|
1438
|
+
/* @__PURE__ */ jsx(DrawerTitle, { className: "sr-only", children: "\uB300\uD654 \uAE30\uB85D" }),
|
|
1439
|
+
/* @__PURE__ */ jsx("div", { className: "flex h-[24px] min-w-0 items-center pr-[32px] pl-[12px]", children: /* @__PURE__ */ jsx(Brand, { logo, title }) })
|
|
1440
|
+
] }),
|
|
1441
|
+
/* @__PURE__ */ jsx("div", { className: "flex min-h-0 flex-1 flex-col px-[24px] pb-[24px]", children: /* @__PURE__ */ jsx(
|
|
1442
|
+
ChatHistory,
|
|
1443
|
+
{
|
|
1444
|
+
...history,
|
|
1445
|
+
className: "flex-1",
|
|
1446
|
+
onSelect: (id) => {
|
|
1447
|
+
history.onSelect(id);
|
|
1448
|
+
setDrawerOpen(false);
|
|
1449
|
+
},
|
|
1450
|
+
onNew: history.onNew ? () => {
|
|
1451
|
+
history.onNew?.();
|
|
1452
|
+
setDrawerOpen(false);
|
|
1453
|
+
} : void 0
|
|
1454
|
+
}
|
|
1455
|
+
) })
|
|
1456
|
+
] }) }) : null,
|
|
1457
|
+
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: [
|
|
1458
|
+
/* @__PURE__ */ jsxs(DrawerHeader, { children: [
|
|
1459
|
+
/* @__PURE__ */ jsx(DrawerTitle, { children: sidePanel.title }),
|
|
1460
|
+
sidePanel.description ? /* @__PURE__ */ jsx(DrawerDescription, { children: sidePanel.description }) : null
|
|
1461
|
+
] }),
|
|
1462
|
+
/* @__PURE__ */ jsx(DrawerBody, { className: "px-[24px] pb-[24px]", children: sidePanel.children }),
|
|
1463
|
+
sidePanel.footer ? /* @__PURE__ */ jsx(DrawerFooter, { children: sidePanel.footer }) : null
|
|
1464
|
+
] }) }) : null
|
|
1465
|
+
] }) })
|
|
1466
|
+
);
|
|
1350
1467
|
}
|
|
1351
1468
|
function ChatPanel({
|
|
1352
1469
|
title,
|
|
@@ -1357,26 +1474,28 @@ function ChatPanel({
|
|
|
1357
1474
|
...shell
|
|
1358
1475
|
}) {
|
|
1359
1476
|
const name = typeof title === "string" ? title : label;
|
|
1360
|
-
return
|
|
1361
|
-
|
|
1362
|
-
{
|
|
1363
|
-
"
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
actions,
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1477
|
+
return (
|
|
1478
|
+
// `actions` 에 Tooltip 을 단 아이콘 버튼을 넣어도 깨지지 않게 감싼다 — PageHeader·ChatPage 와 같은 방식(기본 지연)
|
|
1479
|
+
/* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsxs(
|
|
1480
|
+
"section",
|
|
1481
|
+
{
|
|
1482
|
+
"aria-label": name,
|
|
1483
|
+
className: cn("flex h-full min-h-0 w-full flex-col bg-sys-background", className),
|
|
1484
|
+
children: [
|
|
1485
|
+
/* @__PURE__ */ jsx(
|
|
1486
|
+
ChatHeader,
|
|
1487
|
+
{
|
|
1488
|
+
title,
|
|
1489
|
+
actions: actions || onClose ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1490
|
+
actions,
|
|
1491
|
+
onClose ? /* @__PURE__ */ jsx(IconButton, { type: "button", variant: "secondary", "aria-label": "\uB2EB\uAE30", onClick: onClose, children: /* @__PURE__ */ jsx(X, { size: 20 }) }) : null
|
|
1492
|
+
] }) : null
|
|
1493
|
+
}
|
|
1494
|
+
),
|
|
1495
|
+
/* @__PURE__ */ jsx(ChatConversation, { variant: "panel", label: `${name} \uB300\uD654`, ...shell })
|
|
1496
|
+
]
|
|
1497
|
+
}
|
|
1498
|
+
) })
|
|
1380
1499
|
);
|
|
1381
1500
|
}
|
|
1382
1501
|
|