-
Notifications
You must be signed in to change notification settings - Fork 1
[pro-web] feat: implement brand kit wizard with multi-step creation flow #597
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
db655fe
refactor(media-tab): extract WorkspaceDialog reusable component
derianrddev bd12611
feat(media-tab): add BrandKitEntry component for brand creation and iβ¦
derianrddev 3414201
feat(media-tab): implement BrandKitWizard with steps for brand creation
derianrddev c618117
feat(media-tab): add BrandKitDialog and integrate with MediaWizards aβ¦
derianrddev f5a6091
feat(media-tab): implement brand kit wizard with vibe selection step
derianrddev 4208e89
feat(media-tab): implement fonts step with vibe-based recommendations
derianrddev 6dcbf74
refactor(media-tab): improve fonts step with sticky selection bar andβ¦
derianrddev f64b397
feat(media-tab): implement colors step with palette selection and livβ¦
derianrddev c3f7a41
feat(media-tab): enhance ColorsStep layout with improved scrolling anβ¦
derianrddev 5c360e1
feat(media-tab): refactor ColorsStep for theme-based color adjustmentβ¦
derianrddev 0d53a7c
feat(media-tab): add checkpoint step to brand kit wizard
derianrddev 5466885
fix(media-tab): adapt checkpoint step for single source and validate β¦
derianrddev 0c43c43
feat(media-tab): add persistence with IDB sync and checkpoint handlers
derianrddev 3e34d4d
fix(media-tab): restore wizard step when changing organizations
derianrddev 0e113d2
feat(hasura): add brand_kit jsonb column to organization
derianrddev 6037eb6
fix(media-tab): improve validation and error handling for brand kit flow
derianrddev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
...ns/masterbots/1766505347896_alter_table_public_organization_add_column_brand_kit/down.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| alter table "public"."organization" | ||
| drop column "brand_kit"; |
2 changes: 2 additions & 0 deletions
2
...ions/masterbots/1766505347896_alter_table_public_organization_add_column_brand_kit/up.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| alter table "public"."organization" add column "brand_kit" jsonb | ||
| not null default '{}'::jsonb; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
apps/pro-web/components/routes/workspace/media-tab/ui/brand-kit/brand-kit-dialog.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| 'use client' | ||
|
|
||
| import { WorkspaceDialog } from '@/components/ui/workspace-dialog' | ||
| import { useWorkspace } from '@/lib/hooks/use-workspace' | ||
| import { useMemo, useState } from 'react' | ||
| import { BrandKitEntry } from './brand-kit-entry' | ||
| import { BrandKitWizard } from './wizard/brand-kit-wizard' | ||
|
|
||
| interface BrandKitDialogProps { | ||
| open: boolean | ||
| onOpenChange: (open: boolean) => void | ||
| } | ||
|
|
||
| type BrandKitView = 'entry' | 'wizard' | 'summary' | ||
|
|
||
| export function BrandKitDialog({ open, onOpenChange }: BrandKitDialogProps) { | ||
| const [currentView, setCurrentView] = useState<BrandKitView>('entry') | ||
| const { activeOrganization } = useWorkspace() | ||
|
|
||
| const subtitle = useMemo(() => { | ||
| if (currentView === 'wizard') { | ||
| if (!activeOrganization) return 'Logo & Style' | ||
| const endsWithS = activeOrganization.endsWith('s') | ||
| return `${activeOrganization}${endsWithS ? "'" : "'s"} Logo & Style` | ||
| } | ||
| return 'Brand Kit' | ||
| }, [currentView, activeOrganization]) | ||
derianrddev marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| const handleNewBrand = () => { | ||
| setCurrentView('wizard') | ||
| } | ||
|
|
||
| const handleImportBrand = () => { | ||
| // TODO: Open brand import flow | ||
| // This could trigger a file picker or navigate to import wizard | ||
| console.log('Importing brand...') | ||
| } | ||
|
|
||
| const handleWizardFinish = () => { | ||
| // TODO: Navigate to summary view | ||
| console.log('Wizard finished, navigating to summary...') | ||
| setCurrentView('summary') | ||
| } | ||
|
|
||
| const handleWizardCancel = () => { | ||
| setCurrentView('entry') | ||
| } | ||
|
|
||
| return ( | ||
| <WorkspaceDialog | ||
| open={open} | ||
| onOpenChange={onOpenChange} | ||
| title="Media Mode" | ||
| subtitle={subtitle} | ||
| > | ||
| {currentView === 'entry' && ( | ||
| <BrandKitEntry | ||
| onNewBrand={handleNewBrand} | ||
| onImportBrand={handleImportBrand} | ||
| /> | ||
| )} | ||
|
|
||
| {currentView === 'wizard' && ( | ||
| <BrandKitWizard | ||
| onFinish={handleWizardFinish} | ||
| onCancel={handleWizardCancel} | ||
| /> | ||
| )} | ||
|
|
||
| {/* TODO: Add summary view */} | ||
| {/* {currentView === 'summary' && <BrandKitSummary ... />} */} | ||
| </WorkspaceDialog> | ||
| ) | ||
| } | ||
53 changes: 53 additions & 0 deletions
53
apps/pro-web/components/routes/workspace/media-tab/ui/brand-kit/brand-kit-entry.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| 'use client' | ||
|
|
||
| import { Button } from '@/components/ui/button' | ||
| import { ImageDown, ImagePlus } from 'lucide-react' | ||
|
|
||
| interface BrandKitEntryProps { | ||
| onNewBrand: () => void | ||
| onImportBrand: () => void | ||
| } | ||
|
|
||
| export function BrandKitEntry({ | ||
| onNewBrand, | ||
| onImportBrand, | ||
| }: BrandKitEntryProps) { | ||
| return ( | ||
| <div className="flex items-center justify-center min-h-[380px] py-10"> | ||
| <div className="w-full max-w-xs sm:max-w-sm rounded-3xl border border-border/60 bg-zinc-100/50 dark:bg-zinc-900/50 px-8 py-7 sm:px-10 sm:py-8 shadow-sm"> | ||
| <p className="text-center text-sm text-black dark:text-white mb-3"> | ||
| Start from scratch and create | ||
| </p> | ||
|
|
||
| {/* New Brand Button */} | ||
| <Button | ||
| onClick={onNewBrand} | ||
| className="w-full h-16 sm:h-20 rounded-2xl px-6 text-lg font-normal flex items-center justify-center gap-3" | ||
| > | ||
| <ImagePlus className="w-5 h-5" /> | ||
| <span>New Brand</span> | ||
| </Button> | ||
|
|
||
| {/* Separator with "or" */} | ||
| <div className="flex items-center my-6 text-xs text-black dark:text-white"> | ||
| <div className="flex-1 h-px bg-zinc-200 dark:bg-zinc-700" /> | ||
| <span className="text-xs sm:text-sm px-3">or</span> | ||
| <div className="flex-1 h-px bg-zinc-200 dark:bg-zinc-700" /> | ||
| </div> | ||
|
|
||
| {/* Import Brand Button */} | ||
| <Button | ||
| onClick={onImportBrand} | ||
| className="w-full h-16 sm:h-20 rounded-2xl bg-accent text-accent-foreground hover:bg-accent/90 px-6 text-lg font-normal flex items-center justify-center gap-3" | ||
| > | ||
| <ImageDown className="w-5 h-5" /> | ||
| <span>Import Brand</span> | ||
| </Button> | ||
|
|
||
| <p className="text-center text-xs sm:text-sm text-black dark:text-white mt-3"> | ||
| from your existing brand assets | ||
| </p> | ||
| </div> | ||
| </div> | ||
| ) | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.