@ihabdevteam/core 0.438.0 → 0.441.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.
Files changed (54) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/README.md +3 -3
  3. package/dist/components.cjs.js +190 -180
  4. package/dist/components.esm.css +1 -1
  5. package/dist/hooks.cjs.js +5 -5
  6. package/dist/i18n.cjs.js +3 -3
  7. package/dist/ihabdevteam-core.cjs.js +196 -186
  8. package/dist/ihabdevteam-core.d.ts +435 -5
  9. package/dist/packages/core/src/components/Breadcrumb.css +52 -0
  10. package/dist/packages/core/src/components/Breadcrumb.d.ts +19 -1
  11. package/dist/packages/core/src/components/Breadcrumb.js +12 -4
  12. package/dist/packages/core/src/components/Button.css +9 -2
  13. package/dist/packages/core/src/components/CardSection.css +26 -0
  14. package/dist/packages/core/src/components/CardSection.d.ts +32 -0
  15. package/dist/packages/core/src/components/CardSection.js +23 -0
  16. package/dist/packages/core/src/components/FolderGrid.css +28 -0
  17. package/dist/packages/core/src/components/FolderGrid.d.ts +47 -0
  18. package/dist/packages/core/src/components/FolderGrid.js +68 -0
  19. package/dist/packages/core/src/components/FolderHead.css +8 -0
  20. package/dist/packages/core/src/components/FolderHead.d.ts +42 -0
  21. package/dist/packages/core/src/components/FolderHead.js +62 -0
  22. package/dist/packages/core/src/components/FolderSearchSections.d.ts +25 -0
  23. package/dist/packages/core/src/components/FolderSearchSections.js +18 -0
  24. package/dist/packages/core/src/components/FolderTreeButton.css +2 -0
  25. package/dist/packages/core/src/components/FolderTreeButton.d.ts +34 -0
  26. package/dist/packages/core/src/components/FolderTreeButton.js +44 -0
  27. package/dist/packages/core/src/components/Popup/ConfirmPopup.d.ts +8 -2
  28. package/dist/packages/core/src/components/Popup/ConfirmPopup.js +3 -3
  29. package/dist/packages/core/src/components/Tooltip/FolderTreeTooltip.css +99 -0
  30. package/dist/packages/core/src/components/Tooltip/FolderTreeTooltip.d.ts +60 -0
  31. package/dist/packages/core/src/components/Tooltip/FolderTreeTooltip.js +81 -0
  32. package/dist/packages/core/src/components/Tooltip/Tooltip.d.ts +6 -0
  33. package/dist/packages/core/src/components/Tooltip/Tooltip.js +10 -4
  34. package/dist/packages/core/src/components.d.ts +12 -0
  35. package/dist/packages/core/src/components.js +8 -0
  36. package/dist/packages/core/src/hooks/useCardDragToGroup.d.ts +33 -0
  37. package/dist/packages/core/src/hooks/useCardDragToGroup.js +52 -0
  38. package/dist/packages/core/src/hooks/useFolderBrowse.d.ts +30 -0
  39. package/dist/packages/core/src/hooks/useFolderBrowse.js +38 -0
  40. package/dist/packages/core/src/hooks.d.ts +2 -0
  41. package/dist/packages/core/src/hooks.js +3 -0
  42. package/dist/packages/core/src/i18n/locales/en.json +10 -0
  43. package/dist/packages/core/src/i18n/locales/ko.json +9 -0
  44. package/dist/packages/core/src/utils/folderMenu.d.ts +27 -0
  45. package/dist/packages/core/src/utils/folderMenu.js +19 -0
  46. package/dist/packages/core/src/utils/folderPath.d.ts +50 -0
  47. package/dist/packages/core/src/utils/folderPath.js +98 -0
  48. package/dist/packages/core/src/utils/lucideIconSet.js +4 -0
  49. package/dist/packages/core/src/utils.d.ts +3 -0
  50. package/dist/packages/core/src/utils.js +3 -0
  51. package/dist/packages/core/src/version.d.ts +1 -1
  52. package/dist/packages/core/src/version.js +1 -1
  53. package/dist/utils.cjs.js +175 -165
  54. package/package.json +3 -3
@@ -8,14 +8,22 @@ import Icon from './Icon';
8
8
  * 앞 항목은 `href` 가 있으면 링크, `onClick` 만 있으면 단추, 둘 다 없으면 글자다.
9
9
  * @public
10
10
  */
11
- export default function Breadcrumb({ items, className = '' }) {
11
+ export default function Breadcrumb({ items, size = 'small', className = '' }) {
12
12
  const { t } = useTranslation();
13
+ /* 글자 급과 갈림표 크기는 **함께** 간다 — 한쪽만 키우면 갈림표가 글자에 묻히거나 떠 보인다 */
14
+ const text = size === 'medium' ? 'body-1' : 'body-3';
15
+ const separatorSize = size === 'medium' ? 18 : 14;
16
+ /* `medium` 은 **마지막 칸(지금 자리)만 굵다**(사장님 지시 2026-11-13 "마지막 칸만 굵게 해줘") — 앞 칸은 누르는 길이고
17
+ 마지막은 지금 있는 곳이라, 굵기로 가른다. `small` 은 전처럼 굵기가 같다(색으로만 가른다). */
18
+ const current = size === 'medium' ? 'body-1b' : text;
13
19
  return (
14
20
  /* 영어로 박혀 있어 한국어 화면에서도 낭독기가 "breadcrumb" 이라고 읽었다 — 사전을 탄다 */
15
- _jsx("nav", { className: `breadcrumb ${className}`.trim(), "aria-label": t('breadcrumb.ariaLabel', '이동 경로'), children: _jsx("ol", { className: "breadcrumb__list", children: items.map((item, index) => {
21
+ _jsx("nav", { className: `breadcrumb breadcrumb--${size} ${className}`.trim(), "aria-label": t('breadcrumb.ariaLabel', '이동 경로'), children: _jsx("ol", { className: "breadcrumb__list", children: items.map((item, index) => {
16
22
  const isLast = index === items.length - 1;
17
- return (_jsxs("li", { className: "breadcrumb__item", children: [isLast ? (_jsx("span", { className: "breadcrumb__current body-3", "aria-current": "page", children: item.label })) : item.href ? (_jsx("a", { className: "breadcrumb__link body-3", href: item.href, target: item.target, rel: item.rel ?? (item.target === '_blank' ? 'noopener noreferrer' : undefined), onClick: item.onClick, children: item.label })) : item.onClick ? (_jsx("button", { type: "button", className: "breadcrumb__link body-3", onClick: item.onClick, children: item.label })) : (
23
+ return (_jsxs("li", { className: "breadcrumb__item", children: [isLast && item.menu ? (
24
+ /* 이름과 ▾ 가 한 단추 — 지금 쪽이라는 말(`aria-current`)은 그대로 달고, 메뉴를 연다는 말을 더한다 */
25
+ _jsxs("button", { type: "button", className: `breadcrumb__current breadcrumb__current--menu ${current}`, "aria-current": "page", "aria-haspopup": "menu", "aria-expanded": !!item.menu.expanded, "aria-label": item.menu.ariaLabel, onClick: e => item.menu.onOpen(e.currentTarget), children: [item.label, _jsx(Icon, { icon: "chevron-down", size: separatorSize, className: "breadcrumb__menu-mark" })] })) : isLast ? (_jsx("span", { className: `breadcrumb__current ${current}`, "aria-current": "page", children: item.label })) : item.href ? (_jsx("a", { className: `breadcrumb__link ${text}`, href: item.href, target: item.target, rel: item.rel ?? (item.target === '_blank' ? 'noopener noreferrer' : undefined), onClick: item.onClick, children: item.label })) : item.onClick ? (_jsx("button", { type: "button", className: `breadcrumb__link ${text}`, onClick: item.onClick, children: item.label })) : (
18
26
  /* 갈 곳이 없는 중간 항목은 글자 — 전에는 늘 단추라 눌러도 아무 일 없는 단추가 Tab 자리를 차지했다 */
19
- _jsx("span", { className: "breadcrumb__text body-3", children: item.label })), !isLast && (_jsx(Icon, { icon: "chevron-right", size: 14, className: "breadcrumb__separator" }))] }, index));
27
+ _jsx("span", { className: `breadcrumb__text ${text}`, children: item.label })), !isLast && (_jsx(Icon, { icon: "chevron-right", size: separatorSize, className: "breadcrumb__separator" }))] }, index));
20
28
  }) }) }));
21
29
  }
@@ -328,8 +328,12 @@
328
328
  border: var(--button-border, 1px solid var(--color-whiteLine));
329
329
  }
330
330
 
331
+ /* **`.is-hover`** — 손이 얹히지 않았어도 얹은 꼴을 보인다. 끌어다 놓는 자리가 된 단추가 쓴다: 무엇을 끌고 그 위에 오면
332
+ `:hover` 가 안 걸리는데(끄는 동안 브라우저가 호버를 안 준다), 따로 굵은 테를 두르지 않고 **기본 호버 그대로** 말하려는 것이다
333
+ (말귀 청 (434), 사장님 지시 2026-11-13 "드래그 호버 보더 너무 두꺼워 추가하지말고 기본 호버로 표현하도록 해"). */
331
334
  .button--variant-default:hover,
332
- .button--variant-default:focus-visible {
335
+ .button--variant-default:focus-visible,
336
+ .button--variant-default.is-hover {
333
337
  background: var(--color-white);
334
338
  --button-text-color: var(--color-black);
335
339
  --button-icon-color: var(--color-main);
@@ -410,8 +414,11 @@
410
414
  border: var(--button-border, 1px solid var(--color-gray-a80));
411
415
  }
412
416
 
417
+ /* **펼쳐 둔 동안에도 얹은 꼴**이다(`aria-expanded='true'`) — ⋯ 로 메뉴를 열면 손이 메뉴로 내려가 단추의 호버가 풀리는데,
418
+ 그러면 어느 단추의 메뉴인지가 화면에서 사라진다(말귀 청 (433), 사장님 지시 2026-11-13 "... 클릭시 해당 버튼에 호버 표현"). */
413
419
  .button--variant-transparent-gray:hover,
414
- .button--variant-transparent-gray:focus-visible {
420
+ .button--variant-transparent-gray:focus-visible,
421
+ .button--variant-transparent-gray[aria-expanded='true'] {
415
422
  background: var(--color-gray-a10);
416
423
  color: var(--color-gray);
417
424
  --button-subLabel-color: var(--color-gray-a60);
@@ -0,0 +1,26 @@
1
+ /* **카드가 서는 자리**(`CardSection`) — 회색 그룹 칸 없이 카드가 쪽 바탕에 바로 선다(말귀 청 (437) ㉮).
2
+ 카드는 제 폭(360 · 작은 것 120)을 쥐고 있어 드는 만큼 나란히 선다. 한 줄의 카드는 키를 맞춘다. */
3
+ .card-section { display: flex; flex-direction: column; gap: var(--spacing-s); min-width: 0; }
4
+ /* 묶음이 여럿이면 묶음 사이를 넉넉히 띄운다 — 칸이 없으니 간격이 가름이다 */
5
+ .card-section + .card-section { margin-top: var(--spacing-l); }
6
+
7
+ /* 제목 줄 — 이름 · 수 · (오른쪽에) 단추. 칸을 두르지 않는 가벼운 한 줄이다 */
8
+ .card-section__head { display: flex; align-items: center; gap: var(--spacing-xs); min-height: 32px; }
9
+ .card-section__title { margin: 0; color: var(--color-text-primary); }
10
+ .card-section__count { color: var(--color-main-ink, var(--color-main)); }
11
+ .card-section__actions { margin-left: auto; display: inline-flex; align-items: center; gap: var(--spacing-xs); }
12
+
13
+ .card-section__list {
14
+ display: flex;
15
+ flex-wrap: wrap;
16
+ align-items: stretch;
17
+ gap: var(--spacing-s);
18
+ }
19
+ /* 카드가 자리보다 넓으면 줄어들 수 있게(폰) — 안 주면 360 이 버틴다 */
20
+ .card-section__list > * { min-width: 0; }
21
+
22
+ .card-section__empty {
23
+ padding: var(--spacing-xl) var(--spacing-m);
24
+ text-align: center;
25
+ color: var(--color-gray);
26
+ }
@@ -0,0 +1,32 @@
1
+ import type { ReactNode } from 'react';
2
+ import './CardSection.css';
3
+ /** @public */
4
+ export interface CardSectionProps {
5
+ /** 묶음의 이름 — 한 화면에 묶음이 여럿일 때만 준다 */
6
+ title?: ReactNode;
7
+ /** 그 묶음의 수(쪽에 선 수가 아니라 전부) */
8
+ count?: number;
9
+ /** 제목의 머리글 급 — 쪽에 바로 서면 2, 창 안이면 3 */
10
+ titleLevel?: 2 | 3 | 4;
11
+ /** 제목 줄 오른쪽에 설 것 */
12
+ actions?: ReactNode;
13
+ /** 비었나 — 참이면 목록 대신 `emptyContent` 가 목록 자리에 선다 */
14
+ empty?: boolean;
15
+ emptyContent?: ReactNode;
16
+ className?: string;
17
+ children?: ReactNode;
18
+ }
19
+ /**
20
+ * **카드가 서는 자리** — 회색 그룹 칸 없이 카드가 쪽 바탕에 바로 선다(말귀 청 (437) ㉮ — 말귀 앱에서 옮겨 왔다, 2026-11-13).
21
+ *
22
+ * 전에는 목록마다 `TrainingCardGroup`(회색 칸 + 제목 + 수)이 감쌌다. 말귀 사장님 지시로 그 칸을 걷었다(*"숙제관리, 고객별 숙제
23
+ * 페이지, 등등 그룹 ui 를 사용하고 있는곳이 많아. 모두 정리해주고"*) — 목록이 하나뿐인 자리에서는 칸의 제목과 수가 위의 탭 ·
24
+ * 도구줄과 **같은 말을 한 번 더** 했고, 화면마다 칸이 있고 없고가 갈려 같은 카드가 다르게 보였다.
25
+ *
26
+ * · **목록이 하나뿐이면 제목을 안 준다** — 무엇의 목록인지는 탭과 도구줄이 이미 말한다.
27
+ * · **여러 묶음을 한 화면에 나눠 세울 때만 제목을 준다**(진행 중 / 완료 · 훈련 종류별 · 폴더별) — 가르는 것이 정보인 자리다.
28
+ * 제목은 가벼운 한 줄(이름 + 수)이고 칸을 두르지 않는다.
29
+ * · 비었을 때의 말(`emptyContent`)은 **목록 자리에** 선다 — 못 받음 · 못 찾음 · 아직 없음을 갈라 말하던 것 그대로.
30
+ * @public
31
+ */
32
+ export default function CardSection({ title, count, titleLevel, actions, empty, emptyContent, className, children }: CardSectionProps): import("react").JSX.Element;
@@ -0,0 +1,23 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { cx } from '../utils/cx';
4
+ import './CardSection.css';
5
+ /**
6
+ * **카드가 서는 자리** — 회색 그룹 칸 없이 카드가 쪽 바탕에 바로 선다(말귀 청 (437) ㉮ — 말귀 앱에서 옮겨 왔다, 2026-11-13).
7
+ *
8
+ * 전에는 목록마다 `TrainingCardGroup`(회색 칸 + 제목 + 수)이 감쌌다. 말귀 사장님 지시로 그 칸을 걷었다(*"숙제관리, 고객별 숙제
9
+ * 페이지, 등등 그룹 ui 를 사용하고 있는곳이 많아. 모두 정리해주고"*) — 목록이 하나뿐인 자리에서는 칸의 제목과 수가 위의 탭 ·
10
+ * 도구줄과 **같은 말을 한 번 더** 했고, 화면마다 칸이 있고 없고가 갈려 같은 카드가 다르게 보였다.
11
+ *
12
+ * · **목록이 하나뿐이면 제목을 안 준다** — 무엇의 목록인지는 탭과 도구줄이 이미 말한다.
13
+ * · **여러 묶음을 한 화면에 나눠 세울 때만 제목을 준다**(진행 중 / 완료 · 훈련 종류별 · 폴더별) — 가르는 것이 정보인 자리다.
14
+ * 제목은 가벼운 한 줄(이름 + 수)이고 칸을 두르지 않는다.
15
+ * · 비었을 때의 말(`emptyContent`)은 **목록 자리에** 선다 — 못 받음 · 못 찾음 · 아직 없음을 갈라 말하던 것 그대로.
16
+ * @public
17
+ */
18
+ export default function CardSection({ title, count, titleLevel = 3, actions, empty = false, emptyContent, className, children }) {
19
+ const Heading = `h${titleLevel}`;
20
+ return (_jsxs("section", { className: cx('card-section', className), children: [title != null && (_jsxs("header", { className: "card-section__head", children: [_jsx(Heading, { className: "card-section__title h5b", children: title }), count != null && _jsx("span", { className: "card-section__count body-3b", children: count }), actions != null && _jsx("span", { className: "card-section__actions", children: actions })] })), empty
21
+ ? _jsx("div", { className: "card-section__empty body-3", children: emptyContent })
22
+ : _jsx("div", { className: "card-section__list", children: children })] }));
23
+ }
@@ -0,0 +1,28 @@
1
+ /* **폴더 칸의 격자**(`FolderGrid`) — 폴더 한 칸은 `Button` 하나다: 아이콘 · 이름 · 든 수. 드는 만큼 나란히 서고 좁으면 줄을 바꾼다
2
+ (말귀 청 (435), 사장님 지시 2026-11-13 "브래드와 폴더와 리스트"). */
3
+ .folder-grid {
4
+ display: grid;
5
+ /* 칸은 **200 으로 고정**이다(사장님 지시 2026-11-13 "조금 더 짧게") — `1fr` 로 늘리니 폴더 둘이 281 씩 차지했다.
6
+ 이름이 길면 단추가 줄인다(…). 화면이 200 보다 좁으면 그 폭에 맞춘다. */
7
+ grid-template-columns: repeat(auto-fill, minmax(0, min(200px, 100%)));
8
+ gap: var(--spacing-s);
9
+ margin: 0 0 var(--spacing-l);
10
+ padding: 0;
11
+ list-style: none;
12
+ }
13
+ .folder-grid__cell { position: relative; min-width: 0; }
14
+ /* 칸 오른쪽의 ⋯ — 폴더 단추 위에 얹는다(세로 가운데). 단추 안에는 같은 폭의 빈자리를 둔다 */
15
+ .folder-grid__more {
16
+ position: absolute;
17
+ top: 50%;
18
+ right: var(--spacing-xs);
19
+ transform: translateY(-50%);
20
+ display: inline-flex;
21
+ }
22
+ .folder-grid__more-room { display: inline-block; width: 24px; }
23
+ /* 무엇을 끌고 그 위에 오면 단추가 **기본 호버 꼴**이 된다(`is-hover` — 단추가 스스로 그린다). 여기서는 테를 안 두른다
24
+ (사장님 지시 2026-11-13 — 처음엔 2px 테를 둘렀는데 "너무 두꺼워 추가하지말고 기본 호버로").
25
+ 칸 위에 얹은 ⋯ 가 끌기를 가로채 표시가 깜빡이지 않게, 끄는 동안에는 ⋯ 가 손을 안 받는다. */
26
+ .folder-grid__cell--over .folder-grid__more { pointer-events: none; }
27
+ /* 쥐고 끄는 폴더 칸은 흐려진다 — 구조 나무의 쥔 줄과 같은 말 */
28
+ .folder-grid__cell--dragging { opacity: 0.4; }
@@ -0,0 +1,47 @@
1
+ import { type TooltipMenuColumnItem } from './Tooltip/MenuTooltip';
2
+ import './FolderGrid.css';
3
+ /**
4
+ * 폴더 칸 하나에 그릴 것.
5
+ * @public
6
+ */
7
+ export interface FolderEntry {
8
+ /** 폴더의 **온 길**(`앙/하위`) — 여는 손 · 끌어다 놓는 손 · 메뉴가 이것을 받는다 */
9
+ name: string;
10
+ /** 화면에 보일 이름 — 길의 마지막 마디. 안 주면 `name` 그대로 */
11
+ label?: string;
12
+ /** 이 폴더에 든 수 — 찾기 · 쪽 나누기와 상관없이 **전부** */
13
+ count: number;
14
+ }
15
+ /** @public */
16
+ export interface FolderGridProps {
17
+ folders: FolderEntry[];
18
+ onOpen: (name: string) => void;
19
+ /** 그 칸을 **든 것(카드)이 놓일 자리**로 만드는 손 — 화면의 끌기 훅이 내주는 것(`onDragOver` · `onDrop` …)을 그대로 얹는다 */
20
+ dropProps?: (name: string) => Record<string, unknown>;
21
+ /** 지금 카드가 그 위에 떠 있는 폴더 */
22
+ dropOver?: string | null;
23
+ /**
24
+ * 폴더 칸 오른쪽의 ⋯ 메뉴 — 주면 칸마다 ⋯ 가 서고, 누르면 그 폴더의 메뉴가 아래로 열린다(폴더는 안 열린다).
25
+ * `FolderHead` 는 길의 「이름 ▾」 와 **같은 줄들**을 넘긴다.
26
+ */
27
+ menuItems?: (name: string) => TooltipMenuColumnItem[];
28
+ /**
29
+ * **폴더 칸을 끌어 다른 폴더 칸에 넣는다** — 주면 칸을 쥐고 끌 수 있고, 다른 폴더 칸에 놓으면 그 안으로 들어간다.
30
+ * 제 자신에게는 안 놓인다. 폴더 밖으로 빼는 것은 구조 나무(`FolderTreeTooltip`)에서 한다(여기 선 칸들은 모두 같은 자리의
31
+ * 폴더라 '밖' 이 없다).
32
+ */
33
+ onMove?: (path: string, into: string) => void;
34
+ }
35
+ /**
36
+ * **폴더 칸의 격자** — 폴더 하나가 단추 하나(아이콘 · 이름 · 든 수)이고, 누르면 그 안으로 들어간다(말귀 청 (435)).
37
+ *
38
+ * 말귀의 나의 단어훈련에서 먼저 섰다(사장님 지시 2026-11-13 *"그룹과 훈련묶음의 화면이 구조가 이해도 안되고 어떤 그룹은 하단으로
39
+ * 내려가 있으니까 너무 불편해. 구글 드라이브 식으로"* → *"이런구조. 브래드와 폴더와 리스트."*). 그룹이 전부 펼쳐진 채 위아래로
40
+ * 쌓이던 것을, 그룹 하나를 **작은 칸 하나**로 줄였다.
41
+ *
42
+ * · 칸은 `Button`(bar · 48 · default · 왼쪽 맞춤)이고 폭은 200 으로 고정이다 — 긴 이름은 단추가 줄인다.
43
+ * · **놓을 자리이기도 하다** — 카드든 폴더든 끌고 그 위에 오면 단추가 기본 호버 꼴(`is-hover`)이 된다. 따로 테를 두르지 않는다.
44
+ * · 폴더가 없으면 아무것도 안 그린다(빈 격자가 자리를 먹지 않는다).
45
+ * @public
46
+ */
47
+ export default function FolderGrid({ folders, onOpen, dropProps, dropOver, menuItems, onMove }: FolderGridProps): import("react").JSX.Element | null;
@@ -0,0 +1,68 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useRef, useState } from 'react';
4
+ import { useTranslation } from 'react-i18next';
5
+ import Button from './Button';
6
+ import Tooltip from './Tooltip/Tooltip';
7
+ import MenuTooltip from './Tooltip/MenuTooltip';
8
+ import { useCardDragToGroup } from '../hooks/useCardDragToGroup';
9
+ import './FolderGrid.css';
10
+ /**
11
+ * **폴더 칸의 격자** — 폴더 하나가 단추 하나(아이콘 · 이름 · 든 수)이고, 누르면 그 안으로 들어간다(말귀 청 (435)).
12
+ *
13
+ * 말귀의 나의 단어훈련에서 먼저 섰다(사장님 지시 2026-11-13 *"그룹과 훈련묶음의 화면이 구조가 이해도 안되고 어떤 그룹은 하단으로
14
+ * 내려가 있으니까 너무 불편해. 구글 드라이브 식으로"* → *"이런구조. 브래드와 폴더와 리스트."*). 그룹이 전부 펼쳐진 채 위아래로
15
+ * 쌓이던 것을, 그룹 하나를 **작은 칸 하나**로 줄였다.
16
+ *
17
+ * · 칸은 `Button`(bar · 48 · default · 왼쪽 맞춤)이고 폭은 200 으로 고정이다 — 긴 이름은 단추가 줄인다.
18
+ * · **놓을 자리이기도 하다** — 카드든 폴더든 끌고 그 위에 오면 단추가 기본 호버 꼴(`is-hover`)이 된다. 따로 테를 두르지 않는다.
19
+ * · 폴더가 없으면 아무것도 안 그린다(빈 격자가 자리를 먹지 않는다).
20
+ * @public
21
+ */
22
+ export default function FolderGrid({ folders, onOpen, dropProps, dropOver, menuItems, onMove }) {
23
+ const { t } = useTranslation();
24
+ /** 메뉴가 열린 폴더와 그 단추 */
25
+ const [menu, setMenu] = useState(null);
26
+ /* **폴더 칸 끌기는 끌기 훅 한 벌로**(말귀 청 (437) ㉮, 2026-11-13) — 전에는 끄는 중 · 위에 떠 있나 · `relatedTarget` 나감 판정을
27
+ 여기서 다시 지었다. 카드 끌기(화면이 `dropProps` 로 주는 손)와는 따로 쥔다 — 폴더를 끄는 동안에는 폴더가 놓일 자리만 산다. */
28
+ const folderDrag = useCardDragToGroup((from, into) => onMove?.(from, into));
29
+ const draggingFolder = folderDrag.dragging;
30
+ /** 그 칸의 끌기 손 — 폴더를 끄는 중이면 폴더가 놓일 자리, 아니면 카드가 놓일 자리(화면이 준 손) */
31
+ const cellDrag = (name) => {
32
+ const grab = onMove ? folderDrag.cardProps(name) : {};
33
+ if (draggingFolder === null)
34
+ return { ...dropProps?.(name), ...grab };
35
+ if (!onMove || draggingFolder === name)
36
+ return grab;
37
+ /* 제 자신에게는 안 놓인다 — 위에서 걸렀다 */
38
+ return { ...grab, ...folderDrag.groupProps(name) };
39
+ };
40
+ /** 그 칸 위에 무엇이 떠 있나 — 카드든 폴더든 같은 꼴로 말한다 */
41
+ const isOver = (name) => (draggingFolder === null ? dropOver === name : folderDrag.dragOverKey === name);
42
+ /* 열린 채 ⋯ 를 다시 누르면 닫힌다 — 그 누름은 메뉴에게 '바깥 누름' 이라 메뉴가 먼저 닫히는데, 이어서 이 손이 도로 열면
43
+ 닫을 길이 없다. 방금 닫힌 그 폴더면 다시 열지 않는다. */
44
+ const justClosed = useRef(null);
45
+ const closeMenu = () => {
46
+ setMenu(now => { if (now)
47
+ justClosed.current = { name: now.name, at: Date.now() }; return null; });
48
+ };
49
+ if (folders.length === 0)
50
+ return null;
51
+ return (_jsxs("ul", { className: "folder-grid", "aria-label": t('folder.list', '폴더'), children: [folders.map(folder => {
52
+ const label = folder.label ?? folder.name;
53
+ return (
54
+ /* **끌어다 놓는 손은 칸(`li`)에 얹는다** — 단추는 끌기 손을 안 받는다 */
55
+ _jsxs("li", { className: ['folder-grid__cell', isOver(folder.name) && 'folder-grid__cell--over', draggingFolder === folder.name && 'folder-grid__cell--dragging'].filter(Boolean).join(' '), ...cellDrag(folder.name), children: [_jsx(Button, { htmlType: "button", type: "bar", size: 48, variant: "default", align: "left", width: "100%", ellipsis: true,
56
+ /* 무엇을 끌고 그 위에 오면 **기본 호버 꼴**로 말한다 — 끄는 동안에는 `:hover` 가 안 걸려 `is-hover` 를 붙인다 */
57
+ className: isOver(folder.name) ? 'is-hover' : undefined, icon: "folder", label: label, count: folder.count,
58
+ /* 이름만으로는 무엇을 누르는지 모른다 — 폴더라는 것과 든 수를 함께 읽는다 */
59
+ ariaLabel: t('folder.open', { name: label, count: folder.count, defaultValue: '{{name}} 폴더 열기, {{count}}개' }),
60
+ /* ⋯ 가 설 자리를 단추 안에 비워 둔다 — 안 비우면 긴 이름이 ⋯ 밑으로 들어간다 */
61
+ rightIcon: menuItems ? _jsx("span", { className: "folder-grid__more-room", "aria-hidden": "true" }) : undefined, onClick: () => onOpen(folder.name) }), menuItems && (_jsx("span", { className: "folder-grid__more", children: _jsx(Button, { htmlType: "button", size: 32, type: "dot", variant: "transparent-gray", useBorder: false, icon: "ellipsis", ariaLabel: t('folder.menu', { name: label, defaultValue: '{{name}} 폴더 메뉴' }), ariaExpanded: menu?.name === folder.name, onClick: (e) => {
62
+ if (justClosed.current?.name === folder.name && Date.now() - justClosed.current.at < 300)
63
+ return;
64
+ const anchor = e.currentTarget;
65
+ setMenu(now => (now?.name === folder.name ? null : { name: folder.name, label, anchor }));
66
+ } }) }))] }, folder.name));
67
+ }), menu && menuItems && (_jsx(Tooltip, { anchorEl: menu.anchor, onClose: closeMenu, closeOnOutsideClick: true, offset: 4, prefer: "bottom", ariaLabel: t('folder.menu', { name: menu.label, defaultValue: '{{name}} 폴더 메뉴' }), children: _jsx(MenuTooltip, { columns: [{ items: menuItems(menu.name) }], size: "small", onClose: closeMenu }) }))] }));
68
+ }
@@ -0,0 +1,8 @@
1
+ /* **폴더로 보는 화면의 머리**(`FolderHead`)의 길 줄 — 구조 단추와 길이 한 줄에 선다. 길은 왼쪽에서 시작한다
2
+ (말귀 청 (435)). 줄의 키는 길(`Breadcrumb` medium, 40)이 정한다. */
3
+ .folder-head {
4
+ display: flex;
5
+ align-items: center;
6
+ gap: var(--spacing-xs);
7
+ margin: 0 0 var(--spacing-m);
8
+ }
@@ -0,0 +1,42 @@
1
+ import { type TooltipMenuColumnItem } from './Tooltip/MenuTooltip';
2
+ import './FolderHead.css';
3
+ /** @public */
4
+ export interface FolderHeadProps {
5
+ /** 맨 위의 이름 — 길의 첫 칸 · 구조 나무의 첫 줄 */
6
+ rootLabel: string;
7
+ /** 지금 들어가 있는 폴더의 **온 길**(없으면 맨 위) */
8
+ opened: string | null;
9
+ onOpen: (path: string | null) => void;
10
+ /** 있는 폴더 전부의 길 — 중간 폴더가 빠져 있어도 된다(여기서 채운다). 차례는 받은 그대로 */
11
+ paths: readonly string[];
12
+ /** 그 폴더에 든 수(하위 폴더에 든 것까지) */
13
+ countOf: (path: string) => number;
14
+ /** 그 폴더의 메뉴 줄 — 길의 「이름 ▾」 와 폴더 칸의 ⋯ 가 함께 쓴다 */
15
+ folderMenu?: (path: string) => TooltipMenuColumnItem[];
16
+ /** 맨 위의 메뉴 줄 */
17
+ rootMenu?: TooltipMenuColumnItem[];
18
+ /** 그 폴더를 **든 것(카드)이 놓일 자리**로 만드는 손 — 폴더 칸과 구조 나무의 줄이 함께 쓴다 */
19
+ dropProps?: (path: string) => Record<string, unknown>;
20
+ /** 지금 카드가 그 위에 떠 있는 폴더 */
21
+ dropOver?: string | null;
22
+ /** 폴더를 끌어 다른 폴더에 넣거나 뺀다 — 폴더 칸끼리, 그리고 구조 나무에서(`into` 가 `null` 이면 맨 위로) */
23
+ onMoveFolder?: (path: string, into: string | null) => void;
24
+ /** 화면이 카드를 끄는 중인가 — 그때 구조 단추 위로 오면 나무가 펼쳐지고, 나무의 줄이 놓을 자리가 된다 */
25
+ itemDragging?: boolean;
26
+ /** 맨 위(폴더 밖)로 놓을 때의 열쇠 — `dropProps` · `dropOver` 가 맨 위를 가리키는 그 값. 안 주면 나무의 맨 위 줄에는 못 놓는다 */
27
+ rootDropKey?: string;
28
+ }
29
+ /**
30
+ * **폴더로 보는 화면의 머리** — 구조 단추 · 길(브레드크럼) · 지금 자리의 폴더 칸들. 도구줄 **위**에 선다(말귀 청 (435)).
31
+ *
32
+ * 말귀의 나의 단어표 · 나의 단어훈련 · 나의 문장훈련이 이 꼴로 선다(사장님 지시 2026-11-13 — 구글 드라이브 식 "브래드와 폴더와
33
+ * 리스트"). 차례는 길 · 폴더 · 도구줄 · 목록이고, 도구줄과 목록은 부르는 쪽이 그 아래에 세운다.
34
+ *
35
+ * · **길의 마지막 칸은 늘 메뉴 단추다**(「이름 ▾」) — 폴더 안이면 그 폴더의 메뉴(`folderMenu`), 맨 위면 맨 위의 메뉴(`rootMenu`).
36
+ * · **폴더 칸은 지금 자리의 바로 아래 폴더들이다** — 폴더 안에도 폴더가 선다(이름을 길로 적는다 — `utils` 의 `folder*`).
37
+ * 길은 층마다 한 칸씩 이어진다. 칸마다 ⋯ 가 서고, 그 줄은 「이름 ▾」 와 한 벌이다.
38
+ * · 메뉴는 **아래로** 펼친다 — 위로 뜨면 쪽 제목을 덮는다.
39
+ * · 길 줄의 키는 40 으로 고정이다(`Breadcrumb size="medium"`) — 폴더를 드나들 때 아래가 안 튄다.
40
+ * @public
41
+ */
42
+ export default function FolderHead({ rootLabel, opened, onOpen, paths, countOf, folderMenu, rootMenu, dropProps, dropOver, onMoveFolder, itemDragging, rootDropKey, }: FolderHeadProps): import("react").JSX.Element;
@@ -0,0 +1,62 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { useRef, useState } from 'react';
4
+ import { useTranslation } from 'react-i18next';
5
+ import Breadcrumb from './Breadcrumb';
6
+ import Tooltip from './Tooltip/Tooltip';
7
+ import MenuTooltip from './Tooltip/MenuTooltip';
8
+ import FolderGrid from './FolderGrid';
9
+ import FolderTreeButton from './FolderTreeButton';
10
+ import { folderChildren, folderLeaf, folderTrail, folderTree } from '../utils/folderPath';
11
+ import './FolderHead.css';
12
+ /**
13
+ * **폴더로 보는 화면의 머리** — 구조 단추 · 길(브레드크럼) · 지금 자리의 폴더 칸들. 도구줄 **위**에 선다(말귀 청 (435)).
14
+ *
15
+ * 말귀의 나의 단어표 · 나의 단어훈련 · 나의 문장훈련이 이 꼴로 선다(사장님 지시 2026-11-13 — 구글 드라이브 식 "브래드와 폴더와
16
+ * 리스트"). 차례는 길 · 폴더 · 도구줄 · 목록이고, 도구줄과 목록은 부르는 쪽이 그 아래에 세운다.
17
+ *
18
+ * · **길의 마지막 칸은 늘 메뉴 단추다**(「이름 ▾」) — 폴더 안이면 그 폴더의 메뉴(`folderMenu`), 맨 위면 맨 위의 메뉴(`rootMenu`).
19
+ * · **폴더 칸은 지금 자리의 바로 아래 폴더들이다** — 폴더 안에도 폴더가 선다(이름을 길로 적는다 — `utils` 의 `folder*`).
20
+ * 길은 층마다 한 칸씩 이어진다. 칸마다 ⋯ 가 서고, 그 줄은 「이름 ▾」 와 한 벌이다.
21
+ * · 메뉴는 **아래로** 펼친다 — 위로 뜨면 쪽 제목을 덮는다.
22
+ * · 길 줄의 키는 40 으로 고정이다(`Breadcrumb size="medium"`) — 폴더를 드나들 때 아래가 안 튄다.
23
+ * @public
24
+ */
25
+ export default function FolderHead({ rootLabel, opened, onOpen, paths, countOf, folderMenu, rootMenu, dropProps, dropOver, onMoveFolder, itemDragging, rootDropKey, }) {
26
+ const { t } = useTranslation();
27
+ /** 길의 메뉴가 붙을 단추 — 열려 있으면 그 단추 */
28
+ const [menuAnchor, setMenuAnchor] = useState(null);
29
+ /* 열린 채 다시 누르면 닫힌다 — 그 누름이 메뉴를 먼저 닫는데(바깥 누름), 이어서 도로 열면 닫을 길이 없다 */
30
+ const closedAt = useRef(0);
31
+ const closeMenu = () => { setMenuAnchor(now => { if (now)
32
+ closedAt.current = Date.now(); return null; }); };
33
+ const hereLabel = opened ? folderLeaf(opened) : rootLabel;
34
+ const menuLabel = opened
35
+ ? t('folder.menu', { name: hereLabel, defaultValue: '{{name}} 폴더 메뉴' })
36
+ : t('folder.placeMenu', { name: hereLabel, defaultValue: '{{name}} 메뉴' });
37
+ /* **메뉴를 안 주면 길은 읽기만 한다**(말귀 청 (436)) — 고르는 창처럼 폴더를 드나들기만 하고
38
+ 더하거나 고치지 않는 자리다. 그때 마지막 칸은 맨 이름이고 폴더 칸에도 ⋯ 가 안 선다. */
39
+ const hasMenu = !!folderMenu || !!rootMenu;
40
+ const last = !hasMenu ? { label: hereLabel } : {
41
+ label: hereLabel,
42
+ menu: {
43
+ onOpen: (anchor) => {
44
+ if (Date.now() - closedAt.current < 300)
45
+ return;
46
+ setMenuAnchor(now => (now ? null : anchor));
47
+ },
48
+ expanded: !!menuAnchor,
49
+ ariaLabel: menuLabel,
50
+ },
51
+ };
52
+ /* 길 — 맨 위 · 위 폴더들(누르면 그리로) · 지금 자리(메뉴 단추) */
53
+ const crumbs = opened
54
+ ? [
55
+ { label: rootLabel, onClick: () => onOpen(null) },
56
+ ...folderTrail(opened).slice(0, -1).map(step => ({ label: step.label, onClick: () => onOpen(step.path) })),
57
+ last,
58
+ ]
59
+ : [last];
60
+ const children = folderChildren(paths, opened).map(path => ({ name: path, label: folderLeaf(path), count: countOf(path) }));
61
+ return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "folder-head", children: [_jsx(FolderTreeButton, { rootLabel: rootLabel, opened: opened, onOpen: onOpen, onMove: onMoveFolder, itemDragging: itemDragging, itemDropProps: dropProps ? path => (path !== null ? dropProps(path) : rootDropKey ? dropProps(rootDropKey) : {}) : undefined, itemDropOver: path => dropOver != null && dropOver === (path ?? rootDropKey), tree: folderTree(paths).map(node => ({ ...node, count: countOf(node.path) })) }), _jsx(Breadcrumb, { size: "medium", items: crumbs })] }), _jsx(FolderGrid, { folders: children, onOpen: onOpen, dropProps: dropProps, dropOver: dropOver, menuItems: folderMenu, onMove: onMoveFolder }), menuAnchor && hasMenu && (_jsx(Tooltip, { anchorEl: menuAnchor, onClose: closeMenu, closeOnOutsideClick: true, offset: 4, prefer: "bottom", ariaLabel: menuLabel, children: _jsx(MenuTooltip, { columns: [{ items: (opened ? folderMenu?.(opened) : rootMenu) ?? [] }], size: "small", onClose: closeMenu }) }))] }));
62
+ }
@@ -0,0 +1,25 @@
1
+ import type { ReactNode } from 'react';
2
+ /** @public */
3
+ export interface FolderSearchSectionsProps<T> {
4
+ /** 폴더마다의 찾은 것 — `[폴더의 길(없으면 noneKey), 그 줄들]`. 차례는 받은 그대로 */
5
+ bundles: readonly (readonly [string, readonly T[]])[];
6
+ /** 폴더 없는 것을 가리키는 열쇠 */
7
+ noneKey: string;
8
+ /** 폴더 없는 것의 이름 */
9
+ noneLabel: string;
10
+ titleLevel?: 2 | 3 | 4;
11
+ rowRender: (row: T, slot: number) => ReactNode;
12
+ }
13
+ /**
14
+ * **찾은 것을 폴더마다 나눠 세운다** — 찾는 중의 목록(말귀 청 (437) ㉮ — 말귀 앱에서 옮겨 왔다, 2026-11-13).
15
+ *
16
+ * 찾는 중에는 폴더를 가리지 않고 **전부에서** 찾는다(`useFolderBrowse`). 찾은 것이 여러 폴더에 걸치므로 어느 폴더의 것인지가
17
+ * 보여야 한다 — 폴더마다 가벼운 제목 한 줄(길 · 수)을 두고 그 아래 카드를 세운다(`CardSection`). 회색 그룹 칸은 두르지 않는다.
18
+ * 폴더를 다루는 일(이름 고치기 · 지우기 · 끌어 놓기)은 여기 없다 — 찾는 중에 하는 일이 아니고, 폴더 메뉴에 있다.
19
+ *
20
+ * · **빈 폴더는 안 세운다** — 찾은 것이 없는 폴더의 제목만 줄줄이 서면 찾은 것이 묻힌다.
21
+ * · 폴더 안의 폴더는 길(`앙/하위`)을 `앙 › 하위` 로 이어 보인다.
22
+ * · 폴더 없는 것은 `noneLabel` 아래에 선다.
23
+ * @public
24
+ */
25
+ export default function FolderSearchSections<T>({ bundles, noneKey, noneLabel, titleLevel, rowRender }: FolderSearchSectionsProps<T>): import("react").JSX.Element;
@@ -0,0 +1,18 @@
1
+ 'use client';
2
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import CardSection from './CardSection';
4
+ /**
5
+ * **찾은 것을 폴더마다 나눠 세운다** — 찾는 중의 목록(말귀 청 (437) ㉮ — 말귀 앱에서 옮겨 왔다, 2026-11-13).
6
+ *
7
+ * 찾는 중에는 폴더를 가리지 않고 **전부에서** 찾는다(`useFolderBrowse`). 찾은 것이 여러 폴더에 걸치므로 어느 폴더의 것인지가
8
+ * 보여야 한다 — 폴더마다 가벼운 제목 한 줄(길 · 수)을 두고 그 아래 카드를 세운다(`CardSection`). 회색 그룹 칸은 두르지 않는다.
9
+ * 폴더를 다루는 일(이름 고치기 · 지우기 · 끌어 놓기)은 여기 없다 — 찾는 중에 하는 일이 아니고, 폴더 메뉴에 있다.
10
+ *
11
+ * · **빈 폴더는 안 세운다** — 찾은 것이 없는 폴더의 제목만 줄줄이 서면 찾은 것이 묻힌다.
12
+ * · 폴더 안의 폴더는 길(`앙/하위`)을 `앙 › 하위` 로 이어 보인다.
13
+ * · 폴더 없는 것은 `noneLabel` 아래에 선다.
14
+ * @public
15
+ */
16
+ export default function FolderSearchSections({ bundles, noneKey, noneLabel, titleLevel = 2, rowRender }) {
17
+ return (_jsx(_Fragment, { children: bundles.filter(([, rows]) => rows.length > 0).map(([folder, rows]) => (_jsx(CardSection, { titleLevel: titleLevel, title: folder === noneKey ? noneLabel : folder.split('/').join(' › '), count: rows.length, children: rows.map((row, i) => rowRender(row, i)) }, folder))) }));
18
+ }
@@ -0,0 +1,2 @@
1
+ /* 구조 단추의 감싸개(`FolderTreeButton`) — 든 것을 끌고 그 위로 오면 나무를 펼치려고 끌기 손을 받는다. 꼴은 없다(단추는 `Button`) */
2
+ .folder-tree-button { display: inline-flex; }
@@ -0,0 +1,34 @@
1
+ import { type FolderTreeNode } from './Tooltip/FolderTreeTooltip';
2
+ import './FolderTreeButton.css';
3
+ /** @public */
4
+ export interface FolderTreeButtonProps {
5
+ /** 맨 위의 이름 — 나무의 첫 줄 */
6
+ rootLabel: string;
7
+ /** 지금 들어가 있는 폴더(없으면 맨 위) */
8
+ opened: string | null;
9
+ onOpen: (path: string | null) => void;
10
+ /** 폴더 나무를 **펼친 차례**로(`folderTree`) — 층(`depth`)만큼 들여 세운다. `count` 는 그 폴더에 든 수 */
11
+ tree: readonly FolderTreeNode[];
12
+ /** 폴더를 끌어 다른 폴더에 넣거나 뺀다 — 나무(`FolderTreeTooltip`)로 그대로 간다 */
13
+ onMove?: (path: string, into: string | null) => void;
14
+ /**
15
+ * 화면이 **든 것(카드)을 끄는 중**인가 — 그때 이 단추 위로 끌고 오면 나무가 절로 펼쳐지고(누를 손이 없다), 끌기가 끝나면
16
+ * 닫힌다.
17
+ */
18
+ itemDragging?: boolean;
19
+ /** 카드가 놓일 자리로 만드는 손 · 떠 있는 줄 — 나무(`FolderTreeTooltip`)로 그대로 간다 */
20
+ itemDropProps?: (path: string | null) => Record<string, unknown>;
21
+ itemDropOver?: (path: string | null) => boolean;
22
+ }
23
+ /**
24
+ * **폴더 구조를 펼쳐 보는 단추** — 길(`Breadcrumb`) 앞에 선다(말귀 청 (435)).
25
+ *
26
+ * 드라이브의 왼쪽 폴더 나무를 보여 주되 자리를 늘 차지하지 않게 하려는 것이다(사장님 지시 2026-11-13 *"sidebar도 이미 있고
27
+ * 영역을 잡고 있기가 싫은데"* → *"앞에 구조 보려줄 수 있는 버튼 넣고 누르면 tooltip 형태로 나오도록 해봐"*). **누를 때만** 뜬다:
28
+ * 맨 위와 폴더 전부가 한 줄씩 서고, 지금 있는 자리에 표시가 붙으며, 줄을 누르면 그리로 간다. 폴더가 하나도 없어도 단추는 선다
29
+ * (맨 위 한 줄).
30
+ *
31
+ * 뜨는 나무는 제 조각이다(`FolderTreeTooltip`) — 여기는 **띄우는 단추**(dot · 40 · default)와 여닫음만 쥔다.
32
+ * @public
33
+ */
34
+ export default function FolderTreeButton({ rootLabel, opened, onOpen, tree, onMove, itemDragging, itemDropProps, itemDropOver, }: FolderTreeButtonProps): import("react").JSX.Element;
@@ -0,0 +1,44 @@
1
+ 'use client';
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useEffect, useRef, useState } from 'react';
4
+ import { useTranslation } from 'react-i18next';
5
+ import Button from './Button';
6
+ import FolderTreeTooltip from './Tooltip/FolderTreeTooltip';
7
+ import './FolderTreeButton.css';
8
+ /**
9
+ * **폴더 구조를 펼쳐 보는 단추** — 길(`Breadcrumb`) 앞에 선다(말귀 청 (435)).
10
+ *
11
+ * 드라이브의 왼쪽 폴더 나무를 보여 주되 자리를 늘 차지하지 않게 하려는 것이다(사장님 지시 2026-11-13 *"sidebar도 이미 있고
12
+ * 영역을 잡고 있기가 싫은데"* → *"앞에 구조 보려줄 수 있는 버튼 넣고 누르면 tooltip 형태로 나오도록 해봐"*). **누를 때만** 뜬다:
13
+ * 맨 위와 폴더 전부가 한 줄씩 서고, 지금 있는 자리에 표시가 붙으며, 줄을 누르면 그리로 간다. 폴더가 하나도 없어도 단추는 선다
14
+ * (맨 위 한 줄).
15
+ *
16
+ * 뜨는 나무는 제 조각이다(`FolderTreeTooltip`) — 여기는 **띄우는 단추**(dot · 40 · default)와 여닫음만 쥔다.
17
+ * @public
18
+ */
19
+ export default function FolderTreeButton({ rootLabel, opened, onOpen, tree, onMove, itemDragging = false, itemDropProps, itemDropOver, }) {
20
+ const { t } = useTranslation();
21
+ const [anchor, setAnchor] = useState(null);
22
+ /* 열린 채 단추를 다시 누르면 닫힌다 — 그 누름이 통을 먼저 닫는데(바깥 누름), 이어서 도로 열면 닫을 길이 없다 */
23
+ const closedAt = useRef(0);
24
+ const close = () => { setAnchor(now => { if (now)
25
+ closedAt.current = Date.now(); return null; }); };
26
+ const label = t('folder.tree', '폴더 구조 보기');
27
+ /* 끌고 와서 펼친 나무는 **끌기가 끝나면 닫는다** — 누른 것이 아니라 손이 지나가다 연 것이다. 눌러 연 것은 그대로 둔다 */
28
+ const openedByDrag = useRef(false);
29
+ useEffect(() => {
30
+ if (!itemDragging && openedByDrag.current) {
31
+ openedByDrag.current = false;
32
+ setAnchor(null);
33
+ }
34
+ }, [itemDragging]);
35
+ return (_jsxs(_Fragment, { children: [_jsx("span", { className: "folder-tree-button", onDragEnter: itemDragging ? e => { if (!anchor) {
36
+ openedByDrag.current = true;
37
+ setAnchor(e.currentTarget);
38
+ } } : undefined, children: _jsx(Button, { htmlType: "button", size: 40, type: "dot", variant: "default", icon: "folder-tree", ariaLabel: label, showTooltipInfo: label, ariaExpanded: !!anchor, onClick: (e) => {
39
+ if (Date.now() - closedAt.current < 300)
40
+ return;
41
+ const el = e.currentTarget;
42
+ setAnchor(now => (now ? null : el));
43
+ } }) }), anchor && (_jsx(FolderTreeTooltip, { anchorEl: anchor, onClose: close, ariaLabel: label, rootLabel: rootLabel, opened: opened, onPick: onOpen, tree: tree, onMove: onMove, itemDropProps: itemDropProps, itemDropOver: itemDropOver }))] }));
44
+ }
@@ -4,8 +4,14 @@ import { type ButtonVariant } from '../Button';
4
4
  export interface ConfirmPopupProps {
5
5
  /** 팝업 제목 */
6
6
  title: ReactNode;
7
- /** 본문 메시지 */
8
- message: ReactNode;
7
+ /**
8
+ * 제목 아래 한 줄(창 머리의 부제) — 안내 글을 본문이 아니라 **머리**에 둘 때 쓴다(코어 `Popup.subtitle` 로 간다).
9
+ * 입력칸 하나를 띄우는 창처럼 본문 글이 따로 필요 없으면 이것만 주고 `message` 는 비운다
10
+ * (말귀 청 (431), 사장님 지시 2026-11-13 — 폴더 추가 창의 안내 글을 고르시며 "sub로").
11
+ */
12
+ subtitle?: string;
13
+ /** 본문 메시지. `subtitle` 로 말을 다 했으면 안 줘도 된다 — 그때는 문단이 자리를 안 차지한다 */
14
+ message?: ReactNode;
9
15
  /**
10
16
  * details·message 위(본문 최상단)에 놓을 것 — 미리보기 카드·표 등.
11
17
  *
@@ -12,7 +12,7 @@ import Panel, { PanelRow } from '../Panel';
12
12
  * @public
13
13
  */
14
14
  export default function ConfirmPopup(props) {
15
- const { title, message, topContent, details, children, confirmLabel, cancelLabel, hideCancel = false, extraAction, confirmVariant = 'main', confirmDisabled = false, onConfirm, closeOnConfirm = true, onClose, inline, size = 'small', className, initialFocus = 'close', } = props;
15
+ const { title, subtitle, message, topContent, details, children, confirmLabel, cancelLabel, hideCancel = false, extraAction, confirmVariant = 'main', confirmDisabled = false, onConfirm, closeOnConfirm = true, onClose, inline, size = 'small', className, initialFocus = 'close', } = props;
16
16
  const { t } = useTranslation();
17
17
  /* 열릴 때 포커스 자리 — Popup 이 먼저 첫 포커스 자리(X)로 옮긴 뒤(자식 효과가 먼저 돈다) 여기서 고른 단추로 옮긴다.
18
18
  단추 차례는 [곁 단추?, 취소?, 확인] 이다. */
@@ -70,7 +70,7 @@ export default function ConfirmPopup(props) {
70
70
  }
71
71
  }
72
72
  };
73
- return (_jsxs(Popup, { title: title, onClose: onClose,
73
+ return (_jsxs(Popup, { title: title, subtitle: subtitle, onClose: onClose,
74
74
  // onConfirm(서버 요청 등)이 진행 중일 때 X/ESC로 닫으면, 팝업은 즉시 사라지는데
75
75
  // 이미 시작된 요청은 계속 진행돼 완료 후 부모 state/토스트가 뒤늦게 갱신된다 —
76
76
  // 사용자는 "취소했다"고 믿었는데 실제로는 실행된 것처럼 보이는 문제를 막는다.
@@ -115,5 +115,5 @@ export default function ConfirmPopup(props) {
115
115
  });
116
116
  },
117
117
  },
118
- ], children: [topContent != null && _jsx("div", { className: "confirm-popup__top", children: topContent }), details && details.length > 0 && (_jsx(Panel, { children: details.map((d, i) => (_jsx(PanelRow, { label: d.label, children: _jsx("span", { className: "panel-row__text body-2", children: d.value }) }, i))) })), _jsx("p", { ref: bodyRef, className: "body-2 confirm-popup__message", children: message }), children] }));
118
+ ], children: [topContent != null && _jsx("div", { className: "confirm-popup__top", children: topContent }), details && details.length > 0 && (_jsx(Panel, { children: details.map((d, i) => (_jsx(PanelRow, { label: d.label, children: _jsx("span", { className: "panel-row__text body-2", children: d.value }) }, i))) })), _jsx("p", { ref: bodyRef, className: "body-2 confirm-popup__message", hidden: message == null, children: message }), children] }));
119
119
  }