@vonall/auth 0.2.1 → 0.3.0

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 (107) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +22 -0
  3. package/dist/components/ui/avatar/avatar-fallback.svelte +17 -0
  4. package/dist/components/ui/avatar/avatar-fallback.svelte.d.ts +4 -0
  5. package/dist/components/ui/avatar/avatar-image.svelte +17 -0
  6. package/dist/components/ui/avatar/avatar-image.svelte.d.ts +4 -0
  7. package/dist/components/ui/avatar/avatar.svelte +17 -0
  8. package/dist/components/ui/avatar/avatar.svelte.d.ts +4 -0
  9. package/dist/components/ui/avatar/index.d.ts +4 -0
  10. package/dist/components/ui/avatar/index.js +6 -0
  11. package/dist/components/ui/button/button.svelte +82 -0
  12. package/dist/components/ui/button/button.svelte.d.ts +70 -0
  13. package/dist/components/ui/button/index.d.ts +2 -0
  14. package/dist/components/ui/button/index.js +2 -0
  15. package/dist/components/ui/card/card-action.svelte +20 -0
  16. package/dist/components/ui/card/card-action.svelte.d.ts +5 -0
  17. package/dist/components/ui/card/card-content.svelte +15 -0
  18. package/dist/components/ui/card/card-content.svelte.d.ts +5 -0
  19. package/dist/components/ui/card/card-description.svelte +20 -0
  20. package/dist/components/ui/card/card-description.svelte.d.ts +5 -0
  21. package/dist/components/ui/card/card-footer.svelte +20 -0
  22. package/dist/components/ui/card/card-footer.svelte.d.ts +5 -0
  23. package/dist/components/ui/card/card-header.svelte +23 -0
  24. package/dist/components/ui/card/card-header.svelte.d.ts +5 -0
  25. package/dist/components/ui/card/card-title.svelte +20 -0
  26. package/dist/components/ui/card/card-title.svelte.d.ts +5 -0
  27. package/dist/components/ui/card/card.svelte +23 -0
  28. package/dist/components/ui/card/card.svelte.d.ts +5 -0
  29. package/dist/components/ui/card/index.d.ts +8 -0
  30. package/dist/components/ui/card/index.js +10 -0
  31. package/dist/components/ui/input/index.d.ts +2 -0
  32. package/dist/components/ui/input/index.js +4 -0
  33. package/dist/components/ui/input/input.svelte +48 -0
  34. package/dist/components/ui/input/input.svelte.d.ts +13 -0
  35. package/dist/components/ui/label/index.d.ts +2 -0
  36. package/dist/components/ui/label/index.js +4 -0
  37. package/dist/components/ui/label/label.svelte +20 -0
  38. package/dist/components/ui/label/label.svelte.d.ts +4 -0
  39. package/dist/components/ui/tabs/index.d.ts +5 -0
  40. package/dist/components/ui/tabs/index.js +7 -0
  41. package/dist/components/ui/tabs/tabs-content.svelte +17 -0
  42. package/dist/components/ui/tabs/tabs-content.svelte.d.ts +4 -0
  43. package/dist/components/ui/tabs/tabs-list.svelte +20 -0
  44. package/dist/components/ui/tabs/tabs-list.svelte.d.ts +4 -0
  45. package/dist/components/ui/tabs/tabs-trigger.svelte +20 -0
  46. package/dist/components/ui/tabs/tabs-trigger.svelte.d.ts +4 -0
  47. package/dist/components/ui/tabs/tabs.svelte +19 -0
  48. package/dist/components/ui/tabs/tabs.svelte.d.ts +4 -0
  49. package/dist/messages.d.ts +196 -0
  50. package/dist/messages.js +404 -0
  51. package/dist/ui/AdminView.svelte +91 -0
  52. package/dist/ui/AdminView.svelte.d.ts +6 -0
  53. package/dist/ui/ChangePasswordCard.svelte +62 -0
  54. package/dist/ui/ChangePasswordCard.svelte.d.ts +3 -0
  55. package/dist/ui/DeletionTab.svelte +76 -0
  56. package/dist/ui/DeletionTab.svelte.d.ts +6 -0
  57. package/dist/ui/EinladungErstellen.svelte +74 -0
  58. package/dist/ui/EinladungErstellen.svelte.d.ts +3 -0
  59. package/dist/ui/EinladungPage.svelte +42 -0
  60. package/dist/ui/EinladungPage.svelte.d.ts +13 -0
  61. package/dist/ui/IconGithub.svelte +23 -0
  62. package/dist/ui/IconGithub.svelte.d.ts +4 -0
  63. package/dist/ui/IconGoogle.svelte +16 -0
  64. package/dist/ui/IconGoogle.svelte.d.ts +4 -0
  65. package/dist/ui/InvitationsTab.svelte +46 -0
  66. package/dist/ui/InvitationsTab.svelte.d.ts +3 -0
  67. package/dist/ui/LinksTab.svelte +91 -0
  68. package/dist/ui/LinksTab.svelte.d.ts +3 -0
  69. package/dist/ui/LoginForm.svelte +220 -0
  70. package/dist/ui/LoginForm.svelte.d.ts +8 -0
  71. package/dist/ui/MobileSettingsMenu.svelte +37 -0
  72. package/dist/ui/MobileSettingsMenu.svelte.d.ts +11 -0
  73. package/dist/ui/ProfileManagementTab.svelte +56 -0
  74. package/dist/ui/ProfileManagementTab.svelte.d.ts +7 -0
  75. package/dist/ui/RegisterForm.svelte +143 -0
  76. package/dist/ui/RegisterForm.svelte.d.ts +6 -0
  77. package/dist/ui/ResetPasswordForm.svelte +91 -0
  78. package/dist/ui/ResetPasswordForm.svelte.d.ts +3 -0
  79. package/dist/ui/SecurityTab.svelte +25 -0
  80. package/dist/ui/SecurityTab.svelte.d.ts +3 -0
  81. package/dist/ui/SessionsTab.svelte +98 -0
  82. package/dist/ui/SessionsTab.svelte.d.ts +3 -0
  83. package/dist/ui/SetPasswordCard.svelte +56 -0
  84. package/dist/ui/SetPasswordCard.svelte.d.ts +6 -0
  85. package/dist/ui/SettingsHeader.svelte +19 -0
  86. package/dist/ui/SettingsHeader.svelte.d.ts +7 -0
  87. package/dist/ui/SettingsPage.svelte +96 -0
  88. package/dist/ui/SettingsPage.svelte.d.ts +9 -0
  89. package/dist/ui/SettingsTabsList.svelte +17 -0
  90. package/dist/ui/SettingsTabsList.svelte.d.ts +7 -0
  91. package/dist/ui/SocialButton.svelte +21 -0
  92. package/dist/ui/SocialButton.svelte.d.ts +7 -0
  93. package/dist/ui/TwoFactorAuthenticationCard.svelte +216 -0
  94. package/dist/ui/TwoFactorAuthenticationCard.svelte.d.ts +3 -0
  95. package/dist/ui/Verify2FAForm.svelte +63 -0
  96. package/dist/ui/Verify2FAForm.svelte.d.ts +11 -0
  97. package/dist/ui/context.d.ts +93 -0
  98. package/dist/ui/context.js +17 -0
  99. package/dist/ui/href.d.ts +2 -0
  100. package/dist/ui/href.js +5 -0
  101. package/dist/ui/index.d.ts +10 -0
  102. package/dist/ui/index.js +11 -0
  103. package/dist/ui/tabs.d.ts +17 -0
  104. package/dist/ui/tabs.js +21 -0
  105. package/dist/utils.d.ts +12 -0
  106. package/dist/utils.js +6 -0
  107. package/package.json +17 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @vonall/auth
2
2
 
3
+ ## 0.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - The pages and the settings as components (`@vonall/auth/ui`): `LoginForm`, `RegisterForm`, `ResetPasswordForm`, `EinladungPage`, `SettingsPage` with its tabs (profile, security with two-factor, sessions, linked accounts, invitations, deletion, a Product's own), `AdminView`, `EinladungErstellen`; `setAuthUi({ authClient, appName, locale, signupMode })` in the root layout; every string in English and German.
8
+
3
9
  ## 0.2.1
4
10
 
5
11
  ### Patch Changes
package/README.md CHANGED
@@ -40,3 +40,25 @@ hash, a native module) is a peer dependency: the Product lists it, so its server
40
40
  Strings come in English and German: `configureAuthMessages({ locale, overrides })`. A Product's own user-owned tables
41
41
  reference `user.id` with `onDelete: "cascade"`, so deleting a Konto takes everything with it. The MCP endpoint's
42
42
  better-auth plugins and rate limit rule come from `@vonall/mcp` through `plugins` and `rateLimitRules`.
43
+
44
+ ## The pages and the settings (`@vonall/auth/ui`)
45
+
46
+ ```svelte
47
+ <!-- src/routes/+layout.svelte: once, so the components know the client, the app and its language -->
48
+ <script lang="ts">
49
+ import { setAuthUi } from "@vonall/auth/ui";
50
+ setAuthUi({ authClient, appName: APP_NAME, locale: LOCALE, signupMode: SIGNUP_MODE });
51
+ </script>
52
+
53
+ <!-- src/routes/auth/login/+page.svelte --> <LoginForm>{#snippet footer()}…the privacy line…{/snippet}</LoginForm>
54
+ <!-- src/routes/auth/signup/+page.svelte --> <RegisterForm />
55
+ <!-- src/routes/auth/reset-password --> <ResetPasswordForm />
56
+ <!-- src/routes/einladung/[token] --> <EinladungPage {data} tagline={APP_TAGLINE} />
57
+ <!-- src/routes/home/settings --> <SettingsPage extraTabs={[agentsTab()]}>{#snippet extra(id)}…{/snippet}</SettingsPage>
58
+ <!-- src/routes/home/manage_user --> <AdminView currentUserId={data.currentUserId} />
59
+ ```
60
+
61
+ The components read `page.data` as the loads of this package fill it (`providers`, `mail`, `state`, `einladung`, `user`,
62
+ `session`, `einladen`), use the `.panel` and `.section-kicker` classes of the Factory's `app.css`, and ship their own
63
+ copies of the shadcn-svelte avatar, button, card, input, label and tabs; the Product's `app.css` adds
64
+ `@source "../node_modules/@vonall/auth/dist"`.
@@ -0,0 +1,17 @@
1
+ <script lang="ts">
2
+ import { Avatar as AvatarPrimitive } from "bits-ui";
3
+ import { cn } from "../../../utils.js";
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ ...restProps
9
+ }: AvatarPrimitive.FallbackProps = $props();
10
+ </script>
11
+
12
+ <AvatarPrimitive.Fallback
13
+ bind:ref
14
+ data-slot="avatar-fallback"
15
+ class={cn("bg-muted flex size-full items-center justify-center rounded-full", className)}
16
+ {...restProps}
17
+ />
@@ -0,0 +1,4 @@
1
+ import { Avatar as AvatarPrimitive } from "bits-ui";
2
+ declare const AvatarFallback: import("svelte").Component<AvatarPrimitive.FallbackProps, {}, "ref">;
3
+ type AvatarFallback = ReturnType<typeof AvatarFallback>;
4
+ export default AvatarFallback;
@@ -0,0 +1,17 @@
1
+ <script lang="ts">
2
+ import { Avatar as AvatarPrimitive } from "bits-ui";
3
+ import { cn } from "../../../utils.js";
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ ...restProps
9
+ }: AvatarPrimitive.ImageProps = $props();
10
+ </script>
11
+
12
+ <AvatarPrimitive.Image
13
+ bind:ref
14
+ data-slot="avatar-image"
15
+ class={cn("aspect-square size-full", className)}
16
+ {...restProps}
17
+ />
@@ -0,0 +1,4 @@
1
+ import { Avatar as AvatarPrimitive } from "bits-ui";
2
+ declare const AvatarImage: import("svelte").Component<AvatarPrimitive.ImageProps, {}, "ref">;
3
+ type AvatarImage = ReturnType<typeof AvatarImage>;
4
+ export default AvatarImage;
@@ -0,0 +1,17 @@
1
+ <script lang="ts">
2
+ import { Avatar as AvatarPrimitive } from "bits-ui";
3
+ import { cn } from "../../../utils.js";
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ ...restProps
9
+ }: AvatarPrimitive.RootProps = $props();
10
+ </script>
11
+
12
+ <AvatarPrimitive.Root
13
+ bind:ref
14
+ data-slot="avatar"
15
+ class={cn("relative flex size-8 shrink-0 overflow-hidden rounded-full", className)}
16
+ {...restProps}
17
+ />
@@ -0,0 +1,4 @@
1
+ import { Avatar as AvatarPrimitive } from "bits-ui";
2
+ declare const Avatar: import("svelte").Component<AvatarPrimitive.RootProps, {}, "ref">;
3
+ type Avatar = ReturnType<typeof Avatar>;
4
+ export default Avatar;
@@ -0,0 +1,4 @@
1
+ import Root from "./avatar.svelte";
2
+ import Image from "./avatar-image.svelte";
3
+ import Fallback from "./avatar-fallback.svelte";
4
+ export { Root, Image, Fallback, Root as Avatar, Image as AvatarImage, Fallback as AvatarFallback, };
@@ -0,0 +1,6 @@
1
+ import Root from "./avatar.svelte";
2
+ import Image from "./avatar-image.svelte";
3
+ import Fallback from "./avatar-fallback.svelte";
4
+ export { Root, Image, Fallback,
5
+ //
6
+ Root as Avatar, Image as AvatarImage, Fallback as AvatarFallback, };
@@ -0,0 +1,82 @@
1
+ <script lang="ts" module>
2
+ import { cn, type WithElementRef } from "../../../utils.js";
3
+ import type { HTMLAnchorAttributes, HTMLButtonAttributes } from "svelte/elements";
4
+ import { type VariantProps, tv } from "tailwind-variants";
5
+
6
+ export const buttonVariants = tv({
7
+ base: "focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-lg border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-3 active:not-aria-[haspopup]:translate-y-px aria-invalid:ring-3 [&_svg:not([class*='size-'])]:size-4 group/button inline-flex shrink-0 items-center justify-center whitespace-nowrap transition-all outline-none select-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
8
+ variants: {
9
+ variant: {
10
+ default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
11
+ outline: "border-border bg-background hover:bg-muted hover:text-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 aria-expanded:bg-muted aria-expanded:text-foreground",
12
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
13
+ ghost: "hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground",
14
+ destructive: "bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30",
15
+ link: "text-primary underline-offset-4 hover:underline",
16
+ },
17
+ size: {
18
+ default: "h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
19
+ xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
20
+ sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
21
+ lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
22
+ icon: "size-8",
23
+ "icon-xs": "size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
24
+ "icon-sm": "size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg",
25
+ "icon-lg": "size-9",
26
+ },
27
+ },
28
+ defaultVariants: {
29
+ variant: "default",
30
+ size: "default",
31
+ },
32
+ });
33
+
34
+ export type ButtonVariant = VariantProps<typeof buttonVariants>["variant"];
35
+ export type ButtonSize = VariantProps<typeof buttonVariants>["size"];
36
+
37
+ export type ButtonProps = WithElementRef<HTMLButtonAttributes> &
38
+ WithElementRef<HTMLAnchorAttributes> & {
39
+ variant?: ButtonVariant;
40
+ size?: ButtonSize;
41
+ };
42
+ </script>
43
+
44
+ <script lang="ts">
45
+ let {
46
+ class: className,
47
+ variant = "default",
48
+ size = "default",
49
+ ref = $bindable(null),
50
+ href = undefined,
51
+ type = "button",
52
+ disabled,
53
+ children,
54
+ ...restProps
55
+ }: ButtonProps = $props();
56
+ </script>
57
+
58
+ {#if href}
59
+ <a
60
+ bind:this={ref}
61
+ data-slot="button"
62
+ class={cn(buttonVariants({ variant, size }), className)}
63
+ href={disabled ? undefined : href}
64
+ aria-disabled={disabled}
65
+ role={disabled ? "link" : undefined}
66
+ tabindex={disabled ? -1 : undefined}
67
+ {...restProps}
68
+ >
69
+ {@render children?.()}
70
+ </a>
71
+ {:else}
72
+ <button
73
+ bind:this={ref}
74
+ data-slot="button"
75
+ class={cn(buttonVariants({ variant, size }), className)}
76
+ {type}
77
+ {disabled}
78
+ {...restProps}
79
+ >
80
+ {@render children?.()}
81
+ </button>
82
+ {/if}
@@ -0,0 +1,70 @@
1
+ import { type WithElementRef } from "../../../utils.js";
2
+ import type { HTMLAnchorAttributes, HTMLButtonAttributes } from "svelte/elements";
3
+ import { type VariantProps } from "tailwind-variants";
4
+ export declare const buttonVariants: import("tailwind-variants").TVReturnType<{
5
+ variant: {
6
+ default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80";
7
+ outline: "border-border bg-background hover:bg-muted hover:text-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 aria-expanded:bg-muted aria-expanded:text-foreground";
8
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground";
9
+ ghost: "hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground";
10
+ destructive: "bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30";
11
+ link: "text-primary underline-offset-4 hover:underline";
12
+ };
13
+ size: {
14
+ default: "h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2";
15
+ xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3";
16
+ sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5";
17
+ lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2";
18
+ icon: "size-8";
19
+ "icon-xs": "size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3";
20
+ "icon-sm": "size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg";
21
+ "icon-lg": "size-9";
22
+ };
23
+ }, 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 dark:aria-invalid:border-destructive/50 rounded-lg border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-3 active:not-aria-[haspopup]:translate-y-px aria-invalid:ring-3 [&_svg:not([class*='size-'])]:size-4 group/button inline-flex shrink-0 items-center justify-center whitespace-nowrap transition-all outline-none select-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0", {
24
+ variant: {
25
+ default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80";
26
+ outline: "border-border bg-background hover:bg-muted hover:text-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 aria-expanded:bg-muted aria-expanded:text-foreground";
27
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground";
28
+ ghost: "hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground";
29
+ destructive: "bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30";
30
+ link: "text-primary underline-offset-4 hover:underline";
31
+ };
32
+ size: {
33
+ default: "h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2";
34
+ xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3";
35
+ sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5";
36
+ lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2";
37
+ icon: "size-8";
38
+ "icon-xs": "size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3";
39
+ "icon-sm": "size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg";
40
+ "icon-lg": "size-9";
41
+ };
42
+ }, undefined, import("tailwind-variants").TVReturnTypeLike<{
43
+ variant: {
44
+ default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80";
45
+ outline: "border-border bg-background hover:bg-muted hover:text-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 aria-expanded:bg-muted aria-expanded:text-foreground";
46
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground";
47
+ ghost: "hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground";
48
+ destructive: "bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30";
49
+ link: "text-primary underline-offset-4 hover:underline";
50
+ };
51
+ size: {
52
+ default: "h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2";
53
+ xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3";
54
+ sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5";
55
+ lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2";
56
+ icon: "size-8";
57
+ "icon-xs": "size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3";
58
+ "icon-sm": "size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg";
59
+ "icon-lg": "size-9";
60
+ };
61
+ }, undefined>>;
62
+ export type ButtonVariant = VariantProps<typeof buttonVariants>["variant"];
63
+ export type ButtonSize = VariantProps<typeof buttonVariants>["size"];
64
+ export type ButtonProps = WithElementRef<HTMLButtonAttributes> & WithElementRef<HTMLAnchorAttributes> & {
65
+ variant?: ButtonVariant;
66
+ size?: ButtonSize;
67
+ };
68
+ declare const Button: import("svelte").Component<ButtonProps, {}, "ref">;
69
+ type Button = ReturnType<typeof Button>;
70
+ export default Button;
@@ -0,0 +1,2 @@
1
+ import Root, { type ButtonProps, type ButtonSize, type ButtonVariant, buttonVariants } from "./button.svelte";
2
+ export { Root, type ButtonProps as Props, Root as Button, buttonVariants, type ButtonProps, type ButtonSize, type ButtonVariant };
@@ -0,0 +1,2 @@
1
+ import Root, { buttonVariants } from "./button.svelte";
2
+ export { Root, Root as Button, buttonVariants };
@@ -0,0 +1,20 @@
1
+ <script lang="ts">
2
+ import { cn, type WithElementRef } from "../../../utils.js";
3
+ import type { HTMLAttributes } from "svelte/elements";
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ children,
9
+ ...restProps
10
+ }: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
11
+ </script>
12
+
13
+ <div
14
+ bind:this={ref}
15
+ data-slot="card-action"
16
+ class={cn("col-start-2 row-span-2 row-start-1 self-start justify-self-end", className)}
17
+ {...restProps}
18
+ >
19
+ {@render children?.()}
20
+ </div>
@@ -0,0 +1,5 @@
1
+ import { type WithElementRef } from "../../../utils.js";
2
+ import type { HTMLAttributes } from "svelte/elements";
3
+ declare const CardAction: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLDivElement>>, {}, "ref">;
4
+ type CardAction = ReturnType<typeof CardAction>;
5
+ export default CardAction;
@@ -0,0 +1,15 @@
1
+ <script lang="ts">
2
+ import type { HTMLAttributes } from "svelte/elements";
3
+ import { cn, type WithElementRef } from "../../../utils.js";
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ children,
9
+ ...restProps
10
+ }: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
11
+ </script>
12
+
13
+ <div bind:this={ref} data-slot="card-content" class={cn("px-6", className)} {...restProps}>
14
+ {@render children?.()}
15
+ </div>
@@ -0,0 +1,5 @@
1
+ import type { HTMLAttributes } from "svelte/elements";
2
+ import { type WithElementRef } from "../../../utils.js";
3
+ declare const CardContent: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLDivElement>>, {}, "ref">;
4
+ type CardContent = ReturnType<typeof CardContent>;
5
+ export default CardContent;
@@ -0,0 +1,20 @@
1
+ <script lang="ts">
2
+ import type { HTMLAttributes } from "svelte/elements";
3
+ import { cn, type WithElementRef } from "../../../utils.js";
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ children,
9
+ ...restProps
10
+ }: WithElementRef<HTMLAttributes<HTMLParagraphElement>> = $props();
11
+ </script>
12
+
13
+ <p
14
+ bind:this={ref}
15
+ data-slot="card-description"
16
+ class={cn("text-muted-foreground text-sm", className)}
17
+ {...restProps}
18
+ >
19
+ {@render children?.()}
20
+ </p>
@@ -0,0 +1,5 @@
1
+ import type { HTMLAttributes } from "svelte/elements";
2
+ import { type WithElementRef } from "../../../utils.js";
3
+ declare const CardDescription: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLParagraphElement>>, {}, "ref">;
4
+ type CardDescription = ReturnType<typeof CardDescription>;
5
+ export default CardDescription;
@@ -0,0 +1,20 @@
1
+ <script lang="ts">
2
+ import { cn, type WithElementRef } from "../../../utils.js";
3
+ import type { HTMLAttributes } from "svelte/elements";
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ children,
9
+ ...restProps
10
+ }: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
11
+ </script>
12
+
13
+ <div
14
+ bind:this={ref}
15
+ data-slot="card-footer"
16
+ class={cn("[.border-t]:pt-6 flex items-center px-6", className)}
17
+ {...restProps}
18
+ >
19
+ {@render children?.()}
20
+ </div>
@@ -0,0 +1,5 @@
1
+ import { type WithElementRef } from "../../../utils.js";
2
+ import type { HTMLAttributes } from "svelte/elements";
3
+ declare const CardFooter: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLDivElement>>, {}, "ref">;
4
+ type CardFooter = ReturnType<typeof CardFooter>;
5
+ export default CardFooter;
@@ -0,0 +1,23 @@
1
+ <script lang="ts">
2
+ import { cn, type WithElementRef } from "../../../utils.js";
3
+ import type { HTMLAttributes } from "svelte/elements";
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ children,
9
+ ...restProps
10
+ }: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
11
+ </script>
12
+
13
+ <div
14
+ bind:this={ref}
15
+ data-slot="card-header"
16
+ class={cn(
17
+ "@container/card-header has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6 grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6",
18
+ className
19
+ )}
20
+ {...restProps}
21
+ >
22
+ {@render children?.()}
23
+ </div>
@@ -0,0 +1,5 @@
1
+ import { type WithElementRef } from "../../../utils.js";
2
+ import type { HTMLAttributes } from "svelte/elements";
3
+ declare const CardHeader: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLDivElement>>, {}, "ref">;
4
+ type CardHeader = ReturnType<typeof CardHeader>;
5
+ export default CardHeader;
@@ -0,0 +1,20 @@
1
+ <script lang="ts">
2
+ import type { HTMLAttributes } from "svelte/elements";
3
+ import { cn, type WithElementRef } from "../../../utils.js";
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ children,
9
+ ...restProps
10
+ }: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
11
+ </script>
12
+
13
+ <div
14
+ bind:this={ref}
15
+ data-slot="card-title"
16
+ class={cn("font-semibold leading-none", className)}
17
+ {...restProps}
18
+ >
19
+ {@render children?.()}
20
+ </div>
@@ -0,0 +1,5 @@
1
+ import type { HTMLAttributes } from "svelte/elements";
2
+ import { type WithElementRef } from "../../../utils.js";
3
+ declare const CardTitle: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLDivElement>>, {}, "ref">;
4
+ type CardTitle = ReturnType<typeof CardTitle>;
5
+ export default CardTitle;
@@ -0,0 +1,23 @@
1
+ <script lang="ts">
2
+ import type { HTMLAttributes } from "svelte/elements";
3
+ import { cn, type WithElementRef } from "../../../utils.js";
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ children,
9
+ ...restProps
10
+ }: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
11
+ </script>
12
+
13
+ <div
14
+ bind:this={ref}
15
+ data-slot="card"
16
+ class={cn(
17
+ "bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",
18
+ className
19
+ )}
20
+ {...restProps}
21
+ >
22
+ {@render children?.()}
23
+ </div>
@@ -0,0 +1,5 @@
1
+ import type { HTMLAttributes } from "svelte/elements";
2
+ import { type WithElementRef } from "../../../utils.js";
3
+ declare const Card: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLDivElement>>, {}, "ref">;
4
+ type Card = ReturnType<typeof Card>;
5
+ export default Card;
@@ -0,0 +1,8 @@
1
+ import Root from "./card.svelte";
2
+ import Content from "./card-content.svelte";
3
+ import Description from "./card-description.svelte";
4
+ import Footer from "./card-footer.svelte";
5
+ import Header from "./card-header.svelte";
6
+ import Title from "./card-title.svelte";
7
+ import Action from "./card-action.svelte";
8
+ export { Root, Content, Description, Footer, Header, Title, Action, Root as Card, Content as CardContent, Description as CardDescription, Footer as CardFooter, Header as CardHeader, Title as CardTitle, Action as CardAction, };
@@ -0,0 +1,10 @@
1
+ import Root from "./card.svelte";
2
+ import Content from "./card-content.svelte";
3
+ import Description from "./card-description.svelte";
4
+ import Footer from "./card-footer.svelte";
5
+ import Header from "./card-header.svelte";
6
+ import Title from "./card-title.svelte";
7
+ import Action from "./card-action.svelte";
8
+ export { Root, Content, Description, Footer, Header, Title, Action,
9
+ //
10
+ Root as Card, Content as CardContent, Description as CardDescription, Footer as CardFooter, Header as CardHeader, Title as CardTitle, Action as CardAction, };
@@ -0,0 +1,2 @@
1
+ import Root from "./input.svelte";
2
+ export { Root, Root as Input, };
@@ -0,0 +1,4 @@
1
+ import Root from "./input.svelte";
2
+ export { Root,
3
+ //
4
+ Root as Input, };
@@ -0,0 +1,48 @@
1
+ <script lang="ts">
2
+ import type { HTMLInputAttributes, HTMLInputTypeAttribute } from "svelte/elements";
3
+ import { cn, type WithElementRef } from "../../../utils.js";
4
+
5
+ type InputType = Exclude<HTMLInputTypeAttribute, "file">;
6
+
7
+ type Props = WithElementRef<
8
+ Omit<HTMLInputAttributes, "type"> &
9
+ ({ type: "file"; files?: FileList } | { type?: InputType; files?: undefined })
10
+ >;
11
+
12
+ let {
13
+ ref = $bindable(null),
14
+ value = $bindable(),
15
+ type,
16
+ files = $bindable(),
17
+ class: className,
18
+ "data-slot": dataSlot = "input",
19
+ ...restProps
20
+ }: Props = $props();
21
+ </script>
22
+
23
+ {#if type === "file"}
24
+ <input
25
+ bind:this={ref}
26
+ data-slot={dataSlot}
27
+ class={cn(
28
+ "dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 disabled:bg-input/50 dark:disabled:bg-input/80 h-8 rounded-lg border bg-transparent px-2.5 py-1 text-base transition-colors file:h-6 file:text-sm file:font-medium focus-visible:ring-3 aria-invalid:ring-3 md:text-sm file:text-foreground placeholder:text-muted-foreground w-full min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",
29
+ className
30
+ )}
31
+ type="file"
32
+ bind:files
33
+ bind:value
34
+ {...restProps}
35
+ />
36
+ {:else}
37
+ <input
38
+ bind:this={ref}
39
+ data-slot={dataSlot}
40
+ class={cn(
41
+ "dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 disabled:bg-input/50 dark:disabled:bg-input/80 h-8 rounded-lg border bg-transparent px-2.5 py-1 text-base transition-colors file:h-6 file:text-sm file:font-medium focus-visible:ring-3 aria-invalid:ring-3 md:text-sm file:text-foreground placeholder:text-muted-foreground w-full min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",
42
+ className
43
+ )}
44
+ {type}
45
+ bind:value
46
+ {...restProps}
47
+ />
48
+ {/if}
@@ -0,0 +1,13 @@
1
+ import type { HTMLInputAttributes, HTMLInputTypeAttribute } from "svelte/elements";
2
+ import { type WithElementRef } from "../../../utils.js";
3
+ type InputType = Exclude<HTMLInputTypeAttribute, "file">;
4
+ type Props = WithElementRef<Omit<HTMLInputAttributes, "type"> & ({
5
+ type: "file";
6
+ files?: FileList;
7
+ } | {
8
+ type?: InputType;
9
+ files?: undefined;
10
+ })>;
11
+ declare const Input: import("svelte").Component<Props, {}, "ref" | "value" | "files">;
12
+ type Input = ReturnType<typeof Input>;
13
+ export default Input;
@@ -0,0 +1,2 @@
1
+ import Root from "./label.svelte";
2
+ export { Root, Root as Label, };
@@ -0,0 +1,4 @@
1
+ import Root from "./label.svelte";
2
+ export { Root,
3
+ //
4
+ Root as Label, };
@@ -0,0 +1,20 @@
1
+ <script lang="ts">
2
+ import { Label as LabelPrimitive } from "bits-ui";
3
+ import { cn } from "../../../utils.js";
4
+
5
+ let {
6
+ ref = $bindable(null),
7
+ class: className,
8
+ ...restProps
9
+ }: LabelPrimitive.RootProps = $props();
10
+ </script>
11
+
12
+ <LabelPrimitive.Root
13
+ bind:ref
14
+ data-slot="label"
15
+ class={cn(
16
+ "flex select-none items-center gap-2 text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-50 group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50",
17
+ className
18
+ )}
19
+ {...restProps}
20
+ />
@@ -0,0 +1,4 @@
1
+ import { Label as LabelPrimitive } from "bits-ui";
2
+ declare const Label: import("svelte").Component<LabelPrimitive.RootProps, {}, "ref">;
3
+ type Label = ReturnType<typeof Label>;
4
+ export default Label;
@@ -0,0 +1,5 @@
1
+ import Root from "./tabs.svelte";
2
+ import Content from "./tabs-content.svelte";
3
+ import List from "./tabs-list.svelte";
4
+ import Trigger from "./tabs-trigger.svelte";
5
+ export { Root, Content, List, Trigger, Root as Tabs, Content as TabsContent, List as TabsList, Trigger as TabsTrigger, };