@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,128 @@
|
|
|
1
|
+
/* Root ───────────────────────────────────────────────
|
|
2
|
+
가로 action 줄. IconButton·Button·텍스트 트리거를 품는다.
|
|
3
|
+
표현은 variant가 쥐고, 내부 구조(gap/정렬)만 공통.
|
|
4
|
+
단일 size — IconButton md(24)에 맞춘 bar 높이.
|
|
5
|
+
|
|
6
|
+
▸ Toolbar 내부 로컬 override: IconButton md 히트박스를 살짝 넓힌다.
|
|
7
|
+
기본 24 → 28. 아이콘 자체 크기는 그대로 두고 주변 여유만 확장해서
|
|
8
|
+
클릭 영역이 넉넉해지도록. */
|
|
9
|
+
.root {
|
|
10
|
+
display: inline-flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
gap: var(--space-1);
|
|
13
|
+
width: max-content;
|
|
14
|
+
color: var(--fg);
|
|
15
|
+
box-sizing: border-box;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* Size ──────────────────────────────────────────────
|
|
19
|
+
두 사이즈 모두 아이콘 18(16 + 2)로 통일하고 히트박스만 다르게 — 간격을 좁혀서
|
|
20
|
+
md가 커 보이고 sm이 작아 보이는 체감 문제 완화.
|
|
21
|
+
md — 히트 30 · 아이콘 18 (32·20보다 한 스텝 다운)
|
|
22
|
+
sm — 히트 28 · 아이콘 18 (히트만 2 작음)
|
|
23
|
+
scale에 없는 중간값(30·28·18)은 토큰 조합으로 합성 — Density 축에 비례. */
|
|
24
|
+
.root[data-size="md"] {
|
|
25
|
+
--iconbtn-h-md: calc(var(--control-h-sm) - var(--size-0-5));
|
|
26
|
+
--icon-size-sm: calc(var(--icon-size-md) - var(--size-0-5));
|
|
27
|
+
min-height: calc(var(--control-h-md) - var(--size-0-5));
|
|
28
|
+
padding-block: var(--space-1_5);
|
|
29
|
+
padding-inline: var(--space-2);
|
|
30
|
+
}
|
|
31
|
+
.root[data-size="sm"] {
|
|
32
|
+
--iconbtn-h-md: calc(var(--control-h-xs) + var(--size-1));
|
|
33
|
+
--icon-size-sm: calc(var(--icon-size-md) - var(--size-0-5));
|
|
34
|
+
min-height: calc(var(--control-h-xs) + var(--size-1));
|
|
35
|
+
padding-block: var(--space-1);
|
|
36
|
+
padding-inline: var(--space-1_5);
|
|
37
|
+
gap: var(--space-0_5);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* stretch=true : 콘텐츠 폭이 아니라 부모 폭을 꽉 채움 (attached의 기본값). */
|
|
41
|
+
.root[data-stretch] {
|
|
42
|
+
display: flex;
|
|
43
|
+
width: 100%;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/* Variants ──────────────────────────────────────────── */
|
|
47
|
+
|
|
48
|
+
/* floating — 떠 있는 알약.
|
|
49
|
+
bg-elevated + 얕은 그림자 + Shape 축에 또렷하게 반응하는 radius.
|
|
50
|
+
무게감은 hairline이 쥐고, 그림자는 분리감만 더한다.
|
|
51
|
+
Shape 축별 체감 폭을 크게 — crisp는 각지게(sm 4px), standard는 중간(lg 12px),
|
|
52
|
+
soft는 알약(full). scale 하나로 묶으면 axis별 체감이 평평해지는 자리라
|
|
53
|
+
data-shape 선택자로 Toolbar만 로컬 override. */
|
|
54
|
+
.root[data-variant="floating"] {
|
|
55
|
+
background: var(--bg-elevated, var(--bg));
|
|
56
|
+
border: var(--hairline) solid var(--border);
|
|
57
|
+
border-radius: var(--radius-lg);
|
|
58
|
+
box-shadow: var(--shadow-sm);
|
|
59
|
+
}
|
|
60
|
+
[data-shape="crisp"] .root[data-variant="floating"] {
|
|
61
|
+
border-radius: var(--radius-sm);
|
|
62
|
+
}
|
|
63
|
+
[data-shape="soft"] .root[data-variant="floating"] {
|
|
64
|
+
border-radius: var(--radius-2xl);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/* attached — 콘텐츠에 붙은 bar.
|
|
68
|
+
자체 bg 없음 + 하단 hairline만. 에디터 상단·문서 chrome. */
|
|
69
|
+
.root[data-variant="attached"] {
|
|
70
|
+
background: transparent;
|
|
71
|
+
border: 0;
|
|
72
|
+
border-bottom: var(--hairline) solid var(--border);
|
|
73
|
+
border-radius: 0;
|
|
74
|
+
box-shadow: none;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/* Group ─────────────────────────────────────────────── */
|
|
78
|
+
.group {
|
|
79
|
+
display: inline-flex;
|
|
80
|
+
align-items: center;
|
|
81
|
+
gap: var(--space-0_5);
|
|
82
|
+
flex-shrink: 0;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/* Divider ───────────────────────────────────────────────
|
|
86
|
+
세로 hairline. 그룹 사이 시각 구분.
|
|
87
|
+
굵기 --hairline 고정, 상/하 margin으로 아이콘 라인에서 살짝 안쪽. */
|
|
88
|
+
.divider {
|
|
89
|
+
width: var(--hairline);
|
|
90
|
+
align-self: stretch;
|
|
91
|
+
background: var(--border);
|
|
92
|
+
margin-inline: var(--space-1);
|
|
93
|
+
margin-block: var(--space-1_5);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/* Spacer ───────────────────────────────────────────── */
|
|
97
|
+
.spacer {
|
|
98
|
+
flex: 1 1 auto;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/* Vertical orientation ─────────────────────────────────
|
|
102
|
+
세로 toolbar. 사이드 패널·우측 inspector 자리. 아이템이 세로로 쌓임. */
|
|
103
|
+
.root[data-orientation="vertical"] {
|
|
104
|
+
flex-direction: column;
|
|
105
|
+
align-items: stretch;
|
|
106
|
+
width: max-content;
|
|
107
|
+
}
|
|
108
|
+
.root[data-orientation="vertical"][data-stretch] {
|
|
109
|
+
width: auto;
|
|
110
|
+
height: 100%;
|
|
111
|
+
}
|
|
112
|
+
.root[data-orientation="vertical"] .group {
|
|
113
|
+
flex-direction: column;
|
|
114
|
+
align-items: stretch;
|
|
115
|
+
}
|
|
116
|
+
/* 세로 toolbar의 divider는 가로 hairline (orientation 반전) */
|
|
117
|
+
.root[data-orientation="vertical"] .divider {
|
|
118
|
+
width: auto;
|
|
119
|
+
height: var(--hairline);
|
|
120
|
+
align-self: stretch;
|
|
121
|
+
margin-inline: var(--space-1_5);
|
|
122
|
+
margin-block: var(--space-1);
|
|
123
|
+
}
|
|
124
|
+
/* 세로 attached는 우측 hairline으로 */
|
|
125
|
+
.root[data-orientation="vertical"][data-variant="attached"] {
|
|
126
|
+
border-bottom: 0;
|
|
127
|
+
border-right: var(--hairline) solid var(--border);
|
|
128
|
+
}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
forwardRef,
|
|
5
|
+
useCallback,
|
|
6
|
+
useEffect,
|
|
7
|
+
useRef,
|
|
8
|
+
type HTMLAttributes,
|
|
9
|
+
type KeyboardEvent as ReactKeyboardEvent,
|
|
10
|
+
} from "react";
|
|
11
|
+
|
|
12
|
+
import { cn } from "../_cn";
|
|
13
|
+
import styles from "./Toolbar.module.css";
|
|
14
|
+
|
|
15
|
+
/* Root ─────────────────────────────────────────────────
|
|
16
|
+
툴바 — IconButton 중심의 action 줄.
|
|
17
|
+
variant:
|
|
18
|
+
- floating : 떠 있는 알약(bg-elevated + shadow-md + radius-xl)
|
|
19
|
+
- attached : 콘텐츠에 붙은 bar (transparent + 하단 hairline)
|
|
20
|
+
size:
|
|
21
|
+
- md(기본) : 히트박스 32 · 아이콘 20 — 표준 자리
|
|
22
|
+
- sm : 히트박스 24 · 아이콘 16 — 밀도 승부처(사이드바 바닥·인라인 bar)
|
|
23
|
+
orientation:
|
|
24
|
+
- horizontal(기본) : 가로. 키보드 ← → 로 그룹 안 순회
|
|
25
|
+
- vertical : 세로. 키보드 ↑ ↓ 로 그룹 안 순회
|
|
26
|
+
*/
|
|
27
|
+
export type ToolbarVariant = "floating" | "attached";
|
|
28
|
+
export type ToolbarSize = "sm" | "md";
|
|
29
|
+
export type ToolbarOrientation = "horizontal" | "vertical";
|
|
30
|
+
|
|
31
|
+
export interface ToolbarProps extends HTMLAttributes<HTMLElement> {
|
|
32
|
+
variant?: ToolbarVariant;
|
|
33
|
+
size?: ToolbarSize;
|
|
34
|
+
orientation?: ToolbarOrientation;
|
|
35
|
+
/** 가로 꽉 채울지(attached에 어울림) vs 콘텐츠 폭(floating). 기본은 variant로 자동 결정. */
|
|
36
|
+
stretch?: boolean;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/* 포커스 가능한 자식만 roving tabindex 대상. button, [role="button"] 등. */
|
|
40
|
+
const FOCUSABLE_SELECTOR = [
|
|
41
|
+
"button:not(:disabled):not([aria-disabled='true'])",
|
|
42
|
+
"[role='button']:not([aria-disabled='true'])",
|
|
43
|
+
"a[href]",
|
|
44
|
+
].join(",");
|
|
45
|
+
|
|
46
|
+
const ToolbarRoot = forwardRef<HTMLDivElement, ToolbarProps>(function ToolbarRoot(
|
|
47
|
+
{
|
|
48
|
+
variant = "floating",
|
|
49
|
+
size = "md",
|
|
50
|
+
orientation = "horizontal",
|
|
51
|
+
stretch,
|
|
52
|
+
className,
|
|
53
|
+
children,
|
|
54
|
+
role = "toolbar",
|
|
55
|
+
...rest
|
|
56
|
+
},
|
|
57
|
+
ref,
|
|
58
|
+
) {
|
|
59
|
+
const resolvedStretch = stretch ?? variant === "attached";
|
|
60
|
+
const rootRef = useRef<HTMLDivElement>(null);
|
|
61
|
+
|
|
62
|
+
/* roving tabindex: 하나만 tabIndex=0, 나머지는 -1. 포커스 들어오면 그 요소를 활성. */
|
|
63
|
+
useEffect(() => {
|
|
64
|
+
const root = rootRef.current;
|
|
65
|
+
if (!root) return;
|
|
66
|
+
const focusables = Array.from(
|
|
67
|
+
root.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR),
|
|
68
|
+
);
|
|
69
|
+
focusables.forEach((el, i) => {
|
|
70
|
+
el.tabIndex = i === 0 ? 0 : -1;
|
|
71
|
+
});
|
|
72
|
+
}, [children]);
|
|
73
|
+
|
|
74
|
+
const onKeyDown = useCallback(
|
|
75
|
+
(e: ReactKeyboardEvent<HTMLDivElement>) => {
|
|
76
|
+
const root = rootRef.current;
|
|
77
|
+
if (!root) return;
|
|
78
|
+
|
|
79
|
+
const forwardKey = orientation === "horizontal" ? "ArrowRight" : "ArrowDown";
|
|
80
|
+
const backwardKey = orientation === "horizontal" ? "ArrowLeft" : "ArrowUp";
|
|
81
|
+
|
|
82
|
+
if (e.key !== forwardKey && e.key !== backwardKey && e.key !== "Home" && e.key !== "End") {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const focusables = Array.from(
|
|
87
|
+
root.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR),
|
|
88
|
+
);
|
|
89
|
+
if (focusables.length === 0) return;
|
|
90
|
+
const current = document.activeElement as HTMLElement | null;
|
|
91
|
+
const currentIdx = current ? focusables.indexOf(current) : -1;
|
|
92
|
+
if (currentIdx === -1) return;
|
|
93
|
+
|
|
94
|
+
e.preventDefault();
|
|
95
|
+
let nextIdx = currentIdx;
|
|
96
|
+
if (e.key === forwardKey) nextIdx = (currentIdx + 1) % focusables.length;
|
|
97
|
+
else if (e.key === backwardKey) nextIdx = (currentIdx - 1 + focusables.length) % focusables.length;
|
|
98
|
+
else if (e.key === "Home") nextIdx = 0;
|
|
99
|
+
else if (e.key === "End") nextIdx = focusables.length - 1;
|
|
100
|
+
|
|
101
|
+
focusables.forEach((el, i) => {
|
|
102
|
+
el.tabIndex = i === nextIdx ? 0 : -1;
|
|
103
|
+
});
|
|
104
|
+
focusables[nextIdx].focus();
|
|
105
|
+
},
|
|
106
|
+
[orientation],
|
|
107
|
+
);
|
|
108
|
+
|
|
109
|
+
/* 포커스가 아이템에 들어오면 그 아이템만 tabIndex=0, 다른 건 -1 */
|
|
110
|
+
const onFocus = useCallback(
|
|
111
|
+
(e: React.FocusEvent<HTMLDivElement>) => {
|
|
112
|
+
const root = rootRef.current;
|
|
113
|
+
if (!root) return;
|
|
114
|
+
const target = e.target as HTMLElement;
|
|
115
|
+
const focusables = Array.from(
|
|
116
|
+
root.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR),
|
|
117
|
+
);
|
|
118
|
+
if (!focusables.includes(target)) return;
|
|
119
|
+
focusables.forEach((el) => {
|
|
120
|
+
el.tabIndex = el === target ? 0 : -1;
|
|
121
|
+
});
|
|
122
|
+
},
|
|
123
|
+
[],
|
|
124
|
+
);
|
|
125
|
+
|
|
126
|
+
const setRef = (node: HTMLDivElement | null) => {
|
|
127
|
+
rootRef.current = node;
|
|
128
|
+
if (typeof ref === "function") ref(node);
|
|
129
|
+
else if (ref) (ref as React.MutableRefObject<HTMLDivElement | null>).current = node;
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
return (
|
|
133
|
+
<div
|
|
134
|
+
ref={setRef}
|
|
135
|
+
role={role}
|
|
136
|
+
aria-orientation={orientation}
|
|
137
|
+
className={cn(styles.root, className)}
|
|
138
|
+
data-variant={variant}
|
|
139
|
+
data-size={size}
|
|
140
|
+
data-orientation={orientation}
|
|
141
|
+
data-stretch={resolvedStretch || undefined}
|
|
142
|
+
onKeyDown={onKeyDown}
|
|
143
|
+
onFocus={onFocus}
|
|
144
|
+
{...rest}
|
|
145
|
+
>
|
|
146
|
+
{children}
|
|
147
|
+
</div>
|
|
148
|
+
);
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
/* Group ─────────────────────────────────────────────────
|
|
152
|
+
관련 액션 묶음. 내부는 좁은 gap, 그룹 간은 Divider 또는 넓은 gap으로 구분. */
|
|
153
|
+
interface ToolbarGroupProps extends HTMLAttributes<HTMLDivElement> {}
|
|
154
|
+
|
|
155
|
+
function ToolbarGroup({ className, children, ...rest }: ToolbarGroupProps) {
|
|
156
|
+
return (
|
|
157
|
+
<div className={cn(styles.group, className)} role="group" {...rest}>
|
|
158
|
+
{children}
|
|
159
|
+
</div>
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/* Divider ───────────────────────────────────────────────
|
|
164
|
+
세로 hairline. 그룹 사이 시각 구분. Toolbar orientation에 따라 자동 회전. */
|
|
165
|
+
function ToolbarDivider() {
|
|
166
|
+
return <div className={styles.divider} role="separator" />;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/* Spacer ────────────────────────────────────────────────
|
|
170
|
+
좌/우(가로) 또는 상/하(세로) 정렬용 flex:1. */
|
|
171
|
+
function ToolbarSpacer() {
|
|
172
|
+
return <div className={styles.spacer} aria-hidden />;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
type ToolbarComponent = typeof ToolbarRoot & {
|
|
176
|
+
Group: typeof ToolbarGroup;
|
|
177
|
+
Divider: typeof ToolbarDivider;
|
|
178
|
+
Spacer: typeof ToolbarSpacer;
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
const Toolbar = ToolbarRoot as ToolbarComponent;
|
|
182
|
+
Toolbar.Group = ToolbarGroup;
|
|
183
|
+
Toolbar.Divider = ToolbarDivider;
|
|
184
|
+
Toolbar.Spacer = ToolbarSpacer;
|
|
185
|
+
|
|
186
|
+
export { Toolbar };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
.content {
|
|
2
|
+
position: relative;
|
|
3
|
+
color: var(--tooltip-fg);
|
|
4
|
+
font-size: var(--text-xs);
|
|
5
|
+
line-height: var(--lh-xs);
|
|
6
|
+
max-width: 240px;
|
|
7
|
+
white-space: pre-line;
|
|
8
|
+
user-select: none;
|
|
9
|
+
z-index: var(--z-tooltip);
|
|
10
|
+
/* 배경/그림자는 SVG path에 걸림 */
|
|
11
|
+
filter: drop-shadow(var(--shadow-drop));
|
|
12
|
+
/* 앵커(트리거) 엣지에서 자라나는 느낌을 위해 Radix가 계산한 원점 사용 */
|
|
13
|
+
transform-origin: var(--radix-tooltip-content-transform-origin);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/* In · Out 애니메이션은 전역 유틸 `.m-float`가 담당한다.
|
|
17
|
+
Tooltip.tsx에서 Content className에 "m-float"을 concat해 발동.
|
|
18
|
+
Radix Tooltip은 delayed-open · closed state를 데이터 어트리뷰트로 노출하므로
|
|
19
|
+
유틸이 그대로 매칭한다. */
|
|
20
|
+
|
|
21
|
+
/* SVG shape: content 크기에 딱 맞게 절대 위치 */
|
|
22
|
+
.shape {
|
|
23
|
+
position: absolute;
|
|
24
|
+
inset: 0;
|
|
25
|
+
display: block;
|
|
26
|
+
pointer-events: none;
|
|
27
|
+
}
|
|
28
|
+
.shapePath {
|
|
29
|
+
fill: var(--tooltip-bg);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* 텍스트 레이어: SVG 위에 올라감. side별로 tail 크기만큼 패딩을 밀어줌 */
|
|
33
|
+
.text {
|
|
34
|
+
position: relative;
|
|
35
|
+
padding: var(--space-1) var(--space-2);
|
|
36
|
+
}
|
|
37
|
+
.content[data-side="top"] .text { padding-bottom: calc(var(--space-1) + var(--tail)); }
|
|
38
|
+
.content[data-side="bottom"] .text { padding-top: calc(var(--space-1) + var(--tail)); }
|
|
39
|
+
.content[data-side="left"] .text { padding-right: calc(var(--space-2) + var(--tail)); }
|
|
40
|
+
.content[data-side="right"] .text { padding-left: calc(var(--space-2) + var(--tail)); }
|
|
41
|
+
|
|
42
|
+
/* keyframes(m-emerge-*)는 globals.css의 Motion 프리미티브에서 정의됨 */
|
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as RadixTooltip from "@radix-ui/react-tooltip";
|
|
4
|
+
import {
|
|
5
|
+
forwardRef,
|
|
6
|
+
useEffect,
|
|
7
|
+
useLayoutEffect,
|
|
8
|
+
useRef,
|
|
9
|
+
useState,
|
|
10
|
+
type ReactNode,
|
|
11
|
+
} from "react";
|
|
12
|
+
import styles from "./Tooltip.module.css";
|
|
13
|
+
|
|
14
|
+
type Side = "top" | "right" | "bottom" | "left";
|
|
15
|
+
type Align = "start" | "center" | "end";
|
|
16
|
+
|
|
17
|
+
export interface TooltipProps {
|
|
18
|
+
content: ReactNode;
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
/** 튀어나올 방향. 뷰포트 충돌 시 자동 flip. 기본 top. */
|
|
21
|
+
side?: Side;
|
|
22
|
+
/** 그 방향에서의 정렬. 기본 center. */
|
|
23
|
+
align?: Align;
|
|
24
|
+
/** 트리거와의 간격 (px). 기본 6. */
|
|
25
|
+
sideOffset?: number;
|
|
26
|
+
/**
|
|
27
|
+
* 꼭지(arrow)의 위치를 중심에서 얼마나 밀지 (px).
|
|
28
|
+
* side=top/bottom이면 x축, side=left/right면 y축으로 이동.
|
|
29
|
+
* 기본 0 = 툴팁 본체의 정중앙.
|
|
30
|
+
* followMouse가 true면 이 값은 무시됩니다.
|
|
31
|
+
*/
|
|
32
|
+
arrowOffset?: number;
|
|
33
|
+
/**
|
|
34
|
+
* 마우스가 트리거 위에서 움직일 때 꼭지가 마우스를 따라가게 함.
|
|
35
|
+
* side=top/bottom일 때 x축, left/right일 때 y축을 따라감.
|
|
36
|
+
*/
|
|
37
|
+
followMouse?: boolean;
|
|
38
|
+
delayDuration?: number;
|
|
39
|
+
open?: boolean;
|
|
40
|
+
onOpenChange?: (open: boolean) => void;
|
|
41
|
+
/** 화살표 표시 여부. 기본 true. */
|
|
42
|
+
arrow?: boolean;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/* --- SVG path 프리셋 ---
|
|
46
|
+
body(rounded rect) + tail(삼각형)을 하나의 path로 그린다.
|
|
47
|
+
폭/높이는 사용처의 크기를 따라가고, 꼭지 위치는 CSS 변수 --arrow-x/--arrow-y로 제어. */
|
|
48
|
+
|
|
49
|
+
// 각 side별 path 함수: 컨테이너 크기(width, height)와 꼭지 위치(arrowPos), 꼭지 크기(tail), radius를 받아 path d 문자열 반환
|
|
50
|
+
const TAIL = 6; // 꼭지 크기 (side offset이 이만큼 필요)
|
|
51
|
+
const RADIUS = 6;
|
|
52
|
+
|
|
53
|
+
function buildPath(
|
|
54
|
+
side: Side,
|
|
55
|
+
w: number,
|
|
56
|
+
h: number,
|
|
57
|
+
arrowPos: number, // side가 top/bottom이면 x좌표, left/right면 y좌표
|
|
58
|
+
hasArrow: boolean
|
|
59
|
+
): string {
|
|
60
|
+
const r = Math.min(RADIUS, Math.min(w, h) / 2);
|
|
61
|
+
const t = TAIL;
|
|
62
|
+
|
|
63
|
+
if (side === "top") {
|
|
64
|
+
// body는 0..w-t 세로, arrow는 아래로 삐죽
|
|
65
|
+
const bodyH = h - t;
|
|
66
|
+
// arrow 위치는 x축, tail의 tip이 아래로 나감
|
|
67
|
+
const cx = clamp(arrowPos, r + t, w - r - t);
|
|
68
|
+
return [
|
|
69
|
+
`M${r},0`,
|
|
70
|
+
`H${w - r}`,
|
|
71
|
+
`Q${w},0 ${w},${r}`,
|
|
72
|
+
`V${bodyH - r}`,
|
|
73
|
+
`Q${w},${bodyH} ${w - r},${bodyH}`,
|
|
74
|
+
hasArrow ? `H${cx + t}` : "",
|
|
75
|
+
hasArrow ? `L${cx},${h}` : "",
|
|
76
|
+
hasArrow ? `L${cx - t},${bodyH}` : "",
|
|
77
|
+
`H${r}`,
|
|
78
|
+
`Q0,${bodyH} 0,${bodyH - r}`,
|
|
79
|
+
`V${r}`,
|
|
80
|
+
`Q0,0 ${r},0`,
|
|
81
|
+
`Z`,
|
|
82
|
+
]
|
|
83
|
+
.filter(Boolean)
|
|
84
|
+
.join(" ");
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (side === "bottom") {
|
|
88
|
+
// body는 t..h 세로, arrow는 위로 삐죽
|
|
89
|
+
const bodyTop = t;
|
|
90
|
+
const cx = clamp(arrowPos, r + t, w - r - t);
|
|
91
|
+
return [
|
|
92
|
+
`M${r},${bodyTop}`,
|
|
93
|
+
hasArrow ? `H${cx - t}` : "",
|
|
94
|
+
hasArrow ? `L${cx},0` : "",
|
|
95
|
+
hasArrow ? `L${cx + t},${bodyTop}` : "",
|
|
96
|
+
`H${w - r}`,
|
|
97
|
+
`Q${w},${bodyTop} ${w},${bodyTop + r}`,
|
|
98
|
+
`V${h - r}`,
|
|
99
|
+
`Q${w},${h} ${w - r},${h}`,
|
|
100
|
+
`H${r}`,
|
|
101
|
+
`Q0,${h} 0,${h - r}`,
|
|
102
|
+
`V${bodyTop + r}`,
|
|
103
|
+
`Q0,${bodyTop} ${r},${bodyTop}`,
|
|
104
|
+
`Z`,
|
|
105
|
+
]
|
|
106
|
+
.filter(Boolean)
|
|
107
|
+
.join(" ");
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
if (side === "left") {
|
|
111
|
+
// body는 0..w-t 가로, arrow는 오른쪽으로 삐죽
|
|
112
|
+
const bodyW = w - t;
|
|
113
|
+
const cy = clamp(arrowPos, r + t, h - r - t);
|
|
114
|
+
return [
|
|
115
|
+
`M${r},0`,
|
|
116
|
+
`H${bodyW - r}`,
|
|
117
|
+
`Q${bodyW},0 ${bodyW},${r}`,
|
|
118
|
+
hasArrow ? `V${cy - t}` : "",
|
|
119
|
+
hasArrow ? `L${w},${cy}` : "",
|
|
120
|
+
hasArrow ? `L${bodyW},${cy + t}` : "",
|
|
121
|
+
`V${h - r}`,
|
|
122
|
+
`Q${bodyW},${h} ${bodyW - r},${h}`,
|
|
123
|
+
`H${r}`,
|
|
124
|
+
`Q0,${h} 0,${h - r}`,
|
|
125
|
+
`V${r}`,
|
|
126
|
+
`Q0,0 ${r},0`,
|
|
127
|
+
`Z`,
|
|
128
|
+
]
|
|
129
|
+
.filter(Boolean)
|
|
130
|
+
.join(" ");
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// right
|
|
134
|
+
// body는 t..w 가로, arrow는 왼쪽으로 삐죽
|
|
135
|
+
const bodyLeft = t;
|
|
136
|
+
const cy = clamp(arrowPos, r + t, h - r - t);
|
|
137
|
+
return [
|
|
138
|
+
`M${bodyLeft + r},0`,
|
|
139
|
+
`H${w - r}`,
|
|
140
|
+
`Q${w},0 ${w},${r}`,
|
|
141
|
+
`V${h - r}`,
|
|
142
|
+
`Q${w},${h} ${w - r},${h}`,
|
|
143
|
+
`H${bodyLeft + r}`,
|
|
144
|
+
`Q${bodyLeft},${h} ${bodyLeft},${h - r}`,
|
|
145
|
+
hasArrow ? `V${cy + t}` : "",
|
|
146
|
+
hasArrow ? `L0,${cy}` : "",
|
|
147
|
+
hasArrow ? `L${bodyLeft},${cy - t}` : "",
|
|
148
|
+
`V${r}`,
|
|
149
|
+
`Q${bodyLeft},0 ${bodyLeft + r},0`,
|
|
150
|
+
`Z`,
|
|
151
|
+
]
|
|
152
|
+
.filter(Boolean)
|
|
153
|
+
.join(" ");
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function clamp(v: number, min: number, max: number) {
|
|
157
|
+
return Math.max(min, Math.min(max, v));
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Radix Content를 감싼 컴포넌트. content 크기를 재서 SVG path를 다시 그린다.
|
|
162
|
+
* data-side는 Radix가 자동 flip 후 세팅해주는 값(top/right/bottom/left)을 그대로 씀.
|
|
163
|
+
*/
|
|
164
|
+
const CustomContent = forwardRef<
|
|
165
|
+
HTMLDivElement,
|
|
166
|
+
{
|
|
167
|
+
initialSide: Side;
|
|
168
|
+
align: Align;
|
|
169
|
+
sideOffset: number;
|
|
170
|
+
arrowOffset: number;
|
|
171
|
+
arrow: boolean;
|
|
172
|
+
children: ReactNode;
|
|
173
|
+
}
|
|
174
|
+
>(({ initialSide, align, sideOffset, arrowOffset, arrow, children }, ref) => {
|
|
175
|
+
const contentRef = useRef<HTMLDivElement | null>(null);
|
|
176
|
+
const [size, setSize] = useState<{ w: number; h: number } | null>(null);
|
|
177
|
+
const [side, setSide] = useState<Side>(initialSide);
|
|
178
|
+
|
|
179
|
+
// 크기 측정 + 실제 렌더링된 side(자동 flip 반영) 관측
|
|
180
|
+
useLayoutEffect(() => {
|
|
181
|
+
const el = contentRef.current;
|
|
182
|
+
if (!el) return;
|
|
183
|
+
const measure = () => {
|
|
184
|
+
const rect = el.getBoundingClientRect();
|
|
185
|
+
setSize({ w: rect.width, h: rect.height });
|
|
186
|
+
const s = el.getAttribute("data-side") as Side | null;
|
|
187
|
+
if (s) setSide(s);
|
|
188
|
+
};
|
|
189
|
+
measure();
|
|
190
|
+
const ro = new ResizeObserver(measure);
|
|
191
|
+
ro.observe(el);
|
|
192
|
+
// data-side는 Radix가 mount 후 세팅하므로 MutationObserver로 관측
|
|
193
|
+
const mo = new MutationObserver(measure);
|
|
194
|
+
mo.observe(el, { attributes: true, attributeFilter: ["data-side"] });
|
|
195
|
+
return () => {
|
|
196
|
+
ro.disconnect();
|
|
197
|
+
mo.disconnect();
|
|
198
|
+
};
|
|
199
|
+
}, []);
|
|
200
|
+
|
|
201
|
+
// arrow 위치: side에 따라 x 또는 y 좌표
|
|
202
|
+
const arrowPos = size
|
|
203
|
+
? side === "top" || side === "bottom"
|
|
204
|
+
? size.w / 2 + arrowOffset
|
|
205
|
+
: size.h / 2 + arrowOffset
|
|
206
|
+
: 0;
|
|
207
|
+
|
|
208
|
+
const d = size ? buildPath(side, size.w, size.h, arrowPos, arrow) : "";
|
|
209
|
+
|
|
210
|
+
return (
|
|
211
|
+
<RadixTooltip.Content
|
|
212
|
+
ref={(node) => {
|
|
213
|
+
contentRef.current = node;
|
|
214
|
+
if (typeof ref === "function") ref(node);
|
|
215
|
+
else if (ref) ref.current = node;
|
|
216
|
+
}}
|
|
217
|
+
className={[styles.content, "m-float"].join(" ")}
|
|
218
|
+
side={initialSide}
|
|
219
|
+
align={align}
|
|
220
|
+
sideOffset={sideOffset}
|
|
221
|
+
collisionPadding={8}
|
|
222
|
+
// side에 따라 tail 방향 패딩 확보
|
|
223
|
+
style={
|
|
224
|
+
{
|
|
225
|
+
"--tail": `${TAIL}px`,
|
|
226
|
+
} as React.CSSProperties
|
|
227
|
+
}
|
|
228
|
+
data-side-current={side}
|
|
229
|
+
>
|
|
230
|
+
{size && (
|
|
231
|
+
<svg
|
|
232
|
+
className={styles.shape}
|
|
233
|
+
width={size.w}
|
|
234
|
+
height={size.h}
|
|
235
|
+
viewBox={`0 0 ${size.w} ${size.h}`}
|
|
236
|
+
preserveAspectRatio="none"
|
|
237
|
+
aria-hidden="true"
|
|
238
|
+
>
|
|
239
|
+
<path d={d} className={styles.shapePath} />
|
|
240
|
+
</svg>
|
|
241
|
+
)}
|
|
242
|
+
<div className={styles.text}>{children}</div>
|
|
243
|
+
</RadixTooltip.Content>
|
|
244
|
+
);
|
|
245
|
+
});
|
|
246
|
+
CustomContent.displayName = "CustomContent";
|
|
247
|
+
|
|
248
|
+
export const Tooltip = forwardRef<HTMLDivElement, TooltipProps>(
|
|
249
|
+
(
|
|
250
|
+
{
|
|
251
|
+
content,
|
|
252
|
+
children,
|
|
253
|
+
side = "top",
|
|
254
|
+
align = "center",
|
|
255
|
+
sideOffset = 6,
|
|
256
|
+
arrowOffset = 0,
|
|
257
|
+
followMouse = false,
|
|
258
|
+
delayDuration,
|
|
259
|
+
open,
|
|
260
|
+
onOpenChange,
|
|
261
|
+
arrow = true,
|
|
262
|
+
},
|
|
263
|
+
ref
|
|
264
|
+
) => {
|
|
265
|
+
const triggerRef = useRef<HTMLElement | null>(null);
|
|
266
|
+
const [mouseOffset, setMouseOffset] = useState(0);
|
|
267
|
+
|
|
268
|
+
// followMouse: 트리거 위에서의 마우스 좌표를 arrow 위치로 환산
|
|
269
|
+
useEffect(() => {
|
|
270
|
+
if (!followMouse) return;
|
|
271
|
+
const el = triggerRef.current;
|
|
272
|
+
if (!el) return;
|
|
273
|
+
const onMove = (e: MouseEvent) => {
|
|
274
|
+
const rect = el.getBoundingClientRect();
|
|
275
|
+
if (side === "top" || side === "bottom") {
|
|
276
|
+
const cx = rect.left + rect.width / 2;
|
|
277
|
+
setMouseOffset(e.clientX - cx);
|
|
278
|
+
} else {
|
|
279
|
+
const cy = rect.top + rect.height / 2;
|
|
280
|
+
setMouseOffset(e.clientY - cy);
|
|
281
|
+
}
|
|
282
|
+
};
|
|
283
|
+
el.addEventListener("mousemove", onMove);
|
|
284
|
+
return () => el.removeEventListener("mousemove", onMove);
|
|
285
|
+
}, [followMouse, side]);
|
|
286
|
+
|
|
287
|
+
const effectiveArrowOffset = followMouse ? mouseOffset : arrowOffset;
|
|
288
|
+
|
|
289
|
+
return (
|
|
290
|
+
<RadixTooltip.Root
|
|
291
|
+
delayDuration={delayDuration}
|
|
292
|
+
open={open}
|
|
293
|
+
onOpenChange={onOpenChange}
|
|
294
|
+
>
|
|
295
|
+
<RadixTooltip.Trigger asChild ref={triggerRef as React.RefObject<HTMLButtonElement>}>
|
|
296
|
+
{children}
|
|
297
|
+
</RadixTooltip.Trigger>
|
|
298
|
+
<RadixTooltip.Portal>
|
|
299
|
+
<CustomContent
|
|
300
|
+
ref={ref}
|
|
301
|
+
initialSide={side}
|
|
302
|
+
align={align}
|
|
303
|
+
sideOffset={sideOffset}
|
|
304
|
+
arrowOffset={effectiveArrowOffset}
|
|
305
|
+
arrow={arrow}
|
|
306
|
+
>
|
|
307
|
+
{content}
|
|
308
|
+
</CustomContent>
|
|
309
|
+
</RadixTooltip.Portal>
|
|
310
|
+
</RadixTooltip.Root>
|
|
311
|
+
);
|
|
312
|
+
}
|
|
313
|
+
);
|
|
314
|
+
|
|
315
|
+
Tooltip.displayName = "Tooltip";
|
|
316
|
+
|
|
317
|
+
export const TooltipProvider = ({
|
|
318
|
+
delayDuration = 300,
|
|
319
|
+
skipDelayDuration = 300,
|
|
320
|
+
children,
|
|
321
|
+
}: {
|
|
322
|
+
delayDuration?: number;
|
|
323
|
+
skipDelayDuration?: number;
|
|
324
|
+
children: ReactNode;
|
|
325
|
+
}) => (
|
|
326
|
+
<RadixTooltip.Provider
|
|
327
|
+
delayDuration={delayDuration}
|
|
328
|
+
skipDelayDuration={skipDelayDuration}
|
|
329
|
+
>
|
|
330
|
+
{children}
|
|
331
|
+
</RadixTooltip.Provider>
|
|
332
|
+
);
|