From 73812c0c66b16fd265817bdb4c12b86e1b33c981 Mon Sep 17 00:00:00 2001 From: John Wesley Date: Tue, 2 Jul 2024 20:10:42 -0400 Subject: [PATCH] FEAT: improve server sort and filter ui --- src/components/ui/checkbox.tsx | 38 ++++++++++++ src/components/ui/label.tsx | 19 ++++++ src/components/ui/select.tsx | 109 +++++++++++++++++++++++++++++++++ src/routes/servers.tsx | 96 ++++++++++++++++++++++++----- 4 files changed, 245 insertions(+), 17 deletions(-) create mode 100644 src/components/ui/checkbox.tsx create mode 100644 src/components/ui/label.tsx create mode 100644 src/components/ui/select.tsx diff --git a/src/components/ui/checkbox.tsx b/src/components/ui/checkbox.tsx new file mode 100644 index 0000000..e251b96 --- /dev/null +++ b/src/components/ui/checkbox.tsx @@ -0,0 +1,38 @@ +import { splitProps, ValidComponent } from "solid-js" + +import * as CheckboxPrimitive from "@kobalte/core/checkbox" +import { PolymorphicProps } from "@kobalte/core/polymorphic" + +import { cn } from "~/lib/utils" + +type CheckboxRootProps = + CheckboxPrimitive.CheckboxRootProps & { class?: string | undefined } + +const Checkbox = ( + props: PolymorphicProps> +) => { + const [local, others] = splitProps(props as CheckboxRootProps, ["class"]) + return ( + + + + + + + + + + + ) +} + +export { Checkbox } diff --git a/src/components/ui/label.tsx b/src/components/ui/label.tsx new file mode 100644 index 0000000..0a8db1d --- /dev/null +++ b/src/components/ui/label.tsx @@ -0,0 +1,19 @@ +import type { Component, ComponentProps } from "solid-js" +import { splitProps } from "solid-js" + +import { cn } from "~/lib/utils" + +const Label: Component> = (props) => { + const [local, others] = splitProps(props, ["class"]) + return ( +