Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
huntabyte committed Sep 25, 2024
1 parent 7ef56b2 commit 0556887
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 24 deletions.
26 changes: 24 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sites/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"@internationalized/date": "^3.5.4",
"@unovis/svelte": "1.4.3",
"@unovis/ts": "1.4.3",
"bits-ui": "https://pkg.pr.new/huntabyte/bits-ui/bits-ui@9cc6eb7",
"bits-ui": "https://pkg.pr.new/huntabyte/bits-ui/bits-ui@1f02d0a",
"clsx": "^2.1.1",
"cmdk-sv": "^0.0.17",
"d3-scale": "^4.0.2",
Expand Down
45 changes: 25 additions & 20 deletions sites/docs/src/lib/registry/default/ui/button/button.svelte
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
<script lang="ts">
import { Button as ButtonPrimitive } from "bits-ui";
import { type Events, type Props, buttonVariants } from "./index.js";
import { type Props, buttonVariants } from "./index.js";
import { cn } from "$lib/utils.js";
type $$Props = Props;
type $$Events = Events;
let className: $$Props["class"] = undefined;
export let variant: $$Props["variant"] = "default";
export let size: $$Props["size"] = "default";
export let builders: $$Props["builders"] = [];
export { className as class };
let {
class: className,
variant = "default",
size = "default",
ref = $bindable(null),
href = undefined,
type = "button",
children,
...restProps
}: Props = $props();
</script>

<ButtonPrimitive.Root
{builders}
class={cn(buttonVariants({ variant, size, className }))}
type="button"
{...$$restProps}
on:click
on:keydown
>
<slot />
</ButtonPrimitive.Root>
{#if href}
<a bind:this={ref} class={cn(buttonVariants({ variant, size, className }))} {...restProps}>
{@render children?.()}
</a>
{:else}
<button
bind:this={ref}
class={cn(buttonVariants({ variant, size, className }))}
{type}
{...restProps}
>
{@render children?.()}
</button>
{/if}
2 changes: 1 addition & 1 deletion sites/docs/src/lib/registry/default/ui/button/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type VariantProps, tv } from "tailwind-variants";
import type { Button as ButtonPrimitive } from "bits-ui";

import Root from "./button.svelte";
import type { PrimitiveAnchorAttributes, PrimitiveButtonAttributes } from "$lib/utils.js";

Expand Down

0 comments on commit 0556887

Please sign in to comment.