@conscience-technology/ovenn 0.7.0 → 0.7.2
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/assets/components/AIMessage/AIMessage.module.css +21 -0
- package/assets/components/AIMessage/AIMessage.tsx +27 -7
- package/assets/components/AttachmentItem/AttachmentItem.module.css +41 -10
- package/assets/components/AttachmentItem/AttachmentItem.tsx +25 -8
- package/assets/components/AttachmentThumb/AttachmentThumb.module.css +9 -10
- package/assets/components/Callout/Callout.module.css +53 -7
- package/assets/components/Callout/Callout.tsx +26 -2
- package/assets/components/Callout/index.ts +1 -1
- package/assets/components/ChatComposer/ChatComposer.module.css +17 -0
- package/assets/components/ChatComposer/ChatComposer.tsx +131 -0
- package/assets/components/ChatComposer/index.ts +2 -0
- package/assets/components/ChatInput/ChatInput.module.css +192 -30
- package/assets/components/ChatInput/ChatInput.tsx +137 -45
- package/assets/components/ChatInput/SendButton.tsx +4 -1
- package/assets/components/ChatInput/index.ts +5 -0
- package/assets/components/ChatMessage/ChatMessage.module.css +19 -0
- package/assets/components/ChatMessage/ChatMessage.tsx +63 -0
- package/assets/components/ChatMessage/index.ts +2 -0
- package/assets/components/ChatReactions/ChatReactions.module.css +15 -0
- package/assets/components/ChatReactions/ChatReactions.tsx +58 -0
- package/assets/components/ChatReactions/index.ts +2 -0
- package/assets/components/CodeBlock/CodeBlock.module.css +106 -10
- package/assets/components/CodeBlock/CodeBlock.tsx +114 -29
- package/assets/components/CodeBlock/SyntaxHighlight.tsx +20 -0
- package/assets/components/CodeBlock/diff-lines.ts +21 -0
- package/assets/components/CodeBlock/index.ts +2 -1
- package/assets/components/CodeBlock/line-preview.ts +7 -0
- package/assets/components/CodeBlock/syntax-highlighter.ts +96 -0
- package/assets/components/CodeBlock/use-syntax-tokens.ts +17 -0
- package/assets/components/ColorField/ColorField.module.css +19 -196
- package/assets/components/ColorField/ColorField.tsx +116 -109
- package/assets/components/Combobox/Combobox.module.css +21 -4
- package/assets/components/Combobox/Combobox.tsx +37 -21
- package/assets/components/CommandPalette/CommandPalette.module.css +1 -1
- package/assets/components/ControlGroup/ControlGroup.module.css +13 -6
- package/assets/components/DatePicker/DateField.tsx +72 -25
- package/assets/components/DatePicker/DatePicker.module.css +28 -59
- package/assets/components/DatePicker/DatePicker.tsx +76 -40
- package/assets/components/Drawer/Drawer.module.css +12 -15
- package/assets/components/Drawer/Drawer.tsx +15 -23
- package/assets/components/EmojiPicker/EmojiGlyph.module.css +2 -0
- package/assets/components/EmojiPicker/EmojiGlyph.tsx +12 -0
- package/assets/components/EmojiPicker/EmojiPicker.module.css +43 -0
- package/assets/components/EmojiPicker/EmojiPicker.tsx +143 -0
- package/assets/components/EmojiPicker/UNICODE-LICENSE.txt +39 -0
- package/assets/components/EmojiPicker/data.ts +41 -0
- package/assets/components/EmojiPicker/emojiData-0.json +1 -0
- package/assets/components/EmojiPicker/emojiData-1.json +1 -0
- package/assets/components/EmojiPicker/emojiData-2.json +1 -0
- package/assets/components/EmojiPicker/emojiData-3.json +1 -0
- package/assets/components/EmojiPicker/emojiData.sources.json +35 -0
- package/assets/components/EmojiPicker/emojiData.ts +8 -0
- package/assets/components/EmojiPicker/emojiFallbacks.json +1 -0
- package/assets/components/EmojiPicker/index.ts +4 -0
- package/assets/components/EmptyState/EmptyState.module.css +2 -2
- package/assets/components/FileIcon/FileIcon.module.css +4 -6
- package/assets/components/Icon/LucideFamilyIcon.tsx +2 -0
- package/assets/components/Icon/SolarFamilyIcon.tsx +4 -0
- package/assets/components/Input/Input.module.css +33 -10
- package/assets/components/Input/Input.tsx +20 -9
- package/assets/components/MessageActions/MessageActions.module.css +2 -2
- package/assets/components/Onboarding/Onboarding.module.css +1 -1
- package/assets/components/ProgressBar/ProgressBar.module.css +38 -4
- package/assets/components/ProgressBar/ProgressBar.tsx +5 -1
- package/assets/components/RadioCard/RadioCard.module.css +18 -0
- package/assets/components/RadioCard/RadioCard.tsx +48 -7
- package/assets/components/Select/Select.module.css +9 -7
- package/assets/components/Select/Select.tsx +15 -2
- package/assets/components/Tabs/Tabs.module.css +1 -1
- package/assets/components/Tabs/Tabs.tsx +2 -2
- package/assets/components/Textarea/Textarea.module.css +28 -231
- package/assets/components/Textarea/Textarea.tsx +2 -2
- package/assets/components/TimePicker/TimePicker.module.css +16 -4
- package/assets/components/TimePicker/TimePicker.tsx +66 -8
- package/assets/components/Toast/Toast.module.css +18 -0
- package/assets/components/Toast/Toast.tsx +1 -1
- package/assets/components/Tooltip/Tooltip.tsx +33 -7
- package/assets/components/UserMessage/UserMessage.module.css +110 -1
- package/assets/components/UserMessage/UserMessage.tsx +138 -16
- package/assets/components/UserMessage/index.ts +4 -0
- package/assets/components/_data.ts +10 -5
- package/assets/components/_utils.css +31 -5
- package/assets/components/component-registry.json +1595 -107
- package/assets/components/index.ts +7 -0
- package/assets/components/tokens.css +83 -0
- package/assets/prompts/ASSEMBLY.md +11 -0
- package/assets/prompts/CATALOG.md +110 -106
- package/assets/prompts/PRINCIPLES.md +11 -1
- package/assets/prompts/TEMPLATE_PREVIEWS.md +21 -0
- package/assets/prompts/WORKFLOW_DESIGN.md +2 -0
- package/assets/prompts/axes/font.md +6 -0
- package/assets/prompts/axes/material.md +1 -1
- package/assets/prompts/axes/motion.md +2 -0
- package/assets/prompts/axes/palette.md +9 -2
- package/assets/prompts/axes/voice.md +4 -0
- package/assets/prompts/components/README.md +3 -3
- package/assets/prompts/components/_variants.md +35 -35
- package/assets/prompts/components/accordion.md +15 -15
- package/assets/prompts/components/ai-message.md +14 -12
- package/assets/prompts/components/app-frame.md +16 -16
- package/assets/prompts/components/attachment-item.md +36 -30
- package/assets/prompts/components/attachment-thumb.md +14 -12
- package/assets/prompts/components/avatar-upload.md +10 -10
- package/assets/prompts/components/avatar.md +16 -16
- package/assets/prompts/components/badge.md +4 -4
- package/assets/prompts/components/breadcrumb.md +24 -24
- package/assets/prompts/components/bubble.md +13 -13
- package/assets/prompts/components/button-group.md +1 -1
- package/assets/prompts/components/button.md +36 -36
- package/assets/prompts/components/calendar.md +29 -29
- package/assets/prompts/components/callout.md +39 -23
- package/assets/prompts/components/canvas-edge.md +5 -2
- package/assets/prompts/components/canvas-node.md +3 -3
- package/assets/prompts/components/canvas.md +5 -2
- package/assets/prompts/components/card.md +21 -21
- package/assets/prompts/components/chart-bar.md +7 -7
- package/assets/prompts/components/chart-pie.md +3 -3
- package/assets/prompts/components/chart-radar.md +3 -3
- package/assets/prompts/components/chart-radial.md +4 -4
- package/assets/prompts/components/chat-composer.md +71 -0
- package/assets/prompts/components/chat-input.md +82 -27
- package/assets/prompts/components/chat-message.md +48 -0
- package/assets/prompts/components/chat-reactions.md +38 -0
- package/assets/prompts/components/checkbox-card.md +3 -3
- package/assets/prompts/components/checkbox.md +17 -17
- package/assets/prompts/components/chip.md +32 -32
- package/assets/prompts/components/code-block.md +109 -66
- package/assets/prompts/components/code.md +4 -4
- package/assets/prompts/components/color-area.md +9 -9
- package/assets/prompts/components/color-field.md +17 -13
- package/assets/prompts/components/color-picker.md +6 -6
- package/assets/prompts/components/color-slider.md +8 -8
- package/assets/prompts/components/color-swatch-picker.md +8 -8
- package/assets/prompts/components/color-swatch.md +9 -9
- package/assets/prompts/components/combobox.md +5 -2
- package/assets/prompts/components/command-palette.md +26 -26
- package/assets/prompts/components/comment.md +5 -2
- package/assets/prompts/components/context-menu.md +22 -22
- package/assets/prompts/components/control-group.md +4 -4
- package/assets/prompts/components/date-picker.md +31 -23
- package/assets/prompts/components/disclosure.md +10 -10
- package/assets/prompts/components/drawer.md +19 -18
- package/assets/prompts/components/dropdown-menu.md +21 -21
- package/assets/prompts/components/emoji-picker.md +45 -0
- package/assets/prompts/components/empty-state.md +20 -18
- package/assets/prompts/components/event-chip.md +11 -11
- package/assets/prompts/components/event-list-item.md +21 -21
- package/assets/prompts/components/file-icon.md +18 -19
- package/assets/prompts/components/gallery-item.md +19 -19
- package/assets/prompts/components/generated-image.md +10 -10
- package/assets/prompts/components/hint.md +19 -19
- package/assets/prompts/components/icon-button.md +16 -16
- package/assets/prompts/components/icon.md +12 -9
- package/assets/prompts/components/input.md +49 -46
- package/assets/prompts/components/kanban.md +34 -34
- package/assets/prompts/components/list-item.md +39 -39
- package/assets/prompts/components/menu-item.md +41 -41
- package/assets/prompts/components/message-actions.md +6 -6
- package/assets/prompts/components/message-quote.md +7 -7
- package/assets/prompts/components/message-sources.md +10 -10
- package/assets/prompts/components/message-state.md +17 -17
- package/assets/prompts/components/message-table.md +5 -5
- package/assets/prompts/components/mini-calendar.md +6 -1
- package/assets/prompts/components/modal.md +39 -39
- package/assets/prompts/components/multi-select.md +4 -1
- package/assets/prompts/components/onboarding.md +19 -19
- package/assets/prompts/components/page-header.md +31 -31
- package/assets/prompts/components/pagination.md +17 -17
- package/assets/prompts/components/progress-bar.md +14 -11
- package/assets/prompts/components/quotation-bar.md +10 -10
- package/assets/prompts/components/radio-card.md +7 -6
- package/assets/prompts/components/radio.md +9 -9
- package/assets/prompts/components/select.md +28 -25
- package/assets/prompts/components/shortcut.md +11 -11
- package/assets/prompts/components/sidebar.md +56 -56
- package/assets/prompts/components/skeleton.md +7 -4
- package/assets/prompts/components/slider.md +18 -18
- package/assets/prompts/components/spinner.md +16 -16
- package/assets/prompts/components/stepper.md +14 -14
- package/assets/prompts/components/switch.md +19 -20
- package/assets/prompts/components/tab-strip.md +31 -31
- package/assets/prompts/components/table-cell.md +4 -4
- package/assets/prompts/components/table-header.md +16 -16
- package/assets/prompts/components/table-row-edit.md +19 -19
- package/assets/prompts/components/table-row-select.md +9 -9
- package/assets/prompts/components/table-row.md +18 -18
- package/assets/prompts/components/tabs.md +26 -25
- package/assets/prompts/components/tag.md +6 -6
- package/assets/prompts/components/textarea.md +16 -15
- package/assets/prompts/components/time-picker.md +21 -14
- package/assets/prompts/components/timeline-view.md +4 -4
- package/assets/prompts/components/toast.md +42 -41
- package/assets/prompts/components/toolbar.md +23 -23
- package/assets/prompts/components/tooltip.md +15 -14
- package/assets/prompts/components/top-loader.md +11 -11
- package/assets/prompts/components/topbar.md +35 -35
- package/assets/prompts/components/tree-nav.md +9 -9
- package/assets/prompts/components/user-message.md +23 -12
- package/assets/prompts/design-examples/README.md +1 -1
- package/assets/prompts/design-examples/ai-chat-full-page.png +0 -0
- package/assets/prompts/design-examples/catalog.json +124 -1
- package/assets/prompts/design-examples/sources/ai-chat-full-page/ChatExperience.module.css +346 -0
- package/assets/prompts/design-examples/sources/ai-chat-full-page/ChatExperience.tsx +375 -0
- package/assets/prompts/design-examples/sources/ai-chat-full-page/FullPageChat.tsx +8 -0
- package/assets/prompts/design-examples/sources/ai-chat-full-page/REFERENCE.md +19 -0
- package/assets/prompts/design-examples/sources/ai-chat-full-page/useChatDemo.ts +139 -0
- package/assets/prompts/design-examples/sources/ai-chat-full-page/useDemoTextStream.ts +30 -0
- package/assets/prompts/primitives/emerge.md +2 -0
- package/assets/prompts/templates/README.md +1 -1
- package/assets/prompts/templates/ains.md +7 -0
- package/assets/prompts/templates/minimal.md +6 -0
- package/assets/prompts/templates/onboarding.md +156 -0
- package/assets/prompts/templates/workspace.md +13 -8
- package/assets/prompts/tokens/color.md +7 -2
- package/assets/prompts/tokens/radius.md +22 -0
- package/assets/prompts/use-cases/chart-chart-area.md +40 -40
- package/assets/prompts/use-cases/chart-chart-bar.md +34 -34
- package/assets/prompts/use-cases/chart-chart-pie.md +14 -14
- package/assets/prompts/use-cases/chart-chart-radar.md +24 -24
- package/assets/prompts/use-cases/chart-chart-radial.md +14 -14
- package/assets/prompts/use-cases/chart-segmented-chart.md +32 -32
- package/assets/prompts/use-cases/chat-chat-composer.md +529 -0
- package/assets/prompts/use-cases/chat-chat-input.md +1766 -0
- package/assets/prompts/use-cases/data-comment.md +39 -39
- package/assets/prompts/use-cases/data-data-table.md +34 -34
- package/assets/prompts/use-cases/data-list-item.md +16 -16
- package/assets/prompts/use-cases/data-metric-card.md +18 -18
- package/assets/prompts/use-cases/data-table-row.md +19 -19
- package/assets/prompts/use-cases/data-table-toolbar.md +10 -10
- package/assets/prompts/use-cases/feedback-drawer.md +35 -30
- package/assets/prompts/use-cases/feedback-progress-bar.md +23 -18
- package/assets/prompts/use-cases/general-toolbar.md +16 -16
- package/assets/prompts/use-cases/general-tooltip.md +26 -26
- package/assets/prompts/use-cases/input-checkbox.md +27 -27
- package/assets/prompts/use-cases/structure-card.md +9 -9
- package/assets/prompts/use-cases/structure-page-header.md +17 -17
- package/assets/prompts/use-cases/structure-sidebar.md +20 -20
- package/assets/prompts/use-cases/structure-topbar.md +38 -42
- package/assets/skills/ovenn-wireframe/SKILL.md +17 -4
- package/package.json +6 -2
- package/src/utils/design-examples.js +3 -4
- package/assets/prompts/templates/glass-button.md +0 -337
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* MessageActions — 메시지 하단 액션 아이콘 바.
|
|
2
|
-
UserMessage·AIMessage·MessageState 공용. fg-
|
|
2
|
+
UserMessage·AIMessage·MessageState 공용. fg-subtle 톤, hover 시 fg-strong. */
|
|
3
3
|
|
|
4
4
|
.root {
|
|
5
5
|
display: inline-flex;
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
padding: 0;
|
|
21
21
|
border: 0;
|
|
22
22
|
background: transparent;
|
|
23
|
-
color: var(--fg-
|
|
23
|
+
color: var(--fg-subtle);
|
|
24
24
|
corner-shape: var(--corner-shape);
|
|
25
25
|
border-radius: var(--radius-sm);
|
|
26
26
|
cursor: pointer;
|
|
@@ -1461,7 +1461,7 @@
|
|
|
1461
1461
|
.modeOptions { display: flex; align-items: center; gap: var(--space-6); min-height: var(--control-h-md); }
|
|
1462
1462
|
|
|
1463
1463
|
/* Original rail width and actual Ovenn wordmark; wrappers only arrange shared controls. */
|
|
1464
|
-
.railLogo { display: block; width:
|
|
1464
|
+
.railLogo { display: block; width: var(--size-20); height: var(--size-4); background: currentColor; mask: url("/onboarding/ovenn-wordmark.svg") center / contain no-repeat; }
|
|
1465
1465
|
.railNavigation { flex: 1; min-height: 0; overflow: auto; }
|
|
1466
1466
|
.segment { display: flex; flex-wrap: wrap; gap: var(--space-3); }
|
|
1467
1467
|
.paletteSwatchGrid { width: var(--size-20); }
|
|
@@ -56,13 +56,13 @@
|
|
|
56
56
|
height: var(--_pb-height);
|
|
57
57
|
background: color-mix(in oklch, var(--_pb-bar) 15%, transparent);
|
|
58
58
|
overflow: hidden;
|
|
59
|
-
corner-shape: var(--corner-shape);
|
|
59
|
+
corner-shape: var(--progressbar-corner-shape, var(--corner-shape));
|
|
60
60
|
border-radius: var(--radius-full);
|
|
61
61
|
}
|
|
62
62
|
/* fixed 자리는 트랙 배경 없이(화면 상단 overlay가 콘텐츠에 겹침). */
|
|
63
63
|
.root[data-position="fixed"] .track {
|
|
64
64
|
background: transparent;
|
|
65
|
-
corner-shape: var(--corner-shape);
|
|
65
|
+
corner-shape: var(--progressbar-corner-shape, var(--corner-shape));
|
|
66
66
|
border-radius: 0;
|
|
67
67
|
}
|
|
68
68
|
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
.bar {
|
|
74
74
|
height: 100%;
|
|
75
75
|
background: var(--_pb-bar);
|
|
76
|
-
corner-shape: var(--corner-shape);
|
|
76
|
+
corner-shape: var(--progressbar-corner-shape, var(--corner-shape));
|
|
77
77
|
border-radius: var(--radius-full);
|
|
78
78
|
/* determinate width 변화는 duration-base로 부드럽게. background는 테마 전환용. */
|
|
79
79
|
transition:
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
}
|
|
83
83
|
/* fixed 자리는 왼쪽만 flat(화면 상단 밀착), 오른쪽만 둥글게. */
|
|
84
84
|
.root[data-position="fixed"] .bar {
|
|
85
|
-
corner-shape: var(--corner-shape);
|
|
85
|
+
corner-shape: var(--progressbar-corner-shape, var(--corner-shape));
|
|
86
86
|
border-radius: 0 var(--radius-full) var(--radius-full) 0;
|
|
87
87
|
}
|
|
88
88
|
|
|
@@ -125,3 +125,37 @@
|
|
|
125
125
|
transition: none;
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
|
+
|
|
129
|
+
/* Flow — Canvas 연결선처럼 양끝이 희미한 빛이 지나간다. value는 ARIA에만 반영. */
|
|
130
|
+
.root[data-variant="flow"] {
|
|
131
|
+
--_pb-flow-duration: var(--duration-flow);
|
|
132
|
+
--_pb-flow-easing: var(--ease-flow);
|
|
133
|
+
--_pb-flow-span: 35%;
|
|
134
|
+
--_pb-flow-fade: 12%;
|
|
135
|
+
}
|
|
136
|
+
.root[data-variant="flow"] .track {
|
|
137
|
+
background: transparent;
|
|
138
|
+
mask-image: linear-gradient(to right, transparent, black var(--_pb-flow-fade), black calc(100% - var(--_pb-flow-fade)), transparent);
|
|
139
|
+
}
|
|
140
|
+
.root[data-variant="flow"] .bar {
|
|
141
|
+
width: var(--_pb-flow-span);
|
|
142
|
+
background: linear-gradient(to right, transparent, var(--_pb-bar), transparent);
|
|
143
|
+
animation: pb-flow var(--_pb-flow-duration) var(--_pb-flow-easing) infinite;
|
|
144
|
+
transition: none;
|
|
145
|
+
}
|
|
146
|
+
@keyframes pb-flow {
|
|
147
|
+
0%, 8% { transform: translateX(-100%); }
|
|
148
|
+
92%, 100% { transform: translateX(286%); }
|
|
149
|
+
}
|
|
150
|
+
:global([data-motion="none"]) .root[data-variant="flow"] .bar {
|
|
151
|
+
animation: none;
|
|
152
|
+
transform: translateX(93%);
|
|
153
|
+
opacity: 0.5;
|
|
154
|
+
}
|
|
155
|
+
@media (prefers-reduced-motion: reduce) {
|
|
156
|
+
.root[data-variant="flow"] .bar {
|
|
157
|
+
animation: none;
|
|
158
|
+
transform: translateX(93%);
|
|
159
|
+
opacity: 0.5;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
@@ -12,6 +12,8 @@ export interface ProgressBarProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
12
12
|
* 실제 %가 없는 라우팅/네트워크 로딩용.
|
|
13
13
|
*/
|
|
14
14
|
value?: number;
|
|
15
|
+
/** flow는 진행률 길이 대신 부드러운 빛의 흐름을 반복한다. value는 접근성 진행률로 유지한다. */
|
|
16
|
+
variant?: "progress" | "flow";
|
|
15
17
|
/** 트랙 두께. sm=2px, md=4px. 기본 md. */
|
|
16
18
|
size?: ProgressBarSize;
|
|
17
19
|
/** fixed는 화면 최상단 overlay, inline은 흐름 안에 앉음. 기본 inline. */
|
|
@@ -35,6 +37,7 @@ const ProgressBar = forwardRef<HTMLDivElement, ProgressBarProps>(
|
|
|
35
37
|
(
|
|
36
38
|
{
|
|
37
39
|
value,
|
|
40
|
+
variant = "progress",
|
|
38
41
|
size = "md",
|
|
39
42
|
position = "inline",
|
|
40
43
|
active = true,
|
|
@@ -56,6 +59,7 @@ const ProgressBar = forwardRef<HTMLDivElement, ProgressBarProps>(
|
|
|
56
59
|
aria-valuemin={0}
|
|
57
60
|
aria-valuemax={100}
|
|
58
61
|
aria-valuenow={clamped}
|
|
62
|
+
data-variant={variant}
|
|
59
63
|
data-position={position}
|
|
60
64
|
data-size={size}
|
|
61
65
|
data-active={active || undefined}
|
|
@@ -72,7 +76,7 @@ const ProgressBar = forwardRef<HTMLDivElement, ProgressBarProps>(
|
|
|
72
76
|
<div className={styles.track}>
|
|
73
77
|
<div
|
|
74
78
|
className={styles.bar}
|
|
75
|
-
style={isDeterminate ? { width: `${clamped}%` } : undefined}
|
|
79
|
+
style={isDeterminate && variant !== "flow" ? { width: `${clamped}%` } : undefined}
|
|
76
80
|
/>
|
|
77
81
|
</div>
|
|
78
82
|
</div>
|
|
@@ -281,3 +281,21 @@
|
|
|
281
281
|
.root[data-layout="horizontal"][data-align="start"] .indicator {
|
|
282
282
|
align-self: flex-start;
|
|
283
283
|
}
|
|
284
|
+
|
|
285
|
+
.root[data-mode="button"] {
|
|
286
|
+
appearance: none;
|
|
287
|
+
padding: 0;
|
|
288
|
+
border: 0;
|
|
289
|
+
background: transparent;
|
|
290
|
+
font: inherit;
|
|
291
|
+
text-align: start;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.root[data-mode="button"]:focus-visible {
|
|
295
|
+
outline: none;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
.root[data-mode="button"]:focus-visible .surface {
|
|
299
|
+
background: var(--hover);
|
|
300
|
+
border-color: var(--border-strong);
|
|
301
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import Link from "next/link";
|
|
4
|
-
import { forwardRef, type AnchorHTMLAttributes, type InputHTMLAttributes, type ReactNode } from "react";
|
|
4
|
+
import { forwardRef, type AnchorHTMLAttributes, type ButtonHTMLAttributes, type InputHTMLAttributes, type ReactNode } from "react";
|
|
5
5
|
|
|
6
6
|
import { Icon, type IconName } from "../Icon";
|
|
7
7
|
|
|
8
8
|
import styles from "./RadioCard.module.css";
|
|
9
9
|
|
|
10
|
-
export type RadioCardMode = "radio" | "link";
|
|
10
|
+
export type RadioCardMode = "radio" | "link" | "button";
|
|
11
11
|
type ChoiceCardMode = RadioCardMode | "checkbox";
|
|
12
12
|
export type RadioCardLayout = "vertical" | "horizontal";
|
|
13
13
|
export type RadioCardSize = "md" | "lg";
|
|
@@ -18,6 +18,7 @@ export type ChoiceCardCommonProps = {
|
|
|
18
18
|
* radio: 단일 선택 (RadioGroup으로 묶기).
|
|
19
19
|
* 다중 선택은 CheckboxCard 사용.
|
|
20
20
|
* link: 네비게이션 카드 (`<a>` 렌더, href 필수, 선택 상태 없음).
|
|
21
|
+
* button: 선택 상태 없이 onClick을 실행하는 카드 (`<button>` 렌더).
|
|
21
22
|
*/
|
|
22
23
|
mode?: ChoiceCardMode;
|
|
23
24
|
/**
|
|
@@ -60,11 +61,17 @@ type LinkChoiceProps = ChoiceCardCommonProps &
|
|
|
60
61
|
href: string;
|
|
61
62
|
};
|
|
62
63
|
|
|
64
|
+
type ButtonChoiceProps = ChoiceCardCommonProps &
|
|
65
|
+
Omit<ButtonHTMLAttributes<HTMLButtonElement>, "type" | "size" | "title"> & {
|
|
66
|
+
mode: "button";
|
|
67
|
+
href?: never;
|
|
68
|
+
};
|
|
69
|
+
|
|
63
70
|
export type ChoiceCardInputProps = InputChoiceProps;
|
|
64
|
-
type ChoiceCardProps = InputChoiceProps | LinkChoiceProps;
|
|
65
|
-
export type RadioCardProps = (Omit<InputChoiceProps, "mode"> & { mode?: "radio" }) | LinkChoiceProps;
|
|
71
|
+
type ChoiceCardProps = InputChoiceProps | LinkChoiceProps | ButtonChoiceProps;
|
|
72
|
+
export type RadioCardProps = (Omit<InputChoiceProps, "mode"> & { mode?: "radio" }) | LinkChoiceProps | ButtonChoiceProps;
|
|
66
73
|
|
|
67
|
-
export const ChoiceCard = forwardRef<HTMLInputElement | HTMLAnchorElement, ChoiceCardProps>(
|
|
74
|
+
export const ChoiceCard = forwardRef<HTMLInputElement | HTMLAnchorElement | HTMLButtonElement, ChoiceCardProps>(
|
|
68
75
|
(props, ref) => {
|
|
69
76
|
const {
|
|
70
77
|
className,
|
|
@@ -78,7 +85,7 @@ export const ChoiceCard = forwardRef<HTMLInputElement | HTMLAnchorElement, Choic
|
|
|
78
85
|
description,
|
|
79
86
|
} = props;
|
|
80
87
|
|
|
81
|
-
const indicator = mode
|
|
88
|
+
const indicator = (mode === "radio" || mode === "checkbox") && (requestedIndicator ?? (icon == null || icon === false));
|
|
82
89
|
const layout = requestedLayout ?? (indicator ? "horizontal" : "vertical");
|
|
83
90
|
const resolvedAlign: RadioCardAlign =
|
|
84
91
|
align ?? (layout === "vertical" ? "center" : "start");
|
|
@@ -114,6 +121,7 @@ export const ChoiceCard = forwardRef<HTMLInputElement | HTMLAnchorElement, Choic
|
|
|
114
121
|
if (mode === "link") {
|
|
115
122
|
const {
|
|
116
123
|
href,
|
|
124
|
+
className: _className,
|
|
117
125
|
mode: _m,
|
|
118
126
|
layout: _l,
|
|
119
127
|
indicator: _indicator,
|
|
@@ -140,7 +148,40 @@ export const ChoiceCard = forwardRef<HTMLInputElement | HTMLAnchorElement, Choic
|
|
|
140
148
|
);
|
|
141
149
|
}
|
|
142
150
|
|
|
151
|
+
if (mode === "button") {
|
|
152
|
+
const {
|
|
153
|
+
mode: _mode,
|
|
154
|
+
className: _className,
|
|
155
|
+
layout: _layout,
|
|
156
|
+
indicator: _indicator,
|
|
157
|
+
size: _size,
|
|
158
|
+
align: _align,
|
|
159
|
+
icon: _icon,
|
|
160
|
+
title: _title,
|
|
161
|
+
description: _description,
|
|
162
|
+
disabled,
|
|
163
|
+
...rest
|
|
164
|
+
} = props as ButtonChoiceProps;
|
|
165
|
+
return (
|
|
166
|
+
<button
|
|
167
|
+
{...rest}
|
|
168
|
+
ref={ref as React.Ref<HTMLButtonElement>}
|
|
169
|
+
type="button"
|
|
170
|
+
className={rootClass}
|
|
171
|
+
data-layout={layout}
|
|
172
|
+
data-size={size}
|
|
173
|
+
data-align={resolvedAlign}
|
|
174
|
+
data-mode="button"
|
|
175
|
+
data-disabled={disabled ? "true" : "false"}
|
|
176
|
+
disabled={disabled}
|
|
177
|
+
>
|
|
178
|
+
{inner}
|
|
179
|
+
</button>
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
|
|
143
183
|
const {
|
|
184
|
+
className: _className,
|
|
144
185
|
mode: _m,
|
|
145
186
|
layout: _l,
|
|
146
187
|
indicator: _indicator,
|
|
@@ -178,7 +219,7 @@ export const ChoiceCard = forwardRef<HTMLInputElement | HTMLAnchorElement, Choic
|
|
|
178
219
|
|
|
179
220
|
ChoiceCard.displayName = "ChoiceCard";
|
|
180
221
|
|
|
181
|
-
const RadioCard = forwardRef<HTMLInputElement | HTMLAnchorElement, RadioCardProps>(
|
|
222
|
+
const RadioCard = forwardRef<HTMLInputElement | HTMLAnchorElement | HTMLButtonElement, RadioCardProps>(
|
|
182
223
|
(props, ref) => <ChoiceCard {...props} ref={ref} />,
|
|
183
224
|
);
|
|
184
225
|
RadioCard.displayName = "RadioCard";
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
부모 상속을 끊는다. shorthand `font: inherit`은 font-size까지 덮어써서 사이즈 클래스(sizeSm/Md/Lg)의
|
|
16
16
|
font-size 지정을 무효화하므로 절대 금지. font-family만 inherit하고 font-size/font-weight/
|
|
17
17
|
line-height는 Input.root/size 클래스가 정한 값을 그대로 사용. */
|
|
18
|
-
font-family:
|
|
19
|
-
font-weight:
|
|
20
|
-
color:
|
|
18
|
+
font-family: var(--font-normal);
|
|
19
|
+
font-weight: var(--font-weight-regular);
|
|
20
|
+
color: var(--fg);
|
|
21
21
|
text-align: start;
|
|
22
22
|
cursor: pointer;
|
|
23
23
|
appearance: none;
|
|
@@ -55,9 +55,10 @@
|
|
|
55
55
|
}
|
|
56
56
|
/* filled variant는 bg만으로 상태를 전달 — focus/open에서도 border는 hairline(`--border`)
|
|
57
57
|
유지. 공통 .trigger:focus-visible 규칙이 border-strong을 꽂아버리므로 재선언으로 복원. */
|
|
58
|
-
.trigger[data-variant="filled"]:focus-visible,
|
|
59
|
-
.trigger[data-variant="filled"][data-state="open"] {
|
|
60
|
-
|
|
58
|
+
.trigger[data-variant="filled"]:not([data-readonly]):focus-visible,
|
|
59
|
+
.trigger[data-variant="filled"]:not([data-readonly])[data-state="open"] {
|
|
60
|
+
background: var(--bg-muted);
|
|
61
|
+
border-color: transparent;
|
|
61
62
|
}
|
|
62
63
|
.trigger[data-variant="filled"][data-invalid]:focus-visible,
|
|
63
64
|
.trigger[data-variant="filled"][data-invalid][data-state="open"] {
|
|
@@ -78,8 +79,9 @@
|
|
|
78
79
|
line-height: var(--lh-sm);
|
|
79
80
|
color: var(--fg);
|
|
80
81
|
}
|
|
82
|
+
.trigger[data-placeholder] .value,
|
|
81
83
|
.value :global([data-placeholder]) {
|
|
82
|
-
color: var(--fg-
|
|
84
|
+
color: var(--fg-placeholder);
|
|
83
85
|
}
|
|
84
86
|
|
|
85
87
|
/* Chevron ─────────────────────────────────────────────────────────
|
|
@@ -28,6 +28,7 @@ import {
|
|
|
28
28
|
forwardRef,
|
|
29
29
|
useContext,
|
|
30
30
|
useId,
|
|
31
|
+
useState,
|
|
31
32
|
type ComponentPropsWithoutRef,
|
|
32
33
|
type ReactNode,
|
|
33
34
|
} from "react";
|
|
@@ -74,6 +75,7 @@ type FieldContextValue = {
|
|
|
74
75
|
variant: SelectVariant;
|
|
75
76
|
invalid: boolean;
|
|
76
77
|
disabled: boolean;
|
|
78
|
+
readOnly: boolean;
|
|
77
79
|
width: SelectWidth;
|
|
78
80
|
triggerId: string;
|
|
79
81
|
describedBy?: string;
|
|
@@ -82,6 +84,7 @@ const FieldContext = createContext<FieldContextValue | null>(null);
|
|
|
82
84
|
|
|
83
85
|
export interface SelectRootProps
|
|
84
86
|
extends Omit<ComponentPropsWithoutRef<typeof RS.Root>, "children"> {
|
|
87
|
+
readOnly?: boolean;
|
|
85
88
|
size?: SelectSize;
|
|
86
89
|
variant?: SelectVariant;
|
|
87
90
|
/** 폼 검증 실패. warning이 있으면 자동으로 true. */
|
|
@@ -113,6 +116,7 @@ const Root = ({
|
|
|
113
116
|
invalid: invalidProp,
|
|
114
117
|
width = "fill",
|
|
115
118
|
disabled = false,
|
|
119
|
+
readOnly = false,
|
|
116
120
|
label,
|
|
117
121
|
description,
|
|
118
122
|
warning,
|
|
@@ -120,6 +124,8 @@ const Root = ({
|
|
|
120
124
|
children,
|
|
121
125
|
...rest
|
|
122
126
|
}: SelectRootProps) => {
|
|
127
|
+
const [localValue, setLocalValue] = useState(rest.defaultValue ?? "");
|
|
128
|
+
const [localOpen, setLocalOpen] = useState(rest.defaultOpen ?? false);
|
|
123
129
|
const groupSize = useControlGroupSize();
|
|
124
130
|
const size = resolveControlGroupSize(groupSize, sizeProp, "md");
|
|
125
131
|
const hasWarning = warning != null && warning !== false;
|
|
@@ -127,7 +133,7 @@ const Root = ({
|
|
|
127
133
|
|
|
128
134
|
const autoId = useId();
|
|
129
135
|
const triggerId = id ?? autoId;
|
|
130
|
-
const descriptionId = description != null ? `${triggerId}-desc` : undefined;
|
|
136
|
+
const descriptionId = description != null && !hasWarning ? `${triggerId}-desc` : undefined;
|
|
131
137
|
const warningId = hasWarning ? `${triggerId}-warn` : undefined;
|
|
132
138
|
const describedBy =
|
|
133
139
|
[warningId, descriptionId].filter(Boolean).join(" ") || undefined;
|
|
@@ -137,6 +143,7 @@ const Root = ({
|
|
|
137
143
|
variant,
|
|
138
144
|
invalid,
|
|
139
145
|
disabled,
|
|
146
|
+
readOnly,
|
|
140
147
|
width,
|
|
141
148
|
triggerId,
|
|
142
149
|
describedBy,
|
|
@@ -148,7 +155,11 @@ const Root = ({
|
|
|
148
155
|
return (
|
|
149
156
|
<FieldContext.Provider value={field}>
|
|
150
157
|
<SizeContext.Provider value={size}>
|
|
151
|
-
<RS.Root disabled={disabled}
|
|
158
|
+
<RS.Root {...rest} disabled={disabled}
|
|
159
|
+
value={rest.value !== undefined ? rest.value : localValue}
|
|
160
|
+
onValueChange={(next) => { if (disabled || readOnly) return; if (rest.value === undefined) setLocalValue(next); rest.onValueChange?.(next); }}
|
|
161
|
+
open={!disabled && !readOnly && (rest.open ?? localOpen)}
|
|
162
|
+
onOpenChange={(next) => { if (next && (disabled || readOnly)) return; if (rest.open === undefined) setLocalOpen(next); rest.onOpenChange?.(next); }}>
|
|
152
163
|
{bare ? (
|
|
153
164
|
children
|
|
154
165
|
) : (
|
|
@@ -267,6 +278,8 @@ const Trigger = forwardRef<HTMLButtonElement, TriggerProps>(function SelectTrigg
|
|
|
267
278
|
data-control-group-segment={groupSize ? "" : undefined}
|
|
268
279
|
data-invalid={invalid || undefined}
|
|
269
280
|
data-disabled={disabled || undefined}
|
|
281
|
+
data-readonly={field?.readOnly || undefined}
|
|
282
|
+
aria-readonly={field?.readOnly || undefined}
|
|
270
283
|
data-variant={variant}
|
|
271
284
|
aria-invalid={invalid || undefined}
|
|
272
285
|
aria-describedby={[externalDescription, field?.describedBy].filter(Boolean).join(" ") || undefined}
|
|
@@ -183,7 +183,7 @@
|
|
|
183
183
|
.underlineBar {
|
|
184
184
|
position: absolute;
|
|
185
185
|
left: 0;
|
|
186
|
-
bottom: calc(var(--hairline) * -1);
|
|
186
|
+
bottom: var(--tabs-underline-inset, calc(var(--hairline) * -1));
|
|
187
187
|
height: var(--hairline);
|
|
188
188
|
/* 트리거 좌우 padding을 0으로 뺐으므로 바도 트리거 전체 폭 = 글자 폭에 그대로 맞음. */
|
|
189
189
|
width: var(--tab-indicator-w);
|
|
@@ -221,9 +221,9 @@ const List = forwardRef<HTMLDivElement, TabsListProps>(
|
|
|
221
221
|
const listRect = list.getBoundingClientRect();
|
|
222
222
|
const rect = active.getBoundingClientRect();
|
|
223
223
|
setIndicator({
|
|
224
|
-
x: rect.left - listRect.left,
|
|
224
|
+
x: rect.left - listRect.left + list.scrollLeft - list.clientLeft,
|
|
225
225
|
w: rect.width,
|
|
226
|
-
y: rect.top - listRect.top,
|
|
226
|
+
y: rect.top - listRect.top + list.scrollTop - list.clientTop,
|
|
227
227
|
h: rect.height,
|
|
228
228
|
});
|
|
229
229
|
}, []);
|