@webappwiz/arbor 0.0.28 → 0.0.30

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.
Files changed (119) hide show
  1. package/AGENTS.md +7 -0
  2. package/README.md +34 -12
  3. package/add.test.ts +125 -0
  4. package/add.ts +192 -0
  5. package/age.ts +11 -0
  6. package/arbor.test.ts +145 -0
  7. package/arbor.ts +429 -0
  8. package/assets.d.ts +9 -0
  9. package/attachments.ts +87 -0
  10. package/build.ts +98 -0
  11. package/claim.test.ts +89 -0
  12. package/claim.ts +73 -0
  13. package/components.json +21 -0
  14. package/config.ts +58 -0
  15. package/dev/api.ts +120 -0
  16. package/dev/app.test.tsx +645 -0
  17. package/dev/app.tsx +80 -0
  18. package/dev/assets.ts +16 -0
  19. package/dev/build/main.txt +68 -0
  20. package/dev/build/shell.txt +21 -0
  21. package/dev/build/styles.txt +2263 -0
  22. package/dev/components/ui/badge.tsx +51 -0
  23. package/dev/components/ui/button.tsx +57 -0
  24. package/dev/components/ui/dialog.tsx +154 -0
  25. package/dev/components/ui/empty.tsx +100 -0
  26. package/dev/components/ui/input-group.tsx +155 -0
  27. package/dev/components/ui/input.tsx +19 -0
  28. package/dev/components/ui/progress.tsx +80 -0
  29. package/dev/components/ui/textarea.tsx +17 -0
  30. package/dev/components/ui/toast.tsx +227 -0
  31. package/dev/feed.ts +69 -0
  32. package/dev/files.tsx +191 -0
  33. package/dev/index.html +21 -0
  34. package/dev/lib/utils.ts +7 -0
  35. package/dev/main.tsx +22 -0
  36. package/dev/markdown.test.tsx +133 -0
  37. package/dev/markdown.tsx +124 -0
  38. package/dev/mentions.tsx +319 -0
  39. package/dev/shadcn.css +649 -0
  40. package/dev/styles.css +107 -0
  41. package/dev/tags.tsx +44 -0
  42. package/dev/tasks.tsx +151 -0
  43. package/dev/todos.tsx +759 -0
  44. package/dev.test.ts +439 -0
  45. package/dev.ts +386 -0
  46. package/e2e.test.ts +256 -0
  47. package/escalate.test.ts +76 -0
  48. package/escalate.ts +112 -0
  49. package/exit.test.ts +71 -0
  50. package/exit.ts +74 -0
  51. package/git.ts +294 -0
  52. package/index.ts +9 -0
  53. package/journal.ts +89 -0
  54. package/list.test.ts +82 -0
  55. package/list.ts +137 -0
  56. package/load-config.test.ts +121 -0
  57. package/load-config.ts +62 -0
  58. package/log.test.ts +65 -0
  59. package/log.ts +40 -0
  60. package/merge.test.ts +332 -0
  61. package/merge.ts +283 -0
  62. package/package.json +32 -15
  63. package/path.test.ts +35 -0
  64. package/path.ts +38 -0
  65. package/plan.test.ts +318 -0
  66. package/plan.ts +302 -0
  67. package/progress.test.ts +54 -0
  68. package/progress.ts +31 -0
  69. package/remove.test.ts +68 -0
  70. package/remove.ts +88 -0
  71. package/repository.ts +83 -0
  72. package/retry.test.ts +43 -0
  73. package/retry.ts +48 -0
  74. package/shell.ts +44 -0
  75. package/show.test.ts +91 -0
  76. package/show.ts +151 -0
  77. package/snapshot.test.ts +33 -0
  78. package/snapshot.ts +84 -0
  79. package/table.ts +20 -0
  80. package/testing.ts +229 -0
  81. package/todo.test.ts +490 -0
  82. package/todo.ts +834 -0
  83. package/wait.test.ts +61 -0
  84. package/wait.ts +77 -0
  85. package/worktree-service.test.ts +158 -0
  86. package/worktree-service.ts +193 -0
  87. package/worktree.ts +239 -0
  88. package/add.d.ts +0 -23
  89. package/age.d.ts +0 -2
  90. package/arbor.d.ts +0 -11
  91. package/attachments.d.ts +0 -36
  92. package/claim.d.ts +0 -11
  93. package/config.d.ts +0 -55
  94. package/config.js +0 -7
  95. package/dev/assets.d.ts +0 -11
  96. package/dev.d.ts +0 -47
  97. package/escalate.d.ts +0 -28
  98. package/exit.d.ts +0 -42
  99. package/git.d.ts +0 -77
  100. package/index.d.ts +0 -2
  101. package/index.js +0 -4669
  102. package/journal.d.ts +0 -29
  103. package/list.d.ts +0 -18
  104. package/load-config.d.ts +0 -15
  105. package/log.d.ts +0 -14
  106. package/merge.d.ts +0 -24
  107. package/path.d.ts +0 -13
  108. package/plan.d.ts +0 -83
  109. package/remove.d.ts +0 -19
  110. package/repository.d.ts +0 -25
  111. package/retry.d.ts +0 -17
  112. package/shell.d.ts +0 -17
  113. package/show.d.ts +0 -53
  114. package/snapshot.d.ts +0 -31
  115. package/table.d.ts +0 -5
  116. package/todo.d.ts +0 -230
  117. package/wait.d.ts +0 -22
  118. package/worktree-service.d.ts +0 -51
  119. package/worktree.d.ts +0 -95
@@ -0,0 +1,51 @@
1
+ import { mergeProps } from "@base-ui/react/merge-props";
2
+ import { useRender } from "@base-ui/react/use-render";
3
+ import { cva, type VariantProps } from "class-variance-authority";
4
+ import { cn } from "#dev/lib/utils.ts";
5
+
6
+ const badgeVariants = cva(
7
+ "group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",
8
+ {
9
+ variants: {
10
+ variant: {
11
+ default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
12
+ secondary:
13
+ "bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",
14
+ destructive:
15
+ "bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",
16
+ outline:
17
+ "border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",
18
+ ghost:
19
+ "hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",
20
+ link: "text-primary underline-offset-4 hover:underline",
21
+ },
22
+ },
23
+ defaultVariants: {
24
+ variant: "default",
25
+ },
26
+ },
27
+ );
28
+
29
+ function Badge({
30
+ className,
31
+ variant = "default",
32
+ render,
33
+ ...props
34
+ }: useRender.ComponentProps<"span"> & VariantProps<typeof badgeVariants>) {
35
+ return useRender({
36
+ defaultTagName: "span",
37
+ props: mergeProps<"span">(
38
+ {
39
+ className: cn(badgeVariants({ variant }), className),
40
+ },
41
+ props,
42
+ ),
43
+ render,
44
+ state: {
45
+ slot: "badge",
46
+ variant,
47
+ },
48
+ });
49
+ }
50
+
51
+ export { Badge, badgeVariants };
@@ -0,0 +1,57 @@
1
+ import { Button as ButtonPrimitive } from "@base-ui/react/button";
2
+ import { cva, type VariantProps } from "class-variance-authority";
3
+ import { cn } from "#dev/lib/utils.ts";
4
+
5
+ const buttonVariants = cva(
6
+ "group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
7
+ {
8
+ variants: {
9
+ variant: {
10
+ default: "bg-primary text-primary-foreground hover:bg-primary/80",
11
+ outline:
12
+ "border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
13
+ secondary:
14
+ "bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
15
+ ghost:
16
+ "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
17
+ destructive:
18
+ "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
19
+ link: "text-primary underline-offset-4 hover:underline",
20
+ },
21
+ size: {
22
+ default:
23
+ "h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
24
+ xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
25
+ sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
26
+ lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
27
+ icon: "size-8",
28
+ "icon-xs":
29
+ "size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
30
+ "icon-sm":
31
+ "size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg",
32
+ "icon-lg": "size-9",
33
+ },
34
+ },
35
+ defaultVariants: {
36
+ variant: "default",
37
+ size: "default",
38
+ },
39
+ },
40
+ );
41
+
42
+ function Button({
43
+ className,
44
+ variant = "default",
45
+ size = "default",
46
+ ...props
47
+ }: ButtonPrimitive.Props & VariantProps<typeof buttonVariants>) {
48
+ return (
49
+ <ButtonPrimitive
50
+ data-slot="button"
51
+ className={cn(buttonVariants({ variant, size, className }))}
52
+ {...props}
53
+ />
54
+ );
55
+ }
56
+
57
+ export { Button, buttonVariants };
@@ -0,0 +1,154 @@
1
+ import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
2
+ import { XIcon } from "lucide-react";
3
+ import * as React from "react";
4
+
5
+ import { Button } from "#dev/components/ui/button.tsx";
6
+ import { cn } from "#dev/lib/utils.ts";
7
+
8
+ function Dialog({ ...props }: DialogPrimitive.Root.Props) {
9
+ return <DialogPrimitive.Root data-slot="dialog" {...props} />;
10
+ }
11
+
12
+ function DialogTrigger({ ...props }: DialogPrimitive.Trigger.Props) {
13
+ return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />;
14
+ }
15
+
16
+ function DialogPortal({ ...props }: DialogPrimitive.Portal.Props) {
17
+ return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />;
18
+ }
19
+
20
+ function DialogClose({ ...props }: DialogPrimitive.Close.Props) {
21
+ return <DialogPrimitive.Close data-slot="dialog-close" {...props} />;
22
+ }
23
+
24
+ function DialogOverlay({
25
+ className,
26
+ ...props
27
+ }: DialogPrimitive.Backdrop.Props) {
28
+ return (
29
+ <DialogPrimitive.Backdrop
30
+ data-slot="dialog-overlay"
31
+ className={cn(
32
+ "fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
33
+ className,
34
+ )}
35
+ {...props}
36
+ />
37
+ );
38
+ }
39
+
40
+ function DialogContent({
41
+ className,
42
+ children,
43
+ showCloseButton = true,
44
+ ...props
45
+ }: DialogPrimitive.Popup.Props & {
46
+ showCloseButton?: boolean;
47
+ }) {
48
+ return (
49
+ <DialogPortal>
50
+ <DialogOverlay />
51
+ <DialogPrimitive.Popup
52
+ data-slot="dialog-content"
53
+ className={cn(
54
+ "fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm 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",
55
+ className,
56
+ )}
57
+ {...props}
58
+ >
59
+ {children}
60
+ {showCloseButton && (
61
+ <DialogPrimitive.Close
62
+ data-slot="dialog-close"
63
+ render={
64
+ <Button
65
+ variant="ghost"
66
+ className="absolute top-2 right-2"
67
+ size="icon-sm"
68
+ />
69
+ }
70
+ >
71
+ <XIcon />
72
+ <span className="sr-only">Close</span>
73
+ </DialogPrimitive.Close>
74
+ )}
75
+ </DialogPrimitive.Popup>
76
+ </DialogPortal>
77
+ );
78
+ }
79
+
80
+ function DialogHeader({ className, ...props }: React.ComponentProps<"div">) {
81
+ return (
82
+ <div
83
+ data-slot="dialog-header"
84
+ className={cn("flex flex-col gap-2", className)}
85
+ {...props}
86
+ />
87
+ );
88
+ }
89
+
90
+ function DialogFooter({
91
+ className,
92
+ showCloseButton = false,
93
+ children,
94
+ ...props
95
+ }: React.ComponentProps<"div"> & {
96
+ showCloseButton?: boolean;
97
+ }) {
98
+ return (
99
+ <div
100
+ data-slot="dialog-footer"
101
+ className={cn(
102
+ "-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end",
103
+ className,
104
+ )}
105
+ {...props}
106
+ >
107
+ {children}
108
+ {showCloseButton && (
109
+ <DialogPrimitive.Close render={<Button variant="outline" />}>
110
+ Close
111
+ </DialogPrimitive.Close>
112
+ )}
113
+ </div>
114
+ );
115
+ }
116
+
117
+ function DialogTitle({ className, ...props }: DialogPrimitive.Title.Props) {
118
+ return (
119
+ <DialogPrimitive.Title
120
+ data-slot="dialog-title"
121
+ className={cn("text-base leading-none font-medium", className)}
122
+ {...props}
123
+ />
124
+ );
125
+ }
126
+
127
+ function DialogDescription({
128
+ className,
129
+ ...props
130
+ }: DialogPrimitive.Description.Props) {
131
+ return (
132
+ <DialogPrimitive.Description
133
+ data-slot="dialog-description"
134
+ className={cn(
135
+ "text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",
136
+ className,
137
+ )}
138
+ {...props}
139
+ />
140
+ );
141
+ }
142
+
143
+ export {
144
+ Dialog,
145
+ DialogClose,
146
+ DialogContent,
147
+ DialogDescription,
148
+ DialogFooter,
149
+ DialogHeader,
150
+ DialogOverlay,
151
+ DialogPortal,
152
+ DialogTitle,
153
+ DialogTrigger,
154
+ };
@@ -0,0 +1,100 @@
1
+ import { cva, type VariantProps } from "class-variance-authority";
2
+ import { cn } from "#dev/lib/utils.ts";
3
+
4
+ function Empty({ className, ...props }: React.ComponentProps<"div">) {
5
+ return (
6
+ <div
7
+ data-slot="empty"
8
+ className={cn(
9
+ "flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-xl border-dashed p-6 text-center text-balance",
10
+ className,
11
+ )}
12
+ {...props}
13
+ />
14
+ );
15
+ }
16
+
17
+ function EmptyHeader({ className, ...props }: React.ComponentProps<"div">) {
18
+ return (
19
+ <div
20
+ data-slot="empty-header"
21
+ className={cn("flex max-w-sm flex-col items-center gap-2", className)}
22
+ {...props}
23
+ />
24
+ );
25
+ }
26
+
27
+ const emptyMediaVariants = cva(
28
+ "mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0",
29
+ {
30
+ variants: {
31
+ variant: {
32
+ default: "bg-transparent",
33
+ icon: "flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-4",
34
+ },
35
+ },
36
+ defaultVariants: {
37
+ variant: "default",
38
+ },
39
+ },
40
+ );
41
+
42
+ function EmptyMedia({
43
+ className,
44
+ variant = "default",
45
+ ...props
46
+ }: React.ComponentProps<"div"> & VariantProps<typeof emptyMediaVariants>) {
47
+ return (
48
+ <div
49
+ data-slot="empty-icon"
50
+ data-variant={variant}
51
+ className={cn(emptyMediaVariants({ variant, className }))}
52
+ {...props}
53
+ />
54
+ );
55
+ }
56
+
57
+ function EmptyTitle({ className, ...props }: React.ComponentProps<"div">) {
58
+ return (
59
+ <div
60
+ data-slot="empty-title"
61
+ className={cn("text-sm font-medium tracking-tight", className)}
62
+ {...props}
63
+ />
64
+ );
65
+ }
66
+
67
+ function EmptyDescription({ className, ...props }: React.ComponentProps<"p">) {
68
+ return (
69
+ <div
70
+ data-slot="empty-description"
71
+ className={cn(
72
+ "text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",
73
+ className,
74
+ )}
75
+ {...props}
76
+ />
77
+ );
78
+ }
79
+
80
+ function EmptyContent({ className, ...props }: React.ComponentProps<"div">) {
81
+ return (
82
+ <div
83
+ data-slot="empty-content"
84
+ className={cn(
85
+ "flex w-full max-w-sm min-w-0 flex-col items-center gap-2.5 text-sm text-balance",
86
+ className,
87
+ )}
88
+ {...props}
89
+ />
90
+ );
91
+ }
92
+
93
+ export {
94
+ Empty,
95
+ EmptyContent,
96
+ EmptyDescription,
97
+ EmptyHeader,
98
+ EmptyMedia,
99
+ EmptyTitle,
100
+ };
@@ -0,0 +1,155 @@
1
+ import { cva, type VariantProps } from "class-variance-authority";
2
+ import type * as React from "react";
3
+ import { Button } from "#dev/components/ui/button.tsx";
4
+ import { Input } from "#dev/components/ui/input.tsx";
5
+ import { Textarea } from "#dev/components/ui/textarea.tsx";
6
+ import { cn } from "#dev/lib/utils.ts";
7
+
8
+ function InputGroup({ className, ...props }: React.ComponentProps<"div">) {
9
+ return (
10
+ <div
11
+ data-slot="input-group"
12
+ role="group"
13
+ className={cn(
14
+ "group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",
15
+ className,
16
+ )}
17
+ {...props}
18
+ />
19
+ );
20
+ }
21
+
22
+ const inputGroupAddonVariants = cva(
23
+ "flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",
24
+ {
25
+ variants: {
26
+ align: {
27
+ "inline-start":
28
+ "order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]",
29
+ "inline-end":
30
+ "order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]",
31
+ "block-start":
32
+ "order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2",
33
+ "block-end":
34
+ "order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2",
35
+ },
36
+ },
37
+ defaultVariants: {
38
+ align: "inline-start",
39
+ },
40
+ },
41
+ );
42
+
43
+ function InputGroupAddon({
44
+ className,
45
+ align = "inline-start",
46
+ ...props
47
+ }: React.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>) {
48
+ return (
49
+ <div
50
+ role="group"
51
+ data-slot="input-group-addon"
52
+ data-align={align}
53
+ className={cn(inputGroupAddonVariants({ align }), className)}
54
+ onClick={(e) => {
55
+ if ((e.target as HTMLElement).closest("button")) {
56
+ return;
57
+ }
58
+ e.currentTarget.parentElement?.querySelector("input")?.focus();
59
+ }}
60
+ {...props}
61
+ />
62
+ );
63
+ }
64
+
65
+ const inputGroupButtonVariants = cva(
66
+ "flex items-center gap-2 text-sm shadow-none",
67
+ {
68
+ variants: {
69
+ size: {
70
+ xs: "h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5",
71
+ sm: "",
72
+ "icon-xs":
73
+ "size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0",
74
+ "icon-sm": "size-8 p-0 has-[>svg]:p-0",
75
+ },
76
+ },
77
+ defaultVariants: {
78
+ size: "xs",
79
+ },
80
+ },
81
+ );
82
+
83
+ function InputGroupButton({
84
+ className,
85
+ type = "button",
86
+ variant = "ghost",
87
+ size = "xs",
88
+ ...props
89
+ }: Omit<React.ComponentProps<typeof Button>, "size" | "type"> &
90
+ VariantProps<typeof inputGroupButtonVariants> & {
91
+ type?: "button" | "submit" | "reset";
92
+ }) {
93
+ return (
94
+ <Button
95
+ type={type}
96
+ data-size={size}
97
+ variant={variant}
98
+ className={cn(inputGroupButtonVariants({ size }), className)}
99
+ {...props}
100
+ />
101
+ );
102
+ }
103
+
104
+ function InputGroupText({ className, ...props }: React.ComponentProps<"span">) {
105
+ return (
106
+ <span
107
+ className={cn(
108
+ "flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
109
+ className,
110
+ )}
111
+ {...props}
112
+ />
113
+ );
114
+ }
115
+
116
+ function InputGroupInput({
117
+ className,
118
+ ...props
119
+ }: React.ComponentProps<"input">) {
120
+ return (
121
+ <Input
122
+ data-slot="input-group-control"
123
+ className={cn(
124
+ "flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent",
125
+ className,
126
+ )}
127
+ {...props}
128
+ />
129
+ );
130
+ }
131
+
132
+ function InputGroupTextarea({
133
+ className,
134
+ ...props
135
+ }: React.ComponentProps<"textarea">) {
136
+ return (
137
+ <Textarea
138
+ data-slot="input-group-control"
139
+ className={cn(
140
+ "flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent",
141
+ className,
142
+ )}
143
+ {...props}
144
+ />
145
+ );
146
+ }
147
+
148
+ export {
149
+ InputGroup,
150
+ InputGroupAddon,
151
+ InputGroupButton,
152
+ InputGroupInput,
153
+ InputGroupText,
154
+ InputGroupTextarea,
155
+ };
@@ -0,0 +1,19 @@
1
+ import { Input as InputPrimitive } from "@base-ui/react/input";
2
+ import type * as React from "react";
3
+ import { cn } from "#dev/lib/utils.ts";
4
+
5
+ function Input({ className, type, ...props }: React.ComponentProps<"input">) {
6
+ return (
7
+ <InputPrimitive
8
+ type={type}
9
+ data-slot="input"
10
+ className={cn(
11
+ "h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",
12
+ className,
13
+ )}
14
+ {...props}
15
+ />
16
+ );
17
+ }
18
+
19
+ export { Input };
@@ -0,0 +1,80 @@
1
+ import { Progress as ProgressPrimitive } from "@base-ui/react/progress";
2
+ import { cn } from "#dev/lib/utils.ts";
3
+
4
+ function Progress({
5
+ className,
6
+ children,
7
+ value,
8
+ ...props
9
+ }: ProgressPrimitive.Root.Props) {
10
+ return (
11
+ <ProgressPrimitive.Root
12
+ value={value}
13
+ data-slot="progress"
14
+ className={cn("flex flex-wrap gap-3", className)}
15
+ {...props}
16
+ >
17
+ {children}
18
+ <ProgressTrack>
19
+ <ProgressIndicator />
20
+ </ProgressTrack>
21
+ </ProgressPrimitive.Root>
22
+ );
23
+ }
24
+
25
+ function ProgressTrack({ className, ...props }: ProgressPrimitive.Track.Props) {
26
+ return (
27
+ <ProgressPrimitive.Track
28
+ className={cn(
29
+ "relative flex h-1 w-full items-center overflow-x-hidden rounded-full bg-muted",
30
+ className,
31
+ )}
32
+ data-slot="progress-track"
33
+ {...props}
34
+ />
35
+ );
36
+ }
37
+
38
+ function ProgressIndicator({
39
+ className,
40
+ ...props
41
+ }: ProgressPrimitive.Indicator.Props) {
42
+ return (
43
+ <ProgressPrimitive.Indicator
44
+ data-slot="progress-indicator"
45
+ className={cn("h-full bg-primary transition-all", className)}
46
+ {...props}
47
+ />
48
+ );
49
+ }
50
+
51
+ function ProgressLabel({ className, ...props }: ProgressPrimitive.Label.Props) {
52
+ return (
53
+ <ProgressPrimitive.Label
54
+ className={cn("text-sm font-medium", className)}
55
+ data-slot="progress-label"
56
+ {...props}
57
+ />
58
+ );
59
+ }
60
+
61
+ function ProgressValue({ className, ...props }: ProgressPrimitive.Value.Props) {
62
+ return (
63
+ <ProgressPrimitive.Value
64
+ className={cn(
65
+ "ml-auto text-sm text-muted-foreground tabular-nums",
66
+ className,
67
+ )}
68
+ data-slot="progress-value"
69
+ {...props}
70
+ />
71
+ );
72
+ }
73
+
74
+ export {
75
+ Progress,
76
+ ProgressIndicator,
77
+ ProgressLabel,
78
+ ProgressTrack,
79
+ ProgressValue,
80
+ };
@@ -0,0 +1,17 @@
1
+ import type * as React from "react";
2
+ import { cn } from "#dev/lib/utils.ts";
3
+
4
+ function Textarea({ className, ...props }: React.ComponentProps<"textarea">) {
5
+ return (
6
+ <textarea
7
+ data-slot="textarea"
8
+ className={cn(
9
+ "flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",
10
+ className,
11
+ )}
12
+ {...props}
13
+ />
14
+ );
15
+ }
16
+
17
+ export { Textarea };