Skip to content

Commit 56ed217

Browse files
committed
version 1.0.6
1 parent 5e74c67 commit 56ed217

File tree

2 files changed

+20
-24
lines changed

2 files changed

+20
-24
lines changed

core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "t3-env-client",
3-
"version": "1.0.5",
3+
"version": "1.0.6",
44
"engines": {
55
"node": ">=v21"
66
},

core/src/components/variables/form.tsx

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
"use client";
22

3-
import { useState } from "react";
4-
import { CopyButton } from "../copy-button";
53
import { useVariable, useVariables } from "./context";
64
import {
75
Accordion,
86
AccordionContent,
97
AccordionItem,
108
AccordionTrigger,
119
} from "@/components/ui/accordion";
12-
import { Badge } from "@/components/ui/badge";
13-
import { Button } from "@/components/ui/button";
1410
import {
1511
FormControl,
1612
FormDescription,
@@ -21,15 +17,8 @@ import {
2117
Form as Root,
2218
} from "@/components/ui/form";
2319
import { Input } from "@/components/ui/input";
24-
import type { EnvVariable, Issue } from "@/lib/types";
25-
import {
26-
AlertCircle,
27-
Check,
28-
Copy,
29-
Lock,
30-
ServerIcon,
31-
ShieldOff,
32-
} from "lucide-react";
20+
import type { EnvVariable } from "@/lib/types";
21+
import { ServerIcon } from "lucide-react";
3322
import type {
3423
Control,
3524
ControllerRenderProps,
@@ -126,17 +115,21 @@ export const Form = () => {
126115

127116
{/* Grouped variables */}
128117
{hasGroups && (
129-
<Accordion type="multiple" className="w-full" defaultValue={Object.keys(groups)}>
118+
<Accordion
119+
type="multiple"
120+
className="w-full"
121+
defaultValue={Object.keys(groups)}
122+
>
130123
{Object.entries(groups).map(([prefix, keys]) => (
131124
<AccordionItem
132125
key={prefix}
133126
value={prefix}
134127
className="border-t border-b-0"
135128
>
136-
<AccordionTrigger className="px-4 cursor-pointer">
129+
<AccordionTrigger className="cursor-pointer px-4">
137130
<div className="sticky top-0">
138131
<span className="capitalize">{prefix.toLowerCase()}</span>
139-
<span className="ml-2 text-muted-foreground text-xs">
132+
<span className="text-muted-foreground ml-2 text-xs">
140133
{keys.length} variables
141134
</span>
142135
</div>
@@ -178,14 +171,14 @@ const ValueInput = ({
178171
<div className="flex flex-col">
179172
<div className="flex items-center gap-2">
180173
{variable.group === "server" && (
181-
<div className="h-9 w-9 min-w-9 flex items-center justify-center rounded-md bg-background border">
174+
<div className="bg-background flex h-9 w-9 min-w-9 items-center justify-center rounded-md border">
182175
<ServerIcon className="size-4" />
183176
</div>
184177
)}
185178
<FormControl>
186179
<Input
187180
placeholder={`Set a value for ${variable.key}`}
188-
className="font-mono shadow-none bg-background"
181+
className="bg-background font-mono shadow-none"
189182
{...field}
190183
/>
191184
</FormControl>
@@ -206,22 +199,26 @@ const Variable = ({
206199

207200
return (
208201
// <div className="p-2 first:pt-4">
209-
<span data-slot="variable" id={variable.key} className="block px-2 py-1 first-of-type:pt-2 last-of-type:pb-2 ">
202+
<span
203+
data-slot="variable"
204+
id={variable.key}
205+
className="block px-2 py-1 first-of-type:pt-2 last-of-type:pb-2"
206+
>
210207
<FormField
211208
key={variable.key}
212209
control={control}
213210
name={variable.key}
214211
render={({ field, fieldState }) => (
215212
<FormItem
216-
className="space-y-1 rounded-lg border p-3 bg-muted/50"
213+
className="bg-muted/50 space-y-1 rounded-lg border p-3"
217214
data-field-name={variable.key}
218215
>
219216
<div className="space-y-1">
220217
<div className="flex justify-start gap-2">
221218
<FormLabel className="font-mono font-semibold">
222219
{variable.key}
223220
</FormLabel>
224-
221+
225222
<div className="text-muted-foreground text-xs">
226223
{variable.group}
227224
</div>
@@ -231,9 +228,8 @@ const Variable = ({
231228
)}
232229
</div>
233230
<ValueInput variable={variable} field={field} />
234-
231+
235232
<FormMessage />
236-
237233
</FormItem>
238234
)}
239235
/>

0 commit comments

Comments
 (0)