@aomi-labs/widget-lib 1.1.1 → 1.1.3
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.
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
{
|
|
8
8
|
"type": "registry:component",
|
|
9
9
|
"path": "components/assistant-ui/threadlist-sidebar.tsx",
|
|
10
|
-
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport Link from \"next/link\";\nimport
|
|
10
|
+
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport Link from \"next/link\";\nimport {\n Sidebar,\n SidebarContent,\n SidebarFooter,\n SidebarHeader,\n SidebarRail,\n} from \"@/components/ui/sidebar\";\nimport { ThreadList } from \"@/components/assistant-ui/thread-list\";\nimport { WalletConnect } from \"@/components/control-bar/wallet-connect\";\n\nconst AomiLogo = ({ className }: { className?: string }) => (\n <svg\n width=\"362\"\n height=\"362\"\n viewBox=\"0 0 362 362\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={className}\n >\n <path\n d=\"M321.778 94.2349C321.778 64.4045 297.595 40.2222 267.765 40.2222C237.935 40.2222 213.752 64.4045 213.752 94.2349C213.752 124.065 237.935 148.248 267.765 148.248C297.595 148.248 321.778 124.065 321.778 94.2349ZM362 94.2349C362 146.279 319.81 188.47 267.765 188.47C215.721 188.47 173.53 146.279 173.53 94.2349C173.53 42.1904 215.721 1.33271e-06 267.765 0C319.81 0 362 42.1904 362 94.2349Z\"\n fill=\"currentColor\"\n />\n <path\n d=\"M181 0C184.792 0 188.556 0.116399 192.289 0.346221C189.506 2.74481 186.833 5.26892 184.28 7.90977C170.997 20.759 160.669 36.6452 154.42 54.4509C95.7682 66.7078 51.7143 118.709 51.7143 181C51.7143 252.403 109.597 310.286 181 310.286C243.292 310.286 295.291 266.231 307.547 207.58C325.364 201.327 341.259 190.99 354.113 177.695C356.745 175.149 359.261 172.486 361.653 169.71C361.883 173.444 362 177.208 362 181C362 280.964 280.964 362 181 362C81.0365 362 0 280.964 0 181C0 81.0365 81.0365 0 181 0Z\"\n fill=\"currentColor\"\n />\n </svg>\n);\n\ntype ThreadListSidebarProps = React.ComponentProps<typeof Sidebar> & {\n /** Position of the wallet button: \"header\" (top), \"footer\" (bottom), or null (hidden) */\n walletPosition?: \"header\" | \"footer\" | null;\n};\n\nexport function ThreadListSidebar({\n walletPosition = \"footer\",\n ...props\n}: ThreadListSidebarProps) {\n return (\n <Sidebar\n collapsible=\"offcanvas\"\n variant=\"inset\"\n className=\"relative\"\n {...props}\n >\n <SidebarHeader className=\"aomi-sidebar-header\">\n <div className=\"aomi-sidebar-header-content mb-5 ml-5 mt-5 flex items-center justify-between\">\n <Link\n href=\"https://aomi.dev\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"flex items-center justify-center\"\n >\n <AomiLogo className=\"aomi-sidebar-header-icon size-6\" />\n </Link>\n {walletPosition === \"header\" && <WalletConnect />}\n </div>\n </SidebarHeader>\n <SidebarContent className=\"aomi-sidebar-content\">\n <ThreadList />\n </SidebarContent>\n <SidebarRail />\n {walletPosition === \"footer\" && (\n <SidebarFooter className=\"aomi-sidebar-footer mx-5 mb-5 border-0\">\n <WalletConnect className=\"w-full\" />\n </SidebarFooter>\n )}\n </Sidebar>\n );\n}\n"
|
|
11
11
|
}
|
|
12
12
|
],
|
|
13
13
|
"dependencies": [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aomi-labs/widget-lib",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "Shadcn registry for the Aomi widget.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"dist"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
+
"@aomi-labs/react": "^0.2.2",
|
|
24
25
|
"@assistant-ui/react": "^0.11.28",
|
|
25
26
|
"@assistant-ui/react-markdown": "^0.11.1",
|
|
26
27
|
"@radix-ui/react-accordion": "^1.2.3",
|
|
@@ -38,8 +39,7 @@
|
|
|
38
39
|
"remark-gfm": "^4.0.1",
|
|
39
40
|
"sonner": "^1.7.4",
|
|
40
41
|
"vaul": "^1.1.2",
|
|
41
|
-
"zustand": "^5.0.8"
|
|
42
|
-
"@aomi-labs/react": "0.2.1"
|
|
42
|
+
"zustand": "^5.0.8"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"tsx": "^4.21.0"
|
|
@@ -2,20 +2,36 @@
|
|
|
2
2
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import Link from "next/link";
|
|
5
|
-
import Image from "next/image";
|
|
6
5
|
import {
|
|
7
6
|
Sidebar,
|
|
8
7
|
SidebarContent,
|
|
9
8
|
SidebarFooter,
|
|
10
9
|
SidebarHeader,
|
|
11
|
-
SidebarMenu,
|
|
12
|
-
SidebarMenuButton,
|
|
13
|
-
SidebarMenuItem,
|
|
14
10
|
SidebarRail,
|
|
15
11
|
} from "@/components/ui/sidebar";
|
|
16
12
|
import { ThreadList } from "@/components/assistant-ui/thread-list";
|
|
17
13
|
import { WalletConnect } from "@/components/control-bar/wallet-connect";
|
|
18
14
|
|
|
15
|
+
const AomiLogo = ({ className }: { className?: string }) => (
|
|
16
|
+
<svg
|
|
17
|
+
width="362"
|
|
18
|
+
height="362"
|
|
19
|
+
viewBox="0 0 362 362"
|
|
20
|
+
fill="none"
|
|
21
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
22
|
+
className={className}
|
|
23
|
+
>
|
|
24
|
+
<path
|
|
25
|
+
d="M321.778 94.2349C321.778 64.4045 297.595 40.2222 267.765 40.2222C237.935 40.2222 213.752 64.4045 213.752 94.2349C213.752 124.065 237.935 148.248 267.765 148.248C297.595 148.248 321.778 124.065 321.778 94.2349ZM362 94.2349C362 146.279 319.81 188.47 267.765 188.47C215.721 188.47 173.53 146.279 173.53 94.2349C173.53 42.1904 215.721 1.33271e-06 267.765 0C319.81 0 362 42.1904 362 94.2349Z"
|
|
26
|
+
fill="currentColor"
|
|
27
|
+
/>
|
|
28
|
+
<path
|
|
29
|
+
d="M181 0C184.792 0 188.556 0.116399 192.289 0.346221C189.506 2.74481 186.833 5.26892 184.28 7.90977C170.997 20.759 160.669 36.6452 154.42 54.4509C95.7682 66.7078 51.7143 118.709 51.7143 181C51.7143 252.403 109.597 310.286 181 310.286C243.292 310.286 295.291 266.231 307.547 207.58C325.364 201.327 341.259 190.99 354.113 177.695C356.745 175.149 359.261 172.486 361.653 169.71C361.883 173.444 362 177.208 362 181C362 280.964 280.964 362 181 362C81.0365 362 0 280.964 0 181C0 81.0365 81.0365 0 181 0Z"
|
|
30
|
+
fill="currentColor"
|
|
31
|
+
/>
|
|
32
|
+
</svg>
|
|
33
|
+
);
|
|
34
|
+
|
|
19
35
|
type ThreadListSidebarProps = React.ComponentProps<typeof Sidebar> & {
|
|
20
36
|
/** Position of the wallet button: "header" (top), "footer" (bottom), or null (hidden) */
|
|
21
37
|
walletPosition?: "header" | "footer" | null;
|
|
@@ -33,21 +49,14 @@ export function ThreadListSidebar({
|
|
|
33
49
|
{...props}
|
|
34
50
|
>
|
|
35
51
|
<SidebarHeader className="aomi-sidebar-header">
|
|
36
|
-
<div className="aomi-sidebar-header-content
|
|
52
|
+
<div className="aomi-sidebar-header-content mb-5 ml-5 mt-5 flex items-center justify-between">
|
|
37
53
|
<Link
|
|
38
54
|
href="https://aomi.dev"
|
|
39
55
|
target="_blank"
|
|
40
56
|
rel="noopener noreferrer"
|
|
41
57
|
className="flex items-center justify-center"
|
|
42
58
|
>
|
|
43
|
-
<
|
|
44
|
-
src="/assets/images/bubble.svg"
|
|
45
|
-
alt="Logo"
|
|
46
|
-
width={25}
|
|
47
|
-
height={25}
|
|
48
|
-
className="aomi-sidebar-header-icon size-6"
|
|
49
|
-
priority
|
|
50
|
-
/>
|
|
59
|
+
<AomiLogo className="aomi-sidebar-header-icon size-6" />
|
|
51
60
|
</Link>
|
|
52
61
|
{walletPosition === "header" && <WalletConnect />}
|
|
53
62
|
</div>
|
|
@@ -57,7 +66,7 @@ export function ThreadListSidebar({
|
|
|
57
66
|
</SidebarContent>
|
|
58
67
|
<SidebarRail />
|
|
59
68
|
{walletPosition === "footer" && (
|
|
60
|
-
<SidebarFooter className="aomi-sidebar-footer
|
|
69
|
+
<SidebarFooter className="aomi-sidebar-footer mx-5 mb-5 border-0">
|
|
61
70
|
<WalletConnect className="w-full" />
|
|
62
71
|
</SidebarFooter>
|
|
63
72
|
)}
|