├── .changeset
├── README.md
└── config.json
├── .commitlintrc.json
├── .editorconfig
├── .eslintrc.json
├── .github
├── changeset-version.js
├── version-script-beta.js
├── version-script-next.js
└── workflows
│ ├── code-check.yml
│ ├── prerelease-comment.yml
│ ├── prerelease.yml
│ ├── release.yml
│ └── test.yml
├── .gitignore
├── .husky
└── commit-msg
├── .npmrc
├── .nvmrc
├── .prettierignore
├── .vscode
└── settings.json
├── LICENSE.md
├── README.md
├── apps
└── www
│ ├── .env.example
│ ├── .gitignore
│ ├── .prettierignore
│ ├── __registry__
│ ├── .autogenerated
│ ├── .gitkeep
│ ├── README.md
│ └── index.tsx
│ ├── app
│ ├── docs
│ │ ├── [[...slug]]
│ │ │ └── page.tsx
│ │ └── layout.tsx
│ ├── examples
│ │ ├── authentication
│ │ │ ├── components
│ │ │ │ └── user-auth-form.tsx
│ │ │ └── page.tsx
│ │ ├── cards
│ │ │ ├── components
│ │ │ │ ├── cookie-settings.tsx
│ │ │ │ ├── create-account.tsx
│ │ │ │ ├── date-picker.tsx
│ │ │ │ ├── github-card.tsx
│ │ │ │ ├── notifications.tsx
│ │ │ │ ├── payment-method.tsx
│ │ │ │ ├── report-an-issue.tsx
│ │ │ │ ├── share-document.tsx
│ │ │ │ └── team-members.tsx
│ │ │ └── page.tsx
│ │ ├── dashboard
│ │ │ ├── components
│ │ │ │ ├── date-range-picker.tsx
│ │ │ │ ├── main-nav.tsx
│ │ │ │ ├── overview.tsx
│ │ │ │ ├── recent-sales.tsx
│ │ │ │ ├── search.tsx
│ │ │ │ ├── team-switcher.tsx
│ │ │ │ └── user-nav.tsx
│ │ │ └── page.tsx
│ │ ├── forms
│ │ │ ├── account
│ │ │ │ ├── account-form.tsx
│ │ │ │ └── page.tsx
│ │ │ ├── appearance
│ │ │ │ ├── appearance-form.tsx
│ │ │ │ └── page.tsx
│ │ │ ├── components
│ │ │ │ └── sidebar-nav.tsx
│ │ │ ├── display
│ │ │ │ ├── display-form.tsx
│ │ │ │ └── page.tsx
│ │ │ ├── layout.tsx
│ │ │ ├── notifications
│ │ │ │ ├── notifications-form.tsx
│ │ │ │ └── page.tsx
│ │ │ ├── page.tsx
│ │ │ └── profile-form.tsx
│ │ ├── layout.tsx
│ │ ├── music
│ │ │ ├── components
│ │ │ │ ├── album-artwork.tsx
│ │ │ │ ├── menu.tsx
│ │ │ │ ├── podcast-empty-placeholder.tsx
│ │ │ │ └── sidebar.tsx
│ │ │ ├── data
│ │ │ │ ├── albums.ts
│ │ │ │ └── playlists.ts
│ │ │ └── page.tsx
│ │ ├── playground
│ │ │ ├── components
│ │ │ │ ├── code-viewer.tsx
│ │ │ │ ├── maxlength-selector.tsx
│ │ │ │ ├── model-selector.tsx
│ │ │ │ ├── preset-actions.tsx
│ │ │ │ ├── preset-save.tsx
│ │ │ │ ├── preset-selector.tsx
│ │ │ │ ├── preset-share.tsx
│ │ │ │ ├── temperature-selector.tsx
│ │ │ │ └── top-p-selector.tsx
│ │ │ ├── data
│ │ │ │ ├── models.ts
│ │ │ │ └── presets.ts
│ │ │ └── page.tsx
│ │ └── tasks
│ │ │ ├── components
│ │ │ ├── columns.tsx
│ │ │ ├── data-table-column-header.tsx
│ │ │ ├── data-table-faceted-filter.tsx
│ │ │ ├── data-table-pagination.tsx
│ │ │ ├── data-table-row-actions.tsx
│ │ │ ├── data-table-toolbar.tsx
│ │ │ ├── data-table-view-options.tsx
│ │ │ ├── data-table.tsx
│ │ │ └── user-nav.tsx
│ │ │ ├── data
│ │ │ ├── data.tsx
│ │ │ ├── schema.ts
│ │ │ ├── seed.ts
│ │ │ └── tasks.json
│ │ │ └── page.tsx
│ ├── layout.tsx
│ ├── page.tsx
│ └── sink
│ │ ├── layout.tsx
│ │ ├── new-york
│ │ └── page.tsx
│ │ └── page.tsx
│ ├── assets
│ └── fonts
│ │ ├── CalSans-SemiBold.ttf
│ │ ├── CalSans-SemiBold.woff
│ │ ├── CalSans-SemiBold.woff2
│ │ ├── Inter-Bold.ttf
│ │ └── Inter-Regular.ttf
│ ├── components
│ ├── analytics.tsx
│ ├── callout.tsx
│ ├── code-block-wrapper.tsx
│ ├── command-menu.tsx
│ ├── component-card.tsx
│ ├── component-example.tsx
│ ├── component-preview.tsx
│ ├── component-source.tsx
│ ├── copy-button.tsx
│ ├── examples-nav.tsx
│ ├── framework-docs.tsx
│ ├── icons.tsx
│ ├── main-nav.tsx
│ ├── mdx-components.tsx
│ ├── mobile-nav.tsx
│ ├── mode-toggle.tsx
│ ├── page-header.tsx
│ ├── pager.tsx
│ ├── promo-video.tsx
│ ├── providers.tsx
│ ├── sidebar-nav.tsx
│ ├── site-footer.tsx
│ ├── site-header.tsx
│ ├── style-switcher.tsx
│ ├── style-wrapper.tsx
│ ├── tailwind-indicator.tsx
│ ├── theme-wrapper.tsx
│ └── toc.tsx
│ ├── config
│ ├── docs.ts
│ └── site.ts
│ ├── content
│ └── docs
│ │ ├── about.mdx
│ │ ├── changelog.mdx
│ │ ├── cli.mdx
│ │ ├── components
│ │ ├── accordion.mdx
│ │ ├── alert-dialog.mdx
│ │ ├── alert.mdx
│ │ ├── aspect-ratio.mdx
│ │ ├── avatar.mdx
│ │ ├── badge.mdx
│ │ ├── button.mdx
│ │ ├── calendar.mdx
│ │ ├── card.mdx
│ │ ├── checkbox.mdx
│ │ ├── collapsible.mdx
│ │ ├── combobox.mdx
│ │ ├── command.mdx
│ │ ├── context-menu.mdx
│ │ ├── data-table.mdx
│ │ ├── date-picker.mdx
│ │ ├── dialog.mdx
│ │ ├── dropdown-menu.mdx
│ │ ├── form.mdx
│ │ ├── hover-card.mdx
│ │ ├── input.mdx
│ │ ├── label.mdx
│ │ ├── menubar.mdx
│ │ ├── navigation-menu.mdx
│ │ ├── popover.mdx
│ │ ├── progress.mdx
│ │ ├── radio-group.mdx
│ │ ├── scroll-area.mdx
│ │ ├── select.mdx
│ │ ├── separator.mdx
│ │ ├── sheet.mdx
│ │ ├── skeleton.mdx
│ │ ├── slider.mdx
│ │ ├── switch.mdx
│ │ ├── table.mdx
│ │ ├── tabs.mdx
│ │ ├── textarea.mdx
│ │ ├── toast.mdx
│ │ ├── toggle.mdx
│ │ ├── tooltip.mdx
│ │ └── typography.mdx
│ │ ├── dark-mode.mdx
│ │ ├── figma.mdx
│ │ ├── index.mdx
│ │ ├── installation
│ │ ├── astro.mdx
│ │ ├── gatsby.mdx
│ │ ├── index.mdx
│ │ ├── manual.mdx
│ │ ├── next.mdx
│ │ ├── remix.mdx
│ │ └── vite.mdx
│ │ └── theming.mdx
│ ├── contentlayer.config.js
│ ├── hooks
│ ├── use-config.ts
│ ├── use-lock-body.ts
│ ├── use-mounted.ts
│ └── use-mutation-observer.ts
│ ├── lib
│ ├── events.ts
│ ├── fonts.ts
│ ├── rehype-component.ts
│ ├── rehype-npm-command.ts
│ ├── themes
│ │ ├── dark.json
│ │ └── light.json
│ ├── toc.ts
│ ├── utils.ts
│ └── validations
│ │ ├── log.ts
│ │ └── og.ts
│ ├── next-env.d.ts
│ ├── next.config.mjs
│ ├── package.json
│ ├── pages
│ ├── .gitkeep
│ └── api
│ │ ├── .gitkeep
│ │ ├── components.json
│ │ └── components.ts
│ ├── postcss.config.cjs
│ ├── public
│ ├── android-chrome-192x192.png
│ ├── android-chrome-512x512.png
│ ├── apple-touch-icon.png
│ ├── avatars
│ │ ├── 01.png
│ │ ├── 02.png
│ │ ├── 03.png
│ │ ├── 04.png
│ │ └── 05.png
│ ├── examples
│ │ ├── authentication-dark.png
│ │ ├── authentication-light.png
│ │ ├── cards-dark.png
│ │ ├── cards-light.png
│ │ ├── dashboard-dark.png
│ │ ├── dashboard-light.png
│ │ ├── forms-dark.png
│ │ ├── forms-light.png
│ │ ├── music-dark.png
│ │ ├── music-light.png
│ │ ├── playground-dark.png
│ │ ├── playground-light.png
│ │ ├── tasks-dark.png
│ │ └── tasks-light.png
│ ├── favicon-16x16.png
│ ├── favicon-32x32.png
│ ├── favicon.ico
│ ├── images
│ │ ├── style-with-theming.jpg
│ │ └── style.jpg
│ ├── og.jpg
│ ├── registry
│ │ ├── colors
│ │ │ ├── gray.json
│ │ │ ├── index.json
│ │ │ ├── lime.json
│ │ │ ├── neutral.json
│ │ │ ├── slate.json
│ │ │ ├── stone.json
│ │ │ └── zinc.json
│ │ ├── index.json
│ │ ├── styles
│ │ │ ├── default
│ │ │ │ ├── accordion.json
│ │ │ │ ├── alert-dialog.json
│ │ │ │ ├── alert.json
│ │ │ │ ├── aspect-ratio.json
│ │ │ │ ├── avatar.json
│ │ │ │ ├── badge.json
│ │ │ │ ├── button.json
│ │ │ │ ├── calendar.json
│ │ │ │ ├── card.json
│ │ │ │ ├── checkbox.json
│ │ │ │ ├── collapsible.json
│ │ │ │ ├── command.json
│ │ │ │ ├── context-menu.json
│ │ │ │ ├── dialog.json
│ │ │ │ ├── dropdown-menu.json
│ │ │ │ ├── form.json
│ │ │ │ ├── hover-card.json
│ │ │ │ ├── input.json
│ │ │ │ ├── label.json
│ │ │ │ ├── menubar.json
│ │ │ │ ├── navigation-menu.json
│ │ │ │ ├── popover.json
│ │ │ │ ├── progress.json
│ │ │ │ ├── radio-group.json
│ │ │ │ ├── scroll-area.json
│ │ │ │ ├── select.json
│ │ │ │ ├── separator.json
│ │ │ │ ├── sheet.json
│ │ │ │ ├── skeleton.json
│ │ │ │ ├── slider.json
│ │ │ │ ├── switch.json
│ │ │ │ ├── table.json
│ │ │ │ ├── tabs.json
│ │ │ │ ├── textarea.json
│ │ │ │ ├── toast.json
│ │ │ │ ├── toggle.json
│ │ │ │ └── tooltip.json
│ │ │ ├── index.json
│ │ │ └── new-york
│ │ │ │ ├── accordion.json
│ │ │ │ ├── alert-dialog.json
│ │ │ │ ├── alert.json
│ │ │ │ ├── aspect-ratio.json
│ │ │ │ ├── avatar.json
│ │ │ │ ├── badge.json
│ │ │ │ ├── button.json
│ │ │ │ ├── calendar.json
│ │ │ │ ├── card.json
│ │ │ │ ├── checkbox.json
│ │ │ │ ├── collapsible.json
│ │ │ │ ├── command.json
│ │ │ │ ├── context-menu.json
│ │ │ │ ├── dialog.json
│ │ │ │ ├── dropdown-menu.json
│ │ │ │ ├── form.json
│ │ │ │ ├── hover-card.json
│ │ │ │ ├── input.json
│ │ │ │ ├── label.json
│ │ │ │ ├── menubar.json
│ │ │ │ ├── navigation-menu.json
│ │ │ │ ├── popover.json
│ │ │ │ ├── progress.json
│ │ │ │ ├── radio-group.json
│ │ │ │ ├── scroll-area.json
│ │ │ │ ├── select.json
│ │ │ │ ├── separator.json
│ │ │ │ ├── sheet.json
│ │ │ │ ├── skeleton.json
│ │ │ │ ├── slider.json
│ │ │ │ ├── switch.json
│ │ │ │ ├── table.json
│ │ │ │ ├── tabs.json
│ │ │ │ ├── textarea.json
│ │ │ │ ├── toast.json
│ │ │ │ ├── toggle.json
│ │ │ │ └── tooltip.json
│ │ └── themes.css
│ ├── schema.json
│ └── site.webmanifest
│ ├── registry
│ ├── .eslintrc.json
│ ├── colors.ts
│ ├── default
│ │ ├── example
│ │ │ ├── accordion-demo.tsx
│ │ │ ├── alert-demo.tsx
│ │ │ ├── alert-destructive.tsx
│ │ │ ├── alert-dialog-demo.tsx
│ │ │ ├── aspect-ratio-demo.tsx
│ │ │ ├── avatar-demo.tsx
│ │ │ ├── badge-demo.tsx
│ │ │ ├── badge-destructive.tsx
│ │ │ ├── badge-outline.tsx
│ │ │ ├── badge-secondary.tsx
│ │ │ ├── button-as-child.tsx
│ │ │ ├── button-demo.tsx
│ │ │ ├── button-destructive.tsx
│ │ │ ├── button-ghost.tsx
│ │ │ ├── button-icon.tsx
│ │ │ ├── button-link.tsx
│ │ │ ├── button-loading.tsx
│ │ │ ├── button-outline.tsx
│ │ │ ├── button-secondary.tsx
│ │ │ ├── button-with-icon.tsx
│ │ │ ├── calendar-demo.tsx
│ │ │ ├── calendar-form.tsx
│ │ │ ├── calendar-react-hook-form.tsx
│ │ │ ├── card-demo.tsx
│ │ │ ├── card-with-form.tsx
│ │ │ ├── checkbox-demo.tsx
│ │ │ ├── checkbox-disabled.tsx
│ │ │ ├── checkbox-form-multiple.tsx
│ │ │ ├── checkbox-form-single.tsx
│ │ │ ├── checkbox-with-text.tsx
│ │ │ ├── collapsible-demo.tsx
│ │ │ ├── combobox-demo.tsx
│ │ │ ├── combobox-dropdown-menu.tsx
│ │ │ ├── combobox-form.tsx
│ │ │ ├── combobox-popover.tsx
│ │ │ ├── command-demo.tsx
│ │ │ ├── command-dialog.tsx
│ │ │ ├── context-menu-demo.tsx
│ │ │ ├── data-table-demo.tsx
│ │ │ ├── date-picker-demo.tsx
│ │ │ ├── date-picker-form.tsx
│ │ │ ├── date-picker-with-presets.tsx
│ │ │ ├── date-picker-with-range.tsx
│ │ │ ├── dialog-demo.tsx
│ │ │ ├── dropdown-menu-checkboxes.tsx
│ │ │ ├── dropdown-menu-demo.tsx
│ │ │ ├── dropdown-menu-radio-group.tsx
│ │ │ ├── hover-card-demo.tsx
│ │ │ ├── input-demo.tsx
│ │ │ ├── input-disabled.tsx
│ │ │ ├── input-file.tsx
│ │ │ ├── input-form.tsx
│ │ │ ├── input-with-button.tsx
│ │ │ ├── input-with-label.tsx
│ │ │ ├── input-with-text.tsx
│ │ │ ├── label-demo.tsx
│ │ │ ├── menubar-demo.tsx
│ │ │ ├── mode-toggle.tsx
│ │ │ ├── navigation-menu-demo.tsx
│ │ │ ├── popover-demo.tsx
│ │ │ ├── progress-demo.tsx
│ │ │ ├── radio-group-demo.tsx
│ │ │ ├── radio-group-form.tsx
│ │ │ ├── scroll-area-demo.tsx
│ │ │ ├── select-demo.tsx
│ │ │ ├── select-form.tsx
│ │ │ ├── separator-demo.tsx
│ │ │ ├── sheet-demo.tsx
│ │ │ ├── sheet-side.tsx
│ │ │ ├── skeleton-demo.tsx
│ │ │ ├── slider-demo.tsx
│ │ │ ├── switch-demo.tsx
│ │ │ ├── switch-form.tsx
│ │ │ ├── table-demo.tsx
│ │ │ ├── tabs-demo.tsx
│ │ │ ├── textarea-demo.tsx
│ │ │ ├── textarea-disabled.tsx
│ │ │ ├── textarea-form.tsx
│ │ │ ├── textarea-with-button.tsx
│ │ │ ├── textarea-with-label.tsx
│ │ │ ├── textarea-with-text.tsx
│ │ │ ├── toast-demo.tsx
│ │ │ ├── toast-destructive.tsx
│ │ │ ├── toast-simple.tsx
│ │ │ ├── toast-with-action.tsx
│ │ │ ├── toast-with-title.tsx
│ │ │ ├── toggle-demo.tsx
│ │ │ ├── toggle-disabled.tsx
│ │ │ ├── toggle-lg.tsx
│ │ │ ├── toggle-outline.tsx
│ │ │ ├── toggle-sm.tsx
│ │ │ ├── toggle-with-text.tsx
│ │ │ ├── tooltip-demo.tsx
│ │ │ ├── typography-blockquote.tsx
│ │ │ ├── typography-demo.tsx
│ │ │ ├── typography-h1.tsx
│ │ │ ├── typography-h2.tsx
│ │ │ ├── typography-h3.tsx
│ │ │ ├── typography-h4.tsx
│ │ │ ├── typography-inline-code.tsx
│ │ │ ├── typography-large.tsx
│ │ │ ├── typography-lead.tsx
│ │ │ ├── typography-list.tsx
│ │ │ ├── typography-muted.tsx
│ │ │ ├── typography-p.tsx
│ │ │ ├── typography-small.tsx
│ │ │ └── typography-table.tsx
│ │ └── ui
│ │ │ ├── accordion.tsx
│ │ │ ├── alert-dialog.tsx
│ │ │ ├── alert.tsx
│ │ │ ├── aspect-ratio.tsx
│ │ │ ├── avatar.tsx
│ │ │ ├── badge.tsx
│ │ │ ├── button.tsx
│ │ │ ├── calendar.tsx
│ │ │ ├── card.tsx
│ │ │ ├── checkbox.tsx
│ │ │ ├── collapsible.tsx
│ │ │ ├── command.tsx
│ │ │ ├── context-menu.tsx
│ │ │ ├── dialog.tsx
│ │ │ ├── dropdown-menu.tsx
│ │ │ ├── form.tsx
│ │ │ ├── hover-card.tsx
│ │ │ ├── input.tsx
│ │ │ ├── label.tsx
│ │ │ ├── menubar.tsx
│ │ │ ├── navigation-menu.tsx
│ │ │ ├── popover.tsx
│ │ │ ├── progress.tsx
│ │ │ ├── radio-group.tsx
│ │ │ ├── scroll-area.tsx
│ │ │ ├── select.tsx
│ │ │ ├── separator.tsx
│ │ │ ├── sheet.tsx
│ │ │ ├── skeleton.tsx
│ │ │ ├── slider.tsx
│ │ │ ├── switch.tsx
│ │ │ ├── table.tsx
│ │ │ ├── tabs.tsx
│ │ │ ├── textarea.tsx
│ │ │ ├── toast.tsx
│ │ │ ├── toaster.tsx
│ │ │ ├── toggle.tsx
│ │ │ ├── tooltip.tsx
│ │ │ └── use-toast.ts
│ ├── new-york
│ │ ├── example
│ │ │ ├── accordion-demo.tsx
│ │ │ ├── alert-demo.tsx
│ │ │ ├── alert-destructive.tsx
│ │ │ ├── alert-dialog-demo.tsx
│ │ │ ├── aspect-ratio-demo.tsx
│ │ │ ├── avatar-demo.tsx
│ │ │ ├── badge-demo.tsx
│ │ │ ├── badge-destructive.tsx
│ │ │ ├── badge-outline.tsx
│ │ │ ├── badge-secondary.tsx
│ │ │ ├── button-as-child.tsx
│ │ │ ├── button-demo.tsx
│ │ │ ├── button-destructive.tsx
│ │ │ ├── button-ghost.tsx
│ │ │ ├── button-icon.tsx
│ │ │ ├── button-link.tsx
│ │ │ ├── button-loading.tsx
│ │ │ ├── button-outline.tsx
│ │ │ ├── button-secondary.tsx
│ │ │ ├── button-with-icon.tsx
│ │ │ ├── calendar-demo.tsx
│ │ │ ├── calendar-form.tsx
│ │ │ ├── card-demo.tsx
│ │ │ ├── card-with-form.tsx
│ │ │ ├── checkbox-demo.tsx
│ │ │ ├── checkbox-disabled.tsx
│ │ │ ├── checkbox-form-multiple.tsx
│ │ │ ├── checkbox-form-single.tsx
│ │ │ ├── checkbox-with-text.tsx
│ │ │ ├── collapsible-demo.tsx
│ │ │ ├── combobox-demo.tsx
│ │ │ ├── combobox-dropdown-menu.tsx
│ │ │ ├── combobox-form.tsx
│ │ │ ├── combobox-popover.tsx
│ │ │ ├── command-demo.tsx
│ │ │ ├── command-dialog.tsx
│ │ │ ├── context-menu-demo.tsx
│ │ │ ├── data-table-demo.tsx
│ │ │ ├── date-picker-demo.tsx
│ │ │ ├── date-picker-form.tsx
│ │ │ ├── date-picker-with-presets.tsx
│ │ │ ├── date-picker-with-range.tsx
│ │ │ ├── dialog-demo.tsx
│ │ │ ├── dropdown-menu-checkboxes.tsx
│ │ │ ├── dropdown-menu-demo.tsx
│ │ │ ├── dropdown-menu-radio-group.tsx
│ │ │ ├── hover-card-demo.tsx
│ │ │ ├── input-demo.tsx
│ │ │ ├── input-disabled.tsx
│ │ │ ├── input-file.tsx
│ │ │ ├── input-form.tsx
│ │ │ ├── input-with-button.tsx
│ │ │ ├── input-with-label.tsx
│ │ │ ├── input-with-text.tsx
│ │ │ ├── label-demo.tsx
│ │ │ ├── menubar-demo.tsx
│ │ │ ├── mode-toggle.tsx
│ │ │ ├── navigation-menu-demo.tsx
│ │ │ ├── popover-demo.tsx
│ │ │ ├── progress-demo.tsx
│ │ │ ├── radio-group-demo.tsx
│ │ │ ├── radio-group-form.tsx
│ │ │ ├── scroll-area-demo.tsx
│ │ │ ├── select-demo.tsx
│ │ │ ├── select-form.tsx
│ │ │ ├── separator-demo.tsx
│ │ │ ├── sheet-demo.tsx
│ │ │ ├── sheet-side.tsx
│ │ │ ├── skeleton-demo.tsx
│ │ │ ├── slider-demo.tsx
│ │ │ ├── switch-demo.tsx
│ │ │ ├── switch-form.tsx
│ │ │ ├── table-demo.tsx
│ │ │ ├── tabs-demo.tsx
│ │ │ ├── textarea-demo.tsx
│ │ │ ├── textarea-disabled.tsx
│ │ │ ├── textarea-form.tsx
│ │ │ ├── textarea-with-button.tsx
│ │ │ ├── textarea-with-label.tsx
│ │ │ ├── textarea-with-text.tsx
│ │ │ ├── toast-demo.tsx
│ │ │ ├── toast-destructive.tsx
│ │ │ ├── toast-simple.tsx
│ │ │ ├── toast-with-action.tsx
│ │ │ ├── toast-with-title.tsx
│ │ │ ├── toggle-demo.tsx
│ │ │ ├── toggle-disabled.tsx
│ │ │ ├── toggle-lg.tsx
│ │ │ ├── toggle-outline.tsx
│ │ │ ├── toggle-sm.tsx
│ │ │ ├── toggle-with-text.tsx
│ │ │ ├── tooltip-demo.tsx
│ │ │ ├── typography-blockquote.tsx
│ │ │ ├── typography-demo.tsx
│ │ │ ├── typography-h1.tsx
│ │ │ ├── typography-h2.tsx
│ │ │ ├── typography-h3.tsx
│ │ │ ├── typography-h4.tsx
│ │ │ ├── typography-inline-code.tsx
│ │ │ ├── typography-large.tsx
│ │ │ ├── typography-lead.tsx
│ │ │ ├── typography-list.tsx
│ │ │ ├── typography-muted.tsx
│ │ │ ├── typography-p.tsx
│ │ │ ├── typography-small.tsx
│ │ │ └── typography-table.tsx
│ │ └── ui
│ │ │ ├── accordion.tsx
│ │ │ ├── alert-dialog.tsx
│ │ │ ├── alert.tsx
│ │ │ ├── aspect-ratio.tsx
│ │ │ ├── avatar.tsx
│ │ │ ├── badge.tsx
│ │ │ ├── button.tsx
│ │ │ ├── calendar.tsx
│ │ │ ├── card.tsx
│ │ │ ├── checkbox.tsx
│ │ │ ├── collapsible.tsx
│ │ │ ├── command.tsx
│ │ │ ├── context-menu.tsx
│ │ │ ├── dialog.tsx
│ │ │ ├── dropdown-menu.tsx
│ │ │ ├── form.tsx
│ │ │ ├── hover-card.tsx
│ │ │ ├── input.tsx
│ │ │ ├── label.tsx
│ │ │ ├── menubar.tsx
│ │ │ ├── navigation-menu.tsx
│ │ │ ├── popover.tsx
│ │ │ ├── progress.tsx
│ │ │ ├── radio-group.tsx
│ │ │ ├── scroll-area.tsx
│ │ │ ├── select.tsx
│ │ │ ├── separator.tsx
│ │ │ ├── sheet.tsx
│ │ │ ├── skeleton.tsx
│ │ │ ├── slider.tsx
│ │ │ ├── switch.tsx
│ │ │ ├── table.tsx
│ │ │ ├── tabs.tsx
│ │ │ ├── textarea.tsx
│ │ │ ├── toast.tsx
│ │ │ ├── toaster.tsx
│ │ │ ├── toggle.tsx
│ │ │ ├── tooltip.tsx
│ │ │ └── use-toast.ts
│ ├── registry.ts
│ ├── schema.ts
│ ├── styles.ts
│ └── themes.ts
│ ├── scripts
│ └── build-registry.ts
│ ├── styles
│ ├── globals.css
│ └── mdx.css
│ ├── tailwind.config.cjs
│ ├── tsconfig.json
│ ├── tsconfig.scripts.json
│ └── types
│ ├── nav.ts
│ └── unist.ts
├── fix_user.sh
├── package.json
├── packages
└── cli
│ ├── .gitignore
│ ├── .prettierignore
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── package.json
│ ├── src
│ ├── commands
│ │ ├── add.ts
│ │ ├── diff.ts
│ │ └── init.ts
│ ├── index.ts
│ └── utils
│ │ ├── get-config.ts
│ │ ├── get-package-info.ts
│ │ ├── get-package-manager.ts
│ │ ├── get-project-info.ts
│ │ ├── handle-error.ts
│ │ ├── logger.ts
│ │ ├── registry
│ │ ├── index.ts
│ │ └── schema.ts
│ │ ├── resolve-import.ts
│ │ ├── templates.ts
│ │ └── transformers
│ │ ├── index.ts
│ │ ├── transform-css-vars.ts
│ │ ├── transform-import.ts
│ │ ├── transform-jsx.ts
│ │ └── transform-rsc.ts
│ ├── test
│ ├── commands
│ │ └── init.test.ts
│ ├── fixtures
│ │ ├── colors
│ │ │ ├── neutral.json
│ │ │ ├── slate.json
│ │ │ ├── stone.json
│ │ │ └── zinc.json
│ │ ├── config-full
│ │ │ ├── components.json
│ │ │ ├── package.json
│ │ │ └── tsconfig.json
│ │ ├── config-invalid
│ │ │ ├── components.json
│ │ │ └── package.json
│ │ ├── config-jsx
│ │ │ ├── components.json
│ │ │ ├── jsconfig.json
│ │ │ └── package.json
│ │ ├── config-none
│ │ │ └── package.json
│ │ ├── config-partial
│ │ │ ├── components.json
│ │ │ ├── package.json
│ │ │ └── tsconfig.json
│ │ ├── next-src
│ │ │ ├── .gitignore
│ │ │ ├── next.config.js
│ │ │ ├── package.json
│ │ │ ├── src
│ │ │ │ └── app
│ │ │ │ │ └── globals.css
│ │ │ ├── tailwind.config.js
│ │ │ └── tsconfig.json
│ │ ├── next
│ │ │ ├── .gitignore
│ │ │ ├── app
│ │ │ │ └── globals.css
│ │ │ ├── next.config.js
│ │ │ ├── package.json
│ │ │ ├── pnpm-lock.yaml
│ │ │ ├── tailwind.config.js
│ │ │ └── tsconfig.json
│ │ ├── project-bun
│ │ │ ├── bun.lockb
│ │ │ └── package.json
│ │ ├── project-npm
│ │ │ ├── package-lock.json
│ │ │ └── package.json
│ │ ├── project-pnpm
│ │ │ ├── package.json
│ │ │ └── pnpm-lock.yaml
│ │ ├── project-src
│ │ │ ├── components.json
│ │ │ ├── package-lock.json
│ │ │ └── package.json
│ │ ├── project-yarn
│ │ │ ├── package.json
│ │ │ └── yarn.lock
│ │ ├── project
│ │ │ ├── components.json
│ │ │ ├── package.json
│ │ │ └── pnpm-lock.yaml
│ │ ├── t3-app
│ │ │ ├── .eslintrc.cjs
│ │ │ ├── .gitignore
│ │ │ ├── next.config.mjs
│ │ │ ├── package.json
│ │ │ ├── src
│ │ │ │ ├── env.mjs
│ │ │ │ ├── pages
│ │ │ │ │ ├── _app.tsx
│ │ │ │ │ └── index.tsx
│ │ │ │ └── styles
│ │ │ │ │ └── globals.css
│ │ │ ├── tailwind.config.ts
│ │ │ └── tsconfig.json
│ │ ├── with-base-url
│ │ │ └── tsconfig.json
│ │ └── without-base-url
│ │ │ └── tsconfig.json
│ └── utils
│ │ ├── __snapshots__
│ │ ├── transform-css-vars.test.ts.snap
│ │ ├── transform-import.test.ts.snap
│ │ └── transform-rsc.test.ts.snap
│ │ ├── apply-color-mapping.test.ts
│ │ ├── get-config.test.ts
│ │ ├── get-package-manager.test.ts
│ │ ├── registry.test.ts
│ │ ├── resolve-import.test.ts
│ │ ├── transform-css-vars.test.ts
│ │ ├── transform-import.test.ts
│ │ └── transform-rsc.test.ts
│ ├── tsconfig.json
│ └── tsup.config.ts
├── pnpm-lock.yaml
├── pnpm-workspace.yaml
├── postcss.config.cjs
├── prettier.config.cjs
├── scripts
└── sync-templates.sh
├── tailwind.config.cjs
├── templates
└── next-template
│ ├── .editorconfig
│ ├── .eslintignore
│ ├── .eslintrc.json
│ ├── .gitignore
│ ├── .prettierignore
│ ├── .vscode
│ └── settings.json
│ ├── README.md
│ ├── app
│ ├── layout.tsx
│ └── page.tsx
│ ├── components.json
│ ├── components
│ ├── icons.tsx
│ ├── main-nav.tsx
│ ├── site-header.tsx
│ ├── tailwind-indicator.tsx
│ ├── theme-provider.tsx
│ ├── theme-toggle.tsx
│ └── ui
│ │ └── button.tsx
│ ├── config
│ └── site.ts
│ ├── lib
│ ├── fonts.ts
│ └── utils.ts
│ ├── next-env.d.ts
│ ├── next.config.mjs
│ ├── package.json
│ ├── postcss.config.js
│ ├── prettier.config.js
│ ├── public
│ ├── favicon.ico
│ ├── next.svg
│ ├── thirteen.svg
│ └── vercel.svg
│ ├── styles
│ └── globals.css
│ ├── tailwind.config.js
│ ├── tsconfig.json
│ └── types
│ └── nav.ts
├── tsconfig.json
├── turbo.json
└── vitest.config.ts
/.changeset/README.md:
--------------------------------------------------------------------------------
1 | # Changesets
2 |
3 | Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4 | with multi-package repos, or single-package repos to help you version and publish your code. You can
5 | find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6 |
7 | We have a quick list of common questions to get you started engaging with this project in
8 | [our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
9 |
--------------------------------------------------------------------------------
/.changeset/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json",
3 | "changelog": ["@changesets/changelog-github", { "repo": "shadcn/ui" }],
4 | "commit": false,
5 | "fixed": [],
6 | "linked": [],
7 | "access": "public",
8 | "baseBranch": "main",
9 | "updateInternalDependencies": "patch",
10 | "ignore": ["www", "**-template"]
11 | }
12 |
--------------------------------------------------------------------------------
/.commitlintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": ["@commitlint/config-conventional"]
3 | }
4 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # editorconfig.org
2 | root = true
3 |
4 | [*]
5 | charset = utf-8
6 | end_of_line = lf
7 | indent_size = 2
8 | indent_style = space
9 | insert_final_newline = true
10 | trim_trailing_whitespace = true
11 |
--------------------------------------------------------------------------------
/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json.schemastore.org/eslintrc",
3 | "root": true,
4 | "extends": [
5 | "next/core-web-vitals",
6 | "turbo",
7 | "prettier",
8 | "plugin:tailwindcss/recommended"
9 | ],
10 | "plugins": ["tailwindcss"],
11 | "rules": {
12 | "@next/next/no-html-link-for-pages": "off",
13 | "tailwindcss/no-custom-classname": "off",
14 | "tailwindcss/classnames-order": "error"
15 | },
16 | "settings": {
17 | "tailwindcss": {
18 | "callees": ["cn", "cva"],
19 | "config": "tailwind.config.cjs"
20 | },
21 | "next": {
22 | "rootDir": ["apps/*/"]
23 | }
24 | },
25 | "overrides": [
26 | {
27 | "files": ["*.ts", "*.tsx"],
28 | "parser": "@typescript-eslint/parser"
29 | }
30 | ]
31 | }
32 |
--------------------------------------------------------------------------------
/.github/changeset-version.js:
--------------------------------------------------------------------------------
1 | // ORIGINALLY FROM CLOUDFLARE WRANGLER:
2 | // https://github.com/cloudflare/wrangler2/blob/main/.github/changeset-version.js
3 |
4 | import { exec } from "child_process"
5 |
6 | // This script is used by the `release.yml` workflow to update the version of the packages being released.
7 | // The standard step is only to run `changeset version` but this does not update the package-lock.json file.
8 | // So we also run `npm install`, which does this update.
9 | // This is a workaround until this is handled automatically by `changeset version`.
10 | // See https://github.com/changesets/changesets/issues/421.
11 | exec("npx changeset version")
12 | exec("npm install")
13 |
--------------------------------------------------------------------------------
/.github/version-script-beta.js:
--------------------------------------------------------------------------------
1 | // ORIGINALLY FROM CLOUDFLARE WRANGLER:
2 | // https://github.com/cloudflare/wrangler2/blob/main/.github/version-script.js
3 |
4 | import { exec } from "child_process"
5 | import fs from "fs"
6 |
7 | const pkgJsonPath = "packages/cli/package.json"
8 | try {
9 | const pkg = JSON.parse(fs.readFileSync(pkgJsonPath))
10 | exec("git rev-parse --short HEAD", (err, stdout) => {
11 | if (err) {
12 | console.log(err)
13 | process.exit(1)
14 | }
15 | pkg.version = "0.0.0-beta." + stdout.trim()
16 | fs.writeFileSync(pkgJsonPath, JSON.stringify(pkg, null, "\t") + "\n")
17 | })
18 | } catch (error) {
19 | console.error(error)
20 | process.exit(1)
21 | }
22 |
--------------------------------------------------------------------------------
/.github/version-script-next.js:
--------------------------------------------------------------------------------
1 | // ORIGINALLY FROM CLOUDFLARE WRANGLER:
2 | // https://github.com/cloudflare/wrangler2/blob/main/.github/version-script.js
3 |
4 | import { exec } from "child_process"
5 | import fs from "fs"
6 |
7 | const pkgJsonPath = "packages/cli/package.json"
8 | try {
9 | const pkg = JSON.parse(fs.readFileSync(pkgJsonPath))
10 | exec("git rev-parse --short HEAD", (err, stdout) => {
11 | if (err) {
12 | console.log(err)
13 | process.exit(1)
14 | }
15 | pkg.version = "0.0.0-next." + stdout.trim()
16 | fs.writeFileSync(pkgJsonPath, JSON.stringify(pkg, null, "\t") + "\n")
17 | })
18 | } catch (error) {
19 | console.error(error)
20 | process.exit(1)
21 | }
22 |
--------------------------------------------------------------------------------
/.github/workflows/test.yml:
--------------------------------------------------------------------------------
1 | name: Test
2 |
3 | on:
4 | pull_request:
5 | branches: ["*"]
6 |
7 | jobs:
8 | test:
9 | runs-on: ubuntu-latest
10 | name: Test
11 | steps:
12 | - uses: actions/checkout@v3
13 | with:
14 | fetch-depth: 0
15 |
16 | - name: Install Node.js
17 | uses: actions/setup-node@v3
18 | with:
19 | node-version: 16
20 |
21 | - uses: pnpm/action-setup@v2.2.4
22 | name: Install pnpm
23 | id: pnpm-install
24 | with:
25 | version: 8.6.1
26 | run_install: false
27 |
28 | - name: Get pnpm store directory
29 | id: pnpm-cache
30 | run: |
31 | echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
32 | - uses: actions/cache@v3
33 | name: Setup pnpm cache
34 | with:
35 | path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
36 | key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
37 | restore-keys: |
38 | ${{ runner.os }}-pnpm-store-
39 | - name: Install dependencies
40 | run: pnpm install
41 |
42 | - run: pnpm test
43 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | node_modules
5 | .pnp
6 | .pnp.js
7 |
8 | # testing
9 | coverage
10 |
11 | # next.js
12 | .next/
13 | out/
14 | build
15 |
16 | # misc
17 | .DS_Store
18 | *.pem
19 |
20 | # debug
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 | .pnpm-debug.log*
25 |
26 | # local env files
27 | .env.local
28 | .env.development.local
29 | .env.test.local
30 | .env.production.local
31 |
32 | # turbo
33 | .turbo
34 |
35 | .contentlayer
36 | tsconfig.tsbuildinfo
--------------------------------------------------------------------------------
/.husky/commit-msg:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 | . "$(dirname -- "$0")/_/husky.sh"
3 |
4 | npx commitlint --edit $1
5 |
--------------------------------------------------------------------------------
/.npmrc:
--------------------------------------------------------------------------------
1 | auto-install-peers=true
2 |
--------------------------------------------------------------------------------
/.nvmrc:
--------------------------------------------------------------------------------
1 | v16.18.0
2 |
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | dist
2 | node_modules
3 | .next
4 | build
5 | .contentlayer
6 | apps/www/pages/api/registry.json
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "eslint.workingDirectories": [
3 | { "pattern": "apps/*/" },
4 | { "pattern": "packages/*/" }
5 | ],
6 | "tailwindCSS.experimental.classRegex": [
7 | ["cva\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"],
8 | ["cn\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"]
9 | ]
10 | }
11 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2023 shadcn
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Next.js/ui
2 |
--------------------------------------------------------------------------------
/apps/www/.env.example:
--------------------------------------------------------------------------------
1 | # -----------------------------------------------------------------------------
2 | # App
3 | # -----------------------------------------------------------------------------
4 | NEXT_PUBLIC_APP_URL=http://localhost:3001
5 |
--------------------------------------------------------------------------------
/apps/www/.gitignore:
--------------------------------------------------------------------------------
1 | .vscode
2 | .env
--------------------------------------------------------------------------------
/apps/www/.prettierignore:
--------------------------------------------------------------------------------
1 | dist
2 | node_modules
3 | .next
4 | build
5 | .contentlayer
6 | __registry__/index.tsx
--------------------------------------------------------------------------------
/apps/www/__registry__/.autogenerated:
--------------------------------------------------------------------------------
1 | // The content of this directory is autogenerated by the registry server.
2 |
--------------------------------------------------------------------------------
/apps/www/__registry__/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coincatcher22/ui/cefee5dc6f84b3c5d50b48027c52d578ea300734/apps/www/__registry__/.gitkeep
--------------------------------------------------------------------------------
/apps/www/__registry__/README.md:
--------------------------------------------------------------------------------
1 | > Files inside this directory is autogenerated by `./scripts/build-registry.ts`. **Do not edit them manually.** - shadcn
2 |
--------------------------------------------------------------------------------
/apps/www/app/docs/layout.tsx:
--------------------------------------------------------------------------------
1 | import { docsConfig } from "@/config/docs"
2 | import { DocsSidebarNav } from "@/components/sidebar-nav"
3 | import { ScrollArea } from "@/registry/new-york/ui/scroll-area"
4 |
5 | interface DocsLayoutProps {
6 | children: React.ReactNode
7 | }
8 |
9 | export default function DocsLayout({ children }: DocsLayoutProps) {
10 | return (
11 |
12 |
13 |
18 | {children}
19 |
20 |
21 | )
22 | }
23 |
--------------------------------------------------------------------------------
/apps/www/app/examples/cards/components/date-picker.tsx:
--------------------------------------------------------------------------------
1 | import DatePickerWithRange from "@/registry/default/example/date-picker-with-range"
2 | import { Card, CardContent } from "@/registry/new-york/ui/card"
3 | import { Label } from "@/registry/new-york/ui/label"
4 |
5 | export function DemoDatePicker() {
6 | return (
7 |
8 |
9 |
10 |
13 |
14 |
15 |
16 |
17 | )
18 | }
19 |
--------------------------------------------------------------------------------
/apps/www/app/examples/dashboard/components/main-nav.tsx:
--------------------------------------------------------------------------------
1 | import Link from "next/link"
2 |
3 | import { cn } from "@/lib/utils"
4 |
5 | export function MainNav({
6 | className,
7 | ...props
8 | }: React.HTMLAttributes) {
9 | return (
10 |
39 | )
40 | }
41 |
--------------------------------------------------------------------------------
/apps/www/app/examples/dashboard/components/search.tsx:
--------------------------------------------------------------------------------
1 | import { Input } from "@/registry/new-york/ui/input"
2 |
3 | export function Search() {
4 | return (
5 |
6 |
11 |
12 | )
13 | }
14 |
--------------------------------------------------------------------------------
/apps/www/app/examples/forms/account/page.tsx:
--------------------------------------------------------------------------------
1 | import { Separator } from "@/registry/new-york/ui/separator"
2 | import { AccountForm } from "@/app/examples/forms/account/account-form"
3 |
4 | export default function SettingsAccountPage() {
5 | return (
6 |
7 |
8 |
Account
9 |
10 | Update your account settings. Set your preferred language and
11 | timezone.
12 |
13 |
14 |
15 |
16 |
17 | )
18 | }
19 |
--------------------------------------------------------------------------------
/apps/www/app/examples/forms/appearance/page.tsx:
--------------------------------------------------------------------------------
1 | import { Separator } from "@/registry/new-york/ui/separator"
2 | import { AppearanceForm } from "@/app/examples/forms/appearance/appearance-form"
3 |
4 | export default function SettingsAppearancePage() {
5 | return (
6 |
7 |
8 |
Appearance
9 |
10 | Customize the appearance of the app. Automatically switch between day
11 | and night themes.
12 |
13 |
14 |
15 |
16 |
17 | )
18 | }
19 |
--------------------------------------------------------------------------------
/apps/www/app/examples/forms/components/sidebar-nav.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import Link from "next/link"
4 | import { usePathname } from "next/navigation"
5 |
6 | import { cn } from "@/lib/utils"
7 | import { buttonVariants } from "@/registry/new-york/ui/button"
8 |
9 | interface SidebarNavProps extends React.HTMLAttributes {
10 | items: {
11 | href: string
12 | title: string
13 | }[]
14 | }
15 |
16 | export function SidebarNav({ className, items, ...props }: SidebarNavProps) {
17 | const pathname = usePathname()
18 |
19 | return (
20 |
43 | )
44 | }
45 |
--------------------------------------------------------------------------------
/apps/www/app/examples/forms/display/page.tsx:
--------------------------------------------------------------------------------
1 | import { Separator } from "@/registry/new-york/ui/separator"
2 | import { DisplayForm } from "@/app/examples/forms/display/display-form"
3 |
4 | export default function SettingsDisplayPage() {
5 | return (
6 |
7 |
8 |
Display
9 |
10 | Turn items on or off to control what's displayed in the app.
11 |
12 |
13 |
14 |
15 |
16 | )
17 | }
18 |
--------------------------------------------------------------------------------
/apps/www/app/examples/forms/notifications/page.tsx:
--------------------------------------------------------------------------------
1 | import { Separator } from "@/registry/new-york/ui/separator"
2 | import { NotificationsForm } from "@/app/examples/forms/notifications/notifications-form"
3 |
4 | export default function SettingsNotificationsPage() {
5 | return (
6 |
7 |
8 |
Notifications
9 |
10 | Configure how you receive notifications.
11 |
12 |
13 |
14 |
15 |
16 | )
17 | }
18 |
--------------------------------------------------------------------------------
/apps/www/app/examples/forms/page.tsx:
--------------------------------------------------------------------------------
1 | import { Separator } from "@/registry/new-york/ui/separator"
2 | import { ProfileForm } from "@/app/examples/forms/profile-form"
3 |
4 | export default function SettingsProfilePage() {
5 | return (
6 |
7 |
8 |
Profile
9 |
10 | This is how others will see you on the site.
11 |
12 |
13 |
14 |
15 |
16 | )
17 | }
18 |
--------------------------------------------------------------------------------
/apps/www/app/examples/music/data/playlists.ts:
--------------------------------------------------------------------------------
1 | export type Playlist = (typeof playlists)[number]
2 |
3 | export const playlists = [
4 | "Recently Added",
5 | "Recently Played",
6 | "Top Songs",
7 | "Top Albums",
8 | "Top Artists",
9 | "Logic Discography",
10 | "Bedtime Beats",
11 | "Feeling Happy",
12 | "I miss Y2K Pop",
13 | "Runtober",
14 | "Mellow Days",
15 | "Eminem Essentials",
16 | ]
17 |
--------------------------------------------------------------------------------
/apps/www/app/examples/playground/data/presets.ts:
--------------------------------------------------------------------------------
1 | export interface Preset {
2 | id: string
3 | name: string
4 | }
5 |
6 | export const presets: Preset[] = [
7 | {
8 | id: "9cb0e66a-9937-465d-a188-2c4c4ae2401f",
9 | name: "Grammatical Standard English",
10 | },
11 | {
12 | id: "61eb0e32-2391-4cd3-adc3-66efe09bc0b7",
13 | name: "Summarize for a 2nd grader",
14 | },
15 | {
16 | id: "a4e1fa51-f4ce-4e45-892c-224030a00bdd",
17 | name: "Text to command",
18 | },
19 | {
20 | id: "cc198b13-4933-43aa-977e-dcd95fa30770",
21 | name: "Q&A",
22 | },
23 | {
24 | id: "adfa95be-a575-45fd-a9ef-ea45386c64de",
25 | name: "English to other languages",
26 | },
27 | {
28 | id: "c569a06a-0bd6-43a7-adf9-bf68c09e7a79",
29 | name: "Parse unstructured data",
30 | },
31 | {
32 | id: "15ccc0d7-f37a-4f0a-8163-a37e162877dc",
33 | name: "Classification",
34 | },
35 | {
36 | id: "4641ef41-1c0f-421d-b4b2-70fe431081f3",
37 | name: "Natural language to Python",
38 | },
39 | {
40 | id: "48d34082-72f3-4a1b-a14d-f15aca4f57a0",
41 | name: "Explain code",
42 | },
43 | {
44 | id: "dfd42fd5-0394-4810-92c6-cc907d3bfd1a",
45 | name: "Chat",
46 | },
47 | ]
48 |
--------------------------------------------------------------------------------
/apps/www/app/examples/tasks/data/schema.ts:
--------------------------------------------------------------------------------
1 | import { z } from "zod"
2 |
3 | // We're keeping a simple non-relational schema here.
4 | // IRL, you will have a schema for your data models.
5 | export const taskSchema = z.object({
6 | id: z.string(),
7 | title: z.string(),
8 | status: z.string(),
9 | label: z.string(),
10 | priority: z.string(),
11 | })
12 |
13 | export type Task = z.infer
14 |
--------------------------------------------------------------------------------
/apps/www/app/examples/tasks/data/seed.ts:
--------------------------------------------------------------------------------
1 | import fs from "fs"
2 | import path from "path"
3 | import { faker } from "@faker-js/faker"
4 |
5 | import { labels, priorities, statuses } from "./data"
6 |
7 | const tasks = Array.from({ length: 100 }, () => ({
8 | id: `TASK-${faker.datatype.number({ min: 1000, max: 9999 })}`,
9 | title: faker.hacker.phrase().replace(/^./, (letter) => letter.toUpperCase()),
10 | status: faker.helpers.arrayElement(statuses).value,
11 | label: faker.helpers.arrayElement(labels).value,
12 | priority: faker.helpers.arrayElement(priorities).value,
13 | }))
14 |
15 | fs.writeFileSync(
16 | path.join(__dirname, "tasks.json"),
17 | JSON.stringify(tasks, null, 2)
18 | )
19 |
20 | console.log("✅ Tasks data generated.")
21 |
--------------------------------------------------------------------------------
/apps/www/app/sink/layout.tsx:
--------------------------------------------------------------------------------
1 | import Link from "next/link"
2 |
3 | import { ThemeWrapper } from "@/components/theme-wrapper"
4 | import { styles } from "@/registry/styles"
5 |
6 | interface SinkLayoutProps {
7 | children: React.ReactNode
8 | }
9 |
10 | export default function SinkLayout({ children }: SinkLayoutProps) {
11 | return (
12 |
13 |
14 |
15 | {styles.map((style) => (
16 |
17 | {style.label}
18 |
19 | ))}
20 |
21 |
22 |
23 | {children}
24 |
25 |
26 | )
27 | }
28 |
--------------------------------------------------------------------------------
/apps/www/assets/fonts/CalSans-SemiBold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coincatcher22/ui/cefee5dc6f84b3c5d50b48027c52d578ea300734/apps/www/assets/fonts/CalSans-SemiBold.ttf
--------------------------------------------------------------------------------
/apps/www/assets/fonts/CalSans-SemiBold.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coincatcher22/ui/cefee5dc6f84b3c5d50b48027c52d578ea300734/apps/www/assets/fonts/CalSans-SemiBold.woff
--------------------------------------------------------------------------------
/apps/www/assets/fonts/CalSans-SemiBold.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coincatcher22/ui/cefee5dc6f84b3c5d50b48027c52d578ea300734/apps/www/assets/fonts/CalSans-SemiBold.woff2
--------------------------------------------------------------------------------
/apps/www/assets/fonts/Inter-Bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coincatcher22/ui/cefee5dc6f84b3c5d50b48027c52d578ea300734/apps/www/assets/fonts/Inter-Bold.ttf
--------------------------------------------------------------------------------
/apps/www/assets/fonts/Inter-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coincatcher22/ui/cefee5dc6f84b3c5d50b48027c52d578ea300734/apps/www/assets/fonts/Inter-Regular.ttf
--------------------------------------------------------------------------------
/apps/www/components/analytics.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import { Analytics as VercelAnalytics } from "@vercel/analytics/react"
4 |
5 | export function Analytics() {
6 | return
7 | }
8 |
--------------------------------------------------------------------------------
/apps/www/components/callout.tsx:
--------------------------------------------------------------------------------
1 | import {
2 | Alert,
3 | AlertDescription,
4 | AlertTitle,
5 | } from "@/registry/new-york/ui/alert"
6 |
7 | interface CalloutProps {
8 | icon?: string
9 | title?: string
10 | children?: React.ReactNode
11 | }
12 |
13 | export function Callout({ title, children, icon, ...props }: CalloutProps) {
14 | return (
15 |
16 | {icon && {icon}}
17 | {title && {title}}
18 | {children}
19 |
20 | )
21 | }
22 |
--------------------------------------------------------------------------------
/apps/www/components/component-card.tsx:
--------------------------------------------------------------------------------
1 | import React from "react"
2 |
3 | import { cn } from "@/lib/utils"
4 | import { AspectRatio } from "@/registry/new-york/ui/aspect-ratio"
5 |
6 | export function ComponentCard({
7 | className,
8 | ...props
9 | }: React.HTMLAttributes) {
10 | return (
11 |
12 |
19 |
20 | )
21 | }
22 |
--------------------------------------------------------------------------------
/apps/www/components/component-source.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import * as React from "react"
4 |
5 | import { cn } from "@/lib/utils"
6 | import { CodeBlockWrapper } from "@/components/code-block-wrapper"
7 |
8 | interface ComponentSourceProps extends React.HTMLAttributes {
9 | src: string
10 | }
11 |
12 | export function ComponentSource({
13 | children,
14 | className,
15 | ...props
16 | }: ComponentSourceProps) {
17 | return (
18 |
22 | {children}
23 |
24 | )
25 | }
26 |
--------------------------------------------------------------------------------
/apps/www/components/framework-docs.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import * as React from "react"
4 | import { allDocs } from "contentlayer/generated"
5 |
6 | import { Mdx } from "./mdx-components"
7 |
8 | interface FrameworkDocsProps extends React.HTMLAttributes {
9 | data: string
10 | }
11 |
12 | export function FrameworkDocs({ ...props }: FrameworkDocsProps) {
13 | const frameworkDoc = allDocs.find(
14 | (doc) => doc.slug === `/docs/installation/${props.data}`
15 | )
16 |
17 | if (!frameworkDoc) {
18 | return null
19 | }
20 |
21 | return
22 | }
23 |
--------------------------------------------------------------------------------
/apps/www/components/promo-video.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import { AspectRatio } from "@/registry/new-york/ui/aspect-ratio"
4 |
5 | export function PromoVideo() {
6 | return (
7 |
11 |
17 |
18 | )
19 | }
20 |
--------------------------------------------------------------------------------
/apps/www/components/providers.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import * as React from "react"
4 | import { ThemeProvider as NextThemesProvider } from "next-themes"
5 | import { ThemeProviderProps } from "next-themes/dist/types"
6 |
7 | import { TooltipProvider } from "@/registry/new-york/ui/tooltip"
8 |
9 | export function ThemeProvider({ children, ...props }: ThemeProviderProps) {
10 | return (
11 |
12 | {children}
13 |
14 | )
15 | }
16 |
--------------------------------------------------------------------------------
/apps/www/components/site-footer.tsx:
--------------------------------------------------------------------------------
1 | import { siteConfig } from "@/config/site"
2 |
3 | export function SiteFooter() {
4 | return (
5 |
30 | )
31 | }
32 |
--------------------------------------------------------------------------------
/apps/www/components/style-wrapper.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import * as React from "react"
4 |
5 | import { useConfig } from "@/hooks/use-config"
6 | import { Style } from "@/registry/styles"
7 |
8 | interface StyleWrapperProps extends React.HTMLAttributes {
9 | styleName?: Style["name"]
10 | }
11 |
12 | export function StyleWrapper({ styleName, children }: StyleWrapperProps) {
13 | const [config] = useConfig()
14 |
15 | if (!styleName || config.style === styleName) {
16 | return <>{children}>
17 | }
18 |
19 | return null
20 | }
21 |
--------------------------------------------------------------------------------
/apps/www/components/tailwind-indicator.tsx:
--------------------------------------------------------------------------------
1 | export function TailwindIndicator() {
2 | if (process.env.NODE_ENV === "production") return null
3 |
4 | return (
5 |
6 |
xs
7 |
sm
8 |
md
9 |
lg
10 |
xl
11 |
2xl
12 |
13 | )
14 | }
15 |
--------------------------------------------------------------------------------
/apps/www/components/theme-wrapper.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import { cn } from "@/lib/utils"
4 | import { useConfig } from "@/hooks/use-config"
5 |
6 | export function ThemeWrapper({ children }: React.ComponentProps<"div">) {
7 | const [config] = useConfig()
8 |
9 | return {children}
10 | }
11 |
--------------------------------------------------------------------------------
/apps/www/config/site.ts:
--------------------------------------------------------------------------------
1 | export const siteConfig = {
2 | name: "shadcn/ui",
3 | url: "https://ui.shadcn.com",
4 | ogImage: "https://ui.shadcn.com/og.jpg",
5 | description:
6 | "Beautifully designed components built with Radix UI and Tailwind CSS.",
7 | links: {
8 | twitter: "https://twitter.com/shadcn",
9 | github: "https://github.com/shadcn/ui",
10 | },
11 | }
12 |
13 | export type SiteConfig = typeof siteConfig
14 |
--------------------------------------------------------------------------------
/apps/www/content/docs/about.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: About
3 | description: Powered by amazing open source projects.
4 | ---
5 |
6 | ## About
7 |
8 | [ui.shadcn.com](https://ui.shadcn.com) is a project by [shadcn](https://shadcn.com).
9 |
10 | ## Credits
11 |
12 | - [Radix UI](https://radix-ui.com) - For the primitives.
13 | - [Vercel](https://vercel.com) - Where I host all my projects.
14 | - [Shu Ding](https://shud.in) - The typography style is adapted from his work on Nextra.
15 | - [Cal](https://cal.com) - Where I copied the styles for the first component: the `Button`.
16 | - [cmdk](https://cmdk.paco.me) - For the `` component.
17 |
18 | ## License
19 |
20 | MIT © [shadcn](https://shadcn.com)
21 |
--------------------------------------------------------------------------------
/apps/www/content/docs/components/skeleton.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Skeleton
3 | description: Use to show a placeholder while content is loading.
4 | component: true
5 | ---
6 |
7 |
8 |
9 | ## Installation
10 |
11 |
12 |
13 |
14 | CLI
15 | Manual
16 |
17 |
18 |
19 | ```bash
20 | npx shadcn-ui@latest add skeleton
21 | ```
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 | Copy and paste the following code into your project.
30 |
31 |
32 |
33 | Update the import paths to match your project setup.
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 | ## Usage
42 |
43 | ```tsx
44 | import { Skeleton } from "@/components/ui/skeleton"
45 | ```
46 |
47 | ```tsx
48 |
49 | ```
50 |
--------------------------------------------------------------------------------
/apps/www/content/docs/components/typography.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Typography
3 | description: Styles for headings, paragraphs, lists...etc
4 | component: true
5 | ---
6 |
7 |
11 |
12 | ## h1
13 |
14 |
15 |
16 | ## h2
17 |
18 |
19 |
20 | ## h3
21 |
22 |
23 |
24 | ## h4
25 |
26 |
27 |
28 | ## p
29 |
30 |
31 |
32 | ## blockquote
33 |
34 |
35 |
36 | ## table
37 |
38 |
39 |
40 | ## list
41 |
42 |
43 |
44 | ## Inline code
45 |
46 |
47 |
48 | ## Lead
49 |
50 |
51 |
52 | ## Large
53 |
54 |
55 |
56 | ## Small
57 |
58 |
59 |
60 | ## Muted
61 |
62 |
63 |
--------------------------------------------------------------------------------
/apps/www/content/docs/figma.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Figma
3 | description: Every component recreated in Figma. With customizable props, typography and icons.
4 | ---
5 |
6 | The Figma UI Kit is open sourced by [Pietro Schirano](https://twitter.com/skirano).
7 |
8 |
9 |
13 |
14 |
15 | ## Grab a copy
16 |
17 | https://www.figma.com/community/file/1203061493325953101
18 |
--------------------------------------------------------------------------------
/apps/www/hooks/use-config.ts:
--------------------------------------------------------------------------------
1 | import { useAtom } from "jotai"
2 | import { atomWithStorage } from "jotai/utils"
3 |
4 | import { Style } from "@/registry/styles"
5 | import { Theme } from "@/registry/themes"
6 |
7 | type Config = {
8 | style: Style["name"]
9 | theme: Theme["name"]
10 | }
11 |
12 | const configAtom = atomWithStorage("config", {
13 | style: "default",
14 | theme: "zinc",
15 | })
16 |
17 | export function useConfig() {
18 | return useAtom(configAtom)
19 | }
20 |
--------------------------------------------------------------------------------
/apps/www/hooks/use-lock-body.ts:
--------------------------------------------------------------------------------
1 | import * as React from "react"
2 |
3 | // @see https://usehooks.com/useLockBodyScroll.
4 | export function useLockBody() {
5 | React.useLayoutEffect((): (() => void) => {
6 | const originalStyle: string = window.getComputedStyle(
7 | document.body
8 | ).overflow
9 | document.body.style.overflow = "hidden"
10 | return () => (document.body.style.overflow = originalStyle)
11 | }, [])
12 | }
13 |
--------------------------------------------------------------------------------
/apps/www/hooks/use-mounted.ts:
--------------------------------------------------------------------------------
1 | import * as React from "react"
2 |
3 | export function useMounted() {
4 | const [mounted, setMounted] = React.useState(false)
5 |
6 | React.useEffect(() => {
7 | setMounted(true)
8 | }, [])
9 |
10 | return mounted
11 | }
12 |
--------------------------------------------------------------------------------
/apps/www/hooks/use-mutation-observer.ts:
--------------------------------------------------------------------------------
1 | import * as React from "react"
2 |
3 | export const useMutationObserver = (
4 | ref: React.MutableRefObject,
5 | callback: MutationCallback,
6 | options = {
7 | attributes: true,
8 | characterData: true,
9 | childList: true,
10 | subtree: true,
11 | }
12 | ) => {
13 | React.useEffect(() => {
14 | if (ref.current) {
15 | const observer = new MutationObserver(callback)
16 | observer.observe(ref.current, options)
17 | return () => observer.disconnect()
18 | }
19 | }, [ref, callback, options])
20 | }
21 |
--------------------------------------------------------------------------------
/apps/www/lib/events.ts:
--------------------------------------------------------------------------------
1 | import va from "@vercel/analytics"
2 | import { z } from "zod"
3 |
4 | const eventSchema = z.object({
5 | name: z.enum([
6 | "copy_npm_command",
7 | "copy_usage_import_code",
8 | "copy_usage_code",
9 | "copy_primitive_code",
10 | ]),
11 | // declare type AllowedPropertyValues = string | number | boolean | null
12 | properties: z
13 | .record(z.union([z.string(), z.number(), z.boolean(), z.null()]))
14 | .optional(),
15 | })
16 |
17 | export type Event = z.infer
18 |
19 | export function trackEvent(input: Event): void {
20 | const event = eventSchema.parse(input)
21 | if (event) {
22 | va.track(event.name, event.properties)
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/apps/www/lib/fonts.ts:
--------------------------------------------------------------------------------
1 | import { JetBrains_Mono as FontMono, Inter as FontSans } from "next/font/google"
2 |
3 | export const fontSans = FontSans({
4 | subsets: ["latin"],
5 | variable: "--font-sans",
6 | })
7 |
8 | export const fontMono = FontMono({
9 | subsets: ["latin"],
10 | variable: "--font-mono",
11 | })
12 |
--------------------------------------------------------------------------------
/apps/www/lib/utils.ts:
--------------------------------------------------------------------------------
1 | import { clsx, type ClassValue } from "clsx"
2 | import { twMerge } from "tailwind-merge"
3 |
4 | export function cn(...inputs: ClassValue[]) {
5 | return twMerge(clsx(inputs))
6 | }
7 |
8 | export function formatDate(input: string | number): string {
9 | const date = new Date(input)
10 | return date.toLocaleDateString("en-US", {
11 | month: "long",
12 | day: "numeric",
13 | year: "numeric",
14 | })
15 | }
16 |
17 | export function absoluteUrl(path: string) {
18 | return `${process.env.NEXT_PUBLIC_APP_URL}${path}`
19 | }
20 |
--------------------------------------------------------------------------------
/apps/www/lib/validations/log.ts:
--------------------------------------------------------------------------------
1 | import * as z from "zod"
2 |
3 | export const logSchema = z.object({
4 | event: z.enum(["copy_primitive"]),
5 | data: z.record(z.string()),
6 | })
7 |
--------------------------------------------------------------------------------
/apps/www/lib/validations/og.ts:
--------------------------------------------------------------------------------
1 | import * as z from "zod"
2 |
3 | export const ogImageSchema = z.object({
4 | heading: z.string(),
5 | type: z.string(),
6 | mode: z.enum(["light", "dark"]).default("dark"),
7 | })
8 |
--------------------------------------------------------------------------------
/apps/www/next-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 | ///
3 | ///
4 |
5 | // NOTE: This file should not be edited
6 | // see https://nextjs.org/docs/basic-features/typescript for more information.
7 |
--------------------------------------------------------------------------------
/apps/www/pages/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coincatcher22/ui/cefee5dc6f84b3c5d50b48027c52d578ea300734/apps/www/pages/.gitkeep
--------------------------------------------------------------------------------
/apps/www/pages/api/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coincatcher22/ui/cefee5dc6f84b3c5d50b48027c52d578ea300734/apps/www/pages/api/.gitkeep
--------------------------------------------------------------------------------
/apps/www/pages/api/components.ts:
--------------------------------------------------------------------------------
1 | import { NextApiRequest, NextApiResponse } from "next"
2 |
3 | import components from "./components.json"
4 |
5 | export default async function handler(
6 | req: NextApiRequest,
7 | res: NextApiResponse
8 | ) {
9 | if (req.method !== "GET") {
10 | return res.status(405).end()
11 | }
12 |
13 | return res.status(200).json(components)
14 | }
15 |
--------------------------------------------------------------------------------
/apps/www/postcss.config.cjs:
--------------------------------------------------------------------------------
1 | module.exports = require("../../postcss.config.cjs")
2 |
--------------------------------------------------------------------------------
/apps/www/public/android-chrome-192x192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coincatcher22/ui/cefee5dc6f84b3c5d50b48027c52d578ea300734/apps/www/public/android-chrome-192x192.png
--------------------------------------------------------------------------------
/apps/www/public/android-chrome-512x512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coincatcher22/ui/cefee5dc6f84b3c5d50b48027c52d578ea300734/apps/www/public/android-chrome-512x512.png
--------------------------------------------------------------------------------
/apps/www/public/apple-touch-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coincatcher22/ui/cefee5dc6f84b3c5d50b48027c52d578ea300734/apps/www/public/apple-touch-icon.png
--------------------------------------------------------------------------------
/apps/www/public/avatars/01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coincatcher22/ui/cefee5dc6f84b3c5d50b48027c52d578ea300734/apps/www/public/avatars/01.png
--------------------------------------------------------------------------------
/apps/www/public/avatars/02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coincatcher22/ui/cefee5dc6f84b3c5d50b48027c52d578ea300734/apps/www/public/avatars/02.png
--------------------------------------------------------------------------------
/apps/www/public/avatars/03.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coincatcher22/ui/cefee5dc6f84b3c5d50b48027c52d578ea300734/apps/www/public/avatars/03.png
--------------------------------------------------------------------------------
/apps/www/public/avatars/04.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coincatcher22/ui/cefee5dc6f84b3c5d50b48027c52d578ea300734/apps/www/public/avatars/04.png
--------------------------------------------------------------------------------
/apps/www/public/avatars/05.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coincatcher22/ui/cefee5dc6f84b3c5d50b48027c52d578ea300734/apps/www/public/avatars/05.png
--------------------------------------------------------------------------------
/apps/www/public/examples/authentication-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coincatcher22/ui/cefee5dc6f84b3c5d50b48027c52d578ea300734/apps/www/public/examples/authentication-dark.png
--------------------------------------------------------------------------------
/apps/www/public/examples/authentication-light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coincatcher22/ui/cefee5dc6f84b3c5d50b48027c52d578ea300734/apps/www/public/examples/authentication-light.png
--------------------------------------------------------------------------------
/apps/www/public/examples/cards-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coincatcher22/ui/cefee5dc6f84b3c5d50b48027c52d578ea300734/apps/www/public/examples/cards-dark.png
--------------------------------------------------------------------------------
/apps/www/public/examples/cards-light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coincatcher22/ui/cefee5dc6f84b3c5d50b48027c52d578ea300734/apps/www/public/examples/cards-light.png
--------------------------------------------------------------------------------
/apps/www/public/examples/dashboard-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coincatcher22/ui/cefee5dc6f84b3c5d50b48027c52d578ea300734/apps/www/public/examples/dashboard-dark.png
--------------------------------------------------------------------------------
/apps/www/public/examples/dashboard-light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coincatcher22/ui/cefee5dc6f84b3c5d50b48027c52d578ea300734/apps/www/public/examples/dashboard-light.png
--------------------------------------------------------------------------------
/apps/www/public/examples/forms-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coincatcher22/ui/cefee5dc6f84b3c5d50b48027c52d578ea300734/apps/www/public/examples/forms-dark.png
--------------------------------------------------------------------------------
/apps/www/public/examples/forms-light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coincatcher22/ui/cefee5dc6f84b3c5d50b48027c52d578ea300734/apps/www/public/examples/forms-light.png
--------------------------------------------------------------------------------
/apps/www/public/examples/music-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coincatcher22/ui/cefee5dc6f84b3c5d50b48027c52d578ea300734/apps/www/public/examples/music-dark.png
--------------------------------------------------------------------------------
/apps/www/public/examples/music-light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coincatcher22/ui/cefee5dc6f84b3c5d50b48027c52d578ea300734/apps/www/public/examples/music-light.png
--------------------------------------------------------------------------------
/apps/www/public/examples/playground-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coincatcher22/ui/cefee5dc6f84b3c5d50b48027c52d578ea300734/apps/www/public/examples/playground-dark.png
--------------------------------------------------------------------------------
/apps/www/public/examples/playground-light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coincatcher22/ui/cefee5dc6f84b3c5d50b48027c52d578ea300734/apps/www/public/examples/playground-light.png
--------------------------------------------------------------------------------
/apps/www/public/examples/tasks-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coincatcher22/ui/cefee5dc6f84b3c5d50b48027c52d578ea300734/apps/www/public/examples/tasks-dark.png
--------------------------------------------------------------------------------
/apps/www/public/examples/tasks-light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coincatcher22/ui/cefee5dc6f84b3c5d50b48027c52d578ea300734/apps/www/public/examples/tasks-light.png
--------------------------------------------------------------------------------
/apps/www/public/favicon-16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coincatcher22/ui/cefee5dc6f84b3c5d50b48027c52d578ea300734/apps/www/public/favicon-16x16.png
--------------------------------------------------------------------------------
/apps/www/public/favicon-32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coincatcher22/ui/cefee5dc6f84b3c5d50b48027c52d578ea300734/apps/www/public/favicon-32x32.png
--------------------------------------------------------------------------------
/apps/www/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coincatcher22/ui/cefee5dc6f84b3c5d50b48027c52d578ea300734/apps/www/public/favicon.ico
--------------------------------------------------------------------------------
/apps/www/public/images/style-with-theming.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coincatcher22/ui/cefee5dc6f84b3c5d50b48027c52d578ea300734/apps/www/public/images/style-with-theming.jpg
--------------------------------------------------------------------------------
/apps/www/public/images/style.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coincatcher22/ui/cefee5dc6f84b3c5d50b48027c52d578ea300734/apps/www/public/images/style.jpg
--------------------------------------------------------------------------------
/apps/www/public/og.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coincatcher22/ui/cefee5dc6f84b3c5d50b48027c52d578ea300734/apps/www/public/og.jpg
--------------------------------------------------------------------------------
/apps/www/public/registry/styles/default/aspect-ratio.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "aspect-ratio",
3 | "dependencies": [
4 | "@radix-ui/react-aspect-ratio"
5 | ],
6 | "files": [
7 | {
8 | "name": "aspect-ratio.tsx",
9 | "content": "\"use client\"\n\nimport * as AspectRatioPrimitive from \"@radix-ui/react-aspect-ratio\"\n\nconst AspectRatio = AspectRatioPrimitive.Root\n\nexport { AspectRatio }\n"
10 | }
11 | ],
12 | "type": "components:ui"
13 | }
--------------------------------------------------------------------------------
/apps/www/public/registry/styles/default/collapsible.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "collapsible",
3 | "dependencies": [
4 | "@radix-ui/react-collapsible"
5 | ],
6 | "files": [
7 | {
8 | "name": "collapsible.tsx",
9 | "content": "\"use client\"\n\nimport * as CollapsiblePrimitive from \"@radix-ui/react-collapsible\"\n\nconst Collapsible = CollapsiblePrimitive.Root\n\nconst CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger\n\nconst CollapsibleContent = CollapsiblePrimitive.CollapsibleContent\n\nexport { Collapsible, CollapsibleTrigger, CollapsibleContent }\n"
10 | }
11 | ],
12 | "type": "components:ui"
13 | }
--------------------------------------------------------------------------------
/apps/www/public/registry/styles/default/input.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "input",
3 | "files": [
4 | {
5 | "name": "input.tsx",
6 | "content": "import * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport interface InputProps\n extends React.InputHTMLAttributes {}\n\nconst Input = React.forwardRef(\n ({ className, type, ...props }, ref) => {\n return (\n \n )\n }\n)\nInput.displayName = \"Input\"\n\nexport { Input }\n"
7 | }
8 | ],
9 | "type": "components:ui"
10 | }
--------------------------------------------------------------------------------
/apps/www/public/registry/styles/default/label.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "label",
3 | "dependencies": [
4 | "@radix-ui/react-label"
5 | ],
6 | "files": [
7 | {
8 | "name": "label.tsx",
9 | "content": "\"use client\"\n\nimport * as React from \"react\"\nimport * as LabelPrimitive from \"@radix-ui/react-label\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst labelVariants = cva(\n \"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n)\n\nconst Label = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef &\n VariantProps\n>(({ className, ...props }, ref) => (\n \n))\nLabel.displayName = LabelPrimitive.Root.displayName\n\nexport { Label }\n"
10 | }
11 | ],
12 | "type": "components:ui"
13 | }
--------------------------------------------------------------------------------
/apps/www/public/registry/styles/default/progress.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "progress",
3 | "dependencies": [
4 | "@radix-ui/react-progress"
5 | ],
6 | "files": [
7 | {
8 | "name": "progress.tsx",
9 | "content": "\"use client\"\n\nimport * as React from \"react\"\nimport * as ProgressPrimitive from \"@radix-ui/react-progress\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst Progress = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, value, ...props }, ref) => (\n \n \n \n))\nProgress.displayName = ProgressPrimitive.Root.displayName\n\nexport { Progress }\n"
10 | }
11 | ],
12 | "type": "components:ui"
13 | }
--------------------------------------------------------------------------------
/apps/www/public/registry/styles/default/separator.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "separator",
3 | "dependencies": [
4 | "@radix-ui/react-separator"
5 | ],
6 | "files": [
7 | {
8 | "name": "separator.tsx",
9 | "content": "\"use client\"\n\nimport * as React from \"react\"\nimport * as SeparatorPrimitive from \"@radix-ui/react-separator\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst Separator = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(\n (\n { className, orientation = \"horizontal\", decorative = true, ...props },\n ref\n ) => (\n \n )\n)\nSeparator.displayName = SeparatorPrimitive.Root.displayName\n\nexport { Separator }\n"
10 | }
11 | ],
12 | "type": "components:ui"
13 | }
--------------------------------------------------------------------------------
/apps/www/public/registry/styles/default/skeleton.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "skeleton",
3 | "files": [
4 | {
5 | "name": "skeleton.tsx",
6 | "content": "import { cn } from \"@/lib/utils\"\n\nfunction Skeleton({\n className,\n ...props\n}: React.HTMLAttributes) {\n return (\n \n )\n}\n\nexport { Skeleton }\n"
7 | }
8 | ],
9 | "type": "components:ui"
10 | }
--------------------------------------------------------------------------------
/apps/www/public/registry/styles/default/textarea.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "textarea",
3 | "files": [
4 | {
5 | "name": "textarea.tsx",
6 | "content": "import * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport interface TextareaProps\n extends React.TextareaHTMLAttributes {}\n\nconst Textarea = React.forwardRef(\n ({ className, ...props }, ref) => {\n return (\n \n )\n }\n)\nTextarea.displayName = \"Textarea\"\n\nexport { Textarea }\n"
7 | }
8 | ],
9 | "type": "components:ui"
10 | }
--------------------------------------------------------------------------------
/apps/www/public/registry/styles/index.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "name": "default",
4 | "label": "Default"
5 | },
6 | {
7 | "name": "new-york",
8 | "label": "New York"
9 | }
10 | ]
--------------------------------------------------------------------------------
/apps/www/public/registry/styles/new-york/aspect-ratio.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "aspect-ratio",
3 | "dependencies": [
4 | "@radix-ui/react-aspect-ratio"
5 | ],
6 | "files": [
7 | {
8 | "name": "aspect-ratio.tsx",
9 | "content": "\"use client\"\n\nimport * as AspectRatioPrimitive from \"@radix-ui/react-aspect-ratio\"\n\nconst AspectRatio = AspectRatioPrimitive.Root\n\nexport { AspectRatio }\n"
10 | }
11 | ],
12 | "type": "components:ui"
13 | }
--------------------------------------------------------------------------------
/apps/www/public/registry/styles/new-york/collapsible.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "collapsible",
3 | "dependencies": [
4 | "@radix-ui/react-collapsible"
5 | ],
6 | "files": [
7 | {
8 | "name": "collapsible.tsx",
9 | "content": "\"use client\"\n\nimport * as CollapsiblePrimitive from \"@radix-ui/react-collapsible\"\n\nconst Collapsible = CollapsiblePrimitive.Root\n\nconst CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger\n\nconst CollapsibleContent = CollapsiblePrimitive.CollapsibleContent\n\nexport { Collapsible, CollapsibleTrigger, CollapsibleContent }\n"
10 | }
11 | ],
12 | "type": "components:ui"
13 | }
--------------------------------------------------------------------------------
/apps/www/public/registry/styles/new-york/input.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "input",
3 | "files": [
4 | {
5 | "name": "input.tsx",
6 | "content": "import * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport interface InputProps\n extends React.InputHTMLAttributes {}\n\nconst Input = React.forwardRef(\n ({ className, type, ...props }, ref) => {\n return (\n \n )\n }\n)\nInput.displayName = \"Input\"\n\nexport { Input }\n"
7 | }
8 | ],
9 | "type": "components:ui"
10 | }
--------------------------------------------------------------------------------
/apps/www/public/registry/styles/new-york/label.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "label",
3 | "dependencies": [
4 | "@radix-ui/react-label"
5 | ],
6 | "files": [
7 | {
8 | "name": "label.tsx",
9 | "content": "\"use client\"\n\nimport * as React from \"react\"\nimport * as LabelPrimitive from \"@radix-ui/react-label\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst labelVariants = cva(\n \"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n)\n\nconst Label = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef &\n VariantProps\n>(({ className, ...props }, ref) => (\n \n))\nLabel.displayName = LabelPrimitive.Root.displayName\n\nexport { Label }\n"
10 | }
11 | ],
12 | "type": "components:ui"
13 | }
--------------------------------------------------------------------------------
/apps/www/public/registry/styles/new-york/progress.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "progress",
3 | "dependencies": [
4 | "@radix-ui/react-progress"
5 | ],
6 | "files": [
7 | {
8 | "name": "progress.tsx",
9 | "content": "\"use client\"\n\nimport * as React from \"react\"\nimport * as ProgressPrimitive from \"@radix-ui/react-progress\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst Progress = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, value, ...props }, ref) => (\n \n \n \n))\nProgress.displayName = ProgressPrimitive.Root.displayName\n\nexport { Progress }\n"
10 | }
11 | ],
12 | "type": "components:ui"
13 | }
--------------------------------------------------------------------------------
/apps/www/public/registry/styles/new-york/separator.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "separator",
3 | "dependencies": [
4 | "@radix-ui/react-separator"
5 | ],
6 | "files": [
7 | {
8 | "name": "separator.tsx",
9 | "content": "\"use client\"\n\nimport * as React from \"react\"\nimport * as SeparatorPrimitive from \"@radix-ui/react-separator\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst Separator = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(\n (\n { className, orientation = \"horizontal\", decorative = true, ...props },\n ref\n ) => (\n \n )\n)\nSeparator.displayName = SeparatorPrimitive.Root.displayName\n\nexport { Separator }\n"
10 | }
11 | ],
12 | "type": "components:ui"
13 | }
--------------------------------------------------------------------------------
/apps/www/public/registry/styles/new-york/skeleton.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "skeleton",
3 | "files": [
4 | {
5 | "name": "skeleton.tsx",
6 | "content": "import { cn } from \"@/lib/utils\"\n\nfunction Skeleton({\n className,\n ...props\n}: React.HTMLAttributes) {\n return (\n \n )\n}\n\nexport { Skeleton }\n"
7 | }
8 | ],
9 | "type": "components:ui"
10 | }
--------------------------------------------------------------------------------
/apps/www/public/registry/styles/new-york/textarea.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "textarea",
3 | "files": [
4 | {
5 | "name": "textarea.tsx",
6 | "content": "import * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport interface TextareaProps\n extends React.TextareaHTMLAttributes {}\n\nconst Textarea = React.forwardRef(\n ({ className, ...props }, ref) => {\n return (\n \n )\n }\n)\nTextarea.displayName = \"Textarea\"\n\nexport { Textarea }\n"
7 | }
8 | ],
9 | "type": "components:ui"
10 | }
--------------------------------------------------------------------------------
/apps/www/public/schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://json-schema.org/draft-07/schema#",
3 | "type": "object",
4 | "properties": {
5 | "style": {
6 | "type": "string",
7 | "enum": ["default", "new-york"]
8 | },
9 | "tailwind": {
10 | "type": "object",
11 | "properties": {
12 | "config": {
13 | "type": "string"
14 | },
15 | "css": {
16 | "type": "string"
17 | },
18 | "baseColor": {
19 | "type": "string"
20 | },
21 | "cssVariables": {
22 | "type": "boolean"
23 | }
24 | },
25 | "required": ["config", "css", "baseColor", "cssVariables"]
26 | },
27 | "rsc": {
28 | "type": "boolean"
29 | },
30 | "tsx": {
31 | "type": "boolean"
32 | },
33 | "aliases": {
34 | "type": "object",
35 | "properties": {
36 | "utils": {
37 | "type": "string"
38 | },
39 | "components": {
40 | "type": "string"
41 | }
42 | },
43 | "required": ["utils", "components"]
44 | }
45 | },
46 | "required": ["style", "tailwind", "rsc", "aliases"]
47 | }
48 |
--------------------------------------------------------------------------------
/apps/www/public/site.webmanifest:
--------------------------------------------------------------------------------
1 | {
2 | "name": "",
3 | "short_name": "",
4 | "icons": [
5 | {
6 | "src": "/android-chrome-192x192.png",
7 | "sizes": "192x192",
8 | "type": "image/png"
9 | },
10 | {
11 | "src": "/android-chrome-512x512.png",
12 | "sizes": "512x512",
13 | "type": "image/png"
14 | }
15 | ],
16 | "theme_color": "#ffffff",
17 | "background_color": "#ffffff",
18 | "display": "standalone"
19 | }
20 |
--------------------------------------------------------------------------------
/apps/www/registry/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json.schemastore.org/eslintrc",
3 | "rules": {
4 | "react/no-unescaped-entities": "off"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/accordion-demo.tsx:
--------------------------------------------------------------------------------
1 | import {
2 | Accordion,
3 | AccordionContent,
4 | AccordionItem,
5 | AccordionTrigger,
6 | } from "@/registry/default/ui/accordion"
7 |
8 | export default function AccordionDemo() {
9 | return (
10 |
11 |
12 | Is it accessible?
13 |
14 | Yes. It adheres to the WAI-ARIA design pattern.
15 |
16 |
17 |
18 | Is it styled?
19 |
20 | Yes. It comes with default styles that matches the other
21 | components' aesthetic.
22 |
23 |
24 |
25 | Is it animated?
26 |
27 | Yes. It's animated by default, but you can disable it if you
28 | prefer.
29 |
30 |
31 |
32 | )
33 | }
34 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/alert-demo.tsx:
--------------------------------------------------------------------------------
1 | import { Terminal, Waves } from "lucide-react"
2 |
3 | import {
4 | Alert,
5 | AlertDescription,
6 | AlertTitle,
7 | } from "@/registry/default/ui/alert"
8 |
9 | export default function AlertDemo() {
10 | return (
11 |
12 |
13 | Heads up!
14 |
15 | You can add components to your app using the cli.
16 |
17 |
18 | )
19 | }
20 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/alert-destructive.tsx:
--------------------------------------------------------------------------------
1 | import { AlertCircle, FileWarning, Terminal } from "lucide-react"
2 |
3 | import {
4 | Alert,
5 | AlertDescription,
6 | AlertTitle,
7 | } from "@/registry/default/ui/alert"
8 |
9 | export default function AlertDestructive() {
10 | return (
11 |
12 |
13 | Error
14 |
15 | Your session has expired. Please log in again.
16 |
17 |
18 | )
19 | }
20 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/aspect-ratio-demo.tsx:
--------------------------------------------------------------------------------
1 | import Image from "next/image"
2 |
3 | import { AspectRatio } from "@/registry/default/ui/aspect-ratio"
4 |
5 | export default function AspectRatioDemo() {
6 | return (
7 |
8 |
14 |
15 | )
16 | }
17 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/avatar-demo.tsx:
--------------------------------------------------------------------------------
1 | import {
2 | Avatar,
3 | AvatarFallback,
4 | AvatarImage,
5 | } from "@/registry/default/ui/avatar"
6 |
7 | export default function AvatarDemo() {
8 | return (
9 |
10 |
11 | CN
12 |
13 | )
14 | }
15 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/badge-demo.tsx:
--------------------------------------------------------------------------------
1 | import { Badge } from "@/registry/default/ui/badge"
2 |
3 | export default function BadgeDemo() {
4 | return Badge
5 | }
6 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/badge-destructive.tsx:
--------------------------------------------------------------------------------
1 | import { Badge } from "@/registry/default/ui/badge"
2 |
3 | export default function BadgeDestructive() {
4 | return Destructive
5 | }
6 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/badge-outline.tsx:
--------------------------------------------------------------------------------
1 | import { Badge } from "@/registry/default/ui/badge"
2 |
3 | export default function BadgeOutline() {
4 | return Outline
5 | }
6 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/badge-secondary.tsx:
--------------------------------------------------------------------------------
1 | import { Badge } from "@/registry/default/ui/badge"
2 |
3 | export default function BadgeSecondary() {
4 | return Secondary
5 | }
6 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/button-as-child.tsx:
--------------------------------------------------------------------------------
1 | import Link from "next/link"
2 |
3 | import { Button } from "@/registry/default/ui/button"
4 |
5 | export default function ButtonAsChild() {
6 | return (
7 |
10 | )
11 | }
12 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/button-demo.tsx:
--------------------------------------------------------------------------------
1 | import { Button } from "@/registry/default/ui/button"
2 |
3 | export default function ButtonDemo() {
4 | return
5 | }
6 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/button-destructive.tsx:
--------------------------------------------------------------------------------
1 | import { Button } from "@/registry/default/ui/button"
2 |
3 | export default function ButtonDestructive() {
4 | return
5 | }
6 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/button-ghost.tsx:
--------------------------------------------------------------------------------
1 | import { Button } from "@/registry/default/ui/button"
2 |
3 | export default function ButtonGhost() {
4 | return
5 | }
6 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/button-icon.tsx:
--------------------------------------------------------------------------------
1 | import { ChevronRight } from "lucide-react"
2 |
3 | import { Button } from "@/registry/default/ui/button"
4 |
5 | export default function ButtonIcon() {
6 | return (
7 |
10 | )
11 | }
12 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/button-link.tsx:
--------------------------------------------------------------------------------
1 | import { Button } from "@/registry/default/ui/button"
2 |
3 | export default function ButtonLink() {
4 | return
5 | }
6 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/button-loading.tsx:
--------------------------------------------------------------------------------
1 | import { Loader2 } from "lucide-react"
2 |
3 | import { Button } from "@/registry/default/ui/button"
4 |
5 | export default function ButtonLoading() {
6 | return (
7 |
11 | )
12 | }
13 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/button-outline.tsx:
--------------------------------------------------------------------------------
1 | import { Button } from "@/registry/default/ui/button"
2 |
3 | export default function ButtonOutline() {
4 | return
5 | }
6 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/button-secondary.tsx:
--------------------------------------------------------------------------------
1 | import { Button } from "@/registry/default/ui/button"
2 |
3 | export default function ButtonSecondary() {
4 | return
5 | }
6 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/button-with-icon.tsx:
--------------------------------------------------------------------------------
1 | import { Mail } from "lucide-react"
2 |
3 | import { Button } from "@/registry/default/ui/button"
4 |
5 | export default function ButtonWithIcon() {
6 | return (
7 |
10 | )
11 | }
12 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/calendar-demo.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import * as React from "react"
4 |
5 | import { Calendar } from "@/registry/default/ui/calendar"
6 |
7 | export default function CalendarDemo() {
8 | const [date, setDate] = React.useState(new Date())
9 |
10 | return (
11 |
17 | )
18 | }
19 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/checkbox-demo.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import { Checkbox } from "@/registry/default/ui/checkbox"
4 |
5 | export default function CheckboxDemo() {
6 | return (
7 |
8 |
9 |
15 |
16 | )
17 | }
18 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/checkbox-disabled.tsx:
--------------------------------------------------------------------------------
1 | import { Checkbox } from "@/registry/default/ui/checkbox"
2 |
3 | export default function CheckboxDisabled() {
4 | return (
5 |
6 |
7 |
13 |
14 | )
15 | }
16 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/checkbox-with-text.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import { Checkbox } from "@/registry/default/ui/checkbox"
4 |
5 | export default function CheckboxWithText() {
6 | return (
7 |
8 |
9 |
10 |
16 |
17 | You agree to our Terms of Service and Privacy Policy.
18 |
19 |
20 |
21 | )
22 | }
23 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/input-demo.tsx:
--------------------------------------------------------------------------------
1 | import { Input } from "@/registry/default/ui/input"
2 |
3 | export default function InputDemo() {
4 | return
5 | }
6 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/input-disabled.tsx:
--------------------------------------------------------------------------------
1 | import { Input } from "@/registry/default/ui/input"
2 |
3 | export default function InputDisabled() {
4 | return
5 | }
6 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/input-file.tsx:
--------------------------------------------------------------------------------
1 | import { Input } from "@/registry/default/ui/input"
2 | import { Label } from "@/registry/default/ui/label"
3 |
4 | export default function InputFile() {
5 | return (
6 |
7 |
8 |
9 |
10 | )
11 | }
12 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/input-with-button.tsx:
--------------------------------------------------------------------------------
1 | import { Button } from "@/registry/default/ui/button"
2 | import { Input } from "@/registry/default/ui/input"
3 |
4 | export default function InputWithButton() {
5 | return (
6 |
7 |
8 |
9 |
10 | )
11 | }
12 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/input-with-label.tsx:
--------------------------------------------------------------------------------
1 | import { Input } from "@/registry/default/ui/input"
2 | import { Label } from "@/registry/default/ui/label"
3 |
4 | export default function InputWithLabel() {
5 | return (
6 |
7 |
8 |
9 |
10 | )
11 | }
12 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/input-with-text.tsx:
--------------------------------------------------------------------------------
1 | import { Input } from "@/registry/default/ui/input"
2 | import { Label } from "@/registry/default/ui/label"
3 |
4 | export default function InputWithText() {
5 | return (
6 |
7 |
8 |
9 |
Enter your email address.
10 |
11 | )
12 | }
13 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/label-demo.tsx:
--------------------------------------------------------------------------------
1 | import { Checkbox } from "@/registry/default/ui/checkbox"
2 | import { Label } from "@/registry/default/ui/label"
3 |
4 | export default function LabelDemo() {
5 | return (
6 |
7 |
8 |
9 |
10 |
11 |
12 | )
13 | }
14 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/progress-demo.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import * as React from "react"
4 |
5 | import { Progress } from "@/registry/default/ui/progress"
6 |
7 | export default function ProgressDemo() {
8 | const [progress, setProgress] = React.useState(13)
9 |
10 | React.useEffect(() => {
11 | const timer = setTimeout(() => setProgress(66), 500)
12 | return () => clearTimeout(timer)
13 | }, [])
14 |
15 | return
16 | }
17 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/radio-group-demo.tsx:
--------------------------------------------------------------------------------
1 | import { Label } from "@/registry/default/ui/label"
2 | import { RadioGroup, RadioGroupItem } from "@/registry/default/ui/radio-group"
3 |
4 | export default function RadioGroupDemo() {
5 | return (
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | )
21 | }
22 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/scroll-area-demo.tsx:
--------------------------------------------------------------------------------
1 | import * as React from "react"
2 |
3 | import { ScrollArea } from "@/registry/default/ui/scroll-area"
4 | import { Separator } from "@/registry/default/ui/separator"
5 |
6 | const tags = Array.from({ length: 50 }).map(
7 | (_, i, a) => `v1.2.0-beta.${a.length - i}`
8 | )
9 |
10 | export default function ScrollAreaDemo() {
11 | return (
12 |
13 |
14 |
Tags
15 | {tags.map((tag) => (
16 |
17 |
18 | {tag}
19 |
20 |
21 |
22 | ))}
23 |
24 |
25 | )
26 | }
27 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/select-demo.tsx:
--------------------------------------------------------------------------------
1 | import * as React from "react"
2 |
3 | import {
4 | Select,
5 | SelectContent,
6 | SelectGroup,
7 | SelectItem,
8 | SelectLabel,
9 | SelectTrigger,
10 | SelectValue,
11 | } from "@/registry/default/ui/select"
12 |
13 | export default function SelectDemo() {
14 | return (
15 |
30 | )
31 | }
32 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/separator-demo.tsx:
--------------------------------------------------------------------------------
1 | import { Separator } from "@/registry/default/ui/separator"
2 |
3 | export default function SeparatorDemo() {
4 | return (
5 |
6 |
7 |
Radix Primitives
8 |
9 | An open-source UI component library.
10 |
11 |
12 |
13 |
14 |
Blog
15 |
16 |
Docs
17 |
18 |
Source
19 |
20 |
21 | )
22 | }
23 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/skeleton-demo.tsx:
--------------------------------------------------------------------------------
1 | import { Skeleton } from "@/registry/default/ui/skeleton"
2 |
3 | export default function SkeletonDemo() {
4 | return (
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | )
13 | }
14 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/slider-demo.tsx:
--------------------------------------------------------------------------------
1 | import { cn } from "@/lib/utils"
2 | import { Slider } from "@/registry/default/ui/slider"
3 |
4 | type SliderProps = React.ComponentProps
5 |
6 | export default function SliderDemo({ className, ...props }: SliderProps) {
7 | return (
8 |
15 | )
16 | }
17 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/switch-demo.tsx:
--------------------------------------------------------------------------------
1 | import { Label } from "@/registry/default/ui/label"
2 | import { Switch } from "@/registry/default/ui/switch"
3 |
4 | export default function SwitchDemo() {
5 | return (
6 |
7 |
8 |
9 |
10 | )
11 | }
12 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/textarea-demo.tsx:
--------------------------------------------------------------------------------
1 | import { Textarea } from "@/registry/default/ui/textarea"
2 |
3 | export default function TextareaDemo() {
4 | return
5 | }
6 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/textarea-disabled.tsx:
--------------------------------------------------------------------------------
1 | import { Textarea } from "@/registry/default/ui/textarea"
2 |
3 | export default function TextareaDisabled() {
4 | return
5 | }
6 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/textarea-with-button.tsx:
--------------------------------------------------------------------------------
1 | import { Button } from "@/registry/default/ui/button"
2 | import { Textarea } from "@/registry/default/ui/textarea"
3 |
4 | export default function TextareaWithButton() {
5 | return (
6 |
7 |
8 |
9 |
10 | )
11 | }
12 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/textarea-with-label.tsx:
--------------------------------------------------------------------------------
1 | import { Label } from "@/registry/default/ui/label"
2 | import { Textarea } from "@/registry/default/ui/textarea"
3 |
4 | export default function TextareaWithLabel() {
5 | return (
6 |
7 |
8 |
9 |
10 | )
11 | }
12 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/textarea-with-text.tsx:
--------------------------------------------------------------------------------
1 | import { Label } from "@/registry/default/ui/label"
2 | import { Textarea } from "@/registry/default/ui/textarea"
3 |
4 | export default function TextareaWithText() {
5 | return (
6 |
7 |
8 |
9 |
10 | Your message will be copied to the support team.
11 |
12 |
13 | )
14 | }
15 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/toast-demo.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import { Button } from "@/registry/default/ui/button"
4 | import { ToastAction } from "@/registry/default/ui/toast"
5 | import { useToast } from "@/registry/default/ui/use-toast"
6 |
7 | export default function ToastDemo() {
8 | const { toast } = useToast()
9 |
10 | return (
11 |
25 | )
26 | }
27 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/toast-destructive.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import { Button } from "@/registry/default/ui/button"
4 | import { ToastAction } from "@/registry/default/ui/toast"
5 | import { useToast } from "@/registry/default/ui/use-toast"
6 |
7 | export default function ToastDestructive() {
8 | const { toast } = useToast()
9 |
10 | return (
11 |
24 | )
25 | }
26 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/toast-simple.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import { Button } from "@/registry/default/ui/button"
4 | import { useToast } from "@/registry/default/ui/use-toast"
5 |
6 | export default function ToastSimple() {
7 | const { toast } = useToast()
8 |
9 | return (
10 |
20 | )
21 | }
22 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/toast-with-action.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import { Button } from "@/registry/default/ui/button"
4 | import { ToastAction } from "@/registry/default/ui/toast"
5 | import { useToast } from "@/registry/default/ui/use-toast"
6 |
7 | export default function ToastWithAction() {
8 | const { toast } = useToast()
9 |
10 | return (
11 |
23 | )
24 | }
25 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/toast-with-title.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import { Button } from "@/registry/default/ui/button"
4 | import { useToast } from "@/registry/default/ui/use-toast"
5 |
6 | export default function ToastWithTitle() {
7 | const { toast } = useToast()
8 |
9 | return (
10 |
21 | )
22 | }
23 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/toggle-demo.tsx:
--------------------------------------------------------------------------------
1 | import { Bold } from "lucide-react"
2 |
3 | import { Toggle } from "@/registry/default/ui/toggle"
4 |
5 | export default function ToggleDemo() {
6 | return (
7 |
8 |
9 |
10 | )
11 | }
12 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/toggle-disabled.tsx:
--------------------------------------------------------------------------------
1 | import { Underline } from "lucide-react"
2 |
3 | import { Toggle } from "@/registry/default/ui/toggle"
4 |
5 | export default function ToggleDisabled() {
6 | return (
7 |
8 |
9 |
10 | )
11 | }
12 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/toggle-lg.tsx:
--------------------------------------------------------------------------------
1 | import { Italic } from "lucide-react"
2 |
3 | import { Toggle } from "@/registry/default/ui/toggle"
4 |
5 | export default function ToggleLg() {
6 | return (
7 |
8 |
9 |
10 | )
11 | }
12 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/toggle-outline.tsx:
--------------------------------------------------------------------------------
1 | import { Italic } from "lucide-react"
2 |
3 | import { Toggle } from "@/registry/default/ui/toggle"
4 |
5 | export default function ToggleOutline() {
6 | return (
7 |
8 |
9 |
10 | )
11 | }
12 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/toggle-sm.tsx:
--------------------------------------------------------------------------------
1 | import { Italic } from "lucide-react"
2 |
3 | import { Toggle } from "@/registry/default/ui/toggle"
4 |
5 | export default function ToggleSm() {
6 | return (
7 |
8 |
9 |
10 | )
11 | }
12 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/toggle-with-text.tsx:
--------------------------------------------------------------------------------
1 | import { Italic } from "lucide-react"
2 |
3 | import { Toggle } from "@/registry/default/ui/toggle"
4 |
5 | export default function ToggleWithText() {
6 | return (
7 |
8 |
9 | Italic
10 |
11 | )
12 | }
13 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/tooltip-demo.tsx:
--------------------------------------------------------------------------------
1 | import { Button } from "@/registry/default/ui/button"
2 | import {
3 | Tooltip,
4 | TooltipContent,
5 | TooltipProvider,
6 | TooltipTrigger,
7 | } from "@/registry/default/ui/tooltip"
8 |
9 | export default function TooltipDemo() {
10 | return (
11 |
12 |
13 |
14 |
15 |
16 |
17 | Add to library
18 |
19 |
20 |
21 | )
22 | }
23 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/typography-blockquote.tsx:
--------------------------------------------------------------------------------
1 | export default function TypographyBlockquote() {
2 | return (
3 |
4 | "After all," he said, "everyone enjoys a good joke, so it's only fair that
5 | they should pay for the privilege."
6 |
7 | )
8 | }
9 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/typography-h1.tsx:
--------------------------------------------------------------------------------
1 | export default function TypographyH1() {
2 | return (
3 |
4 | Taxing Laughter: The Joke Tax Chronicles
5 |
6 | )
7 | }
8 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/typography-h2.tsx:
--------------------------------------------------------------------------------
1 | export default function TypographyH2() {
2 | return (
3 |
4 | The People of the Kingdom
5 |
6 | )
7 | }
8 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/typography-h3.tsx:
--------------------------------------------------------------------------------
1 | export default function TypographyH3() {
2 | return (
3 |
4 | The Joke Tax
5 |
6 | )
7 | }
8 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/typography-h4.tsx:
--------------------------------------------------------------------------------
1 | export default function TypographyH4() {
2 | return (
3 |
4 | People stopped telling jokes
5 |
6 | )
7 | }
8 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/typography-inline-code.tsx:
--------------------------------------------------------------------------------
1 | export default function TypographyInlineCode() {
2 | return (
3 |
4 | @radix-ui/react-alert-dialog
5 |
6 | )
7 | }
8 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/typography-large.tsx:
--------------------------------------------------------------------------------
1 | export default function TypographyLarge() {
2 | return (
3 | Are you sure absolutely sure?
4 | )
5 | }
6 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/typography-lead.tsx:
--------------------------------------------------------------------------------
1 | export default function TypographyLead() {
2 | return (
3 |
4 | A modal dialog that interrupts the user with important content and expects
5 | a response.
6 |
7 | )
8 | }
9 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/typography-list.tsx:
--------------------------------------------------------------------------------
1 | export default function TypographyList() {
2 | return (
3 |
4 | - 1st level of puns: 5 gold coins
5 | - 2nd level of jokes: 10 gold coins
6 | - 3rd level of one-liners : 20 gold coins
7 |
8 | )
9 | }
10 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/typography-muted.tsx:
--------------------------------------------------------------------------------
1 | export default function TypographyMuted() {
2 | return (
3 | Enter your email address.
4 | )
5 | }
6 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/typography-p.tsx:
--------------------------------------------------------------------------------
1 | export default function TypographyP() {
2 | return (
3 |
4 | The king, seeing how much happier his subjects were, realized the error of
5 | his ways and repealed the joke tax.
6 |
7 | )
8 | }
9 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/typography-small.tsx:
--------------------------------------------------------------------------------
1 | export default function TypographySmall() {
2 | return (
3 | Email address
4 | )
5 | }
6 |
--------------------------------------------------------------------------------
/apps/www/registry/default/ui/aspect-ratio.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio"
4 |
5 | const AspectRatio = AspectRatioPrimitive.Root
6 |
7 | export { AspectRatio }
8 |
--------------------------------------------------------------------------------
/apps/www/registry/default/ui/checkbox.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import * as React from "react"
4 | import * as CheckboxPrimitive from "@radix-ui/react-checkbox"
5 | import { Check } from "lucide-react"
6 |
7 | import { cn } from "@/lib/utils"
8 |
9 | const Checkbox = React.forwardRef<
10 | React.ElementRef,
11 | React.ComponentPropsWithoutRef
12 | >(({ className, ...props }, ref) => (
13 |
21 |
24 |
25 |
26 |
27 | ))
28 | Checkbox.displayName = CheckboxPrimitive.Root.displayName
29 |
30 | export { Checkbox }
31 |
--------------------------------------------------------------------------------
/apps/www/registry/default/ui/collapsible.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import * as CollapsiblePrimitive from "@radix-ui/react-collapsible"
4 |
5 | const Collapsible = CollapsiblePrimitive.Root
6 |
7 | const CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger
8 |
9 | const CollapsibleContent = CollapsiblePrimitive.CollapsibleContent
10 |
11 | export { Collapsible, CollapsibleTrigger, CollapsibleContent }
12 |
--------------------------------------------------------------------------------
/apps/www/registry/default/ui/input.tsx:
--------------------------------------------------------------------------------
1 | import * as React from "react"
2 |
3 | import { cn } from "@/lib/utils"
4 |
5 | export interface InputProps
6 | extends React.InputHTMLAttributes {}
7 |
8 | const Input = React.forwardRef(
9 | ({ className, type, ...props }, ref) => {
10 | return (
11 |
20 | )
21 | }
22 | )
23 | Input.displayName = "Input"
24 |
25 | export { Input }
26 |
--------------------------------------------------------------------------------
/apps/www/registry/default/ui/label.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import * as React from "react"
4 | import * as LabelPrimitive from "@radix-ui/react-label"
5 | import { cva, type VariantProps } from "class-variance-authority"
6 |
7 | import { cn } from "@/lib/utils"
8 |
9 | const labelVariants = cva(
10 | "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
11 | )
12 |
13 | const Label = React.forwardRef<
14 | React.ElementRef,
15 | React.ComponentPropsWithoutRef &
16 | VariantProps
17 | >(({ className, ...props }, ref) => (
18 |
23 | ))
24 | Label.displayName = LabelPrimitive.Root.displayName
25 |
26 | export { Label }
27 |
--------------------------------------------------------------------------------
/apps/www/registry/default/ui/progress.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import * as React from "react"
4 | import * as ProgressPrimitive from "@radix-ui/react-progress"
5 |
6 | import { cn } from "@/lib/utils"
7 |
8 | const Progress = React.forwardRef<
9 | React.ElementRef,
10 | React.ComponentPropsWithoutRef
11 | >(({ className, value, ...props }, ref) => (
12 |
20 |
24 |
25 | ))
26 | Progress.displayName = ProgressPrimitive.Root.displayName
27 |
28 | export { Progress }
29 |
--------------------------------------------------------------------------------
/apps/www/registry/default/ui/separator.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import * as React from "react"
4 | import * as SeparatorPrimitive from "@radix-ui/react-separator"
5 |
6 | import { cn } from "@/lib/utils"
7 |
8 | const Separator = React.forwardRef<
9 | React.ElementRef,
10 | React.ComponentPropsWithoutRef
11 | >(
12 | (
13 | { className, orientation = "horizontal", decorative = true, ...props },
14 | ref
15 | ) => (
16 |
27 | )
28 | )
29 | Separator.displayName = SeparatorPrimitive.Root.displayName
30 |
31 | export { Separator }
32 |
--------------------------------------------------------------------------------
/apps/www/registry/default/ui/skeleton.tsx:
--------------------------------------------------------------------------------
1 | import { cn } from "@/lib/utils"
2 |
3 | function Skeleton({
4 | className,
5 | ...props
6 | }: React.HTMLAttributes) {
7 | return (
8 |
12 | )
13 | }
14 |
15 | export { Skeleton }
16 |
--------------------------------------------------------------------------------
/apps/www/registry/default/ui/slider.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import * as React from "react"
4 | import * as SliderPrimitive from "@radix-ui/react-slider"
5 |
6 | import { cn } from "@/lib/utils"
7 |
8 | const Slider = React.forwardRef<
9 | React.ElementRef,
10 | React.ComponentPropsWithoutRef
11 | >(({ className, ...props }, ref) => (
12 |
20 |
21 |
22 |
23 |
24 |
25 | ))
26 | Slider.displayName = SliderPrimitive.Root.displayName
27 |
28 | export { Slider }
29 |
--------------------------------------------------------------------------------
/apps/www/registry/default/ui/textarea.tsx:
--------------------------------------------------------------------------------
1 | import * as React from "react"
2 |
3 | import { cn } from "@/lib/utils"
4 |
5 | export interface TextareaProps
6 | extends React.TextareaHTMLAttributes {}
7 |
8 | const Textarea = React.forwardRef(
9 | ({ className, ...props }, ref) => {
10 | return (
11 |
19 | )
20 | }
21 | )
22 | Textarea.displayName = "Textarea"
23 |
24 | export { Textarea }
25 |
--------------------------------------------------------------------------------
/apps/www/registry/default/ui/toaster.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import {
4 | Toast,
5 | ToastClose,
6 | ToastDescription,
7 | ToastProvider,
8 | ToastTitle,
9 | ToastViewport,
10 | } from "@/registry/default/ui/toast"
11 | import { useToast } from "@/registry/default/ui/use-toast"
12 |
13 | export function Toaster() {
14 | const { toasts } = useToast()
15 |
16 | return (
17 |
18 | {toasts.map(function ({ id, title, description, action, ...props }) {
19 | return (
20 |
21 |
22 | {title && {title}}
23 | {description && (
24 | {description}
25 | )}
26 |
27 | {action}
28 |
29 |
30 | )
31 | })}
32 |
33 |
34 | )
35 | }
36 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/accordion-demo.tsx:
--------------------------------------------------------------------------------
1 | import {
2 | Accordion,
3 | AccordionContent,
4 | AccordionItem,
5 | AccordionTrigger,
6 | } from "@/registry/new-york/ui/accordion"
7 |
8 | export default function AccordionDemo() {
9 | return (
10 |
11 |
12 | Is it accessible?
13 |
14 | Yes. It adheres to the WAI-ARIA design pattern.
15 |
16 |
17 |
18 | Is it styled?
19 |
20 | Yes. It comes with default styles that matches the other
21 | components' aesthetic.
22 |
23 |
24 |
25 | Is it animated?
26 |
27 | Yes. It's animated by default, but you can disable it if you prefer.
28 |
29 |
30 |
31 | )
32 | }
33 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/alert-demo.tsx:
--------------------------------------------------------------------------------
1 | import { RocketIcon } from "@radix-ui/react-icons"
2 |
3 | import {
4 | Alert,
5 | AlertDescription,
6 | AlertTitle,
7 | } from "@/registry/new-york/ui/alert"
8 |
9 | export default function AlertDemo() {
10 | return (
11 |
12 |
13 | Heads up!
14 |
15 | You can add components to your app using the cli.
16 |
17 |
18 | )
19 | }
20 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/alert-destructive.tsx:
--------------------------------------------------------------------------------
1 | import { ExclamationTriangleIcon } from "@radix-ui/react-icons"
2 |
3 | import {
4 | Alert,
5 | AlertDescription,
6 | AlertTitle,
7 | } from "@/registry/new-york/ui/alert"
8 |
9 | export default function AlertDestructive() {
10 | return (
11 |
12 |
13 | Error
14 |
15 | Your session has expired. Please log in again.
16 |
17 |
18 | )
19 | }
20 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/aspect-ratio-demo.tsx:
--------------------------------------------------------------------------------
1 | import Image from "next/image"
2 |
3 | import { AspectRatio } from "@/registry/new-york/ui/aspect-ratio"
4 |
5 | export default function AspectRatioDemo() {
6 | return (
7 |
8 |
14 |
15 | )
16 | }
17 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/avatar-demo.tsx:
--------------------------------------------------------------------------------
1 | import {
2 | Avatar,
3 | AvatarFallback,
4 | AvatarImage,
5 | } from "@/registry/new-york/ui/avatar"
6 |
7 | export default function AvatarDemo() {
8 | return (
9 |
10 |
11 | CN
12 |
13 | )
14 | }
15 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/badge-demo.tsx:
--------------------------------------------------------------------------------
1 | import { Badge } from "@/registry/new-york/ui/badge"
2 |
3 | export default function BadgeDemo() {
4 | return Badge
5 | }
6 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/badge-destructive.tsx:
--------------------------------------------------------------------------------
1 | import { Badge } from "@/registry/new-york/ui/badge"
2 |
3 | export default function BadgeDestructive() {
4 | return Destructive
5 | }
6 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/badge-outline.tsx:
--------------------------------------------------------------------------------
1 | import { Badge } from "@/registry/new-york/ui/badge"
2 |
3 | export default function BadgeOutline() {
4 | return Outline
5 | }
6 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/badge-secondary.tsx:
--------------------------------------------------------------------------------
1 | import { Badge } from "@/registry/new-york/ui/badge"
2 |
3 | export default function BadgeSecondary() {
4 | return Secondary
5 | }
6 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/button-as-child.tsx:
--------------------------------------------------------------------------------
1 | import Link from "next/link"
2 |
3 | import { Button } from "@/registry/new-york/ui/button"
4 |
5 | export default function ButtonAsChild() {
6 | return (
7 |
10 | )
11 | }
12 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/button-demo.tsx:
--------------------------------------------------------------------------------
1 | import { Button } from "@/registry/new-york/ui/button"
2 |
3 | export default function ButtonDemo() {
4 | return
5 | }
6 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/button-destructive.tsx:
--------------------------------------------------------------------------------
1 | import { Button } from "@/registry/new-york/ui/button"
2 |
3 | export default function ButtonDestructive() {
4 | return
5 | }
6 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/button-ghost.tsx:
--------------------------------------------------------------------------------
1 | import { Button } from "@/registry/new-york/ui/button"
2 |
3 | export default function ButtonGhost() {
4 | return
5 | }
6 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/button-icon.tsx:
--------------------------------------------------------------------------------
1 | import { ChevronRightIcon } from "@radix-ui/react-icons"
2 |
3 | import { Button } from "@/registry/new-york/ui/button"
4 |
5 | export default function ButtonIcon() {
6 | return (
7 |
10 | )
11 | }
12 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/button-link.tsx:
--------------------------------------------------------------------------------
1 | import { Button } from "@/registry/new-york/ui/button"
2 |
3 | export default function ButtonLink() {
4 | return
5 | }
6 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/button-loading.tsx:
--------------------------------------------------------------------------------
1 | import { ReloadIcon } from "@radix-ui/react-icons"
2 |
3 | import { Button } from "@/registry/new-york/ui/button"
4 |
5 | export default function ButtonLoading() {
6 | return (
7 |
11 | )
12 | }
13 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/button-outline.tsx:
--------------------------------------------------------------------------------
1 | import { Button } from "@/registry/new-york/ui/button"
2 |
3 | export default function ButtonOutline() {
4 | return
5 | }
6 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/button-secondary.tsx:
--------------------------------------------------------------------------------
1 | import { Button } from "@/registry/new-york/ui/button"
2 |
3 | export default function ButtonSecondary() {
4 | return
5 | }
6 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/button-with-icon.tsx:
--------------------------------------------------------------------------------
1 | import { EnvelopeOpenIcon } from "@radix-ui/react-icons"
2 |
3 | import { Button } from "@/registry/new-york/ui/button"
4 |
5 | export default function ButtonWithIcon() {
6 | return (
7 |
10 | )
11 | }
12 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/calendar-demo.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import * as React from "react"
4 |
5 | import { Calendar } from "@/registry/new-york/ui/calendar"
6 |
7 | export default function CalendarDemo() {
8 | const [date, setDate] = React.useState(new Date())
9 |
10 | return (
11 |
17 | )
18 | }
19 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/checkbox-demo.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import { Checkbox } from "@/registry/new-york/ui/checkbox"
4 |
5 | export default function CheckboxDemo() {
6 | return (
7 |
8 |
9 |
15 |
16 | )
17 | }
18 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/checkbox-disabled.tsx:
--------------------------------------------------------------------------------
1 | import { Checkbox } from "@/registry/new-york/ui/checkbox"
2 |
3 | export default function CheckboxDisabled() {
4 | return (
5 |
6 |
7 |
13 |
14 | )
15 | }
16 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/checkbox-with-text.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import { Checkbox } from "@/registry/new-york/ui/checkbox"
4 |
5 | export default function CheckboxWithText() {
6 | return (
7 |
8 |
9 |
10 |
16 |
17 | You agree to our Terms of Service and Privacy Policy.
18 |
19 |
20 |
21 | )
22 | }
23 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/input-demo.tsx:
--------------------------------------------------------------------------------
1 | import { Input } from "@/registry/new-york/ui/input"
2 |
3 | export default function InputDemo() {
4 | return
5 | }
6 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/input-disabled.tsx:
--------------------------------------------------------------------------------
1 | import { Input } from "@/registry/new-york/ui/input"
2 |
3 | export default function InputDisabled() {
4 | return
5 | }
6 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/input-file.tsx:
--------------------------------------------------------------------------------
1 | import { Input } from "@/registry/new-york/ui/input"
2 | import { Label } from "@/registry/new-york/ui/label"
3 |
4 | export default function InputFile() {
5 | return (
6 |
7 |
8 |
9 |
10 | )
11 | }
12 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/input-with-button.tsx:
--------------------------------------------------------------------------------
1 | import { Button } from "@/registry/new-york/ui/button"
2 | import { Input } from "@/registry/new-york/ui/input"
3 |
4 | export default function InputWithButton() {
5 | return (
6 |
7 |
8 |
9 |
10 | )
11 | }
12 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/input-with-label.tsx:
--------------------------------------------------------------------------------
1 | import { Input } from "@/registry/new-york/ui/input"
2 | import { Label } from "@/registry/new-york/ui/label"
3 |
4 | export default function InputWithLabel() {
5 | return (
6 |
7 |
8 |
9 |
10 | )
11 | }
12 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/input-with-text.tsx:
--------------------------------------------------------------------------------
1 | import { Input } from "@/registry/new-york/ui/input"
2 | import { Label } from "@/registry/new-york/ui/label"
3 |
4 | export default function InputWithText() {
5 | return (
6 |
7 |
8 |
9 |
Enter your email address.
10 |
11 | )
12 | }
13 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/label-demo.tsx:
--------------------------------------------------------------------------------
1 | import { Checkbox } from "@/registry/new-york/ui/checkbox"
2 | import { Label } from "@/registry/new-york/ui/label"
3 |
4 | export default function LabelDemo() {
5 | return (
6 |
7 |
8 |
9 |
10 |
11 |
12 | )
13 | }
14 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/progress-demo.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import * as React from "react"
4 |
5 | import { Progress } from "@/registry/new-york/ui/progress"
6 |
7 | export default function ProgressDemo() {
8 | const [progress, setProgress] = React.useState(13)
9 |
10 | React.useEffect(() => {
11 | const timer = setTimeout(() => setProgress(66), 500)
12 | return () => clearTimeout(timer)
13 | }, [])
14 |
15 | return
16 | }
17 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/radio-group-demo.tsx:
--------------------------------------------------------------------------------
1 | import { Label } from "@/registry/new-york/ui/label"
2 | import { RadioGroup, RadioGroupItem } from "@/registry/new-york/ui/radio-group"
3 |
4 | export default function RadioGroupDemo() {
5 | return (
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | )
21 | }
22 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/scroll-area-demo.tsx:
--------------------------------------------------------------------------------
1 | import * as React from "react"
2 |
3 | import { ScrollArea } from "@/registry/new-york/ui/scroll-area"
4 | import { Separator } from "@/registry/new-york/ui/separator"
5 |
6 | const tags = Array.from({ length: 50 }).map(
7 | (_, i, a) => `v1.2.0-beta.${a.length - i}`
8 | )
9 |
10 | export default function ScrollAreaDemo() {
11 | return (
12 |
13 |
14 |
Tags
15 | {tags.map((tag) => (
16 | <>
17 |
{tag}
18 |
19 | >
20 | ))}
21 |
22 |
23 | )
24 | }
25 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/select-demo.tsx:
--------------------------------------------------------------------------------
1 | import * as React from "react"
2 |
3 | import {
4 | Select,
5 | SelectContent,
6 | SelectGroup,
7 | SelectItem,
8 | SelectLabel,
9 | SelectTrigger,
10 | SelectValue,
11 | } from "@/registry/new-york/ui/select"
12 |
13 | export default function SelectDemo() {
14 | return (
15 |
30 | )
31 | }
32 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/separator-demo.tsx:
--------------------------------------------------------------------------------
1 | import { Separator } from "@/registry/new-york/ui/separator"
2 |
3 | export default function SeparatorDemo() {
4 | return (
5 |
6 |
7 |
Radix Primitives
8 |
9 | An open-source UI component library.
10 |
11 |
12 |
13 |
14 |
Blog
15 |
16 |
Docs
17 |
18 |
Source
19 |
20 |
21 | )
22 | }
23 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/skeleton-demo.tsx:
--------------------------------------------------------------------------------
1 | import { Skeleton } from "@/registry/new-york/ui/skeleton"
2 |
3 | export default function SkeletonDemo() {
4 | return (
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | )
13 | }
14 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/slider-demo.tsx:
--------------------------------------------------------------------------------
1 | import { cn } from "@/lib/utils"
2 | import { Slider } from "@/registry/new-york/ui/slider"
3 |
4 | type SliderProps = React.ComponentProps
5 |
6 | export default function SliderDemo({ className, ...props }: SliderProps) {
7 | return (
8 |
15 | )
16 | }
17 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/switch-demo.tsx:
--------------------------------------------------------------------------------
1 | import { Label } from "@/registry/new-york/ui/label"
2 | import { Switch } from "@/registry/new-york/ui/switch"
3 |
4 | export default function SwitchDemo() {
5 | return (
6 |
7 |
8 |
9 |
10 | )
11 | }
12 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/textarea-demo.tsx:
--------------------------------------------------------------------------------
1 | import { Textarea } from "@/registry/new-york/ui/textarea"
2 |
3 | export default function TextareaDemo() {
4 | return
5 | }
6 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/textarea-disabled.tsx:
--------------------------------------------------------------------------------
1 | import { Textarea } from "@/registry/new-york/ui/textarea"
2 |
3 | export default function TextareaDisabled() {
4 | return
5 | }
6 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/textarea-with-button.tsx:
--------------------------------------------------------------------------------
1 | import { Button } from "@/registry/new-york/ui/button"
2 | import { Textarea } from "@/registry/new-york/ui/textarea"
3 |
4 | export default function TextareaWithButton() {
5 | return (
6 |
7 |
8 |
9 |
10 | )
11 | }
12 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/textarea-with-label.tsx:
--------------------------------------------------------------------------------
1 | import { Label } from "@/registry/new-york/ui/label"
2 | import { Textarea } from "@/registry/new-york/ui/textarea"
3 |
4 | export default function TextareaWithLabel() {
5 | return (
6 |
7 |
8 |
9 |
10 | )
11 | }
12 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/textarea-with-text.tsx:
--------------------------------------------------------------------------------
1 | import { Label } from "@/registry/new-york/ui/label"
2 | import { Textarea } from "@/registry/new-york/ui/textarea"
3 |
4 | export default function TextareaWithText() {
5 | return (
6 |
7 |
8 |
9 |
10 | Your message will be copied to the support team.
11 |
12 |
13 | )
14 | }
15 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/toast-demo.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import { Button } from "@/registry/new-york/ui/button"
4 | import { ToastAction } from "@/registry/new-york/ui/toast"
5 | import { useToast } from "@/registry/new-york/ui/use-toast"
6 |
7 | export default function ToastDemo() {
8 | const { toast } = useToast()
9 |
10 | return (
11 |
25 | )
26 | }
27 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/toast-destructive.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import { Button } from "@/registry/new-york/ui/button"
4 | import { ToastAction } from "@/registry/new-york/ui/toast"
5 | import { useToast } from "@/registry/new-york/ui/use-toast"
6 |
7 | export default function ToastDestructive() {
8 | const { toast } = useToast()
9 |
10 | return (
11 |
24 | )
25 | }
26 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/toast-simple.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import { Button } from "@/registry/new-york/ui/button"
4 | import { useToast } from "@/registry/new-york/ui/use-toast"
5 |
6 | export default function ToastSimple() {
7 | const { toast } = useToast()
8 |
9 | return (
10 |
20 | )
21 | }
22 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/toast-with-action.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import { Button } from "@/registry/new-york/ui/button"
4 | import { ToastAction } from "@/registry/new-york/ui/toast"
5 | import { useToast } from "@/registry/new-york/ui/use-toast"
6 |
7 | export default function ToastWithAction() {
8 | const { toast } = useToast()
9 |
10 | return (
11 |
23 | )
24 | }
25 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/toast-with-title.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import { Button } from "@/registry/new-york/ui/button"
4 | import { useToast } from "@/registry/new-york/ui/use-toast"
5 |
6 | export default function ToastWithTitle() {
7 | const { toast } = useToast()
8 |
9 | return (
10 |
21 | )
22 | }
23 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/toggle-demo.tsx:
--------------------------------------------------------------------------------
1 | import { FontBoldIcon } from "@radix-ui/react-icons"
2 |
3 | import { Toggle } from "@/registry/new-york/ui/toggle"
4 |
5 | export default function ToggleDemo() {
6 | return (
7 |
8 |
9 |
10 | )
11 | }
12 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/toggle-disabled.tsx:
--------------------------------------------------------------------------------
1 | import { UnderlineIcon } from "@radix-ui/react-icons"
2 |
3 | import { Toggle } from "@/registry/new-york/ui/toggle"
4 |
5 | export default function ToggleDisabled() {
6 | return (
7 |
8 |
9 |
10 | )
11 | }
12 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/toggle-lg.tsx:
--------------------------------------------------------------------------------
1 | import { FontItalicIcon } from "@radix-ui/react-icons"
2 |
3 | import { Toggle } from "@/registry/new-york/ui/toggle"
4 |
5 | export default function ToggleLg() {
6 | return (
7 |
8 |
9 |
10 | )
11 | }
12 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/toggle-outline.tsx:
--------------------------------------------------------------------------------
1 | import { FontItalicIcon } from "@radix-ui/react-icons"
2 |
3 | import { Toggle } from "@/registry/new-york/ui/toggle"
4 |
5 | export default function ToggleOutline() {
6 | return (
7 |
8 |
9 |
10 | )
11 | }
12 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/toggle-sm.tsx:
--------------------------------------------------------------------------------
1 | import { FontItalicIcon } from "@radix-ui/react-icons"
2 |
3 | import { Toggle } from "@/registry/new-york/ui/toggle"
4 |
5 | export default function ToggleSm() {
6 | return (
7 |
8 |
9 |
10 | )
11 | }
12 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/toggle-with-text.tsx:
--------------------------------------------------------------------------------
1 | import { FontItalicIcon } from "@radix-ui/react-icons"
2 |
3 | import { Toggle } from "@/registry/new-york/ui/toggle"
4 |
5 | export default function ToggleWithText() {
6 | return (
7 |
8 |
9 | Italic
10 |
11 | )
12 | }
13 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/tooltip-demo.tsx:
--------------------------------------------------------------------------------
1 | import { Button } from "@/registry/new-york/ui/button"
2 | import {
3 | Tooltip,
4 | TooltipContent,
5 | TooltipProvider,
6 | TooltipTrigger,
7 | } from "@/registry/new-york/ui/tooltip"
8 |
9 | export default function TooltipDemo() {
10 | return (
11 |
12 |
13 |
14 |
15 |
16 |
17 | Add to library
18 |
19 |
20 |
21 | )
22 | }
23 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/typography-blockquote.tsx:
--------------------------------------------------------------------------------
1 | export default function TypographyBlockquote() {
2 | return (
3 |
4 | "After all," he said, "everyone enjoys a good joke, so it's only fair that
5 | they should pay for the privilege."
6 |
7 | )
8 | }
9 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/typography-h1.tsx:
--------------------------------------------------------------------------------
1 | export default function TypographyH1() {
2 | return (
3 |
4 | Taxing Laughter: The Joke Tax Chronicles
5 |
6 | )
7 | }
8 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/typography-h2.tsx:
--------------------------------------------------------------------------------
1 | export default function TypographyH2() {
2 | return (
3 |
4 | The People of the Kingdom
5 |
6 | )
7 | }
8 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/typography-h3.tsx:
--------------------------------------------------------------------------------
1 | export default function TypographyH3() {
2 | return (
3 |
4 | The Joke Tax
5 |
6 | )
7 | }
8 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/typography-h4.tsx:
--------------------------------------------------------------------------------
1 | export default function TypographyH4() {
2 | return (
3 |
4 | People stopped telling jokes
5 |
6 | )
7 | }
8 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/typography-inline-code.tsx:
--------------------------------------------------------------------------------
1 | export default function TypographyInlineCode() {
2 | return (
3 |
4 | @radix-ui/react-alert-dialog
5 |
6 | )
7 | }
8 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/typography-large.tsx:
--------------------------------------------------------------------------------
1 | export default function TypographyLarge() {
2 | return (
3 | Are you sure absolutely sure?
4 | )
5 | }
6 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/typography-lead.tsx:
--------------------------------------------------------------------------------
1 | export default function TypographyLead() {
2 | return (
3 |
4 | A modal dialog that interrupts the user with important content and expects
5 | a response.
6 |
7 | )
8 | }
9 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/typography-list.tsx:
--------------------------------------------------------------------------------
1 | export default function TypographyList() {
2 | return (
3 |
4 | - 1st level of puns: 5 gold coins
5 | - 2nd level of jokes: 10 gold coins
6 | - 3rd level of one-liners : 20 gold coins
7 |
8 | )
9 | }
10 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/typography-muted.tsx:
--------------------------------------------------------------------------------
1 | export default function TypographyMuted() {
2 | return (
3 | Enter your email address.
4 | )
5 | }
6 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/typography-p.tsx:
--------------------------------------------------------------------------------
1 | export default function TypographyP() {
2 | return (
3 |
4 | The king, seeing how much happier his subjects were, realized the error of
5 | his ways and repealed the joke tax.
6 |
7 | )
8 | }
9 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/example/typography-small.tsx:
--------------------------------------------------------------------------------
1 | export default function TypographySmall() {
2 | return (
3 | Email address
4 | )
5 | }
6 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/ui/aspect-ratio.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio"
4 |
5 | const AspectRatio = AspectRatioPrimitive.Root
6 |
7 | export { AspectRatio }
8 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/ui/checkbox.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import * as React from "react"
4 | import * as CheckboxPrimitive from "@radix-ui/react-checkbox"
5 | import { CheckIcon } from "@radix-ui/react-icons"
6 |
7 | import { cn } from "@/lib/utils"
8 |
9 | const Checkbox = React.forwardRef<
10 | React.ElementRef,
11 | React.ComponentPropsWithoutRef
12 | >(({ className, ...props }, ref) => (
13 |
21 |
24 |
25 |
26 |
27 | ))
28 | Checkbox.displayName = CheckboxPrimitive.Root.displayName
29 |
30 | export { Checkbox }
31 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/ui/collapsible.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import * as CollapsiblePrimitive from "@radix-ui/react-collapsible"
4 |
5 | const Collapsible = CollapsiblePrimitive.Root
6 |
7 | const CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger
8 |
9 | const CollapsibleContent = CollapsiblePrimitive.CollapsibleContent
10 |
11 | export { Collapsible, CollapsibleTrigger, CollapsibleContent }
12 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/ui/input.tsx:
--------------------------------------------------------------------------------
1 | import * as React from "react"
2 |
3 | import { cn } from "@/lib/utils"
4 |
5 | export interface InputProps
6 | extends React.InputHTMLAttributes {}
7 |
8 | const Input = React.forwardRef(
9 | ({ className, type, ...props }, ref) => {
10 | return (
11 |
20 | )
21 | }
22 | )
23 | Input.displayName = "Input"
24 |
25 | export { Input }
26 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/ui/label.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import * as React from "react"
4 | import * as LabelPrimitive from "@radix-ui/react-label"
5 | import { cva, type VariantProps } from "class-variance-authority"
6 |
7 | import { cn } from "@/lib/utils"
8 |
9 | const labelVariants = cva(
10 | "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
11 | )
12 |
13 | const Label = React.forwardRef<
14 | React.ElementRef,
15 | React.ComponentPropsWithoutRef &
16 | VariantProps
17 | >(({ className, ...props }, ref) => (
18 |
23 | ))
24 | Label.displayName = LabelPrimitive.Root.displayName
25 |
26 | export { Label }
27 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/ui/progress.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import * as React from "react"
4 | import * as ProgressPrimitive from "@radix-ui/react-progress"
5 |
6 | import { cn } from "@/lib/utils"
7 |
8 | const Progress = React.forwardRef<
9 | React.ElementRef,
10 | React.ComponentPropsWithoutRef
11 | >(({ className, value, ...props }, ref) => (
12 |
20 |
24 |
25 | ))
26 | Progress.displayName = ProgressPrimitive.Root.displayName
27 |
28 | export { Progress }
29 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/ui/separator.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import * as React from "react"
4 | import * as SeparatorPrimitive from "@radix-ui/react-separator"
5 |
6 | import { cn } from "@/lib/utils"
7 |
8 | const Separator = React.forwardRef<
9 | React.ElementRef,
10 | React.ComponentPropsWithoutRef
11 | >(
12 | (
13 | { className, orientation = "horizontal", decorative = true, ...props },
14 | ref
15 | ) => (
16 |
27 | )
28 | )
29 | Separator.displayName = SeparatorPrimitive.Root.displayName
30 |
31 | export { Separator }
32 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/ui/skeleton.tsx:
--------------------------------------------------------------------------------
1 | import { cn } from "@/lib/utils"
2 |
3 | function Skeleton({
4 | className,
5 | ...props
6 | }: React.HTMLAttributes) {
7 | return (
8 |
12 | )
13 | }
14 |
15 | export { Skeleton }
16 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/ui/slider.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import * as React from "react"
4 | import * as SliderPrimitive from "@radix-ui/react-slider"
5 |
6 | import { cn } from "@/lib/utils"
7 |
8 | const Slider = React.forwardRef<
9 | React.ElementRef,
10 | React.ComponentPropsWithoutRef
11 | >(({ className, ...props }, ref) => (
12 |
20 |
21 |
22 |
23 |
24 |
25 | ))
26 | Slider.displayName = SliderPrimitive.Root.displayName
27 |
28 | export { Slider }
29 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/ui/textarea.tsx:
--------------------------------------------------------------------------------
1 | import * as React from "react"
2 |
3 | import { cn } from "@/lib/utils"
4 |
5 | export interface TextareaProps
6 | extends React.TextareaHTMLAttributes {}
7 |
8 | const Textarea = React.forwardRef(
9 | ({ className, ...props }, ref) => {
10 | return (
11 |
19 | )
20 | }
21 | )
22 | Textarea.displayName = "Textarea"
23 |
24 | export { Textarea }
25 |
--------------------------------------------------------------------------------
/apps/www/registry/new-york/ui/toaster.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import {
4 | Toast,
5 | ToastClose,
6 | ToastDescription,
7 | ToastProvider,
8 | ToastTitle,
9 | ToastViewport,
10 | } from "@/registry/new-york/ui/toast"
11 | import { useToast } from "@/registry/new-york/ui/use-toast"
12 |
13 | export function Toaster() {
14 | const { toasts } = useToast()
15 |
16 | return (
17 |
18 | {toasts.map(function ({ id, title, description, action, ...props }) {
19 | return (
20 |
21 |
22 | {title && {title}}
23 | {description && (
24 | {description}
25 | )}
26 |
27 | {action}
28 |
29 |
30 | )
31 | })}
32 |
33 |
34 | )
35 | }
36 |
--------------------------------------------------------------------------------
/apps/www/registry/schema.ts:
--------------------------------------------------------------------------------
1 | import * as z from "zod"
2 |
3 | export const registrySchema = z.array(
4 | z.object({
5 | name: z.string(),
6 | dependencies: z.array(z.string()).optional(),
7 | registryDependencies: z.array(z.string()).optional(),
8 | files: z.array(z.string()),
9 | type: z.enum([
10 | "components:ui",
11 | "components:component",
12 | "components:example",
13 | ]),
14 | })
15 | )
16 |
17 | export type Registry = z.infer
18 |
--------------------------------------------------------------------------------
/apps/www/registry/styles.ts:
--------------------------------------------------------------------------------
1 | export const styles = [
2 | {
3 | name: "default",
4 | label: "Default",
5 | },
6 | {
7 | name: "new-york",
8 | label: "New York",
9 | },
10 | ] as const
11 |
12 | export type Style = (typeof styles)[number]
13 |
--------------------------------------------------------------------------------
/apps/www/tailwind.config.cjs:
--------------------------------------------------------------------------------
1 | const baseConfig = require("../../tailwind.config.cjs")
2 |
3 | /** @type {import('tailwindcss').Config} */
4 | module.exports = {
5 | ...baseConfig,
6 | content: [
7 | ...baseConfig.content,
8 | "content/**/*.mdx",
9 | "registry/**/*.{ts,tsx}",
10 | ],
11 | }
12 |
--------------------------------------------------------------------------------
/apps/www/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json.schemastore.org/tsconfig",
3 | "extends": "../../tsconfig.json",
4 | "compilerOptions": {
5 | "target": "es5",
6 | "lib": ["dom", "dom.iterable", "esnext"],
7 | "allowJs": true,
8 | "skipLibCheck": true,
9 | "strict": true,
10 | "forceConsistentCasingInFileNames": true,
11 | "noEmit": true,
12 | "incremental": true,
13 | "esModuleInterop": true,
14 | "module": "esnext",
15 | "resolveJsonModule": true,
16 | "isolatedModules": true,
17 | "jsx": "preserve",
18 | "baseUrl": ".",
19 | "paths": {
20 | "@/*": ["./*"],
21 | "contentlayer/generated": ["./.contentlayer/generated"]
22 | },
23 | "plugins": [
24 | {
25 | "name": "next"
26 | }
27 | ]
28 | },
29 | "include": [
30 | "next-env.d.ts",
31 | "**/*.ts",
32 | "**/*.tsx",
33 | ".next/types/**/*.ts",
34 | ".contentlayer/generated"
35 | ],
36 | "exclude": ["node_modules", "./scripts/build-registry.ts"]
37 | }
38 |
--------------------------------------------------------------------------------
/apps/www/tsconfig.scripts.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json.schemastore.org/tsconfig",
3 | "extends": "./tsconfig.json",
4 | "compilerOptions": {
5 | "target": "es6",
6 | "module": "commonjs",
7 | "esModuleInterop": true,
8 | "isolatedModules": false
9 | },
10 | "include": [".contentlayer/generated", "scripts/**/*.ts"],
11 | "exclude": ["node_modules"]
12 | }
13 |
--------------------------------------------------------------------------------
/apps/www/types/nav.ts:
--------------------------------------------------------------------------------
1 | import { Icons } from "@/components/icons"
2 |
3 | export interface NavItem {
4 | title: string
5 | href?: string
6 | disabled?: boolean
7 | external?: boolean
8 | icon?: keyof typeof Icons
9 | label?: string
10 | }
11 |
12 | export interface NavItemWithChildren extends NavItem {
13 | items: NavItemWithChildren[]
14 | }
15 |
16 | export interface MainNavItem extends NavItem {}
17 |
18 | export interface SidebarNavItem extends NavItemWithChildren {}
19 |
--------------------------------------------------------------------------------
/apps/www/types/unist.ts:
--------------------------------------------------------------------------------
1 | import { Node } from "unist-builder"
2 |
3 | export interface UnistNode extends Node {
4 | type: string
5 | name?: string
6 | tagName?: string
7 | value?: string
8 | properties?: {
9 | __rawString__?: string
10 | __className__?: string
11 | __event__?: string
12 | [key: string]: unknown
13 | } & NpmCommands
14 | attributes?: {
15 | name: string
16 | value: unknown
17 | type?: string
18 | }[]
19 | children?: UnistNode[]
20 | }
21 |
22 | export interface UnistTree extends Node {
23 | children: UnistNode[]
24 | }
25 |
26 | export interface NpmCommands {
27 | __npmCommand__?: string
28 | __yarnCommand__?: string
29 | __pnpmCommand__?: string
30 | }
31 |
--------------------------------------------------------------------------------
/fix_user.sh:
--------------------------------------------------------------------------------
1 | git filter-branch --env-filter '
2 | NEW_NAME="midas-1119"
3 | NEW_EMAIL="lucas.chalie1119@gmail.com"
4 |
5 | if [ "$GIT_COMMITTER_EMAIL" != "$NEW_EMAIL" ]
6 | then
7 | export GIT_COMMITTER_NAME="$NEW_NAME"
8 | export GIT_COMMITTER_EMAIL="$NEW_EMAIL"
9 | fi
10 | if [ "$GIT_AUTHOR_EMAIL" != "$NEW_EMAIL" ]
11 | then
12 | export GIT_AUTHOR_NAME="$NEW_NAME"
13 | export GIT_AUTHOR_EMAIL="$NEW_EMAIL"
14 | fi
15 | ' --tag-name-filter cat -- --branches --tags
--------------------------------------------------------------------------------
/packages/cli/.gitignore:
--------------------------------------------------------------------------------
1 | components
2 | dist
3 | .turbo
--------------------------------------------------------------------------------
/packages/cli/.prettierignore:
--------------------------------------------------------------------------------
1 | test
--------------------------------------------------------------------------------
/packages/cli/README.md:
--------------------------------------------------------------------------------
1 | # shadcn-ui
2 |
3 | A CLI for adding components to your project.
4 |
5 | ## Usage
6 |
7 | Use the `init` command to initialize dependencies for a new project.
8 |
9 | The `init` command installs dependencies, adds the `cn` util, configures `tailwind.config.js`, and CSS variables for the project.
10 |
11 | ```bash
12 | npx shadcn-ui init
13 | ```
14 |
15 | ## add
16 |
17 | Use the `add` command to add components to your project.
18 |
19 | The `add` command adds a component to your project and installs all required dependencies.
20 |
21 | ```bash
22 | npx shadcn-ui add [component]
23 | ```
24 |
25 | ### Example
26 |
27 | ```bash
28 | npx shadcn-ui add alert-dialog
29 | ```
30 |
31 | You can also run the command without any arguments to view a list of all available components:
32 |
33 | ```bash
34 | npx shadcn-ui add
35 | ```
36 |
37 | ## Documentation
38 |
39 | Visit http://ui.shadcn.com/docs to view the documentation.
40 |
41 | ## License
42 |
43 | Licensed under the [MIT license](https://github.com/shadcn/ui/blob/main/LICENSE.md).
44 |
--------------------------------------------------------------------------------
/packages/cli/src/index.ts:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 | import { add } from "@/src/commands/add"
3 | import { diff } from "@/src/commands/diff"
4 | import { init } from "@/src/commands/init"
5 | import { Command } from "commander"
6 |
7 | import { getPackageInfo } from "./utils/get-package-info"
8 |
9 | process.on("SIGINT", () => process.exit(0))
10 | process.on("SIGTERM", () => process.exit(0))
11 |
12 | async function main() {
13 | const packageInfo = await getPackageInfo()
14 |
15 | const program = new Command()
16 | .name("shadcn-ui")
17 | .description("add components and dependencies to your project")
18 | .version(
19 | packageInfo.version || "1.0.0",
20 | "-v, --version",
21 | "display the version number"
22 | )
23 |
24 | program.addCommand(init).addCommand(add).addCommand(diff)
25 |
26 | program.parse()
27 | }
28 |
29 | main()
30 |
--------------------------------------------------------------------------------
/packages/cli/src/utils/get-package-info.ts:
--------------------------------------------------------------------------------
1 | import path from "path"
2 | import fs from "fs-extra"
3 | import { type PackageJson } from "type-fest"
4 |
5 | export function getPackageInfo() {
6 | const packageJsonPath = path.join("package.json")
7 |
8 | return fs.readJSONSync(packageJsonPath) as PackageJson
9 | }
10 |
--------------------------------------------------------------------------------
/packages/cli/src/utils/get-package-manager.ts:
--------------------------------------------------------------------------------
1 | import { detect } from "@antfu/ni"
2 |
3 | export async function getPackageManager(
4 | targetDir: string
5 | ): Promise<"yarn" | "pnpm" | "bun" | "npm"> {
6 | const packageManager = await detect({ programmatic: true, cwd: targetDir })
7 |
8 | if (packageManager === "yarn@berry") return "yarn"
9 | if (packageManager === "pnpm@6") return "pnpm"
10 | if (packageManager === "bun") return "bun"
11 |
12 | return packageManager ?? "npm"
13 | }
14 |
--------------------------------------------------------------------------------
/packages/cli/src/utils/get-project-info.ts:
--------------------------------------------------------------------------------
1 | import { existsSync } from "fs"
2 | import path from "path"
3 | import fs from "fs-extra"
4 |
5 | export async function getProjectInfo() {
6 | const info = {
7 | tsconfig: null,
8 | srcDir: false,
9 | appDir: false,
10 | srcComponentsUiDir: false,
11 | componentsUiDir: false,
12 | }
13 |
14 | try {
15 | const tsconfig = await getTsConfig()
16 |
17 | return {
18 | tsconfig,
19 | srcDir: existsSync(path.resolve("./src")),
20 | appDir:
21 | existsSync(path.resolve("./app")) ||
22 | existsSync(path.resolve("./src/app")),
23 | srcComponentsUiDir: existsSync(path.resolve("./src/components/ui")),
24 | componentsUiDir: existsSync(path.resolve("./components/ui")),
25 | }
26 | } catch (error) {
27 | return info
28 | }
29 | }
30 |
31 | export async function getTsConfig() {
32 | try {
33 | const tsconfigPath = path.join("tsconfig.json")
34 | const tsconfig = await fs.readJSON(tsconfigPath)
35 |
36 | if (!tsconfig) {
37 | throw new Error("tsconfig.json is missing")
38 | }
39 |
40 | return tsconfig
41 | } catch (error) {
42 | return null
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/packages/cli/src/utils/handle-error.ts:
--------------------------------------------------------------------------------
1 | import { logger } from "@/src/utils/logger"
2 |
3 | export function handleError(error: unknown) {
4 | if (typeof error === "string") {
5 | logger.error(error)
6 | process.exit(1)
7 | }
8 |
9 | if (error instanceof Error) {
10 | logger.error(error.message)
11 | process.exit(1)
12 | }
13 |
14 | logger.error("Something went wrong. Please try again.")
15 | process.exit(1)
16 | }
17 |
--------------------------------------------------------------------------------
/packages/cli/src/utils/logger.ts:
--------------------------------------------------------------------------------
1 | import chalk from "chalk"
2 |
3 | export const logger = {
4 | error(...args: unknown[]) {
5 | console.log(chalk.red(...args))
6 | },
7 | warn(...args: unknown[]) {
8 | console.log(chalk.yellow(...args))
9 | },
10 | info(...args: unknown[]) {
11 | console.log(chalk.cyan(...args))
12 | },
13 | success(...args: unknown[]) {
14 | console.log(chalk.green(...args))
15 | },
16 | break() {
17 | console.log("")
18 | },
19 | }
20 |
--------------------------------------------------------------------------------
/packages/cli/src/utils/resolve-import.ts:
--------------------------------------------------------------------------------
1 | import { createMatchPath, type ConfigLoaderSuccessResult } from "tsconfig-paths"
2 |
3 | export async function resolveImport(
4 | importPath: string,
5 | config: Pick
6 | ) {
7 | return createMatchPath(config.absoluteBaseUrl, config.paths)(
8 | importPath,
9 | undefined,
10 | () => true,
11 | [".ts", ".tsx"]
12 | )
13 | }
14 |
--------------------------------------------------------------------------------
/packages/cli/src/utils/transformers/transform-import.ts:
--------------------------------------------------------------------------------
1 | import { Transformer } from "@/src/utils/transformers"
2 |
3 | export const transformImport: Transformer = async ({ sourceFile, config }) => {
4 | const importDeclarations = sourceFile.getImportDeclarations()
5 |
6 | for (const importDeclaration of importDeclarations) {
7 | const moduleSpecifier = importDeclaration.getModuleSpecifierValue()
8 |
9 | // Replace @/registry/[style] with the components alias.
10 | if (moduleSpecifier.startsWith("@/registry/")) {
11 | importDeclaration.setModuleSpecifier(
12 | moduleSpecifier.replace(
13 | /^@\/registry\/[^/]+/,
14 | config.aliases.components
15 | )
16 | )
17 | }
18 |
19 | // Replace `import { cn } from "@/lib/utils"`
20 | if (moduleSpecifier == "@/lib/utils") {
21 | const namedImports = importDeclaration.getNamedImports()
22 | const cnImport = namedImports.find((i) => i.getName() === "cn")
23 | if (cnImport) {
24 | importDeclaration.setModuleSpecifier(
25 | moduleSpecifier.replace(/^@\/lib\/utils/, config.aliases.utils)
26 | )
27 | }
28 | }
29 | }
30 |
31 | return sourceFile
32 | }
33 |
--------------------------------------------------------------------------------
/packages/cli/src/utils/transformers/transform-rsc.ts:
--------------------------------------------------------------------------------
1 | import { Transformer } from "@/src/utils/transformers"
2 | import { SyntaxKind } from "ts-morph"
3 |
4 | export const transformRsc: Transformer = async ({ sourceFile, config }) => {
5 | if (config.rsc) {
6 | return sourceFile
7 | }
8 |
9 | // Remove "use client" from the top of the file.
10 | const first = sourceFile.getFirstChildByKind(SyntaxKind.ExpressionStatement)
11 | if (first?.getText() === `"use client"`) {
12 | first.remove()
13 | }
14 |
15 | return sourceFile
16 | }
17 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/config-full/components.json:
--------------------------------------------------------------------------------
1 | {
2 | "style": "new-york",
3 | "tailwind": {
4 | "config": "tailwind.config.ts",
5 | "css": "src/app/globals.css",
6 | "baseColor": "zinc",
7 | "cssVariables": true
8 | },
9 | "rsc": false,
10 | "aliases": {
11 | "utils": "~/lib/utils",
12 | "components": "~/components"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/config-full/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "test-cli-config-full",
3 | "version": "1.0.0",
4 | "main": "index.js",
5 | "author": "shadcn",
6 | "license": "MIT"
7 | }
8 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/config-full/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es2017",
4 | "lib": ["dom", "dom.iterable", "esnext"],
5 | "allowJs": true,
6 | "checkJs": true,
7 | "skipLibCheck": true,
8 | "strict": true,
9 | "forceConsistentCasingInFileNames": true,
10 | "noEmit": true,
11 | "esModuleInterop": true,
12 | "module": "esnext",
13 | "moduleResolution": "node",
14 | "resolveJsonModule": true,
15 | "isolatedModules": true,
16 | "jsx": "preserve",
17 | "incremental": true,
18 | "noUncheckedIndexedAccess": true,
19 | "baseUrl": ".",
20 | "paths": {
21 | "~/*": ["./src/*"]
22 | }
23 | },
24 | "include": [
25 | ".eslintrc.cjs",
26 | "next-env.d.ts",
27 | "**/*.ts",
28 | "**/*.tsx",
29 | "**/*.cjs",
30 | "**/*.mjs"
31 | ],
32 | "exclude": ["node_modules"]
33 | }
34 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/config-invalid/components.json:
--------------------------------------------------------------------------------
1 | {
2 | "cn": "./components",
3 | "ui": "./ui",
4 | "does-not-exist": "./does-not-exist"
5 | }
6 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/config-invalid/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "test-cli-config-invalid",
3 | "version": "1.0.0",
4 | "main": "index.js",
5 | "author": "shadcn",
6 | "license": "MIT"
7 | }
8 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/config-jsx/components.json:
--------------------------------------------------------------------------------
1 | {
2 | "style": "default",
3 | "tsx": false,
4 | "tailwind": {
5 | "config": "./tailwind.config.js",
6 | "css": "./src/assets/css/tailwind.css",
7 | "baseColor": "neutral",
8 | "cssVariables": false
9 | },
10 | "aliases": {
11 | "utils": "@/lib/utils",
12 | "components": "@/components"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/config-jsx/jsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "paths": {
4 | "@/*": ["./*"]
5 | }
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/config-jsx/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "test-cli-config-partial",
3 | "version": "1.0.0",
4 | "main": "index.js",
5 | "author": "shadcn",
6 | "license": "MIT"
7 | }
8 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/config-none/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "test-cli-config-none",
3 | "version": "1.0.0",
4 | "main": "index.js",
5 | "author": "shadcn",
6 | "license": "MIT"
7 | }
8 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/config-partial/components.json:
--------------------------------------------------------------------------------
1 | {
2 | "style": "default",
3 | "tailwind": {
4 | "config": "./tailwind.config.ts",
5 | "css": "./src/assets/css/tailwind.css",
6 | "baseColor": "neutral",
7 | "cssVariables": false
8 | },
9 | "aliases": {
10 | "utils": "@/lib/utils",
11 | "components": "@/components"
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/config-partial/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "test-cli-config-partial",
3 | "version": "1.0.0",
4 | "main": "index.js",
5 | "author": "shadcn",
6 | "license": "MIT"
7 | }
8 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/config-partial/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json.schemastore.org/tsconfig",
3 | "compilerOptions": {
4 | "baseUrl": ".",
5 | "paths": {
6 | "@/*": ["./*"]
7 | }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next-src/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # next.js
12 | /.next/
13 | /out/
14 |
15 | # production
16 | /build
17 |
18 | # misc
19 | .DS_Store
20 | *.pem
21 |
22 | # debug
23 | npm-debug.log*
24 | yarn-debug.log*
25 | yarn-error.log*
26 |
27 | # local env files
28 | .env*.local
29 |
30 | # vercel
31 | .vercel
32 |
33 | # typescript
34 | *.tsbuildinfo
35 | next-env.d.ts
36 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next-src/next.config.js:
--------------------------------------------------------------------------------
1 | /** @type {import('next').NextConfig} */
2 | const nextConfig = {}
3 |
4 | module.exports = nextConfig
5 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next-src/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "text-cli-next-src",
3 | "version": "0.1.0",
4 | "private": true,
5 | "scripts": {
6 | "dev": "next dev",
7 | "build": "next build",
8 | "start": "next start",
9 | "lint": "next lint"
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next-src/src/app/globals.css:
--------------------------------------------------------------------------------
1 | @tailwind base;
2 | @tailwind components;
3 | @tailwind utilities;
4 |
5 | :root {
6 | --foreground-rgb: 0, 0, 0;
7 | --background-start-rgb: 214, 219, 220;
8 | --background-end-rgb: 255, 255, 255;
9 | }
10 |
11 | @media (prefers-color-scheme: dark) {
12 | :root {
13 | --foreground-rgb: 255, 255, 255;
14 | --background-start-rgb: 0, 0, 0;
15 | --background-end-rgb: 0, 0, 0;
16 | }
17 | }
18 |
19 | body {
20 | color: rgb(var(--foreground-rgb));
21 | background: linear-gradient(
22 | to bottom,
23 | transparent,
24 | rgb(var(--background-end-rgb))
25 | )
26 | rgb(var(--background-start-rgb));
27 | }
28 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next-src/tailwind.config.js:
--------------------------------------------------------------------------------
1 | /** @type {import('tailwindcss').Config} */
2 | module.exports = {
3 | content: [
4 | './src/pages/**/*.{js,ts,jsx,tsx,mdx}',
5 | './src/components/**/*.{js,ts,jsx,tsx,mdx}',
6 | './src/app/**/*.{js,ts,jsx,tsx,mdx}',
7 | ],
8 | theme: {
9 | extend: {
10 | backgroundImage: {
11 | 'gradient-radial': 'radial-gradient(var(--tw-gradient-stops))',
12 | 'gradient-conic':
13 | 'conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))',
14 | },
15 | },
16 | },
17 | plugins: [],
18 | }
19 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next-src/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es5",
4 | "lib": ["dom", "dom.iterable", "esnext"],
5 | "allowJs": true,
6 | "skipLibCheck": true,
7 | "strict": true,
8 | "forceConsistentCasingInFileNames": true,
9 | "noEmit": true,
10 | "esModuleInterop": true,
11 | "module": "esnext",
12 | "moduleResolution": "node",
13 | "resolveJsonModule": true,
14 | "isolatedModules": true,
15 | "jsx": "preserve",
16 | "incremental": true,
17 | "plugins": [
18 | {
19 | "name": "next"
20 | }
21 | ],
22 | "paths": {
23 | "@/*": ["./src/*"]
24 | }
25 | },
26 | "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
27 | "exclude": ["node_modules"]
28 | }
29 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # next.js
12 | /.next/
13 | /out/
14 |
15 | # production
16 | /build
17 |
18 | # misc
19 | .DS_Store
20 | *.pem
21 |
22 | # debug
23 | npm-debug.log*
24 | yarn-debug.log*
25 | yarn-error.log*
26 |
27 | # local env files
28 | .env*.local
29 |
30 | # vercel
31 | .vercel
32 |
33 | # typescript
34 | *.tsbuildinfo
35 | next-env.d.ts
36 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next/app/globals.css:
--------------------------------------------------------------------------------
1 | @tailwind base;
2 | @tailwind components;
3 | @tailwind utilities;
4 |
5 | :root {
6 | --foreground-rgb: 0, 0, 0;
7 | --background-start-rgb: 214, 219, 220;
8 | --background-end-rgb: 255, 255, 255;
9 | }
10 |
11 | @media (prefers-color-scheme: dark) {
12 | :root {
13 | --foreground-rgb: 255, 255, 255;
14 | --background-start-rgb: 0, 0, 0;
15 | --background-end-rgb: 0, 0, 0;
16 | }
17 | }
18 |
19 | body {
20 | color: rgb(var(--foreground-rgb));
21 | background: linear-gradient(
22 | to bottom,
23 | transparent,
24 | rgb(var(--background-end-rgb))
25 | )
26 | rgb(var(--background-start-rgb));
27 | }
28 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next/next.config.js:
--------------------------------------------------------------------------------
1 | /** @type {import('next').NextConfig} */
2 | const nextConfig = {}
3 |
4 | module.exports = nextConfig
5 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "test-cli-next",
3 | "version": "0.1.0",
4 | "private": true,
5 | "scripts": {
6 | "dev": "next dev",
7 | "build": "next build",
8 | "start": "next start",
9 | "lint": "next lint"
10 | },
11 | "dependencies": {
12 | "@types/node": "20.2.5",
13 | "@types/react": "18.2.7",
14 | "@types/react-dom": "18.2.4",
15 | "autoprefixer": "10.4.14",
16 | "eslint": "8.41.0",
17 | "eslint-config-next": "13.4.4",
18 | "next": "13.4.4",
19 | "postcss": "8.4.23",
20 | "react": "18.2.0",
21 | "react-dom": "18.2.0",
22 | "tailwindcss": "3.3.2",
23 | "typescript": "5.0.4"
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next/pnpm-lock.yaml:
--------------------------------------------------------------------------------
1 | lockfileVersion: "6.0"
2 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es5",
4 | "lib": ["dom", "dom.iterable", "esnext"],
5 | "allowJs": true,
6 | "skipLibCheck": true,
7 | "strict": true,
8 | "forceConsistentCasingInFileNames": true,
9 | "noEmit": true,
10 | "esModuleInterop": true,
11 | "module": "esnext",
12 | "moduleResolution": "node",
13 | "resolveJsonModule": true,
14 | "isolatedModules": true,
15 | "jsx": "preserve",
16 | "incremental": true,
17 | "plugins": [
18 | {
19 | "name": "next"
20 | }
21 | ],
22 | "paths": {
23 | "@/*": ["./*"]
24 | }
25 | },
26 | "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
27 | "exclude": ["node_modules"]
28 | }
29 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/project-bun/bun.lockb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coincatcher22/ui/cefee5dc6f84b3c5d50b48027c52d578ea300734/packages/cli/test/fixtures/project-bun/bun.lockb
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/project-bun/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "test-cli-project-bun",
3 | "version": "1.0.0",
4 | "main": "index.js",
5 | "author": "shadcn",
6 | "license": "MIT"
7 | }
8 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/project-npm/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "test-cli-npm-project",
3 | "version": "1.0.0",
4 | "lockfileVersion": 2,
5 | "requires": true,
6 | "packages": {
7 | "": {
8 | "name": "npm-project",
9 | "version": "1.0.0",
10 | "license": "MIT"
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/project-npm/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "test-cli-project-npm",
3 | "version": "1.0.0",
4 | "main": "index.js",
5 | "author": "shadcn",
6 | "license": "MIT"
7 | }
8 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/project-pnpm/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "test-cli-project-pnpm",
3 | "version": "1.0.0",
4 | "main": "index.js",
5 | "author": "shadcn",
6 | "license": "MIT"
7 | }
8 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/project-pnpm/pnpm-lock.yaml:
--------------------------------------------------------------------------------
1 | lockfileVersion: '6.0'
2 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/project-src/components.json:
--------------------------------------------------------------------------------
1 | {
2 | "components": "src/components",
3 | "ui": "src/ui",
4 | "styles": "src/styles/main.css",
5 | "utils": "src/lib/cn.ts",
6 | "tailwindConfig": "tailwind.config.ts"
7 | }
8 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/project-src/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "test-cli-project-src",
3 | "version": "1.0.0",
4 | "lockfileVersion": 2,
5 | "requires": true,
6 | "packages": {
7 | "": {
8 | "name": "npm-project",
9 | "version": "1.0.0",
10 | "license": "MIT"
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/project-src/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "project-src",
3 | "version": "0.1.0",
4 | "private": true
5 | }
6 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/project-yarn/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "test-cli-project-yarn",
3 | "version": "1.0.0",
4 | "main": "index.js",
5 | "author": "shadcn",
6 | "license": "MIT"
7 | }
8 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/project-yarn/yarn.lock:
--------------------------------------------------------------------------------
1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2 | # yarn lockfile v1
3 |
4 |
5 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/project/components.json:
--------------------------------------------------------------------------------
1 | {
2 | "tailwindConfig": "./tailwind.config.ts",
3 | "importPaths": {
4 | "styles": "~/styles/globals.css",
5 | "utils:cn": "~/lib/cn.ts",
6 | "components:ui": "~/components/ui"
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/project/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "test-cli-project",
3 | "version": "0.1.0",
4 | "private": true
5 | }
6 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/project/pnpm-lock.yaml:
--------------------------------------------------------------------------------
1 | lockfileVersion: "6.0"
2 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/t3-app/.eslintrc.cjs:
--------------------------------------------------------------------------------
1 | // eslint-disable-next-line @typescript-eslint/no-var-requires
2 | const path = require("path");
3 |
4 | /** @type {import("eslint").Linter.Config} */
5 | const config = {
6 | overrides: [
7 | {
8 | extends: [
9 | "plugin:@typescript-eslint/recommended-requiring-type-checking",
10 | ],
11 | files: ["*.ts", "*.tsx"],
12 | parserOptions: {
13 | project: path.join(__dirname, "tsconfig.json"),
14 | },
15 | },
16 | ],
17 | parser: "@typescript-eslint/parser",
18 | parserOptions: {
19 | project: path.join(__dirname, "tsconfig.json"),
20 | },
21 | plugins: ["@typescript-eslint"],
22 | extends: ["next/core-web-vitals", "plugin:@typescript-eslint/recommended"],
23 | rules: {
24 | "@typescript-eslint/consistent-type-imports": [
25 | "warn",
26 | {
27 | prefer: "type-imports",
28 | fixStyle: "inline-type-imports",
29 | },
30 | ],
31 | "@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }],
32 | },
33 | };
34 |
35 | module.exports = config;
36 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/t3-app/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # database
12 | /prisma/db.sqlite
13 | /prisma/db.sqlite-journal
14 |
15 | # next.js
16 | /.next/
17 | /out/
18 | next-env.d.ts
19 |
20 | # production
21 | /build
22 |
23 | # misc
24 | .DS_Store
25 | *.pem
26 |
27 | # debug
28 | npm-debug.log*
29 | yarn-debug.log*
30 | yarn-error.log*
31 | .pnpm-debug.log*
32 |
33 | # local env files
34 | # do not commit any .env files to git, except for the .env.example file. https://create.t3.gg/en/usage/env-variables#using-environment-variables
35 | .env
36 | .env*.local
37 |
38 | # vercel
39 | .vercel
40 |
41 | # typescript
42 | *.tsbuildinfo
43 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/t3-app/next.config.mjs:
--------------------------------------------------------------------------------
1 | /**
2 | * Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially useful
3 | * for Docker builds.
4 | */
5 | await import("./src/env.mjs");
6 |
7 | /** @type {import("next").NextConfig} */
8 | const config = {
9 | reactStrictMode: true,
10 |
11 | /**
12 | * If you have `experimental: { appDir: true }` set, then you must comment the below `i18n` config
13 | * out.
14 | *
15 | * @see https://github.com/vercel/next.js/issues/41980
16 | */
17 | i18n: {
18 | locales: ["en"],
19 | defaultLocale: "en",
20 | },
21 | };
22 | export default config;
23 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/t3-app/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "test-cli-t3-app",
3 | "version": "0.1.0",
4 | "private": true,
5 | "scripts": {
6 | "build": "next build",
7 | "dev": "next dev",
8 | "lint": "next lint",
9 | "start": "next start"
10 | },
11 | "dependencies": {
12 | "@t3-oss/env-nextjs": "^0.3.1",
13 | "next": "^13.4.2",
14 | "react": "18.2.0",
15 | "react-dom": "18.2.0",
16 | "zod": "^3.21.4"
17 | },
18 | "devDependencies": {
19 | "@types/eslint": "^8.37.0",
20 | "@types/node": "^18.16.0",
21 | "@types/prettier": "^2.7.2",
22 | "@types/react": "^18.2.6",
23 | "@types/react-dom": "^18.2.4",
24 | "@typescript-eslint/eslint-plugin": "^5.59.6",
25 | "@typescript-eslint/parser": "^5.59.6",
26 | "autoprefixer": "^10.4.14",
27 | "eslint": "^8.40.0",
28 | "eslint-config-next": "^13.4.2",
29 | "postcss": "^8.4.21",
30 | "prettier": "^2.8.8",
31 | "prettier-plugin-tailwindcss": "^0.2.8",
32 | "tailwindcss": "^3.3.0",
33 | "typescript": "^5.0.4"
34 | },
35 | "ct3aMetadata": {
36 | "initVersion": "7.13.1"
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/t3-app/src/pages/_app.tsx:
--------------------------------------------------------------------------------
1 | import { type AppType } from "next/dist/shared/lib/utils";
2 | import "~/styles/globals.css";
3 |
4 | const MyApp: AppType = ({ Component, pageProps }) => {
5 | return ;
6 | };
7 |
8 | export default MyApp;
9 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/t3-app/src/styles/globals.css:
--------------------------------------------------------------------------------
1 | @tailwind base;
2 | @tailwind components;
3 | @tailwind utilities;
4 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/t3-app/tailwind.config.ts:
--------------------------------------------------------------------------------
1 | import { type Config } from "tailwindcss";
2 |
3 | export default {
4 | content: ["./src/**/*.{js,ts,jsx,tsx}"],
5 | theme: {
6 | extend: {},
7 | },
8 | plugins: [],
9 | } satisfies Config;
10 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/t3-app/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es2017",
4 | "lib": ["dom", "dom.iterable", "esnext"],
5 | "allowJs": true,
6 | "checkJs": true,
7 | "skipLibCheck": true,
8 | "strict": true,
9 | "forceConsistentCasingInFileNames": true,
10 | "noEmit": true,
11 | "esModuleInterop": true,
12 | "module": "esnext",
13 | "moduleResolution": "node",
14 | "resolveJsonModule": true,
15 | "isolatedModules": true,
16 | "jsx": "preserve",
17 | "incremental": true,
18 | "noUncheckedIndexedAccess": true,
19 | "baseUrl": ".",
20 | "paths": {
21 | "~/*": ["./src/*"]
22 | }
23 | },
24 | "include": [
25 | ".eslintrc.cjs",
26 | "next-env.d.ts",
27 | "**/*.ts",
28 | "**/*.tsx",
29 | "**/*.cjs",
30 | "**/*.mjs"
31 | ],
32 | "exclude": ["node_modules"]
33 | }
34 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/with-base-url/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json.schemastore.org/tsconfig",
3 | "compilerOptions": {
4 | "baseUrl": ".",
5 | "paths": {
6 | "@/*": ["./*"]
7 | }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/without-base-url/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json.schemastore.org/tsconfig",
3 | "compilerOptions": {
4 | "paths": {
5 | "~/components/*": ["./components/*"],
6 | "~/lib/*": ["./lib/*"]
7 | }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/packages/cli/test/utils/__snapshots__/transform-css-vars.test.ts.snap:
--------------------------------------------------------------------------------
1 | // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2 |
3 | exports[`transform css vars 1`] = `
4 | "import * as React from \\"react\\"
5 | export function Foo() {
6 | return foo
7 | }\\"
8 | "
9 | `;
10 |
11 | exports[`transform css vars 2`] = `
12 | "import * as React from \\"react\\"
13 | export function Foo() {
14 | return foo
15 | }\\"\\"
16 | "
17 | `;
18 |
19 | exports[`transform css vars 3`] = `
20 | "import * as React from \\"react\\"
21 | export function Foo() {
22 | return foo
23 | }\\"\\"
24 | "
25 | `;
26 |
--------------------------------------------------------------------------------
/packages/cli/test/utils/__snapshots__/transform-rsc.test.ts.snap:
--------------------------------------------------------------------------------
1 | // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2 |
3 | exports[`transform rsc 1`] = `
4 | "import * as React from \\"react\\"
5 | import { Foo } from \\"bar\\"
6 | "
7 | `;
8 |
9 | exports[`transform rsc 2`] = `
10 | "\\"use client\\"
11 |
12 | import * as React from \\"react\\"
13 | import { Foo } from \\"bar\\"
14 | "
15 | `;
16 |
17 | exports[`transform rsc 3`] = `
18 | " import * as React from \\"react\\"
19 | import { Foo } from \\"bar\\"
20 | "
21 | `;
22 |
23 | exports[`transform rsc 4`] = `
24 | "\\"use foo\\"
25 |
26 | import * as React from \\"react\\"
27 | import { Foo } from \\"bar\\"
28 |
29 | \\"use client\\"
30 | "
31 | `;
32 |
--------------------------------------------------------------------------------
/packages/cli/test/utils/get-package-manager.test.ts:
--------------------------------------------------------------------------------
1 | import path from "path"
2 | import { expect, test } from "vitest"
3 |
4 | import { getPackageManager } from "../../src/utils/get-package-manager"
5 |
6 | test("get package manager", async () => {
7 | expect(
8 | await getPackageManager(path.resolve(__dirname, "../fixtures/project-yarn"))
9 | ).toBe("yarn")
10 |
11 | expect(
12 | await getPackageManager(path.resolve(__dirname, "../fixtures/project-npm"))
13 | ).toBe("npm")
14 |
15 | expect(
16 | await getPackageManager(path.resolve(__dirname, "../fixtures/project-pnpm"))
17 | ).toBe("pnpm")
18 |
19 | expect(
20 | await getPackageManager(path.resolve(__dirname, "../fixtures/project-bun"))
21 | ).toBe("bun")
22 |
23 | expect(
24 | await getPackageManager(path.resolve(__dirname, "../fixtures/next"))
25 | ).toBe("pnpm")
26 | })
27 |
--------------------------------------------------------------------------------
/packages/cli/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json.schemastore.org/tsconfig",
3 | "extends": "../../tsconfig.json",
4 | "compilerOptions": {
5 | "isolatedModules": false,
6 | "baseUrl": ".",
7 | "paths": {
8 | "@/*": ["./*"]
9 | }
10 | },
11 | "include": ["src/**/*.ts"],
12 | "exclude": ["node_modules"]
13 | }
14 |
--------------------------------------------------------------------------------
/packages/cli/tsup.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from "tsup"
2 |
3 | export default defineConfig({
4 | clean: true,
5 | dts: true,
6 | entry: ["src/index.ts"],
7 | format: ["esm"],
8 | sourcemap: true,
9 | target: "esnext",
10 | outDir: "dist",
11 | })
12 |
--------------------------------------------------------------------------------
/pnpm-workspace.yaml:
--------------------------------------------------------------------------------
1 | packages:
2 | - "apps/*"
3 | - "packages/*"
4 | - "templates/*"
5 | - "!**/test/**"
6 |
--------------------------------------------------------------------------------
/postcss.config.cjs:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | plugins: {
3 | tailwindcss: {},
4 | autoprefixer: {},
5 | },
6 | }
7 |
--------------------------------------------------------------------------------
/prettier.config.cjs:
--------------------------------------------------------------------------------
1 | /** @type {import('prettier').Config} */
2 | module.exports = {
3 | endOfLine: "lf",
4 | semi: false,
5 | singleQuote: false,
6 | tabWidth: 2,
7 | trailingComma: "es5",
8 | importOrder: [
9 | "^(react/(.*)$)|^(react$)",
10 | "^(next/(.*)$)|^(next$)",
11 | "",
12 | "",
13 | "^types$",
14 | "^@/types/(.*)$",
15 | "^@/config/(.*)$",
16 | "^@/lib/(.*)$",
17 | "^@/hooks/(.*)$",
18 | "^@/components/ui/(.*)$",
19 | "^@/components/(.*)$",
20 | "^@/registry/(.*)$",
21 | "^@/styles/(.*)$",
22 | "^@/app/(.*)$",
23 | "",
24 | "^[./]",
25 | ],
26 | importOrderSeparation: false,
27 | importOrderSortSpecifiers: true,
28 | importOrderBuiltinModulesToTop: true,
29 | importOrderParserPlugins: ["typescript", "jsx", "decorators-legacy"],
30 | importOrderMergeDuplicateImports: true,
31 | importOrderCombineTypeAndValueImports: true,
32 | plugins: ["@ianvs/prettier-plugin-sort-imports"],
33 | }
34 |
--------------------------------------------------------------------------------
/scripts/sync-templates.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -e # bail on errors
4 | GLOB=$1
5 | IS_CI="${CI:-false}"
6 | BASE=$(pwd)
7 | COMMIT_MESSAGE=$(git log -1 --pretty=%B)
8 |
9 | for folder in $GLOB; do
10 | [ -d "$folder" ] || continue
11 | cd $BASE
12 |
13 | if [ -n "$(git status --porcelain)" ]; then
14 | git add .
15 | git commit -m "chore: update template"
16 | git push origin main
17 | fi
18 |
19 | NAME=${folder##*/}
20 | CLONE_DIR="__${NAME}__clone__"
21 |
22 | # sync to read-only clones
23 | # clone, delete files in the clone, and copy (new) files over
24 | # this handles file deletions, additions, and changes seamlessly
25 | # note: redirect output to dev/null to avoid any possibility of leaking token
26 | git clone --quiet --depth 1 git@github.com:shadcn/${NAME}.git $CLONE_DIR > /dev/null
27 | cd $CLONE_DIR
28 | find . | grep -v ".git" | grep -v "^\.*$" | xargs rm -rf # delete all files (to handle deletions in monorepo)
29 | cp -r $BASE/$folder/. .
30 |
31 | if [ -n "$(git status --porcelain)" ]; then
32 | git add .
33 | git commit -m "$COMMIT_MESSAGE"
34 | git push origin main
35 | fi
36 |
37 | cd $BASE
38 | rm -rf $CLONE_DIR
39 | done
40 |
--------------------------------------------------------------------------------
/templates/next-template/.editorconfig:
--------------------------------------------------------------------------------
1 | # editorconfig.org
2 | root = true
3 |
4 | [*]
5 | charset = utf-8
6 | end_of_line = lf
7 | indent_size = 2
8 | indent_style = space
9 | insert_final_newline = true
10 | trim_trailing_whitespace = true
11 |
--------------------------------------------------------------------------------
/templates/next-template/.eslintignore:
--------------------------------------------------------------------------------
1 | dist/*
2 | .cache
3 | public
4 | node_modules
5 | *.esm.js
6 |
--------------------------------------------------------------------------------
/templates/next-template/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json.schemastore.org/eslintrc",
3 | "root": true,
4 | "extends": [
5 | "next/core-web-vitals",
6 | "prettier",
7 | "plugin:tailwindcss/recommended"
8 | ],
9 | "plugins": ["tailwindcss"],
10 | "rules": {
11 | "@next/next/no-html-link-for-pages": "off",
12 | "react/jsx-key": "off",
13 | "tailwindcss/no-custom-classname": "off"
14 | },
15 | "settings": {
16 | "tailwindcss": {
17 | "callees": ["cn"],
18 | "config": "tailwind.config.js"
19 | },
20 | "next": {
21 | "rootDir": ["./"]
22 | }
23 | },
24 | "overrides": [
25 | {
26 | "files": ["*.ts", "*.tsx"],
27 | "parser": "@typescript-eslint/parser"
28 | }
29 | ]
30 | }
31 |
--------------------------------------------------------------------------------
/templates/next-template/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | node_modules
5 | .pnp
6 | .pnp.js
7 |
8 | # testing
9 | coverage
10 |
11 | # next.js
12 | .next/
13 | out/
14 | build
15 |
16 | # misc
17 | .DS_Store
18 | *.pem
19 |
20 | # debug
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 | .pnpm-debug.log*
25 |
26 | # local env files
27 | .env.local
28 | .env.development.local
29 | .env.test.local
30 | .env.production.local
31 |
32 | # turbo
33 | .turbo
34 |
35 | .contentlayer
36 | .env
--------------------------------------------------------------------------------
/templates/next-template/.prettierignore:
--------------------------------------------------------------------------------
1 | cache
2 | .cache
3 | package.json
4 | package-lock.json
5 | public
6 | CHANGELOG.md
7 | .yarn
8 | dist
9 | node_modules
10 | .next
11 | build
12 | .contentlayer
--------------------------------------------------------------------------------
/templates/next-template/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "typescript.tsdk": "../../node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib",
3 | "typescript.enablePromptUseWorkspaceTsdk": true
4 | }
5 |
--------------------------------------------------------------------------------
/templates/next-template/README.md:
--------------------------------------------------------------------------------
1 | # next-template
2 |
3 | A Next.js 13 template for building apps with Radix UI and Tailwind CSS.
4 |
5 | ## Usage
6 |
7 | ```bash
8 | npx create-next-app -e https://github.com/shadcn/next-template
9 | ```
10 |
11 | ## Features
12 |
13 | - Next.js 13 App Directory
14 | - Radix UI Primitives
15 | - Tailwind CSS
16 | - Icons from [Lucide](https://lucide.dev)
17 | - Dark mode with `next-themes`
18 | - Tailwind CSS class sorting, merging and linting.
19 |
20 | ## License
21 |
22 | Licensed under the [MIT license](https://github.com/shadcn/ui/blob/main/LICENSE.md).
23 |
--------------------------------------------------------------------------------
/templates/next-template/components.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://ui.shadcn.com/schema.json",
3 | "style": "default",
4 | "tailwind": {
5 | "config": "tailwind.config.js",
6 | "css": "app/globals.css",
7 | "baseColor": "slate",
8 | "cssVariables": true
9 | },
10 | "rsc": false,
11 | "aliases": {
12 | "utils": "@/lib/utils",
13 | "components": "@/components"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/templates/next-template/components/tailwind-indicator.tsx:
--------------------------------------------------------------------------------
1 | export function TailwindIndicator() {
2 | if (process.env.NODE_ENV === "production") return null
3 |
4 | return (
5 |
6 |
xs
7 |
sm
8 |
md
9 |
lg
10 |
xl
11 |
2xl
12 |
13 | )
14 | }
15 |
--------------------------------------------------------------------------------
/templates/next-template/components/theme-provider.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import * as React from "react"
4 | import { ThemeProvider as NextThemesProvider } from "next-themes"
5 | import { type ThemeProviderProps } from "next-themes/dist/types"
6 |
7 | export function ThemeProvider({ children, ...props }: ThemeProviderProps) {
8 | return {children}
9 | }
10 |
--------------------------------------------------------------------------------
/templates/next-template/components/theme-toggle.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import * as React from "react"
4 | import { Moon, Sun } from "lucide-react"
5 | import { useTheme } from "next-themes"
6 |
7 | import { Button } from "@/components/ui/button"
8 |
9 | export function ThemeToggle() {
10 | const { setTheme, theme } = useTheme()
11 |
12 | return (
13 |
22 | )
23 | }
24 |
--------------------------------------------------------------------------------
/templates/next-template/config/site.ts:
--------------------------------------------------------------------------------
1 | export type SiteConfig = typeof siteConfig
2 |
3 | export const siteConfig = {
4 | name: "Next.js",
5 | description:
6 | "Beautifully designed components built with Radix UI and Tailwind CSS.",
7 | mainNav: [
8 | {
9 | title: "Home",
10 | href: "/",
11 | },
12 | ],
13 | links: {
14 | twitter: "https://twitter.com/shadcn",
15 | github: "https://github.com/shadcn/ui",
16 | docs: "https://ui.shadcn.com",
17 | },
18 | }
19 |
--------------------------------------------------------------------------------
/templates/next-template/lib/fonts.ts:
--------------------------------------------------------------------------------
1 | import { JetBrains_Mono as FontMono, Inter as FontSans } from "next/font/google"
2 |
3 | export const fontSans = FontSans({
4 | subsets: ["latin"],
5 | variable: "--font-sans",
6 | })
7 |
8 | export const fontMono = FontMono({
9 | subsets: ["latin"],
10 | variable: "--font-mono",
11 | })
12 |
--------------------------------------------------------------------------------
/templates/next-template/lib/utils.ts:
--------------------------------------------------------------------------------
1 | import { clsx, type ClassValue } from "clsx"
2 | import { twMerge } from "tailwind-merge"
3 |
4 | export function cn(...inputs: ClassValue[]) {
5 | return twMerge(clsx(inputs))
6 | }
7 |
--------------------------------------------------------------------------------
/templates/next-template/next-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 | ///
3 |
4 | // NOTE: This file should not be edited
5 | // see https://nextjs.org/docs/basic-features/typescript for more information.
6 |
--------------------------------------------------------------------------------
/templates/next-template/next.config.mjs:
--------------------------------------------------------------------------------
1 | /** @type {import('next').NextConfig} */
2 | const nextConfig = {
3 | reactStrictMode: true,
4 | experimental: {
5 | appDir: true,
6 | },
7 | }
8 |
9 | export default nextConfig
10 |
--------------------------------------------------------------------------------
/templates/next-template/postcss.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | plugins: {
3 | tailwindcss: {},
4 | autoprefixer: {},
5 | },
6 | }
7 |
--------------------------------------------------------------------------------
/templates/next-template/prettier.config.js:
--------------------------------------------------------------------------------
1 | /** @type {import('prettier').Config} */
2 | module.exports = {
3 | endOfLine: "lf",
4 | semi: false,
5 | singleQuote: false,
6 | tabWidth: 2,
7 | trailingComma: "es5",
8 | importOrder: [
9 | "^(react/(.*)$)|^(react$)",
10 | "^(next/(.*)$)|^(next$)",
11 | "",
12 | "",
13 | "^types$",
14 | "^@/types/(.*)$",
15 | "^@/config/(.*)$",
16 | "^@/lib/(.*)$",
17 | "^@/hooks/(.*)$",
18 | "^@/components/ui/(.*)$",
19 | "^@/components/(.*)$",
20 | "^@/styles/(.*)$",
21 | "^@/app/(.*)$",
22 | "",
23 | "^[./]",
24 | ],
25 | importOrderSeparation: false,
26 | importOrderSortSpecifiers: true,
27 | importOrderBuiltinModulesToTop: true,
28 | importOrderParserPlugins: ["typescript", "jsx", "decorators-legacy"],
29 | importOrderMergeDuplicateImports: true,
30 | importOrderCombineTypeAndValueImports: true,
31 | plugins: ["@ianvs/prettier-plugin-sort-imports"],
32 | }
33 |
--------------------------------------------------------------------------------
/templates/next-template/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coincatcher22/ui/cefee5dc6f84b3c5d50b48027c52d578ea300734/templates/next-template/public/favicon.ico
--------------------------------------------------------------------------------
/templates/next-template/public/thirteen.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/templates/next-template/public/vercel.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/templates/next-template/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "lib": ["dom", "dom.iterable", "esnext"],
4 | "allowJs": true,
5 | "skipLibCheck": true,
6 | "strict": true,
7 | "forceConsistentCasingInFileNames": true,
8 | "noEmit": true,
9 | "incremental": true,
10 | "esModuleInterop": true,
11 | "module": "esnext",
12 | "moduleResolution": "node",
13 | "resolveJsonModule": true,
14 | "isolatedModules": true,
15 | "jsx": "preserve",
16 | "baseUrl": ".",
17 | "paths": {
18 | "@/*": ["./*"]
19 | },
20 | "plugins": [
21 | {
22 | "name": "next"
23 | }
24 | ],
25 | "strictNullChecks": true
26 | },
27 | "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
28 | "exclude": ["node_modules"]
29 | }
30 |
--------------------------------------------------------------------------------
/templates/next-template/types/nav.ts:
--------------------------------------------------------------------------------
1 | export interface NavItem {
2 | title: string
3 | href?: string
4 | disabled?: boolean
5 | external?: boolean
6 | }
7 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json.schemastore.org/tsconfig",
3 | "display": "Default",
4 | "compilerOptions": {
5 | "composite": false,
6 | "declaration": true,
7 | "declarationMap": true,
8 | "esModuleInterop": true,
9 | "forceConsistentCasingInFileNames": true,
10 | "inlineSources": false,
11 | "isolatedModules": true,
12 | "moduleResolution": "node",
13 | "noUnusedLocals": false,
14 | "noUnusedParameters": false,
15 | "preserveWatchOutput": true,
16 | "skipLibCheck": true,
17 | "strict": true
18 | },
19 | "exclude": ["node_modules"]
20 | }
21 |
--------------------------------------------------------------------------------
/vitest.config.ts:
--------------------------------------------------------------------------------
1 | import tsconfigPaths from "vite-tsconfig-paths"
2 | import { defineConfig } from "vitest/config"
3 |
4 | export default defineConfig({
5 | test: {
6 | // ...
7 | },
8 | plugins: [tsconfigPaths()],
9 | })
10 |
--------------------------------------------------------------------------------