Skip to content

Commit be43a2b

Browse files
Merge pull request #504 from gridaco/canary
chore: update components use
2 parents 9d1c93a + fc7cf71 commit be43a2b

File tree

46 files changed

+800
-698
lines changed

Some content is hidden

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

46 files changed

+800
-698
lines changed

editor/app/(dev)/canvas/tools/ai/_components/preset-save.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import {
88
DialogTitle,
99
DialogTrigger,
1010
} from "@/components/ui/dialog";
11+
import { Field, FieldGroup, FieldLabel } from "@/components/ui/field";
1112
import { Input } from "@/components/ui/input";
12-
import { Label } from "@/components/ui/label";
1313

1414
export function PresetSave({ disabled }: { disabled?: boolean }) {
1515
return (
@@ -27,16 +27,16 @@ export function PresetSave({ disabled }: { disabled?: boolean }) {
2727
can access later or share with others.
2828
</DialogDescription>
2929
</DialogHeader>
30-
<div className="grid gap-4 py-4">
31-
<div className="grid gap-2">
32-
<Label htmlFor="name">Name</Label>
30+
<FieldGroup className="py-4 gap-4">
31+
<Field>
32+
<FieldLabel htmlFor="name">Name</FieldLabel>
3333
<Input id="name" autoFocus />
34-
</div>
35-
<div className="grid gap-2">
36-
<Label htmlFor="description">Description</Label>
34+
</Field>
35+
<Field>
36+
<FieldLabel htmlFor="description">Description</FieldLabel>
3737
<Input id="description" />
38-
</div>
39-
</div>
38+
</Field>
39+
</FieldGroup>
4040
<DialogFooter>
4141
<Button type="submit">Save</Button>
4242
</DialogFooter>

editor/app/(dev)/canvas/tools/ai/_components/preset-share.tsx

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { Copy } from "lucide-react";
22

33
import { Button } from "@/components/ui/button";
4+
import { Field, FieldLabel } from "@/components/ui/field";
45
import { Input } from "@/components/ui/input";
5-
import { Label } from "@/components/ui/label";
66
import {
77
Popover,
88
PopoverContent,
@@ -27,15 +27,17 @@ export function PresetShare({ disabled }: { disabled?: boolean }) {
2727
</div>
2828
<div className="flex items-center space-x-2 pt-4">
2929
<div className="grid flex-1 gap-2">
30-
<Label htmlFor="link" className="sr-only">
31-
Link
32-
</Label>
33-
<Input
34-
id="link"
35-
defaultValue="https://platform.openai.com/playground/p/7bbKYQvsVkNmVb8NGcdUOLae?model=text-davinci-003"
36-
readOnly
37-
className="h-9"
38-
/>
30+
<Field>
31+
<FieldLabel htmlFor="link" className="sr-only">
32+
Link
33+
</FieldLabel>
34+
<Input
35+
id="link"
36+
defaultValue="https://platform.openai.com/playground/p/7bbKYQvsVkNmVb8NGcdUOLae?model=text-davinci-003"
37+
readOnly
38+
className="h-9"
39+
/>
40+
</Field>
3941
</div>
4042
<Button type="submit" size="sm" className="px-3">
4143
<span className="sr-only">Copy</span>

editor/app/(dev)/canvas/tools/ai/page.tsx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { PresetSelector } from "./_components/preset-selector";
99
import { PresetShare } from "./_components/preset-share";
1010
import { presets } from "./_data/presets";
1111
import { ModelParams } from "./_components/model-params";
12-
import { Label } from "@/components/ui/label";
12+
import { Field, FieldLabel } from "@/components/ui/field";
1313
import { MinimalChatBox } from "@/components/chat";
1414
import { readStreamableValue } from "@ai-sdk/rsc";
1515
import { Canvas } from "./_components/canvas";
@@ -108,39 +108,39 @@ export default function PlaygroundPage() {
108108
/>
109109
<ModelParams />
110110
</div>
111-
<div className="flex-1 flex flex-col gap-2">
112-
<Label className="text-sm text-muted-foreground">
111+
<Field className="flex-1">
112+
<FieldLabel className="text-sm text-muted-foreground">
113113
System Message
114-
</Label>
114+
</FieldLabel>
115115
<Textarea
116116
placeholder="Describe desired model behaviour"
117117
className="resize-none flex-1 p-4 h-full"
118118
value={system1}
119119
onChange={(e) => setSystem1(e.target.value)}
120120
/>
121-
</div>
122-
<div className="flex-1 flex flex-col gap-2">
123-
<Label className="text-sm text-muted-foreground">
121+
</Field>
122+
<Field className="flex-1">
123+
<FieldLabel className="text-sm text-muted-foreground">
124124
Expert Message
125-
</Label>
125+
</FieldLabel>
126126
<Textarea
127127
placeholder="Describe desired model behaviour"
128128
className="resize-none flex-1 p-4 h-full"
129129
value={system2}
130130
onChange={(e) => setSystem2(e.target.value)}
131131
/>
132-
</div>
133-
<div className="flex-1 flex flex-col gap-2">
134-
<Label className="text-sm text-muted-foreground">
132+
</Field>
133+
<Field className="flex-1">
134+
<FieldLabel className="text-sm text-muted-foreground">
135135
Context Message
136-
</Label>
136+
</FieldLabel>
137137
<Textarea
138138
placeholder="Describe desired model behaviour"
139139
className="resize-none flex-1 p-4 h-full"
140140
value={system3}
141141
onChange={(e) => setSystem3(e.target.value)}
142142
/>
143-
</div>
143+
</Field>
144144
</div>
145145
</aside>
146146
<aside className="flex-[2] flex flex-col gap-4">

editor/app/(insiders)/insiders/auth/basic/page.tsx

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import {
77
CardHeader,
88
CardTitle,
99
} from "@/components/ui/card";
10+
import { Field, FieldGroup, FieldLabel } from "@/components/ui/field";
1011
import { Input } from "@/components/ui/input";
11-
import { Label } from "@/components/ui/label";
1212
import { GridaLogo } from "@/components/grida-logo";
1313
import Link from "next/link";
1414

@@ -64,25 +64,30 @@ function Form({ searchParams }: { searchParams: SerachParams }) {
6464
<input type="hidden" name="next" value={searchParams.next} />
6565
<div className="grid gap-6">
6666
<div className="grid gap-6">
67-
<div className="grid gap-2">
68-
<Label htmlFor="email">Email</Label>
69-
<Input
70-
id="email"
71-
name="email"
72-
type="email"
73-
placeholder="[email protected]"
74-
required
75-
/>
76-
</div>
77-
<div className="grid gap-2">
78-
<Input
79-
id="password"
80-
name="password"
81-
placeholder="password"
82-
type="password"
83-
required
84-
/>
85-
</div>
67+
<FieldGroup className="gap-6">
68+
<Field>
69+
<FieldLabel htmlFor="email">Email</FieldLabel>
70+
<Input
71+
id="email"
72+
name="email"
73+
type="email"
74+
placeholder="[email protected]"
75+
required
76+
/>
77+
</Field>
78+
<Field>
79+
<FieldLabel htmlFor="password" className="sr-only">
80+
Password
81+
</FieldLabel>
82+
<Input
83+
id="password"
84+
name="password"
85+
placeholder="password"
86+
type="password"
87+
required
88+
/>
89+
</Field>
90+
</FieldGroup>
8691
<Button type="submit" className="w-full">
8792
Login
8893
</Button>

editor/app/(site)/organizations/[organization_name]/invite/page.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Button } from "@/components/ui/button";
22
import { Input } from "@/components/ui/input";
3-
import { Label } from "@/components/ui/label";
3+
import { Field, FieldLabel } from "@/components/ui/field";
44
import { GridaLogo } from "@/components/grida-logo";
55
import {
66
Breadcrumb,
@@ -40,10 +40,12 @@ export default async function NewOrganizationSetupInvitePage({
4040
Learn more about permissions for organizations →
4141
</Link>
4242
</section>
43-
<div className="grid gap-2">
44-
<Label>Search by username, full name or email address</Label>
43+
<Field>
44+
<FieldLabel>
45+
Search by username, full name or email address
46+
</FieldLabel>
4547
<Input placeholder="Organization name" />
46-
</div>
48+
</Field>
4749
<footer className="flex flex-col gap-2 w-full py-10 border-t">
4850
<Button className="w-full">Complete setup</Button>
4951
<Button variant="link" className="w-full">

editor/app/(site)/organizations/[organization_name]/settings/profile/delete.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
AlertDialogTrigger,
1313
} from "@/components/ui/alert-dialog";
1414
import { Button } from "@/components/ui/button";
15-
import { Label } from "@/components/ui/label";
15+
import { Field, FieldLabel } from "@/components/ui/field";
1616
import { Input } from "@/components/ui/input";
1717

1818
export function DeleteOrganizationConfirm({
@@ -45,18 +45,18 @@ export function DeleteOrganizationConfirm({
4545
method="post"
4646
onSubmit={() => setBusy(true)}
4747
>
48-
<div className="grid gap-2">
49-
<Label htmlFor="confirm">
48+
<Field>
49+
<FieldLabel htmlFor="confirm">
5050
Enter this organization’s name to confirm
51-
</Label>
51+
</FieldLabel>
5252
<Input
5353
id="confirm"
5454
name="confirm"
5555
autoComplete="off"
5656
value={confirm}
5757
onChange={(e) => setConfirm(e.target.value)}
5858
/>
59-
</div>
59+
</Field>
6060
</form>
6161
<AlertDialogFooter>
6262
<AlertDialogCancel>Cancel</AlertDialogCancel>

editor/app/(site)/organizations/[organization_name]/settings/profile/page.tsx

Lines changed: 50 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import {
1313
CardHeader,
1414
CardTitle,
1515
} from "@/components/ui/card";
16+
import { Field, FieldGroup, FieldLabel } from "@/components/ui/field";
1617
import { Input } from "@/components/ui/input";
17-
import { Label } from "@/components/ui/label";
1818
import { notFound, redirect } from "next/navigation";
1919
import { GridaLogo } from "@/components/grida-logo";
2020
import { DeleteOrganizationConfirm } from "./delete";
@@ -65,52 +65,56 @@ export default async function OrganizationsSettingsProfilePage({
6565
action={`/private/accounts/organizations/${organization_name}/profile`}
6666
encType="multipart/form-data"
6767
method="POST"
68-
className="flex flex-col gap-10 py-4"
68+
className="py-4"
6969
>
70-
<div className="grid gap-2">
71-
<Label>Name</Label>
72-
<Input disabled readOnly value={data.name} />
73-
</div>
74-
<div className="grid gap-2">
75-
<Label htmlFor="display_name">Organization display name</Label>
76-
<Input
77-
id="display_name"
78-
name="display_name"
79-
required
80-
placeholder="Organization display name"
81-
defaultValue={data.display_name ?? undefined}
82-
/>
83-
</div>
84-
<div className="grid gap-2">
85-
<Label htmlFor="email">Email (will be public)</Label>
86-
<Input
87-
type="email"
88-
id="email"
89-
name="email"
90-
required
91-
placeholder="[email protected]"
92-
defaultValue={data.email ?? undefined}
93-
/>
94-
</div>
95-
<div className="grid gap-2">
96-
<Label htmlFor="description">Description</Label>
97-
<Input
98-
id="description"
99-
name="description"
100-
placeholder="Organization description"
101-
defaultValue={data.description ?? undefined}
102-
/>
103-
</div>
104-
<div className="grid gap-2">
105-
<Label htmlFor="blog">URL</Label>
106-
<Input
107-
type="url"
108-
id="blog"
109-
name="blog"
110-
placeholder="https://acme.com"
111-
defaultValue={data.blog ?? undefined}
112-
/>
113-
</div>
70+
<FieldGroup className="gap-10">
71+
<Field>
72+
<FieldLabel>Name</FieldLabel>
73+
<Input disabled readOnly value={data.name} />
74+
</Field>
75+
<Field>
76+
<FieldLabel htmlFor="display_name">
77+
Organization display name
78+
</FieldLabel>
79+
<Input
80+
id="display_name"
81+
name="display_name"
82+
required
83+
placeholder="Organization display name"
84+
defaultValue={data.display_name ?? undefined}
85+
/>
86+
</Field>
87+
<Field>
88+
<FieldLabel htmlFor="email">Email (will be public)</FieldLabel>
89+
<Input
90+
type="email"
91+
id="email"
92+
name="email"
93+
required
94+
placeholder="[email protected]"
95+
defaultValue={data.email ?? undefined}
96+
/>
97+
</Field>
98+
<Field>
99+
<FieldLabel htmlFor="description">Description</FieldLabel>
100+
<Input
101+
id="description"
102+
name="description"
103+
placeholder="Organization description"
104+
defaultValue={data.description ?? undefined}
105+
/>
106+
</Field>
107+
<Field>
108+
<FieldLabel htmlFor="blog">URL</FieldLabel>
109+
<Input
110+
type="url"
111+
id="blog"
112+
name="blog"
113+
placeholder="https://acme.com"
114+
defaultValue={data.blog ?? undefined}
115+
/>
116+
</Field>
117+
</FieldGroup>
114118
</form>
115119
</CardContent>
116120
<CardFooter className="flex justify-end items-center border-t pt-6">

0 commit comments

Comments
 (0)