@mcp-b/react-components 0.40.0 → 0.41.0
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/{AgentChat-CVO7xyLC.d.ts → AgentChat-DVr2giwD.d.ts} +1 -1
- package/dist/{AgentToolRunsContext-BCVqCtJ1.d.ts → AgentToolRunsContext-daY67hFM.d.ts} +12 -0
- package/dist/AppTopBar-ZdgmB_Lu.d.ts +97 -0
- package/dist/{CodeBlock-CWk1FVtm.js → CodeBlock-BjELA-_s.js} +1 -1
- package/dist/{FileTree-xqHYBw4g.js → FileTree-DMYRdT6R.js} +1 -1
- package/dist/McpConnectorForm-MRm1r59e.d.ts +39 -0
- package/dist/{Message-DBsHHhcM.d.ts → Message-D_vCVEGB.d.ts} +20 -1
- package/dist/{ThinkChatActivity-D6-_5Phw.d.ts → ThinkChatActivity-DyGHj01E.d.ts} +1 -1
- package/dist/{ThinkExecutionRun-lYYgyeE1.d.ts → ThinkExecutionRun-k8bpyXqt.d.ts} +3 -3
- package/dist/{ToggleGroup-_pQMyHGM.d.ts → ToggleGroup-BrQZOQn_.d.ts} +1 -1
- package/dist/Toolbar-CBOseBQr.d.ts +152 -0
- package/dist/{WorkspaceFileView-Lab3om3F.js → WorkspaceFileView-D0yFwoDr.js} +2 -2
- package/dist/{WorkspaceMessageResponse-Cy28WGSz.d.ts → WorkspaceMessageResponse-D66ty4FO.d.ts} +1 -1
- package/dist/components/agents-sdk/AgentActivity.js +1 -1
- package/dist/components/agents-sdk/AgentChat.d.ts +1 -1
- package/dist/components/agents-sdk/AgentChat.js +41 -18
- package/dist/components/agents-sdk/AgentToolRunsContext.d.ts +1 -1
- package/dist/components/agents-sdk/AgentToolRunsContext.js +12 -0
- package/dist/components/agents-sdk/BrowserLiveScreen.d.ts +135 -0
- package/dist/components/agents-sdk/BrowserLiveScreen.js +637 -0
- package/dist/components/agents-sdk/BrowserLiveView.d.ts +2 -2
- package/dist/components/agents-sdk/BrowserLiveView.js +6 -9
- package/dist/components/agents-sdk/BrowserReplay.js +1 -1
- package/dist/components/agents-sdk/BrowserRunPanel.d.ts +1 -1
- package/dist/components/agents-sdk/BrowserRunPanel.js +6 -12
- package/dist/components/agents-sdk/ManagerOffice.d.ts +156 -0
- package/dist/components/agents-sdk/ManagerOffice.js +662 -0
- package/dist/components/agents-sdk/McpConnectionRequest.js +3 -3
- package/dist/components/agents-sdk/McpConnectorForm.d.ts +1 -38
- package/dist/components/agents-sdk/McpPluginCatalog.d.ts +8 -2
- package/dist/components/agents-sdk/McpPluginCatalog.js +80 -62
- package/dist/components/agents-sdk/McpServerPicker.d.ts +1 -1
- package/dist/components/agents-sdk/McpServerPicker.js +2 -2
- package/dist/components/agents-sdk/ModelSelector.js +2 -2
- package/dist/components/agents-sdk/PromptInputCommands.js +1 -1
- package/dist/components/agents-sdk/SubagentRunDetails.d.ts +1 -9
- package/dist/components/agents-sdk/SubagentRunDetails.js +1 -9
- package/dist/components/agents-sdk/SubagentRunIndicator.js +1 -1
- package/dist/components/agents-sdk/SubagentRunSelector.d.ts +4 -2
- package/dist/components/agents-sdk/SubagentRunSelector.js +7 -6
- package/dist/components/agents-sdk/ThinkChat.d.ts +4 -4
- package/dist/components/agents-sdk/ThinkChat.js +1 -1
- package/dist/components/agents-sdk/ThinkChatActivity.d.ts +1 -1
- package/dist/components/agents-sdk/ThinkChatActivity.js +1 -1
- package/dist/components/agents-sdk/ThinkChatToolPanels.js +1 -1
- package/dist/components/agents-sdk/ThinkExecutionDetail.d.ts +1 -1
- package/dist/components/agents-sdk/ThinkExecutionDetail.js +43 -43
- package/dist/components/agents-sdk/ThinkExecutionRun.d.ts +2 -2
- package/dist/components/agents-sdk/ThinkExecutionRun.js +5 -6
- package/dist/components/agents-sdk/ThinkExecutionStatus.d.ts +1 -1
- package/dist/components/agents-sdk/ThinkExecutionStatus.js +8 -12
- package/dist/components/agents-sdk/ThinkExecutionWorkbench.d.ts +8 -1
- package/dist/components/agents-sdk/ThinkExecutionWorkbench.js +42 -37
- package/dist/components/agents-sdk/ThinkFullApp.d.ts +18 -6
- package/dist/components/agents-sdk/ThinkFullApp.js +113 -145
- package/dist/components/agents-sdk/ThinkFullAppViewSwitch.d.ts +1 -1
- package/dist/components/agents-sdk/ThinkFullAppViewSwitch.js +1 -1
- package/dist/components/agents-sdk/ThinkRoutine.d.ts +1 -1
- package/dist/components/agents-sdk/ThinkRoutineBrowser.js +1 -1
- package/dist/components/agents-sdk/ThinkRoutineDetail.js +5 -16
- package/dist/components/agents-sdk/ThinkRoutineForm.js +1 -1
- package/dist/components/agents-sdk/ThinkRoutineLibrary.js +69 -89
- package/dist/components/agents-sdk/ThinkRoutineRuns.d.ts +1 -1
- package/dist/components/agents-sdk/ThinkRoutineRuns.js +3 -10
- package/dist/components/agents-sdk/ThinkThreadPicker.js +2 -2
- package/dist/components/agents-sdk/WorkspaceBrowser.js +1 -1
- package/dist/components/agents-sdk/WorkspaceExplorer.js +1 -1
- package/dist/components/agents-sdk/WorkspaceFileView.js +1 -1
- package/dist/components/agents-sdk/WorkspaceHeader.js +2 -1
- package/dist/components/agents-sdk/WorkspaceMessageResponse.d.ts +1 -1
- package/dist/components/agents-sdk/WorkspaceMountManager.js +11 -11
- package/dist/components/ai-sdk/Activity.js +1 -1
- package/dist/components/ai-sdk/AgentAttention.d.ts +1 -1
- package/dist/components/ai-sdk/AgentChatStartScreen.js +1 -1
- package/dist/components/ai-sdk/Approval.js +1 -1
- 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.js +1 -1
- package/dist/components/ai-sdk/Conversation.js +1 -1
- package/dist/components/ai-sdk/Goal.js +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 +25 -3
- package/dist/components/ai-sdk/MessageScroller.js +1 -1
- package/dist/components/ai-sdk/MessageScrollerVirtual.js +1 -1
- package/dist/components/ai-sdk/Plan.js +1 -1
- package/dist/components/ai-sdk/PromptInput.js +1 -1
- package/dist/components/ai-sdk/Queue.d.ts +4 -4
- package/dist/components/ai-sdk/Queue.js +6 -15
- package/dist/components/ai-sdk/Reasoning.js +1 -1
- package/dist/components/ai-sdk/Sources.js +1 -1
- package/dist/components/ai-sdk/Task.d.ts +2 -2
- package/dist/components/ai-sdk/Task.js +2 -2
- package/dist/components/extension/ChatGptSignInScreen.js +1 -1
- package/dist/components/extension/CodexModelSelector.js +1 -1
- package/dist/components/extension/ConversationTabPicker.js +1 -1
- package/dist/components/foundations/Avatar.d.ts +1 -10
- package/dist/components/foundations/Avatar.js +1 -10
- package/dist/components/foundations/Checkbox.js +1 -1
- package/dist/components/foundations/CheckboxGroup.js +1 -0
- package/dist/components/foundations/ContextMenu.js +1 -1
- package/dist/components/foundations/LinkButton.d.ts +12 -10
- package/dist/components/foundations/LinkButton.js +15 -11
- package/dist/components/foundations/Menubar.js +1 -1
- package/dist/components/foundations/SearchField.js +1 -1
- package/dist/components/foundations/Select.js +1 -1
- package/dist/components/foundations/Stepper.js +1 -1
- package/dist/components/foundations/Toast.js +1 -1
- package/dist/components/foundations/ToggleGroup.d.ts +1 -1
- package/dist/components/foundations/ToggleGroup.js +1 -1
- package/dist/components/foundations/Toolbar.d.ts +1 -151
- package/dist/components/foundations/icons.d.ts +2 -2
- package/dist/components/foundations/icons.js +2 -2
- package/dist/components/general-purpose/AppTopBar.d.ts +1 -90
- package/dist/components/general-purpose/AppTopBar.js +2 -1
- package/dist/components/general-purpose/Commit.d.ts +2 -2
- package/dist/components/general-purpose/Commit.js +5 -13
- package/dist/components/general-purpose/EnvironmentVariables.d.ts +2 -2
- package/dist/components/general-purpose/EnvironmentVariables.js +4 -7
- package/dist/components/general-purpose/FileTree.js +1 -1
- package/dist/components/general-purpose/PricingBillingToggle.js +5 -10
- package/dist/components/general-purpose/PricingPlanCard.js +15 -14
- package/dist/components/general-purpose/PricingUsageCalculator.js +1 -1
- package/dist/components/general-purpose/ResponsiveSidebarShell.d.ts +95 -2
- package/dist/components/general-purpose/ResponsiveSidebarShell.js +90 -34
- package/dist/components/general-purpose/SetupChecklist.js +1 -1
- package/dist/components/general-purpose/Terminal.d.ts +1 -1
- package/dist/components/general-purpose/Terminal.js +4 -12
- package/dist/components/general-purpose/TestResults.d.ts +1 -1
- package/dist/components/general-purpose/TestResults.js +8 -21
- package/dist/components/general-purpose/ThemeModeControl.js +1 -1
- package/dist/components/general-purpose/WebPreview.d.ts +1 -1
- package/dist/components/general-purpose/WebPreview.js +4 -12
- package/dist/components/nanites/AgentConnection.js +2 -2
- package/dist/components/nanites/AgentToolDetail.d.ts +1 -1
- package/dist/components/nanites/AgentToolDetail.js +7 -7
- package/dist/components/nanites/NaniteScene.js +11 -11
- package/dist/{copy-button-Bc7jsYv_.js → copy-button-lys9N_aI.js} +1 -1
- package/dist/{icons-DwgNir1Q.d.ts → icons-0corjfxR.d.ts} +1 -16
- package/dist/{icons-MmIXciMO.js → icons-CVFSeTJn.js} +2 -5
- package/dist/styles/agent-attention.css +5 -5
- package/dist/styles/agent-chat.css +47 -12
- package/dist/styles/agent-tool-detail.css +2 -12
- package/dist/styles/app-icon.css +12 -18
- package/dist/styles/app-top-bar.css +32 -6
- package/dist/styles/avatar.css +6 -22
- package/dist/styles/base.css +2 -8
- package/dist/styles/browser-live-screen.css +38 -0
- package/dist/styles/browser-live-view.css +12 -4
- package/dist/styles/browser-run-panel.css +20 -18
- package/dist/styles/chatgpt-sign-in-screen.css +5 -5
- package/dist/styles/commit.css +24 -1
- package/dist/styles/environment-variables.css +3 -0
- package/dist/styles/index.css +5 -4
- package/dist/styles/manager-office.css +486 -0
- package/dist/styles/mcp-plugin-catalog.css +39 -35
- package/dist/styles/mcp-server-picker.css +1 -1
- package/dist/styles/message.css +41 -18
- package/dist/styles/nanite-scene.css +9 -9
- package/dist/styles/pricing-page.css +12 -8
- package/dist/styles/prompt-input.css +8 -13
- package/dist/styles/recipes.css +1 -57
- package/dist/styles/responsive-sidebar-shell.css +70 -20
- package/dist/styles/subagent-run.css +20 -3
- package/dist/styles/terminal.css +19 -0
- package/dist/styles/test-results.css +10 -1
- package/dist/styles/think-execution-status.css +8 -24
- package/dist/styles/think-execution-workbench.css +98 -105
- package/dist/styles/think-full-app.css +81 -193
- package/dist/styles/think-routine-library.css +0 -40
- package/dist/styles/think-thread-picker.css +8 -3
- package/dist/styles/transition-surface.css +7 -8
- package/dist/styles/utilities.css +42 -0
- package/dist/styles/web-preview.css +28 -5
- package/dist/styles/workspace-explorer.css +4 -23
- package/dist/styles/workspace-mount-manager.css +22 -0
- package/package.json +37 -35
- package/dist/ResponsiveSidebarShell-DWjULskY.d.ts +0 -68
- package/dist/components/agents-sdk/AgentActivityPreview.d.ts +0 -46
- package/dist/components/agents-sdk/AgentActivityPreview.js +0 -93
- package/dist/components/agents-sdk/ThinkThreadShell.d.ts +0 -38
- package/dist/components/agents-sdk/ThinkThreadShell.js +0 -27
- package/dist/components/foundations/Badge.d.ts +0 -62
- package/dist/components/foundations/Badge.js +0 -55
- package/dist/components/foundations/StatusPill.d.ts +0 -43
- package/dist/components/foundations/StatusPill.js +0 -35
- package/dist/components/general-purpose/Shell.d.ts +0 -149
- package/dist/components/general-purpose/Shell.js +0 -116
- package/dist/styles/agent-activity-preview-overlay.css +0 -169
- package/dist/styles/agent-activity-preview.css +0 -209
- package/dist/styles/badge.css +0 -120
- package/dist/styles/shell.css +0 -122
- package/dist/styles/status-pill.css +0 -39
- package/dist/{ThinkChat-DkA4Wr71.js → ThinkChat-BES_3Mb-.js} +1 -1
|
@@ -10,19 +10,12 @@
|
|
|
10
10
|
overflow: hidden;
|
|
11
11
|
font-family: inherit;
|
|
12
12
|
color: var(--sigvelo-color-text);
|
|
13
|
-
background-color: var(--sigvelo-color-surface-raised);
|
|
14
|
-
border-radius: var(--sigvelo-radius-xl);
|
|
15
|
-
box-shadow: var(--sigvelo-elevation-raised);
|
|
16
13
|
container-type: inline-size;
|
|
17
14
|
}
|
|
18
15
|
|
|
19
16
|
.workspace-explorer:has(> .workspace-explorer__file[data-appearance="canvas"]) {
|
|
20
17
|
block-size: auto;
|
|
21
18
|
overflow: visible;
|
|
22
|
-
background: transparent;
|
|
23
|
-
border: 0;
|
|
24
|
-
border-radius: 0;
|
|
25
|
-
box-shadow: none;
|
|
26
19
|
}
|
|
27
20
|
|
|
28
21
|
.workspace-explorer__file[data-appearance="canvas"] {
|
|
@@ -86,10 +79,6 @@
|
|
|
86
79
|
var(--sigvelo-color-neutral-border-subtle);
|
|
87
80
|
}
|
|
88
81
|
|
|
89
|
-
.workspace-explorer__header .app-top-bar__button {
|
|
90
|
-
padding: var(--sigvelo-spacing-1-5);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
82
|
.workspace-explorer__heading {
|
|
94
83
|
display: flex;
|
|
95
84
|
align-items: baseline;
|
|
@@ -197,14 +186,13 @@
|
|
|
197
186
|
flex: 1;
|
|
198
187
|
min-block-size: 100%;
|
|
199
188
|
border-radius: 0;
|
|
200
|
-
background-color:
|
|
189
|
+
background-color: transparent;
|
|
201
190
|
}
|
|
202
191
|
|
|
203
192
|
.workspace-explorer__markdown-scroll {
|
|
204
193
|
flex: 1;
|
|
205
194
|
min-block-size: 0;
|
|
206
195
|
overflow: auto;
|
|
207
|
-
background-color: var(--sigvelo-color-surface);
|
|
208
196
|
}
|
|
209
197
|
|
|
210
198
|
.workspace-explorer__markdown {
|
|
@@ -255,7 +243,7 @@
|
|
|
255
243
|
[data-streamdown="code-block-actions"],
|
|
256
244
|
[data-streamdown="mermaid-block-actions"]
|
|
257
245
|
) {
|
|
258
|
-
background-color:
|
|
246
|
+
background-color: transparent;
|
|
259
247
|
}
|
|
260
248
|
|
|
261
249
|
.workspace-explorer__markdown-content [data-streamdown="heading-1"] {
|
|
@@ -336,13 +324,13 @@
|
|
|
336
324
|
}
|
|
337
325
|
|
|
338
326
|
.workspace-explorer__skill-status[data-invalid] {
|
|
339
|
-
color: var(--sigvelo-color-
|
|
327
|
+
color: var(--sigvelo-color-danger-text);
|
|
340
328
|
}
|
|
341
329
|
|
|
342
330
|
.workspace-explorer__skill-errors {
|
|
343
331
|
margin-block: var(--sigvelo-spacing-2) 0;
|
|
344
332
|
padding-inline-start: var(--sigvelo-spacing-6);
|
|
345
|
-
color: var(--sigvelo-color-
|
|
333
|
+
color: var(--sigvelo-color-danger-text);
|
|
346
334
|
font-size: var(--sigvelo-text-sm);
|
|
347
335
|
}
|
|
348
336
|
|
|
@@ -352,7 +340,6 @@
|
|
|
352
340
|
flex: 1;
|
|
353
341
|
overflow: auto;
|
|
354
342
|
color-scheme: inherit;
|
|
355
|
-
background-color: var(--sigvelo-color-surface);
|
|
356
343
|
}
|
|
357
344
|
|
|
358
345
|
.workspace-explorer__media-scroll:focus-visible {
|
|
@@ -366,7 +353,6 @@
|
|
|
366
353
|
inline-size: 100%;
|
|
367
354
|
min-block-size: 100%;
|
|
368
355
|
margin: 0;
|
|
369
|
-
background-color: var(--sigvelo-color-surface);
|
|
370
356
|
}
|
|
371
357
|
|
|
372
358
|
.workspace-explorer__media-stage {
|
|
@@ -448,7 +434,6 @@
|
|
|
448
434
|
padding-inline: var(--sigvelo-spacing-4);
|
|
449
435
|
border-block-start: var(--sigvelo-border-style) var(--sigvelo-border-width)
|
|
450
436
|
var(--sigvelo-color-neutral-border-subtle);
|
|
451
|
-
background-color: var(--sigvelo-color-surface);
|
|
452
437
|
}
|
|
453
438
|
|
|
454
439
|
.workspace-explorer__media-details {
|
|
@@ -561,10 +546,6 @@
|
|
|
561
546
|
}
|
|
562
547
|
|
|
563
548
|
@container (inline-size < 24rem) {
|
|
564
|
-
.workspace-explorer__heading {
|
|
565
|
-
max-inline-size: 34cqi;
|
|
566
|
-
}
|
|
567
|
-
|
|
568
549
|
.workspace-explorer__skill-metadata {
|
|
569
550
|
grid-template-columns: 1fr;
|
|
570
551
|
gap: 0;
|
|
@@ -22,3 +22,25 @@
|
|
|
22
22
|
.workspace-mount-manager__path code {
|
|
23
23
|
overflow-wrap: anywhere;
|
|
24
24
|
}
|
|
25
|
+
|
|
26
|
+
.workspace-mount-manager__permission {
|
|
27
|
+
display: inline-flex;
|
|
28
|
+
align-items: center;
|
|
29
|
+
gap: var(--sigvelo-spacing-1);
|
|
30
|
+
color: var(--sigvelo-color-text-muted);
|
|
31
|
+
font-size: var(--sigvelo-text-xs);
|
|
32
|
+
line-height: var(--sigvelo-leading-snug);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.workspace-mount-manager__permission > svg {
|
|
36
|
+
inline-size: var(--sigvelo-control-icon-size-sm);
|
|
37
|
+
block-size: var(--sigvelo-control-icon-size-sm);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.workspace-mount-manager__permission[data-permission="granted"] {
|
|
41
|
+
color: var(--sigvelo-color-success-text);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.workspace-mount-manager__permission[data-permission="denied"] {
|
|
45
|
+
color: var(--sigvelo-color-danger-text);
|
|
46
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mcp-b/react-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.41.0",
|
|
4
4
|
"description": "MCP-B React components built on Base UI and shared design tokens, including Cloudflare Think chat primitives.",
|
|
5
5
|
"homepage": "https://design-system.sigvelo.com",
|
|
6
6
|
"bugs": {
|
|
@@ -39,52 +39,52 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@base-ui/react": "~1.6.0",
|
|
42
|
-
"@rrweb/replay": "^2.1.
|
|
42
|
+
"@rrweb/replay": "^2.1.1",
|
|
43
43
|
"@shadcn/react": "^0.2.1",
|
|
44
44
|
"@streamdown/cjk": "^1.0.3",
|
|
45
45
|
"@streamdown/code": "^1.1.1",
|
|
46
|
-
"@tanstack/react-virtual": "^3.14.
|
|
47
|
-
"agent-skills-ts-sdk": "^2.4.
|
|
46
|
+
"@tanstack/react-virtual": "^3.14.9",
|
|
47
|
+
"agent-skills-ts-sdk": "^2.4.2",
|
|
48
48
|
"anser": "^2.3.5",
|
|
49
|
-
"lucide-react": "^1.
|
|
49
|
+
"lucide-react": "^1.31.0",
|
|
50
50
|
"react-icons": "^5.7.0",
|
|
51
51
|
"rehype-slug": "^6.0.0",
|
|
52
|
-
"shiki": "^
|
|
52
|
+
"shiki": "^3.23.0",
|
|
53
53
|
"streamdown": "^2.5.0",
|
|
54
54
|
"unist-util-visit": "^5.1.0",
|
|
55
|
-
"yet-another-react-lightbox": "^3.32.
|
|
56
|
-
"@mcp-b/design-tokens": "0.
|
|
55
|
+
"yet-another-react-lightbox": "^3.32.2",
|
|
56
|
+
"@mcp-b/design-tokens": "0.41.0"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@ai-sdk/react": "^3.0.
|
|
60
|
-
"@cloudflare/codemode": "^0.5.
|
|
59
|
+
"@ai-sdk/react": "^3.0.249",
|
|
60
|
+
"@cloudflare/codemode": "^0.5.1",
|
|
61
61
|
"@cloudflare/shell": "^0.4.3",
|
|
62
|
-
"@cloudflare/think": "^0.15.
|
|
63
|
-
"@cloudflare/voice": "^0.3.
|
|
64
|
-
"@cloudflare/workers-types": "^5.
|
|
65
|
-
"@storybook/addon-a11y": "^10.5.
|
|
66
|
-
"@storybook/addon-docs": "^10.5.
|
|
67
|
-
"@storybook/addon-vitest": "^10.5.
|
|
68
|
-
"@storybook/tanstack-react": "^10.5.
|
|
69
|
-
"@tanstack/react-form": "^1.33.
|
|
70
|
-
"@tanstack/react-query": "^5.101.
|
|
71
|
-
"@tanstack/react-router": "^1.170.
|
|
62
|
+
"@cloudflare/think": "^0.15.1",
|
|
63
|
+
"@cloudflare/voice": "^0.3.5",
|
|
64
|
+
"@cloudflare/workers-types": "^5.20260811.1",
|
|
65
|
+
"@storybook/addon-a11y": "^10.5.7",
|
|
66
|
+
"@storybook/addon-docs": "^10.5.7",
|
|
67
|
+
"@storybook/addon-vitest": "^10.5.7",
|
|
68
|
+
"@storybook/tanstack-react": "^10.5.7",
|
|
69
|
+
"@tanstack/react-form": "^1.33.4",
|
|
70
|
+
"@tanstack/react-query": "^5.101.4",
|
|
71
|
+
"@tanstack/react-router": "^1.170.25",
|
|
72
72
|
"@tanstack/react-store": "^0.9.3",
|
|
73
|
-
"@tanstack/router-core": "^1.171.
|
|
74
|
-
"@types/hast": "^3.0.
|
|
75
|
-
"@types/node": "^26",
|
|
76
|
-
"@types/react": "^19.2.
|
|
77
|
-
"@types/react-dom": "^19.2.
|
|
73
|
+
"@tanstack/router-core": "^1.171.21",
|
|
74
|
+
"@types/hast": "^3.0.5",
|
|
75
|
+
"@types/node": "^26.2.0",
|
|
76
|
+
"@types/react": "^19.2.18",
|
|
77
|
+
"@types/react-dom": "^19.2.4",
|
|
78
78
|
"@vitest/browser-playwright": "^4.1.10",
|
|
79
79
|
"@vitest/coverage-v8": "^4.1.10",
|
|
80
80
|
"@vitest/mocker": "^4.1.10",
|
|
81
|
-
"agents": "^0.
|
|
82
|
-
"ai": "^6.0.
|
|
81
|
+
"agents": "^0.20.1",
|
|
82
|
+
"ai": "^6.0.247",
|
|
83
83
|
"cloudflare": "^7.0.0",
|
|
84
|
-
"playwright": "~1.61.
|
|
84
|
+
"playwright": "~1.61.1",
|
|
85
85
|
"react": "19.3.0-canary-711c445b-20260722",
|
|
86
86
|
"react-dom": "19.3.0-canary-711c445b-20260722",
|
|
87
|
-
"storybook": "^10.5.
|
|
87
|
+
"storybook": "^10.5.7",
|
|
88
88
|
"typescript": "^6.0.3",
|
|
89
89
|
"vite": "npm:@voidzero-dev/vite-plus-core@0.2.4",
|
|
90
90
|
"vite-plus": "0.2.4",
|
|
@@ -92,14 +92,13 @@
|
|
|
92
92
|
},
|
|
93
93
|
"peerDependencies": {
|
|
94
94
|
"@ai-sdk/react": "^3.0.230",
|
|
95
|
-
"@cloudflare/codemode": "^0.5.
|
|
95
|
+
"@cloudflare/codemode": "^0.5.1",
|
|
96
96
|
"@cloudflare/shell": "^0.4.3",
|
|
97
|
-
"@cloudflare/think": "^0.15.
|
|
98
|
-
"@cloudflare/voice": "^0.3.
|
|
97
|
+
"@cloudflare/think": "^0.15.1",
|
|
98
|
+
"@cloudflare/voice": "^0.3.5",
|
|
99
99
|
"@cloudflare/workers-types": "^5.20260715.1",
|
|
100
100
|
"@tanstack/react-query": "^5.101.2",
|
|
101
|
-
"
|
|
102
|
-
"agents": "^0.19.0",
|
|
101
|
+
"agents": "^0.20.1",
|
|
103
102
|
"ai": "^6.0.228",
|
|
104
103
|
"cloudflare": "^7.0.0",
|
|
105
104
|
"react": "19.3.0-canary-711c445b-20260722",
|
|
@@ -124,6 +123,9 @@
|
|
|
124
123
|
"@cloudflare/workers-types": {
|
|
125
124
|
"optional": true
|
|
126
125
|
},
|
|
126
|
+
"@tanstack/react-query": {
|
|
127
|
+
"optional": true
|
|
128
|
+
},
|
|
127
129
|
"agents": {
|
|
128
130
|
"optional": true
|
|
129
131
|
},
|
|
@@ -140,6 +142,6 @@
|
|
|
140
142
|
"test": "vp test",
|
|
141
143
|
"check": "vp check",
|
|
142
144
|
"storybook": "storybook dev -p 6011",
|
|
143
|
-
"build-storybook": "storybook build"
|
|
145
|
+
"build-storybook": "storybook build && node ../../scripts/audit-storybook-manifest.mjs --write-imports"
|
|
144
146
|
}
|
|
145
147
|
}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
//#region src/components/general-purpose/ResponsiveSidebarShell.d.ts
|
|
4
|
-
interface ResponsiveSidebarShellControls {
|
|
5
|
-
/** Close the sidebar and move focus to the main content. */
|
|
6
|
-
closeSidebar: () => void;
|
|
7
|
-
/** Close only when the shell is currently using its compact drawer layout. */
|
|
8
|
-
closeSidebarOnCompact: () => void;
|
|
9
|
-
}
|
|
10
|
-
interface ResponsiveSidebarShellTopBarControls {
|
|
11
|
-
/** The shell-owned, labelled sidebar toggle to place in a top-bar slot. */
|
|
12
|
-
sidebarToggle: React.ReactNode;
|
|
13
|
-
/** Stable id for a caller-composed compact disclosure trigger. */
|
|
14
|
-
sidebarId: string;
|
|
15
|
-
/** Whether the shared sidebar surface is currently visible. */
|
|
16
|
-
sidebarOpen: boolean;
|
|
17
|
-
/** Toggle the sidebar and remember the invoking control for Escape focus restoration. */
|
|
18
|
-
toggleSidebar: (trigger?: HTMLElement) => void;
|
|
19
|
-
}
|
|
20
|
-
interface ResponsiveSidebarShellProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
21
|
-
/** Navigation or other secondary surface shown beside the selected content. */
|
|
22
|
-
sidebar: React.ReactNode | ((controls: ResponsiveSidebarShellControls) => React.ReactNode);
|
|
23
|
-
/**
|
|
24
|
-
* Optional composable application bar. The render form receives the
|
|
25
|
-
* shell-owned sidebar toggle so callers can place it beside their own icon
|
|
26
|
-
* groups without duplicating drawer behavior.
|
|
27
|
-
*/
|
|
28
|
-
topBar?: React.ReactNode | ((controls: ResponsiveSidebarShellTopBarControls) => React.ReactNode);
|
|
29
|
-
/** Short noun used by the toggle and resize control, such as “threads” or “schedules”. */
|
|
30
|
-
sidebarLabel: string;
|
|
31
|
-
/** Whether the sidebar is open. Omit for internal state. */
|
|
32
|
-
sidebarOpen?: boolean;
|
|
33
|
-
/** Initial sidebar state when `sidebarOpen` is uncontrolled. */
|
|
34
|
-
defaultSidebarOpen?: boolean;
|
|
35
|
-
/** Initial desktop sidebar width in CSS pixels. */
|
|
36
|
-
defaultSidebarWidth?: number;
|
|
37
|
-
/** Called when the sidebar is opened or closed. */
|
|
38
|
-
onSidebarOpenChange?: (open: boolean) => void;
|
|
39
|
-
/** Accessible name for the toolbar containing the sidebar toggle. */
|
|
40
|
-
toolbarLabel?: string;
|
|
41
|
-
/** Accessible name for the mobile preview target that returns to the main content. */
|
|
42
|
-
showMainLabel?: string;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Responsive master-detail shell with a resizable desktop sidebar and a compact
|
|
46
|
-
* floating sidebar that leaves the main content in place as a dismiss target.
|
|
47
|
-
* The root exposes `data-sidebar-open="true" | "false"` as its public styling hook.
|
|
48
|
-
*/
|
|
49
|
-
declare function ResponsiveSidebarShell({
|
|
50
|
-
sidebar,
|
|
51
|
-
topBar,
|
|
52
|
-
sidebarLabel,
|
|
53
|
-
sidebarOpen,
|
|
54
|
-
defaultSidebarOpen,
|
|
55
|
-
defaultSidebarWidth,
|
|
56
|
-
onSidebarOpenChange,
|
|
57
|
-
toolbarLabel,
|
|
58
|
-
showMainLabel,
|
|
59
|
-
className,
|
|
60
|
-
children,
|
|
61
|
-
ref,
|
|
62
|
-
style,
|
|
63
|
-
...props
|
|
64
|
-
}: ResponsiveSidebarShellProps & {
|
|
65
|
-
ref?: React.Ref<HTMLDivElement>;
|
|
66
|
-
}): React.JSX.Element;
|
|
67
|
-
//#endregion
|
|
68
|
-
export { ResponsiveSidebarShellTopBarControls as i, ResponsiveSidebarShellControls as n, ResponsiveSidebarShellProps as r, ResponsiveSidebarShell as t };
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { n as WorkspaceDestination } from "../../WorkspaceLink-Bh9-Jo1r.js";
|
|
2
|
-
import { s as AgentActivitySummary } from "../../AgentActivity-Cc_oDYum.js";
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
|
|
5
|
-
//#region src/components/agents-sdk/AgentActivityPreview.d.ts
|
|
6
|
-
/** The three conditions that make an agent relevant to the transient preview. */
|
|
7
|
-
type AgentActivityPreviewStatus = "running" | "input-required" | "unviewed";
|
|
8
|
-
interface AgentActivityPreviewFavicon {
|
|
9
|
-
src: string;
|
|
10
|
-
label: string;
|
|
11
|
-
}
|
|
12
|
-
type AgentActivityPreviewItem = Omit<AgentActivitySummary, "mode"> & {
|
|
13
|
-
id: string;
|
|
14
|
-
status: AgentActivityPreviewStatus;
|
|
15
|
-
favicons?: readonly AgentActivityPreviewFavicon[];
|
|
16
|
-
};
|
|
17
|
-
interface AgentActivityPreviewProps extends Omit<React.HTMLAttributes<HTMLElement>, "children" | "onSelect"> {
|
|
18
|
-
/** Current agent summaries to show in the transient preview. */
|
|
19
|
-
items: readonly AgentActivityPreviewItem[];
|
|
20
|
-
/** App-authored TanStack Router Link for every durable agent destination. */
|
|
21
|
-
renderAgentLink: (item: AgentActivityPreviewItem) => React.ReactElement;
|
|
22
|
-
/** App-authored TanStack Router Link for a projected workspace file destination. */
|
|
23
|
-
renderWorkspaceFileLink?: (item: AgentActivityPreviewItem, destination: Extract<WorkspaceDestination, {
|
|
24
|
-
kind: "file";
|
|
25
|
-
}>) => React.ReactElement;
|
|
26
|
-
/** Hides the complete preview when the host supports dismissal. */
|
|
27
|
-
onDismiss?: () => void;
|
|
28
|
-
/** Product mark shown beside the agent rows. */
|
|
29
|
-
brandIcon?: React.ReactNode;
|
|
30
|
-
}
|
|
31
|
-
/** Compact multi-agent preview for a page overlay or secondary application rail. */
|
|
32
|
-
declare function AgentActivityPreview({
|
|
33
|
-
"aria-label": ariaLabel,
|
|
34
|
-
brandIcon,
|
|
35
|
-
className,
|
|
36
|
-
items,
|
|
37
|
-
onDismiss,
|
|
38
|
-
renderAgentLink,
|
|
39
|
-
renderWorkspaceFileLink,
|
|
40
|
-
ref,
|
|
41
|
-
...props
|
|
42
|
-
}: AgentActivityPreviewProps & {
|
|
43
|
-
ref?: React.Ref<HTMLElement>;
|
|
44
|
-
}): React.JSX.Element | null;
|
|
45
|
-
//#endregion
|
|
46
|
-
export { AgentActivityPreview, AgentActivityPreviewFavicon, AgentActivityPreviewItem, AgentActivityPreviewProps, AgentActivityPreviewStatus };
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
|
-
import { C as FileIcon, M as McpIcon, Y as SpinnerIcon, it as XIcon, nt as WarningIcon } from "../../icons-MmIXciMO.js";
|
|
3
|
-
import { ActivityHeader } from "../ai-sdk/Activity.js";
|
|
4
|
-
import { Button } from "../foundations/Button.js";
|
|
5
|
-
import { t as NavigationLink } from "../../navigation-link-kqMa81v5.js";
|
|
6
|
-
import { AppIcon } from "../foundations/AppIcon.js";
|
|
7
|
-
import { AgentActivityFavicon, AgentActivityIcon } from "./AgentActivity.js";
|
|
8
|
-
import "react";
|
|
9
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
-
//#region src/components/agents-sdk/AgentActivityPreview.tsx
|
|
11
|
-
/** Compact multi-agent preview for a page overlay or secondary application rail. */
|
|
12
|
-
function AgentActivityPreview({ "aria-label": ariaLabel = "Agent activity", brandIcon = /* @__PURE__ */ jsx(McpIcon, {}), className, items, onDismiss, renderAgentLink, renderWorkspaceFileLink, ref, ...props }) {
|
|
13
|
-
if (items.length === 0) return null;
|
|
14
|
-
return /* @__PURE__ */ jsxs("section", {
|
|
15
|
-
ref,
|
|
16
|
-
"aria-label": ariaLabel,
|
|
17
|
-
className: cx("agent-activity-preview", className),
|
|
18
|
-
"data-slot": "agent-activity-preview",
|
|
19
|
-
...props,
|
|
20
|
-
children: [
|
|
21
|
-
/* @__PURE__ */ jsx("div", {
|
|
22
|
-
className: "agent-activity-preview__badge",
|
|
23
|
-
"aria-hidden": "true",
|
|
24
|
-
children: brandIcon
|
|
25
|
-
}),
|
|
26
|
-
onDismiss ? /* @__PURE__ */ jsx(Button, {
|
|
27
|
-
"aria-label": "Hide agent activity",
|
|
28
|
-
className: "agent-activity-preview__dismiss",
|
|
29
|
-
color: "neutral",
|
|
30
|
-
iconOnly: true,
|
|
31
|
-
size: "sm",
|
|
32
|
-
variant: "ghost",
|
|
33
|
-
onClick: onDismiss,
|
|
34
|
-
children: /* @__PURE__ */ jsx(XIcon, {})
|
|
35
|
-
}) : null,
|
|
36
|
-
/* @__PURE__ */ jsx("ul", {
|
|
37
|
-
className: "agent-activity-preview__list",
|
|
38
|
-
role: "list",
|
|
39
|
-
children: items.map((item) => /* @__PURE__ */ jsxs("li", {
|
|
40
|
-
className: "agent-activity-preview__item",
|
|
41
|
-
children: [/* @__PURE__ */ jsx(NavigationLink, {
|
|
42
|
-
render: renderAgentLink(item),
|
|
43
|
-
className: "agent-activity-preview__row",
|
|
44
|
-
"aria-label": `${item.action}${item.detail ? ` ${item.detail}` : ""}. ${statusLabel(item.status)}. Open agent.`,
|
|
45
|
-
"data-status": item.status,
|
|
46
|
-
children: /* @__PURE__ */ jsx(ActivityHeader, {
|
|
47
|
-
icon: item.url ? /* @__PURE__ */ jsx(AgentActivityFavicon, {
|
|
48
|
-
url: item.url,
|
|
49
|
-
fallbackKind: item.iconKind
|
|
50
|
-
}) : /* @__PURE__ */ jsx(AgentActivityIcon, { kind: item.iconKind }),
|
|
51
|
-
isStreaming: item.status === "running",
|
|
52
|
-
action: item.action,
|
|
53
|
-
detail: item.detail,
|
|
54
|
-
trailing: /* @__PURE__ */ jsxs("span", {
|
|
55
|
-
className: "agent-activity-preview__trailing",
|
|
56
|
-
"aria-hidden": "true",
|
|
57
|
-
children: [item.favicons?.length ? /* @__PURE__ */ jsx(AppIcon.Stack, { children: item.favicons.map((favicon) => /* @__PURE__ */ jsxs(AppIcon.Root, {
|
|
58
|
-
size: "sm",
|
|
59
|
-
title: favicon.label,
|
|
60
|
-
children: [/* @__PURE__ */ jsx(AppIcon.Image, {
|
|
61
|
-
src: favicon.src,
|
|
62
|
-
alt: ""
|
|
63
|
-
}), /* @__PURE__ */ jsx(AppIcon.Fallback, { children: favicon.label.slice(0, 1) })]
|
|
64
|
-
}, `${favicon.src}:${favicon.label}`)) }) : null, /* @__PURE__ */ jsx(StatusIcon, { status: item.status })]
|
|
65
|
-
})
|
|
66
|
-
})
|
|
67
|
-
}), item.workspaceDestination && renderWorkspaceFileLink ? /* @__PURE__ */ jsx(NavigationLink, {
|
|
68
|
-
render: renderWorkspaceFileLink(item, item.workspaceDestination),
|
|
69
|
-
className: "agent-activity-preview__file-action",
|
|
70
|
-
"aria-label": `Open ${item.workspaceDestination.path} in workspace`,
|
|
71
|
-
children: /* @__PURE__ */ jsx(FileIcon, {})
|
|
72
|
-
}) : null]
|
|
73
|
-
}, item.id))
|
|
74
|
-
})
|
|
75
|
-
]
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
function StatusIcon({ status }) {
|
|
79
|
-
switch (status) {
|
|
80
|
-
case "running": return /* @__PURE__ */ jsx(SpinnerIcon, {});
|
|
81
|
-
case "input-required": return /* @__PURE__ */ jsx(WarningIcon, {});
|
|
82
|
-
case "unviewed": return /* @__PURE__ */ jsx("span", { className: "agent-activity-preview__unviewed-dot" });
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
function statusLabel(status) {
|
|
86
|
-
switch (status) {
|
|
87
|
-
case "running": return "Working";
|
|
88
|
-
case "input-required": return "Needs your input";
|
|
89
|
-
case "unviewed": return "Not yet viewed";
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
//#endregion
|
|
93
|
-
export { AgentActivityPreview };
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { t as ResponsiveSidebarShell } from "../../ResponsiveSidebarShell-DWjULskY.js";
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
|
|
4
|
-
//#region src/components/agents-sdk/ThinkThreadShell.d.ts
|
|
5
|
-
interface ThinkThreadShellProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
6
|
-
/**
|
|
7
|
-
* Thread picker or app-owned sidebar shown beside the selected child shell.
|
|
8
|
-
* Use the render form to close the compact drawer when a thread is selected.
|
|
9
|
-
*/
|
|
10
|
-
sidebar: React.ComponentProps<typeof ResponsiveSidebarShell>["sidebar"];
|
|
11
|
-
/** Whether the thread drawer is open. Omit for internal state. */
|
|
12
|
-
sidebarOpen?: boolean;
|
|
13
|
-
/** Initial thread drawer state when `sidebarOpen` is uncontrolled. */
|
|
14
|
-
defaultSidebarOpen?: boolean;
|
|
15
|
-
/** Called when the thread drawer is opened or closed. */
|
|
16
|
-
onSidebarOpenChange?: (open: boolean) => void;
|
|
17
|
-
/** Application bar composed with the shell-owned thread toggle. */
|
|
18
|
-
topBar?: React.ComponentProps<typeof ResponsiveSidebarShell>["topBar"];
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Thread-specific adapter for ResponsiveSidebarShell. Callers still own the
|
|
22
|
-
* parent agent, selected child agent, chat hook, and shared workspace.
|
|
23
|
-
*/
|
|
24
|
-
declare function ThinkThreadShell({
|
|
25
|
-
sidebar,
|
|
26
|
-
sidebarOpen,
|
|
27
|
-
defaultSidebarOpen,
|
|
28
|
-
onSidebarOpenChange,
|
|
29
|
-
topBar,
|
|
30
|
-
children,
|
|
31
|
-
className,
|
|
32
|
-
ref,
|
|
33
|
-
...props
|
|
34
|
-
}: ThinkThreadShellProps & {
|
|
35
|
-
ref?: React.Ref<HTMLDivElement>;
|
|
36
|
-
}): React.JSX.Element;
|
|
37
|
-
//#endregion
|
|
38
|
-
export { ThinkThreadShell, ThinkThreadShellProps };
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
|
-
import { ResponsiveSidebarShell } from "../general-purpose/ResponsiveSidebarShell.js";
|
|
3
|
-
import "react";
|
|
4
|
-
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
//#region src/components/agents-sdk/ThinkThreadShell.tsx
|
|
6
|
-
/**
|
|
7
|
-
* Thread-specific adapter for ResponsiveSidebarShell. Callers still own the
|
|
8
|
-
* parent agent, selected child agent, chat hook, and shared workspace.
|
|
9
|
-
*/
|
|
10
|
-
function ThinkThreadShell({ sidebar, sidebarOpen, defaultSidebarOpen, onSidebarOpenChange, topBar, children, className, ref, ...props }) {
|
|
11
|
-
return /* @__PURE__ */ jsx(ResponsiveSidebarShell, {
|
|
12
|
-
...props,
|
|
13
|
-
ref,
|
|
14
|
-
className: cx("think-thread-shell", className),
|
|
15
|
-
sidebar,
|
|
16
|
-
sidebarLabel: "threads",
|
|
17
|
-
sidebarOpen,
|
|
18
|
-
defaultSidebarOpen,
|
|
19
|
-
onSidebarOpenChange,
|
|
20
|
-
topBar,
|
|
21
|
-
toolbarLabel: "Thread controls",
|
|
22
|
-
showMainLabel: "Show selected thread",
|
|
23
|
-
children
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
//#endregion
|
|
27
|
-
export { ThinkThreadShell };
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { useRender } from "@base-ui/react/use-render";
|
|
2
|
-
|
|
3
|
-
//#region src/components/foundations/Badge.d.ts
|
|
4
|
-
type BadgeVariant = "normal" | "outline" | "ghost" | "link";
|
|
5
|
-
type BadgeColor = "neutral" | "primary" | "success" | "destructive" | "warning";
|
|
6
|
-
interface BadgeVariantsOptions {
|
|
7
|
-
variant?: BadgeVariant | null;
|
|
8
|
-
color?: BadgeColor | null;
|
|
9
|
-
size?: "sm" | "md" | null;
|
|
10
|
-
className?: string;
|
|
11
|
-
}
|
|
12
|
-
declare function badgeVariants({
|
|
13
|
-
variant,
|
|
14
|
-
color,
|
|
15
|
-
size,
|
|
16
|
-
className
|
|
17
|
-
}?: BadgeVariantsOptions): string;
|
|
18
|
-
type BadgeRenderState = {
|
|
19
|
-
slot: "badge";
|
|
20
|
-
variant: BadgeVariant;
|
|
21
|
-
size: "sm" | "md";
|
|
22
|
-
};
|
|
23
|
-
interface BadgeProps extends Omit<useRender.ComponentProps<"span", BadgeRenderState>, "color"> {
|
|
24
|
-
/**
|
|
25
|
-
* The visual rendering style of the badge.
|
|
26
|
-
* @default 'normal'
|
|
27
|
-
*/
|
|
28
|
-
variant?: BadgeVariant;
|
|
29
|
-
/**
|
|
30
|
-
* The semantic color intent of the badge.
|
|
31
|
-
* @default 'primary'
|
|
32
|
-
*/
|
|
33
|
-
color?: BadgeColor;
|
|
34
|
-
/**
|
|
35
|
-
* The size of the badge.
|
|
36
|
-
* @default 'md'
|
|
37
|
-
*/
|
|
38
|
-
size?: "sm" | "md";
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* A badge component for highlighting status, labels, or categories.
|
|
42
|
-
*
|
|
43
|
-
* @example
|
|
44
|
-
* ```tsx
|
|
45
|
-
* <Badge>Default</Badge>
|
|
46
|
-
* <Badge color="success">Active</Badge>
|
|
47
|
-
* <Badge color="warning">Pending</Badge>
|
|
48
|
-
* <Badge variant="outline">Info</Badge>
|
|
49
|
-
* <Badge render={<a href="/docs" />}>Docs</Badge>
|
|
50
|
-
* ```
|
|
51
|
-
*/
|
|
52
|
-
declare function Badge({
|
|
53
|
-
variant,
|
|
54
|
-
color,
|
|
55
|
-
size,
|
|
56
|
-
className,
|
|
57
|
-
render,
|
|
58
|
-
ref,
|
|
59
|
-
...props
|
|
60
|
-
}: BadgeProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
61
|
-
//#endregion
|
|
62
|
-
export { Badge, BadgeColor, BadgeProps, BadgeVariant, BadgeVariantsOptions, badgeVariants };
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { useRender } from "@base-ui/react/use-render";
|
|
2
|
-
//#region src/components/foundations/Badge.tsx
|
|
3
|
-
const BADGE_VARIANT_DEFAULT_COLOR = {
|
|
4
|
-
normal: "primary",
|
|
5
|
-
outline: "neutral",
|
|
6
|
-
ghost: "neutral",
|
|
7
|
-
link: "primary"
|
|
8
|
-
};
|
|
9
|
-
function badgeVariants({ variant = "normal", color, size = "md", className } = {}) {
|
|
10
|
-
const badgeVariant = variant ?? "normal";
|
|
11
|
-
return [
|
|
12
|
-
"badge",
|
|
13
|
-
`badge--${badgeVariant}`,
|
|
14
|
-
`badge--${color ?? BADGE_VARIANT_DEFAULT_COLOR[badgeVariant]}`,
|
|
15
|
-
size !== "md" && `badge--${size}`,
|
|
16
|
-
className
|
|
17
|
-
].filter(Boolean).join(" ");
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* A badge component for highlighting status, labels, or categories.
|
|
21
|
-
*
|
|
22
|
-
* @example
|
|
23
|
-
* ```tsx
|
|
24
|
-
* <Badge>Default</Badge>
|
|
25
|
-
* <Badge color="success">Active</Badge>
|
|
26
|
-
* <Badge color="warning">Pending</Badge>
|
|
27
|
-
* <Badge variant="outline">Info</Badge>
|
|
28
|
-
* <Badge render={<a href="/docs" />}>Docs</Badge>
|
|
29
|
-
* ```
|
|
30
|
-
*/
|
|
31
|
-
function Badge({ variant = "normal", color, size = "md", className, render, ref, ...props }) {
|
|
32
|
-
const badgeVariant = variant ?? "normal";
|
|
33
|
-
const classes = badgeVariants({
|
|
34
|
-
variant,
|
|
35
|
-
color,
|
|
36
|
-
size,
|
|
37
|
-
className
|
|
38
|
-
});
|
|
39
|
-
return useRender({
|
|
40
|
-
defaultTagName: "span",
|
|
41
|
-
render,
|
|
42
|
-
ref,
|
|
43
|
-
props: {
|
|
44
|
-
...props,
|
|
45
|
-
className: classes
|
|
46
|
-
},
|
|
47
|
-
state: {
|
|
48
|
-
slot: "badge",
|
|
49
|
-
variant: badgeVariant,
|
|
50
|
-
size
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
//#endregion
|
|
55
|
-
export { Badge, badgeVariants };
|