@softure-ai/theme-notion 0.0.0-stage → 0.1.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/CHANGELOG.md +16 -0
- package/LICENSE +21 -0
- package/README.md +114 -2
- package/dist/index.d.ts +47 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +49 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/utils.d.ts +6 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +8 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/messages/en.d.ts +29 -0
- package/dist/messages/en.d.ts.map +1 -0
- package/dist/messages/en.js +13 -0
- package/dist/messages/en.js.map +1 -0
- package/dist/messages/index.d.ts +30 -0
- package/dist/messages/index.d.ts.map +1 -0
- package/dist/messages/index.js +4 -0
- package/dist/messages/index.js.map +1 -0
- package/dist/notion/PageFrame.d.ts +11 -0
- package/dist/notion/PageFrame.d.ts.map +1 -0
- package/dist/notion/PageFrame.js +10 -0
- package/dist/notion/PageFrame.js.map +1 -0
- package/dist/notion/PageHeader.d.ts +16 -0
- package/dist/notion/PageHeader.d.ts.map +1 -0
- package/dist/notion/PageHeader.js +9 -0
- package/dist/notion/PageHeader.js.map +1 -0
- package/dist/notion/PropertyList.d.ts +12 -0
- package/dist/notion/PropertyList.d.ts.map +1 -0
- package/dist/notion/PropertyList.js +8 -0
- package/dist/notion/PropertyList.js.map +1 -0
- package/dist/notion/Status.d.ts +11 -0
- package/dist/notion/Status.d.ts.map +1 -0
- package/dist/notion/Status.js +21 -0
- package/dist/notion/Status.js.map +1 -0
- package/dist/notion/icon-stroke.d.ts +2 -0
- package/dist/notion/icon-stroke.d.ts.map +1 -0
- package/dist/notion/icon-stroke.js +3 -0
- package/dist/notion/icon-stroke.js.map +1 -0
- package/dist/notion/palette.d.ts +3 -0
- package/dist/notion/palette.d.ts.map +1 -0
- package/dist/notion/palette.js +4 -0
- package/dist/notion/palette.js.map +1 -0
- package/dist/sft-bridge.css +47 -0
- package/dist/theme.css +388 -0
- package/dist/tokens.d.ts +801 -0
- package/dist/tokens.d.ts.map +1 -0
- package/dist/tokens.js +139 -0
- package/dist/tokens.js.map +1 -0
- package/dist/ui/accordion.d.ts +8 -0
- package/dist/ui/accordion.d.ts.map +1 -0
- package/dist/ui/accordion.js +20 -0
- package/dist/ui/accordion.js.map +1 -0
- package/dist/ui/alert-dialog.d.ts +19 -0
- package/dist/ui/alert-dialog.d.ts.map +1 -0
- package/dist/ui/alert-dialog.js +44 -0
- package/dist/ui/alert-dialog.js.map +1 -0
- package/dist/ui/alert.d.ts +10 -0
- package/dist/ui/alert.d.ts.map +1 -0
- package/dist/ui/alert.js +35 -0
- package/dist/ui/alert.js.map +1 -0
- package/dist/ui/avatar.d.ts +12 -0
- package/dist/ui/avatar.d.ts.map +1 -0
- package/dist/ui/avatar.js +25 -0
- package/dist/ui/avatar.js.map +1 -0
- package/dist/ui/badge.d.ts +11 -0
- package/dist/ui/badge.d.ts.map +1 -0
- package/dist/ui/badge.js +41 -0
- package/dist/ui/badge.js.map +1 -0
- package/dist/ui/breadcrumb.d.ts +14 -0
- package/dist/ui/breadcrumb.d.ts.map +1 -0
- package/dist/ui/breadcrumb.js +30 -0
- package/dist/ui/breadcrumb.js.map +1 -0
- package/dist/ui/button-group.d.ts +12 -0
- package/dist/ui/button-group.d.ts.map +1 -0
- package/dist/ui/button-group.js +28 -0
- package/dist/ui/button-group.js.map +1 -0
- package/dist/ui/button.d.ts +11 -0
- package/dist/ui/button.d.ts.map +1 -0
- package/dist/ui/button.js +37 -0
- package/dist/ui/button.js.map +1 -0
- package/dist/ui/card.d.ts +10 -0
- package/dist/ui/card.d.ts.map +1 -0
- package/dist/ui/card.js +26 -0
- package/dist/ui/card.js.map +1 -0
- package/dist/ui/checkbox.d.ts +5 -0
- package/dist/ui/checkbox.d.ts.map +1 -0
- package/dist/ui/checkbox.js +11 -0
- package/dist/ui/checkbox.js.map +1 -0
- package/dist/ui/collapsible.d.ts +6 -0
- package/dist/ui/collapsible.d.ts.map +1 -0
- package/dist/ui/collapsible.js +14 -0
- package/dist/ui/collapsible.js.map +1 -0
- package/dist/ui/command.d.ts +19 -0
- package/dist/ui/command.d.ts.map +1 -0
- package/dist/ui/command.js +37 -0
- package/dist/ui/command.js.map +1 -0
- package/dist/ui/dialog.d.ts +19 -0
- package/dist/ui/dialog.d.ts.map +1 -0
- package/dist/ui/dialog.js +40 -0
- package/dist/ui/dialog.js.map +1 -0
- package/dist/ui/dropdown-menu.d.ts +26 -0
- package/dist/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/ui/dropdown-menu.js +53 -0
- package/dist/ui/dropdown-menu.js.map +1 -0
- package/dist/ui/empty.d.ts +12 -0
- package/dist/ui/empty.d.ts.map +1 -0
- package/dist/ui/empty.js +34 -0
- package/dist/ui/empty.js.map +1 -0
- package/dist/ui/field.d.ts +25 -0
- package/dist/ui/field.d.ts.map +1 -0
- package/dist/ui/field.js +77 -0
- package/dist/ui/field.js.map +1 -0
- package/dist/ui/input-group.d.ts +17 -0
- package/dist/ui/input-group.d.ts.map +1 -0
- package/dist/ui/input-group.js +65 -0
- package/dist/ui/input-group.js.map +1 -0
- package/dist/ui/input.d.ts +4 -0
- package/dist/ui/input.d.ts.map +1 -0
- package/dist/ui/input.js +8 -0
- package/dist/ui/input.js.map +1 -0
- package/dist/ui/item.d.ts +24 -0
- package/dist/ui/item.d.ts.map +1 -0
- package/dist/ui/item.js +68 -0
- package/dist/ui/item.js.map +1 -0
- package/dist/ui/kbd.d.ts +4 -0
- package/dist/ui/kbd.d.ts.map +1 -0
- package/dist/ui/kbd.js +10 -0
- package/dist/ui/kbd.js.map +1 -0
- package/dist/ui/label.d.ts +5 -0
- package/dist/ui/label.d.ts.map +1 -0
- package/dist/ui/label.js +10 -0
- package/dist/ui/label.js.map +1 -0
- package/dist/ui/popover.d.ts +11 -0
- package/dist/ui/popover.d.ts.map +1 -0
- package/dist/ui/popover.js +28 -0
- package/dist/ui/popover.js.map +1 -0
- package/dist/ui/progress.d.ts +5 -0
- package/dist/ui/progress.d.ts.map +1 -0
- package/dist/ui/progress.js +10 -0
- package/dist/ui/progress.js.map +1 -0
- package/dist/ui/scroll-area.d.ts +6 -0
- package/dist/ui/scroll-area.d.ts.map +1 -0
- package/dist/ui/scroll-area.js +15 -0
- package/dist/ui/scroll-area.js.map +1 -0
- package/dist/ui/select.d.ts +16 -0
- package/dist/ui/select.d.ts.map +1 -0
- package/dist/ui/select.js +40 -0
- package/dist/ui/select.js.map +1 -0
- package/dist/ui/separator.d.ts +5 -0
- package/dist/ui/separator.d.ts.map +1 -0
- package/dist/ui/separator.js +10 -0
- package/dist/ui/separator.js.map +1 -0
- package/dist/ui/sheet.d.ts +16 -0
- package/dist/ui/sheet.d.ts.map +1 -0
- package/dist/ui/sheet.js +43 -0
- package/dist/ui/sheet.js.map +1 -0
- package/dist/ui/sidebar.d.ts +76 -0
- package/dist/ui/sidebar.d.ts.map +1 -0
- package/dist/ui/sidebar.js +216 -0
- package/dist/ui/sidebar.js.map +1 -0
- package/dist/ui/skeleton.d.ts +3 -0
- package/dist/ui/skeleton.d.ts.map +1 -0
- package/dist/ui/skeleton.js +7 -0
- package/dist/ui/skeleton.js.map +1 -0
- package/dist/ui/sonner.d.ts +4 -0
- package/dist/ui/sonner.d.ts.map +1 -0
- package/dist/ui/sonner.js +22 -0
- package/dist/ui/sonner.js.map +1 -0
- package/dist/ui/spinner.d.ts +3 -0
- package/dist/ui/spinner.d.ts.map +1 -0
- package/dist/ui/spinner.js +9 -0
- package/dist/ui/spinner.js.map +1 -0
- package/dist/ui/switch-thumb.d.ts +7 -0
- package/dist/ui/switch-thumb.d.ts.map +1 -0
- package/dist/ui/switch-thumb.js +7 -0
- package/dist/ui/switch-thumb.js.map +1 -0
- package/dist/ui/switch.d.ts +7 -0
- package/dist/ui/switch.d.ts.map +1 -0
- package/dist/ui/switch.js +11 -0
- package/dist/ui/switch.js.map +1 -0
- package/dist/ui/table.d.ts +11 -0
- package/dist/ui/table.d.ts.map +1 -0
- package/dist/ui/table.js +30 -0
- package/dist/ui/table.js.map +1 -0
- package/dist/ui/tabs.d.ts +12 -0
- package/dist/ui/tabs.d.ts.map +1 -0
- package/dist/ui/tabs.js +31 -0
- package/dist/ui/tabs.js.map +1 -0
- package/dist/ui/textarea.d.ts +4 -0
- package/dist/ui/textarea.d.ts.map +1 -0
- package/dist/ui/textarea.js +8 -0
- package/dist/ui/textarea.js.map +1 -0
- package/dist/ui/tooltip.d.ts +8 -0
- package/dist/ui/tooltip.d.ts.map +1 -0
- package/dist/ui/tooltip.js +19 -0
- package/dist/ui/tooltip.js.map +1 -0
- package/package.json +69 -4
- package/src/index.ts +50 -0
- package/src/lib/utils.ts +9 -0
- package/src/messages/en.ts +12 -0
- package/src/messages/index.ts +6 -0
- package/src/notion/PageFrame.tsx +18 -0
- package/src/notion/PageHeader.tsx +62 -0
- package/src/notion/PropertyList.tsx +38 -0
- package/src/notion/Status.tsx +44 -0
- package/src/notion/icon-stroke.ts +2 -0
- package/src/notion/palette.ts +5 -0
- package/src/sft-bridge.css +47 -0
- package/src/tokens.ts +140 -0
- package/src/ui/accordion.tsx +65 -0
- package/src/ui/alert-dialog.tsx +196 -0
- package/src/ui/alert.tsx +74 -0
- package/src/ui/avatar.tsx +108 -0
- package/src/ui/badge.tsx +63 -0
- package/src/ui/breadcrumb.tsx +113 -0
- package/src/ui/button-group.tsx +83 -0
- package/src/ui/button.tsx +62 -0
- package/src/ui/card.tsx +91 -0
- package/src/ui/checkbox.tsx +31 -0
- package/src/ui/collapsible.tsx +33 -0
- package/src/ui/command.tsx +185 -0
- package/src/ui/dialog.tsx +162 -0
- package/src/ui/dropdown-menu.tsx +256 -0
- package/src/ui/empty.tsx +103 -0
- package/src/ui/field.tsx +248 -0
- package/src/ui/input-group.tsx +170 -0
- package/src/ui/input.tsx +20 -0
- package/src/ui/item.tsx +193 -0
- package/src/ui/kbd.tsx +28 -0
- package/src/ui/label.tsx +23 -0
- package/src/ui/popover.tsx +88 -0
- package/src/ui/progress.tsx +30 -0
- package/src/ui/scroll-area.tsx +57 -0
- package/src/ui/select.tsx +189 -0
- package/src/ui/separator.tsx +27 -0
- package/src/ui/sheet.tsx +146 -0
- package/src/ui/sidebar.tsx +744 -0
- package/src/ui/skeleton.tsx +13 -0
- package/src/ui/sonner.tsx +39 -0
- package/src/ui/spinner.tsx +16 -0
- package/src/ui/switch-thumb.ts +6 -0
- package/src/ui/switch.tsx +36 -0
- package/src/ui/table.tsx +115 -0
- package/src/ui/tabs.tsx +90 -0
- package/src/ui/textarea.tsx +17 -0
- package/src/ui/tooltip.tsx +55 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { cn } from "../lib/utils.js"
|
|
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,39 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
CircleCheckIcon,
|
|
5
|
+
InfoIcon,
|
|
6
|
+
Loader2Icon,
|
|
7
|
+
OctagonXIcon,
|
|
8
|
+
TriangleAlertIcon,
|
|
9
|
+
} from "lucide-react"
|
|
10
|
+
import { Toaster as Sonner, type ToasterProps } from "sonner"
|
|
11
|
+
|
|
12
|
+
// The toast stack. `theme` follows the system by default; pass the app's chosen scheme ("light" | "dark") when it
|
|
13
|
+
// has a theme switch (shadcn reads it from `next-themes`, which this package does not require).
|
|
14
|
+
const Toaster = ({ theme = "system", ...props }: ToasterProps) => {
|
|
15
|
+
return (
|
|
16
|
+
<Sonner
|
|
17
|
+
theme={theme}
|
|
18
|
+
className="toaster group"
|
|
19
|
+
icons={{
|
|
20
|
+
success: <CircleCheckIcon className="size-4" />,
|
|
21
|
+
info: <InfoIcon className="size-4" />,
|
|
22
|
+
warning: <TriangleAlertIcon className="size-4" />,
|
|
23
|
+
error: <OctagonXIcon className="size-4" />,
|
|
24
|
+
loading: <Loader2Icon className="size-4 animate-spin" />,
|
|
25
|
+
}}
|
|
26
|
+
style={
|
|
27
|
+
{
|
|
28
|
+
"--normal-bg": "var(--popover)",
|
|
29
|
+
"--normal-text": "var(--popover-foreground)",
|
|
30
|
+
"--normal-border": "var(--border)",
|
|
31
|
+
"--border-radius": "var(--radius-lg)",
|
|
32
|
+
} as React.CSSProperties
|
|
33
|
+
}
|
|
34
|
+
{...props}
|
|
35
|
+
/>
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export { Toaster }
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { en as messages } from "../messages/en.js"
|
|
2
|
+
import { cn } from "../lib/utils.js"
|
|
3
|
+
import { Loader2Icon } from "lucide-react"
|
|
4
|
+
|
|
5
|
+
function Spinner({ className, ...props }: React.ComponentProps<"svg">) {
|
|
6
|
+
return (
|
|
7
|
+
<Loader2Icon
|
|
8
|
+
role="status"
|
|
9
|
+
aria-label={messages.spinner.label}
|
|
10
|
+
className={cn("size-4 animate-spin", className)}
|
|
11
|
+
{...props}
|
|
12
|
+
/>
|
|
13
|
+
)
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export { Spinner }
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The design system's switch thumb (26 × 16 track, 12 px thumb lifted by a soft shadow), shared by the Radix `Switch`
|
|
3
|
+
* and the native one the Variants picker draws without JavaScript. The shadow has no theme token, so this is the one
|
|
4
|
+
* place outside the theme where it is written.
|
|
5
|
+
*/
|
|
6
|
+
export const SWITCH_THUMB_SHADOW_CLASS = "shadow-[0_1px_2px_rgba(15,15,15,0.2)]";
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { cn } from "../lib/utils.js"
|
|
5
|
+
import { SWITCH_THUMB_SHADOW_CLASS } from "./switch-thumb.js"
|
|
6
|
+
import { Switch as SwitchPrimitive } from "radix-ui"
|
|
7
|
+
|
|
8
|
+
function Switch({
|
|
9
|
+
className,
|
|
10
|
+
size = "default",
|
|
11
|
+
...props
|
|
12
|
+
}: React.ComponentProps<typeof SwitchPrimitive.Root> & {
|
|
13
|
+
size?: "sm" | "default"
|
|
14
|
+
}) {
|
|
15
|
+
return (
|
|
16
|
+
<SwitchPrimitive.Root
|
|
17
|
+
data-slot="switch"
|
|
18
|
+
data-size={size}
|
|
19
|
+
className={cn(
|
|
20
|
+
"peer group/switch inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-4 data-[size=default]:w-[26px] data-[size=default]:p-0.5 data-[size=sm]:h-3.5 data-[size=sm]:w-[22px] data-[size=sm]:p-0.5 data-[state=checked]:bg-primary data-[state=unchecked]:bg-control-off",
|
|
21
|
+
className
|
|
22
|
+
)}
|
|
23
|
+
{...props}
|
|
24
|
+
>
|
|
25
|
+
<SwitchPrimitive.Thumb
|
|
26
|
+
data-slot="switch-thumb"
|
|
27
|
+
className={cn(
|
|
28
|
+
"pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-3 group-data-[size=sm]/switch:size-2.5 data-[state=checked]:translate-x-[10px] data-[state=unchecked]:translate-x-0",
|
|
29
|
+
SWITCH_THUMB_SHADOW_CLASS
|
|
30
|
+
)}
|
|
31
|
+
/>
|
|
32
|
+
</SwitchPrimitive.Root>
|
|
33
|
+
)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
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 "../lib/utils.js"
|
|
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(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-[34px] px-2 text-left align-middle font-normal whitespace-nowrap text-muted-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,90 @@
|
|
|
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.js"
|
|
6
|
+
import { Tabs as TabsPrimitive } from "radix-ui"
|
|
7
|
+
|
|
8
|
+
function Tabs({
|
|
9
|
+
className,
|
|
10
|
+
orientation = "horizontal",
|
|
11
|
+
...props
|
|
12
|
+
}: React.ComponentProps<typeof TabsPrimitive.Root>) {
|
|
13
|
+
return (
|
|
14
|
+
<TabsPrimitive.Root
|
|
15
|
+
data-slot="tabs"
|
|
16
|
+
data-orientation={orientation}
|
|
17
|
+
orientation={orientation}
|
|
18
|
+
className={cn(
|
|
19
|
+
"group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",
|
|
20
|
+
className
|
|
21
|
+
)}
|
|
22
|
+
{...props}
|
|
23
|
+
/>
|
|
24
|
+
)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const tabsListVariants = cva(
|
|
28
|
+
"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",
|
|
29
|
+
{
|
|
30
|
+
variants: {
|
|
31
|
+
variant: {
|
|
32
|
+
default: "bg-muted",
|
|
33
|
+
line: "gap-1 bg-transparent",
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
defaultVariants: {
|
|
37
|
+
variant: "line",
|
|
38
|
+
},
|
|
39
|
+
}
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
function TabsList({
|
|
43
|
+
className,
|
|
44
|
+
variant = "line",
|
|
45
|
+
...props
|
|
46
|
+
}: React.ComponentProps<typeof TabsPrimitive.List> &
|
|
47
|
+
VariantProps<typeof tabsListVariants>) {
|
|
48
|
+
return (
|
|
49
|
+
<TabsPrimitive.List
|
|
50
|
+
data-slot="tabs-list"
|
|
51
|
+
data-variant={variant}
|
|
52
|
+
className={cn(tabsListVariants({ variant }), className)}
|
|
53
|
+
{...props}
|
|
54
|
+
/>
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function TabsTrigger({
|
|
59
|
+
className,
|
|
60
|
+
...props
|
|
61
|
+
}: React.ComponentProps<typeof TabsPrimitive.Trigger>) {
|
|
62
|
+
return (
|
|
63
|
+
<TabsPrimitive.Trigger
|
|
64
|
+
data-slot="tabs-trigger"
|
|
65
|
+
className={cn(
|
|
66
|
+
"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-2 focus-visible:ring-ring 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",
|
|
67
|
+
"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",
|
|
68
|
+
"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",
|
|
69
|
+
"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",
|
|
70
|
+
className
|
|
71
|
+
)}
|
|
72
|
+
{...props}
|
|
73
|
+
/>
|
|
74
|
+
)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function TabsContent({
|
|
78
|
+
className,
|
|
79
|
+
...props
|
|
80
|
+
}: React.ComponentProps<typeof TabsPrimitive.Content>) {
|
|
81
|
+
return (
|
|
82
|
+
<TabsPrimitive.Content
|
|
83
|
+
data-slot="tabs-content"
|
|
84
|
+
className={cn("flex-1 outline-none", className)}
|
|
85
|
+
{...props}
|
|
86
|
+
/>
|
|
87
|
+
)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export { Tabs, TabsList, TabsTrigger, TabsContent, tabsListVariants }
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { cn } from "../lib/utils.js"
|
|
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-field px-2.5 py-1.5 text-base transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:aria-invalid:ring-destructive/40",
|
|
10
|
+
className
|
|
11
|
+
)}
|
|
12
|
+
{...props}
|
|
13
|
+
/>
|
|
14
|
+
)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { Textarea }
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { cn } from "../lib/utils.js"
|
|
5
|
+
import { Tooltip as TooltipPrimitive } from "radix-ui"
|
|
6
|
+
|
|
7
|
+
function TooltipProvider({
|
|
8
|
+
delayDuration = 0,
|
|
9
|
+
...props
|
|
10
|
+
}: React.ComponentProps<typeof TooltipPrimitive.Provider>) {
|
|
11
|
+
return (
|
|
12
|
+
<TooltipPrimitive.Provider
|
|
13
|
+
data-slot="tooltip-provider"
|
|
14
|
+
delayDuration={delayDuration}
|
|
15
|
+
{...props}
|
|
16
|
+
/>
|
|
17
|
+
)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function Tooltip({
|
|
21
|
+
...props
|
|
22
|
+
}: React.ComponentProps<typeof TooltipPrimitive.Root>) {
|
|
23
|
+
return <TooltipPrimitive.Root data-slot="tooltip" {...props} />
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function TooltipTrigger({
|
|
27
|
+
...props
|
|
28
|
+
}: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {
|
|
29
|
+
return <TooltipPrimitive.Trigger data-slot="tooltip-trigger" {...props} />
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function TooltipContent({
|
|
33
|
+
className,
|
|
34
|
+
sideOffset = 0,
|
|
35
|
+
children,
|
|
36
|
+
...props
|
|
37
|
+
}: React.ComponentProps<typeof TooltipPrimitive.Content>) {
|
|
38
|
+
return (
|
|
39
|
+
<TooltipPrimitive.Portal>
|
|
40
|
+
<TooltipPrimitive.Content
|
|
41
|
+
data-slot="tooltip-content"
|
|
42
|
+
sideOffset={sideOffset}
|
|
43
|
+
className={cn(
|
|
44
|
+
"z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-sm bg-tooltip px-2 py-1 text-xs font-medium text-balance text-tooltip-foreground 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",
|
|
45
|
+
className
|
|
46
|
+
)}
|
|
47
|
+
{...props}
|
|
48
|
+
>
|
|
49
|
+
{children}
|
|
50
|
+
</TooltipPrimitive.Content>
|
|
51
|
+
</TooltipPrimitive.Portal>
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }
|