@mostra/kit 0.0.0-stage → 0.19.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 +43 -2
- package/css/kit.css +59 -0
- package/css/shadcn.css +638 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/layout.d.ts +60 -0
- package/dist/layout.d.ts.map +1 -0
- package/dist/layout.js +112 -0
- package/dist/layout.js.map +1 -0
- package/dist/questionnaire.d.ts +100 -0
- package/dist/questionnaire.d.ts.map +1 -0
- package/dist/questionnaire.js +632 -0
- package/dist/questionnaire.js.map +1 -0
- package/package.json +120 -3
- package/registry/LICENSE.md +21 -0
- package/registry/base/accordion.json +19 -0
- package/registry/base/alert-dialog.json +21 -0
- package/registry/base/alert.json +18 -0
- package/registry/base/aspect-ratio.json +17 -0
- package/registry/base/attachment.json +22 -0
- package/registry/base/avatar.json +18 -0
- package/registry/base/badge.json +19 -0
- package/registry/base/breadcrumb.json +19 -0
- package/registry/base/bubble.json +19 -0
- package/registry/base/button-group.json +22 -0
- package/registry/base/button.json +19 -0
- package/registry/base/calendar.json +22 -0
- package/registry/base/card.json +17 -0
- package/registry/base/carousel.json +22 -0
- package/registry/base/chart.json +21 -0
- package/registry/base/checkbox.json +19 -0
- package/registry/base/code-block.json +23 -0
- package/registry/base/collapsible.json +17 -0
- package/registry/base/combobox.json +23 -0
- package/registry/base/command.json +23 -0
- package/registry/base/components/mostra/layout.tsx +221 -0
- package/registry/base/components/mostra/questionnaire.tsx +1005 -0
- package/registry/base/components/ui/accordion.tsx +71 -0
- package/registry/base/components/ui/alert-dialog.tsx +187 -0
- package/registry/base/components/ui/alert.tsx +75 -0
- package/registry/base/components/ui/aspect-ratio.tsx +22 -0
- package/registry/base/components/ui/attachment.tsx +207 -0
- package/registry/base/components/ui/avatar.tsx +108 -0
- package/registry/base/components/ui/badge.tsx +54 -0
- package/registry/base/components/ui/breadcrumb.tsx +124 -0
- package/registry/base/components/ui/bubble.tsx +127 -0
- package/registry/base/components/ui/button-group.tsx +87 -0
- package/registry/base/components/ui/button.tsx +57 -0
- package/registry/base/components/ui/calendar.tsx +221 -0
- package/registry/base/components/ui/card.tsx +102 -0
- package/registry/base/components/ui/carousel.tsx +242 -0
- package/registry/base/components/ui/chart.tsx +372 -0
- package/registry/base/components/ui/checkbox.tsx +28 -0
- package/registry/base/components/ui/code-block.tsx +249 -0
- package/registry/base/components/ui/collapsible.tsx +21 -0
- package/registry/base/components/ui/combobox.tsx +297 -0
- package/registry/base/components/ui/command.tsx +196 -0
- package/registry/base/components/ui/context-menu.tsx +270 -0
- package/registry/base/components/ui/dialog.tsx +160 -0
- package/registry/base/components/ui/direction.tsx +6 -0
- package/registry/base/components/ui/drawer.tsx +227 -0
- package/registry/base/components/ui/dropdown-menu.tsx +267 -0
- package/registry/base/components/ui/empty.tsx +103 -0
- package/registry/base/components/ui/field.tsx +238 -0
- package/registry/base/components/ui/hover-card.tsx +50 -0
- package/registry/base/components/ui/input-group.tsx +158 -0
- package/registry/base/components/ui/input-otp.tsx +86 -0
- package/registry/base/components/ui/input.tsx +19 -0
- package/registry/base/components/ui/item.tsx +201 -0
- package/registry/base/components/ui/kbd.tsx +26 -0
- package/registry/base/components/ui/label.tsx +19 -0
- package/registry/base/components/ui/marker.tsx +70 -0
- package/registry/base/components/ui/menubar.tsx +280 -0
- package/registry/base/components/ui/message-scroller.tsx +131 -0
- package/registry/base/components/ui/message.tsx +91 -0
- package/registry/base/components/ui/native-select.tsx +60 -0
- package/registry/base/components/ui/navigation-menu.tsx +167 -0
- package/registry/base/components/ui/pagination.tsx +130 -0
- package/registry/base/components/ui/popover.tsx +89 -0
- package/registry/base/components/ui/progress.tsx +82 -0
- package/registry/base/components/ui/questionnaire.tsx +324 -0
- package/registry/base/components/ui/radio-group.tsx +37 -0
- package/registry/base/components/ui/resizable.tsx +49 -0
- package/registry/base/components/ui/scroll-area.tsx +53 -0
- package/registry/base/components/ui/select.tsx +200 -0
- package/registry/base/components/ui/separator.tsx +24 -0
- package/registry/base/components/ui/sheet.tsx +138 -0
- package/registry/base/components/ui/sidebar.tsx +723 -0
- package/registry/base/components/ui/skeleton.tsx +13 -0
- package/registry/base/components/ui/slider.tsx +51 -0
- package/registry/base/components/ui/sonner.tsx +65 -0
- package/registry/base/components/ui/spinner.tsx +10 -0
- package/registry/base/components/ui/switch.tsx +31 -0
- package/registry/base/components/ui/table.tsx +116 -0
- package/registry/base/components/ui/tabs.tsx +85 -0
- package/registry/base/components/ui/textarea.tsx +17 -0
- package/registry/base/components/ui/toast.tsx +234 -0
- package/registry/base/components/ui/toggle-group.tsx +89 -0
- package/registry/base/components/ui/toggle.tsx +44 -0
- package/registry/base/components/ui/tooltip.tsx +65 -0
- package/registry/base/components/ui/trace.tsx +162 -0
- package/registry/base/context-menu.json +19 -0
- package/registry/base/dialog.json +22 -0
- package/registry/base/direction.json +17 -0
- package/registry/base/drawer.json +18 -0
- package/registry/base/dropdown-menu.json +19 -0
- package/registry/base/empty.json +18 -0
- package/registry/base/field.json +22 -0
- package/registry/base/hooks/use-highlighted-code.ts +75 -0
- package/registry/base/hooks/use-mobile.ts +19 -0
- package/registry/base/hover-card.json +18 -0
- package/registry/base/input-group.json +23 -0
- package/registry/base/input-otp.json +19 -0
- package/registry/base/input.json +18 -0
- package/registry/base/item.json +22 -0
- package/registry/base/kbd.json +17 -0
- package/registry/base/label.json +17 -0
- package/registry/base/lib/highlighter.tsx +124 -0
- package/registry/base/lib/utils.ts +1 -0
- package/registry/base/marker.json +19 -0
- package/registry/base/menubar.json +22 -0
- package/registry/base/message-scroller.json +22 -0
- package/registry/base/message.json +17 -0
- package/registry/base/mostra-layout.json +20 -0
- package/registry/base/mostra-questionnaire.json +22 -0
- package/registry/base/native-select.json +18 -0
- package/registry/base/navigation-menu.json +20 -0
- package/registry/base/pagination.json +21 -0
- package/registry/base/popover.json +18 -0
- package/registry/base/progress.json +18 -0
- package/registry/base/questionnaire.json +22 -0
- package/registry/base/radio-group.json +18 -0
- package/registry/base/registry.json +287 -0
- package/registry/base/resizable.json +18 -0
- package/registry/base/scroll-area.json +18 -0
- package/registry/base/select.json +19 -0
- package/registry/base/separator.json +18 -0
- package/registry/base/sheet.json +22 -0
- package/registry/base/sidebar.json +29 -0
- package/registry/base/skeleton.json +17 -0
- package/registry/base/slider.json +18 -0
- package/registry/base/sonner.json +18 -0
- package/registry/base/spinner.json +18 -0
- package/registry/base/switch.json +18 -0
- package/registry/base/table.json +17 -0
- package/registry/base/tabs.json +19 -0
- package/registry/base/textarea.json +17 -0
- package/registry/base/toast.json +22 -0
- package/registry/base/toggle-group.json +22 -0
- package/registry/base/toggle.json +19 -0
- package/registry/base/tooltip.json +18 -0
- package/registry/base/trace.json +21 -0
- package/registry/base/use-highlighted-code.json +21 -0
- package/registry/base/use-mobile.json +14 -0
- package/registry/base/utils.json +17 -0
- package/registry/radix/accordion.json +19 -0
- package/registry/radix/alert-dialog.json +21 -0
- package/registry/radix/alert.json +18 -0
- package/registry/radix/aspect-ratio.json +17 -0
- package/registry/radix/attachment.json +22 -0
- package/registry/radix/avatar.json +18 -0
- package/registry/radix/badge.json +19 -0
- package/registry/radix/breadcrumb.json +19 -0
- package/registry/radix/bubble.json +19 -0
- package/registry/radix/button-group.json +22 -0
- package/registry/radix/button.json +19 -0
- package/registry/radix/calendar.json +22 -0
- package/registry/radix/card.json +17 -0
- package/registry/radix/carousel.json +22 -0
- package/registry/radix/chart.json +18 -0
- package/registry/radix/checkbox.json +19 -0
- package/registry/radix/code-block.json +23 -0
- package/registry/radix/collapsible.json +17 -0
- package/registry/radix/combobox.json +23 -0
- package/registry/radix/command.json +23 -0
- package/registry/radix/components/mostra/layout.tsx +221 -0
- package/registry/radix/components/mostra/questionnaire.tsx +1005 -0
- package/registry/radix/components/ui/accordion.tsx +80 -0
- package/registry/radix/components/ui/alert-dialog.tsx +199 -0
- package/registry/radix/components/ui/alert.tsx +75 -0
- package/registry/radix/components/ui/aspect-ratio.tsx +11 -0
- package/registry/radix/components/ui/attachment.tsx +204 -0
- package/registry/radix/components/ui/avatar.tsx +111 -0
- package/registry/radix/components/ui/badge.tsx +51 -0
- package/registry/radix/components/ui/breadcrumb.tsx +121 -0
- package/registry/radix/components/ui/bubble.tsx +124 -0
- package/registry/radix/components/ui/button-group.tsx +83 -0
- package/registry/radix/components/ui/button.tsx +66 -0
- package/registry/radix/components/ui/calendar.tsx +222 -0
- package/registry/radix/components/ui/card.tsx +102 -0
- package/registry/radix/components/ui/carousel.tsx +242 -0
- package/registry/radix/components/ui/chart.tsx +372 -0
- package/registry/radix/components/ui/checkbox.tsx +32 -0
- package/registry/radix/components/ui/code-block.tsx +249 -0
- package/registry/radix/components/ui/collapsible.tsx +33 -0
- package/registry/radix/components/ui/combobox.tsx +299 -0
- package/registry/radix/components/ui/command.tsx +195 -0
- package/registry/radix/components/ui/context-menu.tsx +262 -0
- package/registry/radix/components/ui/dialog.tsx +168 -0
- package/registry/radix/components/ui/direction.tsx +22 -0
- package/registry/radix/components/ui/drawer.tsx +133 -0
- package/registry/radix/components/ui/dropdown-menu.tsx +268 -0
- package/registry/radix/components/ui/empty.tsx +103 -0
- package/registry/radix/components/ui/field.tsx +238 -0
- package/registry/radix/components/ui/hover-card.tsx +43 -0
- package/registry/radix/components/ui/input-group.tsx +156 -0
- package/registry/radix/components/ui/input-otp.tsx +86 -0
- package/registry/radix/components/ui/input.tsx +18 -0
- package/registry/radix/components/ui/item.tsx +196 -0
- package/registry/radix/components/ui/kbd.tsx +26 -0
- package/registry/radix/components/ui/label.tsx +23 -0
- package/registry/radix/components/ui/marker.tsx +68 -0
- package/registry/radix/components/ui/menubar.tsx +279 -0
- package/registry/radix/components/ui/message-scroller.tsx +131 -0
- package/registry/radix/components/ui/message.tsx +91 -0
- package/registry/radix/components/ui/native-select.tsx +60 -0
- package/registry/radix/components/ui/navigation-menu.tsx +163 -0
- package/registry/radix/components/ui/pagination.tsx +129 -0
- package/registry/radix/components/ui/popover.tsx +88 -0
- package/registry/radix/components/ui/progress.tsx +30 -0
- package/registry/radix/components/ui/questionnaire.tsx +324 -0
- package/registry/radix/components/ui/radio-group.tsx +43 -0
- package/registry/radix/components/ui/resizable.tsx +49 -0
- package/registry/radix/components/ui/scroll-area.tsx +54 -0
- package/registry/radix/components/ui/select.tsx +191 -0
- package/registry/radix/components/ui/separator.tsx +27 -0
- package/registry/radix/components/ui/sheet.tsx +147 -0
- package/registry/radix/components/ui/sidebar.tsx +702 -0
- package/registry/radix/components/ui/skeleton.tsx +13 -0
- package/registry/radix/components/ui/slider.tsx +62 -0
- package/registry/radix/components/ui/sonner.tsx +65 -0
- package/registry/radix/components/ui/spinner.tsx +10 -0
- package/registry/radix/components/ui/switch.tsx +32 -0
- package/registry/radix/components/ui/table.tsx +116 -0
- package/registry/radix/components/ui/tabs.tsx +129 -0
- package/registry/radix/components/ui/textarea.tsx +17 -0
- package/registry/radix/components/ui/toggle-group.tsx +89 -0
- package/registry/radix/components/ui/toggle.tsx +46 -0
- package/registry/radix/components/ui/tooltip.tsx +56 -0
- package/registry/radix/components/ui/trace.tsx +162 -0
- package/registry/radix/context-menu.json +19 -0
- package/registry/radix/dialog.json +22 -0
- package/registry/radix/direction.json +17 -0
- package/registry/radix/drawer.json +18 -0
- package/registry/radix/dropdown-menu.json +19 -0
- package/registry/radix/empty.json +18 -0
- package/registry/radix/field.json +22 -0
- package/registry/radix/hooks/use-highlighted-code.ts +75 -0
- package/registry/radix/hooks/use-mobile.ts +19 -0
- package/registry/radix/hover-card.json +18 -0
- package/registry/radix/input-group.json +23 -0
- package/registry/radix/input-otp.json +19 -0
- package/registry/radix/input.json +17 -0
- package/registry/radix/item.json +22 -0
- package/registry/radix/kbd.json +17 -0
- package/registry/radix/label.json +18 -0
- package/registry/radix/lib/highlighter.tsx +124 -0
- package/registry/radix/lib/utils.ts +1 -0
- package/registry/radix/marker.json +19 -0
- package/registry/radix/menubar.json +19 -0
- package/registry/radix/message-scroller.json +22 -0
- package/registry/radix/message.json +17 -0
- package/registry/radix/mostra-layout.json +20 -0
- package/registry/radix/mostra-questionnaire.json +22 -0
- package/registry/radix/native-select.json +18 -0
- package/registry/radix/navigation-menu.json +20 -0
- package/registry/radix/pagination.json +21 -0
- package/registry/radix/popover.json +18 -0
- package/registry/radix/progress.json +18 -0
- package/registry/radix/questionnaire.json +22 -0
- package/registry/radix/radio-group.json +18 -0
- package/registry/radix/registry.json +283 -0
- package/registry/radix/resizable.json +18 -0
- package/registry/radix/scroll-area.json +18 -0
- package/registry/radix/select.json +19 -0
- package/registry/radix/separator.json +18 -0
- package/registry/radix/sheet.json +22 -0
- package/registry/radix/sidebar.json +29 -0
- package/registry/radix/skeleton.json +17 -0
- package/registry/radix/slider.json +18 -0
- package/registry/radix/sonner.json +18 -0
- package/registry/radix/spinner.json +18 -0
- package/registry/radix/switch.json +18 -0
- package/registry/radix/table.json +17 -0
- package/registry/radix/tabs.json +19 -0
- package/registry/radix/textarea.json +17 -0
- package/registry/radix/toggle-group.json +22 -0
- package/registry/radix/toggle.json +19 -0
- package/registry/radix/tooltip.json +18 -0
- package/registry/radix/trace.json +21 -0
- package/registry/radix/use-highlighted-code.json +21 -0
- package/registry/radix/use-mobile.json +14 -0
- package/registry/radix/utils.json +17 -0
- package/src/index.ts +15 -0
- package/src/layout.tsx +221 -0
- package/src/questionnaire.tsx +1005 -0
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import {
|
|
5
|
+
MessageScroller as MessageScrollerPrimitive,
|
|
6
|
+
useMessageScroller,
|
|
7
|
+
useMessageScrollerScrollable,
|
|
8
|
+
useMessageScrollerVisibility,
|
|
9
|
+
} from "@shadcn/react/message-scroller"
|
|
10
|
+
import { cn } from "cn"
|
|
11
|
+
|
|
12
|
+
import { Button } from "@/components/ui/button"
|
|
13
|
+
import { ArrowDownIcon } from "lucide-react"
|
|
14
|
+
|
|
15
|
+
function MessageScrollerProvider(
|
|
16
|
+
props: React.ComponentProps<typeof MessageScrollerPrimitive.Provider>
|
|
17
|
+
) {
|
|
18
|
+
return <MessageScrollerPrimitive.Provider {...props} />
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function MessageScroller({
|
|
22
|
+
className,
|
|
23
|
+
...props
|
|
24
|
+
}: React.ComponentProps<typeof MessageScrollerPrimitive.Root>) {
|
|
25
|
+
return (
|
|
26
|
+
<MessageScrollerPrimitive.Root
|
|
27
|
+
data-slot="message-scroller"
|
|
28
|
+
className={cn(
|
|
29
|
+
"group/message-scroller relative flex size-full min-h-0 flex-col overflow-hidden",
|
|
30
|
+
className
|
|
31
|
+
)}
|
|
32
|
+
{...props}
|
|
33
|
+
/>
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function MessageScrollerViewport({
|
|
38
|
+
className,
|
|
39
|
+
...props
|
|
40
|
+
}: React.ComponentProps<typeof MessageScrollerPrimitive.Viewport>) {
|
|
41
|
+
return (
|
|
42
|
+
<MessageScrollerPrimitive.Viewport
|
|
43
|
+
data-slot="message-scroller-viewport"
|
|
44
|
+
className={cn(
|
|
45
|
+
"size-full min-h-0 min-w-0 scroll-fade-b scrollbar-thin scrollbar-gutter-stable overflow-y-auto overscroll-contain contain-content data-autoscrolling:scrollbar-thumb-transparent data-autoscrolling:scrollbar-track-transparent data-pending-scroll:invisible",
|
|
46
|
+
className
|
|
47
|
+
)}
|
|
48
|
+
{...props}
|
|
49
|
+
/>
|
|
50
|
+
)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function MessageScrollerContent({
|
|
54
|
+
className,
|
|
55
|
+
...props
|
|
56
|
+
}: React.ComponentProps<typeof MessageScrollerPrimitive.Content>) {
|
|
57
|
+
return (
|
|
58
|
+
<MessageScrollerPrimitive.Content
|
|
59
|
+
data-slot="message-scroller-content"
|
|
60
|
+
className={cn("flex h-max min-h-full flex-col gap-6", className)}
|
|
61
|
+
{...props}
|
|
62
|
+
/>
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function MessageScrollerItem({
|
|
67
|
+
className,
|
|
68
|
+
scrollAnchor = false,
|
|
69
|
+
...props
|
|
70
|
+
}: React.ComponentProps<typeof MessageScrollerPrimitive.Item>) {
|
|
71
|
+
return (
|
|
72
|
+
<MessageScrollerPrimitive.Item
|
|
73
|
+
data-slot="message-scroller-item"
|
|
74
|
+
scrollAnchor={scrollAnchor}
|
|
75
|
+
className={cn(
|
|
76
|
+
"min-w-0 shrink-0 [contain-intrinsic-size:auto_10rem] [content-visibility:auto]",
|
|
77
|
+
className
|
|
78
|
+
)}
|
|
79
|
+
{...props}
|
|
80
|
+
/>
|
|
81
|
+
)
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function MessageScrollerButton({
|
|
85
|
+
direction = "end",
|
|
86
|
+
className,
|
|
87
|
+
children,
|
|
88
|
+
render,
|
|
89
|
+
variant = "secondary",
|
|
90
|
+
size = "icon-sm",
|
|
91
|
+
...props
|
|
92
|
+
}: React.ComponentProps<typeof MessageScrollerPrimitive.Button> &
|
|
93
|
+
Pick<React.ComponentProps<typeof Button>, "variant" | "size">) {
|
|
94
|
+
return (
|
|
95
|
+
<MessageScrollerPrimitive.Button
|
|
96
|
+
data-slot="message-scroller-button"
|
|
97
|
+
data-direction={direction}
|
|
98
|
+
data-variant={variant}
|
|
99
|
+
data-size={size}
|
|
100
|
+
direction={direction}
|
|
101
|
+
className={cn(
|
|
102
|
+
"absolute inset-s-1/2 -translate-x-1/2 border-border bg-background text-foreground transition-[translate,scale,opacity] duration-200 hover:bg-muted hover:text-foreground data-[active=false]:pointer-events-none data-[active=false]:scale-95 data-[active=false]:opacity-0 data-[active=false]:duration-400 data-[active=false]:ease-[cubic-bezier(0.7,0,0.84,0)] data-[active=true]:translate-y-0 data-[active=true]:scale-100 data-[active=true]:opacity-100 data-[active=true]:ease-[cubic-bezier(0.23,1,0.32,1)] data-[direction=end]:bottom-4 data-[direction=end]:data-[active=false]:translate-y-full data-[direction=start]:top-4 data-[direction=start]:data-[active=false]:-translate-y-full rtl:translate-x-1/2 data-[direction=start]:[&_svg]:rotate-180",
|
|
103
|
+
className
|
|
104
|
+
)}
|
|
105
|
+
render={render ?? <Button variant={variant} size={size} />}
|
|
106
|
+
{...props}
|
|
107
|
+
>
|
|
108
|
+
{children ?? (
|
|
109
|
+
<>
|
|
110
|
+
<ArrowDownIcon
|
|
111
|
+
/>
|
|
112
|
+
<span className="sr-only">
|
|
113
|
+
{direction === "end" ? "Scroll to end" : "Scroll to start"}
|
|
114
|
+
</span>
|
|
115
|
+
</>
|
|
116
|
+
)}
|
|
117
|
+
</MessageScrollerPrimitive.Button>
|
|
118
|
+
)
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export {
|
|
122
|
+
MessageScrollerProvider,
|
|
123
|
+
MessageScroller,
|
|
124
|
+
MessageScrollerViewport,
|
|
125
|
+
MessageScrollerContent,
|
|
126
|
+
MessageScrollerItem,
|
|
127
|
+
MessageScrollerButton,
|
|
128
|
+
useMessageScroller,
|
|
129
|
+
useMessageScrollerScrollable,
|
|
130
|
+
useMessageScrollerVisibility,
|
|
131
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { cn } from "cn"
|
|
3
|
+
|
|
4
|
+
function MessageGroup({ className, ...props }: React.ComponentProps<"div">) {
|
|
5
|
+
return (
|
|
6
|
+
<div
|
|
7
|
+
data-slot="message-group"
|
|
8
|
+
className={cn("flex min-w-0 flex-col gap-2", className)}
|
|
9
|
+
{...props}
|
|
10
|
+
/>
|
|
11
|
+
)
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function Message({
|
|
15
|
+
className,
|
|
16
|
+
align = "start",
|
|
17
|
+
...props
|
|
18
|
+
}: React.ComponentProps<"div"> & { align?: "start" | "end" }) {
|
|
19
|
+
return (
|
|
20
|
+
<div
|
|
21
|
+
data-slot="message"
|
|
22
|
+
data-align={align}
|
|
23
|
+
className={cn(
|
|
24
|
+
"group/message relative flex w-full min-w-0 gap-2 text-sm data-[align=end]:flex-row-reverse",
|
|
25
|
+
className
|
|
26
|
+
)}
|
|
27
|
+
{...props}
|
|
28
|
+
/>
|
|
29
|
+
)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function MessageAvatar({ className, ...props }: React.ComponentProps<"div">) {
|
|
33
|
+
return (
|
|
34
|
+
<div
|
|
35
|
+
data-slot="message-avatar"
|
|
36
|
+
className={cn(
|
|
37
|
+
"flex w-fit min-w-8 shrink-0 items-center justify-center self-end overflow-hidden rounded-full bg-muted group-has-data-[slot=message-footer]/message:-translate-y-8",
|
|
38
|
+
className
|
|
39
|
+
)}
|
|
40
|
+
{...props}
|
|
41
|
+
/>
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function MessageContent({ className, ...props }: React.ComponentProps<"div">) {
|
|
46
|
+
return (
|
|
47
|
+
<div
|
|
48
|
+
data-slot="message-content"
|
|
49
|
+
className={cn(
|
|
50
|
+
"flex w-full min-w-0 flex-col gap-2.5 wrap-break-word group-data-[align=end]/message:*:data-slot:self-end",
|
|
51
|
+
className
|
|
52
|
+
)}
|
|
53
|
+
{...props}
|
|
54
|
+
/>
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function MessageHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
59
|
+
return (
|
|
60
|
+
<div
|
|
61
|
+
data-slot="message-header"
|
|
62
|
+
className={cn(
|
|
63
|
+
"flex max-w-full min-w-0 items-center px-3 text-xs font-medium text-muted-foreground group-has-data-[variant=ghost]/message:px-0",
|
|
64
|
+
className
|
|
65
|
+
)}
|
|
66
|
+
{...props}
|
|
67
|
+
/>
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function MessageFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
72
|
+
return (
|
|
73
|
+
<div
|
|
74
|
+
data-slot="message-footer"
|
|
75
|
+
className={cn(
|
|
76
|
+
"flex max-w-full min-w-0 items-center px-3 text-xs font-medium text-muted-foreground group-has-data-[variant=ghost]/message:px-0 group-data-[align=end]/message:justify-end",
|
|
77
|
+
className
|
|
78
|
+
)}
|
|
79
|
+
{...props}
|
|
80
|
+
/>
|
|
81
|
+
)
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export {
|
|
85
|
+
MessageGroup,
|
|
86
|
+
Message,
|
|
87
|
+
MessageAvatar,
|
|
88
|
+
MessageContent,
|
|
89
|
+
MessageFooter,
|
|
90
|
+
MessageHeader,
|
|
91
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { cn } from "cn"
|
|
3
|
+
import { ChevronDownIcon } from "lucide-react"
|
|
4
|
+
|
|
5
|
+
type NativeSelectProps = Omit<React.ComponentProps<"select">, "size"> & {
|
|
6
|
+
size?: "sm" | "default"
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function NativeSelect({
|
|
10
|
+
className,
|
|
11
|
+
size = "default",
|
|
12
|
+
...props
|
|
13
|
+
}: NativeSelectProps) {
|
|
14
|
+
return (
|
|
15
|
+
<div
|
|
16
|
+
className={cn(
|
|
17
|
+
"group/native-select relative w-fit has-[select:disabled]:opacity-50",
|
|
18
|
+
className
|
|
19
|
+
)}
|
|
20
|
+
data-slot="native-select-wrapper"
|
|
21
|
+
data-size={size}
|
|
22
|
+
>
|
|
23
|
+
<select
|
|
24
|
+
data-slot="native-select"
|
|
25
|
+
data-size={size}
|
|
26
|
+
className="h-(--control-h) w-full min-w-0 appearance-none rounded-control border border-input bg-(--field) pr-8 pl-3.5 text-sm transition-[border-color,box-shadow] outline-none select-none selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30 disabled:pointer-events-none disabled:cursor-not-allowed aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=sm]:h-(--control-h-sm) data-[size=sm]:rounded-[min(var(--radius-md),10px)] data-[size=sm]:py-0.5 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 shadow-control duration-(--state-ms)"
|
|
27
|
+
{...props}
|
|
28
|
+
/>
|
|
29
|
+
<ChevronDownIcon className="pointer-events-none absolute top-1/2 right-2.5 size-4 -translate-y-1/2 text-muted-foreground select-none" aria-hidden="true" data-slot="native-select-icon" />
|
|
30
|
+
</div>
|
|
31
|
+
)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function NativeSelectOption({
|
|
35
|
+
className,
|
|
36
|
+
...props
|
|
37
|
+
}: React.ComponentProps<"option">) {
|
|
38
|
+
return (
|
|
39
|
+
<option
|
|
40
|
+
data-slot="native-select-option"
|
|
41
|
+
className={cn("bg-[Canvas] text-[CanvasText]", className)}
|
|
42
|
+
{...props}
|
|
43
|
+
/>
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function NativeSelectOptGroup({
|
|
48
|
+
className,
|
|
49
|
+
...props
|
|
50
|
+
}: React.ComponentProps<"optgroup">) {
|
|
51
|
+
return (
|
|
52
|
+
<optgroup
|
|
53
|
+
data-slot="native-select-optgroup"
|
|
54
|
+
className={cn("bg-[Canvas] text-[CanvasText]", className)}
|
|
55
|
+
{...props}
|
|
56
|
+
/>
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export { NativeSelect, NativeSelectOptGroup, NativeSelectOption }
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { cva } from "class-variance-authority"
|
|
3
|
+
import { cn } from "cn"
|
|
4
|
+
import { NavigationMenu as NavigationMenuPrimitive } from "radix-ui"
|
|
5
|
+
import { ChevronDownIcon } from "lucide-react"
|
|
6
|
+
|
|
7
|
+
function NavigationMenu({
|
|
8
|
+
className,
|
|
9
|
+
children,
|
|
10
|
+
viewport = true,
|
|
11
|
+
...props
|
|
12
|
+
}: React.ComponentProps<typeof NavigationMenuPrimitive.Root> & {
|
|
13
|
+
viewport?: boolean
|
|
14
|
+
}) {
|
|
15
|
+
return (
|
|
16
|
+
<NavigationMenuPrimitive.Root
|
|
17
|
+
data-slot="navigation-menu"
|
|
18
|
+
data-viewport={viewport}
|
|
19
|
+
className={cn(
|
|
20
|
+
"group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",
|
|
21
|
+
className
|
|
22
|
+
)}
|
|
23
|
+
{...props}
|
|
24
|
+
>
|
|
25
|
+
{children}
|
|
26
|
+
{viewport && <NavigationMenuViewport />}
|
|
27
|
+
</NavigationMenuPrimitive.Root>
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function NavigationMenuList({
|
|
32
|
+
className,
|
|
33
|
+
...props
|
|
34
|
+
}: React.ComponentProps<typeof NavigationMenuPrimitive.List>) {
|
|
35
|
+
return (
|
|
36
|
+
<NavigationMenuPrimitive.List
|
|
37
|
+
data-slot="navigation-menu-list"
|
|
38
|
+
className={cn(
|
|
39
|
+
"group flex flex-1 list-none items-center justify-center gap-0",
|
|
40
|
+
className
|
|
41
|
+
)}
|
|
42
|
+
{...props}
|
|
43
|
+
/>
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function NavigationMenuItem({
|
|
48
|
+
className,
|
|
49
|
+
...props
|
|
50
|
+
}: React.ComponentProps<typeof NavigationMenuPrimitive.Item>) {
|
|
51
|
+
return (
|
|
52
|
+
<NavigationMenuPrimitive.Item
|
|
53
|
+
data-slot="navigation-menu-item"
|
|
54
|
+
className={cn("relative", className)}
|
|
55
|
+
{...props}
|
|
56
|
+
/>
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const navigationMenuTriggerStyle = cva(
|
|
61
|
+
"group/navigation-menu-trigger inline-flex h-9 w-max items-center justify-center rounded-lg px-2.5 py-1.5 text-sm font-medium transition-all outline-none hover:bg-muted focus:bg-muted focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-popup-open:bg-muted/50 data-popup-open:hover:bg-muted data-open:bg-muted/50 data-open:hover:bg-muted data-open:focus:bg-muted"
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
function NavigationMenuTrigger({
|
|
65
|
+
className,
|
|
66
|
+
children,
|
|
67
|
+
...props
|
|
68
|
+
}: React.ComponentProps<typeof NavigationMenuPrimitive.Trigger>) {
|
|
69
|
+
return (
|
|
70
|
+
<NavigationMenuPrimitive.Trigger
|
|
71
|
+
data-slot="navigation-menu-trigger"
|
|
72
|
+
className={cn(navigationMenuTriggerStyle(), "group", className)}
|
|
73
|
+
{...props}
|
|
74
|
+
>
|
|
75
|
+
{children}{" "}
|
|
76
|
+
<ChevronDownIcon className="relative top-px ml-1 size-3 transition duration-300 group-data-popup-open/navigation-menu-trigger:rotate-180 group-data-open/navigation-menu-trigger:rotate-180" aria-hidden="true" />
|
|
77
|
+
</NavigationMenuPrimitive.Trigger>
|
|
78
|
+
)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function NavigationMenuContent({
|
|
82
|
+
className,
|
|
83
|
+
...props
|
|
84
|
+
}: React.ComponentProps<typeof NavigationMenuPrimitive.Content>) {
|
|
85
|
+
return (
|
|
86
|
+
<NavigationMenuPrimitive.Content
|
|
87
|
+
data-slot="navigation-menu-content"
|
|
88
|
+
className={cn(
|
|
89
|
+
"top-0 left-0 w-full p-1 ease-[cubic-bezier(0.22,1,0.36,1)] group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-1.5 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-lg group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=false]/navigation-menu:ring-1 group-data-[viewport=false]/navigation-menu:ring-foreground/10 group-data-[viewport=false]/navigation-menu:duration-300 data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 data-[motion^=from-]:animate-in data-[motion^=from-]:fade-in data-[motion^=to-]:animate-out data-[motion^=to-]:fade-out **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none md:absolute md:w-auto group-data-[viewport=false]/navigation-menu:data-open:animate-in group-data-[viewport=false]/navigation-menu:data-open:fade-in-0 group-data-[viewport=false]/navigation-menu:data-open:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-closed:animate-out group-data-[viewport=false]/navigation-menu:data-closed:fade-out-0 group-data-[viewport=false]/navigation-menu:data-closed:zoom-out-95",
|
|
90
|
+
className
|
|
91
|
+
)}
|
|
92
|
+
{...props}
|
|
93
|
+
/>
|
|
94
|
+
)
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function NavigationMenuViewport({
|
|
98
|
+
className,
|
|
99
|
+
...props
|
|
100
|
+
}: React.ComponentProps<typeof NavigationMenuPrimitive.Viewport>) {
|
|
101
|
+
return (
|
|
102
|
+
<div
|
|
103
|
+
className={cn(
|
|
104
|
+
"absolute top-full left-0 isolate z-50 flex justify-center"
|
|
105
|
+
)}
|
|
106
|
+
>
|
|
107
|
+
<NavigationMenuPrimitive.Viewport
|
|
108
|
+
data-slot="navigation-menu-viewport"
|
|
109
|
+
className={cn(
|
|
110
|
+
"origin-top-center relative mt-1.5 h-(--radix-navigation-menu-viewport-height) w-full overflow-hidden rounded-popover bg-popover text-popover-foreground duration-100 md:w-(--radix-navigation-menu-viewport-width) data-open:animate-in data-open:zoom-in-90 data-closed:animate-out data-closed:zoom-out-90 shadow-popover",
|
|
111
|
+
className
|
|
112
|
+
)}
|
|
113
|
+
{...props}
|
|
114
|
+
/>
|
|
115
|
+
</div>
|
|
116
|
+
)
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function NavigationMenuLink({
|
|
120
|
+
className,
|
|
121
|
+
...props
|
|
122
|
+
}: React.ComponentProps<typeof NavigationMenuPrimitive.Link>) {
|
|
123
|
+
return (
|
|
124
|
+
<NavigationMenuPrimitive.Link
|
|
125
|
+
data-slot="navigation-menu-link"
|
|
126
|
+
className={cn(
|
|
127
|
+
"flex items-center gap-2 rounded-lg p-2 text-sm transition-all outline-none hover:bg-muted focus:bg-muted focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-1 in-data-[slot=navigation-menu-content]:rounded-md data-active:bg-muted/50 data-active:hover:bg-muted data-active:focus:bg-muted [&_svg:not([class*='size-'])]:size-4",
|
|
128
|
+
className
|
|
129
|
+
)}
|
|
130
|
+
{...props}
|
|
131
|
+
/>
|
|
132
|
+
)
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function NavigationMenuIndicator({
|
|
136
|
+
className,
|
|
137
|
+
...props
|
|
138
|
+
}: React.ComponentProps<typeof NavigationMenuPrimitive.Indicator>) {
|
|
139
|
+
return (
|
|
140
|
+
<NavigationMenuPrimitive.Indicator
|
|
141
|
+
data-slot="navigation-menu-indicator"
|
|
142
|
+
className={cn(
|
|
143
|
+
"top-full z-1 flex h-1.5 items-end justify-center overflow-hidden data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:animate-in data-[state=visible]:fade-in",
|
|
144
|
+
className
|
|
145
|
+
)}
|
|
146
|
+
{...props}
|
|
147
|
+
>
|
|
148
|
+
<div className="relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md" />
|
|
149
|
+
</NavigationMenuPrimitive.Indicator>
|
|
150
|
+
)
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export {
|
|
154
|
+
NavigationMenu,
|
|
155
|
+
NavigationMenuList,
|
|
156
|
+
NavigationMenuItem,
|
|
157
|
+
NavigationMenuContent,
|
|
158
|
+
NavigationMenuTrigger,
|
|
159
|
+
NavigationMenuLink,
|
|
160
|
+
NavigationMenuIndicator,
|
|
161
|
+
NavigationMenuViewport,
|
|
162
|
+
navigationMenuTriggerStyle,
|
|
163
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { cn } from "cn"
|
|
3
|
+
|
|
4
|
+
import { Button } from "@/components/ui/button"
|
|
5
|
+
import { ChevronLeftIcon, ChevronRightIcon, MoreHorizontalIcon } from "lucide-react"
|
|
6
|
+
|
|
7
|
+
function Pagination({ className, ...props }: React.ComponentProps<"nav">) {
|
|
8
|
+
return (
|
|
9
|
+
<nav
|
|
10
|
+
role="navigation"
|
|
11
|
+
aria-label="pagination"
|
|
12
|
+
data-slot="pagination"
|
|
13
|
+
className={cn("mx-auto flex w-full justify-center", className)}
|
|
14
|
+
{...props}
|
|
15
|
+
/>
|
|
16
|
+
)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function PaginationContent({
|
|
20
|
+
className,
|
|
21
|
+
...props
|
|
22
|
+
}: React.ComponentProps<"ul">) {
|
|
23
|
+
return (
|
|
24
|
+
<ul
|
|
25
|
+
data-slot="pagination-content"
|
|
26
|
+
className={cn("flex items-center gap-0.5", className)}
|
|
27
|
+
{...props}
|
|
28
|
+
/>
|
|
29
|
+
)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function PaginationItem({ ...props }: React.ComponentProps<"li">) {
|
|
33
|
+
return <li data-slot="pagination-item" {...props} />
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
type PaginationLinkProps = {
|
|
37
|
+
isActive?: boolean
|
|
38
|
+
} & Pick<React.ComponentProps<typeof Button>, "size"> &
|
|
39
|
+
React.ComponentProps<"a">
|
|
40
|
+
|
|
41
|
+
function PaginationLink({
|
|
42
|
+
className,
|
|
43
|
+
isActive,
|
|
44
|
+
size = "icon",
|
|
45
|
+
...props
|
|
46
|
+
}: PaginationLinkProps) {
|
|
47
|
+
return (
|
|
48
|
+
<Button
|
|
49
|
+
asChild
|
|
50
|
+
variant={isActive ? "outline" : "ghost"}
|
|
51
|
+
size={size}
|
|
52
|
+
className={cn(className)}
|
|
53
|
+
>
|
|
54
|
+
<a
|
|
55
|
+
aria-current={isActive ? "page" : undefined}
|
|
56
|
+
data-slot="pagination-link"
|
|
57
|
+
data-active={isActive}
|
|
58
|
+
{...props}
|
|
59
|
+
/>
|
|
60
|
+
</Button>
|
|
61
|
+
)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function PaginationPrevious({
|
|
65
|
+
className,
|
|
66
|
+
text = "Previous",
|
|
67
|
+
...props
|
|
68
|
+
}: React.ComponentProps<typeof PaginationLink> & { text?: string }) {
|
|
69
|
+
return (
|
|
70
|
+
<PaginationLink
|
|
71
|
+
aria-label="Go to previous page"
|
|
72
|
+
size="default"
|
|
73
|
+
className={cn("pl-1.5!", className)}
|
|
74
|
+
{...props}
|
|
75
|
+
>
|
|
76
|
+
<ChevronLeftIcon data-icon="inline-start" />
|
|
77
|
+
<span className="hidden sm:block">{text}</span>
|
|
78
|
+
</PaginationLink>
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function PaginationNext({
|
|
83
|
+
className,
|
|
84
|
+
text = "Next",
|
|
85
|
+
...props
|
|
86
|
+
}: React.ComponentProps<typeof PaginationLink> & { text?: string }) {
|
|
87
|
+
return (
|
|
88
|
+
<PaginationLink
|
|
89
|
+
aria-label="Go to next page"
|
|
90
|
+
size="default"
|
|
91
|
+
className={cn("pr-1.5!", className)}
|
|
92
|
+
{...props}
|
|
93
|
+
>
|
|
94
|
+
<span className="hidden sm:block">{text}</span>
|
|
95
|
+
<ChevronRightIcon data-icon="inline-end" />
|
|
96
|
+
</PaginationLink>
|
|
97
|
+
)
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function PaginationEllipsis({
|
|
101
|
+
className,
|
|
102
|
+
...props
|
|
103
|
+
}: React.ComponentProps<"span">) {
|
|
104
|
+
return (
|
|
105
|
+
<span
|
|
106
|
+
aria-hidden
|
|
107
|
+
data-slot="pagination-ellipsis"
|
|
108
|
+
className={cn(
|
|
109
|
+
"flex size-8 items-center justify-center [&_svg:not([class*='size-'])]:size-4",
|
|
110
|
+
className
|
|
111
|
+
)}
|
|
112
|
+
{...props}
|
|
113
|
+
>
|
|
114
|
+
<MoreHorizontalIcon
|
|
115
|
+
/>
|
|
116
|
+
<span className="sr-only">More pages</span>
|
|
117
|
+
</span>
|
|
118
|
+
)
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export {
|
|
122
|
+
Pagination,
|
|
123
|
+
PaginationContent,
|
|
124
|
+
PaginationEllipsis,
|
|
125
|
+
PaginationItem,
|
|
126
|
+
PaginationLink,
|
|
127
|
+
PaginationNext,
|
|
128
|
+
PaginationPrevious,
|
|
129
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { cn } from "cn"
|
|
5
|
+
import { Popover as PopoverPrimitive } from "radix-ui"
|
|
6
|
+
|
|
7
|
+
function Popover({
|
|
8
|
+
...props
|
|
9
|
+
}: React.ComponentProps<typeof PopoverPrimitive.Root>) {
|
|
10
|
+
return <PopoverPrimitive.Root data-slot="popover" {...props} />
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function PopoverTrigger({
|
|
14
|
+
...props
|
|
15
|
+
}: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {
|
|
16
|
+
return <PopoverPrimitive.Trigger data-slot="popover-trigger" {...props} />
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function PopoverContent({
|
|
20
|
+
className,
|
|
21
|
+
align = "center",
|
|
22
|
+
sideOffset = 4,
|
|
23
|
+
...props
|
|
24
|
+
}: React.ComponentProps<typeof PopoverPrimitive.Content>) {
|
|
25
|
+
return (
|
|
26
|
+
<PopoverPrimitive.Portal>
|
|
27
|
+
<PopoverPrimitive.Content
|
|
28
|
+
data-slot="popover-content"
|
|
29
|
+
align={align}
|
|
30
|
+
sideOffset={sideOffset}
|
|
31
|
+
className={cn(
|
|
32
|
+
"z-50 flex w-72 origin-(--radix-popover-content-transform-origin) flex-col gap-2.5 rounded-popover bg-popover p-2.5 text-sm text-popover-foreground outline-hidden duration-100 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 shadow-popover",
|
|
33
|
+
className
|
|
34
|
+
)}
|
|
35
|
+
{...props}
|
|
36
|
+
/>
|
|
37
|
+
</PopoverPrimitive.Portal>
|
|
38
|
+
)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function PopoverAnchor({
|
|
42
|
+
...props
|
|
43
|
+
}: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {
|
|
44
|
+
return <PopoverPrimitive.Anchor data-slot="popover-anchor" {...props} />
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function PopoverHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
48
|
+
return (
|
|
49
|
+
<div
|
|
50
|
+
data-slot="popover-header"
|
|
51
|
+
className={cn("flex flex-col gap-0.5 text-sm", className)}
|
|
52
|
+
{...props}
|
|
53
|
+
/>
|
|
54
|
+
)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function PopoverTitle({ className, ...props }: React.ComponentProps<"h2">) {
|
|
58
|
+
return (
|
|
59
|
+
<div
|
|
60
|
+
data-slot="popover-title"
|
|
61
|
+
className={cn("font-medium", className)}
|
|
62
|
+
{...props}
|
|
63
|
+
/>
|
|
64
|
+
)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function PopoverDescription({
|
|
68
|
+
className,
|
|
69
|
+
...props
|
|
70
|
+
}: React.ComponentProps<"p">) {
|
|
71
|
+
return (
|
|
72
|
+
<p
|
|
73
|
+
data-slot="popover-description"
|
|
74
|
+
className={cn("text-muted-foreground", className)}
|
|
75
|
+
{...props}
|
|
76
|
+
/>
|
|
77
|
+
)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export {
|
|
81
|
+
Popover,
|
|
82
|
+
PopoverAnchor,
|
|
83
|
+
PopoverContent,
|
|
84
|
+
PopoverDescription,
|
|
85
|
+
PopoverHeader,
|
|
86
|
+
PopoverTitle,
|
|
87
|
+
PopoverTrigger,
|
|
88
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { cn } from "cn"
|
|
5
|
+
import { Progress as ProgressPrimitive } from "radix-ui"
|
|
6
|
+
|
|
7
|
+
function Progress({
|
|
8
|
+
className,
|
|
9
|
+
value,
|
|
10
|
+
...props
|
|
11
|
+
}: React.ComponentProps<typeof ProgressPrimitive.Root>) {
|
|
12
|
+
return (
|
|
13
|
+
<ProgressPrimitive.Root
|
|
14
|
+
data-slot="progress"
|
|
15
|
+
className={cn(
|
|
16
|
+
"relative flex h-1 w-full items-center overflow-x-hidden rounded-full bg-muted",
|
|
17
|
+
className
|
|
18
|
+
)}
|
|
19
|
+
{...props}
|
|
20
|
+
>
|
|
21
|
+
<ProgressPrimitive.Indicator
|
|
22
|
+
data-slot="progress-indicator"
|
|
23
|
+
className="size-full flex-1 bg-primary transition-all"
|
|
24
|
+
style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
|
|
25
|
+
/>
|
|
26
|
+
</ProgressPrimitive.Root>
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export { Progress }
|