zudoku 0.25.2 → 0.25.3
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/dist/app/demo.js +0 -1
- package/dist/app/demo.js.map +1 -1
- package/dist/app/standalone.js +0 -1
- package/dist/app/standalone.js.map +1 -1
- package/dist/config/validators/InputSidebarSchema.d.ts +2 -2
- package/dist/config/validators/validate.d.ts +4 -4
- package/dist/lib/oas/graphql/index.d.ts +3 -0
- package/dist/lib/oas/graphql/index.js +12 -13
- package/dist/lib/oas/graphql/index.js.map +1 -1
- package/dist/lib/plugins/openapi/ColorizedParam.d.ts +10 -2
- package/dist/lib/plugins/openapi/ColorizedParam.js +16 -7
- package/dist/lib/plugins/openapi/ColorizedParam.js.map +1 -1
- package/dist/lib/plugins/openapi/ParameterListItem.js +3 -2
- package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js +2 -0
- package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js.map +1 -1
- package/dist/lib/plugins/openapi/RequestBodySidecarBox.d.ts +1 -1
- package/dist/lib/plugins/openapi/RequestBodySidecarBox.js +2 -5
- package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
- package/dist/lib/plugins/openapi/ResponsesSidecarBox.js +2 -6
- package/dist/lib/plugins/openapi/ResponsesSidecarBox.js.map +1 -1
- package/dist/lib/plugins/openapi/{ExampleDisplay.d.ts → SidecarExamples.d.ts} +2 -6
- package/dist/lib/plugins/openapi/SidecarExamples.js +62 -0
- package/dist/lib/plugins/openapi/SidecarExamples.js.map +1 -0
- package/dist/lib/plugins/openapi/client/GraphQLClient.d.ts +1 -1
- package/dist/lib/plugins/openapi/client/GraphQLClient.js +22 -93
- package/dist/lib/plugins/openapi/client/GraphQLClient.js.map +1 -1
- package/dist/lib/plugins/openapi/client/createServer.d.ts +2 -1
- package/dist/lib/plugins/openapi/client/createServer.js +5 -2
- package/dist/lib/plugins/openapi/client/createServer.js.map +1 -1
- package/dist/lib/plugins/openapi/client/useCreateQuery.d.ts +1 -1
- package/dist/lib/plugins/openapi/client/useCreateQuery.js +2 -13
- package/dist/lib/plugins/openapi/client/useCreateQuery.js.map +1 -1
- package/dist/lib/plugins/openapi/index.d.ts +2 -1
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/EnumSelector.d.ts +8 -0
- package/dist/lib/plugins/openapi/playground/EnumSelector.js +21 -0
- package/dist/lib/plugins/openapi/playground/EnumSelector.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/PathParams.js +9 -4
- package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/Playground.d.ts +3 -0
- package/dist/lib/plugins/openapi/playground/Playground.js +5 -2
- package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/QueryParams.js +23 -8
- package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaComponents.js +2 -1
- package/dist/lib/plugins/openapi/schema/SchemaComponents.js.map +1 -1
- package/dist/lib/plugins/openapi/util/generateSchemaExample.js +19 -11
- package/dist/lib/plugins/openapi/util/generateSchemaExample.js.map +1 -1
- package/dist/lib/ui/Badge.js +1 -1
- package/dist/lib/ui/Badge.js.map +1 -1
- package/dist/lib/ui/Button.d.ts +1 -1
- package/dist/lib/ui/Checkbox.d.ts +8 -2
- package/dist/lib/ui/Checkbox.js +13 -1
- package/dist/lib/ui/Checkbox.js.map +1 -1
- package/dist/lib/util/traverse.d.ts +8 -1
- package/dist/lib/util/traverse.js +7 -3
- package/dist/lib/util/traverse.js.map +1 -1
- package/dist/vite/api/schema-codegen.d.ts +12 -0
- package/dist/vite/api/schema-codegen.js +62 -0
- package/dist/vite/api/schema-codegen.js.map +1 -0
- package/dist/vite/api/schema-codegen.test.d.ts +1 -0
- package/dist/vite/api/schema-codegen.test.js +247 -0
- package/dist/vite/api/schema-codegen.test.js.map +1 -0
- package/dist/vite/config.js +0 -7
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/plugin-api.js +110 -82
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/plugin-component.js +0 -1
- package/dist/vite/plugin-component.js.map +1 -1
- package/lib/Command-9x_kZHr4.js +611 -0
- package/lib/Command-9x_kZHr4.js.map +1 -0
- package/lib/{OperationList-BLdHAQ39.js → OperationList-B8bHMKme.js} +1440 -1434
- package/lib/OperationList-B8bHMKme.js.map +1 -0
- package/lib/{createServer-Bf5_6o6G.js → createServer-BznDkeSA.js} +4227 -5154
- package/lib/createServer-BznDkeSA.js.map +1 -0
- package/lib/index-TaRXY2w1.js +43 -0
- package/lib/index-TaRXY2w1.js.map +1 -0
- package/lib/index-sD8L1_Dl.js +1292 -0
- package/lib/index-sD8L1_Dl.js.map +1 -0
- package/lib/post-processors/traverse.js +11 -8
- package/lib/post-processors/traverse.js.map +1 -1
- package/lib/ui/Badge.js +1 -1
- package/lib/ui/Badge.js.map +1 -1
- package/lib/ui/Checkbox.js +25 -14
- package/lib/ui/Checkbox.js.map +1 -1
- package/lib/ui/Command.js +14 -550
- package/lib/ui/Command.js.map +1 -1
- package/lib/zudoku.plugin-openapi.js +1 -1
- package/package.json +1 -6
- package/src/app/demo.tsx +0 -1
- package/src/app/standalone.tsx +0 -1
- package/src/lib/oas/graphql/index.ts +19 -15
- package/src/lib/plugins/openapi/ColorizedParam.tsx +29 -12
- package/src/lib/plugins/openapi/ParameterListItem.tsx +9 -7
- package/src/lib/plugins/openapi/PlaygroundDialogWrapper.tsx +2 -0
- package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +2 -7
- package/src/lib/plugins/openapi/ResponsesSidecarBox.tsx +5 -8
- package/src/lib/plugins/openapi/SidecarExamples.tsx +155 -0
- package/src/lib/plugins/openapi/client/GraphQLClient.tsx +28 -120
- package/src/lib/plugins/openapi/client/createServer.ts +6 -2
- package/src/lib/plugins/openapi/client/useCreateQuery.ts +2 -17
- package/src/lib/plugins/openapi/index.tsx +2 -1
- package/src/lib/plugins/openapi/playground/EnumSelector.tsx +86 -0
- package/src/lib/plugins/openapi/playground/PathParams.tsx +72 -64
- package/src/lib/plugins/openapi/playground/Playground.tsx +26 -13
- package/src/lib/plugins/openapi/playground/QueryParams.tsx +102 -73
- package/src/lib/plugins/openapi/schema/SchemaComponents.tsx +4 -7
- package/src/lib/plugins/openapi/util/generateSchemaExample.ts +26 -11
- package/src/lib/ui/Badge.tsx +1 -1
- package/src/lib/ui/Checkbox.tsx +24 -7
- package/src/lib/util/traverse.ts +15 -5
- package/dist/lib/plugins/openapi/ExampleDisplay.js +0 -78
- package/dist/lib/plugins/openapi/ExampleDisplay.js.map +0 -1
- package/dist/lib/plugins/openapi/client/worker.d.ts +0 -4
- package/dist/lib/plugins/openapi/client/worker.js +0 -29
- package/dist/lib/plugins/openapi/client/worker.js.map +0 -1
- package/dist/lib/plugins/openapi-worker.d.ts +0 -1
- package/dist/lib/plugins/openapi-worker.js +0 -8
- package/dist/lib/plugins/openapi-worker.js.map +0 -1
- package/lib/Dialog-Bxv1yEIg.js +0 -67
- package/lib/Dialog-Bxv1yEIg.js.map +0 -1
- package/lib/OperationList-BLdHAQ39.js.map +0 -1
- package/lib/assets/index-C7jnHK4b.js +0 -4841
- package/lib/assets/index-C7jnHK4b.js.map +0 -1
- package/lib/assets/worker-Cbp2r2BQ.js +0 -18592
- package/lib/assets/worker-Cbp2r2BQ.js.map +0 -1
- package/lib/createServer-Bf5_6o6G.js.map +0 -1
- package/lib/index-BNx95gkf.js +0 -1284
- package/lib/index-BNx95gkf.js.map +0 -1
- package/lib/index-DyBL--Kz.js +0 -826
- package/lib/index-DyBL--Kz.js.map +0 -1
- package/lib/zudoku.openapi-worker.js +0 -15
- package/lib/zudoku.openapi-worker.js.map +0 -1
- package/src/lib/plugins/openapi/ExampleDisplay.tsx +0 -163
- package/src/lib/plugins/openapi/client/worker.ts +0 -44
- package/src/lib/plugins/openapi-worker.ts +0 -11
|
@@ -5,9 +5,12 @@ import {
|
|
|
5
5
|
useFieldArray,
|
|
6
6
|
useFormContext,
|
|
7
7
|
} from "react-hook-form";
|
|
8
|
+
import { Card } from "zudoku/ui/Card.js";
|
|
9
|
+
import { Checkbox } from "zudoku/ui/Checkbox.js";
|
|
8
10
|
import { Button } from "../../../ui/Button.js";
|
|
9
11
|
import { Input } from "../../../ui/Input.js";
|
|
10
12
|
import { cn } from "../../../util/cn.js";
|
|
13
|
+
import { EnumSelector } from "./EnumSelector.js";
|
|
11
14
|
import { InlineInput } from "./InlineInput.js";
|
|
12
15
|
import {
|
|
13
16
|
NO_IDENTITY,
|
|
@@ -34,97 +37,123 @@ export const QueryParams = ({
|
|
|
34
37
|
const hasSelectedIdentity = selectedIdentity !== NO_IDENTITY;
|
|
35
38
|
|
|
36
39
|
return (
|
|
37
|
-
<
|
|
38
|
-
<table className="w-full
|
|
40
|
+
<Card className="rounded-lg">
|
|
41
|
+
<table className="w-full">
|
|
39
42
|
<tbody>
|
|
40
43
|
{fields
|
|
41
44
|
.filter(
|
|
42
45
|
// TODO remove this hack for Accu or make it more generic
|
|
43
46
|
(field) => !(hasSelectedIdentity && field.name === "apikey"),
|
|
44
47
|
)
|
|
45
|
-
.map((field, i) =>
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
<input
|
|
53
|
-
type="checkbox"
|
|
54
|
-
id={`queryParams.${i}.active`}
|
|
55
|
-
checked={field.value}
|
|
56
|
-
onChange={field.onChange}
|
|
57
|
-
/>
|
|
58
|
-
)}
|
|
59
|
-
/>
|
|
60
|
-
</td>
|
|
61
|
-
<td>
|
|
62
|
-
<Controller
|
|
63
|
-
control={control}
|
|
64
|
-
render={({ field }) => (
|
|
65
|
-
<InlineInput asChild>
|
|
66
|
-
<label
|
|
67
|
-
className="flex items-center cursor-pointer"
|
|
68
|
-
htmlFor={`queryParams.${i}.active`}
|
|
69
|
-
title={
|
|
70
|
-
requiredFields[i] ? "Required field" : undefined
|
|
71
|
-
}
|
|
72
|
-
>
|
|
73
|
-
{field.value}
|
|
74
|
-
{requiredFields[i] && <sup> *</sup>}
|
|
75
|
-
</label>
|
|
76
|
-
</InlineInput>
|
|
77
|
-
)}
|
|
78
|
-
name={`queryParams.${i}.name`}
|
|
79
|
-
/>
|
|
80
|
-
</td>
|
|
81
|
-
<td>
|
|
82
|
-
<div className="flex justify-between items-center">
|
|
48
|
+
.map((field, i) => {
|
|
49
|
+
const currentParam = queryParams.find(
|
|
50
|
+
(param) => param.name === field.name,
|
|
51
|
+
);
|
|
52
|
+
return (
|
|
53
|
+
<tr key={field.id} className="hover:bg-accent/40">
|
|
54
|
+
<td className="w-5/12 flex items-center ps-3">
|
|
83
55
|
<Controller
|
|
84
56
|
control={control}
|
|
57
|
+
name={`queryParams.${i}.active`}
|
|
85
58
|
render={({ field }) => (
|
|
86
|
-
<
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
form.setValue(`queryParams.${i}.active`, true);
|
|
92
|
-
}
|
|
93
|
-
}}
|
|
94
|
-
placeholder="Enter value"
|
|
95
|
-
className="w-full border-0 shadow-none text-xs font-mono"
|
|
59
|
+
<Checkbox
|
|
60
|
+
variant="outline"
|
|
61
|
+
id={`queryParams.${i}.active`}
|
|
62
|
+
checked={field.value}
|
|
63
|
+
onCheckedChange={field.onChange}
|
|
96
64
|
/>
|
|
97
65
|
)}
|
|
98
|
-
name={`queryParams.${i}.value`}
|
|
99
66
|
/>
|
|
100
67
|
<Controller
|
|
101
68
|
control={control}
|
|
102
69
|
render={({ field }) => (
|
|
103
|
-
<
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
onClick={() => field.onChange("")}
|
|
116
|
-
>
|
|
117
|
-
<EraserIcon size={16} />
|
|
118
|
-
</Button>
|
|
70
|
+
<InlineInput asChild>
|
|
71
|
+
<label
|
|
72
|
+
className="flex items-center cursor-pointer gap-1"
|
|
73
|
+
htmlFor={`queryParams.${i}.active`}
|
|
74
|
+
title={
|
|
75
|
+
requiredFields[i] ? "Required field" : undefined
|
|
76
|
+
}
|
|
77
|
+
>
|
|
78
|
+
{field.value}
|
|
79
|
+
{requiredFields[i] && <sup> *</sup>}
|
|
80
|
+
</label>
|
|
81
|
+
</InlineInput>
|
|
119
82
|
)}
|
|
120
|
-
name={`queryParams.${i}.
|
|
83
|
+
name={`queryParams.${i}.name`}
|
|
121
84
|
/>
|
|
122
|
-
</
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
85
|
+
</td>
|
|
86
|
+
<td className="w-7/12">
|
|
87
|
+
<div className="flex justify-between items-center">
|
|
88
|
+
<Controller
|
|
89
|
+
control={control}
|
|
90
|
+
render={({ field }) => {
|
|
91
|
+
const hasEnum =
|
|
92
|
+
currentParam?.enum && currentParam.enum.length > 0;
|
|
93
|
+
|
|
94
|
+
if (!hasEnum) {
|
|
95
|
+
return (
|
|
96
|
+
<Input
|
|
97
|
+
{...field}
|
|
98
|
+
onChange={(e) => {
|
|
99
|
+
field.onChange(e.target.value);
|
|
100
|
+
if (e.target.value.length > 0) {
|
|
101
|
+
form.setValue(
|
|
102
|
+
`queryParams.${i}.active`,
|
|
103
|
+
true,
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
}}
|
|
107
|
+
placeholder="Enter value"
|
|
108
|
+
className="w-full border-0 shadow-none text-xs font-mono hover:bg-accent"
|
|
109
|
+
/>
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const enumValues = currentParam.enum ?? [];
|
|
114
|
+
|
|
115
|
+
return (
|
|
116
|
+
<EnumSelector
|
|
117
|
+
value={field.value}
|
|
118
|
+
enumValues={enumValues}
|
|
119
|
+
onChange={field.onChange}
|
|
120
|
+
onValueSelected={() => {
|
|
121
|
+
form.setValue(`queryParams.${i}.active`, true);
|
|
122
|
+
}}
|
|
123
|
+
/>
|
|
124
|
+
);
|
|
125
|
+
}}
|
|
126
|
+
name={`queryParams.${i}.value`}
|
|
127
|
+
/>
|
|
128
|
+
<Controller
|
|
129
|
+
control={control}
|
|
130
|
+
render={({ field }) => (
|
|
131
|
+
<Button
|
|
132
|
+
size="icon"
|
|
133
|
+
type="button"
|
|
134
|
+
variant="ghost"
|
|
135
|
+
aria-label="Clear value"
|
|
136
|
+
className={cn(
|
|
137
|
+
"ms-2 mr-1",
|
|
138
|
+
field.value.length === 0
|
|
139
|
+
? "opacity-0 pointer-events-none"
|
|
140
|
+
: "opacity-100",
|
|
141
|
+
)}
|
|
142
|
+
title="Clear value"
|
|
143
|
+
onClick={() => field.onChange("")}
|
|
144
|
+
>
|
|
145
|
+
<EraserIcon size={16} />
|
|
146
|
+
</Button>
|
|
147
|
+
)}
|
|
148
|
+
name={`queryParams.${i}.value`}
|
|
149
|
+
/>
|
|
150
|
+
</div>
|
|
151
|
+
</td>
|
|
152
|
+
</tr>
|
|
153
|
+
);
|
|
154
|
+
})}
|
|
126
155
|
</tbody>
|
|
127
156
|
</table>
|
|
128
|
-
</
|
|
157
|
+
</Card>
|
|
129
158
|
);
|
|
130
159
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as Collapsible from "@radix-ui/react-collapsible";
|
|
2
2
|
import { ListPlusIcon, RefreshCcwDotIcon } from "lucide-react";
|
|
3
3
|
import { useCallback, useState } from "react";
|
|
4
|
+
import { Badge } from "zudoku/ui/Badge.js";
|
|
4
5
|
import { Markdown, ProseClasses } from "../../../components/Markdown.js";
|
|
5
6
|
import { CIRCULAR_REF } from "../../../oas/parser/dereference/index.js";
|
|
6
7
|
import type { SchemaObject } from "../../../oas/parser/index.js";
|
|
@@ -85,7 +86,7 @@ export const SchemaPropertyItem = ({
|
|
|
85
86
|
<div className="flex flex-col gap-1 justify-between text-sm">
|
|
86
87
|
<div className="flex gap-2 items-center">
|
|
87
88
|
<code>{name}</code>
|
|
88
|
-
<
|
|
89
|
+
<Badge variant="secondary">
|
|
89
90
|
{schema.type === "array" && schema.items.type ? (
|
|
90
91
|
<span>{schema.items.type}[]</span>
|
|
91
92
|
) : Array.isArray(schema.type) ? (
|
|
@@ -93,12 +94,8 @@ export const SchemaPropertyItem = ({
|
|
|
93
94
|
) : (
|
|
94
95
|
<span>{schema.type}</span>
|
|
95
96
|
)}
|
|
96
|
-
</
|
|
97
|
-
{group === "optional" &&
|
|
98
|
-
<span className="py-px px-1.5 font-medium border rounded-lg">
|
|
99
|
-
optional
|
|
100
|
-
</span>
|
|
101
|
-
)}
|
|
97
|
+
</Badge>
|
|
98
|
+
{group === "optional" && <Badge variant="outline">optional</Badge>}
|
|
102
99
|
</div>
|
|
103
100
|
|
|
104
101
|
{schema.description && (
|
|
@@ -5,24 +5,35 @@ export const generateSchemaExample = (
|
|
|
5
5
|
name?: string,
|
|
6
6
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
7
7
|
): any => {
|
|
8
|
-
//
|
|
8
|
+
// Check for schema-level example first
|
|
9
9
|
if (schema.example !== undefined) {
|
|
10
10
|
return schema.example;
|
|
11
|
-
} else if (schema.examples) {
|
|
12
|
-
return Object.values(schema.examples)[0];
|
|
13
|
-
} else if (schema.default !== undefined) {
|
|
14
|
-
return schema.default;
|
|
15
11
|
}
|
|
16
12
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
// Then check for schema-level examples
|
|
14
|
+
if (
|
|
15
|
+
schema.examples &&
|
|
16
|
+
typeof schema.examples === "object" &&
|
|
17
|
+
"default" in schema.examples
|
|
18
|
+
) {
|
|
19
|
+
const defaultExample = schema.examples.default;
|
|
20
|
+
if (defaultExample !== null) {
|
|
21
|
+
return typeof defaultExample === "object" && "value" in defaultExample
|
|
22
|
+
? defaultExample.value
|
|
23
|
+
: defaultExample;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// For object schemas with properties
|
|
28
|
+
if (schema.type === "object" && schema.properties) {
|
|
29
|
+
const example: Record<string, any> = {};
|
|
20
30
|
|
|
21
|
-
|
|
22
|
-
|
|
31
|
+
for (const [key, propSchema] of Object.entries(schema.properties)) {
|
|
32
|
+
if (typeof propSchema === "object") {
|
|
23
33
|
example[key] = generateSchemaExample(propSchema as SchemaObject, key);
|
|
24
34
|
}
|
|
25
35
|
}
|
|
36
|
+
|
|
26
37
|
return example;
|
|
27
38
|
}
|
|
28
39
|
|
|
@@ -31,7 +42,9 @@ export const generateSchemaExample = (
|
|
|
31
42
|
return schema.items.map((itemSchema) =>
|
|
32
43
|
generateSchemaExample(itemSchema as SchemaObject),
|
|
33
44
|
);
|
|
34
|
-
}
|
|
45
|
+
}
|
|
46
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- OpenAPI schemas don't always adhere to spec
|
|
47
|
+
if (schema.items) {
|
|
35
48
|
return [generateSchemaExample(schema.items as SchemaObject)];
|
|
36
49
|
}
|
|
37
50
|
return [];
|
|
@@ -51,6 +64,8 @@ export const generateSchemaExample = (
|
|
|
51
64
|
return true;
|
|
52
65
|
case "null":
|
|
53
66
|
return null;
|
|
67
|
+
case "object":
|
|
68
|
+
return {};
|
|
54
69
|
case undefined:
|
|
55
70
|
default:
|
|
56
71
|
return {};
|
package/src/lib/ui/Badge.tsx
CHANGED
|
@@ -4,7 +4,7 @@ import * as React from "react";
|
|
|
4
4
|
import { cn } from "../util/cn.js";
|
|
5
5
|
|
|
6
6
|
const badgeVariants = cva(
|
|
7
|
-
"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-
|
|
7
|
+
"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
8
8
|
{
|
|
9
9
|
variants: {
|
|
10
10
|
variant: {
|
package/src/lib/ui/Checkbox.tsx
CHANGED
|
@@ -1,19 +1,36 @@
|
|
|
1
1
|
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
2
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
2
3
|
import { Check } from "lucide-react";
|
|
3
4
|
import * as React from "react";
|
|
4
5
|
|
|
5
6
|
import { cn } from "../util/cn.js";
|
|
6
7
|
|
|
8
|
+
const checkboxVariants = cva(
|
|
9
|
+
"peer h-4 w-4 shrink-0 rounded-sm ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:text-primary",
|
|
10
|
+
{
|
|
11
|
+
variants: {
|
|
12
|
+
variant: {
|
|
13
|
+
default: "border border-primary data-[state=checked]:bg-primary",
|
|
14
|
+
outline: "border border-input data-[state=checked]:bg-accent",
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
defaultVariants: {
|
|
18
|
+
variant: "default",
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
interface CheckboxProps
|
|
24
|
+
extends React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>,
|
|
25
|
+
VariantProps<typeof checkboxVariants> {}
|
|
26
|
+
|
|
7
27
|
const Checkbox = React.forwardRef<
|
|
8
28
|
React.ElementRef<typeof CheckboxPrimitive.Root>,
|
|
9
|
-
|
|
10
|
-
>(({ className, ...props }, ref) => (
|
|
29
|
+
CheckboxProps
|
|
30
|
+
>(({ className, variant, ...props }, ref) => (
|
|
11
31
|
<CheckboxPrimitive.Root
|
|
12
32
|
ref={ref}
|
|
13
|
-
className={cn(
|
|
14
|
-
"peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
|
|
15
|
-
className,
|
|
16
|
-
)}
|
|
33
|
+
className={cn(checkboxVariants({ variant, className }))}
|
|
17
34
|
{...props}
|
|
18
35
|
>
|
|
19
36
|
<CheckboxPrimitive.Indicator
|
|
@@ -25,4 +42,4 @@ const Checkbox = React.forwardRef<
|
|
|
25
42
|
));
|
|
26
43
|
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
27
44
|
|
|
28
|
-
export { Checkbox };
|
|
45
|
+
export { Checkbox, type CheckboxProps };
|
package/src/lib/util/traverse.ts
CHANGED
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2
2
|
export type RecordAny = Record<string, any>;
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
type JsonPrimitive = string | number | boolean | null;
|
|
5
|
+
type JsonArray = JsonValue[];
|
|
6
|
+
type JsonObject = { [key: string]: JsonValue };
|
|
7
|
+
type JsonValue = JsonPrimitive | JsonArray | JsonObject;
|
|
8
|
+
|
|
9
|
+
export const traverse = <T extends JsonValue = RecordAny>(
|
|
5
10
|
specification: RecordAny,
|
|
6
|
-
transform: (specification: RecordAny) =>
|
|
11
|
+
transform: (specification: RecordAny) => T,
|
|
7
12
|
) => {
|
|
8
|
-
const
|
|
13
|
+
const transformed = transform(specification);
|
|
14
|
+
if (typeof transformed !== "object" || transformed === null) {
|
|
15
|
+
return transformed;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const result: RecordAny = Array.isArray(transformed) ? [] : {};
|
|
9
19
|
|
|
10
|
-
for (const [key, value] of Object.entries(
|
|
20
|
+
for (const [key, value] of Object.entries(transformed)) {
|
|
11
21
|
if (Array.isArray(value)) {
|
|
12
22
|
result[key] = value.map((item) =>
|
|
13
23
|
typeof item === "object" && item !== null
|
|
@@ -21,5 +31,5 @@ export const traverse = (
|
|
|
21
31
|
}
|
|
22
32
|
}
|
|
23
33
|
|
|
24
|
-
return
|
|
34
|
+
return result;
|
|
25
35
|
};
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from "react";
|
|
3
|
-
import { SyntaxHighlight } from "../../components/SyntaxHighlight.js";
|
|
4
|
-
import { CollapsibleCode } from "./CollapsibleCode.js";
|
|
5
|
-
import * as SidecarBox from "./SidecarBox.js";
|
|
6
|
-
import { SimpleSelect } from "./SimpleSelect.js";
|
|
7
|
-
import { generateSchemaExample } from "./util/generateSchemaExample.js";
|
|
8
|
-
const formatExample = (example) => {
|
|
9
|
-
if (example == null)
|
|
10
|
-
return "No example";
|
|
11
|
-
if (typeof example === "string" || typeof example !== "object") {
|
|
12
|
-
return String(example).trim();
|
|
13
|
-
}
|
|
14
|
-
return JSON.stringify(example, null, 2);
|
|
15
|
-
};
|
|
16
|
-
const getLanguageForContentType = (mediaType) => mediaType
|
|
17
|
-
? ({
|
|
18
|
-
"application/json": "json",
|
|
19
|
-
"application/xml": "xml",
|
|
20
|
-
"application/x-yaml": "yaml",
|
|
21
|
-
"text/csv": "csv",
|
|
22
|
-
"application/javascript": "javascript",
|
|
23
|
-
"application/graphql": "graphql",
|
|
24
|
-
"text/plain": "plain",
|
|
25
|
-
"application/x-www-form-urlencoded": "plain",
|
|
26
|
-
"multipart/form-data": "plain",
|
|
27
|
-
"application/x-protobuf": "plain",
|
|
28
|
-
}[mediaType] ?? "plain")
|
|
29
|
-
: "plain";
|
|
30
|
-
const getExampleName = (example) => {
|
|
31
|
-
if (example.summary)
|
|
32
|
-
return example.summary;
|
|
33
|
-
if (example.name)
|
|
34
|
-
return example.name;
|
|
35
|
-
if (example.description)
|
|
36
|
-
return example.description;
|
|
37
|
-
};
|
|
38
|
-
const getExampleValue = (example) => {
|
|
39
|
-
if (!example)
|
|
40
|
-
return undefined;
|
|
41
|
-
if (example.value !== undefined)
|
|
42
|
-
return example.value;
|
|
43
|
-
if (example.externalValue)
|
|
44
|
-
return example.externalValue;
|
|
45
|
-
if (example.name)
|
|
46
|
-
return example;
|
|
47
|
-
};
|
|
48
|
-
export const useSidecarExamples = ({ content, description, }) => {
|
|
49
|
-
const [selectedContentTypeIndex, setSelectedContentTypeIndex] = useState(0);
|
|
50
|
-
const [selectedExampleIndex, setSelectedExampleIndex] = useState(0);
|
|
51
|
-
const selectedContent = content[selectedContentTypeIndex];
|
|
52
|
-
const examples = (selectedContent?.examples ?? []);
|
|
53
|
-
const hasExamples = examples.length > 0;
|
|
54
|
-
const selectedExample = hasExamples
|
|
55
|
-
? examples[selectedExampleIndex]
|
|
56
|
-
: undefined;
|
|
57
|
-
const example = hasExamples
|
|
58
|
-
? getExampleValue(selectedExample)
|
|
59
|
-
: selectedContent?.schema
|
|
60
|
-
? generateSchemaExample(selectedContent.schema)
|
|
61
|
-
: undefined;
|
|
62
|
-
const formattedExample = formatExample(example);
|
|
63
|
-
const language = getLanguageForContentType(selectedContent?.mediaType);
|
|
64
|
-
const SidecarBody = () => (_jsxs(SidecarBox.Body, { className: "p-0", children: [selectedExample?.externalValue ? (_jsx("div", { className: "p-2", children: _jsx("a", { href: selectedExample.externalValue, target: "_blank", rel: "noopener noreferrer", className: "text-xs text-primary hover:underline", children: "View External Example \u2192" }) })) : (_jsx(CollapsibleCode, { children: _jsx(SyntaxHighlight, { language: language, noBackground: true, copyable: true, className: "[--scrollbar-color:gray] text-xs max-h-[500px] p-2", code: formattedExample }) })), selectedExample?.description && (_jsx("div", { className: "border-t text-xs px-2 py-1", children: selectedExample.description }))] }));
|
|
65
|
-
const SidebarFooter = () => (_jsxs(SidecarBox.Footer, { className: "flex items-center text-xs gap-2 justify-between py-1", children: [_jsxs("div", { className: "flex items-center gap-2 min-w-0", children: [content.length > 1 ? (_jsx("div", { className: "flex items-center gap-1", children: _jsx(SimpleSelect, { className: "max-w-[200px]", value: selectedContentTypeIndex.toString(), onChange: (e) => setSelectedContentTypeIndex(Number(e.target.value)), options: content.map((c, index) => ({
|
|
66
|
-
value: index.toString(),
|
|
67
|
-
label: c.mediaType,
|
|
68
|
-
})) }) })) : (_jsx("span", { className: "font-mono text-[11px]", children: content[0]?.mediaType })), description && (_jsx("span", { className: "text-muted-foreground truncate", children: description }))] }), examples.length > 1 && (_jsx("div", { className: "flex items-center gap-1", children: _jsx(SimpleSelect, { className: "max-w-[180px]", value: selectedExampleIndex.toString(), onChange: (e) => setSelectedExampleIndex(Number(e.target.value)), options: examples.map((example, index) => ({
|
|
69
|
-
value: index.toString(),
|
|
70
|
-
label: getExampleName(example) ?? `Example ${index + 1}`,
|
|
71
|
-
})) }) }))] }));
|
|
72
|
-
return {
|
|
73
|
-
SidecarBody,
|
|
74
|
-
SidebarFooter,
|
|
75
|
-
hasContent: hasExamples || content.length > 0,
|
|
76
|
-
};
|
|
77
|
-
};
|
|
78
|
-
//# sourceMappingURL=ExampleDisplay.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ExampleDisplay.js","sourceRoot":"","sources":["../../../../src/lib/plugins/openapi/ExampleDisplay.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAEtE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AASxE,MAAM,aAAa,GAAG,CAAC,OAAgB,EAAE,EAAE;IACzC,IAAI,OAAO,IAAI,IAAI;QAAE,OAAO,YAAY,CAAC;IAEzC,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAC/D,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;IAChC,CA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Q,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;wBACzC,KAAK,EAAE,KAAK,CAAC,QAAQ,EAAE;wBACvB,KAAK,EAAE,cAAc,CAAC,OAAO,CAAC,IAAI,WAAW,KAAK,GAAG,CAAC,EAAE;qBACzD,CAAC,CAAC,GACH,GACE,CACP,IACiB,CACrB,CAAC;IAEF,OAAO;QACL,WAAW;QACX,aAAa;QACb,UAAU,EAAE,WAAW,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;KAC9C,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { createServer } from "./createServer.js";
|
|
2
|
-
const localServer = createServer();
|
|
3
|
-
const worker = self;
|
|
4
|
-
worker.addEventListener("connect", (event) => {
|
|
5
|
-
const mainPort = event.ports[0];
|
|
6
|
-
mainPort.onmessage = (e) => {
|
|
7
|
-
if (e.data.port) {
|
|
8
|
-
const clientPort = e.data.port;
|
|
9
|
-
clientPort.onmessage = async (event) => {
|
|
10
|
-
const { id, body } = event.data;
|
|
11
|
-
const response = await localServer.fetch(new Request("/__z/graphql", {
|
|
12
|
-
method: "POST",
|
|
13
|
-
body,
|
|
14
|
-
headers: {
|
|
15
|
-
"Content-Type": "application/json",
|
|
16
|
-
},
|
|
17
|
-
}));
|
|
18
|
-
const responseBody = await response.text();
|
|
19
|
-
clientPort.postMessage({
|
|
20
|
-
id,
|
|
21
|
-
body: responseBody,
|
|
22
|
-
});
|
|
23
|
-
};
|
|
24
|
-
clientPort.start();
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
mainPort.start();
|
|
28
|
-
});
|
|
29
|
-
//# sourceMappingURL=worker.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"worker.js","sourceRoot":"","sources":["../../../../../src/lib/plugins/openapi/client/worker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAIjD,MAAM,WAAW,GAAG,YAAY,EAAE,CAAC;AAEnC,MAAM,MAAM,GAAG,IAA0C,CAAC;AAE1D,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE;IAC3C,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAEhC,QAAS,CAAC,SAAS,GAAG,CAAC,CAAC,EAAE,EAAE;QAC1B,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;YAChB,MAAM,UAAU,GAAG,CAAC,CAAC,IAAI,CAAC,IAAmB,CAAC;YAE9C,UAAU,CAAC,SAAS,GAAG,KAAK,EAC1B,KAAiD,EACjD,EAAE;gBACF,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC;gBAEhC,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,KAAK,CACtC,IAAI,OAAO,CAAC,cAAc,EAAE;oBAC1B,MAAM,EAAE,MAAM;oBACd,IAAI;oBACJ,OAAO,EAAE;wBACP,cAAc,EAAE,kBAAkB;qBACnC;iBACF,CAAC,CACH,CAAC;gBAEF,MAAM,YAAY,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;gBAE3C,UAAU,CAAC,WAAW,CAAC;oBACrB,EAAE;oBACF,IAAI,EAAE,YAAY;iBACK,CAAC,CAAC;YAC7B,CAAC,CAAC;YAEF,UAAU,CAAC,KAAK,EAAE,CAAC;QACrB,CAAC;IACH,CAAC,CAAC;IAEF,QAAS,CAAC,KAAK,EAAE,CAAC;AACpB,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const initializeWorker: () => SharedWorker;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export const initializeWorker = () => {
|
|
2
|
-
const worker = new SharedWorker(new URL("./openapi/client/worker.ts", import.meta.url), { type: "module" });
|
|
3
|
-
// eslint-disable-next-line no-console
|
|
4
|
-
worker.onerror = (e) => console.error(e);
|
|
5
|
-
worker.port.start();
|
|
6
|
-
return worker;
|
|
7
|
-
};
|
|
8
|
-
//# sourceMappingURL=openapi-worker.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"openapi-worker.js","sourceRoot":"","sources":["../../../src/lib/plugins/openapi-worker.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,EAAE;IACnC,MAAM,MAAM,GAAG,IAAI,YAAY,CAC7B,IAAI,GAAG,CAAC,4BAA4B,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EACtD,EAAE,IAAI,EAAE,QAAQ,EAAE,CACnB,CAAC;IACF,sCAAsC;IACtC,MAAM,CAAC,OAAO,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACzC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;IAEpB,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
|
package/lib/Dialog-Bxv1yEIg.js
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { j as t } from "./jsx-runtime-Dx-03ztt.js";
|
|
2
|
-
import * as a from "@radix-ui/react-dialog";
|
|
3
|
-
import { X as r } from "lucide-react";
|
|
4
|
-
import * as i from "react";
|
|
5
|
-
import { c as n } from "./cn-qaFjX9_3.js";
|
|
6
|
-
const y = a.Root, N = a.Trigger, c = a.Portal, d = i.forwardRef(({ className: e, ...o }, s) => /* @__PURE__ */ t.jsx(
|
|
7
|
-
a.Overlay,
|
|
8
|
-
{
|
|
9
|
-
ref: s,
|
|
10
|
-
className: n(
|
|
11
|
-
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
12
|
-
e
|
|
13
|
-
),
|
|
14
|
-
...o
|
|
15
|
-
}
|
|
16
|
-
));
|
|
17
|
-
d.displayName = a.Overlay.displayName;
|
|
18
|
-
const m = i.forwardRef(({ className: e, children: o, ...s }, l) => /* @__PURE__ */ t.jsxs(c, { children: [
|
|
19
|
-
/* @__PURE__ */ t.jsx(d, {}),
|
|
20
|
-
/* @__PURE__ */ t.jsxs(
|
|
21
|
-
a.Content,
|
|
22
|
-
{
|
|
23
|
-
ref: l,
|
|
24
|
-
className: n(
|
|
25
|
-
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
|
|
26
|
-
e
|
|
27
|
-
),
|
|
28
|
-
...s,
|
|
29
|
-
children: [
|
|
30
|
-
o,
|
|
31
|
-
/* @__PURE__ */ t.jsxs(a.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
|
|
32
|
-
/* @__PURE__ */ t.jsx(r, { className: "h-4 w-4" }),
|
|
33
|
-
/* @__PURE__ */ t.jsx("span", { className: "sr-only", children: "Close" })
|
|
34
|
-
] })
|
|
35
|
-
]
|
|
36
|
-
}
|
|
37
|
-
)
|
|
38
|
-
] }));
|
|
39
|
-
m.displayName = a.Content.displayName;
|
|
40
|
-
const p = i.forwardRef(({ className: e, ...o }, s) => /* @__PURE__ */ t.jsx(
|
|
41
|
-
a.Title,
|
|
42
|
-
{
|
|
43
|
-
ref: s,
|
|
44
|
-
className: n(
|
|
45
|
-
"text-lg font-semibold leading-none tracking-tight",
|
|
46
|
-
e
|
|
47
|
-
),
|
|
48
|
-
...o
|
|
49
|
-
}
|
|
50
|
-
));
|
|
51
|
-
p.displayName = a.Title.displayName;
|
|
52
|
-
const f = i.forwardRef(({ className: e, ...o }, s) => /* @__PURE__ */ t.jsx(
|
|
53
|
-
a.Description,
|
|
54
|
-
{
|
|
55
|
-
ref: s,
|
|
56
|
-
className: n("text-sm text-muted-foreground", e),
|
|
57
|
-
...o
|
|
58
|
-
}
|
|
59
|
-
));
|
|
60
|
-
f.displayName = a.Description.displayName;
|
|
61
|
-
export {
|
|
62
|
-
y as D,
|
|
63
|
-
m as a,
|
|
64
|
-
N as b,
|
|
65
|
-
p as c
|
|
66
|
-
};
|
|
67
|
-
//# sourceMappingURL=Dialog-Bxv1yEIg.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog-Bxv1yEIg.js","sources":["../src/lib/ui/Dialog.tsx"],"sourcesContent":["import * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { X } from \"lucide-react\";\nimport * as React from \"react\";\n\nimport { cn } from \"../util/cn.js\";\n\nconst Dialog = DialogPrimitive.Root;\n\nconst DialogTrigger = DialogPrimitive.Trigger;\n\nconst DialogPortal = DialogPrimitive.Portal;\n\nconst DialogClose = DialogPrimitive.Close;\n\nconst DialogOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n \"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n className,\n )}\n {...props}\n />\n));\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\n\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n ref={ref}\n className={cn(\n \"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg\",\n className,\n )}\n {...props}\n >\n {children}\n <DialogPrimitive.Close className=\"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground\">\n <X className=\"h-4 w-4\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n </DialogPrimitive.Content>\n </DialogPortal>\n));\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\nconst DialogHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"flex flex-col space-y-1.5 text-center sm:text-left\",\n className,\n )}\n {...props}\n />\n);\nDialogHeader.displayName = \"DialogHeader\";\n\nconst DialogFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\",\n className,\n )}\n {...props}\n />\n);\nDialogFooter.displayName = \"DialogFooter\";\n\nconst DialogTitle = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn(\n \"text-lg font-semibold leading-none tracking-tight\",\n className,\n )}\n {...props}\n />\n));\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\n\nconst DialogDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n));\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n};\n"],"names":["Dialog","DialogPrimitive","DialogTrigger","DialogPortal","DialogOverlay","React","className","props","ref","jsx","cn","DialogContent","children","jsxs","X","DialogTitle","DialogDescription"],"mappings":";;;;;AAMA,MAAMA,IAASC,EAAgB,MAEzBC,IAAgBD,EAAgB,SAEhCE,IAAeF,EAAgB,QAI/BG,IAAgBC,EAAM,WAG1B,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAM,GAAGC,MAC1BC,gBAAAA,EAAA;AAAA,EAACR,EAAgB;AAAA,EAAhB;AAAA,IACC,KAAAO;AAAA,IACA,WAAWE;AAAA,MACT;AAAA,MACAJ;AAAA,IACF;AAAA,IACC,GAAGC;AAAA,EAAA;AACN,CACD;AACDH,EAAc,cAAcH,EAAgB,QAAQ;AAEpD,MAAMU,IAAgBN,EAAM,WAG1B,CAAC,EAAE,WAAAC,GAAW,UAAAM,GAAU,GAAGL,EAAM,GAAGC,MACpCK,gBAAAA,EAAAA,KAACV,GACC,EAAA,UAAA;AAAA,EAAAM,gBAAAA,EAAA,IAACL,GAAc,EAAA;AAAA,EACfS,gBAAAA,EAAA;AAAA,IAACZ,EAAgB;AAAA,IAAhB;AAAA,MACC,KAAAO;AAAA,MACA,WAAWE;AAAA,QACT;AAAA,QACAJ;AAAA,MACF;AAAA,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