Skip to content

Commit 1c4a5a4

Browse files
authored
fix: auto-resize comment textarea as content is typed (#220)
1 parent 1cb9828 commit 1c4a5a4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+16686
-882
lines changed

README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,17 @@ Then, put this in your React app:
217217
218218
```tsx
219219
import { useState } from "react";
220-
import { getElementContext, freeze, unfreeze, openFile, type ReactGrabElementContext } from "react-grab/primitives";
221-
222-
const useElementSelector = (onSelect: (context: ReactGrabElementContext) => void) => {
220+
import {
221+
getElementContext,
222+
freeze,
223+
unfreeze,
224+
openFile,
225+
type ReactGrabElementContext,
226+
} from "react-grab/primitives";
227+
228+
const useElementSelector = (
229+
onSelect: (context: ReactGrabElementContext) => void,
230+
) => {
223231
const [isActive, setIsActive] = useState(false);
224232
225233
const startSelecting = () => {

packages/cli/src/utils/transform.ts

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -787,13 +787,28 @@ export const previewTransform = (
787787
);
788788

789789
case "vite":
790-
return transformVite(projectRoot, agent, reactGrabAlreadyConfigured, force);
790+
return transformVite(
791+
projectRoot,
792+
agent,
793+
reactGrabAlreadyConfigured,
794+
force,
795+
);
791796

792797
case "tanstack":
793-
return transformTanStack(projectRoot, agent, reactGrabAlreadyConfigured, force);
798+
return transformTanStack(
799+
projectRoot,
800+
agent,
801+
reactGrabAlreadyConfigured,
802+
force,
803+
);
794804

795805
case "webpack":
796-
return transformWebpack(projectRoot, agent, reactGrabAlreadyConfigured, force);
806+
return transformWebpack(
807+
projectRoot,
808+
agent,
809+
reactGrabAlreadyConfigured,
810+
force,
811+
);
797812

798813
default:
799814
return {

packages/demo/components/dashboard.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,14 @@ export function Dashboard() {
118118
</SelectContent>
119119
</Select>
120120
{/* BUG: Export button uses ghost variant — nearly invisible in dark mode */}
121-
<Button size="sm" variant="ghost" className="" onClick={() => { throw new Error("exportDashboard is not a function"); }}>
121+
<Button
122+
size="sm"
123+
variant="ghost"
124+
className=""
125+
onClick={() => {
126+
throw new Error("exportDashboard is not a function");
127+
}}
128+
>
122129
Export
123130
</Button>
124131
</div>

packages/demo/components/ui/badge.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import * as React from "react"
2-
import { Slot } from "@radix-ui/react-slot"
3-
import { cva, type VariantProps } from "class-variance-authority"
1+
import * as React from "react";
2+
import { Slot } from "@radix-ui/react-slot";
3+
import { cva, type VariantProps } from "class-variance-authority";
44

5-
import { cn } from "@/lib/utils"
5+
import { cn } from "@/lib/utils";
66

77
const badgeVariants = cva(
88
"inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",
@@ -22,8 +22,8 @@ const badgeVariants = cva(
2222
defaultVariants: {
2323
variant: "default",
2424
},
25-
}
26-
)
25+
},
26+
);
2727

2828
function Badge({
2929
className,
@@ -32,15 +32,15 @@ function Badge({
3232
...props
3333
}: React.ComponentProps<"span"> &
3434
VariantProps<typeof badgeVariants> & { asChild?: boolean }) {
35-
const Comp = asChild ? Slot : "span"
35+
const Comp = asChild ? Slot : "span";
3636

3737
return (
3838
<Comp
3939
data-slot="badge"
4040
className={cn(badgeVariants({ variant }), className)}
4141
{...props}
4242
/>
43-
)
43+
);
4444
}
4545

46-
export { Badge, badgeVariants }
46+
export { Badge, badgeVariants };

packages/demo/components/ui/button.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import * as React from "react"
2-
import { Slot } from "@radix-ui/react-slot"
3-
import { cva, type VariantProps } from "class-variance-authority"
1+
import * as React from "react";
2+
import { Slot } from "@radix-ui/react-slot";
3+
import { cva, type VariantProps } from "class-variance-authority";
44

5-
import { cn } from "@/lib/utils"
5+
import { cn } from "@/lib/utils";
66

77
const buttonVariants = cva(
88
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
@@ -33,8 +33,8 @@ const buttonVariants = cva(
3333
variant: "default",
3434
size: "default",
3535
},
36-
}
37-
)
36+
},
37+
);
3838

3939
function Button({
4040
className,
@@ -44,17 +44,17 @@ function Button({
4444
...props
4545
}: React.ComponentProps<"button"> &
4646
VariantProps<typeof buttonVariants> & {
47-
asChild?: boolean
47+
asChild?: boolean;
4848
}) {
49-
const Comp = asChild ? Slot : "button"
49+
const Comp = asChild ? Slot : "button";
5050

5151
return (
5252
<Comp
5353
data-slot="button"
5454
className={cn(buttonVariants({ variant, size, className }))}
5555
{...props}
5656
/>
57-
)
57+
);
5858
}
5959

60-
export { Button, buttonVariants }
60+
export { Button, buttonVariants };
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
import * as React from "react"
1+
import * as React from "react";
22

3-
import { cn } from "@/lib/utils"
3+
import { cn } from "@/lib/utils";
44

55
function Card({ className, ...props }: React.ComponentProps<"div">) {
66
return (
77
<div
88
data-slot="card"
99
className={cn(
1010
"bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",
11-
className
11+
className,
1212
)}
1313
{...props}
1414
/>
15-
)
15+
);
1616
}
1717

1818
function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
@@ -21,11 +21,11 @@ function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
2121
data-slot="card-header"
2222
className={cn(
2323
"@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",
24-
className
24+
className,
2525
)}
2626
{...props}
2727
/>
28-
)
28+
);
2929
}
3030

3131
function CardTitle({ className, ...props }: React.ComponentProps<"div">) {
@@ -35,7 +35,7 @@ function CardTitle({ className, ...props }: React.ComponentProps<"div">) {
3535
className={cn("leading-none font-semibold", className)}
3636
{...props}
3737
/>
38-
)
38+
);
3939
}
4040

4141
function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
@@ -45,7 +45,7 @@ function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
4545
className={cn("text-muted-foreground text-sm", className)}
4646
{...props}
4747
/>
48-
)
48+
);
4949
}
5050

5151
function CardAction({ className, ...props }: React.ComponentProps<"div">) {
@@ -54,11 +54,11 @@ function CardAction({ className, ...props }: React.ComponentProps<"div">) {
5454
data-slot="card-action"
5555
className={cn(
5656
"col-start-2 row-span-2 row-start-1 self-start justify-self-end",
57-
className
57+
className,
5858
)}
5959
{...props}
6060
/>
61-
)
61+
);
6262
}
6363

6464
function CardContent({ className, ...props }: React.ComponentProps<"div">) {
@@ -68,7 +68,7 @@ function CardContent({ className, ...props }: React.ComponentProps<"div">) {
6868
className={cn("px-6", className)}
6969
{...props}
7070
/>
71-
)
71+
);
7272
}
7373

7474
function CardFooter({ className, ...props }: React.ComponentProps<"div">) {
@@ -78,7 +78,7 @@ function CardFooter({ className, ...props }: React.ComponentProps<"div">) {
7878
className={cn("flex items-center px-6 [.border-t]:pt-6", className)}
7979
{...props}
8080
/>
81-
)
81+
);
8282
}
8383

8484
export {
@@ -89,4 +89,4 @@ export {
8989
CardAction,
9090
CardDescription,
9191
CardContent,
92-
}
92+
};
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import * as React from "react"
1+
import * as React from "react";
22

3-
import { cn } from "@/lib/utils"
3+
import { cn } from "@/lib/utils";
44

55
function Input({ className, type, ...props }: React.ComponentProps<"input">) {
66
return (
@@ -11,11 +11,11 @@ function Input({ className, type, ...props }: React.ComponentProps<"input">) {
1111
"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
1212
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
1313
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
14-
className
14+
className,
1515
)}
1616
{...props}
1717
/>
18-
)
18+
);
1919
}
2020

21-
export { Input }
21+
export { Input };

0 commit comments

Comments
 (0)