@authdog/react-elements 0.0.40 → 0.0.42

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 (66) 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 +43 -43
  6. package/CHANGELOG.md +12 -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/index.d.mts +3 -1
  28. package/dist/index.d.ts +3 -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/styles.css +217 -7
  34. package/package.json +21 -10
  35. package/src/components/core/user-dropdown.tsx +22 -4
  36. package/src/components/icons.tsx +6 -12
  37. package/src/components/ui/alert.tsx +1 -1
  38. package/src/components/ui/avatar.tsx +1 -1
  39. package/src/components/ui/badge.tsx +1 -1
  40. package/src/components/ui/card.tsx +1 -1
  41. package/src/components/ui/dropdown-menu.tsx +198 -197
  42. package/src/components/ui/input.tsx +1 -1
  43. package/src/components/ui/label.tsx +1 -1
  44. package/src/components/ui/separator.tsx +1 -1
  45. package/src/components/ui/sheet.tsx +1 -1
  46. package/src/stories/core/Navbar.stories.tsx +45 -0
  47. package/src/stories/core/PlaceholderAlert.stories.tsx +23 -0
  48. package/src/stories/core/UserDropdown.stories.tsx +56 -0
  49. package/src/stories/core/UserProfile.stories.tsx +47 -0
  50. package/src/stories/flow/LoginForm.stories.tsx +20 -0
  51. package/src/stories/flow/TotpValidator.stories.tsx +23 -0
  52. package/src/stories/showcase/Landing.stories.tsx +376 -0
  53. package/src/stories/ui/Button.stories.tsx +45 -0
  54. package/vitest.config.ts +39 -0
  55. package/vitest.shims.d.ts +1 -0
  56. package/wrangler.prod.toml +4 -0
  57. package/ladle.config.mjs +0 -21
  58. package/src/main.tsx +0 -9
  59. package/src/preview.tsx +0 -7
  60. package/src/stories/Button._stories.tsx +0 -28
  61. package/src/stories/LoginForm.stories.tsx +0 -29
  62. package/src/stories/Navbar._stories.tsx +0 -66
  63. package/src/stories/PlaceholderAlert._stories.tsx +0 -13
  64. package/src/stories/TotpValidator.stories.tsx +0 -16
  65. package/src/stories/UserDropdown.stories.tsx +0 -34
  66. package/src/stories/UserProfile.stories.tsx +0 -46
@@ -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";