@conscience-technology/ovenn 0.6.7 → 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 +23 -1
- package/assets/components/AIMessage/AIMessage.tsx +27 -7
- package/assets/components/Accordion/Accordion.module.css +3 -0
- package/assets/components/AppFrame/AppFrame.module.css +2 -0
- package/assets/components/AttachmentItem/AttachmentItem.module.css +50 -13
- package/assets/components/AttachmentItem/AttachmentItem.tsx +25 -8
- package/assets/components/AttachmentThumb/AttachmentThumb.module.css +12 -9
- package/assets/components/Avatar/Avatar.module.css +26 -11
- package/assets/components/Avatar/Avatar.tsx +1 -1
- package/assets/components/AvatarUpload/AvatarUpload.module.css +4 -3
- package/assets/components/Badge/Badge.module.css +96 -70
- package/assets/components/Badge/Badge.tsx +33 -25
- package/assets/components/Breadcrumb/Breadcrumb.module.css +8 -4
- package/assets/components/Breadcrumb/Breadcrumb.tsx +1 -1
- package/assets/components/Bubble/Bubble.module.css +6 -0
- package/assets/components/Button/Button.module.css +6 -0
- package/assets/components/Calendar/Calendar.module.css +244 -0
- package/assets/components/Calendar/Calendar.tsx +419 -0
- package/assets/components/Calendar/index.ts +2 -0
- package/assets/components/Callout/Callout.module.css +54 -7
- package/assets/components/Callout/Callout.tsx +26 -2
- package/assets/components/Callout/index.ts +1 -1
- package/assets/components/Canvas/Canvas.module.css +75 -0
- package/assets/components/Canvas/Canvas.tsx +699 -0
- package/assets/components/Canvas/alignment.ts +34 -0
- package/assets/components/Canvas/clipboard.ts +30 -0
- package/assets/components/Canvas/collision.ts +67 -0
- package/assets/components/Canvas/edgeOptions.ts +11 -0
- package/assets/components/Canvas/graph.ts +11 -0
- package/assets/components/Canvas/history.ts +41 -0
- package/assets/components/Canvas/index.ts +4 -0
- package/assets/components/Canvas/selection.ts +56 -0
- package/assets/components/Canvas/tokens.css +61 -0
- package/assets/components/Canvas/types.ts +27 -0
- package/assets/components/Canvas/useCanvasSettlement.ts +79 -0
- package/assets/components/CanvasEdge/CanvasEdge.module.css +62 -0
- package/assets/components/CanvasEdge/CanvasEdge.tsx +121 -0
- package/assets/components/CanvasEdge/geometry.ts +350 -0
- package/assets/components/CanvasEdge/index.ts +4 -0
- package/assets/components/CanvasEdge/interactions.ts +14 -0
- package/assets/components/CanvasEdge/tokens.css +29 -0
- package/assets/components/CanvasNode/CanvasNode.module.css +234 -30
- package/assets/components/CanvasNode/CanvasNode.tsx +95 -28
- package/assets/components/CanvasNode/index.ts +1 -1
- package/assets/components/CanvasNode/runningOutline.ts +59 -0
- package/assets/components/CanvasNode/tokens.css +76 -13
- package/assets/components/Card/Card.module.css +5 -0
- package/assets/components/Chart/Chart.module.css +278 -0
- package/assets/components/Chart/Chart.tsx +385 -0
- package/assets/components/Chart/entrance.tsx +57 -0
- package/assets/components/Chart/index.ts +14 -0
- 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 +197 -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/Checkbox/Checkbox.module.css +39 -0
- package/assets/components/Checkbox/Checkbox.tsx +99 -14
- package/assets/components/Checkbox/index.ts +1 -1
- package/assets/components/CheckboxCard/CheckboxCard.module.css +1 -177
- package/assets/components/CheckboxCard/CheckboxCard.tsx +6 -72
- package/assets/components/Chip/Chip.module.css +20 -30
- package/assets/components/Code/Code.module.css +1 -0
- package/assets/components/CodeBlock/CodeBlock.module.css +113 -13
- 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/ColorArea/ColorArea.module.css +3 -0
- package/assets/components/ColorField/ColorField.module.css +19 -190
- package/assets/components/ColorField/ColorField.tsx +116 -107
- package/assets/components/ColorPicker/ColorPicker.module.css +310 -0
- package/assets/components/ColorPicker/ColorPicker.tsx +387 -0
- package/assets/components/ColorPicker/index.ts +16 -0
- package/assets/components/ColorSlider/ColorSlider.module.css +15 -12
- package/assets/components/ColorSlider/ColorSlider.tsx +3 -3
- package/assets/components/ColorSwatch/ColorSwatch.module.css +2 -2
- package/assets/components/ColorSwatchPicker/ColorSwatchPicker.module.css +4 -3
- package/assets/components/Combobox/Combobox.module.css +21 -4
- package/assets/components/Combobox/Combobox.tsx +38 -22
- package/assets/components/CommandPalette/CommandPalette.module.css +19 -24
- package/assets/components/CommandPalette/CommandPalette.tsx +7 -5
- package/assets/components/Comment/Comment.module.css +25 -0
- package/assets/components/Comment/Comment.tsx +44 -0
- package/assets/components/Comment/CommentComposer.module.css +26 -0
- package/assets/components/Comment/CommentComposer.tsx +56 -0
- package/assets/components/Comment/CommentEditor.module.css +8 -0
- package/assets/components/Comment/CommentEditor.tsx +43 -0
- package/assets/components/Comment/CommentMentionInput.module.css +9 -0
- package/assets/components/Comment/CommentMentionInput.tsx +150 -0
- package/assets/components/Comment/index.ts +9 -0
- package/assets/components/Comment/types.ts +1 -0
- package/assets/components/ContextMenu/ContextMenu.module.css +5 -2
- package/assets/components/ContextMenu/ContextMenu.tsx +5 -0
- package/assets/components/ControlGroup/ControlGroup.module.css +20 -7
- package/assets/components/DataTable/DataTable.module.css +2 -0
- package/assets/components/DatePicker/DateField.tsx +72 -25
- package/assets/components/DatePicker/DatePicker.module.css +56 -54
- package/assets/components/DatePicker/DatePicker.tsx +86 -40
- package/assets/components/DatePicker/TimeSelector.tsx +1 -1
- package/assets/components/Disclosure/Disclosure.module.css +1 -0
- package/assets/components/Drawer/Drawer.module.css +23 -19
- package/assets/components/Drawer/Drawer.tsx +20 -24
- package/assets/components/DropdownMenu/DropdownMenu.tsx +5 -0
- 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/EventChip/EventChip.module.css +120 -53
- package/assets/components/EventChip/EventChip.tsx +54 -6
- package/assets/components/EventChip/index.ts +1 -1
- package/assets/components/EventListItem/EventListItem.module.css +3 -0
- package/assets/components/EventListItem/EventListItem.tsx +15 -8
- package/assets/components/FileIcon/FileIcon.module.css +6 -6
- package/assets/components/FileUpload/FileUpload.module.css +10 -3
- package/assets/components/FileUpload/FileUpload.tsx +5 -9
- package/assets/components/FileUpload/FileUploadItem.tsx +34 -0
- package/assets/components/GalleryItem/GalleryItem.module.css +16 -19
- package/assets/components/GeneratedImage/GeneratedImage.module.css +2 -0
- package/assets/components/Icon/Icon.tsx +264 -1088
- package/assets/components/Icon/LucideFamilyIcon.tsx +436 -0
- package/assets/components/Icon/MissingIcon.tsx +25 -0
- package/assets/components/Icon/SolarFamilyIcon.tsx +443 -0
- package/assets/components/Icon/catalogNames.ts +8 -0
- package/assets/components/Icon/context.tsx +1 -1
- package/assets/components/Icon/index.ts +2 -0
- package/assets/components/Icon/lucideCatalog.ts +11358 -0
- package/assets/components/Icon/phosphorCatalog.ts +3052 -0
- package/assets/components/Icon/solarCatalog.ts +16064 -0
- package/assets/components/IconButton/IconButton.module.css +3 -2
- package/assets/components/Input/Input.module.css +63 -22
- package/assets/components/Input/Input.tsx +21 -10
- package/assets/components/Kanban/Kanban.module.css +6 -0
- package/assets/components/ListItem/ListItem.module.css +9 -6
- package/assets/components/MenuItem/MenuItem.module.css +24 -22
- package/assets/components/MenuItem/MenuItem.tsx +12 -12
- package/assets/components/MessageActions/MessageActions.module.css +38 -2
- package/assets/components/MessageActions/MessageActions.tsx +53 -28
- package/assets/components/MessageQuote/MessageQuote.module.css +1 -0
- package/assets/components/MessageSources/MessageSources.module.css +2 -0
- package/assets/components/MessageState/MessageState.module.css +1 -1
- package/assets/components/MetricCard/MetricCard.module.css +96 -108
- package/assets/components/MetricCard/MetricCard.tsx +45 -23
- package/assets/components/MetricCard/tokens.css +10 -0
- package/assets/components/MiniCalendar/MiniCalendar.module.css +130 -0
- package/assets/components/MiniCalendar/MiniCalendar.tsx +161 -0
- package/assets/components/MiniCalendar/index.ts +2 -0
- package/assets/components/Modal/Modal.module.css +13 -4
- package/assets/components/Modal/Modal.tsx +4 -0
- package/assets/components/Onboarding/LayoutBuilder.tsx +12 -50
- package/assets/components/Onboarding/Onboarding.module.css +211 -278
- package/assets/components/Onboarding/OnboardingAxisPanel.tsx +81 -125
- package/assets/components/Onboarding/OnboardingPage.tsx +244 -467
- package/assets/components/Onboarding/actions.ts +5 -0
- package/assets/components/Onboarding/palette.css +8 -0
- package/assets/components/Onboarding/wizardData.ts +8 -8
- package/assets/components/ProgressBar/ProgressBar.module.css +42 -8
- package/assets/components/ProgressBar/ProgressBar.tsx +5 -6
- package/assets/components/ProgressBar/index.ts +0 -1
- package/assets/components/QuotationBar/QuotationBar.module.css +2 -0
- package/assets/components/Radio/Radio.module.css +2 -0
- package/assets/components/RadioCard/RadioCard.module.css +96 -3
- package/assets/components/RadioCard/RadioCard.tsx +76 -13
- package/assets/components/RadioCard/index.ts +1 -1
- package/assets/components/SegmentedChart/SegmentedChart.module.css +16 -0
- package/assets/components/SegmentedChart/SegmentedChart.tsx +25 -8
- package/assets/components/Select/Select.module.css +9 -7
- package/assets/components/Select/Select.tsx +22 -6
- package/assets/components/Shortcut/Shortcut.module.css +2 -0
- package/assets/components/Sidebar/Sidebar.module.css +1 -0
- package/assets/components/Sidebar/Sidebar.tsx +2 -2
- package/assets/components/Skeleton/Skeleton.module.css +33 -0
- package/assets/components/Skeleton/Skeleton.tsx +20 -0
- package/assets/components/Skeleton/index.ts +2 -0
- package/assets/components/Skeleton/tokens.css +11 -0
- package/assets/components/Slider/Slider.module.css +3 -0
- package/assets/components/Slider/Slider.tsx +7 -2
- package/assets/components/Spinner/LottiePlayer.tsx +4 -4
- package/assets/components/Spinner/Spinner.module.css +3 -0
- package/assets/components/Spinner/lottieManifest.ts +3 -0
- package/assets/components/Stepper/Stepper.module.css +56 -8
- package/assets/components/Stepper/Stepper.tsx +13 -4
- package/assets/components/Switch/Switch.module.css +55 -42
- package/assets/components/Switch/Switch.tsx +6 -2
- package/assets/components/Switch/index.ts +1 -1
- package/assets/components/TabStrip/TabStrip.module.css +5 -1
- package/assets/components/TableCell/TableCell.module.css +8 -1
- package/assets/components/TableCell/TableCellBadge.tsx +7 -3
- package/assets/components/TableCell/TableCellImage.tsx +1 -1
- package/assets/components/TableCell/TableCellTag.tsx +23 -0
- package/assets/components/TableCell/index.ts +3 -0
- package/assets/components/TableHeader/TableHeader.module.css +4 -0
- package/assets/components/TableRow/TableRow.module.css +3 -0
- package/assets/components/TableRowEdit/TableRowEdit.module.css +2 -0
- package/assets/components/TableToolbar/TableToolbar.module.css +1 -0
- package/assets/components/Tabs/Tabs.module.css +23 -8
- package/assets/components/Tabs/Tabs.tsx +4 -3
- package/assets/components/Tag/Tag.module.css +101 -0
- package/assets/components/Tag/Tag.tsx +55 -0
- package/assets/components/Tag/index.ts +2 -0
- package/assets/components/TemplateBoundary/TemplateBoundary.tsx +22 -18
- package/assets/components/TemplateBoundary/types.ts +2 -0
- package/assets/components/Textarea/Textarea.module.css +30 -226
- package/assets/components/Textarea/Textarea.tsx +2 -2
- package/assets/components/ThemeController.tsx +30 -3
- package/assets/components/TimePicker/TimePicker.module.css +17 -4
- package/assets/components/TimePicker/TimePicker.tsx +102 -23
- package/assets/components/TimelineView/TimelineEventBar.tsx +109 -0
- package/assets/components/TimelineView/TimelineView.module.css +203 -0
- package/assets/components/TimelineView/TimelineView.tsx +137 -0
- package/assets/components/TimelineView/axis.ts +62 -0
- package/assets/components/TimelineView/index.ts +3 -0
- package/assets/components/TimelineView/layout.ts +56 -0
- package/assets/components/TimelineView/move.ts +51 -0
- package/assets/components/TimelineView/useTimelineDrag.ts +215 -0
- package/assets/components/TimelineView/useTimelineZoom.ts +92 -0
- package/assets/components/Toast/Toast.module.css +20 -0
- package/assets/components/Toast/Toast.tsx +1 -1
- package/assets/components/Toolbar/Toolbar.module.css +31 -24
- package/assets/components/Toolbar/Toolbar.tsx +4 -3
- package/assets/components/Tooltip/Tooltip.module.css +10 -0
- package/assets/components/Tooltip/Tooltip.tsx +50 -15
- package/assets/components/TopLoader/TopLoader.module.css +1 -0
- package/assets/components/TreeNav/TreeNav.module.css +1 -0
- 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/_color.ts +2 -2
- package/assets/components/_data.ts +37 -31
- package/assets/components/_utils.css +36 -5
- package/assets/components/axisOptions.ts +2 -0
- package/assets/components/component-registry.json +1731 -94
- package/assets/components/index.ts +23 -0
- package/assets/components/materialScope.tsx +11 -0
- package/assets/components/reset.css +1 -0
- package/assets/components/themeBootScript.ts +3 -2
- package/assets/components/tokens.css +308 -71
- package/assets/components/useChartEntrance.ts +119 -0
- package/assets/prompts/ASSEMBLY.md +20 -7
- package/assets/prompts/CATALOG.md +110 -92
- package/assets/prompts/FEEDBACK_PROCESS.md +19 -0
- package/assets/prompts/PRINCIPLES.md +25 -1
- package/assets/prompts/TEMPLATE_PREVIEWS.md +21 -0
- package/assets/prompts/WORKFLOW_DESIGN.md +48 -70
- package/assets/prompts/axes/font.md +12 -1
- package/assets/prompts/axes/icon.md +6 -4
- package/assets/prompts/axes/material.md +40 -0
- package/assets/prompts/axes/motion.md +2 -0
- package/assets/prompts/axes/palette.md +10 -2
- package/assets/prompts/axes/shape.md +8 -0
- 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 +38 -31
- 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 +32 -97
- package/assets/prompts/components/breadcrumb.md +25 -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 +151 -0
- package/assets/prompts/components/callout.md +39 -23
- package/assets/prompts/components/canvas-edge.md +70 -0
- package/assets/prompts/components/canvas-node.md +27 -10
- package/assets/prompts/components/canvas.md +85 -0
- package/assets/prompts/components/card.md +31 -31
- package/assets/prompts/components/chart-bar.md +77 -0
- package/assets/prompts/components/chart-pie.md +63 -0
- package/assets/prompts/components/chart-radar.md +56 -0
- package/assets/prompts/components/chart-radial.md +56 -0
- package/assets/prompts/components/chart.md +129 -0
- 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 +26 -45
- package/assets/prompts/components/checkbox.md +40 -17
- package/assets/prompts/components/chip.md +34 -34
- package/assets/prompts/components/code-block.md +109 -65
- 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 +173 -0
- package/assets/prompts/components/color-slider.md +14 -14
- 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 +31 -30
- package/assets/prompts/components/comment.md +75 -0
- package/assets/prompts/components/context-menu.md +28 -25
- package/assets/prompts/components/control-group.md +4 -4
- package/assets/prompts/components/data-table.md +9 -0
- package/assets/prompts/components/date-picker.md +41 -23
- package/assets/prompts/components/disclosure.md +10 -10
- package/assets/prompts/components/drawer.md +29 -18
- package/assets/prompts/components/dropdown-menu.md +23 -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 +70 -28
- package/assets/prompts/components/event-list-item.md +32 -28
- package/assets/prompts/components/file-icon.md +18 -19
- package/assets/prompts/components/file-upload.md +1 -1
- package/assets/prompts/components/gallery-item.md +24 -23
- 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 +42 -17
- package/assets/prompts/components/input.md +49 -46
- package/assets/prompts/components/kanban.md +35 -35
- package/assets/prompts/components/list-item.md +50 -41
- package/assets/prompts/components/menu-item.md +49 -44
- package/assets/prompts/components/message-actions.md +15 -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/metric-card.md +57 -109
- package/assets/prompts/components/mini-calendar.md +77 -0
- package/assets/prompts/components/modal.md +40 -39
- package/assets/prompts/components/multi-select.md +4 -1
- package/assets/prompts/components/onboarding.md +23 -19
- package/assets/prompts/components/page-header.md +42 -33
- package/assets/prompts/components/pagination.md +17 -17
- package/assets/prompts/components/progress-bar.md +26 -13
- package/assets/prompts/components/quotation-bar.md +10 -10
- package/assets/prompts/components/radio-card.md +34 -117
- package/assets/prompts/components/radio.md +9 -9
- package/assets/prompts/components/segmented-chart.md +19 -5
- package/assets/prompts/components/select.md +29 -25
- package/assets/prompts/components/shortcut.md +11 -11
- package/assets/prompts/components/sidebar.md +67 -58
- package/assets/prompts/components/skeleton.md +47 -0
- package/assets/prompts/components/slider.md +18 -18
- package/assets/prompts/components/spinner.md +16 -16
- package/assets/prompts/components/stepper.md +29 -15
- package/assets/prompts/components/switch.md +30 -26
- package/assets/prompts/components/tab-strip.md +32 -31
- package/assets/prompts/components/table-cell.md +9 -7
- 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 +29 -20
- package/assets/prompts/components/table-toolbar.md +9 -0
- package/assets/prompts/components/tabs.md +30 -27
- package/assets/prompts/components/tag.md +54 -0
- package/assets/prompts/components/textarea.md +16 -15
- package/assets/prompts/components/time-picker.md +22 -14
- package/assets/prompts/components/timeline-view.md +129 -0
- package/assets/prompts/components/toast.md +43 -42
- package/assets/prompts/components/toolbar.md +36 -23
- package/assets/prompts/components/tooltip.md +36 -17
- package/assets/prompts/components/top-loader.md +12 -12
- package/assets/prompts/components/topbar.md +43 -34
- package/assets/prompts/components/tree-nav.md +10 -10
- 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 +9 -1
- package/assets/prompts/templates/aurora.md +5 -4
- package/assets/prompts/templates/minimal.md +14 -6
- package/assets/prompts/templates/onboarding.md +156 -0
- package/assets/prompts/templates/workspace.md +16 -11
- package/assets/prompts/tokens/color.md +11 -4
- package/assets/prompts/tokens/material.md +51 -0
- package/assets/prompts/tokens/radius.md +34 -0
- package/assets/prompts/tokens/typography.md +24 -2
- package/assets/prompts/use-cases/chart-chart-area.md +1334 -0
- package/assets/prompts/use-cases/chart-chart-bar.md +1886 -0
- package/assets/prompts/use-cases/chart-chart-pie.md +1031 -0
- package/assets/prompts/use-cases/chart-chart-radar.md +785 -0
- package/assets/prompts/use-cases/chart-chart-radial.md +988 -0
- package/assets/prompts/use-cases/chart-segmented-chart.md +262 -0
- 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 +360 -0
- package/assets/prompts/use-cases/data-data-table.md +249 -0
- package/assets/prompts/use-cases/data-list-item.md +1056 -0
- package/assets/prompts/use-cases/data-metric-card.md +673 -0
- package/assets/prompts/use-cases/data-table-row.md +966 -0
- package/assets/prompts/use-cases/data-table-toolbar.md +481 -0
- package/assets/prompts/use-cases/feedback-drawer.md +1168 -0
- package/assets/prompts/use-cases/feedback-progress-bar.md +432 -0
- package/assets/prompts/use-cases/general-toolbar.md +854 -0
- package/assets/prompts/use-cases/general-tooltip.md +652 -0
- package/assets/prompts/use-cases/input-checkbox.md +443 -0
- package/assets/prompts/use-cases/structure-card.md +603 -0
- package/assets/prompts/use-cases/structure-page-header.md +755 -0
- package/assets/prompts/use-cases/structure-sidebar.md +1132 -0
- package/assets/prompts/use-cases/structure-topbar.md +1196 -0
- package/assets/public/ovenn-wordmark.svg +19 -0
- package/assets/skills/ovenn-wireframe/SKILL.md +17 -4
- package/package.json +10 -2
- package/src/commands/info.js +1 -1
- package/src/utils/design-examples.js +3 -4
- package/assets/prompts/templates/glass-button.md +0 -336
|
@@ -0,0 +1,966 @@
|
|
|
1
|
+
# Table Row 사용 사례 소스
|
|
2
|
+
|
|
3
|
+
<!-- Generated by scripts/build-use-cases.mjs. Edit original TSX/CSS, then regenerate. -->
|
|
4
|
+
|
|
5
|
+
### 사례 목록
|
|
6
|
+
|
|
7
|
+
- In Uses
|
|
8
|
+
|
|
9
|
+
문서: /en/components/data/table-row#in-uses
|
|
10
|
+
|
|
11
|
+
문서 페이지에서 렌더하는 사례입니다.
|
|
12
|
+
|
|
13
|
+
### 조회 방법
|
|
14
|
+
|
|
15
|
+
get_guide(topic="use-cases/data-table-row", sections=["사례 목록", "파일 목록"])로 먼저 확인하고, 필요한 Section 또는 Source 파일 헤딩만 sections로 조회하세요. 전체 문서는 문서 페이지의 다른 예제도 포함합니다. 공용 컴포넌트 계약은 get_component로 읽고, 예제의 docs 전용 셸·locale·import 경로는 대상 프로젝트에 맞게 조합하세요. 이 연결은 디자인 승인이나 기능 검증을 뜻하지 않습니다.
|
|
16
|
+
|
|
17
|
+
### 파일 목록
|
|
18
|
+
|
|
19
|
+
- `web/app/[lang]/components/data/table-row/_strings.tsx`
|
|
20
|
+
- `web/app/[lang]/components/data/table-row/page.module.css`
|
|
21
|
+
- `web/app/[lang]/components/data/table-row/page.tsx`
|
|
22
|
+
- `web/examples/RowInteractionExamples.module.css`
|
|
23
|
+
- `web/examples/RowInteractionExamples.tsx`
|
|
24
|
+
|
|
25
|
+
### Section: web/app/[lang]/components/data/table-row/page.tsx#in-uses
|
|
26
|
+
|
|
27
|
+
```tsx
|
|
28
|
+
<section id="in-uses">
|
|
29
|
+
<h2>{pathname?.startsWith("/ko") ? "사용 사례" : "In Uses"}</h2>
|
|
30
|
+
<RowInteractionExamples only="table" />
|
|
31
|
+
</section>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Source: web/app/[lang]/components/data/table-row/_strings.tsx
|
|
35
|
+
|
|
36
|
+
````tsx
|
|
37
|
+
import { Code } from "@/components/Code";
|
|
38
|
+
import type { ReactNode } from "react";
|
|
39
|
+
|
|
40
|
+
type Strings = {
|
|
41
|
+
title: string;
|
|
42
|
+
lead: ReactNode;
|
|
43
|
+
|
|
44
|
+
usage: { heading: string; desc: ReactNode };
|
|
45
|
+
variants: { heading: string; desc: ReactNode };
|
|
46
|
+
rowStates: { heading: string; desc: ReactNode; activeLabel: string; disabledLabel: string; selectedLabel: string };
|
|
47
|
+
cells: {
|
|
48
|
+
heading: string;
|
|
49
|
+
desc: ReactNode;
|
|
50
|
+
textDefault: string;
|
|
51
|
+
textStrong: string;
|
|
52
|
+
textMuted: string;
|
|
53
|
+
textSubtle: string;
|
|
54
|
+
badgeSuccess: string;
|
|
55
|
+
badgeWarning: string;
|
|
56
|
+
badgeDestructive: string;
|
|
57
|
+
badgeInfo: string;
|
|
58
|
+
iconDoc: string;
|
|
59
|
+
iconWarning: string;
|
|
60
|
+
iconCheck: string;
|
|
61
|
+
avatarName: string;
|
|
62
|
+
internalLink: string;
|
|
63
|
+
externalLink: string;
|
|
64
|
+
numberUnit: string;
|
|
65
|
+
};
|
|
66
|
+
api: {
|
|
67
|
+
heading: string;
|
|
68
|
+
columns: { prop: string; type: string; default: string; desc: string };
|
|
69
|
+
rows: {
|
|
70
|
+
variant: string;
|
|
71
|
+
size: string;
|
|
72
|
+
columns: string;
|
|
73
|
+
data: string;
|
|
74
|
+
wrap: string;
|
|
75
|
+
selectable: string;
|
|
76
|
+
active: string;
|
|
77
|
+
disabled: string;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
// trace sample rows
|
|
82
|
+
traceShort: {
|
|
83
|
+
output1: string;
|
|
84
|
+
output2: string;
|
|
85
|
+
output3: string;
|
|
86
|
+
output4: string;
|
|
87
|
+
successLabel: string;
|
|
88
|
+
warningLabel: string;
|
|
89
|
+
destructiveLabel: string;
|
|
90
|
+
};
|
|
91
|
+
traceLong: {
|
|
92
|
+
output1: string;
|
|
93
|
+
output2: string;
|
|
94
|
+
output3: string;
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
const en: Strings = {
|
|
99
|
+
title: "Table Row",
|
|
100
|
+
lead: (
|
|
101
|
+
<>
|
|
102
|
+
A row in a data grid. It shares the same <Code>columns</Code> as the header so width and alignment stay in sync. Cell content is composed from <Code>TableCell*</Code> formatters.
|
|
103
|
+
</>
|
|
104
|
+
),
|
|
105
|
+
|
|
106
|
+
usage: {
|
|
107
|
+
heading: "Usage",
|
|
108
|
+
desc: (
|
|
109
|
+
<>
|
|
110
|
+
Reuse the header's <Code>columns</Code> and add a <Code>render</Code> callback for each cell. The row handles layout; formatters handle text, numbers, and badges.
|
|
111
|
+
</>
|
|
112
|
+
),
|
|
113
|
+
},
|
|
114
|
+
|
|
115
|
+
variants: {
|
|
116
|
+
heading: "Variants",
|
|
117
|
+
desc: (
|
|
118
|
+
<>
|
|
119
|
+
Keep <Code>line</Code> for anything that sits on a page. Switch to <Code>plate</Code> only inside cards where each row needs its own surface.
|
|
120
|
+
</>
|
|
121
|
+
),
|
|
122
|
+
},
|
|
123
|
+
|
|
124
|
+
rowStates: {
|
|
125
|
+
heading: "Row States",
|
|
126
|
+
desc: (
|
|
127
|
+
<>
|
|
128
|
+
<Code>active</Code> marks the row whose detail is open and wins over hover. <Code>selected</Code> is for the Checkbox column. <Code>disabled</Code> blocks pointer and keyboard entry.
|
|
129
|
+
</>
|
|
130
|
+
),
|
|
131
|
+
activeLabel: "Active row",
|
|
132
|
+
disabledLabel: "Disabled row",
|
|
133
|
+
selectedLabel: "Selected row",
|
|
134
|
+
},
|
|
135
|
+
|
|
136
|
+
cells: {
|
|
137
|
+
heading: "Cell Formatters",
|
|
138
|
+
desc: (
|
|
139
|
+
<>
|
|
140
|
+
Use the <Code>TableCell*</Code> set as the only children of <Code>render</Code>. Row owns layout; formatters own tone and unit handling.
|
|
141
|
+
</>
|
|
142
|
+
),
|
|
143
|
+
textDefault: "Default",
|
|
144
|
+
textStrong: "Strong",
|
|
145
|
+
textMuted: "Muted",
|
|
146
|
+
textSubtle: "Subtle",
|
|
147
|
+
badgeSuccess: "Success",
|
|
148
|
+
badgeWarning: "Pending",
|
|
149
|
+
badgeDestructive: "Failed",
|
|
150
|
+
badgeInfo: "Review",
|
|
151
|
+
iconDoc: "Doc",
|
|
152
|
+
iconWarning: "Warning",
|
|
153
|
+
iconCheck: "Done",
|
|
154
|
+
avatarName: "Heeyoung Kim",
|
|
155
|
+
internalLink: "Internal link",
|
|
156
|
+
externalLink: "External doc",
|
|
157
|
+
numberUnit: "USD",
|
|
158
|
+
},
|
|
159
|
+
|
|
160
|
+
api: {
|
|
161
|
+
heading: "API Reference",
|
|
162
|
+
columns: { prop: "Prop", type: "Type", default: "Default", desc: "Description" },
|
|
163
|
+
rows: {
|
|
164
|
+
variant: "Pairs with the header variant. Must match on the same table.",
|
|
165
|
+
size: "Keep md for most tables. Drop to sm for dense logs and dev tools; use lg only when rows carry thumbnails.",
|
|
166
|
+
columns: "Reuses the header spec. Attach a render callback to each key.",
|
|
167
|
+
data: "The record passed into every render call.",
|
|
168
|
+
wrap: "Allows cell text to wrap instead of truncating.",
|
|
169
|
+
selectable: "Adds a leading Checkbox and splits its click from the row action.",
|
|
170
|
+
active: "Marks the row whose detail panel is open.",
|
|
171
|
+
disabled: "Disables pointer and keyboard entry on that row.",
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
|
|
175
|
+
traceShort: {
|
|
176
|
+
output1: "Summary complete. Three paragraph excerpts.",
|
|
177
|
+
output2: "Input tokens over limit. Retrying.",
|
|
178
|
+
output3: "Cost evaluation failed. tool call timeout.",
|
|
179
|
+
output4: "25 chunks embedded. vector db.",
|
|
180
|
+
successLabel: "Success",
|
|
181
|
+
warningLabel: "Warning",
|
|
182
|
+
destructiveLabel: "Failed",
|
|
183
|
+
},
|
|
184
|
+
|
|
185
|
+
traceLong: {
|
|
186
|
+
output1:
|
|
187
|
+
"Summary generated. Pulled 3 key claims and 2 counterpoints from 12 input docs (48,210 tokens total). Handing off to draft-writer to produce 3 section drafts.",
|
|
188
|
+
output2:
|
|
189
|
+
"Cost evaluation failed. tool_call timeout 30s. No response after 2 retries. Switching to backup vendor.",
|
|
190
|
+
output3:
|
|
191
|
+
"Embedded 25 chunks and upserted to the vector DB. 3 duplicate IDs handled by overwrite.",
|
|
192
|
+
},
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
const ko: Strings = {
|
|
196
|
+
title: "Table Row",
|
|
197
|
+
lead: (
|
|
198
|
+
<>
|
|
199
|
+
데이터 그리드의 행. 헤더와 같은 <Code>columns</Code>를 공유해 폭·정렬이 자동으로 맞춰져요. 셀 콘텐츠는 <Code>TableCell*</Code> 포맷터로 조립해요.
|
|
200
|
+
</>
|
|
201
|
+
),
|
|
202
|
+
|
|
203
|
+
usage: {
|
|
204
|
+
heading: "사용법",
|
|
205
|
+
desc: (
|
|
206
|
+
<>
|
|
207
|
+
헤더가 쓴 <Code>columns</Code>를 그대로 재사용하고 각 셀마다 <Code>render</Code> 콜백만 더해요. 행은 레이아웃, 포맷터는 텍스트·숫자·배지를 담당해요.
|
|
208
|
+
</>
|
|
209
|
+
),
|
|
210
|
+
},
|
|
211
|
+
|
|
212
|
+
variants: {
|
|
213
|
+
heading: "표현",
|
|
214
|
+
desc: (
|
|
215
|
+
<>
|
|
216
|
+
페이지에 바로 얹히는 자리는 <Code>line</Code>으로 둬요. <Code>plate</Code>는 카드 안쪽처럼 각 행이 자기 표면이 필요할 때만.
|
|
217
|
+
</>
|
|
218
|
+
),
|
|
219
|
+
},
|
|
220
|
+
|
|
221
|
+
rowStates: {
|
|
222
|
+
heading: "행 상태",
|
|
223
|
+
desc: (
|
|
224
|
+
<>
|
|
225
|
+
<Code>active</Code>는 상세가 열린 행 표시로, hover보다 우선해요. <Code>selected</Code>는 Checkbox 선택, <Code>disabled</Code>는 포인터·키보드 진입을 막아요.
|
|
226
|
+
</>
|
|
227
|
+
),
|
|
228
|
+
activeLabel: "Active 행",
|
|
229
|
+
disabledLabel: "Disabled 행",
|
|
230
|
+
selectedLabel: "Selected 행",
|
|
231
|
+
},
|
|
232
|
+
|
|
233
|
+
cells: {
|
|
234
|
+
heading: "셀 표시 형식",
|
|
235
|
+
desc: (
|
|
236
|
+
<>
|
|
237
|
+
<Code>render</Code> 안쪽에는 <Code>TableCell*</Code> 세트만 둬요. 행은 레이아웃, 포맷터는 톤·단위를 담당해요.
|
|
238
|
+
</>
|
|
239
|
+
),
|
|
240
|
+
textDefault: "기본",
|
|
241
|
+
textStrong: "강조",
|
|
242
|
+
textMuted: "보조",
|
|
243
|
+
textSubtle: "힌트",
|
|
244
|
+
badgeSuccess: "성공",
|
|
245
|
+
badgeWarning: "대기",
|
|
246
|
+
badgeDestructive: "실패",
|
|
247
|
+
badgeInfo: "검토",
|
|
248
|
+
iconDoc: "문서",
|
|
249
|
+
iconWarning: "주의",
|
|
250
|
+
iconCheck: "완료",
|
|
251
|
+
avatarName: "김희영",
|
|
252
|
+
internalLink: "내부 링크",
|
|
253
|
+
externalLink: "외부 문서",
|
|
254
|
+
numberUnit: "원",
|
|
255
|
+
},
|
|
256
|
+
|
|
257
|
+
api: {
|
|
258
|
+
heading: "속성",
|
|
259
|
+
columns: { prop: "속성", type: "타입", default: "기본값", desc: "설명" },
|
|
260
|
+
rows: {
|
|
261
|
+
variant: "헤더 variant와 짝. 같은 테이블에서 섞으면 라운드·구분 규칙이 깨져요.",
|
|
262
|
+
size: "대부분은 md. 밀도 높은 로그·개발자 도구는 sm, 썸네일이 있는 행에서만 lg.",
|
|
263
|
+
columns: "헤더 스펙을 재사용해요. 각 key에 render 콜백을 더해요.",
|
|
264
|
+
data: "render에 전달되는 레코드.",
|
|
265
|
+
wrap: "셀 텍스트를 줄바꿈해요. 기본은 한 줄을 넘으면 끝을 생략해요.",
|
|
266
|
+
selectable: "좌측 Checkbox 셀을 추가하고 체크 클릭과 행 클릭을 분리해요.",
|
|
267
|
+
active: "상세 패널이 열린 행을 표시해요.",
|
|
268
|
+
disabled: "해당 행의 포인터·키보드 진입을 막아요.",
|
|
269
|
+
},
|
|
270
|
+
},
|
|
271
|
+
|
|
272
|
+
traceShort: {
|
|
273
|
+
output1: "요약 완료. 세 문단 발췌.",
|
|
274
|
+
output2: "입력 토큰 초과. 재시도 중.",
|
|
275
|
+
output3: "원가 산출 실패. tool call timeout.",
|
|
276
|
+
output4: "25 chunk 임베딩. vector db.",
|
|
277
|
+
successLabel: "성공",
|
|
278
|
+
warningLabel: "경고",
|
|
279
|
+
destructiveLabel: "실패",
|
|
280
|
+
},
|
|
281
|
+
|
|
282
|
+
traceLong: {
|
|
283
|
+
output1:
|
|
284
|
+
"요약 생성 완료. 입력 문서 12개(총 48,210 토큰)에서 핵심 주장 3개 추출, 반대 의견 2개 병기. 다음 단계로 draft-writer에 넘겨 섹션별 초안 3개 생성.",
|
|
285
|
+
output2:
|
|
286
|
+
"원가 산출 실패. tool_call timeout 30s. 재시도 2회 후에도 응답 없음. 대체 벤더로 전환.",
|
|
287
|
+
output3:
|
|
288
|
+
"25개 chunk를 임베딩 모델에 넣어 벡터 DB에 upsert 완료. 중복 ID 3건은 overwrite 처리.",
|
|
289
|
+
},
|
|
290
|
+
};
|
|
291
|
+
|
|
292
|
+
export const strings = { en, ko };
|
|
293
|
+
export type { Strings };
|
|
294
|
+
````
|
|
295
|
+
|
|
296
|
+
### Source: web/app/[lang]/components/data/table-row/page.module.css
|
|
297
|
+
|
|
298
|
+
````css
|
|
299
|
+
.shell {
|
|
300
|
+
overflow-x: auto;
|
|
301
|
+
overflow-y: hidden;
|
|
302
|
+
position: relative;
|
|
303
|
+
width: 100%;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
.shellNarrow {
|
|
307
|
+
max-width: calc(var(--size-24) * 7.5);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
.plateRows {
|
|
311
|
+
display: flex;
|
|
312
|
+
flex-direction: column;
|
|
313
|
+
margin-top: var(--space-1);
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
.cellList {
|
|
317
|
+
margin: 0;
|
|
318
|
+
padding: var(--space-4);
|
|
319
|
+
border: var(--hairline) solid var(--border);
|
|
320
|
+
corner-shape: var(--corner-shape);
|
|
321
|
+
border-radius: var(--radius-lg);
|
|
322
|
+
list-style: none;
|
|
323
|
+
display: flex;
|
|
324
|
+
flex-direction: column;
|
|
325
|
+
gap: var(--space-3);
|
|
326
|
+
width: 100%;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.cellList li {
|
|
330
|
+
display: flex;
|
|
331
|
+
flex-wrap: wrap;
|
|
332
|
+
gap: var(--space-2);
|
|
333
|
+
align-items: center;
|
|
334
|
+
font-size: var(--text-sm);
|
|
335
|
+
line-height: var(--lh-sm);
|
|
336
|
+
}
|
|
337
|
+
````
|
|
338
|
+
|
|
339
|
+
### Source: web/app/[lang]/components/data/table-row/page.tsx
|
|
340
|
+
|
|
341
|
+
````tsx
|
|
342
|
+
"use client";
|
|
343
|
+
|
|
344
|
+
import { RowInteractionExamples } from "@/examples/RowInteractionExamples";
|
|
345
|
+
import { useMemo, useState } from "react";
|
|
346
|
+
import { usePathname } from "next/navigation";
|
|
347
|
+
import { TableHeader, type TableHeaderColumn } from "@/components/TableHeader";
|
|
348
|
+
import { TableRow, type TableRowColumn } from "@/components/TableRow";
|
|
349
|
+
import { Code } from "@/components/Code";
|
|
350
|
+
import { Icon } from "@/components/Icon";
|
|
351
|
+
import {
|
|
352
|
+
TableCellText,
|
|
353
|
+
TableCellNumber,
|
|
354
|
+
TableCellTag,
|
|
355
|
+
TableCellImage,
|
|
356
|
+
TableCellAvatar,
|
|
357
|
+
TableCellMeter,
|
|
358
|
+
} from "@/components/TableCell";
|
|
359
|
+
import { ExampleBlock } from "../../../../_components/ExampleBlock";
|
|
360
|
+
import { Playground } from "../../../../_components/Playground";
|
|
361
|
+
import { DocsTable } from "../../../../_components/DocsTable";
|
|
362
|
+
import { localeFromPathname } from "../../../../_dict";
|
|
363
|
+
import { strings } from "./_strings";
|
|
364
|
+
import styles from "./page.module.css";
|
|
365
|
+
|
|
366
|
+
type TraceRow = {
|
|
367
|
+
id: string;
|
|
368
|
+
timestamp: string;
|
|
369
|
+
flow: string;
|
|
370
|
+
output: string;
|
|
371
|
+
status: "success" | "warning" | "destructive";
|
|
372
|
+
duration: number;
|
|
373
|
+
};
|
|
374
|
+
|
|
375
|
+
type TraceShort = typeof strings.en.traceShort;
|
|
376
|
+
type TraceLong = typeof strings.en.traceLong;
|
|
377
|
+
|
|
378
|
+
function makeTraceRows(s: TraceShort): TraceRow[] {
|
|
379
|
+
return [
|
|
380
|
+
{
|
|
381
|
+
id: "t1",
|
|
382
|
+
timestamp: "2026-10-01 14:02",
|
|
383
|
+
flow: "research-assist",
|
|
384
|
+
output: s.output1,
|
|
385
|
+
status: "success",
|
|
386
|
+
duration: 1240,
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
id: "t2",
|
|
390
|
+
timestamp: "2026-10-01 13:58",
|
|
391
|
+
flow: "research-assist",
|
|
392
|
+
output: s.output2,
|
|
393
|
+
status: "warning",
|
|
394
|
+
duration: 820,
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
id: "t3",
|
|
398
|
+
timestamp: "2026-10-01 13:41",
|
|
399
|
+
flow: "price-eval",
|
|
400
|
+
output: s.output3,
|
|
401
|
+
status: "destructive",
|
|
402
|
+
duration: 3100,
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
id: "t4",
|
|
406
|
+
timestamp: "2026-10-01 13:12",
|
|
407
|
+
flow: "doc-ingest",
|
|
408
|
+
output: s.output4,
|
|
409
|
+
status: "success",
|
|
410
|
+
duration: 2860,
|
|
411
|
+
},
|
|
412
|
+
];
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
function makeTraceRowsLong(s: TraceLong): TraceRow[] {
|
|
416
|
+
return [
|
|
417
|
+
{
|
|
418
|
+
id: "t1",
|
|
419
|
+
timestamp: "2026-10-01 14:02:17.482 KST",
|
|
420
|
+
flow: "research-assist-with-very-long-flow-name-v3-beta-rc2",
|
|
421
|
+
output: s.output1,
|
|
422
|
+
status: "success",
|
|
423
|
+
duration: 1240,
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
id: "t2",
|
|
427
|
+
timestamp: "2026-10-01 13:58:04 KST",
|
|
428
|
+
flow: "price-eval-pipeline-stage-2-cost-breakdown",
|
|
429
|
+
output: s.output2,
|
|
430
|
+
status: "destructive",
|
|
431
|
+
duration: 31240,
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
id: "t3",
|
|
435
|
+
timestamp: "2026-10-01 13:12:48 KST",
|
|
436
|
+
flow: "doc-ingest-pipeline-stage-3-embed",
|
|
437
|
+
output: s.output3,
|
|
438
|
+
status: "success",
|
|
439
|
+
duration: 2860,
|
|
440
|
+
},
|
|
441
|
+
];
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
const TRACE_HEADER_COLUMNS: TableHeaderColumn[] = [
|
|
445
|
+
{ key: "timestamp", label: "Timestamp", width: 160, sortable: true },
|
|
446
|
+
{ key: "flow", label: "Flow", width: 180 },
|
|
447
|
+
{ key: "output", label: "Output", flex: true, minWidth: 200 },
|
|
448
|
+
{ key: "status", label: "Status", width: 110 },
|
|
449
|
+
{ key: "duration", label: "Duration", width: 110, sortable: true },
|
|
450
|
+
];
|
|
451
|
+
|
|
452
|
+
const TRACE_HEADER_COLUMNS_PINNED: TableHeaderColumn[] = [
|
|
453
|
+
{ key: "timestamp", label: "Timestamp", width: 160, pinned: "left", sortable: true },
|
|
454
|
+
{ key: "flow", label: "Flow", width: 180 },
|
|
455
|
+
{ key: "output", label: "Output", width: 480 },
|
|
456
|
+
{ key: "status", label: "Status", width: 110 },
|
|
457
|
+
{ key: "duration", label: "Duration", width: 110, sortable: true },
|
|
458
|
+
];
|
|
459
|
+
|
|
460
|
+
function statusLabel(status: TraceRow["status"], s: TraceShort): string {
|
|
461
|
+
if (status === "success") return s.successLabel;
|
|
462
|
+
if (status === "warning") return s.warningLabel;
|
|
463
|
+
return s.destructiveLabel;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
function traceRowColumnsFrom(
|
|
467
|
+
headers: TableHeaderColumn[],
|
|
468
|
+
s: TraceShort,
|
|
469
|
+
): TableRowColumn<TraceRow>[] {
|
|
470
|
+
return [
|
|
471
|
+
{ ...headers[0], render: (d) => <TableCellText tone="muted">{d.timestamp}</TableCellText> },
|
|
472
|
+
{ ...headers[1], render: (d) => <TableCellText tone="strong">{d.flow}</TableCellText> },
|
|
473
|
+
{ ...headers[2], render: (d) => <TableCellText>{d.output}</TableCellText> },
|
|
474
|
+
{
|
|
475
|
+
...headers[3],
|
|
476
|
+
render: (d) => <TableCellTag status={d.status}>{statusLabel(d.status, s)}</TableCellTag>,
|
|
477
|
+
},
|
|
478
|
+
{ ...headers[4], render: (d) => <TableCellNumber value={d.duration} unit="ms" /> },
|
|
479
|
+
];
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
function traceRowColumnsWithImage(
|
|
483
|
+
headers: TableHeaderColumn[],
|
|
484
|
+
s: TraceShort,
|
|
485
|
+
): TableRowColumn<TraceRow>[] {
|
|
486
|
+
const base = traceRowColumnsFrom(headers, s);
|
|
487
|
+
return [
|
|
488
|
+
base[0],
|
|
489
|
+
{ ...headers[1], render: (d) => <TableCellImage size={40} shape="rounded" label={d.flow} /> },
|
|
490
|
+
base[2],
|
|
491
|
+
base[3],
|
|
492
|
+
base[4],
|
|
493
|
+
];
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
type RowSize = "sm" | "md" | "lg";
|
|
497
|
+
type RowVariant = "line" | "plate";
|
|
498
|
+
|
|
499
|
+
export default function TableRowPage() {
|
|
500
|
+
const pathname = usePathname() ?? "/";
|
|
501
|
+
const t = strings[localeFromPathname(pathname)];
|
|
502
|
+
|
|
503
|
+
const traceRows = useMemo(() => makeTraceRows(strings.en.traceShort), [strings.en.traceShort]);
|
|
504
|
+
const traceRowsLong = useMemo(() => makeTraceRowsLong(strings.en.traceLong), [strings.en.traceLong]);
|
|
505
|
+
const traceRowColumns = useMemo(
|
|
506
|
+
() => traceRowColumnsFrom(TRACE_HEADER_COLUMNS, strings.en.traceShort),
|
|
507
|
+
[strings.en.traceShort],
|
|
508
|
+
);
|
|
509
|
+
const traceRowColumnsPinned = useMemo(
|
|
510
|
+
() => traceRowColumnsFrom(TRACE_HEADER_COLUMNS_PINNED, strings.en.traceShort),
|
|
511
|
+
[strings.en.traceShort],
|
|
512
|
+
);
|
|
513
|
+
const traceRowColumnsWithImageMemo = useMemo(
|
|
514
|
+
() => traceRowColumnsWithImage(TRACE_HEADER_COLUMNS, strings.en.traceShort),
|
|
515
|
+
[strings.en.traceShort],
|
|
516
|
+
);
|
|
517
|
+
|
|
518
|
+
const [variant, setVariant] = useState<RowVariant>("line");
|
|
519
|
+
const [size, setSize] = useState<RowSize>("sm");
|
|
520
|
+
const [selectable, setSelectable] = useState(false);
|
|
521
|
+
const [wrapOn, setWrapOn] = useState(false);
|
|
522
|
+
const [pinnedOn, setPinnedOn] = useState(false);
|
|
523
|
+
const [disabledOn, setDisabledOn] = useState(false);
|
|
524
|
+
const [activeOn, setActiveOn] = useState(true);
|
|
525
|
+
const [selected, setSelected] = useState<Set<string>>(new Set());
|
|
526
|
+
const [activeId, setActiveId] = useState<string | null>(null);
|
|
527
|
+
|
|
528
|
+
const supportsPinned = variant === "line";
|
|
529
|
+
const effectivePinned = supportsPinned && pinnedOn;
|
|
530
|
+
const headers = effectivePinned ? TRACE_HEADER_COLUMNS_PINNED : TRACE_HEADER_COLUMNS;
|
|
531
|
+
const columns =
|
|
532
|
+
size === "lg"
|
|
533
|
+
? traceRowColumnsWithImageMemo
|
|
534
|
+
: effectivePinned
|
|
535
|
+
? traceRowColumnsPinned
|
|
536
|
+
: traceRowColumns;
|
|
537
|
+
const rows = wrapOn ? traceRowsLong : traceRows;
|
|
538
|
+
|
|
539
|
+
const allSelected = rows.length > 0 && rows.every((r) => selected.has(r.id));
|
|
540
|
+
const toggle = (id: string, next: boolean) => {
|
|
541
|
+
setSelected((prev) => {
|
|
542
|
+
const n = new Set(prev);
|
|
543
|
+
if (next) n.add(id);
|
|
544
|
+
else n.delete(id);
|
|
545
|
+
return n;
|
|
546
|
+
});
|
|
547
|
+
};
|
|
548
|
+
const onSelectAll = (next: boolean) => {
|
|
549
|
+
setSelected(next ? new Set(rows.map((r) => r.id)) : new Set());
|
|
550
|
+
};
|
|
551
|
+
|
|
552
|
+
const rowElements = rows.map((row, i) => {
|
|
553
|
+
const isDisabled = disabledOn && i === 1;
|
|
554
|
+
const isActive = activeOn && activeId === row.id && !isDisabled;
|
|
555
|
+
return (
|
|
556
|
+
<TableRow
|
|
557
|
+
key={row.id}
|
|
558
|
+
variant={variant}
|
|
559
|
+
size={size}
|
|
560
|
+
columns={columns}
|
|
561
|
+
data={row}
|
|
562
|
+
wrap={wrapOn}
|
|
563
|
+
disabled={isDisabled}
|
|
564
|
+
active={isActive}
|
|
565
|
+
selectable={selectable}
|
|
566
|
+
selected={selectable ? selected.has(row.id) : undefined}
|
|
567
|
+
onSelectedChange={selectable ? (next) => toggle(row.id, next) : undefined}
|
|
568
|
+
onClick={() => setActiveId(row.id)}
|
|
569
|
+
/>
|
|
570
|
+
);
|
|
571
|
+
});
|
|
572
|
+
|
|
573
|
+
const header = (
|
|
574
|
+
<TableHeader
|
|
575
|
+
variant={variant}
|
|
576
|
+
columns={headers}
|
|
577
|
+
selectable={selectable}
|
|
578
|
+
selectAllChecked={selectable ? allSelected : undefined}
|
|
579
|
+
onSelectAllChange={selectable ? onSelectAll : undefined}
|
|
580
|
+
/>
|
|
581
|
+
);
|
|
582
|
+
|
|
583
|
+
return (
|
|
584
|
+
<>
|
|
585
|
+
<h1 className="page-title">{t.title}</h1>
|
|
586
|
+
<p className="page-lead">{t.lead}</p>
|
|
587
|
+
|
|
588
|
+
<section id="usage" className="section-first">
|
|
589
|
+
<h2>{t.usage.heading}</h2>
|
|
590
|
+
<p className="desc">{t.usage.desc}</p>
|
|
591
|
+
<ExampleBlock
|
|
592
|
+
align="column"
|
|
593
|
+
code={`import { TableHeader } from "@/components/TableHeader";
|
|
594
|
+
import { TableRow } from "@/components/TableRow";
|
|
595
|
+
import { TableCellText, TableCellTag } from "@/components/TableCell";
|
|
596
|
+
|
|
597
|
+
<TableHeader variant="line" columns={headers} />
|
|
598
|
+
<TableRow
|
|
599
|
+
variant="line"
|
|
600
|
+
columns={rowColumns}
|
|
601
|
+
data={row}
|
|
602
|
+
/>`}
|
|
603
|
+
>
|
|
604
|
+
<div className={styles.shell}>
|
|
605
|
+
<TableHeader variant="line" columns={TRACE_HEADER_COLUMNS} />
|
|
606
|
+
{traceRows.map((row) => (
|
|
607
|
+
<TableRow
|
|
608
|
+
key={row.id}
|
|
609
|
+
variant="line"
|
|
610
|
+
size="sm"
|
|
611
|
+
columns={traceRowColumns}
|
|
612
|
+
data={row}
|
|
613
|
+
/>
|
|
614
|
+
))}
|
|
615
|
+
</div>
|
|
616
|
+
</ExampleBlock>
|
|
617
|
+
</section>
|
|
618
|
+
|
|
619
|
+
<Playground
|
|
620
|
+
axes={[
|
|
621
|
+
{
|
|
622
|
+
label: "variant",
|
|
623
|
+
value: variant,
|
|
624
|
+
onChange: (v) => setVariant(v as RowVariant),
|
|
625
|
+
options: ["line", "plate"],
|
|
626
|
+
},
|
|
627
|
+
{
|
|
628
|
+
label: "size",
|
|
629
|
+
value: size,
|
|
630
|
+
onChange: (v) => setSize(v as RowSize),
|
|
631
|
+
options: ["sm", "md", "lg"],
|
|
632
|
+
},
|
|
633
|
+
]}
|
|
634
|
+
toggles={[
|
|
635
|
+
{ group: "behavior", label: "selectable", value: selectable, onChange: setSelectable },
|
|
636
|
+
{ group: "appearance", label: "wrap", value: wrapOn, onChange: setWrapOn },
|
|
637
|
+
...(supportsPinned
|
|
638
|
+
? [{ group: "appearance", label: "pinned", value: pinnedOn, onChange: setPinnedOn }]
|
|
639
|
+
: []),
|
|
640
|
+
{ group: "state", label: "active", value: activeOn, onChange: setActiveOn },
|
|
641
|
+
{ group: "state", label: "disabled", value: disabledOn, onChange: setDisabledOn },
|
|
642
|
+
]}
|
|
643
|
+
>
|
|
644
|
+
<div
|
|
645
|
+
className={`${styles.shell} ${effectivePinned ? styles.shellNarrow : ""}`.trim()}
|
|
646
|
+
>
|
|
647
|
+
{header}
|
|
648
|
+
{variant === "plate" ? (
|
|
649
|
+
<div className={styles.plateRows}>{rowElements}</div>
|
|
650
|
+
) : (
|
|
651
|
+
rowElements
|
|
652
|
+
)}
|
|
653
|
+
</div>
|
|
654
|
+
</Playground>
|
|
655
|
+
|
|
656
|
+
<section id="variants">
|
|
657
|
+
<h2>{t.variants.heading}</h2>
|
|
658
|
+
<p className="desc">{t.variants.desc}</p>
|
|
659
|
+
<ExampleBlock
|
|
660
|
+
align="column"
|
|
661
|
+
code={`<TableRow variant="line" ... />
|
|
662
|
+
<TableRow variant="plate" ... />`}
|
|
663
|
+
>
|
|
664
|
+
<div className={styles.shell}>
|
|
665
|
+
<TableHeader variant="line" columns={TRACE_HEADER_COLUMNS} />
|
|
666
|
+
{traceRows.slice(0, 2).map((row) => (
|
|
667
|
+
<TableRow
|
|
668
|
+
key={row.id}
|
|
669
|
+
variant="line"
|
|
670
|
+
size="sm"
|
|
671
|
+
columns={traceRowColumns}
|
|
672
|
+
data={row}
|
|
673
|
+
/>
|
|
674
|
+
))}
|
|
675
|
+
</div>
|
|
676
|
+
<div className={styles.shell}>
|
|
677
|
+
<TableHeader variant="plate" columns={TRACE_HEADER_COLUMNS} />
|
|
678
|
+
<div className={styles.plateRows}>
|
|
679
|
+
{traceRows.slice(0, 2).map((row) => (
|
|
680
|
+
<TableRow
|
|
681
|
+
key={row.id}
|
|
682
|
+
variant="plate"
|
|
683
|
+
size="sm"
|
|
684
|
+
columns={traceRowColumns}
|
|
685
|
+
data={row}
|
|
686
|
+
/>
|
|
687
|
+
))}
|
|
688
|
+
</div>
|
|
689
|
+
</div>
|
|
690
|
+
</ExampleBlock>
|
|
691
|
+
</section>
|
|
692
|
+
|
|
693
|
+
<section id="row-states">
|
|
694
|
+
<h2>{t.rowStates.heading}</h2>
|
|
695
|
+
<p className="desc">{t.rowStates.desc}</p>
|
|
696
|
+
<ExampleBlock
|
|
697
|
+
align="column"
|
|
698
|
+
code={`<TableRow active ... />
|
|
699
|
+
<TableRow selectable selected ... />
|
|
700
|
+
<TableRow disabled ... />`}
|
|
701
|
+
>
|
|
702
|
+
<div className={styles.shell}>
|
|
703
|
+
<TableHeader variant="line" columns={TRACE_HEADER_COLUMNS} selectable />
|
|
704
|
+
<TableRow
|
|
705
|
+
variant="line"
|
|
706
|
+
size="sm"
|
|
707
|
+
columns={traceRowColumns}
|
|
708
|
+
data={traceRows[0]}
|
|
709
|
+
active
|
|
710
|
+
selectable
|
|
711
|
+
onClick={() => undefined}
|
|
712
|
+
/>
|
|
713
|
+
<TableRow
|
|
714
|
+
variant="line"
|
|
715
|
+
size="sm"
|
|
716
|
+
columns={traceRowColumns}
|
|
717
|
+
data={traceRows[1]}
|
|
718
|
+
selectable
|
|
719
|
+
selected
|
|
720
|
+
onSelectedChange={() => undefined}
|
|
721
|
+
onClick={() => undefined}
|
|
722
|
+
/>
|
|
723
|
+
<TableRow
|
|
724
|
+
variant="line"
|
|
725
|
+
size="sm"
|
|
726
|
+
columns={traceRowColumns}
|
|
727
|
+
data={traceRows[2]}
|
|
728
|
+
selectable
|
|
729
|
+
disabled
|
|
730
|
+
/>
|
|
731
|
+
</div>
|
|
732
|
+
</ExampleBlock>
|
|
733
|
+
</section>
|
|
734
|
+
|
|
735
|
+
<section id="cells">
|
|
736
|
+
<h2>{t.cells.heading}</h2>
|
|
737
|
+
<p className="desc">{t.cells.desc}</p>
|
|
738
|
+
<ExampleBlock
|
|
739
|
+
align="column"
|
|
740
|
+
code={`import { TableCellText, TableCellNumber, TableCellTag, ... } from "@/components/TableCell";
|
|
741
|
+
|
|
742
|
+
<TableCellText tone="muted">...</TableCellText>
|
|
743
|
+
<TableCellNumber value={1240} unit="ms" />
|
|
744
|
+
<TableCellTag status="success">${strings.en.cells.badgeSuccess}</TableCellTag>`}
|
|
745
|
+
>
|
|
746
|
+
<ul className={styles.cellList}>
|
|
747
|
+
<li>
|
|
748
|
+
<Code>TableCellText</Code>
|
|
749
|
+
<TableCellText>{strings.en.cells.textDefault}</TableCellText>
|
|
750
|
+
<TableCellText tone="strong">{strings.en.cells.textStrong}</TableCellText>
|
|
751
|
+
<TableCellText tone="muted">{strings.en.cells.textMuted}</TableCellText>
|
|
752
|
+
<TableCellText tone="subtle">{strings.en.cells.textSubtle}</TableCellText>
|
|
753
|
+
</li>
|
|
754
|
+
<li>
|
|
755
|
+
<Code>TableCellNumber</Code>
|
|
756
|
+
<TableCellNumber value={1234567} />
|
|
757
|
+
<TableCellNumber value={1240} unit="ms" />
|
|
758
|
+
<TableCellNumber value={-320} unit={strings.en.cells.numberUnit} highlightNegative />
|
|
759
|
+
</li>
|
|
760
|
+
<li>
|
|
761
|
+
<Code>TableCellTag</Code>
|
|
762
|
+
<TableCellTag status="success">{strings.en.cells.badgeSuccess}</TableCellTag>
|
|
763
|
+
<TableCellTag status="warning">{strings.en.cells.badgeWarning}</TableCellTag>
|
|
764
|
+
<TableCellTag status="destructive">{strings.en.cells.badgeDestructive}</TableCellTag>
|
|
765
|
+
<TableCellTag status="info">{strings.en.cells.badgeInfo}</TableCellTag>
|
|
766
|
+
</li>
|
|
767
|
+
<li>
|
|
768
|
+
<Code>TableCellImage</Code>
|
|
769
|
+
<TableCellImage size={28} shape="rounded" label="document.pdf" />
|
|
770
|
+
</li>
|
|
771
|
+
<li>
|
|
772
|
+
<Code>TableCellText icon</Code>
|
|
773
|
+
<TableCellText icon={<Icon name="article" size={16} />}>{strings.en.cells.iconDoc}</TableCellText>
|
|
774
|
+
<TableCellText icon={<Icon name="warning" size={16} />}>{strings.en.cells.iconWarning}</TableCellText>
|
|
775
|
+
<TableCellText icon={<Icon name="check" size={16} />} tone="muted">{strings.en.cells.iconCheck}</TableCellText>
|
|
776
|
+
</li>
|
|
777
|
+
<li>
|
|
778
|
+
<Code>TableCellAvatar</Code>
|
|
779
|
+
<TableCellAvatar
|
|
780
|
+
name={strings.en.cells.avatarName}
|
|
781
|
+
label={strings.en.cells.avatarName}
|
|
782
|
+
sublabel="heeyoung@orbit.studio"
|
|
783
|
+
/>
|
|
784
|
+
</li>
|
|
785
|
+
<li>
|
|
786
|
+
<Code>TableCellMeter</Code>
|
|
787
|
+
<TableCellMeter value={28} />
|
|
788
|
+
<TableCellMeter value={72} tone="success" />
|
|
789
|
+
<TableCellMeter value={92} tone="warning" />
|
|
790
|
+
</li>
|
|
791
|
+
</ul>
|
|
792
|
+
</ExampleBlock>
|
|
793
|
+
</section>
|
|
794
|
+
|
|
795
|
+
<section id="in-uses">
|
|
796
|
+
<h2>{pathname?.startsWith("/ko") ? "사용 사례" : "In Uses"}</h2>
|
|
797
|
+
<RowInteractionExamples only="table" />
|
|
798
|
+
</section>
|
|
799
|
+
|
|
800
|
+
<section id="api">
|
|
801
|
+
<h2>{t.api.heading}</h2>
|
|
802
|
+
<DocsTable
|
|
803
|
+
columns={[
|
|
804
|
+
{ key: "prop", label: t.api.columns.prop, width: 160 },
|
|
805
|
+
{ key: "type", label: t.api.columns.type, flex: true, minWidth: 220 },
|
|
806
|
+
{ key: "default", label: t.api.columns.default, width: 120 },
|
|
807
|
+
{ key: "desc", label: t.api.columns.desc, flex: true, minWidth: 240 },
|
|
808
|
+
]}
|
|
809
|
+
rows={[
|
|
810
|
+
{
|
|
811
|
+
prop: <Code>variant</Code>,
|
|
812
|
+
type: <Code>'line' | 'plate'</Code>,
|
|
813
|
+
default: <Code>'line'</Code>,
|
|
814
|
+
desc: t.api.rows.variant,
|
|
815
|
+
},
|
|
816
|
+
{
|
|
817
|
+
prop: <Code>size</Code>,
|
|
818
|
+
type: <Code>'sm' | 'md' | 'lg'</Code>,
|
|
819
|
+
default: <Code>'sm'</Code>,
|
|
820
|
+
desc: t.api.rows.size,
|
|
821
|
+
},
|
|
822
|
+
{
|
|
823
|
+
prop: <Code>columns</Code>,
|
|
824
|
+
type: <Code>TableRowColumn[]</Code>,
|
|
825
|
+
default: "",
|
|
826
|
+
desc: t.api.rows.columns,
|
|
827
|
+
},
|
|
828
|
+
{
|
|
829
|
+
prop: <Code>data</Code>,
|
|
830
|
+
type: <Code>T</Code>,
|
|
831
|
+
default: "",
|
|
832
|
+
desc: t.api.rows.data,
|
|
833
|
+
},
|
|
834
|
+
{
|
|
835
|
+
prop: <Code>wrap</Code>,
|
|
836
|
+
type: <Code>boolean</Code>,
|
|
837
|
+
default: <Code>false</Code>,
|
|
838
|
+
desc: t.api.rows.wrap,
|
|
839
|
+
},
|
|
840
|
+
{
|
|
841
|
+
prop: <Code>selectable</Code>,
|
|
842
|
+
type: <Code>boolean</Code>,
|
|
843
|
+
default: <Code>false</Code>,
|
|
844
|
+
desc: t.api.rows.selectable,
|
|
845
|
+
},
|
|
846
|
+
{
|
|
847
|
+
prop: <Code>active</Code>,
|
|
848
|
+
type: <Code>boolean</Code>,
|
|
849
|
+
default: <Code>false</Code>,
|
|
850
|
+
desc: t.api.rows.active,
|
|
851
|
+
},
|
|
852
|
+
{
|
|
853
|
+
prop: <Code>disabled</Code>,
|
|
854
|
+
type: <Code>boolean</Code>,
|
|
855
|
+
default: <Code>false</Code>,
|
|
856
|
+
desc: t.api.rows.disabled,
|
|
857
|
+
},
|
|
858
|
+
]}
|
|
859
|
+
/>
|
|
860
|
+
</section>
|
|
861
|
+
</>
|
|
862
|
+
);
|
|
863
|
+
}
|
|
864
|
+
````
|
|
865
|
+
|
|
866
|
+
### Source: web/examples/RowInteractionExamples.module.css
|
|
867
|
+
|
|
868
|
+
````css
|
|
869
|
+
.examples { display: grid; gap: var(--space-8); min-width: 0; width: 100%; }
|
|
870
|
+
.example { display: grid; gap: var(--space-3); min-width: 0; }
|
|
871
|
+
.example h3 { margin: 0; font-size: var(--text-lg); color: var(--fg); }
|
|
872
|
+
.example output { color: var(--fg-muted); font-size: var(--text-sm); }
|
|
873
|
+
.example output:empty { display: none; }
|
|
874
|
+
.list { list-style: none; padding: 0; margin: 0; }
|
|
875
|
+
.list > li { border-bottom: var(--hairline) solid var(--border); }
|
|
876
|
+
.list > li:last-child { border-bottom: 0; }
|
|
877
|
+
|
|
878
|
+
.scroll { max-width: 100%; overflow: auto; }
|
|
879
|
+
.example output::before { content: attr(aria-label) ": "; color: var(--fg-subtle); }
|
|
880
|
+
````
|
|
881
|
+
|
|
882
|
+
### Source: web/examples/RowInteractionExamples.tsx
|
|
883
|
+
|
|
884
|
+
````tsx
|
|
885
|
+
"use client";
|
|
886
|
+
import { useState } from "react";
|
|
887
|
+
import { ListItem } from "../components/ListItem";
|
|
888
|
+
import { Checkbox } from "../components/Checkbox";
|
|
889
|
+
import { Button } from "../components/Button";
|
|
890
|
+
import { DataTable, createDataTableState } from "../components/DataTable";
|
|
891
|
+
import { TableHeader } from "../components/TableHeader";
|
|
892
|
+
import { TableRowSelect } from "../components/TableRowSelect";
|
|
893
|
+
import type { TableRowColumn } from "../components/TableRow";
|
|
894
|
+
import { useTheme, ThemeLocaleProvider } from "../components/ThemeController";
|
|
895
|
+
import styles from "./RowInteractionExamples.module.css";
|
|
896
|
+
|
|
897
|
+
const customers = [
|
|
898
|
+
{ id: "hana", name: "Hana Logistics", next: "Review quote", amount: "₩24,000,000" },
|
|
899
|
+
{ id: "on", name: "On Retail", next: "Discuss rollout schedule", amount: "₩18,000,000" },
|
|
900
|
+
];
|
|
901
|
+
|
|
902
|
+
/** 실제 상태를 연결한 조합. 디자인 처방이 아닌 행동 계약의 예시다. */
|
|
903
|
+
function RowInteractionExamplesContent({ only }: { only?: "list" | "table" }) {
|
|
904
|
+
const { lang } = useTheme(); const ko = lang === "ko";
|
|
905
|
+
const [done, setDone] = useState(false);
|
|
906
|
+
const [selected, setSelected] = useState<string[]>([]);
|
|
907
|
+
const [detail, setDetail] = useState("");
|
|
908
|
+
const [calls, setCalls] = useState(0);
|
|
909
|
+
const [table, setTable] = useState(() => createDataTableState(5));
|
|
910
|
+
const [tableDetail, setTableDetail] = useState("");
|
|
911
|
+
const [tableCalls, setTableCalls] = useState(0);
|
|
912
|
+
const [selectionClicks, setSelectionClicks] = useState(0);
|
|
913
|
+
const [selectionActions, setSelectionActions] = useState(0);
|
|
914
|
+
const [readOnlyTable, setReadOnlyTable] = useState(() => createDataTableState(5));
|
|
915
|
+
const [linkTable, setLinkTable] = useState(() => createDataTableState(5));
|
|
916
|
+
const [selectionOnly, setSelectionOnly] = useState(false);
|
|
917
|
+
const columns = [{ key: "name", label: "Customer", width: "2fr", minWidth: "var(--input-w-md)" }, { key: "amount", label: "Expected revenue", width: "1fr", minWidth: "var(--input-w-md)" }];
|
|
918
|
+
const selectionColumns: TableRowColumn<(typeof customers)[number]>[] = [...columns, {
|
|
919
|
+
key: "action", label: "Action", width: "var(--input-w-md)", align: "center",
|
|
920
|
+
render: () => <Button variant="ghost" onClick={() => setSelectionActions(selectionActions + 1)}>Add note</Button>,
|
|
921
|
+
}];
|
|
922
|
+
return <div className={styles.examples}>
|
|
923
|
+
{only !== "table" && <>
|
|
924
|
+
<section className={styles.example} aria-label="Complete a task">
|
|
925
|
+
<h3>{"Complete a task"}</h3>
|
|
926
|
+
<ListItem selected={done} onClick={() => setDone(!done)} actionLabel={"Toggle send quote"} leading={<Checkbox aria-label={"Send quote completed"} checked={done} onChange={(e) => setDone(e.currentTarget.checked)} />}>
|
|
927
|
+
<ListItem.Title>{"Send quote"}</ListItem.Title>
|
|
928
|
+
<ListItem.Description>{"Hana Logistics · Today"}</ListItem.Description>
|
|
929
|
+
</ListItem>
|
|
930
|
+
<output aria-label="Task status">{done ? "Complete" : "Incomplete"}</output>
|
|
931
|
+
</section>
|
|
932
|
+
<section className={styles.example} aria-label="Customer detail and selection">
|
|
933
|
+
<h3>{"Customer detail and selection"}</h3>
|
|
934
|
+
<ul className={styles.list}>{customers.map((customer) => <li key={customer.id}>
|
|
935
|
+
<ListItem selected={selected.includes(customer.id)} active={detail === customer.name} actionLabel={`${customer.name} details`} onClick={() => setDetail(customer.name)} leading={<Checkbox aria-label={`${customer.name} select`} checked={selected.includes(customer.id)} onChange={(e) => setSelected(e.currentTarget.checked ? [...selected, customer.id] : selected.filter((id) => id !== customer.id))} />} trailing={<Button variant="ghost" onClick={() => setCalls(calls + 1)}>{"Log contact"}</Button>}>
|
|
936
|
+
<ListItem.Title>{customer.name}</ListItem.Title><ListItem.Description>{customer.next}</ListItem.Description>
|
|
937
|
+
</ListItem>
|
|
938
|
+
</li>)}</ul>
|
|
939
|
+
<output aria-label="Selected customers">{selected.length}</output><output aria-label="Customer details">{detail}</output><output aria-label="Contact count">{calls}</output>
|
|
940
|
+
<ListItem href="#row-example-detail" actionLabel="Customer details link" trailing={<Button variant="ghost" onClick={() => setCalls(calls + 1)}>Link action</Button>}><ListItem.Title>Customer details link</ListItem.Title></ListItem>
|
|
941
|
+
<ListItem disabled onClick={() => setDetail("Must not run")} leading={<Checkbox aria-label="Select disabled customer" />}><ListItem.Title>Disabled customer</ListItem.Title></ListItem>
|
|
942
|
+
<ListItem><ListItem.Title>Read-only status row</ListItem.Title></ListItem>
|
|
943
|
+
<div id="row-example-detail" tabIndex={-1}>{"Customer detail area"}</div>
|
|
944
|
+
</section>
|
|
945
|
+
</>}
|
|
946
|
+
{only !== "list" && <>
|
|
947
|
+
<section className={styles.example} aria-label="Deal detail and selection">
|
|
948
|
+
<h3>{"Deal detail and selection"}</h3>
|
|
949
|
+
<DataTable label="Deals example" rows={customers} columns={columns} getRowId={(row) => row.id} state={table} onStateChange={setTable} onRowClick={(row) => setTableDetail(row.name)} getRowLabel={(row) => `${row.name} deal details`} activeRowId={customers.find((row) => row.name === tableDetail)?.id} actions={() => <Button variant="ghost" onClick={() => setTableCalls(tableCalls + 1)}>{"Log contact"}</Button>} />
|
|
950
|
+
<output aria-label="Deal details">{tableDetail}</output><output aria-label="Selected deals">{table.selected.length}</output><output aria-label="Deal contacts">{tableCalls}</output>
|
|
951
|
+
</section>
|
|
952
|
+
<section className={styles.example} aria-label="Selection-only table">
|
|
953
|
+
<h3>{"Selection-only table"}</h3>
|
|
954
|
+
<div className={styles.scroll}><div role="table" aria-label="Candidates"><TableHeader columns={selectionColumns} /><TableRowSelect columns={selectionColumns} data={customers[0]} onClick={() => setSelectionClicks(selectionClicks + 1)} selected={selectionOnly} onSelectedChange={setSelectionOnly} /></div></div>
|
|
955
|
+
<output aria-label="Candidate clicks">{selectionClicks}</output><output aria-label="Candidate notes">{selectionActions}</output><output aria-label="Candidate selection">{selectionOnly ? "Selected" : "Not selected"}</output>
|
|
956
|
+
</section>
|
|
957
|
+
<section className={styles.example} aria-label="Customer navigation table"><h3>{"Selection and navigation"}</h3><DataTable label="Customer navigation example" rows={customers} columns={columns} getRowId={(row) => row.id} state={linkTable} onStateChange={setLinkTable} getRowHref={(row) => "#customer-" + row.id} getRowLabel={(row) => row.name + " open page"} /><div id="customer-hana">Hana Logistics details</div><div id="customer-on">On Retail details</div></section>
|
|
958
|
+
<section className={styles.example} aria-label="Summary without selection"><h3>{"Summary without selection"}</h3><DataTable label="Regional summary" rows={customers} columns={columns} getRowId={(row) => row.id} state={readOnlyTable} onStateChange={setReadOnlyTable} selectable={false} /></section>
|
|
959
|
+
</>}
|
|
960
|
+
</div>;
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
export function RowInteractionExamples({ only, lang = "en" }: { only?: "list" | "table"; lang?: "ko" | "en" }) {
|
|
964
|
+
return <ThemeLocaleProvider lang={lang}><RowInteractionExamplesContent only={only} /></ThemeLocaleProvider>;
|
|
965
|
+
}
|
|
966
|
+
````
|