@kayord/ui 1.1.17 → 1.1.19

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.
Files changed (103) hide show
  1. package/dist/components/custom/action/Actions.svelte +8 -10
  2. package/dist/components/custom/data-table/VisibilitySelect.svelte +3 -5
  3. package/dist/components/ui/button/button.svelte +2 -0
  4. package/dist/components/ui/button/button.svelte.d.ts +6 -0
  5. package/dist/components/ui/button-group/button-group-separator.svelte +14 -0
  6. package/dist/components/ui/button-group/button-group-separator.svelte.d.ts +13 -0
  7. package/dist/components/ui/button-group/button-group-text.svelte +33 -0
  8. package/dist/components/ui/button-group/button-group-text.svelte.d.ts +10 -0
  9. package/dist/components/ui/button-group/button-group.svelte +44 -0
  10. package/dist/components/ui/button-group/button-group.svelte.d.ts +25 -0
  11. package/dist/components/ui/button-group/index.d.ts +4 -0
  12. package/dist/components/ui/button-group/index.js +6 -0
  13. package/dist/components/ui/empty/empty-content.svelte +14 -0
  14. package/dist/components/ui/empty/empty-content.svelte.d.ts +4 -0
  15. package/dist/components/ui/empty/empty-description.svelte +17 -0
  16. package/dist/components/ui/empty/empty-description.svelte.d.ts +4 -0
  17. package/dist/components/ui/empty/empty-header.svelte +14 -0
  18. package/dist/components/ui/empty/empty-header.svelte.d.ts +4 -0
  19. package/dist/components/ui/empty/empty-media.svelte +39 -0
  20. package/dist/components/ui/empty/empty-media.svelte.d.ts +25 -0
  21. package/dist/components/ui/empty/empty-title.svelte +10 -0
  22. package/dist/components/ui/empty/empty-title.svelte.d.ts +4 -0
  23. package/dist/components/ui/empty/empty.svelte +17 -0
  24. package/dist/components/ui/empty/empty.svelte.d.ts +4 -0
  25. package/dist/components/ui/empty/index.d.ts +7 -0
  26. package/dist/components/ui/empty/index.js +9 -0
  27. package/dist/components/ui/field/field-content.svelte +14 -0
  28. package/dist/components/ui/field/field-content.svelte.d.ts +4 -0
  29. package/dist/components/ui/field/field-description.svelte +19 -0
  30. package/dist/components/ui/field/field-description.svelte.d.ts +4 -0
  31. package/dist/components/ui/field/field-error.svelte +56 -0
  32. package/dist/components/ui/field/field-error.svelte.d.ts +11 -0
  33. package/dist/components/ui/field/field-group.svelte +17 -0
  34. package/dist/components/ui/field/field-group.svelte.d.ts +4 -0
  35. package/dist/components/ui/field/field-label.svelte +21 -0
  36. package/dist/components/ui/field/field-label.svelte.d.ts +10 -0
  37. package/dist/components/ui/field/field-legend.svelte +22 -0
  38. package/dist/components/ui/field/field-legend.svelte.d.ts +7 -0
  39. package/dist/components/ui/field/field-separator.svelte +33 -0
  40. package/dist/components/ui/field/field-separator.svelte.d.ts +8 -0
  41. package/dist/components/ui/field/field-set.svelte +18 -0
  42. package/dist/components/ui/field/field-set.svelte.d.ts +4 -0
  43. package/dist/components/ui/field/field-title.svelte +17 -0
  44. package/dist/components/ui/field/field-title.svelte.d.ts +4 -0
  45. package/dist/components/ui/field/field.svelte +51 -0
  46. package/dist/components/ui/field/field.svelte.d.ts +28 -0
  47. package/dist/components/ui/field/index.d.ts +11 -0
  48. package/dist/components/ui/field/index.js +13 -0
  49. package/dist/components/ui/form/form-button.svelte +3 -3
  50. package/dist/components/ui/form/form-button.svelte.d.ts +2 -2
  51. package/dist/components/ui/index.d.ts +7 -0
  52. package/dist/components/ui/index.js +7 -0
  53. package/dist/components/ui/input/input.svelte +4 -3
  54. package/dist/components/ui/input-group/index.d.ts +7 -0
  55. package/dist/components/ui/input-group/index.js +9 -0
  56. package/dist/components/ui/input-group/input-group-addon.svelte +50 -0
  57. package/dist/components/ui/input-group/input-group-addon.svelte.d.ts +31 -0
  58. package/dist/components/ui/input-group/input-group-button.svelte +41 -0
  59. package/dist/components/ui/input-group/input-group-button.svelte.d.ts +32 -0
  60. package/dist/components/ui/input-group/input-group-input.svelte +17 -0
  61. package/dist/components/ui/input-group/input-group-input.svelte.d.ts +11 -0
  62. package/dist/components/ui/input-group/input-group-text.svelte +16 -0
  63. package/dist/components/ui/input-group/input-group-text.svelte.d.ts +4 -0
  64. package/dist/components/ui/input-group/input-group-textarea.svelte +17 -0
  65. package/dist/components/ui/input-group/input-group-textarea.svelte.d.ts +3 -0
  66. package/dist/components/ui/input-group/input-group.svelte +32 -0
  67. package/dist/components/ui/input-group/input-group.svelte.d.ts +4 -0
  68. package/dist/components/ui/input-otp/input-otp-slot.svelte +1 -1
  69. package/dist/components/ui/item/index.d.ts +11 -0
  70. package/dist/components/ui/item/index.js +13 -0
  71. package/dist/components/ui/item/item-actions.svelte +10 -0
  72. package/dist/components/ui/item/item-actions.svelte.d.ts +4 -0
  73. package/dist/components/ui/item/item-content.svelte +14 -0
  74. package/dist/components/ui/item/item-content.svelte.d.ts +4 -0
  75. package/dist/components/ui/item/item-description.svelte +18 -0
  76. package/dist/components/ui/item/item-description.svelte.d.ts +4 -0
  77. package/dist/components/ui/item/item-footer.svelte +10 -0
  78. package/dist/components/ui/item/item-footer.svelte.d.ts +4 -0
  79. package/dist/components/ui/item/item-group.svelte +10 -0
  80. package/dist/components/ui/item/item-group.svelte.d.ts +4 -0
  81. package/dist/components/ui/item/item-header.svelte +10 -0
  82. package/dist/components/ui/item/item-header.svelte.d.ts +4 -0
  83. package/dist/components/ui/item/item-media.svelte +35 -0
  84. package/dist/components/ui/item/item-media.svelte.d.ts +28 -0
  85. package/dist/components/ui/item/item-separator.svelte +9 -0
  86. package/dist/components/ui/item/item-separator.svelte.d.ts +13 -0
  87. package/dist/components/ui/item/item-title.svelte +14 -0
  88. package/dist/components/ui/item/item-title.svelte.d.ts +4 -0
  89. package/dist/components/ui/item/item.svelte +61 -0
  90. package/dist/components/ui/item/item.svelte.d.ts +46 -0
  91. package/dist/components/ui/kbd/index.d.ts +3 -0
  92. package/dist/components/ui/kbd/index.js +5 -0
  93. package/dist/components/ui/kbd/kbd-group.svelte +10 -0
  94. package/dist/components/ui/kbd/kbd-group.svelte.d.ts +4 -0
  95. package/dist/components/ui/kbd/kbd.svelte +19 -0
  96. package/dist/components/ui/kbd/kbd.svelte.d.ts +4 -0
  97. package/dist/components/ui/separator/separator.svelte +7 -2
  98. package/dist/components/ui/spinner/index.d.ts +1 -0
  99. package/dist/components/ui/spinner/index.js +1 -0
  100. package/dist/components/ui/spinner/spinner.svelte +11 -0
  101. package/dist/components/ui/spinner/spinner.svelte.d.ts +3 -0
  102. package/dist/components/ui/textarea/textarea.svelte +2 -1
  103. package/package.json +9 -9
@@ -1,6 +1,6 @@
1
1
  <script lang="ts">
2
2
  import * as DropdownMenu from "../../ui/dropdown-menu";
3
- import { Button } from "../../ui/button";
3
+ import { Button, buttonVariants } from "../../ui/button";
4
4
  import EllipsisVerticalIcon from "@lucide/svelte/icons/ellipsis-vertical";
5
5
  import { isActionGroup, isActionType, type ActionsType } from "./types";
6
6
  import Action from "./Action.svelte";
@@ -14,15 +14,13 @@
14
14
  </script>
15
15
 
16
16
  <DropdownMenu.Root>
17
- <DropdownMenu.Trigger>
18
- <Button {variant} {size} class={cn(className)}>
19
- {#if ActionIcon}
20
- <ActionIcon />
21
- {:else}
22
- <EllipsisVerticalIcon class="h-4 w-4" />
23
- {/if}
24
- {text}
25
- </Button>
17
+ <DropdownMenu.Trigger class={cn(buttonVariants({ variant, size }), className)}>
18
+ {#if ActionIcon}
19
+ <ActionIcon />
20
+ {:else}
21
+ <EllipsisVerticalIcon class="h-4 w-4" />
22
+ {/if}
23
+ {text}
26
24
  </DropdownMenu.Trigger>
27
25
  <DropdownMenu.Content>
28
26
  {#each actions as action}
@@ -1,6 +1,6 @@
1
1
  <script lang="ts" generics="T">
2
2
  import * as DropdownMenu from "../../ui/dropdown-menu";
3
- import { Button } from "../../ui/button";
3
+ import { Button, buttonVariants } from "../../ui/button";
4
4
  import { Settings2Icon } from "@lucide/svelte";
5
5
  import type { Table } from "@tanstack/table-core";
6
6
 
@@ -12,10 +12,8 @@
12
12
  </script>
13
13
 
14
14
  <DropdownMenu.Root>
15
- <DropdownMenu.Trigger>
16
- <Button variant="outline" size="sm">
17
- <Settings2Icon class="mr-2 h-4 w-4" /> View
18
- </Button>
15
+ <DropdownMenu.Trigger class={buttonVariants({ variant: "outline", size: "sm" })}>
16
+ <Settings2Icon /> View
19
17
  </DropdownMenu.Trigger>
20
18
  <DropdownMenu.Content>
21
19
  <DropdownMenu.Label>Toggle columns</DropdownMenu.Label>
@@ -21,6 +21,8 @@
21
21
  sm: "h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",
22
22
  lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
23
23
  icon: "size-9",
24
+ "icon-sm": "size-8",
25
+ "icon-lg": "size-10",
24
26
  },
25
27
  },
26
28
  defaultVariants: {
@@ -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,4 @@
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, Root as ButtonGroup, Text as ButtonGroupText, Separator as ButtonGroupSeparator, };
@@ -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,4 @@
1
+ import type { HTMLAttributes } from "svelte/elements";
2
+ declare const EmptyContent: import("svelte").Component<HTMLAttributes<HTMLDivElement>, {}, "">;
3
+ type EmptyContent = ReturnType<typeof EmptyContent>;
4
+ export default EmptyContent;
@@ -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,4 @@
1
+ import type { HTMLAttributes } from "svelte/elements";
2
+ declare const EmptyDescription: import("svelte").Component<HTMLAttributes<HTMLDivElement>, {}, "">;
3
+ type EmptyDescription = ReturnType<typeof EmptyDescription>;
4
+ export default EmptyDescription;
@@ -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,4 @@
1
+ import type { HTMLAttributes } from "svelte/elements";
2
+ declare const EmptyHeader: import("svelte").Component<HTMLAttributes<HTMLDivElement>, {}, "">;
3
+ type EmptyHeader = ReturnType<typeof EmptyHeader>;
4
+ export default EmptyHeader;
@@ -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,4 @@
1
+ import type { HTMLAttributes } from "svelte/elements";
2
+ declare const EmptyTitle: import("svelte").Component<HTMLAttributes<HTMLDivElement>, {}, "">;
3
+ type EmptyTitle = ReturnType<typeof EmptyTitle>;
4
+ export default EmptyTitle;
@@ -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,4 @@
1
+ import type { HTMLAttributes } from "svelte/elements";
2
+ declare const Empty: import("svelte").Component<HTMLAttributes<HTMLDivElement>, {}, "">;
3
+ type Empty = ReturnType<typeof Empty>;
4
+ export default Empty;
@@ -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,4 @@
1
+ import type { HTMLAttributes } from "svelte/elements";
2
+ declare const FieldContent: import("svelte").Component<HTMLAttributes<HTMLDivElement>, {}, "">;
3
+ type FieldContent = ReturnType<typeof FieldContent>;
4
+ export default FieldContent;
@@ -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,4 @@
1
+ import type { HTMLAttributes } from "svelte/elements";
2
+ declare const FieldDescription: import("svelte").Component<HTMLAttributes<HTMLParagraphElement>, {}, "">;
3
+ type FieldDescription = ReturnType<typeof FieldDescription>;
4
+ export default FieldDescription;
@@ -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,4 @@
1
+ import type { HTMLAttributes } from "svelte/elements";
2
+ declare const FieldGroup: import("svelte").Component<HTMLAttributes<HTMLDivElement>, {}, "">;
3
+ type FieldGroup = ReturnType<typeof FieldGroup>;
4
+ export default FieldGroup;
@@ -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>