This commit is contained in:
eewing
2026-02-17 14:10:16 -06:00
parent 2bca5834c5
commit cf73cd3b4c
11246 changed files with 1690552 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
<script lang="ts">
import type { ButtonRootProps } from "../types.js";
let {
href,
type,
children,
disabled = false,
ref = $bindable(null),
...restProps
}: ButtonRootProps = $props();
</script>
<svelte:element
this={href ? "a" : "button"}
data-button-root
type={href ? undefined : type}
href={href && !disabled ? href : undefined}
disabled={href ? undefined : disabled}
aria-disabled={href ? disabled : undefined}
role={href && disabled ? "link" : undefined}
tabindex={href && disabled ? -1 : 0}
bind:this={ref}
{...restProps}
>
{@render children?.()}
</svelte:element>
+4
View File
@@ -0,0 +1,4 @@
import type { ButtonRootProps } from "../types.js";
declare const Button: import("svelte").Component<ButtonRootProps, {}, "ref">;
type Button = ReturnType<typeof Button>;
export default Button;
+2
View File
@@ -0,0 +1,2 @@
export { default as Root } from "./components/button.svelte";
export type { ButtonRootProps as RootProps } from "./types.js";
+1
View File
@@ -0,0 +1 @@
export { default as Root } from "./components/button.svelte";
+1
View File
@@ -0,0 +1 @@
export * as Button from "./exports.js";
+1
View File
@@ -0,0 +1 @@
export * as Button from "./exports.js";
+18
View File
@@ -0,0 +1,18 @@
import type { HTMLAnchorAttributes, HTMLButtonAttributes } from "svelte/elements";
import type { WithoutChildren } from "svelte-toolbelt";
import type { WithChildren } from "../../shared/index.js";
export type ButtonRootPropsWithoutHTML = WithChildren<{
ref?: HTMLElement | null;
}>;
type AnchorElement = ButtonRootPropsWithoutHTML & WithoutChildren<Omit<HTMLAnchorAttributes, "href" | "type">> & {
href: HTMLAnchorAttributes["href"];
type?: never;
disabled?: HTMLButtonAttributes["disabled"];
};
type ButtonElement = ButtonRootPropsWithoutHTML & WithoutChildren<Omit<HTMLButtonAttributes, "type" | "href">> & {
type?: HTMLButtonAttributes["type"];
href?: never;
disabled?: HTMLButtonAttributes["disabled"];
};
export type ButtonRootProps = AnchorElement | ButtonElement;
export {};
+1
View File
@@ -0,0 +1 @@
export {};