@robomous/ui-core 0.1.0 → 0.2.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/README.md +19 -7
- package/dist/{primitives → components}/alert.js +1 -1
- package/dist/{primitives → components}/badge.js +1 -1
- package/dist/{primitives → components}/button.d.ts +1 -1
- package/dist/{primitives → components}/button.js +4 -1
- package/dist/{primitives → components}/card.d.ts +1 -1
- package/dist/{primitives → components}/card.js +2 -2
- package/dist/{primitives → components}/combobox.js +4 -4
- package/dist/{primitives → components}/dialog.js +1 -1
- package/dist/{primitives → components}/dropdown-menu.js +12 -7
- package/dist/{primitives → components}/field.js +2 -4
- package/dist/{primitives → components}/input-group.js +1 -1
- package/dist/{primitives → components}/input.js +1 -1
- package/dist/{primitives → components}/label.js +1 -1
- package/dist/components/progress.js +7 -0
- package/dist/{primitives → components}/select.d.ts +3 -1
- package/dist/{primitives → components}/select.js +7 -4
- package/dist/{primitives → components}/separator.js +1 -1
- package/dist/{primitives → components}/sheet.js +1 -1
- package/dist/{primitives → components}/skeleton.js +1 -1
- package/dist/{primitives → components}/sonner.js +17 -12
- package/dist/{primitives → components}/table.d.ts +1 -1
- package/dist/{primitives → components}/table.js +3 -3
- package/dist/{primitives → components}/tabs.js +1 -1
- package/dist/{primitives → components}/textarea.js +1 -1
- package/dist/{primitives → components}/tooltip.js +1 -1
- package/dist/gates/index.d.ts +28 -0
- package/dist/gates/index.js +142 -0
- package/dist/index.d.ts +31 -32
- package/dist/index.js +32 -33
- package/dist/{tokens.d.ts → theme/tokens.d.ts} +5 -5
- package/dist/{tokens.js → theme/tokens.js} +12 -12
- package/package.json +23 -12
- package/{shadcn → src/components}/alert.tsx +14 -21
- package/src/{primitives → components}/badge.tsx +15 -21
- package/src/{primitives → components}/button.tsx +13 -10
- package/{shadcn → src/components}/card.tsx +16 -31
- package/src/{primitives → components}/combobox.test.tsx +15 -2
- package/src/{primitives → components}/combobox.tsx +45 -74
- package/src/{primitives/primitives.test.tsx → components/components.test.tsx} +106 -69
- package/src/{primitives → components}/dialog.tsx +31 -54
- package/src/{primitives → components}/dropdown-menu.tsx +51 -65
- package/src/{primitives → components}/field.tsx +48 -62
- package/src/{primitives → components}/input-group.tsx +37 -49
- package/{shadcn → src/components}/input.tsx +5 -5
- package/{shadcn → src/components}/label.tsx +7 -10
- package/src/{primitives → components}/progress.tsx +7 -6
- package/{shadcn → src/components}/select.tsx +40 -40
- package/{shadcn → src/components}/separator.tsx +7 -7
- package/src/{primitives → components}/sheet.tsx +27 -44
- package/{shadcn → src/components}/skeleton.tsx +3 -3
- package/src/{primitives → components}/sonner.test.tsx +12 -4
- package/src/components/sonner.tsx +67 -0
- package/{shadcn → src/components}/table.tsx +17 -44
- package/{shadcn → src/components}/tabs.tsx +16 -26
- package/{shadcn → src/components}/textarea.tsx +5 -5
- package/{shadcn → src/components}/tooltip.tsx +12 -16
- package/src/gates/design.test.ts +188 -0
- package/src/gates/index.test.ts +11 -0
- package/src/gates/index.ts +165 -0
- package/src/gates/tokens.test.ts +215 -0
- package/src/harness.test.tsx +1 -1
- package/src/index.ts +63 -33
- package/src/theme/imports.test.ts +160 -0
- package/src/{statusTone.test.ts → theme/statusTone.test.ts} +5 -1
- package/src/{styles.css → theme/styles.css} +45 -31
- package/src/theme/tailwind.css +646 -0
- package/src/{tokens.test.ts → theme/tokens.test.ts} +30 -23
- package/src/{tokens.ts → theme/tokens.ts} +12 -12
- package/components.json +0 -13
- package/dist/lib/button.d.ts +0 -1
- package/dist/lib/button.js +0 -4
- package/dist/lib/cn.d.ts +0 -18
- package/dist/lib/cn.js +0 -21
- package/dist/lib/menu.d.ts +0 -1
- package/dist/lib/menu.js +0 -16
- package/dist/lib/progress.d.ts +0 -3
- package/dist/lib/progress.js +0 -6
- package/dist/lib/select.d.ts +0 -1
- package/dist/lib/select.js +0 -3
- package/dist/primitives/progress.js +0 -7
- package/gates/canonical.test.mjs +0 -71
- package/gates/extensions.test.mjs +0 -373
- package/gates/index.d.mts +0 -51
- package/gates/index.mjs +0 -514
- package/gates/tokens.test.mjs +0 -276
- package/shadcn/README.md +0 -13
- package/shadcn/badge.tsx +0 -49
- package/shadcn/button.tsx +0 -67
- package/shadcn/combobox.tsx +0 -299
- package/shadcn/dialog.tsx +0 -166
- package/shadcn/dropdown-menu.tsx +0 -267
- package/shadcn/field.tsx +0 -236
- package/shadcn/input-group.tsx +0 -154
- package/shadcn/progress.tsx +0 -29
- package/shadcn/sheet.tsx +0 -145
- package/shadcn/sonner.tsx +0 -49
- package/src/lib/button.ts +0 -4
- package/src/lib/cn.test.ts +0 -33
- package/src/lib/cn.ts +0 -23
- package/src/lib/menu.ts +0 -16
- package/src/lib/progress.ts +0 -6
- package/src/lib/select.ts +0 -4
- package/src/primitives/alert.tsx +0 -76
- package/src/primitives/card.tsx +0 -103
- package/src/primitives/input.tsx +0 -19
- package/src/primitives/label.tsx +0 -22
- package/src/primitives/select.tsx +0 -190
- package/src/primitives/separator.tsx +0 -28
- package/src/primitives/skeleton.tsx +0 -13
- package/src/primitives/sonner.tsx +0 -65
- package/src/primitives/table.tsx +0 -114
- package/src/primitives/tabs.tsx +0 -88
- package/src/primitives/textarea.tsx +0 -18
- package/src/primitives/tooltip.tsx +0 -57
- /package/dist/{primitives → components}/alert.d.ts +0 -0
- /package/dist/{primitives → components}/badge.d.ts +0 -0
- /package/dist/{primitives → components}/combobox.d.ts +0 -0
- /package/dist/{primitives → components}/dialog.d.ts +0 -0
- /package/dist/{primitives → components}/dropdown-menu.d.ts +0 -0
- /package/dist/{primitives → components}/field.d.ts +0 -0
- /package/dist/{primitives → components}/input-group.d.ts +0 -0
- /package/dist/{primitives → components}/input.d.ts +0 -0
- /package/dist/{primitives → components}/label.d.ts +0 -0
- /package/dist/{primitives → components}/progress.d.ts +0 -0
- /package/dist/{primitives → components}/separator.d.ts +0 -0
- /package/dist/{primitives → components}/sheet.d.ts +0 -0
- /package/dist/{primitives → components}/skeleton.d.ts +0 -0
- /package/dist/{primitives → components}/sonner.d.ts +0 -0
- /package/dist/{primitives → components}/tabs.d.ts +0 -0
- /package/dist/{primitives → components}/textarea.d.ts +0 -0
- /package/dist/{primitives → components}/tooltip.d.ts +0 -0
- /package/dist/{statusTone.d.ts → theme/statusTone.d.ts} +0 -0
- /package/dist/{statusTone.js → theme/statusTone.js} +0 -0
- /package/src/{statusTone.ts → theme/statusTone.ts} +0 -0
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import { Select as SelectPrimitive } from "radix-ui"
|
|
3
|
-
|
|
4
|
-
import { cn } from "../lib/cn.js"
|
|
5
|
-
import { ChevronDownIcon, CheckIcon, ChevronUpIcon } from "lucide-react"
|
|
6
|
-
|
|
7
|
-
function Select({
|
|
8
|
-
...props
|
|
9
|
-
}: React.ComponentProps<typeof SelectPrimitive.Root>) {
|
|
10
|
-
return <SelectPrimitive.Root data-slot="select" {...props} />
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
function SelectGroup({
|
|
14
|
-
className,
|
|
15
|
-
...props
|
|
16
|
-
}: React.ComponentProps<typeof SelectPrimitive.Group>) {
|
|
17
|
-
return (
|
|
18
|
-
<SelectPrimitive.Group
|
|
19
|
-
data-slot="select-group"
|
|
20
|
-
className={cn("scroll-my-1 p-1", className)}
|
|
21
|
-
{...props}
|
|
22
|
-
/>
|
|
23
|
-
)
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
function SelectValue({
|
|
27
|
-
...props
|
|
28
|
-
}: React.ComponentProps<typeof SelectPrimitive.Value>) {
|
|
29
|
-
return <SelectPrimitive.Value data-slot="select-value" {...props} />
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function SelectTrigger({
|
|
33
|
-
className,
|
|
34
|
-
size = "default",
|
|
35
|
-
children,
|
|
36
|
-
...props
|
|
37
|
-
}: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
|
|
38
|
-
size?: "sm" | "default"
|
|
39
|
-
}) {
|
|
40
|
-
return (
|
|
41
|
-
<SelectPrimitive.Trigger
|
|
42
|
-
data-slot="select-trigger"
|
|
43
|
-
data-size={size}
|
|
44
|
-
className={cn(
|
|
45
|
-
"flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
46
|
-
className
|
|
47
|
-
)}
|
|
48
|
-
{...props}
|
|
49
|
-
>
|
|
50
|
-
{children}
|
|
51
|
-
<SelectPrimitive.Icon asChild>
|
|
52
|
-
<ChevronDownIcon className="pointer-events-none size-4 text-muted-foreground" />
|
|
53
|
-
</SelectPrimitive.Icon>
|
|
54
|
-
</SelectPrimitive.Trigger>
|
|
55
|
-
)
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function SelectContent({
|
|
59
|
-
className,
|
|
60
|
-
children,
|
|
61
|
-
position = "item-aligned",
|
|
62
|
-
align = "center",
|
|
63
|
-
...props
|
|
64
|
-
}: React.ComponentProps<typeof SelectPrimitive.Content>) {
|
|
65
|
-
return (
|
|
66
|
-
<SelectPrimitive.Portal>
|
|
67
|
-
<SelectPrimitive.Content
|
|
68
|
-
data-slot="select-content"
|
|
69
|
-
data-align-trigger={position === "item-aligned"}
|
|
70
|
-
className={cn("dark relative z-50 max-h-(--radix-select-content-available-height) min-w-36 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none 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-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", position ==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", className )}
|
|
71
|
-
position={position}
|
|
72
|
-
align={align}
|
|
73
|
-
{...props}
|
|
74
|
-
>
|
|
75
|
-
<SelectScrollUpButton />
|
|
76
|
-
<SelectPrimitive.Viewport
|
|
77
|
-
data-position={position}
|
|
78
|
-
className={cn(
|
|
79
|
-
"data-[position=popper]:h-(--radix-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)",
|
|
80
|
-
position === "popper" && ""
|
|
81
|
-
)}
|
|
82
|
-
>
|
|
83
|
-
{children}
|
|
84
|
-
</SelectPrimitive.Viewport>
|
|
85
|
-
<SelectScrollDownButton />
|
|
86
|
-
</SelectPrimitive.Content>
|
|
87
|
-
</SelectPrimitive.Portal>
|
|
88
|
-
)
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
function SelectLabel({
|
|
92
|
-
className,
|
|
93
|
-
...props
|
|
94
|
-
}: React.ComponentProps<typeof SelectPrimitive.Label>) {
|
|
95
|
-
return (
|
|
96
|
-
<SelectPrimitive.Label
|
|
97
|
-
data-slot="select-label"
|
|
98
|
-
className={cn("px-1.5 py-1 text-xs text-muted-foreground", className)}
|
|
99
|
-
{...props}
|
|
100
|
-
/>
|
|
101
|
-
)
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
function SelectItem({
|
|
105
|
-
className,
|
|
106
|
-
children,
|
|
107
|
-
...props
|
|
108
|
-
}: React.ComponentProps<typeof SelectPrimitive.Item>) {
|
|
109
|
-
return (
|
|
110
|
-
<SelectPrimitive.Item
|
|
111
|
-
data-slot="select-item"
|
|
112
|
-
className={cn(
|
|
113
|
-
"relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
|
|
114
|
-
className
|
|
115
|
-
)}
|
|
116
|
-
{...props}
|
|
117
|
-
>
|
|
118
|
-
<span className="pointer-events-none absolute right-2 flex size-4 items-center justify-center">
|
|
119
|
-
<SelectPrimitive.ItemIndicator>
|
|
120
|
-
<CheckIcon className="pointer-events-none" />
|
|
121
|
-
</SelectPrimitive.ItemIndicator>
|
|
122
|
-
</span>
|
|
123
|
-
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
|
124
|
-
</SelectPrimitive.Item>
|
|
125
|
-
)
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
function SelectSeparator({
|
|
129
|
-
className,
|
|
130
|
-
...props
|
|
131
|
-
}: React.ComponentProps<typeof SelectPrimitive.Separator>) {
|
|
132
|
-
return (
|
|
133
|
-
<SelectPrimitive.Separator
|
|
134
|
-
data-slot="select-separator"
|
|
135
|
-
className={cn("pointer-events-none -mx-1 my-1 h-px bg-border", className)}
|
|
136
|
-
{...props}
|
|
137
|
-
/>
|
|
138
|
-
)
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
function SelectScrollUpButton({
|
|
142
|
-
className,
|
|
143
|
-
...props
|
|
144
|
-
}: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {
|
|
145
|
-
return (
|
|
146
|
-
<SelectPrimitive.ScrollUpButton
|
|
147
|
-
data-slot="select-scroll-up-button"
|
|
148
|
-
className={cn(
|
|
149
|
-
"z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",
|
|
150
|
-
className
|
|
151
|
-
)}
|
|
152
|
-
{...props}
|
|
153
|
-
>
|
|
154
|
-
<ChevronUpIcon
|
|
155
|
-
/>
|
|
156
|
-
</SelectPrimitive.ScrollUpButton>
|
|
157
|
-
)
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
function SelectScrollDownButton({
|
|
161
|
-
className,
|
|
162
|
-
...props
|
|
163
|
-
}: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {
|
|
164
|
-
return (
|
|
165
|
-
<SelectPrimitive.ScrollDownButton
|
|
166
|
-
data-slot="select-scroll-down-button"
|
|
167
|
-
className={cn(
|
|
168
|
-
"z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",
|
|
169
|
-
className
|
|
170
|
-
)}
|
|
171
|
-
{...props}
|
|
172
|
-
>
|
|
173
|
-
<ChevronDownIcon
|
|
174
|
-
/>
|
|
175
|
-
</SelectPrimitive.ScrollDownButton>
|
|
176
|
-
)
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
export {
|
|
180
|
-
Select,
|
|
181
|
-
SelectContent,
|
|
182
|
-
SelectGroup,
|
|
183
|
-
SelectItem,
|
|
184
|
-
SelectLabel,
|
|
185
|
-
SelectScrollDownButton,
|
|
186
|
-
SelectScrollUpButton,
|
|
187
|
-
SelectSeparator,
|
|
188
|
-
SelectTrigger,
|
|
189
|
-
SelectValue,
|
|
190
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import { Separator as SeparatorPrimitive } from "radix-ui"
|
|
5
|
-
|
|
6
|
-
import { cn } from "../lib/cn.js"
|
|
7
|
-
|
|
8
|
-
function Separator({
|
|
9
|
-
className,
|
|
10
|
-
orientation = "horizontal",
|
|
11
|
-
decorative = true,
|
|
12
|
-
...props
|
|
13
|
-
}: React.ComponentProps<typeof SeparatorPrimitive.Root>) {
|
|
14
|
-
return (
|
|
15
|
-
<SeparatorPrimitive.Root
|
|
16
|
-
data-slot="separator"
|
|
17
|
-
decorative={decorative}
|
|
18
|
-
orientation={orientation}
|
|
19
|
-
className={cn(
|
|
20
|
-
"shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",
|
|
21
|
-
className
|
|
22
|
-
)}
|
|
23
|
-
{...props}
|
|
24
|
-
/>
|
|
25
|
-
)
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export { Separator }
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { cn } from "../lib/cn.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-muted", className)}
|
|
8
|
-
{...props}
|
|
9
|
-
/>
|
|
10
|
-
)
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export { Skeleton }
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import { Toaster as Sonner, type ToasterProps } from "sonner"
|
|
5
|
-
import { CircleCheckIcon, InfoIcon, TriangleAlertIcon, OctagonXIcon, Loader2Icon } from "lucide-react"
|
|
6
|
-
|
|
7
|
-
// SHADCN FRAMEWORK ADAPTER: shadcn's sonner reads next-themes (a Next.js
|
|
8
|
-
// integration). VisionSet is Vite with one theme source, `.dark` on <html>
|
|
9
|
-
// (styles.css `@custom-variant dark`). This hook is the only difference from
|
|
10
|
-
// frontend/ui-core/shadcn/sonner.tsx; drop it if the app ever adopts a
|
|
11
|
-
// provider that shadcn's file can read.
|
|
12
|
-
function useTheme(): { theme: "light" | "dark" } {
|
|
13
|
-
const read = () => (typeof document !== "undefined" && document.documentElement.classList.contains("dark") ? "dark" : "light")
|
|
14
|
-
const [theme, setTheme] = React.useState<"light" | "dark">(read)
|
|
15
|
-
React.useEffect(() => {
|
|
16
|
-
const observer = new MutationObserver(() => setTheme(read()))
|
|
17
|
-
observer.observe(document.documentElement, { attributes: true, attributeFilter: ["class"] })
|
|
18
|
-
return () => observer.disconnect()
|
|
19
|
-
}, [])
|
|
20
|
-
return { theme }
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const Toaster = ({ ...props }: ToasterProps) => {
|
|
24
|
-
const { theme = "system" } = useTheme()
|
|
25
|
-
|
|
26
|
-
return (
|
|
27
|
-
<Sonner
|
|
28
|
-
theme={theme as ToasterProps["theme"]}
|
|
29
|
-
className="toaster group"
|
|
30
|
-
icons={{
|
|
31
|
-
success: (
|
|
32
|
-
<CircleCheckIcon className="size-4" />
|
|
33
|
-
),
|
|
34
|
-
info: (
|
|
35
|
-
<InfoIcon className="size-4" />
|
|
36
|
-
),
|
|
37
|
-
warning: (
|
|
38
|
-
<TriangleAlertIcon className="size-4" />
|
|
39
|
-
),
|
|
40
|
-
error: (
|
|
41
|
-
<OctagonXIcon className="size-4" />
|
|
42
|
-
),
|
|
43
|
-
loading: (
|
|
44
|
-
<Loader2Icon className="size-4 animate-spin" />
|
|
45
|
-
),
|
|
46
|
-
}}
|
|
47
|
-
style={
|
|
48
|
-
{
|
|
49
|
-
"--normal-bg": "var(--popover)",
|
|
50
|
-
"--normal-text": "var(--popover-foreground)",
|
|
51
|
-
"--normal-border": "var(--border)",
|
|
52
|
-
"--border-radius": "var(--radius)",
|
|
53
|
-
} as React.CSSProperties
|
|
54
|
-
}
|
|
55
|
-
toastOptions={{
|
|
56
|
-
classNames: {
|
|
57
|
-
toast: "cn-toast",
|
|
58
|
-
},
|
|
59
|
-
}}
|
|
60
|
-
{...props}
|
|
61
|
-
/>
|
|
62
|
-
)
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export { Toaster }
|
package/src/primitives/table.tsx
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
|
|
3
|
-
import { cn } from "../lib/cn.js"
|
|
4
|
-
|
|
5
|
-
function Table({ className, ...props }: React.ComponentProps<"table">) {
|
|
6
|
-
return (
|
|
7
|
-
<div
|
|
8
|
-
data-slot="table-container"
|
|
9
|
-
className="relative w-full overflow-x-auto"
|
|
10
|
-
>
|
|
11
|
-
<table
|
|
12
|
-
data-slot="table"
|
|
13
|
-
className={cn("w-full caption-bottom text-sm", className)}
|
|
14
|
-
{...props}
|
|
15
|
-
/>
|
|
16
|
-
</div>
|
|
17
|
-
)
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function TableHeader({ className, ...props }: React.ComponentProps<"thead">) {
|
|
21
|
-
return (
|
|
22
|
-
<thead
|
|
23
|
-
data-slot="table-header"
|
|
24
|
-
className={cn("[&_tr]:border-b", className)}
|
|
25
|
-
{...props}
|
|
26
|
-
/>
|
|
27
|
-
)
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function TableBody({ className, ...props }: React.ComponentProps<"tbody">) {
|
|
31
|
-
return (
|
|
32
|
-
<tbody
|
|
33
|
-
data-slot="table-body"
|
|
34
|
-
className={cn("[&_tr:last-child]:border-0", className)}
|
|
35
|
-
{...props}
|
|
36
|
-
/>
|
|
37
|
-
)
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function TableFooter({ className, ...props }: React.ComponentProps<"tfoot">) {
|
|
41
|
-
return (
|
|
42
|
-
<tfoot
|
|
43
|
-
data-slot="table-footer"
|
|
44
|
-
className={cn(
|
|
45
|
-
"border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",
|
|
46
|
-
className
|
|
47
|
-
)}
|
|
48
|
-
{...props}
|
|
49
|
-
/>
|
|
50
|
-
)
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function TableRow({ className, ...props }: React.ComponentProps<"tr">) {
|
|
54
|
-
return (
|
|
55
|
-
<tr
|
|
56
|
-
data-slot="table-row"
|
|
57
|
-
className={cn(
|
|
58
|
-
"border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",
|
|
59
|
-
className
|
|
60
|
-
)}
|
|
61
|
-
{...props}
|
|
62
|
-
/>
|
|
63
|
-
)
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function TableHead({ className, ...props }: React.ComponentProps<"th">) {
|
|
67
|
-
return (
|
|
68
|
-
<th
|
|
69
|
-
data-slot="table-head"
|
|
70
|
-
className={cn(
|
|
71
|
-
"h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0",
|
|
72
|
-
className
|
|
73
|
-
)}
|
|
74
|
-
{...props}
|
|
75
|
-
/>
|
|
76
|
-
)
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
function TableCell({ className, ...props }: React.ComponentProps<"td">) {
|
|
80
|
-
return (
|
|
81
|
-
<td
|
|
82
|
-
data-slot="table-cell"
|
|
83
|
-
className={cn(
|
|
84
|
-
"p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0",
|
|
85
|
-
className
|
|
86
|
-
)}
|
|
87
|
-
{...props}
|
|
88
|
-
/>
|
|
89
|
-
)
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
function TableCaption({
|
|
93
|
-
className,
|
|
94
|
-
...props
|
|
95
|
-
}: React.ComponentProps<"caption">) {
|
|
96
|
-
return (
|
|
97
|
-
<caption
|
|
98
|
-
data-slot="table-caption"
|
|
99
|
-
className={cn("mt-4 text-sm text-muted-foreground", className)}
|
|
100
|
-
{...props}
|
|
101
|
-
/>
|
|
102
|
-
)
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
export {
|
|
106
|
-
Table,
|
|
107
|
-
TableHeader,
|
|
108
|
-
TableBody,
|
|
109
|
-
TableFooter,
|
|
110
|
-
TableHead,
|
|
111
|
-
TableRow,
|
|
112
|
-
TableCell,
|
|
113
|
-
TableCaption,
|
|
114
|
-
}
|
package/src/primitives/tabs.tsx
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import { cva, type VariantProps } from "class-variance-authority"
|
|
3
|
-
import { Tabs as TabsPrimitive } from "radix-ui"
|
|
4
|
-
|
|
5
|
-
import { cn } from "../lib/cn.js"
|
|
6
|
-
|
|
7
|
-
function Tabs({
|
|
8
|
-
className,
|
|
9
|
-
orientation = "horizontal",
|
|
10
|
-
...props
|
|
11
|
-
}: React.ComponentProps<typeof TabsPrimitive.Root>) {
|
|
12
|
-
return (
|
|
13
|
-
<TabsPrimitive.Root
|
|
14
|
-
data-slot="tabs"
|
|
15
|
-
data-orientation={orientation}
|
|
16
|
-
className={cn(
|
|
17
|
-
"group/tabs flex gap-2 data-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-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-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-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-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 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_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-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent",
|
|
66
|
-
"data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground",
|
|
67
|
-
"after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-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 text-sm outline-none", className)}
|
|
83
|
-
{...props}
|
|
84
|
-
/>
|
|
85
|
-
)
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export { Tabs, TabsList, TabsTrigger, TabsContent, tabsListVariants }
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
|
|
3
|
-
import { cn } from "../lib/cn.js"
|
|
4
|
-
|
|
5
|
-
function Textarea({ className, ...props }: React.ComponentProps<"textarea">) {
|
|
6
|
-
return (
|
|
7
|
-
<textarea
|
|
8
|
-
data-slot="textarea"
|
|
9
|
-
className={cn(
|
|
10
|
-
"flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",
|
|
11
|
-
className
|
|
12
|
-
)}
|
|
13
|
-
{...props}
|
|
14
|
-
/>
|
|
15
|
-
)
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export { Textarea }
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import { Tooltip as TooltipPrimitive } from "radix-ui"
|
|
5
|
-
|
|
6
|
-
import { cn } from "../lib/cn.js"
|
|
7
|
-
|
|
8
|
-
function TooltipProvider({
|
|
9
|
-
delayDuration = 0,
|
|
10
|
-
...props
|
|
11
|
-
}: React.ComponentProps<typeof TooltipPrimitive.Provider>) {
|
|
12
|
-
return (
|
|
13
|
-
<TooltipPrimitive.Provider
|
|
14
|
-
data-slot="tooltip-provider"
|
|
15
|
-
delayDuration={delayDuration}
|
|
16
|
-
{...props}
|
|
17
|
-
/>
|
|
18
|
-
)
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function Tooltip({
|
|
22
|
-
...props
|
|
23
|
-
}: React.ComponentProps<typeof TooltipPrimitive.Root>) {
|
|
24
|
-
return <TooltipPrimitive.Root data-slot="tooltip" {...props} />
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function TooltipTrigger({
|
|
28
|
-
...props
|
|
29
|
-
}: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {
|
|
30
|
-
return <TooltipPrimitive.Trigger data-slot="tooltip-trigger" {...props} />
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function TooltipContent({
|
|
34
|
-
className,
|
|
35
|
-
sideOffset = 0,
|
|
36
|
-
children,
|
|
37
|
-
...props
|
|
38
|
-
}: React.ComponentProps<typeof TooltipPrimitive.Content>) {
|
|
39
|
-
return (
|
|
40
|
-
<TooltipPrimitive.Portal>
|
|
41
|
-
<TooltipPrimitive.Content
|
|
42
|
-
data-slot="tooltip-content"
|
|
43
|
-
sideOffset={sideOffset}
|
|
44
|
-
className={cn(
|
|
45
|
-
"z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 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-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
46
|
-
className
|
|
47
|
-
)}
|
|
48
|
-
{...props}
|
|
49
|
-
>
|
|
50
|
-
{children}
|
|
51
|
-
<TooltipPrimitive.Arrow className="z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground" />
|
|
52
|
-
</TooltipPrimitive.Content>
|
|
53
|
-
</TooltipPrimitive.Portal>
|
|
54
|
-
)
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger }
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|