@kayord/ui 1.1.17 → 1.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ui/button/button.svelte +2 -0
- package/dist/components/ui/button/button.svelte.d.ts +6 -0
- package/dist/components/ui/button-group/button-group-separator.svelte +14 -0
- package/dist/components/ui/button-group/button-group-separator.svelte.d.ts +13 -0
- package/dist/components/ui/button-group/button-group-text.svelte +33 -0
- package/dist/components/ui/button-group/button-group-text.svelte.d.ts +10 -0
- package/dist/components/ui/button-group/button-group.svelte +44 -0
- package/dist/components/ui/button-group/button-group.svelte.d.ts +25 -0
- package/dist/components/ui/button-group/index.d.ts +4 -0
- package/dist/components/ui/button-group/index.js +6 -0
- package/dist/components/ui/empty/empty-content.svelte +14 -0
- package/dist/components/ui/empty/empty-content.svelte.d.ts +4 -0
- package/dist/components/ui/empty/empty-description.svelte +17 -0
- package/dist/components/ui/empty/empty-description.svelte.d.ts +4 -0
- package/dist/components/ui/empty/empty-header.svelte +14 -0
- package/dist/components/ui/empty/empty-header.svelte.d.ts +4 -0
- package/dist/components/ui/empty/empty-media.svelte +39 -0
- package/dist/components/ui/empty/empty-media.svelte.d.ts +25 -0
- package/dist/components/ui/empty/empty-title.svelte +10 -0
- package/dist/components/ui/empty/empty-title.svelte.d.ts +4 -0
- package/dist/components/ui/empty/empty.svelte +17 -0
- package/dist/components/ui/empty/empty.svelte.d.ts +4 -0
- package/dist/components/ui/empty/index.d.ts +7 -0
- package/dist/components/ui/empty/index.js +9 -0
- package/dist/components/ui/field/field-content.svelte +14 -0
- package/dist/components/ui/field/field-content.svelte.d.ts +4 -0
- package/dist/components/ui/field/field-description.svelte +19 -0
- package/dist/components/ui/field/field-description.svelte.d.ts +4 -0
- package/dist/components/ui/field/field-error.svelte +56 -0
- package/dist/components/ui/field/field-error.svelte.d.ts +11 -0
- package/dist/components/ui/field/field-group.svelte +17 -0
- package/dist/components/ui/field/field-group.svelte.d.ts +4 -0
- package/dist/components/ui/field/field-label.svelte +21 -0
- package/dist/components/ui/field/field-label.svelte.d.ts +10 -0
- package/dist/components/ui/field/field-legend.svelte +22 -0
- package/dist/components/ui/field/field-legend.svelte.d.ts +7 -0
- package/dist/components/ui/field/field-separator.svelte +33 -0
- package/dist/components/ui/field/field-separator.svelte.d.ts +8 -0
- package/dist/components/ui/field/field-set.svelte +18 -0
- package/dist/components/ui/field/field-set.svelte.d.ts +4 -0
- package/dist/components/ui/field/field-title.svelte +17 -0
- package/dist/components/ui/field/field-title.svelte.d.ts +4 -0
- package/dist/components/ui/field/field.svelte +51 -0
- package/dist/components/ui/field/field.svelte.d.ts +28 -0
- package/dist/components/ui/field/index.d.ts +11 -0
- package/dist/components/ui/field/index.js +13 -0
- package/dist/components/ui/form/form-button.svelte +3 -3
- package/dist/components/ui/form/form-button.svelte.d.ts +2 -2
- package/dist/components/ui/index.d.ts +7 -0
- package/dist/components/ui/index.js +7 -0
- package/dist/components/ui/input/input.svelte +3 -2
- package/dist/components/ui/input-group/index.d.ts +7 -0
- package/dist/components/ui/input-group/index.js +9 -0
- package/dist/components/ui/input-group/input-group-addon.svelte +50 -0
- package/dist/components/ui/input-group/input-group-addon.svelte.d.ts +31 -0
- package/dist/components/ui/input-group/input-group-button.svelte +41 -0
- package/dist/components/ui/input-group/input-group-button.svelte.d.ts +32 -0
- package/dist/components/ui/input-group/input-group-input.svelte +16 -0
- package/dist/components/ui/input-group/input-group-input.svelte.d.ts +11 -0
- package/dist/components/ui/input-group/input-group-text.svelte +16 -0
- package/dist/components/ui/input-group/input-group-text.svelte.d.ts +4 -0
- package/dist/components/ui/input-group/input-group-textarea.svelte +16 -0
- package/dist/components/ui/input-group/input-group-textarea.svelte.d.ts +3 -0
- package/dist/components/ui/input-group/input-group.svelte +32 -0
- package/dist/components/ui/input-group/input-group.svelte.d.ts +4 -0
- package/dist/components/ui/input-otp/input-otp-slot.svelte +1 -1
- package/dist/components/ui/item/index.d.ts +11 -0
- package/dist/components/ui/item/index.js +13 -0
- package/dist/components/ui/item/item-actions.svelte +10 -0
- package/dist/components/ui/item/item-actions.svelte.d.ts +4 -0
- package/dist/components/ui/item/item-content.svelte +14 -0
- package/dist/components/ui/item/item-content.svelte.d.ts +4 -0
- package/dist/components/ui/item/item-description.svelte +18 -0
- package/dist/components/ui/item/item-description.svelte.d.ts +4 -0
- package/dist/components/ui/item/item-footer.svelte +10 -0
- package/dist/components/ui/item/item-footer.svelte.d.ts +4 -0
- package/dist/components/ui/item/item-group.svelte +10 -0
- package/dist/components/ui/item/item-group.svelte.d.ts +4 -0
- package/dist/components/ui/item/item-header.svelte +10 -0
- package/dist/components/ui/item/item-header.svelte.d.ts +4 -0
- package/dist/components/ui/item/item-media.svelte +35 -0
- package/dist/components/ui/item/item-media.svelte.d.ts +28 -0
- package/dist/components/ui/item/item-separator.svelte +9 -0
- package/dist/components/ui/item/item-separator.svelte.d.ts +13 -0
- package/dist/components/ui/item/item-title.svelte +14 -0
- package/dist/components/ui/item/item-title.svelte.d.ts +4 -0
- package/dist/components/ui/item/item.svelte +61 -0
- package/dist/components/ui/item/item.svelte.d.ts +46 -0
- package/dist/components/ui/kbd/index.d.ts +3 -0
- package/dist/components/ui/kbd/index.js +5 -0
- package/dist/components/ui/kbd/kbd-group.svelte +10 -0
- package/dist/components/ui/kbd/kbd-group.svelte.d.ts +4 -0
- package/dist/components/ui/kbd/kbd.svelte +19 -0
- package/dist/components/ui/kbd/kbd.svelte.d.ts +4 -0
- package/dist/components/ui/separator/separator.svelte +7 -2
- package/dist/components/ui/spinner/index.d.ts +1 -0
- package/dist/components/ui/spinner/index.js +1 -0
- package/dist/components/ui/spinner/spinner.svelte +11 -0
- package/dist/components/ui/spinner/spinner.svelte.d.ts +3 -0
- package/dist/components/ui/textarea/textarea.svelte +2 -1
- package/package.json +7 -7
|
@@ -15,6 +15,8 @@ export declare const buttonVariants: import("tailwind-variants").TVReturnType<{
|
|
|
15
15
|
sm: string;
|
|
16
16
|
lg: string;
|
|
17
17
|
icon: string;
|
|
18
|
+
"icon-sm": string;
|
|
19
|
+
"icon-lg": string;
|
|
18
20
|
};
|
|
19
21
|
}, undefined, "focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium outline-none transition-all focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0", {
|
|
20
22
|
variant: {
|
|
@@ -30,6 +32,8 @@ export declare const buttonVariants: import("tailwind-variants").TVReturnType<{
|
|
|
30
32
|
sm: string;
|
|
31
33
|
lg: string;
|
|
32
34
|
icon: string;
|
|
35
|
+
"icon-sm": string;
|
|
36
|
+
"icon-lg": string;
|
|
33
37
|
};
|
|
34
38
|
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
35
39
|
variant: {
|
|
@@ -45,6 +49,8 @@ export declare const buttonVariants: import("tailwind-variants").TVReturnType<{
|
|
|
45
49
|
sm: string;
|
|
46
50
|
lg: string;
|
|
47
51
|
icon: string;
|
|
52
|
+
"icon-sm": string;
|
|
53
|
+
"icon-lg": string;
|
|
48
54
|
};
|
|
49
55
|
}, undefined, "focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium outline-none transition-all focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0", unknown, unknown, undefined>>;
|
|
50
56
|
export type ButtonVariant = VariantProps<typeof buttonVariants>["variant"];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from "../../../utils.js";
|
|
3
|
+
import type { ComponentProps } from "svelte";
|
|
4
|
+
import { Separator } from "../separator/index.js";
|
|
5
|
+
|
|
6
|
+
let { class: className, orientation = "vertical", ...restProps }: ComponentProps<typeof Separator> = $props();
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<Separator
|
|
10
|
+
data-slot="button-group-separator"
|
|
11
|
+
{orientation}
|
|
12
|
+
class={cn("bg-input relative !m-0 self-stretch data-[orientation=vertical]:h-auto", className)}
|
|
13
|
+
{...restProps}
|
|
14
|
+
/>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare const ButtonGroupSeparator: import("svelte").Component<Omit<{
|
|
2
|
+
orientation?: import("bits-ui").Orientation;
|
|
3
|
+
decorative?: boolean;
|
|
4
|
+
}, "child" | "children"> & {
|
|
5
|
+
child?: import("svelte").Snippet<[{
|
|
6
|
+
props: Record<string, unknown>;
|
|
7
|
+
}]> | undefined;
|
|
8
|
+
children?: import("svelte").Snippet<[]> | undefined;
|
|
9
|
+
style?: import("bits-ui").StyleProperties | string | null | undefined;
|
|
10
|
+
ref?: HTMLElement | null | undefined;
|
|
11
|
+
} & import("bits-ui").Without<import("bits-ui").BitsPrimitiveDivAttributes, import("bits-ui").SeparatorRootPropsWithoutHTML>, {}, "">;
|
|
12
|
+
type ButtonGroupSeparator = ReturnType<typeof ButtonGroupSeparator>;
|
|
13
|
+
export default ButtonGroupSeparator;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from "../../../utils.js";
|
|
3
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
4
|
+
import type { Snippet } from "svelte";
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
class: className,
|
|
8
|
+
child,
|
|
9
|
+
...restProps
|
|
10
|
+
}: HTMLAttributes<HTMLDivElement> & {
|
|
11
|
+
child?: Snippet<[{ props: Record<string, unknown> }]>;
|
|
12
|
+
} = $props();
|
|
13
|
+
|
|
14
|
+
const classes = $derived(
|
|
15
|
+
cn(
|
|
16
|
+
"bg-muted shadow-xs flex items-center gap-2 rounded-md border px-4 text-sm font-medium [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none",
|
|
17
|
+
className
|
|
18
|
+
)
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
const mergedProps = $derived({
|
|
22
|
+
...restProps,
|
|
23
|
+
class: classes,
|
|
24
|
+
});
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
{#if child}
|
|
28
|
+
{@render child({ props: mergedProps })}
|
|
29
|
+
{:else}
|
|
30
|
+
<div {...mergedProps}>
|
|
31
|
+
{@render mergedProps.children?.()}
|
|
32
|
+
</div>
|
|
33
|
+
{/if}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
|
+
type $$ComponentProps = HTMLAttributes<HTMLDivElement> & {
|
|
4
|
+
child?: Snippet<[{
|
|
5
|
+
props: Record<string, unknown>;
|
|
6
|
+
}]>;
|
|
7
|
+
};
|
|
8
|
+
declare const ButtonGroupText: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
9
|
+
type ButtonGroupText = ReturnType<typeof ButtonGroupText>;
|
|
10
|
+
export default ButtonGroupText;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import { tv, type VariantProps } from "tailwind-variants";
|
|
3
|
+
|
|
4
|
+
const buttonGroupVariants = tv({
|
|
5
|
+
base: "flex w-fit items-stretch has-[>[data-slot=button-group]]:gap-2 [&>*]:focus-visible:relative [&>*]:focus-visible:z-10 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1",
|
|
6
|
+
variants: {
|
|
7
|
+
orientation: {
|
|
8
|
+
horizontal:
|
|
9
|
+
"[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",
|
|
10
|
+
vertical:
|
|
11
|
+
"flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none",
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
defaultVariants: {
|
|
15
|
+
orientation: "horizontal",
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export type ButtonGroupOrientation = VariantProps<typeof buttonGroupVariants>["orientation"];
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<script lang="ts">
|
|
23
|
+
import { cn } from "../../../utils.js";
|
|
24
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
25
|
+
|
|
26
|
+
let {
|
|
27
|
+
class: className,
|
|
28
|
+
children,
|
|
29
|
+
orientation = "horizontal",
|
|
30
|
+
...restProps
|
|
31
|
+
}: HTMLAttributes<HTMLDivElement> & {
|
|
32
|
+
orientation?: ButtonGroupOrientation;
|
|
33
|
+
} = $props();
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<div
|
|
37
|
+
role="group"
|
|
38
|
+
data-slot="button-group"
|
|
39
|
+
data-orientation={orientation}
|
|
40
|
+
class={cn(buttonGroupVariants({ orientation }), className)}
|
|
41
|
+
{...restProps}
|
|
42
|
+
>
|
|
43
|
+
{@render children?.()}
|
|
44
|
+
</div>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type VariantProps } from "tailwind-variants";
|
|
2
|
+
declare const buttonGroupVariants: import("tailwind-variants").TVReturnType<{
|
|
3
|
+
orientation: {
|
|
4
|
+
horizontal: string;
|
|
5
|
+
vertical: string;
|
|
6
|
+
};
|
|
7
|
+
}, undefined, "flex w-fit items-stretch has-[>[data-slot=button-group]]:gap-2 [&>*]:focus-visible:relative [&>*]:focus-visible:z-10 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1", {
|
|
8
|
+
orientation: {
|
|
9
|
+
horizontal: string;
|
|
10
|
+
vertical: string;
|
|
11
|
+
};
|
|
12
|
+
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
13
|
+
orientation: {
|
|
14
|
+
horizontal: string;
|
|
15
|
+
vertical: string;
|
|
16
|
+
};
|
|
17
|
+
}, undefined, "flex w-fit items-stretch has-[>[data-slot=button-group]]:gap-2 [&>*]:focus-visible:relative [&>*]:focus-visible:z-10 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1", unknown, unknown, undefined>>;
|
|
18
|
+
export type ButtonGroupOrientation = VariantProps<typeof buttonGroupVariants>["orientation"];
|
|
19
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
20
|
+
type $$ComponentProps = HTMLAttributes<HTMLDivElement> & {
|
|
21
|
+
orientation?: ButtonGroupOrientation;
|
|
22
|
+
};
|
|
23
|
+
declare const ButtonGroup: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
24
|
+
type ButtonGroup = ReturnType<typeof ButtonGroup>;
|
|
25
|
+
export default ButtonGroup;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import Root from "./button-group.svelte";
|
|
2
|
+
import Text from "./button-group-text.svelte";
|
|
3
|
+
import Separator from "./button-group-separator.svelte";
|
|
4
|
+
export { Root, Text, Separator,
|
|
5
|
+
//
|
|
6
|
+
Root as ButtonGroup, Text as ButtonGroupText, Separator as ButtonGroupSeparator, };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from "../../../utils.js";
|
|
3
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
4
|
+
|
|
5
|
+
let { class: className, children, ...restProps }: HTMLAttributes<HTMLDivElement> = $props();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<div
|
|
9
|
+
data-slot="empty-content"
|
|
10
|
+
class={cn("flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance", className)}
|
|
11
|
+
{...restProps}
|
|
12
|
+
>
|
|
13
|
+
{@render children?.()}
|
|
14
|
+
</div>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from "../../../utils.js";
|
|
3
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
4
|
+
|
|
5
|
+
let { class: className, children, ...restProps }: HTMLAttributes<HTMLDivElement> = $props();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<div
|
|
9
|
+
data-slot="empty-description"
|
|
10
|
+
class={cn(
|
|
11
|
+
"text-muted-foreground [&>a:hover]:text-primary text-sm/relaxed [&>a]:underline [&>a]:underline-offset-4",
|
|
12
|
+
className
|
|
13
|
+
)}
|
|
14
|
+
{...restProps}
|
|
15
|
+
>
|
|
16
|
+
{@render children?.()}
|
|
17
|
+
</div>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from "../../../utils.js";
|
|
3
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
4
|
+
|
|
5
|
+
let { class: className, children, ...restProps }: HTMLAttributes<HTMLDivElement> = $props();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<div
|
|
9
|
+
data-slot="empty-header"
|
|
10
|
+
class={cn("flex max-w-sm flex-col items-center gap-2 text-center", className)}
|
|
11
|
+
{...restProps}
|
|
12
|
+
>
|
|
13
|
+
{@render children?.()}
|
|
14
|
+
</div>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import { tv, type VariantProps } from "tailwind-variants";
|
|
3
|
+
|
|
4
|
+
export const emptyMediaVariants = tv({
|
|
5
|
+
base: "mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
6
|
+
variants: {
|
|
7
|
+
variant: {
|
|
8
|
+
default: "bg-transparent",
|
|
9
|
+
icon: "bg-muted text-foreground flex size-10 shrink-0 items-center justify-center rounded-lg [&_svg:not([class*='size-'])]:size-6",
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
defaultVariants: {
|
|
13
|
+
variant: "default",
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export type EmptyMediaVariant = VariantProps<typeof emptyMediaVariants>["variant"];
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<script lang="ts">
|
|
21
|
+
import { cn } from "../../../utils.js";
|
|
22
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
23
|
+
|
|
24
|
+
let {
|
|
25
|
+
class: className,
|
|
26
|
+
children,
|
|
27
|
+
variant = "default",
|
|
28
|
+
...restProps
|
|
29
|
+
}: HTMLAttributes<HTMLDivElement> & { variant?: EmptyMediaVariant } = $props();
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<div
|
|
33
|
+
data-slot="empty-icon"
|
|
34
|
+
data-variant={variant}
|
|
35
|
+
class={cn(emptyMediaVariants({ variant }), className)}
|
|
36
|
+
{...restProps}
|
|
37
|
+
>
|
|
38
|
+
{@render children?.()}
|
|
39
|
+
</div>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type VariantProps } from "tailwind-variants";
|
|
2
|
+
export declare const emptyMediaVariants: import("tailwind-variants").TVReturnType<{
|
|
3
|
+
variant: {
|
|
4
|
+
default: string;
|
|
5
|
+
icon: string;
|
|
6
|
+
};
|
|
7
|
+
}, undefined, "mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0", {
|
|
8
|
+
variant: {
|
|
9
|
+
default: string;
|
|
10
|
+
icon: string;
|
|
11
|
+
};
|
|
12
|
+
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
13
|
+
variant: {
|
|
14
|
+
default: string;
|
|
15
|
+
icon: string;
|
|
16
|
+
};
|
|
17
|
+
}, undefined, "mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0", unknown, unknown, undefined>>;
|
|
18
|
+
export type EmptyMediaVariant = VariantProps<typeof emptyMediaVariants>["variant"];
|
|
19
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
20
|
+
type $$ComponentProps = HTMLAttributes<HTMLDivElement> & {
|
|
21
|
+
variant?: EmptyMediaVariant;
|
|
22
|
+
};
|
|
23
|
+
declare const EmptyMedia: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
24
|
+
type EmptyMedia = ReturnType<typeof EmptyMedia>;
|
|
25
|
+
export default EmptyMedia;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from "../../../utils.js";
|
|
3
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
4
|
+
|
|
5
|
+
let { class: className, children, ...restProps }: HTMLAttributes<HTMLDivElement> = $props();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<div data-slot="empty-title" class={cn("text-lg font-medium tracking-tight", className)} {...restProps}>
|
|
9
|
+
{@render children?.()}
|
|
10
|
+
</div>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from "../../../utils.js";
|
|
3
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
4
|
+
|
|
5
|
+
let { class: className, children, ...restProps }: HTMLAttributes<HTMLDivElement> = $props();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<div
|
|
9
|
+
data-slot="empty"
|
|
10
|
+
class={cn(
|
|
11
|
+
"flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-lg border-dashed p-6 text-center text-balance md:p-12",
|
|
12
|
+
className
|
|
13
|
+
)}
|
|
14
|
+
{...restProps}
|
|
15
|
+
>
|
|
16
|
+
{@render children?.()}
|
|
17
|
+
</div>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import Root from "./empty.svelte";
|
|
2
|
+
import Header from "./empty-header.svelte";
|
|
3
|
+
import Media from "./empty-media.svelte";
|
|
4
|
+
import Title from "./empty-title.svelte";
|
|
5
|
+
import Description from "./empty-description.svelte";
|
|
6
|
+
import Content from "./empty-content.svelte";
|
|
7
|
+
export { Root, Header, Media, Title, Description, Content, Root as Empty, Header as EmptyHeader, Media as EmptyMedia, Title as EmptyTitle, Description as EmptyDescription, Content as EmptyContent, };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Root from "./empty.svelte";
|
|
2
|
+
import Header from "./empty-header.svelte";
|
|
3
|
+
import Media from "./empty-media.svelte";
|
|
4
|
+
import Title from "./empty-title.svelte";
|
|
5
|
+
import Description from "./empty-description.svelte";
|
|
6
|
+
import Content from "./empty-content.svelte";
|
|
7
|
+
export { Root, Header, Media, Title, Description, Content,
|
|
8
|
+
//
|
|
9
|
+
Root as Empty, Header as EmptyHeader, Media as EmptyMedia, Title as EmptyTitle, Description as EmptyDescription, Content as EmptyContent, };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from "../../../utils.js";
|
|
3
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
4
|
+
|
|
5
|
+
let { class: className, children, ...restProps }: HTMLAttributes<HTMLDivElement> = $props();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<div
|
|
9
|
+
data-slot="field-content"
|
|
10
|
+
class={cn("group/field-content flex flex-1 flex-col gap-1.5 leading-snug", className)}
|
|
11
|
+
{...restProps}
|
|
12
|
+
>
|
|
13
|
+
{@render children?.()}
|
|
14
|
+
</div>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from "../../../utils.js";
|
|
3
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
4
|
+
|
|
5
|
+
let { class: className, children, ...restProps }: HTMLAttributes<HTMLParagraphElement> = $props();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<p
|
|
9
|
+
data-slot="field-description"
|
|
10
|
+
class={cn(
|
|
11
|
+
"text-muted-foreground text-sm leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance",
|
|
12
|
+
"last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5",
|
|
13
|
+
"[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",
|
|
14
|
+
className
|
|
15
|
+
)}
|
|
16
|
+
{...restProps}
|
|
17
|
+
>
|
|
18
|
+
{@render children?.()}
|
|
19
|
+
</p>
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from "../../../utils.js";
|
|
3
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
4
|
+
import type { Snippet } from "svelte";
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
class: className,
|
|
8
|
+
children,
|
|
9
|
+
errors,
|
|
10
|
+
...restProps
|
|
11
|
+
}: HTMLAttributes<HTMLDivElement> & {
|
|
12
|
+
children?: Snippet;
|
|
13
|
+
errors?: { message?: string }[];
|
|
14
|
+
} = $props();
|
|
15
|
+
|
|
16
|
+
const hasContent = $derived.by(() => {
|
|
17
|
+
// has slotted error
|
|
18
|
+
if (children) return true;
|
|
19
|
+
|
|
20
|
+
// no errors
|
|
21
|
+
if (!errors) return false;
|
|
22
|
+
|
|
23
|
+
// has an error but no message
|
|
24
|
+
if (errors.length === 1 && !errors[0]?.message) {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return true;
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const isMultipleErrors = $derived(errors && errors.length > 1);
|
|
32
|
+
const singleErrorMessage = $derived(errors && errors.length === 1 && errors[0]?.message);
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
{#if hasContent}
|
|
36
|
+
<div
|
|
37
|
+
role="alert"
|
|
38
|
+
data-slot="field-error"
|
|
39
|
+
class={cn("text-destructive text-sm font-normal", className)}
|
|
40
|
+
{...restProps}
|
|
41
|
+
>
|
|
42
|
+
{#if children}
|
|
43
|
+
{@render children()}
|
|
44
|
+
{:else if singleErrorMessage}
|
|
45
|
+
{singleErrorMessage}
|
|
46
|
+
{:else if isMultipleErrors}
|
|
47
|
+
<ul class="ml-4 flex list-disc flex-col gap-1">
|
|
48
|
+
{#each errors ?? [] as error, index (index)}
|
|
49
|
+
{#if error?.message}
|
|
50
|
+
<li>{error.message}</li>
|
|
51
|
+
{/if}
|
|
52
|
+
{/each}
|
|
53
|
+
</ul>
|
|
54
|
+
{/if}
|
|
55
|
+
</div>
|
|
56
|
+
{/if}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
|
+
type $$ComponentProps = HTMLAttributes<HTMLDivElement> & {
|
|
4
|
+
children?: Snippet;
|
|
5
|
+
errors?: {
|
|
6
|
+
message?: string;
|
|
7
|
+
}[];
|
|
8
|
+
};
|
|
9
|
+
declare const FieldError: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
10
|
+
type FieldError = ReturnType<typeof FieldError>;
|
|
11
|
+
export default FieldError;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from "../../../utils.js";
|
|
3
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
4
|
+
|
|
5
|
+
let { class: className, children, ...restProps }: HTMLAttributes<HTMLDivElement> = $props();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<div
|
|
9
|
+
data-slot="field-group"
|
|
10
|
+
class={cn(
|
|
11
|
+
"group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4",
|
|
12
|
+
className
|
|
13
|
+
)}
|
|
14
|
+
{...restProps}
|
|
15
|
+
>
|
|
16
|
+
{@render children?.()}
|
|
17
|
+
</div>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Label } from "../label/index.js";
|
|
3
|
+
import { cn } from "../../../utils.js";
|
|
4
|
+
import type { ComponentProps } from "svelte";
|
|
5
|
+
|
|
6
|
+
let { ref = $bindable(null), class: className, children, ...restProps }: ComponentProps<typeof Label> = $props();
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<Label
|
|
10
|
+
bind:ref
|
|
11
|
+
data-slot="field-label"
|
|
12
|
+
class={cn(
|
|
13
|
+
"group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50",
|
|
14
|
+
"has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4",
|
|
15
|
+
"has-data-[state=checked]:bg-primary/5 has-data-[state=checked]:border-primary dark:has-data-[state=checked]:bg-primary/10",
|
|
16
|
+
className
|
|
17
|
+
)}
|
|
18
|
+
{...restProps}
|
|
19
|
+
>
|
|
20
|
+
{@render children?.()}
|
|
21
|
+
</Label>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare const FieldLabel: import("svelte").Component<Omit<{}, "child" | "children"> & {
|
|
2
|
+
child?: import("svelte").Snippet<[{
|
|
3
|
+
props: Record<string, unknown>;
|
|
4
|
+
}]> | undefined;
|
|
5
|
+
children?: import("svelte").Snippet<[]> | undefined;
|
|
6
|
+
style?: import("bits-ui").StyleProperties | string | null | undefined;
|
|
7
|
+
ref?: HTMLElement | null | undefined;
|
|
8
|
+
} & import("bits-ui").Without<import("bits-ui").BitsPrimitiveLabelAttributes, import("bits-ui").LabelRootPropsWithoutHTML>, {}, "ref">;
|
|
9
|
+
type FieldLabel = ReturnType<typeof FieldLabel>;
|
|
10
|
+
export default FieldLabel;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from "../../../utils.js";
|
|
3
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
class: className,
|
|
7
|
+
variant = "legend",
|
|
8
|
+
children,
|
|
9
|
+
...restProps
|
|
10
|
+
}: HTMLAttributes<HTMLLegendElement> & {
|
|
11
|
+
variant?: "legend" | "label";
|
|
12
|
+
} = $props();
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<legend
|
|
16
|
+
data-slot="field-legend"
|
|
17
|
+
data-variant={variant}
|
|
18
|
+
class={cn("mb-3 font-medium", "data-[variant=legend]:text-base", "data-[variant=label]:text-sm", className)}
|
|
19
|
+
{...restProps}
|
|
20
|
+
>
|
|
21
|
+
{@render children?.()}
|
|
22
|
+
</legend>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
2
|
+
type $$ComponentProps = HTMLAttributes<HTMLLegendElement> & {
|
|
3
|
+
variant?: "legend" | "label";
|
|
4
|
+
};
|
|
5
|
+
declare const FieldLegend: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
6
|
+
type FieldLegend = ReturnType<typeof FieldLegend>;
|
|
7
|
+
export default FieldLegend;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Separator } from "../separator/index.js";
|
|
3
|
+
import { cn } from "../../../utils.js";
|
|
4
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
5
|
+
import type { Snippet } from "svelte";
|
|
6
|
+
|
|
7
|
+
let {
|
|
8
|
+
class: className,
|
|
9
|
+
children,
|
|
10
|
+
...restProps
|
|
11
|
+
}: HTMLAttributes<HTMLDivElement> & {
|
|
12
|
+
children?: Snippet;
|
|
13
|
+
} = $props();
|
|
14
|
+
|
|
15
|
+
const hasContent = $derived(!!children);
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<div
|
|
19
|
+
data-slot="field-separator"
|
|
20
|
+
data-content={hasContent}
|
|
21
|
+
class={cn("relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2", className)}
|
|
22
|
+
{...restProps}
|
|
23
|
+
>
|
|
24
|
+
<Separator class="absolute inset-0 top-1/2" />
|
|
25
|
+
{#if children}
|
|
26
|
+
<span
|
|
27
|
+
class="bg-background text-muted-foreground relative mx-auto block w-fit px-2"
|
|
28
|
+
data-slot="field-separator-content"
|
|
29
|
+
>
|
|
30
|
+
{@render children()}
|
|
31
|
+
</span>
|
|
32
|
+
{/if}
|
|
33
|
+
</div>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
|
+
type $$ComponentProps = HTMLAttributes<HTMLDivElement> & {
|
|
4
|
+
children?: Snippet;
|
|
5
|
+
};
|
|
6
|
+
declare const FieldSeparator: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
7
|
+
type FieldSeparator = ReturnType<typeof FieldSeparator>;
|
|
8
|
+
export default FieldSeparator;
|