zudoku 0.3.0-dev.77 → 0.3.0-dev.79
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/config/validators/validate.d.ts +130 -130
- package/dist/lib/authentication/providers/openid.d.ts +1 -1
- package/dist/lib/authentication/providers/openid.js +1 -1
- package/dist/lib/authentication/providers/openid.js.map +1 -1
- package/dist/lib/components/DevPortal.js +11 -2
- package/dist/lib/components/DevPortal.js.map +1 -1
- package/dist/lib/components/Heading.d.ts +1 -1
- package/dist/lib/core/plugins.d.ts +3 -0
- package/dist/lib/core/plugins.js +1 -0
- package/dist/lib/core/plugins.js.map +1 -1
- package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.d.ts +2 -1
- package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js +8 -16
- package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js.map +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js +18 -1
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/gql.d.ts +6 -6
- package/dist/lib/plugins/openapi/graphql/gql.js +1 -1
- package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/graphql.d.ts +15 -15
- package/dist/lib/plugins/openapi/graphql/graphql.js +67 -67
- package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
- package/dist/lib/plugins/openapi/index.js +7 -1
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/PathParams.d.ts +2 -3
- package/dist/lib/plugins/openapi/playground/PathParams.js +3 -4
- package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/Playground.d.ts +22 -10
- package/dist/lib/plugins/openapi/playground/Playground.js +40 -28
- package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.d.ts +3 -1
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +1 -1
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/QueryParams.d.ts +3 -2
- package/dist/lib/plugins/openapi/playground/QueryParams.js +10 -5
- package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/ResponseTab.d.ts +4 -0
- package/dist/lib/plugins/openapi/playground/ResponseTab.js +40 -0
- package/dist/lib/plugins/openapi/playground/ResponseTab.js.map +1 -0
- package/dist/lib/ui/Button.d.ts +5 -1
- package/dist/lib/ui/Button.js +24 -1
- package/dist/lib/ui/Button.js.map +1 -1
- package/dist/lib/util/fetchTimeout.d.ts +1 -0
- package/dist/lib/util/fetchTimeout.js +14 -0
- package/dist/lib/util/fetchTimeout.js.map +1 -0
- package/lib/{CategoryHeading-D0V23fMT.js → CategoryHeading-DCmchnA1.js} +2 -2
- package/lib/{CategoryHeading-D0V23fMT.js.map → CategoryHeading-DCmchnA1.js.map} +1 -1
- package/lib/{Combination-CgxP9BB4.js → Combination-CS4rK8IJ.js} +33 -39
- package/lib/Combination-CS4rK8IJ.js.map +1 -0
- package/lib/DeveloperHint-DQVwIery.js +10 -0
- package/lib/DeveloperHint-DQVwIery.js.map +1 -0
- package/lib/{Input-BcZoDid4.js → Input-GFpPXs5b.js} +3 -3
- package/lib/{Input-BcZoDid4.js.map → Input-GFpPXs5b.js.map} +1 -1
- package/lib/{Markdown-IsabnbGN.js → Markdown-QsZ-PHET.js} +3 -3
- package/lib/{Markdown-IsabnbGN.js.map → Markdown-QsZ-PHET.js.map} +1 -1
- package/lib/{MdxPage-B1B2Inj5.js → MdxPage-V4FCB0C_.js} +3 -3
- package/lib/{MdxPage-B1B2Inj5.js.map → MdxPage-V4FCB0C_.js.map} +1 -1
- package/lib/OperationList-C-M33Hxu.js +4368 -0
- package/lib/OperationList-C-M33Hxu.js.map +1 -0
- package/lib/{Route-D0Ub80Oa.js → Route-CogU1ofM.js} +2 -2
- package/lib/{Route-D0Ub80Oa.js.map → Route-CogU1ofM.js.map} +1 -1
- package/lib/{SlotletProvider-CJXWb2gw.js → SlotletProvider-D_Vz-7c_.js} +4 -4
- package/lib/{SlotletProvider-CJXWb2gw.js.map → SlotletProvider-D_Vz-7c_.js.map} +1 -1
- package/lib/Spinner-oNQQyp-I.js +244 -0
- package/lib/Spinner-oNQQyp-I.js.map +1 -0
- package/lib/index-D4bOMg7f.js +124 -0
- package/lib/index-D4bOMg7f.js.map +1 -0
- package/lib/index-Uqja2h2M.js +1960 -0
- package/lib/index-Uqja2h2M.js.map +1 -0
- package/lib/{urql-DMlBWUKL.js → urql-DrBfkb92.js} +2 -3
- package/lib/{urql-DMlBWUKL.js.map → urql-DrBfkb92.js.map} +1 -1
- package/lib/zudoku.auth-openid.js +1 -1
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.components.js +352 -348
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.openapi-worker.js +1 -1
- package/lib/zudoku.plugin-api-keys.js +7 -6
- package/lib/zudoku.plugin-api-keys.js.map +1 -1
- package/lib/zudoku.plugin-custom-page.js +1 -1
- package/lib/zudoku.plugin-markdown.js +1 -1
- package/lib/zudoku.plugin-openapi.js +5 -4
- package/lib/zudoku.plugin-openapi.js.map +1 -1
- package/package.json +1 -1
- package/src/app/main.css +1 -1
- package/src/lib/authentication/providers/openid.tsx +1 -1
- package/src/lib/components/DevPortal.tsx +14 -5
- package/src/lib/core/plugins.ts +7 -0
- package/src/lib/plugins/openapi/PlaygroundDialogWrapper.tsx +9 -17
- package/src/lib/plugins/openapi/Sidecar.tsx +23 -1
- package/src/lib/plugins/openapi/graphql/gql.ts +8 -8
- package/src/lib/plugins/openapi/graphql/graphql.ts +80 -80
- package/src/lib/plugins/openapi/index.tsx +21 -0
- package/src/lib/plugins/openapi/playground/PathParams.tsx +14 -20
- package/src/lib/plugins/openapi/playground/Playground.tsx +76 -56
- package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +10 -6
- package/src/lib/plugins/openapi/playground/QueryParams.tsx +86 -72
- package/src/lib/plugins/openapi/playground/ResponseTab.tsx +76 -0
- package/src/lib/ui/Button.tsx +32 -2
- package/src/lib/util/fetchTimeout.tsx +21 -0
- package/dist/lib/ui/button-variants.d.ts +0 -4
- package/dist/lib/ui/button-variants.js +0 -25
- package/dist/lib/ui/button-variants.js.map +0 -1
- package/lib/Combination-CgxP9BB4.js.map +0 -1
- package/lib/OperationList-B2nsuf1v.js +0 -5471
- package/lib/OperationList-B2nsuf1v.js.map +0 -1
- package/lib/Spinner-BhtSoFka.js +0 -359
- package/lib/Spinner-BhtSoFka.js.map +0 -1
- package/lib/index-BC2Ob2BR.js +0 -727
- package/lib/index-BC2Ob2BR.js.map +0 -1
- package/src/lib/ui/button-variants.ts +0 -32
|
@@ -9,12 +9,18 @@ import { Button } from "../../../ui/Button.js";
|
|
|
9
9
|
import { Input } from "../../../ui/Input.js";
|
|
10
10
|
import { cn } from "../../../util/cn.js";
|
|
11
11
|
import { InlineInput } from "./InlineInput.js";
|
|
12
|
-
import
|
|
12
|
+
import {
|
|
13
|
+
NO_IDENTITY,
|
|
14
|
+
type PlaygroundForm,
|
|
15
|
+
type QueryParam,
|
|
16
|
+
} from "./Playground.js";
|
|
13
17
|
|
|
14
18
|
export const QueryParams = ({
|
|
15
19
|
control,
|
|
20
|
+
queryParams,
|
|
16
21
|
}: {
|
|
17
22
|
control: Control<PlaygroundForm>;
|
|
23
|
+
queryParams: QueryParam[];
|
|
18
24
|
}) => {
|
|
19
25
|
const { fields } = useFieldArray<PlaygroundForm>({
|
|
20
26
|
control,
|
|
@@ -22,93 +28,101 @@ export const QueryParams = ({
|
|
|
22
28
|
});
|
|
23
29
|
const form = useFormContext<PlaygroundForm>();
|
|
24
30
|
|
|
25
|
-
const requiredFields =
|
|
26
|
-
|
|
27
|
-
|
|
31
|
+
const requiredFields = queryParams.map((param) => Boolean(param.isRequired));
|
|
32
|
+
|
|
33
|
+
const selectedIdentity = form.watch("identity");
|
|
34
|
+
const hasSelectedIdentity = selectedIdentity !== NO_IDENTITY;
|
|
28
35
|
|
|
29
36
|
return (
|
|
30
37
|
<div className="">
|
|
31
38
|
<table className="w-full [&_td]:border [&_td]:p-1.5 [&_td]:px-2">
|
|
32
39
|
<tbody>
|
|
33
|
-
{fields
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
type="checkbox"
|
|
42
|
-
id={`queryParams.${i}.active`}
|
|
43
|
-
checked={field.value}
|
|
44
|
-
onChange={field.onChange}
|
|
45
|
-
/>
|
|
46
|
-
)}
|
|
47
|
-
/>
|
|
48
|
-
</td>
|
|
49
|
-
<td>
|
|
50
|
-
<Controller
|
|
51
|
-
control={control}
|
|
52
|
-
render={({ field }) => (
|
|
53
|
-
<InlineInput asChild>
|
|
54
|
-
<label
|
|
55
|
-
className="flex items-center cursor-pointer"
|
|
56
|
-
htmlFor={`queryParams.${i}.active`}
|
|
57
|
-
title={requiredFields[i] ? "Required field" : undefined}
|
|
58
|
-
>
|
|
59
|
-
{field.value}
|
|
60
|
-
{requiredFields[i] && <sup> *</sup>}
|
|
61
|
-
</label>
|
|
62
|
-
</InlineInput>
|
|
63
|
-
)}
|
|
64
|
-
name={`queryParams.${i}.name`}
|
|
65
|
-
/>
|
|
66
|
-
</td>
|
|
67
|
-
<td>
|
|
68
|
-
<div className="flex justify-between items-center">
|
|
40
|
+
{fields
|
|
41
|
+
.filter(
|
|
42
|
+
// TODO remove this hack for Accu or make it more generic
|
|
43
|
+
(field) => !(hasSelectedIdentity && field.name === "apikey"),
|
|
44
|
+
)
|
|
45
|
+
.map((field, i) => (
|
|
46
|
+
<tr key={field.id} className="hover:bg-accent/40">
|
|
47
|
+
<td className="text-center">
|
|
69
48
|
<Controller
|
|
70
49
|
control={control}
|
|
50
|
+
name={`queryParams.${i}.active`}
|
|
71
51
|
render={({ field }) => (
|
|
72
|
-
<
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
form.setValue(`queryParams.${i}.active`, true);
|
|
78
|
-
}
|
|
79
|
-
}}
|
|
80
|
-
placeholder="Enter value"
|
|
81
|
-
className="w-full border-0 shadow-none text-xs font-mono"
|
|
52
|
+
<input
|
|
53
|
+
type="checkbox"
|
|
54
|
+
id={`queryParams.${i}.active`}
|
|
55
|
+
checked={field.value}
|
|
56
|
+
onChange={field.onChange}
|
|
82
57
|
/>
|
|
83
58
|
)}
|
|
84
|
-
name={`queryParams.${i}.value`}
|
|
85
59
|
/>
|
|
60
|
+
</td>
|
|
61
|
+
<td>
|
|
86
62
|
<Controller
|
|
87
63
|
control={control}
|
|
88
64
|
render={({ field }) => (
|
|
89
|
-
<
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
onClick={() => field.onChange("")}
|
|
102
|
-
>
|
|
103
|
-
<EraserIcon size={16} />
|
|
104
|
-
</Button>
|
|
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>
|
|
105
77
|
)}
|
|
106
|
-
name={`queryParams.${i}.
|
|
78
|
+
name={`queryParams.${i}.name`}
|
|
107
79
|
/>
|
|
108
|
-
</
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
80
|
+
</td>
|
|
81
|
+
<td>
|
|
82
|
+
<div className="flex justify-between items-center">
|
|
83
|
+
<Controller
|
|
84
|
+
control={control}
|
|
85
|
+
render={({ field }) => (
|
|
86
|
+
<Input
|
|
87
|
+
{...field}
|
|
88
|
+
onChange={(e) => {
|
|
89
|
+
field.onChange(e.target.value);
|
|
90
|
+
if (e.target.value.length > 0) {
|
|
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"
|
|
96
|
+
/>
|
|
97
|
+
)}
|
|
98
|
+
name={`queryParams.${i}.value`}
|
|
99
|
+
/>
|
|
100
|
+
<Controller
|
|
101
|
+
control={control}
|
|
102
|
+
render={({ field }) => (
|
|
103
|
+
<Button
|
|
104
|
+
size="icon"
|
|
105
|
+
type="button"
|
|
106
|
+
variant="ghost"
|
|
107
|
+
aria-label="Clear value"
|
|
108
|
+
className={cn(
|
|
109
|
+
"ms-2",
|
|
110
|
+
field.value.length === 0
|
|
111
|
+
? "opacity-0 pointer-events-none"
|
|
112
|
+
: "opacity-100",
|
|
113
|
+
)}
|
|
114
|
+
title="Clear value"
|
|
115
|
+
onClick={() => field.onChange("")}
|
|
116
|
+
>
|
|
117
|
+
<EraserIcon size={16} />
|
|
118
|
+
</Button>
|
|
119
|
+
)}
|
|
120
|
+
name={`queryParams.${i}.value`}
|
|
121
|
+
/>
|
|
122
|
+
</div>
|
|
123
|
+
</td>
|
|
124
|
+
</tr>
|
|
125
|
+
))}
|
|
112
126
|
</tbody>
|
|
113
127
|
</table>
|
|
114
128
|
</div>
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import { SyntaxHighlight } from "../../../components/SyntaxHighlight.js";
|
|
3
|
+
import { Card } from "../../../ui/Card.js";
|
|
4
|
+
import { SimpleSelect } from "../SimpleSelect.js";
|
|
5
|
+
|
|
6
|
+
const mimeTypeToLanguage = (mimeType: string) => {
|
|
7
|
+
const mimeTypeMapping = {
|
|
8
|
+
"application/json": "json",
|
|
9
|
+
"text/json": "json",
|
|
10
|
+
"text/html": "html",
|
|
11
|
+
"text/css": "css",
|
|
12
|
+
"text/javascript": "javascript",
|
|
13
|
+
"application/xml": "xml",
|
|
14
|
+
"application/xhtml+xml": "xhtml",
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
return Object.entries(mimeTypeMapping).find(([mime]) =>
|
|
18
|
+
mimeType.includes(mime),
|
|
19
|
+
)?.[1];
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const detectLanguage = (headers: Headers) => {
|
|
23
|
+
const contentType = headers.get("Content-Type") || "";
|
|
24
|
+
return mimeTypeToLanguage(contentType);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const tryParseJson = (body: string) => {
|
|
28
|
+
try {
|
|
29
|
+
return JSON.stringify(JSON.parse(body), null, 2);
|
|
30
|
+
} catch {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const ResponseTab = ({
|
|
36
|
+
body = "",
|
|
37
|
+
headers,
|
|
38
|
+
}: {
|
|
39
|
+
body?: string;
|
|
40
|
+
headers: Headers;
|
|
41
|
+
}) => {
|
|
42
|
+
const detectedLanguage = detectLanguage(headers);
|
|
43
|
+
const jsonContent = tryParseJson(body);
|
|
44
|
+
const beautifiedBody = jsonContent || body;
|
|
45
|
+
const [view, setView] = useState<"formatted" | "raw">(
|
|
46
|
+
jsonContent ? "formatted" : "raw",
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<div className="flex flex-col gap-2">
|
|
51
|
+
<Card className="shadow-none">
|
|
52
|
+
<SyntaxHighlight
|
|
53
|
+
language={
|
|
54
|
+
view === "raw" ? (jsonContent ? "plain" : detectedLanguage) : "json"
|
|
55
|
+
}
|
|
56
|
+
noBackground
|
|
57
|
+
showLanguageIndicator
|
|
58
|
+
className="overflow-x-auto p-4 text-xs"
|
|
59
|
+
code={view === "raw" ? body : beautifiedBody}
|
|
60
|
+
/>
|
|
61
|
+
</Card>
|
|
62
|
+
{jsonContent && (
|
|
63
|
+
<div className="flex justify-end">
|
|
64
|
+
<SimpleSelect
|
|
65
|
+
value={view}
|
|
66
|
+
onChange={(e) => setView(e.target.value as "formatted" | "raw")}
|
|
67
|
+
options={[
|
|
68
|
+
{ value: "formatted", label: "Formatted" },
|
|
69
|
+
{ value: "raw", label: "Raw" },
|
|
70
|
+
]}
|
|
71
|
+
/>
|
|
72
|
+
</div>
|
|
73
|
+
)}
|
|
74
|
+
</div>
|
|
75
|
+
);
|
|
76
|
+
};
|
package/src/lib/ui/Button.tsx
CHANGED
|
@@ -1,8 +1,38 @@
|
|
|
1
1
|
import { Slot } from "@radix-ui/react-slot";
|
|
2
|
-
import { VariantProps } from "class-variance-authority";
|
|
2
|
+
import { cva, VariantProps } from "class-variance-authority";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { cn } from "../util/cn.js";
|
|
5
|
-
|
|
5
|
+
|
|
6
|
+
const buttonVariants = cva(
|
|
7
|
+
"not-prose inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
|
|
8
|
+
{
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
default:
|
|
12
|
+
"bg-primary text-primary-foreground shadow hover:bg-primary/90",
|
|
13
|
+
destructive:
|
|
14
|
+
"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
|
|
15
|
+
outline:
|
|
16
|
+
"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
|
|
17
|
+
secondary:
|
|
18
|
+
"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
|
|
19
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
20
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
21
|
+
},
|
|
22
|
+
size: {
|
|
23
|
+
default: "h-9 px-4 py-2",
|
|
24
|
+
sm: "h-8 rounded-md px-3 text-xs",
|
|
25
|
+
lg: "h-10 rounded-md px-8",
|
|
26
|
+
xl: "h-14 rounded-lg px-10 text-lg",
|
|
27
|
+
icon: "h-9 w-9",
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
defaultVariants: {
|
|
31
|
+
variant: "default",
|
|
32
|
+
size: "default",
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
);
|
|
6
36
|
|
|
7
37
|
export interface ButtonProps
|
|
8
38
|
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export const fetchTimeout = async (
|
|
2
|
+
input: RequestInfo,
|
|
3
|
+
init?: RequestInit,
|
|
4
|
+
timeout = 5000,
|
|
5
|
+
): Promise<Response> => {
|
|
6
|
+
const controller = new AbortController();
|
|
7
|
+
const signal = controller.signal;
|
|
8
|
+
|
|
9
|
+
const fetchPromise = fetch(input, { ...init, signal });
|
|
10
|
+
|
|
11
|
+
const timeoutPromise = new Promise<Response>((_, reject) => {
|
|
12
|
+
const timer = setTimeout(() => {
|
|
13
|
+
controller.abort("Request timed out");
|
|
14
|
+
reject(new Error("Request timed out"));
|
|
15
|
+
}, timeout);
|
|
16
|
+
|
|
17
|
+
void fetchPromise.finally(() => clearTimeout(timer));
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
return Promise.race([fetchPromise, timeoutPromise]);
|
|
21
|
+
};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare const buttonVariants: (props?: ({
|
|
2
|
-
variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
3
|
-
size?: "default" | "sm" | "lg" | "xl" | "icon" | null | undefined;
|
|
4
|
-
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { cva } from "class-variance-authority";
|
|
2
|
-
export const buttonVariants = cva("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50", {
|
|
3
|
-
variants: {
|
|
4
|
-
variant: {
|
|
5
|
-
default: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
|
|
6
|
-
destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
|
|
7
|
-
outline: "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
|
|
8
|
-
secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
|
|
9
|
-
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
10
|
-
link: "text-primary underline-offset-4 hover:underline",
|
|
11
|
-
},
|
|
12
|
-
size: {
|
|
13
|
-
default: "h-9 px-4 py-2",
|
|
14
|
-
sm: "h-8 rounded-md px-3 text-xs",
|
|
15
|
-
lg: "h-10 rounded-md px-8",
|
|
16
|
-
xl: "h-14 rounded-lg px-10 text-lg",
|
|
17
|
-
icon: "h-9 w-9",
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
defaultVariants: {
|
|
21
|
-
variant: "default",
|
|
22
|
-
size: "default",
|
|
23
|
-
},
|
|
24
|
-
});
|
|
25
|
-
//# sourceMappingURL=button-variants.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"button-variants.js","sourceRoot":"","sources":["../../../src/lib/ui/button-variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAE/C,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAC/B,qOAAqO,EACrO;IACE,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EACL,+DAA+D;YACjE,WAAW,EACT,8EAA8E;YAChF,OAAO,EACL,0FAA0F;YAC5F,SAAS,EACP,wEAAwE;YAC1E,KAAK,EAAE,8CAA8C;YACrD,IAAI,EAAE,iDAAiD;SACxD;QACD,IAAI,EAAE;YACJ,OAAO,EAAE,eAAe;YACxB,EAAE,EAAE,6BAA6B;YACjC,EAAE,EAAE,sBAAsB;YAC1B,EAAE,EAAE,+BAA+B;YACnC,IAAI,EAAE,SAAS;SAChB;KACF;IACD,eAAe,EAAE;QACf,OAAO,EAAE,SAAS;QAClB,IAAI,EAAE,SAAS;KAChB;CACF,CACF,CAAC"}
|