@mcp-b/react-components 0.48.0 → 0.49.1
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/AgentChatQueue-v5890eA1.d.ts +48 -0
- package/dist/AgentToolRunsContext-GMe_hSnD.d.ts +35 -0
- package/dist/Avatar-o2NO1fCG.d.ts +124 -0
- package/dist/{Button-CZt3yywF.d.ts → Button-DjONW5UW.d.ts} +1 -1
- package/dist/{CodeBlock-C380GD5t.d.ts → CodeBlock--r6GS8YV.d.ts} +8 -2
- package/dist/{CodeBlock-BSJl682D.js → CodeBlock-g8sADidM.js} +8 -8
- package/dist/{FileTree-DvE0hNZu.js → FileTree-DruTQ-oa.js} +38 -36
- package/dist/{IconButton-BAUFhUk8.d.ts → IconButton-ByiyjkYE.d.ts} +2 -2
- package/dist/{Menu-yb6QXWA3.d.ts → Menu-CgfUZhZd.d.ts} +1 -1
- package/dist/{Message-D_vCVEGB.d.ts → Message-DyaTBiV7.d.ts} +17 -4
- package/dist/MessageScrollerVirtual-D4afYwVB.d.ts +84 -0
- package/dist/{PromptInput-DtJHyp0S.d.ts → PromptInput-4kCz3T9P.d.ts} +45 -32
- package/dist/PromptInputApproval-D2hpn54U.d.ts +44 -0
- package/dist/Separator-CzhtLYE1.d.ts +41 -0
- package/dist/Toolbar-CGY004u0.d.ts +155 -0
- package/dist/{Workspace-LIoU30n7.d.ts → Workspace-HzGrWDX3.d.ts} +1 -1
- package/dist/{WorkspaceFile-Dq-GC0_T.d.ts → WorkspaceFile-Bouauobc.d.ts} +1 -1
- package/dist/{WorkspaceFileView-C_WnYm-a.js → WorkspaceFileView-DYPtRVpM.js} +5 -4
- package/dist/{WorkspaceLink-B1d2GIGl.js → WorkspaceLink-BYZG-V_I.js} +8 -91
- package/dist/{WorkspaceMessageResponse-BqOezptB.js → WorkspaceMessageResponse-CUJk9_P5.js} +2 -2
- package/dist/components/agents-sdk/AgentActivity.js +1 -1
- package/dist/components/agents-sdk/AgentChat.d.ts +198 -2
- package/dist/components/agents-sdk/AgentChat.js +527 -672
- package/dist/components/agents-sdk/AgentChatQueue.d.ts +2 -0
- package/dist/components/agents-sdk/AgentChatQueue.js +206 -0
- package/dist/components/agents-sdk/AgentEvent.js +2 -2
- package/dist/components/agents-sdk/AgentToolRunsContext.d.ts +2 -2
- package/dist/components/agents-sdk/AgentToolRunsContext.js +1 -36
- package/dist/components/agents-sdk/BrowserLiveScreen.js +22 -14
- package/dist/components/agents-sdk/BrowserLiveView.js +1 -1
- package/dist/components/agents-sdk/BrowserReplay.d.ts +1 -1
- package/dist/components/agents-sdk/BrowserReplay.js +1 -1
- package/dist/components/agents-sdk/BrowserRunPanel.d.ts +3 -0
- package/dist/components/agents-sdk/BrowserRunPanel.js +32 -31
- package/dist/components/agents-sdk/EmployeeChrome.d.ts +212 -0
- package/dist/components/agents-sdk/EmployeeChrome.js +555 -0
- package/dist/components/agents-sdk/ManagerOffice.d.ts +79 -40
- package/dist/components/agents-sdk/ManagerOffice.js +291 -281
- package/dist/components/agents-sdk/McpConnectionRequest.d.ts +4 -4
- package/dist/components/agents-sdk/McpConnectionRequest.js +4 -3
- package/dist/components/agents-sdk/McpConnectorForm.d.ts +38 -1
- package/dist/components/agents-sdk/McpConnectorForm.js +1 -1
- package/dist/components/agents-sdk/McpPluginCatalog.d.ts +93 -1
- package/dist/components/agents-sdk/McpPluginCatalog.js +5 -4
- package/dist/components/agents-sdk/McpServerIcon.d.ts +17 -0
- package/dist/components/agents-sdk/McpServerIcon.js +25 -0
- package/dist/components/agents-sdk/McpServerPicker.d.ts +5 -4
- package/dist/components/agents-sdk/McpServerPicker.js +4 -3
- package/dist/components/agents-sdk/ModelSelector.d.ts +4 -4
- package/dist/components/agents-sdk/ModelSelector.js +4 -4
- package/dist/components/agents-sdk/PromptInputApproval.d.ts +1 -43
- package/dist/components/agents-sdk/PromptInputApproval.js +1 -1
- package/dist/components/agents-sdk/PromptInputCommands.d.ts +1 -1
- package/dist/components/agents-sdk/PromptInputCommands.js +2 -3
- package/dist/components/agents-sdk/SessionCompaction.d.ts +88 -1
- package/dist/components/agents-sdk/SessionCompaction.js +2 -2
- package/dist/components/agents-sdk/SubagentRunDetails.d.ts +30 -1
- package/dist/components/agents-sdk/SubagentRunDetails.js +57 -1
- package/dist/components/agents-sdk/SubagentRunIndicator.d.ts +9 -9
- package/dist/components/agents-sdk/SubagentRunIndicator.js +19 -24
- package/dist/components/agents-sdk/SubagentRunList.d.ts +6 -3
- package/dist/components/agents-sdk/SubagentRunList.js +4 -2
- package/dist/components/agents-sdk/SubagentRunPanel.d.ts +60 -0
- package/dist/components/agents-sdk/SubagentRunPanel.js +255 -0
- package/dist/components/agents-sdk/SubagentRunSelector.d.ts +8 -4
- package/dist/components/agents-sdk/SubagentRunSelector.js +5 -3
- package/dist/components/agents-sdk/ThinkChat.d.ts +102 -2
- package/dist/components/agents-sdk/ThinkChat.js +233 -2
- package/dist/components/agents-sdk/ThinkChatActivity.d.ts +76 -1
- package/dist/components/agents-sdk/ThinkChatActivity.js +18 -10
- package/dist/components/agents-sdk/ThinkChatContext.d.ts +27 -1
- package/dist/components/agents-sdk/ThinkChatContext.js +1 -1
- package/dist/components/agents-sdk/ThinkChatToolPanels.js +24 -19
- package/dist/components/agents-sdk/ThinkExecutionDetail.js +2 -2
- package/dist/components/agents-sdk/ThinkExecutionStatus.d.ts +1 -1
- package/dist/components/agents-sdk/ThinkExecutionStatus.js +1 -1
- package/dist/components/agents-sdk/ThinkExecutionWorkbench.d.ts +85 -28
- package/dist/components/agents-sdk/ThinkExecutionWorkbench.js +159 -102
- package/dist/components/agents-sdk/ThinkFullApp.d.ts +40 -158
- package/dist/components/agents-sdk/ThinkFullApp.js +71 -290
- package/dist/components/agents-sdk/ThinkRecoveryNotice.d.ts +18 -1
- package/dist/components/agents-sdk/ThinkRecoveryNotice.js +1 -1
- package/dist/components/agents-sdk/ThinkRoutineActions.d.ts +51 -0
- package/dist/components/agents-sdk/ThinkRoutineActions.js +201 -0
- package/dist/components/agents-sdk/ThinkRoutineBrowser.d.ts +4 -1
- package/dist/components/agents-sdk/ThinkRoutineBrowser.js +17 -15
- package/dist/components/agents-sdk/ThinkRoutineDetail.js +11 -11
- package/dist/components/agents-sdk/ThinkRoutineForm.d.ts +2 -1
- package/dist/components/agents-sdk/ThinkRoutineForm.js +14 -14
- package/dist/components/agents-sdk/ThinkRoutineRuns.js +7 -7
- package/dist/components/agents-sdk/ThinkThreadPicker.d.ts +90 -1
- package/dist/components/agents-sdk/ThinkThreadPicker.js +3 -3
- package/dist/components/agents-sdk/Workspace.d.ts +1 -1
- package/dist/components/agents-sdk/Workspace.js +7 -13
- package/dist/components/agents-sdk/WorkspaceBrowser.d.ts +1 -1
- package/dist/components/agents-sdk/WorkspaceBrowser.js +1 -1
- package/dist/components/agents-sdk/WorkspaceConcept.d.ts +1 -1
- package/dist/components/agents-sdk/WorkspaceCorrespondence.d.ts +10 -1
- package/dist/components/agents-sdk/WorkspaceCorrespondence.js +10 -7
- package/dist/components/agents-sdk/WorkspaceExecution.d.ts +5 -14
- package/dist/components/agents-sdk/WorkspaceExecution.js +24 -38
- package/dist/components/agents-sdk/WorkspaceExplorer.d.ts +5 -2
- package/dist/components/agents-sdk/WorkspaceExplorer.js +3 -2
- package/dist/components/agents-sdk/WorkspaceFile.d.ts +1 -1
- package/dist/components/agents-sdk/WorkspaceFileView.d.ts +1 -1
- package/dist/components/agents-sdk/WorkspaceFileView.js +1 -1
- package/dist/components/agents-sdk/WorkspaceHeader.js +1 -1
- package/dist/components/agents-sdk/WorkspaceLink.js +1 -1
- package/dist/components/agents-sdk/WorkspaceLive.d.ts +60 -1
- package/dist/components/agents-sdk/WorkspaceMessageResponse.d.ts +47 -1
- package/dist/components/agents-sdk/WorkspaceMessageResponse.js +1 -1
- package/dist/components/agents-sdk/WorkspaceMountManager.d.ts +3 -2
- package/dist/components/agents-sdk/WorkspaceMountManager.js +6 -9
- package/dist/components/agents-sdk/WorkspaceNavigationRestoration.d.ts +38 -0
- package/dist/components/agents-sdk/WorkspaceNavigationRestoration.js +86 -0
- package/dist/components/agents-sdk/WorkspaceProject.d.ts +5 -14
- package/dist/components/agents-sdk/WorkspaceProject.js +21 -35
- package/dist/components/agents-sdk/WorkspaceUserScript.d.ts +1 -1
- package/dist/components/agents-sdk/WorkspaceUserScript.js +8 -5
- package/dist/components/ai-sdk/Activity.d.ts +1 -1
- package/dist/components/ai-sdk/Activity.js +1 -1
- package/dist/components/ai-sdk/AgentAttention.d.ts +2 -2
- package/dist/components/ai-sdk/AgentChatMessageEditor.js +5 -1
- package/dist/components/ai-sdk/AgentChatStartScreen.d.ts +89 -2
- package/dist/components/ai-sdk/AgentChatStartScreen.js +64 -43
- package/dist/components/ai-sdk/AgentMessageParts.d.ts +45 -1
- package/dist/components/ai-sdk/Approval.d.ts +1 -1
- package/dist/components/ai-sdk/Approval.js +2 -2
- package/dist/components/ai-sdk/Artifact.d.ts +2 -2
- package/dist/components/ai-sdk/Artifact.js +1 -1
- package/dist/components/ai-sdk/ChainOfThought.d.ts +1 -1
- package/dist/components/ai-sdk/ChainOfThought.js +1 -1
- package/dist/components/ai-sdk/Checkpoint.js +1 -1
- package/dist/components/ai-sdk/CodeBlock.d.ts +1 -1
- package/dist/components/ai-sdk/CodeBlock.js +1 -1
- package/dist/components/ai-sdk/ComposerLink.js +2 -3
- package/dist/components/ai-sdk/ConnectedAppCards.d.ts +9 -1
- package/dist/components/ai-sdk/ConnectedAppCards.js +28 -21
- package/dist/components/ai-sdk/Context.d.ts +7 -3
- package/dist/components/ai-sdk/Context.js +7 -17
- package/dist/components/ai-sdk/Conversation.d.ts +2 -2
- package/dist/components/ai-sdk/Conversation.js +1 -1
- package/dist/components/ai-sdk/Goal.d.ts +3 -3
- package/dist/components/ai-sdk/Goal.js +3 -3
- package/dist/components/ai-sdk/InlineCitation.d.ts +1 -1
- package/dist/components/ai-sdk/MediaPreviewCard.d.ts +1 -1
- package/dist/components/ai-sdk/MediaPreviewCard.js +1 -1
- package/dist/components/ai-sdk/Message.d.ts +2 -2
- package/dist/components/ai-sdk/Message.js +12 -3
- package/dist/components/ai-sdk/MessageScroller.d.ts +1 -1
- package/dist/components/ai-sdk/MessageScroller.js +1 -1
- package/dist/components/ai-sdk/MessageScrollerVirtual.d.ts +2 -76
- package/dist/components/ai-sdk/MessageScrollerVirtual.js +40 -5
- package/dist/components/ai-sdk/Plan.d.ts +1 -1
- package/dist/components/ai-sdk/Plan.js +1 -1
- package/dist/components/ai-sdk/PromptInput.d.ts +2 -2
- package/dist/components/ai-sdk/PromptInput.js +175 -231
- package/dist/components/ai-sdk/PromptInputComposerEditor.js +32 -9
- package/dist/components/ai-sdk/Queue.d.ts +28 -5
- package/dist/components/ai-sdk/Queue.js +20 -5
- package/dist/components/ai-sdk/Reasoning.d.ts +1 -1
- package/dist/components/ai-sdk/Reasoning.js +5 -5
- package/dist/components/ai-sdk/Sources.d.ts +1 -1
- package/dist/components/ai-sdk/Sources.js +1 -1
- package/dist/components/ai-sdk/Task.d.ts +1 -1
- package/dist/components/ai-sdk/Task.js +1 -1
- package/dist/components/extension/ChatGptSignInScreen.d.ts +1 -1
- package/dist/components/extension/ChatGptSignInScreen.js +1 -1
- package/dist/components/extension/CodexModelSelector.d.ts +6 -1
- package/dist/components/extension/CodexModelSelector.js +3 -3
- package/dist/components/extension/ConversationTabPicker.d.ts +1 -0
- package/dist/components/extension/ConversationTabPicker.js +2 -2
- package/dist/components/foundations/AlertDialog.d.ts +1 -1
- package/dist/components/foundations/AppIcon.d.ts +3 -2
- package/dist/components/foundations/Autocomplete.js +6 -1
- package/dist/components/foundations/Avatar.d.ts +1 -121
- package/dist/components/foundations/Button.d.ts +1 -1
- package/dist/components/foundations/Card.d.ts +22 -27
- package/dist/components/foundations/Card.js +51 -32
- package/dist/components/foundations/Checkbox.js +1 -1
- package/dist/components/foundations/CheckboxGroup.d.ts +1 -1
- package/dist/components/foundations/Collapsible.d.ts +1 -1
- package/dist/components/foundations/Collapsible.js +1 -1
- package/dist/components/foundations/Combobox.js +6 -1
- package/dist/components/foundations/ContextMenu.d.ts +10 -23
- package/dist/components/foundations/ContextMenu.js +3 -2
- package/dist/components/foundations/Dialog.d.ts +106 -1
- package/dist/components/foundations/EmptyState.d.ts +1 -1
- package/dist/components/foundations/Field.d.ts +2 -1
- package/dist/components/foundations/Fieldset.d.ts +1 -1
- package/dist/components/foundations/Form.d.ts +4 -4
- package/dist/components/foundations/IconButton.d.ts +1 -1
- package/dist/components/foundations/Label.d.ts +1 -1
- package/dist/components/foundations/LinkButton.d.ts +2 -2
- package/dist/components/foundations/Menu.d.ts +1 -1
- package/dist/components/foundations/Menubar.d.ts +1 -1
- package/dist/components/foundations/Menubar.js +1 -1
- package/dist/components/foundations/Meter.d.ts +1 -1
- package/dist/components/foundations/NumberField.d.ts +1 -1
- package/dist/components/foundations/PreviewCard.d.ts +1 -1
- package/dist/components/foundations/ScrollArea.d.ts +1 -1
- package/dist/components/foundations/SearchField.d.ts +1 -1
- package/dist/components/foundations/SearchField.js +1 -1
- package/dist/components/foundations/Select.js +7 -2
- package/dist/components/foundations/Separator.d.ts +1 -40
- package/dist/components/foundations/Stepper.d.ts +1 -1
- package/dist/components/foundations/Stepper.js +1 -1
- package/dist/components/foundations/Textarea.d.ts +1 -1
- package/dist/components/foundations/Toast.d.ts +5 -1
- package/dist/components/foundations/Toast.js +1 -1
- package/dist/components/foundations/Toggle.d.ts +70 -1
- package/dist/components/foundations/ToggleGroup.d.ts +4 -3
- package/dist/components/foundations/ToggleGroup.js +1 -1
- package/dist/components/foundations/Toolbar.d.ts +1 -151
- package/dist/components/foundations/Tooltip.d.ts +1 -1
- package/dist/components/foundations/TransitionSurface.d.ts +1 -1
- package/dist/components/foundations/icons.js +1 -1
- package/dist/components/general-purpose/ActionGuide.d.ts +10 -26
- package/dist/components/general-purpose/ActionGuide.js +4 -18
- package/dist/components/general-purpose/AppTopBar.d.ts +4 -2
- package/dist/components/general-purpose/Commit.d.ts +2 -2
- package/dist/components/general-purpose/Commit.js +2 -2
- package/dist/components/general-purpose/EnvironmentVariables.d.ts +2 -2
- package/dist/components/general-purpose/EnvironmentVariables.js +2 -2
- package/dist/components/general-purpose/FileTree.d.ts +1 -7
- package/dist/components/general-purpose/FileTree.js +1 -1
- package/dist/components/general-purpose/PricingPlanCard.d.ts +4 -0
- package/dist/components/general-purpose/PricingPlanCard.js +2 -2
- package/dist/components/general-purpose/PricingUsageCalculator.js +2 -2
- package/dist/components/general-purpose/ResizableSidePanel.d.ts +2 -2
- package/dist/components/general-purpose/ResponsiveSidebarShell.d.ts +128 -2
- package/dist/components/general-purpose/ResponsiveSidebarShell.js +120 -102
- package/dist/components/general-purpose/SettingsFormDialog.d.ts +14 -27
- package/dist/components/general-purpose/SettingsFormDialog.js +42 -72
- package/dist/components/general-purpose/SetupChecklist.d.ts +1 -0
- package/dist/components/general-purpose/SetupChecklist.js +76 -1
- package/dist/components/general-purpose/Terminal.d.ts +3 -3
- package/dist/components/general-purpose/Terminal.js +11 -6
- package/dist/components/general-purpose/TestResults.d.ts +23 -11
- package/dist/components/general-purpose/TestResults.js +49 -51
- package/dist/components/general-purpose/ThemeModeControl.d.ts +2 -0
- package/dist/components/general-purpose/ThemeModeControl.js +2 -2
- package/dist/components/general-purpose/WebPreview.d.ts +29 -4
- package/dist/components/general-purpose/WebPreview.js +39 -14
- package/dist/components/nanites/AgentConnection.js +2 -2
- package/dist/components/nanites/AgentToolDetail.d.ts +13 -11
- package/dist/components/nanites/AgentToolDetail.js +21 -42
- package/dist/{copy-button-Dk2vRe9j.js → copy-button-CSDuDfdP.js} +1 -1
- package/dist/{copy-button-C0JyjClr.d.ts → copy-button-OUwOdgEm.d.ts} +1 -1
- package/dist/mcp-server-mAErsxHU.js +27 -0
- package/dist/styles/accessibility.css +20 -0
- package/dist/styles/activity.css +1 -96
- package/dist/styles/agent-chat.css +75 -102
- package/dist/styles/agent-tool-detail.css +0 -16
- package/dist/styles/base.css +1 -9
- package/dist/styles/browser-run-panel.css +1 -15
- package/dist/styles/button.css +7 -1
- package/dist/styles/code-block.css +12 -0
- package/dist/styles/codex-model-selector.css +4 -0
- package/dist/styles/color-contrast.test.ts +212 -0
- package/dist/styles/composition-motion.css +0 -2
- package/dist/styles/employee-chrome.css +43 -0
- package/dist/styles/file-tree.css +10 -1
- package/dist/styles/index.css +4 -2
- package/dist/styles/manager-office.css +5 -5
- package/dist/styles/message.css +2 -10
- package/dist/styles/queue.css +71 -0
- package/dist/styles/responsive-sidebar-shell.css +1 -1
- package/dist/styles/subagent-run.css +122 -6
- package/dist/styles/test-results.css +2 -5
- package/dist/styles/think-chat-activity.css +13 -0
- package/dist/styles/think-chat-tool-panels.css +81 -0
- package/dist/styles/think-execution-workbench.css +2 -8
- package/dist/styles/think-full-app.css +42 -251
- package/dist/styles/{think-routine-library.css → think-routine.css} +64 -80
- package/dist/styles/web-preview.css +15 -1
- package/dist/utils/codex-model-catalog.d.ts +25 -6
- package/dist/utils/codex-model-catalog.js +22 -5
- package/dist/utils/mcp-server-catalog.d.ts +1112 -2
- package/dist/utils/mcp-server-catalog.js +28 -9
- package/dist/utils/structured-code.d.ts +1 -1
- package/dist/{workspace-assets-GqsCYxqT.js → workspace-assets-Bg7XhPsk.js} +2 -2
- package/package.json +8 -4
- package/dist/AgentChat-BLmQghkt.d.ts +0 -327
- package/dist/AgentChatStartScreen-Bkv7Avni.d.ts +0 -84
- package/dist/AgentMessageParts-C7L-Mv9U.d.ts +0 -46
- package/dist/AgentToolRunsContext-jtmveaRE.d.ts +0 -57
- package/dist/Dialog-B_FhRWaz.d.ts +0 -107
- package/dist/McpConnectorForm-CeYNY0MI.d.ts +0 -39
- package/dist/McpPluginCatalog-3qWu8oK1.d.ts +0 -92
- package/dist/ResponsiveSidebarShell-BTVPxLJK.d.ts +0 -123
- package/dist/SessionCompaction-CmTJFpzj.d.ts +0 -89
- package/dist/SetupChecklist-DeTU9YpW.js +0 -77
- package/dist/ThinkChat-CwMdEum8.d.ts +0 -185
- package/dist/ThinkChat-DiI6hhDP.js +0 -332
- package/dist/ThinkChatActivity-B3lGVS-6.d.ts +0 -77
- package/dist/ThinkChatContext-COIgzkYp.d.ts +0 -28
- package/dist/ThinkRecoveryNotice-DGWr94rk.d.ts +0 -19
- package/dist/ThinkThreadPicker-yFz4vvIf.d.ts +0 -91
- package/dist/Toggle-DLrIf5YH.d.ts +0 -69
- package/dist/WorkspaceLive-DfjH1Ypm.d.ts +0 -61
- package/dist/WorkspaceMessageResponse-kJYU8Onj.d.ts +0 -48
- package/dist/components/agents-sdk/ThinkFullAppViewSwitch.d.ts +0 -31
- package/dist/components/agents-sdk/ThinkFullAppViewSwitch.js +0 -34
- package/dist/components/agents-sdk/ThinkRoutineLibrary.d.ts +0 -80
- package/dist/components/agents-sdk/ThinkRoutineLibrary.js +0 -159
- package/dist/components/agents-sdk/ThinkSidepanel.d.ts +0 -200
- package/dist/components/agents-sdk/ThinkSidepanel.js +0 -775
- package/dist/mcp-server-7NR24ASj.js +0 -69
- package/dist/mcp-server-catalog-C_g7C-9o.d.ts +0 -1108
- package/dist/styles/think-sidepanel.css +0 -78
- package/dist/think-agent-Cip5KAPj.d.ts +0 -7
- package/dist/{icons-CeGfXO21.js → icons-cuEtsgj9.js} +1 -1
|
@@ -1,2 +1,77 @@
|
|
|
1
|
-
import { n as
|
|
1
|
+
import { n as mergeBaseClassName } from "../../class-names-BiMDVpUo.js";
|
|
2
|
+
import { B as PlusIcon, d as CheckIcon, et as WarningIcon, f as ChevronDownIcon } from "../../icons-cuEtsgj9.js";
|
|
3
|
+
import { Button } from "../foundations/Button.js";
|
|
4
|
+
import { Menu } from "../foundations/Menu.js";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/_internal/menu-disclosure-group.tsx
|
|
8
|
+
/**
|
|
9
|
+
* A menu-native disclosure: its trigger stays in the menu roving-focus model,
|
|
10
|
+
* while its rows mount only after the user expands the section.
|
|
11
|
+
*/
|
|
12
|
+
function MenuDisclosureGroup({ children, className, defaultOpen = false, label, triggerClassName, ...props }) {
|
|
13
|
+
const [open, setOpen] = React.useState(defaultOpen);
|
|
14
|
+
return /* @__PURE__ */ jsxs(Menu.Group, {
|
|
15
|
+
className: mergeBaseClassName("menu-disclosure-group", className),
|
|
16
|
+
...props,
|
|
17
|
+
children: [/* @__PURE__ */ jsxs(Menu.Item, {
|
|
18
|
+
"aria-expanded": open,
|
|
19
|
+
className: mergeBaseClassName("menu-disclosure-group__trigger", triggerClassName),
|
|
20
|
+
closeOnClick: false,
|
|
21
|
+
onClick: () => setOpen((current) => !current),
|
|
22
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
23
|
+
className: "sigvelo-truncate-grow",
|
|
24
|
+
children: label
|
|
25
|
+
}), /* @__PURE__ */ jsx(ChevronDownIcon, { "aria-hidden": "true" })]
|
|
26
|
+
}), open ? /* @__PURE__ */ jsx("div", {
|
|
27
|
+
className: "menu-disclosure-group__items",
|
|
28
|
+
children
|
|
29
|
+
}) : null]
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/components/general-purpose/SetupChecklist.tsx
|
|
34
|
+
/** Checklist rows for any Menu surface (composer plus menu, tray menu). */
|
|
35
|
+
function SetupChecklistGroup({ label, entries, defaultOpen = false, onSelect }) {
|
|
36
|
+
return /* @__PURE__ */ jsx(MenuDisclosureGroup, {
|
|
37
|
+
label,
|
|
38
|
+
defaultOpen,
|
|
39
|
+
children: entries.map((entry) => /* @__PURE__ */ jsxs(Menu.Item, {
|
|
40
|
+
"aria-label": `${entry.name}, ${entry.complete ? "complete" : "not set up"}`,
|
|
41
|
+
onClick: () => onSelect(entry.id),
|
|
42
|
+
children: [
|
|
43
|
+
entry.icon,
|
|
44
|
+
/* @__PURE__ */ jsx("span", {
|
|
45
|
+
className: "sigvelo-truncate-grow",
|
|
46
|
+
children: entry.description
|
|
47
|
+
}),
|
|
48
|
+
entry.complete ? /* @__PURE__ */ jsx(CheckIcon, { "aria-hidden": "true" }) : /* @__PURE__ */ jsx(PlusIcon, { "aria-hidden": "true" })
|
|
49
|
+
]
|
|
50
|
+
}, entry.id))
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
/** Progress-aware tray trigger opening the checklist in its own menu. */
|
|
54
|
+
function SetupChecklistAction({ actionLabel, label, entries, onSelect }) {
|
|
55
|
+
const completed = entries.filter((entry) => entry.complete).length;
|
|
56
|
+
return /* @__PURE__ */ jsxs(Menu.Root, { children: [/* @__PURE__ */ jsxs(Button, {
|
|
57
|
+
type: "button",
|
|
58
|
+
variant: "ghost",
|
|
59
|
+
color: "neutral",
|
|
60
|
+
size: "sm",
|
|
61
|
+
"aria-label": `${actionLabel} — ${completed} of ${entries.length} set up`,
|
|
62
|
+
render: /* @__PURE__ */ jsx(Menu.Trigger, { unstyled: true }),
|
|
63
|
+
children: [completed === entries.length ? /* @__PURE__ */ jsx(CheckIcon, { "aria-hidden": "true" }) : /* @__PURE__ */ jsx(WarningIcon, { "aria-hidden": "true" }), /* @__PURE__ */ jsx("span", { children: actionLabel })]
|
|
64
|
+
}), /* @__PURE__ */ jsx(Menu.Portal, { children: /* @__PURE__ */ jsx(Menu.Positioner, {
|
|
65
|
+
side: "bottom",
|
|
66
|
+
align: "start",
|
|
67
|
+
sideOffset: 4,
|
|
68
|
+
children: /* @__PURE__ */ jsx(Menu.Popup, { children: /* @__PURE__ */ jsx(SetupChecklistGroup, {
|
|
69
|
+
defaultOpen: true,
|
|
70
|
+
label,
|
|
71
|
+
entries,
|
|
72
|
+
onSelect
|
|
73
|
+
}) })
|
|
74
|
+
}) })] });
|
|
75
|
+
}
|
|
76
|
+
//#endregion
|
|
2
77
|
export { SetupChecklistAction, SetupChecklistGroup };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as IconButtonProps } from "../../IconButton-
|
|
2
|
-
import { t as CopyButtonProps } from "../../copy-button-
|
|
1
|
+
import { n as IconButtonProps } from "../../IconButton-ByiyjkYE.js";
|
|
2
|
+
import { t as CopyButtonProps } from "../../copy-button-OUwOdgEm.js";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/components/general-purpose/Terminal.d.ts
|
|
@@ -42,7 +42,7 @@ declare function Terminal({
|
|
|
42
42
|
ref,
|
|
43
43
|
...props
|
|
44
44
|
}: TerminalProps & {
|
|
45
|
-
ref?: React.Ref<HTMLDivElement>;
|
|
45
|
+
/** Ref forwarded to the component's rendered root element. */ref?: React.Ref<HTMLDivElement>;
|
|
46
46
|
}): React.JSX.Element;
|
|
47
47
|
interface TerminalHeaderProps extends React.HTMLAttributes<HTMLDivElement> {}
|
|
48
48
|
declare function TerminalHeader({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
|
-
import { Z as TerminalIcon, nt as XIcon } from "../../icons-
|
|
2
|
+
import { Z as TerminalIcon, nt as XIcon } from "../../icons-cuEtsgj9.js";
|
|
3
3
|
import { IconButton } from "../foundations/IconButton.js";
|
|
4
|
-
import { t as CopyButton } from "../../copy-button-
|
|
4
|
+
import { t as CopyButton } from "../../copy-button-CSDuDfdP.js";
|
|
5
5
|
import { ScrollArea } from "../foundations/ScrollArea.js";
|
|
6
6
|
import * as React from "react";
|
|
7
7
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -56,6 +56,15 @@ function parseAnsi(input) {
|
|
|
56
56
|
dim: c.decorations?.includes("dim") ?? false
|
|
57
57
|
}));
|
|
58
58
|
}
|
|
59
|
+
const ANSI_ESCAPE_SEQUENCE = /\u001b\[[0-9;?]*[a-zA-Z]/g;
|
|
60
|
+
/**
|
|
61
|
+
* The same text with every escape sequence removed, for surfaces that need the
|
|
62
|
+
* plain characters instead of {@link parseAnsi}'s formatted segments — copying
|
|
63
|
+
* terminal output, measuring it, or searching it.
|
|
64
|
+
*/
|
|
65
|
+
function stripAnsi(input) {
|
|
66
|
+
return input.replace(ANSI_ESCAPE_SEQUENCE, "");
|
|
67
|
+
}
|
|
59
68
|
//#endregion
|
|
60
69
|
//#region src/components/general-purpose/Terminal.tsx
|
|
61
70
|
const TerminalContext = React.createContext(null);
|
|
@@ -219,9 +228,5 @@ function TerminalClearButton({ className, label = "Clear terminal", onClick, ...
|
|
|
219
228
|
children: /* @__PURE__ */ jsx(XIcon, {})
|
|
220
229
|
});
|
|
221
230
|
}
|
|
222
|
-
const ANSI_REGEX = /\u001b\[[0-9;?]*[a-zA-Z]/g;
|
|
223
|
-
function stripAnsi(input) {
|
|
224
|
-
return input.replace(ANSI_REGEX, "");
|
|
225
|
-
}
|
|
226
231
|
//#endregion
|
|
227
232
|
export { Terminal, TerminalActions, TerminalClearButton, TerminalContent, TerminalCopyButton, TerminalHeader, TerminalStatus, TerminalTitle };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Collapsible } from "../foundations/Collapsible.js";
|
|
2
2
|
import * as React from "react";
|
|
3
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
3
4
|
|
|
4
5
|
//#region src/components/general-purpose/TestResults.d.ts
|
|
5
6
|
type TestStatusValue = "passed" | "failed" | "skipped" | "running";
|
|
@@ -15,12 +16,12 @@ interface TestSummary {
|
|
|
15
16
|
/** Total runtime in milliseconds. */
|
|
16
17
|
duration?: number;
|
|
17
18
|
}
|
|
18
|
-
interface TestResultsProps extends
|
|
19
|
+
interface TestResultsProps extends useRender.ComponentProps<"div"> {
|
|
19
20
|
/** Aggregate test counts used by the summary and progress bar. */
|
|
20
21
|
summary?: TestSummary;
|
|
21
22
|
/** Additional class names for layout only; do not override status colors from apps. */
|
|
22
23
|
className?: string;
|
|
23
|
-
/**
|
|
24
|
+
/** Explicit header, summary, progress, and suite content parts. */
|
|
24
25
|
children?: React.ReactNode;
|
|
25
26
|
}
|
|
26
27
|
/**
|
|
@@ -39,22 +40,33 @@ interface TestResultsProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
39
40
|
* @example
|
|
40
41
|
* ```tsx
|
|
41
42
|
* <TestResults summary={{ passed: 10, failed: 1, skipped: 0, total: 11 }}>
|
|
42
|
-
* <
|
|
43
|
-
* <
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
43
|
+
* <TestResultsHeader>
|
|
44
|
+
* <TestResultsSummary />
|
|
45
|
+
* <TestResultsProgress />
|
|
46
|
+
* </TestResultsHeader>
|
|
47
|
+
* <TestResultsContent>
|
|
48
|
+
* <TestSuite name="auth.test.ts" status="failed">
|
|
49
|
+
* <TestSuiteName />
|
|
50
|
+
* <TestSuiteContent>
|
|
51
|
+
* <Test name="rejects bad tokens" status="failed">
|
|
52
|
+
* <TestStatus />
|
|
53
|
+
* <TestName />
|
|
54
|
+
* <TestError message="Expected 401, received 500" />
|
|
55
|
+
* </Test>
|
|
56
|
+
* </TestSuiteContent>
|
|
57
|
+
* </TestSuite>
|
|
58
|
+
* </TestResultsContent>
|
|
47
59
|
* </TestResults>
|
|
48
60
|
* ```
|
|
49
61
|
*/
|
|
50
62
|
declare function TestResults({
|
|
51
|
-
|
|
63
|
+
render,
|
|
52
64
|
summary,
|
|
53
65
|
children,
|
|
54
66
|
ref,
|
|
55
67
|
...props
|
|
56
68
|
}: TestResultsProps & {
|
|
57
|
-
ref?: React.Ref<HTMLDivElement>;
|
|
69
|
+
/** Ref forwarded to the component's rendered root element. */ref?: React.Ref<HTMLDivElement>;
|
|
58
70
|
}): React.JSX.Element;
|
|
59
71
|
interface TestResultsHeaderProps extends React.HTMLAttributes<HTMLDivElement> {}
|
|
60
72
|
declare function TestResultsHeader({
|
|
@@ -150,13 +162,13 @@ declare function TestSuiteContent({
|
|
|
150
162
|
}: TestSuiteContentProps & {
|
|
151
163
|
ref?: React.Ref<HTMLDivElement>;
|
|
152
164
|
}): React.JSX.Element;
|
|
153
|
-
interface TestProps extends
|
|
165
|
+
interface TestProps extends useRender.ComponentProps<"div"> {
|
|
154
166
|
name: string;
|
|
155
167
|
status: TestStatusValue;
|
|
156
168
|
duration?: number;
|
|
157
169
|
}
|
|
158
170
|
declare function Test({
|
|
159
|
-
|
|
171
|
+
render,
|
|
160
172
|
name,
|
|
161
173
|
status,
|
|
162
174
|
duration,
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
1
|
+
import { n as mergeBaseClassName, t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
|
+
import { K as SpinnerIcon, d as CheckIcon, nt as XIcon, p as ChevronRightIcon } from "../../icons-cuEtsgj9.js";
|
|
2
3
|
import { Collapsible } from "../foundations/Collapsible.js";
|
|
3
|
-
import { K as SpinnerIcon, d as CheckIcon, nt as XIcon, p as ChevronRightIcon } from "../../icons-CeGfXO21.js";
|
|
4
4
|
import { Progress } from "../foundations/Progress.js";
|
|
5
5
|
import * as React from "react";
|
|
6
6
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
8
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
7
9
|
//#region src/components/general-purpose/TestResults.tsx
|
|
8
10
|
const TestResultsContext = React.createContext({});
|
|
9
11
|
/**
|
|
@@ -22,28 +24,42 @@ const TestResultsContext = React.createContext({});
|
|
|
22
24
|
* @example
|
|
23
25
|
* ```tsx
|
|
24
26
|
* <TestResults summary={{ passed: 10, failed: 1, skipped: 0, total: 11 }}>
|
|
25
|
-
* <
|
|
26
|
-
* <
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
27
|
+
* <TestResultsHeader>
|
|
28
|
+
* <TestResultsSummary />
|
|
29
|
+
* <TestResultsProgress />
|
|
30
|
+
* </TestResultsHeader>
|
|
31
|
+
* <TestResultsContent>
|
|
32
|
+
* <TestSuite name="auth.test.ts" status="failed">
|
|
33
|
+
* <TestSuiteName />
|
|
34
|
+
* <TestSuiteContent>
|
|
35
|
+
* <Test name="rejects bad tokens" status="failed">
|
|
36
|
+
* <TestStatus />
|
|
37
|
+
* <TestName />
|
|
38
|
+
* <TestError message="Expected 401, received 500" />
|
|
39
|
+
* </Test>
|
|
40
|
+
* </TestSuiteContent>
|
|
41
|
+
* </TestSuite>
|
|
42
|
+
* </TestResultsContent>
|
|
30
43
|
* </TestResults>
|
|
31
44
|
* ```
|
|
32
45
|
*/
|
|
33
|
-
function TestResults({
|
|
46
|
+
function TestResults({ render, summary, children, ref, ...props }) {
|
|
34
47
|
const overall = summary && summary.failed > 0 ? "failed" : "passed";
|
|
35
48
|
const contextValue = React.useMemo(() => ({ summary }), [summary]);
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
className:
|
|
49
|
+
const element = useRender({
|
|
50
|
+
defaultTagName: "div",
|
|
51
|
+
render,
|
|
52
|
+
ref,
|
|
53
|
+
props: mergeProps({
|
|
54
|
+
className: "test-results",
|
|
42
55
|
"data-status": overall,
|
|
43
|
-
...props,
|
|
44
56
|
"data-recipe": "framed-panel",
|
|
45
|
-
children
|
|
46
|
-
})
|
|
57
|
+
children
|
|
58
|
+
}, props)
|
|
59
|
+
});
|
|
60
|
+
return /* @__PURE__ */ jsx(TestResultsContext.Provider, {
|
|
61
|
+
value: contextValue,
|
|
62
|
+
children: element
|
|
47
63
|
});
|
|
48
64
|
}
|
|
49
65
|
function TestResultsHeader({ className, children, ref, ...props }) {
|
|
@@ -147,9 +163,6 @@ function TestResultsContent({ className, children, ref, ...props }) {
|
|
|
147
163
|
children
|
|
148
164
|
});
|
|
149
165
|
}
|
|
150
|
-
function hasComposableTestResultsChildren(children) {
|
|
151
|
-
return React.Children.toArray(children).some((child) => React.isValidElement(child) && (child.type === TestResultsHeader || child.type === TestResultsSummary || child.type === TestResultsProgress || child.type === TestResultsContent));
|
|
152
|
-
}
|
|
153
166
|
const TestSuiteContext = React.createContext({
|
|
154
167
|
name: "",
|
|
155
168
|
status: "passed"
|
|
@@ -159,20 +172,16 @@ function TestSuite({ className, name, status, defaultOpen, children, ref, ...pro
|
|
|
159
172
|
name,
|
|
160
173
|
status
|
|
161
174
|
}), [name, status]);
|
|
162
|
-
const isComposable = hasComposableTestSuiteChildren(children);
|
|
163
175
|
return /* @__PURE__ */ jsx(TestSuiteContext.Provider, {
|
|
164
176
|
value: contextValue,
|
|
165
177
|
children: /* @__PURE__ */ jsx(Collapsible.Root, {
|
|
166
178
|
ref,
|
|
167
|
-
className:
|
|
179
|
+
className: mergeBaseClassName("test-results__suite", className),
|
|
168
180
|
defaultOpen: defaultOpen ?? status === "failed",
|
|
169
181
|
"data-status": status,
|
|
170
182
|
...props,
|
|
171
183
|
unstyled: true,
|
|
172
|
-
children
|
|
173
|
-
className: "test-results__suite-tests",
|
|
174
|
-
children
|
|
175
|
-
}) })] })
|
|
184
|
+
children
|
|
176
185
|
})
|
|
177
186
|
});
|
|
178
187
|
}
|
|
@@ -180,7 +189,7 @@ function TestSuiteName({ className, children, ref, ...props }) {
|
|
|
180
189
|
const { name, status } = React.useContext(TestSuiteContext);
|
|
181
190
|
return /* @__PURE__ */ jsxs(Collapsible.Trigger, {
|
|
182
191
|
ref,
|
|
183
|
-
className:
|
|
192
|
+
className: mergeBaseClassName("test-results__suite-trigger", className),
|
|
184
193
|
...props,
|
|
185
194
|
unstyled: true,
|
|
186
195
|
children: [
|
|
@@ -224,20 +233,17 @@ function TestSuiteStats({ className, passed = 0, failed = 0, skipped = 0, childr
|
|
|
224
233
|
function TestSuiteContent({ className, children, ref, ...props }) {
|
|
225
234
|
return /* @__PURE__ */ jsx(Collapsible.Panel, {
|
|
226
235
|
ref,
|
|
227
|
-
className:
|
|
236
|
+
className: mergeBaseClassName("test-results__suite-content", className),
|
|
228
237
|
...props,
|
|
229
238
|
unstyled: true,
|
|
230
239
|
children
|
|
231
240
|
});
|
|
232
241
|
}
|
|
233
|
-
function hasComposableTestSuiteChildren(children) {
|
|
234
|
-
return React.Children.toArray(children).some((child) => React.isValidElement(child) && (child.type === TestSuiteName || child.type === TestSuiteContent));
|
|
235
|
-
}
|
|
236
242
|
const TestContext = React.createContext({
|
|
237
243
|
name: "",
|
|
238
244
|
status: "passed"
|
|
239
245
|
});
|
|
240
|
-
function Test({
|
|
246
|
+
function Test({ render, name, status, duration, children, ref, ...props }) {
|
|
241
247
|
const contextValue = React.useMemo(() => ({
|
|
242
248
|
duration,
|
|
243
249
|
name,
|
|
@@ -247,24 +253,19 @@ function Test({ className, name, status, duration, children, ref, ...props }) {
|
|
|
247
253
|
name,
|
|
248
254
|
status
|
|
249
255
|
]);
|
|
250
|
-
const
|
|
256
|
+
const element = useRender({
|
|
257
|
+
defaultTagName: "div",
|
|
258
|
+
render,
|
|
259
|
+
ref,
|
|
260
|
+
props: mergeProps({
|
|
261
|
+
className: cx("test-results__test", `test-results__test--${status}`),
|
|
262
|
+
"data-status": status,
|
|
263
|
+
children
|
|
264
|
+
}, props)
|
|
265
|
+
});
|
|
251
266
|
return /* @__PURE__ */ jsx(TestContext.Provider, {
|
|
252
267
|
value: contextValue,
|
|
253
|
-
children:
|
|
254
|
-
ref,
|
|
255
|
-
className: cx("test-results__test", `test-results__test--${status}`, className),
|
|
256
|
-
"data-status": status,
|
|
257
|
-
...props,
|
|
258
|
-
children: isComposable ? children : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
259
|
-
/* @__PURE__ */ jsx(TestStatus, {}),
|
|
260
|
-
/* @__PURE__ */ jsx(TestName, {}),
|
|
261
|
-
/* @__PURE__ */ jsx(TestDuration, {}),
|
|
262
|
-
children ? /* @__PURE__ */ jsx("div", {
|
|
263
|
-
className: "test-results__test-children",
|
|
264
|
-
children
|
|
265
|
-
}) : null
|
|
266
|
-
] })
|
|
267
|
-
})
|
|
268
|
+
children: element
|
|
268
269
|
});
|
|
269
270
|
}
|
|
270
271
|
function TestStatus({ className, children, status, ref, ...props }) {
|
|
@@ -301,9 +302,6 @@ function TestDuration({ className, children, ref, ...props }) {
|
|
|
301
302
|
children: children ?? `${duration}ms`
|
|
302
303
|
});
|
|
303
304
|
}
|
|
304
|
-
function hasComposableTestChildren(children) {
|
|
305
|
-
return React.Children.toArray(children).some((child) => React.isValidElement(child) && (child.type === TestStatus || child.type === TestName || child.type === TestDuration));
|
|
306
|
-
}
|
|
307
305
|
function TestError({ className, message, children, ref, ...props }) {
|
|
308
306
|
return /* @__PURE__ */ jsx("div", {
|
|
309
307
|
ref,
|
|
@@ -6,7 +6,9 @@ interface ThemeModeControlProps {
|
|
|
6
6
|
"aria-label"?: string;
|
|
7
7
|
/** Name used by the radio group's hidden form input. @default "theme" */
|
|
8
8
|
name?: string;
|
|
9
|
+
/** Prevents changing the current theme preference. */
|
|
9
10
|
disabled?: boolean;
|
|
11
|
+
/** Additional class name for layout in the consuming surface. */
|
|
10
12
|
className?: string;
|
|
11
13
|
}
|
|
12
14
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { F as MoonIcon, P as MonitorIcon, Y as SunIcon } from "../../icons-
|
|
2
|
-
import { Radio, RadioGroup } from "../foundations/RadioGroup.js";
|
|
1
|
+
import { F as MoonIcon, P as MonitorIcon, Y as SunIcon } from "../../icons-cuEtsgj9.js";
|
|
3
2
|
import { useTheme } from "../foundations/ThemeProvider.js";
|
|
3
|
+
import { Radio, RadioGroup } from "../foundations/RadioGroup.js";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
//#region src/components/general-purpose/ThemeModeControl.tsx
|
|
6
6
|
const modes = [
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { n as IconButtonProps } from "../../IconButton-
|
|
1
|
+
import { n as IconButtonProps } from "../../IconButton-ByiyjkYE.js";
|
|
2
2
|
import * as React from "react";
|
|
3
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
3
4
|
|
|
4
5
|
//#region src/components/general-purpose/WebPreview.d.ts
|
|
5
6
|
interface WebPreviewContextValue {
|
|
@@ -15,6 +16,8 @@ interface WebPreviewContextValue {
|
|
|
15
16
|
reloadToken: number;
|
|
16
17
|
}
|
|
17
18
|
interface WebPreviewProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
19
|
+
/** Omit the frame when the host already supplies panel chrome. */
|
|
20
|
+
surface?: "framed" | "plain";
|
|
18
21
|
/** Initial URL for uncontrolled preview history. */
|
|
19
22
|
defaultUrl?: string;
|
|
20
23
|
/** Controlled URL. Controlled previews leave history ownership to the caller. */
|
|
@@ -60,6 +63,7 @@ interface WebPreviewProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
60
63
|
* ```
|
|
61
64
|
*/
|
|
62
65
|
declare function WebPreview({
|
|
66
|
+
surface,
|
|
63
67
|
className,
|
|
64
68
|
defaultUrl,
|
|
65
69
|
url: controlledUrl,
|
|
@@ -69,10 +73,14 @@ declare function WebPreview({
|
|
|
69
73
|
"data-recipe": recipe,
|
|
70
74
|
...props
|
|
71
75
|
}: WebPreviewProps & {
|
|
72
|
-
ref?: React.Ref<HTMLDivElement>;
|
|
76
|
+
/** Ref forwarded to the component's rendered root element. */ref?: React.Ref<HTMLDivElement>;
|
|
73
77
|
}): React.JSX.Element;
|
|
74
|
-
interface WebPreviewNavigationProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
78
|
+
interface WebPreviewNavigationProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
79
|
+
/** Tabs join the address row below them without a second dividing edge. */
|
|
80
|
+
variant?: "address" | "tabs";
|
|
81
|
+
}
|
|
75
82
|
declare function WebPreviewNavigation({
|
|
83
|
+
variant,
|
|
76
84
|
className,
|
|
77
85
|
children,
|
|
78
86
|
ref,
|
|
@@ -115,6 +123,23 @@ declare function WebPreviewUrl({
|
|
|
115
123
|
}: WebPreviewUrlProps & {
|
|
116
124
|
ref?: React.Ref<HTMLInputElement>;
|
|
117
125
|
}): React.JSX.Element;
|
|
126
|
+
interface WebPreviewViewportProps extends useRender.ComponentProps<"div"> {}
|
|
127
|
+
/** Media surface shared by iframe previews and host-provided live views.
|
|
128
|
+
* Compose a behavior part such as Tabs.Panel through render to keep one element. */
|
|
129
|
+
declare function WebPreviewViewport({
|
|
130
|
+
render,
|
|
131
|
+
ref,
|
|
132
|
+
...props
|
|
133
|
+
}: WebPreviewViewportProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
134
|
+
interface WebPreviewEmptyProps extends React.HTMLAttributes<HTMLDivElement> {}
|
|
135
|
+
/** Centered placeholder or session state inside a preview surface. */
|
|
136
|
+
declare function WebPreviewEmpty({
|
|
137
|
+
className,
|
|
138
|
+
ref,
|
|
139
|
+
...props
|
|
140
|
+
}: WebPreviewEmptyProps & {
|
|
141
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
142
|
+
}): React.JSX.Element;
|
|
118
143
|
interface WebPreviewBodyProps extends Omit<React.IframeHTMLAttributes<HTMLIFrameElement>, "loading"> {
|
|
119
144
|
/** Optional placeholder shown while the iframe has no src. */
|
|
120
145
|
loading?: React.ReactNode;
|
|
@@ -149,4 +174,4 @@ declare function WebPreviewConsole({
|
|
|
149
174
|
ref?: React.Ref<HTMLDivElement>;
|
|
150
175
|
}): React.JSX.Element;
|
|
151
176
|
//#endregion
|
|
152
|
-
export { ConsoleLog, ConsoleLogLevel, WebPreview, WebPreviewBody, WebPreviewBodyProps, WebPreviewConsole, WebPreviewConsoleProps, WebPreviewContextValue, WebPreviewNavigation, WebPreviewNavigationButton, WebPreviewNavigationButtonProps, WebPreviewNavigationProps, WebPreviewProps, WebPreviewUrl, WebPreviewUrlProps };
|
|
177
|
+
export { ConsoleLog, ConsoleLogLevel, WebPreview, WebPreviewBody, WebPreviewBodyProps, WebPreviewConsole, WebPreviewConsoleProps, WebPreviewContextValue, WebPreviewEmpty, WebPreviewEmptyProps, WebPreviewNavigation, WebPreviewNavigationButton, WebPreviewNavigationButtonProps, WebPreviewNavigationProps, WebPreviewProps, WebPreviewUrl, WebPreviewUrlProps, WebPreviewViewport, WebPreviewViewportProps };
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
|
+
import { H as RefreshIcon, f as ChevronDownIcon, i as ArrowRightIcon, r as ArrowLeftIcon } from "../../icons-cuEtsgj9.js";
|
|
2
3
|
import { Collapsible } from "../foundations/Collapsible.js";
|
|
3
|
-
import { H as RefreshIcon, f as ChevronDownIcon, i as ArrowRightIcon, r as ArrowLeftIcon } from "../../icons-CeGfXO21.js";
|
|
4
4
|
import { IconButton } from "../foundations/IconButton.js";
|
|
5
|
-
import { Input } from "../foundations/Input.js";
|
|
6
5
|
import { ScrollArea } from "../foundations/ScrollArea.js";
|
|
6
|
+
import { Input } from "../foundations/Input.js";
|
|
7
7
|
import * as React from "react";
|
|
8
8
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
10
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
9
11
|
//#region src/components/general-purpose/WebPreview.tsx
|
|
10
12
|
const WebPreviewContext = React.createContext(null);
|
|
11
13
|
function useWebPreviewContext() {
|
|
@@ -44,7 +46,7 @@ function useWebPreviewContext() {
|
|
|
44
46
|
* </WebPreview>
|
|
45
47
|
* ```
|
|
46
48
|
*/
|
|
47
|
-
function WebPreview({ className, defaultUrl = "", url: controlledUrl, onUrlChange, children, ref, "data-recipe": recipe, ...props }) {
|
|
49
|
+
function WebPreview({ surface = "framed", className, defaultUrl = "", url: controlledUrl, onUrlChange, children, ref, "data-recipe": recipe, ...props }) {
|
|
48
50
|
const [navigation, setNavigation] = React.useState(() => ({
|
|
49
51
|
history: defaultUrl ? [defaultUrl] : [],
|
|
50
52
|
index: defaultUrl ? 0 : -1
|
|
@@ -125,16 +127,18 @@ function WebPreview({ className, defaultUrl = "", url: controlledUrl, onUrlChang
|
|
|
125
127
|
children: /* @__PURE__ */ jsx("div", {
|
|
126
128
|
ref,
|
|
127
129
|
className: cx("web-preview", className),
|
|
130
|
+
"data-surface": surface,
|
|
128
131
|
...props,
|
|
129
132
|
"data-recipe": cx("framed-panel", recipe),
|
|
130
133
|
children
|
|
131
134
|
})
|
|
132
135
|
});
|
|
133
136
|
}
|
|
134
|
-
function WebPreviewNavigation({ className, children, ref, ...props }) {
|
|
137
|
+
function WebPreviewNavigation({ variant = "address", className, children, ref, ...props }) {
|
|
135
138
|
return /* @__PURE__ */ jsx("div", {
|
|
136
139
|
ref,
|
|
137
140
|
className: cx("web-preview__nav", className),
|
|
141
|
+
"data-variant": variant,
|
|
138
142
|
...props,
|
|
139
143
|
children
|
|
140
144
|
});
|
|
@@ -220,21 +224,42 @@ function WebPreviewUrl({ className, placeholder = "Enter URL…", value, onChang
|
|
|
220
224
|
})
|
|
221
225
|
});
|
|
222
226
|
}
|
|
227
|
+
/** Media surface shared by iframe previews and host-provided live views.
|
|
228
|
+
* Compose a behavior part such as Tabs.Panel through render to keep one element. */
|
|
229
|
+
function WebPreviewViewport({ render, ref, ...props }) {
|
|
230
|
+
return useRender({
|
|
231
|
+
defaultTagName: "div",
|
|
232
|
+
render,
|
|
233
|
+
ref,
|
|
234
|
+
props: mergeProps({ className: "web-preview__body" }, props)
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
/** Centered placeholder or session state inside a preview surface. */
|
|
238
|
+
function WebPreviewEmpty({ className, ref, ...props }) {
|
|
239
|
+
return /* @__PURE__ */ jsx("div", {
|
|
240
|
+
ref,
|
|
241
|
+
className: cx("web-preview__empty", className),
|
|
242
|
+
...props
|
|
243
|
+
});
|
|
244
|
+
}
|
|
223
245
|
function WebPreviewBody({ className, loading, src, ref, interactive = true, ...props }) {
|
|
224
246
|
const { url, reloadToken } = useWebPreviewContext();
|
|
225
247
|
const effectiveSrc = src ?? url;
|
|
226
248
|
const iframeSrc = effectiveSrc ? `${effectiveSrc}${reloadToken ? `#reload-${reloadToken}` : ""}` : void 0;
|
|
227
|
-
if (!iframeSrc) return /* @__PURE__ */ jsx(
|
|
228
|
-
className
|
|
249
|
+
if (!iframeSrc) return /* @__PURE__ */ jsx(WebPreviewViewport, {
|
|
250
|
+
className,
|
|
251
|
+
render: /* @__PURE__ */ jsx(WebPreviewEmpty, {}),
|
|
229
252
|
children: loading ?? "Enter a URL above to preview a site."
|
|
230
253
|
});
|
|
231
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
254
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(WebPreviewViewport, {
|
|
255
|
+
className: cx(!interactive && "web-preview__body--readonly", className),
|
|
256
|
+
render: /* @__PURE__ */ jsx("iframe", {
|
|
257
|
+
ref,
|
|
258
|
+
src: iframeSrc,
|
|
259
|
+
sandbox: "allow-scripts allow-forms allow-popups allow-presentation",
|
|
260
|
+
title: "Web preview",
|
|
261
|
+
...props
|
|
262
|
+
})
|
|
238
263
|
}, iframeSrc), loading] });
|
|
239
264
|
}
|
|
240
265
|
function WebPreviewConsole({ className, logs = [], children, ref, ...props }) {
|
|
@@ -289,4 +314,4 @@ function WebPreviewConsole({ className, logs = [], children, ref, ...props }) {
|
|
|
289
314
|
});
|
|
290
315
|
}
|
|
291
316
|
//#endregion
|
|
292
|
-
export { WebPreview, WebPreviewBody, WebPreviewConsole, WebPreviewNavigation, WebPreviewNavigationButton, WebPreviewUrl };
|
|
317
|
+
export { WebPreview, WebPreviewBody, WebPreviewConsole, WebPreviewEmpty, WebPreviewNavigation, WebPreviewNavigationButton, WebPreviewUrl, WebPreviewViewport };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
|
-
import { D as LinkIcon } from "../../icons-
|
|
2
|
+
import { D as LinkIcon } from "../../icons-cuEtsgj9.js";
|
|
3
3
|
import { Button } from "../foundations/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-BSJl682D.js";
|
|
5
4
|
import { Popover } from "../foundations/Popover.js";
|
|
5
|
+
import { a as CodeBlockCopyButton, i as CodeBlockContent, n as CodeBlockActions, p as CodeBlockTitle, r as CodeBlockContainer, s as CodeBlockHeader, t as CodeBlock } from "../../CodeBlock-g8sADidM.js";
|
|
6
6
|
import { ToggleGroup } from "../foundations/ToggleGroup.js";
|
|
7
7
|
import * as React from "react";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|