@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,322 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
forwardRef,
|
|
5
|
+
useCallback,
|
|
6
|
+
useLayoutEffect,
|
|
7
|
+
useRef,
|
|
8
|
+
type ChangeEvent,
|
|
9
|
+
type CSSProperties,
|
|
10
|
+
type FormEvent,
|
|
11
|
+
type KeyboardEvent,
|
|
12
|
+
} from "react";
|
|
13
|
+
import { Paperclip as PhPaperclip } from "@phosphor-icons/react";
|
|
14
|
+
import { AttachmentChip } from "@/components/AttachmentChip";
|
|
15
|
+
import { AttachmentThumb } from "@/components/AttachmentThumb";
|
|
16
|
+
import { QuotationBar } from "@/components/QuotationBar";
|
|
17
|
+
import { ModelSelector } from "./ModelSelector";
|
|
18
|
+
import { SendButton } from "./SendButton";
|
|
19
|
+
import styles from "./ChatInput.module.css";
|
|
20
|
+
|
|
21
|
+
export type ChatInputShape = "multi" | "single";
|
|
22
|
+
export type ChatInputRadius = "square" | "rounded" | "circular";
|
|
23
|
+
|
|
24
|
+
/** 첨부 공용 타입 — ChatInput·Message 양쪽에서 재사용. */
|
|
25
|
+
export interface ChatAttachmentImage {
|
|
26
|
+
id: string;
|
|
27
|
+
kind: "image";
|
|
28
|
+
src?: string; // 아직 로딩 중이면 생략
|
|
29
|
+
alt?: string;
|
|
30
|
+
loading?: boolean;
|
|
31
|
+
}
|
|
32
|
+
export interface ChatAttachmentFile {
|
|
33
|
+
id: string;
|
|
34
|
+
kind: "file";
|
|
35
|
+
filename: string;
|
|
36
|
+
}
|
|
37
|
+
export type ChatAttachment = ChatAttachmentImage | ChatAttachmentFile;
|
|
38
|
+
|
|
39
|
+
export interface ChatInputModel {
|
|
40
|
+
id: string;
|
|
41
|
+
label: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface ChatInputProps {
|
|
45
|
+
shape?: ChatInputShape;
|
|
46
|
+
radius?: ChatInputRadius;
|
|
47
|
+
|
|
48
|
+
value: string;
|
|
49
|
+
onChange: (v: string) => void;
|
|
50
|
+
|
|
51
|
+
/** 전송 가능할 때 호출. onStop이 분기. */
|
|
52
|
+
onSend: () => void;
|
|
53
|
+
/** 스트리밍 중 send 자리에 stop. */
|
|
54
|
+
onStop?: () => void;
|
|
55
|
+
isStreaming?: boolean;
|
|
56
|
+
|
|
57
|
+
attachments?: ChatAttachment[];
|
|
58
|
+
onRemoveAttachment?: (id: string) => void;
|
|
59
|
+
onAttach?: (files: File[]) => void;
|
|
60
|
+
|
|
61
|
+
quotation?: { text: string; onRemove?: () => void };
|
|
62
|
+
|
|
63
|
+
/** 모델 선택 UI. 없거나 selectedModel 없으면 숨김. */
|
|
64
|
+
models?: ChatInputModel[];
|
|
65
|
+
selectedModel?: string;
|
|
66
|
+
onSelectModel?: (id: string) => void;
|
|
67
|
+
|
|
68
|
+
placeholder?: string;
|
|
69
|
+
disabled?: boolean;
|
|
70
|
+
/** multiLine일 때 textarea max rows. 넘으면 세로 스크롤. */
|
|
71
|
+
maxRows?: number;
|
|
72
|
+
/** 외부에서 wrapper에 추가 폭 지정하고 싶을 때. */
|
|
73
|
+
className?: string;
|
|
74
|
+
style?: CSSProperties;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** 10자 넘으면 ModelSelector compact — SingleLine 공간 압박 완화. */
|
|
78
|
+
const SINGLE_COMPACT_THRESHOLD = 10;
|
|
79
|
+
|
|
80
|
+
export const ChatInput = forwardRef<HTMLDivElement, ChatInputProps>(
|
|
81
|
+
function ChatInput(props, ref) {
|
|
82
|
+
const {
|
|
83
|
+
shape = "multi",
|
|
84
|
+
radius = "rounded",
|
|
85
|
+
value,
|
|
86
|
+
onChange,
|
|
87
|
+
onSend,
|
|
88
|
+
onStop,
|
|
89
|
+
isStreaming = false,
|
|
90
|
+
attachments = [],
|
|
91
|
+
onRemoveAttachment,
|
|
92
|
+
onAttach,
|
|
93
|
+
quotation,
|
|
94
|
+
models,
|
|
95
|
+
selectedModel,
|
|
96
|
+
onSelectModel,
|
|
97
|
+
placeholder = "Ask me anything…",
|
|
98
|
+
disabled = false,
|
|
99
|
+
maxRows = 8,
|
|
100
|
+
className,
|
|
101
|
+
style,
|
|
102
|
+
} = props;
|
|
103
|
+
|
|
104
|
+
const taRef = useRef<HTMLTextAreaElement>(null);
|
|
105
|
+
const fileRef = useRef<HTMLInputElement>(null);
|
|
106
|
+
|
|
107
|
+
const canSend = !disabled && (value.trim().length > 0 || attachments.length > 0);
|
|
108
|
+
const showStop = isStreaming && !!onStop;
|
|
109
|
+
|
|
110
|
+
/* autoResize for multi */
|
|
111
|
+
useLayoutEffect(() => {
|
|
112
|
+
if (shape !== "multi") return;
|
|
113
|
+
const el = taRef.current;
|
|
114
|
+
if (!el) return;
|
|
115
|
+
const cs = getComputedStyle(el);
|
|
116
|
+
const lh = parseFloat(cs.lineHeight);
|
|
117
|
+
const pt = parseFloat(cs.paddingTop);
|
|
118
|
+
const pb = parseFloat(cs.paddingBottom);
|
|
119
|
+
const chrome = pt + pb;
|
|
120
|
+
const maxH = lh * maxRows + chrome;
|
|
121
|
+
el.style.height = "auto";
|
|
122
|
+
const next = Math.min(el.scrollHeight, maxH);
|
|
123
|
+
el.style.height = `${next}px`;
|
|
124
|
+
el.style.overflowY = el.scrollHeight > maxH ? "auto" : "hidden";
|
|
125
|
+
}, [shape, value, maxRows]);
|
|
126
|
+
|
|
127
|
+
const handleKeyDown = useCallback(
|
|
128
|
+
(e: KeyboardEvent<HTMLTextAreaElement | HTMLInputElement>) => {
|
|
129
|
+
if (e.key !== "Enter") return;
|
|
130
|
+
if (e.shiftKey) return; // multi: 줄바꿈 허용
|
|
131
|
+
if (shape === "multi" && e.nativeEvent.isComposing) return;
|
|
132
|
+
e.preventDefault();
|
|
133
|
+
if (showStop) {
|
|
134
|
+
onStop?.();
|
|
135
|
+
} else if (canSend) {
|
|
136
|
+
onSend();
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
[shape, canSend, showStop, onSend, onStop]
|
|
140
|
+
);
|
|
141
|
+
|
|
142
|
+
const handleSendClick = useCallback(() => {
|
|
143
|
+
if (showStop) onStop?.();
|
|
144
|
+
else if (canSend) onSend();
|
|
145
|
+
}, [showStop, canSend, onSend, onStop]);
|
|
146
|
+
|
|
147
|
+
const handleAttachClick = useCallback(() => {
|
|
148
|
+
fileRef.current?.click();
|
|
149
|
+
}, []);
|
|
150
|
+
|
|
151
|
+
const handleFileChange = useCallback(
|
|
152
|
+
(e: ChangeEvent<HTMLInputElement>) => {
|
|
153
|
+
const files = Array.from(e.target.files ?? []);
|
|
154
|
+
if (files.length > 0) onAttach?.(files);
|
|
155
|
+
// 같은 파일 다시 선택 가능하게
|
|
156
|
+
e.target.value = "";
|
|
157
|
+
},
|
|
158
|
+
[onAttach]
|
|
159
|
+
);
|
|
160
|
+
|
|
161
|
+
const hasAttachments = attachments.length > 0;
|
|
162
|
+
const modelLabel =
|
|
163
|
+
models && selectedModel
|
|
164
|
+
? models.find((m) => m.id === selectedModel)?.label ?? selectedModel
|
|
165
|
+
: null;
|
|
166
|
+
|
|
167
|
+
/* SingleLine에서 입력이 10자 넘으면 모델 selector compact. */
|
|
168
|
+
const modelCompact =
|
|
169
|
+
shape === "single" && value.length > SINGLE_COMPACT_THRESHOLD;
|
|
170
|
+
|
|
171
|
+
const rootCls = [
|
|
172
|
+
styles.root,
|
|
173
|
+
styles[`shape-${shape}`],
|
|
174
|
+
styles[`radius-${radius}`],
|
|
175
|
+
disabled ? styles.disabled : "",
|
|
176
|
+
className,
|
|
177
|
+
]
|
|
178
|
+
.filter(Boolean)
|
|
179
|
+
.join(" ");
|
|
180
|
+
|
|
181
|
+
const AttachInput = (
|
|
182
|
+
<input
|
|
183
|
+
ref={fileRef}
|
|
184
|
+
type="file"
|
|
185
|
+
multiple
|
|
186
|
+
className={styles.hiddenFile}
|
|
187
|
+
onChange={handleFileChange}
|
|
188
|
+
aria-hidden
|
|
189
|
+
tabIndex={-1}
|
|
190
|
+
/>
|
|
191
|
+
);
|
|
192
|
+
|
|
193
|
+
const AttachButton = (
|
|
194
|
+
<button
|
|
195
|
+
type="button"
|
|
196
|
+
className={styles.attachBtn}
|
|
197
|
+
onClick={handleAttachClick}
|
|
198
|
+
disabled={disabled || !onAttach}
|
|
199
|
+
aria-label="파일 첨부"
|
|
200
|
+
>
|
|
201
|
+
<PhPaperclip className={styles.attachIcon} weight="regular" />
|
|
202
|
+
</button>
|
|
203
|
+
);
|
|
204
|
+
|
|
205
|
+
const ModelAndSend = (
|
|
206
|
+
<div className={styles.actions}>
|
|
207
|
+
{modelLabel ? (
|
|
208
|
+
<ModelSelector
|
|
209
|
+
label={modelLabel}
|
|
210
|
+
compact={modelCompact}
|
|
211
|
+
onClick={() => {
|
|
212
|
+
if (!models || !onSelectModel) return;
|
|
213
|
+
// 간단 토글 — 다음 모델. 실제 메뉴는 소비처에서 ContextMenu로.
|
|
214
|
+
const idx = models.findIndex((m) => m.id === selectedModel);
|
|
215
|
+
const next = models[(idx + 1) % models.length];
|
|
216
|
+
onSelectModel(next.id);
|
|
217
|
+
}}
|
|
218
|
+
disabled={disabled}
|
|
219
|
+
/>
|
|
220
|
+
) : null}
|
|
221
|
+
<SendButton
|
|
222
|
+
active={canSend}
|
|
223
|
+
streaming={showStop}
|
|
224
|
+
disabled={disabled && !showStop}
|
|
225
|
+
onClick={handleSendClick}
|
|
226
|
+
/>
|
|
227
|
+
</div>
|
|
228
|
+
);
|
|
229
|
+
|
|
230
|
+
const handleFormSubmit = (e: FormEvent) => {
|
|
231
|
+
e.preventDefault();
|
|
232
|
+
if (showStop) onStop?.();
|
|
233
|
+
else if (canSend) onSend();
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
return (
|
|
237
|
+
<div ref={ref} className={rootCls} style={style}>
|
|
238
|
+
{/* 첨부물 바 */}
|
|
239
|
+
{hasAttachments ? (
|
|
240
|
+
<div className={styles.attachments}>
|
|
241
|
+
{attachments.map((a) => (
|
|
242
|
+
<div
|
|
243
|
+
key={a.id}
|
|
244
|
+
className={styles.attachmentCell}
|
|
245
|
+
data-kind={a.kind}
|
|
246
|
+
>
|
|
247
|
+
{a.kind === "image" ? (
|
|
248
|
+
<AttachmentThumb
|
|
249
|
+
src={a.src}
|
|
250
|
+
alt={a.alt}
|
|
251
|
+
size="md"
|
|
252
|
+
loading={a.loading}
|
|
253
|
+
onRemove={
|
|
254
|
+
onRemoveAttachment
|
|
255
|
+
? () => onRemoveAttachment(a.id)
|
|
256
|
+
: undefined
|
|
257
|
+
}
|
|
258
|
+
/>
|
|
259
|
+
) : (
|
|
260
|
+
<AttachmentChip
|
|
261
|
+
filename={a.filename}
|
|
262
|
+
onRemove={
|
|
263
|
+
onRemoveAttachment
|
|
264
|
+
? () => onRemoveAttachment(a.id)
|
|
265
|
+
: undefined
|
|
266
|
+
}
|
|
267
|
+
/>
|
|
268
|
+
)}
|
|
269
|
+
</div>
|
|
270
|
+
))}
|
|
271
|
+
</div>
|
|
272
|
+
) : null}
|
|
273
|
+
|
|
274
|
+
{/* Quotation */}
|
|
275
|
+
{quotation ? (
|
|
276
|
+
<div className={styles.quotation}>
|
|
277
|
+
<QuotationBar text={quotation.text} onRemove={quotation.onRemove} />
|
|
278
|
+
</div>
|
|
279
|
+
) : null}
|
|
280
|
+
|
|
281
|
+
<form className={styles.body} onSubmit={handleFormSubmit}>
|
|
282
|
+
{shape === "single" ? (
|
|
283
|
+
<>
|
|
284
|
+
{AttachButton}
|
|
285
|
+
<input
|
|
286
|
+
type="text"
|
|
287
|
+
className={styles.singleField}
|
|
288
|
+
value={value}
|
|
289
|
+
onChange={(e) => onChange(e.target.value)}
|
|
290
|
+
onKeyDown={handleKeyDown}
|
|
291
|
+
placeholder={placeholder}
|
|
292
|
+
disabled={disabled}
|
|
293
|
+
aria-label={placeholder}
|
|
294
|
+
/>
|
|
295
|
+
{ModelAndSend}
|
|
296
|
+
</>
|
|
297
|
+
) : (
|
|
298
|
+
<div className={styles.multiStack}>
|
|
299
|
+
<textarea
|
|
300
|
+
ref={taRef}
|
|
301
|
+
className={styles.multiField}
|
|
302
|
+
value={value}
|
|
303
|
+
onChange={(e) => onChange(e.target.value)}
|
|
304
|
+
onKeyDown={handleKeyDown}
|
|
305
|
+
placeholder={placeholder}
|
|
306
|
+
disabled={disabled}
|
|
307
|
+
rows={1}
|
|
308
|
+
aria-label={placeholder}
|
|
309
|
+
/>
|
|
310
|
+
<div className={styles.footer}>
|
|
311
|
+
{AttachButton}
|
|
312
|
+
{ModelAndSend}
|
|
313
|
+
</div>
|
|
314
|
+
</div>
|
|
315
|
+
)}
|
|
316
|
+
</form>
|
|
317
|
+
|
|
318
|
+
{AttachInput}
|
|
319
|
+
</div>
|
|
320
|
+
);
|
|
321
|
+
}
|
|
322
|
+
);
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import type { MouseEvent } from "react";
|
|
4
|
+
import {
|
|
5
|
+
Infinity as PhInfinity,
|
|
6
|
+
CaretDown as PhCaretDown,
|
|
7
|
+
} from "@phosphor-icons/react";
|
|
8
|
+
import styles from "./ChatInput.module.css";
|
|
9
|
+
|
|
10
|
+
interface ModelSelectorProps {
|
|
11
|
+
label: string;
|
|
12
|
+
/** true면 라벨 숨기고 아이콘만 (SingleLine에서 공간 부족할 때). */
|
|
13
|
+
compact?: boolean;
|
|
14
|
+
onClick?: (e: MouseEvent<HTMLButtonElement>) => void;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function ModelSelector({
|
|
19
|
+
label,
|
|
20
|
+
compact = false,
|
|
21
|
+
onClick,
|
|
22
|
+
disabled,
|
|
23
|
+
}: ModelSelectorProps) {
|
|
24
|
+
return (
|
|
25
|
+
<button
|
|
26
|
+
type="button"
|
|
27
|
+
className={styles.modelBtn}
|
|
28
|
+
data-compact={compact || undefined}
|
|
29
|
+
onClick={onClick}
|
|
30
|
+
disabled={disabled}
|
|
31
|
+
aria-label={compact ? `모델: ${label}` : undefined}
|
|
32
|
+
>
|
|
33
|
+
<PhInfinity className={styles.modelLead} weight="regular" aria-hidden />
|
|
34
|
+
{!compact ? <span className={styles.modelLabel}>{label}</span> : null}
|
|
35
|
+
{!compact ? (
|
|
36
|
+
<PhCaretDown className={styles.modelCaret} weight="bold" aria-hidden />
|
|
37
|
+
) : null}
|
|
38
|
+
</button>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import type { MouseEvent } from "react";
|
|
4
|
+
import {
|
|
5
|
+
ArrowUp as PhArrowUp,
|
|
6
|
+
Square as PhSquare,
|
|
7
|
+
} from "@phosphor-icons/react";
|
|
8
|
+
import styles from "./ChatInput.module.css";
|
|
9
|
+
|
|
10
|
+
interface SendButtonProps {
|
|
11
|
+
/** 입력에 텍스트/첨부가 있어 send 가능한지. */
|
|
12
|
+
active: boolean;
|
|
13
|
+
/** 스트리밍 중 → stop 아이콘. */
|
|
14
|
+
streaming?: boolean;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
onClick: (e: MouseEvent<HTMLButtonElement>) => void;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function SendButton({
|
|
20
|
+
active,
|
|
21
|
+
streaming = false,
|
|
22
|
+
disabled,
|
|
23
|
+
onClick,
|
|
24
|
+
}: SendButtonProps) {
|
|
25
|
+
return (
|
|
26
|
+
<button
|
|
27
|
+
type="button"
|
|
28
|
+
className={styles.sendBtn}
|
|
29
|
+
data-active={active || streaming || undefined}
|
|
30
|
+
disabled={disabled}
|
|
31
|
+
onClick={onClick}
|
|
32
|
+
aria-label={streaming ? "중지" : "보내기"}
|
|
33
|
+
>
|
|
34
|
+
{streaming ? (
|
|
35
|
+
<PhSquare className={styles.sendIcon} weight="fill" />
|
|
36
|
+
) : (
|
|
37
|
+
<PhArrowUp className={styles.sendIcon} weight="bold" />
|
|
38
|
+
)}
|
|
39
|
+
</button>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/* Checkbox ─────────────────────────────────────────────────────
|
|
2
|
+
폼 · 필터에서 다중 선택을 표시하는 컨트롤.
|
|
3
|
+
시각 요소 = .indicator, 접근성 = 실제 <input type="checkbox"> (.visually-hidden).
|
|
4
|
+
FilterButton type="checkbox"도 indicator를 재사용한다. */
|
|
5
|
+
.root {
|
|
6
|
+
display: inline-flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
gap: var(--space-2);
|
|
9
|
+
cursor: pointer;
|
|
10
|
+
user-select: none;
|
|
11
|
+
color: var(--fg);
|
|
12
|
+
font-family: var(--label-font);
|
|
13
|
+
font-size: var(--label-md-size);
|
|
14
|
+
font-weight: var(--label-weight);
|
|
15
|
+
letter-spacing: var(--label-tracking);
|
|
16
|
+
line-height: var(--lh-tight);
|
|
17
|
+
}
|
|
18
|
+
.root[data-disabled="true"] {
|
|
19
|
+
cursor: not-allowed;
|
|
20
|
+
opacity: 0.5;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/* Indicator — 단독 사용도 가능. FilterButton 안에서도 재사용. */
|
|
24
|
+
.indicator {
|
|
25
|
+
display: inline-flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
justify-content: center;
|
|
28
|
+
flex-shrink: 0;
|
|
29
|
+
width: var(--space-4);
|
|
30
|
+
height: var(--space-4);
|
|
31
|
+
border-radius: var(--radius-checkbox);
|
|
32
|
+
border: 1px solid var(--border-strong);
|
|
33
|
+
background: var(--bg);
|
|
34
|
+
color: transparent;
|
|
35
|
+
transition: var(--transition-colors), var(--transition-ring);
|
|
36
|
+
}
|
|
37
|
+
.indicator > svg {
|
|
38
|
+
width: 80%;
|
|
39
|
+
height: 80%;
|
|
40
|
+
display: block;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* Focus — input이 포커스일 때 indicator에 ring */
|
|
44
|
+
.input:focus-visible + .indicator {
|
|
45
|
+
outline: none;
|
|
46
|
+
box-shadow: var(--ring-shadow);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/* Hover — 보더만 selected-fg로 은은하게 물듦 (checked면 이미 채워져 있어 무시) */
|
|
50
|
+
.root:hover:not([data-disabled="true"]) .input:not(:checked) + .indicator {
|
|
51
|
+
border-color: var(--selected-fg);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/* Checked — 배경/글자 반전. 색은 Accent 축에 따라 mono=fg, 나머지=primary */
|
|
55
|
+
.input:checked + .indicator {
|
|
56
|
+
background: var(--selected-fg);
|
|
57
|
+
border-color: var(--selected-fg);
|
|
58
|
+
color: var(--bg);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* Standalone indicator (FilterButton 내부 사용) — checked 상태를 data-*로 표현 */
|
|
62
|
+
.indicator[data-checked="true"] {
|
|
63
|
+
background: var(--selected-fg);
|
|
64
|
+
border-color: var(--selected-fg);
|
|
65
|
+
color: var(--bg);
|
|
66
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { forwardRef, type InputHTMLAttributes, type ReactNode } from "react";
|
|
4
|
+
|
|
5
|
+
import { Icon } from "../Icon";
|
|
6
|
+
import styles from "./Checkbox.module.css";
|
|
7
|
+
|
|
8
|
+
export type CheckboxProps = Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "type"> & {
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(
|
|
13
|
+
({ className, disabled, children, ...rest }, ref) => {
|
|
14
|
+
const rootClass = [styles.root, className ?? ""].filter(Boolean).join(" ");
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<label className={rootClass} data-disabled={disabled ? "true" : "false"}>
|
|
18
|
+
<input
|
|
19
|
+
ref={ref}
|
|
20
|
+
type="checkbox"
|
|
21
|
+
className={`${styles.input} visually-hidden`}
|
|
22
|
+
disabled={disabled}
|
|
23
|
+
{...rest}
|
|
24
|
+
/>
|
|
25
|
+
<span className={styles.indicator} aria-hidden>
|
|
26
|
+
<Icon name="check" family="lucide" />
|
|
27
|
+
</span>
|
|
28
|
+
{children != null && <span>{children}</span>}
|
|
29
|
+
</label>
|
|
30
|
+
);
|
|
31
|
+
},
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
Checkbox.displayName = "Checkbox";
|
|
35
|
+
|
|
36
|
+
export { Checkbox };
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/* Chip ─────────────────────────────────────────────────────────
|
|
2
|
+
"선택된 값"을 시각화하는 라벨. 이메일 To 필드의 수신자, 검색창의 적용 필터,
|
|
3
|
+
Combobox의 multi-select 결과처럼 사용자가 골라 붙인 항목을 나타낸다.
|
|
4
|
+
|
|
5
|
+
Badge(장식·비인터랙션) / FilterButton(토글 선택) 과 시맨틱이 다름:
|
|
6
|
+
Chip은 "이미 적용된" 상태만 있고, 인터랙션은 오직 "제거".
|
|
7
|
+
그래서 root는 <span>, 제거 버튼만 <button>. */
|
|
8
|
+
.root {
|
|
9
|
+
display: inline-flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
gap: var(--space-1);
|
|
12
|
+
font-family: var(--label-font);
|
|
13
|
+
font-weight: var(--label-weight);
|
|
14
|
+
line-height: var(--lh-tight);
|
|
15
|
+
letter-spacing: var(--label-tracking);
|
|
16
|
+
white-space: nowrap;
|
|
17
|
+
border: 1px solid transparent;
|
|
18
|
+
transition:
|
|
19
|
+
background var(--duration-fast) var(--ease-out),
|
|
20
|
+
border-color var(--duration-fast) var(--ease-out);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/* Sizes ─────────────────────────────────────────────────────
|
|
24
|
+
Badge md와 FilterButton sm 사이의 스케일. "정보 라벨"이라 컨트롤 높이보다 낮음.
|
|
25
|
+
Shape 축이 radius를 스왑. */
|
|
26
|
+
/* X 버튼이 있으면 오른쪽 padding을 한 단계 줄여 시각적 균형을 맞춘다.
|
|
27
|
+
X 자체가 아이콘 슬롯만큼의 여백 인상을 이미 만들기 때문. */
|
|
28
|
+
.sm {
|
|
29
|
+
height: var(--space-5); /* 20 */
|
|
30
|
+
padding-inline: var(--space-1_5); /* 6 */
|
|
31
|
+
gap: var(--space-1); /* 4 */
|
|
32
|
+
font-size: var(--label-sm-size);
|
|
33
|
+
letter-spacing: var(--label-tracking);
|
|
34
|
+
border-radius: var(--radius-xs);
|
|
35
|
+
}
|
|
36
|
+
.sm:has(> .remove) {
|
|
37
|
+
padding-inline-end: var(--space-0_5); /* 2 */
|
|
38
|
+
}
|
|
39
|
+
.md {
|
|
40
|
+
height: var(--space-6); /* 24 */
|
|
41
|
+
padding-inline: var(--space-2); /* 8 */
|
|
42
|
+
gap: var(--space-1); /* 4 */
|
|
43
|
+
font-size: var(--label-md-size);
|
|
44
|
+
letter-spacing: var(--label-tracking);
|
|
45
|
+
border-radius: var(--radius-xs);
|
|
46
|
+
}
|
|
47
|
+
.md:has(> .remove) {
|
|
48
|
+
padding-inline-end: var(--space-1); /* 4 */
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* Variants ──────────────────────────────────────────────────
|
|
52
|
+
Badge와 톤 규칙 공유:
|
|
53
|
+
- soft: 표면은 --hover (무채색 밀도) + 텍스트 --fg.
|
|
54
|
+
Badge soft가 primary tint인 반면 Chip soft는 무채색.
|
|
55
|
+
"적용된 필터가 한 화면에 여러 개 나열"되는 상황에서
|
|
56
|
+
primary tint가 반복되면 시각적으로 시끄러워짐.
|
|
57
|
+
- outline: 배경 없음 + border. 흰 캔버스에 나열될 때 밀도 낮춤. */
|
|
58
|
+
.soft {
|
|
59
|
+
background: var(--hover);
|
|
60
|
+
color: var(--fg);
|
|
61
|
+
}
|
|
62
|
+
.outline {
|
|
63
|
+
background: transparent;
|
|
64
|
+
color: var(--fg);
|
|
65
|
+
border-color: var(--border);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* Left icon slot — FilterButton과 동일 방식 */
|
|
69
|
+
.icon {
|
|
70
|
+
display: inline-flex;
|
|
71
|
+
align-items: center;
|
|
72
|
+
justify-content: center;
|
|
73
|
+
flex-shrink: 0;
|
|
74
|
+
opacity: 0.75;
|
|
75
|
+
}
|
|
76
|
+
.icon > svg {
|
|
77
|
+
display: block;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.label {
|
|
81
|
+
display: inline-flex;
|
|
82
|
+
align-items: center;
|
|
83
|
+
min-width: 0;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/* Remove button ─────────────────────────────────────────────
|
|
87
|
+
내부 <button>. Chip 전체를 button으로 만들지 않는 이유:
|
|
88
|
+
Combobox 등에서 Chip 본체는 popover 열기, X는 제거처럼 서로 다른 액션에
|
|
89
|
+
붙는 경우가 흔하고, 버블링으로 꼬임. */
|
|
90
|
+
.remove {
|
|
91
|
+
display: inline-flex;
|
|
92
|
+
align-items: center;
|
|
93
|
+
justify-content: center;
|
|
94
|
+
flex-shrink: 0;
|
|
95
|
+
padding: 0;
|
|
96
|
+
margin-inline-start: var(--space-0_5);
|
|
97
|
+
border: 0;
|
|
98
|
+
background: transparent;
|
|
99
|
+
color: inherit;
|
|
100
|
+
opacity: 0.6;
|
|
101
|
+
cursor: pointer;
|
|
102
|
+
border-radius: var(--radius-xs);
|
|
103
|
+
transition:
|
|
104
|
+
opacity var(--duration-fast) var(--ease-out),
|
|
105
|
+
background var(--duration-fast) var(--ease-out);
|
|
106
|
+
}
|
|
107
|
+
.remove:hover:not(:disabled) {
|
|
108
|
+
opacity: 1;
|
|
109
|
+
background: var(--hover);
|
|
110
|
+
}
|
|
111
|
+
.remove:focus-visible {
|
|
112
|
+
outline: none;
|
|
113
|
+
box-shadow: var(--ring-shadow);
|
|
114
|
+
opacity: 1;
|
|
115
|
+
}
|
|
116
|
+
.remove:disabled {
|
|
117
|
+
cursor: not-allowed;
|
|
118
|
+
opacity: 0.4;
|
|
119
|
+
}
|
|
120
|
+
.remove > svg {
|
|
121
|
+
display: block;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/* Disabled ─────────────────────────────────────────────────
|
|
125
|
+
전체를 dim. 폼이 read-only이거나, chip 자체가 잠긴 상태. */
|
|
126
|
+
.disabled {
|
|
127
|
+
opacity: 0.5;
|
|
128
|
+
}
|