183 Commits

Author SHA1 Message Date
Sahaj Jain d21c8e3d40 fix: keep AI chat image payloads under the serverless body limit
Uploaded images were inlined as full-resolution base64 in the message
metadata, and the entire chat history is posted on every turn. Two 4MB
uploads exceeded the 4.5MB request body cap, so the platform rejected the
request before the route ran (FUNCTION_PAYLOAD_TOO_LARGE).

- Downscale and re-encode raster uploads client-side (1536px longest edge,
  WebP with a JPEG fallback, ~300KB target). UI screenshots land around
  12KB with imperceptible color drift, so token extraction is unaffected.
- Trim images from the oldest messages when the serialized request body
  would still exceed the budget, rather than failing the request outright.
- Raise MAX_IMAGE_FILES from 2 to 5 now that the payload allows it, and
  wrap the multi-image message preview row so the thumbnails stay legible.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-17 20:50:38 +05:30
Sahaj Jain f89566aef1 fix: vertically center Transactions card header action
The Select sat below the title's center because the grid CardAction is
self-start and spans two rows with no description row. Use a centered
flex header so the title and period selector align.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-11 06:12:27 +05:30
Hamish O'Neill b784f961b4 feat: add Application and Marketing preview tabs (shadcncraft blocks) (#282)
Adds dense Application and full landing-page Marketing demo tabs to the theme preview, themed entirely via editor tokens. Includes follow-up fixes: Mail/Color Palette moved into the More previews dropdown, marketing scrollbar kept above the sticky nav, Application fills the preview frame, and atp/src tracking params on shadcncraft attribution links.
2026-06-11 05:37:00 +05:30
Sahaj Jain 9adabcf96f fix figma export dialog: new logo, layout, font weight
- Add shadcncraft.svg with new two-parallelogram mark
- Switch dialog to use shadcncraft logo
- Bump dialog max-width to 800px and split pricing card 3fr/2fr
- Switch heading font weight from semibold to medium

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-29 02:11:52 +05:30
Sahaj Jain e80940031f redesign figma export dialog for shadcncraft v2
Updates the tweakcn × shadcncraft modal to match the new Figma design:
new hero, UI blocks and React code sections, refreshed pricing card,
and rebrand from "shadcraft" to "shadcncraft" across the figma surface.
2026-04-29 02:01:02 +05:30
Sahaj Jain 9fb9c4c77f upgrade streamdown to v2 and fix chat theme preview height
- Upgrade streamdown 1.0.11 → 2.4.0 with native streaming animation support
- Use Streamdown's built-in isAnimating/animated props instead of custom typewriter
- Remove useStreamText hook (replaced by Streamdown's native animation)
- Simplify StreamText component to pass through to Streamdown directly
- Add streamdown/styles.css import and Tailwind @source for class detection
- Fix ChatThemePreview card height by overriding Card's default py-6/gap-6

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 19:24:43 +05:30
Sahaj Jain 2667bb63a4 feat: add popular fonts section to font picker dropdown
Adds a "Popular" section at the top of the font picker dropdown with
10+ curated fonts per category (sans-serif, serif, monospace, display,
handwriting) including Geist and Geist Mono. The rest of the fonts
continue in alphabetical order under "All Fonts". The popular section
hides when searching.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 04:34:46 +05:30
Sahaj Jain 0a44d81089 feat: add sidebar color sync toggle to sync with base colors
Adds a "Sync" toggle button to the Sidebar color group header that syncs
all sidebar colors to their respective base counterparts (e.g. sidebar
background → background, sidebar-primary → primary). When enabled, base
color changes automatically propagate to sidebar colors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 04:10:39 +05:30
Sahaj Jain 3f537ab5f0 improve preview panel: edge-to-edge cards, fix mail layout
- Cards preview: remove horizontal/top padding, reduce inner top padding
- Mail preview: full-width account switcher, aligned header borders,
  viewport-responsive height (min 800px/90vh), scrollable inbox list
  with styled ScrollArea, border on inner content div
- Preview panel: conditional padding/rounding per active tab

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 02:58:02 +05:30
Sahaj Jain e204941ebb redesign editor sidebar: compact layout with pill accordions, search, and inline controls
- Add search bar to Colors tab with data-driven color group rendering
- Replace accordion headers with compact pill badge style
- Make all controls inline (label + control on same row)
- Add focus-within active style on accordion pills
- Fix sidebar resizable overlap and horizontal overflow
- Tighten spacing across all tabs for consistent density

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 02:02:12 +05:30
sebatanes e032092845 fix: correct scroll textarea on import dialog (#268) 2026-03-06 22:11:21 +05:30
Sahaj Jain 4206d094d0 fix: theme preset dropdown scroll and width issues
Replace ScrollArea with CommandList so cmdk groups render inside the
scrollable container, and widen the popover from 300px to 400px.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 22:05:32 +05:30
Sahaj Jain cde8adc6bd Chore/update shadcn components (#266)
* chore: update shadcn/ui components to v3.8.5 and migrate to unified radix-ui

- Update shadcn CLI from 2.5.0 to 3.8.5
- Update 45 standard UI components to latest versions
- Migrate from 28 individual @radix-ui/react-* packages to unified radix-ui
- Update react-resizable-panels from v2 to v4 (direction→orientation,
  onLayout→onLayoutChanged, ref→panelRef, numeric sizes→percentage strings)
- Fix revola.tsx runtime error by sharing shouldUseDialog via React context
  instead of independent useMediaQuery calls in each sub-component
- Preserve custom components: sidebar.tsx, base-ui-tabs.tsx, revola.tsx
- Re-apply button accent variant after component update
- Fix direct Radix imports in theme-toggle, user-profile-dropdown,
  data-table-view-options
- Fix registryItemSchema import (shadcn/registry→shadcn/schema)
- Fix ScrollArea viewPortClassName removal (use data-slot CSS selector)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: resolve CSS specificity regressions from shadcn v3.8.5 update

- button: remove has-[>svg]:px-* variants that override custom padding, restore lg px-8
- dialog: revert sm:max-w-lg to max-w-lg so consumer max-w overrides work
- separator: use JS conditionals instead of data-attribute variants for orientation
- tabs: restore old TabsTrigger styles to prevent dark mode border overrides
- select consumers: use size="sm" prop instead of className h-8 override

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 21:22:27 +05:30
joseph_sam c797cc7bc4 add white, black and transparent to Tailwind color search (#264)
* fix: add white, black and transparent to tailwind color palette (fixes #261)

* fix: handle transparent color swatch visibility with checkerboard
2026-03-05 03:47:15 +05:30
Sahaj Jain f35fd18d47 feat(community): add theme preview dialog with navigation and share
Click a theme card to apply it and open a preview dialog with Cards Demo,
like/share/toggle actions, and left/right arrow navigation between themes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 03:06:45 +05:30
Sahaj Jain d17fdbbdfd fix: remove excessive spacing between list items in AI responses
Loose markdown lists (items separated by blank lines) wrap each item's
content in a <p> tag with browser-default margins, causing large gaps.
Added [&_li>p]:my-0 to collapse those margins.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-28 00:28:33 +05:30
Sahaj Jain dfadcd84dc fix: use theme name instead of ID for v0 open title
The "Open in v0" button on /themes/[id] was using the themeId as the
title, causing v0 API to reject it. Now passes the actual theme name
and truncates the title to 32 chars to stay within v0's limit.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 18:05:23 +05:30
Sahaj Jain 107b9405d0 fix: show registry command on theme view page
The code panel on /themes/[id] incorrectly showed "Save your theme to
get the registry command" because it relied on the editor store's preset
field, which isn't set when viewing a theme page. Pass themeId through
to CodePanel so it always shows the registry command for saved themes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 17:56:34 +05:30
Sahaj Jain c2151989d4 feat: add layout.tsx tab with Next.js font imports in code panel
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 17:52:54 +05:30
Sahaj Jain 433eb3445a fix: polish theme card and preset button styling
Adjust community card height and grid gap, apply theme-aware border
radius and font family to preset buttons, and fix preview text alignment.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 20:21:49 +05:30
Sahaj Jain 75d542990a refactor: extract shared ThemePreview component for theme cards
Replace duplicated color swatch strips in CommunityThemeCard and
ThemeCard with a new ThemePreview component that shows palette bars,
font preview, and box shadow. Adjust grid gap for community page.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 20:09:25 +05:30
Sahaj Jain 3b8ab5adb3 refactor: simplify theme detail page header and fix v0 open flow
- Replace dropdown menu with inline "Open in Editor" button
- Remove "Published" badge from theme name
- Make header section mobile responsive with flex-col/row
- Skip save check when opening in v0 from theme detail page since theme already exists

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 04:22:15 +05:30
Sahaj Jain 73754ccaf4 feat: add AI nav link, center header nav, add New badge to community page
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 04:02:48 +05:30
Sahaj Jain a4189a5b06 point Examples links to /community and remove redundant header entry
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 03:57:53 +05:30
Sahaj Jain 145697d25a add link to community from editor 2026-02-09 03:55:03 +05:30
Sahaj Jain c82b49d3fd feat: revamp landing page and remove roadmap section
Simplify and modernize the landing page components including hero,
features, FAQ, how-it-works, and AI generation CTA. Remove the
roadmap section entirely. Update AI chat message styling.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 03:52:12 +05:30
Sahaj Jain 90570d60a2 feat: add community theme tags with searchable selector
Add a predefined tag system for community themes (50 tags across
style, use-case, season, and aesthetic categories). Users select
1-5 tags when publishing via a searchable command dropdown.
Tags display as overlay pills on community cards and as badges
on theme view pages. Includes SEO metadata enrichment with tags.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 02:51:13 +05:30
Sahaj Jain 632dd42a72 feat: replace edit mode with inline save-or-update flow
Remove the separate edit mode (ThemeEditActions bar + EditButton) and
instead track unsaved changes inline. The preset selector now shows
`<name>*` for any preset with unsaved changes. Clicking Save on a
saved preset opens a dialog offering to update the existing theme or
save as a new one.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 02:13:59 +05:30
Sahaj Jain 6688873b54 fix: improve mobile header by hiding Sign In and Figma button text
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 01:49:37 +05:30
Sahaj Jain c7d74cbe50 fix: community card respects dark mode, add theme toggle to user dropdown
- Use current theme mode for community card color swatches instead of
  hardcoded "light"
- Add light/dark theme toggle switch to user profile dropdown menu

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 01:48:44 +05:30
Sahaj Jain cc02f1b1f6 fix: show Save button instead of Published when theme has unsaved changes
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 01:45:35 +05:30
Sahaj Jain 249b72f98a Community themes (#259)
* add community themes feature

Allow users to publish saved themes to a public community page,
browse/sort community themes, and like them with auth-gated interactions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* improve community themes UI and fix like state

- Polish community page with better layout, sort icons, loading skeletons
- Show author, date, like count on theme detail page
- Fix isLikedByMe not being fetched in getCommunityDataForTheme
- Remove Community link from app header
- Replace Save with Publish button in editor action bar for saved themes
- Include isPublished in getThemes() via server-side join to avoid layout shift

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* ui

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 01:32:17 +05:30
Sahaj Jain 17fe33b20b fix theme id page 2025-12-23 14:11:16 +05:30
Sahaj Jain 7bbd22371f open in v0 2025-12-13 22:09:24 +05:30
Sujal Kesharwani b701091899 fix: for descructive action added distructive colors and styles (#232)
* fix: for descructive action added distructive colors and styles

* fix: enhance destructive action styles for better visibility
2025-12-06 03:24:10 +05:30
Gerard Balaoro 6ae9e3eb73 feat(editor): use hex format for checking if a color is selected (#239)
* chore: update package-lock.json

* feat(editor): use hex format for checking if a color is selected
2025-12-06 03:18:57 +05:30
Aditya 4d8619a134 fix: use text-inherit for outline badge so it properly inherits styling in dark mode (#243) 2025-12-06 03:14:38 +05:30
Sahaj Jain 0ffa6d58e4 add code button on themes share page 2025-11-06 01:56:31 +05:30
Sahaj Jain 240f7cdac4 small copy change 2025-10-12 14:08:46 +05:30
Luis Llanes fe6a3ea3d9 Refactor preview components and broken styles (#230)
* refactor: composition and broken styles (no functionality)

* feat: async script for next.js, default linter marked as error
2025-10-12 13:34:56 +05:30
Sahaj Jain fb2223e290 refactor
A
2025-10-12 03:37:04 +05:30
Sahaj Jain 5480cf5e98 minify live-preview script 2025-10-12 03:25:54 +05:30
Sahaj Jain 21ce40ad04 Merge branch 'main' of github.com:jnsahaj/tweakcn 2025-10-12 03:02:52 +05:30
Sahaj Jain 701723116f update code panel syntax highlight + hsl fix 2025-10-12 03:02:46 +05:30
Sahaj Jain 5fe4958db2 Feature/preview external (#225)
* Enhance Preview Panel and Support External Websites (#184)

* feat: Add Block Viewer for Preview Panel

* feat: support theme injection for external websites

* refactor: Improve Naming and Composition

* Support for Google Fonts in Preview script and Error Feedback (#202)

* feat: Add support for loading Google Fonts in the embed script.

* feat: Add error state and UI feedback

* fix font loading by overriding classes

* add reset button + update some ui

* syntax highlighting plus copy changes

* rename script

* update ui for connection status

* ui

* zustand store for preview state

* use nuqs for active preview tab

* get shadows working

* refactor

* A

* add tracking

---------

Co-authored-by: Luis Llanes <137589205+llanesluis@users.noreply.github.com>
Co-authored-by: Luis Llanes <luisllaboj@gmail.com>
2025-10-12 02:15:57 +05:30
Sahaj Jain 5882f60c32 Enhance ai chat (#218)
* update package locks to avoid conflict

* Refactor AI Generation with AI SDK v5 (#210)

* refactor(wip): Whole Chat implementation

* fix: Deps

* chore: Update types and create tool to handle theme generation

* chore: Add hook and component to handle feedback text

* chore: Check for themeStyles in asssiatant metadata

* feat: Improve messages styles and feedback

* chore: Update react-hook-form deps

* chore: Improve Messages display

* chore: Show a banner when theme is generating

* chore: Optimize the Messages syncing

* feat: Add debug button to MessageActions in dev mode

* chore: messages

* chore: Improve System prompt + tools + utils

* fix: correctly display User messages with only images

* feat: Handle errors in UI and adapt to AI sdk

* feat: Use tool output instead of custom data parts

* chore: System prompt and schema context

* chore: Gemini 2.5 pro as the default model

* refactor: Change name to Chat Context and apply generated theme automatically

* chore: Update ai packages to latest version

* feat: Stop ongoing request before starting a new chat

* feat: Refactor logic for Scroll start/end sentinels

* feat: Improve UI streaming with AI Elements and Stream Text utils

* chore: Generate theme types and logic

* feat: Allow customize the speed of streaming text

* refactor: Theme generation utils

* fix: Avoid duplicated Mention references

* styles: Improve Chat error banner

* feat: Enhance Prompt core implementation

* feat: Implement enhance prompt in components

* chore: Add TODOS comments

* chore: Remove Openai provider

* chore: Update AI adk packages

* fix: Free request constant

---------

Co-authored-by: Sahaj Jain <82111591+jnsahaj@users.noreply.github.com>

* update lockfile

* fix import

* fix types

* chore: Trigger theme generation before transitioning to editor page

* refactor: Move AI sdk specific code into Lib and update imports

* chore: Provide model ID to record usage util

* refactor: Multi model provider convention

* fix types

* refactor: Use Zustand persist middleware versioning

* feat: Improve prompts and context

* feat: Optimize streaming JSONContent into text area

* chore: Improve Theme Generation prompt

* feat: Improve prompt

* feat: Add subscription checks for enhancing prompt and Posthog tracking

---------

Co-authored-by: Luis Llanes <137589205+llanesluis@users.noreply.github.com>
Co-authored-by: Luis Llanes <luisllaboj@gmail.com>
2025-10-01 16:31:10 +05:30
vice-108 56b0d15148 fix(footer): update navigation links to work from any page (#224) 2025-10-01 16:23:47 +05:30
Sahaj Jain b4ca827b8e update figma pricing (#221) 2025-09-22 01:39:49 +05:30
Abdur Rahman Talha 2c2db2ea2d fix: code copy button not copying tailwind.config.ts in theme editor (#217)
* fix: code copy button not copying tailwind.config.ts in theme editor

* fix: reset active tab on version change on code panel
2025-09-15 22:40:08 +05:30
Sameer Singh a3c4c6c8e8 feat: replace all Dialog usage with Revola for responsive behavior (Responsive Dialog) (#208)
* chore: add @base-ui-components/react dependency and update pnpm-lock.yaml

* feat: add custom hook useMediaQuery for responsive design

* refactor: streamline button component code for improved readability

* refactor: enhance ScrollArea component with viewport className prop and improve className organization

* refactor: replace Dialog component with ResponsiveDialog for improved responsiveness and UI consistency

* feat: introduce ResponsiveDialog component for enhanced mobile and desktop dialog handling

* refactor: update Next.js configuration to use TypeScript type for NextConfig

* refactor: replace Dialog with ResponsiveDialog in CardsChat component for improved UI consistency and responsiveness

* refactor: replace Dialog with ResponsiveDialog in ShareDialog component for improved UI consistency and responsiveness

* refactor: replace Dialog with ResponsiveDialog in FigmaExportDialog component for improved UI consistency and responsiveness.

- Use `Scrollarea` for cleaner scrollbar and structure it a bit different, so scrollbar's doesn't overflow beyond dialog.

* refactor: replace Dialog with ResponsiveDialog in ThemeSaveDialog component for improved UI consistency and responsiveness

* refactor: replace Dialog with ResponsiveDialog in PodcastEmptyPlaceholder component for improved UI consistency and responsiveness

* refactor: replace Dialog with ResponsiveDialog in ChatImagePreview component for improved UI consistency and responsiveness

* feat: add Tabs component based on BaseUI with customizable TabsList, TabsTrigger, TabsContent, and TabsIndicator for improved UI navigation

* refactor: replace Dialog with ResponsiveDialog in CssImportDialog component for improved UI consistency and responsiveness

* refactor: replace Dialog with ResponsiveDialog in AuthDialog component for improved UI consistency and responsiveness

* refactor: replace Dialog with ResponsiveDialog in MCPDialog component for improved UI consistency and responsiveness

- Replace `Tabs` component with new Base UI based `Tabs` component

* refactor: update Tabs and Select components in CodePanel for improved UI consistency

- Replace old Tabs component with new Base UI based Tabs component
- Add TabsIndicator for enhanced visual feedback
- Adjust SelectContent z-index for better layering

* refactor: replace Dialog with ResponsiveDialog in CodePanelDialog component for improved UI consistency and responsiveness

- fix: accessibility issue cased by missing title and description for dialog

* refactor: replace Dialog with ResponsiveDialog in ContrastChecker component for improved UI consistency and responsiveness

- Disable `Issues` button, when there's no issue
- Sticky Header for each section for better messaging for each section especially on mobile

* refactor: adjust layout and spacing in FigmaExportDialog for improved visual consistency

- Update margin and padding for better alignment of elements
- Remove unnecessary line breaks to streamline the code

* refactor: adjust layout and spacing in GetProDialog and AIChatDemo components for improved visual consistency

- Update positioning of elements in GetProDialog for better alignment
- Remove unnecessary inset from AIChatDemo for cleaner layout

* refactor: enhance layout in CodePanelDialog for improved responsiveness

- Adjust max-height for better display on smaller screens
- Maintain overall visual consistency with other dialog components

* refactor: enhance CodePanel layout with additional ScrollBar orientations

- Add horizontal and vertical ScrollBars for improved navigation within code panels
- Adjust padding in CodePanelDialog for better spacing and visual consistency

* refactor: clean up TabsIndicator component by removing commented code

- Remove unnecessary commented-out code for better readability
- Streamline TabsIndicator implementation for improved clarity

* refactor: update ResponsiveDialog components to use isDesktop for breakpoint detection

- Replace isMobile with isDesktop in ResponsiveDialog components for improved clarity
- Ensure consistent behavior across dialog and drawer implementations based on desktop view

* refactor: enhance ResponsiveDialogContent with additional props for customization (v1.4) update

- Introduce closeButtonClassName and dragHandleClassName props for better styling control
- Update context initialization to allow null values for improved type safety
- Refactor ResponsiveDialogContent to streamline rendering logic and improve readability

* refactor: reorganize imports and clean up AuthDialog component for improved readability

- Rearranged import statements for better structure
- Removed unnecessary props from ResponsiveDialogContent for cleaner layout
- Enhanced overall code clarity and maintainability

* refactor: reorganize imports in MCPDialog for improved clarity and consistency

- Rearranged import statements for better structure
- Cleaned up component imports to enhance readability
- Maintained overall code organization for future maintainability

* refactor: reorganize imports and enhance layout in various dialog components for improved readability

- Cleaned up and rearranged import statements for better structure
- Updated ResponsiveDialogContent and ResponsiveDialogHeader for consistent padding and spacing
- Enhanced overall layout and visual consistency across multiple dialog components

* refactor: add iOS detection to adjust repositioning of inputs in ResponsiveDialog
2025-08-30 18:28:31 +05:30