kf-component-library 1.1.2
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 +90 -0
- package/dist/lib/main.d.ts +56 -0
- package/dist/lib/main.d.ts.map +1 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/main.cjs.js +277 -0
- package/dist/main.es.js +34009 -0
- package/package.json +103 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Kreftforeningen
|
|
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,90 @@
|
|
|
1
|
+
# kf-component-library
|
|
2
|
+
|
|
3
|
+
A modern, accessible, and customizable React component library built with [Radix UI](https://www.radix-ui.com/), [Tailwind CSS](https://tailwindcss.com/), and [Vite](https://vitejs.dev/).
|
|
4
|
+
Perfect for building beautiful, production-ready UIs with speed and consistency.
|
|
5
|
+
|
|
6
|
+
## Features
|
|
7
|
+
|
|
8
|
+
- **Accessible**: Built on top of Radix UI primitives for accessibility out of the box.
|
|
9
|
+
- **Customizable**: Style with Tailwind CSS and easily override component styles.
|
|
10
|
+
- **Comprehensive**: Includes Accordions, Alerts, Badges, Buttons, Cards, Carousels, Dropdowns, Forms, Tables, Tooltips, and more.
|
|
11
|
+
- **Type-safe**: Written in TypeScript with full type definitions.
|
|
12
|
+
- **Fast**: Powered by Vite for instant HMR and fast builds.
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
pnpm add kf-component-library
|
|
18
|
+
# or
|
|
19
|
+
npm install kf-component-library
|
|
20
|
+
# or
|
|
21
|
+
yarn add kf-component-library
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Usage
|
|
25
|
+
|
|
26
|
+
Import components directly from the library:
|
|
27
|
+
|
|
28
|
+
```tsx
|
|
29
|
+
import {
|
|
30
|
+
Button,
|
|
31
|
+
Card,
|
|
32
|
+
Badge,
|
|
33
|
+
Accordion,
|
|
34
|
+
Alert,
|
|
35
|
+
// ...and more
|
|
36
|
+
} from "kf-component-library";
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Example:
|
|
40
|
+
|
|
41
|
+
```tsx
|
|
42
|
+
import { Button, Card, Badge } from "kf-component-library";
|
|
43
|
+
|
|
44
|
+
function Example() {
|
|
45
|
+
return (
|
|
46
|
+
<Card>
|
|
47
|
+
<Badge>New</Badge>
|
|
48
|
+
<h2>Card Title</h2>
|
|
49
|
+
<Button>Click me</Button>
|
|
50
|
+
</Card>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Components
|
|
56
|
+
|
|
57
|
+
- Accordion, Alert, AlertDialog, AspectRatio, Avatar, Badge, Breadcrumb, Button, Calendar, Card, Carousel, Checkbox, Collapsible, Command, ContextMenu, Dialog, Drawer, DropdownMenu, HoverCard, Input, InputOTP, Label, Menubar, NavigationMenu, Pagination, Popover, Progress, RadioGroup, Resizable, ScrollArea, Select, Separator, Sheet, Sidebar, Skeleton, Slider, Switch, Table, Tabs, Textarea, Toaster, Toggle, ToggleGroup, Tooltip, and more.
|
|
58
|
+
|
|
59
|
+
See the [source code](./src/lib/main.ts) for a full list of exports.
|
|
60
|
+
|
|
61
|
+
## Theming
|
|
62
|
+
|
|
63
|
+
All components are styled with Tailwind CSS utility classes.
|
|
64
|
+
You can override styles using the `className` prop or extend Tailwind's config.
|
|
65
|
+
|
|
66
|
+
## Development
|
|
67
|
+
|
|
68
|
+
### Scripts
|
|
69
|
+
|
|
70
|
+
- `pnpm dev` – Start the development server
|
|
71
|
+
- `pnpm build` – Build the library for production
|
|
72
|
+
- `pnpm lint` – Lint the source code
|
|
73
|
+
- `pnpm check-types` – Type-check the codebase
|
|
74
|
+
- `pnpm test` – Run tests
|
|
75
|
+
|
|
76
|
+
### Requirements
|
|
77
|
+
|
|
78
|
+
- Node.js 18+
|
|
79
|
+
- pnpm, npm, or yarn
|
|
80
|
+
|
|
81
|
+
## Contributing
|
|
82
|
+
|
|
83
|
+
1. Fork the repo and create your branch.
|
|
84
|
+
2. Run `pnpm install` to install dependencies.
|
|
85
|
+
3. Run `pnpm dev` to start the playground.
|
|
86
|
+
4. Submit a pull request!
|
|
87
|
+
|
|
88
|
+
## License
|
|
89
|
+
|
|
90
|
+
MIT © Asbjørn Ness / Kreftforeningen
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export { AccentuatedLink, AccentuatedLinkSubtitle, AccentuatedLinkTitle, } from '../accentuated-link';
|
|
2
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, } from '../accordion';
|
|
3
|
+
export { Alert, AlertDescription, AlertTitle } from '../alert';
|
|
4
|
+
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, } from '../alert-dialog';
|
|
5
|
+
export { AspectRatio } from '../aspect-ratio';
|
|
6
|
+
export { Avatar, AvatarFallback, AvatarImage } from '../avatar';
|
|
7
|
+
export { Badge } from '../badge';
|
|
8
|
+
export { Banner, BannerImage, BannerContent, BannerTitle, BannerDescription, BannerButtons, } from '../banner';
|
|
9
|
+
export { Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, } from '../breadcrumb';
|
|
10
|
+
export { Button } from '../button';
|
|
11
|
+
export { Calendar } from '../calendar';
|
|
12
|
+
export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, } from '../card';
|
|
13
|
+
export { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, } from '../carousel';
|
|
14
|
+
export { ChartContainer, ChartTooltip, ChartTooltipContent, ChartLegend, ChartLegendContent, ChartStyle, } from '../chart';
|
|
15
|
+
export type { ChartConfig } from '../chart';
|
|
16
|
+
export { Checkbox } from '../checkbox';
|
|
17
|
+
export { Collapsible, CollapsibleContent, CollapsibleTrigger, } from '../collapsible';
|
|
18
|
+
export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, } from '../command';
|
|
19
|
+
export { ContextMenu, ContextMenuContent, ContextMenuItem, ContextMenuTrigger, } from '../context-menu';
|
|
20
|
+
export { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, DialogTrigger, } from '../dialog';
|
|
21
|
+
export { Download, DownloadContent, DownloadImage, DownloadMain, DownloadTitle, DownloadDescription, DownloadFooter, DownloadDownloadUrl, DownloadOrderUrl, } from '../download';
|
|
22
|
+
export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger, } from '../drawer';
|
|
23
|
+
export { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, } from '../dropdown-menu';
|
|
24
|
+
export { FactBox, FactBoxTitle, FactBoxContent, FactBoxAction, FactBoxDescription, } from '../fact-box';
|
|
25
|
+
export { HoverCard, HoverCardContent, HoverCardTrigger } from '../hover-card';
|
|
26
|
+
export { Infographic, InfographicItem, InfographicItemIcon, InfographicItemTitle, InfographicItemTitleNumber, InfographicItemTitleText, InfographicItemDescription, } from '../infographic';
|
|
27
|
+
export { Input } from '../input';
|
|
28
|
+
export { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, } from '../input-otp';
|
|
29
|
+
export { Label } from '../label';
|
|
30
|
+
export { LinkList, LinkListItem, LinkListTitle, LinkListDescription, } from '../link-list';
|
|
31
|
+
export { Menubar, MenubarContent, MenubarItem, MenubarMenu, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, } from '../menubar';
|
|
32
|
+
export { NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, } from '../navigation-menu';
|
|
33
|
+
export { Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, } from '../pagination';
|
|
34
|
+
export { Person, PersonItem, PersonItemImage, PersonItemContent, PersonItemName, PersonItemTitle, PersonItemEmail, PersonItemPhone, PersonItemDescription, } from '../person';
|
|
35
|
+
export { Popover, PopoverContent, PopoverTrigger } from '../popover';
|
|
36
|
+
export { Progress } from '../progress';
|
|
37
|
+
export { RadioGroup, RadioGroupItem } from '../radio-group';
|
|
38
|
+
export { ResizableHandle, ResizablePanel, ResizablePanelGroup, } from '../resizable';
|
|
39
|
+
export { ScrollArea } from '../scroll-area';
|
|
40
|
+
export { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from '../select';
|
|
41
|
+
export { Separator } from '../separator';
|
|
42
|
+
export { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle, SheetTrigger, SheetClose, SheetFooter, } from '../sheet';
|
|
43
|
+
export { Sidebar, SidebarContent, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarMenu, SidebarMenuButton, SidebarMenuItem, } from '../sidebar';
|
|
44
|
+
export { Skeleton } from '../skeleton';
|
|
45
|
+
export { Slider } from '../slider';
|
|
46
|
+
export { Switch } from '../switch';
|
|
47
|
+
export { Table, TableBody, TableCaption, TableCell, TableHead, TableHeader, TableRow, } from '../table';
|
|
48
|
+
export { Tabs, TabsContent, TabsList, TabsTrigger } from '../tabs';
|
|
49
|
+
export { Textarea } from '../textarea';
|
|
50
|
+
export { Timeline, TimelineItem, TimelineItemTitle, TimelineItemDescription, } from '../timeline';
|
|
51
|
+
export { Toaster } from '../sonner';
|
|
52
|
+
export { toast } from 'sonner';
|
|
53
|
+
export { Toggle } from '../toggle';
|
|
54
|
+
export { ToggleGroup, ToggleGroupItem } from '../toggle-group';
|
|
55
|
+
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from '../tooltip';
|
|
56
|
+
//# sourceMappingURL=main.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/lib/main.ts"],"names":[],"mappings":"AACA,OAAO,cAAc,CAAC;AACtB,OAAO,EACL,eAAe,EACf,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,gBAAgB,GACjB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC/D,OAAO,EACL,WA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