mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-02-10 03:24:24 +01:00
feat: artifacts + shadcnui PROBLEMATIC COMMIT
This commit is contained in:
parent
9abf941085
commit
5bf61c3cdf
11 changed files with 223 additions and 31 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import dedent from 'dedent';
|
||||
import type { CodeBlock } from '~/common';
|
||||
// import * as shadcnComponents from '~/utils/shadcn';
|
||||
|
||||
const artifactFilename = {
|
||||
'application/vnd.react': 'App.tsx',
|
||||
|
|
@ -45,36 +45,35 @@ export const sharedProps = {
|
|||
'date-fns': '^3.3.1',
|
||||
'tailwind-merge': '^1.9.1',
|
||||
'tailwindcss-animate': '^1.0.5',
|
||||
// recharts: '2.9.0',
|
||||
// '@radix-ui/react-accordion': '^1.2.0',
|
||||
// '@radix-ui/react-alert-dialog': '^1.1.1',
|
||||
// '@radix-ui/react-aspect-ratio': '^1.1.0',
|
||||
// '@radix-ui/react-avatar': '^1.1.0',
|
||||
// '@radix-ui/react-checkbox': '^1.1.1',
|
||||
// '@radix-ui/react-collapsible': '^1.1.0',
|
||||
// '@radix-ui/react-dialog': '^1.1.1',
|
||||
// '@radix-ui/react-dropdown-menu': '^2.1.1',
|
||||
// '@radix-ui/react-hover-card': '^1.1.1',
|
||||
// '@radix-ui/react-label': '^2.1.0',
|
||||
// '@radix-ui/react-menubar': '^1.1.1',
|
||||
// '@radix-ui/react-navigation-menu': '^1.2.0',
|
||||
// '@radix-ui/react-popover': '^1.1.1',
|
||||
// '@radix-ui/react-progress': '^1.1.0',
|
||||
// '@radix-ui/react-radio-group': '^1.2.0',
|
||||
// '@radix-ui/react-select': '^2.1.1',
|
||||
// '@radix-ui/react-separator': '^1.1.0',
|
||||
// '@radix-ui/react-slider': '^1.2.0',
|
||||
// '@radix-ui/react-slot': '^1.1.0',
|
||||
// '@radix-ui/react-switch': '^1.1.0',
|
||||
// '@radix-ui/react-tabs': '^1.1.0',
|
||||
// '@radix-ui/react-toast': '^1.2.1',
|
||||
// '@radix-ui/react-toggle': '^1.1.0',
|
||||
// '@radix-ui/react-toggle-group': '^1.1.0',
|
||||
// '@radix-ui/react-tooltip': '^1.1.2',
|
||||
|
||||
// 'embla-carousel-react': '^8.1.8',
|
||||
// 'react-day-picker': '^8.10.1',
|
||||
// vaul: '^0.9.1',
|
||||
recharts: '2.12.7',
|
||||
'@radix-ui/react-accordion': '^1.1.2',
|
||||
'@radix-ui/react-alert-dialog': '^1.0.2',
|
||||
'@radix-ui/react-aspect-ratio': '^1.1.0',
|
||||
'@radix-ui/react-avatar': '^1.1.0',
|
||||
'@radix-ui/react-checkbox': '^1.0.3',
|
||||
'@radix-ui/react-collapsible': '^1.0.3',
|
||||
'@radix-ui/react-dialog': '^1.0.2',
|
||||
'@radix-ui/react-dropdown-menu': '^2.1.1',
|
||||
'@radix-ui/react-hover-card': '^1.0.5',
|
||||
'@radix-ui/react-label': '^2.0.0',
|
||||
'@radix-ui/react-menubar': '^1.1.1',
|
||||
'@radix-ui/react-navigation-menu': '^1.2.0',
|
||||
'@radix-ui/react-popover': '^1.0.7',
|
||||
'@radix-ui/react-progress': '^1.1.0',
|
||||
'@radix-ui/react-radio-group': '^1.1.3',
|
||||
'@radix-ui/react-select': '^2.0.0',
|
||||
'@radix-ui/react-separator': '^1.0.3',
|
||||
'@radix-ui/react-slider': '^1.1.1',
|
||||
'@radix-ui/react-switch': '^1.0.3',
|
||||
'@radix-ui/react-tabs': '^1.0.3',
|
||||
'@radix-ui/react-toast': '^1.1.5',
|
||||
'@radix-ui/react-tooltip': '^1.0.6',
|
||||
'@radix-ui/react-slot': '^1.1.0',
|
||||
'@radix-ui/react-toggle': '^1.1.0',
|
||||
'@radix-ui/react-toggle-group': '^1.1.0',
|
||||
'embla-carousel-react': '^8.2.0',
|
||||
'react-day-picker': '^9.0.8',
|
||||
vaul: '^0.9.1',
|
||||
},
|
||||
},
|
||||
} as const;
|
||||
|
|
@ -84,6 +83,44 @@ export const sharedOptions = {
|
|||
};
|
||||
|
||||
export const sharedFiles = {
|
||||
// '/lib/utils.ts': shadcnComponents.utils,
|
||||
// '/components/ui/accordion.tsx': shadcnComponents.accordian,
|
||||
// '/components/ui/alert-dialog.tsx': shadcnComponents.alertDialog,
|
||||
// '/components/ui/alert.tsx': shadcnComponents.alert,
|
||||
// '/components/ui/avatar.tsx': shadcnComponents.avatar,
|
||||
// '/components/ui/badge.tsx': shadcnComponents.badge,
|
||||
// '/components/ui/breadcrumb.tsx': shadcnComponents.breadcrumb,
|
||||
// '/components/ui/button.tsx': shadcnComponents.button,
|
||||
// '/components/ui/calendar.tsx': shadcnComponents.calendar,
|
||||
// '/components/ui/card.tsx': shadcnComponents.card,
|
||||
// '/components/ui/carousel.tsx': shadcnComponents.carousel,
|
||||
// '/components/ui/checkbox.tsx': shadcnComponents.checkbox,
|
||||
// '/components/ui/collapsible.tsx': shadcnComponents.collapsible,
|
||||
// '/components/ui/dialog.tsx': shadcnComponents.dialog,
|
||||
// '/components/ui/drawer.tsx': shadcnComponents.drawer,
|
||||
// '/components/ui/dropdown-menu.tsx': shadcnComponents.dropdownMenu,
|
||||
// '/components/ui/input.tsx': shadcnComponents.input,
|
||||
// '/components/ui/label.tsx': shadcnComponents.label,
|
||||
// '/components/ui/menubar.tsx': shadcnComponents.menuBar,
|
||||
// '/components/ui/navigation-menu.tsx': shadcnComponents.navigationMenu,
|
||||
// '/components/ui/pagination.tsx': shadcnComponents.pagination,
|
||||
// '/components/ui/popover.tsx': shadcnComponents.popover,
|
||||
// '/components/ui/progress.tsx': shadcnComponents.progress,
|
||||
// '/components/ui/radio-group.tsx': shadcnComponents.radioGroup,
|
||||
// '/components/ui/select.tsx': shadcnComponents.select,
|
||||
// '/components/ui/separator.tsx': shadcnComponents.separator,
|
||||
// '/components/ui/skeleton.tsx': shadcnComponents.skeleton,
|
||||
// '/components/ui/slider.tsx': shadcnComponents.slider,
|
||||
// '/components/ui/switch.tsx': shadcnComponents.switchComponent,
|
||||
// '/components/ui/table.tsx': shadcnComponents.table,
|
||||
// '/components/ui/tabs.tsx': shadcnComponents.tabs,
|
||||
// '/components/ui/textarea.tsx': shadcnComponents.textarea,
|
||||
// '/components/ui/toast.tsx': shadcnComponents.toast,
|
||||
// '/components/ui/toaster.tsx': shadcnComponents.toaster,
|
||||
// '/components/ui/toggle-group.tsx': shadcnComponents.toggleGroup,
|
||||
// '/components/ui/toggle.tsx': shadcnComponents.toggle,
|
||||
// '/components/ui/tooltip.tsx': shadcnComponents.tooltip,
|
||||
// '/components/ui/use-toast.tsx': shadcnComponents.useToast,
|
||||
'/public/index.html': dedent`
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
|
|
|||
12
client/src/utils/shadcn-docs/avatar.tsx
Normal file
12
client/src/utils/shadcn-docs/avatar.tsx
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
export const name = 'Avatar';
|
||||
|
||||
export const importDocs = `
|
||||
import { Avatar, AvatarFallback, AvatarImage } from "/components/ui/avatar";
|
||||
`;
|
||||
|
||||
export const usageDocs = `
|
||||
<Avatar>
|
||||
<AvatarImage src="https://github.com/nutlope.png" />
|
||||
<AvatarFallback>CN</AvatarFallback>
|
||||
</Avatar>
|
||||
`;
|
||||
14
client/src/utils/shadcn-docs/button.tsx
Normal file
14
client/src/utils/shadcn-docs/button.tsx
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
export const name = 'Button';
|
||||
|
||||
export const importDocs = `
|
||||
import { Button } from "/components/ui/button"
|
||||
`;
|
||||
|
||||
export const usageDocs = `
|
||||
<Button>A normal button</Button>
|
||||
<Button variant='secondary'>Button</Button>
|
||||
<Button variant='destructive'>Button</Button>
|
||||
<Button variant='outline'>Button</Button>
|
||||
<Button variant='ghost'>Button</Button>
|
||||
<Button variant='link'>Button</Button>
|
||||
`;
|
||||
27
client/src/utils/shadcn-docs/card.tsx
Normal file
27
client/src/utils/shadcn-docs/card.tsx
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
export const name = 'Card';
|
||||
|
||||
export const importDocs = `
|
||||
import {
|
||||
Card,
|
||||
CardContent,
|
||||
CardDescription,
|
||||
CardFooter,
|
||||
CardHeader,
|
||||
CardTitle,
|
||||
} from "/components/ui/card"
|
||||
`;
|
||||
|
||||
export const usageDocs = `
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>Card Title</CardTitle>
|
||||
<CardDescription>Card Description</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<p>Card Content</p>
|
||||
</CardContent>
|
||||
<CardFooter>
|
||||
<p>Card Footer</p>
|
||||
</CardFooter>
|
||||
</Card>
|
||||
`;
|
||||
9
client/src/utils/shadcn-docs/checkbox.tsx
Normal file
9
client/src/utils/shadcn-docs/checkbox.tsx
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
export const name = 'Checkbox';
|
||||
|
||||
export const importDocs = `
|
||||
import { Checkbox } from "/components/ui/checkbox"
|
||||
`;
|
||||
|
||||
export const usageDocs = `
|
||||
<Checkbox />
|
||||
`;
|
||||
23
client/src/utils/shadcn-docs/index.ts
Normal file
23
client/src/utils/shadcn-docs/index.ts
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import * as Avatar from './avatar';
|
||||
import * as Button from './button';
|
||||
import * as Card from './card';
|
||||
// import * as Checkbox from "./checkbox";
|
||||
import * as Input from './input';
|
||||
import * as Label from './label';
|
||||
import * as RadioGroup from './radio-group';
|
||||
import * as Select from './select';
|
||||
import * as Textarea from './textarea';
|
||||
|
||||
const shadcnDocs = [
|
||||
Avatar,
|
||||
Button,
|
||||
Card,
|
||||
// Checkbox,
|
||||
Input,
|
||||
Label,
|
||||
RadioGroup,
|
||||
Select,
|
||||
Textarea,
|
||||
];
|
||||
|
||||
export default shadcnDocs;
|
||||
9
client/src/utils/shadcn-docs/input.tsx
Normal file
9
client/src/utils/shadcn-docs/input.tsx
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
export const name = 'Input';
|
||||
|
||||
export const importDocs = `
|
||||
import { Input } from "/components/ui/input"
|
||||
`;
|
||||
|
||||
export const usageDocs = `
|
||||
<Input />
|
||||
`;
|
||||
9
client/src/utils/shadcn-docs/label.tsx
Normal file
9
client/src/utils/shadcn-docs/label.tsx
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
export const name = 'Label';
|
||||
|
||||
export const importDocs = `
|
||||
import { Label } from "/components/ui/label"
|
||||
`;
|
||||
|
||||
export const usageDocs = `
|
||||
<Label htmlFor="email">Your email address</Label>
|
||||
`;
|
||||
19
client/src/utils/shadcn-docs/radio-group.tsx
Normal file
19
client/src/utils/shadcn-docs/radio-group.tsx
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
export const name = 'RadioGroup';
|
||||
|
||||
export const importDocs = `
|
||||
import { Label } from "/components/ui/label"
|
||||
import { RadioGroup, RadioGroupItem } from "/components/ui/radio-group"
|
||||
`;
|
||||
|
||||
export const usageDocs = `
|
||||
<RadioGroup defaultValue="option-one">
|
||||
<div className="flex items-center space-x-2">
|
||||
<RadioGroupItem value="option-one" id="option-one" />
|
||||
<Label htmlFor="option-one">Option One</Label>
|
||||
</div>
|
||||
<div className="flex items-center space-x-2">
|
||||
<RadioGroupItem value="option-two" id="option-two" />
|
||||
<Label htmlFor="option-two">Option Two</Label>
|
||||
</div>
|
||||
</RadioGroup>
|
||||
`;
|
||||
24
client/src/utils/shadcn-docs/select.tsx
Normal file
24
client/src/utils/shadcn-docs/select.tsx
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
export const name = 'Select';
|
||||
|
||||
export const importDocs = `
|
||||
import {
|
||||
Select,
|
||||
SelectContent,
|
||||
SelectItem,
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from "/components/ui/select"
|
||||
`;
|
||||
|
||||
export const usageDocs = `
|
||||
<Select>
|
||||
<SelectTrigger className="w-[180px]">
|
||||
<SelectValue placeholder="Theme" />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="light">Light</SelectItem>
|
||||
<SelectItem value="dark">Dark</SelectItem>
|
||||
<SelectItem value="system">System</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
`;
|
||||
9
client/src/utils/shadcn-docs/textarea.tsx
Normal file
9
client/src/utils/shadcn-docs/textarea.tsx
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
export const name = 'Textarea';
|
||||
|
||||
export const importDocs = `
|
||||
import { Textarea } from "/components/ui/textarea"
|
||||
`;
|
||||
|
||||
export const usageDocs = `
|
||||
<Textarea />
|
||||
`;
|
||||
Loading…
Add table
Add a link
Reference in a new issue