├── .changeset
├── README.md
├── config.json
└── wet-eagles-leave.md
├── .commitlintrc.json
├── .editorconfig
├── .env
├── .eslintrc.js
├── .eslintrc.json
├── .github
├── ISSUE_TEMPLATE
│ ├── bug_report.yml
│ ├── config.yml
│ ├── feature_request.yml
│ └── generic_issue.yml
├── changeset-version.js
├── version-script-beta.js
├── version-script-next.js
└── workflows
│ ├── code-check.yml
│ ├── issue-stale.yml
│ ├── prerelease-comment.yml
│ ├── prerelease.yml
│ ├── release.yml
│ └── test.yml
├── .gitignore
├── .husky
└── commit-msg
├── .kodiak.toml
├── .npmrc
├── .nvmrc
├── .prettierignore
├── .vscode
└── settings.json
├── CONTRIBUTING.md
├── LICENSE.md
├── README.md
├── apps
└── www
│ ├── .env.example
│ ├── .gitignore
│ ├── .prettierignore
│ ├── __registry__
│ ├── .autogenerated
│ ├── .gitkeep
│ ├── README.md
│ └── index.tsx
│ ├── app
│ ├── docs
│ │ ├── [[...slug]]
│ │ │ └── page.tsx
│ │ └── layout.tsx
│ ├── layout.tsx
│ ├── page.tsx
│ └── themes
│ │ ├── page.tsx
│ │ └── tabs.tsx
│ ├── assets
│ └── fonts
│ │ ├── Inter-Bold.ttf
│ │ └── Inter-Regular.ttf
│ ├── components
│ ├── analytics.tsx
│ ├── announcement.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
│ ├── drawer.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-component.tsx
│ ├── theme-customizer.tsx
│ ├── theme-switcher.tsx
│ ├── theme-wrapper.tsx
│ └── toc.tsx
│ ├── config
│ ├── docs.ts
│ └── site.ts
│ ├── content
│ └── docs
│ │ ├── about.mdx
│ │ ├── changelog.mdx
│ │ ├── cli.mdx
│ │ ├── components-json.mdx
│ │ ├── components
│ │ ├── collection-stats.mdx
│ │ ├── collection.mdx
│ │ ├── nft-card.mdx
│ │ ├── nfts-by-account.mdx
│ │ └── trade-ranking.mdx
│ │ ├── dark-mode
│ │ ├── astro.mdx
│ │ ├── index.mdx
│ │ ├── next.mdx
│ │ ├── remix.mdx
│ │ └── vite.mdx
│ │ ├── figma.mdx
│ │ ├── index.mdx
│ │ ├── installation
│ │ ├── astro.mdx
│ │ ├── gatsby.mdx
│ │ ├── index.mdx
│ │ ├── laravel.mdx
│ │ ├── manual.mdx
│ │ ├── next.mdx
│ │ ├── remix.mdx
│ │ └── vite.mdx
│ │ └── theming.mdx
│ ├── contentlayer.config.js
│ ├── hooks
│ ├── use-config.ts
│ ├── use-lock-body.ts
│ ├── use-media-query.tsx
│ ├── 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
│ │ ├── mail-dark.png
│ │ ├── mail-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
│ │ │ ├── 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
│ │ │ │ ├── breadcrumb.json
│ │ │ │ ├── button.json
│ │ │ │ ├── calendar.json
│ │ │ │ ├── card.json
│ │ │ │ ├── carousel.json
│ │ │ │ ├── checkbox.json
│ │ │ │ ├── collapsible.json
│ │ │ │ ├── collection-stats.json
│ │ │ │ ├── collection.json
│ │ │ │ ├── command.json
│ │ │ │ ├── context-menu.json
│ │ │ │ ├── dialog.json
│ │ │ │ ├── drawer.json
│ │ │ │ ├── dropdown-menu.json
│ │ │ │ ├── form.json
│ │ │ │ ├── hover-card.json
│ │ │ │ ├── input-otp.json
│ │ │ │ ├── input.json
│ │ │ │ ├── label.json
│ │ │ │ ├── loading.json
│ │ │ │ ├── menubar.json
│ │ │ │ ├── navigation-menu.json
│ │ │ │ ├── nft-card.json
│ │ │ │ ├── nftcard.json
│ │ │ │ ├── nfts-by-account.json
│ │ │ │ ├── pagination.json
│ │ │ │ ├── popover.json
│ │ │ │ ├── progress.json
│ │ │ │ ├── radio-group.json
│ │ │ │ ├── resizable.json
│ │ │ │ ├── scroll-area.json
│ │ │ │ ├── select.json
│ │ │ │ ├── separator.json
│ │ │ │ ├── sheet.json
│ │ │ │ ├── skeleton.json
│ │ │ │ ├── slider.json
│ │ │ │ ├── sonner.json
│ │ │ │ ├── switch.json
│ │ │ │ ├── table.json
│ │ │ │ ├── tabs.json
│ │ │ │ ├── textarea.json
│ │ │ │ ├── toast.json
│ │ │ │ ├── toggle-group.json
│ │ │ │ ├── toggle.json
│ │ │ │ ├── tooltip.json
│ │ │ │ └── trade-ranking.json
│ │ │ ├── index.json
│ │ │ └── new-york
│ │ │ │ ├── accordion.json
│ │ │ │ ├── alert-dialog.json
│ │ │ │ ├── alert.json
│ │ │ │ ├── aspect-ratio.json
│ │ │ │ ├── avatar.json
│ │ │ │ ├── badge.json
│ │ │ │ ├── breadcrumb.json
│ │ │ │ ├── button.json
│ │ │ │ ├── calendar.json
│ │ │ │ ├── card.json
│ │ │ │ ├── carousel.json
│ │ │ │ ├── checkbox.json
│ │ │ │ ├── collapsible.json
│ │ │ │ ├── command.json
│ │ │ │ ├── context-menu.json
│ │ │ │ ├── dialog.json
│ │ │ │ ├── drawer.json
│ │ │ │ ├── dropdown-menu.json
│ │ │ │ ├── form.json
│ │ │ │ ├── hover-card.json
│ │ │ │ ├── input-otp.json
│ │ │ │ ├── input.json
│ │ │ │ ├── label.json
│ │ │ │ ├── menubar.json
│ │ │ │ ├── navigation-menu.json
│ │ │ │ ├── pagination.json
│ │ │ │ ├── popover.json
│ │ │ │ ├── progress.json
│ │ │ │ ├── radio-group.json
│ │ │ │ ├── resizable.json
│ │ │ │ ├── scroll-area.json
│ │ │ │ ├── select.json
│ │ │ │ ├── separator.json
│ │ │ │ ├── sheet.json
│ │ │ │ ├── skeleton.json
│ │ │ │ ├── slider.json
│ │ │ │ ├── sonner.json
│ │ │ │ ├── switch.json
│ │ │ │ ├── table.json
│ │ │ │ ├── tabs.json
│ │ │ │ ├── textarea.json
│ │ │ │ ├── toast.json
│ │ │ │ ├── toggle-group.json
│ │ │ │ ├── toggle.json
│ │ │ │ └── tooltip.json
│ │ ├── themes.css
│ │ └── themes
│ │ │ ├── gray.json
│ │ │ ├── neutral.json
│ │ │ ├── slate.json
│ │ │ ├── stone.json
│ │ │ └── zinc.json
│ ├── schema.json
│ └── site.webmanifest
│ ├── registry
│ ├── .eslintrc.json
│ ├── colors.ts
│ ├── default
│ │ ├── example
│ │ │ ├── card-demo.tsx
│ │ │ ├── collection-demo.tsx
│ │ │ ├── collection-stats-demo.tsx
│ │ │ ├── nft-card-demo.tsx
│ │ │ ├── nfts-by-account-collection-demo.tsx
│ │ │ ├── nfts-by-account-demo.tsx
│ │ │ ├── skeleton-card.tsx
│ │ │ ├── skeleton-demo.tsx
│ │ │ └── trade-ranking-demo.tsx
│ │ └── ui
│ │ │ ├── accordion.tsx
│ │ │ ├── alert-dialog.tsx
│ │ │ ├── alert.tsx
│ │ │ ├── aspect-ratio.tsx
│ │ │ ├── avatar.tsx
│ │ │ ├── badge.tsx
│ │ │ ├── breadcrumb.tsx
│ │ │ ├── button.tsx
│ │ │ ├── calendar.tsx
│ │ │ ├── card.tsx
│ │ │ ├── carousel.tsx
│ │ │ ├── checkbox.tsx
│ │ │ ├── collapsible.tsx
│ │ │ ├── collection-stats.tsx
│ │ │ ├── collection.tsx
│ │ │ ├── command.tsx
│ │ │ ├── context-menu.tsx
│ │ │ ├── dialog.tsx
│ │ │ ├── drawer.tsx
│ │ │ ├── dropdown-menu.tsx
│ │ │ ├── form.tsx
│ │ │ ├── hover-card.tsx
│ │ │ ├── input-otp.tsx
│ │ │ ├── input.tsx
│ │ │ ├── label.tsx
│ │ │ ├── loading.tsx
│ │ │ ├── menubar.tsx
│ │ │ ├── navigation-menu.tsx
│ │ │ ├── nft-card.tsx
│ │ │ ├── nfts-by-account.tsx
│ │ │ ├── pagination.tsx
│ │ │ ├── popover.tsx
│ │ │ ├── progress.tsx
│ │ │ ├── radio-group.tsx
│ │ │ ├── resizable.tsx
│ │ │ ├── scroll-area.tsx
│ │ │ ├── select.tsx
│ │ │ ├── separator.tsx
│ │ │ ├── sheet.tsx
│ │ │ ├── skeleton.tsx
│ │ │ ├── slider.tsx
│ │ │ ├── sonner.tsx
│ │ │ ├── switch.tsx
│ │ │ ├── table.tsx
│ │ │ ├── tabs.tsx
│ │ │ ├── textarea.tsx
│ │ │ ├── toast.tsx
│ │ │ ├── toaster.tsx
│ │ │ ├── toggle-group.tsx
│ │ │ ├── toggle.tsx
│ │ │ ├── tooltip.tsx
│ │ │ ├── trade-ranking.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
├── package.json
├── packages
└── cli
│ ├── .env
│ ├── .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
│ │ └── transform-tw-prefix.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
│ │ ├── config-ui
│ │ │ ├── components.json
│ │ │ ├── package.json
│ │ │ └── tsconfig.json
│ │ ├── next-app-js
│ │ │ ├── app
│ │ │ │ ├── favicon.ico
│ │ │ │ ├── globals.css
│ │ │ │ ├── layout.js
│ │ │ │ └── page.js
│ │ │ ├── jsconfig.json
│ │ │ ├── next.config.js
│ │ │ ├── package.json
│ │ │ ├── postcss.config.js
│ │ │ └── tailwind.config.js
│ │ ├── next-app-src
│ │ │ ├── next-env.d.ts
│ │ │ ├── next.config.js
│ │ │ ├── other.css
│ │ │ ├── package.json
│ │ │ ├── pnpm-lock.yaml
│ │ │ ├── postcss.config.js
│ │ │ ├── src
│ │ │ │ ├── app
│ │ │ │ │ ├── favicon.ico
│ │ │ │ │ ├── layout.tsx
│ │ │ │ │ ├── other.css
│ │ │ │ │ ├── page.tsx
│ │ │ │ │ └── styles.css
│ │ │ │ └── other.css
│ │ │ ├── tailwind.config.ts
│ │ │ └── tsconfig.json
│ │ ├── next-app
│ │ │ ├── app
│ │ │ │ ├── favicon.ico
│ │ │ │ ├── globals.css
│ │ │ │ ├── layout.tsx
│ │ │ │ ├── other.css
│ │ │ │ └── page.tsx
│ │ │ ├── next-env.d.ts
│ │ │ ├── next.config.js
│ │ │ ├── package.json
│ │ │ ├── pnpm-lock.yaml
│ │ │ ├── postcss.config.js
│ │ │ ├── tailwind.config.ts
│ │ │ └── tsconfig.json
│ │ ├── next-pages-src
│ │ │ ├── next-env.d.ts
│ │ │ ├── next.config.js
│ │ │ ├── other.css
│ │ │ ├── package.json
│ │ │ ├── pnpm-lock.yaml
│ │ │ ├── postcss.config.js
│ │ │ ├── src
│ │ │ │ ├── other.css
│ │ │ │ ├── pages
│ │ │ │ │ ├── _app.tsx
│ │ │ │ │ ├── _document.tsx
│ │ │ │ │ ├── api
│ │ │ │ │ │ └── hello.ts
│ │ │ │ │ ├── index.tsx
│ │ │ │ │ └── other.css
│ │ │ │ └── styles
│ │ │ │ │ ├── globals.css
│ │ │ │ │ └── other.css
│ │ │ ├── tailwind.config.ts
│ │ │ └── tsconfig.json
│ │ ├── next-pages
│ │ │ ├── next.config.js
│ │ │ ├── package.json
│ │ │ ├── pages
│ │ │ │ ├── _app.tsx
│ │ │ │ ├── _document.tsx
│ │ │ │ ├── api
│ │ │ │ │ └── hello.ts
│ │ │ │ ├── index.tsx
│ │ │ │ └── other.css
│ │ │ ├── pnpm-lock.yaml
│ │ │ ├── postcss.config.js
│ │ │ ├── styles
│ │ │ │ ├── globals.css
│ │ │ │ └── other.css
│ │ │ ├── tailwind.config.ts
│ │ │ └── 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
│ │ └── transform-tw-prefix.test.ts.snap
│ │ ├── apply-color-mapping.test.ts
│ │ ├── apply-prefix.test.ts
│ │ ├── get-config.test.ts
│ │ ├── get-item-target-path.test.ts
│ │ ├── get-package-manager.test.ts
│ │ ├── get-project-type.test.ts
│ │ ├── get-tailwind-css-file.test.ts
│ │ ├── get-ts-config-alias-prefix.test.ts
│ │ ├── is-typescript-project.test.ts
│ │ ├── registry.test.ts
│ │ ├── resolve-import.test.ts
│ │ ├── transform-css-vars.test.ts
│ │ ├── transform-import.test.ts
│ │ ├── transform-rsc.test.ts
│ │ └── transform-tw-prefix.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": "code100x/ui" }],
4 | "commit": false,
5 | "fixed": [],
6 | "linked": [],
7 | "access": "public",
8 | "baseBranch": "main",
9 | "updateInternalDependencies": "patch",
10 | "ignore": ["www", "**-template"]
11 | }
12 |
--------------------------------------------------------------------------------
/.changeset/wet-eagles-leave.md:
--------------------------------------------------------------------------------
1 | ---
2 | "code100x-ui": patch
3 | ---
4 |
5 | update zod imports
6 |
--------------------------------------------------------------------------------
/.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 |
--------------------------------------------------------------------------------
/.env:
--------------------------------------------------------------------------------
1 | COMPONENTS_REGISTRY_URL=http://localhost:3001
2 |
--------------------------------------------------------------------------------
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | // This configuration only applies to the package manager root.
2 | /** @type {import("eslint").Linter.Config} */
3 | module.exports = {
4 | ignorePatterns: ["apps/**", "packages/**"],
5 | extends: ["@repo/eslint-config/library.js"],
6 | parser: "@typescript-eslint/parser",
7 | parserOptions: {
8 | project: true,
9 | },
10 | };
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/ISSUE_TEMPLATE/config.yml:
--------------------------------------------------------------------------------
1 | blank_issues_enabled: false
2 | contact_links:
3 | - name: Get Help
4 | url: https://github.com/code100x/ui/discussions/new?category=general
5 | about: If you can't get something to work the way you expect, open a question in our discussion forums.
--------------------------------------------------------------------------------
/.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/issue-stale.yml:
--------------------------------------------------------------------------------
1 | # Adapted from vercel/next.js
2 | name: Issue Stale
3 | on:
4 | workflow_dispatch:
5 | schedule:
6 | # This runs every day 20 minutes before midnight: https://crontab.guru/#40_23_*_*_*
7 | - cron: "40 23 * * *"
8 |
9 | jobs:
10 | stale:
11 | runs-on: ubuntu-latest
12 | if: github.repository_owner == 'code100x'
13 | steps:
14 | - uses: actions/stale@v4
15 | id: stale-no-repro
16 | name: "Close stale issues with no reproduction"
17 | with:
18 | repo-token: ${{ secrets.STALE_TOKEN }}
19 | close-issue-message: "This issue has been automatically closed because it received no activity for a while. If you think it was closed by accident, please leave a comment. Thank you."
20 | days-before-issue-close: 7
21 | days-before-issue-stale: 15
22 | stale-pr-label: "stale?"
23 | days-before-pr-close: -1
24 | days-before-pr-stale: -1
25 | exempt-issue-labels: "roadmap,next,bug"
26 | operations-per-run: 300 # 1 operation per 100 issues, the rest is to label/comment/close
27 |
--------------------------------------------------------------------------------
/.github/workflows/release.yml:
--------------------------------------------------------------------------------
1 | # Adapted from create-t3-app.
2 |
3 | name: Release
4 |
5 | on:
6 | push:
7 | branches:
8 | - main
9 |
10 | jobs:
11 | release:
12 | if: ${{ github.repository_owner == 'code100x' }}
13 | name: Create a PR for release workflow
14 | runs-on: ubuntu-latest
15 | steps:
16 | - name: Checkout Repo
17 | uses: actions/checkout@v3
18 | with:
19 | fetch-depth: 0
20 |
21 | - name: Use PNPM
22 | uses: pnpm/action-setup@v2.2.4
23 | with:
24 | version: 8.6.1
25 |
26 | - name: Use Node.js 18
27 | uses: actions/setup-node@v3
28 | with:
29 | version: 8.6.1
30 | node-version: 18
31 | cache: "pnpm"
32 |
33 | - name: Install NPM Dependencies
34 | run: pnpm install
35 |
36 | # - name: Check for errors
37 | # run: pnpm check
38 |
39 | - name: Build the package
40 | run: pnpm build:cli
41 |
42 | - name: Create Version PR or Publish to NPM
43 | id: changesets
44 | uses: changesets/action@v1.4.1
45 | with:
46 | commit: "chore(release): version packages"
47 | title: "chore(release): version packages"
48 | version: node .github/changeset-version.js
49 | publish: npx changeset publish
50 | env:
51 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52 | NPM_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
53 | NODE_ENV: "production"
54 |
--------------------------------------------------------------------------------
/.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: pnpm 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: 18
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 |
--------------------------------------------------------------------------------
/.kodiak.toml:
--------------------------------------------------------------------------------
1 | # .kodiak.toml
2 | version = 1
3 |
4 | [merge]
5 | automerge_label = "automerge"
6 | require_automerge_label = true
7 | method = "squash"
8 | delete_branch_on_merge = true
9 | optimistic_updates = false
10 | prioritize_ready_to_merge = true
11 | notify_on_conflict = true
12 |
13 | [merge.message]
14 | title = "pull_request_title"
15 | body = "pull_request_body"
16 | include_pr_number = true
17 | body_type = "markdown"
18 | strip_html_comments = true
19 |
--------------------------------------------------------------------------------
/.npmrc:
--------------------------------------------------------------------------------
1 | auto-install-peers=true
2 |
--------------------------------------------------------------------------------
/.nvmrc:
--------------------------------------------------------------------------------
1 | v18.17.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 code100x
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 | # code100x/ui
2 |
3 | Accessible and customizable components that you can copy and paste into your apps. Free. Open Source. **Use this to build your own component library**.
4 |
5 | 
6 |
7 | ## Documentation
8 |
9 | Visit http://ui.code100x.com/docs to view the documentation.
10 |
11 | ## Contributing
12 |
13 | Please read the [contributing guide](/CONTRIBUTING.md).
14 |
15 | ## License
16 |
17 | Licensed under the [MIT license](https://github.com/code100x/ui/blob/main/LICENSE.md).
18 |
--------------------------------------------------------------------------------
/apps/www/.env.example:
--------------------------------------------------------------------------------
1 | # -----------------------------------------------------------------------------
2 | # App
3 | # -----------------------------------------------------------------------------
4 | NEXT_PUBLIC_APP_URL=http://localhost:3001
5 | NEXT_PUBLIC_NFTSCAN_KEY=
--------------------------------------------------------------------------------
/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
7 | app/examples/mail/components/mail.tsx
8 |
--------------------------------------------------------------------------------
/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/code100x/web3-frontends/f396856a1637e9ff0444fa5fc3aa03c7126a8070/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.** - code100x
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/default/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/themes/page.tsx:
--------------------------------------------------------------------------------
1 | import { Metadata } from "next"
2 |
3 | import "public/registry/themes.css"
4 | import { Announcement } from "@/components/announcement"
5 | import {
6 | PageActions,
7 | PageHeader,
8 | PageHeaderDescription,
9 | PageHeaderHeading,
10 | } from "@/components/page-header"
11 | import { ThemeCustomizer } from "@/components/theme-customizer"
12 | import { ThemeWrapper } from "@/components/theme-wrapper"
13 | import { ThemesTabs } from "@/app/themes/tabs"
14 |
15 | export const metadata: Metadata = {
16 | title: "Themes",
17 | description: "Hand-picked themes that you can copy and paste into your apps.",
18 | }
19 |
20 | export default function ThemesPage() {
21 | return (
22 |
23 |
27 |
28 | {/* */}
29 |
30 | Add colors. Make it yours.
31 |
32 |
33 | Make it yours
34 |
35 |
36 | Hand-picked themes that you can copy and paste into your apps.
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 | )
46 | }
47 |
--------------------------------------------------------------------------------
/apps/www/assets/fonts/Inter-Bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code100x/web3-frontends/f396856a1637e9ff0444fa5fc3aa03c7126a8070/apps/www/assets/fonts/Inter-Bold.ttf
--------------------------------------------------------------------------------
/apps/www/assets/fonts/Inter-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code100x/web3-frontends/f396856a1637e9ff0444fa5fc3aa03c7126a8070/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/announcement.tsx:
--------------------------------------------------------------------------------
1 | import Link from "next/link"
2 | import { ArrowRightIcon } from "@radix-ui/react-icons"
3 |
4 | import { Separator } from "@/registry/default/ui/separator"
5 |
6 | export function Announcement() {
7 | return (
8 |
12 | 🎉 {" "}
13 | New components and more.
14 |
15 | New components, breadcrumb and input otp.
16 |
17 |
18 |
19 | )
20 | }
21 |
--------------------------------------------------------------------------------
/apps/www/components/callout.tsx:
--------------------------------------------------------------------------------
1 | import {
2 | Alert,
3 | AlertDescription,
4 | AlertTitle,
5 | } from "@/registry/default/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/default/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/drawer.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import { forwardRef } from "react"
4 | import { Drawer as DrawerPrimitive } from "vaul"
5 |
6 | import { cn } from "@/lib/utils"
7 |
8 | const DrawerTrigger = DrawerPrimitive.Trigger
9 |
10 | const DrawerContent = forwardRef<
11 | React.ElementRef,
12 | React.ComponentPropsWithoutRef
13 | >(({ className, children, ...props }, ref) => (
14 |
15 |
16 |
24 |
25 | {children}
26 |
27 |
28 | ))
29 | DrawerContent.displayName = "DrawerContent"
30 |
31 | export { DrawerTrigger, DrawerContent }
32 |
--------------------------------------------------------------------------------
/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/mode-toggle.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import * as React from "react"
4 | import { MoonIcon, SunIcon } from "@radix-ui/react-icons"
5 | import { useTheme } from "next-themes"
6 |
7 | import { Button } from "@/registry/default/ui/button"
8 | import {
9 | DropdownMenu,
10 | DropdownMenuContent,
11 | DropdownMenuItem,
12 | DropdownMenuTrigger,
13 | } from "@/registry/default/ui/dropdown-menu"
14 |
15 | export function ModeToggle() {
16 | const { setTheme } = useTheme()
17 |
18 | return (
19 |
20 |
21 |
26 |
27 |
28 | setTheme("light")}>
29 | Light
30 |
31 | setTheme("dark")}>
32 | Dark
33 |
34 | setTheme("system")}>
35 | System
36 |
37 |
38 |
39 | )
40 | }
41 |
--------------------------------------------------------------------------------
/apps/www/components/promo-video.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import { AspectRatio } from "@/registry/default/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/default/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-switcher.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import * as React from "react"
4 | import { type SelectTriggerProps } from "@radix-ui/react-select"
5 |
6 | import { cn } from "@/lib/utils"
7 | import { useConfig } from "@/hooks/use-config"
8 | import {
9 | Select,
10 | SelectContent,
11 | SelectItem,
12 | SelectTrigger,
13 | SelectValue,
14 | } from "@/registry/default/ui/select"
15 | import { Style, styles } from "@/registry/styles"
16 |
17 | export function StyleSwitcher({ className }: SelectTriggerProps) {
18 | const [config, setConfig] = useConfig()
19 |
20 | return (
21 |
47 | )
48 | }
49 |
--------------------------------------------------------------------------------
/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-component.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import * as React from "react"
4 | import { Index } from "@/__registry__"
5 |
6 | import { cn } from "@/lib/utils"
7 | import { useConfig } from "@/hooks/use-config"
8 | import { Icons } from "@/components/icons"
9 |
10 | interface ThemeComponentProps extends React.HTMLAttributes {
11 | name: string
12 | extractClassname?: boolean
13 | extractedClassNames?: string
14 | align?: "center" | "start" | "end"
15 | }
16 |
17 | export function ThemeComponent({ name, ...props }: ThemeComponentProps) {
18 | const [config] = useConfig()
19 |
20 | const Preview = React.useMemo(() => {
21 | const Component = Index[config.style][name]?.component
22 |
23 | if (!Component) {
24 | return (
25 |
26 | Component{" "}
27 |
28 | {name}
29 |
{" "}
30 | not found in registry.
31 |
32 | )
33 | }
34 |
35 | return
36 | }, [name, config.style])
37 |
38 | return (
39 |
40 |
43 |
44 | Loading...
45 |
46 | }
47 | >
48 | {Preview}
49 |
50 |
51 | )
52 | }
53 |
--------------------------------------------------------------------------------
/apps/www/components/theme-switcher.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import * as React from "react"
4 | import { useSelectedLayoutSegment } from "next/navigation"
5 |
6 | import { useConfig } from "@/hooks/use-config"
7 |
8 | export function ThemeSwitcher() {
9 | const [config] = useConfig()
10 | const segment = useSelectedLayoutSegment()
11 |
12 | React.useEffect(() => {
13 | document.body.classList.forEach((className) => {
14 | if (className.match(/^theme.*/)) {
15 | document.body.classList.remove(className)
16 | }
17 | })
18 |
19 | const theme = segment === "themes" ? config.theme : null
20 | if (theme) {
21 | return document.body.classList.add(`theme-${theme}`)
22 | }
23 | }, [segment, config])
24 |
25 | return null
26 | }
27 |
--------------------------------------------------------------------------------
/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 | interface ThemeWrapperProps extends React.ComponentProps<"div"> {
7 | defaultTheme?: string
8 | }
9 |
10 | export function ThemeWrapper({
11 | defaultTheme,
12 | children,
13 | className,
14 | }: ThemeWrapperProps) {
15 | const [config] = useConfig()
16 |
17 | return (
18 |
30 | {children}
31 |
32 | )
33 | }
34 |
--------------------------------------------------------------------------------
/apps/www/config/site.ts:
--------------------------------------------------------------------------------
1 | export const siteConfig = {
2 | name: "code100x/ui",
3 | url: "https://ui.code100x.com",
4 | ogImage: "https://ui.code100x.com/og.jpg",
5 | description:
6 | "Beautifully designed components that you can copy and paste into your apps. Accessible. Customizable. Open Source.",
7 | links: {
8 | twitter: "https://twitter.com/code100x",
9 | github: "https://github.com/code100x/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.code100x.com](https://ui.code100x.com) is a project by [code100x](https://code100x.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 © [code100x](https://code100x.com)
21 |
--------------------------------------------------------------------------------
/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 | radius: number
11 | }
12 |
13 | const configAtom = atomWithStorage("config", {
14 | style: "default",
15 | theme: "zinc",
16 | radius: 0.5,
17 | })
18 |
19 | export function useConfig() {
20 | return useAtom(configAtom)
21 | }
22 |
--------------------------------------------------------------------------------
/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-media-query.tsx:
--------------------------------------------------------------------------------
1 | import * as React from "react"
2 |
3 | export function useMediaQuery(query: string) {
4 | const [value, setValue] = React.useState(false)
5 |
6 | React.useEffect(() => {
7 | function onChange(event: MediaQueryListEvent) {
8 | setValue(event.matches)
9 | }
10 |
11 | const result = matchMedia(query)
12 | result.addEventListener("change", onChange)
13 | setValue(result.matches)
14 |
15 | return () => result.removeEventListener("change", onChange)
16 | }, [query])
17 |
18 | return value
19 | }
20 |
--------------------------------------------------------------------------------
/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 | "copy_theme_code",
11 | ]),
12 | // declare type AllowedPropertyValues = string | number | boolean | null
13 | properties: z
14 | .record(z.union([z.string(), z.number(), z.boolean(), z.null()]))
15 | .optional(),
16 | })
17 |
18 | export type Event = z.infer
19 |
20 | export function trackEvent(input: Event): void {
21 | const event = eventSchema.parse(input)
22 | if (event) {
23 | va.track(event.name, event.properties)
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/apps/www/lib/fonts.ts:
--------------------------------------------------------------------------------
1 | // import { JetBrains_Mono as FontMono, Inter as FontSans } from "next/font/google"
2 | import { JetBrains_Mono as FontMono } from "next/font/google"
3 | // import { GeistMono } from "geist/font/mono"
4 | import { GeistSans } from "geist/font/sans"
5 |
6 | // export const fontSans = FontSans({
7 | // subsets: ["latin"],
8 | // variable: "--font-sans",
9 | // })
10 | export const fontSans = GeistSans
11 |
12 | export const fontMono = FontMono({
13 | subsets: ["latin"],
14 | variable: "--font-mono",
15 | })
16 |
--------------------------------------------------------------------------------
/apps/www/lib/utils.ts:
--------------------------------------------------------------------------------
1 | import * as React from "react"
2 | import { clsx, type ClassValue } from "clsx"
3 | import { twMerge } from "tailwind-merge"
4 |
5 | export function cn(...inputs: ClassValue[]) {
6 | return twMerge(clsx(inputs))
7 | }
8 |
9 | export function formatDate(input: string | number): string {
10 | const date = new Date(input)
11 | return date.toLocaleDateString("en-US", {
12 | month: "long",
13 | day: "numeric",
14 | year: "numeric",
15 | })
16 | }
17 |
18 | export function absoluteUrl(path: string) {
19 | return `${process.env.NEXT_PUBLIC_APP_URL}${path}`
20 | }
21 |
--------------------------------------------------------------------------------
/apps/www/lib/validations/log.ts:
--------------------------------------------------------------------------------
1 | import { 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 { 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/code100x/web3-frontends/f396856a1637e9ff0444fa5fc3aa03c7126a8070/apps/www/pages/.gitkeep
--------------------------------------------------------------------------------
/apps/www/pages/api/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code100x/web3-frontends/f396856a1637e9ff0444fa5fc3aa03c7126a8070/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/code100x/web3-frontends/f396856a1637e9ff0444fa5fc3aa03c7126a8070/apps/www/public/android-chrome-192x192.png
--------------------------------------------------------------------------------
/apps/www/public/android-chrome-512x512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code100x/web3-frontends/f396856a1637e9ff0444fa5fc3aa03c7126a8070/apps/www/public/android-chrome-512x512.png
--------------------------------------------------------------------------------
/apps/www/public/apple-touch-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code100x/web3-frontends/f396856a1637e9ff0444fa5fc3aa03c7126a8070/apps/www/public/apple-touch-icon.png
--------------------------------------------------------------------------------
/apps/www/public/avatars/01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code100x/web3-frontends/f396856a1637e9ff0444fa5fc3aa03c7126a8070/apps/www/public/avatars/01.png
--------------------------------------------------------------------------------
/apps/www/public/avatars/02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code100x/web3-frontends/f396856a1637e9ff0444fa5fc3aa03c7126a8070/apps/www/public/avatars/02.png
--------------------------------------------------------------------------------
/apps/www/public/avatars/03.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code100x/web3-frontends/f396856a1637e9ff0444fa5fc3aa03c7126a8070/apps/www/public/avatars/03.png
--------------------------------------------------------------------------------
/apps/www/public/avatars/04.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code100x/web3-frontends/f396856a1637e9ff0444fa5fc3aa03c7126a8070/apps/www/public/avatars/04.png
--------------------------------------------------------------------------------
/apps/www/public/avatars/05.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code100x/web3-frontends/f396856a1637e9ff0444fa5fc3aa03c7126a8070/apps/www/public/avatars/05.png
--------------------------------------------------------------------------------
/apps/www/public/examples/authentication-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code100x/web3-frontends/f396856a1637e9ff0444fa5fc3aa03c7126a8070/apps/www/public/examples/authentication-dark.png
--------------------------------------------------------------------------------
/apps/www/public/examples/authentication-light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code100x/web3-frontends/f396856a1637e9ff0444fa5fc3aa03c7126a8070/apps/www/public/examples/authentication-light.png
--------------------------------------------------------------------------------
/apps/www/public/examples/cards-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code100x/web3-frontends/f396856a1637e9ff0444fa5fc3aa03c7126a8070/apps/www/public/examples/cards-dark.png
--------------------------------------------------------------------------------
/apps/www/public/examples/cards-light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code100x/web3-frontends/f396856a1637e9ff0444fa5fc3aa03c7126a8070/apps/www/public/examples/cards-light.png
--------------------------------------------------------------------------------
/apps/www/public/examples/dashboard-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code100x/web3-frontends/f396856a1637e9ff0444fa5fc3aa03c7126a8070/apps/www/public/examples/dashboard-dark.png
--------------------------------------------------------------------------------
/apps/www/public/examples/dashboard-light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code100x/web3-frontends/f396856a1637e9ff0444fa5fc3aa03c7126a8070/apps/www/public/examples/dashboard-light.png
--------------------------------------------------------------------------------
/apps/www/public/examples/forms-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code100x/web3-frontends/f396856a1637e9ff0444fa5fc3aa03c7126a8070/apps/www/public/examples/forms-dark.png
--------------------------------------------------------------------------------
/apps/www/public/examples/forms-light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code100x/web3-frontends/f396856a1637e9ff0444fa5fc3aa03c7126a8070/apps/www/public/examples/forms-light.png
--------------------------------------------------------------------------------
/apps/www/public/examples/mail-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code100x/web3-frontends/f396856a1637e9ff0444fa5fc3aa03c7126a8070/apps/www/public/examples/mail-dark.png
--------------------------------------------------------------------------------
/apps/www/public/examples/mail-light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code100x/web3-frontends/f396856a1637e9ff0444fa5fc3aa03c7126a8070/apps/www/public/examples/mail-light.png
--------------------------------------------------------------------------------
/apps/www/public/examples/music-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code100x/web3-frontends/f396856a1637e9ff0444fa5fc3aa03c7126a8070/apps/www/public/examples/music-dark.png
--------------------------------------------------------------------------------
/apps/www/public/examples/music-light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code100x/web3-frontends/f396856a1637e9ff0444fa5fc3aa03c7126a8070/apps/www/public/examples/music-light.png
--------------------------------------------------------------------------------
/apps/www/public/examples/playground-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code100x/web3-frontends/f396856a1637e9ff0444fa5fc3aa03c7126a8070/apps/www/public/examples/playground-dark.png
--------------------------------------------------------------------------------
/apps/www/public/examples/playground-light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code100x/web3-frontends/f396856a1637e9ff0444fa5fc3aa03c7126a8070/apps/www/public/examples/playground-light.png
--------------------------------------------------------------------------------
/apps/www/public/examples/tasks-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code100x/web3-frontends/f396856a1637e9ff0444fa5fc3aa03c7126a8070/apps/www/public/examples/tasks-dark.png
--------------------------------------------------------------------------------
/apps/www/public/examples/tasks-light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code100x/web3-frontends/f396856a1637e9ff0444fa5fc3aa03c7126a8070/apps/www/public/examples/tasks-light.png
--------------------------------------------------------------------------------
/apps/www/public/favicon-16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code100x/web3-frontends/f396856a1637e9ff0444fa5fc3aa03c7126a8070/apps/www/public/favicon-16x16.png
--------------------------------------------------------------------------------
/apps/www/public/favicon-32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code100x/web3-frontends/f396856a1637e9ff0444fa5fc3aa03c7126a8070/apps/www/public/favicon-32x32.png
--------------------------------------------------------------------------------
/apps/www/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code100x/web3-frontends/f396856a1637e9ff0444fa5fc3aa03c7126a8070/apps/www/public/favicon.ico
--------------------------------------------------------------------------------
/apps/www/public/images/style-with-theming.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code100x/web3-frontends/f396856a1637e9ff0444fa5fc3aa03c7126a8070/apps/www/public/images/style-with-theming.jpg
--------------------------------------------------------------------------------
/apps/www/public/images/style.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code100x/web3-frontends/f396856a1637e9ff0444fa5fc3aa03c7126a8070/apps/www/public/images/style.jpg
--------------------------------------------------------------------------------
/apps/www/public/og.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code100x/web3-frontends/f396856a1637e9ff0444fa5fc3aa03c7126a8070/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\"\r\n\r\nimport * as AspectRatioPrimitive from \"@radix-ui/react-aspect-ratio\"\r\n\r\nconst AspectRatio = AspectRatioPrimitive.Root\r\n\r\nexport { AspectRatio }\r\n"
10 | }
11 | ],
12 | "type": "components:ui"
13 | }
--------------------------------------------------------------------------------
/apps/www/public/registry/styles/default/badge.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "badge",
3 | "files": [
4 | {
5 | "name": "badge.tsx",
6 | "content": "import * as React from \"react\"\r\nimport { cva, type VariantProps } from \"class-variance-authority\"\r\n\r\nimport { cn } from \"@/lib/utils\"\r\n\r\nconst badgeVariants = cva(\r\n \"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2\",\r\n {\r\n variants: {\r\n variant: {\r\n default:\r\n \"border-transparent bg-primary text-primary-foreground hover:bg-primary/80\",\r\n secondary:\r\n \"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80\",\r\n destructive:\r\n \"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80\",\r\n outline: \"text-foreground\",\r\n },\r\n },\r\n defaultVariants: {\r\n variant: \"default\",\r\n },\r\n }\r\n)\r\n\r\nexport interface BadgeProps\r\n extends React.HTMLAttributes,\r\n VariantProps {}\r\n\r\nfunction Badge({ className, variant, ...props }: BadgeProps) {\r\n return (\r\n \r\n )\r\n}\r\n\r\nexport { Badge, badgeVariants }\r\n"
7 | }
8 | ],
9 | "type": "components:ui"
10 | }
--------------------------------------------------------------------------------
/apps/www/public/registry/styles/default/checkbox.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "checkbox",
3 | "dependencies": [
4 | "@radix-ui/react-checkbox"
5 | ],
6 | "files": [
7 | {
8 | "name": "checkbox.tsx",
9 | "content": "\"use client\"\r\n\r\nimport * as React from \"react\"\r\nimport * as CheckboxPrimitive from \"@radix-ui/react-checkbox\"\r\nimport { Check } from \"lucide-react\"\r\n\r\nimport { cn } from \"@/lib/utils\"\r\n\r\nconst Checkbox = React.forwardRef<\r\n React.ElementRef,\r\n React.ComponentPropsWithoutRef\r\n>(({ className, ...props }, ref) => (\r\n \r\n \r\n \r\n \r\n \r\n))\r\nCheckbox.displayName = CheckboxPrimitive.Root.displayName\r\n\r\nexport { Checkbox }\r\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\"\r\n\r\nimport * as CollapsiblePrimitive from \"@radix-ui/react-collapsible\"\r\n\r\nconst Collapsible = CollapsiblePrimitive.Root\r\n\r\nconst CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger\r\n\r\nconst CollapsibleContent = CollapsiblePrimitive.CollapsibleContent\r\n\r\nexport { Collapsible, CollapsibleTrigger, CollapsibleContent }\r\n"
10 | }
11 | ],
12 | "type": "components:ui"
13 | }
--------------------------------------------------------------------------------
/apps/www/public/registry/styles/default/hover-card.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "hover-card",
3 | "dependencies": [
4 | "@radix-ui/react-hover-card"
5 | ],
6 | "files": [
7 | {
8 | "name": "hover-card.tsx",
9 | "content": "\"use client\"\r\n\r\nimport * as React from \"react\"\r\nimport * as HoverCardPrimitive from \"@radix-ui/react-hover-card\"\r\n\r\nimport { cn } from \"@/lib/utils\"\r\n\r\nconst HoverCard = HoverCardPrimitive.Root\r\n\r\nconst HoverCardTrigger = HoverCardPrimitive.Trigger\r\n\r\nconst HoverCardContent = React.forwardRef<\r\n React.ElementRef,\r\n React.ComponentPropsWithoutRef\r\n>(({ className, align = \"center\", sideOffset = 4, ...props }, ref) => (\r\n \r\n))\r\nHoverCardContent.displayName = HoverCardPrimitive.Content.displayName\r\n\r\nexport { HoverCard, HoverCardTrigger, HoverCardContent }\r\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\"\r\n\r\nimport { cn } from \"@/lib/utils\"\r\n\r\nexport interface InputProps\r\n extends React.InputHTMLAttributes {}\r\n\r\nconst Input = React.forwardRef(\r\n ({ className, type, ...props }, ref) => {\r\n return (\r\n \r\n )\r\n }\r\n)\r\nInput.displayName = \"Input\"\r\n\r\nexport { Input }\r\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\"\r\n\r\nimport * as React from \"react\"\r\nimport * as LabelPrimitive from \"@radix-ui/react-label\"\r\nimport { cva, type VariantProps } from \"class-variance-authority\"\r\n\r\nimport { cn } from \"@/lib/utils\"\r\n\r\nconst labelVariants = cva(\r\n \"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\r\n)\r\n\r\nconst Label = React.forwardRef<\r\n React.ElementRef,\r\n React.ComponentPropsWithoutRef &\r\n VariantProps\r\n>(({ className, ...props }, ref) => (\r\n \r\n))\r\nLabel.displayName = LabelPrimitive.Root.displayName\r\n\r\nexport { Label }\r\n"
10 | }
11 | ],
12 | "type": "components:ui"
13 | }
--------------------------------------------------------------------------------
/apps/www/public/registry/styles/default/loading.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "loading",
3 | "dependencies": [],
4 | "files": [
5 | {
6 | "name": "loading.tsx",
7 | "content": "import React from \"react\"\n\nconst Loading = () => {\n return (\n \n )\n}\n\nexport default Loading\n"
8 | }
9 | ],
10 | "type": "components:ui"
11 | }
--------------------------------------------------------------------------------
/apps/www/public/registry/styles/default/popover.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "popover",
3 | "dependencies": [
4 | "@radix-ui/react-popover"
5 | ],
6 | "files": [
7 | {
8 | "name": "popover.tsx",
9 | "content": "\"use client\"\r\n\r\nimport * as React from \"react\"\r\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\"\r\n\r\nimport { cn } from \"@/lib/utils\"\r\n\r\nconst Popover = PopoverPrimitive.Root\r\n\r\nconst PopoverTrigger = PopoverPrimitive.Trigger\r\n\r\nconst PopoverContent = React.forwardRef<\r\n React.ElementRef,\r\n React.ComponentPropsWithoutRef\r\n>(({ className, align = \"center\", sideOffset = 4, ...props }, ref) => (\r\n \r\n \r\n \r\n))\r\nPopoverContent.displayName = PopoverPrimitive.Content.displayName\r\n\r\nexport { Popover, PopoverTrigger, PopoverContent }\r\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\"\r\n\r\nimport * as React from \"react\"\r\nimport * as ProgressPrimitive from \"@radix-ui/react-progress\"\r\n\r\nimport { cn } from \"@/lib/utils\"\r\n\r\nconst Progress = React.forwardRef<\r\n React.ElementRef,\r\n React.ComponentPropsWithoutRef\r\n>(({ className, value, ...props }, ref) => (\r\n \r\n \r\n \r\n))\r\nProgress.displayName = ProgressPrimitive.Root.displayName\r\n\r\nexport { Progress }\r\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\"\r\n\r\nimport * as React from \"react\"\r\nimport * as SeparatorPrimitive from \"@radix-ui/react-separator\"\r\n\r\nimport { cn } from \"@/lib/utils\"\r\n\r\nconst Separator = React.forwardRef<\r\n React.ElementRef,\r\n React.ComponentPropsWithoutRef\r\n>(\r\n (\r\n { className, orientation = \"horizontal\", decorative = true, ...props },\r\n ref\r\n ) => (\r\n \r\n )\r\n)\r\nSeparator.displayName = SeparatorPrimitive.Root.displayName\r\n\r\nexport { Separator }\r\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\"\r\n\r\nfunction Skeleton({\r\n className,\r\n ...props\r\n}: React.HTMLAttributes) {\r\n return (\r\n \r\n )\r\n}\r\n\r\nexport { Skeleton }\r\n"
7 | }
8 | ],
9 | "type": "components:ui"
10 | }
--------------------------------------------------------------------------------
/apps/www/public/registry/styles/default/slider.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "slider",
3 | "dependencies": [
4 | "@radix-ui/react-slider"
5 | ],
6 | "files": [
7 | {
8 | "name": "slider.tsx",
9 | "content": "\"use client\"\r\n\r\nimport * as React from \"react\"\r\nimport * as SliderPrimitive from \"@radix-ui/react-slider\"\r\n\r\nimport { cn } from \"@/lib/utils\"\r\n\r\nconst Slider = React.forwardRef<\r\n React.ElementRef,\r\n React.ComponentPropsWithoutRef\r\n>(({ className, ...props }, ref) => (\r\n \r\n \r\n \r\n \r\n \r\n \r\n))\r\nSlider.displayName = SliderPrimitive.Root.displayName\r\n\r\nexport { Slider }\r\n"
10 | }
11 | ],
12 | "type": "components:ui"
13 | }
--------------------------------------------------------------------------------
/apps/www/public/registry/styles/default/sonner.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "sonner",
3 | "dependencies": [
4 | "sonner",
5 | "next-themes"
6 | ],
7 | "files": [
8 | {
9 | "name": "sonner.tsx",
10 | "content": "\"use client\"\r\n\r\nimport { useTheme } from \"next-themes\"\r\nimport { Toaster as Sonner } from \"sonner\"\r\n\r\ntype ToasterProps = React.ComponentProps\r\n\r\nconst Toaster = ({ ...props }: ToasterProps) => {\r\n const { theme = \"system\" } = useTheme()\r\n\r\n return (\r\n \r\n )\r\n}\r\n\r\nexport { Toaster }\r\n"
11 | }
12 | ],
13 | "type": "components:ui"
14 | }
--------------------------------------------------------------------------------
/apps/www/public/registry/styles/default/switch.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "switch",
3 | "dependencies": [
4 | "@radix-ui/react-switch"
5 | ],
6 | "files": [
7 | {
8 | "name": "switch.tsx",
9 | "content": "\"use client\"\r\n\r\nimport * as React from \"react\"\r\nimport * as SwitchPrimitives from \"@radix-ui/react-switch\"\r\n\r\nimport { cn } from \"@/lib/utils\"\r\n\r\nconst Switch = React.forwardRef<\r\n React.ElementRef,\r\n React.ComponentPropsWithoutRef\r\n>(({ className, ...props }, ref) => (\r\n \r\n \r\n \r\n))\r\nSwitch.displayName = SwitchPrimitives.Root.displayName\r\n\r\nexport { Switch }\r\n"
10 | }
11 | ],
12 | "type": "components:ui"
13 | }
--------------------------------------------------------------------------------
/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\"\r\n\r\nimport { cn } from \"@/lib/utils\"\r\n\r\nexport interface TextareaProps\r\n extends React.TextareaHTMLAttributes {}\r\n\r\nconst Textarea = React.forwardRef(\r\n ({ className, ...props }, ref) => {\r\n return (\r\n \r\n )\r\n }\r\n)\r\nTextarea.displayName = \"Textarea\"\r\n\r\nexport { Textarea }\r\n"
7 | }
8 | ],
9 | "type": "components:ui"
10 | }
--------------------------------------------------------------------------------
/apps/www/public/registry/styles/default/tooltip.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "tooltip",
3 | "dependencies": [
4 | "@radix-ui/react-tooltip"
5 | ],
6 | "files": [
7 | {
8 | "name": "tooltip.tsx",
9 | "content": "\"use client\"\r\n\r\nimport * as React from \"react\"\r\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\"\r\n\r\nimport { cn } from \"@/lib/utils\"\r\n\r\nconst TooltipProvider = TooltipPrimitive.Provider\r\n\r\nconst Tooltip = TooltipPrimitive.Root\r\n\r\nconst TooltipTrigger = TooltipPrimitive.Trigger\r\n\r\nconst TooltipContent = React.forwardRef<\r\n React.ElementRef,\r\n React.ComponentPropsWithoutRef\r\n>(({ className, sideOffset = 4, ...props }, ref) => (\r\n \r\n))\r\nTooltipContent.displayName = TooltipPrimitive.Content.displayName\r\n\r\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }\r\n"
10 | }
11 | ],
12 | "type": "components:ui"
13 | }
--------------------------------------------------------------------------------
/apps/www/public/registry/styles/index.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "name": "default",
4 | "label": "Default"
5 | }
6 | ]
--------------------------------------------------------------------------------
/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/badge.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "badge",
3 | "files": [
4 | {
5 | "name": "badge.tsx",
6 | "content": "import * as React from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst badgeVariants = cva(\n \"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2\",\n {\n variants: {\n variant: {\n default:\n \"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80\",\n secondary:\n \"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n destructive:\n \"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80\",\n outline: \"text-foreground\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n)\n\nexport interface BadgeProps\n extends React.HTMLAttributes,\n VariantProps {}\n\nfunction Badge({ className, variant, ...props }: BadgeProps) {\n return (\n \n )\n}\n\nexport { Badge, badgeVariants }\n"
7 | }
8 | ],
9 | "type": "components:ui"
10 | }
--------------------------------------------------------------------------------
/apps/www/public/registry/styles/new-york/checkbox.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "checkbox",
3 | "dependencies": [
4 | "@radix-ui/react-checkbox"
5 | ],
6 | "files": [
7 | {
8 | "name": "checkbox.tsx",
9 | "content": "\"use client\"\n\nimport * as React from \"react\"\nimport * as CheckboxPrimitive from \"@radix-ui/react-checkbox\"\nimport { CheckIcon } from \"@radix-ui/react-icons\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst Checkbox = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => (\n \n \n \n \n \n))\nCheckbox.displayName = CheckboxPrimitive.Root.displayName\n\nexport { Checkbox }\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/hover-card.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "hover-card",
3 | "dependencies": [
4 | "@radix-ui/react-hover-card"
5 | ],
6 | "files": [
7 | {
8 | "name": "hover-card.tsx",
9 | "content": "\"use client\"\n\nimport * as React from \"react\"\nimport * as HoverCardPrimitive from \"@radix-ui/react-hover-card\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst HoverCard = HoverCardPrimitive.Root\n\nconst HoverCardTrigger = HoverCardPrimitive.Trigger\n\nconst HoverCardContent = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, align = \"center\", sideOffset = 4, ...props }, ref) => (\n \n))\nHoverCardContent.displayName = HoverCardPrimitive.Content.displayName\n\nexport { HoverCard, HoverCardTrigger, HoverCardContent }\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/popover.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "popover",
3 | "dependencies": [
4 | "@radix-ui/react-popover"
5 | ],
6 | "files": [
7 | {
8 | "name": "popover.tsx",
9 | "content": "\"use client\"\n\nimport * as React from \"react\"\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst Popover = PopoverPrimitive.Root\n\nconst PopoverTrigger = PopoverPrimitive.Trigger\n\nconst PopoverAnchor = PopoverPrimitive.Anchor\n\nconst PopoverContent = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, align = \"center\", sideOffset = 4, ...props }, ref) => (\n \n \n \n))\nPopoverContent.displayName = PopoverPrimitive.Content.displayName\n\nexport { Popover, PopoverTrigger, PopoverContent, PopoverAnchor }\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/slider.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "slider",
3 | "dependencies": [
4 | "@radix-ui/react-slider"
5 | ],
6 | "files": [
7 | {
8 | "name": "slider.tsx",
9 | "content": "\"use client\"\n\nimport * as React from \"react\"\nimport * as SliderPrimitive from \"@radix-ui/react-slider\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst Slider = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => (\n \n \n \n \n \n \n))\nSlider.displayName = SliderPrimitive.Root.displayName\n\nexport { Slider }\n"
10 | }
11 | ],
12 | "type": "components:ui"
13 | }
--------------------------------------------------------------------------------
/apps/www/public/registry/styles/new-york/sonner.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "sonner",
3 | "dependencies": [
4 | "sonner",
5 | "next-themes"
6 | ],
7 | "files": [
8 | {
9 | "name": "sonner.tsx",
10 | "content": "\"use client\"\n\nimport { useTheme } from \"next-themes\"\nimport { Toaster as Sonner } from \"sonner\"\n\ntype ToasterProps = React.ComponentProps\n\nconst Toaster = ({ ...props }: ToasterProps) => {\n const { theme = \"system\" } = useTheme()\n\n return (\n \n )\n}\n\nexport { Toaster }\n"
11 | }
12 | ],
13 | "type": "components:ui"
14 | }
--------------------------------------------------------------------------------
/apps/www/public/registry/styles/new-york/switch.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "switch",
3 | "dependencies": [
4 | "@radix-ui/react-switch"
5 | ],
6 | "files": [
7 | {
8 | "name": "switch.tsx",
9 | "content": "\"use client\"\n\nimport * as React from \"react\"\nimport * as SwitchPrimitives from \"@radix-ui/react-switch\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst Switch = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => (\n \n \n \n))\nSwitch.displayName = SwitchPrimitives.Root.displayName\n\nexport { Switch }\n"
10 | }
11 | ],
12 | "type": "components:ui"
13 | }
--------------------------------------------------------------------------------
/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/registry/styles/new-york/tooltip.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "tooltip",
3 | "dependencies": [
4 | "@radix-ui/react-tooltip"
5 | ],
6 | "files": [
7 | {
8 | "name": "tooltip.tsx",
9 | "content": "\"use client\"\n\nimport * as React from \"react\"\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst TooltipProvider = TooltipPrimitive.Provider\n\nconst Tooltip = TooltipPrimitive.Root\n\nconst TooltipTrigger = TooltipPrimitive.Trigger\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, sideOffset = 4, ...props }, ref) => (\n \n))\nTooltipContent.displayName = TooltipPrimitive.Content.displayName\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }\n"
10 | }
11 | ],
12 | "type": "components:ui"
13 | }
--------------------------------------------------------------------------------
/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 | "prefix": {
25 | "type": "string"
26 | }
27 | },
28 | "required": ["config", "css", "baseColor", "cssVariables"]
29 | },
30 | "rsc": {
31 | "type": "boolean"
32 | },
33 | "tsx": {
34 | "type": "boolean"
35 | },
36 | "aliases": {
37 | "type": "object",
38 | "properties": {
39 | "utils": {
40 | "type": "string"
41 | },
42 | "components": {
43 | "type": "string"
44 | },
45 | "ui": {
46 | "type": "string"
47 | }
48 | },
49 | "required": ["utils", "components"]
50 | }
51 | },
52 | "required": ["style", "tailwind", "rsc", "aliases"]
53 | }
54 |
--------------------------------------------------------------------------------
/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/collection-demo.tsx:
--------------------------------------------------------------------------------
1 | import { Collection } from "../ui/collection"
2 |
3 | const CollectionDemo = () => {
4 | return
5 | }
6 |
7 | export default CollectionDemo
8 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/collection-stats-demo.tsx:
--------------------------------------------------------------------------------
1 | import { CollectionStats } from "../ui/collection-stats"
2 |
3 | const CollectionStatsDemo = () => {
4 | return
5 | }
6 |
7 | export default CollectionStatsDemo
8 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/nft-card-demo.tsx:
--------------------------------------------------------------------------------
1 | import { NftCard } from "../ui/nft-card"
2 |
3 | const NftCardDemo = () => {
4 | return (
5 |
13 | )
14 | }
15 |
16 | export default NftCardDemo
17 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/nfts-by-account-collection-demo.tsx:
--------------------------------------------------------------------------------
1 | import { NftsByAccount } from "../ui/nfts-by-account";
2 |
3 |
4 | const NftsByAccountCollectionDemo = () => {
5 | return (
6 |
11 | )
12 | }
13 |
14 | export default NftsByAccountCollectionDemo
--------------------------------------------------------------------------------
/apps/www/registry/default/example/nfts-by-account-demo.tsx:
--------------------------------------------------------------------------------
1 | import { NftsByAccount } from "../ui/nfts-by-account"
2 |
3 | const NftsByAccountDemo = () => {
4 | return (
5 |
9 | )
10 | }
11 |
12 | export default NftsByAccountDemo
13 |
--------------------------------------------------------------------------------
/apps/www/registry/default/example/skeleton-card.tsx:
--------------------------------------------------------------------------------
1 | import { Skeleton } from "@/registry/default/ui/skeleton"
2 |
3 | export default function SkeletonCard() {
4 | return (
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | )
13 | }
14 |
--------------------------------------------------------------------------------
/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/trade-ranking-demo.tsx:
--------------------------------------------------------------------------------
1 | import { TradeRanking } from "../ui/trade-ranking"
2 |
3 | const TradeRankingDemo = () => {
4 | return
5 | }
6 |
7 | export default TradeRankingDemo
8 |
--------------------------------------------------------------------------------
/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/badge.tsx:
--------------------------------------------------------------------------------
1 | import * as React from "react"
2 | import { cva, type VariantProps } from "class-variance-authority"
3 |
4 | import { cn } from "@/lib/utils"
5 |
6 | const badgeVariants = cva(
7 | "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
8 | {
9 | variants: {
10 | variant: {
11 | default:
12 | "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
13 | secondary:
14 | "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
15 | destructive:
16 | "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
17 | outline: "text-foreground",
18 | },
19 | },
20 | defaultVariants: {
21 | variant: "default",
22 | },
23 | }
24 | )
25 |
26 | export interface BadgeProps
27 | extends React.HTMLAttributes,
28 | VariantProps {}
29 |
30 | function Badge({ className, variant, ...props }: BadgeProps) {
31 | return (
32 |
33 | )
34 | }
35 |
36 | export { Badge, badgeVariants }
37 |
--------------------------------------------------------------------------------
/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/hover-card.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import * as React from "react"
4 | import * as HoverCardPrimitive from "@radix-ui/react-hover-card"
5 |
6 | import { cn } from "@/lib/utils"
7 |
8 | const HoverCard = HoverCardPrimitive.Root
9 |
10 | const HoverCardTrigger = HoverCardPrimitive.Trigger
11 |
12 | const HoverCardContent = React.forwardRef<
13 | React.ElementRef,
14 | React.ComponentPropsWithoutRef
15 | >(({ className, align = "center", sideOffset = 4, ...props }, ref) => (
16 |
26 | ))
27 | HoverCardContent.displayName = HoverCardPrimitive.Content.displayName
28 |
29 | export { HoverCard, HoverCardTrigger, HoverCardContent }
30 |
--------------------------------------------------------------------------------
/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/loading.tsx:
--------------------------------------------------------------------------------
1 | import React from "react"
2 |
3 | const Loading = () => {
4 | return (
5 |
6 |
7 |
8 | Loading...
9 |
10 |
11 | )
12 | }
13 |
14 | export default Loading
15 |
--------------------------------------------------------------------------------
/apps/www/registry/default/ui/popover.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import * as React from "react"
4 | import * as PopoverPrimitive from "@radix-ui/react-popover"
5 |
6 | import { cn } from "@/lib/utils"
7 |
8 | const Popover = PopoverPrimitive.Root
9 |
10 | const PopoverTrigger = PopoverPrimitive.Trigger
11 |
12 | const PopoverContent = React.forwardRef<
13 | React.ElementRef,
14 | React.ComponentPropsWithoutRef
15 | >(({ className, align = "center", sideOffset = 4, ...props }, ref) => (
16 |
17 |
27 |
28 | ))
29 | PopoverContent.displayName = PopoverPrimitive.Content.displayName
30 |
31 | export { Popover, PopoverTrigger, PopoverContent }
32 |
--------------------------------------------------------------------------------
/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/sonner.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import { useTheme } from "next-themes"
4 | import { Toaster as Sonner } from "sonner"
5 |
6 | type ToasterProps = React.ComponentProps
7 |
8 | const Toaster = ({ ...props }: ToasterProps) => {
9 | const { theme = "system" } = useTheme()
10 |
11 | return (
12 |
28 | )
29 | }
30 |
31 | export { Toaster }
32 |
--------------------------------------------------------------------------------
/apps/www/registry/default/ui/switch.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import * as React from "react"
4 | import * as SwitchPrimitives from "@radix-ui/react-switch"
5 |
6 | import { cn } from "@/lib/utils"
7 |
8 | const Switch = React.forwardRef<
9 | React.ElementRef,
10 | React.ComponentPropsWithoutRef
11 | >(({ className, ...props }, ref) => (
12 |
20 |
25 |
26 | ))
27 | Switch.displayName = SwitchPrimitives.Root.displayName
28 |
29 | export { Switch }
30 |
--------------------------------------------------------------------------------
/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/default/ui/tooltip.tsx:
--------------------------------------------------------------------------------
1 | "use client"
2 |
3 | import * as React from "react"
4 | import * as TooltipPrimitive from "@radix-ui/react-tooltip"
5 |
6 | import { cn } from "@/lib/utils"
7 |
8 | const TooltipProvider = TooltipPrimitive.Provider
9 |
10 | const Tooltip = TooltipPrimitive.Root
11 |
12 | const TooltipTrigger = TooltipPrimitive.Trigger
13 |
14 | const TooltipContent = React.forwardRef<
15 | React.ElementRef,
16 | React.ComponentPropsWithoutRef
17 | >(({ className, sideOffset = 4, ...props }, ref) => (
18 |
27 | ))
28 | TooltipContent.displayName = TooltipPrimitive.Content.displayName
29 |
30 | export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }
31 |
--------------------------------------------------------------------------------
/apps/www/registry/schema.ts:
--------------------------------------------------------------------------------
1 | import { 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 | devDependencies: z.array(z.string()).optional(),
8 | registryDependencies: z.array(z.string()).optional(),
9 | files: z.array(z.string()),
10 | type: z.enum([
11 | "components:ui",
12 | "components:component",
13 | "components:example",
14 | ]),
15 | })
16 | )
17 |
18 | export type Registry = z.infer
19 |
--------------------------------------------------------------------------------
/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 | __bunCommand__?: string
31 | }
32 |
--------------------------------------------------------------------------------
/packages/cli/.env:
--------------------------------------------------------------------------------
1 | COMPONENTS_REGISTRY_URL=http://localhost:3001
2 |
--------------------------------------------------------------------------------
/packages/cli/.gitignore:
--------------------------------------------------------------------------------
1 | components
2 | dist
3 | .turbo
--------------------------------------------------------------------------------
/packages/cli/.prettierignore:
--------------------------------------------------------------------------------
1 | test
--------------------------------------------------------------------------------
/packages/cli/README.md:
--------------------------------------------------------------------------------
1 | # code100x-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 code100x-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 code100x-ui add [component]
23 | ```
24 |
25 | ### Example
26 |
27 | ```bash
28 | npx code100x-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 code100x-ui add
35 | ```
36 |
37 | ## Documentation
38 |
39 | Visit https://ui.code100x.com/docs/cli to view the documentation.
40 |
41 | ## License
42 |
43 | Licensed under the [MIT license](https://github.com/code100x/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("code100x-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/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/registry/schema.ts:
--------------------------------------------------------------------------------
1 | import { z } from "zod"
2 |
3 | // TODO: Extract this to a shared package.
4 | export const registryItemSchema = z.object({
5 | name: z.string(),
6 | dependencies: z.array(z.string()).optional(),
7 | devDependencies: z.array(z.string()).optional(),
8 | registryDependencies: z.array(z.string()).optional(),
9 | files: z.array(z.string()),
10 | type: z.enum(["components:ui", "components:component", "components:example"]),
11 | })
12 |
13 | export const registryIndexSchema = z.array(registryItemSchema)
14 |
15 | export const registryItemWithContentSchema = registryItemSchema.extend({
16 | files: z.array(
17 | z.object({
18 | name: z.string(),
19 | content: z.string(),
20 | })
21 | ),
22 | })
23 |
24 | export const registryWithContentSchema = z.array(registryItemWithContentSchema)
25 |
26 | export const stylesSchema = z.array(
27 | z.object({
28 | name: z.string(),
29 | label: z.string(),
30 | })
31 | )
32 |
33 | export const registryBaseColorSchema = z.object({
34 | inlineColors: z.object({
35 | light: z.record(z.string(), z.string()),
36 | dark: z.record(z.string(), z.string()),
37 | }),
38 | cssVars: z.object({
39 | light: z.record(z.string(), z.string()),
40 | dark: z.record(z.string(), z.string()),
41 | }),
42 | inlineColorsTemplate: z.string(),
43 | cssVarsTemplate: z.string(),
44 | })
45 |
--------------------------------------------------------------------------------
/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 | if (config.aliases.ui) {
12 | importDeclaration.setModuleSpecifier(
13 | moduleSpecifier.replace(/^@\/registry\/[^/]+\/ui/, config.aliases.ui)
14 | )
15 | } else {
16 | importDeclaration.setModuleSpecifier(
17 | moduleSpecifier.replace(
18 | /^@\/registry\/[^/]+/,
19 | config.aliases.components
20 | )
21 | )
22 | }
23 | }
24 |
25 | // Replace `import { cn } from "@/lib/utils"`
26 | if (moduleSpecifier == "@/lib/utils") {
27 | const namedImports = importDeclaration.getNamedImports()
28 | const cnImport = namedImports.find((i) => i.getName() === "cn")
29 | if (cnImport) {
30 | importDeclaration.setModuleSpecifier(
31 | moduleSpecifier.replace(/^@\/lib\/utils/, config.aliases.utils)
32 | )
33 | }
34 | }
35 | }
36 |
37 | return sourceFile
38 | }
39 |
--------------------------------------------------------------------------------
/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 | "prefix": "tw-"
9 | },
10 | "rsc": false,
11 | "aliases": {
12 | "utils": "~/lib/utils",
13 | "components": "~/components"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/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": "code100x",
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": "code100x",
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": "code100x",
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": "code100x",
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": "code100x",
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/config-ui/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 | "prefix": "tw-"
9 | },
10 | "rsc": false,
11 | "aliases": {
12 | "utils": "~/lib/utils",
13 | "components": "~/components",
14 | "ui": "~/ui"
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/config-ui/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "test-cli-config-ui",
3 | "version": "1.0.0",
4 | "main": "index.js",
5 | "author": "code100x",
6 | "license": "MIT"
7 | }
8 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/config-ui/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/next-app-js/app/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code100x/web3-frontends/f396856a1637e9ff0444fa5fc3aa03c7126a8070/packages/cli/test/fixtures/next-app-js/app/favicon.ico
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next-app-js/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-app-js/app/layout.js:
--------------------------------------------------------------------------------
1 | import { Inter } from 'next/font/google'
2 | import './globals.css'
3 |
4 | const inter = Inter({ subsets: ['latin'] })
5 |
6 | export const metadata = {
7 | title: 'Create Next App',
8 | description: 'Generated by create next app',
9 | }
10 |
11 | export default function RootLayout({ children }) {
12 | return (
13 |
14 | {children}
15 |
16 | )
17 | }
18 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next-app-js/jsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "paths": {
4 | "@/*": ["./*"]
5 | }
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next-app-js/next.config.js:
--------------------------------------------------------------------------------
1 | /** @type {import('next').NextConfig} */
2 | const nextConfig = {}
3 |
4 | module.exports = nextConfig
5 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next-app-js/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "app-js",
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 | "react": "^18",
13 | "react-dom": "^18",
14 | "next": "14.0.4"
15 | },
16 | "devDependencies": {
17 | "autoprefixer": "^10.0.1",
18 | "postcss": "^8",
19 | "tailwindcss": "^3.3.0",
20 | "eslint": "^8",
21 | "eslint-config-next": "14.0.4"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next-app-js/postcss.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | plugins: {
3 | tailwindcss: {},
4 | autoprefixer: {},
5 | },
6 | }
7 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next-app-js/tailwind.config.js:
--------------------------------------------------------------------------------
1 | /** @type {import('tailwindcss').Config} */
2 | module.exports = {
3 | content: [
4 | './pages/**/*.{js,ts,jsx,tsx,mdx}',
5 | './components/**/*.{js,ts,jsx,tsx,mdx}',
6 | './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-app-src/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 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next-app-src/next.config.js:
--------------------------------------------------------------------------------
1 | /** @type {import('next').NextConfig} */
2 | const nextConfig = {}
3 |
4 | module.exports = nextConfig
5 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next-app-src/other.css:
--------------------------------------------------------------------------------
1 | body {
2 | background-color: red;
3 | }
4 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next-app-src/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "test-cli-next-app-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-app-src/postcss.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | plugins: {
3 | tailwindcss: {},
4 | autoprefixer: {},
5 | },
6 | }
7 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next-app-src/src/app/layout.tsx:
--------------------------------------------------------------------------------
1 | import "./styles.css"
2 |
3 | export default function RootLayout({
4 | children,
5 | }: {
6 | children: React.ReactNode
7 | }) {
8 | return (
9 |
10 | {children}
11 |
12 | )
13 | }
14 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next-app-src/src/app/other.css:
--------------------------------------------------------------------------------
1 | body {
2 | background-color: red;
3 | }
4 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next-app-src/src/app/styles.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-app-src/src/other.css:
--------------------------------------------------------------------------------
1 | body {
2 | background-color: red;
3 | }
4 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next-app-src/tailwind.config.ts:
--------------------------------------------------------------------------------
1 | // @ts-nocheck
2 | import type { Config } from 'tailwindcss'
3 |
4 | const config: Config = {
5 | content: [
6 | './src/pages/**/*.{js,ts,jsx,tsx,mdx}',
7 | './src/components/**/*.{js,ts,jsx,tsx,mdx}',
8 | './src/app/**/*.{js,ts,jsx,tsx,mdx}'
9 | ],
10 | theme: {
11 | extend: {
12 | backgroundImage: {
13 | 'gradient-radial': 'radial-gradient(var(--tw-gradient-stops))',
14 | 'gradient-conic':
15 | 'conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))'
16 | }
17 | }
18 | },
19 | plugins: []
20 | }
21 | export default config
22 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next-app-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 | "noEmit": true,
9 | "esModuleInterop": true,
10 | "module": "esnext",
11 | "moduleResolution": "bundler",
12 | "resolveJsonModule": true,
13 | "isolatedModules": true,
14 | "jsx": "preserve",
15 | "incremental": true,
16 | "plugins": [
17 | {
18 | "name": "next"
19 | }
20 | ],
21 | "paths": {
22 | "#/*": ["./src/*"]
23 | }
24 | },
25 | "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
26 | "exclude": ["node_modules"]
27 | }
28 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next-app/app/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/code100x/web3-frontends/f396856a1637e9ff0444fa5fc3aa03c7126a8070/packages/cli/test/fixtures/next-app/app/favicon.ico
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next-app/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-app/app/layout.tsx:
--------------------------------------------------------------------------------
1 | import './globals.css'
2 | import type { Metadata } from 'next'
3 | import { Inter } from 'next/font/google'
4 |
5 | const inter = Inter({ subsets: ['latin'] })
6 |
7 | export const metadata: Metadata = {
8 | title: 'Create Next App',
9 | description: 'Generated by create next app',
10 | }
11 |
12 | export default function RootLayout({
13 | children,
14 | }: {
15 | children: React.ReactNode
16 | }) {
17 | return (
18 |
19 | {children}
20 |
21 | )
22 | }
23 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next-app/app/other.css:
--------------------------------------------------------------------------------
1 | body {
2 | background-color: red;
3 | }
4 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next-app/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 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next-app/next.config.js:
--------------------------------------------------------------------------------
1 | /** @type {import('next').NextConfig} */
2 | const nextConfig = {}
3 |
4 | module.exports = nextConfig
5 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next-app/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "test-cli-next-app",
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-app/postcss.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | plugins: {
3 | tailwindcss: {},
4 | autoprefixer: {},
5 | },
6 | }
7 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next-app/tailwind.config.ts:
--------------------------------------------------------------------------------
1 | // @ts-nocheck
2 | import type { Config } from 'tailwindcss'
3 |
4 | const config: Config = {
5 | content: [
6 | './pages/**/*.{js,ts,jsx,tsx,mdx}',
7 | './components/**/*.{js,ts,jsx,tsx,mdx}',
8 | './app/**/*.{js,ts,jsx,tsx,mdx}'
9 | ],
10 | theme: {
11 | extend: {
12 | backgroundImage: {
13 | 'gradient-radial': 'radial-gradient(var(--tw-gradient-stops))',
14 | 'gradient-conic':
15 | 'conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))'
16 | }
17 | }
18 | },
19 | plugins: []
20 | }
21 | export default config
22 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next-app/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es5",
4 | "lib": ["dom", "dom.iterable", "esnext"],
5 | "allowJs": true,
6 | "skipLibCheck": true,
7 | "strict": true,
8 | "noEmit": true,
9 | "esModuleInterop": true,
10 | "module": "esnext",
11 | "moduleResolution": "bundler",
12 | "resolveJsonModule": true,
13 | "isolatedModules": true,
14 | "jsx": "preserve",
15 | "incremental": true,
16 | "plugins": [
17 | {
18 | "name": "next"
19 | }
20 | ],
21 | "paths": {
22 | "@/*": ["./*"]
23 | }
24 | },
25 | "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
26 | "exclude": ["node_modules"]
27 | }
28 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next-pages-src/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 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next-pages-src/next.config.js:
--------------------------------------------------------------------------------
1 | /** @type {import('next').NextConfig} */
2 | const nextConfig = {
3 | reactStrictMode: true,
4 | }
5 |
6 | module.exports = nextConfig
7 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next-pages-src/other.css:
--------------------------------------------------------------------------------
1 | body {
2 | background-color: red;
3 | }
4 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next-pages-src/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "test-pages-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-pages-src/postcss.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | plugins: {
3 | tailwindcss: {},
4 | autoprefixer: {},
5 | },
6 | }
7 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next-pages-src/src/other.css:
--------------------------------------------------------------------------------
1 | body {
2 | background-color: red;
3 | }
4 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next-pages-src/src/pages/_app.tsx:
--------------------------------------------------------------------------------
1 | import '@/styles/globals.css'
2 | import type { AppProps } from 'next/app'
3 |
4 | export default function App({ Component, pageProps }: AppProps) {
5 | return
6 | }
7 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next-pages-src/src/pages/_document.tsx:
--------------------------------------------------------------------------------
1 | import { Html, Head, Main, NextScript } from 'next/document'
2 |
3 | export default function Document() {
4 | return (
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | )
13 | }
14 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next-pages-src/src/pages/api/hello.ts:
--------------------------------------------------------------------------------
1 | // Next.js API route support: https://nextjs.org/docs/api-routes/introduction
2 | import type { NextApiRequest, NextApiResponse } from 'next'
3 |
4 | type Data = {
5 | name: string
6 | }
7 |
8 | export default function handler(
9 | req: NextApiRequest,
10 | res: NextApiResponse
11 | ) {
12 | res.status(200).json({ name: 'John Doe' })
13 | }
14 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next-pages-src/src/pages/other.css:
--------------------------------------------------------------------------------
1 | body {
2 | background-color: red;
3 | }
4 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next-pages-src/src/styles/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-pages-src/src/styles/other.css:
--------------------------------------------------------------------------------
1 | body {
2 | background-color: red;
3 | }
4 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next-pages-src/tailwind.config.ts:
--------------------------------------------------------------------------------
1 | // @ts-nocheck
2 | import type { Config } from 'tailwindcss'
3 |
4 | const config: Config = {
5 | content: [
6 | './src/pages/**/*.{js,ts,jsx,tsx,mdx}',
7 | './src/components/**/*.{js,ts,jsx,tsx,mdx}',
8 | './src/app/**/*.{js,ts,jsx,tsx,mdx}'
9 | ],
10 | theme: {
11 | extend: {
12 | backgroundImage: {
13 | 'gradient-radial': 'radial-gradient(var(--tw-gradient-stops))',
14 | 'gradient-conic':
15 | 'conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))'
16 | }
17 | }
18 | },
19 | plugins: []
20 | }
21 | export default config
22 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next-pages-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 | "noEmit": true,
9 | "esModuleInterop": true,
10 | "module": "esnext",
11 | "moduleResolution": "bundler",
12 | "resolveJsonModule": true,
13 | "isolatedModules": true,
14 | "jsx": "preserve",
15 | "incremental": true,
16 | "paths": {
17 | "@/*": ["./src/*"]
18 | }
19 | },
20 | "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
21 | "exclude": ["node_modules"]
22 | }
23 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next-pages/next.config.js:
--------------------------------------------------------------------------------
1 | /** @type {import('next').NextConfig} */
2 | const nextConfig = {
3 | reactStrictMode: true,
4 | }
5 |
6 | module.exports = nextConfig
7 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next-pages/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "test-cli-pages",
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-pages/pages/_app.tsx:
--------------------------------------------------------------------------------
1 | import '~/styles/globals.css'
2 | import type { AppProps } from 'next/app'
3 |
4 | export default function App({ Component, pageProps }: AppProps) {
5 | return
6 | }
7 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next-pages/pages/_document.tsx:
--------------------------------------------------------------------------------
1 | import { Html, Head, Main, NextScript } from 'next/document'
2 |
3 | export default function Document() {
4 | return (
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | )
13 | }
14 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next-pages/pages/api/hello.ts:
--------------------------------------------------------------------------------
1 | // Next.js API route support: https://nextjs.org/docs/api-routes/introduction
2 | import type { NextApiRequest, NextApiResponse } from 'next'
3 |
4 | type Data = {
5 | name: string
6 | }
7 |
8 | export default function handler(
9 | req: NextApiRequest,
10 | res: NextApiResponse
11 | ) {
12 | res.status(200).json({ name: 'John Doe' })
13 | }
14 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next-pages/pages/other.css:
--------------------------------------------------------------------------------
1 | body {
2 | background-color: red;
3 | }
4 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next-pages/postcss.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | plugins: {
3 | tailwindcss: {},
4 | autoprefixer: {},
5 | },
6 | }
7 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next-pages/styles/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-pages/styles/other.css:
--------------------------------------------------------------------------------
1 | body {
2 | background-color: red;
3 | }
4 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next-pages/tailwind.config.ts:
--------------------------------------------------------------------------------
1 | // @ts-nocheck
2 | import type { Config } from 'tailwindcss'
3 |
4 | const config: Config = {
5 | content: [
6 | './pages/**/*.{js,ts,jsx,tsx,mdx}',
7 | './components/**/*.{js,ts,jsx,tsx,mdx}',
8 | './app/**/*.{js,ts,jsx,tsx,mdx}'
9 | ],
10 | theme: {
11 | extend: {
12 | backgroundImage: {
13 | 'gradient-radial': 'radial-gradient(var(--tw-gradient-stops))',
14 | 'gradient-conic':
15 | 'conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))'
16 | }
17 | }
18 | },
19 | plugins: []
20 | }
21 | export default config
22 |
--------------------------------------------------------------------------------
/packages/cli/test/fixtures/next-pages/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es5",
4 | "lib": ["dom", "dom.iterable", "esnext"],
5 | "allowJs": true,
6 | "skipLibCheck": true,
7 | "strict": true,
8 | "noEmit": true,
9 | "esModuleInterop": true,
10 | "module": "esnext",
11 | "moduleResolution": "bundler",
12 | "resolveJsonModule": true,
13 | "isolatedModules": true,
14 | "jsx": "preserve",
15 | "incremental": true,
16 | "paths": {
17 | "~/*": ["./*"]
18 | }
19 | },
20 | "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
21 | "exclude": ["node_modules"]
22 | }
23 |
--------------------------------------------------------------------------------
/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/code100x/web3-frontends/f396856a1637e9ff0444fa5fc3aa03c7126a8070/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": "code100x",
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": "code100x",
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": "code100x",
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": "code100x",
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/env.mjs:
--------------------------------------------------------------------------------
1 | import { createEnv } from "@t3-oss/env-nextjs";
2 | import { z } from "zod";
3 |
4 | export const env = createEnv({
5 | /**
6 | * Specify your server-side environment variables schema here. This way you can ensure the app
7 | * isn't built with invalid env vars.
8 | */
9 | server: {
10 | NODE_ENV: z.enum(["development", "test", "production"]),
11 | },
12 |
13 | /**
14 | * Specify your client-side environment variables schema here. This way you can ensure the app
15 | * isn't built with invalid env vars. To expose them to the client, prefix them with
16 | * `NEXT_PUBLIC_`.
17 | */
18 | client: {
19 | // NEXT_PUBLIC_CLIENTVAR: z.string().min(1),
20 | },
21 |
22 | /**
23 | * You can't destruct `process.env` as a regular object in the Next.js edge runtimes (e.g.
24 | * middlewares) or client-side so we need to destruct manually.
25 | */
26 | runtimeEnv: {
27 | NODE_ENV: process.env.NODE_ENV,
28 | // NEXT_PUBLIC_CLIENTVAR: process.env.NEXT_PUBLIC_CLIENTVAR,
29 | },
30 | /**
31 | * Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation.
32 | * This is especially useful for Docker builds.
33 | */
34 | skipValidation: !!process.env.SKIP_ENV_VALIDATION,
35 | });
36 |
--------------------------------------------------------------------------------
/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 |
27 | exports[`transform css vars 4`] = `
28 | "import * as React from \\"react\\"
29 | export function Foo() {
30 | return foo
31 | }\\"\\"
32 | "
33 | `;
34 |
--------------------------------------------------------------------------------
/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-item-target-path.test.ts:
--------------------------------------------------------------------------------
1 | import path from "path"
2 | import { expect, test } from "vitest"
3 |
4 | import { getConfig } from "../../src/utils/get-config"
5 | import { getItemTargetPath } from "../../src/utils/registry"
6 |
7 | test("get item target path", async () => {
8 | // Full config.
9 | let appDir = path.resolve(__dirname, "../fixtures/config-full")
10 | expect(
11 | await getItemTargetPath(await getConfig(appDir), {
12 | type: "components:ui",
13 | })
14 | ).toEqual(path.resolve(appDir, "./src/components/ui"))
15 |
16 | // Partial config.
17 | appDir = path.resolve(__dirname, "../fixtures/config-partial")
18 | expect(
19 | await getItemTargetPath(await getConfig(appDir), {
20 | type: "components:ui",
21 | })
22 | ).toEqual(path.resolve(appDir, "./components/ui"))
23 |
24 | // JSX.
25 | appDir = path.resolve(__dirname, "../fixtures/config-jsx")
26 | expect(
27 | await getItemTargetPath(await getConfig(appDir), {
28 | type: "components:ui",
29 | })
30 | ).toEqual(path.resolve(appDir, "./components/ui"))
31 |
32 | // Custom paths.
33 | appDir = path.resolve(__dirname, "../fixtures/config-ui")
34 | expect(
35 | await getItemTargetPath(await getConfig(appDir), {
36 | type: "components:ui",
37 | })
38 | ).toEqual(path.resolve(appDir, "./src/ui"))
39 | })
40 |
--------------------------------------------------------------------------------
/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/test/utils/get-project-type.test.ts:
--------------------------------------------------------------------------------
1 | import path from "path"
2 | import { describe, expect, test } from "vitest"
3 |
4 | import { getProjectType } from "../../src/utils/get-project-info"
5 |
6 | describe("get project type", async () => {
7 | test.each([
8 | {
9 | name: "next-app",
10 | type: "next-app",
11 | },
12 | {
13 | name: "next-app-src",
14 | type: "next-app-src",
15 | },
16 | {
17 | name: "next-pages",
18 | type: "next-pages",
19 | },
20 | {
21 | name: "next-pages-src",
22 | type: "next-pages-src",
23 | },
24 | {
25 | name: "project",
26 | type: null,
27 | },
28 | {
29 | name: "t3-app",
30 | type: "next-pages-src",
31 | },
32 | ])(`getProjectType($name) -> $type`, async ({ name, type }) => {
33 | expect(
34 | await getProjectType(path.resolve(__dirname, `../fixtures/${name}`))
35 | ).toBe(type)
36 | })
37 | })
38 |
--------------------------------------------------------------------------------
/packages/cli/test/utils/get-tailwind-css-file.test.ts:
--------------------------------------------------------------------------------
1 | import path from "path"
2 | import { describe, expect, test } from "vitest"
3 |
4 | import { getTailwindCssFile } from "../../src/utils/get-project-info"
5 |
6 | describe("get tailwind css file", async () => {
7 | test.each([
8 | {
9 | name: "next-app",
10 | file: "app/globals.css",
11 | },
12 | {
13 | name: "next-app-src",
14 | file: "src/app/styles.css",
15 | },
16 | {
17 | name: "next-pages",
18 | file: "styles/globals.css",
19 | },
20 | {
21 | name: "next-pages-src",
22 | file: "src/styles/globals.css",
23 | },
24 | {
25 | name: "t3-app",
26 | file: "src/styles/globals.css",
27 | },
28 | ])(`getTailwindCssFile($name) -> $file`, async ({ name, file }) => {
29 | expect(
30 | await getTailwindCssFile(path.resolve(__dirname, `../fixtures/${name}`))
31 | ).toBe(file)
32 | })
33 | })
34 |
--------------------------------------------------------------------------------
/packages/cli/test/utils/get-ts-config-alias-prefix.test.ts:
--------------------------------------------------------------------------------
1 | import path from "path"
2 | import { describe, expect, test } from "vitest"
3 |
4 | import { getTsConfigAliasPrefix } from "../../src/utils/get-project-info"
5 |
6 | describe("get ts config alias prefix", async () => {
7 | test.each([
8 | {
9 | name: "next-app",
10 | prefix: "@",
11 | },
12 | {
13 | name: "next-app-src",
14 | prefix: "#",
15 | },
16 | {
17 | name: "next-pages",
18 | prefix: "~",
19 | },
20 | {
21 | name: "next-pages-src",
22 | prefix: "@",
23 | },
24 | {
25 | name: "t3-app",
26 | prefix: "~",
27 | },
28 | ])(`getTsConfigAliasPrefix($name) -> $prefix`, async ({ name, prefix }) => {
29 | expect(
30 | await getTsConfigAliasPrefix(
31 | path.resolve(__dirname, `../fixtures/${name}`)
32 | )
33 | ).toBe(prefix)
34 | })
35 | })
36 |
--------------------------------------------------------------------------------
/packages/cli/test/utils/is-typescript-project.test.ts:
--------------------------------------------------------------------------------
1 | import path from "path"
2 | import { describe, expect, test } from "vitest"
3 |
4 | import { isTypeScriptProject } from "../../src/utils/get-project-info"
5 |
6 | describe("is TypeScript project", async () => {
7 | test.each([
8 | {
9 | name: "next-app",
10 | result: true,
11 | },
12 | {
13 | name: "next-app-src",
14 | result: true,
15 | },
16 | {
17 | name: "next-pages",
18 | result: true,
19 | },
20 | {
21 | name: "next-pages-src",
22 | result: true,
23 | },
24 | {
25 | name: "t3-app",
26 | result: true,
27 | },
28 | {
29 | name: "next-app-js",
30 | result: false,
31 | },
32 | ])(`isTypeScriptProject($name) -> $result`, async ({ name, result }) => {
33 | expect(
34 | await isTypeScriptProject(path.resolve(__dirname, `../fixtures/${name}`))
35 | ).toBe(result)
36 | })
37 | })
38 |
--------------------------------------------------------------------------------
/packages/cli/test/utils/transform-rsc.test.ts:
--------------------------------------------------------------------------------
1 | import { expect, test } from "vitest"
2 |
3 | import { transform } from "../../src/utils/transformers"
4 |
5 | test("transform rsc", async () => {
6 | expect(
7 | await transform({
8 | filename: "test.ts",
9 | raw: `import * as React from "react"
10 | import { Foo } from "bar"
11 | `,
12 | config: {
13 | tsx: true,
14 | rsc: true,
15 | },
16 | })
17 | ).toMatchSnapshot()
18 |
19 | expect(
20 | await transform({
21 | filename: "test.ts",
22 | raw: `"use client"
23 |
24 | import * as React from "react"
25 | import { Foo } from "bar"
26 | `,
27 | config: {
28 | tsx: true,
29 | rsc: true,
30 | },
31 | })
32 | ).toMatchSnapshot()
33 |
34 | expect(
35 | await transform({
36 | filename: "test.ts",
37 | raw: `"use client"
38 |
39 | import * as React from "react"
40 | import { Foo } from "bar"
41 | `,
42 | config: {
43 | tsx: true,
44 | rsc: false,
45 | },
46 | })
47 | ).toMatchSnapshot()
48 |
49 | expect(
50 | await transform({
51 | filename: "test.ts",
52 | raw: `"use foo"
53 |
54 | import * as React from "react"
55 | import { Foo } from "bar"
56 |
57 | "use client"
58 | `,
59 | config: {
60 | tsx: true,
61 | rsc: false,
62 | },
63 | })
64 | ).toMatchSnapshot()
65 | })
66 |
--------------------------------------------------------------------------------
/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 | minify: true,
10 | target: "esnext",
11 | outDir: "dist",
12 | })
13 |
--------------------------------------------------------------------------------
/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:code100x/${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/code100x/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/code100x/ui/blob/main/LICENSE.md).
23 |
--------------------------------------------------------------------------------
/templates/next-template/app/page.tsx:
--------------------------------------------------------------------------------
1 | import Link from "next/link"
2 |
3 | import { siteConfig } from "@/config/site"
4 | import { buttonVariants } from "@/components/ui/button"
5 |
6 | export default function IndexPage() {
7 | return (
8 |
9 |
10 |
11 | Beautifully designed components
12 | built with Radix UI and Tailwind CSS.
13 |
14 |
15 | Accessible and customizable components that you can copy and paste
16 | into your apps. Free. Open Source. And Next.js 13 Ready.
17 |
18 |
19 |
20 |
26 | Documentation
27 |
28 |
34 | GitHub
35 |
36 |
37 |
38 | )
39 | }
40 |
--------------------------------------------------------------------------------
/templates/next-template/components.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://ui.code100x.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/main-nav.tsx:
--------------------------------------------------------------------------------
1 | import * as React from "react"
2 | import Link from "next/link"
3 |
4 | import { NavItem } from "@/types/nav"
5 | import { siteConfig } from "@/config/site"
6 | import { cn } from "@/lib/utils"
7 | import { Icons } from "@/components/icons"
8 |
9 | interface MainNavProps {
10 | items?: NavItem[]
11 | }
12 |
13 | export function MainNav({ items }: MainNavProps) {
14 | return (
15 |
16 |
17 |
18 | {siteConfig.name}
19 |
20 | {items?.length ? (
21 |
38 | ) : null}
39 |
40 | )
41 | }
42 |
--------------------------------------------------------------------------------
/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 that you can copy and paste into your apps. Accessible. Customizable. Open Source.",
7 | mainNav: [
8 | {
9 | title: "Home",
10 | href: "/",
11 | },
12 | ],
13 | links: {
14 | twitter: "https://twitter.com/code100x",
15 | github: "https://github.com/code100x/ui",
16 | docs: "https://ui.code100x.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 | }
5 |
6 | export default nextConfig
7 |
--------------------------------------------------------------------------------
/templates/next-template/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "next-template",
3 | "version": "0.0.2",
4 | "private": true,
5 | "scripts": {
6 | "dev": "next dev",
7 | "build": "next build",
8 | "start": "next start",
9 | "lint": "next lint",
10 | "lint:fix": "next lint --fix",
11 | "preview": "next build && next start",
12 | "typecheck": "tsc --noEmit",
13 | "format:write": "prettier --write \"**/*.{ts,tsx,mdx}\" --cache",
14 | "format:check": "prettier --check \"**/*.{ts,tsx,mdx}\" --cache"
15 | },
16 | "dependencies": {
17 | "@radix-ui/react-slot": "^1.0.2",
18 | "class-variance-authority": "^0.4.0",
19 | "clsx": "^1.2.1",
20 | "lucide-react": "0.105.0-alpha.4",
21 | "next": "^13.4.8",
22 | "next-themes": "^0.2.1",
23 | "react": "^18.2.0",
24 | "react-dom": "^18.2.0",
25 | "sharp": "^0.31.3",
26 | "tailwind-merge": "^1.13.2",
27 | "tailwindcss-animate": "^1.0.6"
28 | },
29 | "devDependencies": {
30 | "@ianvs/prettier-plugin-sort-imports": "^3.7.2",
31 | "@types/node": "^17.0.45",
32 | "@types/react": "^18.2.14",
33 | "@types/react-dom": "^18.2.6",
34 | "@typescript-eslint/parser": "^5.61.0",
35 | "autoprefixer": "^10.4.14",
36 | "eslint": "^8.44.0",
37 | "eslint-config-next": "13.0.0",
38 | "eslint-config-prettier": "^8.8.0",
39 | "eslint-plugin-react": "^7.32.2",
40 | "eslint-plugin-tailwindcss": "^3.13.0",
41 | "postcss": "^8.4.24",
42 | "prettier": "^2.8.8",
43 | "tailwindcss": "^3.3.2",
44 | "typescript": "^4.9.5"
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/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/code100x/web3-frontends/f396856a1637e9ff0444fa5fc3aa03c7126a8070/templates/next-template/public/favicon.ico
--------------------------------------------------------------------------------
/templates/next-template/public/next.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/turbo.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://turbo.build/schema.json",
3 | "globalEnv": ["NODE_ENV"],
4 | "pipeline": {
5 | "build": {
6 | "dependsOn": ["^build"],
7 | "env": [
8 | "NEXT_PUBLIC_APP_URL",
9 | "NEXT_PUBLIC_NFTSCAN_KEY",
10 | "UPSTASH_REDIS_REST_URL",
11 | "UPSTASH_REDIS_REST_TOKEN",
12 | "COMPONENTS_REGISTRY_URL",
13 | "npm_config_user_agent",
14 | "https_proxy"
15 | ],
16 | "outputs": ["dist/**", ".next/**"]
17 | },
18 | "preview": {
19 | "env": ["NEXT_PUBLIC_APP_URL"],
20 | "outputs": ["dist/**", ".next/**"]
21 | },
22 | "start": {
23 | "dependsOn": ["^build"]
24 | },
25 | "lint": {
26 | "cache": false,
27 | "outputs": []
28 | },
29 | "lint:fix": {
30 | "cache": false,
31 | "outputs": []
32 | },
33 | "format:check": {
34 | "cache": false,
35 | "outputs": []
36 | },
37 | "format:write": {
38 | "cache": false,
39 | "outputs": []
40 | },
41 | "typecheck": {},
42 | "dev": {
43 | "cache": false
44 | },
45 | "check": {
46 | "cache": false
47 | },
48 | "test": {
49 | "cache": false,
50 | "outputs": []
51 | }
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------