@conscience-technology/ovenn 0.0.0-stage → 0.6.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +189 -2
- package/assets/components/AIMessage/AIMessage.module.css +149 -0
- package/assets/components/AIMessage/AIMessage.tsx +106 -0
- package/assets/components/AIMessage/index.ts +2 -0
- package/assets/components/Accordion/Accordion.module.css +262 -0
- package/assets/components/Accordion/Accordion.tsx +209 -0
- package/assets/components/Accordion/index.ts +7 -0
- package/assets/components/AppFrame/AppFrame.module.css +198 -0
- package/assets/components/AppFrame/AppFrame.tsx +93 -0
- package/assets/components/AppFrame/index.ts +6 -0
- package/assets/components/AttachmentItem/AttachmentItem.module.css +118 -0
- package/assets/components/AttachmentItem/AttachmentItem.tsx +185 -0
- package/assets/components/AttachmentItem/index.ts +6 -0
- package/assets/components/AttachmentThumb/AttachmentThumb.module.css +137 -0
- package/assets/components/AttachmentThumb/AttachmentThumb.tsx +102 -0
- package/assets/components/AttachmentThumb/index.ts +2 -0
- package/assets/components/Avatar/Avatar.module.css +201 -0
- package/assets/components/Avatar/Avatar.tsx +283 -0
- package/assets/components/Avatar/index.ts +9 -0
- package/assets/components/AvatarUpload/AvatarUpload.module.css +82 -0
- package/assets/components/AvatarUpload/AvatarUpload.tsx +155 -0
- package/assets/components/AvatarUpload/index.ts +2 -0
- package/assets/components/Badge/Badge.module.css +152 -0
- package/assets/components/Badge/Badge.tsx +109 -0
- package/assets/components/Badge/index.ts +2 -0
- package/assets/components/BrandSet/BrandSetController.tsx +56 -0
- package/assets/components/BrandSet/index.ts +14 -0
- package/assets/components/BrandSet/resolve.ts +10 -0
- package/assets/components/BrandSet/types.ts +43 -0
- package/assets/components/Breadcrumb/Breadcrumb.module.css +277 -0
- package/assets/components/Breadcrumb/Breadcrumb.tsx +352 -0
- package/assets/components/Breadcrumb/index.ts +8 -0
- package/assets/components/Bubble/Bubble.module.css +65 -0
- package/assets/components/Bubble/Bubble.tsx +63 -0
- package/assets/components/Bubble/index.ts +2 -0
- package/assets/components/Button/Button.module.css +336 -0
- package/assets/components/Button/Button.tsx +217 -0
- package/assets/components/Button/index.ts +2 -0
- package/assets/components/ButtonGroup/ButtonGroup.tsx +22 -0
- package/assets/components/ButtonGroup/index.ts +5 -0
- package/assets/components/Callout/Callout.module.css +146 -0
- package/assets/components/Callout/Callout.tsx +207 -0
- package/assets/components/Callout/index.ts +2 -0
- package/assets/components/CanvasNode/CanvasNode.module.css +110 -0
- package/assets/components/CanvasNode/CanvasNode.tsx +77 -0
- package/assets/components/CanvasNode/index.ts +2 -0
- package/assets/components/CanvasNode/tokens.css +26 -0
- package/assets/components/Card/Card.module.css +122 -0
- package/assets/components/Card/Card.tsx +88 -0
- package/assets/components/Card/index.ts +2 -0
- package/assets/components/ChatInput/ChatInput.module.css +373 -0
- package/assets/components/ChatInput/ChatInput.tsx +362 -0
- package/assets/components/ChatInput/ModelSelector.tsx +48 -0
- package/assets/components/ChatInput/SendButton.tsx +72 -0
- package/assets/components/ChatInput/index.ts +12 -0
- package/assets/components/Checkbox/Checkbox.module.css +147 -0
- package/assets/components/Checkbox/Checkbox.tsx +44 -0
- package/assets/components/Checkbox/index.ts +2 -0
- package/assets/components/CheckboxCard/CheckboxCard.module.css +177 -0
- package/assets/components/CheckboxCard/CheckboxCard.tsx +83 -0
- package/assets/components/CheckboxCard/index.ts +2 -0
- package/assets/components/Chip/Chip.module.css +219 -0
- package/assets/components/Chip/Chip.tsx +219 -0
- package/assets/components/Chip/index.ts +2 -0
- package/assets/components/Code/Code.module.css +25 -0
- package/assets/components/Code/Code.tsx +26 -0
- package/assets/components/Code/index.ts +2 -0
- package/assets/components/CodeBlock/CodeBlock.module.css +255 -0
- package/assets/components/CodeBlock/CodeBlock.tsx +283 -0
- package/assets/components/CodeBlock/copy-code.ts +15 -0
- package/assets/components/CodeBlock/index.ts +2 -0
- package/assets/components/ColorArea/ColorArea.module.css +145 -0
- package/assets/components/ColorArea/ColorArea.tsx +156 -0
- package/assets/components/ColorArea/index.ts +2 -0
- package/assets/components/ColorField/ColorField.module.css +195 -0
- package/assets/components/ColorField/ColorField.tsx +372 -0
- package/assets/components/ColorField/index.ts +2 -0
- package/assets/components/ColorSlider/ColorSlider.module.css +167 -0
- package/assets/components/ColorSlider/ColorSlider.tsx +165 -0
- package/assets/components/ColorSlider/index.ts +15 -0
- package/assets/components/ColorSwatch/ColorSwatch.module.css +35 -0
- package/assets/components/ColorSwatch/ColorSwatch.tsx +69 -0
- package/assets/components/ColorSwatch/index.ts +2 -0
- package/assets/components/ColorSwatchPicker/ColorSwatchPicker.module.css +114 -0
- package/assets/components/ColorSwatchPicker/ColorSwatchPicker.tsx +183 -0
- package/assets/components/ColorSwatchPicker/index.ts +15 -0
- package/assets/components/Combobox/Combobox.module.css +13 -0
- package/assets/components/Combobox/Combobox.tsx +107 -0
- package/assets/components/Combobox/index.ts +2 -0
- package/assets/components/CommandPalette/CommandPalette.module.css +269 -0
- package/assets/components/CommandPalette/CommandPalette.tsx +423 -0
- package/assets/components/CommandPalette/index.ts +9 -0
- package/assets/components/CommandPalette/useCommandPaletteHotkey.ts +49 -0
- package/assets/components/ContextMenu/ContextMenu.module.css +118 -0
- package/assets/components/ContextMenu/ContextMenu.tsx +415 -0
- package/assets/components/ContextMenu/index.ts +9 -0
- package/assets/components/ControlGroup/ControlGroup.module.css +313 -0
- package/assets/components/ControlGroup/ControlGroup.tsx +69 -0
- package/assets/components/ControlGroup/context.tsx +12 -0
- package/assets/components/ControlGroup/index.ts +3 -0
- package/assets/components/ControlGroup/size.ts +9 -0
- package/assets/components/DataTable/DataTable.module.css +55 -0
- package/assets/components/DataTable/DataTable.tsx +137 -0
- package/assets/components/DataTable/index.ts +4 -0
- package/assets/components/DataTable/state.ts +34 -0
- package/assets/components/DatePicker/Calendar.tsx +485 -0
- package/assets/components/DatePicker/DESIGN_NOTES.md +106 -0
- package/assets/components/DatePicker/DESIGN_NOTES_TIME.md +125 -0
- package/assets/components/DatePicker/DateField.tsx +303 -0
- package/assets/components/DatePicker/DatePicker.module.css +590 -0
- package/assets/components/DatePicker/DatePicker.tsx +520 -0
- package/assets/components/DatePicker/TimeSelector.tsx +77 -0
- package/assets/components/DatePicker/index.ts +11 -0
- package/assets/components/DatePicker/presets.ts +84 -0
- package/assets/components/DatePicker/utils.ts +214 -0
- package/assets/components/Disclosure/Disclosure.module.css +73 -0
- package/assets/components/Disclosure/Disclosure.tsx +129 -0
- package/assets/components/Disclosure/index.ts +6 -0
- package/assets/components/Drawer/Drawer.module.css +190 -0
- package/assets/components/Drawer/Drawer.tsx +226 -0
- package/assets/components/Drawer/index.ts +15 -0
- package/assets/components/DropdownMenu/DropdownMenu.module.css +26 -0
- package/assets/components/DropdownMenu/DropdownMenu.tsx +395 -0
- package/assets/components/DropdownMenu/index.ts +9 -0
- package/assets/components/EmptyState/EmptyState.module.css +102 -0
- package/assets/components/EmptyState/EmptyState.tsx +80 -0
- package/assets/components/EmptyState/index.ts +2 -0
- package/assets/components/EventChip/EventChip.module.css +76 -0
- package/assets/components/EventChip/EventChip.tsx +47 -0
- package/assets/components/EventChip/index.ts +2 -0
- package/assets/components/EventListItem/EventListItem.module.css +220 -0
- package/assets/components/EventListItem/EventListItem.tsx +226 -0
- package/assets/components/EventListItem/index.ts +8 -0
- package/assets/components/FileIcon/FileIcon.module.css +76 -0
- package/assets/components/FileIcon/FileIcon.tsx +142 -0
- package/assets/components/FileIcon/fileExtMap.ts +166 -0
- package/assets/components/FileIcon/index.ts +9 -0
- package/assets/components/FileUpload/FileUpload.module.css +12 -0
- package/assets/components/FileUpload/FileUpload.tsx +100 -0
- package/assets/components/FileUpload/index.ts +2 -0
- package/assets/components/FileUpload/utils.ts +8 -0
- package/assets/components/GalleryItem/GalleryItem.module.css +220 -0
- package/assets/components/GalleryItem/GalleryItem.tsx +163 -0
- package/assets/components/GalleryItem/index.ts +7 -0
- package/assets/components/GeneratedImage/GeneratedImage.module.css +91 -0
- package/assets/components/GeneratedImage/GeneratedImage.tsx +84 -0
- package/assets/components/GeneratedImage/index.ts +5 -0
- package/assets/components/Hint/Hint.module.css +75 -0
- package/assets/components/Hint/Hint.tsx +89 -0
- package/assets/components/Hint/index.ts +2 -0
- package/assets/components/Icon/Icon.tsx +1478 -0
- package/assets/components/Icon/context.tsx +39 -0
- package/assets/components/Icon/index.ts +4 -0
- package/assets/components/IconButton/IconButton.module.css +116 -0
- package/assets/components/IconButton/IconButton.tsx +113 -0
- package/assets/components/IconButton/index.ts +2 -0
- package/assets/components/Input/Input.module.css +357 -0
- package/assets/components/Input/Input.tsx +424 -0
- package/assets/components/Input/index.ts +2 -0
- package/assets/components/Kanban/Kanban.module.css +347 -0
- package/assets/components/Kanban/Kanban.tsx +371 -0
- package/assets/components/Kanban/index.ts +10 -0
- package/assets/components/ListItem/ListItem.module.css +232 -0
- package/assets/components/ListItem/ListItem.tsx +262 -0
- package/assets/components/ListItem/index.ts +9 -0
- package/assets/components/MenuItem/MenuItem.module.css +601 -0
- package/assets/components/MenuItem/MenuItem.tsx +704 -0
- package/assets/components/MenuItem/index.ts +8 -0
- package/assets/components/MessageActions/MessageActions.module.css +43 -0
- package/assets/components/MessageActions/MessageActions.tsx +114 -0
- package/assets/components/MessageActions/index.ts +6 -0
- package/assets/components/MessageQuote/MessageQuote.module.css +29 -0
- package/assets/components/MessageQuote/MessageQuote.tsx +33 -0
- package/assets/components/MessageQuote/index.ts +2 -0
- package/assets/components/MessageSources/MessageSources.module.css +58 -0
- package/assets/components/MessageSources/MessageSources.tsx +60 -0
- package/assets/components/MessageSources/index.ts +2 -0
- package/assets/components/MessageState/MessageState.module.css +118 -0
- package/assets/components/MessageState/MessageState.tsx +150 -0
- package/assets/components/MessageState/index.ts +2 -0
- package/assets/components/MessageTable/MessageTable.module.css +59 -0
- package/assets/components/MessageTable/MessageTable.tsx +21 -0
- package/assets/components/MessageTable/index.ts +2 -0
- package/assets/components/MetricCard/MetricCard.module.css +153 -0
- package/assets/components/MetricCard/MetricCard.tsx +140 -0
- package/assets/components/MetricCard/index.ts +2 -0
- package/assets/components/Modal/Modal.module.css +285 -0
- package/assets/components/Modal/Modal.tsx +398 -0
- package/assets/components/Modal/index.ts +22 -0
- package/assets/components/MultiSelect/MultiSelect.tsx +7 -0
- package/assets/components/MultiSelect/index.ts +2 -0
- package/assets/components/Onboarding/DocsIndex.tsx +102 -0
- package/assets/components/Onboarding/LayoutBuilder.tsx +204 -0
- package/assets/components/Onboarding/Onboarding.module.css +1561 -0
- package/assets/components/Onboarding/OnboardingAxisPanel.tsx +516 -0
- package/assets/components/Onboarding/OnboardingPage.tsx +1481 -0
- package/assets/components/Onboarding/PresetsGallery.tsx +56 -0
- package/assets/components/Onboarding/actions.ts +524 -0
- package/assets/components/Onboarding/index.ts +8 -0
- package/assets/components/Onboarding/palette.css +40 -0
- package/assets/components/Onboarding/wizardData.ts +529 -0
- package/assets/components/PageHeader/PageHeader.module.css +119 -0
- package/assets/components/PageHeader/PageHeader.tsx +126 -0
- package/assets/components/PageHeader/index.ts +2 -0
- package/assets/components/Pagination/Pagination.module.css +132 -0
- package/assets/components/Pagination/Pagination.tsx +294 -0
- package/assets/components/Pagination/index.ts +6 -0
- package/assets/components/ProgressBar/ProgressBar.module.css +127 -0
- package/assets/components/ProgressBar/ProgressBar.tsx +90 -0
- package/assets/components/ProgressBar/index.ts +7 -0
- package/assets/components/QuotationBar/QuotationBar.module.css +61 -0
- package/assets/components/QuotationBar/QuotationBar.tsx +60 -0
- package/assets/components/QuotationBar/index.ts +2 -0
- package/assets/components/Radio/Radio.module.css +123 -0
- package/assets/components/Radio/Radio.tsx +39 -0
- package/assets/components/Radio/index.ts +2 -0
- package/assets/components/RadioCard/RadioCard.module.css +208 -0
- package/assets/components/RadioCard/RadioCard.tsx +164 -0
- package/assets/components/RadioCard/index.ts +2 -0
- package/assets/components/SegmentedChart/SegmentedChart.module.css +221 -0
- package/assets/components/SegmentedChart/SegmentedChart.tsx +104 -0
- package/assets/components/SegmentedChart/index.ts +2 -0
- package/assets/components/Select/Select.module.css +161 -0
- package/assets/components/Select/Select.tsx +450 -0
- package/assets/components/Select/index.ts +10 -0
- package/assets/components/Shortcut/Shortcut.module.css +77 -0
- package/assets/components/Shortcut/Shortcut.tsx +206 -0
- package/assets/components/Shortcut/index.ts +2 -0
- package/assets/components/Sidebar/Sidebar.module.css +406 -0
- package/assets/components/Sidebar/Sidebar.tsx +585 -0
- package/assets/components/Sidebar/index.ts +7 -0
- package/assets/components/Slider/Slider.module.css +134 -0
- package/assets/components/Slider/Slider.tsx +99 -0
- package/assets/components/Slider/index.ts +2 -0
- package/assets/components/Spinner/LottiePlayer.tsx +179 -0
- package/assets/components/Spinner/Spinner.module.css +205 -0
- package/assets/components/Spinner/Spinner.tsx +133 -0
- package/assets/components/Spinner/index.ts +10 -0
- package/assets/components/Spinner/lottieColor.ts +166 -0
- package/assets/components/Spinner/lottieManifest.ts +100 -0
- package/assets/components/Stepper/Stepper.module.css +330 -0
- package/assets/components/Stepper/Stepper.tsx +244 -0
- package/assets/components/Stepper/index.ts +2 -0
- package/assets/components/Switch/Switch.module.css +163 -0
- package/assets/components/Switch/Switch.tsx +73 -0
- package/assets/components/Switch/index.ts +2 -0
- package/assets/components/TabStrip/TabStrip.module.css +358 -0
- package/assets/components/TabStrip/TabStrip.tsx +404 -0
- package/assets/components/TabStrip/index.ts +7 -0
- package/assets/components/TableCell/TableCell.module.css +130 -0
- package/assets/components/TableCell/TableCellAvatar.tsx +66 -0
- package/assets/components/TableCell/TableCellBadge.tsx +26 -0
- package/assets/components/TableCell/TableCellImage.tsx +49 -0
- package/assets/components/TableCell/TableCellMeter.tsx +55 -0
- package/assets/components/TableCell/TableCellNumber.tsx +43 -0
- package/assets/components/TableCell/TableCellText.tsx +33 -0
- package/assets/components/TableCell/index.ts +19 -0
- package/assets/components/TableHeader/TableHeader.module.css +351 -0
- package/assets/components/TableHeader/TableHeader.tsx +658 -0
- package/assets/components/TableHeader/index.ts +9 -0
- package/assets/components/TableRow/TableRow.module.css +352 -0
- package/assets/components/TableRow/TableRow.tsx +292 -0
- package/assets/components/TableRow/index.ts +8 -0
- package/assets/components/TableRowEdit/TableRowEdit.module.css +162 -0
- package/assets/components/TableRowEdit/TableRowEdit.tsx +279 -0
- package/assets/components/TableRowEdit/index.ts +2 -0
- package/assets/components/TableRowSelect/TableRowSelect.module.css +23 -0
- package/assets/components/TableRowSelect/TableRowSelect.tsx +173 -0
- package/assets/components/TableRowSelect/index.ts +2 -0
- package/assets/components/TableToolbar/TableToolbar.module.css +37 -0
- package/assets/components/TableToolbar/TableToolbar.tsx +105 -0
- package/assets/components/TableToolbar/index.ts +5 -0
- package/assets/components/Tabs/Tabs.module.css +372 -0
- package/assets/components/Tabs/Tabs.tsx +517 -0
- package/assets/components/Tabs/index.ts +9 -0
- package/assets/components/TemplateBoundary/TemplateBoundary.module.css +4 -0
- package/assets/components/TemplateBoundary/TemplateBoundary.tsx +50 -0
- package/assets/components/TemplateBoundary/index.ts +3 -0
- package/assets/components/TemplateBoundary/types.ts +23 -0
- package/assets/components/Textarea/Textarea.module.css +343 -0
- package/assets/components/Textarea/Textarea.tsx +438 -0
- package/assets/components/Textarea/index.ts +7 -0
- package/assets/components/ThemeController.tsx +369 -0
- package/assets/components/TimePicker/TimePicker.module.css +112 -0
- package/assets/components/TimePicker/TimePicker.tsx +403 -0
- package/assets/components/TimePicker/index.ts +8 -0
- package/assets/components/TimePicker/utils.ts +116 -0
- package/assets/components/Toast/Toast.module.css +332 -0
- package/assets/components/Toast/Toast.tsx +310 -0
- package/assets/components/Toast/index.ts +16 -0
- package/assets/components/Toolbar/Toolbar.module.css +128 -0
- package/assets/components/Toolbar/Toolbar.tsx +186 -0
- package/assets/components/Toolbar/index.ts +7 -0
- package/assets/components/Tooltip/Tooltip.module.css +42 -0
- package/assets/components/Tooltip/Tooltip.tsx +332 -0
- package/assets/components/Tooltip/index.ts +2 -0
- package/assets/components/TopLoader/TopLoader.module.css +64 -0
- package/assets/components/TopLoader/TopLoader.tsx +58 -0
- package/assets/components/TopLoader/index.ts +2 -0
- package/assets/components/Topbar/Topbar.module.css +54 -0
- package/assets/components/Topbar/Topbar.tsx +102 -0
- package/assets/components/Topbar/index.ts +2 -0
- package/assets/components/TreeNav/TreeNav.module.css +32 -0
- package/assets/components/TreeNav/TreeNav.tsx +130 -0
- package/assets/components/TreeNav/index.ts +2 -0
- package/assets/components/UserMessage/UserMessage.module.css +47 -0
- package/assets/components/UserMessage/UserMessage.tsx +66 -0
- package/assets/components/UserMessage/index.ts +2 -0
- package/assets/components/_cn.ts +3 -0
- package/assets/components/_color.ts +75 -0
- package/assets/components/_data.ts +607 -0
- package/assets/components/_rowInteraction.ts +16 -0
- package/assets/components/_utils.css +130 -0
- package/assets/components/app-shell.css +17 -0
- package/assets/components/axisOptions.ts +15 -0
- package/assets/components/component-registry.json +914 -0
- package/assets/components/index.ts +102 -0
- package/assets/components/reset.css +77 -0
- package/assets/components/themeBootScript.ts +124 -0
- package/assets/components/tokens.css +1121 -0
- package/assets/prompts/ASSEMBLY.md +70 -0
- package/assets/prompts/CASCADE.md +49 -0
- package/assets/prompts/CATALOG.md +127 -0
- package/assets/prompts/GUIDE.md +307 -0
- package/assets/prompts/MEMORY.md +202 -0
- package/assets/prompts/OVERRIDE.md +30 -0
- package/assets/prompts/PRINCIPLES.md +114 -0
- package/assets/prompts/SLOTS.md +194 -0
- package/assets/prompts/WORKFLOW_DESIGN.md +156 -0
- package/assets/prompts/axes/density.md +42 -0
- package/assets/prompts/axes/font.md +30 -0
- package/assets/prompts/axes/icon.md +57 -0
- package/assets/prompts/axes/mode.md +52 -0
- package/assets/prompts/axes/motion.md +77 -0
- package/assets/prompts/axes/palette.md +50 -0
- package/assets/prompts/axes/shape.md +33 -0
- package/assets/prompts/axes/voice.md +57 -0
- package/assets/prompts/brand-sets/_SCHEMA.md +27 -0
- package/assets/prompts/components/README.md +84 -0
- package/assets/prompts/components/_variants.md +86 -0
- package/assets/prompts/components/accordion.md +151 -0
- package/assets/prompts/components/ai-message.md +53 -0
- package/assets/prompts/components/app-frame.md +141 -0
- package/assets/prompts/components/attachment-item.md +88 -0
- package/assets/prompts/components/attachment-thumb.md +54 -0
- package/assets/prompts/components/avatar-upload.md +62 -0
- package/assets/prompts/components/avatar.md +106 -0
- package/assets/prompts/components/badge.md +123 -0
- package/assets/prompts/components/breadcrumb.md +123 -0
- package/assets/prompts/components/bubble.md +61 -0
- package/assets/prompts/components/button-group.md +35 -0
- package/assets/prompts/components/button.md +133 -0
- package/assets/prompts/components/callout.md +98 -0
- package/assets/prompts/components/canvas-node.md +63 -0
- package/assets/prompts/components/card.md +167 -0
- package/assets/prompts/components/chat-input.md +103 -0
- package/assets/prompts/components/checkbox-card.md +72 -0
- package/assets/prompts/components/checkbox.md +98 -0
- package/assets/prompts/components/chip.md +163 -0
- package/assets/prompts/components/code-block.md +94 -0
- package/assets/prompts/components/code.md +62 -0
- package/assets/prompts/components/color-area.md +95 -0
- package/assets/prompts/components/color-field.md +108 -0
- package/assets/prompts/components/color-slider.md +108 -0
- package/assets/prompts/components/color-swatch-picker.md +96 -0
- package/assets/prompts/components/color-swatch.md +85 -0
- package/assets/prompts/components/combobox.md +35 -0
- package/assets/prompts/components/command-palette.md +193 -0
- package/assets/prompts/components/context-menu.md +150 -0
- package/assets/prompts/components/control-group.md +67 -0
- package/assets/prompts/components/data-table.md +81 -0
- package/assets/prompts/components/date-picker.md +146 -0
- package/assets/prompts/components/disclosure.md +55 -0
- package/assets/prompts/components/drawer.md +141 -0
- package/assets/prompts/components/dropdown-menu.md +165 -0
- package/assets/prompts/components/empty-state.md +74 -0
- package/assets/prompts/components/event-chip.md +81 -0
- package/assets/prompts/components/event-list-item.md +108 -0
- package/assets/prompts/components/file-icon.md +83 -0
- package/assets/prompts/components/file-upload.md +35 -0
- package/assets/prompts/components/gallery-item.md +163 -0
- package/assets/prompts/components/generated-image.md +85 -0
- package/assets/prompts/components/hint.md +94 -0
- package/assets/prompts/components/icon-button.md +99 -0
- package/assets/prompts/components/icon.md +79 -0
- package/assets/prompts/components/input.md +134 -0
- package/assets/prompts/components/kanban.md +172 -0
- package/assets/prompts/components/list-item.md +325 -0
- package/assets/prompts/components/menu-item.md +247 -0
- package/assets/prompts/components/message-actions.md +54 -0
- package/assets/prompts/components/message-quote.md +34 -0
- package/assets/prompts/components/message-sources.md +46 -0
- package/assets/prompts/components/message-state.md +61 -0
- package/assets/prompts/components/message-table.md +42 -0
- package/assets/prompts/components/metric-card.md +137 -0
- package/assets/prompts/components/modal.md +235 -0
- package/assets/prompts/components/multi-select.md +31 -0
- package/assets/prompts/components/onboarding.md +51 -0
- package/assets/prompts/components/page-header.md +161 -0
- package/assets/prompts/components/pagination.md +99 -0
- package/assets/prompts/components/progress-bar.md +75 -0
- package/assets/prompts/components/quotation-bar.md +44 -0
- package/assets/prompts/components/radio-card.md +146 -0
- package/assets/prompts/components/radio.md +56 -0
- package/assets/prompts/components/segmented-chart.md +65 -0
- package/assets/prompts/components/select.md +145 -0
- package/assets/prompts/components/shortcut.md +81 -0
- package/assets/prompts/components/sidebar.md +528 -0
- package/assets/prompts/components/slider.md +111 -0
- package/assets/prompts/components/spinner.md +124 -0
- package/assets/prompts/components/stepper.md +108 -0
- package/assets/prompts/components/switch.md +103 -0
- package/assets/prompts/components/tab-strip.md +162 -0
- package/assets/prompts/components/table-cell.md +65 -0
- package/assets/prompts/components/table-header.md +181 -0
- package/assets/prompts/components/table-row-edit.md +144 -0
- package/assets/prompts/components/table-row-select.md +90 -0
- package/assets/prompts/components/table-row.md +175 -0
- package/assets/prompts/components/table-toolbar.md +94 -0
- package/assets/prompts/components/tabs.md +134 -0
- package/assets/prompts/components/textarea.md +114 -0
- package/assets/prompts/components/time-picker.md +86 -0
- package/assets/prompts/components/toast.md +155 -0
- package/assets/prompts/components/toolbar.md +86 -0
- package/assets/prompts/components/tooltip.md +76 -0
- package/assets/prompts/components/top-loader.md +64 -0
- package/assets/prompts/components/topbar.md +177 -0
- package/assets/prompts/components/tree-nav.md +77 -0
- package/assets/prompts/components/user-message.md +50 -0
- package/assets/prompts/design-examples/README.md +57 -0
- package/assets/prompts/design-examples/catalog.json +1 -0
- package/assets/prompts/primitives/emerge.md +43 -0
- package/assets/prompts/primitives/fade.md +31 -0
- package/assets/prompts/primitives/mobile.md +53 -0
- package/assets/prompts/primitives/scale.md +32 -0
- package/assets/prompts/primitives/scroll.md +170 -0
- package/assets/prompts/primitives/slide.md +31 -0
- package/assets/prompts/recipes/README.md +104 -0
- package/assets/prompts/recipes/card-row.md +39 -0
- package/assets/prompts/recipes/form-footer.md +76 -0
- package/assets/prompts/recipes/meta-line.md +61 -0
- package/assets/prompts/recipes/page-banner.md +121 -0
- package/assets/prompts/recipes/page-header.md +107 -0
- package/assets/prompts/recipes/section-header.md +90 -0
- package/assets/prompts/templates/README.md +9 -0
- package/assets/prompts/templates/ains.md +630 -0
- package/assets/prompts/templates/aurora.md +439 -0
- package/assets/prompts/templates/glass-button.md +336 -0
- package/assets/prompts/templates/minimal.md +207 -0
- package/assets/prompts/templates/workspace.md +346 -0
- package/assets/prompts/themes/_SCHEMA.md +135 -0
- package/assets/prompts/themes/_TEMPLATE.md +73 -0
- package/assets/prompts/themes/expressive.md +118 -0
- package/assets/prompts/themes/pure.md +87 -0
- package/assets/prompts/themes/spare.md +73 -0
- package/assets/prompts/tokens/breakpoint.md +29 -0
- package/assets/prompts/tokens/color.md +103 -0
- package/assets/prompts/tokens/radius.md +33 -0
- package/assets/prompts/tokens/shadow.md +35 -0
- package/assets/prompts/tokens/spacing.md +96 -0
- package/assets/prompts/tokens/typography.md +67 -0
- package/assets/prompts/tokens/z-index.md +35 -0
- package/assets/public/expressive.png +0 -0
- package/assets/public/pure.png +0 -0
- package/assets/public/spare.png +0 -0
- package/assets/skills/ovenn/SKILL.md +12 -0
- package/assets/skills/ovenn-component/SKILL.md +12 -0
- package/assets/skills/ovenn-page/SKILL.md +12 -0
- package/assets/skills/ovenn-theme/SKILL.md +12 -0
- package/assets/skills/ovenn-validate/SKILL.md +14 -0
- package/assets/skills/ovenn-validate/fixtures/clean/Clean.module.css +12 -0
- package/assets/skills/ovenn-validate/fixtures/clean/Clean.tsx +9 -0
- package/assets/skills/ovenn-validate/scripts/lib/component-usage.js +112 -0
- package/assets/skills/ovenn-validate/scripts/lib/source-graph.js +15 -0
- package/assets/skills/ovenn-validate/scripts/lib/source-utils.mjs +25 -0
- package/assets/skills/ovenn-validate/scripts/lib/source-utils.test.mjs +52 -0
- package/assets/skills/ovenn-validate/scripts/rules/doc-sync.mjs +151 -0
- package/assets/skills/ovenn-validate/scripts/rules/doc-sync.test.mjs +91 -0
- package/assets/skills/ovenn-validate/scripts/rules/ghost-tokens.mjs +69 -0
- package/assets/skills/ovenn-validate/scripts/rules/ghost-tokens.test.mjs +52 -0
- package/assets/skills/ovenn-validate/scripts/rules/hardcoded.mjs +145 -0
- package/assets/skills/ovenn-validate/scripts/rules/hardcoded.test.mjs +83 -0
- package/assets/skills/ovenn-validate/scripts/rules/memory-rules.mjs +252 -0
- package/assets/skills/ovenn-validate/scripts/rules/memory-rules.test.mjs +131 -0
- package/assets/skills/ovenn-validate/scripts/validate.mjs +169 -0
- package/assets/skills/ovenn-wireframe/SKILL.md +12 -0
- package/bin/ovenn.js +85 -0
- package/package.json +139 -4
- package/src/commands/info.js +217 -0
- package/src/commands/init.js +386 -0
- package/src/commands/update.js +65 -0
- package/src/utils/agents.js +83 -0
- package/src/utils/assets.js +51 -0
- package/src/utils/client-bridges.js +32 -0
- package/src/utils/component-usage.js +112 -0
- package/src/utils/deps.js +59 -0
- package/src/utils/design-examples.js +101 -0
- package/src/utils/design-workflow.js +155 -0
- package/src/utils/detect.js +59 -0
- package/src/utils/diff.js +52 -0
- package/src/utils/doctor.js +47 -0
- package/src/utils/hash.js +16 -0
- package/src/utils/launch.js +94 -0
- package/src/utils/log.js +41 -0
- package/src/utils/managed-assets.js +50 -0
- package/src/utils/mcp-client.js +47 -0
- package/src/utils/meta.js +73 -0
- package/src/utils/patch.js +334 -0
- package/src/utils/prompt.js +28 -0
- package/src/utils/source-graph.js +15 -0
- package/src/utils/update-transaction.js +79 -0
|
@@ -0,0 +1,1481 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useEffect, useMemo, useState } from "react";
|
|
4
|
+
import { Badge } from "../Badge";
|
|
5
|
+
import { Button } from "../Button";
|
|
6
|
+
import { Icon } from "../Icon";
|
|
7
|
+
import { Chip } from "../Chip";
|
|
8
|
+
import { Input } from "../Input";
|
|
9
|
+
import { CheckboxCard } from "../CheckboxCard";
|
|
10
|
+
import { Stepper } from "../Stepper";
|
|
11
|
+
import { isValidHex, normalizeHex } from "../_color";
|
|
12
|
+
import { paletteSetPresets, type PaletteSet } from "../_data";
|
|
13
|
+
import { useTheme } from "../ThemeController";
|
|
14
|
+
import { OnboardingAxisPanel } from "./OnboardingAxisPanel";
|
|
15
|
+
import { applyOnboarding, checkExistingFiles } from "./actions";
|
|
16
|
+
import { PresetsGallery } from "./PresetsGallery";
|
|
17
|
+
import { LayoutBuilder } from "./LayoutBuilder";
|
|
18
|
+
import { DocsIndex } from "./DocsIndex";
|
|
19
|
+
import {
|
|
20
|
+
getDensityChoices,
|
|
21
|
+
getLayoutChoices,
|
|
22
|
+
getPaletteChoices,
|
|
23
|
+
getThemeChoices,
|
|
24
|
+
getVibeChoices,
|
|
25
|
+
THEME_PRESETS,
|
|
26
|
+
THEME_VIBE_FALLBACK,
|
|
27
|
+
type DensityChoiceId,
|
|
28
|
+
type Lang,
|
|
29
|
+
type LayoutId,
|
|
30
|
+
type ThemeId,
|
|
31
|
+
type VibeId,
|
|
32
|
+
} from "./wizardData";
|
|
33
|
+
import styles from "./Onboarding.module.css";
|
|
34
|
+
import "./palette.css";
|
|
35
|
+
|
|
36
|
+
type StepKey = "theme" | "vibe" | "color" | "density" | "layout" | "summary";
|
|
37
|
+
|
|
38
|
+
const LABELS = {
|
|
39
|
+
ko: {
|
|
40
|
+
steps: {
|
|
41
|
+
theme: { title: "디자인 스타일", hint: "시작 번들. 축 디폴트 + DESIGN.md가 함께 적용." },
|
|
42
|
+
vibe: { title: "프로덕트 분위기", hint: "코너 · 모션 · 강조색이 세트로 결정." },
|
|
43
|
+
density: { title: "정보 밀도", hint: "한 화면에 얼마나 빽빽하게 담을지." },
|
|
44
|
+
color: { title: "컬러 & 톤", hint: "팔레트 선택 + 브랜드 색." },
|
|
45
|
+
layout: { title: "레이아웃", hint: "사이드바 · 탑바 조합." },
|
|
46
|
+
summary: { title: "요약 & 적용", hint: "선택을 확인하고 프로젝트에 반영." },
|
|
47
|
+
},
|
|
48
|
+
stepTitle: {
|
|
49
|
+
theme: "디자인 스타일을 적용할까요?",
|
|
50
|
+
vibe: "이 프로덕트는 어떤 톤인가요?",
|
|
51
|
+
color: "컬러는 어떻게 갈까요?",
|
|
52
|
+
density: "화면에 정보가 얼마나 많나요?",
|
|
53
|
+
layout: "어떤 레이아웃이 어울릴까요?",
|
|
54
|
+
summary: "이렇게 설정할게요",
|
|
55
|
+
},
|
|
56
|
+
stepLead: {
|
|
57
|
+
theme:
|
|
58
|
+
"스타일을 고르면 축 디폴트와 DESIGN.md가 함께 적용돼요. 축은 뒤에서 자유롭게 바꿀 수 있어요.",
|
|
59
|
+
vibe: "가장 가까운 하나만 골라주세요. Shape · Motion · Icon Weight가 세트로 결정돼요.",
|
|
60
|
+
color:
|
|
61
|
+
"먼저 팔레트를 고르고, 그 다음 브랜드 색을 슬라이더로 조정하거나 hex로 직접 넣어주세요.",
|
|
62
|
+
density: "한 화면에 담을 정보량. Density 축이 결정돼요.",
|
|
63
|
+
layout: "쓰임새에 맞는 사이드바·탑바 조합.",
|
|
64
|
+
summary:
|
|
65
|
+
"선택을 확인하고 프로젝트에 적용하세요. 언제든 자유 조정으로 세부 축을 바꿀 수 있어요.",
|
|
66
|
+
},
|
|
67
|
+
back: "Back",
|
|
68
|
+
next: "Next",
|
|
69
|
+
applyThisSetup: "이 설정 적용",
|
|
70
|
+
applyError: {
|
|
71
|
+
emptySelection: "선택값이 비어있습니다",
|
|
72
|
+
exception: (msg: string) => `적용 중 예외: ${msg}`,
|
|
73
|
+
unknown: (msg: string) => `적용 중 알 수 없는 오류: ${msg}`,
|
|
74
|
+
},
|
|
75
|
+
dialog: {
|
|
76
|
+
overwriteTitle: "기존 설정을 덮어쓸까요?",
|
|
77
|
+
applyTitle: "이 설정을 프로젝트에 적용할까요?",
|
|
78
|
+
overwriteLead: (
|
|
79
|
+
<>
|
|
80
|
+
이미 다음 파일이 존재합니다. 적용하면 <strong>덮어쓰여집니다</strong>.
|
|
81
|
+
커밋되지 않은 변경이 있는지 확인하세요.
|
|
82
|
+
</>
|
|
83
|
+
),
|
|
84
|
+
applyLead:
|
|
85
|
+
"프로젝트 루트에 다음 두 파일이 생성됩니다. 모두 로컬 파일 작업이고 되돌릴 수 있어요.",
|
|
86
|
+
configOverwrite: "기존 파일 덮어씀 · 축 값 JSON",
|
|
87
|
+
configNew: "축 값 JSON (AI 에이전트·ThemeController가 참조)",
|
|
88
|
+
designOverwrite: "기존 파일 덮어씀 · 테마·축 산문 요약",
|
|
89
|
+
designNew: "테마·축 산문 요약",
|
|
90
|
+
cancel: "취소",
|
|
91
|
+
overwriteApply: "덮어쓰고 적용",
|
|
92
|
+
apply: "적용",
|
|
93
|
+
applyingTitle: "적용 중",
|
|
94
|
+
applyingLead: "파일을 쓰는 중입니다.",
|
|
95
|
+
doneTitle: "적용 완료",
|
|
96
|
+
doneLead: "다음 파일이 생성/수정됐어요.",
|
|
97
|
+
doneTail: (
|
|
98
|
+
<>
|
|
99
|
+
이제 Claude Code 등 AI 에이전트가 <code>ovenn.config.json</code>·
|
|
100
|
+
<code>DESIGN.md</code>를 참조해 이 프로젝트의 축 값에 맞춰 코드를 생성할 수 있습니다.
|
|
101
|
+
</>
|
|
102
|
+
),
|
|
103
|
+
close: "닫기",
|
|
104
|
+
errorTitle: "적용 실패",
|
|
105
|
+
errorLead:
|
|
106
|
+
"파일 쓰기 중 오류가 발생했어요. 미리보기(브라우저 톤)는 적용됐지만 파일은 저장되지 않았습니다.",
|
|
107
|
+
partialLabel: "그 전에 성공한 파일:",
|
|
108
|
+
},
|
|
109
|
+
rail: {
|
|
110
|
+
brand: "Ovenn 온보딩",
|
|
111
|
+
freeMode: "자유 조정",
|
|
112
|
+
},
|
|
113
|
+
themePreview: "preview image TBD",
|
|
114
|
+
color: {
|
|
115
|
+
modeHeading: "밝기 모드",
|
|
116
|
+
modeAria: "밝기 모드",
|
|
117
|
+
light: "밝게",
|
|
118
|
+
dark: "어둡게",
|
|
119
|
+
paletteHeading: "조화 세트",
|
|
120
|
+
paletteAria: "조화 세트",
|
|
121
|
+
brandHeading: "브랜드 색",
|
|
122
|
+
monoHeading: "Mono",
|
|
123
|
+
monoOn: "ON — primary와 chart는 모드 기반 명도 단계 흑백",
|
|
124
|
+
monoOff: "OFF — 아이콘·secondary 전부 brand 톤",
|
|
125
|
+
hexPlaceholder: "#3B5BDB",
|
|
126
|
+
hexInvalid: "hex 형식이 올바르지 않아요",
|
|
127
|
+
hexHint: "입력한 색을 primary로 그대로 사용해요",
|
|
128
|
+
},
|
|
129
|
+
summary: {
|
|
130
|
+
themeLabel: "디자인 스타일",
|
|
131
|
+
vibeLabel: "분위기",
|
|
132
|
+
colorLabel: "컬러 & 톤",
|
|
133
|
+
densityLabel: "정보 밀도",
|
|
134
|
+
layoutLabel: "레이아웃",
|
|
135
|
+
custom: "Custom",
|
|
136
|
+
none: "—",
|
|
137
|
+
hint: "한 번 적용한 뒤 축을 바꾸면 이미 쌓인 컴포넌트·레이아웃이 자동 보정되지 않아요. 지금 신중히 결정해주세요.",
|
|
138
|
+
advanced: "고급 설정",
|
|
139
|
+
},
|
|
140
|
+
free: {
|
|
141
|
+
title: "자유 조정",
|
|
142
|
+
lead: "좌측 축을 직접 조작하거나 아래에서 프리셋·레이아웃·문서를 골라 보세요.",
|
|
143
|
+
backToWizard: "← 위저드로",
|
|
144
|
+
tabPresets: "프리셋",
|
|
145
|
+
tabLayout: "레이아웃",
|
|
146
|
+
tabDocs: "컴포넌트 문서",
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
en: {
|
|
150
|
+
steps: {
|
|
151
|
+
theme: { title: "Design style", hint: "Starter bundle. Axis defaults plus DESIGN.md." },
|
|
152
|
+
vibe: { title: "Product tone", hint: "Corners, motion, and accent decided as a set." },
|
|
153
|
+
density: { title: "Density", hint: "How tightly to pack a screen." },
|
|
154
|
+
color: { title: "Color and tone", hint: "Palette plus brand color." },
|
|
155
|
+
layout: { title: "Layout", hint: "Sidebar and topbar composition." },
|
|
156
|
+
summary: { title: "Review and apply", hint: "Confirm selections and apply to project." },
|
|
157
|
+
},
|
|
158
|
+
stepTitle: {
|
|
159
|
+
theme: "Pick a design style",
|
|
160
|
+
vibe: "What tone fits this product?",
|
|
161
|
+
color: "How should the color feel?",
|
|
162
|
+
density: "How much information per screen?",
|
|
163
|
+
layout: "Which layout suits best?",
|
|
164
|
+
summary: "Your setup",
|
|
165
|
+
},
|
|
166
|
+
stepLead: {
|
|
167
|
+
theme:
|
|
168
|
+
"Picking a style applies axis defaults and DESIGN.md together. You can change axes freely later.",
|
|
169
|
+
vibe: "Pick the closest one. Shape, Motion, and Icon Weight get decided as a set.",
|
|
170
|
+
color:
|
|
171
|
+
"Pick a palette first, then adjust the brand color with the slider or enter a hex directly.",
|
|
172
|
+
density: "How much info fits on screen. Sets the Density axis.",
|
|
173
|
+
layout: "The sidebar and topbar combination that fits your use.",
|
|
174
|
+
summary:
|
|
175
|
+
"Confirm selections and apply. You can tweak individual axes in free mode anytime.",
|
|
176
|
+
},
|
|
177
|
+
back: "Back",
|
|
178
|
+
next: "Next",
|
|
179
|
+
applyThisSetup: "Apply this setup",
|
|
180
|
+
applyError: {
|
|
181
|
+
emptySelection: "Some selections are missing.",
|
|
182
|
+
exception: (msg: string) => `Error while applying: ${msg}`,
|
|
183
|
+
unknown: (msg: string) => `Unknown error while applying: ${msg}`,
|
|
184
|
+
},
|
|
185
|
+
dialog: {
|
|
186
|
+
overwriteTitle: "Overwrite existing setup?",
|
|
187
|
+
applyTitle: "Apply this setup to the project?",
|
|
188
|
+
overwriteLead: (
|
|
189
|
+
<>
|
|
190
|
+
These files already exist. Applying will <strong>overwrite them</strong>.
|
|
191
|
+
Check that you have no uncommitted changes.
|
|
192
|
+
</>
|
|
193
|
+
),
|
|
194
|
+
applyLead:
|
|
195
|
+
"Two files will be created in the project root. Local file writes only, fully reversible.",
|
|
196
|
+
configOverwrite: "Overwrites existing file. Axis values JSON",
|
|
197
|
+
configNew: "Axis values JSON (read by AI agents and ThemeController)",
|
|
198
|
+
designOverwrite: "Overwrites existing file. Theme and axis prose",
|
|
199
|
+
designNew: "Theme and axis prose",
|
|
200
|
+
cancel: "Cancel",
|
|
201
|
+
overwriteApply: "Overwrite and apply",
|
|
202
|
+
apply: "Apply",
|
|
203
|
+
applyingTitle: "Applying",
|
|
204
|
+
applyingLead: "Writing files.",
|
|
205
|
+
doneTitle: "Applied",
|
|
206
|
+
doneLead: "These files were created or updated.",
|
|
207
|
+
doneTail: (
|
|
208
|
+
<>
|
|
209
|
+
AI agents like Claude Code can now read <code>ovenn.config.json</code> and{" "}
|
|
210
|
+
<code>DESIGN.md</code> to generate code against this project's axis values.
|
|
211
|
+
</>
|
|
212
|
+
),
|
|
213
|
+
close: "Close",
|
|
214
|
+
errorTitle: "Apply failed",
|
|
215
|
+
errorLead:
|
|
216
|
+
"A file write failed. The preview (browser tone) applied, but files were not saved.",
|
|
217
|
+
partialLabel: "Files written before the error:",
|
|
218
|
+
},
|
|
219
|
+
rail: {
|
|
220
|
+
brand: "Ovenn onboarding",
|
|
221
|
+
freeMode: "Free mode",
|
|
222
|
+
},
|
|
223
|
+
themePreview: "preview image TBD",
|
|
224
|
+
color: {
|
|
225
|
+
modeHeading: "Light or dark",
|
|
226
|
+
modeAria: "Light or dark",
|
|
227
|
+
light: "Light",
|
|
228
|
+
dark: "Dark",
|
|
229
|
+
paletteHeading: "Harmony set",
|
|
230
|
+
paletteAria: "Harmony set",
|
|
231
|
+
brandHeading: "Brand color",
|
|
232
|
+
monoHeading: "Mono",
|
|
233
|
+
monoOn: "ON — primary and charts use mode-aware grayscale steps",
|
|
234
|
+
monoOff: "OFF — icon and secondary follow brand",
|
|
235
|
+
hexPlaceholder: "#3B5BDB",
|
|
236
|
+
hexInvalid: "The hex format is not valid.",
|
|
237
|
+
hexHint: "Your color is used as the primary as-is.",
|
|
238
|
+
},
|
|
239
|
+
summary: {
|
|
240
|
+
themeLabel: "Design style",
|
|
241
|
+
vibeLabel: "Tone",
|
|
242
|
+
colorLabel: "Color and tone",
|
|
243
|
+
densityLabel: "Density",
|
|
244
|
+
layoutLabel: "Layout",
|
|
245
|
+
custom: "Custom",
|
|
246
|
+
none: "—",
|
|
247
|
+
hint: "After applying, changing axes won't retroactively fix components or layouts already built. Decide carefully now.",
|
|
248
|
+
advanced: "Advanced",
|
|
249
|
+
},
|
|
250
|
+
free: {
|
|
251
|
+
title: "Free mode",
|
|
252
|
+
lead: "Tweak axes on the left, or pick presets, layouts, and docs below.",
|
|
253
|
+
backToWizard: "← Back to wizard",
|
|
254
|
+
tabPresets: "Presets",
|
|
255
|
+
tabLayout: "Layout",
|
|
256
|
+
tabDocs: "Component docs",
|
|
257
|
+
},
|
|
258
|
+
},
|
|
259
|
+
} as const;
|
|
260
|
+
|
|
261
|
+
type Answers = {
|
|
262
|
+
theme: ThemeId | null;
|
|
263
|
+
vibe: VibeId | null;
|
|
264
|
+
/** primary brand hex (#RRGGBB). 비어있으면 ThemeController default 사용. */
|
|
265
|
+
brand: string;
|
|
266
|
+
paletteSet: PaletteSet;
|
|
267
|
+
mono: boolean;
|
|
268
|
+
mode: "light" | "dark";
|
|
269
|
+
density: DensityChoiceId | null;
|
|
270
|
+
layout: LayoutId | null;
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
const STEP_KEYS: StepKey[] = ["theme", "vibe", "density", "color", "layout", "summary"];
|
|
274
|
+
|
|
275
|
+
function getSteps(lang: Lang): { key: StepKey; title: string; hint: string }[] {
|
|
276
|
+
const L = LABELS[lang];
|
|
277
|
+
return STEP_KEYS.map((k) => ({ key: k, title: L.steps[k].title, hint: L.steps[k].hint }));
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
export function OnboardingPage() {
|
|
281
|
+
const {
|
|
282
|
+
theme,
|
|
283
|
+
setTheme,
|
|
284
|
+
brand: currentBrand,
|
|
285
|
+
paletteSet: currentPaletteSet,
|
|
286
|
+
mono: currentMono,
|
|
287
|
+
shape: currentShape,
|
|
288
|
+
density: currentDensity,
|
|
289
|
+
motionMode: currentMotion,
|
|
290
|
+
iconFamily: currentIconFamily,
|
|
291
|
+
setShape,
|
|
292
|
+
setMotionMode,
|
|
293
|
+
setBrand,
|
|
294
|
+
setPaletteSet,
|
|
295
|
+
setMono,
|
|
296
|
+
setDensity,
|
|
297
|
+
applyPreset,
|
|
298
|
+
voice,
|
|
299
|
+
lang,
|
|
300
|
+
} = useTheme();
|
|
301
|
+
const L = LABELS[lang];
|
|
302
|
+
const STEPS = useMemo(() => getSteps(lang), [lang]);
|
|
303
|
+
const vibeChoices = useMemo(() => getVibeChoices(lang), [lang]);
|
|
304
|
+
const layoutChoices = useMemo(() => getLayoutChoices(lang), [lang]);
|
|
305
|
+
const [mode, setMode] = useState<"wizard" | "free">("wizard");
|
|
306
|
+
const [stepIdx, setStepIdx] = useState(0);
|
|
307
|
+
/** 적용 확인 다이얼로그 상태. 적용 진행 중/완료/실패까지 담는다.
|
|
308
|
+
* confirm 단계에서 existing(이미 있는 파일 목록)이 비어있지 않으면 "덮어쓸래?" 플로우. */
|
|
309
|
+
const [applyState, setApplyState] = useState<
|
|
310
|
+
| { phase: "idle" }
|
|
311
|
+
| { phase: "confirm"; existing: string[] }
|
|
312
|
+
| { phase: "applying" }
|
|
313
|
+
| { phase: "done"; files: string[] }
|
|
314
|
+
| { phase: "error"; message: string; files: string[] }
|
|
315
|
+
>({ phase: "idle" });
|
|
316
|
+
const [answers, setAnswers] = useState<Answers>({
|
|
317
|
+
theme: "none",
|
|
318
|
+
vibe: "balanced",
|
|
319
|
+
brand: currentBrand,
|
|
320
|
+
paletteSet: "analogous",
|
|
321
|
+
mono: false,
|
|
322
|
+
mode: "light",
|
|
323
|
+
density: "default",
|
|
324
|
+
layout: "topbar-sidebar",
|
|
325
|
+
});
|
|
326
|
+
|
|
327
|
+
const applyTheme = (t: ThemeId) => {
|
|
328
|
+
setAnswers((a) => ({ ...a, theme: t }));
|
|
329
|
+
// "none" 은 이후 축을 사용자가 직접 선택.
|
|
330
|
+
// pure/spare/expressive는 prompts/themes/<slug>.md의 Preset을 자동 매핑하고
|
|
331
|
+
// vibe/density도 테마가 커버하므로 answers에 미리 세팅 → vibe 단계 skip 가능.
|
|
332
|
+
if (t === "none") return;
|
|
333
|
+
const preset = THEME_PRESETS[t];
|
|
334
|
+
const vibeFallback = THEME_VIBE_FALLBACK[t];
|
|
335
|
+
applyPreset(preset);
|
|
336
|
+
setAnswers((a) => ({
|
|
337
|
+
...a,
|
|
338
|
+
theme: t,
|
|
339
|
+
vibe: vibeFallback,
|
|
340
|
+
density: preset.density,
|
|
341
|
+
mode: preset.mode,
|
|
342
|
+
}));
|
|
343
|
+
};
|
|
344
|
+
|
|
345
|
+
const applyMode = (m: "light" | "dark") => {
|
|
346
|
+
setTheme(m);
|
|
347
|
+
setAnswers((a) => ({ ...a, mode: m }));
|
|
348
|
+
};
|
|
349
|
+
|
|
350
|
+
const applyVibe = (v: VibeId) => {
|
|
351
|
+
const c = vibeChoices.find((x) => x.id === v);
|
|
352
|
+
if (!c) return;
|
|
353
|
+
setShape(c.values.shape);
|
|
354
|
+
setMotionMode(c.values.motion);
|
|
355
|
+
// serious vibe는 mono 토글 ON을 승계.
|
|
356
|
+
if (c.values.mono != null) {
|
|
357
|
+
setMono(c.values.mono);
|
|
358
|
+
setAnswers((a) => ({ ...a, vibe: v, mono: c.values.mono! }));
|
|
359
|
+
return;
|
|
360
|
+
}
|
|
361
|
+
setAnswers((a) => ({ ...a, vibe: v }));
|
|
362
|
+
};
|
|
363
|
+
const applyPaletteSet = (v: PaletteSet) => {
|
|
364
|
+
setPaletteSet(v);
|
|
365
|
+
setAnswers((a) => ({ ...a, paletteSet: v }));
|
|
366
|
+
};
|
|
367
|
+
const applyMono = (v: boolean) => {
|
|
368
|
+
setMono(v);
|
|
369
|
+
setAnswers((a) => ({ ...a, mono: v }));
|
|
370
|
+
};
|
|
371
|
+
const applyBrandHex = (hex: string) => {
|
|
372
|
+
const trimmed = hex.trim();
|
|
373
|
+
if (!trimmed) {
|
|
374
|
+
// hex 비우기 — 축 그대로 두고 answers만 정리.
|
|
375
|
+
setAnswers((a) => ({ ...a, brand: currentBrand }));
|
|
376
|
+
return;
|
|
377
|
+
}
|
|
378
|
+
if (!isValidHex(trimmed)) {
|
|
379
|
+
setAnswers((a) => ({ ...a, brand: trimmed }));
|
|
380
|
+
return;
|
|
381
|
+
}
|
|
382
|
+
const normalized = normalizeHex(trimmed);
|
|
383
|
+
setBrand(normalized);
|
|
384
|
+
setAnswers((a) => ({ ...a, brand: normalized }));
|
|
385
|
+
};
|
|
386
|
+
const applyDensity = (v: DensityChoiceId) => {
|
|
387
|
+
setDensity(v);
|
|
388
|
+
setAnswers((a) => ({ ...a, density: v }));
|
|
389
|
+
};
|
|
390
|
+
|
|
391
|
+
/** 적용 흐름: 1) 확인 다이얼로그 open (기존 파일 조회) → 2) 사용자 확인 → 3) 미리보기 적용 + 파일 쓰기 */
|
|
392
|
+
const openApplyConfirm = async () => {
|
|
393
|
+
const { existing } = await checkExistingFiles();
|
|
394
|
+
setApplyState({ phase: "confirm", existing });
|
|
395
|
+
};
|
|
396
|
+
|
|
397
|
+
const runApply = async () => {
|
|
398
|
+
const layoutChoice = layoutChoices.find((c) => c.id === answers.layout);
|
|
399
|
+
if (!answers.theme || !layoutChoice) {
|
|
400
|
+
setApplyState({ phase: "error", message: L.applyError.emptySelection, files: [] });
|
|
401
|
+
return;
|
|
402
|
+
}
|
|
403
|
+
// confirm 단계에서 기존 파일 발견했었다면 overwrite=true로 명시 승인 전달
|
|
404
|
+
const overwrite =
|
|
405
|
+
applyState.phase === "confirm" && applyState.existing.length > 0;
|
|
406
|
+
setApplyState({ phase: "applying" });
|
|
407
|
+
// ThemeController 현재값이 소스 오브 트루스 — Summary 고급설정에서 바꾼 값이
|
|
408
|
+
// answers에는 반영되지 않으므로 useTheme() 현재값을 그대로 쓴다.
|
|
409
|
+
// 파일 쓰기 (server action)
|
|
410
|
+
// server action이 reject되면(네트워크 끊김·배포환경·내부 throw 등) applying에 멈춰서
|
|
411
|
+
// 무한로딩처럼 보이므로 반드시 try/catch로 감싸서 error phase로 떨어뜨린다.
|
|
412
|
+
try {
|
|
413
|
+
const result = await applyOnboarding(
|
|
414
|
+
{
|
|
415
|
+
brandSet: { id: "core", version: "1" },
|
|
416
|
+
theme: answers.theme,
|
|
417
|
+
mode: answers.mode,
|
|
418
|
+
brand: currentBrand,
|
|
419
|
+
paletteSet: currentPaletteSet,
|
|
420
|
+
mono: currentMono,
|
|
421
|
+
shape: currentShape,
|
|
422
|
+
density: currentDensity,
|
|
423
|
+
motion: currentMotion,
|
|
424
|
+
iconFamily: currentIconFamily,
|
|
425
|
+
voice,
|
|
426
|
+
lang,
|
|
427
|
+
layout: {
|
|
428
|
+
id: layoutChoice.id,
|
|
429
|
+
sidebar: layoutChoice.sidebar,
|
|
430
|
+
topbar: layoutChoice.topbar,
|
|
431
|
+
appFrameLayout: layoutChoice.appFrameLayout,
|
|
432
|
+
tabs: layoutChoice.tabs,
|
|
433
|
+
},
|
|
434
|
+
appliedAt: new Date().toISOString(),
|
|
435
|
+
},
|
|
436
|
+
{ overwrite, lang }
|
|
437
|
+
);
|
|
438
|
+
if (result.ok) {
|
|
439
|
+
// 적용 성공 시 과거 축 값 흔적 제거. 다음 리프레시부터 ovenn.config.json이
|
|
440
|
+
// 유일한 소스가 되게 — 안 지우면 과거 ovenn-mode=dark 등이 config을 덮어씀.
|
|
441
|
+
try {
|
|
442
|
+
[
|
|
443
|
+
"ovenn-mode",
|
|
444
|
+
"ovenn-brand",
|
|
445
|
+
"ovenn-palette-set",
|
|
446
|
+
"ovenn-mono",
|
|
447
|
+
"ovenn-palette",
|
|
448
|
+
"ovenn-hue",
|
|
449
|
+
"ovenn-accent-hue",
|
|
450
|
+
"ovenn-shape",
|
|
451
|
+
"ovenn-density",
|
|
452
|
+
"ovenn-motion",
|
|
453
|
+
"ovenn-icon-family",
|
|
454
|
+
"ovenn-lang",
|
|
455
|
+
"ovenn-voice",
|
|
456
|
+
].forEach((k) => localStorage.removeItem(k));
|
|
457
|
+
} catch {}
|
|
458
|
+
setApplyState({ phase: "done", files: result.files });
|
|
459
|
+
} else {
|
|
460
|
+
setApplyState({
|
|
461
|
+
phase: "error",
|
|
462
|
+
message: result.error,
|
|
463
|
+
files: result.files,
|
|
464
|
+
});
|
|
465
|
+
}
|
|
466
|
+
} catch (e) {
|
|
467
|
+
setApplyState({
|
|
468
|
+
phase: "error",
|
|
469
|
+
message:
|
|
470
|
+
e instanceof Error
|
|
471
|
+
? L.applyError.exception(e.message)
|
|
472
|
+
: L.applyError.unknown(String(e)),
|
|
473
|
+
files: [],
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
};
|
|
477
|
+
|
|
478
|
+
// 페이지 진입 시 default answers를 축에 즉시 반영 (첫 렌더 톤 통일).
|
|
479
|
+
useEffect(() => {
|
|
480
|
+
if (answers.vibe) applyVibe(answers.vibe);
|
|
481
|
+
if (answers.paletteSet) setPaletteSet(answers.paletteSet);
|
|
482
|
+
if (answers.density) setDensity(answers.density);
|
|
483
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
484
|
+
}, []);
|
|
485
|
+
|
|
486
|
+
// 온보딩은 설정 전 단계라 OS prefers-color-scheme이나 저장된 ovenn-mode가 dark여도
|
|
487
|
+
// 무조건 light로 고정 (CheckboxCard 안 글자 가독성 확보).
|
|
488
|
+
// theme이 dark로 돌아올 때마다 다시 light로 끌어오는 게 아니라, 마운트 시 한 번만
|
|
489
|
+
// light로 세팅 — 사용자가 온보딩 안에서 축을 바꿔도 ThemeController sync effect가
|
|
490
|
+
// light를 재적용함.
|
|
491
|
+
useEffect(() => {
|
|
492
|
+
if (theme !== "light") setTheme("light");
|
|
493
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
494
|
+
}, []);
|
|
495
|
+
|
|
496
|
+
const step = STEPS[stepIdx];
|
|
497
|
+
const canGoNext = useMemo(() => {
|
|
498
|
+
if (step.key === "theme") return answers.theme != null;
|
|
499
|
+
if (step.key === "vibe") return answers.vibe != null;
|
|
500
|
+
if (step.key === "color") return answers.paletteSet != null;
|
|
501
|
+
if (step.key === "density") return answers.density != null;
|
|
502
|
+
if (step.key === "layout") return answers.layout != null;
|
|
503
|
+
return true;
|
|
504
|
+
}, [step.key, answers]);
|
|
505
|
+
const totalSteps = STEPS.length;
|
|
506
|
+
|
|
507
|
+
if (mode === "free") {
|
|
508
|
+
return <FreeMode onBack={() => setMode("wizard")} />;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
return (
|
|
512
|
+
<div className={styles.shell} data-mode="light">
|
|
513
|
+
<Rail
|
|
514
|
+
stepIdx={stepIdx}
|
|
515
|
+
answers={answers}
|
|
516
|
+
steps={STEPS}
|
|
517
|
+
lang={lang}
|
|
518
|
+
onStepClick={(idx) => {
|
|
519
|
+
if (idx <= stepIdx || isStepReachable(idx, answers, STEPS)) setStepIdx(idx);
|
|
520
|
+
}}
|
|
521
|
+
onFreeMode={() => setMode("free")}
|
|
522
|
+
/>
|
|
523
|
+
|
|
524
|
+
<div className={styles.content}>
|
|
525
|
+
<div className={styles.contentInner}>
|
|
526
|
+
<header className={styles.stepHeader}>
|
|
527
|
+
<span className={styles.stepProgress}>
|
|
528
|
+
{stepIdx + 1} / {totalSteps}
|
|
529
|
+
</span>
|
|
530
|
+
<h1 className={styles.stepTitle}>{L.stepTitle[step.key]}</h1>
|
|
531
|
+
<p className={styles.stepLead}>{L.stepLead[step.key]}</p>
|
|
532
|
+
</header>
|
|
533
|
+
|
|
534
|
+
<div className={styles.stepBody}>
|
|
535
|
+
{step.key === "theme" && (
|
|
536
|
+
<ThemeStep value={answers.theme} onChange={applyTheme} />
|
|
537
|
+
)}
|
|
538
|
+
{step.key === "vibe" && (
|
|
539
|
+
<VibeStep value={answers.vibe} onChange={applyVibe} />
|
|
540
|
+
)}
|
|
541
|
+
{step.key === "color" && (
|
|
542
|
+
<ColorStep
|
|
543
|
+
brand={answers.brand}
|
|
544
|
+
paletteSet={answers.paletteSet}
|
|
545
|
+
mono={answers.mono}
|
|
546
|
+
mode={answers.mode}
|
|
547
|
+
onMode={applyMode}
|
|
548
|
+
onPaletteSet={applyPaletteSet}
|
|
549
|
+
onMono={applyMono}
|
|
550
|
+
onBrandHex={applyBrandHex}
|
|
551
|
+
/>
|
|
552
|
+
)}
|
|
553
|
+
{step.key === "density" && (
|
|
554
|
+
<DensityStep value={answers.density} onChange={applyDensity} />
|
|
555
|
+
)}
|
|
556
|
+
{step.key === "layout" && (
|
|
557
|
+
<LayoutStep
|
|
558
|
+
value={answers.layout}
|
|
559
|
+
onChange={(v) => setAnswers((a) => ({ ...a, layout: v }))}
|
|
560
|
+
/>
|
|
561
|
+
)}
|
|
562
|
+
{step.key === "summary" && <SummaryStep answers={answers} />}
|
|
563
|
+
</div>
|
|
564
|
+
|
|
565
|
+
<footer className={styles.stepFoot}>
|
|
566
|
+
<div className={styles.stepFootActions}>
|
|
567
|
+
<Button
|
|
568
|
+
variant="secondary"
|
|
569
|
+
size="lg"
|
|
570
|
+
disabled={stepIdx === 0}
|
|
571
|
+
onClick={() => setStepIdx((i) => Math.max(0, i - 1))}
|
|
572
|
+
>
|
|
573
|
+
{L.back}
|
|
574
|
+
</Button>
|
|
575
|
+
<Button
|
|
576
|
+
variant="primary"
|
|
577
|
+
size="lg"
|
|
578
|
+
disabled={!canGoNext}
|
|
579
|
+
onClick={() => {
|
|
580
|
+
if (stepIdx === totalSteps - 1) {
|
|
581
|
+
openApplyConfirm();
|
|
582
|
+
return;
|
|
583
|
+
}
|
|
584
|
+
setStepIdx((i) => nextStepIdx(i, answers, STEPS));
|
|
585
|
+
}}
|
|
586
|
+
rightIcon={
|
|
587
|
+
stepIdx === totalSteps - 1 ? undefined : <Icon name="arrow-right" />
|
|
588
|
+
}
|
|
589
|
+
>
|
|
590
|
+
{stepIdx === totalSteps - 1 ? L.applyThisSetup : L.next}
|
|
591
|
+
</Button>
|
|
592
|
+
</div>
|
|
593
|
+
</footer>
|
|
594
|
+
</div>
|
|
595
|
+
</div>
|
|
596
|
+
|
|
597
|
+
{applyState.phase !== "idle" && (
|
|
598
|
+
<ApplyDialog
|
|
599
|
+
state={applyState}
|
|
600
|
+
lang={lang}
|
|
601
|
+
onCancel={() => setApplyState({ phase: "idle" })}
|
|
602
|
+
onConfirm={runApply}
|
|
603
|
+
/>
|
|
604
|
+
)}
|
|
605
|
+
</div>
|
|
606
|
+
);
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
// ────────────────────────────────────────────────────────
|
|
610
|
+
// Apply dialog — confirm / applying / done / error
|
|
611
|
+
// ────────────────────────────────────────────────────────
|
|
612
|
+
|
|
613
|
+
type ApplyState =
|
|
614
|
+
| { phase: "confirm"; existing: string[] }
|
|
615
|
+
| { phase: "applying" }
|
|
616
|
+
| { phase: "done"; files: string[] }
|
|
617
|
+
| { phase: "error"; message: string; files: string[] };
|
|
618
|
+
|
|
619
|
+
function ApplyDialog({
|
|
620
|
+
state,
|
|
621
|
+
lang,
|
|
622
|
+
onCancel,
|
|
623
|
+
onConfirm,
|
|
624
|
+
}: {
|
|
625
|
+
state: ApplyState;
|
|
626
|
+
lang: Lang;
|
|
627
|
+
onCancel: () => void;
|
|
628
|
+
onConfirm: () => void;
|
|
629
|
+
}) {
|
|
630
|
+
const D = LABELS[lang].dialog;
|
|
631
|
+
return (
|
|
632
|
+
<div className={styles.applyBackdrop} onClick={state.phase === "applying" ? undefined : onCancel}>
|
|
633
|
+
<div
|
|
634
|
+
className={styles.applyModal}
|
|
635
|
+
onClick={(e) => e.stopPropagation()}
|
|
636
|
+
role="dialog"
|
|
637
|
+
aria-modal="true"
|
|
638
|
+
>
|
|
639
|
+
{state.phase === "confirm" && (
|
|
640
|
+
<>
|
|
641
|
+
<h2 className={styles.applyTitle}>
|
|
642
|
+
{state.existing.length > 0 ? D.overwriteTitle : D.applyTitle}
|
|
643
|
+
</h2>
|
|
644
|
+
{state.existing.length > 0 ? (
|
|
645
|
+
<p className={styles.applyLead}>{D.overwriteLead}</p>
|
|
646
|
+
) : (
|
|
647
|
+
<p className={styles.applyLead}>{D.applyLead}</p>
|
|
648
|
+
)}
|
|
649
|
+
<ul className={styles.applyFileList}>
|
|
650
|
+
<li>
|
|
651
|
+
<code>ovenn.config.json</code>
|
|
652
|
+
<span className={styles.applyFileHint}>
|
|
653
|
+
{state.existing.includes("ovenn.config.json")
|
|
654
|
+
? D.configOverwrite
|
|
655
|
+
: D.configNew}
|
|
656
|
+
</span>
|
|
657
|
+
</li>
|
|
658
|
+
<li>
|
|
659
|
+
<code>DESIGN.md</code>
|
|
660
|
+
<span className={styles.applyFileHint}>
|
|
661
|
+
{state.existing.includes("DESIGN.md")
|
|
662
|
+
? D.designOverwrite
|
|
663
|
+
: D.designNew}
|
|
664
|
+
</span>
|
|
665
|
+
</li>
|
|
666
|
+
</ul>
|
|
667
|
+
<div className={styles.applyActions}>
|
|
668
|
+
<Button variant="secondary" size="md" onClick={onCancel}>
|
|
669
|
+
{D.cancel}
|
|
670
|
+
</Button>
|
|
671
|
+
<Button variant="primary" size="md" onClick={onConfirm}>
|
|
672
|
+
{state.existing.length > 0 ? D.overwriteApply : D.apply}
|
|
673
|
+
</Button>
|
|
674
|
+
</div>
|
|
675
|
+
</>
|
|
676
|
+
)}
|
|
677
|
+
{state.phase === "applying" && (
|
|
678
|
+
<>
|
|
679
|
+
<h2 className={styles.applyTitle}>{D.applyingTitle}</h2>
|
|
680
|
+
<p className={styles.applyLead}>{D.applyingLead}</p>
|
|
681
|
+
</>
|
|
682
|
+
)}
|
|
683
|
+
{state.phase === "done" && (
|
|
684
|
+
<>
|
|
685
|
+
<h2 className={styles.applyTitle}>{D.doneTitle}</h2>
|
|
686
|
+
<p className={styles.applyLead}>{D.doneLead}</p>
|
|
687
|
+
<ul className={styles.applyFileList}>
|
|
688
|
+
{state.files.map((f) => (
|
|
689
|
+
<li key={f}>
|
|
690
|
+
<code>{f}</code>
|
|
691
|
+
</li>
|
|
692
|
+
))}
|
|
693
|
+
</ul>
|
|
694
|
+
<p className={styles.applyLead}>{D.doneTail}</p>
|
|
695
|
+
<div className={styles.applyActions}>
|
|
696
|
+
<Button variant="primary" size="md" onClick={onCancel}>
|
|
697
|
+
{D.close}
|
|
698
|
+
</Button>
|
|
699
|
+
</div>
|
|
700
|
+
</>
|
|
701
|
+
)}
|
|
702
|
+
{state.phase === "error" && (
|
|
703
|
+
<>
|
|
704
|
+
<h2 className={styles.applyTitle}>{D.errorTitle}</h2>
|
|
705
|
+
<p className={styles.applyLead}>{D.errorLead}</p>
|
|
706
|
+
<pre className={styles.applyError}>{state.message}</pre>
|
|
707
|
+
{state.files.length > 0 && (
|
|
708
|
+
<>
|
|
709
|
+
<p className={styles.applyLead}>{D.partialLabel}</p>
|
|
710
|
+
<ul className={styles.applyFileList}>
|
|
711
|
+
{state.files.map((f) => (
|
|
712
|
+
<li key={f}>
|
|
713
|
+
<code>{f}</code>
|
|
714
|
+
</li>
|
|
715
|
+
))}
|
|
716
|
+
</ul>
|
|
717
|
+
</>
|
|
718
|
+
)}
|
|
719
|
+
<div className={styles.applyActions}>
|
|
720
|
+
<Button variant="secondary" size="md" onClick={onCancel}>
|
|
721
|
+
{D.close}
|
|
722
|
+
</Button>
|
|
723
|
+
</div>
|
|
724
|
+
</>
|
|
725
|
+
)}
|
|
726
|
+
</div>
|
|
727
|
+
</div>
|
|
728
|
+
);
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
// ────────────────────────────────────────────────────────
|
|
732
|
+
|
|
733
|
+
/**
|
|
734
|
+
* step 도달 가능 여부. STEPS 순서가 바뀌어도 안전하도록 key 기반으로 판정.
|
|
735
|
+
* 각 step에 필요한 answers 필드를 매핑.
|
|
736
|
+
*/
|
|
737
|
+
const STEP_REQUIRES: Record<StepKey, (keyof Answers)[]> = {
|
|
738
|
+
theme: [],
|
|
739
|
+
vibe: ["theme"],
|
|
740
|
+
density: ["theme", "vibe"],
|
|
741
|
+
color: ["theme", "vibe", "density"],
|
|
742
|
+
layout: ["theme", "vibe", "density", "paletteSet"],
|
|
743
|
+
summary: ["theme", "vibe", "density", "paletteSet", "layout"],
|
|
744
|
+
};
|
|
745
|
+
|
|
746
|
+
type StepsArr = { key: StepKey; title: string; hint: string }[];
|
|
747
|
+
|
|
748
|
+
function isStepReachable(idx: number, a: Answers, steps: StepsArr): boolean {
|
|
749
|
+
const step = steps[idx];
|
|
750
|
+
if (!step) return false;
|
|
751
|
+
return STEP_REQUIRES[step.key].every((k) => a[k] != null);
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
/**
|
|
755
|
+
* 다음 step 인덱스 계산. 특수 룰:
|
|
756
|
+
* - theme 단계에서 none이 아닌 테마를 고르면 vibe 단계는 건너뜀 (테마가 vibe 축을 커버).
|
|
757
|
+
* 그 외엔 선형 +1.
|
|
758
|
+
*/
|
|
759
|
+
function nextStepIdx(current: number, a: Answers, steps: StepsArr): number {
|
|
760
|
+
const curr = steps[current]?.key;
|
|
761
|
+
if (curr === "theme" && a.theme && a.theme !== "none") {
|
|
762
|
+
const colorIdx = steps.findIndex((s) => s.key === "color");
|
|
763
|
+
if (colorIdx > current) return colorIdx;
|
|
764
|
+
}
|
|
765
|
+
return Math.min(steps.length - 1, current + 1);
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
// ────────────────────────────────────────────────────────
|
|
769
|
+
|
|
770
|
+
function Rail({
|
|
771
|
+
stepIdx,
|
|
772
|
+
answers,
|
|
773
|
+
steps,
|
|
774
|
+
lang,
|
|
775
|
+
onStepClick,
|
|
776
|
+
onFreeMode,
|
|
777
|
+
}: {
|
|
778
|
+
stepIdx: number;
|
|
779
|
+
answers: Answers;
|
|
780
|
+
steps: StepsArr;
|
|
781
|
+
lang: Lang;
|
|
782
|
+
onStepClick: (i: number) => void;
|
|
783
|
+
onFreeMode: () => void;
|
|
784
|
+
}) {
|
|
785
|
+
const L = LABELS[lang];
|
|
786
|
+
return (
|
|
787
|
+
<aside className={styles.rail}>
|
|
788
|
+
<div className={styles.railBrand} aria-hidden>
|
|
789
|
+
<Icon name="palette" size={18} />
|
|
790
|
+
</div>
|
|
791
|
+
|
|
792
|
+
<Stepper
|
|
793
|
+
className={styles.railSteps}
|
|
794
|
+
activeIndex={stepIdx}
|
|
795
|
+
onStepClick={onStepClick}
|
|
796
|
+
marker="number"
|
|
797
|
+
>
|
|
798
|
+
{steps.map((s, i) => (
|
|
799
|
+
<Stepper.Item
|
|
800
|
+
key={s.key}
|
|
801
|
+
title={s.title}
|
|
802
|
+
hint={s.hint}
|
|
803
|
+
disabled={i > stepIdx && !isStepReachable(i, answers, steps)}
|
|
804
|
+
/>
|
|
805
|
+
))}
|
|
806
|
+
</Stepper>
|
|
807
|
+
|
|
808
|
+
<div className={styles.railFoot}>
|
|
809
|
+
<span>{L.rail.brand}</span>
|
|
810
|
+
<button
|
|
811
|
+
type="button"
|
|
812
|
+
className={styles.railFootBtn}
|
|
813
|
+
onClick={onFreeMode}
|
|
814
|
+
>
|
|
815
|
+
{L.rail.freeMode}
|
|
816
|
+
<Icon name="arrow-right" size={12} />
|
|
817
|
+
</button>
|
|
818
|
+
</div>
|
|
819
|
+
</aside>
|
|
820
|
+
);
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
// ────────────────────────────────────────────────────────
|
|
824
|
+
|
|
825
|
+
/**
|
|
826
|
+
* 각 테마 미리보기 이미지. null이면 placeholder 블록 표시.
|
|
827
|
+
* 이미지는 web/public/onboarding/<slug>.png 에 둔다.
|
|
828
|
+
*/
|
|
829
|
+
const THEME_PREVIEW_IMG: Record<ThemeId, string | null> = {
|
|
830
|
+
none: null,
|
|
831
|
+
pure: "/onboarding/pure.png",
|
|
832
|
+
spare: "/onboarding/spare.png",
|
|
833
|
+
expressive: "/onboarding/expressive.png",
|
|
834
|
+
};
|
|
835
|
+
|
|
836
|
+
function ThemeStep({
|
|
837
|
+
value,
|
|
838
|
+
onChange,
|
|
839
|
+
}: {
|
|
840
|
+
value: ThemeId | null;
|
|
841
|
+
onChange: (v: ThemeId) => void;
|
|
842
|
+
}) {
|
|
843
|
+
const { lang } = useTheme();
|
|
844
|
+
const L = LABELS[lang];
|
|
845
|
+
const themeChoices = useMemo(() => getThemeChoices(lang), [lang]);
|
|
846
|
+
const [hovered, setHovered] = useState<ThemeId | null>(null);
|
|
847
|
+
const [cursor, setCursor] = useState<{ x: number; y: number }>({ x: 0, y: 0 });
|
|
848
|
+
|
|
849
|
+
const handleMove = (e: React.MouseEvent) => {
|
|
850
|
+
setCursor({ x: e.clientX, y: e.clientY });
|
|
851
|
+
};
|
|
852
|
+
|
|
853
|
+
// "none"은 사진이 어차피 없으니 호버 미리보기 생략.
|
|
854
|
+
const showPreview = hovered !== null && hovered !== "none";
|
|
855
|
+
const previewSrc = hovered ? THEME_PREVIEW_IMG[hovered] : null;
|
|
856
|
+
|
|
857
|
+
// 커서 오른쪽 아래로 offset. 화면 밖 넘치면 왼쪽/위로 뒤집기.
|
|
858
|
+
const OFFSET_X = 20;
|
|
859
|
+
const OFFSET_Y = 20;
|
|
860
|
+
const PREVIEW_W = 384; // CSS와 동기 (space-24 * 4 = 96 * 4)
|
|
861
|
+
const PREVIEW_H = 288; // CSS와 동기 (space-24 * 3)
|
|
862
|
+
let left = cursor.x + OFFSET_X;
|
|
863
|
+
let top = cursor.y + OFFSET_Y;
|
|
864
|
+
if (typeof window !== "undefined") {
|
|
865
|
+
if (left + PREVIEW_W > window.innerWidth) left = cursor.x - OFFSET_X - PREVIEW_W;
|
|
866
|
+
if (top + PREVIEW_H > window.innerHeight) top = cursor.y - OFFSET_Y - PREVIEW_H;
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
return (
|
|
870
|
+
<>
|
|
871
|
+
<div className={styles.choiceList}>
|
|
872
|
+
{themeChoices.map((c) => (
|
|
873
|
+
<div
|
|
874
|
+
key={c.id}
|
|
875
|
+
onMouseEnter={() => setHovered(c.id)}
|
|
876
|
+
onMouseLeave={() => setHovered((prev) => (prev === c.id ? null : prev))}
|
|
877
|
+
onMouseMove={handleMove}
|
|
878
|
+
>
|
|
879
|
+
<CheckboxCard
|
|
880
|
+
mode="radio"
|
|
881
|
+
name="onb-theme"
|
|
882
|
+
value={c.id}
|
|
883
|
+
checked={value === c.id}
|
|
884
|
+
onChange={() => onChange(c.id)}
|
|
885
|
+
title={
|
|
886
|
+
c.badge ? (
|
|
887
|
+
<span className={styles.themeTitleRow}>
|
|
888
|
+
<Badge size="sm" variant="soft" status={c.badgeStatus}>
|
|
889
|
+
{c.badge}
|
|
890
|
+
</Badge>
|
|
891
|
+
<span>{c.title}</span>
|
|
892
|
+
</span>
|
|
893
|
+
) : (
|
|
894
|
+
c.title
|
|
895
|
+
)
|
|
896
|
+
}
|
|
897
|
+
description={c.hint}
|
|
898
|
+
/>
|
|
899
|
+
</div>
|
|
900
|
+
))}
|
|
901
|
+
</div>
|
|
902
|
+
|
|
903
|
+
<div
|
|
904
|
+
className={styles.themeHoverLayer}
|
|
905
|
+
data-visible={showPreview || undefined}
|
|
906
|
+
style={{ transform: `translate(${left}px, ${top}px)` }}
|
|
907
|
+
aria-hidden
|
|
908
|
+
>
|
|
909
|
+
{previewSrc ? (
|
|
910
|
+
// eslint-disable-next-line @next/next/no-img-element
|
|
911
|
+
<img src={previewSrc} alt="" className={styles.themeHoverImg} />
|
|
912
|
+
) : (
|
|
913
|
+
<div className={styles.themeHoverPlaceholder}>
|
|
914
|
+
<span className={styles.themeHoverPlaceholderLabel}>
|
|
915
|
+
{hovered ?? ""}
|
|
916
|
+
</span>
|
|
917
|
+
<span className={styles.themeHoverPlaceholderHint}>
|
|
918
|
+
{L.themePreview}
|
|
919
|
+
</span>
|
|
920
|
+
</div>
|
|
921
|
+
)}
|
|
922
|
+
</div>
|
|
923
|
+
</>
|
|
924
|
+
);
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
function VibeStep({
|
|
928
|
+
value,
|
|
929
|
+
onChange,
|
|
930
|
+
}: {
|
|
931
|
+
value: VibeId | null;
|
|
932
|
+
onChange: (v: VibeId) => void;
|
|
933
|
+
}) {
|
|
934
|
+
const { lang } = useTheme();
|
|
935
|
+
const vibeChoices = useMemo(() => getVibeChoices(lang), [lang]);
|
|
936
|
+
return (
|
|
937
|
+
<div className={styles.choiceList}>
|
|
938
|
+
{vibeChoices.map((c) => (
|
|
939
|
+
<CheckboxCard
|
|
940
|
+
key={c.id}
|
|
941
|
+
mode="radio"
|
|
942
|
+
name="onb-vibe"
|
|
943
|
+
value={c.id}
|
|
944
|
+
checked={value === c.id}
|
|
945
|
+
onChange={() => onChange(c.id)}
|
|
946
|
+
title={c.title}
|
|
947
|
+
description={c.hint}
|
|
948
|
+
/>
|
|
949
|
+
))}
|
|
950
|
+
</div>
|
|
951
|
+
);
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
function ColorStep({
|
|
955
|
+
brand,
|
|
956
|
+
paletteSet,
|
|
957
|
+
mono,
|
|
958
|
+
mode,
|
|
959
|
+
onMode,
|
|
960
|
+
onPaletteSet,
|
|
961
|
+
onMono,
|
|
962
|
+
onBrandHex,
|
|
963
|
+
}: {
|
|
964
|
+
brand: string;
|
|
965
|
+
paletteSet: PaletteSet;
|
|
966
|
+
mono: boolean;
|
|
967
|
+
mode: "light" | "dark";
|
|
968
|
+
onMode: (v: "light" | "dark") => void;
|
|
969
|
+
onPaletteSet: (v: PaletteSet) => void;
|
|
970
|
+
onMono: (v: boolean) => void;
|
|
971
|
+
onBrandHex: (hex: string) => void;
|
|
972
|
+
}) {
|
|
973
|
+
const { lang } = useTheme();
|
|
974
|
+
const C = LABELS[lang].color;
|
|
975
|
+
const paletteChoices = useMemo(() => getPaletteChoices(lang), [lang]);
|
|
976
|
+
const brandInvalid = brand.trim().length > 0 && !isValidHex(brand.trim());
|
|
977
|
+
const activeHint = paletteChoices.find((c) => c.id === paletteSet)?.hint;
|
|
978
|
+
|
|
979
|
+
return (
|
|
980
|
+
<div className={styles.colorStep}>
|
|
981
|
+
<section className={styles.colorSection}>
|
|
982
|
+
<span className={styles.colorSectionTitle}>{C.modeHeading}</span>
|
|
983
|
+
<div className={styles.paletteRow} role="radiogroup" aria-label={C.modeAria}>
|
|
984
|
+
<Chip
|
|
985
|
+
size="lg"
|
|
986
|
+
selected={mode === "light"}
|
|
987
|
+
onPressedChange={() => onMode("light")}
|
|
988
|
+
>
|
|
989
|
+
{C.light}
|
|
990
|
+
</Chip>
|
|
991
|
+
<Chip
|
|
992
|
+
size="lg"
|
|
993
|
+
selected={mode === "dark"}
|
|
994
|
+
onPressedChange={() => onMode("dark")}
|
|
995
|
+
>
|
|
996
|
+
{C.dark}
|
|
997
|
+
</Chip>
|
|
998
|
+
</div>
|
|
999
|
+
</section>
|
|
1000
|
+
|
|
1001
|
+
<section className={styles.colorSection}>
|
|
1002
|
+
<span className={styles.colorSectionTitle}>{C.brandHeading}</span>
|
|
1003
|
+
<div className={styles.hexBlock}>
|
|
1004
|
+
<Input
|
|
1005
|
+
size="md"
|
|
1006
|
+
width="fill"
|
|
1007
|
+
placeholder={C.hexPlaceholder}
|
|
1008
|
+
value={brand}
|
|
1009
|
+
onChange={(e) => onBrandHex(e.target.value)}
|
|
1010
|
+
invalid={brandInvalid}
|
|
1011
|
+
prefix={
|
|
1012
|
+
<span
|
|
1013
|
+
className={styles.hexBigSwatch}
|
|
1014
|
+
style={{
|
|
1015
|
+
background: brand && !brandInvalid ? normalizeHex(brand) : "transparent",
|
|
1016
|
+
}}
|
|
1017
|
+
aria-hidden
|
|
1018
|
+
/>
|
|
1019
|
+
}
|
|
1020
|
+
/>
|
|
1021
|
+
<span className={styles.hexHelp}>
|
|
1022
|
+
{brandInvalid ? C.hexInvalid : C.hexHint}
|
|
1023
|
+
</span>
|
|
1024
|
+
</div>
|
|
1025
|
+
</section>
|
|
1026
|
+
|
|
1027
|
+
<section className={styles.colorSection}>
|
|
1028
|
+
<div className={styles.colorSectionHead}>
|
|
1029
|
+
<span className={styles.colorSectionTitle}>{C.paletteHeading}</span>
|
|
1030
|
+
{activeHint && <span className={styles.colorSectionHint}>{activeHint}</span>}
|
|
1031
|
+
</div>
|
|
1032
|
+
<div className={styles.paletteRow} role="radiogroup" aria-label={C.paletteAria}>
|
|
1033
|
+
{paletteChoices.map((c) => {
|
|
1034
|
+
const preset = paletteSetPresets.find((p) => p.id === c.id);
|
|
1035
|
+
return (
|
|
1036
|
+
<Chip
|
|
1037
|
+
key={c.id}
|
|
1038
|
+
size="lg"
|
|
1039
|
+
selected={paletteSet === c.id}
|
|
1040
|
+
onPressedChange={() => onPaletteSet(c.id)}
|
|
1041
|
+
>
|
|
1042
|
+
{preset?.label ?? c.id}
|
|
1043
|
+
</Chip>
|
|
1044
|
+
);
|
|
1045
|
+
})}
|
|
1046
|
+
</div>
|
|
1047
|
+
</section>
|
|
1048
|
+
|
|
1049
|
+
<section className={styles.colorSection}>
|
|
1050
|
+
<span className={styles.colorSectionTitle}>{C.monoHeading}</span>
|
|
1051
|
+
<div className={styles.paletteRow}>
|
|
1052
|
+
<Chip
|
|
1053
|
+
size="lg"
|
|
1054
|
+
selected={mono}
|
|
1055
|
+
onPressedChange={() => onMono(!mono)}
|
|
1056
|
+
>
|
|
1057
|
+
{mono ? C.monoOn : C.monoOff}
|
|
1058
|
+
</Chip>
|
|
1059
|
+
</div>
|
|
1060
|
+
</section>
|
|
1061
|
+
</div>
|
|
1062
|
+
);
|
|
1063
|
+
}
|
|
1064
|
+
|
|
1065
|
+
function DensityStep({
|
|
1066
|
+
value,
|
|
1067
|
+
onChange,
|
|
1068
|
+
}: {
|
|
1069
|
+
value: DensityChoiceId | null;
|
|
1070
|
+
onChange: (v: DensityChoiceId) => void;
|
|
1071
|
+
}) {
|
|
1072
|
+
const { lang } = useTheme();
|
|
1073
|
+
const densityChoices = useMemo(() => getDensityChoices(lang), [lang]);
|
|
1074
|
+
return (
|
|
1075
|
+
<div className={styles.choiceList}>
|
|
1076
|
+
{densityChoices.map((c) => (
|
|
1077
|
+
<CheckboxCard
|
|
1078
|
+
key={c.id}
|
|
1079
|
+
mode="radio"
|
|
1080
|
+
name="onb-density"
|
|
1081
|
+
value={c.id}
|
|
1082
|
+
checked={value === c.id}
|
|
1083
|
+
onChange={() => onChange(c.id)}
|
|
1084
|
+
title={c.title}
|
|
1085
|
+
description={c.hint}
|
|
1086
|
+
/>
|
|
1087
|
+
))}
|
|
1088
|
+
</div>
|
|
1089
|
+
);
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
function LayoutStep({
|
|
1093
|
+
value,
|
|
1094
|
+
onChange,
|
|
1095
|
+
}: {
|
|
1096
|
+
value: LayoutId | null;
|
|
1097
|
+
onChange: (v: LayoutId) => void;
|
|
1098
|
+
}) {
|
|
1099
|
+
const { lang } = useTheme();
|
|
1100
|
+
const layoutChoices = useMemo(() => getLayoutChoices(lang), [lang]);
|
|
1101
|
+
const [hovered, setHovered] = useState<LayoutId | null>(null);
|
|
1102
|
+
const [cursor, setCursor] = useState<{ x: number; y: number }>({ x: 0, y: 0 });
|
|
1103
|
+
|
|
1104
|
+
const handleMove = (e: React.MouseEvent) => {
|
|
1105
|
+
setCursor({ x: e.clientX, y: e.clientY });
|
|
1106
|
+
};
|
|
1107
|
+
|
|
1108
|
+
const hoveredChoice = hovered ? layoutChoices.find((c) => c.id === hovered) : null;
|
|
1109
|
+
const hoveredSidebar = hoveredChoice?.sidebar ?? "none";
|
|
1110
|
+
const hoveredTopbar = hoveredChoice?.topbar ?? false;
|
|
1111
|
+
const hoveredFrameLayout = hoveredChoice?.appFrameLayout ?? "sidebar-first";
|
|
1112
|
+
const hoveredTabs = hoveredChoice?.tabs ?? false;
|
|
1113
|
+
|
|
1114
|
+
// ThemeStep과 동일한 커서 추적 로직.
|
|
1115
|
+
const OFFSET_X = 20;
|
|
1116
|
+
const OFFSET_Y = 20;
|
|
1117
|
+
const PREVIEW_W = 384;
|
|
1118
|
+
const PREVIEW_H = 256;
|
|
1119
|
+
let left = cursor.x + OFFSET_X;
|
|
1120
|
+
let top = cursor.y + OFFSET_Y;
|
|
1121
|
+
if (typeof window !== "undefined") {
|
|
1122
|
+
if (left + PREVIEW_W > window.innerWidth) left = cursor.x - OFFSET_X - PREVIEW_W;
|
|
1123
|
+
if (top + PREVIEW_H > window.innerHeight) top = cursor.y - OFFSET_Y - PREVIEW_H;
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1126
|
+
return (
|
|
1127
|
+
<>
|
|
1128
|
+
<div className={styles.choiceList}>
|
|
1129
|
+
{layoutChoices.map((c) => (
|
|
1130
|
+
<div
|
|
1131
|
+
key={c.id}
|
|
1132
|
+
onMouseEnter={() => setHovered(c.id)}
|
|
1133
|
+
onMouseLeave={() => setHovered((prev) => (prev === c.id ? null : prev))}
|
|
1134
|
+
onMouseMove={handleMove}
|
|
1135
|
+
>
|
|
1136
|
+
<CheckboxCard
|
|
1137
|
+
mode="radio"
|
|
1138
|
+
name="onb-layout"
|
|
1139
|
+
value={c.id}
|
|
1140
|
+
checked={value === c.id}
|
|
1141
|
+
onChange={() => onChange(c.id)}
|
|
1142
|
+
title={c.title}
|
|
1143
|
+
description={c.hint}
|
|
1144
|
+
/>
|
|
1145
|
+
</div>
|
|
1146
|
+
))}
|
|
1147
|
+
</div>
|
|
1148
|
+
|
|
1149
|
+
<div
|
|
1150
|
+
className={styles.themeHoverLayer}
|
|
1151
|
+
data-visible={hoveredChoice ? true : undefined}
|
|
1152
|
+
style={{ transform: `translate(${left}px, ${top}px)` }}
|
|
1153
|
+
aria-hidden
|
|
1154
|
+
>
|
|
1155
|
+
{hoveredChoice && (
|
|
1156
|
+
<LayoutWireframe
|
|
1157
|
+
sidebar={hoveredSidebar}
|
|
1158
|
+
topbar={hoveredTopbar}
|
|
1159
|
+
frameLayout={hoveredFrameLayout}
|
|
1160
|
+
tabs={hoveredTabs}
|
|
1161
|
+
/>
|
|
1162
|
+
)}
|
|
1163
|
+
</div>
|
|
1164
|
+
</>
|
|
1165
|
+
);
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1168
|
+
/**
|
|
1169
|
+
* 레이아웃 호버 미리보기 와이어프레임.
|
|
1170
|
+
* frameLayout에 따라 두 가지 구조:
|
|
1171
|
+
* - sidebar-first: [좌사이드바(세로 전체) | (탑바 + 콘텐츠 세로)] — Figma/Notion
|
|
1172
|
+
* - topbar-first: [탑바(가로 전체); (좌사이드바 | 콘텐츠)] — GitHub/Vercel
|
|
1173
|
+
* tabs=true면 탑바 아래 탭 바 한 줄 추가.
|
|
1174
|
+
*/
|
|
1175
|
+
function LayoutWireframe({
|
|
1176
|
+
sidebar,
|
|
1177
|
+
topbar,
|
|
1178
|
+
frameLayout,
|
|
1179
|
+
tabs,
|
|
1180
|
+
}: {
|
|
1181
|
+
sidebar: "left" | "right" | "dual" | "none";
|
|
1182
|
+
topbar: boolean;
|
|
1183
|
+
frameLayout: "sidebar-first" | "topbar-first";
|
|
1184
|
+
tabs: boolean;
|
|
1185
|
+
}) {
|
|
1186
|
+
const hasLeft = sidebar === "left" || sidebar === "dual";
|
|
1187
|
+
const hasRight = sidebar === "right" || sidebar === "dual";
|
|
1188
|
+
|
|
1189
|
+
if (topbar && frameLayout === "topbar-first") {
|
|
1190
|
+
return (
|
|
1191
|
+
<div className={styles.layoutWire} data-frame="topbar-first">
|
|
1192
|
+
<div className={styles.layoutWireTopbar} />
|
|
1193
|
+
{tabs && <div className={styles.layoutWireTabs} />}
|
|
1194
|
+
<div className={styles.layoutWireBody}>
|
|
1195
|
+
{hasLeft && <div className={styles.layoutWireSidebar} />}
|
|
1196
|
+
<div className={styles.layoutWireContent} />
|
|
1197
|
+
{hasRight && <div className={styles.layoutWireSidebar} />}
|
|
1198
|
+
</div>
|
|
1199
|
+
</div>
|
|
1200
|
+
);
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
return (
|
|
1204
|
+
<div className={styles.layoutWire} data-frame="sidebar-first">
|
|
1205
|
+
{hasLeft && <div className={styles.layoutWireSidebar} />}
|
|
1206
|
+
<div className={styles.layoutWireMain}>
|
|
1207
|
+
{topbar && <div className={styles.layoutWireTopbar} />}
|
|
1208
|
+
{tabs && <div className={styles.layoutWireTabs} />}
|
|
1209
|
+
<div className={styles.layoutWireContent} />
|
|
1210
|
+
</div>
|
|
1211
|
+
{hasRight && <div className={styles.layoutWireSidebar} />}
|
|
1212
|
+
</div>
|
|
1213
|
+
);
|
|
1214
|
+
}
|
|
1215
|
+
|
|
1216
|
+
// ────────────────────────────────────────────────────────
|
|
1217
|
+
|
|
1218
|
+
function SummaryStep({ answers }: { answers: Answers }) {
|
|
1219
|
+
const { lang } = useTheme();
|
|
1220
|
+
const S = LABELS[lang].summary;
|
|
1221
|
+
const themeChoices = useMemo(() => getThemeChoices(lang), [lang]);
|
|
1222
|
+
const vibeChoices = useMemo(() => getVibeChoices(lang), [lang]);
|
|
1223
|
+
const paletteChoices = useMemo(() => getPaletteChoices(lang), [lang]);
|
|
1224
|
+
const densityChoices = useMemo(() => getDensityChoices(lang), [lang]);
|
|
1225
|
+
const layoutChoices = useMemo(() => getLayoutChoices(lang), [lang]);
|
|
1226
|
+
const [advancedOpen, setAdvancedOpen] = useState(false);
|
|
1227
|
+
|
|
1228
|
+
const theme = themeChoices.find((c) => c.id === answers.theme);
|
|
1229
|
+
const vibe = vibeChoices.find((c) => c.id === answers.vibe);
|
|
1230
|
+
const paletteChoice = paletteChoices.find((c) => c.id === answers.paletteSet);
|
|
1231
|
+
const density = densityChoices.find((c) => c.id === answers.density);
|
|
1232
|
+
const layout = layoutChoices.find((c) => c.id === answers.layout);
|
|
1233
|
+
|
|
1234
|
+
return (
|
|
1235
|
+
<>
|
|
1236
|
+
<div className={styles.summaryGrid}>
|
|
1237
|
+
<SummaryCard
|
|
1238
|
+
label={S.themeLabel}
|
|
1239
|
+
value={theme?.title ?? S.none}
|
|
1240
|
+
preview={
|
|
1241
|
+
theme?.badge ? (
|
|
1242
|
+
<Badge size="sm" variant="soft" status={theme.badgeStatus}>
|
|
1243
|
+
{theme.badge}
|
|
1244
|
+
</Badge>
|
|
1245
|
+
) : (
|
|
1246
|
+
<span className={styles.summaryPreviewMuted}>{S.custom}</span>
|
|
1247
|
+
)
|
|
1248
|
+
}
|
|
1249
|
+
/>
|
|
1250
|
+
<SummaryCard
|
|
1251
|
+
label={S.vibeLabel}
|
|
1252
|
+
value={vibe?.title ?? S.none}
|
|
1253
|
+
preview={
|
|
1254
|
+
vibe && (
|
|
1255
|
+
<div className={styles.vibePreview} data-summary>
|
|
1256
|
+
<span
|
|
1257
|
+
className={styles.vibePreviewBtn}
|
|
1258
|
+
data-shape={vibe.values.shape}
|
|
1259
|
+
aria-hidden
|
|
1260
|
+
/>
|
|
1261
|
+
<span
|
|
1262
|
+
className={styles.vibePreviewChip}
|
|
1263
|
+
data-shape={vibe.values.shape}
|
|
1264
|
+
data-motion={vibe.values.motion}
|
|
1265
|
+
aria-hidden
|
|
1266
|
+
/>
|
|
1267
|
+
<span
|
|
1268
|
+
className={styles.vibePreviewChip}
|
|
1269
|
+
data-shape={vibe.values.shape}
|
|
1270
|
+
data-motion={vibe.values.motion}
|
|
1271
|
+
data-variant="ghost"
|
|
1272
|
+
aria-hidden
|
|
1273
|
+
/>
|
|
1274
|
+
</div>
|
|
1275
|
+
)
|
|
1276
|
+
}
|
|
1277
|
+
/>
|
|
1278
|
+
<SummaryCard
|
|
1279
|
+
label={S.colorLabel}
|
|
1280
|
+
value={paletteChoice?.title ?? S.none}
|
|
1281
|
+
preview={
|
|
1282
|
+
<div className={styles.colorPreview} aria-hidden>
|
|
1283
|
+
<span
|
|
1284
|
+
className={styles.colorPreviewSwatch}
|
|
1285
|
+
style={{ background: answers.brand }}
|
|
1286
|
+
/>
|
|
1287
|
+
</div>
|
|
1288
|
+
}
|
|
1289
|
+
/>
|
|
1290
|
+
<SummaryCard
|
|
1291
|
+
label={S.densityLabel}
|
|
1292
|
+
value={density?.title ?? S.none}
|
|
1293
|
+
preview={
|
|
1294
|
+
density && (
|
|
1295
|
+
<div
|
|
1296
|
+
className={styles.densityPreview}
|
|
1297
|
+
data-density={density.id}
|
|
1298
|
+
aria-hidden
|
|
1299
|
+
>
|
|
1300
|
+
<span />
|
|
1301
|
+
<span />
|
|
1302
|
+
<span />
|
|
1303
|
+
<span />
|
|
1304
|
+
</div>
|
|
1305
|
+
)
|
|
1306
|
+
}
|
|
1307
|
+
/>
|
|
1308
|
+
<SummaryCard
|
|
1309
|
+
label={S.layoutLabel}
|
|
1310
|
+
value={layout?.title ?? S.none}
|
|
1311
|
+
preview={
|
|
1312
|
+
layout && (
|
|
1313
|
+
<LayoutPreviewMini
|
|
1314
|
+
sidebar={layout.sidebar}
|
|
1315
|
+
topbar={layout.topbar}
|
|
1316
|
+
frameLayout={layout.appFrameLayout ?? "sidebar-first"}
|
|
1317
|
+
tabs={layout.tabs ?? false}
|
|
1318
|
+
/>
|
|
1319
|
+
)
|
|
1320
|
+
}
|
|
1321
|
+
/>
|
|
1322
|
+
</div>
|
|
1323
|
+
|
|
1324
|
+
<p className={styles.summaryHint}>{S.hint}</p>
|
|
1325
|
+
|
|
1326
|
+
<div className={styles.summaryAdvanced}>
|
|
1327
|
+
<button
|
|
1328
|
+
type="button"
|
|
1329
|
+
className={styles.summaryAdvancedToggle}
|
|
1330
|
+
onClick={() => setAdvancedOpen((v) => !v)}
|
|
1331
|
+
aria-expanded={advancedOpen}
|
|
1332
|
+
>
|
|
1333
|
+
<span>{S.advanced}</span>
|
|
1334
|
+
<Icon name={advancedOpen ? "caret-down" : "caret-right"} size={16} />
|
|
1335
|
+
|
|
1336
|
+
</button>
|
|
1337
|
+
{advancedOpen && (
|
|
1338
|
+
<div className={styles.summaryAdvancedBody}>
|
|
1339
|
+
<OnboardingAxisPanel variant="wide" themeId={answers.theme} />
|
|
1340
|
+
</div>
|
|
1341
|
+
)}
|
|
1342
|
+
</div>
|
|
1343
|
+
|
|
1344
|
+
</>
|
|
1345
|
+
);
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1348
|
+
function LayoutPreviewMini({
|
|
1349
|
+
sidebar,
|
|
1350
|
+
topbar,
|
|
1351
|
+
frameLayout,
|
|
1352
|
+
tabs,
|
|
1353
|
+
}: {
|
|
1354
|
+
sidebar: "left" | "right" | "dual" | "none";
|
|
1355
|
+
topbar: boolean;
|
|
1356
|
+
frameLayout: "sidebar-first" | "topbar-first";
|
|
1357
|
+
tabs: boolean;
|
|
1358
|
+
}) {
|
|
1359
|
+
const hasLeft = sidebar === "left" || sidebar === "dual";
|
|
1360
|
+
const hasRight = sidebar === "right" || sidebar === "dual";
|
|
1361
|
+
|
|
1362
|
+
if (topbar && frameLayout === "topbar-first") {
|
|
1363
|
+
return (
|
|
1364
|
+
<div className={styles.layoutPreview} data-frame="topbar-first" aria-hidden>
|
|
1365
|
+
<span className={styles.layoutPreviewBar} />
|
|
1366
|
+
{tabs && <span className={styles.layoutPreviewTabs} />}
|
|
1367
|
+
<span className={styles.layoutPreviewBody}>
|
|
1368
|
+
{hasLeft && <span className={styles.layoutPreviewRail} />}
|
|
1369
|
+
<span className={styles.layoutPreviewContent} />
|
|
1370
|
+
{hasRight && <span className={styles.layoutPreviewRail} />}
|
|
1371
|
+
</span>
|
|
1372
|
+
</div>
|
|
1373
|
+
);
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1376
|
+
return (
|
|
1377
|
+
<div className={styles.layoutPreview} data-frame="sidebar-first" aria-hidden>
|
|
1378
|
+
{hasLeft && <span className={styles.layoutPreviewRail} />}
|
|
1379
|
+
<span className={styles.layoutPreviewMain}>
|
|
1380
|
+
{topbar && <span className={styles.layoutPreviewBar} />}
|
|
1381
|
+
{tabs && <span className={styles.layoutPreviewTabs} />}
|
|
1382
|
+
<span className={styles.layoutPreviewContent} />
|
|
1383
|
+
</span>
|
|
1384
|
+
{hasRight && <span className={styles.layoutPreviewRail} />}
|
|
1385
|
+
</div>
|
|
1386
|
+
);
|
|
1387
|
+
}
|
|
1388
|
+
|
|
1389
|
+
function SummaryCard({
|
|
1390
|
+
label,
|
|
1391
|
+
value,
|
|
1392
|
+
preview,
|
|
1393
|
+
}: {
|
|
1394
|
+
label: string;
|
|
1395
|
+
value: string;
|
|
1396
|
+
preview?: React.ReactNode;
|
|
1397
|
+
}) {
|
|
1398
|
+
return (
|
|
1399
|
+
<div className={styles.summaryCard}>
|
|
1400
|
+
<div className={styles.summaryCardPreview}>{preview}</div>
|
|
1401
|
+
<div className={styles.summaryCardText}>
|
|
1402
|
+
<span className={styles.summaryLabel}>{label}</span>
|
|
1403
|
+
<span className={styles.summaryValue}>{value}</span>
|
|
1404
|
+
</div>
|
|
1405
|
+
</div>
|
|
1406
|
+
);
|
|
1407
|
+
}
|
|
1408
|
+
|
|
1409
|
+
// ────────────────────────────────────────────────────────
|
|
1410
|
+
// Free mode: 위저드 밖 자유 조정 (기존 갤러리 뷰 재사용)
|
|
1411
|
+
// ────────────────────────────────────────────────────────
|
|
1412
|
+
|
|
1413
|
+
function FreeMode({ onBack }: { onBack: () => void }) {
|
|
1414
|
+
const { lang } = useTheme();
|
|
1415
|
+
const F = LABELS[lang].free;
|
|
1416
|
+
const [tab, setTab] = useState<"presets" | "layout" | "docs">("presets");
|
|
1417
|
+
|
|
1418
|
+
return (
|
|
1419
|
+
<div className={styles.freeShell}>
|
|
1420
|
+
<div className={styles.freeAxis}>
|
|
1421
|
+
<div className={styles.freeAxisScroll}>
|
|
1422
|
+
<div className={styles.freeAxisInner}>
|
|
1423
|
+
<OnboardingAxisPanel />
|
|
1424
|
+
</div>
|
|
1425
|
+
</div>
|
|
1426
|
+
</div>
|
|
1427
|
+
<div className={styles.freeContent}>
|
|
1428
|
+
<div className={styles.freeContentInner}>
|
|
1429
|
+
<div className={styles.freeHeader}>
|
|
1430
|
+
<div>
|
|
1431
|
+
<h1 className={styles.freeTitle}>{F.title}</h1>
|
|
1432
|
+
<p className={styles.freeLead}>{F.lead}</p>
|
|
1433
|
+
</div>
|
|
1434
|
+
<Button variant="ghost" size="sm" onClick={onBack}>
|
|
1435
|
+
{F.backToWizard}
|
|
1436
|
+
</Button>
|
|
1437
|
+
</div>
|
|
1438
|
+
|
|
1439
|
+
<FreeTabs value={tab} onChange={setTab} />
|
|
1440
|
+
|
|
1441
|
+
{tab === "presets" && <PresetsGallery />}
|
|
1442
|
+
{tab === "layout" && <LayoutBuilder />}
|
|
1443
|
+
{tab === "docs" && <DocsIndex />}
|
|
1444
|
+
</div>
|
|
1445
|
+
</div>
|
|
1446
|
+
</div>
|
|
1447
|
+
);
|
|
1448
|
+
}
|
|
1449
|
+
|
|
1450
|
+
function FreeTabs({
|
|
1451
|
+
value,
|
|
1452
|
+
onChange,
|
|
1453
|
+
}: {
|
|
1454
|
+
value: "presets" | "layout" | "docs";
|
|
1455
|
+
onChange: (v: "presets" | "layout" | "docs") => void;
|
|
1456
|
+
}) {
|
|
1457
|
+
const { lang } = useTheme();
|
|
1458
|
+
const F = LABELS[lang].free;
|
|
1459
|
+
const tabs: { id: "presets" | "layout" | "docs"; label: string }[] = [
|
|
1460
|
+
{ id: "presets", label: F.tabPresets },
|
|
1461
|
+
{ id: "layout", label: F.tabLayout },
|
|
1462
|
+
{ id: "docs", label: F.tabDocs },
|
|
1463
|
+
];
|
|
1464
|
+
return (
|
|
1465
|
+
<div className={styles.segment} role="tablist">
|
|
1466
|
+
{tabs.map((t) => (
|
|
1467
|
+
<button
|
|
1468
|
+
key={t.id}
|
|
1469
|
+
type="button"
|
|
1470
|
+
className={styles.segmentItem}
|
|
1471
|
+
data-active={value === t.id || undefined}
|
|
1472
|
+
onClick={() => onChange(t.id)}
|
|
1473
|
+
role="tab"
|
|
1474
|
+
aria-selected={value === t.id}
|
|
1475
|
+
>
|
|
1476
|
+
{t.label}
|
|
1477
|
+
</button>
|
|
1478
|
+
))}
|
|
1479
|
+
</div>
|
|
1480
|
+
);
|
|
1481
|
+
}
|