@mcp-b/react-components 0.1.1 → 0.1.2

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.
Files changed (203) hide show
  1. package/dist/Button-QCM8ZKgR.d.ts +98 -0
  2. package/dist/CodeBlock-CttHhWcb.js +356 -0
  3. package/dist/CodeBlock-V6pgafSS.d.ts +174 -0
  4. package/dist/Select-CRsKCJ9x.d.ts +200 -0
  5. package/dist/class-names-9UtZwb0J.js +12 -0
  6. package/dist/components/Accordion.d.ts +81 -0
  7. package/dist/components/Accordion.js +97 -0
  8. package/dist/components/AgentConnection.d.ts +69 -0
  9. package/dist/components/AgentConnection.js +176 -0
  10. package/dist/components/AlertDialog.d.ts +148 -0
  11. package/dist/components/AlertDialog.js +141 -0
  12. package/dist/components/Artifact.d.ts +128 -0
  13. package/dist/components/Artifact.js +115 -0
  14. package/dist/components/Autocomplete.d.ts +186 -0
  15. package/dist/components/Autocomplete.js +186 -0
  16. package/dist/components/Avatar.d.ts +134 -0
  17. package/dist/components/Avatar.js +118 -0
  18. package/dist/components/Badge.d.ts +68 -0
  19. package/dist/components/Badge.js +108 -0
  20. package/dist/components/Button.d.ts +2 -0
  21. package/dist/components/Button.js +73 -0
  22. package/dist/components/Card.d.ts +87 -0
  23. package/dist/components/Card.js +81 -0
  24. package/dist/components/ChainOfThought.d.ts +153 -0
  25. package/dist/components/ChainOfThought.js +157 -0
  26. package/dist/components/Checkbox.d.ts +35 -0
  27. package/dist/components/Checkbox.js +47 -0
  28. package/dist/components/CheckboxGroup.d.ts +76 -0
  29. package/dist/components/CheckboxGroup.js +69 -0
  30. package/dist/components/CodeBlock.d.ts +2 -0
  31. package/dist/components/CodeBlock.js +2 -0
  32. package/dist/components/Collapsible.d.ts +127 -0
  33. package/dist/components/Collapsible.js +103 -0
  34. package/dist/components/Combobox.d.ts +177 -0
  35. package/dist/components/Combobox.js +179 -0
  36. package/dist/components/Commit.d.ts +265 -0
  37. package/dist/components/Commit.js +282 -0
  38. package/dist/components/Context.d.ts +129 -0
  39. package/dist/components/Context.js +309 -0
  40. package/dist/components/ContextMenu.d.ts +282 -0
  41. package/dist/components/ContextMenu.js +270 -0
  42. package/dist/components/Conversation.d.ts +166 -0
  43. package/dist/components/Conversation.js +202 -0
  44. package/dist/components/Dialog.d.ts +120 -0
  45. package/dist/components/Dialog.js +114 -0
  46. package/dist/components/EnvironmentVariables.d.ts +176 -0
  47. package/dist/components/EnvironmentVariables.js +221 -0
  48. package/dist/components/Field.d.ts +281 -0
  49. package/dist/components/Field.js +274 -0
  50. package/dist/components/Fieldset.d.ts +93 -0
  51. package/dist/components/Fieldset.js +81 -0
  52. package/dist/components/FileTree.d.ts +116 -0
  53. package/dist/components/FileTree.js +310 -0
  54. package/dist/components/Form.d.ts +94 -0
  55. package/dist/components/Form.js +88 -0
  56. package/dist/components/GithubMotionMark.d.ts +13 -0
  57. package/dist/components/GithubMotionMark.js +23 -0
  58. package/dist/components/Input.d.ts +33 -0
  59. package/dist/components/Input.js +27 -0
  60. package/dist/components/Label.d.ts +44 -0
  61. package/dist/components/Label.js +41 -0
  62. package/dist/components/Menu.d.ts +395 -0
  63. package/dist/components/Menu.js +338 -0
  64. package/dist/components/Menubar.d.ts +331 -0
  65. package/dist/components/Menubar.js +299 -0
  66. package/dist/components/Message.d.ts +216 -0
  67. package/dist/components/Message.js +245 -0
  68. package/dist/components/Meter.d.ts +151 -0
  69. package/dist/components/Meter.js +121 -0
  70. package/dist/components/ModelSelector.d.ts +198 -0
  71. package/dist/components/ModelSelector.js +306 -0
  72. package/dist/components/NaniteScene.d.ts +33 -0
  73. package/dist/components/NaniteScene.js +405 -0
  74. package/dist/components/NavigationMenu.d.ts +256 -0
  75. package/dist/components/NavigationMenu.js +228 -0
  76. package/dist/components/NumberField.d.ts +159 -0
  77. package/dist/components/NumberField.js +123 -0
  78. package/dist/components/Popover.d.ts +278 -0
  79. package/dist/components/Popover.js +245 -0
  80. package/dist/components/PreviewCard.d.ts +156 -0
  81. package/dist/components/PreviewCard.js +156 -0
  82. package/dist/components/PricingPage.d.ts +209 -0
  83. package/dist/components/PricingPage.js +506 -0
  84. package/dist/components/Progress.d.ts +58 -0
  85. package/dist/components/Progress.js +51 -0
  86. package/dist/components/PromptInput.d.ts +399 -0
  87. package/dist/components/PromptInput.js +737 -0
  88. package/dist/components/Queue.d.ts +241 -0
  89. package/dist/components/Queue.js +225 -0
  90. package/dist/components/RadioGroup.d.ts +78 -0
  91. package/dist/components/RadioGroup.js +72 -0
  92. package/dist/components/Reasoning.d.ts +88 -0
  93. package/dist/components/Reasoning.js +187 -0
  94. package/dist/components/ScrollArea.d.ts +160 -0
  95. package/dist/components/ScrollArea.js +145 -0
  96. package/dist/components/Select.d.ts +2 -0
  97. package/dist/components/Select.js +260 -0
  98. package/dist/components/Separator.d.ts +45 -0
  99. package/dist/components/Separator.js +40 -0
  100. package/dist/components/Shell.d.ts +163 -0
  101. package/dist/components/Shell.js +137 -0
  102. package/dist/components/Slider.d.ts +120 -0
  103. package/dist/components/Slider.js +115 -0
  104. package/dist/components/Sources.d.ts +91 -0
  105. package/dist/components/Sources.js +121 -0
  106. package/dist/components/Stepper.d.ts +190 -0
  107. package/dist/components/Stepper.js +315 -0
  108. package/dist/components/Switch.d.ts +57 -0
  109. package/dist/components/Switch.js +55 -0
  110. package/dist/components/Tabs.d.ts +84 -0
  111. package/dist/components/Tabs.js +78 -0
  112. package/dist/components/Task.d.ts +100 -0
  113. package/dist/components/Task.js +120 -0
  114. package/dist/components/Terminal.d.ts +118 -0
  115. package/dist/components/Terminal.js +234 -0
  116. package/dist/components/TestResults.d.ts +236 -0
  117. package/dist/components/TestResults.js +346 -0
  118. package/dist/components/Toast.d.ts +192 -0
  119. package/dist/components/Toast.js +163 -0
  120. package/dist/components/Toggle.d.ts +69 -0
  121. package/dist/components/Toggle.js +66 -0
  122. package/dist/components/ToggleGroup.d.ts +69 -0
  123. package/dist/components/ToggleGroup.js +99 -0
  124. package/dist/components/Tool.d.ts +119 -0
  125. package/dist/components/Tool.js +192 -0
  126. package/dist/components/Toolbar.d.ts +162 -0
  127. package/dist/components/Toolbar.js +126 -0
  128. package/dist/components/Tooltip.d.ts +81 -0
  129. package/dist/components/Tooltip.js +74 -0
  130. package/dist/components/WebPreview.d.ts +143 -0
  131. package/dist/components/WebPreview.js +280 -0
  132. package/dist/components/useStickToBottom.d.ts +30 -0
  133. package/dist/components/useStickToBottom.js +95 -0
  134. package/dist/copy-button-BIATcZWZ.d.ts +16 -0
  135. package/dist/copy-button-BNgclDrO.js +43 -0
  136. package/dist/icons-BsWc8g4E.js +221 -0
  137. package/dist/styles/accordion.css +10 -10
  138. package/dist/styles/agent-connection.css +18 -17
  139. package/dist/styles/alert-dialog.css +48 -29
  140. package/dist/styles/artifact.css +10 -10
  141. package/dist/styles/autocomplete.css +25 -24
  142. package/dist/styles/avatar.css +96 -6
  143. package/dist/styles/badge.css +78 -14
  144. package/dist/styles/base.css +9 -9
  145. package/dist/styles/button.css +57 -38
  146. package/dist/styles/card.css +57 -10
  147. package/dist/styles/chain-of-thought.css +47 -33
  148. package/dist/styles/checkbox.css +24 -10
  149. package/dist/styles/code-block.css +22 -15
  150. package/dist/styles/collapsible.css +14 -12
  151. package/dist/styles/combobox.css +26 -25
  152. package/dist/styles/commit.css +49 -24
  153. package/dist/styles/context-menu.css +70 -16
  154. package/dist/styles/context.css +15 -15
  155. package/dist/styles/conversation.css +12 -12
  156. package/dist/styles/dialog.css +52 -16
  157. package/dist/styles/environment-variables.css +19 -19
  158. package/dist/styles/field.css +184 -22
  159. package/dist/styles/fieldset.css +5 -4
  160. package/dist/styles/file-tree.css +17 -17
  161. package/dist/styles/index.css.d.ts +1 -0
  162. package/dist/styles/input.css +45 -11
  163. package/dist/styles/label.css +21 -4
  164. package/dist/styles/menu.css +55 -32
  165. package/dist/styles/menubar.css +80 -28
  166. package/dist/styles/message.css +22 -13
  167. package/dist/styles/meter.css +8 -8
  168. package/dist/styles/model-selector.css +33 -21
  169. package/dist/styles/navigation-menu.css +26 -24
  170. package/dist/styles/number-field.css +20 -18
  171. package/dist/styles/popover.css +38 -28
  172. package/dist/styles/preview-card.css +15 -13
  173. package/dist/styles/pricing-page.css +53 -53
  174. package/dist/styles/progress.css +7 -7
  175. package/dist/styles/prompt-input.css +73 -24
  176. package/dist/styles/queue.css +58 -32
  177. package/dist/styles/radio.css +26 -11
  178. package/dist/styles/reasoning.css +15 -11
  179. package/dist/styles/scroll-area.css +6 -6
  180. package/dist/styles/scrollbars.css +4 -4
  181. package/dist/styles/select.css +84 -25
  182. package/dist/styles/separator.css +1 -1
  183. package/dist/styles/shell.css +21 -20
  184. package/dist/styles/slider.css +35 -11
  185. package/dist/styles/sources.css +20 -20
  186. package/dist/styles/stepper.css +22 -22
  187. package/dist/styles/switch.css +29 -13
  188. package/dist/styles/tabs.css +23 -16
  189. package/dist/styles/task.css +27 -23
  190. package/dist/styles/terminal.css +16 -13
  191. package/dist/styles/test-results.css +79 -32
  192. package/dist/styles/toast.css +26 -25
  193. package/dist/styles/toggle-group.css +12 -12
  194. package/dist/styles/toggle.css +29 -11
  195. package/dist/styles/tool.css +54 -32
  196. package/dist/styles/toolbar.css +30 -28
  197. package/dist/styles/tooltip.css +10 -8
  198. package/dist/styles/web-preview.css +37 -21
  199. package/dist/utils/structured-code.d.ts +10 -0
  200. package/dist/utils/structured-code.js +81 -0
  201. package/package.json +16 -7
  202. package/dist/index.d.ts +0 -7236
  203. package/dist/index.js +0 -8945
@@ -0,0 +1,200 @@
1
+ import * as React from "react";
2
+ import { Select } from "@base-ui/react/select";
3
+
4
+ //#region src/components/Select.d.ts
5
+ interface SelectProps extends React.ComponentPropsWithRef<typeof Select.Root> {
6
+ /**
7
+ * Static list of items for label resolution. Needed when options are inside
8
+ * a portal (not mounted until opened) so SelectValue can display the correct
9
+ * label on initial render.
10
+ */
11
+ items?: Array<{
12
+ label: React.ReactNode;
13
+ value: unknown;
14
+ }>;
15
+ }
16
+ interface SelectTriggerProps extends Omit<Select.Trigger.Props, "className"> {
17
+ className?: string;
18
+ /**
19
+ * The size of the select trigger.
20
+ * @default 'default'
21
+ */
22
+ size?: "sm" | "md" | "default";
23
+ }
24
+ interface SelectValueProps extends Omit<Select.Value.Props, "children"> {
25
+ placeholder?: string;
26
+ children?: Select.Value.Props["children"];
27
+ }
28
+ interface SelectPortalProps extends Select.Portal.Props {}
29
+ interface SelectPositionerProps extends Select.Positioner.Props {}
30
+ interface SelectPopupProps extends Omit<Select.Popup.Props, "className"> {
31
+ className?: string;
32
+ }
33
+ interface SelectListProps extends Omit<Select.List.Props, "className"> {
34
+ className?: string;
35
+ }
36
+ interface SelectOptionProps extends Omit<Select.Item.Props, "className"> {
37
+ className?: string;
38
+ }
39
+ interface SelectOptionGroupProps extends Omit<Select.Group.Props, "className"> {
40
+ className?: string;
41
+ label?: string;
42
+ }
43
+ type SelectItemProps = SelectOptionProps;
44
+ type SelectGroupProps = SelectOptionGroupProps;
45
+ interface SelectLabelProps extends Omit<Select.GroupLabel.Props, "className"> {
46
+ className?: string;
47
+ }
48
+ interface SelectSeparatorProps extends Omit<Select.Separator.Props, "className"> {
49
+ className?: string;
50
+ }
51
+ interface SelectScrollUpButtonProps extends Omit<Select.ScrollUpArrow.Props, "className"> {
52
+ className?: string;
53
+ }
54
+ interface SelectScrollDownButtonProps extends Omit<Select.ScrollDownArrow.Props, "className"> {
55
+ className?: string;
56
+ }
57
+ type SelectPlacementProps = Pick<SelectPositionerProps, "anchor" | "positionMethod" | "side" | "sideOffset" | "align" | "alignOffset" | "collisionBoundary" | "collisionPadding" | "sticky" | "arrowPadding" | "disableAnchorTracking" | "collisionAvoidance"> & {
58
+ position?: "popper" | "item-aligned";
59
+ };
60
+ type SelectContentProps = SelectPopupProps & SelectPlacementProps;
61
+ /**
62
+ * A select component for choosing from a list of options.
63
+ *
64
+ * @example
65
+ * ```tsx
66
+ * <Select defaultValue="option1">
67
+ * <SelectTrigger>
68
+ * <SelectValue placeholder="Select..." />
69
+ * </SelectTrigger>
70
+ * <SelectPortal>
71
+ * <SelectPositioner>
72
+ * <SelectPopup>
73
+ * <SelectList>
74
+ * <SelectOption value="option1">Option 1</SelectOption>
75
+ * <SelectOption value="option2">Option 2</SelectOption>
76
+ * </SelectList>
77
+ * </SelectPopup>
78
+ * </SelectPositioner>
79
+ * </SelectPortal>
80
+ * </Select>
81
+ * ```
82
+ *
83
+ * @see {@link https://base-ui.com/react/components/select | Base UI Select}
84
+ */
85
+ declare function Select$1({
86
+ items,
87
+ ...props
88
+ }: SelectProps): React.JSX.Element;
89
+ declare function SelectTrigger({
90
+ size,
91
+ className,
92
+ children,
93
+ ref,
94
+ ...props
95
+ }: SelectTriggerProps & {
96
+ ref?: React.Ref<HTMLButtonElement>;
97
+ }): React.JSX.Element;
98
+ declare function SelectValue({
99
+ placeholder,
100
+ children,
101
+ ref,
102
+ ...props
103
+ }: SelectValueProps & {
104
+ ref?: React.Ref<HTMLSpanElement>;
105
+ }): React.JSX.Element;
106
+ declare const SelectPortal: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").SelectPortalProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
107
+ declare function SelectPositioner({
108
+ className,
109
+ ref,
110
+ ...props
111
+ }: SelectPositionerProps & {
112
+ className?: string;
113
+ } & {
114
+ ref?: React.Ref<HTMLDivElement>;
115
+ }): React.JSX.Element;
116
+ declare function SelectPopup({
117
+ className,
118
+ ref,
119
+ ...props
120
+ }: SelectPopupProps & {
121
+ ref?: React.Ref<HTMLDivElement>;
122
+ }): React.JSX.Element;
123
+ declare function SelectContent({
124
+ anchor,
125
+ positionMethod,
126
+ side,
127
+ sideOffset,
128
+ align,
129
+ alignOffset,
130
+ collisionBoundary,
131
+ collisionPadding,
132
+ sticky,
133
+ arrowPadding,
134
+ disableAnchorTracking,
135
+ collisionAvoidance,
136
+ position,
137
+ children,
138
+ ...props
139
+ }: SelectContentProps & {
140
+ ref?: React.Ref<HTMLDivElement>;
141
+ }): React.JSX.Element;
142
+ declare function SelectList({
143
+ className,
144
+ ref,
145
+ ...props
146
+ }: SelectListProps & {
147
+ ref?: React.Ref<HTMLDivElement>;
148
+ }): React.JSX.Element;
149
+ declare function SelectOption({
150
+ className,
151
+ value,
152
+ children,
153
+ ref,
154
+ ...props
155
+ }: SelectOptionProps & {
156
+ ref?: React.Ref<HTMLDivElement>;
157
+ }): React.JSX.Element;
158
+ declare const SelectItem: typeof SelectOption;
159
+ declare function SelectOptionGroup({
160
+ label,
161
+ className,
162
+ children,
163
+ ref,
164
+ ...props
165
+ }: SelectOptionGroupProps & {
166
+ ref?: React.Ref<HTMLDivElement>;
167
+ }): React.JSX.Element;
168
+ declare const SelectGroup: typeof SelectOptionGroup;
169
+ declare function SelectLabel({
170
+ className,
171
+ ref,
172
+ ...props
173
+ }: SelectLabelProps & {
174
+ ref?: React.Ref<HTMLDivElement>;
175
+ }): React.JSX.Element;
176
+ declare function SelectSeparator({
177
+ className,
178
+ ref,
179
+ ...props
180
+ }: SelectSeparatorProps & {
181
+ ref?: React.Ref<HTMLDivElement>;
182
+ }): React.JSX.Element;
183
+ declare function SelectScrollUpButton({
184
+ className,
185
+ children,
186
+ ref,
187
+ ...props
188
+ }: SelectScrollUpButtonProps & {
189
+ ref?: React.Ref<HTMLDivElement>;
190
+ }): React.JSX.Element;
191
+ declare function SelectScrollDownButton({
192
+ className,
193
+ children,
194
+ ref,
195
+ ...props
196
+ }: SelectScrollDownButtonProps & {
197
+ ref?: React.Ref<HTMLDivElement>;
198
+ }): React.JSX.Element;
199
+ //#endregion
200
+ export { SelectTriggerProps as A, SelectScrollDownButton as C, SelectSeparator as D, SelectScrollUpButtonProps as E, SelectValueProps as M, SelectSeparatorProps as O, SelectProps as S, SelectScrollUpButton as T, SelectPopupProps as _, SelectGroupProps as a, SelectPositioner as b, SelectLabel as c, SelectListProps as d, SelectOption as f, SelectPopup as g, SelectOptionProps as h, SelectGroup as i, SelectValue as j, SelectTrigger as k, SelectLabelProps as l, SelectOptionGroupProps as m, SelectContent as n, SelectItem as o, SelectOptionGroup as p, SelectContentProps as r, SelectItemProps as s, Select$1 as t, SelectList as u, SelectPortal as v, SelectScrollDownButtonProps as w, SelectPositionerProps as x, SelectPortalProps as y };
@@ -0,0 +1,12 @@
1
+ //#region src/components/_internal/class-names.ts
2
+ /**
3
+ * Concatenates class-name parts, skipping falsy values.
4
+ *
5
+ * Matches the idiom used throughout existing components:
6
+ * `[...].filter(Boolean).join(" ")`
7
+ */
8
+ function cx(...parts) {
9
+ return parts.filter(Boolean).join(" ");
10
+ }
11
+ //#endregion
12
+ export { cx as t };
@@ -0,0 +1,81 @@
1
+ import * as React from "react";
2
+ import { Accordion as Accordion$1 } from "@base-ui/react/accordion";
3
+
4
+ //#region src/components/Accordion.d.ts
5
+ interface AccordionProps extends Omit<React.ComponentPropsWithRef<typeof Accordion$1.Root>, "className"> {
6
+ className?: string;
7
+ }
8
+ interface AccordionItemProps extends Omit<React.ComponentPropsWithRef<typeof Accordion$1.Item>, "className"> {
9
+ className?: string;
10
+ }
11
+ interface AccordionTriggerProps extends Omit<React.ComponentPropsWithRef<typeof Accordion$1.Trigger>, "className"> {
12
+ className?: string;
13
+ }
14
+ interface AccordionPanelProps extends Omit<React.ComponentPropsWithRef<typeof Accordion$1.Panel>, "className"> {
15
+ className?: string;
16
+ }
17
+ type AccordionContentProps = AccordionPanelProps;
18
+ /**
19
+ * An accordion component for showing collapsible content sections.
20
+ *
21
+ * @example
22
+ * ```tsx
23
+ * <Accordion>
24
+ * <AccordionItem value="item-1">
25
+ * <AccordionTrigger>Section 1</AccordionTrigger>
26
+ * <AccordionPanel>Content for section 1</AccordionPanel>
27
+ * </AccordionItem>
28
+ * <AccordionItem value="item-2">
29
+ * <AccordionTrigger>Section 2</AccordionTrigger>
30
+ * <AccordionPanel>Content for section 2</AccordionPanel>
31
+ * </AccordionItem>
32
+ * </Accordion>
33
+ * ```
34
+ *
35
+ * @see {@link https://base-ui.com/react/components/accordion | Base UI Accordion}
36
+ */
37
+ declare function Accordion({
38
+ className,
39
+ ref,
40
+ ...props
41
+ }: AccordionProps & {
42
+ ref?: React.Ref<HTMLDivElement>;
43
+ }): React.JSX.Element;
44
+ /**
45
+ * A single item within an Accordion.
46
+ */
47
+ declare function AccordionItem({
48
+ className,
49
+ ref,
50
+ ...props
51
+ }: AccordionItemProps & {
52
+ ref?: React.Ref<HTMLDivElement>;
53
+ }): React.JSX.Element;
54
+ /**
55
+ * The header/trigger that toggles an AccordionItem.
56
+ */
57
+ declare const AccordionHeader: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").AccordionHeaderProps, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
58
+ /**
59
+ * The clickable trigger button within an AccordionItem.
60
+ */
61
+ declare function AccordionTrigger({
62
+ className,
63
+ children,
64
+ ref,
65
+ ...props
66
+ }: AccordionTriggerProps & {
67
+ ref?: React.Ref<HTMLButtonElement>;
68
+ }): React.JSX.Element;
69
+ /**
70
+ * The collapsible content panel of an AccordionItem.
71
+ */
72
+ declare function AccordionPanel({
73
+ className,
74
+ ref,
75
+ ...props
76
+ }: AccordionPanelProps & {
77
+ ref?: React.Ref<HTMLDivElement>;
78
+ }): React.JSX.Element;
79
+ declare const AccordionContent: typeof AccordionPanel;
80
+ //#endregion
81
+ export { Accordion, AccordionContent, AccordionContentProps, AccordionHeader, AccordionItem, AccordionItemProps, AccordionPanel, AccordionPanelProps, AccordionProps, AccordionTrigger, AccordionTriggerProps };
@@ -0,0 +1,97 @@
1
+ import "react";
2
+ import { Accordion as Accordion$1 } from "@base-ui/react/accordion";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ //#region src/components/Accordion.tsx
5
+ /**
6
+ * An accordion component for showing collapsible content sections.
7
+ *
8
+ * @example
9
+ * ```tsx
10
+ * <Accordion>
11
+ * <AccordionItem value="item-1">
12
+ * <AccordionTrigger>Section 1</AccordionTrigger>
13
+ * <AccordionPanel>Content for section 1</AccordionPanel>
14
+ * </AccordionItem>
15
+ * <AccordionItem value="item-2">
16
+ * <AccordionTrigger>Section 2</AccordionTrigger>
17
+ * <AccordionPanel>Content for section 2</AccordionPanel>
18
+ * </AccordionItem>
19
+ * </Accordion>
20
+ * ```
21
+ *
22
+ * @see {@link https://base-ui.com/react/components/accordion | Base UI Accordion}
23
+ */
24
+ function Accordion({ className = "", ref, ...props }) {
25
+ const classes = ["accordion", className].filter(Boolean).join(" ");
26
+ return /* @__PURE__ */ jsx(Accordion$1.Root, {
27
+ ref,
28
+ className: classes,
29
+ ...props
30
+ });
31
+ }
32
+ /**
33
+ * A single item within an Accordion.
34
+ */
35
+ function AccordionItem({ className = "", ref, ...props }) {
36
+ const classes = ["accordion__item", className].filter(Boolean).join(" ");
37
+ return /* @__PURE__ */ jsx(Accordion$1.Item, {
38
+ ref,
39
+ className: classes,
40
+ ...props
41
+ });
42
+ }
43
+ /**
44
+ * The header/trigger that toggles an AccordionItem.
45
+ */
46
+ const AccordionHeader = Accordion$1.Header;
47
+ /**
48
+ * The clickable trigger button within an AccordionItem.
49
+ */
50
+ function AccordionTrigger({ className = "", children, ref, ...props }) {
51
+ const classes = ["accordion__trigger", className].filter(Boolean).join(" ");
52
+ return /* @__PURE__ */ jsx(Accordion$1.Header, {
53
+ className: "accordion__header",
54
+ children: /* @__PURE__ */ jsxs(Accordion$1.Trigger, {
55
+ ref,
56
+ className: classes,
57
+ ...props,
58
+ children: [/* @__PURE__ */ jsx("span", {
59
+ className: "accordion__trigger-text",
60
+ children
61
+ }), /* @__PURE__ */ jsx("span", {
62
+ className: "accordion__icon",
63
+ "aria-hidden": "true",
64
+ children: /* @__PURE__ */ jsx("svg", {
65
+ width: "12",
66
+ height: "12",
67
+ viewBox: "0 0 12 12",
68
+ fill: "none",
69
+ xmlns: "http://www.w3.org/2000/svg",
70
+ "aria-hidden": "true",
71
+ focusable: "false",
72
+ children: /* @__PURE__ */ jsx("path", {
73
+ d: "M2.5 4.5L6 8L9.5 4.5",
74
+ stroke: "currentColor",
75
+ strokeWidth: "1.5",
76
+ strokeLinecap: "round",
77
+ strokeLinejoin: "round"
78
+ })
79
+ })
80
+ })]
81
+ })
82
+ });
83
+ }
84
+ /**
85
+ * The collapsible content panel of an AccordionItem.
86
+ */
87
+ function AccordionPanel({ className = "", ref, ...props }) {
88
+ const classes = ["accordion__panel", className].filter(Boolean).join(" ");
89
+ return /* @__PURE__ */ jsx(Accordion$1.Panel, {
90
+ ref,
91
+ className: classes,
92
+ ...props
93
+ });
94
+ }
95
+ const AccordionContent = AccordionPanel;
96
+ //#endregion
97
+ export { Accordion, AccordionContent, AccordionHeader, AccordionItem, AccordionPanel, AccordionTrigger };
@@ -0,0 +1,69 @@
1
+ import * as React from "react";
2
+
3
+ //#region src/components/AgentConnection.d.ts
4
+ type AgentConnectionTarget = string;
5
+ type AgentConnectionCommand = {
6
+ readonly target: AgentConnectionTarget;
7
+ readonly label: string;
8
+ readonly description: string;
9
+ readonly language: "bash" | "json";
10
+ readonly code: string;
11
+ };
12
+ type ConnectionProps = React.SVGProps<SVGGElement> & {
13
+ readonly fromX: number;
14
+ readonly fromY: number;
15
+ readonly toX: number;
16
+ readonly toY: number;
17
+ };
18
+ type NanitesAgentConnectionOptions = {
19
+ readonly mcpName?: string;
20
+ readonly pluginMarketplace?: string;
21
+ readonly claudePluginRef?: string;
22
+ readonly skillName?: string;
23
+ };
24
+ type AgentConnectionPanelProps = {
25
+ readonly className?: string;
26
+ readonly commands?: readonly AgentConnectionCommand[];
27
+ readonly defaultTarget?: AgentConnectionTarget;
28
+ readonly headingLevel?: 2 | 3;
29
+ readonly origin?: string;
30
+ readonly section?: boolean;
31
+ };
32
+ type AgentConnectionPopoverProps = Omit<AgentConnectionPanelProps, "section"> & {
33
+ readonly className?: string;
34
+ };
35
+ declare function Connection({
36
+ fromX,
37
+ fromY,
38
+ toX,
39
+ toY,
40
+ ...props
41
+ }: ConnectionProps): React.JSX.Element;
42
+ declare function buildNanitesAgentConnectionCommands(origin: string, {
43
+ mcpName,
44
+ pluginMarketplace,
45
+ claudePluginRef,
46
+ skillName
47
+ }?: NanitesAgentConnectionOptions): readonly AgentConnectionCommand[];
48
+ /**
49
+ * Shows copyable install commands for connecting an agent to Nanites.
50
+ * Use inside setup screens where users need Codex, Claude Code, skill-only,
51
+ * or raw MCP JSON connection instructions.
52
+ */
53
+ declare function AgentConnectionPanel({
54
+ className,
55
+ commands: commandsProp,
56
+ defaultTarget,
57
+ headingLevel,
58
+ origin,
59
+ section
60
+ }: AgentConnectionPanelProps): React.JSX.Element | null;
61
+ /**
62
+ * Compact popover trigger for showing AgentConnectionPanel inline.
63
+ */
64
+ declare function AgentConnectionPopover({
65
+ className,
66
+ ...props
67
+ }: AgentConnectionPopoverProps): React.JSX.Element;
68
+ //#endregion
69
+ export { AgentConnectionCommand, AgentConnectionPanel, AgentConnectionPanelProps, AgentConnectionPopover, AgentConnectionPopoverProps, AgentConnectionTarget, Connection, ConnectionProps, NanitesAgentConnectionOptions, buildNanitesAgentConnectionCommands };
@@ -0,0 +1,176 @@
1
+ import { v as LinkIcon } from "../icons-BsWc8g4E.js";
2
+ import { t as cx } from "../class-names-9UtZwb0J.js";
3
+ import { Button } from "./Button.js";
4
+ import { a as CodeBlockCopyButton, i as CodeBlockContent, n as CodeBlockActions, p as CodeBlockTitle, r as CodeBlockContainer, s as CodeBlockHeader, t as CodeBlock } from "../CodeBlock-CttHhWcb.js";
5
+ import { Popover } from "./Popover.js";
6
+ import * as React from "react";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ //#region src/components/AgentConnection.tsx
9
+ const DEFAULT_LOCAL_ORIGIN = "http://localhost:5173";
10
+ const CONNECTION_CURVE_MIDPOINT = .5;
11
+ function Connection({ fromX, fromY, toX, toY, ...props }) {
12
+ const controlX = fromX + (toX - fromX) * CONNECTION_CURVE_MIDPOINT;
13
+ return /* @__PURE__ */ jsxs("g", {
14
+ ...props,
15
+ children: [/* @__PURE__ */ jsx("path", {
16
+ className: "animated",
17
+ d: `M${fromX},${fromY} C ${controlX},${fromY} ${controlX},${toY} ${toX},${toY}`,
18
+ fill: "none",
19
+ stroke: "var(--sigvelo-color-focus)",
20
+ strokeWidth: 1
21
+ }), /* @__PURE__ */ jsx("circle", {
22
+ cx: toX,
23
+ cy: toY,
24
+ fill: "var(--sigvelo-color-canvas)",
25
+ r: 3,
26
+ stroke: "var(--sigvelo-color-focus)",
27
+ strokeWidth: 1
28
+ })]
29
+ });
30
+ }
31
+ function getBrowserOrigin() {
32
+ if (typeof window === "undefined") return DEFAULT_LOCAL_ORIGIN;
33
+ return window.location.origin;
34
+ }
35
+ function buildMcpUrl(origin) {
36
+ return `${origin.replace(/\/$/, "")}/mcp`;
37
+ }
38
+ function buildNanitesAgentConnectionCommands(origin, { mcpName = "nanites", pluginMarketplace = "WebMCP-org/nanites", claudePluginRef = "nanites@nanites", skillName = "nanites" } = {}) {
39
+ const mcpUrl = buildMcpUrl(origin);
40
+ return [
41
+ {
42
+ target: "codex",
43
+ label: "Codex",
44
+ description: "Install the Nanites plugin marketplace, then connect this deployment over MCP.",
45
+ language: "bash",
46
+ code: [
47
+ `NANITES_MCP_URL="${mcpUrl}"`,
48
+ "",
49
+ `codex plugin marketplace add ${pluginMarketplace}`,
50
+ `codex mcp add ${mcpName} --url "$NANITES_MCP_URL"`,
51
+ `codex mcp login ${mcpName}`
52
+ ].join("\n")
53
+ },
54
+ {
55
+ target: "claude-code",
56
+ label: "Claude Code",
57
+ description: "Install the Nanites plugin and add this deployment as the Nanites MCP server.",
58
+ language: "bash",
59
+ code: [
60
+ `NANITES_MCP_URL="${mcpUrl}"`,
61
+ "",
62
+ `claude plugin marketplace add ${pluginMarketplace}`,
63
+ `claude plugin install ${claudePluginRef}`,
64
+ `claude mcp add --transport http --scope user ${mcpName} "$NANITES_MCP_URL"`
65
+ ].join("\n")
66
+ },
67
+ {
68
+ target: "skill",
69
+ label: "Skill Only",
70
+ description: "Install the Nanites skill without installing a plugin.",
71
+ language: "bash",
72
+ code: [
73
+ `npx --yes skills add ${pluginMarketplace} \\`,
74
+ ` --skill ${skillName} \\`,
75
+ ` --global \\`,
76
+ ` --copy \\`,
77
+ ` --agent codex claude-code \\`,
78
+ ` -y`
79
+ ].join("\n")
80
+ },
81
+ {
82
+ target: "mcp-json",
83
+ label: "MCP JSON",
84
+ description: "Use this with clients that accept direct MCP server JSON.",
85
+ language: "json",
86
+ code: JSON.stringify({ mcpServers: { [mcpName]: {
87
+ type: "http",
88
+ url: mcpUrl
89
+ } } }, null, 2)
90
+ }
91
+ ];
92
+ }
93
+ /**
94
+ * Shows copyable install commands for connecting an agent to Nanites.
95
+ * Use inside setup screens where users need Codex, Claude Code, skill-only,
96
+ * or raw MCP JSON connection instructions.
97
+ */
98
+ function AgentConnectionPanel({ className, commands: commandsProp, defaultTarget = "codex", headingLevel = 2, origin, section = true }) {
99
+ const commands = React.useMemo(() => commandsProp ?? buildNanitesAgentConnectionCommands(origin ?? getBrowserOrigin()), [commandsProp, origin]);
100
+ const [target, setTarget] = React.useState(defaultTarget);
101
+ const selected = commands.find((command) => command.target === target) ?? commands[0];
102
+ const Heading = headingLevel === 3 ? "h3" : "h2";
103
+ const Wrapper = section ? "section" : "div";
104
+ if (!selected) return null;
105
+ return /* @__PURE__ */ jsxs(Wrapper, {
106
+ className: cx("agent-connect", className),
107
+ children: [
108
+ /* @__PURE__ */ jsxs("div", {
109
+ className: "agent-connect__header",
110
+ children: [/* @__PURE__ */ jsx("div", {
111
+ className: "agent-connect__icon",
112
+ "aria-hidden": "true",
113
+ children: /* @__PURE__ */ jsx(LinkIcon, {
114
+ size: 18,
115
+ strokeWidth: 2
116
+ })
117
+ }), /* @__PURE__ */ jsxs("div", {
118
+ className: "agent-connect__title-group",
119
+ children: [/* @__PURE__ */ jsx(Heading, { children: "Connect Agent" }), /* @__PURE__ */ jsx("p", { children: selected.description })]
120
+ })]
121
+ }),
122
+ /* @__PURE__ */ jsxs("fieldset", {
123
+ className: "agent-connect__targets",
124
+ children: [/* @__PURE__ */ jsx("legend", {
125
+ className: "agent-connect__legend",
126
+ children: "Agent connection target"
127
+ }), commands.map((command) => /* @__PURE__ */ jsx(Button, {
128
+ variant: "ghost",
129
+ color: "neutral",
130
+ size: "sm",
131
+ "aria-pressed": command.target === selected.target,
132
+ "data-selected": command.target === selected.target,
133
+ className: "agent-connect__target",
134
+ onClick: () => {
135
+ setTarget(command.target);
136
+ },
137
+ children: command.label
138
+ }, command.target))]
139
+ }),
140
+ /* @__PURE__ */ jsxs(CodeBlock, {
141
+ code: selected.code,
142
+ language: selected.language,
143
+ children: [/* @__PURE__ */ jsxs(CodeBlockHeader, { children: [/* @__PURE__ */ jsx(CodeBlockTitle, { children: selected.label }), /* @__PURE__ */ jsx(CodeBlockActions, { children: /* @__PURE__ */ jsx(CodeBlockCopyButton, {}) })] }), /* @__PURE__ */ jsx(CodeBlockContainer, { children: /* @__PURE__ */ jsx(CodeBlockContent, {}) })]
144
+ })
145
+ ]
146
+ });
147
+ }
148
+ /**
149
+ * Compact popover trigger for showing AgentConnectionPanel inline.
150
+ */
151
+ function AgentConnectionPopover({ className, ...props }) {
152
+ return /* @__PURE__ */ jsxs(Popover.Root, { children: [/* @__PURE__ */ jsx(Popover.Trigger, { render: /* @__PURE__ */ jsxs(Button, {
153
+ type: "button",
154
+ color: "neutral",
155
+ variant: "outline",
156
+ size: "sm",
157
+ className: cx("agent-connect-trigger", className),
158
+ children: [/* @__PURE__ */ jsx(LinkIcon, {
159
+ size: 16,
160
+ strokeWidth: 2
161
+ }), /* @__PURE__ */ jsx("span", { children: "Connect agent" })]
162
+ }) }), /* @__PURE__ */ jsx(Popover.Portal, { children: /* @__PURE__ */ jsx(Popover.Positioner, {
163
+ side: "top",
164
+ align: "start",
165
+ sideOffset: 10,
166
+ children: /* @__PURE__ */ jsxs(Popover.Popup, {
167
+ className: "agent-connect-popover",
168
+ children: [/* @__PURE__ */ jsx(AgentConnectionPanel, {
169
+ ...props,
170
+ section: false
171
+ }), /* @__PURE__ */ jsx(Popover.Arrow, {})]
172
+ })
173
+ }) })] });
174
+ }
175
+ //#endregion
176
+ export { AgentConnectionPanel, AgentConnectionPopover, Connection, buildNanitesAgentConnectionCommands };