@botfather/units-uikit-shadcn 1.0.0
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/LICENSE +21 -0
- package/README.md +25 -0
- package/index.js +36 -0
- package/package.json +35 -0
- package/shadcn/Accordion.ui +3 -0
- package/shadcn/AccordionContent.ui +5 -0
- package/shadcn/AccordionItem.ui +3 -0
- package/shadcn/AccordionTrigger.ui +6 -0
- package/shadcn/Alert.ui +3 -0
- package/shadcn/AlertDescription.ui +3 -0
- package/shadcn/AlertDialog.ui +3 -0
- package/shadcn/AlertDialogAction.ui +6 -0
- package/shadcn/AlertDialogCancel.ui +6 -0
- package/shadcn/AlertDialogContent.ui +3 -0
- package/shadcn/AlertDialogDescription.ui +3 -0
- package/shadcn/AlertDialogFooter.ui +3 -0
- package/shadcn/AlertDialogHeader.ui +3 -0
- package/shadcn/AlertDialogTitle.ui +3 -0
- package/shadcn/AlertDialogTrigger.ui +6 -0
- package/shadcn/AlertTitle.ui +3 -0
- package/shadcn/AspectRatio.ui +6 -0
- package/shadcn/Avatar.ui +3 -0
- package/shadcn/AvatarFallback.ui +3 -0
- package/shadcn/AvatarImage.ui +1 -0
- package/shadcn/Badge.ui +9 -0
- package/shadcn/Breadcrumb.ui +3 -0
- package/shadcn/BreadcrumbEllipsis.ui +3 -0
- package/shadcn/BreadcrumbItem.ui +3 -0
- package/shadcn/BreadcrumbLink.ui +6 -0
- package/shadcn/BreadcrumbList.ui +3 -0
- package/shadcn/BreadcrumbPage.ui +3 -0
- package/shadcn/BreadcrumbSeparator.ui +3 -0
- package/shadcn/Button.ui +20 -0
- package/shadcn/ButtonGroup.ui +3 -0
- package/shadcn/Calendar.ui +3 -0
- package/shadcn/Card.ui +3 -0
- package/shadcn/CardContent.ui +3 -0
- package/shadcn/CardDescription.ui +3 -0
- package/shadcn/CardFooter.ui +3 -0
- package/shadcn/CardHeader.ui +3 -0
- package/shadcn/CardTitle.ui +3 -0
- package/shadcn/Carousel.ui +3 -0
- package/shadcn/CarouselContent.ui +3 -0
- package/shadcn/CarouselItem.ui +3 -0
- package/shadcn/CarouselNext.ui +6 -0
- package/shadcn/CarouselPrevious.ui +6 -0
- package/shadcn/Chart.ui +3 -0
- package/shadcn/ChartContainer.ui +3 -0
- package/shadcn/ChartLegend.ui +3 -0
- package/shadcn/ChartLegendContent.ui +3 -0
- package/shadcn/ChartTooltip.ui +3 -0
- package/shadcn/ChartTooltipContent.ui +3 -0
- package/shadcn/Checkbox.ui +13 -0
- package/shadcn/Collapsible.ui +3 -0
- package/shadcn/CollapsibleContent.ui +3 -0
- package/shadcn/CollapsibleTrigger.ui +6 -0
- package/shadcn/Combobox.ui +3 -0
- package/shadcn/ComboboxEmpty.ui +3 -0
- package/shadcn/ComboboxInput.ui +1 -0
- package/shadcn/ComboboxItem.ui +6 -0
- package/shadcn/ComboboxList.ui +3 -0
- package/shadcn/ComboboxTrigger.ui +6 -0
- package/shadcn/Command.ui +3 -0
- package/shadcn/CommandEmpty.ui +3 -0
- package/shadcn/CommandGroup.ui +3 -0
- package/shadcn/CommandInput.ui +1 -0
- package/shadcn/CommandItem.ui +3 -0
- package/shadcn/CommandList.ui +3 -0
- package/shadcn/CommandSeparator.ui +3 -0
- package/shadcn/CommandShortcut.ui +3 -0
- package/shadcn/ContextMenu.ui +3 -0
- package/shadcn/ContextMenuCheckboxItem.ui +3 -0
- package/shadcn/ContextMenuContent.ui +3 -0
- package/shadcn/ContextMenuGroup.ui +3 -0
- package/shadcn/ContextMenuItem.ui +3 -0
- package/shadcn/ContextMenuLabel.ui +3 -0
- package/shadcn/ContextMenuRadioGroup.ui +3 -0
- package/shadcn/ContextMenuRadioItem.ui +3 -0
- package/shadcn/ContextMenuSeparator.ui +3 -0
- package/shadcn/ContextMenuShortcut.ui +3 -0
- package/shadcn/ContextMenuSub.ui +3 -0
- package/shadcn/ContextMenuSubContent.ui +3 -0
- package/shadcn/ContextMenuSubTrigger.ui +3 -0
- package/shadcn/ContextMenuTrigger.ui +3 -0
- package/shadcn/DataTable.ui +3 -0
- package/shadcn/DataTablePagination.ui +3 -0
- package/shadcn/DataTableToolbar.ui +3 -0
- package/shadcn/DatePicker.ui +3 -0
- package/shadcn/DatePickerCalendar.ui +3 -0
- package/shadcn/DatePickerContent.ui +3 -0
- package/shadcn/DatePickerTrigger.ui +6 -0
- package/shadcn/Dialog.ui +3 -0
- package/shadcn/DialogClose.ui +6 -0
- package/shadcn/DialogContent.ui +3 -0
- package/shadcn/DialogDescription.ui +3 -0
- package/shadcn/DialogFooter.ui +3 -0
- package/shadcn/DialogHeader.ui +3 -0
- package/shadcn/DialogTitle.ui +3 -0
- package/shadcn/DialogTrigger.ui +6 -0
- package/shadcn/Direction.ui +3 -0
- package/shadcn/Drawer.ui +3 -0
- package/shadcn/DrawerClose.ui +6 -0
- package/shadcn/DrawerContent.ui +3 -0
- package/shadcn/DrawerDescription.ui +3 -0
- package/shadcn/DrawerFooter.ui +3 -0
- package/shadcn/DrawerHeader.ui +3 -0
- package/shadcn/DrawerTitle.ui +3 -0
- package/shadcn/DrawerTrigger.ui +6 -0
- package/shadcn/DropdownMenu.ui +3 -0
- package/shadcn/DropdownMenuCheckboxItem.ui +3 -0
- package/shadcn/DropdownMenuContent.ui +3 -0
- package/shadcn/DropdownMenuGroup.ui +3 -0
- package/shadcn/DropdownMenuItem.ui +3 -0
- package/shadcn/DropdownMenuLabel.ui +3 -0
- package/shadcn/DropdownMenuRadioGroup.ui +3 -0
- package/shadcn/DropdownMenuRadioItem.ui +3 -0
- package/shadcn/DropdownMenuSeparator.ui +3 -0
- package/shadcn/DropdownMenuShortcut.ui +3 -0
- package/shadcn/DropdownMenuSub.ui +3 -0
- package/shadcn/DropdownMenuSubContent.ui +3 -0
- package/shadcn/DropdownMenuSubTrigger.ui +3 -0
- package/shadcn/DropdownMenuTrigger.ui +6 -0
- package/shadcn/Empty.ui +3 -0
- package/shadcn/EmptyAction.ui +3 -0
- package/shadcn/EmptyDescription.ui +3 -0
- package/shadcn/EmptyTitle.ui +3 -0
- package/shadcn/Field.ui +3 -0
- package/shadcn/FieldControl.ui +3 -0
- package/shadcn/FieldDescription.ui +3 -0
- package/shadcn/FieldLabel.ui +3 -0
- package/shadcn/FieldMessage.ui +3 -0
- package/shadcn/HoverCard.ui +3 -0
- package/shadcn/HoverCardContent.ui +3 -0
- package/shadcn/HoverCardTrigger.ui +3 -0
- package/shadcn/Input.ui +8 -0
- package/shadcn/InputGroup.ui +3 -0
- package/shadcn/InputGroupAddon.ui +3 -0
- package/shadcn/InputGroupItem.ui +3 -0
- package/shadcn/InputOTP.ui +3 -0
- package/shadcn/InputOTPGroup.ui +3 -0
- package/shadcn/InputOTPSeparator.ui +3 -0
- package/shadcn/InputOTPSlot.ui +3 -0
- package/shadcn/Item.ui +3 -0
- package/shadcn/Kbd.ui +3 -0
- package/shadcn/Label.ui +3 -0
- package/shadcn/Menubar.ui +3 -0
- package/shadcn/MenubarCheckboxItem.ui +3 -0
- package/shadcn/MenubarContent.ui +3 -0
- package/shadcn/MenubarGroup.ui +3 -0
- package/shadcn/MenubarItem.ui +3 -0
- package/shadcn/MenubarLabel.ui +3 -0
- package/shadcn/MenubarMenu.ui +3 -0
- package/shadcn/MenubarRadioGroup.ui +3 -0
- package/shadcn/MenubarRadioItem.ui +3 -0
- package/shadcn/MenubarSeparator.ui +3 -0
- package/shadcn/MenubarShortcut.ui +3 -0
- package/shadcn/MenubarSub.ui +3 -0
- package/shadcn/MenubarSubContent.ui +3 -0
- package/shadcn/MenubarSubTrigger.ui +3 -0
- package/shadcn/MenubarTrigger.ui +6 -0
- package/shadcn/NativeSelect.ui +8 -0
- package/shadcn/NavigationMenu.ui +3 -0
- package/shadcn/NavigationMenuContent.ui +3 -0
- package/shadcn/NavigationMenuIndicator.ui +3 -0
- package/shadcn/NavigationMenuItem.ui +3 -0
- package/shadcn/NavigationMenuLink.ui +3 -0
- package/shadcn/NavigationMenuList.ui +3 -0
- package/shadcn/NavigationMenuTrigger.ui +6 -0
- package/shadcn/NavigationMenuViewport.ui +3 -0
- package/shadcn/Pagination.ui +6 -0
- package/shadcn/PaginationContent.ui +3 -0
- package/shadcn/PaginationEllipsis.ui +3 -0
- package/shadcn/PaginationItem.ui +3 -0
- package/shadcn/PaginationLink.ui +6 -0
- package/shadcn/PaginationNext.ui +6 -0
- package/shadcn/PaginationPrevious.ui +6 -0
- package/shadcn/Popover.ui +3 -0
- package/shadcn/PopoverContent.ui +3 -0
- package/shadcn/PopoverTrigger.ui +6 -0
- package/shadcn/Progress.ui +12 -0
- package/shadcn/RadioGroup.ui +3 -0
- package/shadcn/RadioGroupItem.ui +12 -0
- package/shadcn/ResizableHandle.ui +3 -0
- package/shadcn/ResizablePanel.ui +3 -0
- package/shadcn/ResizablePanelGroup.ui +3 -0
- package/shadcn/ScrollArea.ui +3 -0
- package/shadcn/ScrollBar.ui +3 -0
- package/shadcn/Select.ui +3 -0
- package/shadcn/SelectContent.ui +3 -0
- package/shadcn/SelectGroup.ui +3 -0
- package/shadcn/SelectItem.ui +3 -0
- package/shadcn/SelectLabel.ui +3 -0
- package/shadcn/SelectScrollDownButton.ui +6 -0
- package/shadcn/SelectScrollUpButton.ui +6 -0
- package/shadcn/SelectSeparator.ui +3 -0
- package/shadcn/SelectTrigger.ui +6 -0
- package/shadcn/SelectValue.ui +3 -0
- package/shadcn/Separator.ui +3 -0
- package/shadcn/Sheet.ui +3 -0
- package/shadcn/SheetClose.ui +6 -0
- package/shadcn/SheetContent.ui +3 -0
- package/shadcn/SheetDescription.ui +3 -0
- package/shadcn/SheetFooter.ui +3 -0
- package/shadcn/SheetHeader.ui +3 -0
- package/shadcn/SheetTitle.ui +3 -0
- package/shadcn/SheetTrigger.ui +6 -0
- package/shadcn/Sidebar.ui +3 -0
- package/shadcn/SidebarContent.ui +3 -0
- package/shadcn/SidebarFooter.ui +3 -0
- package/shadcn/SidebarGroup.ui +3 -0
- package/shadcn/SidebarHeader.ui +3 -0
- package/shadcn/SidebarMenu.ui +3 -0
- package/shadcn/SidebarMenuButton.ui +6 -0
- package/shadcn/SidebarMenuItem.ui +3 -0
- package/shadcn/SidebarMenuSub.ui +3 -0
- package/shadcn/SidebarMenuSubButton.ui +6 -0
- package/shadcn/SidebarMenuSubItem.ui +3 -0
- package/shadcn/SidebarRail.ui +3 -0
- package/shadcn/Skeleton.ui +3 -0
- package/shadcn/Slider.ui +12 -0
- package/shadcn/Sonner.ui +3 -0
- package/shadcn/SonnerToast.ui +3 -0
- package/shadcn/Spinner.ui +3 -0
- package/shadcn/Switch.ui +12 -0
- package/shadcn/Table.ui +3 -0
- package/shadcn/TableBody.ui +3 -0
- package/shadcn/TableCaption.ui +3 -0
- package/shadcn/TableCell.ui +3 -0
- package/shadcn/TableFooter.ui +3 -0
- package/shadcn/TableHead.ui +3 -0
- package/shadcn/TableHeader.ui +3 -0
- package/shadcn/TableRow.ui +3 -0
- package/shadcn/Tabs.ui +3 -0
- package/shadcn/TabsContent.ui +3 -0
- package/shadcn/TabsList.ui +3 -0
- package/shadcn/TabsTrigger.ui +6 -0
- package/shadcn/Textarea.ui +9 -0
- package/shadcn/Toast.ui +3 -0
- package/shadcn/ToastAction.ui +6 -0
- package/shadcn/ToastClose.ui +6 -0
- package/shadcn/ToastDescription.ui +3 -0
- package/shadcn/ToastProvider.ui +3 -0
- package/shadcn/ToastTitle.ui +3 -0
- package/shadcn/ToastViewport.ui +3 -0
- package/shadcn/Toggle.ui +6 -0
- package/shadcn/ToggleGroup.ui +3 -0
- package/shadcn/ToggleGroupItem.ui +6 -0
- package/shadcn/Tooltip.ui +3 -0
- package/shadcn/TooltipContent.ui +3 -0
- package/shadcn/TooltipProvider.ui +3 -0
- package/shadcn/TooltipTrigger.ui +3 -0
- package/shadcn/Typography.ui +3 -0
- package/shadcn/TypographyBlockquote.ui +3 -0
- package/shadcn/TypographyH1.ui +3 -0
- package/shadcn/TypographyH2.ui +3 -0
- package/shadcn/TypographyH3.ui +3 -0
- package/shadcn/TypographyH4.ui +3 -0
- package/shadcn/TypographyInlineCode.ui +3 -0
- package/shadcn/TypographyLarge.ui +3 -0
- package/shadcn/TypographyLead.ui +3 -0
- package/shadcn/TypographyList.ui +3 -0
- package/shadcn/TypographyMuted.ui +3 -0
- package/shadcn/TypographyP.ui +3 -0
- package/shadcn/TypographySmall.ui +3 -0
- package/shadcn/contracts.md +1045 -0
- package/shadcn-manifest.js +523 -0
- package/shadcn.css +163 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 The Units Authors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# ShadCN Units Library (DSL)
|
|
2
|
+
|
|
3
|
+
This package contains Units `.ui` templates modeled after the shadcn/ui component set.
|
|
4
|
+
|
|
5
|
+
Notes:
|
|
6
|
+
- Each component expects a `props` object in scope (e.g. `{ className: '' }`).
|
|
7
|
+
- Slots are rendered with `#slot (default)` unless otherwise noted.
|
|
8
|
+
- These templates focus on structure and Tailwind-style classes. Behavior (Radix, state management, portals, etc.) should be wired in your renderer or host components.
|
|
9
|
+
|
|
10
|
+
Suggested usage:
|
|
11
|
+
- Import a component AST via `units-manifest` and wrap it in a React component.
|
|
12
|
+
- Pass `props` into scope when rendering, and provide slots via `options.slots`.
|
|
13
|
+
|
|
14
|
+
Helper exports:
|
|
15
|
+
- `@botfather/units-uikit-shadcn` exposes `shadcnComponents` and `withShadcnComponents()` for quick wiring.
|
|
16
|
+
|
|
17
|
+
Example (React renderer):
|
|
18
|
+
```
|
|
19
|
+
import { renderUnits } from "@botfather/units/runtime";
|
|
20
|
+
import uiAst from "./app.ui";
|
|
21
|
+
import { withShadcnComponents } from "@botfather/units-uikit-shadcn";
|
|
22
|
+
|
|
23
|
+
const options = withShadcnComponents();
|
|
24
|
+
renderUnits(uiAst, { /* scope */ }, options);
|
|
25
|
+
```
|
package/index.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { renderUnits } from "@botfather/units/runtime";
|
|
2
|
+
import { uiManifest } from "./shadcn-manifest.js";
|
|
3
|
+
|
|
4
|
+
function normalizeScope(scope) {
|
|
5
|
+
return scope && typeof scope === "object" ? scope : {};
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function createUnitsComponent(ast) {
|
|
9
|
+
return function UnitsComponent(props) {
|
|
10
|
+
const { __scope, slots: slotOverrides, children, ...rest } = props || {};
|
|
11
|
+
const scope = {
|
|
12
|
+
...normalizeScope(__scope),
|
|
13
|
+
props: {
|
|
14
|
+
...rest,
|
|
15
|
+
children,
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
const slots = { ...(slotOverrides || {}) };
|
|
19
|
+
if (children != null) slots.default = children;
|
|
20
|
+
return renderUnits(ast, scope, { slots });
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const shadcnComponents = Object.fromEntries(
|
|
25
|
+
Object.entries(uiManifest).map(([name, ast]) => [name, createUnitsComponent(ast)]),
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
export function withShadcnComponents(options = {}) {
|
|
29
|
+
return {
|
|
30
|
+
...options,
|
|
31
|
+
components: {
|
|
32
|
+
...(options.components || {}),
|
|
33
|
+
...shadcnComponents,
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@botfather/units-uikit-shadcn",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "ShadCN-style component library authored in Units DSL.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/Botfather/units.git",
|
|
10
|
+
"directory": "packages/units-uikit-shadcn"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://github.com/Botfather/units/tree/main/packages/units-uikit-shadcn",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/Botfather/units/issues"
|
|
15
|
+
},
|
|
16
|
+
"main": "./index.js",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": "./index.js",
|
|
19
|
+
"./shadcn.css": "./shadcn.css",
|
|
20
|
+
"./shadcn-manifest.js": "./shadcn-manifest.js",
|
|
21
|
+
"./shadcn/*": "./shadcn/*"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"index.js",
|
|
25
|
+
"shadcn-manifest.js",
|
|
26
|
+
"shadcn.css",
|
|
27
|
+
"shadcn"
|
|
28
|
+
],
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@botfather/units": "1.0.0"
|
|
31
|
+
},
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"access": "public"
|
|
34
|
+
}
|
|
35
|
+
}
|
package/shadcn/Alert.ui
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
button (
|
|
2
|
+
className=@('inline-flex items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium hover:bg-accent hover:text-accent-foreground' + (props.className ? ' ' + props.className : '')),
|
|
3
|
+
type:'button'
|
|
4
|
+
) {
|
|
5
|
+
#slot (default)
|
|
6
|
+
}
|
package/shadcn/Avatar.ui
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
img (className=@('aspect-square h-full w-full' + (props.className ? ' ' + props.className : '')))
|
package/shadcn/Badge.ui
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
span (className=@('inline-flex items-center rounded-full border border-transparent px-2.5 py-0.5 text-xs font-semibold transition-colors' +
|
|
2
|
+
(props.variant == 'secondary' ? ' bg-secondary text-secondary-foreground' :
|
|
3
|
+
props.variant == 'destructive' ? ' bg-destructive text-destructive-foreground' :
|
|
4
|
+
props.variant == 'outline' ? ' border-border text-foreground' :
|
|
5
|
+
' bg-primary text-primary-foreground') +
|
|
6
|
+
(props.className ? ' ' + props.className : '')
|
|
7
|
+
)) {
|
|
8
|
+
#slot (default)
|
|
9
|
+
}
|
package/shadcn/Button.ui
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
button (
|
|
2
|
+
className=@('inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 ring-offset-background' +
|
|
3
|
+
(props.variant == 'destructive' ? ' bg-destructive text-destructive-foreground hover:bg-destructive/90' :
|
|
4
|
+
props.variant == 'outline' ? ' border border-input bg-background hover:bg-accent hover:text-accent-foreground' :
|
|
5
|
+
props.variant == 'secondary' ? ' bg-secondary text-secondary-foreground hover:bg-secondary/80' :
|
|
6
|
+
props.variant == 'ghost' ? ' hover:bg-accent hover:text-accent-foreground' :
|
|
7
|
+
props.variant == 'link' ? ' text-primary underline-offset-4 hover:underline' :
|
|
8
|
+
' bg-primary text-primary-foreground hover:bg-primary/90') +
|
|
9
|
+
(props.size == 'sm' ? ' h-9 rounded-md px-3' :
|
|
10
|
+
props.size == 'lg' ? ' h-11 rounded-md px-8' :
|
|
11
|
+
props.size == 'icon' ? ' h-10 w-10' :
|
|
12
|
+
' h-10 px-4 py-2') +
|
|
13
|
+
(props.className ? ' ' + props.className : '')
|
|
14
|
+
),
|
|
15
|
+
type=@(props.type || 'button'),
|
|
16
|
+
disabled?=@props.disabled,
|
|
17
|
+
!click { props.onClick && props.onClick(@event) }
|
|
18
|
+
) {
|
|
19
|
+
#slot (default)
|
|
20
|
+
}
|
package/shadcn/Card.ui
ADDED
package/shadcn/Chart.ui
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
label (className=@('inline-flex items-center gap-2 text-sm' + (props.className ? ' ' + props.className : ''))) {
|
|
2
|
+
input (
|
|
3
|
+
type:'checkbox',
|
|
4
|
+
className:'peer h-4 w-4 shrink-0 rounded-sm border border-input text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',
|
|
5
|
+
checked?=@props.checked,
|
|
6
|
+
disabled?=@props.disabled,
|
|
7
|
+
!change { props.onCheckedChange && props.onCheckedChange(@event) }
|
|
8
|
+
)
|
|
9
|
+
span (className:'sr-only') {
|
|
10
|
+
text 'Checkbox'
|
|
11
|
+
}
|
|
12
|
+
#slot (default)
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
input (className=@('w-full rounded-md border border-input bg-background px-3 py-2 text-sm' + (props.className ? ' ' + props.className : '')))
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
input (className=@('flex h-10 w-full rounded-md bg-transparent px-3 py-2 text-sm outline-none' + (props.className ? ' ' + props.className : '')))
|