@authdog/react-elements 0.0.39 → 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 (74) 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 +45 -42
  6. package/CHANGELOG.md +18 -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 +218 -8
  34. package/package.json +25 -14
  35. package/src/components/core/client-only.tsx +10 -15
  36. package/src/components/core/navbar.tsx +81 -50
  37. package/src/components/core/placeholder-alert.tsx +7 -9
  38. package/src/components/core/user-dropdown.tsx +117 -57
  39. package/src/components/core/user-profile.tsx +180 -86
  40. package/src/components/flow/login.tsx +42 -29
  41. package/src/components/flow/totp-validator.tsx +94 -73
  42. package/src/components/icons.tsx +15 -21
  43. package/src/components/ui/alert.tsx +11 -11
  44. package/src/components/ui/avatar.tsx +10 -10
  45. package/src/components/ui/badge.tsx +9 -9
  46. package/src/components/ui/card.tsx +13 -13
  47. package/src/components/ui/dropdown-menu.tsx +214 -211
  48. package/src/components/ui/input.tsx +5 -5
  49. package/src/components/ui/label.tsx +7 -7
  50. package/src/components/ui/separator.tsx +7 -7
  51. package/src/components/ui/sheet.tsx +21 -21
  52. package/src/index.ts +6 -6
  53. package/src/stories/core/Navbar.stories.tsx +45 -0
  54. package/src/stories/core/PlaceholderAlert.stories.tsx +23 -0
  55. package/src/stories/core/UserDropdown.stories.tsx +56 -0
  56. package/src/stories/core/UserProfile.stories.tsx +47 -0
  57. package/src/stories/flow/LoginForm.stories.tsx +20 -0
  58. package/src/stories/flow/TotpValidator.stories.tsx +23 -0
  59. package/src/stories/showcase/Landing.stories.tsx +376 -0
  60. package/src/stories/ui/Button.stories.tsx +45 -0
  61. package/tsup.config.ts +6 -9
  62. package/vitest.config.ts +39 -0
  63. package/vitest.shims.d.ts +1 -0
  64. package/wrangler.prod.toml +4 -0
  65. package/ladle.config.mjs +0 -21
  66. package/src/main.tsx +0 -11
  67. package/src/preview.tsx +0 -11
  68. package/src/stories/Button._stories.tsx +0 -24
  69. package/src/stories/LoginForm.stories.tsx +0 -29
  70. package/src/stories/Navbar._stories.tsx +0 -28
  71. package/src/stories/PlaceholderAlert._stories.tsx +0 -13
  72. package/src/stories/TotpValidator.stories.tsx +0 -14
  73. package/src/stories/UserDropdown.stories.tsx +0 -36
  74. package/src/stories/UserProfile.stories.tsx +0 -46
@@ -1,36 +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
- )
35
-
36
-
@@ -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"