@mcp-b/react-components 0.1.1 → 0.1.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/Button-QCM8ZKgR.d.ts +98 -0
- package/dist/CodeBlock-CttHhWcb.js +356 -0
- package/dist/CodeBlock-V6pgafSS.d.ts +174 -0
- package/dist/Select-CRsKCJ9x.d.ts +200 -0
- package/dist/class-names-9UtZwb0J.js +12 -0
- package/dist/components/Accordion.d.ts +81 -0
- package/dist/components/Accordion.js +97 -0
- package/dist/components/AgentConnection.d.ts +69 -0
- package/dist/components/AgentConnection.js +176 -0
- package/dist/components/AlertDialog.d.ts +148 -0
- package/dist/components/AlertDialog.js +141 -0
- package/dist/components/Artifact.d.ts +128 -0
- package/dist/components/Artifact.js +115 -0
- package/dist/components/Autocomplete.d.ts +186 -0
- package/dist/components/Autocomplete.js +186 -0
- package/dist/components/Avatar.d.ts +134 -0
- package/dist/components/Avatar.js +118 -0
- package/dist/components/Badge.d.ts +68 -0
- package/dist/components/Badge.js +108 -0
- package/dist/components/Button.d.ts +2 -0
- package/dist/components/Button.js +73 -0
- package/dist/components/Card.d.ts +87 -0
- package/dist/components/Card.js +81 -0
- package/dist/components/ChainOfThought.d.ts +153 -0
- package/dist/components/ChainOfThought.js +157 -0
- package/dist/components/Checkbox.d.ts +35 -0
- package/dist/components/Checkbox.js +47 -0
- package/dist/components/CheckboxGroup.d.ts +76 -0
- package/dist/components/CheckboxGroup.js +69 -0
- package/dist/components/CodeBlock.d.ts +2 -0
- package/dist/components/CodeBlock.js +2 -0
- package/dist/components/Collapsible.d.ts +127 -0
- package/dist/components/Collapsible.js +103 -0
- package/dist/components/Combobox.d.ts +177 -0
- package/dist/components/Combobox.js +179 -0
- package/dist/components/Commit.d.ts +265 -0
- package/dist/components/Commit.js +282 -0
- package/dist/components/Context.d.ts +129 -0
- package/dist/components/Context.js +309 -0
- package/dist/components/ContextMenu.d.ts +282 -0
- package/dist/components/ContextMenu.js +270 -0
- package/dist/components/Conversation.d.ts +166 -0
- package/dist/components/Conversation.js +202 -0
- package/dist/components/Dialog.d.ts +120 -0
- package/dist/components/Dialog.js +114 -0
- package/dist/components/EnvironmentVariables.d.ts +176 -0
- package/dist/components/EnvironmentVariables.js +221 -0
- package/dist/components/Field.d.ts +281 -0
- package/dist/components/Field.js +274 -0
- package/dist/components/Fieldset.d.ts +93 -0
- package/dist/components/Fieldset.js +81 -0
- package/dist/components/FileTree.d.ts +116 -0
- package/dist/components/FileTree.js +310 -0
- package/dist/components/Form.d.ts +94 -0
- package/dist/components/Form.js +88 -0
- package/dist/components/GithubMotionMark.d.ts +13 -0
- package/dist/components/GithubMotionMark.js +23 -0
- package/dist/components/Input.d.ts +33 -0
- package/dist/components/Input.js +27 -0
- package/dist/components/Label.d.ts +44 -0
- package/dist/components/Label.js +41 -0
- package/dist/components/Menu.d.ts +395 -0
- package/dist/components/Menu.js +338 -0
- package/dist/components/Menubar.d.ts +331 -0
- package/dist/components/Menubar.js +299 -0
- package/dist/components/Message.d.ts +216 -0
- package/dist/components/Message.js +245 -0
- package/dist/components/Meter.d.ts +151 -0
- package/dist/components/Meter.js +121 -0
- package/dist/components/ModelSelector.d.ts +198 -0
- package/dist/components/ModelSelector.js +306 -0
- package/dist/components/NaniteScene.d.ts +33 -0
- package/dist/components/NaniteScene.js +405 -0
- package/dist/components/NavigationMenu.d.ts +256 -0
- package/dist/components/NavigationMenu.js +228 -0
- package/dist/components/NumberField.d.ts +159 -0
- package/dist/components/NumberField.js +123 -0
- package/dist/components/Popover.d.ts +278 -0
- package/dist/components/Popover.js +245 -0
- package/dist/components/PreviewCard.d.ts +156 -0
- package/dist/components/PreviewCard.js +156 -0
- package/dist/components/PricingPage.d.ts +209 -0
- package/dist/components/PricingPage.js +506 -0
- package/dist/components/Progress.d.ts +58 -0
- package/dist/components/Progress.js +51 -0
- package/dist/components/PromptInput.d.ts +399 -0
- package/dist/components/PromptInput.js +737 -0
- package/dist/components/Queue.d.ts +241 -0
- package/dist/components/Queue.js +225 -0
- package/dist/components/RadioGroup.d.ts +78 -0
- package/dist/components/RadioGroup.js +72 -0
- package/dist/components/Reasoning.d.ts +88 -0
- package/dist/components/Reasoning.js +187 -0
- package/dist/components/ScrollArea.d.ts +160 -0
- package/dist/components/ScrollArea.js +145 -0
- package/dist/components/Select.d.ts +2 -0
- package/dist/components/Select.js +260 -0
- package/dist/components/Separator.d.ts +45 -0
- package/dist/components/Separator.js +40 -0
- package/dist/components/Shell.d.ts +163 -0
- package/dist/components/Shell.js +137 -0
- package/dist/components/Slider.d.ts +120 -0
- package/dist/components/Slider.js +115 -0
- package/dist/components/Sources.d.ts +91 -0
- package/dist/components/Sources.js +121 -0
- package/dist/components/Stepper.d.ts +190 -0
- package/dist/components/Stepper.js +315 -0
- package/dist/components/Switch.d.ts +57 -0
- package/dist/components/Switch.js +55 -0
- package/dist/components/Tabs.d.ts +84 -0
- package/dist/components/Tabs.js +78 -0
- package/dist/components/Task.d.ts +100 -0
- package/dist/components/Task.js +120 -0
- package/dist/components/Terminal.d.ts +118 -0
- package/dist/components/Terminal.js +234 -0
- package/dist/components/TestResults.d.ts +236 -0
- package/dist/components/TestResults.js +346 -0
- package/dist/components/Toast.d.ts +192 -0
- package/dist/components/Toast.js +163 -0
- package/dist/components/Toggle.d.ts +69 -0
- package/dist/components/Toggle.js +66 -0
- package/dist/components/ToggleGroup.d.ts +69 -0
- package/dist/components/ToggleGroup.js +99 -0
- package/dist/components/Tool.d.ts +119 -0
- package/dist/components/Tool.js +192 -0
- package/dist/components/Toolbar.d.ts +162 -0
- package/dist/components/Toolbar.js +126 -0
- package/dist/components/Tooltip.d.ts +81 -0
- package/dist/components/Tooltip.js +74 -0
- package/dist/components/WebPreview.d.ts +143 -0
- package/dist/components/WebPreview.js +280 -0
- package/dist/components/useStickToBottom.d.ts +30 -0
- package/dist/components/useStickToBottom.js +95 -0
- package/dist/copy-button-BIATcZWZ.d.ts +16 -0
- package/dist/copy-button-BNgclDrO.js +43 -0
- package/dist/icons-BsWc8g4E.js +221 -0
- package/dist/styles/accordion.css +10 -10
- package/dist/styles/agent-connection.css +18 -17
- package/dist/styles/alert-dialog.css +48 -29
- package/dist/styles/artifact.css +10 -10
- package/dist/styles/autocomplete.css +25 -24
- package/dist/styles/avatar.css +96 -6
- package/dist/styles/badge.css +78 -14
- package/dist/styles/base.css +9 -9
- package/dist/styles/button.css +57 -38
- package/dist/styles/card.css +57 -10
- package/dist/styles/chain-of-thought.css +47 -33
- package/dist/styles/checkbox.css +24 -10
- package/dist/styles/code-block.css +22 -15
- package/dist/styles/collapsible.css +14 -12
- package/dist/styles/combobox.css +26 -25
- package/dist/styles/commit.css +49 -24
- package/dist/styles/context-menu.css +70 -16
- package/dist/styles/context.css +15 -15
- package/dist/styles/conversation.css +12 -12
- package/dist/styles/dialog.css +52 -16
- package/dist/styles/environment-variables.css +19 -19
- package/dist/styles/field.css +184 -22
- package/dist/styles/fieldset.css +5 -4
- package/dist/styles/file-tree.css +17 -17
- package/dist/styles/index.css.d.ts +1 -0
- package/dist/styles/input.css +45 -11
- package/dist/styles/label.css +21 -4
- package/dist/styles/menu.css +55 -32
- package/dist/styles/menubar.css +80 -28
- package/dist/styles/message.css +22 -13
- package/dist/styles/meter.css +8 -8
- package/dist/styles/model-selector.css +33 -21
- package/dist/styles/navigation-menu.css +26 -24
- package/dist/styles/number-field.css +20 -18
- package/dist/styles/popover.css +38 -28
- package/dist/styles/preview-card.css +15 -13
- package/dist/styles/pricing-page.css +53 -53
- package/dist/styles/progress.css +7 -7
- package/dist/styles/prompt-input.css +73 -24
- package/dist/styles/queue.css +58 -32
- package/dist/styles/radio.css +26 -11
- package/dist/styles/reasoning.css +15 -11
- package/dist/styles/scroll-area.css +6 -6
- package/dist/styles/scrollbars.css +4 -4
- package/dist/styles/select.css +84 -25
- package/dist/styles/separator.css +1 -1
- package/dist/styles/shell.css +21 -20
- package/dist/styles/slider.css +35 -11
- package/dist/styles/sources.css +20 -20
- package/dist/styles/stepper.css +22 -22
- package/dist/styles/switch.css +29 -13
- package/dist/styles/tabs.css +23 -16
- package/dist/styles/task.css +27 -23
- package/dist/styles/terminal.css +16 -13
- package/dist/styles/test-results.css +79 -32
- package/dist/styles/toast.css +26 -25
- package/dist/styles/toggle-group.css +12 -12
- package/dist/styles/toggle.css +29 -11
- package/dist/styles/tool.css +54 -32
- package/dist/styles/toolbar.css +30 -28
- package/dist/styles/tooltip.css +10 -8
- package/dist/styles/web-preview.css +37 -21
- package/dist/utils/structured-code.d.ts +10 -0
- package/dist/utils/structured-code.js +81 -0
- package/package.json +17 -8
- package/dist/index.d.ts +0 -7236
- package/dist/index.js +0 -8945
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { AlertDialog as AlertDialog$1 } from "@base-ui/react/alert-dialog";
|
|
3
|
+
|
|
4
|
+
//#region src/components/AlertDialog.d.ts
|
|
5
|
+
interface AlertDialogProps extends React.ComponentPropsWithRef<typeof AlertDialog$1.Root> {}
|
|
6
|
+
interface AlertDialogTriggerProps extends Omit<React.ComponentPropsWithRef<typeof AlertDialog$1.Trigger>, "className"> {
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
interface AlertDialogBackdropProps extends Omit<React.ComponentPropsWithRef<typeof AlertDialog$1.Backdrop>, "className"> {
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
interface AlertDialogPopupProps extends Omit<React.ComponentPropsWithRef<typeof AlertDialog$1.Popup>, "className"> {
|
|
13
|
+
className?: string;
|
|
14
|
+
/**
|
|
15
|
+
* The size of the alert dialog.
|
|
16
|
+
* @default 'md'
|
|
17
|
+
*/
|
|
18
|
+
size?: "sm" | "md" | "lg";
|
|
19
|
+
}
|
|
20
|
+
interface AlertDialogTitleProps extends Omit<React.ComponentPropsWithRef<typeof AlertDialog$1.Title>, "className"> {
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
interface AlertDialogDescriptionProps extends Omit<React.ComponentPropsWithRef<typeof AlertDialog$1.Description>, "className"> {
|
|
24
|
+
className?: string;
|
|
25
|
+
}
|
|
26
|
+
interface AlertDialogCloseProps extends Omit<React.ComponentPropsWithRef<typeof AlertDialog$1.Close>, "className"> {
|
|
27
|
+
className?: string;
|
|
28
|
+
/**
|
|
29
|
+
* The variant of the close button.
|
|
30
|
+
* @default 'secondary'
|
|
31
|
+
*/
|
|
32
|
+
variant?: "primary" | "secondary" | "destructive" | "outline" | "ghost";
|
|
33
|
+
}
|
|
34
|
+
type AlertDialogOverlayProps = AlertDialogBackdropProps;
|
|
35
|
+
type AlertDialogContentProps = AlertDialogPopupProps;
|
|
36
|
+
type AlertDialogActionProps = AlertDialogCloseProps;
|
|
37
|
+
type AlertDialogCancelProps = AlertDialogCloseProps;
|
|
38
|
+
interface AlertDialogHeaderProps extends React.HTMLAttributes<HTMLDivElement> {}
|
|
39
|
+
interface AlertDialogFooterProps extends React.HTMLAttributes<HTMLDivElement> {}
|
|
40
|
+
interface AlertDialogMediaProps extends React.HTMLAttributes<HTMLDivElement> {}
|
|
41
|
+
/**
|
|
42
|
+
* An alert dialog component for important confirmations and warnings.
|
|
43
|
+
* Unlike regular dialogs, alert dialogs require explicit user action to dismiss.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```tsx
|
|
47
|
+
* <AlertDialog>
|
|
48
|
+
* <AlertDialogTrigger>Delete Account</AlertDialogTrigger>
|
|
49
|
+
* <AlertDialogPortal>
|
|
50
|
+
* <AlertDialogBackdrop />
|
|
51
|
+
* <AlertDialogPopup>
|
|
52
|
+
* <AlertDialogTitle>Are you sure?</AlertDialogTitle>
|
|
53
|
+
* <AlertDialogDescription>
|
|
54
|
+
* This action cannot be undone.
|
|
55
|
+
* </AlertDialogDescription>
|
|
56
|
+
* <div style={{ display: "flex", gap: "0.5rem", justifyContent: "flex-end" }}>
|
|
57
|
+
* <AlertDialogClose>Cancel</AlertDialogClose>
|
|
58
|
+
* <AlertDialogClose variant="destructive">Delete</AlertDialogClose>
|
|
59
|
+
* </div>
|
|
60
|
+
* </AlertDialogPopup>
|
|
61
|
+
* </AlertDialogPortal>
|
|
62
|
+
* </AlertDialog>
|
|
63
|
+
* ```
|
|
64
|
+
*
|
|
65
|
+
* @see {@link https://base-ui.com/react/components/alert-dialog | Base UI Alert Dialog}
|
|
66
|
+
*/
|
|
67
|
+
declare const AlertDialog: typeof AlertDialog$1.Root;
|
|
68
|
+
declare function AlertDialogTrigger({
|
|
69
|
+
className,
|
|
70
|
+
ref,
|
|
71
|
+
...props
|
|
72
|
+
}: AlertDialogTriggerProps & {
|
|
73
|
+
ref?: React.Ref<HTMLButtonElement>;
|
|
74
|
+
}): React.JSX.Element;
|
|
75
|
+
declare const AlertDialogPortal: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").AlertDialogPortalProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
76
|
+
declare function AlertDialogBackdrop({
|
|
77
|
+
className,
|
|
78
|
+
ref,
|
|
79
|
+
...props
|
|
80
|
+
}: AlertDialogBackdropProps & {
|
|
81
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
82
|
+
}): React.JSX.Element;
|
|
83
|
+
declare const AlertDialogOverlay: typeof AlertDialogBackdrop;
|
|
84
|
+
declare function AlertDialogPopup({
|
|
85
|
+
size,
|
|
86
|
+
className,
|
|
87
|
+
ref,
|
|
88
|
+
...props
|
|
89
|
+
}: AlertDialogPopupProps & {
|
|
90
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
91
|
+
}): React.JSX.Element;
|
|
92
|
+
declare function AlertDialogContent({
|
|
93
|
+
ref,
|
|
94
|
+
...props
|
|
95
|
+
}: AlertDialogContentProps & {
|
|
96
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
97
|
+
}): React.JSX.Element;
|
|
98
|
+
declare function AlertDialogHeader({
|
|
99
|
+
className,
|
|
100
|
+
ref,
|
|
101
|
+
...props
|
|
102
|
+
}: AlertDialogHeaderProps & {
|
|
103
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
104
|
+
}): React.JSX.Element;
|
|
105
|
+
declare function AlertDialogFooter({
|
|
106
|
+
className,
|
|
107
|
+
ref,
|
|
108
|
+
...props
|
|
109
|
+
}: AlertDialogFooterProps & {
|
|
110
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
111
|
+
}): React.JSX.Element;
|
|
112
|
+
declare function AlertDialogMedia({
|
|
113
|
+
className,
|
|
114
|
+
ref,
|
|
115
|
+
...props
|
|
116
|
+
}: AlertDialogMediaProps & {
|
|
117
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
118
|
+
}): React.JSX.Element;
|
|
119
|
+
declare function AlertDialogTitle({
|
|
120
|
+
className,
|
|
121
|
+
ref,
|
|
122
|
+
...props
|
|
123
|
+
}: AlertDialogTitleProps & {
|
|
124
|
+
ref?: React.Ref<HTMLHeadingElement>;
|
|
125
|
+
}): React.JSX.Element;
|
|
126
|
+
declare function AlertDialogDescription({
|
|
127
|
+
className,
|
|
128
|
+
ref,
|
|
129
|
+
...props
|
|
130
|
+
}: AlertDialogDescriptionProps & {
|
|
131
|
+
ref?: React.Ref<HTMLParagraphElement>;
|
|
132
|
+
}): React.JSX.Element;
|
|
133
|
+
declare function AlertDialogClose({
|
|
134
|
+
variant,
|
|
135
|
+
className,
|
|
136
|
+
ref,
|
|
137
|
+
...props
|
|
138
|
+
}: AlertDialogCloseProps & {
|
|
139
|
+
ref?: React.Ref<HTMLButtonElement>;
|
|
140
|
+
}): React.JSX.Element;
|
|
141
|
+
declare function AlertDialogAction(props: AlertDialogActionProps & {
|
|
142
|
+
ref?: React.Ref<HTMLButtonElement>;
|
|
143
|
+
}): React.JSX.Element;
|
|
144
|
+
declare function AlertDialogCancel(props: AlertDialogCancelProps & {
|
|
145
|
+
ref?: React.Ref<HTMLButtonElement>;
|
|
146
|
+
}): React.JSX.Element;
|
|
147
|
+
//#endregion
|
|
148
|
+
export { AlertDialog, AlertDialogAction, AlertDialogActionProps, AlertDialogBackdrop, AlertDialogBackdropProps, AlertDialogCancel, AlertDialogCancelProps, AlertDialogClose, AlertDialogCloseProps, AlertDialogContent, AlertDialogContentProps, AlertDialogDescription, AlertDialogDescriptionProps, AlertDialogFooter, AlertDialogFooterProps, AlertDialogHeader, AlertDialogHeaderProps, AlertDialogMedia, AlertDialogMediaProps, AlertDialogOverlay, AlertDialogOverlayProps, AlertDialogPopup, AlertDialogPopupProps, AlertDialogPortal, AlertDialogProps, AlertDialogTitle, AlertDialogTitleProps, AlertDialogTrigger, AlertDialogTriggerProps };
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import "react";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { AlertDialog as AlertDialog$1 } from "@base-ui/react/alert-dialog";
|
|
4
|
+
//#region src/components/AlertDialog.tsx
|
|
5
|
+
/**
|
|
6
|
+
* An alert dialog component for important confirmations and warnings.
|
|
7
|
+
* Unlike regular dialogs, alert dialogs require explicit user action to dismiss.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* <AlertDialog>
|
|
12
|
+
* <AlertDialogTrigger>Delete Account</AlertDialogTrigger>
|
|
13
|
+
* <AlertDialogPortal>
|
|
14
|
+
* <AlertDialogBackdrop />
|
|
15
|
+
* <AlertDialogPopup>
|
|
16
|
+
* <AlertDialogTitle>Are you sure?</AlertDialogTitle>
|
|
17
|
+
* <AlertDialogDescription>
|
|
18
|
+
* This action cannot be undone.
|
|
19
|
+
* </AlertDialogDescription>
|
|
20
|
+
* <div style={{ display: "flex", gap: "0.5rem", justifyContent: "flex-end" }}>
|
|
21
|
+
* <AlertDialogClose>Cancel</AlertDialogClose>
|
|
22
|
+
* <AlertDialogClose variant="destructive">Delete</AlertDialogClose>
|
|
23
|
+
* </div>
|
|
24
|
+
* </AlertDialogPopup>
|
|
25
|
+
* </AlertDialogPortal>
|
|
26
|
+
* </AlertDialog>
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @see {@link https://base-ui.com/react/components/alert-dialog | Base UI Alert Dialog}
|
|
30
|
+
*/
|
|
31
|
+
const AlertDialog = AlertDialog$1.Root;
|
|
32
|
+
function AlertDialogTrigger({ className = "", ref, ...props }) {
|
|
33
|
+
const classes = ["alert-dialog__trigger", className].filter(Boolean).join(" ");
|
|
34
|
+
return /* @__PURE__ */ jsx(AlertDialog$1.Trigger, {
|
|
35
|
+
ref,
|
|
36
|
+
"data-slot": "alert-dialog-trigger",
|
|
37
|
+
className: classes,
|
|
38
|
+
...props
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
const AlertDialogPortal = AlertDialog$1.Portal;
|
|
42
|
+
function AlertDialogBackdrop({ className = "", ref, ...props }) {
|
|
43
|
+
const classes = ["alert-dialog__backdrop", className].filter(Boolean).join(" ");
|
|
44
|
+
return /* @__PURE__ */ jsx(AlertDialog$1.Backdrop, {
|
|
45
|
+
ref,
|
|
46
|
+
"data-slot": "alert-dialog-overlay",
|
|
47
|
+
className: classes,
|
|
48
|
+
...props
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
const AlertDialogOverlay = AlertDialogBackdrop;
|
|
52
|
+
function AlertDialogPopup({ size = "md", className = "", ref, ...props }) {
|
|
53
|
+
const classes = [
|
|
54
|
+
"alert-dialog__popup",
|
|
55
|
+
size !== "md" && `alert-dialog__popup--${size}`,
|
|
56
|
+
className
|
|
57
|
+
].filter(Boolean).join(" ");
|
|
58
|
+
return /* @__PURE__ */ jsx(AlertDialog$1.Popup, {
|
|
59
|
+
ref,
|
|
60
|
+
"data-slot": "alert-dialog-content",
|
|
61
|
+
className: classes,
|
|
62
|
+
...props
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
function AlertDialogContent({ ref, ...props }) {
|
|
66
|
+
return /* @__PURE__ */ jsxs(AlertDialogPortal, { children: [/* @__PURE__ */ jsx(AlertDialogBackdrop, {}), /* @__PURE__ */ jsx(AlertDialogPopup, {
|
|
67
|
+
ref,
|
|
68
|
+
...props
|
|
69
|
+
})] });
|
|
70
|
+
}
|
|
71
|
+
function AlertDialogHeader({ className = "", ref, ...props }) {
|
|
72
|
+
return /* @__PURE__ */ jsx("div", {
|
|
73
|
+
ref,
|
|
74
|
+
"data-slot": "alert-dialog-header",
|
|
75
|
+
className: ["alert-dialog__header", className].filter(Boolean).join(" "),
|
|
76
|
+
...props
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
function AlertDialogFooter({ className = "", ref, ...props }) {
|
|
80
|
+
return /* @__PURE__ */ jsx("div", {
|
|
81
|
+
ref,
|
|
82
|
+
"data-slot": "alert-dialog-footer",
|
|
83
|
+
className: ["alert-dialog__footer", className].filter(Boolean).join(" "),
|
|
84
|
+
...props
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
function AlertDialogMedia({ className = "", ref, ...props }) {
|
|
88
|
+
return /* @__PURE__ */ jsx("div", {
|
|
89
|
+
ref,
|
|
90
|
+
"data-slot": "alert-dialog-media",
|
|
91
|
+
className: ["alert-dialog__media", className].filter(Boolean).join(" "),
|
|
92
|
+
...props
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
function AlertDialogTitle({ className = "", ref, ...props }) {
|
|
96
|
+
const classes = ["alert-dialog__title", className].filter(Boolean).join(" ");
|
|
97
|
+
return /* @__PURE__ */ jsx(AlertDialog$1.Title, {
|
|
98
|
+
ref,
|
|
99
|
+
"data-slot": "alert-dialog-title",
|
|
100
|
+
className: classes,
|
|
101
|
+
...props
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
function AlertDialogDescription({ className = "", ref, ...props }) {
|
|
105
|
+
const classes = ["alert-dialog__description", className].filter(Boolean).join(" ");
|
|
106
|
+
return /* @__PURE__ */ jsx(AlertDialog$1.Description, {
|
|
107
|
+
ref,
|
|
108
|
+
"data-slot": "alert-dialog-description",
|
|
109
|
+
className: classes,
|
|
110
|
+
...props
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
function AlertDialogClose({ variant = "secondary", className = "", ref, ...props }) {
|
|
114
|
+
const classes = [
|
|
115
|
+
"alert-dialog__action",
|
|
116
|
+
`alert-dialog__action--${variant}`,
|
|
117
|
+
className
|
|
118
|
+
].filter(Boolean).join(" ");
|
|
119
|
+
return /* @__PURE__ */ jsx(AlertDialog$1.Close, {
|
|
120
|
+
ref,
|
|
121
|
+
"data-slot": "alert-dialog-close",
|
|
122
|
+
className: classes,
|
|
123
|
+
...props
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
function AlertDialogAction(props) {
|
|
127
|
+
return /* @__PURE__ */ jsx(AlertDialogClose, {
|
|
128
|
+
"data-slot": "alert-dialog-action",
|
|
129
|
+
variant: "primary",
|
|
130
|
+
...props
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
function AlertDialogCancel(props) {
|
|
134
|
+
return /* @__PURE__ */ jsx(AlertDialogClose, {
|
|
135
|
+
"data-slot": "alert-dialog-cancel",
|
|
136
|
+
variant: "outline",
|
|
137
|
+
...props
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
//#endregion
|
|
141
|
+
export { AlertDialog, AlertDialogAction, AlertDialogBackdrop, AlertDialogCancel, AlertDialogClose, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPopup, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger };
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { r as ButtonProps } from "../Button-QCM8ZKgR.js";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/Artifact.d.ts
|
|
5
|
+
interface ArtifactProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
/** Additional class names for layout only; do not restyle artifact internals from apps. */
|
|
7
|
+
className?: string;
|
|
8
|
+
/** Header and content slots, usually composed from Artifact subcomponents. */
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* A container for generated content (code, documents, outputs) with a header
|
|
13
|
+
* containing a title, description, and action buttons.
|
|
14
|
+
*
|
|
15
|
+
* Built internally for Sigvelo agent outputs. Use it for generated artifacts
|
|
16
|
+
* that need a title, optional description, content body, and compact actions.
|
|
17
|
+
* Do not use it as a page section or generic card; use Card or page layout
|
|
18
|
+
* instead.
|
|
19
|
+
*
|
|
20
|
+
* Styling is mapped to Sigvelo surface, border, spacing, radius, typography,
|
|
21
|
+
* and focus tokens. Extend with composition, action props, or a shared variant
|
|
22
|
+
* here when multiple apps need the same behavior. Avoid overriding nested
|
|
23
|
+
* `.artifact__*` selectors from app CSS.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```tsx
|
|
27
|
+
* <Artifact>
|
|
28
|
+
* <ArtifactHeader>
|
|
29
|
+
* <div>
|
|
30
|
+
* <ArtifactTitle>Project report</ArtifactTitle>
|
|
31
|
+
* <ArtifactDescription>Generated from Q1 data</ArtifactDescription>
|
|
32
|
+
* </div>
|
|
33
|
+
* <ArtifactActions>
|
|
34
|
+
* <ArtifactAction label="Copy" tooltip="Copy to clipboard" icon={<CopyIcon />} />
|
|
35
|
+
* <ArtifactClose onClick={close} />
|
|
36
|
+
* </ArtifactActions>
|
|
37
|
+
* </ArtifactHeader>
|
|
38
|
+
* <ArtifactContent>…</ArtifactContent>
|
|
39
|
+
* </Artifact>
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
declare function Artifact({
|
|
43
|
+
className,
|
|
44
|
+
children,
|
|
45
|
+
ref,
|
|
46
|
+
...props
|
|
47
|
+
}: ArtifactProps & {
|
|
48
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
49
|
+
}): React.JSX.Element;
|
|
50
|
+
interface ArtifactHeaderProps extends React.HTMLAttributes<HTMLDivElement> {}
|
|
51
|
+
declare function ArtifactHeader({
|
|
52
|
+
className,
|
|
53
|
+
children,
|
|
54
|
+
ref,
|
|
55
|
+
...props
|
|
56
|
+
}: ArtifactHeaderProps & {
|
|
57
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
58
|
+
}): React.JSX.Element;
|
|
59
|
+
interface ArtifactTitleProps extends React.HTMLAttributes<HTMLHeadingElement> {}
|
|
60
|
+
declare function ArtifactTitle({
|
|
61
|
+
className,
|
|
62
|
+
children,
|
|
63
|
+
ref,
|
|
64
|
+
...props
|
|
65
|
+
}: ArtifactTitleProps & {
|
|
66
|
+
ref?: React.Ref<HTMLHeadingElement>;
|
|
67
|
+
}): React.JSX.Element;
|
|
68
|
+
interface ArtifactDescriptionProps extends React.HTMLAttributes<HTMLParagraphElement> {}
|
|
69
|
+
declare function ArtifactDescription({
|
|
70
|
+
className,
|
|
71
|
+
children,
|
|
72
|
+
ref,
|
|
73
|
+
...props
|
|
74
|
+
}: ArtifactDescriptionProps & {
|
|
75
|
+
ref?: React.Ref<HTMLParagraphElement>;
|
|
76
|
+
}): React.JSX.Element;
|
|
77
|
+
interface ArtifactActionsProps extends React.HTMLAttributes<HTMLDivElement> {}
|
|
78
|
+
declare function ArtifactActions({
|
|
79
|
+
className,
|
|
80
|
+
children,
|
|
81
|
+
ref,
|
|
82
|
+
...props
|
|
83
|
+
}: ArtifactActionsProps & {
|
|
84
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
85
|
+
}): React.JSX.Element;
|
|
86
|
+
interface ArtifactActionProps extends Omit<ButtonProps, "children" | "variant" | "size" | "color" | "className"> {
|
|
87
|
+
className?: string;
|
|
88
|
+
/** Accessible label for the button. */
|
|
89
|
+
label?: string;
|
|
90
|
+
/** Tooltip text shown on hover. Defaults to label. */
|
|
91
|
+
tooltip?: string;
|
|
92
|
+
/** The icon to render inside the button. */
|
|
93
|
+
icon?: React.ReactNode | React.ComponentType<{
|
|
94
|
+
className?: string;
|
|
95
|
+
}>;
|
|
96
|
+
children?: React.ReactNode;
|
|
97
|
+
}
|
|
98
|
+
declare function ArtifactAction({
|
|
99
|
+
className,
|
|
100
|
+
label,
|
|
101
|
+
tooltip,
|
|
102
|
+
icon,
|
|
103
|
+
children,
|
|
104
|
+
...props
|
|
105
|
+
}: ArtifactActionProps): React.JSX.Element;
|
|
106
|
+
interface ArtifactCloseProps extends Omit<ButtonProps, "children" | "variant" | "size" | "color" | "className"> {
|
|
107
|
+
className?: string;
|
|
108
|
+
/** Accessible label for the close button. */
|
|
109
|
+
label?: string;
|
|
110
|
+
children?: React.ReactNode;
|
|
111
|
+
}
|
|
112
|
+
declare function ArtifactClose({
|
|
113
|
+
className,
|
|
114
|
+
label,
|
|
115
|
+
children,
|
|
116
|
+
...props
|
|
117
|
+
}: ArtifactCloseProps): React.JSX.Element;
|
|
118
|
+
interface ArtifactContentProps extends React.HTMLAttributes<HTMLDivElement> {}
|
|
119
|
+
declare function ArtifactContent({
|
|
120
|
+
className,
|
|
121
|
+
children,
|
|
122
|
+
ref,
|
|
123
|
+
...props
|
|
124
|
+
}: ArtifactContentProps & {
|
|
125
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
126
|
+
}): React.JSX.Element;
|
|
127
|
+
//#endregion
|
|
128
|
+
export { Artifact, ArtifactAction, ArtifactActionProps, ArtifactActions, ArtifactActionsProps, ArtifactClose, ArtifactCloseProps, ArtifactContent, ArtifactContentProps, ArtifactDescription, ArtifactDescriptionProps, ArtifactHeader, ArtifactHeaderProps, ArtifactProps, ArtifactTitle, ArtifactTitleProps };
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { O as XIcon } from "../icons-BsWc8g4E.js";
|
|
2
|
+
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
3
|
+
import { Button } from "./Button.js";
|
|
4
|
+
import { Tooltip, TooltipPopup, TooltipPortal, TooltipPositioner, TooltipTrigger } from "./Tooltip.js";
|
|
5
|
+
import "react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/Artifact.tsx
|
|
8
|
+
/**
|
|
9
|
+
* A container for generated content (code, documents, outputs) with a header
|
|
10
|
+
* containing a title, description, and action buttons.
|
|
11
|
+
*
|
|
12
|
+
* Built internally for Sigvelo agent outputs. Use it for generated artifacts
|
|
13
|
+
* that need a title, optional description, content body, and compact actions.
|
|
14
|
+
* Do not use it as a page section or generic card; use Card or page layout
|
|
15
|
+
* instead.
|
|
16
|
+
*
|
|
17
|
+
* Styling is mapped to Sigvelo surface, border, spacing, radius, typography,
|
|
18
|
+
* and focus tokens. Extend with composition, action props, or a shared variant
|
|
19
|
+
* here when multiple apps need the same behavior. Avoid overriding nested
|
|
20
|
+
* `.artifact__*` selectors from app CSS.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* <Artifact>
|
|
25
|
+
* <ArtifactHeader>
|
|
26
|
+
* <div>
|
|
27
|
+
* <ArtifactTitle>Project report</ArtifactTitle>
|
|
28
|
+
* <ArtifactDescription>Generated from Q1 data</ArtifactDescription>
|
|
29
|
+
* </div>
|
|
30
|
+
* <ArtifactActions>
|
|
31
|
+
* <ArtifactAction label="Copy" tooltip="Copy to clipboard" icon={<CopyIcon />} />
|
|
32
|
+
* <ArtifactClose onClick={close} />
|
|
33
|
+
* </ArtifactActions>
|
|
34
|
+
* </ArtifactHeader>
|
|
35
|
+
* <ArtifactContent>…</ArtifactContent>
|
|
36
|
+
* </Artifact>
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
function Artifact({ className, children, ref, ...props }) {
|
|
40
|
+
return /* @__PURE__ */ jsx("div", {
|
|
41
|
+
ref,
|
|
42
|
+
className: cx("artifact", className),
|
|
43
|
+
...props,
|
|
44
|
+
children
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function ArtifactHeader({ className, children, ref, ...props }) {
|
|
48
|
+
return /* @__PURE__ */ jsx("div", {
|
|
49
|
+
ref,
|
|
50
|
+
className: cx("artifact__header", className),
|
|
51
|
+
...props,
|
|
52
|
+
children
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
function ArtifactTitle({ className, children, ref, ...props }) {
|
|
56
|
+
return /* @__PURE__ */ jsx("h3", {
|
|
57
|
+
ref,
|
|
58
|
+
className: cx("artifact__title", className),
|
|
59
|
+
...props,
|
|
60
|
+
children
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
function ArtifactDescription({ className, children, ref, ...props }) {
|
|
64
|
+
return /* @__PURE__ */ jsx("p", {
|
|
65
|
+
ref,
|
|
66
|
+
className: cx("artifact__description", className),
|
|
67
|
+
...props,
|
|
68
|
+
children
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
function ArtifactActions({ className, children, ref, ...props }) {
|
|
72
|
+
return /* @__PURE__ */ jsx("div", {
|
|
73
|
+
ref,
|
|
74
|
+
className: cx("artifact__actions", className),
|
|
75
|
+
...props,
|
|
76
|
+
children
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
function ArtifactAction({ className, label, tooltip, icon, children, ...props }) {
|
|
80
|
+
const Icon = typeof icon === "function" ? icon : null;
|
|
81
|
+
const accessibleLabel = label ?? tooltip;
|
|
82
|
+
const button = /* @__PURE__ */ jsxs(Button, {
|
|
83
|
+
variant: "ghost",
|
|
84
|
+
size: "icon",
|
|
85
|
+
"aria-label": accessibleLabel,
|
|
86
|
+
className: cx("artifact__action", className),
|
|
87
|
+
...props,
|
|
88
|
+
children: [Icon ? /* @__PURE__ */ jsx(Icon, {}) : icon ?? children, accessibleLabel ? /* @__PURE__ */ jsx("span", {
|
|
89
|
+
className: "sr-only",
|
|
90
|
+
children: accessibleLabel
|
|
91
|
+
}) : null]
|
|
92
|
+
});
|
|
93
|
+
if (!tooltip) return button;
|
|
94
|
+
return /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, { render: button }), /* @__PURE__ */ jsx(TooltipPortal, { children: /* @__PURE__ */ jsx(TooltipPositioner, { children: /* @__PURE__ */ jsx(TooltipPopup, { children: tooltip }) }) })] });
|
|
95
|
+
}
|
|
96
|
+
function ArtifactClose({ className, label = "Close", children, ...props }) {
|
|
97
|
+
return /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, { render: /* @__PURE__ */ jsx(Button, {
|
|
98
|
+
variant: "ghost",
|
|
99
|
+
size: "icon",
|
|
100
|
+
"aria-label": label,
|
|
101
|
+
className: cx("artifact__close", className),
|
|
102
|
+
...props,
|
|
103
|
+
children: children ?? /* @__PURE__ */ jsx(XIcon, {})
|
|
104
|
+
}) }), /* @__PURE__ */ jsx(TooltipPortal, { children: /* @__PURE__ */ jsx(TooltipPositioner, { children: /* @__PURE__ */ jsx(TooltipPopup, { children: label }) }) })] });
|
|
105
|
+
}
|
|
106
|
+
function ArtifactContent({ className, children, ref, ...props }) {
|
|
107
|
+
return /* @__PURE__ */ jsx("div", {
|
|
108
|
+
ref,
|
|
109
|
+
className: cx("artifact__content", className),
|
|
110
|
+
...props,
|
|
111
|
+
children
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
//#endregion
|
|
115
|
+
export { Artifact, ArtifactAction, ArtifactActions, ArtifactClose, ArtifactContent, ArtifactDescription, ArtifactHeader, ArtifactTitle };
|