@conscience-technology/ctds 0.0.0-stage → 0.1.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/README.md +128 -2
- package/assets/components/AppFrame/AppFrame.module.css +177 -0
- package/assets/components/AppFrame/AppFrame.tsx +93 -0
- package/assets/components/AppFrame/index.ts +6 -0
- package/assets/components/AttachmentChip/AttachmentChip.module.css +71 -0
- package/assets/components/AttachmentChip/AttachmentChip.tsx +74 -0
- package/assets/components/AttachmentChip/index.ts +2 -0
- package/assets/components/AttachmentThumb/AttachmentThumb.module.css +107 -0
- package/assets/components/AttachmentThumb/AttachmentThumb.tsx +91 -0
- package/assets/components/AttachmentThumb/index.ts +2 -0
- package/assets/components/Avatar/Avatar.module.css +167 -0
- package/assets/components/Avatar/Avatar.tsx +228 -0
- package/assets/components/Avatar/index.ts +2 -0
- package/assets/components/AvatarUpload/AvatarUpload.module.css +130 -0
- package/assets/components/AvatarUpload/AvatarUpload.tsx +139 -0
- package/assets/components/AvatarUpload/index.ts +2 -0
- package/assets/components/Badge/Badge.module.css +76 -0
- package/assets/components/Badge/Badge.tsx +68 -0
- package/assets/components/Badge/index.ts +2 -0
- package/assets/components/Breadcrumb/Breadcrumb.module.css +213 -0
- package/assets/components/Breadcrumb/Breadcrumb.tsx +279 -0
- package/assets/components/Breadcrumb/index.ts +8 -0
- package/assets/components/Button/Button.module.css +216 -0
- package/assets/components/Button/Button.tsx +149 -0
- package/assets/components/Button/index.ts +2 -0
- package/assets/components/Callout/Callout.module.css +146 -0
- package/assets/components/Callout/Callout.tsx +138 -0
- package/assets/components/Callout/index.ts +2 -0
- package/assets/components/ChatInput/ChatInput.module.css +241 -0
- package/assets/components/ChatInput/ChatInput.tsx +322 -0
- package/assets/components/ChatInput/ModelSelector.tsx +40 -0
- package/assets/components/ChatInput/SendButton.tsx +41 -0
- package/assets/components/ChatInput/index.ts +10 -0
- package/assets/components/Checkbox/Checkbox.module.css +66 -0
- package/assets/components/Checkbox/Checkbox.tsx +36 -0
- package/assets/components/Checkbox/index.ts +2 -0
- package/assets/components/Chip/Chip.module.css +128 -0
- package/assets/components/Chip/Chip.tsx +103 -0
- package/assets/components/Chip/index.ts +2 -0
- package/assets/components/ChoiceCard/ChoiceCard.module.css +142 -0
- package/assets/components/ChoiceCard/ChoiceCard.tsx +132 -0
- package/assets/components/ChoiceCard/index.ts +2 -0
- package/assets/components/ContextMenu/ContextMenu.module.css +102 -0
- package/assets/components/ContextMenu/ContextMenu.tsx +392 -0
- package/assets/components/ContextMenu/index.ts +9 -0
- package/assets/components/DatePicker/Calendar.tsx +234 -0
- package/assets/components/DatePicker/DESIGN_NOTES.md +106 -0
- package/assets/components/DatePicker/DESIGN_NOTES_TIME.md +125 -0
- package/assets/components/DatePicker/DatePicker.module.css +295 -0
- package/assets/components/DatePicker/DatePicker.tsx +387 -0
- package/assets/components/DatePicker/TimeSelector.tsx +69 -0
- package/assets/components/DatePicker/index.ts +8 -0
- package/assets/components/DatePicker/presets.ts +80 -0
- package/assets/components/DatePicker/utils.ts +148 -0
- package/assets/components/Disclosure/Disclosure.module.css +73 -0
- package/assets/components/Disclosure/Disclosure.tsx +129 -0
- package/assets/components/Disclosure/index.ts +6 -0
- package/assets/components/Drawer/Drawer.module.css +257 -0
- package/assets/components/Drawer/Drawer.tsx +126 -0
- package/assets/components/Drawer/index.ts +7 -0
- package/assets/components/EmptyState/EmptyState.module.css +102 -0
- package/assets/components/EmptyState/EmptyState.tsx +80 -0
- package/assets/components/EmptyState/index.ts +2 -0
- package/assets/components/FileIcon/FileIcon.module.css +66 -0
- package/assets/components/FileIcon/FileIcon.tsx +84 -0
- package/assets/components/FileIcon/fileExtMap.ts +112 -0
- package/assets/components/FileIcon/index.ts +9 -0
- package/assets/components/FilterButton/FilterButton.module.css +130 -0
- package/assets/components/FilterButton/FilterButton.tsx +94 -0
- package/assets/components/FilterButton/index.ts +2 -0
- package/assets/components/GalleryItem/GalleryItem.module.css +220 -0
- package/assets/components/GalleryItem/GalleryItem.tsx +163 -0
- package/assets/components/GalleryItem/index.ts +7 -0
- package/assets/components/Icon/Icon.tsx +616 -0
- package/assets/components/Icon/context.tsx +39 -0
- package/assets/components/Icon/index.ts +4 -0
- package/assets/components/IconButton/IconButton.module.css +109 -0
- package/assets/components/IconButton/IconButton.tsx +110 -0
- package/assets/components/IconButton/index.ts +2 -0
- package/assets/components/Input/Input.module.css +338 -0
- package/assets/components/Input/Input.tsx +371 -0
- package/assets/components/Input/index.ts +2 -0
- package/assets/components/ListItem/ListItem.module.css +318 -0
- package/assets/components/ListItem/ListItem.tsx +262 -0
- package/assets/components/ListItem/index.ts +9 -0
- package/assets/components/MenuItem/MenuItem.module.css +437 -0
- package/assets/components/MenuItem/MenuItem.tsx +529 -0
- package/assets/components/MenuItem/index.ts +8 -0
- package/assets/components/MetricCard/MetricCard.module.css +153 -0
- package/assets/components/MetricCard/MetricCard.tsx +140 -0
- package/assets/components/MetricCard/index.ts +2 -0
- package/assets/components/Modal/Modal.module.css +175 -0
- package/assets/components/Modal/Modal.tsx +98 -0
- package/assets/components/Modal/index.ts +2 -0
- package/assets/components/Onboarding/DocsIndex.tsx +82 -0
- package/assets/components/Onboarding/LayoutBuilder.tsx +160 -0
- package/assets/components/Onboarding/Onboarding.module.css +1394 -0
- package/assets/components/Onboarding/OnboardingAxisPanel.tsx +515 -0
- package/assets/components/Onboarding/OnboardingPage.tsx +1193 -0
- package/assets/components/Onboarding/PresetsGallery.tsx +65 -0
- package/assets/components/Onboarding/actions.ts +250 -0
- package/assets/components/Onboarding/index.ts +8 -0
- package/assets/components/Onboarding/palette.css +40 -0
- package/assets/components/Onboarding/wizardData.ts +265 -0
- package/assets/components/Pagination/Pagination.module.css +82 -0
- package/assets/components/Pagination/Pagination.tsx +248 -0
- package/assets/components/Pagination/index.ts +6 -0
- package/assets/components/ProgressBar/ProgressBar.module.css +64 -0
- package/assets/components/ProgressBar/ProgressBar.tsx +54 -0
- package/assets/components/ProgressBar/index.ts +2 -0
- package/assets/components/QuotationBar/QuotationBar.module.css +61 -0
- package/assets/components/QuotationBar/QuotationBar.tsx +48 -0
- package/assets/components/QuotationBar/index.ts +2 -0
- package/assets/components/Radio/Radio.module.css +63 -0
- package/assets/components/Radio/Radio.tsx +33 -0
- package/assets/components/Radio/index.ts +2 -0
- package/assets/components/Select/Select.module.css +151 -0
- package/assets/components/Select/Select.tsx +425 -0
- package/assets/components/Select/index.ts +10 -0
- package/assets/components/SelectableCard/SelectableCard.module.css +177 -0
- package/assets/components/SelectableCard/SelectableCard.tsx +83 -0
- package/assets/components/SelectableCard/index.ts +2 -0
- package/assets/components/Shortcut/Shortcut.module.css +56 -0
- package/assets/components/Shortcut/Shortcut.tsx +156 -0
- package/assets/components/Shortcut/index.ts +2 -0
- package/assets/components/Sidebar/Sidebar.module.css +242 -0
- package/assets/components/Sidebar/Sidebar.tsx +264 -0
- package/assets/components/Sidebar/index.ts +7 -0
- package/assets/components/SidebarSplit/SidebarSplit.module.css +126 -0
- package/assets/components/SidebarSplit/SidebarSplit.tsx +222 -0
- package/assets/components/SidebarSplit/index.ts +6 -0
- package/assets/components/Slider/Slider.module.css +120 -0
- package/assets/components/Slider/Slider.tsx +88 -0
- package/assets/components/Slider/index.ts +2 -0
- package/assets/components/SplitButton/SplitButton.module.css +190 -0
- package/assets/components/SplitButton/SplitButton.tsx +145 -0
- package/assets/components/SplitButton/index.ts +6 -0
- package/assets/components/Stepper/Stepper.module.css +182 -0
- package/assets/components/Stepper/Stepper.tsx +185 -0
- package/assets/components/Stepper/index.ts +2 -0
- package/assets/components/Switch/Switch.module.css +116 -0
- package/assets/components/Switch/Switch.tsx +58 -0
- package/assets/components/Switch/index.ts +2 -0
- package/assets/components/TableCell/TableCell.module.css +137 -0
- package/assets/components/TableCell/TableCellAvatar.tsx +42 -0
- package/assets/components/TableCell/TableCellBadge.tsx +23 -0
- package/assets/components/TableCell/TableCellIcon.tsx +39 -0
- package/assets/components/TableCell/TableCellImage.tsx +49 -0
- package/assets/components/TableCell/TableCellLink.tsx +33 -0
- package/assets/components/TableCell/TableCellMeter.tsx +55 -0
- package/assets/components/TableCell/TableCellNumber.tsx +43 -0
- package/assets/components/TableCell/TableCellText.tsx +30 -0
- package/assets/components/TableCell/index.ts +23 -0
- package/assets/components/TableHeader/TableHeader.module.css +287 -0
- package/assets/components/TableHeader/TableHeader.tsx +590 -0
- package/assets/components/TableHeader/index.ts +9 -0
- package/assets/components/TableRow/TableRow.module.css +290 -0
- package/assets/components/TableRow/TableRow.tsx +253 -0
- package/assets/components/TableRow/index.ts +8 -0
- package/assets/components/TableRowEdit/TableRowEdit.module.css +126 -0
- package/assets/components/TableRowEdit/TableRowEdit.tsx +247 -0
- package/assets/components/TableRowEdit/index.ts +2 -0
- package/assets/components/TableRowSelect/TableRowSelect.module.css +23 -0
- package/assets/components/TableRowSelect/TableRowSelect.tsx +175 -0
- package/assets/components/TableRowSelect/index.ts +2 -0
- package/assets/components/Tabs/Tabs.module.css +234 -0
- package/assets/components/Tabs/Tabs.tsx +426 -0
- package/assets/components/Tabs/index.ts +9 -0
- package/assets/components/Textarea/Textarea.module.css +318 -0
- package/assets/components/Textarea/Textarea.tsx +426 -0
- package/assets/components/Textarea/index.ts +7 -0
- package/assets/components/ThemeController.tsx +271 -0
- package/assets/components/TimePicker/TimePicker.module.css +317 -0
- package/assets/components/TimePicker/TimePicker.tsx +821 -0
- package/assets/components/TimePicker/index.ts +8 -0
- package/assets/components/TimePicker/utils.ts +115 -0
- package/assets/components/Toast/Toast.module.css +264 -0
- package/assets/components/Toast/Toast.tsx +243 -0
- package/assets/components/Toast/index.ts +15 -0
- package/assets/components/Toolbar/Toolbar.module.css +72 -0
- package/assets/components/Toolbar/Toolbar.tsx +75 -0
- package/assets/components/Toolbar/index.ts +2 -0
- package/assets/components/Tooltip/Tooltip.module.css +42 -0
- package/assets/components/Tooltip/Tooltip.tsx +332 -0
- package/assets/components/Tooltip/index.ts +2 -0
- package/assets/components/Topbar/Topbar.module.css +26 -0
- package/assets/components/Topbar/Topbar.tsx +47 -0
- package/assets/components/Topbar/index.ts +2 -0
- package/assets/components/_cn.ts +3 -0
- package/assets/components/_color.ts +48 -0
- package/assets/components/_data.ts +659 -0
- package/assets/components/_utils.css +19 -0
- package/assets/components/axisOptions.ts +24 -0
- package/assets/components/tokens.css +742 -0
- package/assets/prompts/GUIDE.md +251 -0
- package/assets/prompts/OVERRIDE.md +170 -0
- package/assets/prompts/PRINCIPLES.md +130 -0
- package/assets/prompts/axes/density.md +38 -0
- package/assets/prompts/axes/font.md +36 -0
- package/assets/prompts/axes/hue.md +36 -0
- package/assets/prompts/axes/icon.md +48 -0
- package/assets/prompts/axes/mode.md +50 -0
- package/assets/prompts/axes/motion.md +77 -0
- package/assets/prompts/axes/palette.md +35 -0
- package/assets/prompts/axes/shape.md +33 -0
- package/assets/prompts/axes/voice.md +54 -0
- package/assets/prompts/components/README.md +84 -0
- package/assets/prompts/components/app-frame.md +94 -0
- package/assets/prompts/components/attachment-chip.md +46 -0
- package/assets/prompts/components/attachment-thumb.md +49 -0
- package/assets/prompts/components/avatar.md +86 -0
- package/assets/prompts/components/badge.md +104 -0
- package/assets/prompts/components/breadcrumb.md +77 -0
- package/assets/prompts/components/button.md +99 -0
- package/assets/prompts/components/callout.md +81 -0
- package/assets/prompts/components/chat-input.md +84 -0
- package/assets/prompts/components/checkbox.md +46 -0
- package/assets/prompts/components/chip.md +84 -0
- package/assets/prompts/components/choice-card.md +127 -0
- package/assets/prompts/components/context-menu.md +145 -0
- package/assets/prompts/components/date-picker.md +104 -0
- package/assets/prompts/components/drawer.md +152 -0
- package/assets/prompts/components/empty-state.md +69 -0
- package/assets/prompts/components/file-icon.md +73 -0
- package/assets/prompts/components/filter-button.md +42 -0
- package/assets/prompts/components/form-field.md +74 -0
- package/assets/prompts/components/gallery-item.md +158 -0
- package/assets/prompts/components/icon-button.md +82 -0
- package/assets/prompts/components/icon.md +68 -0
- package/assets/prompts/components/input.md +95 -0
- package/assets/prompts/components/list-item.md +235 -0
- package/assets/prompts/components/menu-item.md +234 -0
- package/assets/prompts/components/metric-card.md +132 -0
- package/assets/prompts/components/modal.md +131 -0
- package/assets/prompts/components/pagination.md +92 -0
- package/assets/prompts/components/progress-bar.md +61 -0
- package/assets/prompts/components/quotation-bar.md +39 -0
- package/assets/prompts/components/radio.md +41 -0
- package/assets/prompts/components/select.md +104 -0
- package/assets/prompts/components/selectable-card.md +67 -0
- package/assets/prompts/components/shortcut.md +76 -0
- package/assets/prompts/components/sidebar.md +107 -0
- package/assets/prompts/components/slider.md +89 -0
- package/assets/prompts/components/split-button.md +71 -0
- package/assets/prompts/components/stepper.md +93 -0
- package/assets/prompts/components/switch.md +86 -0
- package/assets/prompts/components/table-cell.md +87 -0
- package/assets/prompts/components/table-header.md +157 -0
- package/assets/prompts/components/table-row-edit.md +129 -0
- package/assets/prompts/components/table-row-select.md +82 -0
- package/assets/prompts/components/table-row.md +156 -0
- package/assets/prompts/components/tabs.md +122 -0
- package/assets/prompts/components/textarea.md +105 -0
- package/assets/prompts/components/toast.md +149 -0
- package/assets/prompts/components/tooltip.md +71 -0
- package/assets/prompts/components/topbar.md +148 -0
- package/assets/prompts/primitives/emerge.md +43 -0
- package/assets/prompts/primitives/fade.md +31 -0
- package/assets/prompts/primitives/scale.md +32 -0
- package/assets/prompts/primitives/scroll.md +75 -0
- package/assets/prompts/primitives/slide.md +31 -0
- package/assets/prompts/themes/_SCHEMA.md +135 -0
- package/assets/prompts/themes/_TEMPLATE.md +73 -0
- package/assets/prompts/themes/expressive.md +118 -0
- package/assets/prompts/themes/pure.md +87 -0
- package/assets/prompts/themes/spare.md +73 -0
- package/assets/prompts/tokens/breakpoint.md +29 -0
- package/assets/prompts/tokens/color.md +78 -0
- package/assets/prompts/tokens/radius.md +33 -0
- package/assets/prompts/tokens/shadow.md +35 -0
- package/assets/prompts/tokens/spacing.md +86 -0
- package/assets/prompts/tokens/typography.md +76 -0
- package/assets/prompts/tokens/z-index.md +35 -0
- package/assets/public/expressive.png +0 -0
- package/assets/public/pure.png +0 -0
- package/assets/public/spare.png +0 -0
- package/assets/skill/SKILL.md +36 -0
- package/bin/ctds.js +76 -0
- package/package.json +35 -4
- package/src/commands/init.js +215 -0
- package/src/commands/update.js +275 -0
- package/src/utils/assets.js +78 -0
- package/src/utils/deps.js +51 -0
- package/src/utils/detect.js +47 -0
- package/src/utils/diff.js +52 -0
- package/src/utils/hash.js +16 -0
- package/src/utils/log.js +41 -0
- package/src/utils/meta.js +73 -0
- package/src/utils/prompt.js +28 -0
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
forwardRef,
|
|
5
|
+
type CSSProperties,
|
|
6
|
+
type HTMLAttributes,
|
|
7
|
+
type KeyboardEvent,
|
|
8
|
+
type MouseEvent,
|
|
9
|
+
type ReactNode,
|
|
10
|
+
} from "react";
|
|
11
|
+
|
|
12
|
+
import { Checkbox } from "../Checkbox";
|
|
13
|
+
import { pinnedStyle, type TableHeaderAlign } from "../TableHeader";
|
|
14
|
+
import type { TableRowColumn } from "../TableRow";
|
|
15
|
+
import rowStyles from "../TableRow/TableRow.module.css";
|
|
16
|
+
import styles from "./TableRowEdit.module.css";
|
|
17
|
+
|
|
18
|
+
/* ────────────────────────────────────────────────────────────
|
|
19
|
+
TableRowEdit
|
|
20
|
+
edit 모드 — Notion/Excel 스타일. 행 전체가 아닌 "셀"이 상호작용 단위.
|
|
21
|
+
세로 구분선이 강제된다. 셀 콘텐츠는 호출 측에서 columns[].render로 꽂음
|
|
22
|
+
(TableCell* 또는 Input/Select 등 편집 요소).
|
|
23
|
+
|
|
24
|
+
variant 없음(line 외곽 고정). size는 sm(36)/md(40) 두 가지만 —
|
|
25
|
+
edit은 스프레드시트 톤이라 lg 같은 큰 밀도는 어울리지 않음.
|
|
26
|
+
──────────────────────────────────────────────────────────── */
|
|
27
|
+
|
|
28
|
+
export type TableRowEditSize = "sm" | "md";
|
|
29
|
+
|
|
30
|
+
export type TableRowEditProps<T = unknown> = Omit<
|
|
31
|
+
HTMLAttributes<HTMLDivElement>,
|
|
32
|
+
"onChange" | "role"
|
|
33
|
+
> & {
|
|
34
|
+
size?: TableRowEditSize;
|
|
35
|
+
columns: TableRowColumn<T>[];
|
|
36
|
+
order?: string[];
|
|
37
|
+
widths?: Record<string, number>;
|
|
38
|
+
data: T;
|
|
39
|
+
|
|
40
|
+
/** 맨 앞 체크박스 셀 — 헤더 selectable과 짝. Notion처럼 '행 선택' 보조. */
|
|
41
|
+
selectable?: boolean;
|
|
42
|
+
selected?: boolean;
|
|
43
|
+
onSelectedChange?: (next: boolean) => void;
|
|
44
|
+
|
|
45
|
+
/** 현재 포커스/편집 중인 셀의 column key. */
|
|
46
|
+
activeCellKey?: string;
|
|
47
|
+
/** 셀 클릭/키보드 활성화 시 호출. */
|
|
48
|
+
onCellActivate?: (key: string) => void;
|
|
49
|
+
|
|
50
|
+
disabled?: boolean;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
/* ────────────────────────────────────────────────────────────
|
|
54
|
+
Utilities (TableRow와 동일)
|
|
55
|
+
──────────────────────────────────────────────────────────── */
|
|
56
|
+
|
|
57
|
+
function toCssSize(v: number | string | undefined): string | undefined {
|
|
58
|
+
if (v === undefined) return undefined;
|
|
59
|
+
return typeof v === "number" ? `${v}px` : v;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function alignToJustify(
|
|
63
|
+
align: TableHeaderAlign | undefined,
|
|
64
|
+
): CSSProperties["justifyContent"] {
|
|
65
|
+
return align === "end" ? "flex-end" : align === "center" ? "center" : "flex-start";
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function resolveOrder<T>(columns: TableRowColumn<T>[], order?: string[]): string[] {
|
|
69
|
+
if (!order) return columns.map((c) => c.key);
|
|
70
|
+
const known = new Set(columns.map((c) => c.key));
|
|
71
|
+
const filtered = order.filter((k) => known.has(k));
|
|
72
|
+
const missing = columns.map((c) => c.key).filter((k) => !filtered.includes(k));
|
|
73
|
+
return [...filtered, ...missing];
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/* ────────────────────────────────────────────────────────────
|
|
77
|
+
Component
|
|
78
|
+
──────────────────────────────────────────────────────────── */
|
|
79
|
+
|
|
80
|
+
function TableRowEditInner<T>(
|
|
81
|
+
props: TableRowEditProps<T>,
|
|
82
|
+
ref: React.ForwardedRef<HTMLDivElement>,
|
|
83
|
+
) {
|
|
84
|
+
const {
|
|
85
|
+
className,
|
|
86
|
+
size = "md",
|
|
87
|
+
columns,
|
|
88
|
+
order,
|
|
89
|
+
widths,
|
|
90
|
+
data,
|
|
91
|
+
selectable = false,
|
|
92
|
+
selected = false,
|
|
93
|
+
onSelectedChange,
|
|
94
|
+
activeCellKey,
|
|
95
|
+
onCellActivate,
|
|
96
|
+
disabled = false,
|
|
97
|
+
...rest
|
|
98
|
+
} = props;
|
|
99
|
+
|
|
100
|
+
const orderedKeys = resolveOrder(columns, order);
|
|
101
|
+
const columnMap = new Map(columns.map((c) => [c.key, c]));
|
|
102
|
+
|
|
103
|
+
/* 외곽/높이는 edit 전용으로 .edit에서 그린다 — TableRow의 .line/sizeMd를
|
|
104
|
+
쓰면 셀 padding이 0으로 cascade되고 행 높이도 48px(터치 톤)이 되어
|
|
105
|
+
스프레드시트 톤과 어긋남. */
|
|
106
|
+
const rootClass = [
|
|
107
|
+
rowStyles.root,
|
|
108
|
+
styles.edit,
|
|
109
|
+
size === "sm" ? styles.sizeSm : styles.sizeMd,
|
|
110
|
+
selected ? styles.selected : "",
|
|
111
|
+
disabled ? rowStyles.disabled : "",
|
|
112
|
+
className ?? "",
|
|
113
|
+
]
|
|
114
|
+
.filter(Boolean)
|
|
115
|
+
.join(" ");
|
|
116
|
+
|
|
117
|
+
/* 체크박스 셀 자체 클릭이 다른 핸들러로 전파되지 않도록 stop. */
|
|
118
|
+
const stop = (e: MouseEvent) => e.stopPropagation();
|
|
119
|
+
|
|
120
|
+
const activateCell = (key: string) => {
|
|
121
|
+
if (disabled) return;
|
|
122
|
+
onCellActivate?.(key);
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
const handleCellKeyDown = (
|
|
126
|
+
e: KeyboardEvent<HTMLDivElement>,
|
|
127
|
+
key: string,
|
|
128
|
+
) => {
|
|
129
|
+
if (disabled) return;
|
|
130
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
131
|
+
e.preventDefault();
|
|
132
|
+
activateCell(key);
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
return (
|
|
137
|
+
<div
|
|
138
|
+
ref={ref}
|
|
139
|
+
role="row"
|
|
140
|
+
aria-selected={selected || undefined}
|
|
141
|
+
aria-disabled={disabled || undefined}
|
|
142
|
+
className={rootClass}
|
|
143
|
+
{...rest}
|
|
144
|
+
>
|
|
145
|
+
{selectable && (
|
|
146
|
+
<div
|
|
147
|
+
className={rowStyles.selectCell}
|
|
148
|
+
onClick={stop}
|
|
149
|
+
data-edit-cell="select"
|
|
150
|
+
>
|
|
151
|
+
<Checkbox
|
|
152
|
+
checked={selected}
|
|
153
|
+
disabled={disabled}
|
|
154
|
+
onChange={(e) => onSelectedChange?.(e.currentTarget.checked)}
|
|
155
|
+
aria-label="행 선택"
|
|
156
|
+
/>
|
|
157
|
+
</div>
|
|
158
|
+
)}
|
|
159
|
+
|
|
160
|
+
{orderedKeys.map((key, idx) => {
|
|
161
|
+
const col = columnMap.get(key);
|
|
162
|
+
if (!col) return null;
|
|
163
|
+
const cssWidth =
|
|
164
|
+
widths?.[col.key] !== undefined
|
|
165
|
+
? `${widths[col.key]}px`
|
|
166
|
+
: toCssSize(col.width);
|
|
167
|
+
const slotStyle: CSSProperties = {
|
|
168
|
+
width: cssWidth,
|
|
169
|
+
minWidth: toCssSize(col.minWidth) ?? cssWidth,
|
|
170
|
+
flex: col.flex ? "1 1 0" : undefined,
|
|
171
|
+
justifyContent: alignToJustify(col.align),
|
|
172
|
+
...pinnedStyle(col, orderedKeys, columnMap, widths ?? {}),
|
|
173
|
+
};
|
|
174
|
+
const content: ReactNode = col.render
|
|
175
|
+
? col.render(data)
|
|
176
|
+
: (data as Record<string, ReactNode>)?.[col.key];
|
|
177
|
+
const editable = col.editable !== false;
|
|
178
|
+
const isActive = editable && !disabled && activeCellKey === col.key;
|
|
179
|
+
/* 세로 구분선은 editable 여부와 무관하게 모든 셀 사이에 균일하게.
|
|
180
|
+
엑셀 톤 "셀 그리드" 신호는 일관성이 핵심 — read-only 셀만 선이 빠지면
|
|
181
|
+
리듬이 깨져 보임. 첫 데이터 셀은 왼쪽에 선 없음(테이블 외곽).
|
|
182
|
+
selectable이면 체크박스 ↔ 첫 데이터 셀 사이에도 선. */
|
|
183
|
+
const showLeftDivider = idx > 0 || selectable;
|
|
184
|
+
return (
|
|
185
|
+
<div
|
|
186
|
+
key={col.key}
|
|
187
|
+
data-pinned={col.pinned || undefined}
|
|
188
|
+
className={rowStyles.cellSlot}
|
|
189
|
+
style={slotStyle}
|
|
190
|
+
>
|
|
191
|
+
<div
|
|
192
|
+
role="cell"
|
|
193
|
+
className={[
|
|
194
|
+
rowStyles.cell,
|
|
195
|
+
editable ? styles.editCell : styles.readonlyCell,
|
|
196
|
+
isActive ? styles.cellActive : "",
|
|
197
|
+
]
|
|
198
|
+
.filter(Boolean)
|
|
199
|
+
.join(" ")}
|
|
200
|
+
data-align={col.align ?? "start"}
|
|
201
|
+
data-active={isActive || undefined}
|
|
202
|
+
data-divider={showLeftDivider || undefined}
|
|
203
|
+
tabIndex={editable && !disabled && !isActive ? 0 : undefined}
|
|
204
|
+
onMouseDown={(e) => {
|
|
205
|
+
if (!editable || isActive) return;
|
|
206
|
+
/* preventDefault 중요 — 셀의 role/tabIndex 때문에 네이티브 focus가
|
|
207
|
+
셀로 이동하면서 바로 뒤에 마운트될 input의 focus를 뺏음 →
|
|
208
|
+
React useEffect에서 input.focus() 후 네이티브 focus 반환 →
|
|
209
|
+
input blur → onBlur commit → clearActive 로 활성이 즉시 꺼지는
|
|
210
|
+
레이스. mouseDown에서 default를 끊으면 포커스 이동이 발생
|
|
211
|
+
안 해 input focus가 안정적으로 유지된다. */
|
|
212
|
+
e.preventDefault();
|
|
213
|
+
activateCell(col.key);
|
|
214
|
+
}}
|
|
215
|
+
onFocus={editable && !isActive ? () => activateCell(col.key) : undefined}
|
|
216
|
+
onKeyDown={
|
|
217
|
+
editable && !isActive ? (e) => handleCellKeyDown(e, col.key) : undefined
|
|
218
|
+
}
|
|
219
|
+
>
|
|
220
|
+
{isActive ? (
|
|
221
|
+
/* 활성: editor(input/select 등)를 셀 안에 바로 꽂음. editorHost는
|
|
222
|
+
nowrap/mask 없는 flex container라 editor가 셀 폭을 꽉 채움.
|
|
223
|
+
cellInner와 editorHost 둘 중 하나만 렌더해 같은 render(data)가
|
|
224
|
+
두 번 마운트되는 것을 방지. */
|
|
225
|
+
<div
|
|
226
|
+
className={styles.editorHost}
|
|
227
|
+
onMouseDown={(e) => e.stopPropagation()}
|
|
228
|
+
>
|
|
229
|
+
{content}
|
|
230
|
+
</div>
|
|
231
|
+
) : (
|
|
232
|
+
/* 비활성 콘텐츠 — TableRow의 cellInner(nowrap + mask fade). */
|
|
233
|
+
<span className={rowStyles.cellInner}>{content}</span>
|
|
234
|
+
)}
|
|
235
|
+
</div>
|
|
236
|
+
</div>
|
|
237
|
+
);
|
|
238
|
+
})}
|
|
239
|
+
</div>
|
|
240
|
+
);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
const TableRowEdit = forwardRef(TableRowEditInner) as <T>(
|
|
244
|
+
props: TableRowEditProps<T> & { ref?: React.ForwardedRef<HTMLDivElement> },
|
|
245
|
+
) => ReturnType<typeof TableRowEditInner>;
|
|
246
|
+
|
|
247
|
+
export { TableRowEdit };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/* TableRowSelect
|
|
2
|
+
───────────────────────────────────────────────────────────────
|
|
3
|
+
select 모드 전용 CSS. 레이아웃·사이즈·variant·fade mask는 TableRow.module.css
|
|
4
|
+
를 그대로 상속해서 공유한다. 여기선 "선택됨" 상태의 시각만 정의.
|
|
5
|
+
|
|
6
|
+
원칙
|
|
7
|
+
- selected 행은 hover보다 뚜렷하게 — primary 톤의 아주 옅은 배경.
|
|
8
|
+
hover 토큰(--hover, 중성 알파)과 구분돼야 "현재 체크된 상태"가 명확.
|
|
9
|
+
- selected 위 hover 시엔 톤을 덮지 않는다 — hover가 selected를 지워버리면
|
|
10
|
+
"지금 선택된 것"이 사라지는 혼동 발생. [[feedback/hover-over-active]] 원칙.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/* 선택된 행 — hover 톤과 동일한 중성 알파 배경.
|
|
14
|
+
TableRow(navigate)의 active 상태와 같은 톤 체계 — "지금 포커스된/선택된 행" 신호가
|
|
15
|
+
컴포넌트 간 일관되게 유지된다. */
|
|
16
|
+
.selected {
|
|
17
|
+
background: var(--hover);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/* hover가 selected를 덮지 않도록 톤 유지. */
|
|
21
|
+
.selected:hover {
|
|
22
|
+
background: var(--hover) !important;
|
|
23
|
+
}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
forwardRef,
|
|
5
|
+
type CSSProperties,
|
|
6
|
+
type HTMLAttributes,
|
|
7
|
+
type KeyboardEvent,
|
|
8
|
+
type MouseEvent,
|
|
9
|
+
type ReactNode,
|
|
10
|
+
} from "react";
|
|
11
|
+
|
|
12
|
+
import type {
|
|
13
|
+
TableHeaderAlign,
|
|
14
|
+
TableHeaderVariant,
|
|
15
|
+
} from "../TableHeader";
|
|
16
|
+
import type { TableRowColumn, TableRowSize } from "../TableRow";
|
|
17
|
+
import rowStyles from "../TableRow/TableRow.module.css";
|
|
18
|
+
import styles from "./TableRowSelect.module.css";
|
|
19
|
+
|
|
20
|
+
/* ────────────────────────────────────────────────────────────
|
|
21
|
+
TableRowSelect
|
|
22
|
+
──────────────────────────────────────────────────────────── */
|
|
23
|
+
|
|
24
|
+
export type TableRowSelectProps<T = unknown> = Omit<
|
|
25
|
+
HTMLAttributes<HTMLDivElement>,
|
|
26
|
+
"onChange" | "role"
|
|
27
|
+
> & {
|
|
28
|
+
variant?: TableHeaderVariant;
|
|
29
|
+
size?: TableRowSize;
|
|
30
|
+
columns: TableRowColumn<T>[];
|
|
31
|
+
order?: string[];
|
|
32
|
+
widths?: Record<string, number>;
|
|
33
|
+
data: T;
|
|
34
|
+
|
|
35
|
+
/** 현재 행 선택 상태. */
|
|
36
|
+
selected?: boolean;
|
|
37
|
+
/** 행 클릭 또는 Space 키로 토글될 때 호출. */
|
|
38
|
+
onSelectedChange?: (next: boolean) => void;
|
|
39
|
+
|
|
40
|
+
disabled?: boolean;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/* ────────────────────────────────────────────────────────────
|
|
44
|
+
Utilities (TableRow와 동일)
|
|
45
|
+
──────────────────────────────────────────────────────────── */
|
|
46
|
+
|
|
47
|
+
function toCssSize(v: number | string | undefined): string | undefined {
|
|
48
|
+
if (v === undefined) return undefined;
|
|
49
|
+
return typeof v === "number" ? `${v}px` : v;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function alignToJustify(
|
|
53
|
+
align: TableHeaderAlign | undefined,
|
|
54
|
+
): CSSProperties["justifyContent"] {
|
|
55
|
+
return align === "end" ? "flex-end" : align === "center" ? "center" : "flex-start";
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function resolveOrder<T>(columns: TableRowColumn<T>[], order?: string[]): string[] {
|
|
59
|
+
if (!order) return columns.map((c) => c.key);
|
|
60
|
+
const known = new Set(columns.map((c) => c.key));
|
|
61
|
+
const filtered = order.filter((k) => known.has(k));
|
|
62
|
+
const missing = columns.map((c) => c.key).filter((k) => !filtered.includes(k));
|
|
63
|
+
return [...filtered, ...missing];
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/* ────────────────────────────────────────────────────────────
|
|
67
|
+
Component
|
|
68
|
+
──────────────────────────────────────────────────────────── */
|
|
69
|
+
|
|
70
|
+
function TableRowSelectInner<T>(
|
|
71
|
+
props: TableRowSelectProps<T>,
|
|
72
|
+
ref: React.ForwardedRef<HTMLDivElement>,
|
|
73
|
+
) {
|
|
74
|
+
const {
|
|
75
|
+
className,
|
|
76
|
+
variant = "line",
|
|
77
|
+
size = "md",
|
|
78
|
+
columns,
|
|
79
|
+
order,
|
|
80
|
+
widths,
|
|
81
|
+
data,
|
|
82
|
+
selected = false,
|
|
83
|
+
onSelectedChange,
|
|
84
|
+
disabled = false,
|
|
85
|
+
onKeyDown,
|
|
86
|
+
tabIndex,
|
|
87
|
+
...rest
|
|
88
|
+
} = props;
|
|
89
|
+
|
|
90
|
+
const orderedKeys = resolveOrder(columns, order);
|
|
91
|
+
const columnMap = new Map(columns.map((c) => [c.key, c]));
|
|
92
|
+
|
|
93
|
+
const rootClass = [
|
|
94
|
+
rowStyles.root,
|
|
95
|
+
variant === "plate" ? rowStyles.plate : rowStyles.line,
|
|
96
|
+
size === "sm"
|
|
97
|
+
? rowStyles.sizeSm
|
|
98
|
+
: size === "lg"
|
|
99
|
+
? rowStyles.sizeLg
|
|
100
|
+
: rowStyles.sizeMd,
|
|
101
|
+
selected ? styles.selected : "",
|
|
102
|
+
disabled ? rowStyles.disabled : "",
|
|
103
|
+
className ?? "",
|
|
104
|
+
]
|
|
105
|
+
.filter(Boolean)
|
|
106
|
+
.join(" ");
|
|
107
|
+
|
|
108
|
+
const toggle = () => {
|
|
109
|
+
if (disabled) return;
|
|
110
|
+
onSelectedChange?.(!selected);
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
const handleRowClick = (e: MouseEvent<HTMLDivElement>) => {
|
|
114
|
+
rest.onClick?.(e);
|
|
115
|
+
toggle();
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
const handleKeyDown = (e: KeyboardEvent<HTMLDivElement>) => {
|
|
119
|
+
onKeyDown?.(e);
|
|
120
|
+
if (disabled) return;
|
|
121
|
+
if (e.key === " ") {
|
|
122
|
+
e.preventDefault();
|
|
123
|
+
toggle();
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
return (
|
|
128
|
+
<div
|
|
129
|
+
ref={ref}
|
|
130
|
+
role="row"
|
|
131
|
+
aria-selected={selected || undefined}
|
|
132
|
+
aria-disabled={disabled || undefined}
|
|
133
|
+
tabIndex={disabled ? undefined : (tabIndex ?? 0)}
|
|
134
|
+
className={rootClass}
|
|
135
|
+
onClick={disabled ? undefined : handleRowClick}
|
|
136
|
+
onKeyDown={disabled ? undefined : handleKeyDown}
|
|
137
|
+
{...rest}
|
|
138
|
+
>
|
|
139
|
+
{orderedKeys.map((key) => {
|
|
140
|
+
const col = columnMap.get(key);
|
|
141
|
+
if (!col) return null;
|
|
142
|
+
const cssWidth =
|
|
143
|
+
widths?.[col.key] !== undefined
|
|
144
|
+
? `${widths[col.key]}px`
|
|
145
|
+
: toCssSize(col.width);
|
|
146
|
+
const slotStyle: CSSProperties = {
|
|
147
|
+
width: cssWidth,
|
|
148
|
+
minWidth: toCssSize(col.minWidth) ?? cssWidth,
|
|
149
|
+
flex: col.flex ? "1 1 0" : undefined,
|
|
150
|
+
justifyContent: alignToJustify(col.align),
|
|
151
|
+
};
|
|
152
|
+
const content: ReactNode = col.render
|
|
153
|
+
? col.render(data)
|
|
154
|
+
: (data as Record<string, ReactNode>)?.[col.key];
|
|
155
|
+
return (
|
|
156
|
+
<div key={col.key} className={rowStyles.cellSlot} style={slotStyle}>
|
|
157
|
+
<div
|
|
158
|
+
role="cell"
|
|
159
|
+
className={rowStyles.cell}
|
|
160
|
+
data-align={col.align ?? "start"}
|
|
161
|
+
>
|
|
162
|
+
<span className={rowStyles.cellInner}>{content}</span>
|
|
163
|
+
</div>
|
|
164
|
+
</div>
|
|
165
|
+
);
|
|
166
|
+
})}
|
|
167
|
+
</div>
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
const TableRowSelect = forwardRef(TableRowSelectInner) as <T>(
|
|
172
|
+
props: TableRowSelectProps<T> & { ref?: React.ForwardedRef<HTMLDivElement> },
|
|
173
|
+
) => ReturnType<typeof TableRowSelectInner>;
|
|
174
|
+
|
|
175
|
+
export { TableRowSelect };
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
/* Tabs — 두 variant
|
|
2
|
+
─ underline: 하단에 인디케이터 바. 콘텐츠 전환의 지배적 표준.
|
|
3
|
+
─ segmented: 연한 배경 컨테이너 안에 pill. 3~4개 옵션 중 하나 선택.
|
|
4
|
+
|
|
5
|
+
축 반응:
|
|
6
|
+
─ Density → --control-h-* (트리거 높이), --font-scale (라벨), --space-scale (gap)
|
|
7
|
+
─ Shape → segmented의 컨테이너/트리거 radius
|
|
8
|
+
─ Motion → 상태 전환 duration/easing
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/* Root ─────────────────────────────────────────────────────── */
|
|
12
|
+
.root {
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
gap: var(--space-4);
|
|
16
|
+
width: 100%;
|
|
17
|
+
min-width: 0;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/* List ─────────────────────────────────────────────────────── */
|
|
21
|
+
.list {
|
|
22
|
+
display: inline-flex;
|
|
23
|
+
align-items: stretch;
|
|
24
|
+
min-width: 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/* underline: 아래 경계선. 트리거의 하단 바가 이 위에 겹쳐 인디케이터 역할. */
|
|
28
|
+
.listUnderline {
|
|
29
|
+
gap: var(--space-1);
|
|
30
|
+
border-bottom: 1px solid var(--border);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/* text: 컨테이너·라인·인디케이터 전부 없음. 순수 텍스트 위계만.
|
|
34
|
+
페이지 헤더 sub-nav나 카드 안 미니 스위처처럼 "공간을 절대 안 먹는" 탭. */
|
|
35
|
+
.listText {
|
|
36
|
+
gap: var(--space-4);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/* segmented: 연한 회색 컨테이너. 안에서 pill이 슬라이드.
|
|
40
|
+
기본 full-width + 트리거 균일 분배가 가장 흔한 유즈케이스.
|
|
41
|
+
폭을 내용만큼으로 조이고 싶으면 부모에서 width/max-width를 조이거나
|
|
42
|
+
list에 width:auto를 덮으면 된다. */
|
|
43
|
+
.listSegmented {
|
|
44
|
+
gap: var(--space-0_5);
|
|
45
|
+
padding: var(--space-1);
|
|
46
|
+
background: var(--bg-muted);
|
|
47
|
+
border-radius: var(--radius-md);
|
|
48
|
+
width: 100%;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* Trigger 공통 ────────────────────────────────────────────── */
|
|
52
|
+
.trigger {
|
|
53
|
+
display: inline-flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
justify-content: center;
|
|
56
|
+
gap: var(--space-1_5);
|
|
57
|
+
font-family: var(--label-font);
|
|
58
|
+
font-weight: var(--label-weight);
|
|
59
|
+
line-height: var(--lh-tight);
|
|
60
|
+
letter-spacing: var(--label-tracking);
|
|
61
|
+
white-space: nowrap;
|
|
62
|
+
cursor: pointer;
|
|
63
|
+
user-select: none;
|
|
64
|
+
background: transparent;
|
|
65
|
+
border: 0;
|
|
66
|
+
padding: 0;
|
|
67
|
+
color: var(--fg-muted);
|
|
68
|
+
transition:
|
|
69
|
+
background var(--duration-slow) var(--ease-out),
|
|
70
|
+
color var(--duration-slow) var(--ease-out),
|
|
71
|
+
box-shadow var(--duration-fast) var(--ease-out);
|
|
72
|
+
}
|
|
73
|
+
.trigger:focus-visible {
|
|
74
|
+
outline: none;
|
|
75
|
+
box-shadow: var(--ring-shadow);
|
|
76
|
+
position: relative;
|
|
77
|
+
z-index: var(--z-docked);
|
|
78
|
+
}
|
|
79
|
+
.trigger:disabled {
|
|
80
|
+
cursor: not-allowed;
|
|
81
|
+
opacity: 0.5;
|
|
82
|
+
}
|
|
83
|
+
.trigger:hover:not(:disabled) {
|
|
84
|
+
color: var(--fg);
|
|
85
|
+
}
|
|
86
|
+
.trigger[data-state="active"] {
|
|
87
|
+
color: var(--fg-strong);
|
|
88
|
+
}
|
|
89
|
+
.trigger:hover:not(:disabled) .icon {
|
|
90
|
+
opacity: 1;
|
|
91
|
+
}
|
|
92
|
+
.trigger[data-state="active"] .icon {
|
|
93
|
+
opacity: 1;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/* Sizes — Button 계열과 동일한 --control-h-* 기반 */
|
|
97
|
+
.size_sm .trigger { height: var(--control-h-sm); font-size: var(--label-sm-size); letter-spacing: var(--label-tracking); }
|
|
98
|
+
.size_md .trigger { height: var(--control-h-md); font-size: var(--label-md-size); letter-spacing: var(--label-tracking); }
|
|
99
|
+
.size_lg .trigger { height: var(--control-h-lg); font-size: var(--label-md-size); letter-spacing: var(--label-tracking); }
|
|
100
|
+
|
|
101
|
+
/* Underline variant ─────────────────────────────────────────
|
|
102
|
+
개별 트리거의 ::after가 아니라 list에 붙은 단일 .underlineBar가
|
|
103
|
+
활성 트리거 위치(--tab-indicator-x/w)로 슬라이드. 라인은 텍스트 폭에
|
|
104
|
+
맞추기 위해 left/right 여백을 트리거 padding과 동일하게 뺀다. */
|
|
105
|
+
.triggerUnderline {
|
|
106
|
+
padding-inline: var(--space-2);
|
|
107
|
+
position: relative;
|
|
108
|
+
}
|
|
109
|
+
.size_sm .triggerUnderline { padding-inline: var(--space-1_5); }
|
|
110
|
+
.size_lg .triggerUnderline { padding-inline: var(--space-3); }
|
|
111
|
+
|
|
112
|
+
.listUnderline { position: relative; }
|
|
113
|
+
|
|
114
|
+
.underlineBar {
|
|
115
|
+
position: absolute;
|
|
116
|
+
left: 0;
|
|
117
|
+
bottom: calc(var(--hairline) * -1);
|
|
118
|
+
height: var(--hairline);
|
|
119
|
+
width: calc(var(--tab-indicator-w) - var(--space-2) * 2);
|
|
120
|
+
transform: translateX(calc(var(--tab-indicator-x) + var(--space-2)));
|
|
121
|
+
background: var(--fg-strong);
|
|
122
|
+
pointer-events: none;
|
|
123
|
+
}
|
|
124
|
+
.size_sm .underlineBar {
|
|
125
|
+
width: calc(var(--tab-indicator-w) - var(--space-1_5) * 2);
|
|
126
|
+
transform: translateX(calc(var(--tab-indicator-x) + var(--space-1_5)));
|
|
127
|
+
}
|
|
128
|
+
.size_lg .underlineBar {
|
|
129
|
+
width: calc(var(--tab-indicator-w) - var(--space-3) * 2);
|
|
130
|
+
transform: translateX(calc(var(--tab-indicator-x) + var(--space-3)));
|
|
131
|
+
}
|
|
132
|
+
/* ready=true 이후에만 transition — 초기 배치는 순간이동. */
|
|
133
|
+
.listUnderline[data-ready="true"] .underlineBar {
|
|
134
|
+
transition:
|
|
135
|
+
transform var(--duration-slow) var(--ease-in-out),
|
|
136
|
+
width var(--duration-slow) var(--ease-in-out);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/* Text variant ─────────────────────────────────────────────
|
|
140
|
+
장식 없음. 색만으로 위계 표현 — muted(기본) → fg(hover) → fg-strong(active).
|
|
141
|
+
좌우 패딩도 최소로 잡아 시각적 존재감을 낮춤. */
|
|
142
|
+
.triggerText {
|
|
143
|
+
padding-inline: var(--space-1);
|
|
144
|
+
}
|
|
145
|
+
.size_sm .triggerText { padding-inline: var(--space-0_5); }
|
|
146
|
+
.size_lg .triggerText { padding-inline: var(--space-1_5); }
|
|
147
|
+
|
|
148
|
+
.triggerText {
|
|
149
|
+
transition:
|
|
150
|
+
color var(--duration-slower) var(--ease-in-out),
|
|
151
|
+
background var(--duration-slow) var(--ease-out),
|
|
152
|
+
box-shadow var(--duration-fast) var(--ease-out);
|
|
153
|
+
}
|
|
154
|
+
.triggerText[data-state="active"] {
|
|
155
|
+
font-weight: var(--font-weight-semibold);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/* Segmented variant ────────────────────────────────────────
|
|
159
|
+
활성 표면(bg + shadow-xs)은 list에 얹힌 .pill이 담당하고, 트리거는
|
|
160
|
+
색만 바뀐다. pill이 활성 트리거 위치(--tab-indicator-x/w)로 슬라이드. */
|
|
161
|
+
.listSegmented { position: relative; }
|
|
162
|
+
|
|
163
|
+
.triggerSegmented {
|
|
164
|
+
padding-inline: var(--space-3);
|
|
165
|
+
border-radius: var(--radius-sm);
|
|
166
|
+
flex: 1 1 0;
|
|
167
|
+
min-width: 0;
|
|
168
|
+
position: relative;
|
|
169
|
+
z-index: var(--z-raise);
|
|
170
|
+
}
|
|
171
|
+
.size_sm .triggerSegmented { padding-inline: var(--space-2); border-radius: var(--radius-xs); }
|
|
172
|
+
.size_lg .triggerSegmented { padding-inline: var(--space-4); border-radius: var(--radius-sm); }
|
|
173
|
+
|
|
174
|
+
.size_sm .listSegmented .trigger { height: calc(var(--control-h-sm) - var(--space-1)); }
|
|
175
|
+
.size_md .listSegmented .trigger { height: calc(var(--control-h-md) - var(--space-1)); }
|
|
176
|
+
.size_lg .listSegmented .trigger { height: calc(var(--control-h-lg) - var(--space-1)); }
|
|
177
|
+
|
|
178
|
+
.triggerSegmented:hover:not(:disabled):not([data-state="active"]) {
|
|
179
|
+
background: var(--hover);
|
|
180
|
+
}
|
|
181
|
+
.triggerSegmented[data-state="active"] {
|
|
182
|
+
color: var(--fg-strong);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.pill {
|
|
186
|
+
position: absolute;
|
|
187
|
+
top: var(--space-1);
|
|
188
|
+
bottom: var(--space-1);
|
|
189
|
+
left: 0;
|
|
190
|
+
width: var(--tab-indicator-w);
|
|
191
|
+
transform: translateX(var(--tab-indicator-x));
|
|
192
|
+
background: var(--bg);
|
|
193
|
+
border-radius: var(--radius-sm);
|
|
194
|
+
box-shadow: var(--shadow-xs);
|
|
195
|
+
pointer-events: none;
|
|
196
|
+
z-index: var(--z-base);
|
|
197
|
+
}
|
|
198
|
+
.size_sm .pill { border-radius: var(--radius-xs); }
|
|
199
|
+
.size_lg .pill { border-radius: var(--radius-sm); }
|
|
200
|
+
.listSegmented[data-ready="true"] .pill {
|
|
201
|
+
transition:
|
|
202
|
+
transform var(--duration-slow) var(--ease-in-out),
|
|
203
|
+
width var(--duration-slow) var(--ease-in-out);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/* Icon / label slots — Button과 동일 규칙 */
|
|
207
|
+
.icon {
|
|
208
|
+
display: inline-flex;
|
|
209
|
+
align-items: center;
|
|
210
|
+
justify-content: center;
|
|
211
|
+
flex-shrink: 0;
|
|
212
|
+
opacity: 0.75;
|
|
213
|
+
transition: opacity var(--duration-slow) var(--ease-out);
|
|
214
|
+
}
|
|
215
|
+
.icon > svg {
|
|
216
|
+
display: block;
|
|
217
|
+
}
|
|
218
|
+
.label {
|
|
219
|
+
display: inline-flex;
|
|
220
|
+
align-items: center;
|
|
221
|
+
min-width: 0;
|
|
222
|
+
overflow: hidden;
|
|
223
|
+
text-overflow: ellipsis;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/* Panel ───────────────────────────────────────────────────── */
|
|
227
|
+
.panel {
|
|
228
|
+
min-width: 0;
|
|
229
|
+
}
|
|
230
|
+
.panel:focus-visible {
|
|
231
|
+
outline: none;
|
|
232
|
+
box-shadow: var(--ring-shadow);
|
|
233
|
+
border-radius: var(--radius-xs);
|
|
234
|
+
}
|