@aereamart/design-system 0.3.5 → 0.4.1
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/cn.d.ts +2 -1
- package/dist/cn.js +4 -2
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/hooks/use-mobile.js +15 -0
- package/dist/index.d.ts +48 -37
- package/dist/index.js +48 -37
- package/dist/ui/accordion.d.ts +7 -0
- package/dist/ui/accordion.js +17 -0
- package/dist/ui/alert-dialog.d.ts +18 -0
- package/dist/ui/alert-dialog.js +42 -0
- package/dist/ui/alert.d.ts +9 -0
- package/dist/ui/alert.js +24 -0
- package/dist/ui/aspect-ratio.d.ts +3 -0
- package/dist/ui/aspect-ratio.js +6 -0
- package/dist/ui/avatar.d.ts +11 -0
- package/dist/ui/avatar.js +23 -0
- package/dist/ui/badge.d.ts +9 -0
- package/dist/ui/badge.js +24 -0
- package/dist/ui/breadcrumb.d.ts +11 -0
- package/dist/ui/breadcrumb.js +27 -0
- package/dist/ui/button.d.ts +10 -0
- package/dist/ui/button.js +35 -0
- package/dist/ui/calendar.d.ts +8 -0
- package/dist/ui/calendar.js +75 -0
- package/dist/ui/card.d.ts +9 -0
- package/dist/ui/card.js +24 -0
- package/dist/ui/carousel.d.ts +19 -0
- package/dist/ui/carousel.js +91 -0
- package/dist/ui/chart.d.ts +44 -0
- package/dist/ui/chart.js +132 -0
- package/dist/ui/checkbox.d.ts +4 -0
- package/dist/ui/checkbox.js +8 -0
- package/dist/ui/collapsible.d.ts +5 -0
- package/dist/ui/collapsible.js +13 -0
- package/dist/ui/command.d.ts +18 -0
- package/dist/ui/command.js +34 -0
- package/dist/ui/context-menu.d.ts +25 -0
- package/dist/ui/context-menu.js +51 -0
- package/dist/ui/dialog.d.ts +17 -0
- package/dist/ui/dialog.js +36 -0
- package/dist/ui/drawer.d.ts +13 -0
- package/dist/ui/drawer.js +35 -0
- package/dist/ui/dropdown-menu.d.ts +25 -0
- package/dist/ui/dropdown-menu.js +50 -0
- package/dist/ui/form.d.ts +24 -0
- package/dist/ui/form.js +58 -0
- package/dist/ui/hover-card.d.ts +6 -0
- package/dist/ui/hover-card.js +13 -0
- package/dist/ui/input-otp.d.ts +11 -0
- package/dist/ui/input-otp.js +21 -0
- package/dist/ui/input.d.ts +3 -0
- package/dist/ui/input.js +6 -0
- package/dist/ui/label.d.ts +4 -0
- package/dist/ui/label.js +8 -0
- package/dist/ui/menubar.d.ts +26 -0
- package/dist/ui/menubar.js +53 -0
- package/dist/ui/navigation-menu.d.ts +14 -0
- package/dist/ui/navigation-menu.js +31 -0
- package/dist/ui/pagination.d.ts +13 -0
- package/dist/ui/pagination.js +29 -0
- package/dist/ui/popover.d.ts +10 -0
- package/dist/ui/popover.js +26 -0
- package/dist/ui/progress.d.ts +4 -0
- package/dist/ui/progress.js +7 -0
- package/dist/ui/radio-group.d.ts +5 -0
- package/dist/ui/radio-group.js +12 -0
- package/dist/ui/resizable.d.ts +7 -0
- package/dist/ui/resizable.js +14 -0
- package/dist/ui/scroll-area.d.ts +5 -0
- package/dist/ui/scroll-area.js +12 -0
- package/dist/ui/select.d.ts +15 -0
- package/dist/ui/select.js +38 -0
- package/dist/ui/separator.d.ts +4 -0
- package/dist/ui/separator.js +7 -0
- package/dist/ui/sheet.d.ts +14 -0
- package/dist/ui/sheet.js +40 -0
- package/dist/ui/sidebar.d.ts +69 -0
- package/dist/ui/sidebar.js +211 -0
- package/dist/ui/skeleton.d.ts +2 -0
- package/dist/ui/skeleton.js +6 -0
- package/dist/ui/slider.d.ts +4 -0
- package/dist/ui/slider.js +13 -0
- package/dist/ui/sonner.d.ts +3 -0
- package/dist/ui/sonner.js +21 -0
- package/dist/ui/switch.d.ts +6 -0
- package/dist/ui/switch.js +7 -0
- package/dist/ui/table.d.ts +10 -0
- package/dist/ui/table.js +28 -0
- package/dist/ui/tabs.d.ts +11 -0
- package/dist/ui/tabs.js +28 -0
- package/dist/ui/textarea.d.ts +3 -0
- package/dist/ui/textarea.js +6 -0
- package/dist/ui/toggle-group.d.ts +9 -0
- package/dist/ui/toggle-group.js +22 -0
- package/dist/ui/toggle.d.ts +9 -0
- package/dist/ui/toggle.js +26 -0
- package/dist/ui/tooltip.d.ts +7 -0
- package/dist/ui/tooltip.js +16 -0
- package/package.json +28 -4
- package/src/cn.ts +5 -2
- package/src/hooks/use-mobile.ts +19 -0
- package/src/index.css +140 -0
- package/src/index.ts +48 -37
- package/src/ui/accordion.tsx +63 -0
- package/src/ui/alert-dialog.tsx +196 -0
- package/src/ui/alert.tsx +65 -0
- package/src/ui/aspect-ratio.tsx +9 -0
- package/src/ui/avatar.tsx +108 -0
- package/src/ui/badge.tsx +47 -0
- package/src/ui/breadcrumb.tsx +108 -0
- package/src/ui/button.tsx +63 -0
- package/src/ui/calendar.tsx +218 -0
- package/src/ui/card.tsx +91 -0
- package/src/ui/carousel.tsx +241 -0
- package/src/ui/chart.tsx +371 -0
- package/src/ui/checkbox.tsx +29 -0
- package/src/ui/collapsible.tsx +33 -0
- package/src/ui/command.tsx +184 -0
- package/src/ui/context-menu.tsx +251 -0
- package/src/ui/dialog.tsx +156 -0
- package/src/ui/drawer.tsx +134 -0
- package/src/ui/dropdown-menu.tsx +254 -0
- package/src/ui/form.tsx +165 -0
- package/src/ui/hover-card.tsx +41 -0
- package/src/ui/input-otp.tsx +76 -0
- package/src/ui/input.tsx +20 -0
- package/src/ui/label.tsx +23 -0
- package/src/ui/menubar.tsx +273 -0
- package/src/ui/navigation-menu.tsx +167 -0
- package/src/ui/pagination.tsx +127 -0
- package/src/ui/popover.tsx +88 -0
- package/src/ui/progress.tsx +28 -0
- package/src/ui/radio-group.tsx +44 -0
- package/src/ui/resizable.tsx +50 -0
- package/src/ui/scroll-area.tsx +55 -0
- package/src/ui/select.tsx +189 -0
- package/src/ui/separator.tsx +25 -0
- package/src/ui/sheet.tsx +142 -0
- package/src/ui/sidebar.tsx +724 -0
- package/src/ui/skeleton.tsx +13 -0
- package/src/ui/slider.tsx +60 -0
- package/src/ui/sonner.tsx +40 -0
- package/src/ui/switch.tsx +32 -0
- package/src/ui/table.tsx +115 -0
- package/src/ui/tabs.tsx +88 -0
- package/src/ui/textarea.tsx +17 -0
- package/src/ui/toggle-group.tsx +83 -0
- package/src/ui/toggle.tsx +46 -0
- package/src/ui/tooltip.tsx +54 -0
- package/dist/Accordion.d.ts +0 -10
- package/dist/Accordion.js +0 -12
- package/dist/AlertBanner.d.ts +0 -9
- package/dist/AlertBanner.js +0 -21
- package/dist/AppBar.d.ts +0 -7
- package/dist/AppBar.js +0 -5
- package/dist/Avatar.d.ts +0 -6
- package/dist/Avatar.js +0 -20
- package/dist/Badge.d.ts +0 -6
- package/dist/Badge.js +0 -11
- package/dist/BottomSheet.d.ts +0 -8
- package/dist/BottomSheet.js +0 -24
- package/dist/Breadcrumb.d.ts +0 -8
- package/dist/Breadcrumb.js +0 -9
- package/dist/Button.d.ts +0 -9
- package/dist/Button.js +0 -18
- package/dist/Card.d.ts +0 -7
- package/dist/Card.js +0 -6
- package/dist/Checkbox.d.ts +0 -5
- package/dist/Checkbox.js +0 -5
- package/dist/Chip.d.ts +0 -7
- package/dist/Chip.js +0 -15
- package/dist/DataTable.d.ts +0 -15
- package/dist/DataTable.js +0 -7
- package/dist/DatePicker.d.ts +0 -5
- package/dist/DatePicker.js +0 -11
- package/dist/Divider.d.ts +0 -5
- package/dist/Divider.js +0 -11
- package/dist/Drawer.d.ts +0 -10
- package/dist/Drawer.js +0 -24
- package/dist/EmptyState.d.ts +0 -7
- package/dist/EmptyState.js +0 -6
- package/dist/Input.d.ts +0 -5
- package/dist/Input.js +0 -7
- package/dist/Link.d.ts +0 -4
- package/dist/Link.js +0 -6
- package/dist/Menu.d.ts +0 -14
- package/dist/Menu.js +0 -29
- package/dist/Modal.d.ts +0 -9
- package/dist/Modal.js +0 -24
- package/dist/NavigationBar.d.ts +0 -14
- package/dist/NavigationBar.js +0 -22
- package/dist/Pagination.d.ts +0 -7
- package/dist/Pagination.js +0 -24
- package/dist/Popover.d.ts +0 -7
- package/dist/Popover.js +0 -9
- package/dist/Progress.d.ts +0 -8
- package/dist/Progress.js +0 -15
- package/dist/Radio.d.ts +0 -15
- package/dist/Radio.js +0 -8
- package/dist/SegmentedControl.d.ts +0 -13
- package/dist/SegmentedControl.js +0 -18
- package/dist/Select.d.ts +0 -5
- package/dist/Select.js +0 -7
- package/dist/Sidebar.d.ts +0 -16
- package/dist/Sidebar.js +0 -19
- package/dist/Slider.d.ts +0 -5
- package/dist/Slider.js +0 -5
- package/dist/Snackbar.d.ts +0 -12
- package/dist/Snackbar.js +0 -20
- package/dist/Spinner.d.ts +0 -3
- package/dist/Spinner.js +0 -5
- package/dist/Switch.d.ts +0 -4
- package/dist/Switch.js +0 -5
- package/dist/Tabs.d.ts +0 -14
- package/dist/Tabs.js +0 -24
- package/dist/Tag.d.ts +0 -6
- package/dist/Tag.js +0 -11
- package/dist/Textarea.d.ts +0 -5
- package/dist/Textarea.js +0 -7
- package/dist/Tooltip.d.ts +0 -7
- package/dist/Tooltip.js +0 -5
- package/dist/TreeView.d.ts +0 -12
- package/dist/TreeView.js +0 -34
- package/src/Accordion.tsx +0 -58
- package/src/AlertBanner.tsx +0 -62
- package/src/AppBar.tsx +0 -29
- package/src/Avatar.tsx +0 -42
- package/src/Badge.tsx +0 -27
- package/src/BottomSheet.tsx +0 -60
- package/src/Breadcrumb.tsx +0 -48
- package/src/Button.tsx +0 -54
- package/src/Card.tsx +0 -39
- package/src/Checkbox.tsx +0 -31
- package/src/Chip.tsx +0 -44
- package/src/DataTable.tsx +0 -64
- package/src/DatePicker.tsx +0 -44
- package/src/Divider.tsx +0 -33
- package/src/Drawer.tsx +0 -71
- package/src/EmptyState.tsx +0 -37
- package/src/Input.tsx +0 -30
- package/src/Link.tsx +0 -22
- package/src/Menu.tsx +0 -73
- package/src/Modal.tsx +0 -62
- package/src/NavigationBar.tsx +0 -68
- package/src/Pagination.tsx +0 -69
- package/src/Popover.tsx +0 -34
- package/src/Progress.tsx +0 -53
- package/src/Radio.tsx +0 -49
- package/src/SegmentedControl.tsx +0 -63
- package/src/Select.tsx +0 -32
- package/src/Sidebar.tsx +0 -73
- package/src/Slider.tsx +0 -33
- package/src/Snackbar.tsx +0 -72
- package/src/Spinner.tsx +0 -19
- package/src/Switch.tsx +0 -40
- package/src/Tabs.tsx +0 -77
- package/src/Tag.tsx +0 -29
- package/src/Textarea.tsx +0 -30
- package/src/Tooltip.tsx +0 -25
- package/src/TreeView.tsx +0 -105
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { cn } from "../cn"
|
|
2
|
+
|
|
3
|
+
function Skeleton({ className, ...props }: React.ComponentProps<"div">) {
|
|
4
|
+
return (
|
|
5
|
+
<div
|
|
6
|
+
data-slot="skeleton"
|
|
7
|
+
className={cn("animate-pulse rounded-md bg-accent", className)}
|
|
8
|
+
{...props}
|
|
9
|
+
/>
|
|
10
|
+
)
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { Skeleton }
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { cn } from "../cn"
|
|
3
|
+
import { Slider as SliderPrimitive } from "radix-ui"
|
|
4
|
+
|
|
5
|
+
function Slider({
|
|
6
|
+
className,
|
|
7
|
+
defaultValue,
|
|
8
|
+
value,
|
|
9
|
+
min = 0,
|
|
10
|
+
max = 100,
|
|
11
|
+
...props
|
|
12
|
+
}: React.ComponentProps<typeof SliderPrimitive.Root>) {
|
|
13
|
+
const _values = React.useMemo(
|
|
14
|
+
() =>
|
|
15
|
+
Array.isArray(value)
|
|
16
|
+
? value
|
|
17
|
+
: Array.isArray(defaultValue)
|
|
18
|
+
? defaultValue
|
|
19
|
+
: [min, max],
|
|
20
|
+
[value, defaultValue, min, max]
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<SliderPrimitive.Root
|
|
25
|
+
data-slot="slider"
|
|
26
|
+
defaultValue={defaultValue}
|
|
27
|
+
value={value}
|
|
28
|
+
min={min}
|
|
29
|
+
max={max}
|
|
30
|
+
className={cn(
|
|
31
|
+
"relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",
|
|
32
|
+
className
|
|
33
|
+
)}
|
|
34
|
+
{...props}
|
|
35
|
+
>
|
|
36
|
+
<SliderPrimitive.Track
|
|
37
|
+
data-slot="slider-track"
|
|
38
|
+
className={cn(
|
|
39
|
+
"relative grow overflow-hidden rounded-full bg-muted data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"
|
|
40
|
+
)}
|
|
41
|
+
>
|
|
42
|
+
<SliderPrimitive.Range
|
|
43
|
+
data-slot="slider-range"
|
|
44
|
+
className={cn(
|
|
45
|
+
"absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"
|
|
46
|
+
)}
|
|
47
|
+
/>
|
|
48
|
+
</SliderPrimitive.Track>
|
|
49
|
+
{Array.from({ length: _values.length }, (_, index) => (
|
|
50
|
+
<SliderPrimitive.Thumb
|
|
51
|
+
data-slot="slider-thumb"
|
|
52
|
+
key={index}
|
|
53
|
+
className="block size-4 shrink-0 rounded-full border border-primary bg-white shadow-sm ring-ring/50 transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"
|
|
54
|
+
/>
|
|
55
|
+
))}
|
|
56
|
+
</SliderPrimitive.Root>
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export { Slider }
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
CircleCheckIcon,
|
|
5
|
+
InfoIcon,
|
|
6
|
+
Loader2Icon,
|
|
7
|
+
OctagonXIcon,
|
|
8
|
+
TriangleAlertIcon,
|
|
9
|
+
} from "lucide-react"
|
|
10
|
+
import { useTheme } from "next-themes"
|
|
11
|
+
import { Toaster as Sonner, type ToasterProps } from "sonner"
|
|
12
|
+
|
|
13
|
+
const Toaster = ({ ...props }: ToasterProps) => {
|
|
14
|
+
const { theme = "system" } = useTheme()
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<Sonner
|
|
18
|
+
theme={theme as ToasterProps["theme"]}
|
|
19
|
+
className="toaster group"
|
|
20
|
+
icons={{
|
|
21
|
+
success: <CircleCheckIcon className="size-4" />,
|
|
22
|
+
info: <InfoIcon className="size-4" />,
|
|
23
|
+
warning: <TriangleAlertIcon className="size-4" />,
|
|
24
|
+
error: <OctagonXIcon className="size-4" />,
|
|
25
|
+
loading: <Loader2Icon className="size-4 animate-spin" />,
|
|
26
|
+
}}
|
|
27
|
+
style={
|
|
28
|
+
{
|
|
29
|
+
"--normal-bg": "var(--popover)",
|
|
30
|
+
"--normal-text": "var(--popover-foreground)",
|
|
31
|
+
"--normal-border": "var(--border)",
|
|
32
|
+
"--border-radius": "var(--radius)",
|
|
33
|
+
} as React.CSSProperties
|
|
34
|
+
}
|
|
35
|
+
{...props}
|
|
36
|
+
/>
|
|
37
|
+
)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export { Toaster }
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { cn } from "../cn"
|
|
3
|
+
import { Switch as SwitchPrimitive } from "radix-ui"
|
|
4
|
+
|
|
5
|
+
function Switch({
|
|
6
|
+
className,
|
|
7
|
+
size = "default",
|
|
8
|
+
...props
|
|
9
|
+
}: React.ComponentProps<typeof SwitchPrimitive.Root> & {
|
|
10
|
+
size?: "sm" | "default"
|
|
11
|
+
}) {
|
|
12
|
+
return (
|
|
13
|
+
<SwitchPrimitive.Root
|
|
14
|
+
data-slot="switch"
|
|
15
|
+
data-size={size}
|
|
16
|
+
className={cn(
|
|
17
|
+
"peer group/switch inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80",
|
|
18
|
+
className
|
|
19
|
+
)}
|
|
20
|
+
{...props}
|
|
21
|
+
>
|
|
22
|
+
<SwitchPrimitive.Thumb
|
|
23
|
+
data-slot="switch-thumb"
|
|
24
|
+
className={cn(
|
|
25
|
+
"pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0 dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground"
|
|
26
|
+
)}
|
|
27
|
+
/>
|
|
28
|
+
</SwitchPrimitive.Root>
|
|
29
|
+
)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export { Switch }
|
package/src/ui/table.tsx
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { cn } from "../cn"
|
|
5
|
+
|
|
6
|
+
function Table({ className, ...props }: React.ComponentProps<"table">) {
|
|
7
|
+
return (
|
|
8
|
+
<div
|
|
9
|
+
data-slot="table-container"
|
|
10
|
+
className="relative w-full overflow-x-auto"
|
|
11
|
+
>
|
|
12
|
+
<table
|
|
13
|
+
data-slot="table"
|
|
14
|
+
className={cn("w-full caption-bottom text-sm", className)}
|
|
15
|
+
{...props}
|
|
16
|
+
/>
|
|
17
|
+
</div>
|
|
18
|
+
)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function TableHeader({ className, ...props }: React.ComponentProps<"thead">) {
|
|
22
|
+
return (
|
|
23
|
+
<thead
|
|
24
|
+
data-slot="table-header"
|
|
25
|
+
className={cn("[&_tr]:border-b", className)}
|
|
26
|
+
{...props}
|
|
27
|
+
/>
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function TableBody({ className, ...props }: React.ComponentProps<"tbody">) {
|
|
32
|
+
return (
|
|
33
|
+
<tbody
|
|
34
|
+
data-slot="table-body"
|
|
35
|
+
className={cn("[&_tr:last-child]:border-0", className)}
|
|
36
|
+
{...props}
|
|
37
|
+
/>
|
|
38
|
+
)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function TableFooter({ className, ...props }: React.ComponentProps<"tfoot">) {
|
|
42
|
+
return (
|
|
43
|
+
<tfoot
|
|
44
|
+
data-slot="table-footer"
|
|
45
|
+
className={cn(
|
|
46
|
+
"border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",
|
|
47
|
+
className
|
|
48
|
+
)}
|
|
49
|
+
{...props}
|
|
50
|
+
/>
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function TableRow({ className, ...props }: React.ComponentProps<"tr">) {
|
|
55
|
+
return (
|
|
56
|
+
<tr
|
|
57
|
+
data-slot="table-row"
|
|
58
|
+
className={cn(
|
|
59
|
+
"border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",
|
|
60
|
+
className
|
|
61
|
+
)}
|
|
62
|
+
{...props}
|
|
63
|
+
/>
|
|
64
|
+
)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function TableHead({ className, ...props }: React.ComponentProps<"th">) {
|
|
68
|
+
return (
|
|
69
|
+
<th
|
|
70
|
+
data-slot="table-head"
|
|
71
|
+
className={cn(
|
|
72
|
+
"h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
|
|
73
|
+
className
|
|
74
|
+
)}
|
|
75
|
+
{...props}
|
|
76
|
+
/>
|
|
77
|
+
)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function TableCell({ className, ...props }: React.ComponentProps<"td">) {
|
|
81
|
+
return (
|
|
82
|
+
<td
|
|
83
|
+
data-slot="table-cell"
|
|
84
|
+
className={cn(
|
|
85
|
+
"p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
|
|
86
|
+
className
|
|
87
|
+
)}
|
|
88
|
+
{...props}
|
|
89
|
+
/>
|
|
90
|
+
)
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function TableCaption({
|
|
94
|
+
className,
|
|
95
|
+
...props
|
|
96
|
+
}: React.ComponentProps<"caption">) {
|
|
97
|
+
return (
|
|
98
|
+
<caption
|
|
99
|
+
data-slot="table-caption"
|
|
100
|
+
className={cn("mt-4 text-sm text-muted-foreground", className)}
|
|
101
|
+
{...props}
|
|
102
|
+
/>
|
|
103
|
+
)
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export {
|
|
107
|
+
Table,
|
|
108
|
+
TableHeader,
|
|
109
|
+
TableBody,
|
|
110
|
+
TableFooter,
|
|
111
|
+
TableHead,
|
|
112
|
+
TableRow,
|
|
113
|
+
TableCell,
|
|
114
|
+
TableCaption,
|
|
115
|
+
}
|
package/src/ui/tabs.tsx
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
3
|
+
import { cn } from "../cn"
|
|
4
|
+
import { Tabs as TabsPrimitive } from "radix-ui"
|
|
5
|
+
|
|
6
|
+
function Tabs({
|
|
7
|
+
className,
|
|
8
|
+
orientation = "horizontal",
|
|
9
|
+
...props
|
|
10
|
+
}: React.ComponentProps<typeof TabsPrimitive.Root>) {
|
|
11
|
+
return (
|
|
12
|
+
<TabsPrimitive.Root
|
|
13
|
+
data-slot="tabs"
|
|
14
|
+
data-orientation={orientation}
|
|
15
|
+
orientation={orientation}
|
|
16
|
+
className={cn(
|
|
17
|
+
"group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",
|
|
18
|
+
className
|
|
19
|
+
)}
|
|
20
|
+
{...props}
|
|
21
|
+
/>
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const tabsListVariants = cva(
|
|
26
|
+
"group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none",
|
|
27
|
+
{
|
|
28
|
+
variants: {
|
|
29
|
+
variant: {
|
|
30
|
+
default: "bg-muted",
|
|
31
|
+
line: "gap-1 bg-transparent",
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
defaultVariants: {
|
|
35
|
+
variant: "default",
|
|
36
|
+
},
|
|
37
|
+
}
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
function TabsList({
|
|
41
|
+
className,
|
|
42
|
+
variant = "default",
|
|
43
|
+
...props
|
|
44
|
+
}: React.ComponentProps<typeof TabsPrimitive.List> &
|
|
45
|
+
VariantProps<typeof tabsListVariants>) {
|
|
46
|
+
return (
|
|
47
|
+
<TabsPrimitive.List
|
|
48
|
+
data-slot="tabs-list"
|
|
49
|
+
data-variant={variant}
|
|
50
|
+
className={cn(tabsListVariants({ variant }), className)}
|
|
51
|
+
{...props}
|
|
52
|
+
/>
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function TabsTrigger({
|
|
57
|
+
className,
|
|
58
|
+
...props
|
|
59
|
+
}: React.ComponentProps<typeof TabsPrimitive.Trigger>) {
|
|
60
|
+
return (
|
|
61
|
+
<TabsPrimitive.Trigger
|
|
62
|
+
data-slot="tabs-trigger"
|
|
63
|
+
className={cn(
|
|
64
|
+
"relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
65
|
+
"group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent",
|
|
66
|
+
"data-[state=active]:bg-background data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark:data-[state=active]:text-foreground",
|
|
67
|
+
"after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",
|
|
68
|
+
className
|
|
69
|
+
)}
|
|
70
|
+
{...props}
|
|
71
|
+
/>
|
|
72
|
+
)
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function TabsContent({
|
|
76
|
+
className,
|
|
77
|
+
...props
|
|
78
|
+
}: React.ComponentProps<typeof TabsPrimitive.Content>) {
|
|
79
|
+
return (
|
|
80
|
+
<TabsPrimitive.Content
|
|
81
|
+
data-slot="tabs-content"
|
|
82
|
+
className={cn("flex-1 outline-none", className)}
|
|
83
|
+
{...props}
|
|
84
|
+
/>
|
|
85
|
+
)
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export { Tabs, TabsList, TabsTrigger, TabsContent, tabsListVariants }
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { cn } from "../cn"
|
|
3
|
+
|
|
4
|
+
function Textarea({ className, ...props }: React.ComponentProps<"textarea">) {
|
|
5
|
+
return (
|
|
6
|
+
<textarea
|
|
7
|
+
data-slot="textarea"
|
|
8
|
+
className={cn(
|
|
9
|
+
"flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40",
|
|
10
|
+
className
|
|
11
|
+
)}
|
|
12
|
+
{...props}
|
|
13
|
+
/>
|
|
14
|
+
)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { Textarea }
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { type VariantProps } from "class-variance-authority"
|
|
5
|
+
import { cn } from "../cn"
|
|
6
|
+
import { ToggleGroup as ToggleGroupPrimitive } from "radix-ui"
|
|
7
|
+
|
|
8
|
+
import { toggleVariants } from "./toggle"
|
|
9
|
+
|
|
10
|
+
const ToggleGroupContext = React.createContext<
|
|
11
|
+
VariantProps<typeof toggleVariants> & {
|
|
12
|
+
spacing?: number
|
|
13
|
+
}
|
|
14
|
+
>({
|
|
15
|
+
size: "default",
|
|
16
|
+
variant: "default",
|
|
17
|
+
spacing: 0,
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
function ToggleGroup({
|
|
21
|
+
className,
|
|
22
|
+
variant,
|
|
23
|
+
size,
|
|
24
|
+
spacing = 0,
|
|
25
|
+
children,
|
|
26
|
+
...props
|
|
27
|
+
}: React.ComponentProps<typeof ToggleGroupPrimitive.Root> &
|
|
28
|
+
VariantProps<typeof toggleVariants> & {
|
|
29
|
+
spacing?: number
|
|
30
|
+
}) {
|
|
31
|
+
return (
|
|
32
|
+
<ToggleGroupPrimitive.Root
|
|
33
|
+
data-slot="toggle-group"
|
|
34
|
+
data-variant={variant}
|
|
35
|
+
data-size={size}
|
|
36
|
+
data-spacing={spacing}
|
|
37
|
+
style={{ "--gap": spacing } as React.CSSProperties}
|
|
38
|
+
className={cn(
|
|
39
|
+
"group/toggle-group flex w-fit items-center gap-[--spacing(var(--gap))] rounded-md data-[spacing=default]:data-[variant=outline]:shadow-xs",
|
|
40
|
+
className
|
|
41
|
+
)}
|
|
42
|
+
{...props}
|
|
43
|
+
>
|
|
44
|
+
<ToggleGroupContext.Provider value={{ variant, size, spacing }}>
|
|
45
|
+
{children}
|
|
46
|
+
</ToggleGroupContext.Provider>
|
|
47
|
+
</ToggleGroupPrimitive.Root>
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function ToggleGroupItem({
|
|
52
|
+
className,
|
|
53
|
+
children,
|
|
54
|
+
variant,
|
|
55
|
+
size,
|
|
56
|
+
...props
|
|
57
|
+
}: React.ComponentProps<typeof ToggleGroupPrimitive.Item> &
|
|
58
|
+
VariantProps<typeof toggleVariants>) {
|
|
59
|
+
const context = React.useContext(ToggleGroupContext)
|
|
60
|
+
|
|
61
|
+
return (
|
|
62
|
+
<ToggleGroupPrimitive.Item
|
|
63
|
+
data-slot="toggle-group-item"
|
|
64
|
+
data-variant={context.variant || variant}
|
|
65
|
+
data-size={context.size || size}
|
|
66
|
+
data-spacing={context.spacing}
|
|
67
|
+
className={cn(
|
|
68
|
+
toggleVariants({
|
|
69
|
+
variant: context.variant || variant,
|
|
70
|
+
size: context.size || size,
|
|
71
|
+
}),
|
|
72
|
+
"w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10",
|
|
73
|
+
"data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:first:rounded-l-md data-[spacing=0]:last:rounded-r-md data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:data-[variant=outline]:first:border-l",
|
|
74
|
+
className
|
|
75
|
+
)}
|
|
76
|
+
{...props}
|
|
77
|
+
>
|
|
78
|
+
{children}
|
|
79
|
+
</ToggleGroupPrimitive.Item>
|
|
80
|
+
)
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export { ToggleGroup, ToggleGroupItem }
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
5
|
+
import { cn } from "../cn"
|
|
6
|
+
import { Toggle as TogglePrimitive } from "radix-ui"
|
|
7
|
+
|
|
8
|
+
const toggleVariants = cva(
|
|
9
|
+
"inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-[color,box-shadow] outline-none hover:bg-muted hover:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
10
|
+
{
|
|
11
|
+
variants: {
|
|
12
|
+
variant: {
|
|
13
|
+
default: "bg-transparent",
|
|
14
|
+
outline:
|
|
15
|
+
"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground",
|
|
16
|
+
},
|
|
17
|
+
size: {
|
|
18
|
+
default: "h-9 min-w-9 px-2",
|
|
19
|
+
sm: "h-8 min-w-8 px-1.5",
|
|
20
|
+
lg: "h-10 min-w-10 px-2.5",
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
defaultVariants: {
|
|
24
|
+
variant: "default",
|
|
25
|
+
size: "default",
|
|
26
|
+
},
|
|
27
|
+
}
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
function Toggle({
|
|
31
|
+
className,
|
|
32
|
+
variant,
|
|
33
|
+
size,
|
|
34
|
+
...props
|
|
35
|
+
}: React.ComponentProps<typeof TogglePrimitive.Root> &
|
|
36
|
+
VariantProps<typeof toggleVariants>) {
|
|
37
|
+
return (
|
|
38
|
+
<TogglePrimitive.Root
|
|
39
|
+
data-slot="toggle"
|
|
40
|
+
className={cn(toggleVariants({ variant, size, className }))}
|
|
41
|
+
{...props}
|
|
42
|
+
/>
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export { Toggle, toggleVariants }
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { cn } from "../cn"
|
|
3
|
+
import { Tooltip as TooltipPrimitive } from "radix-ui"
|
|
4
|
+
|
|
5
|
+
function TooltipProvider({
|
|
6
|
+
delayDuration = 0,
|
|
7
|
+
...props
|
|
8
|
+
}: React.ComponentProps<typeof TooltipPrimitive.Provider>) {
|
|
9
|
+
return (
|
|
10
|
+
<TooltipPrimitive.Provider
|
|
11
|
+
data-slot="tooltip-provider"
|
|
12
|
+
delayDuration={delayDuration}
|
|
13
|
+
{...props}
|
|
14
|
+
/>
|
|
15
|
+
)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function Tooltip({
|
|
19
|
+
...props
|
|
20
|
+
}: React.ComponentProps<typeof TooltipPrimitive.Root>) {
|
|
21
|
+
return <TooltipPrimitive.Root data-slot="tooltip" {...props} />
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function TooltipTrigger({
|
|
25
|
+
...props
|
|
26
|
+
}: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {
|
|
27
|
+
return <TooltipPrimitive.Trigger data-slot="tooltip-trigger" {...props} />
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function TooltipContent({
|
|
31
|
+
className,
|
|
32
|
+
sideOffset = 0,
|
|
33
|
+
children,
|
|
34
|
+
...props
|
|
35
|
+
}: React.ComponentProps<typeof TooltipPrimitive.Content>) {
|
|
36
|
+
return (
|
|
37
|
+
<TooltipPrimitive.Portal>
|
|
38
|
+
<TooltipPrimitive.Content
|
|
39
|
+
data-slot="tooltip-content"
|
|
40
|
+
sideOffset={sideOffset}
|
|
41
|
+
className={cn(
|
|
42
|
+
"z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
43
|
+
className
|
|
44
|
+
)}
|
|
45
|
+
{...props}
|
|
46
|
+
>
|
|
47
|
+
{children}
|
|
48
|
+
<TooltipPrimitive.Arrow className="z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground" />
|
|
49
|
+
</TooltipPrimitive.Content>
|
|
50
|
+
</TooltipPrimitive.Portal>
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }
|
package/dist/Accordion.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export interface AccordionItem {
|
|
2
|
-
title: string;
|
|
3
|
-
content: React.ReactNode;
|
|
4
|
-
}
|
|
5
|
-
export interface AccordionProps {
|
|
6
|
-
items: AccordionItem[];
|
|
7
|
-
defaultOpen?: number | null;
|
|
8
|
-
className?: string;
|
|
9
|
-
}
|
|
10
|
-
export declare function Accordion({ items, defaultOpen, className }: AccordionProps): import("react").JSX.Element;
|
package/dist/Accordion.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from 'react';
|
|
3
|
-
import { ChevronDown } from 'lucide-react';
|
|
4
|
-
import { cn } from './cn';
|
|
5
|
-
export function Accordion({ items, defaultOpen = null, className }) {
|
|
6
|
-
const [open, setOpen] = useState(defaultOpen);
|
|
7
|
-
return (_jsx("div", { className: cn('divide-y divide-slate-200 overflow-hidden rounded-xl border border-slate-200 bg-white', className), children: items.map((item, i) => {
|
|
8
|
-
const isOpen = open === i;
|
|
9
|
-
const uid = `accordion-${i}`;
|
|
10
|
-
return (_jsxs("div", { children: [_jsxs("button", { type: "button", "aria-expanded": isOpen, "aria-controls": `${uid}-panel`, onClick: () => setOpen(isOpen ? null : i), className: "flex w-full items-center justify-between gap-4 px-5 py-4 text-left text-sm font-semibold text-slate-900 transition-colors hover:bg-slate-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-lime-500/40", children: [item.title, _jsx(ChevronDown, { "aria-hidden": "true", className: cn('h-4 w-4 shrink-0 text-slate-400 transition-transform', isOpen && 'rotate-180') })] }), isOpen && (_jsx("div", { id: `${uid}-panel`, role: "region", className: "border-t border-slate-100 px-5 py-4 text-sm leading-relaxed text-slate-600", children: item.content }))] }, uid));
|
|
11
|
-
}) }));
|
|
12
|
-
}
|
package/dist/AlertBanner.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
type AlertTone = 'info' | 'primary' | 'accent' | 'danger' | 'neutral';
|
|
2
|
-
export interface AlertBannerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
-
tone?: AlertTone;
|
|
4
|
-
title?: string;
|
|
5
|
-
dismissible?: boolean;
|
|
6
|
-
onDismiss?: () => void;
|
|
7
|
-
}
|
|
8
|
-
export declare function AlertBanner({ tone, title, dismissible, onDismiss, className, children, ...props }: AlertBannerProps): import("react").JSX.Element | null;
|
|
9
|
-
export {};
|
package/dist/AlertBanner.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Info, AlertTriangle, CheckCircle2, XCircle, X } from 'lucide-react';
|
|
3
|
-
import { useState } from 'react';
|
|
4
|
-
import { cn } from './cn';
|
|
5
|
-
const toneRecord = {
|
|
6
|
-
info: { wrap: 'border-sky-300 bg-sky-50 text-sky-900', icon: _jsx(Info, { className: "h-4 w-4" }), label: 'Info' },
|
|
7
|
-
primary: { wrap: 'border-lime-300 bg-lime-50 text-lime-900', icon: _jsx(CheckCircle2, { className: "h-4 w-4" }), label: 'Success' },
|
|
8
|
-
accent: { wrap: 'border-purple-300 bg-purple-50 text-purple-900', icon: _jsx(AlertTriangle, { className: "h-4 w-4" }), label: 'Warning' },
|
|
9
|
-
danger: { wrap: 'border-red-300 bg-red-50 text-red-900', icon: _jsx(XCircle, { className: "h-4 w-4" }), label: 'Error' },
|
|
10
|
-
neutral: { wrap: 'border-slate-300 bg-slate-50 text-slate-800', icon: _jsx(Info, { className: "h-4 w-4" }), label: 'Notice' },
|
|
11
|
-
};
|
|
12
|
-
export function AlertBanner({ tone = 'primary', title, dismissible = false, onDismiss, className, children, ...props }) {
|
|
13
|
-
const [hidden, setHidden] = useState(false);
|
|
14
|
-
if (hidden)
|
|
15
|
-
return null;
|
|
16
|
-
const t = toneRecord[tone];
|
|
17
|
-
return (_jsxs("div", { role: "alert", className: cn('flex items-start gap-3 rounded-lg border px-4 py-3 text-sm', t.wrap, className), ...props, children: [_jsx("span", { className: "mt-0.5 shrink-0", "aria-label": t.label, children: t.icon }), _jsxs("div", { className: "min-w-0 flex-1", children: [title && _jsx("p", { className: "font-bold", children: title }), _jsx("div", { className: cn(title && 'mt-0.5 text-sm opacity-90'), children: children })] }), dismissible && (_jsx("button", { type: "button", "aria-label": "Dismiss", onClick: () => {
|
|
18
|
-
setHidden(true);
|
|
19
|
-
onDismiss?.();
|
|
20
|
-
}, className: "-mr-1 -mt-1 shrink-0 rounded-full p-1 hover:bg-black/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-current", children: _jsx(X, { "aria-hidden": "true", className: "h-4 w-4" }) }))] }));
|
|
21
|
-
}
|
package/dist/AppBar.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export interface AppBarProps extends React.HTMLAttributes<HTMLElement> {
|
|
2
|
-
title: string;
|
|
3
|
-
subtitle?: string;
|
|
4
|
-
leading?: React.ReactNode;
|
|
5
|
-
actions?: React.ReactNode;
|
|
6
|
-
}
|
|
7
|
-
export declare function AppBar({ title, subtitle, leading, actions, className, ...props }: AppBarProps): import("react").JSX.Element;
|
package/dist/AppBar.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from './cn';
|
|
3
|
-
export function AppBar({ title, subtitle, leading, actions, className, ...props }) {
|
|
4
|
-
return (_jsxs("header", { className: cn('flex items-center justify-between gap-4 border-b border-slate-200 bg-white px-6 py-4', className), ...props, children: [_jsxs("div", { className: "flex min-w-0 items-center gap-3", children: [leading, _jsxs("div", { className: "min-w-0", children: [_jsx("h1", { className: "truncate text-lg font-bold text-slate-900", children: title }), subtitle && _jsx("p", { className: "truncate text-sm text-slate-500", children: subtitle })] })] }), actions && _jsx("div", { className: "flex shrink-0 items-center gap-2", children: actions })] }));
|
|
5
|
-
}
|
package/dist/Avatar.d.ts
DELETED
package/dist/Avatar.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from './cn';
|
|
3
|
-
const sizeClasses = {
|
|
4
|
-
sm: 'h-8 w-8 text-xs',
|
|
5
|
-
md: 'h-10 w-10 text-sm',
|
|
6
|
-
lg: 'h-14 w-14 text-lg',
|
|
7
|
-
};
|
|
8
|
-
function initials(name) {
|
|
9
|
-
if (!name)
|
|
10
|
-
return '?';
|
|
11
|
-
return name
|
|
12
|
-
.split(/\s+/)
|
|
13
|
-
.filter(Boolean)
|
|
14
|
-
.slice(0, 2)
|
|
15
|
-
.map(w => w[0]?.toUpperCase() ?? '')
|
|
16
|
-
.join('') || '?';
|
|
17
|
-
}
|
|
18
|
-
export function Avatar({ src, name, size = 'md', className, ...props }) {
|
|
19
|
-
return (_jsx("div", { className: cn('inline-flex shrink-0 select-none items-center justify-center overflow-hidden rounded-full bg-lime-100 font-semibold text-lime-800', sizeClasses[size], className), ...props, children: src ? (_jsx("img", { src: src, alt: name ?? '', className: "h-full w-full object-cover" })) : (_jsx("span", { "aria-hidden": "true", children: initials(name) })) }));
|
|
20
|
-
}
|
package/dist/Badge.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
type BadgeVariant = 'danger' | 'primary' | 'accent' | 'neutral';
|
|
2
|
-
export interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
3
|
-
variant?: BadgeVariant;
|
|
4
|
-
}
|
|
5
|
-
export declare function Badge({ variant, className, ...props }: BadgeProps): import("react").JSX.Element;
|
|
6
|
-
export {};
|