├── .prettierignore
├── pnpm-workspace.yaml
├── .changeset
├── huge-bars-move.md
├── beige-bobcats-taste.md
├── loud-spies-move.md
├── rare-cheetahs-live.md
├── rich-fireants-hang.md
├── clean-rice-crash.md
├── tidy-ways-learn.md
├── config.json
└── README.md
├── apps
└── docs
│ ├── public
│ ├── og.png
│ ├── favicon.ico
│ ├── avatars
│ │ ├── 01.png
│ │ ├── 02.png
│ │ ├── 03.png
│ │ ├── 04.png
│ │ └── 05.png
│ ├── favicon-96x96.png
│ ├── fonts
│ │ ├── Geist.woff2
│ │ └── GeistMono.woff2
│ ├── star-history.png
│ ├── apple-touch-icon.png
│ ├── examples
│ │ ├── cards-dark.png
│ │ ├── cards-light.png
│ │ ├── dashboard-dark.png
│ │ ├── dashboard-light.png
│ │ ├── authentication-dark.png
│ │ └── authentication-light.png
│ ├── images
│ │ ├── sidebar-menu.png
│ │ ├── sidebar-menu-dark.png
│ │ ├── sidebar-structure.png
│ │ └── sidebar-structure-dark.png
│ ├── android-chrome-192x192.png
│ ├── android-chrome-512x512.png
│ ├── site.webmanifest
│ ├── registry
│ │ └── ui
│ │ │ ├── collapsible.json
│ │ │ ├── label.json
│ │ │ ├── aspect-ratio.json
│ │ │ ├── skeleton.json
│ │ │ ├── sonner.json
│ │ │ ├── separator.json
│ │ │ ├── tooltip.json
│ │ │ ├── popover.json
│ │ │ ├── progress.json
│ │ │ ├── callout.json
│ │ │ ├── badge.json
│ │ │ ├── delta-bar.json
│ │ │ ├── card.json
│ │ │ └── hover-card.json
│ ├── r
│ │ ├── collapsible.json
│ │ ├── label.json
│ │ ├── aspect-ratio.json
│ │ ├── skeleton.json
│ │ ├── sonner.json
│ │ ├── separator.json
│ │ └── tooltip.json
│ ├── schema.json
│ └── favicon.svg
│ ├── src
│ ├── entry-client.tsx
│ ├── components
│ │ ├── authentication
│ │ │ └── validations
│ │ │ │ └── auth.ts
│ │ ├── mail
│ │ │ └── use-mail.tsx
│ │ ├── dashboard
│ │ │ ├── search.tsx
│ │ │ ├── overview.tsx
│ │ │ └── main-nav.tsx
│ │ ├── component-example.tsx
│ │ ├── component-source.tsx
│ │ ├── mdx-header.tsx
│ │ ├── footer.tsx
│ │ ├── page-header.tsx
│ │ ├── mode-toggle.tsx
│ │ └── cards
│ │ │ └── index.tsx
│ ├── lib
│ │ ├── hooks
│ │ │ └── use-id.ts
│ │ ├── utils.ts
│ │ └── mdx
│ │ │ └── frontmatter.tsx
│ ├── registry
│ │ ├── index.ts
│ │ ├── example
│ │ │ ├── text-field-textarea-demo.tsx
│ │ │ ├── avatar-demo.tsx
│ │ │ ├── switch-demo.tsx
│ │ │ ├── checkbox-indeterminate-demo.tsx
│ │ │ ├── badge-demo.tsx
│ │ │ ├── text-field-demo.tsx
│ │ │ ├── alert-demo.tsx
│ │ │ ├── skeleton-demo.tsx
│ │ │ ├── delta-bar-demo.tsx
│ │ │ ├── aspect-ratio-demo.tsx
│ │ │ ├── toggle-demo.tsx
│ │ │ ├── tooltip-demo.tsx
│ │ │ ├── popover-demo.tsx
│ │ │ ├── button-demo.tsx
│ │ │ ├── radio-group-demo.tsx
│ │ │ ├── checkbox-demo.tsx
│ │ │ ├── progress-demo.tsx
│ │ │ ├── pagination-demo.tsx
│ │ │ ├── timeline-demo.tsx
│ │ │ ├── flex-demo.tsx
│ │ │ ├── pie-chart-demo.tsx
│ │ │ ├── sonner-demo.tsx
│ │ │ ├── otp-field-demo.tsx
│ │ │ ├── separator-demo.tsx
│ │ │ ├── toggle-group-demo.tsx
│ │ │ ├── bar-chart-demo.tsx
│ │ │ ├── slider-demo.tsx
│ │ │ ├── collapsible-demo.tsx
│ │ │ ├── number-field-demo.tsx
│ │ │ ├── alert-dialog-demo.tsx
│ │ │ ├── select-demo.tsx
│ │ │ ├── breadcrumb-demo.tsx
│ │ │ ├── badge-delta-demo.tsx
│ │ │ ├── carousel-demo.tsx
│ │ │ ├── carousel-spacing-demo.tsx
│ │ │ ├── accordion-demo.tsx
│ │ │ ├── text-field-error-demo.tsx
│ │ │ ├── carousel-size-demo.tsx
│ │ │ ├── area-chart-demo.tsx
│ │ │ ├── carousel-orientation-demo.tsx
│ │ │ ├── resizable-demo.tsx
│ │ │ ├── grid-demo.tsx
│ │ │ ├── hover-card-demo.tsx
│ │ │ ├── carousel-plugin-demo.tsx
│ │ │ ├── bar-list-demo.tsx
│ │ │ ├── mode-toggle.tsx
│ │ │ ├── dialog-demo.tsx
│ │ │ └── carousel-api-demo.tsx
│ │ ├── ui
│ │ │ ├── collapsible.tsx
│ │ │ ├── label.tsx
│ │ │ ├── skeleton.tsx
│ │ │ ├── aspect-ratio.tsx
│ │ │ ├── sonner.tsx
│ │ │ ├── separator.tsx
│ │ │ ├── tooltip.tsx
│ │ │ ├── progress.tsx
│ │ │ ├── popover.tsx
│ │ │ ├── callout.tsx
│ │ │ ├── badge.tsx
│ │ │ ├── hover-card.tsx
│ │ │ ├── delta-bar.tsx
│ │ │ └── card.tsx
│ │ ├── block
│ │ │ └── sidebar-01
│ │ │ │ └── components
│ │ │ │ └── search-form.tsx
│ │ ├── schema.ts
│ │ └── registry-blocks.ts
│ ├── routes
│ │ ├── (app)
│ │ │ ├── examples
│ │ │ │ ├── cards.tsx
│ │ │ │ ├── mail.tsx
│ │ │ │ ├── dashboard.tsx
│ │ │ │ ├── authentication.tsx
│ │ │ │ └── tasks
│ │ │ │ │ ├── components
│ │ │ │ │ ├── table-input-filter.tsx
│ │ │ │ │ └── table-view-options.tsx
│ │ │ │ │ └── index.tsx
│ │ │ ├── docs
│ │ │ │ ├── figma.mdx
│ │ │ │ ├── about.mdx
│ │ │ │ ├── components
│ │ │ │ │ ├── badge.mdx
│ │ │ │ │ ├── label.mdx
│ │ │ │ │ ├── delta-bar.mdx
│ │ │ │ │ ├── badge-delta.mdx
│ │ │ │ │ ├── skeleton.mdx
│ │ │ │ │ ├── aspect-ratio.mdx
│ │ │ │ │ ├── progress-circle.mdx
│ │ │ │ │ ├── bar-list.mdx
│ │ │ │ │ ├── separator.mdx
│ │ │ │ │ ├── avatar.mdx
│ │ │ │ │ ├── progress.mdx
│ │ │ │ │ ├── switch.mdx
│ │ │ │ │ ├── toggle.mdx
│ │ │ │ │ ├── card.mdx
│ │ │ │ │ ├── slider.mdx
│ │ │ │ │ ├── date-picker.mdx
│ │ │ │ │ ├── popover.mdx
│ │ │ │ │ ├── timeline.mdx
│ │ │ │ │ ├── callout.mdx
│ │ │ │ │ ├── alert.mdx
│ │ │ │ │ ├── resizable.mdx
│ │ │ │ │ ├── flex.mdx
│ │ │ │ │ ├── tooltip.mdx
│ │ │ │ │ ├── hover-card.mdx
│ │ │ │ │ ├── checkbox.mdx
│ │ │ │ │ ├── toggle-group.mdx
│ │ │ │ │ ├── text-field.mdx
│ │ │ │ │ ├── collapsible.mdx
│ │ │ │ │ ├── grid.mdx
│ │ │ │ │ ├── radio-group.mdx
│ │ │ │ │ ├── sonner.mdx
│ │ │ │ │ ├── tabs.mdx
│ │ │ │ │ ├── pagination.mdx
│ │ │ │ │ ├── number-field.mdx
│ │ │ │ │ ├── table.mdx
│ │ │ │ │ ├── navigation-menu.mdx
│ │ │ │ │ ├── dialog.mdx
│ │ │ │ │ ├── select.mdx
│ │ │ │ │ ├── context-menu.mdx
│ │ │ │ │ ├── menubar.mdx
│ │ │ │ │ └── dropdown-menu.mdx
│ │ │ │ ├── introduction.mdx
│ │ │ │ ├── cli.mdx
│ │ │ │ └── dark-mode
│ │ │ │ │ └── vite.mdx
│ │ │ ├── docs.tsx
│ │ │ └── examples.tsx
│ │ ├── (blocks)
│ │ │ └── blocks
│ │ │ │ └── [name].tsx
│ │ ├── [...404].tsx
│ │ └── (app).tsx
│ ├── styles
│ │ └── mdx.css
│ ├── entry-server.tsx
│ ├── types
│ │ └── search.ts
│ └── app.tsx
│ ├── .gitignore
│ ├── tsconfig.json
│ └── app.config.ts
├── packages
└── cli
│ ├── tsup.config.json
│ ├── .gitignore
│ ├── src
│ ├── utils
│ │ ├── resolve-import.ts
│ │ ├── get-package-manager.ts
│ │ ├── get-package-info.ts
│ │ ├── logger.ts
│ │ └── transformers
│ │ │ ├── transform-import.ts
│ │ │ └── index.ts
│ └── index.ts
│ ├── tsconfig.json
│ └── README.md
├── turbo.json
├── .gitignore
├── tsconfig.json
├── .prettierrc.json
├── .eslintrc.json
├── README.md
├── LICENSE
├── .github
└── workflows
│ └── release.yml
└── package.json
/.prettierignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | build
3 | dist
--------------------------------------------------------------------------------
/pnpm-workspace.yaml:
--------------------------------------------------------------------------------
1 | packages:
2 | - "apps/*"
3 | - "packages/*"
--------------------------------------------------------------------------------
/.changeset/huge-bars-move.md:
--------------------------------------------------------------------------------
1 | ---
2 | "solidui-cli": patch
3 | ---
4 |
5 | feat: support deno
6 |
--------------------------------------------------------------------------------
/apps/docs/public/og.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stefan-karger/solid-ui/HEAD/apps/docs/public/og.png
--------------------------------------------------------------------------------
/.changeset/beige-bobcats-taste.md:
--------------------------------------------------------------------------------
1 | ---
2 | "docs": patch
3 | ---
4 |
5 | fix: isMobile now works correctly (#156)
6 |
--------------------------------------------------------------------------------
/.changeset/loud-spies-move.md:
--------------------------------------------------------------------------------
1 | ---
2 | "docs": patch
3 | ---
4 |
5 | fix: removed remaining ?? in favor of show
6 |
--------------------------------------------------------------------------------
/.changeset/rare-cheetahs-live.md:
--------------------------------------------------------------------------------
1 | ---
2 | "docs": patch
3 | ---
4 |
5 | feat: add label,etc.. to select exports
6 |
--------------------------------------------------------------------------------
/.changeset/rich-fireants-hang.md:
--------------------------------------------------------------------------------
1 | ---
2 | "docs": patch
3 | ---
4 |
5 | fix: remove bg blur from dialog (#160)
6 |
--------------------------------------------------------------------------------
/apps/docs/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stefan-karger/solid-ui/HEAD/apps/docs/public/favicon.ico
--------------------------------------------------------------------------------
/.changeset/clean-rice-crash.md:
--------------------------------------------------------------------------------
1 | ---
2 | "docs": patch
3 | ---
4 |
5 | fix: delta-bar indicator know matches bar color
6 |
--------------------------------------------------------------------------------
/apps/docs/public/avatars/01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stefan-karger/solid-ui/HEAD/apps/docs/public/avatars/01.png
--------------------------------------------------------------------------------
/apps/docs/public/avatars/02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stefan-karger/solid-ui/HEAD/apps/docs/public/avatars/02.png
--------------------------------------------------------------------------------
/apps/docs/public/avatars/03.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stefan-karger/solid-ui/HEAD/apps/docs/public/avatars/03.png
--------------------------------------------------------------------------------
/apps/docs/public/avatars/04.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stefan-karger/solid-ui/HEAD/apps/docs/public/avatars/04.png
--------------------------------------------------------------------------------
/apps/docs/public/avatars/05.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stefan-karger/solid-ui/HEAD/apps/docs/public/avatars/05.png
--------------------------------------------------------------------------------
/apps/docs/public/favicon-96x96.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stefan-karger/solid-ui/HEAD/apps/docs/public/favicon-96x96.png
--------------------------------------------------------------------------------
/apps/docs/public/fonts/Geist.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stefan-karger/solid-ui/HEAD/apps/docs/public/fonts/Geist.woff2
--------------------------------------------------------------------------------
/apps/docs/public/star-history.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stefan-karger/solid-ui/HEAD/apps/docs/public/star-history.png
--------------------------------------------------------------------------------
/apps/docs/public/apple-touch-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stefan-karger/solid-ui/HEAD/apps/docs/public/apple-touch-icon.png
--------------------------------------------------------------------------------
/apps/docs/public/examples/cards-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stefan-karger/solid-ui/HEAD/apps/docs/public/examples/cards-dark.png
--------------------------------------------------------------------------------
/apps/docs/public/fonts/GeistMono.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stefan-karger/solid-ui/HEAD/apps/docs/public/fonts/GeistMono.woff2
--------------------------------------------------------------------------------
/apps/docs/public/images/sidebar-menu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stefan-karger/solid-ui/HEAD/apps/docs/public/images/sidebar-menu.png
--------------------------------------------------------------------------------
/apps/docs/public/examples/cards-light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stefan-karger/solid-ui/HEAD/apps/docs/public/examples/cards-light.png
--------------------------------------------------------------------------------
/.changeset/tidy-ways-learn.md:
--------------------------------------------------------------------------------
1 | ---
2 | "solidui-cli": patch
3 | ---
4 |
5 | fix buggy rendering in component add command due to lots of items
6 |
--------------------------------------------------------------------------------
/apps/docs/public/android-chrome-192x192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stefan-karger/solid-ui/HEAD/apps/docs/public/android-chrome-192x192.png
--------------------------------------------------------------------------------
/apps/docs/public/android-chrome-512x512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stefan-karger/solid-ui/HEAD/apps/docs/public/android-chrome-512x512.png
--------------------------------------------------------------------------------
/apps/docs/public/examples/dashboard-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stefan-karger/solid-ui/HEAD/apps/docs/public/examples/dashboard-dark.png
--------------------------------------------------------------------------------
/apps/docs/public/examples/dashboard-light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stefan-karger/solid-ui/HEAD/apps/docs/public/examples/dashboard-light.png
--------------------------------------------------------------------------------
/apps/docs/public/images/sidebar-menu-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stefan-karger/solid-ui/HEAD/apps/docs/public/images/sidebar-menu-dark.png
--------------------------------------------------------------------------------
/apps/docs/public/images/sidebar-structure.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stefan-karger/solid-ui/HEAD/apps/docs/public/images/sidebar-structure.png
--------------------------------------------------------------------------------
/apps/docs/public/examples/authentication-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stefan-karger/solid-ui/HEAD/apps/docs/public/examples/authentication-dark.png
--------------------------------------------------------------------------------
/apps/docs/public/examples/authentication-light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stefan-karger/solid-ui/HEAD/apps/docs/public/examples/authentication-light.png
--------------------------------------------------------------------------------
/apps/docs/public/images/sidebar-structure-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/stefan-karger/solid-ui/HEAD/apps/docs/public/images/sidebar-structure-dark.png
--------------------------------------------------------------------------------
/apps/docs/src/entry-client.tsx:
--------------------------------------------------------------------------------
1 | // @refresh reload
2 | import { mount, StartClient } from "@solidjs/start/client"
3 |
4 | mount(() => , document.getElementById("app")!)
5 |
--------------------------------------------------------------------------------
/packages/cli/tsup.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://cdn.jsdelivr.net/npm/tsup/schema.json",
3 | "entry": ["src/index.ts"],
4 | "splitting": false,
5 | "clean": true,
6 | "format": "esm"
7 | }
8 |
--------------------------------------------------------------------------------
/turbo.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://turbo.build/schema.json",
3 | "pipeline": {
4 | "build": {
5 | "outputs": [".solid/**", "dist/**"]
6 | },
7 | "lint": {},
8 | "test": {},
9 | "dev": {}
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/apps/docs/src/components/authentication/validations/auth.ts:
--------------------------------------------------------------------------------
1 | import type { Input } from "valibot"
2 | import { email, object, string } from "valibot"
3 |
4 | export const AuthSchema = object({
5 | email: string([email()])
6 | })
7 | export type AuthForm = Input
8 |
--------------------------------------------------------------------------------
/apps/docs/src/lib/hooks/use-id.ts:
--------------------------------------------------------------------------------
1 | let uniqueId = 0
2 | const getUniqueId = () => uniqueId++
3 | const prefix = "S_"
4 |
5 | export function useId() {
6 | let ref
7 | if (ref === undefined) {
8 | ref = getUniqueId()
9 | }
10 | return `${prefix}${ref}`
11 | }
12 |
--------------------------------------------------------------------------------
/apps/docs/src/components/mail/use-mail.tsx:
--------------------------------------------------------------------------------
1 | import { createStore } from "solid-js/store"
2 |
3 | import { mails, type Mail } from "./data"
4 |
5 | type Config = {
6 | selected: Mail["id"] | null
7 | }
8 |
9 | export const [mail, setMail] = createStore({
10 | selected: mails[0].id
11 | })
12 |
--------------------------------------------------------------------------------
/apps/docs/src/registry/index.ts:
--------------------------------------------------------------------------------
1 | import { blocks } from "~/registry/registry-blocks"
2 | import { examples } from "~/registry/registry-examples"
3 | import { ui } from "~/registry/registry-ui"
4 | import type { Registry } from "~/registry/schema"
5 |
6 | export const registry: Registry = [...ui, ...examples, ...blocks]
7 |
--------------------------------------------------------------------------------
/apps/docs/src/registry/example/text-field-textarea-demo.tsx:
--------------------------------------------------------------------------------
1 | import { TextField, TextFieldTextArea } from "~/registry/ui/text-field"
2 |
3 | export default function TextareaDemo() {
4 | return (
5 |
6 |
7 |
8 | )
9 | }
10 |
--------------------------------------------------------------------------------
/apps/docs/src/registry/example/avatar-demo.tsx:
--------------------------------------------------------------------------------
1 | import { Avatar, AvatarFallback, AvatarImage } from "~/registry/ui/avatar"
2 |
3 | export default function AvatarDemo() {
4 | return (
5 |
6 |
7 | EK
8 |
9 | )
10 | }
11 |
--------------------------------------------------------------------------------
/apps/docs/src/components/dashboard/search.tsx:
--------------------------------------------------------------------------------
1 | import { TextField, TextFieldInput } from "~/registry/ui/text-field"
2 |
3 | export function Search() {
4 | return (
5 |
6 |
7 |
8 |
9 |
10 | )
11 | }
12 |
--------------------------------------------------------------------------------
/apps/docs/src/registry/ui/collapsible.tsx:
--------------------------------------------------------------------------------
1 | import * as CollapsiblePrimitive from "@kobalte/core/collapsible"
2 |
3 | const Collapsible = CollapsiblePrimitive.Root
4 |
5 | const CollapsibleTrigger = CollapsiblePrimitive.Trigger
6 |
7 | const CollapsibleContent = CollapsiblePrimitive.Content
8 |
9 | export { Collapsible, CollapsibleTrigger, CollapsibleContent }
10 |
--------------------------------------------------------------------------------
/apps/docs/src/routes/(app)/examples/cards.tsx:
--------------------------------------------------------------------------------
1 | import { Cards } from "~/components/cards"
2 | import { MetaTags } from "~/components/meta-tags"
3 |
4 | export default function CardsRoute() {
5 | return (
6 | <>
7 |
8 |
9 | >
10 | )
11 | }
12 |
--------------------------------------------------------------------------------
/apps/docs/src/routes/(app)/examples/mail.tsx:
--------------------------------------------------------------------------------
1 | import { Mail } from "~/components/mail"
2 | import { MetaTags } from "~/components/meta-tags"
3 |
4 | export default function CardsRoute() {
5 | return (
6 | <>
7 |
8 |
9 | >
10 | )
11 | }
12 |
--------------------------------------------------------------------------------
/packages/cli/.gitignore:
--------------------------------------------------------------------------------
1 | dist
2 | .solid
3 | .output
4 | .vercel
5 | .netlify
6 | netlify
7 |
8 | # Environment
9 | .env
10 | .env*.local
11 |
12 | # dependencies
13 | /node_modules
14 |
15 | # IDEs and editors
16 | /.idea
17 | .project
18 | .classpath
19 | *.launch
20 | .settings/
21 |
22 | # Temp
23 | gitignore
24 |
25 | # System Files
26 | .DS_Store
27 | Thumbs.db
28 |
--------------------------------------------------------------------------------
/.changeset/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://unpkg.com/@changesets/config@2.3.1/schema.json",
3 | "changelog": ["@changesets/changelog-github", { "repo": "stefan-karger/solid-ui" }],
4 | "commit": false,
5 | "fixed": [],
6 | "linked": [],
7 | "access": "public",
8 | "baseBranch": "main",
9 | "updateInternalDependencies": "patch",
10 | "ignore": []
11 | }
12 |
--------------------------------------------------------------------------------
/apps/docs/.gitignore:
--------------------------------------------------------------------------------
1 | dist
2 | .solid
3 | .vinxi
4 | .output
5 | .vercel
6 | .netlify
7 | netlify
8 |
9 | # Environment
10 | .env
11 | .env*.local
12 |
13 | # dependencies
14 | /node_modules
15 |
16 | # IDEs and editors
17 | /.idea
18 | .project
19 | .classpath
20 | *.launch
21 | .settings/
22 |
23 | # Temp
24 | gitignore
25 |
26 | # System Files
27 | .DS_Store
28 | Thumbs.db
29 |
--------------------------------------------------------------------------------
/apps/docs/src/routes/(app)/examples/dashboard.tsx:
--------------------------------------------------------------------------------
1 | import { Dashboard } from "~/components/dashboard"
2 | import { MetaTags } from "~/components/meta-tags"
3 |
4 | export default function DashboardRoute() {
5 | return (
6 | <>
7 |
8 |
9 | >
10 | )
11 | }
12 |
--------------------------------------------------------------------------------
/apps/docs/src/registry/example/switch-demo.tsx:
--------------------------------------------------------------------------------
1 | import { Switch, SwitchControl, SwitchLabel, SwitchThumb } from "~/registry/ui/switch"
2 |
3 | export default function SwitchDemo() {
4 | return (
5 |
6 |
7 |
8 |
9 | Airplane Mode
10 |
11 | )
12 | }
13 |
--------------------------------------------------------------------------------
/apps/docs/src/registry/example/checkbox-indeterminate-demo.tsx:
--------------------------------------------------------------------------------
1 | import { Checkbox } from "~/registry/ui/checkbox"
2 | import { Label } from "~/registry/ui/label"
3 |
4 | export default function CheckboxDemo() {
5 | return (
6 |
7 |
8 |
9 |
10 | )
11 | }
12 |
--------------------------------------------------------------------------------
/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)(importPath, undefined, () => true, [
8 | ".ts",
9 | ".tsx"
10 | ])
11 | }
12 |
--------------------------------------------------------------------------------
/apps/docs/src/registry/example/badge-demo.tsx:
--------------------------------------------------------------------------------
1 | import { Badge } from "~/registry/ui/badge"
2 |
3 | export default function BadgeDemo() {
4 | return (
5 |
6 | Badge
7 | Secondary
8 | Outline
9 | Error
10 | Round
11 |
12 | )
13 | }
14 |
--------------------------------------------------------------------------------
/apps/docs/src/registry/example/text-field-demo.tsx:
--------------------------------------------------------------------------------
1 | import { TextField, TextFieldInput, TextFieldLabel } from "~/registry/ui/text-field"
2 |
3 | export default function TextFieldDemo() {
4 | return (
5 |
6 | Email
7 |
8 |
9 | )
10 | }
11 |
--------------------------------------------------------------------------------
/apps/docs/src/registry/example/alert-demo.tsx:
--------------------------------------------------------------------------------
1 | import { IconTerminal } from "~/components/icons"
2 | import { Alert, AlertDescription, AlertTitle } from "~/registry/ui/alert"
3 |
4 | export default function AlertDemo() {
5 | return (
6 |
7 |
8 | Heads up!
9 | You can add components to your app using the cli.
10 |
11 | )
12 | }
13 |
--------------------------------------------------------------------------------
/apps/docs/src/routes/(app)/examples/authentication.tsx:
--------------------------------------------------------------------------------
1 | import { Authentication } from "~/components/authentication"
2 | import { MetaTags } from "~/components/meta-tags"
3 |
4 | export default function AuthenticationRoute() {
5 | return (
6 | <>
7 |
11 |
12 | >
13 | )
14 | }
15 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | dist
2 | .solid
3 | .output
4 | .vercel
5 | .netlify
6 | .turbo
7 | netlify
8 |
9 | # Environment
10 | .env
11 | .env*.local
12 |
13 | # dependencies
14 | /node_modules
15 |
16 | # IDEs and editors
17 | /.idea
18 | .project
19 | .classpath
20 | *.launch
21 | .settings/
22 | .vscode/
23 |
24 | # Temp
25 | gitignore
26 |
27 | # System Files
28 | .DS_Store
29 | Thumbs.db
30 |
31 |
32 | app.config.timestamp*
33 |
34 | .vscode/settings.json
35 |
36 |
--------------------------------------------------------------------------------
/apps/docs/src/routes/(blocks)/blocks/[name].tsx:
--------------------------------------------------------------------------------
1 | import { Show } from "solid-js"
2 | import { useParams } from "@solidjs/router"
3 |
4 | import { Index } from "~/__registry__"
5 |
6 | export default function Block() {
7 | const params = useParams()
8 |
9 | return (
10 |
11 | {(item) => {
12 | const Component = item().component
13 | return
14 | }}
15 |
16 | )
17 | }
18 |
--------------------------------------------------------------------------------
/apps/docs/src/registry/example/skeleton-demo.tsx:
--------------------------------------------------------------------------------
1 | import { Skeleton } from "~/registry/ui/skeleton"
2 |
3 | export default function SkeletonDemo() {
4 | return (
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | )
13 | }
14 |
--------------------------------------------------------------------------------
/apps/docs/src/registry/example/delta-bar-demo.tsx:
--------------------------------------------------------------------------------
1 | import { DeltaBar } from "~/registry/ui/delta-bar"
2 |
3 | export default function DeltaBarDemo() {
4 | return (
5 |
6 |
DeltaBar with default increase behavior
7 |
8 |
DeltaBar with increase seen as negative
9 |
10 |
11 | )
12 | }
13 |
--------------------------------------------------------------------------------
/apps/docs/src/registry/example/aspect-ratio-demo.tsx:
--------------------------------------------------------------------------------
1 | import { AspectRatio } from "~/registry/ui/aspect-ratio"
2 |
3 | export default function AspectRatioDemo() {
4 | return (
5 |
6 |
11 |
12 | )
13 | }
14 |
--------------------------------------------------------------------------------
/apps/docs/src/registry/example/toggle-demo.tsx:
--------------------------------------------------------------------------------
1 | import { Show } from "solid-js"
2 |
3 | import { IconMoon, IconSun } from "~/components/icons"
4 | import { Toggle } from "~/registry/ui/toggle"
5 |
6 | export default function ToggleDemo() {
7 | return (
8 |
9 | {(state) => (
10 | }>
11 |
12 |
13 | )}
14 |
15 | )
16 | }
17 |
--------------------------------------------------------------------------------
/packages/cli/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "exclude": ["node_modules", "dist"],
3 | "compilerOptions": {
4 | "allowSyntheticDefaultImports": true,
5 | "esModuleInterop": false,
6 | "target": "ESNext",
7 | "module": "ESNext",
8 | "moduleResolution": "bundler",
9 | "noEmit": false,
10 | "allowArbitraryExtensions": true,
11 | "strict": true,
12 | "baseUrl": "./",
13 | "outDir": "./dist",
14 | "paths": {
15 | "~/*": ["./src/*"]
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/apps/docs/src/registry/example/tooltip-demo.tsx:
--------------------------------------------------------------------------------
1 | import { Button } from "~/registry/ui/button"
2 | import { Tooltip, TooltipContent, TooltipTrigger } from "~/registry/ui/tooltip"
3 |
4 | export default function TooltipDemo() {
5 | return (
6 |
7 | } variant="outline">
8 | Trigger
9 |
10 |
11 | Tooltip content
12 |
13 |
14 | )
15 | }
16 |
--------------------------------------------------------------------------------
/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" | "deno"> {
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 |
--------------------------------------------------------------------------------
/apps/docs/src/registry/example/popover-demo.tsx:
--------------------------------------------------------------------------------
1 | import { Button } from "~/registry/ui/button"
2 | import { Popover, PopoverContent, PopoverTrigger } from "~/registry/ui/popover"
3 |
4 | export default function PopoverDemo() {
5 | return (
6 |
7 | }>trigger me
8 |
9 | A UI toolkit for building accessible web apps and design systems with SolidJS.
10 |
11 |
12 | )
13 | }
14 |
--------------------------------------------------------------------------------
/apps/docs/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ESNext",
4 | "module": "ESNext",
5 | "moduleResolution": "bundler",
6 | "allowSyntheticDefaultImports": true,
7 | "esModuleInterop": true,
8 | "jsx": "preserve",
9 | "jsxImportSource": "solid-js",
10 | "allowJs": true,
11 | "strict": true,
12 | "types": ["vinxi/client"],
13 | "isolatedModules": true,
14 | "baseUrl": "./",
15 | "paths": {
16 | "~/*": ["./src/*"]
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/.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 |
--------------------------------------------------------------------------------
/apps/docs/src/lib/utils.ts:
--------------------------------------------------------------------------------
1 | import type { ClassValue } from "clsx"
2 | import { clsx } 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 clamp(val: number, min: number, max: number) {
10 | return val > max ? max : val < min ? min : val
11 | }
12 |
13 | export function toggleValue(array: T[], value: T): T[] {
14 | return array.includes(value) ? array.filter((item) => item !== value) : [...array, value]
15 | }
16 |
--------------------------------------------------------------------------------
/apps/docs/src/registry/example/button-demo.tsx:
--------------------------------------------------------------------------------
1 | import { Button } from "~/registry/ui/button"
2 |
3 | export default function ButtonDemo() {
4 | return (
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | )
14 | }
15 |
--------------------------------------------------------------------------------
/apps/docs/public/site.webmanifest:
--------------------------------------------------------------------------------
1 | {
2 | "name": "SolidUI",
3 | "short_name": "SolidUI",
4 | "icons": [
5 | {
6 | "src": "/android-chrome-192x192.png",
7 | "sizes": "192x192",
8 | "type": "image/png",
9 | "purpose": "maskable"
10 | },
11 | {
12 | "src": "/android-chrome-512x512.png",
13 | "sizes": "512x512",
14 | "type": "image/png",
15 | "purpose": "maskable"
16 | }
17 | ],
18 | "theme_color": "#ffffff",
19 | "background_color": "#ffffff",
20 | "display": "standalone"
21 | }
--------------------------------------------------------------------------------
/apps/docs/public/registry/ui/collapsible.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "collapsible",
3 | "dependencies": [
4 | "@kobalte/core"
5 | ],
6 | "files": [
7 | {
8 | "name": "collapsible.tsx",
9 | "content": "import * as CollapsiblePrimitive from \"@kobalte/core/collapsible\"\n\nconst Collapsible = CollapsiblePrimitive.Root\n\nconst CollapsibleTrigger = CollapsiblePrimitive.Trigger\n\nconst CollapsibleContent = CollapsiblePrimitive.Content\n\nexport { Collapsible, CollapsibleTrigger, CollapsibleContent }\n"
10 | }
11 | ],
12 | "type": "ui"
13 | }
--------------------------------------------------------------------------------
/apps/docs/src/registry/example/radio-group-demo.tsx:
--------------------------------------------------------------------------------
1 | import { For } from "solid-js"
2 |
3 | import { RadioGroup, RadioGroupItem, RadioGroupItemLabel } from "~/registry/ui/radio-group"
4 |
5 | export default function RadioGroupDemo() {
6 | return (
7 |
8 |
9 | {(fruit) => (
10 |
11 | {fruit}
12 |
13 | )}
14 |
15 |
16 | )
17 | }
18 |
--------------------------------------------------------------------------------
/apps/docs/src/registry/ui/label.tsx:
--------------------------------------------------------------------------------
1 | import type { Component, ComponentProps } from "solid-js"
2 | import { splitProps } from "solid-js"
3 |
4 | import { cn } from "~/lib/utils"
5 |
6 | const Label: Component> = (props) => {
7 | const [local, others] = splitProps(props, ["class"])
8 | return (
9 |
16 | )
17 | }
18 |
19 | export { Label }
20 |
--------------------------------------------------------------------------------
/apps/docs/src/registry/example/checkbox-demo.tsx:
--------------------------------------------------------------------------------
1 | import { Checkbox } from "~/registry/ui/checkbox"
2 | import { Label } from "~/registry/ui/label"
3 |
4 | export default function CheckboxDemo() {
5 | return (
6 |
7 |
8 |
9 |
10 |
11 | You agree to our Terms of Service and Privacy Policy.
12 |
13 |
14 |
15 | )
16 | }
17 |
--------------------------------------------------------------------------------
/apps/docs/src/registry/example/progress-demo.tsx:
--------------------------------------------------------------------------------
1 | import { Progress, ProgressLabel, ProgressValueLabel } from "~/registry/ui/progress"
2 |
3 | export default function ProgressDemo() {
4 | return (
5 |
17 | )
18 | }
19 |
--------------------------------------------------------------------------------
/apps/docs/src/components/component-example.tsx:
--------------------------------------------------------------------------------
1 | import type { Component, ComponentProps } from "solid-js"
2 | import { splitProps } from "solid-js"
3 |
4 | import { cn } from "~/lib/utils"
5 |
6 | const ComponentExample: Component> = (props) => {
7 | const [, rest] = splitProps(props, ["class", "children"])
8 | return (
9 |
10 |
11 | {props.children}
12 |
13 |
14 | )
15 | }
16 |
17 | export { ComponentExample }
18 |
--------------------------------------------------------------------------------
/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": "bundler",
13 | "noUnusedLocals": false,
14 | "noUnusedParameters": false,
15 | "preserveWatchOutput": true,
16 | "skipLibCheck": true,
17 | "strict": true
18 | },
19 | "exclude": ["node_modules", "dist"]
20 | }
21 |
--------------------------------------------------------------------------------
/apps/docs/src/components/component-source.tsx:
--------------------------------------------------------------------------------
1 | import type { Component, ComponentProps } from "solid-js"
2 |
3 | import { cn } from "~/lib/utils"
4 | import { CodeBlockWrapper } from "~/components/code-block-wrapper"
5 |
6 | interface ComponentSourceProps extends ComponentProps<"div"> {
7 | src: string
8 | }
9 |
10 | const ComponentSource: Component = (props) => {
11 | return (
12 |
16 | {props.children}
17 |
18 | )
19 | }
20 |
21 | export { ComponentSource }
22 |
--------------------------------------------------------------------------------
/apps/docs/src/registry/example/pagination-demo.tsx:
--------------------------------------------------------------------------------
1 | import {
2 | Pagination,
3 | PaginationEllipsis,
4 | PaginationItem,
5 | PaginationItems,
6 | PaginationNext,
7 | PaginationPrevious
8 | } from "~/registry/ui/pagination"
9 |
10 | export default function PaginationDemo() {
11 | return (
12 | {props.page}}
16 | ellipsisComponent={() => }
17 | >
18 |
19 |
20 |
21 |
22 | )
23 | }
24 |
--------------------------------------------------------------------------------
/apps/docs/src/registry/example/timeline-demo.tsx:
--------------------------------------------------------------------------------
1 | import { Timeline } from "~/registry/ui/timeline"
2 |
3 | export default function TimelineDemo() {
4 | return (
5 |
22 | )
23 | }
24 |
--------------------------------------------------------------------------------
/apps/docs/public/registry/ui/label.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "label",
3 | "files": [
4 | {
5 | "name": "label.tsx",
6 | "content": "import type { Component, ComponentProps } from \"solid-js\"\nimport { splitProps } from \"solid-js\"\n\nimport { cn } from \"~/lib/utils\"\n\nconst Label: Component> = (props) => {\n const [local, others] = splitProps(props, [\"class\"])\n return (\n \n )\n}\n\nexport { Label }\n"
7 | }
8 | ],
9 | "type": "ui"
10 | }
--------------------------------------------------------------------------------
/apps/docs/src/routes/(app)/docs/figma.mdx:
--------------------------------------------------------------------------------
1 |
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 |
--------------------------------------------------------------------------------
/packages/cli/src/utils/get-package-info.ts:
--------------------------------------------------------------------------------
1 | import fs from "node:fs"
2 | import { dirname, resolve } from "node:path"
3 | import { fileURLToPath } from "node:url"
4 |
5 | type PackageJSON = {
6 | name: string
7 | description: string
8 | version: string
9 | }
10 |
11 | const __filename = fileURLToPath(import.meta.url)
12 | const __dirname = dirname(__filename)
13 |
14 | export function getPackageInfo() {
15 | const location = resolve(__dirname, "..", "package.json")
16 | return readJSONSync(location) as PackageJSON
17 | }
18 |
19 | function readJSONSync(path: string) {
20 | const content = fs.readFileSync(path, { encoding: "utf-8" })
21 | return JSON.parse(content)
22 | }
23 |
--------------------------------------------------------------------------------
/apps/docs/src/registry/example/flex-demo.tsx:
--------------------------------------------------------------------------------
1 | import { Card } from "~/registry/ui/card"
2 | import { Flex } from "~/registry/ui/flex"
3 |
4 | export default function FlexDemo() {
5 | return (
6 |
7 |
8 |
9 |
Tickets sold
10 |
9,876
11 |
12 |
13 |
Average Selling Price
14 |
$ 175.20
15 |
16 |
17 |
18 | )
19 | }
20 |
--------------------------------------------------------------------------------
/apps/docs/src/registry/example/pie-chart-demo.tsx:
--------------------------------------------------------------------------------
1 | import { Card, CardContent, CardHeader, CardTitle } from "~/registry/ui/card"
2 | import { PieChart } from "~/registry/ui/charts"
3 |
4 | export default function PieChartDemo() {
5 | const chartData = {
6 | labels: ["New York", "London", "Hong Kong", "San Francisco", "Singapore", "Zurich"],
7 | datasets: [
8 | {
9 | data: [9800, 4567, 3908, 2400, 1908, 1398]
10 | }
11 | ]
12 | }
13 | return (
14 |
15 |
16 | Sales
17 |
18 |
19 |
20 |
21 |
22 | )
23 | }
24 |
--------------------------------------------------------------------------------
/apps/docs/src/registry/example/sonner-demo.tsx:
--------------------------------------------------------------------------------
1 | import { toast } from "solid-sonner"
2 |
3 | import { Button } from "~/registry/ui/button"
4 | import { Toaster } from "~/registry/ui/sonner"
5 |
6 | export default function SonnerDemo() {
7 | return (
8 | <>
9 |
23 |
24 | >
25 | )
26 | }
27 |
--------------------------------------------------------------------------------
/apps/docs/src/registry/example/otp-field-demo.tsx:
--------------------------------------------------------------------------------
1 | import {
2 | OTPField,
3 | OTPFieldGroup,
4 | OTPFieldInput,
5 | OTPFieldSeparator,
6 | OTPFieldSlot
7 | } from "~/registry/ui/otp-field"
8 |
9 | export default function OTPFieldDemo() {
10 | return (
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | )
26 | }
27 |
--------------------------------------------------------------------------------
/apps/docs/src/registry/example/separator-demo.tsx:
--------------------------------------------------------------------------------
1 | import { Separator } from "~/registry/ui/separator"
2 |
3 | export default function SeparatorDemo() {
4 | return (
5 |
6 |
7 |
Radix Primitives
8 |
An open-source UI component library.
9 |
10 |
11 |
12 |
Blog
13 |
14 |
Docs
15 |
16 |
Source
17 |
18 |
19 | )
20 | }
21 |
--------------------------------------------------------------------------------
/apps/docs/src/registry/example/toggle-group-demo.tsx:
--------------------------------------------------------------------------------
1 | import { IconBold, IconItalic, IconUnderline } from "~/components/icons"
2 | import { ToggleGroup, ToggleGroupItem } from "~/registry/ui/toggle-group"
3 |
4 | export default function ToggleGroupDemo() {
5 | return (
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | )
18 | }
19 |
--------------------------------------------------------------------------------
/packages/cli/src/utils/logger.ts:
--------------------------------------------------------------------------------
1 | import * as p from "@clack/prompts"
2 | import chalk from "chalk"
3 |
4 | export const headline = (text: string) => chalk.bgGreen.bold.black(text)
5 | export const highlight = (text: string) => chalk.bold.green(text)
6 | export const subtle = (text: string) => chalk.grey(text)
7 |
8 | export function handleError(error: unknown) {
9 | // provide a newline gap
10 | p.log.message()
11 |
12 | if (typeof error === "string") {
13 | p.cancel(error)
14 | process.exit(1)
15 | }
16 |
17 | // unexpected error
18 | if (error instanceof Error) {
19 | p.cancel(error.stack)
20 | process.exit(1)
21 | }
22 |
23 | p.cancel("Something went wrong. Please try again.")
24 | process.exit(1)
25 | }
26 |
--------------------------------------------------------------------------------
/apps/docs/public/r/collapsible.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3 | "name": "collapsible",
4 | "type": "registry:ui",
5 | "title": "Collapsible",
6 | "description": "A collapsible component",
7 | "dependencies": [
8 | "@kobalte/core"
9 | ],
10 | "files": [
11 | {
12 | "path": "src/registry/ui/collapsible.tsx",
13 | "content": "import * as CollapsiblePrimitive from \"@kobalte/core/collapsible\"\n\nconst Collapsible = CollapsiblePrimitive.Root\n\nconst CollapsibleTrigger = CollapsiblePrimitive.Trigger\n\nconst CollapsibleContent = CollapsiblePrimitive.Content\n\nexport { Collapsible, CollapsibleTrigger, CollapsibleContent }\n",
14 | "type": "registry:ui"
15 | }
16 | ]
17 | }
--------------------------------------------------------------------------------
/packages/cli/src/index.ts:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env node
2 | import { Command } from "commander"
3 |
4 | import { add } from "~/commands/add"
5 | import { init } from "~/commands/init"
6 | import { getPackageInfo } from "~/utils/get-package-info"
7 |
8 | process.on("SIGINT", () => process.exit(0))
9 | process.on("SIGTERM", () => process.exit(0))
10 |
11 | async function main() {
12 | console.clear()
13 |
14 | const packageInfo = getPackageInfo()
15 |
16 | new Command()
17 | .name("solidui-cli")
18 | .description("add SolidUI components to your project")
19 | .version(packageInfo.version || "0.0.0", "-v, --version", "display the version number")
20 | .addCommand(init)
21 | .addCommand(add)
22 | .parse()
23 | }
24 |
25 | main()
26 |
--------------------------------------------------------------------------------
/apps/docs/src/registry/example/bar-chart-demo.tsx:
--------------------------------------------------------------------------------
1 | import { Card, CardContent, CardHeader, CardTitle } from "~/registry/ui/card"
2 | import { BarChart } from "~/registry/ui/charts"
3 |
4 | export default function BarChartDemo() {
5 | const chartData = {
6 | labels: ["Amphibians", "Birds", "Crustaceans", "Ferns", "Arachnids", "Corals", "Algae"],
7 | datasets: [
8 | {
9 | label: "Number of threatened species",
10 | data: [2488, 1445, 734, 281, 251, 232, 98]
11 | }
12 | ]
13 | }
14 | return (
15 |
16 |
17 | Sales
18 |
19 |
20 |
21 |
22 |
23 | )
24 | }
25 |
--------------------------------------------------------------------------------
/apps/docs/src/routes/[...404].tsx:
--------------------------------------------------------------------------------
1 | import { A } from "@solidjs/router"
2 |
3 | import {
4 | PageHeaderActions,
5 | PageHeaderDescription,
6 | PageHeaderHeading
7 | } from "~/components/page-header"
8 | import { Button } from "~/registry/ui/button"
9 |
10 | export default function NotFound() {
11 | return (
12 |
13 |
Oops! Page not found.
14 |
15 | The page you're looking for doesn't exist or has been moved.
16 |
17 |
18 |
21 |
22 |
23 | )
24 | }
25 |
--------------------------------------------------------------------------------
/apps/docs/src/registry/example/slider-demo.tsx:
--------------------------------------------------------------------------------
1 | import {
2 | Slider,
3 | SliderFill,
4 | SliderLabel,
5 | SliderThumb,
6 | SliderTrack,
7 | SliderValueLabel
8 | } from "~/registry/ui/slider"
9 |
10 | export default function SliderDemo() {
11 | return (
12 | `$${params.values[0]} - $${params.values[1]}`}
17 | class="w-[300px] space-y-3"
18 | >
19 |
20 | Money
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 | )
30 | }
31 |
--------------------------------------------------------------------------------
/apps/docs/src/routes/(app)/docs/about.mdx:
--------------------------------------------------------------------------------
1 |
2 |
3 | ## Credits
4 |
5 | - [@shadcn](https://twitter.com/shadcn) - The brilliant mind behind the designs, methodology, and implementation of the original [shadcn/ui](https://github.com/shadcn/ui).
6 | - [tremor-raw](https://github.com/tremorlabs/tremor-raw) - Additional components that perfectly fit with shadcn/ui.
7 | - [Kobalte.](https://github.com/kobaltedev/kobalte) - The headless components that power this project.
8 | - [corvu](https://corvu.dev/) - The headless components that power this project.
9 | - [tabler](https://tabler.io/icons) - The awesome svg icons.
10 | - [Lucide](https://lucide.dev/icons/) - The awesome svg icons.
11 |
12 | ## License
13 |
14 | MIT © [Stefan E-K](https://github.com/stefan-karger/)
15 |
--------------------------------------------------------------------------------
/packages/cli/src/utils/transformers/transform-import.ts:
--------------------------------------------------------------------------------
1 | import type { Transformer } from "~/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 | if (moduleSpecifier.startsWith("~/registry/")) {
10 | importDeclaration.setModuleSpecifier(
11 | moduleSpecifier.replace(/^~\/registry\/ui/, config.aliases.components)
12 | )
13 | } else if (moduleSpecifier === "~/lib/utils") {
14 | importDeclaration.setModuleSpecifier(
15 | moduleSpecifier.replace(/^~\/lib\/utils/, config.aliases.utils)
16 | )
17 | }
18 | }
19 | return sourceFile
20 | }
21 |
--------------------------------------------------------------------------------
/apps/docs/src/routes/(app).tsx:
--------------------------------------------------------------------------------
1 | import { Suspense, type ParentProps } from "solid-js"
2 |
3 | import { MDXProvider } from "solid-mdx"
4 |
5 | import Footer from "~/components/footer"
6 | import { MDXComponents } from "~/components/mdx-components"
7 | import Navbar from "~/components/navbar"
8 |
9 | export default function DocsLayout(props: ParentProps) {
10 | return (
11 |
12 |
13 |
14 |
15 |
16 | {props.children}
17 |
18 |
19 |
20 |
21 |
22 | )
23 | }
24 |
--------------------------------------------------------------------------------
/apps/docs/src/routes/(app)/examples/tasks/components/table-input-filter.tsx:
--------------------------------------------------------------------------------
1 | import type { ComponentProps } from "solid-js"
2 | import { splitProps } from "solid-js"
3 |
4 | import type { Column } from "@tanstack/solid-table"
5 |
6 | import { TextField, TextFieldInput } from "~/registry/ui/text-field"
7 |
8 | type TableInputFilterProps = ComponentProps & {
9 | column?: Column
10 | }
11 |
12 | export function TableInputFilter(props: TableInputFilterProps) {
13 | const [local, others] = splitProps(props, ["column"])
14 | return (
15 | local.column?.setFilterValue(value)}
18 | >
19 |
20 |
21 | )
22 | }
23 |
--------------------------------------------------------------------------------
/apps/docs/src/registry/block/sidebar-01/components/search-form.tsx:
--------------------------------------------------------------------------------
1 | import type { ComponentProps } from "solid-js"
2 |
3 | import { IconSearch } from "~/components/icons"
4 | import { SidebarGroup, SidebarGroupContent, SidebarInput } from "~/registry/ui/sidebar"
5 |
6 | export function SearchForm(props: ComponentProps<"form">) {
7 | return (
8 |
19 | )
20 | }
21 |
--------------------------------------------------------------------------------
/apps/docs/src/routes/(app)/examples/tasks/index.tsx:
--------------------------------------------------------------------------------
1 | import { columns } from "./components/columns"
2 | import { tasks } from "./components/data"
3 | import { DataTable } from "./components/data-table"
4 | import { UserNav } from "./components/user-nav"
5 |
6 | export default function Tasks() {
7 | return (
8 |
9 |
10 |
11 |
Welcome back!
12 |
Here's a list of your tasks for this month!
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | )
21 | }
22 |
--------------------------------------------------------------------------------
/apps/docs/src/registry/ui/skeleton.tsx:
--------------------------------------------------------------------------------
1 | import type { ValidComponent } from "solid-js"
2 | import { splitProps } from "solid-js"
3 |
4 | import type { PolymorphicProps } from "@kobalte/core/polymorphic"
5 | import * as SkeletonPrimitive from "@kobalte/core/skeleton"
6 |
7 | import { cn } from "~/lib/utils"
8 |
9 | type SkeletonRootProps =
10 | SkeletonPrimitive.SkeletonRootProps & { class?: string | undefined }
11 |
12 | const Skeleton = (
13 | props: PolymorphicProps>
14 | ) => {
15 | const [local, others] = splitProps(props as SkeletonRootProps, ["class"])
16 | return (
17 |
21 | )
22 | }
23 |
24 | export { Skeleton }
25 |
--------------------------------------------------------------------------------
/apps/docs/src/registry/ui/aspect-ratio.tsx:
--------------------------------------------------------------------------------
1 | import type { Component, ComponentProps } from "solid-js"
2 | import { mergeProps, splitProps } from "solid-js"
3 |
4 | type AspectRatioProps = ComponentProps<"div"> & { ratio?: number }
5 |
6 | const AspectRatio: Component = (rawProps) => {
7 | const props = mergeProps({ ratio: 1 / 1 }, rawProps)
8 | const [local, others] = splitProps(props, ["ratio"])
9 | return (
10 |
28 | )
29 | }
30 |
31 | export { AspectRatio }
32 |
--------------------------------------------------------------------------------
/apps/docs/src/routes/(app)/docs/components/badge.mdx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | ## Installation
6 |
7 |
8 |
9 |
10 | CLI
11 | Manual
12 |
13 |
14 |
15 |
16 | ```bash
17 | npx solidui-cli@latest add badge
18 | ```
19 |
20 |
21 |
22 |
23 |
24 | Copy and paste the following code into your project:
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 | ## Usage
33 |
34 | ```tsx
35 | import { Badge } from "~/components/ui/badge"
36 | ```
37 |
38 | ```tsx
39 | Badge
40 | ```
41 |
--------------------------------------------------------------------------------
/apps/docs/src/routes/(app)/docs/components/label.mdx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | ## Installation
6 |
7 |
8 |
9 |
10 | CLI
11 | Manual
12 |
13 |
14 |
15 |
16 | ```bash
17 | npx solidui-cli@latest add label
18 | ```
19 |
20 |
21 |
22 |
23 |
24 | Copy and paste the following code into your project:
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 | ## Usage
33 |
34 | ```tsx
35 | import { Label } from "~/components/ui/label"
36 | ```
37 |
38 | ```tsx
39 |
40 | ```
41 |
--------------------------------------------------------------------------------
/apps/docs/public/schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://json-schema.org/draft-07/schema#",
3 | "type": "object",
4 | "properties": {
5 | "tsx": {
6 | "type": "boolean"
7 | },
8 | "tailwind": {
9 | "type": "object",
10 | "properties": {
11 | "css": {
12 | "type": "string"
13 | },
14 | "config": {
15 | "type": "string"
16 | },
17 | "prefix": {
18 | "type": "string"
19 | }
20 | },
21 | "required": ["css", "config"]
22 | },
23 | "aliases": {
24 | "type": "object",
25 | "properties": {
26 | "components": {
27 | "type": "string"
28 | },
29 | "utils": {
30 | "type": "string"
31 | }
32 | },
33 | "required": ["components", "utils"]
34 | }
35 | },
36 | "required": ["tsx", "tailwind", "aliases"]
37 | }
38 |
--------------------------------------------------------------------------------
/apps/docs/src/registry/example/collapsible-demo.tsx:
--------------------------------------------------------------------------------
1 | import { IconChevronDown } from "~/components/icons"
2 | import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "~/registry/ui/collapsible"
3 |
4 | export default function CollapsibleDemo() {
5 | return (
6 |
7 |
8 | What is Kobalte ?
9 |
10 |
11 |
12 | Kobalte is a UI toolkit for building accessible web apps and design systems with SolidJS. It
13 | provides a set of low-level UI components and primitives which can be the foundation for
14 | your design system implementation.
15 |
16 |
17 | )
18 | }
19 |
--------------------------------------------------------------------------------
/apps/docs/public/r/label.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3 | "name": "label",
4 | "type": "registry:ui",
5 | "title": "Label",
6 | "description": "A label component",
7 | "dependencies": [
8 | "solid-js"
9 | ],
10 | "files": [
11 | {
12 | "path": "src/registry/ui/label.tsx",
13 | "content": "import type { Component, ComponentProps } from \"solid-js\"\nimport { splitProps } from \"solid-js\"\n\nimport { cn } from \"~/lib/utils\"\n\nconst Label: Component> = (props) => {\n const [local, others] = splitProps(props, [\"class\"])\n return (\n \n )\n}\n\nexport { Label }\n",
14 | "type": "registry:ui"
15 | }
16 | ]
17 | }
--------------------------------------------------------------------------------
/apps/docs/src/registry/ui/sonner.tsx:
--------------------------------------------------------------------------------
1 | import type { Component, ComponentProps } from "solid-js"
2 |
3 | import { Toaster as Sonner } from "solid-sonner"
4 |
5 | type ToasterProps = ComponentProps
6 |
7 | const Toaster: Component = (props) => {
8 | return (
9 |
22 | )
23 | }
24 |
25 | export { Toaster }
26 |
--------------------------------------------------------------------------------
/apps/docs/src/registry/example/number-field-demo.tsx:
--------------------------------------------------------------------------------
1 | import { createSignal } from "solid-js"
2 |
3 | import {
4 | NumberField,
5 | NumberFieldDecrementTrigger,
6 | NumberFieldErrorMessage,
7 | NumberFieldGroup,
8 | NumberFieldIncrementTrigger,
9 | NumberFieldInput
10 | } from "~/registry/ui/number-field"
11 |
12 | export default function NumberFieldDemo() {
13 | const [rawValue, setRawValue] = createSignal()
14 |
15 | return (
16 |
21 |
22 |
23 |
24 |
25 |
26 | Hmm, I prefer 40.
27 |
28 | )
29 | }
30 |
--------------------------------------------------------------------------------
/apps/docs/public/registry/ui/aspect-ratio.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "aspect-ratio",
3 | "files": [
4 | {
5 | "name": "aspect-ratio.tsx",
6 | "content": "import type { Component, ComponentProps } from \"solid-js\"\nimport { mergeProps, splitProps } from \"solid-js\"\n\ntype AspectRatioProps = ComponentProps<\"div\"> & { ratio?: number }\n\nconst AspectRatio: Component = (rawProps) => {\n const props = mergeProps({ ratio: 1 / 1 }, rawProps)\n const [local, others] = splitProps(props, [\"ratio\"])\n return (\n \n )\n}\n\nexport { AspectRatio }\n"
7 | }
8 | ],
9 | "type": "ui"
10 | }
--------------------------------------------------------------------------------
/apps/docs/src/routes/(app)/docs/components/delta-bar.mdx:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 | ## Installation
9 |
10 |
11 |
12 |
13 | CLI
14 | Manual
15 |
16 |
17 |
18 |
19 | ```bash
20 | npx solidui-cli@latest add delta-bar
21 | ```
22 |
23 |
24 |
25 |
26 |
27 | Copy and paste the following code into your project:
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 | ## Usage
36 |
37 | ```tsx
38 | import { DeltaBar } from "~/components/ui/delta-bar"
39 | ```
40 |
41 | ```tsx
42 |
43 | ```
44 |
--------------------------------------------------------------------------------
/.prettierrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "endOfLine": "lf",
3 | "semi": false,
4 | "singleQuote": false,
5 | "tabWidth": 2,
6 | "printWidth": 100,
7 | "trailingComma": "none",
8 | "importOrder": [
9 | "",
10 | "",
11 | "^(solid-js/(.*)$)|^(solid-js$)",
12 | "^(@solidjs/(.*)$)",
13 | "",
14 | "",
15 | "",
16 | "^~/(.*)$",
17 | "",
18 | "^[./]"
19 | ],
20 | "importOrderSeparation": false,
21 | "importOrderSortSpecifiers": true,
22 | "importOrderBuiltinModulesToTop": true,
23 | "importOrderParserPlugins": ["typescript", "jsx", "decorators-legacy"],
24 | "importOrderMergeDuplicateImports": true,
25 | "importOrderCombineTypeAndValueImports": true,
26 | "plugins": ["@ianvs/prettier-plugin-sort-imports", "prettier-plugin-tailwindcss"],
27 | "tailwindStylesheet": "./apps/docs/src/styles/app.css",
28 | "tailwindAttributes": ["class"],
29 | "tailwindFunctions": ["clsx", "cva"]
30 | }
31 |
--------------------------------------------------------------------------------
/apps/docs/src/registry/example/alert-dialog-demo.tsx:
--------------------------------------------------------------------------------
1 | import {
2 | AlertDialog,
3 | AlertDialogContent,
4 | AlertDialogDescription,
5 | AlertDialogTitle,
6 | AlertDialogTrigger
7 | } from "~/registry/ui/alert-dialog"
8 | import { Button } from "~/registry/ui/button"
9 |
10 | export default function AlertDialogDemo() {
11 | return (
12 |
13 |
14 | Show Dialog
15 |
16 |
17 | Alert Dialog
18 |
19 | An Alert Dialog enables assistive technologies and browsers to distinguish alert dialogs
20 | from other dialogs so they have the option of giving alert dialogs special treatment, such
21 | as playing a system alert sound.
22 |
23 |
24 |
25 | )
26 | }
27 |
--------------------------------------------------------------------------------
/apps/docs/src/registry/example/select-demo.tsx:
--------------------------------------------------------------------------------
1 | import { createSignal } from "solid-js"
2 |
3 | import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "~/registry/ui/select"
4 |
5 | export default function SelectDemo() {
6 | const [value, setValue] = createSignal("")
7 | return (
8 |
9 |
21 |
Your favorite fruit is: {value()}
22 |
23 | )
24 | }
25 |
--------------------------------------------------------------------------------
/apps/docs/src/routes/(app)/docs/components/badge-delta.mdx:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 | ## Installation
9 |
10 |
11 |
12 |
13 | CLI
14 | Manual
15 |
16 |
17 |
18 |
19 | ```bash
20 | npx solidui-cli@latest add badge-delta
21 | ```
22 |
23 |
24 |
25 |
26 |
27 |
28 | Copy and paste the following code into your project:
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 | ## Usage
38 |
39 | ```tsx
40 | import { BadgeDelta } from "~/components/ui/badge-delta"
41 | ```
42 |
43 | ```tsx
44 | + 420.69%
45 | ```
46 |
--------------------------------------------------------------------------------
/apps/docs/src/routes/(app)/docs/components/skeleton.mdx:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 | ## Installation
10 |
11 |
12 |
13 |
14 | CLI
15 | Manual
16 |
17 |
18 |
19 |
20 | ```bash
21 | npx solidui-cli@latest add skeleton
22 | ```
23 |
24 |
25 |
26 |
27 |
28 | Copy and paste the following code into your project:
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 | ## Usage
37 |
38 | ```tsx
39 | import { Skeleton } from "~/components/ui/skeleton"
40 | ```
41 |
42 | ```tsx
43 |
44 | ```
45 |
--------------------------------------------------------------------------------
/apps/docs/public/favicon.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/apps/docs/src/registry/example/breadcrumb-demo.tsx:
--------------------------------------------------------------------------------
1 | import {
2 | Breadcrumb,
3 | BreadcrumbEllipsis,
4 | BreadcrumbItem,
5 | BreadcrumbLink,
6 | BreadcrumbList,
7 | BreadcrumbSeparator
8 | } from "~/registry/ui/breadcrumb"
9 |
10 | export default function BreadcrumbDemo() {
11 | return (
12 |
13 |
14 |
15 | Home
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 | Components
24 |
25 |
26 |
27 | Breadcrumbs
28 |
29 |
30 |
31 | )
32 | }
33 |
--------------------------------------------------------------------------------
/apps/docs/src/routes/(app)/docs/components/aspect-ratio.mdx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | ## Installation
6 |
7 |
8 |
9 |
10 | CLI
11 | Manual
12 |
13 |
14 |
15 |
16 | ```bash
17 | npx solidui-cli@latest add aspect-ratio
18 | ```
19 |
20 |
21 |
22 |
23 |
24 | Copy and paste the following code into your project:
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 | ## Usage
33 |
34 | ```tsx
35 | import { AspectRatio } from "~/components/ui/aspect-ratio"
36 | ```
37 |
38 | ```tsx
39 |
40 |
41 |
42 | ```
43 |
--------------------------------------------------------------------------------
/apps/docs/public/registry/ui/skeleton.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "skeleton",
3 | "dependencies": [
4 | "@kobalte/core"
5 | ],
6 | "files": [
7 | {
8 | "name": "skeleton.tsx",
9 | "content": "import type { ValidComponent } from \"solid-js\"\nimport { splitProps } from \"solid-js\"\n\nimport type { PolymorphicProps } from \"@kobalte/core/polymorphic\"\nimport * as SkeletonPrimitive from \"@kobalte/core/skeleton\"\n\nimport { cn } from \"~/lib/utils\"\n\ntype SkeletonRootProps =\n SkeletonPrimitive.SkeletonRootProps & { class?: string | undefined }\n\nconst Skeleton = (\n props: PolymorphicProps>\n) => {\n const [local, others] = splitProps(props as SkeletonRootProps, [\"class\"])\n return (\n \n )\n}\n\nexport { Skeleton }\n"
10 | }
11 | ],
12 | "type": "ui"
13 | }
--------------------------------------------------------------------------------
/apps/docs/src/routes/(app)/docs/components/progress-circle.mdx:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 | ## Installation
9 |
10 |
11 |
12 |
13 | CLI
14 | Manual
15 |
16 |
17 |
18 |
19 | ```bash
20 | npx solidui-cli@latest add progress-circle
21 | ```
22 |
23 |
24 |
25 |
26 |
27 |
28 | Copy and paste the following code into your project:
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 | ## Usage
38 |
39 | ```tsx
40 | import { ProgressCircle } from "~/components/ui/progress-circle"
41 | ```
42 |
43 | ```tsx
44 |
45 | ```
46 |
--------------------------------------------------------------------------------
/apps/docs/src/routes/(app)/docs/introduction.mdx:
--------------------------------------------------------------------------------
1 |
5 |
6 | This is an unofficial port of [shadcn/ui](https://github.com/shadcn-ui/ui) & [tremor-raw](https://github.com/tremorlabs/tremor-raw) to [Solid](https://www.solidjs.com/).
7 |
8 | This is **NOT** a component library. It's a collection of re-usable components that you can copy and paste into your apps.
9 |
10 | **What do you mean by not a component library?**
11 |
12 | I mean you do not install it as a dependency. It is not available or distributed via npm. I have no plans to publish it as an npm package (for now).
13 |
14 | Pick the components you need. Copy and paste the code into your project and customize to your needs. The code is yours.
15 |
16 | _Use this as a reference to build your own component libraries._
17 |
18 | [](https://star-history.com/#stefan-karger/solid-ui-components&Date)
19 |
--------------------------------------------------------------------------------
/apps/docs/src/routes/(app)/docs.tsx:
--------------------------------------------------------------------------------
1 | import type { RouteProps } from "@solidjs/router"
2 | import { MDXProvider } from "solid-mdx"
3 |
4 | import { MDXComponents } from "~/components/mdx-components"
5 | import Sidebar from "~/components/sidebar"
6 | import { TableOfContents } from "~/components/toc"
7 |
8 | import "~/styles/mdx.css"
9 |
10 | export default function DocsLayout(props: RouteProps) {
11 | return (
12 |
13 |
14 |
15 |
16 |
17 | {props.children}
18 |
19 |
20 |
23 |
24 |
25 | )
26 | }
27 |
--------------------------------------------------------------------------------
/apps/docs/src/routes/(app)/docs/components/bar-list.mdx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | ## Installation
6 |
7 |
8 |
9 |
10 | CLI
11 | Manual
12 |
13 |
14 |
15 |
16 | ```bash
17 | npx solidui-cli@latest add bar-list
18 | ```
19 |
20 |
21 |
22 |
23 |
24 | Copy and paste the following code into your project:
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 | ## Usage
33 |
34 | ```tsx
35 | import { BarList } from "~/components/ui/bar-list"
36 | ```
37 |
38 | ```tsx
39 | const data = [
40 | { name: "Instagram", value: 324 },
41 | { name: "X", value: 174 },
42 | { name: "Youtube", value: 1237 }
43 | ]
44 |
45 |
46 | ```
47 |
--------------------------------------------------------------------------------
/apps/docs/src/registry/ui/separator.tsx:
--------------------------------------------------------------------------------
1 | import type { ValidComponent } from "solid-js"
2 | import { splitProps } from "solid-js"
3 |
4 | import type { PolymorphicProps } from "@kobalte/core/polymorphic"
5 | import * as SeparatorPrimitive from "@kobalte/core/separator"
6 |
7 | import { cn } from "~/lib/utils"
8 |
9 | type SeparatorRootProps =
10 | SeparatorPrimitive.SeparatorRootProps & { class?: string | undefined }
11 |
12 | const Separator = (
13 | props: PolymorphicProps>
14 | ) => {
15 | const [local, others] = splitProps(props as SeparatorRootProps, ["class", "orientation"])
16 | return (
17 |
26 | )
27 | }
28 |
29 | export { Separator }
30 |
--------------------------------------------------------------------------------
/apps/docs/public/registry/ui/sonner.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "sonner",
3 | "dependencies": [
4 | "solid-sonner"
5 | ],
6 | "files": [
7 | {
8 | "name": "sonner.tsx",
9 | "content": "import type { Component, ComponentProps } from \"solid-js\"\n\nimport { Toaster as Sonner } from \"solid-sonner\"\n\ntype ToasterProps = ComponentProps\n\nconst Toaster: Component = (props) => {\n return (\n \n )\n}\n\nexport { Toaster }\n"
10 | }
11 | ],
12 | "type": "ui"
13 | }
--------------------------------------------------------------------------------
/apps/docs/src/registry/example/badge-delta-demo.tsx:
--------------------------------------------------------------------------------
1 | import { BadgeDelta } from "~/registry/ui/badge-delta"
2 |
3 | export default function BadgeDeltaDemo() {
4 | return (
5 |
6 |
BadgeDelta with pre-defined status icons
7 |
8 | text
9 | text
10 | text
11 | text
12 | text
13 |
14 |
BadgeDelta without text
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 | )
24 | }
25 |
--------------------------------------------------------------------------------
/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "root": true,
3 | "extends": [
4 | "eslint:recommended",
5 | "plugin:@typescript-eslint/eslint-recommended",
6 | "plugin:@typescript-eslint/recommended",
7 | "plugin:solid/recommended",
8 | "plugin:tailwindcss/recommended"
9 | ],
10 | "plugins": ["solid", "tailwindcss"],
11 | "rules": {
12 | "@typescript-eslint/consistent-type-imports": "error",
13 | "@typescript-eslint/no-unused-vars": [
14 | "error",
15 | {
16 | "argsIgnorePattern": "^_",
17 | "varsIgnorePattern": "^_",
18 | "caughtErrorsIgnorePattern": "^_"
19 | }
20 | ],
21 | "tailwindcss/classnames-order": "error",
22 | "tailwindcss/no-custom-classname": "off"
23 | },
24 | "settings": {
25 | "tailwindcss": {
26 | "callees": ["cn", "cva"],
27 | "config": "tailwind.config.cjs"
28 | }
29 | },
30 | "overrides": [
31 | {
32 | "files": ["*.ts", "*.tsx"],
33 | "parser": "@typescript-eslint/parser"
34 | }
35 | ],
36 | "ignorePatterns": ["*.config.*", "*.json"]
37 | }
38 |
--------------------------------------------------------------------------------
/apps/docs/src/components/mdx-header.tsx:
--------------------------------------------------------------------------------
1 | import { Show } from "solid-js"
2 | import { A } from "@solidjs/router"
3 |
4 | import { cn } from "~/lib/utils"
5 | import { badgeVariants } from "~/registry/ui/badge"
6 |
7 | import { IconExternalLink } from "./icons"
8 |
9 | type HeaderProps = {
10 | title: string
11 | description: string
12 | docs?: string
13 | }
14 |
15 | export function MDXHeader(props: HeaderProps) {
16 | return (
17 |
18 |
{props.title}
19 |
{props.description}
20 |
21 | {(docs) => (
22 |
28 | Docs
29 |
30 |
31 | )}
32 |
33 |
34 | )
35 | }
36 |
--------------------------------------------------------------------------------
/apps/docs/src/registry/example/carousel-demo.tsx:
--------------------------------------------------------------------------------
1 | import { Index } from "solid-js"
2 |
3 | import { Card, CardContent } from "~/registry/ui/card"
4 | import {
5 | Carousel,
6 | CarouselContent,
7 | CarouselItem,
8 | CarouselNext,
9 | CarouselPrevious
10 | } from "~/registry/ui/carousel"
11 |
12 | export default function CarouselDemo() {
13 | return (
14 |
15 |
16 |
17 | {(_, index) => (
18 |
19 |
20 |
21 |
22 | {index + 1}
23 |
24 |
25 |
26 |
27 | )}
28 |
29 |
30 |
31 |
32 |
33 | )
34 | }
35 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | SolidUI
5 |
6 |
7 |
8 | This is an unofficial port of [shadcn/ui](https://github.com/shadcn-ui/ui) & [tremor-raw](https://github.com/tremorlabs/tremor-raw) to [Solid](https://www.solidjs.com/).
9 |
10 | Accessible and customizable components that you can copy and paste into your apps. Free. Open Source. **Use this to build your own component library**.
11 |
12 | 
13 |
14 | ## Documentation
15 |
16 | Visit https://www.solid-ui.com to view the documentation.
17 |
18 | ## License
19 |
20 | Published under the [MIT license](LICENSE). Built by [@stefan-karger](https://github.com/stefan-karger), [@michaelessiet](https://github.com/michaelessiet) & [community](https://github.com/stefan-karger/solid-ui/graphs/contributors).
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/apps/docs/src/registry/schema.ts:
--------------------------------------------------------------------------------
1 | import * as v from "valibot"
2 |
3 | export const registryTypeSchema = v.picklist(["ui", "example", "block", "page", "component"])
4 |
5 | export const registryFileSchema = v.object({
6 | path: v.string(),
7 | content: v.optional(v.string()),
8 | type: registryTypeSchema,
9 | target: v.optional(v.string())
10 | })
11 |
12 | export const registryItemSchema = v.object({
13 | name: v.string(),
14 | dependencies: v.optional(v.array(v.string())),
15 | registryDependencies: v.optional(v.array(v.string())),
16 | files: v.array(registryFileSchema),
17 | type: registryTypeSchema,
18 | description: v.optional(v.string())
19 | })
20 |
21 | export const registryIndexSchema = v.record(
22 | v.string(),
23 | v.object({ ...registryItemSchema.entries, component: v.any() })
24 | )
25 |
26 | export const registrySchema = v.array(registryItemSchema)
27 |
28 | export type RegistryItem = v.InferOutput
29 | export type RegistryIndex = v.InferOutput
30 | export type Registry = v.InferOutput
31 |
--------------------------------------------------------------------------------
/apps/docs/src/routes/(app)/docs/components/separator.mdx:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 | ## Installation
10 |
11 |
12 |
13 |
14 | CLI
15 | Manual
16 |
17 |
18 |
19 |
20 | ```bash
21 | npx solidui-cli@latest add separator
22 | ```
23 |
24 |
25 |
26 |
27 |
28 |
29 | Install the following dependencies:
30 |
31 | ```bash
32 | npm install @kobalte/core
33 | ```
34 |
35 | Copy and paste the following code into your project:
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 | ## Usage
45 |
46 | ```tsx
47 | import { Separator } from "~/components/ui/separator"
48 | ```
49 |
50 | ```tsx
51 |
52 | ```
53 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2023 shadcn
4 | Copyright (c) 2023 Stefan E-K
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
7 |
8 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
9 |
10 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
11 |
--------------------------------------------------------------------------------
/apps/docs/src/registry/registry-blocks.ts:
--------------------------------------------------------------------------------
1 | import type { Registry } from "~/registry/schema"
2 |
3 | export const blocks: Registry = [
4 | {
5 | name: "sidebar-01",
6 | description: "A simple sidebar with navigation grouped by section",
7 | type: "block",
8 | registryDependencies: ["sidebar", "breadcrumb", "separator", "label", "dropdown-menu"],
9 | files: [
10 | {
11 | path: "block/sidebar-01/index.tsx",
12 | type: "page",
13 | target: "app/dashboard/page.tsx"
14 | },
15 | {
16 | path: "block/sidebar-01/components/app-sidebar.tsx",
17 | type: "component"
18 | },
19 | {
20 | path: "block/sidebar-01/components/search-form.tsx",
21 | type: "component"
22 | },
23 | {
24 | path: "block/sidebar-01/components/version-switcher.tsx",
25 | type: "component"
26 | }
27 | ]
28 | },
29 | {
30 | name: "demo-sidebar",
31 | type: "block",
32 | files: [
33 | {
34 | path: "block/demo-sidebar.tsx",
35 | type: "component"
36 | }
37 | ]
38 | }
39 | ]
40 |
--------------------------------------------------------------------------------
/packages/cli/README.md:
--------------------------------------------------------------------------------
1 | # solid-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.cjs`, and sets up CSS variables for the project.
10 |
11 | ```bash
12 | npx solidui-cli@latest 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 solidui-cli@latest add [component]
23 | ```
24 |
25 | ### Example
26 |
27 | ```bash
28 | npx solidui-cli@latest 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 solidui-cli@latest add
35 | ```
36 |
37 | ## Documentation
38 |
39 | Visit https://solid-ui.com to view the documentation.
40 |
41 | ## License
42 |
43 | Licensed under the [MIT license](https://github.com/stefan-karger/solid-ui/blob/main/LICENSE).
44 |
--------------------------------------------------------------------------------
/apps/docs/src/registry/example/carousel-spacing-demo.tsx:
--------------------------------------------------------------------------------
1 | import { Index } from "solid-js"
2 |
3 | import { Card, CardContent } from "~/registry/ui/card"
4 | import {
5 | Carousel,
6 | CarouselContent,
7 | CarouselItem,
8 | CarouselNext,
9 | CarouselPrevious
10 | } from "~/registry/ui/carousel"
11 |
12 | export default function CarouselSpacingDemo() {
13 | return (
14 |
15 |
16 |
17 | {(_, index) => (
18 |
19 |
20 |
21 |
22 | {index + 1}
23 |
24 |
25 |
26 |
27 | )}
28 |
29 |
30 |
31 |
32 |
33 | )
34 | }
35 |
--------------------------------------------------------------------------------
/apps/docs/src/registry/example/accordion-demo.tsx:
--------------------------------------------------------------------------------
1 | import {
2 | Accordion,
3 | AccordionContent,
4 | AccordionItem,
5 | AccordionTrigger
6 | } from "~/registry/ui/accordion"
7 |
8 | export default function AccordionDemo() {
9 | return (
10 |
11 |
12 | Is it accessible?
13 | Yes. It adheres to the WAI-ARIA design pattern.
14 |
15 |
16 | Is it styled?
17 |
18 | Yes. It comes with default styles that matches the other components' aesthetic.
19 |
20 |
21 |
22 | Is it animated?
23 |
24 | Yes. It's animated by default, but you can disable it if you prefer.
25 |
26 |
27 |
28 | )
29 | }
30 |
--------------------------------------------------------------------------------
/apps/docs/src/styles/mdx.css:
--------------------------------------------------------------------------------
1 | @reference "./app.css";
2 |
3 | [data-rehype-pretty-code-fragment] {
4 | @apply relative;
5 | }
6 |
7 | [data-rehype-pretty-code-fragment] [data-highlighted-line] {
8 | @apply bg-white/10;
9 | }
10 |
11 | [data-rehype-pretty-code-fragment] [data-line] {
12 | @apply px-4 min-h-[1rem] py-0.5 w-full inline-block;
13 | }
14 |
15 | [data-rehype-pretty-code-fragment] code {
16 | @apply grid min-w-full break-words rounded-none border-0 bg-transparent p-0;
17 | counter-reset: line;
18 | box-decoration-break: clone;
19 | }
20 |
21 | [data-rehype-pretty-code-fragment] [data-line-numbers] [data-line] {
22 | @apply px-2;
23 | }
24 |
25 | [data-rehype-pretty-code-fragment] [data-line-numbers] > [data-line]::before {
26 | @apply text-zinc-50/40 text-xs;
27 | counter-increment: line;
28 | content: counter(line);
29 | display: inline-block;
30 | width: 1.8rem;
31 | margin-right: 1.4rem;
32 | text-align: right;
33 | }
34 |
35 | [data-rehype-pretty-code-title] {
36 | @apply mt-2 pt-6 px-4 text-sm font-medium;
37 | }
38 |
39 | [data-rehype-pretty-code-title] + div > pre {
40 | @apply mt-2;
41 | }
42 |
--------------------------------------------------------------------------------
/apps/docs/src/routes/(app)/docs/cli.mdx:
--------------------------------------------------------------------------------
1 |
2 |
3 | ## init
4 |
5 | Use the `init` command to initialize configuration and dependencies for a new project.
6 |
7 | The `init` command installs dependencies, adds the `cn` util, configures `tailwind.config.cjs`, and CSS variables for the project.
8 |
9 | ```bash
10 | npx solidui-cli@latest init
11 | ```
12 |
13 | It also creates a `ui.config.json` file which houses all Solid UI configurations. Feel free to change where you would like your components to be stored by modifying the `componentDir` property.
14 |
15 | ## add
16 |
17 | Use the `add` command to add components and dependencies to your project.
18 |
19 | ```bash
20 | npx solidui-cli@latest add [component]
21 | ```
22 |
23 | You will be presented with a list of components to choose from:
24 |
25 | ```txt
26 | Which components would you like to add? › Space to select. A to toggle all.
27 | Enter to submit.
28 |
29 | ◯ accordion
30 | ◯ avatar
31 | ◯ badge
32 | ◯ button
33 | ◯ callout
34 | ◯ card
35 | ◯ charts
36 | ◯ checkbox
37 | ◯ dialog
38 | ```
39 |
--------------------------------------------------------------------------------
/apps/docs/src/components/dashboard/overview.tsx:
--------------------------------------------------------------------------------
1 | import { BarChart } from "~/registry/ui/charts"
2 |
3 | export function Overview() {
4 | const chartData = {
5 | labels: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
6 | datasets: [
7 | {
8 | label: "Sales",
9 | data: [
10 | Math.floor(Math.random() * 5000) + 1000,
11 | Math.floor(Math.random() * 5000) + 1000,
12 | Math.floor(Math.random() * 5000) + 1000,
13 | Math.floor(Math.random() * 5000) + 1000,
14 | Math.floor(Math.random() * 5000) + 1000,
15 | Math.floor(Math.random() * 5000) + 1000,
16 | Math.floor(Math.random() * 5000) + 1000,
17 | Math.floor(Math.random() * 5000) + 1000,
18 | Math.floor(Math.random() * 5000) + 1000,
19 | Math.floor(Math.random() * 5000) + 1000,
20 | Math.floor(Math.random() * 5000) + 1000,
21 | Math.floor(Math.random() * 5000) + 1000
22 | ]
23 | }
24 | ]
25 | }
26 |
27 | return (
28 |
29 |
30 |
31 | )
32 | }
33 |
--------------------------------------------------------------------------------
/apps/docs/public/registry/ui/separator.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "separator",
3 | "dependencies": [
4 | "@kobalte/core"
5 | ],
6 | "files": [
7 | {
8 | "name": "separator.tsx",
9 | "content": "import type { ValidComponent } from \"solid-js\"\nimport { splitProps } from \"solid-js\"\n\nimport type { PolymorphicProps } from \"@kobalte/core/polymorphic\"\nimport * as SeparatorPrimitive from \"@kobalte/core/separator\"\n\nimport { cn } from \"~/lib/utils\"\n\ntype SeparatorRootProps =\n SeparatorPrimitive.SeparatorRootProps & { class?: string | undefined }\n\nconst Separator = (\n props: PolymorphicProps>\n) => {\n const [local, others] = splitProps(props as SeparatorRootProps, [\"class\", \"orientation\"])\n return (\n \n )\n}\n\nexport { Separator }\n"
10 | }
11 | ],
12 | "type": "ui"
13 | }
--------------------------------------------------------------------------------
/apps/docs/src/registry/example/text-field-error-demo.tsx:
--------------------------------------------------------------------------------
1 | import { createSignal } from "solid-js"
2 |
3 | import {
4 | TextField,
5 | TextFieldErrorMessage,
6 | TextFieldInput,
7 | TextFieldLabel
8 | } from "~/registry/ui/text-field"
9 | import { Tooltip, TooltipContent, TooltipTrigger } from "~/registry/ui/tooltip"
10 |
11 | export default function TextFieldErrorDemo() {
12 | const [value, setValue] = createSignal("no valid email")
13 | const [error, setError] = createSignal(true)
14 |
15 | const verifyInput = (value: string) => {
16 | const isValid = /^.+@.+\..+$/.test(value) && value.length < 256
17 | setError(!isValid)
18 | setValue(value)
19 | }
20 |
21 | return (
22 |
27 | Email
28 |
29 |
30 |
31 | Please enter a valid email.
32 |
33 |
34 |
35 | )
36 | }
37 |
--------------------------------------------------------------------------------
/apps/docs/src/components/footer.tsx:
--------------------------------------------------------------------------------
1 | import type { JSX } from "solid-js"
2 | import { A } from "@solidjs/router"
3 |
4 | function Link(props: { href: string; children: JSX.Element }) {
5 | return (
6 |
12 | {props.children}
13 |
14 | )
15 | }
16 |
17 | export default function Footer() {
18 | return (
19 |
29 | )
30 | }
31 |
--------------------------------------------------------------------------------
/apps/docs/src/routes/(app)/docs/components/avatar.mdx:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 | ## Installation
9 |
10 |
11 |
12 |
13 | CLI
14 | Manual
15 |
16 |
17 |
18 |
19 | ```bash
20 | npx solidui-cli@latest add avatar
21 | ```
22 |
23 |
24 |
25 |
26 |
27 |
28 | Install the following dependencies:
29 |
30 | ```bash
31 | npm install @kobalte/core
32 | ```
33 |
34 | Copy and paste the following code into your project:
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 | ## Usage
44 |
45 | ```tsx
46 | import { Avatar, AvatarFallback, AvatarImage } from "~/components/ui/avatar"
47 | ```
48 |
49 | ```tsx
50 |
51 |
52 | EK
53 |
54 | ```
55 |
--------------------------------------------------------------------------------
/apps/docs/src/entry-server.tsx:
--------------------------------------------------------------------------------
1 | // @refresh reload
2 | import { createHandler, StartServer } from "@solidjs/start/server"
3 |
4 | export default createHandler(() => (
5 | (
7 |
8 |
9 | {assets}
10 |
15 |
22 |
29 |
30 |
31 | {children}
32 | {scripts}
33 |
34 |
35 | )}
36 | />
37 | ))
38 |
--------------------------------------------------------------------------------
/apps/docs/src/registry/example/carousel-size-demo.tsx:
--------------------------------------------------------------------------------
1 | import { Index } from "solid-js"
2 |
3 | import { Card, CardContent } from "~/registry/ui/card"
4 | import {
5 | Carousel,
6 | CarouselContent,
7 | CarouselItem,
8 | CarouselNext,
9 | CarouselPrevious
10 | } from "~/registry/ui/carousel"
11 |
12 | export default function CarouselSizeDemo() {
13 | return (
14 |
20 |
21 |
22 | {(_, index) => (
23 |
24 |
25 |
26 |
27 | {index + 1}
28 |
29 |
30 |
31 |
32 | )}
33 |
34 |
35 |
36 |
37 |
38 | )
39 | }
40 |
--------------------------------------------------------------------------------
/apps/docs/src/routes/(app)/docs/components/progress.mdx:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 | ## Installation
10 |
11 |
12 |
13 |
14 | CLI
15 | Manual
16 |
17 |
18 |
19 |
20 | ```bash
21 | npx solidui-cli@latest add progress
22 | ```
23 |
24 |
25 |
26 |
27 |
28 |
29 | Install the following dependencies:
30 |
31 | ```bash
32 | npm install @kobalte/core
33 | ```
34 |
35 | Copy and paste the following code into your project:
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 | ## Usage
45 |
46 | ```tsx
47 | import { Progress, ProgressValue, ProgressValueLabel } from "~/components/ui/progress"
48 | ```
49 |
50 | ```tsx
51 |
52 | ```
53 |
--------------------------------------------------------------------------------
/apps/docs/public/r/aspect-ratio.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3 | "name": "aspect-ratio",
4 | "type": "registry:ui",
5 | "title": "Aspect Ratio",
6 | "description": "An aspect ratio component",
7 | "dependencies": [
8 | "solid-js"
9 | ],
10 | "files": [
11 | {
12 | "path": "src/registry/ui/aspect-ratio.tsx",
13 | "content": "import type { Component, ComponentProps } from \"solid-js\"\nimport { mergeProps, splitProps } from \"solid-js\"\n\ntype AspectRatioProps = ComponentProps<\"div\"> & { ratio?: number }\n\nconst AspectRatio: Component = (rawProps) => {\n const props = mergeProps({ ratio: 1 / 1 }, rawProps)\n const [local, others] = splitProps(props, [\"ratio\"])\n return (\n \n )\n}\n\nexport { AspectRatio }\n",
14 | "type": "registry:ui"
15 | }
16 | ]
17 | }
--------------------------------------------------------------------------------
/apps/docs/src/components/dashboard/main-nav.tsx:
--------------------------------------------------------------------------------
1 | import type { ComponentProps } from "solid-js"
2 | import { splitProps } from "solid-js"
3 |
4 | import { cn } from "~/lib/utils"
5 |
6 | export function MainNav(props: ComponentProps<"nav">) {
7 | const [, rest] = splitProps(props, ["class"])
8 | return (
9 |
35 | )
36 | }
37 |
--------------------------------------------------------------------------------
/apps/docs/src/routes/(app)/docs/components/switch.mdx:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 | ## Installation
10 |
11 |
12 |
13 |
14 | CLI
15 | Manual
16 |
17 |
18 |
19 |
20 | ```bash
21 | npx solidui-cli@latest add switch
22 | ```
23 |
24 |
25 |
26 |
27 |
28 |
29 | Install the following dependencies:
30 |
31 | ```bash
32 | npm install @kobalte/core
33 | ```
34 |
35 | Copy and paste the following code into your project:
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 | ## Usage
45 |
46 | ```tsx
47 | import { Switch, SwitchControl, SwitchThumb } from "~/components/ui/switch"
48 | ```
49 |
50 | ```tsx
51 |
52 |
53 |
54 |
55 |
56 | ```
57 |
--------------------------------------------------------------------------------
/apps/docs/public/r/skeleton.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3 | "name": "skeleton",
4 | "type": "registry:ui",
5 | "title": "Skeleton",
6 | "description": "A skeleton component",
7 | "dependencies": [
8 | "solid-js",
9 | "@kobalte/core"
10 | ],
11 | "files": [
12 | {
13 | "path": "src/registry/ui/skeleton.tsx",
14 | "content": "import type { ValidComponent } from \"solid-js\"\nimport { splitProps } from \"solid-js\"\n\nimport type { PolymorphicProps } from \"@kobalte/core/polymorphic\"\nimport * as SkeletonPrimitive from \"@kobalte/core/skeleton\"\n\nimport { cn } from \"~/lib/utils\"\n\ntype SkeletonRootProps =\n SkeletonPrimitive.SkeletonRootProps & { class?: string | undefined }\n\nconst Skeleton = (\n props: PolymorphicProps>\n) => {\n const [local, others] = splitProps(props as SkeletonRootProps, [\"class\"])\n return (\n \n )\n}\n\nexport { Skeleton }\n",
15 | "type": "registry:ui"
16 | }
17 | ]
18 | }
--------------------------------------------------------------------------------
/apps/docs/src/types/search.ts:
--------------------------------------------------------------------------------
1 | export interface SearchRes {
2 | facet_counts: unknown[]
3 | found: number
4 | hits: Hit[]
5 | out_of: number
6 | page: number
7 | request_params: RequestParams
8 | search_cutoff: boolean
9 | search_time_ms: number
10 | }
11 |
12 | export interface Hit {
13 | document: Document
14 | highlight: PurpleHighlight
15 | highlights: HighlightElement[]
16 | text_match: number
17 | text_match_info: TextMatchInfo
18 | }
19 |
20 | export interface Document {
21 | contents: string
22 | id: string
23 | title: string
24 | uri: string
25 | }
26 |
27 | export interface PurpleHighlight {
28 | contents: Contents
29 | title: Contents
30 | }
31 |
32 | export interface Contents {
33 | matched_tokens: string[]
34 | snippet: string
35 | }
36 |
37 | export interface HighlightElement {
38 | field: string
39 | matched_tokens: string[]
40 | snippet: string
41 | }
42 |
43 | export interface TextMatchInfo {
44 | best_field_score: string
45 | best_field_weight: number
46 | fields_matched: number
47 | score: string
48 | tokens_matched: number
49 | }
50 |
51 | export interface RequestParams {
52 | collection_name: string
53 | per_page: number
54 | q: string
55 | }
56 |
--------------------------------------------------------------------------------
/apps/docs/src/routes/(app)/docs/components/toggle.mdx:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 | ## Installation
10 |
11 |
12 |
13 |
14 | CLI
15 | Manual
16 |
17 |
18 |
19 |
20 | ```bash
21 | npx solidui-cli@latest add toggle
22 | ```
23 |
24 |
25 |
26 |
27 |
28 |
29 | Install the following dependencies:
30 |
31 | ```bash
32 | npm install @kobalte/core
33 | ```
34 |
35 | Copy and paste the following code into your project:
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 | ## Usage
45 |
46 | ```tsx
47 | import { Toggle } from "~/components/ui/toggle"
48 | ```
49 |
50 | ```tsx
51 |
52 | {(state) => (
53 | }>
54 |
55 |
56 | )}
57 |
58 | ```
59 |
--------------------------------------------------------------------------------
/apps/docs/src/registry/example/area-chart-demo.tsx:
--------------------------------------------------------------------------------
1 | import { Card, CardContent, CardHeader, CardTitle } from "~/registry/ui/card"
2 | import { LineChart } from "~/registry/ui/charts"
3 |
4 | export default function AreaChartDemo() {
5 | const chartData = {
6 | labels: [
7 | "Jan 22",
8 | "Feb 22",
9 | "Mar 22",
10 | "Apr 22",
11 | "May 22",
12 | "Jun 22",
13 | "Jul 22",
14 | "Aug 22",
15 | "Sep 22",
16 | "Oct 22",
17 | "Nov 22",
18 | "Dec 22"
19 | ],
20 | datasets: [
21 | {
22 | label: "SemiAnalysis",
23 | data: [2890, 2756, 3322, 3470, 3475, 3129, 3490, 2903, 2643, 2837, 2954, 3239],
24 | fill: true
25 | },
26 | {
27 | label: "The Pragmatic Engineer",
28 | data: [2338, 2103, 2194, 2108, 1812, 1726, 1982, 2012, 2342, 2473, 3848, 3736],
29 | fill: true
30 | }
31 | ]
32 | }
33 | return (
34 |
35 |
36 | Newsletter revenue over time (USD)
37 |
38 |
39 |
40 |
41 |
42 | )
43 | }
44 |
--------------------------------------------------------------------------------
/apps/docs/src/registry/example/carousel-orientation-demo.tsx:
--------------------------------------------------------------------------------
1 | import { Index } from "solid-js"
2 |
3 | import { Card, CardContent } from "~/registry/ui/card"
4 | import {
5 | Carousel,
6 | CarouselContent,
7 | CarouselItem,
8 | CarouselNext,
9 | CarouselPrevious
10 | } from "~/registry/ui/carousel"
11 |
12 | export default function CarouselOrientationDemo() {
13 | return (
14 |
21 |
22 |
23 | {(_, index) => (
24 |
25 |
26 |
27 |
28 | {index + 1}
29 |
30 |
31 |
32 |
33 | )}
34 |
35 |
36 |
37 |
38 |
39 | )
40 | }
41 |
--------------------------------------------------------------------------------
/apps/docs/src/routes/(app)/docs/components/card.mdx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | ## Installation
6 |
7 |
8 |
9 |
10 | CLI
11 | Manual
12 |
13 |
14 |
15 |
16 | ```bash
17 | npx solidui-cli@latest add card
18 | ```
19 |
20 |
21 |
22 |
23 |
24 | Copy and paste the following code into your project:
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 | ## Usage
33 |
34 | ```tsx
35 | import {
36 | Card,
37 | CardContent,
38 | CardDescription,
39 | CardFooter,
40 | CardHeader,
41 | CardTitle
42 | } from "~/components/ui/card"
43 | ```
44 |
45 | ```tsx
46 |
47 |
48 | Card Title
49 | Card Description
50 |
51 |
52 | Card Content
53 |
54 |
55 | Card Footer
56 |
57 |
58 | ```
59 |
--------------------------------------------------------------------------------
/apps/docs/public/r/sonner.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3 | "name": "sonner",
4 | "type": "registry:ui",
5 | "title": "Sonner",
6 | "description": "A sonner component",
7 | "dependencies": [
8 | "solid-js",
9 | "solid-sonner"
10 | ],
11 | "files": [
12 | {
13 | "path": "src/registry/ui/sonner.tsx",
14 | "content": "import type { Component, ComponentProps } from \"solid-js\"\n\nimport { Toaster as Sonner } from \"solid-sonner\"\n\ntype ToasterProps = ComponentProps\n\nconst Toaster: Component = (props) => {\n return (\n \n )\n}\n\nexport { Toaster }\n",
15 | "type": "registry:ui"
16 | }
17 | ]
18 | }
--------------------------------------------------------------------------------
/apps/docs/src/routes/(app)/docs/components/slider.mdx:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 | ## Installation
10 |
11 |
12 |
13 |
14 | CLI
15 | Manual
16 |
17 |
18 |
19 |
20 | ```bash
21 | npx solidui-cli@latest add slider
22 | ```
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 | Install the following dependencies:
31 |
32 | ```bash
33 | npm install @kobalte/core
34 | ```
35 |
36 | Copy and paste the following code into your project:
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 | ## Usage
47 |
48 | ```tsx
49 | import { Slider, SliderFill, SliderThumb, SliderTrack } from "~/registry/ui/slider"
50 | ```
51 |
52 | ```tsx
53 |
54 |
55 |
56 |
57 |
58 |
59 | ```
60 |
--------------------------------------------------------------------------------
/apps/docs/src/routes/(app)/docs/components/date-picker.mdx:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 | ## About
10 |
11 | The Date Picker component is currently built using [Ark UI](https://ark-ui.com/).
12 |
13 | ## Installation
14 |
15 |
16 |
17 |
18 | CLI
19 | Manual
20 |
21 |
22 |
23 |
24 | ```bash
25 | npx solidui-cli@latest add date-picker
26 | ```
27 |
28 |
29 |
30 |
31 |
32 |
33 | Install the following dependencies:
34 |
35 | ```bash
36 | npm install @ark-ui/solid
37 | ```
38 |
39 | Copy and paste the following code into your project:
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 | ## Examples
49 |
50 | ### Date Range Picker
51 |
52 |
53 |
54 | ### Calendar
55 |
56 |
57 |
--------------------------------------------------------------------------------
/apps/docs/src/routes/(app)/docs/components/popover.mdx:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 | ## Installation
10 |
11 |
12 |
13 |
14 | CLI
15 | Manual
16 |
17 |
18 |
19 |
20 | ```bash
21 | npx solidui-cli@latest add popover
22 | ```
23 |
24 |
25 |
26 |
27 |
28 |
29 | Install the following dependencies:
30 |
31 | ```bash
32 | npm install @kobalte/core
33 | ```
34 |
35 | Copy and paste the following code into your project:
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 | ## Usage
45 |
46 | ```tsx
47 | import { Popover, PopoverContent, PopoverTrigger } from "~/components/ui/popover"
48 | ```
49 |
50 | ```tsx
51 |
52 | Open
53 | Place content for the popover here.
54 |
55 | ```
56 |
--------------------------------------------------------------------------------
/apps/docs/src/routes/(app)/docs/components/timeline.mdx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | ## Installation
6 |
7 |
8 |
9 |
10 | CLI
11 | Manual
12 |
13 |
14 |
15 |
16 | ```bash
17 | npx solidui-cli@latest add timeline
18 | ```
19 |
20 |
21 |
22 |
23 |
24 | Copy and paste the following code into your project:
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 | ## Usage
33 |
34 | ```tsx
35 | import { Timeline } from "~/components/ui/timeline"
36 | ```
37 |
38 | ```tsx
39 |
56 | ```
57 |
--------------------------------------------------------------------------------
/apps/docs/src/routes/(app)/docs/components/callout.mdx:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 | ## Installation
9 |
10 |
11 |
12 |
13 | CLI
14 | Manual
15 |
16 |
17 |
18 |
19 | ```bash
20 | npx solidui-cli@latest add callout
21 | ```
22 |
23 |
24 |
25 |
26 |
27 | Copy and paste the following code into your project:
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 | ## Usage
36 |
37 | ```tsx
38 | import { Callout, CalloutContent, CalloutTitle } from "~/components/ui/callout"
39 | ```
40 |
41 | ```tsx
42 |
43 | Title
44 |
45 | Lorem ipsum dolor sit amet consectetur, adipisicing elit. Tempora cupiditate sapiente officiis
46 | ullam, nulla nam sunt? Ipsa facilis ut aspernatur debitis. Qui dolorem modi, assumenda nihil
47 | eligendi commodi tempore eos?
48 |
49 |
50 | ```
51 |
--------------------------------------------------------------------------------
/apps/docs/app.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from "@solidjs/start/config"
2 |
3 | /* @ts-ignore */
4 | import pkg from "@vinxi/plugin-mdx"
5 | import rehypePrettyCode from "rehype-pretty-code"
6 | import rehypeSlug from "rehype-slug"
7 | import remarkGfm from "remark-gfm"
8 | import { getHighlighter } from "shiki"
9 | import tailwindcss from "@tailwindcss/vite";
10 |
11 | import rehypeComponent from "./src/lib/mdx/component"
12 |
13 | const { default: mdx } = pkg
14 |
15 | export default defineConfig({
16 | ssr: true,
17 | server: {
18 | preset: "vercel"
19 | },
20 | extensions: ["mdx", "md"],
21 | vite: {
22 | plugins: [
23 | tailwindcss(),
24 | mdx.withImports({})({
25 | jsx: true,
26 | jsxImportSource: "solid-js",
27 | providerImportSource: "solid-mdx",
28 | remarkPlugins: [remarkGfm],
29 | rehypePlugins: [
30 | rehypeSlug,
31 | rehypeComponent,
32 | [
33 | rehypePrettyCode,
34 | {
35 | getHighlighter: async () => {
36 | return await getHighlighter({
37 | theme: "github-dark"
38 | })
39 | }
40 | }
41 | ]
42 | ]
43 | })
44 | ]
45 | }
46 | })
47 |
--------------------------------------------------------------------------------
/apps/docs/src/registry/example/resizable-demo.tsx:
--------------------------------------------------------------------------------
1 | import { Resizable, ResizableHandle, ResizablePanel } from "~/registry/ui/resizable"
2 |
3 | export default function ResizableDemo() {
4 | return (
5 |
6 |
7 |
8 | One
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | Two
17 |
18 |
19 |
20 |
21 |
22 | Three
23 |
24 |
25 |
26 |
27 |
28 | )
29 | }
30 |
--------------------------------------------------------------------------------
/apps/docs/src/routes/(app)/docs/components/alert.mdx:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 | ## Installation
10 |
11 |
12 |
13 |
14 | CLI
15 | Manual
16 |
17 |
18 |
19 |
20 | ```bash
21 | npx solidui-cli@latest add alert
22 | ```
23 |
24 |
25 |
26 |
27 |
28 |
29 | Install the following dependencies:
30 |
31 | ```bash
32 | npm install @kobalte/core
33 | ```
34 |
35 | Copy and paste the following code into your project:
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 | ## Usage
45 |
46 | ```tsx
47 | import { Alert, AlertDescription, AlertTitle } from "~/components/ui/alert"
48 | ```
49 |
50 | ```tsx
51 |
52 |
53 | Heads up!
54 |
55 | You can add components and dependencies to your app using the cli.
56 |
57 |
58 | ```
59 |
--------------------------------------------------------------------------------
/apps/docs/src/routes/(app)/docs/components/resizable.mdx:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 | ## Installation
10 |
11 |
12 |
13 |
14 | CLI
15 | Manual
16 |
17 |
18 |
19 |
20 | ```bash
21 | npx solidui-cli@latest add resizable
22 | ```
23 |
24 |
25 |
26 |
27 |
28 |
29 | Install the following dependencies:
30 |
31 | ```bash
32 | npm install @corvu/resizable
33 | ```
34 |
35 | Copy and paste the following code into your project:
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 | ## Usage
45 |
46 | ```tsx
47 | import { Resizable, ResizableHandle, ResizablePanel } from "~/components/ui/resizable"
48 | ```
49 |
50 | ```tsx
51 |
52 | One
53 |
54 | Two
55 |
56 | ```
57 |
--------------------------------------------------------------------------------
/apps/docs/src/routes/(app)/docs/components/flex.mdx:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 | ## Installation
9 |
10 |
11 |
12 |
13 | CLI
14 | Manual
15 |
16 |
17 |
18 |
19 | ```bash
20 | npx solidui-cli@latest add flex
21 | ```
22 |
23 |
24 |
25 |
26 |
27 | Copy and paste the following code into your project:
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 | ## Usage
36 |
37 | ```tsx
38 | import { Flex } from "~/components/ui/flex"
39 | ```
40 |
41 | ```tsx
42 |
43 |
44 |
45 |
Tickets sold
46 |
9,876
47 |
48 |
49 |
Average Selling Price
50 |
$ 175.20
51 |
52 |
53 |
54 | ```
55 |
--------------------------------------------------------------------------------
/.github/workflows/release.yml:
--------------------------------------------------------------------------------
1 | name: Release
2 |
3 | on:
4 | push:
5 | branches:
6 | - main
7 |
8 | concurrency: ${{ github.workflow }}-${{ github.ref }}
9 |
10 | jobs:
11 | release:
12 | name: Build & Publish Release
13 | if: github.repository == 'stefan-karger/solid-ui'
14 | runs-on: ubuntu-latest
15 | steps:
16 | - name: Checkout Repo
17 | uses: actions/checkout@v3
18 |
19 | - name: Use PNPM
20 | uses: pnpm/action-setup@v4.0.0
21 | with:
22 | version: 8.6.12
23 |
24 | - name: Use Node.js 18
25 | uses: actions/setup-node@v3
26 | with:
27 | node-version: 18
28 | cache: "pnpm"
29 |
30 | - name: Install NPM Dependencies
31 | run: pnpm install
32 |
33 | - name: Build the package
34 | run: pnpm build:cli
35 |
36 | - name: Create Release Pull Request or Publish
37 | id: changesets
38 | uses: changesets/action@v1.4.1
39 | with:
40 | commit: "chore(release): version packages"
41 | title: "chore(release): version packages"
42 | publish: npx changeset publish
43 | env:
44 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45 | NPM_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
46 | NODE_ENV: "production"
47 |
--------------------------------------------------------------------------------
/apps/docs/src/registry/example/grid-demo.tsx:
--------------------------------------------------------------------------------
1 | import { Card, CardContent, CardHeader, CardTitle } from "~/registry/ui/card"
2 | import { Col, Grid } from "~/registry/ui/grid"
3 |
4 | export default function GridDemo() {
5 | return (
6 |
7 |
8 |
9 |
10 | Title
11 |
12 | KPI 1
13 |
14 |
15 |
16 |
17 | Title
18 |
19 | KPI 2
20 |
21 |
22 |
23 |
24 | Title
25 |
26 | KPI 3
27 |
28 |
29 |
30 |
31 | Title
32 |
33 | KPI 4
34 |
35 |
36 |
37 | Title
38 |
39 | KPI 5
40 |
41 |
42 | )
43 | }
44 |
--------------------------------------------------------------------------------
/apps/docs/src/app.tsx:
--------------------------------------------------------------------------------
1 | // @refresh reload
2 | import { Suspense } from "solid-js"
3 | import { isServer } from "solid-js/web"
4 | import { MetaProvider } from "@solidjs/meta"
5 | import { Router } from "@solidjs/router"
6 | import { FileRoutes } from "@solidjs/start/router"
7 |
8 | import { ColorModeProvider, ColorModeScript, cookieStorageManagerSSR } from "@kobalte/core"
9 | import { getCookie } from "vinxi/http"
10 |
11 | import { MetaTags } from "~/components/meta-tags"
12 |
13 | import "~/styles/app.css"
14 |
15 | function getServerCookies() {
16 | "use server"
17 | const colorMode = getCookie("kb-color-mode")
18 | return colorMode ? `kb-color-mode=${colorMode}` : ""
19 | }
20 |
21 | export default function App() {
22 | const storageManager = cookieStorageManagerSSR(isServer ? getServerCookies() : document.cookie)
23 | return (
24 | (
26 |
27 |
28 |
29 |
30 |
31 | {props.children}
32 |
33 |
34 |
35 | )}
36 | >
37 |
38 |
39 | )
40 | }
41 |
--------------------------------------------------------------------------------
/apps/docs/src/registry/example/hover-card-demo.tsx:
--------------------------------------------------------------------------------
1 | import { IconCalendar } from "~/components/icons"
2 | import { Avatar, AvatarFallback, AvatarImage } from "~/registry/ui/avatar"
3 | import { Button } from "~/registry/ui/button"
4 | import { HoverCard, HoverCardContent, HoverCardTrigger } from "~/registry/ui/hover-card"
5 |
6 | export default function HoverCardDemo() {
7 | return (
8 |
9 | } variant="link">
10 | @solidjs
11 |
12 |
13 |
14 |
15 |
16 | RC
17 |
18 |
19 |
@solidjs
20 |
Simple and performant reactivity for building user interfaces.
21 |
22 | {" "}
23 | Joined April 2018
24 |
25 |
26 |
27 |
28 |
29 | )
30 | }
31 |
--------------------------------------------------------------------------------
/apps/docs/src/routes/(app)/docs/components/tooltip.mdx:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 | ## Installation
10 |
11 |
12 |
13 |
14 | CLI
15 | Manual
16 |
17 |
18 |
19 |
20 | ```bash
21 | npx solidui-cli@latest add tooltip
22 | ```
23 |
24 |
25 |
26 |
27 |
28 |
29 | Install the following dependencies:
30 |
31 | ```bash
32 | npm install @kobalte/core
33 | ```
34 |
35 | Copy and paste the following code into your project:
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 | ## Usage
45 |
46 | ```tsx
47 | import { Tooltip, TooltipContent, TooltipTrigger } from "~/components/ui/tooltip"
48 | ```
49 |
50 | ```tsx
51 |
52 | Hover Me
53 | Place content for the Tooltip here.
54 |
55 | ```
56 |
--------------------------------------------------------------------------------
/apps/docs/src/routes/(app)/docs/components/hover-card.mdx:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 | ## Installation
10 |
11 |
12 |
13 |
14 | CLI
15 | Manual
16 |
17 |
18 |
19 |
20 | ```bash
21 | npx solidui-cli@latest add hover-card
22 | ```
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 | Install the following dependencies:
31 |
32 | ```bash
33 | npm install @kobalte/core
34 | ```
35 |
36 | Copy and paste the following code into your project:
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 | ## Usage
47 |
48 | ```tsx
49 | import { HoverCard, HoverCardContent, HoverCardTrigger } from "~/components/ui/hover-card"
50 | ```
51 |
52 | ```tsx
53 |
54 | Hover
55 | The React Framework – created and maintained by @vercel.
56 |
57 | ```
58 |
--------------------------------------------------------------------------------
/apps/docs/src/routes/(app)/docs/components/checkbox.mdx:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 | ## Installation
10 |
11 |
12 |
13 |
14 | CLI
15 | Manual
16 |
17 |
18 |
19 |
20 | ```bash
21 | npx solidui-cli@latest add checkbox
22 | ```
23 |
24 |
25 |
26 |
27 |
28 |
29 | Install the following dependencies:
30 |
31 | ```bash
32 | npm install @kobalte/core
33 | ```
34 |
35 | Copy and paste the following code into your project:
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 | ## Usage
45 |
46 | ```tsx
47 | import { Checkbox } from "~/components/ui/checkbox"
48 | ```
49 |
50 | ```tsx
51 |
52 | ```
53 |
54 | ## Indeterminate state
55 |
56 | You can set the flag `indeterminate` if you need the checkbox in a state that is neither `checked` or `unchecked`.
57 |
58 |
59 |
--------------------------------------------------------------------------------
/apps/docs/src/routes/(app)/docs/components/toggle-group.mdx:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 | ## Installation
10 |
11 |
12 |
13 |
14 | CLI
15 | Manual
16 |
17 |
18 |
19 |
20 | ```bash
21 | npx solidui-cli@latest add toggle-group
22 | ```
23 |
24 |
25 |
26 |
27 |
28 |
29 | Install the following dependencies:
30 |
31 | ```bash
32 | npm install @kobalte/core
33 | ```
34 |
35 | Copy and paste the following code into your project:
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 | ## Usage
45 |
46 | ```tsx
47 | import { ToggleGroup, ToggleGroupItem } from "~/components/ui/toggle-group"
48 | ```
49 |
50 | ```tsx
51 |
52 | A
53 | B
54 | C
55 |
56 | ```
57 |
--------------------------------------------------------------------------------
/apps/docs/src/registry/example/carousel-plugin-demo.tsx:
--------------------------------------------------------------------------------
1 | import { Index } from "solid-js"
2 |
3 | import Autoplay from "embla-carousel-autoplay"
4 |
5 | import { Card, CardContent } from "~/registry/ui/card"
6 | import {
7 | Carousel,
8 | CarouselContent,
9 | CarouselItem,
10 | CarouselNext,
11 | CarouselPrevious
12 | } from "~/registry/ui/carousel"
13 |
14 | export default function CarouselPluginDemo() {
15 | const plugin = Autoplay({ delay: 2000, stopOnInteraction: true })
16 |
17 | return (
18 | plugin.play(false)}
23 | >
24 |
25 |
26 | {(_, index) => (
27 |
28 |
29 |
30 |
31 | {index + 1}
32 |
33 |
34 |
35 |
36 | )}
37 |
38 |
39 |
40 |
41 |
42 | )
43 | }
44 |
--------------------------------------------------------------------------------
/apps/docs/src/routes/(app)/docs/components/text-field.mdx:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 | ## Installation
10 |
11 |
12 |
13 |
14 | CLI
15 | Manual
16 |
17 |
18 |
19 |
20 | ```bash
21 | npx solidui-cli@latest add text-field
22 | ```
23 |
24 |
25 |
26 |
27 |
28 | Copy and paste the following code into your project:
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 | ## Usage
37 |
38 | ```tsx
39 | import { TextField, TextFieldInput } from "~/components/ui/text-field"
40 | ```
41 |
42 | ```tsx
43 |
44 |
45 |
46 | ```
47 |
48 | ## Examples
49 |
50 | ### Multiline
51 |
52 | Use `TextFieldTextArea` instead of `TextFieldInput` to create a multiline text field.
53 |
54 |
55 |
56 | ### Error as tooltip
57 |
58 |
59 |
--------------------------------------------------------------------------------
/apps/docs/public/r/separator.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3 | "name": "separator",
4 | "type": "registry:ui",
5 | "title": "Separator",
6 | "description": "A separator component",
7 | "dependencies": [
8 | "solid-js",
9 | "@kobalte/core"
10 | ],
11 | "files": [
12 | {
13 | "path": "src/registry/ui/separator.tsx",
14 | "content": "import type { ValidComponent } from \"solid-js\"\nimport { splitProps } from \"solid-js\"\n\nimport type { PolymorphicProps } from \"@kobalte/core/polymorphic\"\nimport * as SeparatorPrimitive from \"@kobalte/core/separator\"\n\nimport { cn } from \"~/lib/utils\"\n\ntype SeparatorRootProps =\n SeparatorPrimitive.SeparatorRootProps & { class?: string | undefined }\n\nconst Separator = (\n props: PolymorphicProps>\n) => {\n const [local, others] = splitProps(props as SeparatorRootProps, [\"class\", \"orientation\"])\n return (\n \n )\n}\n\nexport { Separator }\n",
15 | "type": "registry:ui"
16 | }
17 | ]
18 | }
--------------------------------------------------------------------------------
/apps/docs/src/registry/ui/tooltip.tsx:
--------------------------------------------------------------------------------
1 | import type { ValidComponent } from "solid-js"
2 | import { splitProps, type Component } from "solid-js"
3 |
4 | import type { PolymorphicProps } from "@kobalte/core/polymorphic"
5 | import * as TooltipPrimitive from "@kobalte/core/tooltip"
6 |
7 | import { cn } from "~/lib/utils"
8 |
9 | const TooltipTrigger = TooltipPrimitive.Trigger
10 |
11 | const Tooltip: Component = (props) => {
12 | return
13 | }
14 |
15 | type TooltipContentProps =
16 | TooltipPrimitive.TooltipContentProps & { class?: string | undefined }
17 |
18 | const TooltipContent = (
19 | props: PolymorphicProps>
20 | ) => {
21 | const [local, others] = splitProps(props as TooltipContentProps, ["class"])
22 | return (
23 |
24 |
31 |
32 | )
33 | }
34 |
35 | export { Tooltip, TooltipTrigger, TooltipContent }
36 |
--------------------------------------------------------------------------------
/apps/docs/src/routes/(app)/docs/components/collapsible.mdx:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 | ## Installation
10 |
11 |
12 |
13 |
14 | CLI
15 | Manual
16 |
17 |
18 |
19 |
20 | ```bash
21 | npx solidui-cli@latest add collapsible
22 | ```
23 |
24 |
25 |
26 |
27 |
28 |
29 | Install the following dependencies:
30 |
31 | ```bash
32 | npm install @kobalte/core
33 | ```
34 |
35 | Copy and paste the following code into your project:
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 | ## Usage
45 |
46 | ```tsx
47 | import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "~/components/ui/collapsible"
48 | ```
49 |
50 | ```tsx
51 |
52 | Can I use this in my project?
53 |
54 | Yes. Free to use for personal and commercial projects. No attribution required.
55 |
56 |
57 | ```
58 |
--------------------------------------------------------------------------------
/packages/cli/src/utils/transformers/index.ts:
--------------------------------------------------------------------------------
1 | import { mkdtemp } from "node:fs/promises"
2 | import { tmpdir } from "node:os"
3 | import path from "node:path"
4 |
5 | import { Project, ScriptKind, type SourceFile } from "ts-morph"
6 |
7 | import type { Config } from "~/utils/config"
8 | import { transformImport } from "~/utils/transformers/transform-import"
9 | import { transformJsx } from "~/utils/transformers/transform-jsx"
10 | import { transformTwPrefix } from "~/utils/transformers/transform-tw-prefix"
11 |
12 | export type TransformProps = {
13 | filename: string
14 | raw: string
15 | config: Config
16 | }
17 |
18 | export type Transformer