Skip to content

Commit

Permalink
feat(api): add solid-icons when init
Browse files Browse the repository at this point in the history
fix(ww): wrong `textarea` file
  • Loading branch information
hngngn committed Oct 12, 2023
1 parent c152f29 commit c502b32
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 51 deletions.
5 changes: 5 additions & 0 deletions .changeset/ten-students-sleep.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"shadcn-solid": patch
---

- add `solid-icons` when `init`
2 changes: 1 addition & 1 deletion apps/www/public/registry/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@
"textfield"
],
"files": [
"ui/textfield.tsx"
"ui/textarea.tsx"
],
"type": "components:ui"
},
Expand Down
4 changes: 2 additions & 2 deletions apps/www/public/registry/styles/default/textarea.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
],
"files": [
{
"name": "textfield.tsx",
"content": "import { cn } from \"@/lib/cn\"\nimport { TextField as TextFieldPrimitive } from \"@kobalte/core\"\nimport { cva } from \"class-variance-authority\"\nimport { splitProps, type ParentComponent } from \"solid-js\"\n\nexport const TextFieldErrorMessage = TextFieldPrimitive.ErrorMessage\nexport const TextFieldDescription = TextFieldPrimitive.Description\nexport const TextField = TextFieldPrimitive.Root\n\nexport const labelVariants = cva(\n\t\"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n)\n\nexport const TextFieldLabel: ParentComponent<\n\tTextFieldPrimitive.TextFieldLabelProps\n> = (props) => {\n\tconst [local, rest] = splitProps(props, [\"class\"])\n\treturn (\n\t\t<TextFieldPrimitive.Label\n\t\t\tclass={cn(labelVariants(), local.class)}\n\t\t\t{...rest}\n\t\t/>\n\t)\n}\n\nexport const TextFieldInput: ParentComponent<\n\tTextFieldPrimitive.TextFieldInputProps\n> = (props) => {\n\tconst [local, rest] = splitProps(props, [\"class\"])\n\treturn (\n\t\t<TextFieldPrimitive.Input\n\t\t\tclass={cn(\n\t\t\t\t\"flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50\",\n\t\t\t\tlocal.class\n\t\t\t)}\n\t\t\t{...rest}\n\t\t/>\n\t)\n}\n"
"name": "textarea.tsx",
"content": "import { cn } from \"@/lib/cn\"\nimport { TextField as TextFieldPrimitive } from \"@kobalte/core\"\nimport { splitProps, type ParentComponent } from \"solid-js\"\n\nexport const TextFieldTextArea: ParentComponent<\n\tTextFieldPrimitive.TextFieldTextAreaProps\n> = (props) => {\n\tconst [local, rest] = splitProps(props, [\"class\"])\n\treturn (\n\t\t<TextFieldPrimitive.TextArea\n\t\t\tclass={cn(\n\t\t\t\t\"flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50\",\n\t\t\t\tlocal.class\n\t\t\t)}\n\t\t\t{...rest}\n\t\t/>\n\t)\n}\n"
}
],
"type": "components:ui"
Expand Down
2 changes: 1 addition & 1 deletion apps/www/src/__registry__/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ export const Index: Record<string, any> = {
type: "components:ui",
registryDependencies: ["textfield"],
component: lazy(() => import("@/registry/default/ui/textarea")),
files: ["registry/default/ui/textfield.tsx"],
files: ["registry/default/ui/textarea.tsx"],
},
"toast": {
name: "toast",
Expand Down
4 changes: 2 additions & 2 deletions apps/www/src/registry/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const ui: Registry = [
{
name: "checkbox",
type: "components:ui",
dependencies: ["@kobalte/core", "solid-icons"],
dependencies: ["@kobalte/core"],
files: ["ui/checkbox.tsx"],
},
{
Expand Down Expand Up @@ -153,7 +153,7 @@ const ui: Registry = [
type: "components:ui",
dependencies: ["@kobalte/core"],
registryDependencies: ["textfield"],
files: ["ui/textfield.tsx"],
files: ["ui/textarea.tsx"],
},
{
name: "toast",
Expand Down
1 change: 1 addition & 0 deletions packages/cli/src/commands/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const PROJECT_DEPENDENCIES = [
"class-variance-authority",
"clsx",
"tailwind-merge",
"solid-icons",
]

const initOptionsSchema = z.object({
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ async function main() {
const program = new Command()
.name("shadcn-solid")
.description("add components and dependencies to your project")
.version("0.3.0", "-v, --version", "display the version number")
.version("0.3.1", "-v, --version", "display the version number")

program.addCommand(init).addCommand(add)

Expand Down
44 changes: 0 additions & 44 deletions packages/cli/src/utils/get-project-info.ts

This file was deleted.

0 comments on commit c502b32

Please sign in to comment.