@multicomma/arkcn 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/README.md +78 -0
- package/bin/arkcn.mjs +78 -0
- package/cli/commands.mjs +251 -0
- package/cli/project.mjs +168 -0
- package/cli/registry.mjs +50 -0
- package/cli/ui.mjs +46 -0
- package/mcp/server.mjs +149 -0
- package/package.json +201 -0
- package/registry/base.css +680 -0
- package/registry/index.json +1833 -0
- package/registry/items/accordion.json +18 -0
- package/registry/items/activity-feed.json +18 -0
- package/registry/items/alert-dialog.json +18 -0
- package/registry/items/alert.json +17 -0
- package/registry/items/angle-slider.json +17 -0
- package/registry/items/app-shell.json +28 -0
- package/registry/items/aspect-ratio.json +13 -0
- package/registry/items/attachment.json +19 -0
- package/registry/items/avatar.json +17 -0
- package/registry/items/badge.json +18 -0
- package/registry/items/breadcrumb.json +18 -0
- package/registry/items/bubble.json +18 -0
- package/registry/items/button-group.json +19 -0
- package/registry/items/button.json +18 -0
- package/registry/items/calendar.json +19 -0
- package/registry/items/canvas.json +24 -0
- package/registry/items/card.json +15 -0
- package/registry/items/carousel.json +19 -0
- package/registry/items/cascader.json +23 -0
- package/registry/items/chart.json +17 -0
- package/registry/items/chat.json +23 -0
- package/registry/items/checkbox.json +18 -0
- package/registry/items/clipboard.json +19 -0
- package/registry/items/collapsible.json +15 -0
- package/registry/items/color-picker.json +19 -0
- package/registry/items/combobox.json +20 -0
- package/registry/items/command.json +21 -0
- package/registry/items/comment-thread.json +25 -0
- package/registry/items/context-menu.json +18 -0
- package/registry/items/controllable.json +14 -0
- package/registry/items/data-grid.json +24 -0
- package/registry/items/data-table-adapter.json +14 -0
- package/registry/items/data-table.json +32 -0
- package/registry/items/date-input.json +17 -0
- package/registry/items/dialog.json +19 -0
- package/registry/items/direction.json +13 -0
- package/registry/items/drag-preview.json +16 -0
- package/registry/items/drawer.json +18 -0
- package/registry/items/dropdown-menu.json +18 -0
- package/registry/items/editable.json +17 -0
- package/registry/items/empty.json +17 -0
- package/registry/items/field.json +19 -0
- package/registry/items/file-upload.json +19 -0
- package/registry/items/floating-panel.json +19 -0
- package/registry/items/floating-toolbar.json +16 -0
- package/registry/items/form.json +14 -0
- package/registry/items/format.json +15 -0
- package/registry/items/gantt.json +22 -0
- package/registry/items/history.json +14 -0
- package/registry/items/hotkeys.json +18 -0
- package/registry/items/hover-card.json +17 -0
- package/registry/items/image-cropper.json +17 -0
- package/registry/items/input-group.json +20 -0
- package/registry/items/input-otp.json +18 -0
- package/registry/items/input.json +15 -0
- package/registry/items/item.json +19 -0
- package/registry/items/json-tree-view.json +17 -0
- package/registry/items/kanban.json +26 -0
- package/registry/items/kbd.json +15 -0
- package/registry/items/label.json +15 -0
- package/registry/items/live-region.json +16 -0
- package/registry/items/marker.json +18 -0
- package/registry/items/marquee.json +17 -0
- package/registry/items/menubar.json +19 -0
- package/registry/items/message.json +15 -0
- package/registry/items/navigation-menu.json +19 -0
- package/registry/items/node-graph.json +22 -0
- package/registry/items/number-input.json +18 -0
- package/registry/items/pagination.json +18 -0
- package/registry/items/password-input.json +18 -0
- package/registry/items/popconfirm.json +20 -0
- package/registry/items/popover.json +18 -0
- package/registry/items/progress.json +17 -0
- package/registry/items/qr-code.json +17 -0
- package/registry/items/query-builder.json +23 -0
- package/registry/items/radio-group.json +17 -0
- package/registry/items/rating-group.json +18 -0
- package/registry/items/resizable.json +17 -0
- package/registry/items/rich-text-editor.json +37 -0
- package/registry/items/row-layout.json +15 -0
- package/registry/items/scheduler.json +23 -0
- package/registry/items/scroll-area.json +17 -0
- package/registry/items/segment-group.json +17 -0
- package/registry/items/select.json +19 -0
- package/registry/items/separator.json +15 -0
- package/registry/items/sheet.json +19 -0
- package/registry/items/sidebar.json +27 -0
- package/registry/items/signature-pad.json +19 -0
- package/registry/items/skeleton.json +15 -0
- package/registry/items/slider.json +17 -0
- package/registry/items/sonner.json +17 -0
- package/registry/items/spinner.json +17 -0
- package/registry/items/steps.json +19 -0
- package/registry/items/swap.json +17 -0
- package/registry/items/switch.json +17 -0
- package/registry/items/table.json +16 -0
- package/registry/items/tabs.json +18 -0
- package/registry/items/tags-input.json +18 -0
- package/registry/items/textarea.json +15 -0
- package/registry/items/time.json +14 -0
- package/registry/items/timer.json +18 -0
- package/registry/items/toc.json +17 -0
- package/registry/items/toggle-group.json +19 -0
- package/registry/items/toggle.json +18 -0
- package/registry/items/tooltip.json +17 -0
- package/registry/items/tour.json +19 -0
- package/registry/items/transfer-list.json +24 -0
- package/registry/items/tree-select.json +24 -0
- package/registry/items/tree-view.json +18 -0
- package/registry/items/use-mobile.json +13 -0
- package/registry/items/utils.json +17 -0
- package/registry/items/virtual-list.json +16 -0
- package/src/components/ui/accordion.tsx +111 -0
- package/src/components/ui/activity-feed.tsx +228 -0
- package/src/components/ui/alert-dialog.tsx +204 -0
- package/src/components/ui/alert.tsx +55 -0
- package/src/components/ui/angle-slider.tsx +117 -0
- package/src/components/ui/app-shell.tsx +985 -0
- package/src/components/ui/aspect-ratio.tsx +35 -0
- package/src/components/ui/attachment.tsx +193 -0
- package/src/components/ui/avatar.tsx +94 -0
- package/src/components/ui/badge.tsx +45 -0
- package/src/components/ui/breadcrumb.tsx +93 -0
- package/src/components/ui/bubble.tsx +119 -0
- package/src/components/ui/button-group.tsx +79 -0
- package/src/components/ui/button.tsx +65 -0
- package/src/components/ui/calendar.tsx +172 -0
- package/src/components/ui/canvas.tsx +723 -0
- package/src/components/ui/card.tsx +69 -0
- package/src/components/ui/carousel.tsx +228 -0
- package/src/components/ui/cascader.tsx +754 -0
- package/src/components/ui/chart.tsx +303 -0
- package/src/components/ui/chat.tsx +544 -0
- package/src/components/ui/checkbox.tsx +94 -0
- package/src/components/ui/clipboard.tsx +94 -0
- package/src/components/ui/collapsible.tsx +32 -0
- package/src/components/ui/color-picker.tsx +441 -0
- package/src/components/ui/combobox.tsx +400 -0
- package/src/components/ui/command.tsx +292 -0
- package/src/components/ui/comment-thread.tsx +923 -0
- package/src/components/ui/context-menu.tsx +331 -0
- package/src/components/ui/data-grid.tsx +1227 -0
- package/src/components/ui/data-table.tsx +993 -0
- package/src/components/ui/date-input.tsx +103 -0
- package/src/components/ui/dialog.tsx +159 -0
- package/src/components/ui/direction.tsx +32 -0
- package/src/components/ui/drawer.tsx +200 -0
- package/src/components/ui/dropdown-menu.tsx +329 -0
- package/src/components/ui/editable.tsx +90 -0
- package/src/components/ui/empty.tsx +86 -0
- package/src/components/ui/field.tsx +218 -0
- package/src/components/ui/file-upload.tsx +204 -0
- package/src/components/ui/floating-panel.tsx +199 -0
- package/src/components/ui/floating-toolbar.tsx +79 -0
- package/src/components/ui/format.tsx +22 -0
- package/src/components/ui/gantt.tsx +950 -0
- package/src/components/ui/hotkeys.tsx +340 -0
- package/src/components/ui/hover-card.tsx +83 -0
- package/src/components/ui/image-cropper.tsx +100 -0
- package/src/components/ui/input-group.tsx +133 -0
- package/src/components/ui/input-otp.tsx +82 -0
- package/src/components/ui/input.tsx +18 -0
- package/src/components/ui/item.tsx +174 -0
- package/src/components/ui/json-tree-view.tsx +37 -0
- package/src/components/ui/kanban.tsx +884 -0
- package/src/components/ui/kbd.tsx +20 -0
- package/src/components/ui/label.tsx +30 -0
- package/src/components/ui/live-region.tsx +54 -0
- package/src/components/ui/marker.tsx +66 -0
- package/src/components/ui/marquee.tsx +61 -0
- package/src/components/ui/menubar.tsx +456 -0
- package/src/components/ui/message.tsx +74 -0
- package/src/components/ui/navigation-menu.tsx +202 -0
- package/src/components/ui/node-graph.tsx +1723 -0
- package/src/components/ui/number-input.tsx +148 -0
- package/src/components/ui/pagination.tsx +88 -0
- package/src/components/ui/password-input.tsx +104 -0
- package/src/components/ui/popconfirm.tsx +149 -0
- package/src/components/ui/popover.tsx +126 -0
- package/src/components/ui/progress.tsx +114 -0
- package/src/components/ui/qr-code.tsx +51 -0
- package/src/components/ui/query-builder.tsx +938 -0
- package/src/components/ui/radio-group.tsx +108 -0
- package/src/components/ui/rating-group.tsx +91 -0
- package/src/components/ui/resizable.tsx +41 -0
- package/src/components/ui/rich-text-editor.tsx +845 -0
- package/src/components/ui/scheduler.tsx +1164 -0
- package/src/components/ui/scroll-area.tsx +82 -0
- package/src/components/ui/segment-group.tsx +95 -0
- package/src/components/ui/select.tsx +354 -0
- package/src/components/ui/separator.tsx +32 -0
- package/src/components/ui/sheet.tsx +130 -0
- package/src/components/ui/sidebar.tsx +665 -0
- package/src/components/ui/signature-pad.tsx +112 -0
- package/src/components/ui/skeleton.tsx +7 -0
- package/src/components/ui/slider.tsx +183 -0
- package/src/components/ui/sonner.tsx +37 -0
- package/src/components/ui/spinner.tsx +16 -0
- package/src/components/ui/steps.tsx +152 -0
- package/src/components/ui/swap.tsx +33 -0
- package/src/components/ui/switch.tsx +83 -0
- package/src/components/ui/table.tsx +72 -0
- package/src/components/ui/tabs.tsx +100 -0
- package/src/components/ui/tags-input.tsx +153 -0
- package/src/components/ui/textarea.tsx +17 -0
- package/src/components/ui/timer.tsx +67 -0
- package/src/components/ui/toc.tsx +64 -0
- package/src/components/ui/toggle-group.tsx +89 -0
- package/src/components/ui/toggle.tsx +46 -0
- package/src/components/ui/tooltip.tsx +113 -0
- package/src/components/ui/tour.tsx +168 -0
- package/src/components/ui/transfer-list.tsx +700 -0
- package/src/components/ui/tree-select.tsx +638 -0
- package/src/components/ui/tree-view.tsx +217 -0
- package/src/components/ui/virtual-list.tsx +343 -0
- package/src/hooks/use-mobile.ts +19 -0
- package/src/lib/controllable.ts +31 -0
- package/src/lib/data-table-adapter.ts +67 -0
- package/src/lib/drag-preview.ts +39 -0
- package/src/lib/form.ts +39 -0
- package/src/lib/history.ts +55 -0
- package/src/lib/row-layout.ts +81 -0
- package/src/lib/table.ts +483 -0
- package/src/lib/time.ts +37 -0
- package/src/lib/utils.ts +6 -0
- package/src/styles/arkcn.css +764 -0
- package/src/styles/index.css +3 -0
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { cn } from "@/lib/utils"
|
|
5
|
+
import { NumberInput as NumberInputPrimitive } from "@ark-ui/react"
|
|
6
|
+
import { ChevronDownIcon, ChevronUpIcon } from "lucide-react"
|
|
7
|
+
|
|
8
|
+
function NumberInput({ className, children, ...props }: React.ComponentProps<typeof NumberInputPrimitive.Root>) {
|
|
9
|
+
return (
|
|
10
|
+
<NumberInputPrimitive.Root
|
|
11
|
+
data-slot="number-input"
|
|
12
|
+
className={cn("flex w-full flex-col gap-1.5", className)}
|
|
13
|
+
{...props}
|
|
14
|
+
>
|
|
15
|
+
{children ?? (
|
|
16
|
+
<NumberInputControl>
|
|
17
|
+
<NumberInputInput />
|
|
18
|
+
<NumberInputTriggers />
|
|
19
|
+
</NumberInputControl>
|
|
20
|
+
)}
|
|
21
|
+
</NumberInputPrimitive.Root>
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function NumberInputContext({ ...props }: React.ComponentProps<typeof NumberInputPrimitive.Context>) {
|
|
26
|
+
return <NumberInputPrimitive.Context {...props} />
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function NumberInputLabel({ className, ...props }: React.ComponentProps<typeof NumberInputPrimitive.Label>) {
|
|
30
|
+
return (
|
|
31
|
+
<NumberInputPrimitive.Label
|
|
32
|
+
data-slot="number-input-label"
|
|
33
|
+
className={cn("text-sm font-medium select-none", className)}
|
|
34
|
+
{...props}
|
|
35
|
+
/>
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function NumberInputControl({ className, ...props }: React.ComponentProps<typeof NumberInputPrimitive.Control>) {
|
|
40
|
+
return (
|
|
41
|
+
<NumberInputPrimitive.Control
|
|
42
|
+
data-slot="number-input-control"
|
|
43
|
+
className={cn(
|
|
44
|
+
"flex h-8 w-full min-w-0 items-stretch overflow-hidden rounded-lg border border-input bg-transparent transition-colors has-focus-visible:border-ring has-focus-visible:ring-3 has-focus-visible:ring-ring/50 data-invalid:border-destructive data-invalid:ring-3 data-invalid:ring-destructive/20 dark:bg-input/30 dark:data-invalid:border-destructive/50 dark:data-invalid:ring-destructive/40 data-disabled:pointer-events-none data-disabled:opacity-50",
|
|
45
|
+
className
|
|
46
|
+
)}
|
|
47
|
+
{...props}
|
|
48
|
+
/>
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** `id` is omitted: set part ids through the root `ids` prop so Ark's internal lookups keep working. */
|
|
53
|
+
function NumberInputInput({
|
|
54
|
+
className,
|
|
55
|
+
...props
|
|
56
|
+
}: Omit<React.ComponentProps<typeof NumberInputPrimitive.Input>, "id">) {
|
|
57
|
+
return (
|
|
58
|
+
<NumberInputPrimitive.Input
|
|
59
|
+
data-slot="number-input-input"
|
|
60
|
+
className={cn(
|
|
61
|
+
"min-w-0 flex-1 bg-transparent px-2.5 py-1 text-base outline-none placeholder:text-muted-foreground md:text-sm",
|
|
62
|
+
className
|
|
63
|
+
)}
|
|
64
|
+
{...props}
|
|
65
|
+
/>
|
|
66
|
+
)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function NumberInputTriggers({ className, ...props }: React.ComponentProps<"div">) {
|
|
70
|
+
return (
|
|
71
|
+
<div
|
|
72
|
+
data-slot="number-input-triggers"
|
|
73
|
+
className={cn("flex w-6 flex-col border-l border-input", className)}
|
|
74
|
+
{...props}
|
|
75
|
+
>
|
|
76
|
+
<NumberInputIncrementTrigger />
|
|
77
|
+
<NumberInputDecrementTrigger />
|
|
78
|
+
</div>
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const triggerClassName =
|
|
83
|
+
"flex flex-1 items-center justify-center text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-3"
|
|
84
|
+
|
|
85
|
+
function NumberInputIncrementTrigger({
|
|
86
|
+
className,
|
|
87
|
+
children,
|
|
88
|
+
...props
|
|
89
|
+
}: React.ComponentProps<typeof NumberInputPrimitive.IncrementTrigger>) {
|
|
90
|
+
return (
|
|
91
|
+
<NumberInputPrimitive.IncrementTrigger
|
|
92
|
+
data-slot="number-input-increment-trigger"
|
|
93
|
+
className={cn(triggerClassName, "border-b border-input", className)}
|
|
94
|
+
{...props}
|
|
95
|
+
>
|
|
96
|
+
{children ?? <ChevronUpIcon />}
|
|
97
|
+
</NumberInputPrimitive.IncrementTrigger>
|
|
98
|
+
)
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function NumberInputDecrementTrigger({
|
|
102
|
+
className,
|
|
103
|
+
children,
|
|
104
|
+
...props
|
|
105
|
+
}: React.ComponentProps<typeof NumberInputPrimitive.DecrementTrigger>) {
|
|
106
|
+
return (
|
|
107
|
+
<NumberInputPrimitive.DecrementTrigger
|
|
108
|
+
data-slot="number-input-decrement-trigger"
|
|
109
|
+
className={cn(triggerClassName, className)}
|
|
110
|
+
{...props}
|
|
111
|
+
>
|
|
112
|
+
{children ?? <ChevronDownIcon />}
|
|
113
|
+
</NumberInputPrimitive.DecrementTrigger>
|
|
114
|
+
)
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function NumberInputScrubber({ className, ...props }: React.ComponentProps<typeof NumberInputPrimitive.Scrubber>) {
|
|
118
|
+
return (
|
|
119
|
+
<NumberInputPrimitive.Scrubber
|
|
120
|
+
data-slot="number-input-scrubber"
|
|
121
|
+
className={cn("cursor-ew-resize select-none", className)}
|
|
122
|
+
{...props}
|
|
123
|
+
/>
|
|
124
|
+
)
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function NumberInputValueText({ className, ...props }: React.ComponentProps<typeof NumberInputPrimitive.ValueText>) {
|
|
128
|
+
return (
|
|
129
|
+
<NumberInputPrimitive.ValueText
|
|
130
|
+
data-slot="number-input-value-text"
|
|
131
|
+
className={cn("text-sm text-muted-foreground", className)}
|
|
132
|
+
{...props}
|
|
133
|
+
/>
|
|
134
|
+
)
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export {
|
|
138
|
+
NumberInput,
|
|
139
|
+
NumberInputContext,
|
|
140
|
+
NumberInputControl,
|
|
141
|
+
NumberInputDecrementTrigger,
|
|
142
|
+
NumberInputIncrementTrigger,
|
|
143
|
+
NumberInputInput,
|
|
144
|
+
NumberInputLabel,
|
|
145
|
+
NumberInputScrubber,
|
|
146
|
+
NumberInputTriggers,
|
|
147
|
+
NumberInputValueText,
|
|
148
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { cn } from "@/lib/utils"
|
|
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({ className, ...props }: React.ComponentProps<"ul">) {
|
|
20
|
+
return <ul data-slot="pagination-content" className={cn("flex items-center gap-0.5", className)} {...props} />
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function PaginationItem({ ...props }: React.ComponentProps<"li">) {
|
|
24
|
+
return <li data-slot="pagination-item" {...props} />
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
type PaginationLinkProps = {
|
|
28
|
+
isActive?: boolean
|
|
29
|
+
} & Pick<React.ComponentProps<typeof Button>, "size"> &
|
|
30
|
+
React.ComponentProps<"a">
|
|
31
|
+
|
|
32
|
+
function PaginationLink({ className, isActive, size = "icon", ...props }: PaginationLinkProps) {
|
|
33
|
+
return (
|
|
34
|
+
<Button asChild variant={isActive ? "outline" : "ghost"} size={size} className={cn(className)}>
|
|
35
|
+
<a aria-current={isActive ? "page" : undefined} data-slot="pagination-link" data-active={isActive} {...props} />
|
|
36
|
+
</Button>
|
|
37
|
+
)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function PaginationPrevious({
|
|
41
|
+
className,
|
|
42
|
+
text = "Previous",
|
|
43
|
+
...props
|
|
44
|
+
}: React.ComponentProps<typeof PaginationLink> & { text?: string }) {
|
|
45
|
+
return (
|
|
46
|
+
<PaginationLink aria-label="Go to previous page" size="default" className={cn("pl-1.5!", className)} {...props}>
|
|
47
|
+
<ChevronLeftIcon data-icon="inline-start" />
|
|
48
|
+
<span className="hidden sm:block">{text}</span>
|
|
49
|
+
</PaginationLink>
|
|
50
|
+
)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function PaginationNext({
|
|
54
|
+
className,
|
|
55
|
+
text = "Next",
|
|
56
|
+
...props
|
|
57
|
+
}: React.ComponentProps<typeof PaginationLink> & { text?: string }) {
|
|
58
|
+
return (
|
|
59
|
+
<PaginationLink aria-label="Go to next page" size="default" className={cn("pr-1.5!", className)} {...props}>
|
|
60
|
+
<span className="hidden sm:block">{text}</span>
|
|
61
|
+
<ChevronRightIcon data-icon="inline-end" />
|
|
62
|
+
</PaginationLink>
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function PaginationEllipsis({ className, ...props }: React.ComponentProps<"span">) {
|
|
67
|
+
return (
|
|
68
|
+
<span
|
|
69
|
+
aria-hidden
|
|
70
|
+
data-slot="pagination-ellipsis"
|
|
71
|
+
className={cn("flex size-8 items-center justify-center [&_svg:not([class*='size-'])]:size-4", className)}
|
|
72
|
+
{...props}
|
|
73
|
+
>
|
|
74
|
+
<MoreHorizontalIcon />
|
|
75
|
+
<span className="sr-only">More pages</span>
|
|
76
|
+
</span>
|
|
77
|
+
)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export {
|
|
81
|
+
Pagination,
|
|
82
|
+
PaginationContent,
|
|
83
|
+
PaginationEllipsis,
|
|
84
|
+
PaginationItem,
|
|
85
|
+
PaginationLink,
|
|
86
|
+
PaginationNext,
|
|
87
|
+
PaginationPrevious,
|
|
88
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { cn } from "@/lib/utils"
|
|
5
|
+
import { PasswordInput as PasswordInputPrimitive } from "@ark-ui/react"
|
|
6
|
+
import { EyeIcon, EyeOffIcon } from "lucide-react"
|
|
7
|
+
|
|
8
|
+
function PasswordInput({ className, children, ...props }: React.ComponentProps<typeof PasswordInputPrimitive.Root>) {
|
|
9
|
+
return (
|
|
10
|
+
<PasswordInputPrimitive.Root
|
|
11
|
+
data-slot="password-input"
|
|
12
|
+
className={cn("flex w-full flex-col gap-1.5", className)}
|
|
13
|
+
{...props}
|
|
14
|
+
>
|
|
15
|
+
{children ?? (
|
|
16
|
+
<PasswordInputControl>
|
|
17
|
+
<PasswordInputInput />
|
|
18
|
+
<PasswordInputVisibilityTrigger />
|
|
19
|
+
</PasswordInputControl>
|
|
20
|
+
)}
|
|
21
|
+
</PasswordInputPrimitive.Root>
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function PasswordInputContext({ ...props }: React.ComponentProps<typeof PasswordInputPrimitive.Context>) {
|
|
26
|
+
return <PasswordInputPrimitive.Context {...props} />
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function PasswordInputLabel({ className, ...props }: React.ComponentProps<typeof PasswordInputPrimitive.Label>) {
|
|
30
|
+
return (
|
|
31
|
+
<PasswordInputPrimitive.Label
|
|
32
|
+
data-slot="password-input-label"
|
|
33
|
+
className={cn("text-sm font-medium select-none", className)}
|
|
34
|
+
{...props}
|
|
35
|
+
/>
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function PasswordInputControl({ className, ...props }: React.ComponentProps<typeof PasswordInputPrimitive.Control>) {
|
|
40
|
+
return (
|
|
41
|
+
<PasswordInputPrimitive.Control
|
|
42
|
+
data-slot="password-input-control"
|
|
43
|
+
className={cn(
|
|
44
|
+
"flex h-8 w-full min-w-0 items-center rounded-lg border border-input bg-transparent pr-1 transition-colors has-focus-visible:border-ring has-focus-visible:ring-3 has-focus-visible:ring-ring/50 data-invalid:border-destructive data-invalid:ring-3 data-invalid:ring-destructive/20 dark:bg-input/30 dark:data-invalid:border-destructive/50 dark:data-invalid:ring-destructive/40 data-disabled:pointer-events-none data-disabled:opacity-50",
|
|
45
|
+
className
|
|
46
|
+
)}
|
|
47
|
+
{...props}
|
|
48
|
+
/>
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** `id` is omitted: set part ids through the root `ids` prop so Ark's internal lookups keep working. */
|
|
53
|
+
function PasswordInputInput({
|
|
54
|
+
className,
|
|
55
|
+
...props
|
|
56
|
+
}: Omit<React.ComponentProps<typeof PasswordInputPrimitive.Input>, "id">) {
|
|
57
|
+
return (
|
|
58
|
+
<PasswordInputPrimitive.Input
|
|
59
|
+
data-slot="password-input-input"
|
|
60
|
+
className={cn(
|
|
61
|
+
"min-w-0 flex-1 bg-transparent px-2.5 py-1 text-base outline-none placeholder:text-muted-foreground md:text-sm",
|
|
62
|
+
className
|
|
63
|
+
)}
|
|
64
|
+
{...props}
|
|
65
|
+
/>
|
|
66
|
+
)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function PasswordInputVisibilityTrigger({
|
|
70
|
+
className,
|
|
71
|
+
children,
|
|
72
|
+
...props
|
|
73
|
+
}: React.ComponentProps<typeof PasswordInputPrimitive.VisibilityTrigger>) {
|
|
74
|
+
return (
|
|
75
|
+
<PasswordInputPrimitive.VisibilityTrigger
|
|
76
|
+
data-slot="password-input-visibility-trigger"
|
|
77
|
+
className={cn(
|
|
78
|
+
"inline-flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-none [&_svg]:size-4",
|
|
79
|
+
className
|
|
80
|
+
)}
|
|
81
|
+
{...props}
|
|
82
|
+
>
|
|
83
|
+
{children ?? (
|
|
84
|
+
<PasswordInputIndicator fallback={<EyeOffIcon />}>
|
|
85
|
+
<EyeIcon />
|
|
86
|
+
</PasswordInputIndicator>
|
|
87
|
+
)}
|
|
88
|
+
</PasswordInputPrimitive.VisibilityTrigger>
|
|
89
|
+
)
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function PasswordInputIndicator({ ...props }: React.ComponentProps<typeof PasswordInputPrimitive.Indicator>) {
|
|
93
|
+
return <PasswordInputPrimitive.Indicator data-slot="password-input-indicator" {...props} />
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export {
|
|
97
|
+
PasswordInput,
|
|
98
|
+
PasswordInputContext,
|
|
99
|
+
PasswordInputControl,
|
|
100
|
+
PasswordInputIndicator,
|
|
101
|
+
PasswordInputInput,
|
|
102
|
+
PasswordInputLabel,
|
|
103
|
+
PasswordInputVisibilityTrigger,
|
|
104
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { AlertTriangleIcon } from "lucide-react"
|
|
3
|
+
import { Button } from "@/components/ui/button"
|
|
4
|
+
import { Popover, PopoverArrow, PopoverClose, PopoverContent, PopoverTrigger } from "@/components/ui/popover"
|
|
5
|
+
import { cn } from "@/lib/utils"
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Popconfirm — a lightweight inline confirmation on Ark's Popover, for
|
|
9
|
+
* actions that need a "are you sure?" without a modal dialog. Compose it:
|
|
10
|
+
* `Popconfirm` > `PopconfirmTrigger` + `PopconfirmContent` > (`PopconfirmHeader` >
|
|
11
|
+
* `PopconfirmIcon` + `PopconfirmTitle` + `PopconfirmDescription`) + `PopconfirmFooter` >
|
|
12
|
+
* `PopconfirmCancelTrigger` + `PopconfirmConfirmTrigger`. `PopconfirmConfirmTrigger` closes after `onConfirm`
|
|
13
|
+
* unless the handler calls `event.preventDefault()`.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
function Popconfirm({ positioning, ...props }: React.ComponentProps<typeof Popover>) {
|
|
17
|
+
return <Popover data-slot="popconfirm" positioning={{ placement: "top", gutter: 8, ...positioning }} {...props} />
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function PopconfirmTrigger({ ...props }: React.ComponentProps<typeof PopoverTrigger>) {
|
|
21
|
+
return <PopoverTrigger data-slot="popconfirm-trigger" {...props} />
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function PopconfirmContent({
|
|
25
|
+
className,
|
|
26
|
+
children,
|
|
27
|
+
showArrow = true,
|
|
28
|
+
...props
|
|
29
|
+
}: React.ComponentProps<typeof PopoverContent> & { showArrow?: boolean }) {
|
|
30
|
+
return (
|
|
31
|
+
<PopoverContent
|
|
32
|
+
data-slot="popconfirm-content"
|
|
33
|
+
role="alertdialog"
|
|
34
|
+
className={cn("w-72 gap-3 p-3", className)}
|
|
35
|
+
{...props}
|
|
36
|
+
>
|
|
37
|
+
{showArrow && <PopoverArrow />}
|
|
38
|
+
{children}
|
|
39
|
+
</PopoverContent>
|
|
40
|
+
)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function PopconfirmHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
44
|
+
return (
|
|
45
|
+
<div
|
|
46
|
+
data-slot="popconfirm-header"
|
|
47
|
+
className={cn(
|
|
48
|
+
"grid grid-cols-[auto_1fr] gap-x-0 gap-y-0.5 has-[>[data-slot=popconfirm-icon]]:gap-x-2",
|
|
49
|
+
className
|
|
50
|
+
)}
|
|
51
|
+
{...props}
|
|
52
|
+
/>
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function PopconfirmIcon({ className, children, ...props }: React.ComponentProps<"span">) {
|
|
57
|
+
return (
|
|
58
|
+
<span
|
|
59
|
+
data-slot="popconfirm-icon"
|
|
60
|
+
className={cn(
|
|
61
|
+
"row-span-2 mt-0.5 flex size-5 items-center justify-center text-destructive [&_svg]:size-4",
|
|
62
|
+
className
|
|
63
|
+
)}
|
|
64
|
+
{...props}
|
|
65
|
+
>
|
|
66
|
+
{children ?? <AlertTriangleIcon />}
|
|
67
|
+
</span>
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function PopconfirmTitle({ className, ...props }: React.ComponentProps<"p">) {
|
|
72
|
+
return (
|
|
73
|
+
<p data-slot="popconfirm-title" className={cn("col-start-2 text-sm/tight font-semibold", className)} {...props} />
|
|
74
|
+
)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function PopconfirmDescription({ className, ...props }: React.ComponentProps<"p">) {
|
|
78
|
+
return (
|
|
79
|
+
<p
|
|
80
|
+
data-slot="popconfirm-description"
|
|
81
|
+
className={cn("col-start-2 text-xs text-muted-foreground", className)}
|
|
82
|
+
{...props}
|
|
83
|
+
/>
|
|
84
|
+
)
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function PopconfirmFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
88
|
+
return (
|
|
89
|
+
<div data-slot="popconfirm-footer" className={cn("flex items-center justify-end gap-2", className)} {...props} />
|
|
90
|
+
)
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function PopconfirmCancelTrigger({
|
|
94
|
+
variant = "outline",
|
|
95
|
+
size = "sm",
|
|
96
|
+
children = "Cancel",
|
|
97
|
+
...props
|
|
98
|
+
}: React.ComponentProps<typeof Button>) {
|
|
99
|
+
return (
|
|
100
|
+
<PopoverClose asChild>
|
|
101
|
+
<Button data-slot="popconfirm-cancel-trigger" variant={variant} size={size} {...props}>
|
|
102
|
+
{children}
|
|
103
|
+
</Button>
|
|
104
|
+
</PopoverClose>
|
|
105
|
+
)
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function PopconfirmConfirmTrigger({
|
|
109
|
+
variant = "destructive",
|
|
110
|
+
size = "sm",
|
|
111
|
+
onConfirm,
|
|
112
|
+
onClick,
|
|
113
|
+
children = "Confirm",
|
|
114
|
+
...props
|
|
115
|
+
}: React.ComponentProps<typeof Button> & {
|
|
116
|
+
/** Runs on click; call `event.preventDefault()` to keep the popconfirm open. */
|
|
117
|
+
onConfirm?: (event: React.MouseEvent<HTMLButtonElement>) => void
|
|
118
|
+
}) {
|
|
119
|
+
const [stayOpen, setStayOpen] = React.useState(false)
|
|
120
|
+
const button = (
|
|
121
|
+
<Button
|
|
122
|
+
data-slot="popconfirm-confirm-trigger"
|
|
123
|
+
variant={variant}
|
|
124
|
+
size={size}
|
|
125
|
+
onClick={(event) => {
|
|
126
|
+
onClick?.(event)
|
|
127
|
+
onConfirm?.(event)
|
|
128
|
+
setStayOpen(event.defaultPrevented)
|
|
129
|
+
}}
|
|
130
|
+
{...props}
|
|
131
|
+
>
|
|
132
|
+
{children}
|
|
133
|
+
</Button>
|
|
134
|
+
)
|
|
135
|
+
return stayOpen ? button : <PopoverClose asChild>{button}</PopoverClose>
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export {
|
|
139
|
+
Popconfirm,
|
|
140
|
+
PopconfirmCancelTrigger,
|
|
141
|
+
PopconfirmConfirmTrigger,
|
|
142
|
+
PopconfirmContent,
|
|
143
|
+
PopconfirmDescription,
|
|
144
|
+
PopconfirmFooter,
|
|
145
|
+
PopconfirmHeader,
|
|
146
|
+
PopconfirmIcon,
|
|
147
|
+
PopconfirmTitle,
|
|
148
|
+
PopconfirmTrigger,
|
|
149
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { cn } from "@/lib/utils"
|
|
3
|
+
import { ChevronDownIcon } from "lucide-react"
|
|
4
|
+
import { Popover as PopoverPrimitive, Portal as PortalPrimitive } from "@ark-ui/react"
|
|
5
|
+
|
|
6
|
+
function Popover({
|
|
7
|
+
positioning,
|
|
8
|
+
lazyMount = true,
|
|
9
|
+
unmountOnExit = true,
|
|
10
|
+
...props
|
|
11
|
+
}: React.ComponentProps<typeof PopoverPrimitive.Root>) {
|
|
12
|
+
return (
|
|
13
|
+
<PopoverPrimitive.Root
|
|
14
|
+
positioning={{ placement: "bottom", gutter: 4, ...positioning }}
|
|
15
|
+
lazyMount={lazyMount}
|
|
16
|
+
unmountOnExit={unmountOnExit}
|
|
17
|
+
{...props}
|
|
18
|
+
/>
|
|
19
|
+
)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function PopoverTrigger({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {
|
|
23
|
+
return <PopoverPrimitive.Trigger data-slot="popover-trigger" {...props} />
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function PopoverPortal({ ...props }: React.ComponentProps<typeof PortalPrimitive>) {
|
|
27
|
+
return <PortalPrimitive {...props} />
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function PopoverContext({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Context>) {
|
|
31
|
+
return <PopoverPrimitive.Context {...props} />
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function PopoverPositioner({ className, ...props }: React.ComponentProps<typeof PopoverPrimitive.Positioner>) {
|
|
35
|
+
return (
|
|
36
|
+
<PopoverPrimitive.Positioner
|
|
37
|
+
data-slot="popover-positioner"
|
|
38
|
+
className={cn("[--z-index:50]", className)}
|
|
39
|
+
{...props}
|
|
40
|
+
/>
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function PopoverContent({ className, ...props }: React.ComponentProps<typeof PopoverPrimitive.Content>) {
|
|
45
|
+
return (
|
|
46
|
+
<PopoverPortal>
|
|
47
|
+
<PopoverPositioner>
|
|
48
|
+
<PopoverPrimitive.Content
|
|
49
|
+
data-slot="popover-content"
|
|
50
|
+
className={cn(
|
|
51
|
+
"z-50 flex w-72 origin-(--transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 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",
|
|
52
|
+
className
|
|
53
|
+
)}
|
|
54
|
+
{...props}
|
|
55
|
+
/>
|
|
56
|
+
</PopoverPositioner>
|
|
57
|
+
</PopoverPortal>
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function PopoverAnchor({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {
|
|
62
|
+
return <PopoverPrimitive.Anchor data-slot="popover-anchor" {...props} />
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function PopoverArrow({ className, ...props }: React.ComponentProps<typeof PopoverPrimitive.Arrow>) {
|
|
66
|
+
return (
|
|
67
|
+
<PopoverPrimitive.Arrow
|
|
68
|
+
data-slot="popover-arrow"
|
|
69
|
+
className={cn("[--arrow-background:var(--color-popover)] [--arrow-size:0.625rem]", className)}
|
|
70
|
+
{...props}
|
|
71
|
+
>
|
|
72
|
+
<PopoverPrimitive.ArrowTip data-slot="popover-arrow-tip" className="border-t border-l border-foreground/10" />
|
|
73
|
+
</PopoverPrimitive.Arrow>
|
|
74
|
+
)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function PopoverClose({ ...props }: React.ComponentProps<typeof PopoverPrimitive.CloseTrigger>) {
|
|
78
|
+
return <PopoverPrimitive.CloseTrigger data-slot="popover-close" {...props} />
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function PopoverHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
82
|
+
return <div data-slot="popover-header" className={cn("flex flex-col gap-0.5 text-sm", className)} {...props} />
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function PopoverTitle({ className, ...props }: React.ComponentProps<typeof PopoverPrimitive.Title>) {
|
|
86
|
+
return <PopoverPrimitive.Title data-slot="popover-title" className={cn("font-medium", className)} {...props} />
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function PopoverDescription({ className, ...props }: React.ComponentProps<typeof PopoverPrimitive.Description>) {
|
|
90
|
+
return (
|
|
91
|
+
<PopoverPrimitive.Description
|
|
92
|
+
data-slot="popover-description"
|
|
93
|
+
className={cn("text-muted-foreground", className)}
|
|
94
|
+
{...props}
|
|
95
|
+
/>
|
|
96
|
+
)
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/** Open-state indicator for a trigger; rotates when open. */
|
|
100
|
+
function PopoverIndicator({ className, children, ...props }: React.ComponentProps<typeof PopoverPrimitive.Indicator>) {
|
|
101
|
+
return (
|
|
102
|
+
<PopoverPrimitive.Indicator
|
|
103
|
+
data-slot="popover-indicator"
|
|
104
|
+
className={cn("inline-flex transition-transform data-[state=open]:rotate-180 [&_svg]:size-4", className)}
|
|
105
|
+
{...props}
|
|
106
|
+
>
|
|
107
|
+
{children ?? <ChevronDownIcon />}
|
|
108
|
+
</PopoverPrimitive.Indicator>
|
|
109
|
+
)
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export {
|
|
113
|
+
Popover,
|
|
114
|
+
PopoverAnchor,
|
|
115
|
+
PopoverArrow,
|
|
116
|
+
PopoverClose,
|
|
117
|
+
PopoverContent,
|
|
118
|
+
PopoverContext,
|
|
119
|
+
PopoverDescription,
|
|
120
|
+
PopoverHeader,
|
|
121
|
+
PopoverPortal,
|
|
122
|
+
PopoverPositioner,
|
|
123
|
+
PopoverTitle,
|
|
124
|
+
PopoverTrigger,
|
|
125
|
+
PopoverIndicator,
|
|
126
|
+
}
|