@appcorp/shadcn 1.1.31 → 1.1.34
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/components/aceternity-ui/apple-cards-carousel.js +1 -1
- package/components/shadcn-example/ai-chat/chat-interface.d.ts +11 -0
- package/components/shadcn-example/ai-chat/chat-interface.js +70 -0
- package/components/shadcn-example/ai-chat/index.d.ts +38 -0
- package/components/shadcn-example/ai-chat/index.js +66 -0
- package/components/shadcn-example/ai-chat/sidebar.d.ts +15 -0
- package/components/shadcn-example/ai-chat/sidebar.js +68 -0
- package/components/shadcn-example/ai-chat/welcome-section.d.ts +12 -0
- package/components/shadcn-example/ai-chat/welcome-section.js +26 -0
- package/components/shadcn-example/blog-detail-page/header.d.ts +1 -1
- package/components/shadcn-example/blog-detail-page/header.js +1 -1
- package/components/shadcn-io/gantt/index.js +0 -1
- package/components/theme-provider.js +4 -4
- package/components/ui/resizable.d.ts +1 -1
- package/components/ui/scroll-area.js +1 -1
- package/components/ui/theme-switcher.js +2 -2
- package/package.json +102 -96
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ChangeEvent, FC, FormEvent } from "react";
|
|
2
|
+
import type { UIMessage as Message } from "@ai-sdk/react";
|
|
3
|
+
interface ChatInterfaceProps {
|
|
4
|
+
messages: Message[];
|
|
5
|
+
input: string;
|
|
6
|
+
handleInputChange: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
7
|
+
handleSubmit: (e: FormEvent<HTMLFormElement>) => void;
|
|
8
|
+
isLoading: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const ChatInterface: FC<ChatInterfaceProps>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.ChatInterface = void 0;
|
|
8
|
+
var react_1 = __importDefault(require("react"));
|
|
9
|
+
var button_1 = require("@/components/ui/button");
|
|
10
|
+
var input_1 = require("@/components/ui/input");
|
|
11
|
+
var scroll_area_1 = require("@/components/ui/scroll-area");
|
|
12
|
+
var avatar_1 = require("@/components/ui/avatar");
|
|
13
|
+
var lucide_react_1 = require("lucide-react");
|
|
14
|
+
function getMessageText(message) {
|
|
15
|
+
// UIMessage uses `parts` with text parts having { type: 'text', text }
|
|
16
|
+
var parts = message.parts || [];
|
|
17
|
+
return parts
|
|
18
|
+
.filter(function (p) { return (p === null || p === void 0 ? void 0 : p.type) === "text"; })
|
|
19
|
+
.map(function (p) { return p.text; })
|
|
20
|
+
.join("");
|
|
21
|
+
}
|
|
22
|
+
var ChatInterface = function (_a) {
|
|
23
|
+
var messages = _a.messages, input = _a.input, handleInputChange = _a.handleInputChange, handleSubmit = _a.handleSubmit, isLoading = _a.isLoading;
|
|
24
|
+
return (react_1.default.createElement("div", { className: "flex flex-1 flex-col min-h-0" },
|
|
25
|
+
react_1.default.createElement(scroll_area_1.ScrollArea, { className: "flex-1 min-h-0 h-full p-4 block" },
|
|
26
|
+
react_1.default.createElement("div", { className: "mx-auto max-w-6xl space-y-6 flex-1 min-h-0 flex flex-col justify-end h-full" },
|
|
27
|
+
messages.map(function (message) { return (react_1.default.createElement("div", { key: message.id, className: "flex gap-4" }, message.role === "user" ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
28
|
+
react_1.default.createElement("div", { className: "flex-1" },
|
|
29
|
+
react_1.default.createElement("div", { className: "bg-muted rounded-lg p-4" },
|
|
30
|
+
react_1.default.createElement("p", null, getMessageText(message)))),
|
|
31
|
+
react_1.default.createElement(avatar_1.Avatar, null,
|
|
32
|
+
react_1.default.createElement(avatar_1.AvatarImage, { src: "/placeholder.svg?height=32&width=32" }),
|
|
33
|
+
react_1.default.createElement(avatar_1.AvatarFallback, null, "JD")))) : (react_1.default.createElement(react_1.default.Fragment, null,
|
|
34
|
+
react_1.default.createElement(avatar_1.Avatar, null,
|
|
35
|
+
react_1.default.createElement(avatar_1.AvatarFallback, { className: "bg-blue-500" }, "AI")),
|
|
36
|
+
react_1.default.createElement("div", { className: "flex-1" },
|
|
37
|
+
react_1.default.createElement("div", { className: "bg-muted rounded-lg border p-4" },
|
|
38
|
+
react_1.default.createElement("p", { className: "mb-4" }, getMessageText(message)),
|
|
39
|
+
react_1.default.createElement("div", { className: "flex items-center gap-2" },
|
|
40
|
+
react_1.default.createElement(button_1.Button, { variant: "ghost", size: "sm", className: "h-8 w-8 p-0" },
|
|
41
|
+
react_1.default.createElement(lucide_react_1.Copy, { className: "h-4 w-4" })),
|
|
42
|
+
react_1.default.createElement(button_1.Button, { variant: "ghost", size: "sm", className: "h-8 w-8 p-0" },
|
|
43
|
+
react_1.default.createElement(lucide_react_1.Share, { className: "h-4 w-4" })),
|
|
44
|
+
react_1.default.createElement("div", { className: "ml-auto flex items-center gap-1" },
|
|
45
|
+
react_1.default.createElement(button_1.Button, { variant: "ghost", size: "sm", className: "h-8 w-8 p-0" },
|
|
46
|
+
react_1.default.createElement(lucide_react_1.ThumbsDown, { className: "h-4 w-4" })),
|
|
47
|
+
react_1.default.createElement(button_1.Button, { variant: "ghost", size: "sm", className: "h-8 w-8 p-0" },
|
|
48
|
+
react_1.default.createElement(lucide_react_1.ThumbsUp, { className: "h-4 w-4" })))))))))); }),
|
|
49
|
+
isLoading && (react_1.default.createElement("div", { className: "flex gap-4" },
|
|
50
|
+
react_1.default.createElement(avatar_1.Avatar, { className: "h-8 w-8" },
|
|
51
|
+
react_1.default.createElement(avatar_1.AvatarFallback, { className: "bg-blue-500" }, "AI")),
|
|
52
|
+
react_1.default.createElement("div", { className: "flex-1" },
|
|
53
|
+
react_1.default.createElement("div", { className: "bg-muted rounded-lg border p-4" },
|
|
54
|
+
react_1.default.createElement("div", { className: "flex items-center gap-2" },
|
|
55
|
+
react_1.default.createElement("div", { className: "bg-muted h-2 w-2 animate-bounce rounded-full" }),
|
|
56
|
+
react_1.default.createElement("div", { className: "bg-muted h-2 w-2 animate-bounce rounded-full", style: { animationDelay: "0.1s" } }),
|
|
57
|
+
react_1.default.createElement("div", { className: "bg-muted h-2 w-2 animate-bounce rounded-full", style: { animationDelay: "0.2s" } })))))))),
|
|
58
|
+
react_1.default.createElement("div", { className: "border-t px-4 py-2" },
|
|
59
|
+
react_1.default.createElement("div", { className: "mx-auto max-w-6xl" },
|
|
60
|
+
react_1.default.createElement("form", { onSubmit: handleSubmit, className: "relative" },
|
|
61
|
+
react_1.default.createElement("div", { className: "bg-muted flex items-center gap-2 rounded-lg border p-2" },
|
|
62
|
+
react_1.default.createElement(button_1.Button, { type: "button", variant: "ghost", size: "sm", className: "h-8 w-8 p-0" },
|
|
63
|
+
react_1.default.createElement(lucide_react_1.Paperclip, { className: "h-4 w-4" })),
|
|
64
|
+
react_1.default.createElement(input_1.Input, { value: input, onChange: handleInputChange, placeholder: "Ask me anything...", className: "flex-1 border-0 bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0", disabled: isLoading }),
|
|
65
|
+
react_1.default.createElement(button_1.Button, { type: "button", variant: "ghost", size: "sm", className: "h-8 w-8 p-0" },
|
|
66
|
+
react_1.default.createElement(lucide_react_1.Mic, { className: "h-4 w-4" })),
|
|
67
|
+
react_1.default.createElement(button_1.Button, { type: "submit", size: "sm", disabled: !input.trim() || isLoading, className: "h-8 w-8 p-0" },
|
|
68
|
+
react_1.default.createElement(lucide_react_1.Send, { className: "h-4 w-4" }))))))));
|
|
69
|
+
};
|
|
70
|
+
exports.ChatInterface = ChatInterface;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Suggestion } from "./welcome-section";
|
|
3
|
+
import { UIMessage, UseChatHelpers } from "@ai-sdk/react";
|
|
4
|
+
export interface Message {
|
|
5
|
+
id: string;
|
|
6
|
+
role: "user" | "assistant";
|
|
7
|
+
parts: {
|
|
8
|
+
type: "text";
|
|
9
|
+
text: string;
|
|
10
|
+
}[];
|
|
11
|
+
}
|
|
12
|
+
export interface Chat {
|
|
13
|
+
id: string;
|
|
14
|
+
title: string;
|
|
15
|
+
preview: string;
|
|
16
|
+
timestamp: Date;
|
|
17
|
+
messages: Message[];
|
|
18
|
+
}
|
|
19
|
+
type AiChatProps = {
|
|
20
|
+
initialSelectedChatId?: string | null;
|
|
21
|
+
username?: string;
|
|
22
|
+
chats: Chat[];
|
|
23
|
+
suggestions: Suggestion[];
|
|
24
|
+
selectedChatId: string;
|
|
25
|
+
onSelectedChatIdChange: (chatId: string) => void;
|
|
26
|
+
chat: UseChatHelpers<UIMessage<unknown, Record<string, unknown>, Record<string, {
|
|
27
|
+
input: unknown;
|
|
28
|
+
output: unknown | undefined;
|
|
29
|
+
}>>>;
|
|
30
|
+
completion: {
|
|
31
|
+
input: string;
|
|
32
|
+
handleInputChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
33
|
+
handleSubmit: (e: React.FormEvent<HTMLFormElement>) => void;
|
|
34
|
+
isLoading: boolean;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
export declare const AiChat: ({ chat, chats, completion, onSelectedChatIdChange, selectedChatId, suggestions, username, }: AiChatProps) => React.JSX.Element;
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.AiChat = void 0;
|
|
38
|
+
var react_1 = __importStar(require("react"));
|
|
39
|
+
var sidebar_1 = require("./sidebar");
|
|
40
|
+
var welcome_section_1 = require("./welcome-section");
|
|
41
|
+
var chat_interface_1 = require("./chat-interface");
|
|
42
|
+
var AiChat = function (_a) {
|
|
43
|
+
var chat = _a.chat, chats = _a.chats, completion = _a.completion, onSelectedChatIdChange = _a.onSelectedChatIdChange, selectedChatId = _a.selectedChatId, suggestions = _a.suggestions, _b = _a.username, username = _b === void 0 ? "Guest" : _b;
|
|
44
|
+
var messages = chat.messages, setMessages = chat.setMessages;
|
|
45
|
+
(0, react_1.useEffect)(function () {
|
|
46
|
+
var _a;
|
|
47
|
+
setMessages(((_a = chats.find(function (chat) { return chat.id === selectedChatId; })) === null || _a === void 0 ? void 0 : _a.messages) || []);
|
|
48
|
+
}, [selectedChatId, chats, setMessages]);
|
|
49
|
+
// Completion handlers are provided by the story via props.
|
|
50
|
+
var input = completion.input, handleInputChange = completion.handleInputChange, handleSubmit = completion.handleSubmit, isLoading = completion.isLoading;
|
|
51
|
+
var handleNewChat = function () {
|
|
52
|
+
onSelectedChatIdChange("");
|
|
53
|
+
// Reset chat messages would happen here in a real app
|
|
54
|
+
};
|
|
55
|
+
var handleSelectChat = function (chatId) {
|
|
56
|
+
onSelectedChatIdChange(chatId);
|
|
57
|
+
};
|
|
58
|
+
var handleSuggestionClick = function () {
|
|
59
|
+
// In a real app, this would start a new chat with the suggestion
|
|
60
|
+
onSelectedChatIdChange("new");
|
|
61
|
+
};
|
|
62
|
+
return (react_1.default.createElement("div", { className: "flex h-screen" },
|
|
63
|
+
react_1.default.createElement(sidebar_1.Sidebar, { chats: chats, selectedChatId: selectedChatId, onNewChat: handleNewChat, onSelectChat: handleSelectChat }),
|
|
64
|
+
react_1.default.createElement("div", { className: "flex flex-1 flex-col" }, !selectedChatId ? (react_1.default.createElement(welcome_section_1.WelcomeSection, { username: username, onSuggestionClick: handleSuggestionClick, suggestions: suggestions })) : (react_1.default.createElement(chat_interface_1.ChatInterface, { messages: messages, input: input, handleInputChange: handleInputChange, handleSubmit: handleSubmit, isLoading: isLoading })))));
|
|
65
|
+
};
|
|
66
|
+
exports.AiChat = AiChat;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
interface Chat {
|
|
3
|
+
id: string;
|
|
4
|
+
title: string;
|
|
5
|
+
preview: string;
|
|
6
|
+
timestamp: Date;
|
|
7
|
+
}
|
|
8
|
+
interface SidebarProps {
|
|
9
|
+
chats: Chat[];
|
|
10
|
+
selectedChatId: string | null;
|
|
11
|
+
onNewChat: () => void;
|
|
12
|
+
onSelectChat: (chatId: string) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare const Sidebar: FC<SidebarProps>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.Sidebar = void 0;
|
|
38
|
+
var react_1 = __importStar(require("react"));
|
|
39
|
+
var button_1 = require("@/components/ui/button");
|
|
40
|
+
var input_1 = require("@/components/ui/input");
|
|
41
|
+
var scroll_area_1 = require("@/components/ui/scroll-area");
|
|
42
|
+
var lucide_react_1 = require("lucide-react");
|
|
43
|
+
var utils_1 = require("@/lib/utils");
|
|
44
|
+
var Sidebar = function (_a) {
|
|
45
|
+
var chats = _a.chats, selectedChatId = _a.selectedChatId, onNewChat = _a.onNewChat, onSelectChat = _a.onSelectChat;
|
|
46
|
+
var _b = (0, react_1.useState)(""), searchQuery = _b[0], setSearchQuery = _b[1];
|
|
47
|
+
var filteredChats = chats.filter(function (chat) {
|
|
48
|
+
return chat.title.toLowerCase().includes(searchQuery.toLowerCase()) ||
|
|
49
|
+
chat.preview.toLowerCase().includes(searchQuery.toLowerCase());
|
|
50
|
+
});
|
|
51
|
+
return (react_1.default.createElement("div", { className: "bg-muted flex justify-between w-80 flex-col border-r" },
|
|
52
|
+
react_1.default.createElement("div", { className: "border-b p-4" },
|
|
53
|
+
react_1.default.createElement(input_1.Input, { placeholder: "Search chats...", value: searchQuery, onChange: function (e) { return setSearchQuery(e.target.value); }, className: "text-sm" })),
|
|
54
|
+
react_1.default.createElement("div", { className: "flex min-h-0 flex-col h-full" },
|
|
55
|
+
react_1.default.createElement("div", { className: "flex-1 overflow-hidden" },
|
|
56
|
+
react_1.default.createElement(scroll_area_1.ScrollArea, { className: "h-full" },
|
|
57
|
+
react_1.default.createElement("div", { className: "space-y-2 p-4" }, filteredChats.map(function (chat) { return (react_1.default.createElement(button_1.Button, { key: chat.id, variant: "ghost", onClick: function () { return onSelectChat(chat.id); }, className: (0, utils_1.cn)("h-auto w-full justify-start p-3 text-left hover:primary-100 odd:bg-gray-200 even:bg-gray-300", selectedChatId === chat.id && "bg-gray-100") },
|
|
58
|
+
react_1.default.createElement("div", { className: "flex w-full items-start gap-2" },
|
|
59
|
+
react_1.default.createElement(lucide_react_1.MessageCircle, { className: "mt-0.5 h-4 w-4 flex-shrink-0 text-gray-400" }),
|
|
60
|
+
react_1.default.createElement("div", { className: "min-w-0 flex-1" },
|
|
61
|
+
react_1.default.createElement("div", { className: "truncate text-sm font-medium" }, chat.title),
|
|
62
|
+
react_1.default.createElement("div", { className: "text-muted-foreground mt-0.5 truncate text-xs" }, chat.preview))))); }))))),
|
|
63
|
+
react_1.default.createElement("div", { className: "space-y-1 border border-t p-4" },
|
|
64
|
+
react_1.default.createElement(button_1.Button, { className: "w-full", onClick: onNewChat },
|
|
65
|
+
react_1.default.createElement(lucide_react_1.Plus, null),
|
|
66
|
+
"New Chat"))));
|
|
67
|
+
};
|
|
68
|
+
exports.Sidebar = Sidebar;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
export interface Suggestion {
|
|
3
|
+
title: string;
|
|
4
|
+
category: string;
|
|
5
|
+
}
|
|
6
|
+
interface WelcomeScreenProps {
|
|
7
|
+
onSuggestionClick: (suggestion: string) => void;
|
|
8
|
+
suggestions: Suggestion[];
|
|
9
|
+
username: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const WelcomeSection: FC<WelcomeScreenProps>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.WelcomeSection = void 0;
|
|
8
|
+
var react_1 = __importDefault(require("react"));
|
|
9
|
+
var button_1 = require("@/components/ui/button");
|
|
10
|
+
var lucide_react_1 = require("lucide-react");
|
|
11
|
+
var WelcomeSection = function (_a) {
|
|
12
|
+
var onSuggestionClick = _a.onSuggestionClick, suggestions = _a.suggestions, username = _a.username;
|
|
13
|
+
return (react_1.default.createElement("div", { className: "mx-auto flex max-w-4xl flex-1 flex-col items-center justify-center p-8" },
|
|
14
|
+
react_1.default.createElement("div", { className: "mb-12 text-center" },
|
|
15
|
+
react_1.default.createElement("h1", { className: "mb-4 text-6xl font-bold" },
|
|
16
|
+
react_1.default.createElement("span", { className: "bg-gradient-to-r from-pink-500 via-red-500 to-red-600 bg-clip-text text-transparent" },
|
|
17
|
+
"Welcome, ",
|
|
18
|
+
username)),
|
|
19
|
+
react_1.default.createElement("p", { className: "text-muted-foreground text-xl" }, "How can I assist you today?")),
|
|
20
|
+
react_1.default.createElement("div", { className: "grid w-full max-w-4xl grid-cols-1 gap-4 md:grid-cols-2" }, suggestions.map(function (suggestion, index) { return (react_1.default.createElement(button_1.Button, { className: "group h-auto border-gray-200 p-6 text-left hover:bg-gray-50 cursor-pointer", key: index, onClick: function () { return onSuggestionClick(suggestion.title); }, variant: "outline" },
|
|
21
|
+
react_1.default.createElement("div", { className: "flex w-full items-start justify-between" },
|
|
22
|
+
react_1.default.createElement("div", { className: "flex-1 pr-4" },
|
|
23
|
+
react_1.default.createElement("p", { className: "text-muted-foreground text-sm leading-relaxed text-wrap" }, suggestion.title)),
|
|
24
|
+
react_1.default.createElement(lucide_react_1.ArrowUpRight, { className: "group-hover:text-primary text-muted-foreground h-4 w-4 flex-shrink-0" })))); }))));
|
|
25
|
+
};
|
|
26
|
+
exports.WelcomeSection = WelcomeSection;
|
|
@@ -7,5 +7,5 @@ interface BlogHeaderProps {
|
|
|
7
7
|
publishedAt: string;
|
|
8
8
|
onBack: () => void;
|
|
9
9
|
}
|
|
10
|
-
export declare const Header: ({ category, title, authorName, authorAvatar, publishedAt,
|
|
10
|
+
export declare const Header: ({ category, title, authorName, authorAvatar, publishedAt, }: BlogHeaderProps) => React.JSX.Element;
|
|
11
11
|
export {};
|
|
@@ -10,7 +10,7 @@ var button_1 = require("@/components/ui/button");
|
|
|
10
10
|
var avatar_1 = require("@/components/ui/avatar");
|
|
11
11
|
var badge_1 = require("@/components/ui/badge");
|
|
12
12
|
var Header = function (_a) {
|
|
13
|
-
var category = _a.category, title = _a.title, authorName = _a.authorName, authorAvatar = _a.authorAvatar, publishedAt = _a.publishedAt
|
|
13
|
+
var category = _a.category, title = _a.title, authorName = _a.authorName, authorAvatar = _a.authorAvatar, publishedAt = _a.publishedAt;
|
|
14
14
|
return (react_1.default.createElement("header", { className: "space-y-6" },
|
|
15
15
|
react_1.default.createElement(badge_1.Badge, { variant: "outline" }, category),
|
|
16
16
|
react_1.default.createElement("h1", { className: "text-foreground text-4xl leading-15 font-bold tracking-tight md:text-4xl lg:text-5xl" }, title),
|
|
@@ -617,7 +617,6 @@ var GanttProvider = function (_a) {
|
|
|
617
617
|
observer.disconnect();
|
|
618
618
|
};
|
|
619
619
|
}, []);
|
|
620
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
621
620
|
var handleScroll = (0, react_1.useCallback)((0, lodash_throttle_1.default)(function () {
|
|
622
621
|
var _a, _b;
|
|
623
622
|
var scrollElement = scrollRef.current;
|
|
@@ -77,7 +77,7 @@ function ThemeApplier(_a) {
|
|
|
77
77
|
try {
|
|
78
78
|
return window.localStorage.getItem("ui-theme-color");
|
|
79
79
|
}
|
|
80
|
-
catch (
|
|
80
|
+
catch (_a) {
|
|
81
81
|
return null;
|
|
82
82
|
}
|
|
83
83
|
})();
|
|
@@ -124,13 +124,13 @@ function ThemeProvider(_a) {
|
|
|
124
124
|
try {
|
|
125
125
|
persistedTheme = window.localStorage.getItem(storageKey);
|
|
126
126
|
}
|
|
127
|
-
catch (
|
|
127
|
+
catch (_e) {
|
|
128
128
|
persistedTheme = null;
|
|
129
129
|
}
|
|
130
130
|
try {
|
|
131
131
|
persistedColor = window.localStorage.getItem("ui-theme-color");
|
|
132
132
|
}
|
|
133
|
-
catch (
|
|
133
|
+
catch (_f) {
|
|
134
134
|
persistedColor = null;
|
|
135
135
|
}
|
|
136
136
|
var initialTheme = persistedTheme || defaultTheme;
|
|
@@ -152,7 +152,7 @@ function ThemeProvider(_a) {
|
|
|
152
152
|
}
|
|
153
153
|
root_1.setAttribute("data-theme", initialTheme);
|
|
154
154
|
}
|
|
155
|
-
catch (
|
|
155
|
+
catch (_g) {
|
|
156
156
|
// ignore DOM errors
|
|
157
157
|
}
|
|
158
158
|
return (react_1.default.createElement(next_themes_1.ThemeProvider, __assign({ attribute: "data-theme", defaultTheme: initialTheme, storageKey: storageKey, enableSystem: enableSystem, themes: Object.keys(themes_1.themes) }, props),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import * as ResizablePrimitive from "react-resizable-panels";
|
|
3
3
|
declare const ResizablePanelGroup: ({ className, ...props }: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>) => React.JSX.Element;
|
|
4
|
-
declare const ResizablePanel: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLElement | HTMLButtonElement | HTMLDivElement | HTMLInputElement | HTMLObjectElement | HTMLSlotElement | HTMLStyleElement | HTMLTitleElement | HTMLSpanElement | HTMLAnchorElement | HTMLAreaElement | HTMLAudioElement | HTMLBaseElement | HTMLQuoteElement | HTMLBodyElement | HTMLBRElement | HTMLCanvasElement | HTMLTableColElement | HTMLDataElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDialogElement | HTMLDListElement | HTMLEmbedElement | HTMLFieldSetElement |
|
|
4
|
+
declare const ResizablePanel: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLElement | HTMLButtonElement | HTMLDivElement | HTMLFormElement | HTMLInputElement | HTMLObjectElement | HTMLSlotElement | HTMLStyleElement | HTMLTitleElement | HTMLSpanElement | HTMLAnchorElement | HTMLAreaElement | HTMLAudioElement | HTMLBaseElement | HTMLQuoteElement | HTMLBodyElement | HTMLBRElement | HTMLCanvasElement | HTMLTableColElement | HTMLDataElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDialogElement | HTMLDListElement | HTMLEmbedElement | HTMLFieldSetElement | HTMLHeadingElement | HTMLHeadElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLImageElement | HTMLLabelElement | HTMLLegendElement | HTMLLIElement | HTMLLinkElement | HTMLMapElement | HTMLMetaElement | HTMLMeterElement | HTMLOListElement | HTMLOptGroupElement | HTMLOptionElement | HTMLOutputElement | HTMLParagraphElement | HTMLPreElement | HTMLProgressElement | HTMLScriptElement | HTMLSelectElement | HTMLSourceElement | HTMLTableElement | HTMLTemplateElement | HTMLTableSectionElement | HTMLTableCellElement | HTMLTextAreaElement | HTMLTimeElement | HTMLTableRowElement | HTMLTrackElement | HTMLUListElement | HTMLVideoElement | HTMLTableCaptionElement | HTMLMenuElement | HTMLPictureElement>, "id" | "onResize"> & {
|
|
5
5
|
className?: string;
|
|
6
6
|
collapsedSize?: number | undefined;
|
|
7
7
|
collapsible?: boolean | undefined;
|
|
@@ -63,7 +63,7 @@ var utils_1 = require("../../lib/utils");
|
|
|
63
63
|
var ScrollArea = React.forwardRef(function (_a, ref) {
|
|
64
64
|
var className = _a.className, children = _a.children, props = __rest(_a, ["className", "children"]);
|
|
65
65
|
return (React.createElement(ScrollAreaPrimitive.Root, __assign({ ref: ref, className: (0, utils_1.cn)("relative overflow-hidden", className) }, props),
|
|
66
|
-
|
|
66
|
+
children,
|
|
67
67
|
React.createElement(ScrollBar, null),
|
|
68
68
|
React.createElement(ScrollAreaPrimitive.Corner, null)));
|
|
69
69
|
});
|
|
@@ -96,7 +96,7 @@ var ThemeSwitcher = function (_a) {
|
|
|
96
96
|
return;
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
catch (
|
|
99
|
+
catch (_a) {
|
|
100
100
|
// ignore
|
|
101
101
|
}
|
|
102
102
|
var currentColorTheme = colorThemes.find(function (t) {
|
|
@@ -122,7 +122,7 @@ var ThemeSwitcher = function (_a) {
|
|
|
122
122
|
try {
|
|
123
123
|
window.localStorage.setItem("ui-theme-color", newColorTheme);
|
|
124
124
|
}
|
|
125
|
-
catch (
|
|
125
|
+
catch (_a) {
|
|
126
126
|
// ignore storage errors
|
|
127
127
|
}
|
|
128
128
|
setColorTheme(newColorTheme);
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appcorp/shadcn",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.34",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build:next": "next build",
|
|
6
|
-
"build:storybook": "storybook build -c .storybook -o .out",
|
|
6
|
+
"build:storybook": "mv ../.pnp.cjs ../.pnp.cjs.bak 2>/dev/null || true && storybook build -c .storybook -o .out && mv ../.pnp.cjs.bak ../.pnp.cjs 2>/dev/null || true",
|
|
7
7
|
"build:ts": "tsc --project tsconfig.build.json",
|
|
8
8
|
"build": "yarn clean && yarn build:ts && cp package.json lib && cp README.md lib && cp yarn.lock lib",
|
|
9
9
|
"clean": "yarn rimraf ./lib",
|
|
@@ -15,14 +15,14 @@
|
|
|
15
15
|
"format:check": "prettier --check \"**/*.{js,jsx,ts,tsx,json,css,md}\"",
|
|
16
16
|
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,css,md}\"",
|
|
17
17
|
"generate:sitemap": "scripts/generate-sitemap.sh",
|
|
18
|
-
"lint": "eslint .",
|
|
18
|
+
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
|
|
19
19
|
"major": "npm version major",
|
|
20
20
|
"minor": "npm version minor",
|
|
21
21
|
"patch": "npm version patch",
|
|
22
22
|
"prepare": "husky",
|
|
23
23
|
"publish:npm": "yarn build && cd lib/ && npm publish --access public && cd ..",
|
|
24
24
|
"start": "next start",
|
|
25
|
-
"storybook": "storybook dev -p 6006",
|
|
25
|
+
"storybook": "mv ../.pnp.cjs ../.pnp.cjs.bak 2>/dev/null || true && storybook dev -p 6006",
|
|
26
26
|
"test:watch": "jest --watch",
|
|
27
27
|
"test": "jest",
|
|
28
28
|
"upgrade": "ncu -u"
|
|
@@ -31,101 +31,107 @@
|
|
|
31
31
|
"author": "Taimoor Khan <taimoor.m.k@live.com>",
|
|
32
32
|
"license": "MIT",
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@
|
|
35
|
-
"@commitlint/
|
|
36
|
-
"@
|
|
37
|
-
"@dnd-kit/
|
|
38
|
-
"@
|
|
39
|
-
"@
|
|
40
|
-
"@
|
|
41
|
-
"@
|
|
42
|
-
"@
|
|
43
|
-
"@radix-ui/react-
|
|
44
|
-
"@radix-ui/react-
|
|
45
|
-
"@radix-ui/react-
|
|
46
|
-
"@radix-ui/react-
|
|
47
|
-
"@radix-ui/react-
|
|
48
|
-
"@radix-ui/react-
|
|
49
|
-
"@radix-ui/react-
|
|
50
|
-
"@radix-ui/react-
|
|
51
|
-
"@radix-ui/react-
|
|
52
|
-
"@radix-ui/react-
|
|
53
|
-
"@radix-ui/react-
|
|
54
|
-
"@radix-ui/react-
|
|
55
|
-
"@radix-ui/react-
|
|
56
|
-
"@radix-ui/react-
|
|
57
|
-
"@radix-ui/react-
|
|
58
|
-
"@radix-ui/react-
|
|
59
|
-
"@radix-ui/react-
|
|
60
|
-
"@radix-ui/react-
|
|
61
|
-
"@radix-ui/react-
|
|
62
|
-
"@radix-ui/react-
|
|
63
|
-
"@radix-ui/react-
|
|
64
|
-
"@radix-ui/react-
|
|
65
|
-
"@radix-ui/react-
|
|
66
|
-
"@
|
|
67
|
-
"@
|
|
68
|
-
"@
|
|
69
|
-
"@storybook/
|
|
70
|
-
"@
|
|
71
|
-
"@
|
|
72
|
-
"@
|
|
73
|
-
"@
|
|
74
|
-
"@
|
|
75
|
-
"@testing-library/
|
|
76
|
-
"@testing-library/
|
|
77
|
-
"@
|
|
78
|
-
"@
|
|
34
|
+
"@ai-sdk/react": "^3",
|
|
35
|
+
"@commitlint/cli": "^20",
|
|
36
|
+
"@commitlint/config-conventional": "^20",
|
|
37
|
+
"@dnd-kit/core": "^6",
|
|
38
|
+
"@dnd-kit/modifiers": "^9",
|
|
39
|
+
"@emotion/is-prop-valid": "^1",
|
|
40
|
+
"@eslint/eslintrc": "^3",
|
|
41
|
+
"@eslint/js": "^9",
|
|
42
|
+
"@hookform/resolvers": "^5",
|
|
43
|
+
"@radix-ui/react-accordion": "^1",
|
|
44
|
+
"@radix-ui/react-alert-dialog": "^1",
|
|
45
|
+
"@radix-ui/react-aspect-ratio": "^1",
|
|
46
|
+
"@radix-ui/react-avatar": "^1",
|
|
47
|
+
"@radix-ui/react-checkbox": "^1",
|
|
48
|
+
"@radix-ui/react-collapsible": "^1",
|
|
49
|
+
"@radix-ui/react-context-menu": "^2",
|
|
50
|
+
"@radix-ui/react-dialog": "^1",
|
|
51
|
+
"@radix-ui/react-dropdown-menu": "^2",
|
|
52
|
+
"@radix-ui/react-hover-card": "^1",
|
|
53
|
+
"@radix-ui/react-icons": "^1",
|
|
54
|
+
"@radix-ui/react-label": "^2",
|
|
55
|
+
"@radix-ui/react-menubar": "^1",
|
|
56
|
+
"@radix-ui/react-navigation-menu": "^1",
|
|
57
|
+
"@radix-ui/react-popover": "^1",
|
|
58
|
+
"@radix-ui/react-progress": "^1",
|
|
59
|
+
"@radix-ui/react-radio-group": "^1",
|
|
60
|
+
"@radix-ui/react-scroll-area": "^1",
|
|
61
|
+
"@radix-ui/react-select": "^2",
|
|
62
|
+
"@radix-ui/react-separator": "^1",
|
|
63
|
+
"@radix-ui/react-slider": "^1",
|
|
64
|
+
"@radix-ui/react-slot": "^1",
|
|
65
|
+
"@radix-ui/react-switch": "^1",
|
|
66
|
+
"@radix-ui/react-tabs": "^1",
|
|
67
|
+
"@radix-ui/react-toggle": "^1",
|
|
68
|
+
"@react-pakistan/util-functions": "^1.25.18",
|
|
69
|
+
"@storybook/addon-docs": "^10",
|
|
70
|
+
"@storybook/addon-onboarding": "^10",
|
|
71
|
+
"@storybook/nextjs": "^10",
|
|
72
|
+
"@tabler/icons-react": "^3",
|
|
73
|
+
"@tailwindcss/postcss": "^4",
|
|
74
|
+
"@tanstack/react-table": "^8",
|
|
75
|
+
"@testing-library/dom": "^10",
|
|
76
|
+
"@testing-library/jest-dom": "^6",
|
|
77
|
+
"@testing-library/react": "^16",
|
|
78
|
+
"@testing-library/user-event": "^14",
|
|
79
|
+
"@types/color": "^4",
|
|
80
|
+
"@types/jest": "^30",
|
|
79
81
|
"@types/lodash.throttle": "^4",
|
|
80
|
-
"@types/node": "^24
|
|
82
|
+
"@types/node": "^24",
|
|
81
83
|
"@types/react": "^19",
|
|
82
84
|
"@types/react-dom": "^19",
|
|
83
|
-
"@
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"
|
|
92
|
-
"
|
|
93
|
-
"eslint
|
|
94
|
-
"eslint-config-
|
|
95
|
-
"eslint-
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
"
|
|
100
|
-
"
|
|
101
|
-
"
|
|
102
|
-
"
|
|
103
|
-
"
|
|
104
|
-
"
|
|
105
|
-
"
|
|
106
|
-
"
|
|
107
|
-
"
|
|
108
|
-
"
|
|
109
|
-
"
|
|
110
|
-
"
|
|
111
|
-
"
|
|
112
|
-
"
|
|
113
|
-
"react
|
|
114
|
-
"react-
|
|
115
|
-
"react-
|
|
116
|
-
"react-
|
|
117
|
-
"react-
|
|
118
|
-
"
|
|
119
|
-
"
|
|
120
|
-
"
|
|
121
|
-
"
|
|
122
|
-
"
|
|
123
|
-
"
|
|
124
|
-
"
|
|
125
|
-
"
|
|
126
|
-
"
|
|
127
|
-
"
|
|
128
|
-
"
|
|
85
|
+
"@types/react-is": "^19",
|
|
86
|
+
"@uidotdev/usehooks": "^2",
|
|
87
|
+
"autoprefixer": "^10",
|
|
88
|
+
"class-variance-authority": "^0",
|
|
89
|
+
"clsx": "^2",
|
|
90
|
+
"cmdk": "^1",
|
|
91
|
+
"color": "^5",
|
|
92
|
+
"date-fns": "^4",
|
|
93
|
+
"dayjs": "^1",
|
|
94
|
+
"embla-carousel-react": "^8",
|
|
95
|
+
"eslint": "^9",
|
|
96
|
+
"eslint-config-next": "^16",
|
|
97
|
+
"eslint-config-prettier": "^10",
|
|
98
|
+
"eslint-plugin-react-hooks": "^4",
|
|
99
|
+
"eslint-plugin-storybook": "^10",
|
|
100
|
+
"husky": "^9",
|
|
101
|
+
"input-otp": "^1",
|
|
102
|
+
"jest": "^30",
|
|
103
|
+
"jest-environment-jsdom": "^30",
|
|
104
|
+
"jotai": "^2",
|
|
105
|
+
"libphonenumber-js": "^1",
|
|
106
|
+
"lint-staged": "^16",
|
|
107
|
+
"lodash.throttle": "^4",
|
|
108
|
+
"lucide-react": "^0",
|
|
109
|
+
"motion": "^12",
|
|
110
|
+
"next": "^16",
|
|
111
|
+
"next-themes": "^0",
|
|
112
|
+
"postcss": "^8",
|
|
113
|
+
"prettier": "^3",
|
|
114
|
+
"radix-ui": "^1",
|
|
115
|
+
"react": "^19",
|
|
116
|
+
"react-day-picker": "^9",
|
|
117
|
+
"react-dom": "^19",
|
|
118
|
+
"react-dropzone": "^14",
|
|
119
|
+
"react-easy-crop": "^5",
|
|
120
|
+
"react-hook-form": "^7",
|
|
121
|
+
"react-is": "^19",
|
|
122
|
+
"react-resizable-panels": "^3",
|
|
123
|
+
"recharts": "3",
|
|
124
|
+
"rimraf": "^6",
|
|
125
|
+
"sonner": "^2",
|
|
126
|
+
"storybook": "^10",
|
|
127
|
+
"tailwind-merge": "^3",
|
|
128
|
+
"tailwindcss": "^4",
|
|
129
|
+
"ts-node": "^10",
|
|
130
|
+
"typescript": "^5",
|
|
131
|
+
"uuid": "^13",
|
|
132
|
+
"vaul": "^1",
|
|
133
|
+
"webpack": "5",
|
|
134
|
+
"zod": "^4"
|
|
129
135
|
},
|
|
130
136
|
"packageManager": "yarn@4.12.0"
|
|
131
137
|
}
|