@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,162 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Toolbar as Toolbar$1 } from "@base-ui/react/toolbar";
|
|
3
|
+
|
|
4
|
+
//#region src/components/Toolbar.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Props for the Toolbar.Root component.
|
|
7
|
+
*/
|
|
8
|
+
interface ToolbarRootProps extends Omit<React.ComponentPropsWithoutRef<typeof Toolbar$1.Root>, "className"> {
|
|
9
|
+
/** Additional CSS class names */
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Props for the Toolbar.Button component.
|
|
14
|
+
*/
|
|
15
|
+
interface ToolbarButtonProps extends Omit<React.ComponentPropsWithoutRef<typeof Toolbar$1.Button>, "className"> {
|
|
16
|
+
/** Additional CSS class names */
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Props for the Toolbar.Link component.
|
|
21
|
+
*/
|
|
22
|
+
interface ToolbarLinkProps extends Omit<React.ComponentPropsWithoutRef<typeof Toolbar$1.Link>, "className"> {
|
|
23
|
+
/** Additional CSS class names */
|
|
24
|
+
className?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Props for the Toolbar.Group component.
|
|
28
|
+
*/
|
|
29
|
+
interface ToolbarGroupProps extends Omit<React.ComponentPropsWithoutRef<typeof Toolbar$1.Group>, "className"> {
|
|
30
|
+
/** Additional CSS class names */
|
|
31
|
+
className?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Props for the Toolbar.Separator component.
|
|
35
|
+
*/
|
|
36
|
+
interface ToolbarSeparatorProps extends Omit<React.ComponentPropsWithoutRef<typeof Toolbar$1.Separator>, "className"> {
|
|
37
|
+
/** Additional CSS class names */
|
|
38
|
+
className?: string;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Props for the Toolbar.Input component.
|
|
42
|
+
*/
|
|
43
|
+
interface ToolbarInputProps extends Omit<React.ComponentPropsWithoutRef<typeof Toolbar$1.Input>, "className"> {
|
|
44
|
+
/** Additional CSS class names */
|
|
45
|
+
className?: string;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Container for grouping toolbar buttons and controls.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```tsx
|
|
52
|
+
* <Toolbar.Root>
|
|
53
|
+
* <Toolbar.Button>Bold</Toolbar.Button>
|
|
54
|
+
* <Toolbar.Button>Italic</Toolbar.Button>
|
|
55
|
+
* <Toolbar.Separator />
|
|
56
|
+
* <Toolbar.Button>Align Left</Toolbar.Button>
|
|
57
|
+
* </Toolbar.Root>
|
|
58
|
+
* ```
|
|
59
|
+
*
|
|
60
|
+
* @see {@link https://base-ui.com/react/components/toolbar | Base UI Toolbar}
|
|
61
|
+
*/
|
|
62
|
+
declare function ToolbarRoot({
|
|
63
|
+
className,
|
|
64
|
+
ref,
|
|
65
|
+
...props
|
|
66
|
+
}: ToolbarRootProps & {
|
|
67
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
68
|
+
}): React.JSX.Element;
|
|
69
|
+
/**
|
|
70
|
+
* A clickable button within the toolbar.
|
|
71
|
+
*/
|
|
72
|
+
declare function ToolbarButton({
|
|
73
|
+
className,
|
|
74
|
+
ref,
|
|
75
|
+
...props
|
|
76
|
+
}: ToolbarButtonProps & {
|
|
77
|
+
ref?: React.Ref<HTMLButtonElement>;
|
|
78
|
+
}): React.JSX.Element;
|
|
79
|
+
/**
|
|
80
|
+
* A link element within the toolbar.
|
|
81
|
+
*/
|
|
82
|
+
declare function ToolbarLink({
|
|
83
|
+
className,
|
|
84
|
+
ref,
|
|
85
|
+
...props
|
|
86
|
+
}: ToolbarLinkProps & {
|
|
87
|
+
ref?: React.Ref<HTMLAnchorElement>;
|
|
88
|
+
}): React.JSX.Element;
|
|
89
|
+
/**
|
|
90
|
+
* Groups toolbar items together.
|
|
91
|
+
*/
|
|
92
|
+
declare function ToolbarGroup({
|
|
93
|
+
className,
|
|
94
|
+
ref,
|
|
95
|
+
...props
|
|
96
|
+
}: ToolbarGroupProps & {
|
|
97
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
98
|
+
}): React.JSX.Element;
|
|
99
|
+
/**
|
|
100
|
+
* Visual separator between toolbar sections.
|
|
101
|
+
*/
|
|
102
|
+
declare function ToolbarSeparator({
|
|
103
|
+
className,
|
|
104
|
+
ref,
|
|
105
|
+
...props
|
|
106
|
+
}: ToolbarSeparatorProps & {
|
|
107
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
108
|
+
}): React.JSX.Element;
|
|
109
|
+
/**
|
|
110
|
+
* Input element within the toolbar.
|
|
111
|
+
*/
|
|
112
|
+
declare function ToolbarInput({
|
|
113
|
+
className,
|
|
114
|
+
ref,
|
|
115
|
+
...props
|
|
116
|
+
}: ToolbarInputProps & {
|
|
117
|
+
ref?: React.Ref<HTMLInputElement>;
|
|
118
|
+
}): React.JSX.Element;
|
|
119
|
+
/**
|
|
120
|
+
* A container for grouping buttons and controls.
|
|
121
|
+
* Provides keyboard navigation between items.
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* ```tsx
|
|
125
|
+
* // Text formatting toolbar
|
|
126
|
+
* <Toolbar.Root>
|
|
127
|
+
* <Toolbar.Group>
|
|
128
|
+
* <Toolbar.Button>Bold</Toolbar.Button>
|
|
129
|
+
* <Toolbar.Button>Italic</Toolbar.Button>
|
|
130
|
+
* <Toolbar.Button>Underline</Toolbar.Button>
|
|
131
|
+
* </Toolbar.Group>
|
|
132
|
+
* <Toolbar.Separator />
|
|
133
|
+
* <Toolbar.Group>
|
|
134
|
+
* <Toolbar.Button>Left</Toolbar.Button>
|
|
135
|
+
* <Toolbar.Button>Center</Toolbar.Button>
|
|
136
|
+
* <Toolbar.Button>Right</Toolbar.Button>
|
|
137
|
+
* </Toolbar.Group>
|
|
138
|
+
* </Toolbar.Root>
|
|
139
|
+
* ```
|
|
140
|
+
*
|
|
141
|
+
* @example
|
|
142
|
+
* ```tsx
|
|
143
|
+
* // Vertical toolbar
|
|
144
|
+
* <Toolbar.Root orientation="vertical">
|
|
145
|
+
* <Toolbar.Button>Item 1</Toolbar.Button>
|
|
146
|
+
* <Toolbar.Button>Item 2</Toolbar.Button>
|
|
147
|
+
* <Toolbar.Button>Item 3</Toolbar.Button>
|
|
148
|
+
* </Toolbar.Root>
|
|
149
|
+
* ```
|
|
150
|
+
*
|
|
151
|
+
* @see {@link https://base-ui.com/react/components/toolbar | Base UI Toolbar}
|
|
152
|
+
*/
|
|
153
|
+
declare const Toolbar: {
|
|
154
|
+
Root: typeof ToolbarRoot;
|
|
155
|
+
Button: typeof ToolbarButton;
|
|
156
|
+
Link: typeof ToolbarLink;
|
|
157
|
+
Group: typeof ToolbarGroup;
|
|
158
|
+
Separator: typeof ToolbarSeparator;
|
|
159
|
+
Input: typeof ToolbarInput;
|
|
160
|
+
};
|
|
161
|
+
//#endregion
|
|
162
|
+
export { Toolbar, ToolbarButtonProps, ToolbarGroupProps, ToolbarInputProps, ToolbarLinkProps, ToolbarRootProps, ToolbarSeparatorProps };
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Toolbar as Toolbar$1 } from "@base-ui/react/toolbar";
|
|
4
|
+
//#region src/components/Toolbar.tsx
|
|
5
|
+
/**
|
|
6
|
+
* Container for grouping toolbar buttons and controls.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* <Toolbar.Root>
|
|
11
|
+
* <Toolbar.Button>Bold</Toolbar.Button>
|
|
12
|
+
* <Toolbar.Button>Italic</Toolbar.Button>
|
|
13
|
+
* <Toolbar.Separator />
|
|
14
|
+
* <Toolbar.Button>Align Left</Toolbar.Button>
|
|
15
|
+
* </Toolbar.Root>
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* @see {@link https://base-ui.com/react/components/toolbar | Base UI Toolbar}
|
|
19
|
+
*/
|
|
20
|
+
function ToolbarRoot({ className = "", ref, ...props }) {
|
|
21
|
+
const classes = ["toolbar", className].filter(Boolean).join(" ");
|
|
22
|
+
return /* @__PURE__ */ jsx(Toolbar$1.Root, {
|
|
23
|
+
ref,
|
|
24
|
+
className: classes,
|
|
25
|
+
...props
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* A clickable button within the toolbar.
|
|
30
|
+
*/
|
|
31
|
+
function ToolbarButton({ className = "", ref, ...props }) {
|
|
32
|
+
const classes = ["toolbar__button", className].filter(Boolean).join(" ");
|
|
33
|
+
return /* @__PURE__ */ jsx(Toolbar$1.Button, {
|
|
34
|
+
ref,
|
|
35
|
+
className: classes,
|
|
36
|
+
...props
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* A link element within the toolbar.
|
|
41
|
+
*/
|
|
42
|
+
function ToolbarLink({ className = "", ref, ...props }) {
|
|
43
|
+
const classes = ["toolbar__link", className].filter(Boolean).join(" ");
|
|
44
|
+
return /* @__PURE__ */ jsx(Toolbar$1.Link, {
|
|
45
|
+
ref,
|
|
46
|
+
className: classes,
|
|
47
|
+
...props
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Groups toolbar items together.
|
|
52
|
+
*/
|
|
53
|
+
function ToolbarGroup({ className = "", ref, ...props }) {
|
|
54
|
+
const classes = ["toolbar__group", className].filter(Boolean).join(" ");
|
|
55
|
+
return /* @__PURE__ */ jsx(Toolbar$1.Group, {
|
|
56
|
+
ref,
|
|
57
|
+
className: classes,
|
|
58
|
+
...props
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Visual separator between toolbar sections.
|
|
63
|
+
*/
|
|
64
|
+
function ToolbarSeparator({ className = "", ref, ...props }) {
|
|
65
|
+
const classes = ["toolbar__separator", className].filter(Boolean).join(" ");
|
|
66
|
+
return /* @__PURE__ */ jsx(Toolbar$1.Separator, {
|
|
67
|
+
ref,
|
|
68
|
+
className: classes,
|
|
69
|
+
...props
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Input element within the toolbar.
|
|
74
|
+
*/
|
|
75
|
+
function ToolbarInput({ className = "", ref, ...props }) {
|
|
76
|
+
const classes = ["toolbar__input", className].filter(Boolean).join(" ");
|
|
77
|
+
return /* @__PURE__ */ jsx(Toolbar$1.Input, {
|
|
78
|
+
ref,
|
|
79
|
+
className: classes,
|
|
80
|
+
...props
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* A container for grouping buttons and controls.
|
|
85
|
+
* Provides keyboard navigation between items.
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```tsx
|
|
89
|
+
* // Text formatting toolbar
|
|
90
|
+
* <Toolbar.Root>
|
|
91
|
+
* <Toolbar.Group>
|
|
92
|
+
* <Toolbar.Button>Bold</Toolbar.Button>
|
|
93
|
+
* <Toolbar.Button>Italic</Toolbar.Button>
|
|
94
|
+
* <Toolbar.Button>Underline</Toolbar.Button>
|
|
95
|
+
* </Toolbar.Group>
|
|
96
|
+
* <Toolbar.Separator />
|
|
97
|
+
* <Toolbar.Group>
|
|
98
|
+
* <Toolbar.Button>Left</Toolbar.Button>
|
|
99
|
+
* <Toolbar.Button>Center</Toolbar.Button>
|
|
100
|
+
* <Toolbar.Button>Right</Toolbar.Button>
|
|
101
|
+
* </Toolbar.Group>
|
|
102
|
+
* </Toolbar.Root>
|
|
103
|
+
* ```
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* ```tsx
|
|
107
|
+
* // Vertical toolbar
|
|
108
|
+
* <Toolbar.Root orientation="vertical">
|
|
109
|
+
* <Toolbar.Button>Item 1</Toolbar.Button>
|
|
110
|
+
* <Toolbar.Button>Item 2</Toolbar.Button>
|
|
111
|
+
* <Toolbar.Button>Item 3</Toolbar.Button>
|
|
112
|
+
* </Toolbar.Root>
|
|
113
|
+
* ```
|
|
114
|
+
*
|
|
115
|
+
* @see {@link https://base-ui.com/react/components/toolbar | Base UI Toolbar}
|
|
116
|
+
*/
|
|
117
|
+
const Toolbar = {
|
|
118
|
+
Root: ToolbarRoot,
|
|
119
|
+
Button: ToolbarButton,
|
|
120
|
+
Link: ToolbarLink,
|
|
121
|
+
Group: ToolbarGroup,
|
|
122
|
+
Separator: ToolbarSeparator,
|
|
123
|
+
Input: ToolbarInput
|
|
124
|
+
};
|
|
125
|
+
//#endregion
|
|
126
|
+
export { Toolbar };
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Tooltip as Tooltip$1 } from "@base-ui/react/tooltip";
|
|
3
|
+
|
|
4
|
+
//#region src/components/Tooltip.d.ts
|
|
5
|
+
interface TooltipProps extends Tooltip$1.Root.Props {}
|
|
6
|
+
interface TooltipTriggerProps extends Tooltip$1.Trigger.Props {}
|
|
7
|
+
interface TooltipPortalProps extends Tooltip$1.Portal.Props {}
|
|
8
|
+
interface TooltipPositionerProps extends Tooltip$1.Positioner.Props {}
|
|
9
|
+
interface TooltipProviderProps extends Tooltip$1.Provider.Props {
|
|
10
|
+
delayDuration?: number;
|
|
11
|
+
}
|
|
12
|
+
interface TooltipPopupProps extends Omit<Tooltip$1.Popup.Props, "className"> {
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
interface TooltipContentProps extends TooltipPopupProps {
|
|
16
|
+
side?: TooltipPositionerProps["side"];
|
|
17
|
+
sideOffset?: TooltipPositionerProps["sideOffset"];
|
|
18
|
+
align?: TooltipPositionerProps["align"];
|
|
19
|
+
alignOffset?: TooltipPositionerProps["alignOffset"];
|
|
20
|
+
}
|
|
21
|
+
interface TooltipArrowProps extends Omit<Tooltip$1.Arrow.Props, "className"> {
|
|
22
|
+
className?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* A tooltip component for displaying helpful information on hover.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```tsx
|
|
29
|
+
* <Tooltip>
|
|
30
|
+
* <TooltipTrigger>
|
|
31
|
+
* <Button>Hover me</Button>
|
|
32
|
+
* </TooltipTrigger>
|
|
33
|
+
* <TooltipPortal>
|
|
34
|
+
* <TooltipPositioner>
|
|
35
|
+
* <TooltipPopup>
|
|
36
|
+
* <TooltipArrow />
|
|
37
|
+
* Helpful information
|
|
38
|
+
* </TooltipPopup>
|
|
39
|
+
* </TooltipPositioner>
|
|
40
|
+
* </TooltipPortal>
|
|
41
|
+
* </Tooltip>
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* @see {@link https://base-ui.com/react/components/tooltip | Base UI Tooltip}
|
|
45
|
+
*/
|
|
46
|
+
declare const Tooltip: <Payload>(props: Tooltip$1.Root.Props<Payload>) => import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
declare function TooltipProvider({
|
|
48
|
+
delayDuration,
|
|
49
|
+
delay,
|
|
50
|
+
...props
|
|
51
|
+
}: TooltipProviderProps): React.JSX.Element;
|
|
52
|
+
declare function TooltipTrigger(props: TooltipTriggerProps): React.JSX.Element;
|
|
53
|
+
declare const TooltipPortal: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").TooltipPortalProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
54
|
+
declare const TooltipPositioner: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").TooltipPositionerProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
55
|
+
declare function TooltipPopup({
|
|
56
|
+
className,
|
|
57
|
+
ref,
|
|
58
|
+
...props
|
|
59
|
+
}: TooltipPopupProps & {
|
|
60
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
61
|
+
}): React.JSX.Element;
|
|
62
|
+
declare function TooltipContent({
|
|
63
|
+
align,
|
|
64
|
+
alignOffset,
|
|
65
|
+
children,
|
|
66
|
+
side,
|
|
67
|
+
sideOffset,
|
|
68
|
+
ref,
|
|
69
|
+
...props
|
|
70
|
+
}: TooltipContentProps & {
|
|
71
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
72
|
+
}): React.JSX.Element;
|
|
73
|
+
declare function TooltipArrow({
|
|
74
|
+
className,
|
|
75
|
+
ref,
|
|
76
|
+
...props
|
|
77
|
+
}: TooltipArrowProps & {
|
|
78
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
79
|
+
}): React.JSX.Element;
|
|
80
|
+
//#endregion
|
|
81
|
+
export { Tooltip, TooltipArrow, TooltipArrowProps, TooltipContent, TooltipContentProps, TooltipPopup, TooltipPopupProps, TooltipPortal, TooltipPortalProps, TooltipPositioner, TooltipPositionerProps, TooltipProps, TooltipProvider, TooltipProviderProps, TooltipTrigger, TooltipTriggerProps };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import "react";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Tooltip as Tooltip$1 } from "@base-ui/react/tooltip";
|
|
4
|
+
//#region src/components/Tooltip.tsx
|
|
5
|
+
/**
|
|
6
|
+
* A tooltip component for displaying helpful information on hover.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* <Tooltip>
|
|
11
|
+
* <TooltipTrigger>
|
|
12
|
+
* <Button>Hover me</Button>
|
|
13
|
+
* </TooltipTrigger>
|
|
14
|
+
* <TooltipPortal>
|
|
15
|
+
* <TooltipPositioner>
|
|
16
|
+
* <TooltipPopup>
|
|
17
|
+
* <TooltipArrow />
|
|
18
|
+
* Helpful information
|
|
19
|
+
* </TooltipPopup>
|
|
20
|
+
* </TooltipPositioner>
|
|
21
|
+
* </TooltipPortal>
|
|
22
|
+
* </Tooltip>
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @see {@link https://base-ui.com/react/components/tooltip | Base UI Tooltip}
|
|
26
|
+
*/
|
|
27
|
+
const Tooltip = Tooltip$1.Root;
|
|
28
|
+
function TooltipProvider({ delayDuration = 0, delay, ...props }) {
|
|
29
|
+
return /* @__PURE__ */ jsx(Tooltip$1.Provider, {
|
|
30
|
+
delay: delay ?? delayDuration,
|
|
31
|
+
...props
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
function TooltipTrigger(props) {
|
|
35
|
+
return /* @__PURE__ */ jsx(Tooltip$1.Trigger, {
|
|
36
|
+
"data-slot": "tooltip-trigger",
|
|
37
|
+
...props
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
const TooltipPortal = Tooltip$1.Portal;
|
|
41
|
+
const TooltipPositioner = Tooltip$1.Positioner;
|
|
42
|
+
function TooltipPopup({ className = "", ref, ...props }) {
|
|
43
|
+
const classes = ["tooltip__popup", className].filter(Boolean).join(" ");
|
|
44
|
+
return /* @__PURE__ */ jsx(Tooltip$1.Popup, {
|
|
45
|
+
ref,
|
|
46
|
+
"data-slot": "tooltip-content",
|
|
47
|
+
className: classes,
|
|
48
|
+
...props
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
function TooltipContent({ align, alignOffset, children, side, sideOffset = 0, ref, ...props }) {
|
|
52
|
+
return /* @__PURE__ */ jsx(TooltipPortal, { children: /* @__PURE__ */ jsx(TooltipPositioner, {
|
|
53
|
+
align,
|
|
54
|
+
alignOffset,
|
|
55
|
+
side,
|
|
56
|
+
sideOffset,
|
|
57
|
+
children: /* @__PURE__ */ jsxs(TooltipPopup, {
|
|
58
|
+
ref,
|
|
59
|
+
...props,
|
|
60
|
+
children: [children, /* @__PURE__ */ jsx(TooltipArrow, {})]
|
|
61
|
+
})
|
|
62
|
+
}) });
|
|
63
|
+
}
|
|
64
|
+
function TooltipArrow({ className = "", ref, ...props }) {
|
|
65
|
+
const classes = ["tooltip__arrow", className].filter(Boolean).join(" ");
|
|
66
|
+
return /* @__PURE__ */ jsx(Tooltip$1.Arrow, {
|
|
67
|
+
ref,
|
|
68
|
+
"data-slot": "tooltip-arrow",
|
|
69
|
+
className: classes,
|
|
70
|
+
...props
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
//#endregion
|
|
74
|
+
export { Tooltip, TooltipArrow, TooltipContent, TooltipPopup, TooltipPortal, TooltipPositioner, TooltipProvider, TooltipTrigger };
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { r as ButtonProps } from "../Button-QCM8ZKgR.js";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/WebPreview.d.ts
|
|
5
|
+
interface WebPreviewContextValue {
|
|
6
|
+
url: string;
|
|
7
|
+
setUrl: (next: string) => void;
|
|
8
|
+
consoleOpen: boolean;
|
|
9
|
+
setConsoleOpen: (open: boolean) => void;
|
|
10
|
+
canGoBack: boolean;
|
|
11
|
+
canGoForward: boolean;
|
|
12
|
+
goBack: () => void;
|
|
13
|
+
goForward: () => void;
|
|
14
|
+
reload: () => void;
|
|
15
|
+
reloadToken: number;
|
|
16
|
+
}
|
|
17
|
+
interface WebPreviewProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
18
|
+
/** Initial URL for uncontrolled preview history. */
|
|
19
|
+
defaultUrl?: string;
|
|
20
|
+
/** Controlled URL pushed into preview history when it changes. */
|
|
21
|
+
url?: string;
|
|
22
|
+
/** Called when the displayed URL changes. */
|
|
23
|
+
onUrlChange?: (url: string) => void;
|
|
24
|
+
/** Additional class names for layout only; do not override iframe sandboxing from apps. */
|
|
25
|
+
className?: string;
|
|
26
|
+
/** Navigation, body, and optional console slots. */
|
|
27
|
+
children?: React.ReactNode;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* An iframe preview with a navigation bar, URL input, and optional console
|
|
31
|
+
* panel. Tracks browsing history internally so back/forward buttons work
|
|
32
|
+
* without depending on the iframe's own history.
|
|
33
|
+
*
|
|
34
|
+
* Built internally for agent/browser preview surfaces. Use it to display a
|
|
35
|
+
* known URL with local navigation controls. Do not use it for trusted app
|
|
36
|
+
* embedding that needs custom iframe permissions; add those explicitly here.
|
|
37
|
+
*
|
|
38
|
+
* Sigvelo changes: composes Button, Input, ScrollArea, Tooltip, and Badge;
|
|
39
|
+
* keeps a conservative sandbox; maps navigation and console UI to Sigvelo CSS
|
|
40
|
+
* tokens.
|
|
41
|
+
*
|
|
42
|
+
* The iframe has a fixed title and sandbox. Navigation buttons provide
|
|
43
|
+
* accessible labels and tooltips. Add new permissions or console behaviors
|
|
44
|
+
* here when multiple apps need them.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```tsx
|
|
48
|
+
* <WebPreview defaultUrl="https://example.com">
|
|
49
|
+
* <WebPreviewNavigation>
|
|
50
|
+
* <WebPreviewNavigationButton action="back" />
|
|
51
|
+
* <WebPreviewNavigationButton action="forward" />
|
|
52
|
+
* <WebPreviewNavigationButton action="reload" />
|
|
53
|
+
* <WebPreviewUrl />
|
|
54
|
+
* </WebPreviewNavigation>
|
|
55
|
+
* <WebPreviewBody />
|
|
56
|
+
* <WebPreviewConsole logs={logs} />
|
|
57
|
+
* </WebPreview>
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
declare function WebPreview({
|
|
61
|
+
className,
|
|
62
|
+
defaultUrl,
|
|
63
|
+
url: controlledUrl,
|
|
64
|
+
onUrlChange,
|
|
65
|
+
children,
|
|
66
|
+
ref,
|
|
67
|
+
...props
|
|
68
|
+
}: WebPreviewProps & {
|
|
69
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
70
|
+
}): React.JSX.Element;
|
|
71
|
+
interface WebPreviewNavigationProps extends React.HTMLAttributes<HTMLDivElement> {}
|
|
72
|
+
declare function WebPreviewNavigation({
|
|
73
|
+
className,
|
|
74
|
+
children,
|
|
75
|
+
ref,
|
|
76
|
+
...props
|
|
77
|
+
}: WebPreviewNavigationProps & {
|
|
78
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
79
|
+
}): React.JSX.Element;
|
|
80
|
+
interface WebPreviewNavigationButtonProps extends Omit<ButtonProps, "variant" | "size" | "color" | "className" | "onClick"> {
|
|
81
|
+
className?: string;
|
|
82
|
+
action?: "back" | "forward" | "reload";
|
|
83
|
+
label?: string;
|
|
84
|
+
tooltip?: string;
|
|
85
|
+
children?: React.ReactNode;
|
|
86
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
87
|
+
}
|
|
88
|
+
declare function WebPreviewNavigationButton({
|
|
89
|
+
className,
|
|
90
|
+
action,
|
|
91
|
+
label,
|
|
92
|
+
tooltip,
|
|
93
|
+
children,
|
|
94
|
+
onClick,
|
|
95
|
+
...props
|
|
96
|
+
}: WebPreviewNavigationButtonProps): React.JSX.Element;
|
|
97
|
+
interface WebPreviewUrlProps extends React.InputHTMLAttributes<HTMLInputElement> {}
|
|
98
|
+
declare function WebPreviewUrl({
|
|
99
|
+
className,
|
|
100
|
+
placeholder,
|
|
101
|
+
value,
|
|
102
|
+
onChange,
|
|
103
|
+
onKeyDown,
|
|
104
|
+
ref,
|
|
105
|
+
...props
|
|
106
|
+
}: WebPreviewUrlProps & {
|
|
107
|
+
ref?: React.Ref<HTMLInputElement>;
|
|
108
|
+
}): React.JSX.Element;
|
|
109
|
+
interface WebPreviewBodyProps extends Omit<React.IframeHTMLAttributes<HTMLIFrameElement>, "loading"> {
|
|
110
|
+
/** Optional placeholder shown while the iframe has no src. */
|
|
111
|
+
loading?: React.ReactNode;
|
|
112
|
+
interactive?: boolean;
|
|
113
|
+
}
|
|
114
|
+
declare function WebPreviewBody({
|
|
115
|
+
className,
|
|
116
|
+
loading,
|
|
117
|
+
src,
|
|
118
|
+
ref,
|
|
119
|
+
interactive,
|
|
120
|
+
...props
|
|
121
|
+
}: WebPreviewBodyProps & {
|
|
122
|
+
ref?: React.Ref<HTMLIFrameElement>;
|
|
123
|
+
}): React.JSX.Element;
|
|
124
|
+
type ConsoleLogLevel = "log" | "info" | "warn" | "error";
|
|
125
|
+
interface ConsoleLog {
|
|
126
|
+
level: ConsoleLogLevel;
|
|
127
|
+
message: string;
|
|
128
|
+
timestamp: Date;
|
|
129
|
+
}
|
|
130
|
+
interface WebPreviewConsoleProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
131
|
+
logs?: ConsoleLog[];
|
|
132
|
+
}
|
|
133
|
+
declare function WebPreviewConsole({
|
|
134
|
+
className,
|
|
135
|
+
logs,
|
|
136
|
+
children,
|
|
137
|
+
ref,
|
|
138
|
+
...props
|
|
139
|
+
}: WebPreviewConsoleProps & {
|
|
140
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
141
|
+
}): React.JSX.Element;
|
|
142
|
+
//#endregion
|
|
143
|
+
export { ConsoleLog, ConsoleLogLevel, WebPreview, WebPreviewBody, WebPreviewBodyProps, WebPreviewConsole, WebPreviewConsoleProps, WebPreviewContextValue, WebPreviewNavigation, WebPreviewNavigationButton, WebPreviewNavigationButtonProps, WebPreviewNavigationProps, WebPreviewProps, WebPreviewUrl, WebPreviewUrlProps };
|