From 9cac3d472ba9ca39342bb8732e5e134b02a04b94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mac=C3=A1k?= <34311965+daelmaak@users.noreply.github.com> Date: Mon, 7 Oct 2024 07:54:36 +0200 Subject: [PATCH] add: indeterminate state for checkbox (#135) * feat: indeterminate state for checkbox * Create fuzzy-pears-watch.md --------- Co-authored-by: Stefan E-K --- .changeset/fuzzy-pears-watch.md | 5 +++ apps/docs/public/registry/ui/checkbox.json | 2 +- apps/docs/src/registry/ui/checkbox.tsx | 46 +++++++++++++++------- 3 files changed, 38 insertions(+), 15 deletions(-) create mode 100644 .changeset/fuzzy-pears-watch.md diff --git a/.changeset/fuzzy-pears-watch.md b/.changeset/fuzzy-pears-watch.md new file mode 100644 index 00000000..580ba75a --- /dev/null +++ b/.changeset/fuzzy-pears-watch.md @@ -0,0 +1,5 @@ +--- +"docs": patch +--- + +add: indeterminate state for checkbox diff --git a/apps/docs/public/registry/ui/checkbox.json b/apps/docs/public/registry/ui/checkbox.json index 7faab654..f2268102 100644 --- a/apps/docs/public/registry/ui/checkbox.json +++ b/apps/docs/public/registry/ui/checkbox.json @@ -6,7 +6,7 @@ "files": [ { "name": "checkbox.tsx", - "content": "import type { ValidComponent } from \"solid-js\"\nimport { splitProps } from \"solid-js\"\n\nimport * as CheckboxPrimitive from \"@kobalte/core/checkbox\"\nimport type { PolymorphicProps } from \"@kobalte/core/polymorphic\"\n\nimport { cn } from \"~/lib/utils\"\n\ntype CheckboxRootProps =\n CheckboxPrimitive.CheckboxRootProps & { class?: string | undefined }\n\nconst Checkbox = (\n props: PolymorphicProps>\n) => {\n const [local, others] = splitProps(props as CheckboxRootProps, [\"class\"])\n return (\n \n \n \n \n \n \n \n \n \n \n )\n}\n\nexport { Checkbox }\n" + "content": "import type { ValidComponent } from \"solid-js\"\nimport { Match, splitProps, Switch } from \"solid-js\"\n\nimport * as CheckboxPrimitive from \"@kobalte/core/checkbox\"\nimport type { PolymorphicProps } from \"@kobalte/core/polymorphic\"\n\nimport { cn } from \"~/lib/utils\"\n\ntype CheckboxRootProps =\n CheckboxPrimitive.CheckboxRootProps & { class?: string | undefined }\n\nconst Checkbox = (\n props: PolymorphicProps>\n) => {\n const [local, others] = splitProps(props as CheckboxRootProps, [\"class\"])\n return (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n )\n}\n\nexport { Checkbox }\n" } ], "type": "ui" diff --git a/apps/docs/src/registry/ui/checkbox.tsx b/apps/docs/src/registry/ui/checkbox.tsx index 137cc532..f930da9c 100644 --- a/apps/docs/src/registry/ui/checkbox.tsx +++ b/apps/docs/src/registry/ui/checkbox.tsx @@ -1,5 +1,5 @@ import type { ValidComponent } from "solid-js" -import { splitProps } from "solid-js" +import { Match, splitProps, Switch } from "solid-js" import * as CheckboxPrimitive from "@kobalte/core/checkbox" import type { PolymorphicProps } from "@kobalte/core/polymorphic" @@ -16,20 +16,38 @@ const Checkbox = ( return ( - + - - - + + + + + + + + + + + +