@traky-app/ui 0.0.0-stage → 1.0.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 +30 -2
- package/package.json +26 -4
- package/registry/registry.json +6 -0
- package/registry/traky/hooks/use-mobile.ts +19 -0
- package/registry/traky/json/accordion.json +18 -0
- package/registry/traky/json/alert-dialog.json +20 -0
- package/registry/traky/json/alert.json +17 -0
- package/registry/traky/json/animated-beam.json +14 -0
- package/registry/traky/json/animated-list.json +14 -0
- package/registry/traky/json/avatar.json +17 -0
- package/registry/traky/json/badge.json +18 -0
- package/registry/traky/json/bento-grid.json +20 -0
- package/registry/traky/json/breadcrumb.json +18 -0
- package/registry/traky/json/bubble.json +18 -0
- package/registry/traky/json/button-group.json +21 -0
- package/registry/traky/json/button.json +18 -0
- package/registry/traky/json/calendar.json +21 -0
- package/registry/traky/json/card.json +14 -0
- package/registry/traky/json/carousel.json +21 -0
- package/registry/traky/json/chart.json +17 -0
- package/registry/traky/json/checkbox.json +18 -0
- package/registry/traky/json/checkpoint.json +22 -0
- package/registry/traky/json/code-block.json +21 -0
- package/registry/traky/json/collapsible.json +17 -0
- package/registry/traky/json/command.json +22 -0
- package/registry/traky/json/context-menu.json +18 -0
- package/registry/traky/json/dialog.json +18 -0
- package/registry/traky/json/drawer.json +17 -0
- package/registry/traky/json/dropdown-menu.json +18 -0
- package/registry/traky/json/empty.json +17 -0
- package/registry/traky/json/field.json +21 -0
- package/registry/traky/json/globe.json +17 -0
- package/registry/traky/json/hook-use-mobile.json +14 -0
- package/registry/traky/json/hover-card.json +17 -0
- package/registry/traky/json/input-group.json +22 -0
- package/registry/traky/json/input-otp.json +18 -0
- package/registry/traky/json/input.json +17 -0
- package/registry/traky/json/item.json +21 -0
- package/registry/traky/json/kbd.json +14 -0
- package/registry/traky/json/label.json +17 -0
- package/registry/traky/json/lib-disable-input-autofill.json +14 -0
- package/registry/traky/json/lib-sidebar-persistence.json +14 -0
- package/registry/traky/json/lib-utils.json +18 -0
- package/registry/traky/json/map.json +19 -0
- package/registry/traky/json/marker.json +18 -0
- package/registry/traky/json/marquee.json +14 -0
- package/registry/traky/json/message.json +14 -0
- package/registry/traky/json/navigation-menu.json +19 -0
- package/registry/traky/json/number-ticker.json +14 -0
- package/registry/traky/json/pagination.json +20 -0
- package/registry/traky/json/popover.json +17 -0
- package/registry/traky/json/progress.json +17 -0
- package/registry/traky/json/select.json +18 -0
- package/registry/traky/json/separator.json +17 -0
- package/registry/traky/json/sheet.json +18 -0
- package/registry/traky/json/sidebar.json +29 -0
- package/registry/traky/json/skeleton.json +14 -0
- package/registry/traky/json/sonner.json +18 -0
- package/registry/traky/json/spinner.json +17 -0
- package/registry/traky/json/switch.json +17 -0
- package/registry/traky/json/table.json +14 -0
- package/registry/traky/json/tabs.json +17 -0
- package/registry/traky/json/textarea.json +17 -0
- package/registry/traky/json/toggle-group.json +21 -0
- package/registry/traky/json/toggle.json +18 -0
- package/registry/traky/json/tooltip.json +17 -0
- package/registry/traky/json/trace.json +20 -0
- package/registry/traky/lib/disable-input-autofill.ts +23 -0
- package/registry/traky/lib/sidebar-persistence.ts +76 -0
- package/registry/traky/lib/utils.ts +6 -0
- package/registry/traky/registry.json +637 -0
- package/registry/traky/ui/accordion.tsx +65 -0
- package/registry/traky/ui/alert-dialog.tsx +163 -0
- package/registry/traky/ui/alert.tsx +66 -0
- package/registry/traky/ui/animated-beam.tsx +185 -0
- package/registry/traky/ui/animated-list.tsx +71 -0
- package/registry/traky/ui/avatar.tsx +53 -0
- package/registry/traky/ui/badge.tsx +46 -0
- package/registry/traky/ui/bento-grid.tsx +109 -0
- package/registry/traky/ui/breadcrumb.tsx +108 -0
- package/registry/traky/ui/bubble.tsx +125 -0
- package/registry/traky/ui/button-group.tsx +83 -0
- package/registry/traky/ui/button.tsx +64 -0
- package/registry/traky/ui/calendar.tsx +213 -0
- package/registry/traky/ui/card.tsx +92 -0
- package/registry/traky/ui/carousel.tsx +240 -0
- package/registry/traky/ui/chart.tsx +380 -0
- package/registry/traky/ui/checkbox.tsx +31 -0
- package/registry/traky/ui/checkpoint.tsx +94 -0
- package/registry/traky/ui/code-block.tsx +232 -0
- package/registry/traky/ui/collapsible.tsx +33 -0
- package/registry/traky/ui/command.tsx +190 -0
- package/registry/traky/ui/context-menu.tsx +251 -0
- package/registry/traky/ui/dialog.tsx +142 -0
- package/registry/traky/ui/drawer.tsx +135 -0
- package/registry/traky/ui/dropdown-menu.tsx +256 -0
- package/registry/traky/ui/empty.tsx +104 -0
- package/registry/traky/ui/field.tsx +248 -0
- package/registry/traky/ui/globe.tsx +234 -0
- package/registry/traky/ui/hover-card.tsx +44 -0
- package/registry/traky/ui/input-group.tsx +170 -0
- package/registry/traky/ui/input-otp.tsx +77 -0
- package/registry/traky/ui/input.tsx +24 -0
- package/registry/traky/ui/item.tsx +193 -0
- package/registry/traky/ui/kbd.tsx +28 -0
- package/registry/traky/ui/label.tsx +24 -0
- package/registry/traky/ui/map.tsx +2226 -0
- package/registry/traky/ui/marker.tsx +69 -0
- package/registry/traky/ui/marquee.tsx +74 -0
- package/registry/traky/ui/message.tsx +92 -0
- package/registry/traky/ui/navigation-menu.tsx +169 -0
- package/registry/traky/ui/number-ticker.tsx +90 -0
- package/registry/traky/ui/pagination.tsx +122 -0
- package/registry/traky/ui/popover.tsx +48 -0
- package/registry/traky/ui/progress.tsx +31 -0
- package/registry/traky/ui/select.tsx +193 -0
- package/registry/traky/ui/separator.tsx +28 -0
- package/registry/traky/ui/sheet.tsx +143 -0
- package/registry/traky/ui/sidebar.tsx +764 -0
- package/registry/traky/ui/skeleton.tsx +13 -0
- package/registry/traky/ui/sonner.tsx +71 -0
- package/registry/traky/ui/spinner.tsx +15 -0
- package/registry/traky/ui/switch.tsx +41 -0
- package/registry/traky/ui/table.tsx +116 -0
- package/registry/traky/ui/tabs.tsx +66 -0
- package/registry/traky/ui/textarea.tsx +20 -0
- package/registry/traky/ui/toggle-group.tsx +83 -0
- package/registry/traky/ui/toggle.tsx +47 -0
- package/registry/traky/ui/tooltip.tsx +61 -0
- package/registry/traky/ui/trace.tsx +165 -0
- package/schema/components.json +24 -0
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { Slot } from "@radix-ui/react-slot"
|
|
3
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
4
|
+
|
|
5
|
+
import { cn } from "@/lib/utils"
|
|
6
|
+
import { Separator } from "@/components/ui/separator"
|
|
7
|
+
|
|
8
|
+
function ItemGroup({ className, ...props }: React.ComponentProps<"div">) {
|
|
9
|
+
return (
|
|
10
|
+
<div
|
|
11
|
+
role="list"
|
|
12
|
+
data-slot="item-group"
|
|
13
|
+
className={cn("group/item-group flex flex-col", className)}
|
|
14
|
+
{...props}
|
|
15
|
+
/>
|
|
16
|
+
)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function ItemSeparator({
|
|
20
|
+
className,
|
|
21
|
+
...props
|
|
22
|
+
}: React.ComponentProps<typeof Separator>) {
|
|
23
|
+
return (
|
|
24
|
+
<Separator
|
|
25
|
+
data-slot="item-separator"
|
|
26
|
+
orientation="horizontal"
|
|
27
|
+
className={cn("my-0", className)}
|
|
28
|
+
{...props}
|
|
29
|
+
/>
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const itemVariants = cva(
|
|
34
|
+
"group/item flex items-center border border-transparent text-sm rounded-md transition-colors [a]:hover:bg-accent/50 [a]:transition-colors duration-100 flex-wrap outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
35
|
+
{
|
|
36
|
+
variants: {
|
|
37
|
+
variant: {
|
|
38
|
+
default: "bg-transparent",
|
|
39
|
+
outline: "border-border",
|
|
40
|
+
muted: "bg-muted/50",
|
|
41
|
+
},
|
|
42
|
+
size: {
|
|
43
|
+
default: "p-4 gap-4 ",
|
|
44
|
+
sm: "py-3 px-4 gap-2.5",
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
defaultVariants: {
|
|
48
|
+
variant: "default",
|
|
49
|
+
size: "default",
|
|
50
|
+
},
|
|
51
|
+
}
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
function Item({
|
|
55
|
+
className,
|
|
56
|
+
variant = "default",
|
|
57
|
+
size = "default",
|
|
58
|
+
asChild = false,
|
|
59
|
+
...props
|
|
60
|
+
}: React.ComponentProps<"div"> &
|
|
61
|
+
VariantProps<typeof itemVariants> & { asChild?: boolean }) {
|
|
62
|
+
const Comp = asChild ? Slot : "div"
|
|
63
|
+
return (
|
|
64
|
+
<Comp
|
|
65
|
+
data-slot="item"
|
|
66
|
+
data-variant={variant}
|
|
67
|
+
data-size={size}
|
|
68
|
+
className={cn(itemVariants({ variant, size, className }))}
|
|
69
|
+
{...props}
|
|
70
|
+
/>
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const itemMediaVariants = cva(
|
|
75
|
+
"flex shrink-0 items-center justify-center gap-2 group-has-[[data-slot=item-description]]/item:self-start [&_svg]:pointer-events-none group-has-[[data-slot=item-description]]/item:translate-y-0.5",
|
|
76
|
+
{
|
|
77
|
+
variants: {
|
|
78
|
+
variant: {
|
|
79
|
+
default: "bg-transparent",
|
|
80
|
+
icon: "size-8 border rounded-sm bg-muted [&_svg:not([class*='size-'])]:size-4",
|
|
81
|
+
image:
|
|
82
|
+
"size-10 rounded-sm overflow-hidden [&_img]:size-full [&_img]:object-cover",
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
defaultVariants: {
|
|
86
|
+
variant: "default",
|
|
87
|
+
},
|
|
88
|
+
}
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
function ItemMedia({
|
|
92
|
+
className,
|
|
93
|
+
variant = "default",
|
|
94
|
+
...props
|
|
95
|
+
}: React.ComponentProps<"div"> & VariantProps<typeof itemMediaVariants>) {
|
|
96
|
+
return (
|
|
97
|
+
<div
|
|
98
|
+
data-slot="item-media"
|
|
99
|
+
data-variant={variant}
|
|
100
|
+
className={cn(itemMediaVariants({ variant, className }))}
|
|
101
|
+
{...props}
|
|
102
|
+
/>
|
|
103
|
+
)
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function ItemContent({ className, ...props }: React.ComponentProps<"div">) {
|
|
107
|
+
return (
|
|
108
|
+
<div
|
|
109
|
+
data-slot="item-content"
|
|
110
|
+
className={cn(
|
|
111
|
+
"flex flex-1 flex-col gap-1 [&+[data-slot=item-content]]:flex-none",
|
|
112
|
+
className
|
|
113
|
+
)}
|
|
114
|
+
{...props}
|
|
115
|
+
/>
|
|
116
|
+
)
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function ItemTitle({ className, ...props }: React.ComponentProps<"div">) {
|
|
120
|
+
return (
|
|
121
|
+
<div
|
|
122
|
+
data-slot="item-title"
|
|
123
|
+
className={cn(
|
|
124
|
+
"flex w-fit items-center gap-2 text-sm leading-snug font-medium",
|
|
125
|
+
className
|
|
126
|
+
)}
|
|
127
|
+
{...props}
|
|
128
|
+
/>
|
|
129
|
+
)
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function ItemDescription({ className, ...props }: React.ComponentProps<"p">) {
|
|
133
|
+
return (
|
|
134
|
+
<p
|
|
135
|
+
data-slot="item-description"
|
|
136
|
+
className={cn(
|
|
137
|
+
"text-muted-foreground line-clamp-2 text-sm leading-normal font-normal text-balance",
|
|
138
|
+
"[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",
|
|
139
|
+
className
|
|
140
|
+
)}
|
|
141
|
+
{...props}
|
|
142
|
+
/>
|
|
143
|
+
)
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function ItemActions({ className, ...props }: React.ComponentProps<"div">) {
|
|
147
|
+
return (
|
|
148
|
+
<div
|
|
149
|
+
data-slot="item-actions"
|
|
150
|
+
className={cn("flex items-center gap-2", className)}
|
|
151
|
+
{...props}
|
|
152
|
+
/>
|
|
153
|
+
)
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function ItemHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
157
|
+
return (
|
|
158
|
+
<div
|
|
159
|
+
data-slot="item-header"
|
|
160
|
+
className={cn(
|
|
161
|
+
"flex basis-full items-center justify-between gap-2",
|
|
162
|
+
className
|
|
163
|
+
)}
|
|
164
|
+
{...props}
|
|
165
|
+
/>
|
|
166
|
+
)
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
function ItemFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
170
|
+
return (
|
|
171
|
+
<div
|
|
172
|
+
data-slot="item-footer"
|
|
173
|
+
className={cn(
|
|
174
|
+
"flex basis-full items-center justify-between gap-2",
|
|
175
|
+
className
|
|
176
|
+
)}
|
|
177
|
+
{...props}
|
|
178
|
+
/>
|
|
179
|
+
)
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export {
|
|
183
|
+
Item,
|
|
184
|
+
ItemMedia,
|
|
185
|
+
ItemContent,
|
|
186
|
+
ItemActions,
|
|
187
|
+
ItemGroup,
|
|
188
|
+
ItemSeparator,
|
|
189
|
+
ItemTitle,
|
|
190
|
+
ItemDescription,
|
|
191
|
+
ItemHeader,
|
|
192
|
+
ItemFooter,
|
|
193
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { cn } from "@/lib/utils"
|
|
2
|
+
|
|
3
|
+
function Kbd({ className, ...props }: React.ComponentProps<"kbd">) {
|
|
4
|
+
return (
|
|
5
|
+
<kbd
|
|
6
|
+
data-slot="kbd"
|
|
7
|
+
className={cn(
|
|
8
|
+
"bg-muted text-muted-foreground pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm px-1 font-sans text-xs font-medium select-none",
|
|
9
|
+
"[&_svg:not([class*='size-'])]:size-3",
|
|
10
|
+
"[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10",
|
|
11
|
+
className
|
|
12
|
+
)}
|
|
13
|
+
{...props}
|
|
14
|
+
/>
|
|
15
|
+
)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function KbdGroup({ className, ...props }: React.ComponentProps<"div">) {
|
|
19
|
+
return (
|
|
20
|
+
<kbd
|
|
21
|
+
data-slot="kbd-group"
|
|
22
|
+
className={cn("inline-flex items-center gap-1", className)}
|
|
23
|
+
{...props}
|
|
24
|
+
/>
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export { Kbd, KbdGroup }
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import * as LabelPrimitive from "@radix-ui/react-label"
|
|
5
|
+
|
|
6
|
+
import { cn } from "@/lib/utils"
|
|
7
|
+
|
|
8
|
+
function Label({
|
|
9
|
+
className,
|
|
10
|
+
...props
|
|
11
|
+
}: React.ComponentProps<typeof LabelPrimitive.Root>) {
|
|
12
|
+
return (
|
|
13
|
+
<LabelPrimitive.Root
|
|
14
|
+
data-slot="label"
|
|
15
|
+
className={cn(
|
|
16
|
+
"flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
|
|
17
|
+
className
|
|
18
|
+
)}
|
|
19
|
+
{...props}
|
|
20
|
+
/>
|
|
21
|
+
)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export { Label }
|