@authdog/react-elements 0.0.13 → 0.0.14

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 (54) hide show
  1. package/.turbo/turbo-build.log +46 -22
  2. package/CHANGELOG.md +6 -0
  3. package/dist/components/ui/alert.js +3 -0
  4. package/dist/components/ui/alert.js.map +1 -0
  5. package/dist/components/ui/alert.mjs +3 -0
  6. package/dist/components/ui/alert.mjs.map +1 -0
  7. package/dist/components/ui/badge.js +3 -0
  8. package/dist/components/ui/badge.js.map +1 -0
  9. package/dist/components/ui/badge.mjs +3 -0
  10. package/dist/components/ui/badge.mjs.map +1 -0
  11. package/dist/components/ui/card.js +3 -0
  12. package/dist/components/ui/card.js.map +1 -0
  13. package/dist/components/ui/card.mjs +3 -0
  14. package/dist/components/ui/card.mjs.map +1 -0
  15. package/dist/components/ui/input.js +3 -0
  16. package/dist/components/ui/input.js.map +1 -0
  17. package/dist/components/ui/input.mjs +3 -0
  18. package/dist/components/ui/input.mjs.map +1 -0
  19. package/dist/components/ui/label.js +3 -0
  20. package/dist/components/ui/label.js.map +1 -0
  21. package/dist/components/ui/label.mjs +3 -0
  22. package/dist/components/ui/label.mjs.map +1 -0
  23. package/dist/components/ui/separator.js +3 -0
  24. package/dist/components/ui/separator.js.map +1 -0
  25. package/dist/components/ui/separator.mjs +3 -0
  26. package/dist/components/ui/separator.mjs.map +1 -0
  27. package/dist/index.d.mts +18 -1
  28. package/dist/index.d.ts +18 -1
  29. package/dist/index.js +1 -1
  30. package/dist/index.js.map +1 -1
  31. package/dist/index.mjs +1 -1
  32. package/dist/index.mjs.map +1 -1
  33. package/dist/postcss.config.mjs +2 -0
  34. package/dist/styles.css +406 -0
  35. package/dist/tailwind.config.ts +5 -5
  36. package/ladle.config.mjs +21 -0
  37. package/package.json +16 -4
  38. package/postcss.config.mjs +2 -0
  39. package/src/components/core/user-profile.tsx +245 -0
  40. package/src/components/flow/login.tsx +158 -0
  41. package/src/components/ui/alert.tsx +66 -0
  42. package/src/components/ui/badge.tsx +46 -0
  43. package/src/components/ui/card.tsx +92 -0
  44. package/src/components/ui/input.tsx +21 -0
  45. package/src/components/ui/label.tsx +24 -0
  46. package/src/components/ui/separator.tsx +28 -0
  47. package/src/index.ts +3 -2
  48. package/src/main.tsx +11 -0
  49. package/src/preview.tsx +10 -0
  50. package/src/stories/Button.stories.tsx +24 -0
  51. package/src/stories/LoginForm.stories.tsx +29 -0
  52. package/src/stories/Navbar.stories.tsx +22 -0
  53. package/src/stories/UserProfile.stories.tsx +56 -0
  54. package/tailwind.config.ts +5 -5
@@ -0,0 +1,21 @@
1
+ import * as React from "react"
2
+
3
+ import { cn } from "@authdog/react-elements/lib/utils"
4
+
5
+ function Input({ className, type, ...props }: React.ComponentProps<"input">) {
6
+ return (
7
+ <input
8
+ type={type}
9
+ data-slot="input"
10
+ className={cn(
11
+ "file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
12
+ "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
13
+ "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
14
+ className
15
+ )}
16
+ {...props}
17
+ />
18
+ )
19
+ }
20
+
21
+ export { Input }
@@ -0,0 +1,24 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import * as LabelPrimitive from "@radix-ui/react-label"
5
+
6
+ import { cn } from "@authdog/react-elements/lib/utils"
7
+
8
+ function Label({
9
+ className,
10
+ ...props
11
+ }: React.ComponentProps<typeof LabelPrimitive.Root>) {
12
+ return (
13
+ <LabelPrimitive.Root
14
+ data-slot="label"
15
+ className={cn(
16
+ "flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
17
+ className
18
+ )}
19
+ {...props}
20
+ />
21
+ )
22
+ }
23
+
24
+ export { Label }
@@ -0,0 +1,28 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import * as SeparatorPrimitive from "@radix-ui/react-separator"
5
+
6
+ import { cn } from "@authdog/react-elements/lib/utils"
7
+
8
+ function Separator({
9
+ className,
10
+ orientation = "horizontal",
11
+ decorative = true,
12
+ ...props
13
+ }: React.ComponentProps<typeof SeparatorPrimitive.Root>) {
14
+ return (
15
+ <SeparatorPrimitive.Root
16
+ data-slot="separator-root"
17
+ decorative={decorative}
18
+ orientation={orientation}
19
+ className={cn(
20
+ "bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
21
+ className
22
+ )}
23
+ {...props}
24
+ />
25
+ )
26
+ }
27
+
28
+ export { Separator }
package/src/index.ts CHANGED
@@ -1,2 +1,3 @@
1
- export * from "./components/ui/button";
2
- export {Navbar} from "./components/core/navbar"
1
+ export {Button} from "./components/ui/button";
2
+ export {Navbar} from "./components/core/navbar";
3
+ export {UserProfile} from "./components/core/user-profile";
package/src/main.tsx ADDED
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import '../dist/styles.css';
3
+
4
+ // This is the main entry point for Ladle
5
+ export default function Main({ children }: { children: React.ReactNode }) {
6
+ return (
7
+ <div className="min-h-screen bg-background text-foreground">
8
+ {children}
9
+ </div>
10
+ );
11
+ }
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+
3
+ // This is the preview component for Ladle
4
+ export default function Preview({ children }: { children: React.ReactNode }) {
5
+ return (
6
+ <div className="ladle-main">
7
+ {children}
8
+ </div>
9
+ );
10
+ }
@@ -0,0 +1,24 @@
1
+ import type { Story } from '@ladle/react';
2
+ import { Button } from '../components/ui/button';
3
+ import "../global.css";
4
+
5
+ export const Default: Story = () => <Button>Click me</Button>;
6
+ Default.storyName = 'Default Button';
7
+
8
+ export const Primary: Story = () => <Button variant="default">Primary</Button>;
9
+ Primary.storyName = 'Primary Button';
10
+
11
+ export const Secondary: Story = () => <Button variant="secondary">Secondary</Button>;
12
+ Secondary.storyName = 'Secondary Button';
13
+
14
+ export const Destructive: Story = () => <Button variant="destructive">Delete</Button>;
15
+ Destructive.storyName = 'Destructive Button';
16
+
17
+ export const Outline: Story = () => <Button variant="outline">Outline</Button>;
18
+ Outline.storyName = 'Outline Button';
19
+
20
+ export const Ghost: Story = () => <Button variant="ghost">Ghost</Button>;
21
+ Ghost.storyName = 'Ghost Button';
22
+
23
+ export const Link: Story = () => <Button variant="link">Link</Button>;
24
+ Link.storyName = 'Link Button';
@@ -0,0 +1,29 @@
1
+ // import { useState, useEffect } from "react"
2
+ import type { Story } from "@ladle/react"
3
+ import { LoginForm } from "../components/flow/login"
4
+ import "../global.css"
5
+
6
+ export const Default: Story = () => <LoginForm />
7
+ Default.storyName = "Default Login Form"
8
+
9
+ // export const Loading: Story = () => {
10
+ // const [isLoading, setIsLoading] = useState(true)
11
+ // useEffect(() => {
12
+ // const timer = setTimeout(() => setIsLoading(false), 2000)
13
+ // return () => clearTimeout(timer)
14
+ // }, [])
15
+ // return <LoginForm />
16
+ // }
17
+ // Loading.storyName = "Loading State"
18
+
19
+ // export const WithError: Story = () => {
20
+ // const [error, setError] = useState("Invalid email or password")
21
+ // return <LoginForm />
22
+ // }
23
+ // WithError.storyName = "With Error Message"
24
+
25
+ // export const WithPrefilledEmail: Story = () => {
26
+ // const [email, setEmail] = useState("user@example.com")
27
+ // return <LoginForm />
28
+ // }
29
+ // WithPrefilledEmail.storyName = "With Pre-filled Email"
@@ -0,0 +1,22 @@
1
+ import type { Story } from '@ladle/react';
2
+ import { Navbar } from "../components/core/navbar"
3
+ import { Button } from "../components/ui/button"
4
+ import "../global.css"
5
+
6
+ export const Default: Story = () => <Navbar logoText="Authdog" />;
7
+ Default.storyName = 'Default Navbar';
8
+
9
+ export const CustomNavigation: Story = () => <Navbar logoText="Authdog" items={[{ title: "Home", href: "/" }, { title: "Features", href: "/features" }, { title: "Pricing", href: "/pricing" }, { title: "Contact", href: "/contact" }]} />;
10
+ CustomNavigation.storyName = 'Custom Navigation';
11
+
12
+ export const CustomUser: Story = () => <Navbar logoText="Authdog" user={{ name: "Jane Smith", email: "jane@Authdog.com", image: "https://github.com/shadcn.png" }} />;
13
+ CustomUser.storyName = 'Custom User';
14
+
15
+ export const WithChildren: Story = () => <Navbar logoText="Authdog" children={<Button variant="outline" size="sm">Get Started</Button>} />;
16
+ WithChildren.storyName = 'With Children';
17
+
18
+ export const CustomStyling: Story = () => <Navbar logoText="Authdog" className="bg-gradient-to-r from-blue-500 to-purple-500 text-white" />;
19
+ CustomStyling.storyName = 'Custom Styling';
20
+
21
+ export const WithDisabledItems: Story = () => <Navbar logoText="Authdog" items={[{ title: "Dashboard", href: "/dashboard" }, { title: "Projects", href: "/projects" }, { title: "Team", href: "/team", disabled: true }, { title: "Reports", href: "/reports", disabled: true }]} />;
22
+ WithDisabledItems.storyName = 'With Disabled Items';
@@ -0,0 +1,56 @@
1
+ import type { Story } from '@ladle/react';
2
+ import { UserProfile, UserProfileProps } from '../components/core/user-profile';
3
+ import "../global.css";
4
+
5
+ export const Default: Story = () => (
6
+ <UserProfile
7
+ user={{
8
+ name: "Jaylon Dias",
9
+ email: "example@clerk.dev",
10
+ image: "/placeholder-user.jpg"
11
+ }}
12
+ />
13
+ );
14
+ Default.storyName = 'Default User Profile';
15
+
16
+ export const WithCustomUser: Story = () => (
17
+ <UserProfile
18
+ user={{
19
+ name: "Jane Smith",
20
+ email: "jane@example.com",
21
+ image: "/placeholder-user.jpg"
22
+ }}
23
+ />
24
+ );
25
+ WithCustomUser.storyName = 'User Profile with Custom User';
26
+
27
+ export const WithMultipleEmails: Story = () => (
28
+ <UserProfile
29
+ user={{
30
+ name: "John Doe",
31
+ email: "john@example.com",
32
+ image: "/placeholder-user.jpg"
33
+ }}
34
+ emails={[
35
+ { address: "john@example.com", isPrimary: true },
36
+ { address: "john@personal.com", isPrimary: false },
37
+ { address: "john@work.com", isPrimary: false }
38
+ ]}
39
+ />
40
+ );
41
+ WithMultipleEmails.storyName = 'User Profile with Multiple Emails';
42
+
43
+ export const WithConnectedAccounts: Story = () => (
44
+ <UserProfile
45
+ user={{
46
+ name: "Alex Johnson",
47
+ email: "alex@example.com",
48
+ image: "/placeholder-user.jpg"
49
+ }}
50
+ connectedAccounts={[
51
+ { provider: "Google", email: "alex@gmail.com" },
52
+ { provider: "GitHub", email: "alex@github.com" }
53
+ ]}
54
+ />
55
+ );
56
+ WithConnectedAccounts.storyName = 'User Profile with Connected Accounts';
@@ -4,11 +4,11 @@ import tailwindcssAnimate from "tailwindcss-animate";
4
4
  const config = {
5
5
  darkMode: ["class"],
6
6
  content: [
7
- "./pages/**/*.{ts,tsx}",
8
- "./components/**/*.{ts,tsx}",
9
- "./components/**/**/*.{ts,tsx}",
10
- "./app/**/*.{ts,tsx}",
11
- "./src/**/*.{ts,tsx}"
7
+ "./src/**/*.{js,ts,jsx,tsx}",
8
+ "./src/**/*.stories.{js,ts,jsx,tsx}",
9
+ "./src/components/**/*.{js,ts,jsx,tsx}",
10
+ "./src/components/**/**/*.{js,ts,jsx,tsx}",
11
+ "./src/preview.{js,ts,jsx,tsx}",
12
12
  ],
13
13
  prefix: "",
14
14
  theme: {