@t3q-ui/design-system 1.64.0 → 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.
@@ -410,7 +410,7 @@ type ChatPageProps = ChatShellProps & {
410
410
  titleRight?: ReactNode;
411
411
  /** 대화 영역 맨 위 줄 오른쪽 끝의 행동 버튼. 버튼 사이 8px 로 그린다. 파라미터·설정처럼 아이콘만으로 뜻이 통하는 보조 행동은 아이콘만 있는 `IconButton`(`aria-label` 필수, 아이콘 20)을 권장한다 — `Tooltip` 은 패턴이 `TooltipProvider`(기본 지연)로 감싸 두어 바로 쓸 수 있다 */
412
412
  actions?: ReactNode;
413
- /** 왼쪽 대화 기록. 주면 기록 바(280px)가 생기고 맨 위에 로고(없으면 제목)와 접기 버튼이 놓인다. 접으면 펼치기 버튼과 새 대화 버튼(`onNew` 가 있을 때)만 남은 좁은 레일이 되고, 화면이 좁으면(패턴 폭 960px 미만) 레일 없이 Drawer 로 열린다 */
413
+ /** 왼쪽 대화 기록. 주면 기록 바(280px)가 생기고 맨 위에 로고(없으면 제목)와 접기 버튼이 놓인다. 접으면 펼치기 버튼과 새 대화·검색 버튼(각각 `onNew`·`search` 가 있을 때)만 남은 좁은 레일이 되고, 화면이 좁으면(패턴 폭 960px 미만) 레일 없이 Drawer 로 열린다 */
414
414
  history?: Omit<ChatHistoryProps, 'className'>;
415
415
  /** 오른쪽 패널. 열 때 객체를 주고 닫으면 undefined 로. 화면이 좁으면 Drawer 로 열린다 */
416
416
  sidePanel?: ChatPageSidePanel;
@@ -410,7 +410,7 @@ type ChatPageProps = ChatShellProps & {
410
410
  titleRight?: ReactNode;
411
411
  /** 대화 영역 맨 위 줄 오른쪽 끝의 행동 버튼. 버튼 사이 8px 로 그린다. 파라미터·설정처럼 아이콘만으로 뜻이 통하는 보조 행동은 아이콘만 있는 `IconButton`(`aria-label` 필수, 아이콘 20)을 권장한다 — `Tooltip` 은 패턴이 `TooltipProvider`(기본 지연)로 감싸 두어 바로 쓸 수 있다 */
412
412
  actions?: ReactNode;
413
- /** 왼쪽 대화 기록. 주면 기록 바(280px)가 생기고 맨 위에 로고(없으면 제목)와 접기 버튼이 놓인다. 접으면 펼치기 버튼과 새 대화 버튼(`onNew` 가 있을 때)만 남은 좁은 레일이 되고, 화면이 좁으면(패턴 폭 960px 미만) 레일 없이 Drawer 로 열린다 */
413
+ /** 왼쪽 대화 기록. 주면 기록 바(280px)가 생기고 맨 위에 로고(없으면 제목)와 접기 버튼이 놓인다. 접으면 펼치기 버튼과 새 대화·검색 버튼(각각 `onNew`·`search` 가 있을 때)만 남은 좁은 레일이 되고, 화면이 좁으면(패턴 폭 960px 미만) 레일 없이 Drawer 로 열린다 */
414
414
  history?: Omit<ChatHistoryProps, 'className'>;
415
415
  /** 오른쪽 패널. 열 때 객체를 주고 닫으면 undefined 로. 화면이 좁으면 Drawer 로 열린다 */
416
416
  sidePanel?: ChatPageSidePanel;
@@ -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, TooltipProvider, ChatHistory, TwoLineCellRenderer, Tooltip, TooltipTrigger, TooltipContent, ChatComposer, DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator } from '../chunk-MWVKFIOX.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, Plus, 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
@@ -1253,8 +1253,15 @@ function ChatPage({
1253
1253
  const hasTopRow = !(history && historyInline) || Boolean(status || titleRight || actions);
1254
1254
  const bodyRef = useRef(null);
1255
1255
  const hasHistory = Boolean(history);
1256
+ const focusSearchRef = useRef(false);
1256
1257
  useEffect(() => {
1257
- bodyRef.current?.toggleAttribute("inert", collapsed);
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();
1264
+ }
1258
1265
  }, [collapsed, historyInline, hasHistory]);
1259
1266
  return (
1260
1267
  // PageHeader 와 같은 방식(기본 지연) — `actions` 에 넣은 Tooltip 도 이 안에서 동작한다
@@ -1301,18 +1308,33 @@ function ChatPage({
1301
1308
  )
1302
1309
  ] }),
1303
1310
  /* @__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
- ) })
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
+ ] })
1316
1338
  ) : null,
1317
1339
  /* @__PURE__ */ jsx(
1318
1340
  "div",
@@ -1320,9 +1342,11 @@ function ChatPage({
1320
1342
  ref: bodyRef,
1321
1343
  "aria-hidden": collapsed || void 0,
1322
1344
  className: cn(
1323
- "flex w-[256px] shrink-0 flex-col transition-[opacity,visibility]",
1345
+ "flex w-[256px] shrink-0 flex-col",
1324
1346
  SLIDE,
1325
- collapsed ? "invisible opacity-0" : "visible opacity-100"
1347
+ // visibility 는 숨길 때만 전환에 넣는다(흐려지는 동안 보이다가 끝에 숨는다). 펼칠 때는 바로 보여야 한다 —
1348
+ // visibility 전환은 시작 순간에 아직 hidden 으로 계산돼서, 레일의 검색 버튼이 보내는 포커스가 검색창에 닿지 않는다
1349
+ collapsed ? "invisible opacity-0 transition-[opacity,visibility]" : "visible opacity-100 transition-opacity"
1326
1350
  ),
1327
1351
  children: /* @__PURE__ */ jsx(ChatHistory, { ...history, className: "flex-1" })
1328
1352
  }
@@ -1454,14 +1478,37 @@ function ChatPage({
1454
1478
  }
1455
1479
  ) })
1456
1480
  ] }) }) : 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
1481
+ side && !sideInline ? (
1482
+ // 닫을 때 Drawer 를 지우지 않고 open 만 내린다 — 지우면 닫힘 애니메이션이 돌 틈 없이 바로 사라진다.
1483
+ // 닫히는 동안에는 마지막으로 받은 패널(side)을 그대로 그린다
1484
+ /* @__PURE__ */ jsx(
1485
+ Drawer,
1486
+ {
1487
+ open: sideOpen,
1488
+ onOpenChange: (open) => {
1489
+ if (!open) sidePanel?.onClose();
1490
+ },
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
+ )
1509
+ }
1510
+ )
1511
+ ) : null
1465
1512
  ] }) })
1466
1513
  );
1467
1514
  }