aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/shadcn/components/ui/button
diff options
context:
space:
mode:
authorMurillo Pinheiro de Oliveira <[email protected]>2024-02-28 12:42:46 -0300
committerMurillo Pinheiro de Oliveira <[email protected]>2024-02-28 12:42:46 -0300
commit907366bc11171ac5c121e9b2ccd9c0d38e634164 (patch)
tree3cc4774ebf7b8e25a41b76a2753a2957b22787c1 /src/lib/shadcn/components/ui/button
parentbd114379db9abd9d0414d9179816a23ef041ab01 (diff)
downloadcoinos-ui-907366bc11171ac5c121e9b2ccd9c0d38e634164.tar.gz
coinos-ui-907366bc11171ac5c121e9b2ccd9c0d38e634164.zip
update: ui
Diffstat (limited to 'src/lib/shadcn/components/ui/button')
-rw-r--r--src/lib/shadcn/components/ui/button/button.svelte21
-rw-r--r--src/lib/shadcn/components/ui/button/index.js32
2 files changed, 53 insertions, 0 deletions
diff --git a/src/lib/shadcn/components/ui/button/button.svelte b/src/lib/shadcn/components/ui/button/button.svelte
new file mode 100644
index 00000000..775b9f09
--- /dev/null
+++ b/src/lib/shadcn/components/ui/button/button.svelte
@@ -0,0 +1,21 @@
+<script>
+ import { Button as ButtonPrimitive } from "bits-ui";
+ import { cn } from "$lib/shadcn/utils";
+ import { buttonVariants } from ".";
+ let className = undefined;
+ export let variant = "default";
+ export let size = "default";
+ export let builders = [];
+ export { className as class };
+</script>
+
+<ButtonPrimitive.Root
+ {builders}
+ class={cn(buttonVariants({ variant, size, className }))}
+ type="button"
+ {...$$restProps}
+ on:click
+ on:keydown
+>
+ <slot />
+</ButtonPrimitive.Root>
diff --git a/src/lib/shadcn/components/ui/button/index.js b/src/lib/shadcn/components/ui/button/index.js
new file mode 100644
index 00000000..96d93665
--- /dev/null
+++ b/src/lib/shadcn/components/ui/button/index.js
@@ -0,0 +1,32 @@
+import Root from "./button.svelte";
+import { tv } from "tailwind-variants";
+const buttonVariants = tv({
+ base: "inline-flex items-center justify-center rounded-md text-sm font-medium whitespace-nowrap ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
+ variants: {
+ variant: {
+ default: "bg-primary text-primary-foreground hover:bg-primary/90",
+ destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
+ outline:
+ "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
+ ghost: "hover:bg-accent hover:text-accent-foreground",
+ link: "text-primary underline-offset-4 hover:underline",
+ },
+ size: {
+ default: "h-10 px-4 py-2",
+ sm: "h-9 rounded-md px-3",
+ lg: "h-11 rounded-md px-8",
+ icon: "h-10 w-10",
+ },
+ },
+ defaultVariants: {
+ variant: "default",
+ size: "default",
+ },
+});
+export {
+ Root,
+ //
+ Root as Button,
+ buttonVariants,
+};