@conscience-technology/ctds 0.0.0-stage → 0.1.1
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 +254 -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,73 @@
|
|
|
1
|
+
/* Disclosure ───────────────────────────────────────────────
|
|
2
|
+
토글 섹션. grid-template-rows 트릭으로 CSS만으로 height 애니메이션.
|
|
3
|
+
trigger는 라벨 + caret, body는 opacity + height 페이드. */
|
|
4
|
+
|
|
5
|
+
.root {
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/* Trigger — 라벨과 caret을 양 끝에. */
|
|
11
|
+
.trigger {
|
|
12
|
+
display: inline-flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
justify-content: space-between;
|
|
15
|
+
gap: var(--space-2);
|
|
16
|
+
padding: var(--space-3) 0;
|
|
17
|
+
min-height: var(--control-h-md);
|
|
18
|
+
background: transparent;
|
|
19
|
+
border: none;
|
|
20
|
+
cursor: pointer;
|
|
21
|
+
font-family: var(--font-sans);
|
|
22
|
+
font-size: var(--text-sm);
|
|
23
|
+
font-weight: var(--font-weight-medium);
|
|
24
|
+
color: var(--fg);
|
|
25
|
+
text-align: start;
|
|
26
|
+
transition: var(--transition-colors);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.trigger:hover {
|
|
30
|
+
color: var(--fg-muted);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.trigger:focus-visible {
|
|
34
|
+
outline: none;
|
|
35
|
+
box-shadow: var(--ring-shadow);
|
|
36
|
+
border-radius: var(--radius-xs);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.triggerLabel {
|
|
40
|
+
flex: 1 1 auto;
|
|
41
|
+
min-width: 0;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.caret {
|
|
45
|
+
color: var(--fg-muted);
|
|
46
|
+
flex: 0 0 auto;
|
|
47
|
+
transition: transform var(--duration-base) var(--ease-out);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.root[data-open] .caret {
|
|
51
|
+
transform: rotate(180deg);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/* Body wrap — grid-template-rows 0fr→1fr 트릭.
|
|
55
|
+
bodyInner는 min-height:0 + overflow:hidden으로 그 안쪽에서 자연 높이만큼만 자람. */
|
|
56
|
+
.bodyWrap {
|
|
57
|
+
display: grid;
|
|
58
|
+
grid-template-rows: 0fr;
|
|
59
|
+
opacity: 0;
|
|
60
|
+
transition:
|
|
61
|
+
grid-template-rows var(--duration-base) var(--ease-emphasized),
|
|
62
|
+
opacity var(--duration-base) var(--ease-out);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.bodyWrap[data-open] {
|
|
66
|
+
grid-template-rows: 1fr;
|
|
67
|
+
opacity: 1;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.bodyInner {
|
|
71
|
+
min-height: 0;
|
|
72
|
+
overflow: hidden;
|
|
73
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
createContext,
|
|
5
|
+
forwardRef,
|
|
6
|
+
useCallback,
|
|
7
|
+
useContext,
|
|
8
|
+
useId,
|
|
9
|
+
useState,
|
|
10
|
+
type HTMLAttributes,
|
|
11
|
+
type ReactNode,
|
|
12
|
+
} from "react";
|
|
13
|
+
|
|
14
|
+
import { Icon } from "../Icon";
|
|
15
|
+
import styles from "./Disclosure.module.css";
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Disclosure — 토글로 열고 닫는 섹션.
|
|
19
|
+
*
|
|
20
|
+
* grid-template-rows: 0fr → 1fr 트릭으로 자연 높이 측정 없이 CSS만으로 애니메이션.
|
|
21
|
+
* caret 180° 회전, body opacity 페이드 동반.
|
|
22
|
+
*
|
|
23
|
+
* 사용:
|
|
24
|
+
* <Disclosure defaultOpen>
|
|
25
|
+
* <Disclosure.Trigger>적용 방법</Disclosure.Trigger>
|
|
26
|
+
* <Disclosure.Body>...</Disclosure.Body>
|
|
27
|
+
* </Disclosure>
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
interface DisclosureCtx {
|
|
31
|
+
open: boolean;
|
|
32
|
+
toggle: () => void;
|
|
33
|
+
bodyId: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const DisclosureContext = createContext<DisclosureCtx | null>(null);
|
|
37
|
+
|
|
38
|
+
function useDisclosure() {
|
|
39
|
+
const ctx = useContext(DisclosureContext);
|
|
40
|
+
if (!ctx) throw new Error("Disclosure.* must be used inside <Disclosure>");
|
|
41
|
+
return ctx;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface DisclosureProps extends HTMLAttributes<HTMLDivElement> {
|
|
45
|
+
/** controlled open 상태. */
|
|
46
|
+
open?: boolean;
|
|
47
|
+
defaultOpen?: boolean;
|
|
48
|
+
onOpenChange?: (open: boolean) => void;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const DisclosureRoot = forwardRef<HTMLDivElement, DisclosureProps>(
|
|
52
|
+
function DisclosureRoot(
|
|
53
|
+
{ open: openProp, defaultOpen = false, onOpenChange, className, children, ...rest },
|
|
54
|
+
ref,
|
|
55
|
+
) {
|
|
56
|
+
const [openState, setOpenState] = useState(defaultOpen);
|
|
57
|
+
const open = openProp ?? openState;
|
|
58
|
+
const bodyId = useId();
|
|
59
|
+
|
|
60
|
+
const toggle = useCallback(() => {
|
|
61
|
+
const next = !open;
|
|
62
|
+
if (openProp === undefined) setOpenState(next);
|
|
63
|
+
onOpenChange?.(next);
|
|
64
|
+
}, [open, openProp, onOpenChange]);
|
|
65
|
+
|
|
66
|
+
const rootClass = [styles.root, className ?? ""].filter(Boolean).join(" ");
|
|
67
|
+
|
|
68
|
+
return (
|
|
69
|
+
<DisclosureContext.Provider value={{ open, toggle, bodyId }}>
|
|
70
|
+
<div ref={ref} className={rootClass} data-open={open || undefined} {...rest}>
|
|
71
|
+
{children}
|
|
72
|
+
</div>
|
|
73
|
+
</DisclosureContext.Provider>
|
|
74
|
+
);
|
|
75
|
+
},
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
/* Trigger ────────────────────────────────────────────── */
|
|
79
|
+
export interface DisclosureTriggerProps
|
|
80
|
+
extends Omit<HTMLAttributes<HTMLButtonElement>, "onClick"> {
|
|
81
|
+
children?: ReactNode;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function DisclosureTrigger({ className, children, ...rest }: DisclosureTriggerProps) {
|
|
85
|
+
const { open, toggle, bodyId } = useDisclosure();
|
|
86
|
+
return (
|
|
87
|
+
<button
|
|
88
|
+
type="button"
|
|
89
|
+
className={[styles.trigger, className ?? ""].filter(Boolean).join(" ")}
|
|
90
|
+
aria-expanded={open}
|
|
91
|
+
aria-controls={bodyId}
|
|
92
|
+
onClick={toggle}
|
|
93
|
+
{...rest}
|
|
94
|
+
>
|
|
95
|
+
<span className={styles.triggerLabel}>{children}</span>
|
|
96
|
+
<Icon name="caret-down" size={12} className={styles.caret} />
|
|
97
|
+
</button>
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/* Body ────────────────────────────────────────────────── */
|
|
102
|
+
export interface DisclosureBodyProps extends HTMLAttributes<HTMLDivElement> {}
|
|
103
|
+
|
|
104
|
+
function DisclosureBody({ className, children, ...rest }: DisclosureBodyProps) {
|
|
105
|
+
const { open, bodyId } = useDisclosure();
|
|
106
|
+
return (
|
|
107
|
+
<div
|
|
108
|
+
id={bodyId}
|
|
109
|
+
className={[styles.bodyWrap, className ?? ""].filter(Boolean).join(" ")}
|
|
110
|
+
data-open={open || undefined}
|
|
111
|
+
aria-hidden={!open || undefined}
|
|
112
|
+
{...rest}
|
|
113
|
+
>
|
|
114
|
+
<div className={styles.bodyInner}>{children}</div>
|
|
115
|
+
</div>
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/* Compound export ────────────────────────────────────── */
|
|
120
|
+
type DisclosureComponent = typeof DisclosureRoot & {
|
|
121
|
+
Trigger: typeof DisclosureTrigger;
|
|
122
|
+
Body: typeof DisclosureBody;
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
const Disclosure = DisclosureRoot as DisclosureComponent;
|
|
126
|
+
Disclosure.Trigger = DisclosureTrigger;
|
|
127
|
+
Disclosure.Body = DisclosureBody;
|
|
128
|
+
|
|
129
|
+
export { Disclosure };
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
/* Drawer ────────────────────────────────────────────────────────
|
|
2
|
+
화면 가장자리에서 밀고 들어오는 패널. 흐름을 끊지 않고 상세·편집·설정을 띄울 때.
|
|
3
|
+
구조: [header: title · close] · [body: 자유 children] · [footer: actions]
|
|
4
|
+
Modal과 달리 가장자리에 붙어 full-length(세로 또는 가로)로 자람.
|
|
5
|
+
방향(side) × 사이즈(size) × backdrop 정책이 variant 축. */
|
|
6
|
+
|
|
7
|
+
/* Overlay ───────────────────────────────────────────────────── */
|
|
8
|
+
.overlay {
|
|
9
|
+
position: fixed;
|
|
10
|
+
inset: 0;
|
|
11
|
+
z-index: var(--z-overlay);
|
|
12
|
+
background: var(--scrim);
|
|
13
|
+
animation: drawer-overlay-in var(--duration-base) var(--ease-out);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.overlay[data-state="closed"] {
|
|
17
|
+
animation: drawer-overlay-out var(--duration-fast) var(--ease-in);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/* Content ───────────────────────────────────────────────────── */
|
|
21
|
+
.content {
|
|
22
|
+
position: fixed;
|
|
23
|
+
z-index: var(--z-modal);
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
background: var(--bg);
|
|
27
|
+
border: var(--hairline) solid var(--border);
|
|
28
|
+
box-shadow: var(--shadow-xl);
|
|
29
|
+
font-family: var(--font-sans);
|
|
30
|
+
color: var(--fg);
|
|
31
|
+
outline: none;
|
|
32
|
+
overflow: hidden;
|
|
33
|
+
will-change: transform, opacity;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/* side별 자리·사이즈·테두리 — radius는 바깥쪽은 떼고 안쪽만 둥글게. */
|
|
37
|
+
.content[data-side="right"] {
|
|
38
|
+
top: 0;
|
|
39
|
+
right: 0;
|
|
40
|
+
bottom: 0;
|
|
41
|
+
width: 100vw;
|
|
42
|
+
max-width: calc(100vw - var(--space-8));
|
|
43
|
+
border-right: 0;
|
|
44
|
+
border-radius: var(--radius-lg) 0 0 var(--radius-lg);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.content[data-side="left"] {
|
|
48
|
+
top: 0;
|
|
49
|
+
left: 0;
|
|
50
|
+
bottom: 0;
|
|
51
|
+
width: 100vw;
|
|
52
|
+
max-width: calc(100vw - var(--space-8));
|
|
53
|
+
border-left: 0;
|
|
54
|
+
border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.content[data-side="top"] {
|
|
58
|
+
top: 0;
|
|
59
|
+
left: 0;
|
|
60
|
+
right: 0;
|
|
61
|
+
height: 100vh;
|
|
62
|
+
max-height: calc(100vh - var(--space-8));
|
|
63
|
+
border-top: 0;
|
|
64
|
+
border-radius: 0 0 var(--radius-lg) var(--radius-lg);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.content[data-side="bottom"] {
|
|
68
|
+
bottom: 0;
|
|
69
|
+
left: 0;
|
|
70
|
+
right: 0;
|
|
71
|
+
height: 100vh;
|
|
72
|
+
max-height: calc(100vh - var(--space-8));
|
|
73
|
+
border-bottom: 0;
|
|
74
|
+
border-radius: var(--radius-lg) var(--radius-lg) 0 0;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/* size — right/left는 width, top/bottom은 height.
|
|
78
|
+
값은 space-2(8) 배수 조합: sm 44*8=352, md 55*8=440, lg 72*8=576. */
|
|
79
|
+
.content[data-side="right"][data-size="sm"],
|
|
80
|
+
.content[data-side="left"][data-size="sm"] {
|
|
81
|
+
width: calc(var(--space-2) * 44);
|
|
82
|
+
}
|
|
83
|
+
.content[data-side="right"][data-size="md"],
|
|
84
|
+
.content[data-side="left"][data-size="md"] {
|
|
85
|
+
width: calc(var(--space-2) * 55);
|
|
86
|
+
}
|
|
87
|
+
.content[data-side="right"][data-size="lg"],
|
|
88
|
+
.content[data-side="left"][data-size="lg"] {
|
|
89
|
+
width: calc(var(--space-2) * 72);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.content[data-side="top"][data-size="sm"],
|
|
93
|
+
.content[data-side="bottom"][data-size="sm"] {
|
|
94
|
+
height: calc(var(--space-2) * 36);
|
|
95
|
+
}
|
|
96
|
+
.content[data-side="top"][data-size="md"],
|
|
97
|
+
.content[data-side="bottom"][data-size="md"] {
|
|
98
|
+
height: calc(var(--space-2) * 50);
|
|
99
|
+
}
|
|
100
|
+
.content[data-side="top"][data-size="lg"],
|
|
101
|
+
.content[data-side="bottom"][data-size="lg"] {
|
|
102
|
+
height: calc(var(--space-2) * 64);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/* 등장·퇴장 애니 — side별 slide 방향.
|
|
106
|
+
거리는 --motion-distance-scale로 Motion 축 스왑. */
|
|
107
|
+
.content[data-side="right"] {
|
|
108
|
+
animation: drawer-in-right var(--duration-slow) var(--ease-emphasized);
|
|
109
|
+
}
|
|
110
|
+
.content[data-side="right"][data-state="closed"] {
|
|
111
|
+
animation: drawer-out-right var(--duration-base) var(--ease-in);
|
|
112
|
+
}
|
|
113
|
+
.content[data-side="left"] {
|
|
114
|
+
animation: drawer-in-left var(--duration-slow) var(--ease-emphasized);
|
|
115
|
+
}
|
|
116
|
+
.content[data-side="left"][data-state="closed"] {
|
|
117
|
+
animation: drawer-out-left var(--duration-base) var(--ease-in);
|
|
118
|
+
}
|
|
119
|
+
.content[data-side="top"] {
|
|
120
|
+
animation: drawer-in-top var(--duration-slow) var(--ease-emphasized);
|
|
121
|
+
}
|
|
122
|
+
.content[data-side="top"][data-state="closed"] {
|
|
123
|
+
animation: drawer-out-top var(--duration-base) var(--ease-in);
|
|
124
|
+
}
|
|
125
|
+
.content[data-side="bottom"] {
|
|
126
|
+
animation: drawer-in-bottom var(--duration-slow) var(--ease-emphasized);
|
|
127
|
+
}
|
|
128
|
+
.content[data-side="bottom"][data-state="closed"] {
|
|
129
|
+
animation: drawer-out-bottom var(--duration-base) var(--ease-in);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/* Header ────────────────────────────────────────────────────── */
|
|
133
|
+
.header {
|
|
134
|
+
display: flex;
|
|
135
|
+
align-items: flex-start;
|
|
136
|
+
gap: var(--space-2);
|
|
137
|
+
padding: var(--space-5) var(--space-5) 0;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.headerText {
|
|
141
|
+
flex: 1 1 auto;
|
|
142
|
+
min-width: 0;
|
|
143
|
+
display: flex;
|
|
144
|
+
flex-direction: column;
|
|
145
|
+
gap: var(--space-1);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.title {
|
|
149
|
+
margin: 0;
|
|
150
|
+
font-size: var(--text-sm);
|
|
151
|
+
line-height: var(--lh-sm);
|
|
152
|
+
letter-spacing: var(--type-sm-tracking);
|
|
153
|
+
font-weight: var(--font-weight-semibold);
|
|
154
|
+
color: var(--fg);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.description {
|
|
158
|
+
margin: 0;
|
|
159
|
+
font-size: var(--text-xs);
|
|
160
|
+
line-height: var(--lh-xs);
|
|
161
|
+
color: var(--fg-muted);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.close {
|
|
165
|
+
flex-shrink: 0;
|
|
166
|
+
color: var(--fg-muted);
|
|
167
|
+
/* title 첫 줄 line-height 중앙에 X 중심 맞춤. */
|
|
168
|
+
margin-top: calc((var(--lh-sm) - var(--iconbtn-h-md)) / 2);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/* Body ──────────────────────────────────────────────────────── */
|
|
172
|
+
/* 바깥(.body)은 overflow만, 안쪽(.bodyInner)이 좌우 padding을 깐다. */
|
|
173
|
+
.body {
|
|
174
|
+
flex: 1 1 auto;
|
|
175
|
+
min-height: 0;
|
|
176
|
+
overflow-y: auto;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.bodyInner {
|
|
180
|
+
padding: var(--space-4) var(--space-5) 0;
|
|
181
|
+
color: var(--fg);
|
|
182
|
+
font-size: var(--text-sm);
|
|
183
|
+
line-height: var(--lh-sm);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.body:last-child .bodyInner {
|
|
187
|
+
padding-bottom: var(--space-5);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/* Footer ────────────────────────────────────────────────────── */
|
|
191
|
+
.footer {
|
|
192
|
+
display: flex;
|
|
193
|
+
align-items: center;
|
|
194
|
+
gap: var(--space-1);
|
|
195
|
+
padding: var(--space-5) var(--space-5) var(--space-5);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.footer > :first-child {
|
|
199
|
+
margin-left: auto;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/* Animations ────────────────────────────────────────────────── */
|
|
203
|
+
/* 이동 거리: 기본은 100% translate(완전히 밖으로) + 추가 여유 --space-6.
|
|
204
|
+
Motion 축의 --motion-distance-scale(1.1 / 1 / 0.9 / 0)이 추가 여유를 스왑. */
|
|
205
|
+
@keyframes drawer-overlay-in {
|
|
206
|
+
from { opacity: 0; }
|
|
207
|
+
to { opacity: 1; }
|
|
208
|
+
}
|
|
209
|
+
@keyframes drawer-overlay-out {
|
|
210
|
+
from { opacity: 1; }
|
|
211
|
+
to { opacity: 0; }
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
@keyframes drawer-in-right {
|
|
215
|
+
from { opacity: 0; transform: translateX(calc(var(--space-6) * var(--motion-distance-scale, 1) + 100%)); }
|
|
216
|
+
to { opacity: 1; transform: translateX(0); }
|
|
217
|
+
}
|
|
218
|
+
@keyframes drawer-out-right {
|
|
219
|
+
from { opacity: 1; transform: translateX(0); }
|
|
220
|
+
to { opacity: 0; transform: translateX(calc(var(--space-6) * var(--motion-distance-scale, 1) + 100%)); }
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
@keyframes drawer-in-left {
|
|
224
|
+
from { opacity: 0; transform: translateX(calc(-var(--space-6) * var(--motion-distance-scale, 1) - 100%)); }
|
|
225
|
+
to { opacity: 1; transform: translateX(0); }
|
|
226
|
+
}
|
|
227
|
+
@keyframes drawer-out-left {
|
|
228
|
+
from { opacity: 1; transform: translateX(0); }
|
|
229
|
+
to { opacity: 0; transform: translateX(calc(-var(--space-6) * var(--motion-distance-scale, 1) - 100%)); }
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
@keyframes drawer-in-top {
|
|
233
|
+
from { opacity: 0; transform: translateY(calc(-var(--space-6) * var(--motion-distance-scale, 1) - 100%)); }
|
|
234
|
+
to { opacity: 1; transform: translateY(0); }
|
|
235
|
+
}
|
|
236
|
+
@keyframes drawer-out-top {
|
|
237
|
+
from { opacity: 1; transform: translateY(0); }
|
|
238
|
+
to { opacity: 0; transform: translateY(calc(-var(--space-6) * var(--motion-distance-scale, 1) - 100%)); }
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
@keyframes drawer-in-bottom {
|
|
242
|
+
from { opacity: 0; transform: translateY(calc(var(--space-6) * var(--motion-distance-scale, 1) + 100%)); }
|
|
243
|
+
to { opacity: 1; transform: translateY(0); }
|
|
244
|
+
}
|
|
245
|
+
@keyframes drawer-out-bottom {
|
|
246
|
+
from { opacity: 1; transform: translateY(0); }
|
|
247
|
+
to { opacity: 0; transform: translateY(calc(var(--space-6) * var(--motion-distance-scale, 1) + 100%)); }
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
@media (prefers-reduced-motion: reduce) {
|
|
251
|
+
.overlay,
|
|
252
|
+
.overlay[data-state="closed"],
|
|
253
|
+
.content,
|
|
254
|
+
.content[data-state="closed"] {
|
|
255
|
+
animation: none;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as RadixDialog from "@radix-ui/react-dialog";
|
|
4
|
+
import { forwardRef, type ReactNode } from "react";
|
|
5
|
+
|
|
6
|
+
import { Icon } from "../Icon";
|
|
7
|
+
import { IconButton } from "../IconButton";
|
|
8
|
+
|
|
9
|
+
import styles from "./Drawer.module.css";
|
|
10
|
+
|
|
11
|
+
export type DrawerSide = "right" | "left" | "top" | "bottom";
|
|
12
|
+
export type DrawerSize = "sm" | "md" | "lg";
|
|
13
|
+
export type DrawerBackdrop = "scrim" | "locked" | "none";
|
|
14
|
+
|
|
15
|
+
export interface DrawerProps {
|
|
16
|
+
open: boolean;
|
|
17
|
+
onOpenChange: (open: boolean) => void;
|
|
18
|
+
/** 헤더 좌측 타이틀. 접근성상 필수 — 숨길 땐 titleSrOnly. */
|
|
19
|
+
title: ReactNode;
|
|
20
|
+
/** 타이틀 바로 아래 한두 줄 설명. 헤더 영역 안에서 title과 바짝 붙음. */
|
|
21
|
+
description?: ReactNode;
|
|
22
|
+
/** 타이틀을 시각적으로 숨기고 스크린리더에만 노출. */
|
|
23
|
+
titleSrOnly?: boolean;
|
|
24
|
+
/** 바디 콘텐츠. Modal보다 길어도 OK — 세로 스크롤 담당. */
|
|
25
|
+
children?: ReactNode;
|
|
26
|
+
/** 하단 액션 영역. Button들을 넘김. 없으면 footer 자체가 렌더되지 않음. */
|
|
27
|
+
footer?: ReactNode;
|
|
28
|
+
/** 헤더 우측 X 버튼. 기본 true. */
|
|
29
|
+
dismissible?: boolean;
|
|
30
|
+
/** 스크린리더용 X 버튼 라벨. i18n 호출부 책임. */
|
|
31
|
+
dismissLabel?: string;
|
|
32
|
+
/** ESC 키 닫힘 차단. 중요한 확인/저장 중엔 true. */
|
|
33
|
+
disableEscape?: boolean;
|
|
34
|
+
/** 열리는 방향. 기본 right. */
|
|
35
|
+
side?: DrawerSide;
|
|
36
|
+
/** 가로/세로 사이즈. right/left는 가로 폭, top/bottom은 세로 높이. 기본 sm. */
|
|
37
|
+
size?: DrawerSize;
|
|
38
|
+
/**
|
|
39
|
+
* backdrop(dim) 정책.
|
|
40
|
+
* - `scrim` (기본): dim O + 바깥 클릭 닫힘.
|
|
41
|
+
* - `locked`: dim O + 바깥 클릭 무시 (실수 유발 방지).
|
|
42
|
+
* - `none`: dim 없음 — non-modal 사이드 패널 느낌. 뒤 영역 계속 조작 가능.
|
|
43
|
+
*/
|
|
44
|
+
backdrop?: DrawerBackdrop;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export const Drawer = forwardRef<HTMLDivElement, DrawerProps>(function Drawer(
|
|
48
|
+
{
|
|
49
|
+
open,
|
|
50
|
+
onOpenChange,
|
|
51
|
+
title,
|
|
52
|
+
description,
|
|
53
|
+
titleSrOnly,
|
|
54
|
+
children,
|
|
55
|
+
footer,
|
|
56
|
+
dismissible = true,
|
|
57
|
+
dismissLabel,
|
|
58
|
+
disableEscape,
|
|
59
|
+
side = "right",
|
|
60
|
+
size = "sm",
|
|
61
|
+
backdrop = "scrim",
|
|
62
|
+
},
|
|
63
|
+
ref,
|
|
64
|
+
) {
|
|
65
|
+
// non-modal이면 Radix에게 modal=false로 넘겨 뒤 영역 포인터 이벤트 유지.
|
|
66
|
+
const isModal = backdrop !== "none";
|
|
67
|
+
|
|
68
|
+
return (
|
|
69
|
+
<RadixDialog.Root open={open} onOpenChange={onOpenChange} modal={isModal}>
|
|
70
|
+
<RadixDialog.Portal>
|
|
71
|
+
{backdrop !== "none" && (
|
|
72
|
+
<RadixDialog.Overlay className={styles.overlay} />
|
|
73
|
+
)}
|
|
74
|
+
<RadixDialog.Content
|
|
75
|
+
ref={ref}
|
|
76
|
+
className={styles.content}
|
|
77
|
+
data-side={side}
|
|
78
|
+
data-size={size}
|
|
79
|
+
onEscapeKeyDown={(e) => {
|
|
80
|
+
if (disableEscape) e.preventDefault();
|
|
81
|
+
}}
|
|
82
|
+
onPointerDownOutside={(e) => {
|
|
83
|
+
// scrim만 바깥 클릭 닫힘. locked/none은 Radix 기본 닫힘 차단.
|
|
84
|
+
if (backdrop !== "scrim") e.preventDefault();
|
|
85
|
+
}}
|
|
86
|
+
onInteractOutside={(e) => {
|
|
87
|
+
if (backdrop === "none") e.preventDefault();
|
|
88
|
+
}}
|
|
89
|
+
>
|
|
90
|
+
<div className={styles.header}>
|
|
91
|
+
<div className={styles.headerText}>
|
|
92
|
+
<RadixDialog.Title
|
|
93
|
+
className={[styles.title, titleSrOnly && "visually-hidden"]
|
|
94
|
+
.filter(Boolean)
|
|
95
|
+
.join(" ")}
|
|
96
|
+
>
|
|
97
|
+
{title}
|
|
98
|
+
</RadixDialog.Title>
|
|
99
|
+
{description && (
|
|
100
|
+
<RadixDialog.Description className={styles.description}>
|
|
101
|
+
{description}
|
|
102
|
+
</RadixDialog.Description>
|
|
103
|
+
)}
|
|
104
|
+
</div>
|
|
105
|
+
{dismissible && (
|
|
106
|
+
<RadixDialog.Close asChild>
|
|
107
|
+
<IconButton
|
|
108
|
+
className={styles.close}
|
|
109
|
+
variant="ghost"
|
|
110
|
+
icon={<Icon name="x" />}
|
|
111
|
+
aria-label={dismissLabel}
|
|
112
|
+
/>
|
|
113
|
+
</RadixDialog.Close>
|
|
114
|
+
)}
|
|
115
|
+
</div>
|
|
116
|
+
{children !== undefined && children !== null && (
|
|
117
|
+
<div className={styles.body}>
|
|
118
|
+
<div className={styles.bodyInner}>{children}</div>
|
|
119
|
+
</div>
|
|
120
|
+
)}
|
|
121
|
+
{footer && <div className={styles.footer}>{footer}</div>}
|
|
122
|
+
</RadixDialog.Content>
|
|
123
|
+
</RadixDialog.Portal>
|
|
124
|
+
</RadixDialog.Root>
|
|
125
|
+
);
|
|
126
|
+
});
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/* EmptyState ──────────────────────────────────────────────────
|
|
2
|
+
리스트/테이블/대시보드 영역이 비었을 때 영역 전체를 채우는 자리채움.
|
|
3
|
+
세로 중앙정렬 — 시각 요소 → 타이틀 → 설명 → 액션.
|
|
4
|
+
size는 외곽 padding과 시각 요소/텍스트 스케일을 함께 스왑. */
|
|
5
|
+
.root {
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
align-items: center;
|
|
9
|
+
justify-content: center;
|
|
10
|
+
text-align: center;
|
|
11
|
+
color: var(--fg);
|
|
12
|
+
font-family: var(--font-sans);
|
|
13
|
+
/* 영역 전체를 채우도록 컨테이너 폭·높이를 꽉 채운다. */
|
|
14
|
+
width: 100%;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/* Visual slot ─────────────────────────────────────────────────
|
|
18
|
+
illustration: 자체 폭/높이 결정. 컨테이너는 size별 min-height만 보장.
|
|
19
|
+
icon: --icon-size-* 토큰 기반, size별로 몇 배수 스케일. */
|
|
20
|
+
.illustration {
|
|
21
|
+
display: inline-flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
justify-content: center;
|
|
24
|
+
flex-shrink: 0;
|
|
25
|
+
}
|
|
26
|
+
.icon {
|
|
27
|
+
display: inline-flex;
|
|
28
|
+
align-items: center;
|
|
29
|
+
justify-content: center;
|
|
30
|
+
flex-shrink: 0;
|
|
31
|
+
color: var(--fg-subtle);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* Text block — title/description은 세트로 묶여 보이도록 gap 좁게. */
|
|
35
|
+
.text {
|
|
36
|
+
display: flex;
|
|
37
|
+
flex-direction: column;
|
|
38
|
+
align-items: center;
|
|
39
|
+
gap: var(--space-1);
|
|
40
|
+
max-width: 42ch;
|
|
41
|
+
}
|
|
42
|
+
.title {
|
|
43
|
+
color: var(--fg);
|
|
44
|
+
font-weight: var(--font-weight-medium);
|
|
45
|
+
}
|
|
46
|
+
.description {
|
|
47
|
+
color: var(--fg-muted);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* Actions — Button 1~2개 가로 배치. */
|
|
51
|
+
.actions {
|
|
52
|
+
display: flex;
|
|
53
|
+
align-items: center;
|
|
54
|
+
justify-content: center;
|
|
55
|
+
gap: var(--space-2);
|
|
56
|
+
flex-wrap: wrap;
|
|
57
|
+
}
|
|
58
|
+
/* text ↔ actions 사이는 다른 요소 간격보다 한 단계 더 벌린다 —
|
|
59
|
+
"읽은 뒤 → 행동"으로 넘어가는 breath. root gap 위에 margin-top으로 추가. */
|
|
60
|
+
.text + .actions {
|
|
61
|
+
margin-top: var(--space-2);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/* Size scale ──────────────────────────────────────────────────
|
|
65
|
+
sm: 패널·사이드 리스트 안 (좁은 영역)
|
|
66
|
+
md: 메인 콘텐츠 영역 (테이블·그리드)
|
|
67
|
+
아이콘·폰트·패딩 전부 콘솔 밀도 기준으로 보수적. 과하지 않게. */
|
|
68
|
+
.sizeSm {
|
|
69
|
+
gap: var(--space-2);
|
|
70
|
+
padding: var(--space-5) var(--space-4);
|
|
71
|
+
}
|
|
72
|
+
.sizeSm .icon > svg {
|
|
73
|
+
width: var(--icon-size-lg);
|
|
74
|
+
height: var(--icon-size-lg);
|
|
75
|
+
}
|
|
76
|
+
.sizeSm .title {
|
|
77
|
+
font-size: var(--text-sm);
|
|
78
|
+
line-height: var(--lh-sm);
|
|
79
|
+
}
|
|
80
|
+
.sizeSm .description {
|
|
81
|
+
font-size: var(--text-sm);
|
|
82
|
+
line-height: var(--lh-sm);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.sizeMd {
|
|
86
|
+
gap: var(--space-3);
|
|
87
|
+
padding: var(--space-6) var(--space-5);
|
|
88
|
+
}
|
|
89
|
+
.sizeMd .icon > svg {
|
|
90
|
+
/* icon-size-lg × 1.17 ≒ 28px — sm(24)보다 살짝만 큼. */
|
|
91
|
+
width: calc(var(--icon-size-lg) * 1.17);
|
|
92
|
+
height: calc(var(--icon-size-lg) * 1.17);
|
|
93
|
+
}
|
|
94
|
+
.sizeMd .title {
|
|
95
|
+
font-size: var(--text-base);
|
|
96
|
+
line-height: var(--lh-base);
|
|
97
|
+
}
|
|
98
|
+
.sizeMd .description {
|
|
99
|
+
font-size: var(--text-sm);
|
|
100
|
+
line-height: var(--lh-sm);
|
|
101
|
+
}
|
|
102
|
+
|