@dfosco/storyboard-core 4.2.0-beta.4 → 4.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/commandpalette.config.json +109 -24
- package/dist/storyboard-ui.css +1 -1
- package/dist/storyboard-ui.js +16711 -27239
- package/dist/storyboard-ui.js.map +1 -1
- package/dist/tailwind.css +1 -1
- package/package.json +5 -2
- package/scaffold/agents/prompt-agent.agent.md +181 -0
- package/scaffold/agents/terminal-agent.agent.md +351 -0
- package/scaffold/codex/config.toml +246 -0
- package/scaffold/manifest.json +5 -10
- package/scaffold/skills/canvas/SKILL.md +5 -4
- package/scaffold/skills/ship/SKILL.md +1 -1
- package/scaffold/storyboard.config.json +11 -1
- package/src/ActionMenuButton.jsx +103 -0
- package/src/AutosyncMenuButton.css +67 -0
- package/src/AutosyncMenuButton.jsx +242 -0
- package/src/BranchSelect.jsx +29 -0
- package/src/BranchSelect.module.css +30 -0
- package/src/CanvasAgentsMenu.jsx +89 -0
- package/src/CanvasCreateMenu.jsx +611 -0
- package/src/CanvasSnap.css +27 -0
- package/src/CanvasSnap.jsx +51 -0
- package/src/CanvasUndoRedo.css +36 -0
- package/src/CanvasUndoRedo.jsx +62 -0
- package/src/CanvasZoomControl.css +53 -0
- package/src/CanvasZoomControl.jsx +49 -0
- package/src/CanvasZoomToFit.css +18 -0
- package/src/CanvasZoomToFit.jsx +26 -0
- package/src/CommandMenu.css +8 -0
- package/src/CommandMenu.jsx +287 -0
- package/src/CommandPalette.jsx +35 -0
- package/src/CommandPaletteTrigger.jsx +25 -0
- package/src/CommentsMenuButton.jsx +40 -0
- package/src/CoreUIBar.css +47 -0
- package/src/CoreUIBar.jsx +858 -0
- package/src/CreateMenuButton.jsx +117 -0
- package/src/HideChromeTrigger.jsx +40 -0
- package/src/InspectorPanel.css +109 -0
- package/src/InspectorPanel.jsx +632 -0
- package/src/PwaInstallBanner.css +42 -0
- package/src/PwaInstallBanner.jsx +124 -0
- package/src/SidePanel.jsx +261 -0
- package/src/ThemeMenuButton.jsx +139 -0
- package/src/autosync/server.js +202 -5
- package/src/autosync/server.test.js +111 -0
- package/src/canvas/__tests__/agent-integration.test.js +596 -0
- package/src/canvas/__tests__/helpers/browser.js +95 -0
- package/src/canvas/__tests__/helpers/canvas-api.js +129 -0
- package/src/canvas/__tests__/helpers/perf.js +118 -0
- package/src/canvas/__tests__/helpers/setup.js +176 -0
- package/src/canvas/__tests__/helpers/tmux.js +130 -0
- package/src/canvas/__tests__/helpers/transcript.js +132 -0
- package/src/canvas/__tests__/terminal-integration.test.js +177 -0
- package/src/canvas/hot-pool.js +756 -0
- package/src/canvas/materializer.js +31 -0
- package/src/canvas/materializer.test.js +56 -0
- package/src/canvas/selectedWidgets.js +65 -7
- package/src/canvas/server.js +1802 -22
- package/src/canvas/server.test.js +239 -0
- package/src/canvas/terminal-config.js +330 -0
- package/src/canvas/terminal-registry.js +41 -3
- package/src/canvas/terminal-server.js +1098 -37
- package/src/canvas/writeGuard.js +51 -3
- package/src/canvasConfig.js +67 -1
- package/src/canvasConfig.test.js +79 -1
- package/src/cli/agent.js +85 -0
- package/src/cli/branch.js +232 -0
- package/src/cli/canvasAdd.js +61 -14
- package/src/cli/canvasBatch.js +98 -0
- package/src/cli/canvasBounds.js +1 -1
- package/src/cli/canvasRead.js +1 -1
- package/src/cli/canvasUpdate.js +179 -0
- package/src/cli/compact.js +0 -2
- package/src/cli/create.js +40 -16
- package/src/cli/dev.js +158 -84
- package/src/cli/exit.js +23 -24
- package/src/cli/index.js +55 -2
- package/src/cli/proxy.js +96 -37
- package/src/cli/schemas.js +22 -4
- package/src/cli/server.js +149 -26
- package/src/cli/serverUrl.js +8 -3
- package/src/cli/sessions.js +133 -7
- package/src/cli/setup.js +138 -12
- package/src/cli/terminal-commands.js +20 -9
- package/src/cli/terminal-messaging.js +231 -0
- package/src/cli/terminal-welcome.js +449 -34
- package/src/cli/updateVersion.js +1 -1
- package/src/commandActions.js +1 -0
- package/src/commandPaletteConfig.js +9 -0
- package/src/comments/auth.js +2 -1
- package/src/comments/ui/AuthModal.jsx +114 -0
- package/src/comments/ui/CommentWindow.jsx +329 -0
- package/src/comments/ui/CommentsDrawer.jsx +102 -0
- package/src/comments/ui/Composer.jsx +64 -0
- package/src/comments/ui/authModal.test.js +1 -1
- package/src/comments/ui/commentWindow.js +16 -17
- package/src/comments/ui/commentsDrawer.js +25 -26
- package/src/comments/ui/composer.js +23 -24
- package/src/comments/ui/index.js +2 -3
- package/src/configSchema.js +59 -1
- package/src/configStore.js +161 -0
- package/src/core-ui-colors.css +12 -0
- package/src/devtools.js +17 -19
- package/src/devtools.test.js +18 -9
- package/src/featureFlags.js +12 -5
- package/src/fuzzySearch.test.js +10 -0
- package/src/index.js +15 -3
- package/src/lib/components/ui/alert/alert-action.jsx +11 -0
- package/src/lib/components/ui/alert/alert-description.jsx +11 -0
- package/src/lib/components/ui/alert/alert-title.jsx +11 -0
- package/src/lib/components/ui/alert/alert.jsx +25 -0
- package/src/lib/components/ui/alert/index.js +15 -15
- package/src/lib/components/ui/avatar/avatar-badge.jsx +22 -0
- package/src/lib/components/ui/avatar/avatar-fallback.jsx +18 -0
- package/src/lib/components/ui/avatar/avatar-group-count.jsx +19 -0
- package/src/lib/components/ui/avatar/avatar-group.jsx +19 -0
- package/src/lib/components/ui/avatar/avatar-image.jsx +15 -0
- package/src/lib/components/ui/avatar/avatar.jsx +19 -0
- package/src/lib/components/ui/avatar/index.js +20 -20
- package/src/lib/components/ui/badge/badge.jsx +31 -0
- package/src/lib/components/ui/badge/index.js +2 -2
- package/src/lib/components/ui/button/button.jsx +100 -0
- package/src/lib/components/ui/button/index.js +9 -9
- package/src/lib/components/ui/card/card-action.jsx +11 -0
- package/src/lib/components/ui/card/card-content.jsx +11 -0
- package/src/lib/components/ui/card/card-description.jsx +11 -0
- package/src/lib/components/ui/card/card-footer.jsx +11 -0
- package/src/lib/components/ui/card/card-header.jsx +19 -0
- package/src/lib/components/ui/card/card-title.jsx +11 -0
- package/src/lib/components/ui/card/card.jsx +17 -0
- package/src/lib/components/ui/card/index.js +23 -23
- package/src/lib/components/ui/checkbox/checkbox.jsx +29 -0
- package/src/lib/components/ui/checkbox/index.js +5 -5
- package/src/lib/components/ui/collapsible/collapsible-content.jsx +7 -0
- package/src/lib/components/ui/collapsible/collapsible-trigger.jsx +7 -0
- package/src/lib/components/ui/collapsible/collapsible.jsx +7 -0
- package/src/lib/components/ui/collapsible/index.js +11 -11
- package/src/lib/components/ui/dialog/dialog-close.jsx +7 -0
- package/src/lib/components/ui/dialog/dialog-content.jsx +34 -0
- package/src/lib/components/ui/dialog/dialog-description.jsx +15 -0
- package/src/lib/components/ui/dialog/dialog-footer.jsx +23 -0
- package/src/lib/components/ui/dialog/dialog-header.jsx +11 -0
- package/src/lib/components/ui/dialog/dialog-overlay.jsx +15 -0
- package/src/lib/components/ui/dialog/dialog-portal.jsx +4 -0
- package/src/lib/components/ui/dialog/dialog-title.jsx +15 -0
- package/src/lib/components/ui/dialog/dialog-trigger.jsx +7 -0
- package/src/lib/components/ui/dialog/dialog.jsx +4 -0
- package/src/lib/components/ui/dialog/index.js +32 -32
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-checkbox-group.jsx +8 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-checkbox-item.jsx +30 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-content.jsx +22 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-group-heading.jsx +16 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-group.jsx +7 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-item.jsx +20 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-label.jsx +17 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-portal.jsx +4 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-radio-group.jsx +7 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-radio-item.jsx +29 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-separator.jsx +15 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-shortcut.jsx +16 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-sub-content.jsx +15 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-sub-trigger.jsx +23 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-sub.jsx +4 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-trigger.jsx +7 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu.jsx +4 -0
- package/src/lib/components/ui/dropdown-menu/index.js +52 -52
- package/src/lib/components/ui/input/index.js +5 -5
- package/src/lib/components/ui/input/input.jsx +19 -0
- package/src/lib/components/ui/label/index.js +5 -5
- package/src/lib/components/ui/label/label.jsx +19 -0
- package/src/lib/components/ui/panel/index.js +21 -21
- package/src/lib/components/ui/panel/panel-body.jsx +11 -0
- package/src/lib/components/ui/panel/panel-close.jsx +16 -0
- package/src/lib/components/ui/panel/panel-content.jsx +29 -0
- package/src/lib/components/ui/panel/panel-footer.jsx +11 -0
- package/src/lib/components/ui/panel/panel-header.jsx +11 -0
- package/src/lib/components/ui/panel/panel-title.jsx +12 -0
- package/src/lib/components/ui/panel/panel.jsx +4 -0
- package/src/lib/components/ui/popover/index.js +26 -26
- package/src/lib/components/ui/popover/popover-close.jsx +7 -0
- package/src/lib/components/ui/popover/popover-content.jsx +22 -0
- package/src/lib/components/ui/popover/popover-description.jsx +11 -0
- package/src/lib/components/ui/popover/popover-header.jsx +11 -0
- package/src/lib/components/ui/popover/popover-portal.jsx +4 -0
- package/src/lib/components/ui/popover/popover-title.jsx +11 -0
- package/src/lib/components/ui/popover/popover-trigger.jsx +8 -0
- package/src/lib/components/ui/popover/popover.jsx +4 -0
- package/src/lib/components/ui/searchable-list.jsx +160 -0
- package/src/lib/components/ui/select/index.js +35 -35
- package/src/lib/components/ui/select/select-content.jsx +30 -0
- package/src/lib/components/ui/select/select-group-heading.jsx +17 -0
- package/src/lib/components/ui/select/select-group.jsx +15 -0
- package/src/lib/components/ui/select/select-item.jsx +26 -0
- package/src/lib/components/ui/select/select-label.jsx +11 -0
- package/src/lib/components/ui/select/select-portal.jsx +4 -0
- package/src/lib/components/ui/select/select-scroll-down-button.jsx +18 -0
- package/src/lib/components/ui/select/select-scroll-up-button.jsx +18 -0
- package/src/lib/components/ui/select/select-separator.jsx +15 -0
- package/src/lib/components/ui/select/select-trigger.jsx +25 -0
- package/src/lib/components/ui/select/select.jsx +4 -0
- package/src/lib/components/ui/separator/index.js +5 -5
- package/src/lib/components/ui/separator/separator.jsx +22 -0
- package/src/lib/components/ui/sheet/index.js +32 -32
- package/src/lib/components/ui/sheet/sheet-close.jsx +7 -0
- package/src/lib/components/ui/sheet/sheet-content.jsx +35 -0
- package/src/lib/components/ui/sheet/sheet-description.jsx +15 -0
- package/src/lib/components/ui/sheet/sheet-footer.jsx +11 -0
- package/src/lib/components/ui/sheet/sheet-header.jsx +11 -0
- package/src/lib/components/ui/sheet/sheet-overlay.jsx +15 -0
- package/src/lib/components/ui/sheet/sheet-portal.jsx +4 -0
- package/src/lib/components/ui/sheet/sheet-title.jsx +15 -0
- package/src/lib/components/ui/sheet/sheet-trigger.jsx +7 -0
- package/src/lib/components/ui/sheet/sheet.jsx +4 -0
- package/src/lib/components/ui/textarea/index.js +5 -5
- package/src/lib/components/ui/textarea/textarea.jsx +18 -0
- package/src/lib/components/ui/toggle/index.js +6 -9
- package/src/lib/components/ui/toggle/toggle.jsx +36 -0
- package/src/lib/components/ui/toggle-group/index.js +8 -8
- package/src/lib/components/ui/toggle-group/toggle-group-item.jsx +29 -0
- package/src/lib/components/ui/toggle-group/toggle-group.jsx +43 -0
- package/src/lib/components/ui/tooltip/index.js +3 -3
- package/src/lib/components/ui/tooltip/tooltip-content.jsx +21 -0
- package/src/lib/components/ui/tooltip/tooltip-trigger.jsx +23 -0
- package/src/lib/components/ui/tooltip/tooltip.jsx +11 -0
- package/src/lib/components/ui/trigger-button/index.js +3 -3
- package/src/lib/components/ui/trigger-button/trigger-button.css +38 -0
- package/src/lib/components/ui/trigger-button/trigger-button.jsx +63 -0
- package/src/logger/devLogger.js +238 -0
- package/src/logger/devLogger.test.js +193 -0
- package/src/modes.test.js +4 -4
- package/src/mountStoryboardCore.js +133 -42
- package/src/paletteProviders.js +3 -0
- package/src/paletteProviders.test.js +2 -2
- package/src/server/index.js +104 -40
- package/src/sidepanel.css +214 -0
- package/src/smoothCorners.js +1 -1
- package/src/styles/tailwind.css +1 -1
- package/src/svelte-plugin-ui/__tests__/ModeSwitch.test.ts +8 -8
- package/src/svelte-plugin-ui/__tests__/ToolbarShell.test.ts +11 -10
- package/src/svelte-plugin-ui/components/Icon.css +11 -0
- package/src/svelte-plugin-ui/components/Icon.jsx +281 -0
- package/src/svelte-plugin-ui/components/ModeSwitch.css +90 -0
- package/src/svelte-plugin-ui/components/ModeSwitch.jsx +47 -0
- package/src/svelte-plugin-ui/components/ToolbarShell.css +80 -0
- package/src/svelte-plugin-ui/components/ToolbarShell.jsx +84 -0
- package/src/svelte-plugin-ui/components/Viewfinder.css +412 -0
- package/src/svelte-plugin-ui/components/Viewfinder.jsx +513 -0
- package/src/svelte-plugin-ui/mount.ts +12 -16
- package/src/toolRegistry.js +4 -4
- package/src/toolbarConfigStore.js +30 -0
- package/src/tools/handlers/autosync.js +1 -1
- package/src/tools/handlers/canvasAddWidget.js +1 -1
- package/src/tools/handlers/canvasAgents.js +20 -0
- package/src/tools/handlers/canvasToolbar.js +8 -8
- package/src/tools/handlers/commandPalette.js +9 -0
- package/src/tools/handlers/comments.js +2 -2
- package/src/tools/handlers/create.js +1 -1
- package/src/tools/handlers/devtools.js +19 -3
- package/src/tools/handlers/devtools.test.js +38 -0
- package/src/tools/handlers/featureFlags.js +1 -1
- package/src/tools/handlers/flows.js +3 -3
- package/src/tools/handlers/hideChrome.js +9 -0
- package/src/tools/handlers/paletteTheme.js +35 -0
- package/src/tools/handlers/theme.js +1 -1
- package/src/tools/registry.js +4 -1
- package/src/tools/surfaces/commandList.js +3 -3
- package/src/tools/surfaces/mainToolbar.js +3 -3
- package/src/tools/surfaces/registry.js +4 -4
- package/src/ui/design-modes.ts +2 -2
- package/src/ui/viewfinder.ts +1 -1
- package/src/vite/server-plugin.js +243 -61
- package/src/workshop/features/createCanvas/CreateCanvasForm.jsx +260 -0
- package/src/workshop/features/createCanvas/index.js +1 -1
- package/src/workshop/features/createFlow/CreateFlowForm.jsx +334 -0
- package/src/workshop/features/createFlow/index.js +1 -1
- package/src/workshop/features/createPage/CreatePageForm.jsx +304 -0
- package/src/workshop/features/createPage/index.js +1 -1
- package/src/workshop/features/createPrototype/CreatePrototypeForm.jsx +289 -0
- package/src/workshop/features/createPrototype/index.js +1 -1
- package/src/workshop/features/createPrototype/server.js +98 -0
- package/src/workshop/features/createStory/CreateStoryForm.jsx +208 -0
- package/src/workshop/features/createStory/index.js +1 -1
- package/src/workshop/ui/WorkshopPanel.jsx +98 -0
- package/src/workshop/ui/mount.ts +1 -1
- package/src/worktree/port.js +48 -0
- package/src/worktree/serverRegistry.js +120 -0
- package/toolbar.config.json +93 -42
- package/widgets.config.json +580 -12
- package/scaffold/commandpalette.config.json +0 -4
- package/scaffold/toolbar.config.json +0 -4
- package/src/ActionMenuButton.svelte +0 -119
- package/src/AutosyncMenuButton.svelte +0 -397
- package/src/CanvasCreateMenu.svelte +0 -295
- package/src/CanvasSnap.svelte +0 -87
- package/src/CanvasUndoRedo.svelte +0 -108
- package/src/CanvasZoomControl.svelte +0 -111
- package/src/CanvasZoomToFit.svelte +0 -52
- package/src/CommandMenu.svelte +0 -249
- package/src/CommandPalette.svelte +0 -33
- package/src/CommentsMenuButton.svelte +0 -53
- package/src/CoreUIBar.svelte +0 -847
- package/src/CreateMenuButton.svelte +0 -133
- package/src/DocPanel.svelte +0 -299
- package/src/InspectorPanel.svelte +0 -745
- package/src/PwaInstallBanner.svelte +0 -124
- package/src/SidePanel.svelte +0 -480
- package/src/ThemeMenuButton.svelte +0 -132
- package/src/comments/ui/AuthModal.svelte +0 -108
- package/src/comments/ui/CommentWindow.svelte +0 -333
- package/src/comments/ui/CommentsDrawer.svelte +0 -96
- package/src/comments/ui/Composer.svelte +0 -65
- package/src/lib/components/ui/alert/alert-action.svelte +0 -19
- package/src/lib/components/ui/alert/alert-description.svelte +0 -22
- package/src/lib/components/ui/alert/alert-title.svelte +0 -22
- package/src/lib/components/ui/alert/alert.svelte +0 -38
- package/src/lib/components/ui/avatar/avatar-badge.svelte +0 -25
- package/src/lib/components/ui/avatar/avatar-fallback.svelte +0 -20
- package/src/lib/components/ui/avatar/avatar-group-count.svelte +0 -22
- package/src/lib/components/ui/avatar/avatar-group.svelte +0 -22
- package/src/lib/components/ui/avatar/avatar-image.svelte +0 -17
- package/src/lib/components/ui/avatar/avatar.svelte +0 -24
- package/src/lib/components/ui/badge/badge.svelte +0 -44
- package/src/lib/components/ui/button/button.svelte +0 -108
- package/src/lib/components/ui/card/card-action.svelte +0 -21
- package/src/lib/components/ui/card/card-content.svelte +0 -19
- package/src/lib/components/ui/card/card-description.svelte +0 -19
- package/src/lib/components/ui/card/card-footer.svelte +0 -18
- package/src/lib/components/ui/card/card-header.svelte +0 -21
- package/src/lib/components/ui/card/card-title.svelte +0 -14
- package/src/lib/components/ui/card/card.svelte +0 -21
- package/src/lib/components/ui/checkbox/checkbox.svelte +0 -39
- package/src/lib/components/ui/collapsible/collapsible-content.svelte +0 -7
- package/src/lib/components/ui/collapsible/collapsible-trigger.svelte +0 -7
- package/src/lib/components/ui/collapsible/collapsible.svelte +0 -11
- package/src/lib/components/ui/dialog/dialog-close.svelte +0 -11
- package/src/lib/components/ui/dialog/dialog-content.svelte +0 -42
- package/src/lib/components/ui/dialog/dialog-description.svelte +0 -17
- package/src/lib/components/ui/dialog/dialog-footer.svelte +0 -29
- package/src/lib/components/ui/dialog/dialog-header.svelte +0 -19
- package/src/lib/components/ui/dialog/dialog-overlay.svelte +0 -17
- package/src/lib/components/ui/dialog/dialog-portal.svelte +0 -7
- package/src/lib/components/ui/dialog/dialog-title.svelte +0 -17
- package/src/lib/components/ui/dialog/dialog-trigger.svelte +0 -11
- package/src/lib/components/ui/dialog/dialog.svelte +0 -7
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-checkbox-group.svelte +0 -16
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte +0 -40
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-content.svelte +0 -27
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-group-heading.svelte +0 -18
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-group.svelte +0 -7
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-item.svelte +0 -24
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-label.svelte +0 -20
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-portal.svelte +0 -7
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-radio-group.svelte +0 -16
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte +0 -34
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-separator.svelte +0 -17
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-shortcut.svelte +0 -19
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte +0 -17
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte +0 -27
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-sub.svelte +0 -7
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-trigger.svelte +0 -7
- package/src/lib/components/ui/dropdown-menu/dropdown-menu.svelte +0 -7
- package/src/lib/components/ui/input/input.svelte +0 -40
- package/src/lib/components/ui/label/label.svelte +0 -20
- package/src/lib/components/ui/panel/panel-body.svelte +0 -13
- package/src/lib/components/ui/panel/panel-close.svelte +0 -16
- package/src/lib/components/ui/panel/panel-content.svelte +0 -33
- package/src/lib/components/ui/panel/panel-footer.svelte +0 -13
- package/src/lib/components/ui/panel/panel-header.svelte +0 -16
- package/src/lib/components/ui/panel/panel-title.svelte +0 -14
- package/src/lib/components/ui/panel/panel.svelte +0 -15
- package/src/lib/components/ui/popover/popover-close.svelte +0 -7
- package/src/lib/components/ui/popover/popover-content.svelte +0 -27
- package/src/lib/components/ui/popover/popover-description.svelte +0 -19
- package/src/lib/components/ui/popover/popover-header.svelte +0 -19
- package/src/lib/components/ui/popover/popover-portal.svelte +0 -7
- package/src/lib/components/ui/popover/popover-title.svelte +0 -19
- package/src/lib/components/ui/popover/popover-trigger.svelte +0 -17
- package/src/lib/components/ui/popover/popover.svelte +0 -7
- package/src/lib/components/ui/select/select-content.svelte +0 -40
- package/src/lib/components/ui/select/select-group-heading.svelte +0 -19
- package/src/lib/components/ui/select/select-group.svelte +0 -17
- package/src/lib/components/ui/select/select-item.svelte +0 -38
- package/src/lib/components/ui/select/select-label.svelte +0 -18
- package/src/lib/components/ui/select/select-portal.svelte +0 -7
- package/src/lib/components/ui/select/select-scroll-down-button.svelte +0 -20
- package/src/lib/components/ui/select/select-scroll-up-button.svelte +0 -20
- package/src/lib/components/ui/select/select-separator.svelte +0 -17
- package/src/lib/components/ui/select/select-trigger.svelte +0 -27
- package/src/lib/components/ui/select/select.svelte +0 -11
- package/src/lib/components/ui/separator/separator.svelte +0 -23
- package/src/lib/components/ui/sheet/sheet-close.svelte +0 -7
- package/src/lib/components/ui/sheet/sheet-content.svelte +0 -43
- package/src/lib/components/ui/sheet/sheet-description.svelte +0 -17
- package/src/lib/components/ui/sheet/sheet-footer.svelte +0 -18
- package/src/lib/components/ui/sheet/sheet-header.svelte +0 -19
- package/src/lib/components/ui/sheet/sheet-overlay.svelte +0 -17
- package/src/lib/components/ui/sheet/sheet-portal.svelte +0 -7
- package/src/lib/components/ui/sheet/sheet-title.svelte +0 -17
- package/src/lib/components/ui/sheet/sheet-trigger.svelte +0 -7
- package/src/lib/components/ui/sheet/sheet.svelte +0 -7
- package/src/lib/components/ui/textarea/textarea.svelte +0 -21
- package/src/lib/components/ui/toggle/toggle.svelte +0 -45
- package/src/lib/components/ui/toggle-group/toggle-group-item.svelte +0 -35
- package/src/lib/components/ui/toggle-group/toggle-group.svelte +0 -63
- package/src/lib/components/ui/tooltip/tooltip-content.svelte +0 -24
- package/src/lib/components/ui/tooltip/tooltip-trigger.svelte +0 -27
- package/src/lib/components/ui/tooltip/tooltip.svelte +0 -9
- package/src/lib/components/ui/trigger-button/trigger-button.svelte +0 -106
- package/src/svelte-plugin-ui/components/Icon.svelte +0 -181
- package/src/svelte-plugin-ui/components/ModeSwitch.svelte +0 -121
- package/src/svelte-plugin-ui/components/ToolbarShell.svelte +0 -150
- package/src/svelte-plugin-ui/components/Viewfinder.svelte +0 -1001
- package/src/tools/handlers/docs.js +0 -11
- package/src/workshop/features/createCanvas/CreateCanvasForm.svelte +0 -139
- package/src/workshop/features/createFlow/CreateFlowForm.svelte +0 -314
- package/src/workshop/features/createPage/CreatePageForm.svelte +0 -249
- package/src/workshop/features/createPrototype/CreatePrototypeForm.svelte +0 -287
- package/src/workshop/features/createStory/CreateStoryForm.svelte +0 -161
- package/src/workshop/ui/WorkshopPanel.svelte +0 -97
package/src/featureFlags.js
CHANGED
|
@@ -16,6 +16,12 @@ import { getLocal, setLocal, removeLocal, getAllLocal } from './localStorage.js'
|
|
|
16
16
|
const FLAG_PREFIX = 'flag.'
|
|
17
17
|
const BODY_CLASS_PREFIX = 'sb-ff-'
|
|
18
18
|
|
|
19
|
+
/** Built-in feature flag defaults — always available even if initFeatureFlags is never called. */
|
|
20
|
+
const BUILTIN_DEFAULTS = {
|
|
21
|
+
'canvas-auto-reload': false,
|
|
22
|
+
'prototype-auto-reload': true,
|
|
23
|
+
}
|
|
24
|
+
|
|
19
25
|
/** Module-level storage for config defaults */
|
|
20
26
|
let _defaults = {}
|
|
21
27
|
|
|
@@ -43,7 +49,7 @@ export function syncFlagBodyClasses() {
|
|
|
43
49
|
* @param {Record<string, boolean>} defaults - Flag key → default value
|
|
44
50
|
*/
|
|
45
51
|
export function initFeatureFlags(defaults = {}) {
|
|
46
|
-
_defaults = { ...defaults }
|
|
52
|
+
_defaults = { ...BUILTIN_DEFAULTS, ...defaults }
|
|
47
53
|
for (const [key, value] of Object.entries(_defaults)) {
|
|
48
54
|
if (getLocal(FLAG_PREFIX + key) === null) {
|
|
49
55
|
setLocal(FLAG_PREFIX + key, String(value))
|
|
@@ -61,7 +67,7 @@ export function getFlag(key) {
|
|
|
61
67
|
const localVal = getLocal(FLAG_PREFIX + key)
|
|
62
68
|
if (localVal !== null) return localVal === 'true'
|
|
63
69
|
|
|
64
|
-
return _defaults[key] ?? false
|
|
70
|
+
return _defaults[key] ?? BUILTIN_DEFAULTS[key] ?? false
|
|
65
71
|
}
|
|
66
72
|
|
|
67
73
|
/**
|
|
@@ -87,10 +93,11 @@ export function toggleFlag(key) {
|
|
|
87
93
|
* @returns {Record<string, { default: boolean, current: boolean }>}
|
|
88
94
|
*/
|
|
89
95
|
export function getAllFlags() {
|
|
96
|
+
const allKeys = new Set([...Object.keys(BUILTIN_DEFAULTS), ...Object.keys(_defaults)])
|
|
90
97
|
const result = {}
|
|
91
|
-
for (const key of
|
|
98
|
+
for (const key of allKeys) {
|
|
92
99
|
result[key] = {
|
|
93
|
-
default: _defaults[key] ?? false,
|
|
100
|
+
default: _defaults[key] ?? BUILTIN_DEFAULTS[key] ?? false,
|
|
94
101
|
current: getFlag(key),
|
|
95
102
|
}
|
|
96
103
|
}
|
|
@@ -116,5 +123,5 @@ export function resetFlags() {
|
|
|
116
123
|
* @returns {string[]}
|
|
117
124
|
*/
|
|
118
125
|
export function getFlagKeys() {
|
|
119
|
-
return Object.keys(_defaults)
|
|
126
|
+
return [...new Set([...Object.keys(BUILTIN_DEFAULTS), ...Object.keys(_defaults)])]
|
|
120
127
|
}
|
package/src/fuzzySearch.test.js
CHANGED
|
@@ -106,4 +106,14 @@ describe('fuzzySearch', () => {
|
|
|
106
106
|
const results = fuzzySearch(data, 'val')
|
|
107
107
|
expect(results).toHaveLength(1)
|
|
108
108
|
})
|
|
109
|
+
|
|
110
|
+
it('ranks agent keyword matches above fuzzy component matches for "cop"', () => {
|
|
111
|
+
const data = [
|
|
112
|
+
{ label: 'Component add widget create component component' },
|
|
113
|
+
{ label: 'Agent add widget create agent copilot Copilot CLI' },
|
|
114
|
+
]
|
|
115
|
+
const results = fuzzySearch(data, 'cop')
|
|
116
|
+
expect(results[0].item.label).toContain('Agent')
|
|
117
|
+
expect(results[0].score).toBeGreaterThan(results[1].score)
|
|
118
|
+
})
|
|
109
119
|
})
|
package/src/index.js
CHANGED
|
@@ -82,7 +82,7 @@ export { initUIConfig, isMenuHidden, getHiddenItems } from './uiConfig.js'
|
|
|
82
82
|
export { initToolRegistry, registerToolModule, setToolComponent, setToolGuardResult, getToolComponent, getToolModule, getToolsForToolbar, getToolConfig, getAllToolConfigs, subscribeToToolRegistry, getToolRegistrySnapshot } from './toolRegistry.js'
|
|
83
83
|
|
|
84
84
|
// Toolbar config store (reactive layered overrides: core → custom → prototype → user)
|
|
85
|
-
export { initToolbarConfig, setPrototypeToolbarConfig, clearPrototypeToolbarConfig, getToolbarConfig, subscribeToToolbarConfig, getToolbarConfigSnapshot } from './toolbarConfigStore.js'
|
|
85
|
+
export { initToolbarConfig, setPrototypeToolbarConfig, clearPrototypeToolbarConfig, getToolbarConfig, subscribeToToolbarConfig, getToolbarConfigSnapshot, setClientToolbarOverrides, consumeClientToolbarOverrides } from './toolbarConfigStore.js'
|
|
86
86
|
|
|
87
87
|
// Toolbar tool state management (runtime state for toolbar tools)
|
|
88
88
|
export { TOOL_STATES, initToolbarToolStates, setToolbarToolState, getToolbarToolState, isToolbarToolLocalOnly, subscribeToToolbarToolStates, getToolbarToolStatesSnapshot } from './toolStateStore.js'
|
|
@@ -91,8 +91,11 @@ export { TOOL_STATES, initToolbarToolStates, setToolbarToolState, getToolbarTool
|
|
|
91
91
|
export { initCommentsConfig, getCommentsConfig, isCommentsEnabled } from './comments/config.js'
|
|
92
92
|
|
|
93
93
|
// Canvas config (paste rules, canvas-level overrides)
|
|
94
|
-
export { initCanvasConfig, getPasteRules, getTerminalConfig } from './canvasConfig.js'
|
|
95
|
-
export { getCommandPaletteConfig } from './commandPaletteConfig.js'
|
|
94
|
+
export { initCanvasConfig, getPasteRules, getTerminalConfig, getAgentsConfig, isTerminalResizable, getTerminalDimensions, getCanvasZoom } from './canvasConfig.js'
|
|
95
|
+
export { getCommandPaletteConfig, initCommandPaletteConfig } from './commandPaletteConfig.js'
|
|
96
|
+
|
|
97
|
+
// Unified config store
|
|
98
|
+
export { initConfig, getConfig, setOverrides, clearOverrides, clearAllOverrides, subscribeToConfig, getConfigSnapshot } from './configStore.js'
|
|
96
99
|
|
|
97
100
|
// Customer mode config
|
|
98
101
|
export { initCustomerModeConfig, getCustomerModeConfig, isCustomerMode } from './customerModeConfig.js'
|
|
@@ -110,3 +113,12 @@ export {
|
|
|
110
113
|
|
|
111
114
|
// Recent artifacts (command palette recents)
|
|
112
115
|
export { trackRecent, getRecent, clearRecent } from './recentArtifacts.js'
|
|
116
|
+
|
|
117
|
+
// Fuzzy search (scoring used by command palette custom filter)
|
|
118
|
+
export { scoreMatch } from './fuzzySearch.js'
|
|
119
|
+
|
|
120
|
+
// Icon component for UI rendering
|
|
121
|
+
export { Icon, default as IconDefault } from './svelte-plugin-ui/components/Icon.jsx'
|
|
122
|
+
|
|
123
|
+
// Shared UI components
|
|
124
|
+
export { default as BranchSelect } from './BranchSelect.jsx'
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { forwardRef } from "react";
|
|
2
|
+
import { cn } from "../../../utils/index.js";
|
|
3
|
+
|
|
4
|
+
const AlertAction = forwardRef(function AlertAction({ className, children, ...props }, ref) {
|
|
5
|
+
return (
|
|
6
|
+
<div ref={ref} data-slot="alert-action" className={cn("absolute top-2 right-2", className)} {...props}>
|
|
7
|
+
{children}
|
|
8
|
+
</div>
|
|
9
|
+
);
|
|
10
|
+
});
|
|
11
|
+
export default AlertAction;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { forwardRef } from "react";
|
|
2
|
+
import { cn } from "../../../utils/index.js";
|
|
3
|
+
|
|
4
|
+
const AlertDescription = forwardRef(function AlertDescription({ className, children, ...props }, ref) {
|
|
5
|
+
return (
|
|
6
|
+
<div ref={ref} data-slot="alert-description" className={cn("text-muted-foreground text-sm text-balance md:text-pretty [&_p:not(:last-child)]:mb-4 [&_a]:hover:text-foreground [&_a]:underline [&_a]:underline-offset-3", className)} {...props}>
|
|
7
|
+
{children}
|
|
8
|
+
</div>
|
|
9
|
+
);
|
|
10
|
+
});
|
|
11
|
+
export default AlertDescription;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { forwardRef } from "react";
|
|
2
|
+
import { cn } from "../../../utils/index.js";
|
|
3
|
+
|
|
4
|
+
const AlertTitle = forwardRef(function AlertTitle({ className, children, ...props }, ref) {
|
|
5
|
+
return (
|
|
6
|
+
<div ref={ref} data-slot="alert-title" className={cn("font-medium group-has-[>svg]/alert:col-start-2 [&_a]:hover:text-foreground [&_a]:underline [&_a]:underline-offset-3", className)} {...props}>
|
|
7
|
+
{children}
|
|
8
|
+
</div>
|
|
9
|
+
);
|
|
10
|
+
});
|
|
11
|
+
export default AlertTitle;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { forwardRef } from "react";
|
|
2
|
+
import { cn } from "../../../utils/index.js";
|
|
3
|
+
import { tv } from "tailwind-variants";
|
|
4
|
+
|
|
5
|
+
export const alertVariants = tv({
|
|
6
|
+
base: "grid gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4 group/alert relative w-full",
|
|
7
|
+
variants: {
|
|
8
|
+
variant: {
|
|
9
|
+
default: "bg-card text-card-foreground",
|
|
10
|
+
destructive: "text-destructive bg-card *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current",
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
defaultVariants: {
|
|
14
|
+
variant: "default",
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const Alert = forwardRef(function Alert({ className, variant = "default", children, ...props }, ref) {
|
|
19
|
+
return (
|
|
20
|
+
<div ref={ref} data-slot="alert" role="alert" className={cn(alertVariants({ variant }), className)} {...props}>
|
|
21
|
+
{children}
|
|
22
|
+
</div>
|
|
23
|
+
);
|
|
24
|
+
});
|
|
25
|
+
export default Alert;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import Root from "./alert.
|
|
2
|
-
import Description from "./alert-description.
|
|
3
|
-
import Title from "./alert-title.
|
|
4
|
-
import Action from "./alert-action.
|
|
5
|
-
export { alertVariants, } from "./alert.svelte";
|
|
1
|
+
import Root, { alertVariants } from "./alert.jsx";
|
|
2
|
+
import Description from "./alert-description.jsx";
|
|
3
|
+
import Title from "./alert-title.jsx";
|
|
4
|
+
import Action from "./alert-action.jsx";
|
|
6
5
|
|
|
7
6
|
export {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
7
|
+
alertVariants,
|
|
8
|
+
Root,
|
|
9
|
+
Description,
|
|
10
|
+
Title,
|
|
11
|
+
Action,
|
|
12
|
+
//
|
|
13
|
+
Root as Alert,
|
|
14
|
+
Description as AlertDescription,
|
|
15
|
+
Title as AlertTitle,
|
|
16
|
+
Action as AlertAction,
|
|
17
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { forwardRef } from "react";
|
|
2
|
+
import { cn } from "../../../utils/index.js";
|
|
3
|
+
|
|
4
|
+
const AvatarBadge = forwardRef(function AvatarBadge({ className, children, ...props }, ref) {
|
|
5
|
+
return (
|
|
6
|
+
<span
|
|
7
|
+
ref={ref}
|
|
8
|
+
data-slot="avatar-badge"
|
|
9
|
+
className={cn(
|
|
10
|
+
"bg-primary text-primary-foreground ring-background absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-blend-color ring-2 select-none",
|
|
11
|
+
"group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden",
|
|
12
|
+
"group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2",
|
|
13
|
+
"group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2",
|
|
14
|
+
className
|
|
15
|
+
)}
|
|
16
|
+
{...props}
|
|
17
|
+
>
|
|
18
|
+
{children}
|
|
19
|
+
</span>
|
|
20
|
+
);
|
|
21
|
+
});
|
|
22
|
+
export default AvatarBadge;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { forwardRef } from "react";
|
|
2
|
+
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
3
|
+
import { cn } from "../../../utils/index.js";
|
|
4
|
+
|
|
5
|
+
const AvatarFallback = forwardRef(function AvatarFallback({ className, ...props }, ref) {
|
|
6
|
+
return (
|
|
7
|
+
<AvatarPrimitive.Fallback
|
|
8
|
+
ref={ref}
|
|
9
|
+
data-slot="avatar-fallback"
|
|
10
|
+
className={cn(
|
|
11
|
+
"bg-muted text-muted-foreground rounded-full flex size-full items-center justify-center text-sm group-data-[size=sm]/avatar:text-xs",
|
|
12
|
+
className
|
|
13
|
+
)}
|
|
14
|
+
{...props}
|
|
15
|
+
/>
|
|
16
|
+
);
|
|
17
|
+
});
|
|
18
|
+
export default AvatarFallback;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { forwardRef } from "react";
|
|
2
|
+
import { cn } from "../../../utils/index.js";
|
|
3
|
+
|
|
4
|
+
const AvatarGroupCount = forwardRef(function AvatarGroupCount({ className, children, ...props }, ref) {
|
|
5
|
+
return (
|
|
6
|
+
<div
|
|
7
|
+
ref={ref}
|
|
8
|
+
data-slot="avatar-group-count"
|
|
9
|
+
className={cn(
|
|
10
|
+
"bg-muted text-muted-foreground size-8 rounded-full text-sm group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3 ring-background relative flex shrink-0 items-center justify-center ring-2",
|
|
11
|
+
className
|
|
12
|
+
)}
|
|
13
|
+
{...props}
|
|
14
|
+
>
|
|
15
|
+
{children}
|
|
16
|
+
</div>
|
|
17
|
+
);
|
|
18
|
+
});
|
|
19
|
+
export default AvatarGroupCount;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { forwardRef } from "react";
|
|
2
|
+
import { cn } from "../../../utils/index.js";
|
|
3
|
+
|
|
4
|
+
const AvatarGroup = forwardRef(function AvatarGroup({ className, children, ...props }, ref) {
|
|
5
|
+
return (
|
|
6
|
+
<div
|
|
7
|
+
ref={ref}
|
|
8
|
+
data-slot="avatar-group"
|
|
9
|
+
className={cn(
|
|
10
|
+
"cn-avatar-group *:data-[slot=avatar]:ring-background group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2",
|
|
11
|
+
className
|
|
12
|
+
)}
|
|
13
|
+
{...props}
|
|
14
|
+
>
|
|
15
|
+
{children}
|
|
16
|
+
</div>
|
|
17
|
+
);
|
|
18
|
+
});
|
|
19
|
+
export default AvatarGroup;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { forwardRef } from "react";
|
|
2
|
+
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
3
|
+
import { cn } from "../../../utils/index.js";
|
|
4
|
+
|
|
5
|
+
const AvatarImage = forwardRef(function AvatarImage({ className, ...props }, ref) {
|
|
6
|
+
return (
|
|
7
|
+
<AvatarPrimitive.Image
|
|
8
|
+
ref={ref}
|
|
9
|
+
data-slot="avatar-image"
|
|
10
|
+
className={cn("rounded-full aspect-square size-full object-cover", className)}
|
|
11
|
+
{...props}
|
|
12
|
+
/>
|
|
13
|
+
);
|
|
14
|
+
});
|
|
15
|
+
export default AvatarImage;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { forwardRef } from "react";
|
|
2
|
+
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
3
|
+
import { cn } from "../../../utils/index.js";
|
|
4
|
+
|
|
5
|
+
const Avatar = forwardRef(function Avatar({ className, size = "default", ...props }, ref) {
|
|
6
|
+
return (
|
|
7
|
+
<AvatarPrimitive.Root
|
|
8
|
+
ref={ref}
|
|
9
|
+
data-slot="avatar"
|
|
10
|
+
data-size={size}
|
|
11
|
+
className={cn(
|
|
12
|
+
"size-8 rounded-full after:rounded-full data-[size=lg]:size-10 data-[size=sm]:size-6 after:border-border group/avatar relative flex shrink-0 select-none after:absolute after:inset-0 after:border after:mix-blend-darken dark:after:mix-blend-lighten",
|
|
13
|
+
className
|
|
14
|
+
)}
|
|
15
|
+
{...props}
|
|
16
|
+
/>
|
|
17
|
+
);
|
|
18
|
+
});
|
|
19
|
+
export default Avatar;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import Root from "./avatar.
|
|
2
|
-
import Image from "./avatar-image.
|
|
3
|
-
import Fallback from "./avatar-fallback.
|
|
4
|
-
import Badge from "./avatar-badge.
|
|
5
|
-
import Group from "./avatar-group.
|
|
6
|
-
import GroupCount from "./avatar-group-count.
|
|
1
|
+
import Root from "./avatar.jsx";
|
|
2
|
+
import Image from "./avatar-image.jsx";
|
|
3
|
+
import Fallback from "./avatar-fallback.jsx";
|
|
4
|
+
import Badge from "./avatar-badge.jsx";
|
|
5
|
+
import Group from "./avatar-group.jsx";
|
|
6
|
+
import GroupCount from "./avatar-group-count.jsx";
|
|
7
7
|
|
|
8
8
|
export {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
};
|
|
9
|
+
Root,
|
|
10
|
+
Image,
|
|
11
|
+
Fallback,
|
|
12
|
+
Badge,
|
|
13
|
+
Group,
|
|
14
|
+
GroupCount,
|
|
15
|
+
//
|
|
16
|
+
Root as Avatar,
|
|
17
|
+
Image as AvatarImage,
|
|
18
|
+
Fallback as AvatarFallback,
|
|
19
|
+
Badge as AvatarBadge,
|
|
20
|
+
Group as AvatarGroup,
|
|
21
|
+
GroupCount as AvatarGroupCount,
|
|
22
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { forwardRef } from "react";
|
|
2
|
+
import { cn } from "../../../utils/index.js";
|
|
3
|
+
import { tv } from "tailwind-variants";
|
|
4
|
+
|
|
5
|
+
export const badgeVariants = tv({
|
|
6
|
+
base: "h-5 gap-1 rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-3! focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive group/badge inline-flex w-fit shrink-0 items-center justify-center overflow-hidden whitespace-nowrap transition-colors focus-visible:ring-[3px] [&>svg]:pointer-events-none",
|
|
7
|
+
variants: {
|
|
8
|
+
variant: {
|
|
9
|
+
default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
|
|
10
|
+
secondary: "bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",
|
|
11
|
+
destructive: "bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20",
|
|
12
|
+
outline: "border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",
|
|
13
|
+
ghost: "hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",
|
|
14
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
defaultVariants: {
|
|
18
|
+
variant: "default",
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const Badge = forwardRef(function Badge({ href, className, variant = "default", children, ...props }, ref) {
|
|
23
|
+
const Component = href ? "a" : "span";
|
|
24
|
+
return (
|
|
25
|
+
<Component ref={ref} data-slot="badge" href={href} className={cn(badgeVariants({ variant }), className)} {...props}>
|
|
26
|
+
{children}
|
|
27
|
+
</Component>
|
|
28
|
+
);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export default Badge;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as Badge } from "./badge.
|
|
2
|
-
export { badgeVariants
|
|
1
|
+
export { default as Badge } from "./badge.jsx";
|
|
2
|
+
export { badgeVariants } from "./badge.jsx";
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { forwardRef } from "react";
|
|
2
|
+
import { cn } from "../../../utils/index.js";
|
|
3
|
+
import { tv } from "tailwind-variants";
|
|
4
|
+
|
|
5
|
+
export const buttonVariants = tv({
|
|
6
|
+
base: "focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 rounded-lg font-medium focus-visible:ring-3 aria-invalid:ring-3 [&_svg:not([class*='size-'])]:size-4 group/button inline-flex size-full shrink-0 items-center justify-center whitespace-nowrap transition-colors outline-none select-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
7
|
+
variants: {
|
|
8
|
+
variant: {
|
|
9
|
+
default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
|
|
10
|
+
outline: "bg-background hover:bg-muted hover:text-foreground dark:bg-input/30 dark:hover:bg-input/50 aria-expanded:bg-muted aria-expanded:text-foreground",
|
|
11
|
+
trigger: "focus-visible:ring-0",
|
|
12
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
|
|
13
|
+
ghost: "hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground",
|
|
14
|
+
destructive: "bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive dark:hover:bg-destructive/30",
|
|
15
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
16
|
+
},
|
|
17
|
+
size: {
|
|
18
|
+
default: "text-sm gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
19
|
+
xs: "text-xs gap-1 rounded-[min(var(--sb--radius-md),10px)] px-2 in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
20
|
+
sm: "text-[0.8rem] gap-1 rounded-[min(var(--sb--radius-md),12px)] px-2.5 in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
|
|
21
|
+
lg: "text-sm gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",
|
|
22
|
+
xl: "text-base gap-2 px-4 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3 [&_svg:not([class*='size-'])]:size-5",
|
|
23
|
+
"2xl": "text-lg gap-2.5 px-5 has-data-[icon=inline-end]:pr-4 has-data-[icon=inline-start]:pl-4 [&_svg:not([class*='size-'])]:size-6",
|
|
24
|
+
icon: "text-sm",
|
|
25
|
+
"icon-xs": "text-xs rounded-[min(var(--sb--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
|
|
26
|
+
"icon-sm": "text-[0.8rem] rounded-[min(var(--sb--radius-md),12px)] in-data-[slot=button-group]:rounded-lg",
|
|
27
|
+
"icon-lg": "text-sm",
|
|
28
|
+
"icon-xl": "text-base [&_svg:not([class*='size-'])]:size-5",
|
|
29
|
+
"icon-2xl": "text-lg [&_svg:not([class*='size-'])]:size-6",
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
defaultVariants: {
|
|
33
|
+
variant: "default",
|
|
34
|
+
size: "default",
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export const wrapperVariants = tv({
|
|
39
|
+
base: "inline-flex shrink-0 transition-transform",
|
|
40
|
+
variants: {
|
|
41
|
+
size: {
|
|
42
|
+
default: "h-8",
|
|
43
|
+
xs: "h-6 rounded-[min(var(--sb--radius-md),10px)] in-data-[slot=button-group]:rounded-lg",
|
|
44
|
+
sm: "h-7 rounded-[min(var(--sb--radius-md),12px)] in-data-[slot=button-group]:rounded-lg",
|
|
45
|
+
lg: "h-9",
|
|
46
|
+
xl: "h-11",
|
|
47
|
+
"2xl": "h-14",
|
|
48
|
+
icon: "size-8",
|
|
49
|
+
"icon-xs": "size-6 rounded-[min(var(--sb--radius-md),10px)] in-data-[slot=button-group]:rounded-lg",
|
|
50
|
+
"icon-sm": "size-7 rounded-[min(var(--sb--radius-md),12px)] in-data-[slot=button-group]:rounded-lg",
|
|
51
|
+
"icon-lg": "size-9",
|
|
52
|
+
"icon-xl": "size-11",
|
|
53
|
+
"icon-2xl": "size-14",
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
defaultVariants: {
|
|
57
|
+
size: "default",
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
const Button = forwardRef(function Button(
|
|
62
|
+
{ className, wrapperClass = "", variant = "default", size = "default", href, type = "button", disabled, children, ...props },
|
|
63
|
+
ref
|
|
64
|
+
) {
|
|
65
|
+
return (
|
|
66
|
+
<span
|
|
67
|
+
data-slot="button-wrapper"
|
|
68
|
+
className={cn(wrapperVariants({ size }), wrapperClass)}
|
|
69
|
+
style={{ background: "var(--sb--sc-border-color, transparent)", padding: "var(--sb--sc-border-width, 0px)" }}
|
|
70
|
+
>
|
|
71
|
+
{href ? (
|
|
72
|
+
<a
|
|
73
|
+
ref={ref}
|
|
74
|
+
className={cn(buttonVariants({ variant, size }), className)}
|
|
75
|
+
href={disabled ? undefined : href}
|
|
76
|
+
aria-disabled={disabled}
|
|
77
|
+
role={disabled ? "link" : undefined}
|
|
78
|
+
tabIndex={disabled ? -1 : undefined}
|
|
79
|
+
data-slot="button"
|
|
80
|
+
{...props}
|
|
81
|
+
>
|
|
82
|
+
{children}
|
|
83
|
+
</a>
|
|
84
|
+
) : (
|
|
85
|
+
<button
|
|
86
|
+
ref={ref}
|
|
87
|
+
className={cn(buttonVariants({ variant, size }), className)}
|
|
88
|
+
type={type}
|
|
89
|
+
disabled={disabled}
|
|
90
|
+
data-slot="button"
|
|
91
|
+
{...props}
|
|
92
|
+
>
|
|
93
|
+
{children}
|
|
94
|
+
</button>
|
|
95
|
+
)}
|
|
96
|
+
</span>
|
|
97
|
+
);
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
export default Button;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import Root, {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} from "./button.
|
|
2
|
+
buttonVariants,
|
|
3
|
+
wrapperVariants,
|
|
4
|
+
} from "./button.jsx";
|
|
5
5
|
|
|
6
6
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
};
|
|
7
|
+
Root,
|
|
8
|
+
//
|
|
9
|
+
Root as Button,
|
|
10
|
+
buttonVariants,
|
|
11
|
+
wrapperVariants,
|
|
12
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { forwardRef } from "react";
|
|
2
|
+
import { cn } from "../../../utils/index.js";
|
|
3
|
+
|
|
4
|
+
const CardAction = forwardRef(function CardAction({ className, children, ...props }, ref) {
|
|
5
|
+
return (
|
|
6
|
+
<div ref={ref} data-slot="card-action" className={cn("cn-card-action col-start-2 row-span-2 row-start-1 self-start justify-self-end", className)} {...props}>
|
|
7
|
+
{children}
|
|
8
|
+
</div>
|
|
9
|
+
);
|
|
10
|
+
});
|
|
11
|
+
export default CardAction;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { forwardRef } from "react";
|
|
2
|
+
import { cn } from "../../../utils/index.js";
|
|
3
|
+
|
|
4
|
+
const CardContent = forwardRef(function CardContent({ className, children, ...props }, ref) {
|
|
5
|
+
return (
|
|
6
|
+
<div ref={ref} data-slot="card-content" className={cn("px-4 group-data-[size=sm]/card:px-3", className)} {...props}>
|
|
7
|
+
{children}
|
|
8
|
+
</div>
|
|
9
|
+
);
|
|
10
|
+
});
|
|
11
|
+
export default CardContent;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { forwardRef } from "react";
|
|
2
|
+
import { cn } from "../../../utils/index.js";
|
|
3
|
+
|
|
4
|
+
const CardDescription = forwardRef(function CardDescription({ className, children, ...props }, ref) {
|
|
5
|
+
return (
|
|
6
|
+
<p ref={ref} data-slot="card-description" className={cn("text-muted-foreground text-sm", className)} {...props}>
|
|
7
|
+
{children}
|
|
8
|
+
</p>
|
|
9
|
+
);
|
|
10
|
+
});
|
|
11
|
+
export default CardDescription;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { forwardRef } from "react";
|
|
2
|
+
import { cn } from "../../../utils/index.js";
|
|
3
|
+
|
|
4
|
+
const CardFooter = forwardRef(function CardFooter({ className, children, ...props }, ref) {
|
|
5
|
+
return (
|
|
6
|
+
<div ref={ref} data-slot="card-footer" className={cn("bg-muted/50 rounded-b-xl border-t p-4 group-data-[size=sm]/card:p-3 flex items-center", className)} {...props}>
|
|
7
|
+
{children}
|
|
8
|
+
</div>
|
|
9
|
+
);
|
|
10
|
+
});
|
|
11
|
+
export default CardFooter;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { forwardRef } from "react";
|
|
2
|
+
import { cn } from "../../../utils/index.js";
|
|
3
|
+
|
|
4
|
+
const CardHeader = forwardRef(function CardHeader({ className, children, ...props }, ref) {
|
|
5
|
+
return (
|
|
6
|
+
<div
|
|
7
|
+
ref={ref}
|
|
8
|
+
data-slot="card-header"
|
|
9
|
+
className={cn(
|
|
10
|
+
"gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3 group/card-header @container/card-header grid auto-rows-min items-start has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto]",
|
|
11
|
+
className
|
|
12
|
+
)}
|
|
13
|
+
{...props}
|
|
14
|
+
>
|
|
15
|
+
{children}
|
|
16
|
+
</div>
|
|
17
|
+
);
|
|
18
|
+
});
|
|
19
|
+
export default CardHeader;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { forwardRef } from "react";
|
|
2
|
+
import { cn } from "../../../utils/index.js";
|
|
3
|
+
|
|
4
|
+
const CardTitle = forwardRef(function CardTitle({ className, children, ...props }, ref) {
|
|
5
|
+
return (
|
|
6
|
+
<div ref={ref} data-slot="card-title" className={cn("text-base leading-snug font-medium group-data-[size=sm]/card:text-sm", className)} {...props}>
|
|
7
|
+
{children}
|
|
8
|
+
</div>
|
|
9
|
+
);
|
|
10
|
+
});
|
|
11
|
+
export default CardTitle;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { forwardRef } from "react";
|
|
2
|
+
import { cn } from "../../../utils/index.js";
|
|
3
|
+
|
|
4
|
+
const Card = forwardRef(function Card({ className, size = "default", children, ...props }, ref) {
|
|
5
|
+
return (
|
|
6
|
+
<div
|
|
7
|
+
ref={ref}
|
|
8
|
+
data-slot="card"
|
|
9
|
+
data-size={size}
|
|
10
|
+
className={cn("ring-foreground/10 bg-card text-card-foreground gap-4 overflow-hidden rounded-xl py-4 text-sm ring-1 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl group/card flex flex-col", className)}
|
|
11
|
+
{...props}
|
|
12
|
+
>
|
|
13
|
+
{children}
|
|
14
|
+
</div>
|
|
15
|
+
);
|
|
16
|
+
});
|
|
17
|
+
export default Card;
|