@authdog/react-elements 0.0.32 → 0.0.33

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.
package/src/preview.tsx CHANGED
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import './global.css';
2
3
 
3
4
  // This is the preview component for Ladle
4
5
  export default function Preview({ children }: { children: React.ReactNode }) {
@@ -0,0 +1,36 @@
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
+