@kinetixui/ui 0.7.0 → 0.8.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/dist/index.d.ts +36 -1
- package/dist/index.js +77 -0
- package/package.json +2 -2
- package/src/components/empty.tsx +76 -0
- package/src/components/kbd.tsx +40 -0
- package/src/index.ts +13 -0
- package/src/stories/Empty.stories.tsx +35 -0
- package/src/stories/Kbd.stories.tsx +27 -0
package/dist/index.d.ts
CHANGED
|
@@ -1217,7 +1217,42 @@ interface TableOfContentsProps extends React$1.HTMLAttributes<HTMLElement> {
|
|
|
1217
1217
|
}
|
|
1218
1218
|
declare const TableOfContents: React$1.ForwardRefExoticComponent<TableOfContentsProps & React$1.RefAttributes<HTMLElement>>;
|
|
1219
1219
|
|
|
1220
|
+
/**
|
|
1221
|
+
* Kbd — a single keyboard key glyph, e.g. `<Kbd>⌘</Kbd>`. Wrap several in
|
|
1222
|
+
* `KbdGroup` for a shortcut combo (`⌘` `K`). Gap-fill addition (not in the
|
|
1223
|
+
* original Figma source) — matches the shadcn/ui Kbd/KbdGroup API shape.
|
|
1224
|
+
*/
|
|
1225
|
+
interface KbdProps extends React$1.HTMLAttributes<HTMLElement> {
|
|
1226
|
+
/** render as the single child element (Radix Slot) instead of <kbd> */
|
|
1227
|
+
asChild?: boolean;
|
|
1228
|
+
}
|
|
1229
|
+
declare const Kbd: React$1.ForwardRefExoticComponent<KbdProps & React$1.RefAttributes<HTMLElement>>;
|
|
1230
|
+
interface KbdGroupProps extends React$1.HTMLAttributes<HTMLElement> {
|
|
1231
|
+
}
|
|
1232
|
+
/** Lays out multiple `Kbd` for a shortcut combo — `<KbdGroup><Kbd>⌘</Kbd><Kbd>K</Kbd></KbdGroup>` */
|
|
1233
|
+
declare const KbdGroup: React$1.ForwardRefExoticComponent<KbdGroupProps & React$1.RefAttributes<HTMLElement>>;
|
|
1234
|
+
|
|
1235
|
+
/**
|
|
1236
|
+
* Empty — a placeholder for a zero-results state (an empty table, an empty
|
|
1237
|
+
* search, a fresh workspace with nothing in it yet). Composition-based, like
|
|
1238
|
+
* Card: `Empty` is an unstyled-beyond-layout root so it composes cleanly
|
|
1239
|
+
* inside whatever already has a border (a Table cell, a Card, a bare page
|
|
1240
|
+
* section) instead of forcing its own. Gap-fill addition (not in the
|
|
1241
|
+
* original Figma source) — matches the shadcn/ui Empty API shape.
|
|
1242
|
+
*/
|
|
1243
|
+
declare const Empty: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & React$1.RefAttributes<HTMLDivElement>>;
|
|
1244
|
+
declare const EmptyHeader: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & React$1.RefAttributes<HTMLDivElement>>;
|
|
1245
|
+
declare const emptyMediaVariants: (props?: ({
|
|
1246
|
+
variant?: "icon" | "default" | null | undefined;
|
|
1247
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1248
|
+
interface EmptyMediaProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantProps<typeof emptyMediaVariants> {
|
|
1249
|
+
}
|
|
1250
|
+
declare const EmptyMedia: React$1.ForwardRefExoticComponent<EmptyMediaProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
1251
|
+
declare const EmptyTitle: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLParagraphElement> & React$1.RefAttributes<HTMLParagraphElement>>;
|
|
1252
|
+
declare const EmptyDescription: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLParagraphElement> & React$1.RefAttributes<HTMLParagraphElement>>;
|
|
1253
|
+
declare const EmptyContent: React$1.ForwardRefExoticComponent<React$1.HTMLAttributes<HTMLDivElement> & React$1.RefAttributes<HTMLDivElement>>;
|
|
1254
|
+
|
|
1220
1255
|
/** Merges Tailwind class names, resolving conflicts (clsx + tailwind-merge). */
|
|
1221
1256
|
declare function cn(...inputs: ClassValue[]): string;
|
|
1222
1257
|
|
|
1223
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AppBar, AppBarActions, AppBarBrand, AppBarLink, type AppBarLinkProps, AppBarNav, AspectRatio, AudioPlayer, type AudioPlayerProps, Avatar, AvatarFallback, AvatarGroup, type AvatarGroupProps, AvatarImage, Badge, type BadgeProps, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, type ButtonProps, Calendar, type CalendarProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, type CarouselApi, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, type ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, CircularProgress, type CircularProgressProps, CodeBlock, type CodeBlockFile, type CodeBlockProps, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, DataTable, DatePicker, type DatePickerProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Fab, type FabProps, Field, FieldControl, FieldDescription, FieldLabel, FieldMessage, FileUpload, FileUploadItem, type FileUploadItemProps, type FileUploadProps, Footer, FooterBottom, FooterColumn, type FooterColumnProps, FooterLink, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, HoverCard, HoverCardContent, HoverCardTrigger, Image, type ImageProps, Inform, type InformProps, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, type InputProps, Label, List, ListItem, type ListItemProps, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Metric, type MetricProps, Modal, type ModalProps, type ModalType, NavigationBar, type NavigationBarProps, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, NumberInput, type NumberInputProps, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, PasswordInput, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, Quote, type QuoteProps, RadioGroup, RadioGroupItem, Rating, type RatingProps, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarProvider, SidebarSeparator, SidebarTrigger, Skeleton, Slider, Spinner, type SpinnerProps, Stepper, type StepperProps, type StepperStep, Switch, TabBar, TabBarItem, type TabBarItemProps, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableOfContents, type TableOfContentsProps, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tag, type TagProps, Textarea, type TextareaProps, Toaster, type TocItem, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type UploadFile, badgeVariants, buttonVariants, cn, fabVariants, formatBytes, informVariants, inputVariants, messageVariants, navigationMenuTriggerStyle, spinnerVariants, tagVariants, textareaVariants, toggleVariants, useAppBar, useFormField, useSidebar };
|
|
1258
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AppBar, AppBarActions, AppBarBrand, AppBarLink, type AppBarLinkProps, AppBarNav, AspectRatio, AudioPlayer, type AudioPlayerProps, Avatar, AvatarFallback, AvatarGroup, type AvatarGroupProps, AvatarImage, Badge, type BadgeProps, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, type ButtonProps, Calendar, type CalendarProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, type CarouselApi, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, type ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, CircularProgress, type CircularProgressProps, CodeBlock, type CodeBlockFile, type CodeBlockProps, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, DataTable, DatePicker, type DatePickerProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, type EmptyMediaProps, EmptyTitle, Fab, type FabProps, Field, FieldControl, FieldDescription, FieldLabel, FieldMessage, FileUpload, FileUploadItem, type FileUploadItemProps, type FileUploadProps, Footer, FooterBottom, FooterColumn, type FooterColumnProps, FooterLink, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, HoverCard, HoverCardContent, HoverCardTrigger, Image, type ImageProps, Inform, type InformProps, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, type InputProps, Kbd, KbdGroup, type KbdGroupProps, type KbdProps, Label, List, ListItem, type ListItemProps, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Metric, type MetricProps, Modal, type ModalProps, type ModalType, NavigationBar, type NavigationBarProps, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, NumberInput, type NumberInputProps, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, PasswordInput, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, Quote, type QuoteProps, RadioGroup, RadioGroupItem, Rating, type RatingProps, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarProvider, SidebarSeparator, SidebarTrigger, Skeleton, Slider, Spinner, type SpinnerProps, Stepper, type StepperProps, type StepperStep, Switch, TabBar, TabBarItem, type TabBarItemProps, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableOfContents, type TableOfContentsProps, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tag, type TagProps, Textarea, type TextareaProps, Toaster, type TocItem, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type UploadFile, badgeVariants, buttonVariants, cn, emptyMediaVariants, fabVariants, formatBytes, informVariants, inputVariants, messageVariants, navigationMenuTriggerStyle, spinnerVariants, tagVariants, textareaVariants, toggleVariants, useAppBar, useFormField, useSidebar };
|
package/dist/index.js
CHANGED
|
@@ -3867,6 +3867,74 @@ var TableOfContents = React65.forwardRef(
|
|
|
3867
3867
|
}) })
|
|
3868
3868
|
);
|
|
3869
3869
|
TableOfContents.displayName = "TableOfContents";
|
|
3870
|
+
|
|
3871
|
+
// src/components/kbd.tsx
|
|
3872
|
+
import * as React66 from "react";
|
|
3873
|
+
import { Slot as Slot10 } from "@radix-ui/react-slot";
|
|
3874
|
+
import { jsx as jsx71 } from "react/jsx-runtime";
|
|
3875
|
+
var Kbd = React66.forwardRef(({ className, asChild = false, ...props }, ref) => {
|
|
3876
|
+
const Comp = asChild ? Slot10 : "kbd";
|
|
3877
|
+
return /* @__PURE__ */ jsx71(
|
|
3878
|
+
Comp,
|
|
3879
|
+
{
|
|
3880
|
+
ref,
|
|
3881
|
+
className: cn(
|
|
3882
|
+
"inline-flex h-5 min-w-5 items-center justify-center rounded-sm border border-input bg-muted px-1.5 font-sans text-[11px] font-medium text-muted-foreground",
|
|
3883
|
+
className
|
|
3884
|
+
),
|
|
3885
|
+
...props
|
|
3886
|
+
}
|
|
3887
|
+
);
|
|
3888
|
+
});
|
|
3889
|
+
Kbd.displayName = "Kbd";
|
|
3890
|
+
var KbdGroup = React66.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx71("kbd", { ref, className: cn("inline-flex items-center gap-1", className), ...props }));
|
|
3891
|
+
KbdGroup.displayName = "KbdGroup";
|
|
3892
|
+
|
|
3893
|
+
// src/components/empty.tsx
|
|
3894
|
+
import * as React67 from "react";
|
|
3895
|
+
import { cva as cva18 } from "class-variance-authority";
|
|
3896
|
+
import { jsx as jsx72 } from "react/jsx-runtime";
|
|
3897
|
+
var Empty = React67.forwardRef(
|
|
3898
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx72(
|
|
3899
|
+
"div",
|
|
3900
|
+
{
|
|
3901
|
+
ref,
|
|
3902
|
+
className: cn("flex min-w-0 flex-1 flex-col items-center justify-center gap-6 p-10 text-center font-sans", className),
|
|
3903
|
+
...props
|
|
3904
|
+
}
|
|
3905
|
+
)
|
|
3906
|
+
);
|
|
3907
|
+
Empty.displayName = "Empty";
|
|
3908
|
+
var EmptyHeader = React67.forwardRef(
|
|
3909
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx72("div", { ref, className: cn("flex max-w-sm flex-col items-center gap-2", className), ...props })
|
|
3910
|
+
);
|
|
3911
|
+
EmptyHeader.displayName = "EmptyHeader";
|
|
3912
|
+
var emptyMediaVariants = cva18("flex shrink-0 items-center justify-center", {
|
|
3913
|
+
variants: {
|
|
3914
|
+
/** `icon` gives a muted circular badge behind the icon; `default` renders the child as-is (an illustration, an avatar, …) */
|
|
3915
|
+
variant: {
|
|
3916
|
+
default: "",
|
|
3917
|
+
icon: "size-10 rounded-full bg-muted text-muted-foreground [&_svg]:size-5"
|
|
3918
|
+
}
|
|
3919
|
+
},
|
|
3920
|
+
defaultVariants: { variant: "default" }
|
|
3921
|
+
});
|
|
3922
|
+
var EmptyMedia = React67.forwardRef(
|
|
3923
|
+
({ className, variant, ...props }, ref) => /* @__PURE__ */ jsx72("div", { ref, className: cn(emptyMediaVariants({ variant }), className), ...props })
|
|
3924
|
+
);
|
|
3925
|
+
EmptyMedia.displayName = "EmptyMedia";
|
|
3926
|
+
var EmptyTitle = React67.forwardRef(
|
|
3927
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx72("p", { ref, className: cn("text-title-sm font-medium text-foreground", className), ...props })
|
|
3928
|
+
);
|
|
3929
|
+
EmptyTitle.displayName = "EmptyTitle";
|
|
3930
|
+
var EmptyDescription = React67.forwardRef(
|
|
3931
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx72("p", { ref, className: cn("text-body-sm text-muted-foreground", className), ...props })
|
|
3932
|
+
);
|
|
3933
|
+
EmptyDescription.displayName = "EmptyDescription";
|
|
3934
|
+
var EmptyContent = React67.forwardRef(
|
|
3935
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx72("div", { ref, className: cn("flex flex-col items-center gap-3", className), ...props })
|
|
3936
|
+
);
|
|
3937
|
+
EmptyContent.displayName = "EmptyContent";
|
|
3870
3938
|
export {
|
|
3871
3939
|
Accordion,
|
|
3872
3940
|
AccordionContent,
|
|
@@ -3991,6 +4059,12 @@ export {
|
|
|
3991
4059
|
DropdownMenuSubContent,
|
|
3992
4060
|
DropdownMenuSubTrigger,
|
|
3993
4061
|
DropdownMenuTrigger,
|
|
4062
|
+
Empty,
|
|
4063
|
+
EmptyContent,
|
|
4064
|
+
EmptyDescription,
|
|
4065
|
+
EmptyHeader,
|
|
4066
|
+
EmptyMedia,
|
|
4067
|
+
EmptyTitle,
|
|
3994
4068
|
Fab,
|
|
3995
4069
|
Field,
|
|
3996
4070
|
FieldControl,
|
|
@@ -4025,6 +4099,8 @@ export {
|
|
|
4025
4099
|
InputOTPGroup,
|
|
4026
4100
|
InputOTPSeparator,
|
|
4027
4101
|
InputOTPSlot,
|
|
4102
|
+
Kbd,
|
|
4103
|
+
KbdGroup,
|
|
4028
4104
|
Label2 as Label,
|
|
4029
4105
|
List3 as List,
|
|
4030
4106
|
ListItem,
|
|
@@ -4146,6 +4222,7 @@ export {
|
|
|
4146
4222
|
badgeVariants,
|
|
4147
4223
|
buttonVariants,
|
|
4148
4224
|
cn,
|
|
4225
|
+
emptyMediaVariants,
|
|
4149
4226
|
fabVariants,
|
|
4150
4227
|
formatBytes,
|
|
4151
4228
|
informVariants,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kinetixui/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "KinetixUI React components — CVA + Radix + Tailwind on the KinetixUI token contract. Also distributed via the kinetixui CLI as a component registry.",
|
|
6
6
|
"keywords": [
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"react-dom": ">=18"
|
|
91
91
|
},
|
|
92
92
|
"devDependencies": {
|
|
93
|
-
"@kinetixui/tokens": "0.
|
|
93
|
+
"@kinetixui/tokens": "0.8.0",
|
|
94
94
|
"@testing-library/jest-dom": "^7.0.1",
|
|
95
95
|
"@testing-library/react": "^16.3.3",
|
|
96
96
|
"@testing-library/user-event": "^14.6.7",
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
5
|
+
import { cn } from "../lib/utils";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Empty — a placeholder for a zero-results state (an empty table, an empty
|
|
9
|
+
* search, a fresh workspace with nothing in it yet). Composition-based, like
|
|
10
|
+
* Card: `Empty` is an unstyled-beyond-layout root so it composes cleanly
|
|
11
|
+
* inside whatever already has a border (a Table cell, a Card, a bare page
|
|
12
|
+
* section) instead of forcing its own. Gap-fill addition (not in the
|
|
13
|
+
* original Figma source) — matches the shadcn/ui Empty API shape.
|
|
14
|
+
*/
|
|
15
|
+
const Empty = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
16
|
+
({ className, ...props }, ref) => (
|
|
17
|
+
<div
|
|
18
|
+
ref={ref}
|
|
19
|
+
className={cn("flex min-w-0 flex-1 flex-col items-center justify-center gap-6 p-10 text-center font-sans", className)}
|
|
20
|
+
{...props}
|
|
21
|
+
/>
|
|
22
|
+
),
|
|
23
|
+
);
|
|
24
|
+
Empty.displayName = "Empty";
|
|
25
|
+
|
|
26
|
+
const EmptyHeader = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
27
|
+
({ className, ...props }, ref) => (
|
|
28
|
+
<div ref={ref} className={cn("flex max-w-sm flex-col items-center gap-2", className)} {...props} />
|
|
29
|
+
),
|
|
30
|
+
);
|
|
31
|
+
EmptyHeader.displayName = "EmptyHeader";
|
|
32
|
+
|
|
33
|
+
const emptyMediaVariants = cva("flex shrink-0 items-center justify-center", {
|
|
34
|
+
variants: {
|
|
35
|
+
/** `icon` gives a muted circular badge behind the icon; `default` renders the child as-is (an illustration, an avatar, …) */
|
|
36
|
+
variant: {
|
|
37
|
+
default: "",
|
|
38
|
+
icon: "size-10 rounded-full bg-muted text-muted-foreground [&_svg]:size-5",
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
defaultVariants: { variant: "default" },
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
export interface EmptyMediaProps
|
|
45
|
+
extends React.HTMLAttributes<HTMLDivElement>,
|
|
46
|
+
VariantProps<typeof emptyMediaVariants> {}
|
|
47
|
+
|
|
48
|
+
const EmptyMedia = React.forwardRef<HTMLDivElement, EmptyMediaProps>(
|
|
49
|
+
({ className, variant, ...props }, ref) => (
|
|
50
|
+
<div ref={ref} className={cn(emptyMediaVariants({ variant }), className)} {...props} />
|
|
51
|
+
),
|
|
52
|
+
);
|
|
53
|
+
EmptyMedia.displayName = "EmptyMedia";
|
|
54
|
+
|
|
55
|
+
const EmptyTitle = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>(
|
|
56
|
+
({ className, ...props }, ref) => (
|
|
57
|
+
<p ref={ref} className={cn("text-title-sm font-medium text-foreground", className)} {...props} />
|
|
58
|
+
),
|
|
59
|
+
);
|
|
60
|
+
EmptyTitle.displayName = "EmptyTitle";
|
|
61
|
+
|
|
62
|
+
const EmptyDescription = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>(
|
|
63
|
+
({ className, ...props }, ref) => (
|
|
64
|
+
<p ref={ref} className={cn("text-body-sm text-muted-foreground", className)} {...props} />
|
|
65
|
+
),
|
|
66
|
+
);
|
|
67
|
+
EmptyDescription.displayName = "EmptyDescription";
|
|
68
|
+
|
|
69
|
+
const EmptyContent = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
70
|
+
({ className, ...props }, ref) => (
|
|
71
|
+
<div ref={ref} className={cn("flex flex-col items-center gap-3", className)} {...props} />
|
|
72
|
+
),
|
|
73
|
+
);
|
|
74
|
+
EmptyContent.displayName = "EmptyContent";
|
|
75
|
+
|
|
76
|
+
export { Empty, EmptyHeader, EmptyMedia, EmptyTitle, EmptyDescription, EmptyContent, emptyMediaVariants };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
5
|
+
import { cn } from "../lib/utils";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Kbd — a single keyboard key glyph, e.g. `<Kbd>⌘</Kbd>`. Wrap several in
|
|
9
|
+
* `KbdGroup` for a shortcut combo (`⌘` `K`). Gap-fill addition (not in the
|
|
10
|
+
* original Figma source) — matches the shadcn/ui Kbd/KbdGroup API shape.
|
|
11
|
+
*/
|
|
12
|
+
export interface KbdProps extends React.HTMLAttributes<HTMLElement> {
|
|
13
|
+
/** render as the single child element (Radix Slot) instead of <kbd> */
|
|
14
|
+
asChild?: boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const Kbd = React.forwardRef<HTMLElement, KbdProps>(({ className, asChild = false, ...props }, ref) => {
|
|
18
|
+
const Comp = asChild ? Slot : "kbd";
|
|
19
|
+
return (
|
|
20
|
+
<Comp
|
|
21
|
+
ref={ref}
|
|
22
|
+
className={cn(
|
|
23
|
+
"inline-flex h-5 min-w-5 items-center justify-center rounded-sm border border-input bg-muted px-1.5 font-sans text-[11px] font-medium text-muted-foreground",
|
|
24
|
+
className,
|
|
25
|
+
)}
|
|
26
|
+
{...props}
|
|
27
|
+
/>
|
|
28
|
+
);
|
|
29
|
+
});
|
|
30
|
+
Kbd.displayName = "Kbd";
|
|
31
|
+
|
|
32
|
+
export interface KbdGroupProps extends React.HTMLAttributes<HTMLElement> {}
|
|
33
|
+
|
|
34
|
+
/** Lays out multiple `Kbd` for a shortcut combo — `<KbdGroup><Kbd>⌘</Kbd><Kbd>K</Kbd></KbdGroup>` */
|
|
35
|
+
const KbdGroup = React.forwardRef<HTMLElement, KbdGroupProps>(({ className, ...props }, ref) => (
|
|
36
|
+
<kbd ref={ref} className={cn("inline-flex items-center gap-1", className)} {...props} />
|
|
37
|
+
));
|
|
38
|
+
KbdGroup.displayName = "KbdGroup";
|
|
39
|
+
|
|
40
|
+
export { Kbd, KbdGroup };
|
package/src/index.ts
CHANGED
|
@@ -311,4 +311,17 @@ export { Quote, type QuoteProps } from "./components/quote";
|
|
|
311
311
|
export { Footer, FooterColumn, FooterLink, FooterBottom, type FooterColumnProps } from "./components/footer";
|
|
312
312
|
export { TableOfContents, type TableOfContentsProps, type TocItem } from "./components/table-of-contents";
|
|
313
313
|
|
|
314
|
+
/* Batch 6 — infra/design-system audit gap-fill components */
|
|
315
|
+
export { Kbd, KbdGroup, type KbdProps, type KbdGroupProps } from "./components/kbd";
|
|
316
|
+
export {
|
|
317
|
+
Empty,
|
|
318
|
+
EmptyHeader,
|
|
319
|
+
EmptyMedia,
|
|
320
|
+
EmptyTitle,
|
|
321
|
+
EmptyDescription,
|
|
322
|
+
EmptyContent,
|
|
323
|
+
emptyMediaVariants,
|
|
324
|
+
type EmptyMediaProps,
|
|
325
|
+
} from "./components/empty";
|
|
326
|
+
|
|
314
327
|
export { cn } from "./lib/utils";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/* AUTO-GENERATED by scripts/gen-stories.mjs — do not edit.
|
|
2
|
+
Source of truth: apps/web/src/registry/demos.tsx */
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
5
|
+
import { Button, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle } from "@kinetixui/ui";
|
|
6
|
+
import { Search } from "lucide-react";
|
|
7
|
+
|
|
8
|
+
const Demo = () => (
|
|
9
|
+
<Empty className="w-full max-w-sm rounded-lg border border-dashed">
|
|
10
|
+
<EmptyHeader>
|
|
11
|
+
<EmptyMedia variant="icon">
|
|
12
|
+
<Search />
|
|
13
|
+
</EmptyMedia>
|
|
14
|
+
<EmptyTitle>No results found</EmptyTitle>
|
|
15
|
+
<EmptyDescription>Try adjusting your search or filters.</EmptyDescription>
|
|
16
|
+
</EmptyHeader>
|
|
17
|
+
<EmptyContent>
|
|
18
|
+
<Button variant="Outline" size="sm">
|
|
19
|
+
Clear filters
|
|
20
|
+
</Button>
|
|
21
|
+
</EmptyContent>
|
|
22
|
+
</Empty>
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
const meta = {
|
|
26
|
+
title: "Feedback/Empty",
|
|
27
|
+
parameters: {
|
|
28
|
+
layout: "centered",
|
|
29
|
+
docs: { source: { code: "<Empty>\\n <EmptyHeader>\\n <EmptyMedia variant=\"icon\"><Search /></EmptyMedia>\\n <EmptyTitle>No results found</EmptyTitle>\\n <EmptyDescription>Try adjusting your search or filters.</EmptyDescription>\\n </EmptyHeader>\\n <EmptyContent>\\n <Button variant=\"Outline\" size=\"sm\">Clear filters</Button>\\n </EmptyContent>\\n</Empty>", language: "tsx" } },
|
|
30
|
+
},
|
|
31
|
+
} satisfies Meta;
|
|
32
|
+
|
|
33
|
+
export default meta;
|
|
34
|
+
|
|
35
|
+
export const Default: StoryObj<typeof meta> = { render: () => <Demo /> };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/* AUTO-GENERATED by scripts/gen-stories.mjs — do not edit.
|
|
2
|
+
Source of truth: apps/web/src/registry/demos.tsx */
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
5
|
+
import { Kbd, KbdGroup } from "@kinetixui/ui";
|
|
6
|
+
|
|
7
|
+
const Demo = () => (
|
|
8
|
+
<div className="flex items-center gap-4">
|
|
9
|
+
<Kbd>⏎</Kbd>
|
|
10
|
+
<KbdGroup>
|
|
11
|
+
<Kbd>⌘</Kbd>
|
|
12
|
+
<Kbd>K</Kbd>
|
|
13
|
+
</KbdGroup>
|
|
14
|
+
</div>
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
const meta = {
|
|
18
|
+
title: "Foundations/Kbd",
|
|
19
|
+
parameters: {
|
|
20
|
+
layout: "centered",
|
|
21
|
+
docs: { source: { code: "<Kbd>⏎</Kbd>\\n<KbdGroup>\\n <Kbd>⌘</Kbd>\\n <Kbd>K</Kbd>\\n</KbdGroup>", language: "tsx" } },
|
|
22
|
+
},
|
|
23
|
+
} satisfies Meta;
|
|
24
|
+
|
|
25
|
+
export default meta;
|
|
26
|
+
|
|
27
|
+
export const Default: StoryObj<typeof meta> = { render: () => <Demo /> };
|