@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/.turbo/turbo-build.log +16 -16
- package/CHANGELOG.md +6 -0
- package/dist/components/ui/dropdown-menu.js.map +1 -1
- package/dist/components/ui/dropdown-menu.mjs.map +1 -1
- package/dist/index.d.mts +34 -4
- package/dist/index.d.ts +34 -4
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +43 -0
- package/package.json +1 -1
- package/src/components/core/user-dropdown.tsx +99 -0
- package/src/components/ui/dropdown-menu.tsx +1 -1
- package/src/index.ts +1 -0
- package/src/main.tsx +1 -1
- package/src/preview.tsx +1 -0
- package/src/stories/UserDropdown.stories.tsx +36 -0
package/src/preview.tsx
CHANGED
|
@@ -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
|
+
|