@authdog/react-elements 0.0.40 → 0.0.43

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 (72) hide show
  1. package/.eslintrc.js +1 -1
  2. package/.storybook/main.ts +21 -0
  3. package/.storybook/preview.ts +17 -0
  4. package/.storybook/vitest.setup.ts +7 -0
  5. package/.turbo/turbo-build.log +48 -44
  6. package/CHANGELOG.md +19 -0
  7. package/dist/components/ui/alert.js.map +1 -1
  8. package/dist/components/ui/alert.mjs.map +1 -1
  9. package/dist/components/ui/avatar.js.map +1 -1
  10. package/dist/components/ui/avatar.mjs.map +1 -1
  11. package/dist/components/ui/badge.js.map +1 -1
  12. package/dist/components/ui/badge.mjs.map +1 -1
  13. package/dist/components/ui/card.js.map +1 -1
  14. package/dist/components/ui/card.mjs.map +1 -1
  15. package/dist/components/ui/dropdown-menu.js +1 -1
  16. package/dist/components/ui/dropdown-menu.js.map +1 -1
  17. package/dist/components/ui/dropdown-menu.mjs +1 -1
  18. package/dist/components/ui/dropdown-menu.mjs.map +1 -1
  19. package/dist/components/ui/input.js.map +1 -1
  20. package/dist/components/ui/input.mjs.map +1 -1
  21. package/dist/components/ui/label.js.map +1 -1
  22. package/dist/components/ui/label.mjs.map +1 -1
  23. package/dist/components/ui/separator.js.map +1 -1
  24. package/dist/components/ui/separator.mjs.map +1 -1
  25. package/dist/components/ui/sheet.js.map +1 -1
  26. package/dist/components/ui/sheet.mjs.map +1 -1
  27. package/dist/components/ui/theme-toggle.js +3 -0
  28. package/dist/components/ui/theme-toggle.js.map +1 -0
  29. package/dist/components/ui/theme-toggle.mjs +3 -0
  30. package/dist/components/ui/theme-toggle.mjs.map +1 -0
  31. package/dist/index.d.mts +5 -2
  32. package/dist/index.d.ts +5 -2
  33. package/dist/index.js +1 -1
  34. package/dist/index.js.map +1 -1
  35. package/dist/index.mjs +1 -1
  36. package/dist/index.mjs.map +1 -1
  37. package/dist/styles.css +314 -20
  38. package/package.json +23 -12
  39. package/src/components/core/navbar.tsx +145 -112
  40. package/src/components/core/user-dropdown.tsx +22 -4
  41. package/src/components/icons.tsx +6 -12
  42. package/src/components/ui/alert.tsx +1 -1
  43. package/src/components/ui/avatar.tsx +1 -1
  44. package/src/components/ui/badge.tsx +1 -1
  45. package/src/components/ui/card.tsx +1 -1
  46. package/src/components/ui/dropdown-menu.tsx +198 -197
  47. package/src/components/ui/input.tsx +1 -1
  48. package/src/components/ui/label.tsx +1 -1
  49. package/src/components/ui/separator.tsx +1 -1
  50. package/src/components/ui/sheet.tsx +1 -1
  51. package/src/components/ui/theme-toggle.tsx +55 -0
  52. package/src/stories/core/Navbar.stories.tsx +45 -0
  53. package/src/stories/core/PlaceholderAlert.stories.tsx +23 -0
  54. package/src/stories/core/UserDropdown.stories.tsx +56 -0
  55. package/src/stories/core/UserProfile.stories.tsx +47 -0
  56. package/src/stories/flow/LoginForm.stories.tsx +20 -0
  57. package/src/stories/flow/TotpValidator.stories.tsx +23 -0
  58. package/src/stories/showcase/Landing.stories.tsx +376 -0
  59. package/src/stories/ui/Button.stories.tsx +45 -0
  60. package/vitest.config.ts +39 -0
  61. package/vitest.shims.d.ts +1 -0
  62. package/wrangler.prod.toml +4 -0
  63. package/ladle.config.mjs +0 -21
  64. package/src/main.tsx +0 -9
  65. package/src/preview.tsx +0 -7
  66. package/src/stories/Button._stories.tsx +0 -28
  67. package/src/stories/LoginForm.stories.tsx +0 -29
  68. package/src/stories/Navbar._stories.tsx +0 -66
  69. package/src/stories/PlaceholderAlert._stories.tsx +0 -13
  70. package/src/stories/TotpValidator.stories.tsx +0 -16
  71. package/src/stories/UserDropdown.stories.tsx +0 -34
  72. package/src/stories/UserProfile.stories.tsx +0 -46
@@ -1,66 +0,0 @@
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 = () => (
10
- <Navbar
11
- logoText="Authdog"
12
- items={[
13
- { title: "Home", href: "/" },
14
- { title: "Features", href: "/features" },
15
- { title: "Pricing", href: "/pricing" },
16
- { title: "Contact", href: "/contact" },
17
- ]}
18
- />
19
- );
20
-
21
- CustomNavigation.storyName = "Custom Navigation";
22
-
23
- export const CustomUser: Story = () => (
24
- <Navbar
25
- logoText="Authdog"
26
- user={{
27
- name: "Jane Smith",
28
- email: "jane@Authdog.com",
29
- image: "https://github.com/shadcn.png",
30
- }}
31
- />
32
- );
33
- CustomUser.storyName = "Custom User";
34
-
35
- export const WithChildren: Story = () => (
36
- <Navbar
37
- logoText="Authdog"
38
- children={
39
- <Button variant="outline" size="sm">
40
- Get Started
41
- </Button>
42
- }
43
- />
44
- );
45
- WithChildren.storyName = "With Children";
46
-
47
- export const CustomStyling: Story = () => (
48
- <Navbar
49
- logoText="Authdog"
50
- className="bg-gradient-to-r from-blue-500 to-purple-500 text-white"
51
- />
52
- );
53
- CustomStyling.storyName = "Custom Styling";
54
-
55
- export const WithDisabledItems: Story = () => (
56
- <Navbar
57
- logoText="Authdog"
58
- items={[
59
- { title: "Dashboard", href: "/dashboard" },
60
- { title: "Projects", href: "/projects" },
61
- { title: "Team", href: "/team", disabled: true },
62
- { title: "Reports", href: "/reports", disabled: true },
63
- ]}
64
- />
65
- );
66
- WithDisabledItems.storyName = "With Disabled Items";
@@ -1,13 +0,0 @@
1
- import type { Story } from "@ladle/react";
2
- import { PlaceholderAlert } from "../components/core/placeholder-alert";
3
- import "../global.css";
4
-
5
- export const Default: Story = () => <PlaceholderAlert />;
6
- Default.storyName = "Default Placeholder Alert";
7
- export const CustomTitleAndDescription: Story = () => (
8
- <PlaceholderAlert
9
- title="Custom Alert Title"
10
- description="This is a custom description for the placeholder alert."
11
- />
12
- );
13
- CustomTitleAndDescription.storyName = "Custom Title and Description";
@@ -1,16 +0,0 @@
1
- import type { Story } from "@ladle/react";
2
- import { TOTPValidator } from "../components/flow/totp-validator";
3
- import "../global.css";
4
-
5
- export const Default: Story = () => (
6
- <TOTPValidator
7
- onValidate={async (code) => {
8
- console.log(code);
9
- }}
10
- />
11
- );
12
- Default.storyName = "Default TOTP Validator";
13
-
14
- // export const defaultTOTPValidator: Story = () => (
15
- // <TOTPValidator />
16
- // );
@@ -1,34 +0,0 @@
1
- import React from "react";
2
- import { UserDropdown } from "../components/core/user-dropdown";
3
- import { Avatar, AvatarFallback, AvatarImage } from "../components/ui/avatar";
4
-
5
- const DemoTrigger = () => (
6
- <span className="inline-flex items-center justify-center h-10 w-10 rounded-full border bg-white shadow">
7
- <Avatar className="h-8 w-8 rounded-full">
8
- <AvatarImage src="https://i.pravatar.cc/100" />
9
- <AvatarFallback>JD</AvatarFallback>
10
- </Avatar>
11
- </span>
12
- );
13
-
14
- const demoUser = {
15
- displayName: "Jane Doe",
16
- emails: [{ value: "jane.doe@example.com" }],
17
- photos: [{ value: "https://i.pravatar.cc/100" }],
18
- };
19
-
20
- export default { title: "Core/UserDropdown" };
21
-
22
- export const Basic = () => (
23
- <div className="p-10">
24
- <UserDropdown
25
- trigger={<DemoTrigger />}
26
- user={demoUser}
27
- onManageAccount={() => alert("Manage account")}
28
- onSignout={() => alert("Sign out")}
29
- links={[{ label: "My Organizations", href: "/organizations" }]}
30
- side="bottom"
31
- align="start"
32
- />
33
- </div>
34
- );
@@ -1,46 +0,0 @@
1
- import type { StoryDefault, Story } from "@ladle/react";
2
- import { UserProfile } from "../components/core/user-profile";
3
- import "../global.css";
4
-
5
- export default {
6
- title: "Core/UserProfile",
7
- } satisfies StoryDefault;
8
-
9
- const baseUser: any = {
10
- id: "user_123",
11
- displayName: "Jane Doe",
12
- provider: "google-oauth20",
13
- emails: [{ id: "e1", value: "jane.primary@example.com" }],
14
- verifications: [],
15
- photos: [],
16
- };
17
-
18
- export const EmailNotVerified: Story = () => {
19
- return (
20
- <div className="p-6 bg-background text-foreground">
21
- <UserProfile loading={false} user={{ ...baseUser }} />
22
- </div>
23
- );
24
- };
25
- EmailNotVerified.storyName = "Email not verified";
26
-
27
- export const EmailVerified: Story = () => {
28
- const verifiedUser = {
29
- ...baseUser,
30
- verifications: [
31
- {
32
- id: "v1",
33
- email: "jane.primary@example.com",
34
- verified: true,
35
- createdAt: new Date().toISOString(),
36
- updatedAt: new Date().toISOString(),
37
- },
38
- ],
39
- };
40
- return (
41
- <div className="p-6 bg-background text-foreground">
42
- <UserProfile loading={false} user={verifiedUser} />
43
- </div>
44
- );
45
- };
46
- EmailVerified.storyName = "Email verified";