@krak-stack/registry 0.1.2 → 0.1.4
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/README.md +17 -1
- package/dist/components/ui/alert.d.ts +10 -0
- package/dist/components/ui/app-brand.js +20 -20
- package/dist/components/ui/bubble.d.ts +16 -0
- package/dist/components/ui/code-block.js +38 -38
- package/dist/components/ui/collapsible.d.ts +5 -0
- package/dist/components/ui/copy-button.js +16 -16
- package/dist/components/ui/data-table.js +687 -687
- package/dist/components/ui/editing-locale-switcher.js +54 -54
- package/dist/components/ui/effect-form.js +490 -490
- package/dist/components/ui/empty.d.ts +11 -0
- package/dist/components/ui/file-picker.js +96 -96
- package/dist/components/ui/form.js +418 -418
- package/dist/components/ui/google-map.js +27 -27
- package/dist/components/ui/icon-input.js +93 -93
- package/dist/components/ui/loading.js +5 -5
- package/dist/components/ui/locale-switcher.js +48 -48
- package/dist/components/ui/marker.d.ts +10 -0
- package/dist/components/ui/message-scroller.d.ts +10 -0
- package/dist/components/ui/message.d.ts +10 -0
- package/dist/components/ui/pagination.js +92 -92
- package/dist/components/ui/search-menu.js +93 -93
- package/dist/components/ui/sidebar-layout.js +156 -156
- package/dist/components/ui/stats-card.js +28 -28
- package/dist/components/ui/theme-switcher.js +64 -64
- package/dist/components/ui/virtualized-combobox.js +66 -66
- package/dist/lib/docs-ai.d.ts +136 -0
- package/dist/lib/docs-ai.js +310 -0
- package/dist/lib/docs-core.d.ts +681 -0
- package/dist/lib/docs-core.js +2571 -0
- package/dist/lib/httpapi-ai.d.ts +54 -0
- package/dist/lib/httpapi-ai.js +361 -0
- package/dist/lib/httpapi-cli.d.ts +22 -0
- package/dist/lib/httpapi-cli.js +412 -0
- package/dist/lib/httpapi-client.d.ts +20 -0
- package/dist/lib/httpapi-client.js +50 -0
- package/dist/lib/httpapi-helpers.d.ts +105 -0
- package/dist/lib/httpapi-helpers.js +237 -0
- package/dist/lib/httpapi-mcp.d.ts +20 -0
- package/dist/lib/httpapi-mcp.js +366 -0
- package/dist/lib/query.js +128 -0
- package/dist/services/agent/client/atom.d.ts +56 -0
- package/dist/services/agent/client/index.d.ts +2 -0
- package/dist/services/agent/client/index.js +2239 -0
- package/dist/services/agent/client/widget.d.ts +52 -0
- package/dist/services/agent/index.d.ts +111 -0
- package/dist/services/agent/index.js +190 -0
- package/dist/services/agent/schema.d.ts +161 -0
- package/dist/services/agent/schema.js +135 -0
- package/package.json +59 -3
package/README.md
CHANGED
|
@@ -11,9 +11,25 @@ Import only the subpaths used by the application:
|
|
|
11
11
|
```tsx
|
|
12
12
|
import { DataTable } from "@krak-stack/registry/data-table";
|
|
13
13
|
import { Pagination } from "@krak-stack/registry/pagination";
|
|
14
|
+
import { AgentService } from "@krak-stack/registry/agent";
|
|
15
|
+
import { AgentWidget, makeAgentAtoms } from "@krak-stack/registry/agent/client";
|
|
16
|
+
import { makeAgentApiGroup } from "@krak-stack/registry/agent/schema";
|
|
17
|
+
import { makeHttpApiAiToolkit } from "@krak-stack/registry/httpapi/ai";
|
|
18
|
+
import { ApiClient } from "@krak-stack/registry/httpapi/client";
|
|
19
|
+
import { HttpApiSpec } from "@krak-stack/registry/httpapi/helpers";
|
|
20
|
+
import { createMdxDocsSource, makeDocs } from "@krak-stack/registry/docs";
|
|
21
|
+
import { makeChatDocumentation } from "@krak-stack/registry/docs-ai";
|
|
22
|
+
import { Query } from "@krak-stack/registry/query";
|
|
14
23
|
import { NotificationService } from "@krak-stack/registry/service-notification";
|
|
15
24
|
```
|
|
16
25
|
|
|
26
|
+
HTTP API client, schema, AI tool, CLI, and MCP utilities are available under
|
|
27
|
+
the `@krak-stack/registry/httpapi/*` subpaths. Keep application-specific API
|
|
28
|
+
layers, handlers, authentication, and client bindings in the application.
|
|
29
|
+
|
|
30
|
+
Documentation consumers create their content source in the application so Vite
|
|
31
|
+
can resolve the local `import.meta.glob`, then pass it to `makeDocs`.
|
|
32
|
+
|
|
17
33
|
Add the package's Tailwind source to the application stylesheet:
|
|
18
34
|
|
|
19
35
|
```css
|
|
@@ -26,4 +42,4 @@ The same canonical sources remain available through shadcn:
|
|
|
26
42
|
bunx shadcn@latest add @krak-stack/data-table
|
|
27
43
|
```
|
|
28
44
|
|
|
29
|
-
Project-specific
|
|
45
|
+
Project-specific configuration and scaffolding remain available through shadcn.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const alertVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "destructive" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
+
declare function Alert({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof alertVariants>): React.JSX.Element;
|
|
7
|
+
declare function AlertTitle({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
8
|
+
declare function AlertDescription({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
9
|
+
declare function AlertAction({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
10
|
+
export { Alert, AlertTitle, AlertDescription, AlertAction };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// ../../src/components/ui/app-brand.tsx
|
|
2
2
|
import { Link } from "@tanstack/react-router";
|
|
3
|
-
import {
|
|
3
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
4
4
|
function AppBrand({
|
|
5
5
|
className,
|
|
6
6
|
label,
|
|
@@ -15,63 +15,63 @@ function AppBrand({
|
|
|
15
15
|
const iconClassName = variant === "sidebar" ? "bg-sidebar-primary" : "bg-primary";
|
|
16
16
|
const iconColor = variant === "sidebar" ? "var(--sidebar-primary-foreground)" : "var(--primary-foreground)";
|
|
17
17
|
const contentClassName = variant === "sidebar" ? "group-data-[collapsible=icon]:hidden" : undefined;
|
|
18
|
-
const content = /* @__PURE__ */
|
|
18
|
+
const content = /* @__PURE__ */ jsxs(Fragment, {
|
|
19
19
|
children: [
|
|
20
|
-
/* @__PURE__ */
|
|
20
|
+
/* @__PURE__ */ jsx("div", {
|
|
21
21
|
className: [
|
|
22
22
|
"flex size-8 shrink-0 items-center justify-center overflow-hidden rounded-md",
|
|
23
23
|
imageSrc ? "border bg-background" : iconClassName
|
|
24
24
|
].join(" "),
|
|
25
|
-
children: imageSrc ? /* @__PURE__ */
|
|
25
|
+
children: imageSrc ? /* @__PURE__ */ jsx("img", {
|
|
26
26
|
src: imageSrc,
|
|
27
27
|
alt: label,
|
|
28
28
|
className: "size-full object-cover"
|
|
29
|
-
}
|
|
29
|
+
}) : Icon ? /* @__PURE__ */ jsx(Icon, {
|
|
30
30
|
className: "size-4",
|
|
31
31
|
color: iconColor
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
/* @__PURE__ */
|
|
32
|
+
}) : null
|
|
33
|
+
}),
|
|
34
|
+
/* @__PURE__ */ jsxs("div", {
|
|
35
35
|
className: ["flex min-w-0 flex-col leading-tight", contentClassName].filter(Boolean).join(" "),
|
|
36
36
|
children: [
|
|
37
|
-
/* @__PURE__ */
|
|
37
|
+
/* @__PURE__ */ jsx("span", {
|
|
38
38
|
className: "truncate font-semibold tracking-tight",
|
|
39
39
|
children: label
|
|
40
|
-
}
|
|
41
|
-
subtitle ? /* @__PURE__ */
|
|
40
|
+
}),
|
|
41
|
+
subtitle ? /* @__PURE__ */ jsx("span", {
|
|
42
42
|
className: "text-muted-foreground truncate text-xs",
|
|
43
43
|
children: subtitle
|
|
44
|
-
}
|
|
44
|
+
}) : null
|
|
45
45
|
]
|
|
46
|
-
}
|
|
46
|
+
})
|
|
47
47
|
]
|
|
48
|
-
}
|
|
48
|
+
});
|
|
49
49
|
const brandClassName = [
|
|
50
50
|
"flex min-w-0 items-center gap-2 text-foreground hover:text-foreground",
|
|
51
51
|
variant === "sidebar" ? "p-2 group-data-[collapsible=icon]:justify-center group-data-[collapsible=icon]:p-0" : "",
|
|
52
52
|
className
|
|
53
53
|
].filter(Boolean).join(" ");
|
|
54
54
|
if (to === null) {
|
|
55
|
-
return /* @__PURE__ */
|
|
55
|
+
return /* @__PURE__ */ jsx("div", {
|
|
56
56
|
className: brandClassName,
|
|
57
57
|
...props,
|
|
58
58
|
children: content
|
|
59
|
-
}
|
|
59
|
+
});
|
|
60
60
|
}
|
|
61
61
|
if (href) {
|
|
62
|
-
return /* @__PURE__ */
|
|
62
|
+
return /* @__PURE__ */ jsx("a", {
|
|
63
63
|
className: brandClassName,
|
|
64
64
|
href,
|
|
65
65
|
...props,
|
|
66
66
|
children: content
|
|
67
|
-
}
|
|
67
|
+
});
|
|
68
68
|
}
|
|
69
|
-
return /* @__PURE__ */
|
|
69
|
+
return /* @__PURE__ */ jsx(Link, {
|
|
70
70
|
to: to ?? "/",
|
|
71
71
|
className: brandClassName,
|
|
72
72
|
...props,
|
|
73
73
|
children: content
|
|
74
|
-
}
|
|
74
|
+
});
|
|
75
75
|
}
|
|
76
76
|
export {
|
|
77
77
|
AppBrand
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
3
|
+
import { type VariantProps } from "class-variance-authority";
|
|
4
|
+
declare function BubbleGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
5
|
+
declare const bubbleVariants: (props?: ({
|
|
6
|
+
variant?: "default" | "destructive" | "ghost" | "muted" | "outline" | "secondary" | "tinted" | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
+
declare function Bubble({ variant, align, className, ...props }: React.ComponentProps<"div"> & VariantProps<typeof bubbleVariants> & {
|
|
9
|
+
align?: "start" | "end";
|
|
10
|
+
}): React.JSX.Element;
|
|
11
|
+
declare function BubbleContent({ className, render, ...props }: useRender.ComponentProps<"div">): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
12
|
+
declare function BubbleReactions({ side, align, className, ...props }: React.ComponentProps<"div"> & {
|
|
13
|
+
align?: "start" | "end";
|
|
14
|
+
side?: "top" | "bottom";
|
|
15
|
+
}): React.JSX.Element;
|
|
16
|
+
export { BubbleGroup, Bubble, BubbleContent, BubbleReactions };
|
|
@@ -10,7 +10,7 @@ function cn(...inputs) {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
// ../../src/components/ui/button.tsx
|
|
13
|
-
import {
|
|
13
|
+
import { jsx } from "react/jsx-runtime";
|
|
14
14
|
var buttonVariants = cva("group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
|
|
15
15
|
variants: {
|
|
16
16
|
variant: {
|
|
@@ -43,17 +43,17 @@ function Button({
|
|
|
43
43
|
size = "default",
|
|
44
44
|
...props
|
|
45
45
|
}) {
|
|
46
|
-
return /* @__PURE__ */
|
|
46
|
+
return /* @__PURE__ */ jsx(ButtonPrimitive, {
|
|
47
47
|
"data-slot": "button",
|
|
48
48
|
className: cn(buttonVariants({ variant, size, className })),
|
|
49
49
|
...props
|
|
50
|
-
}
|
|
50
|
+
});
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
// ../../src/components/ui/copy-button.tsx
|
|
54
54
|
import { Check, Copy, TriangleAlert } from "lucide-react";
|
|
55
55
|
import { useEffect, useRef, useState } from "react";
|
|
56
|
-
import {
|
|
56
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
57
57
|
function CopyButton({
|
|
58
58
|
value,
|
|
59
59
|
valueDescription,
|
|
@@ -100,38 +100,38 @@ function CopyButton({
|
|
|
100
100
|
resetCopyState();
|
|
101
101
|
};
|
|
102
102
|
const status = copyState === "copied" ? valueDescription ? `${labels.copied}: ${valueDescription}` : labels.copied : copyState === "failed" ? valueDescription ? `${labels.copyFailed}: ${valueDescription}` : labels.copyFailed : "";
|
|
103
|
-
return /* @__PURE__ */
|
|
103
|
+
return /* @__PURE__ */ jsxs(Button, {
|
|
104
104
|
"aria-label": accessibleLabel,
|
|
105
105
|
disabled,
|
|
106
106
|
onClick: copy,
|
|
107
107
|
size: size ?? defaultSize,
|
|
108
108
|
...props,
|
|
109
109
|
children: [
|
|
110
|
-
/* @__PURE__ */
|
|
110
|
+
/* @__PURE__ */ jsx2("span", {
|
|
111
111
|
"aria-live": "polite",
|
|
112
112
|
className: "sr-only",
|
|
113
113
|
role: "status",
|
|
114
114
|
children: status
|
|
115
|
-
}
|
|
116
|
-
copyState === "copied" ? /* @__PURE__ */
|
|
115
|
+
}),
|
|
116
|
+
copyState === "copied" ? /* @__PURE__ */ jsx2(Check, {
|
|
117
117
|
"aria-hidden": "true"
|
|
118
|
-
}
|
|
119
|
-
copyState === "failed" ? /* @__PURE__ */
|
|
118
|
+
}) : null,
|
|
119
|
+
copyState === "failed" ? /* @__PURE__ */ jsx2(TriangleAlert, {
|
|
120
120
|
"aria-hidden": "true"
|
|
121
|
-
}
|
|
122
|
-
copyState === "idle" ? /* @__PURE__ */
|
|
121
|
+
}) : null,
|
|
122
|
+
copyState === "idle" ? /* @__PURE__ */ jsx2(Copy, {
|
|
123
123
|
"aria-hidden": "true"
|
|
124
|
-
}
|
|
125
|
-
isLarge ? /* @__PURE__ */
|
|
124
|
+
}) : null,
|
|
125
|
+
isLarge ? /* @__PURE__ */ jsx2("span", {
|
|
126
126
|
children: labels.copy
|
|
127
|
-
}
|
|
127
|
+
}) : null
|
|
128
128
|
]
|
|
129
|
-
}
|
|
129
|
+
});
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
// ../../src/components/ui/code-block.tsx
|
|
133
133
|
import { Fragment, useEffect as useEffect2, useState as useState2 } from "react";
|
|
134
|
-
import {
|
|
134
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
135
135
|
var codeBodyClassName = "font-mono text-[0.875rem] leading-[1.625] break-all whitespace-pre-wrap [&_code]:block [&_code]:font-mono [&_code]:text-[inherit] [&_code]:leading-[inherit] [&_code]:whitespace-pre-wrap [&_span]:break-all";
|
|
136
136
|
var getTokenStyle = (token) => {
|
|
137
137
|
const style = {};
|
|
@@ -168,17 +168,17 @@ function CodeBlock({
|
|
|
168
168
|
active = false;
|
|
169
169
|
};
|
|
170
170
|
}, [code, highlighter, language]);
|
|
171
|
-
return /* @__PURE__ */
|
|
171
|
+
return /* @__PURE__ */ jsxs2("div", {
|
|
172
172
|
className: "overflow-hidden rounded-md border",
|
|
173
173
|
children: [
|
|
174
|
-
/* @__PURE__ */
|
|
174
|
+
/* @__PURE__ */ jsxs2("div", {
|
|
175
175
|
className: "border-border/60 flex items-center justify-between border-b px-3 py-2",
|
|
176
176
|
children: [
|
|
177
|
-
/* @__PURE__ */
|
|
177
|
+
/* @__PURE__ */ jsx3("span", {
|
|
178
178
|
className: "text-muted-foreground font-mono text-xs",
|
|
179
179
|
children: language.toLowerCase()
|
|
180
|
-
}
|
|
181
|
-
/* @__PURE__ */
|
|
180
|
+
}),
|
|
181
|
+
/* @__PURE__ */ jsx3(CopyButton, {
|
|
182
182
|
value: code,
|
|
183
183
|
valueDescription: `${language.toLowerCase()} code`,
|
|
184
184
|
variant: "secondary",
|
|
@@ -187,37 +187,37 @@ function CodeBlock({
|
|
|
187
187
|
...messages?.copied === undefined ? {} : { copied: messages.copied },
|
|
188
188
|
...messages?.copyFailed === undefined ? {} : { copyFailed: messages.copyFailed }
|
|
189
189
|
}
|
|
190
|
-
}
|
|
190
|
+
})
|
|
191
191
|
]
|
|
192
|
-
}
|
|
193
|
-
/* @__PURE__ */
|
|
192
|
+
}),
|
|
193
|
+
/* @__PURE__ */ jsx3("div", {
|
|
194
194
|
className: "bg-muted max-h-full overflow-auto p-3",
|
|
195
|
-
children: tokens ? /* @__PURE__ */
|
|
195
|
+
children: tokens ? /* @__PURE__ */ jsx3("div", {
|
|
196
196
|
className: codeBodyClassName,
|
|
197
|
-
children: /* @__PURE__ */
|
|
197
|
+
children: /* @__PURE__ */ jsx3("code", {
|
|
198
198
|
className: `language-${language}`,
|
|
199
|
-
children: tokens.map((line, lineIndex) => /* @__PURE__ */
|
|
199
|
+
children: tokens.map((line, lineIndex) => /* @__PURE__ */ jsxs2(Fragment, {
|
|
200
200
|
children: [
|
|
201
|
-
line.map((token) => /* @__PURE__ */
|
|
201
|
+
line.map((token) => /* @__PURE__ */ jsx3("span", {
|
|
202
202
|
className: "text-[var(--shiki-light)] dark:text-[var(--shiki-dark)]",
|
|
203
203
|
style: getTokenStyle(token),
|
|
204
204
|
children: token.content
|
|
205
|
-
}, token.offset
|
|
205
|
+
}, token.offset)),
|
|
206
206
|
lineIndex < tokens.length - 1 ? `
|
|
207
207
|
` : null
|
|
208
208
|
]
|
|
209
|
-
}, lineIndex
|
|
210
|
-
}
|
|
211
|
-
}
|
|
209
|
+
}, lineIndex))
|
|
210
|
+
})
|
|
211
|
+
}) : /* @__PURE__ */ jsx3("div", {
|
|
212
212
|
className: `max-w-full ${codeBodyClassName}`,
|
|
213
|
-
children: /* @__PURE__ */
|
|
213
|
+
children: /* @__PURE__ */ jsx3("code", {
|
|
214
214
|
className: `language-${language}`,
|
|
215
215
|
children: code
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
}
|
|
216
|
+
})
|
|
217
|
+
})
|
|
218
|
+
})
|
|
219
219
|
]
|
|
220
|
-
}
|
|
220
|
+
});
|
|
221
221
|
}
|
|
222
222
|
export {
|
|
223
223
|
CodeBlock
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Collapsible as CollapsiblePrimitive } from "@base-ui/react/collapsible";
|
|
2
|
+
declare function Collapsible({ ...props }: CollapsiblePrimitive.Root.Props): import("react").JSX.Element;
|
|
3
|
+
declare function CollapsibleTrigger({ ...props }: CollapsiblePrimitive.Trigger.Props): import("react").JSX.Element;
|
|
4
|
+
declare function CollapsibleContent({ ...props }: CollapsiblePrimitive.Panel.Props): import("react").JSX.Element;
|
|
5
|
+
export { Collapsible, CollapsibleTrigger, CollapsibleContent };
|
|
@@ -10,7 +10,7 @@ function cn(...inputs) {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
// ../../src/components/ui/button.tsx
|
|
13
|
-
import {
|
|
13
|
+
import { jsx } from "react/jsx-runtime";
|
|
14
14
|
var buttonVariants = cva("group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
|
|
15
15
|
variants: {
|
|
16
16
|
variant: {
|
|
@@ -43,17 +43,17 @@ function Button({
|
|
|
43
43
|
size = "default",
|
|
44
44
|
...props
|
|
45
45
|
}) {
|
|
46
|
-
return /* @__PURE__ */
|
|
46
|
+
return /* @__PURE__ */ jsx(ButtonPrimitive, {
|
|
47
47
|
"data-slot": "button",
|
|
48
48
|
className: cn(buttonVariants({ variant, size, className })),
|
|
49
49
|
...props
|
|
50
|
-
}
|
|
50
|
+
});
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
// ../../src/components/ui/copy-button.tsx
|
|
54
54
|
import { Check, Copy, TriangleAlert } from "lucide-react";
|
|
55
55
|
import { useEffect, useRef, useState } from "react";
|
|
56
|
-
import {
|
|
56
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
57
57
|
function CopyButton({
|
|
58
58
|
value,
|
|
59
59
|
valueDescription,
|
|
@@ -100,33 +100,33 @@ function CopyButton({
|
|
|
100
100
|
resetCopyState();
|
|
101
101
|
};
|
|
102
102
|
const status = copyState === "copied" ? valueDescription ? `${labels.copied}: ${valueDescription}` : labels.copied : copyState === "failed" ? valueDescription ? `${labels.copyFailed}: ${valueDescription}` : labels.copyFailed : "";
|
|
103
|
-
return /* @__PURE__ */
|
|
103
|
+
return /* @__PURE__ */ jsxs(Button, {
|
|
104
104
|
"aria-label": accessibleLabel,
|
|
105
105
|
disabled,
|
|
106
106
|
onClick: copy,
|
|
107
107
|
size: size ?? defaultSize,
|
|
108
108
|
...props,
|
|
109
109
|
children: [
|
|
110
|
-
/* @__PURE__ */
|
|
110
|
+
/* @__PURE__ */ jsx2("span", {
|
|
111
111
|
"aria-live": "polite",
|
|
112
112
|
className: "sr-only",
|
|
113
113
|
role: "status",
|
|
114
114
|
children: status
|
|
115
|
-
}
|
|
116
|
-
copyState === "copied" ? /* @__PURE__ */
|
|
115
|
+
}),
|
|
116
|
+
copyState === "copied" ? /* @__PURE__ */ jsx2(Check, {
|
|
117
117
|
"aria-hidden": "true"
|
|
118
|
-
}
|
|
119
|
-
copyState === "failed" ? /* @__PURE__ */
|
|
118
|
+
}) : null,
|
|
119
|
+
copyState === "failed" ? /* @__PURE__ */ jsx2(TriangleAlert, {
|
|
120
120
|
"aria-hidden": "true"
|
|
121
|
-
}
|
|
122
|
-
copyState === "idle" ? /* @__PURE__ */
|
|
121
|
+
}) : null,
|
|
122
|
+
copyState === "idle" ? /* @__PURE__ */ jsx2(Copy, {
|
|
123
123
|
"aria-hidden": "true"
|
|
124
|
-
}
|
|
125
|
-
isLarge ? /* @__PURE__ */
|
|
124
|
+
}) : null,
|
|
125
|
+
isLarge ? /* @__PURE__ */ jsx2("span", {
|
|
126
126
|
children: labels.copy
|
|
127
|
-
}
|
|
127
|
+
}) : null
|
|
128
128
|
]
|
|
129
|
-
}
|
|
129
|
+
});
|
|
130
130
|
}
|
|
131
131
|
export {
|
|
132
132
|
CopyButton
|