@tulipfarm/sprout 0.3.0 → 0.4.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/README.md +45 -40
- package/dist/components/accordion.d.ts +2 -2
- package/dist/components/accordion.js +9 -9
- package/dist/components/agent-fanout.d.ts +2 -2
- package/dist/components/agent-fanout.js +65 -87
- package/dist/components/alert-dialog.d.ts +6 -6
- package/dist/components/alert-dialog.js +20 -20
- package/dist/components/alert.d.ts +6 -6
- package/dist/components/alert.js +13 -13
- package/dist/components/aspect-ratio.d.ts +2 -2
- package/dist/components/aspect-ratio.js +2 -2
- package/dist/components/attachment.d.ts +17 -17
- package/dist/components/attachment.js +82 -115
- package/dist/components/avatar.d.ts +10 -10
- package/dist/components/avatar.js +14 -14
- package/dist/components/badge.d.ts +4 -4
- package/dist/components/badge.js +18 -18
- package/dist/components/board.d.ts +107 -0
- package/dist/components/board.js +640 -0
- package/dist/components/brand-icon.d.ts +6 -6
- package/dist/components/brand-icon.js +55 -63
- package/dist/components/breadcrumb.d.ts +11 -11
- package/dist/components/breadcrumb.js +16 -18
- package/dist/components/button-group.d.ts +6 -6
- package/dist/components/button-group.js +14 -14
- package/dist/components/button.d.ts +11 -11
- package/dist/components/button.js +46 -56
- package/dist/components/calendar.d.ts +5 -5
- package/dist/components/calendar.js +44 -53
- package/dist/components/canvas.d.ts +4 -4
- package/dist/components/canvas.js +39 -46
- package/dist/components/card.d.ts +6 -6
- package/dist/components/card.js +17 -17
- package/dist/components/carousel.d.ts +7 -7
- package/dist/components/carousel.js +57 -75
- package/dist/components/chart.d.ts +5 -112
- package/dist/components/chart.js +5 -172
- package/dist/components/chat-confirmation.d.ts +13 -11
- package/dist/components/chat-confirmation.js +32 -38
- package/dist/components/chat-input.d.ts +4 -4
- package/dist/components/chat-input.js +74 -81
- package/dist/components/chat-plan.d.ts +2 -2
- package/dist/components/chat-plan.js +15 -20
- package/dist/components/chat-sources.d.ts +8 -8
- package/dist/components/chat-sources.js +18 -27
- package/dist/components/checkbox.d.ts +1 -1
- package/dist/components/checkbox.js +9 -9
- package/dist/components/choice-list.d.ts +2 -2
- package/dist/components/choice-list.js +16 -18
- package/dist/components/code-block.d.ts +5 -5
- package/dist/components/code-block.js +26 -26
- package/dist/components/collapsible.d.ts +1 -1
- package/dist/components/collapsible.js +7 -11
- package/dist/components/combobox.d.ts +3 -3
- package/dist/components/combobox.js +24 -24
- package/dist/components/command.d.ts +13 -13
- package/dist/components/command.js +61 -73
- package/dist/components/context-menu.d.ts +5 -5
- package/dist/components/context-menu.js +22 -22
- package/dist/components/dialog.d.ts +6 -6
- package/dist/components/dialog.js +23 -28
- package/dist/components/direction.d.ts +1 -1
- package/dist/components/direction.js +1 -1
- package/dist/components/dropdown-menu.d.ts +5 -5
- package/dist/components/dropdown-menu.js +20 -20
- package/dist/components/field.d.ts +11 -11
- package/dist/components/field.js +41 -61
- package/dist/components/file-explorer.d.ts +2 -2
- package/dist/components/file-explorer.js +89 -105
- package/dist/components/file-viewer.d.ts +10 -10
- package/dist/components/file-viewer.js +112 -140
- package/dist/components/form.d.ts +7 -7
- package/dist/components/form.js +24 -28
- package/dist/components/glass-banner.d.ts +3 -3
- package/dist/components/glass-banner.js +21 -24
- package/dist/components/gradient-banner.d.ts +5 -5
- package/dist/components/gradient-banner.js +13 -22
- package/dist/components/hover-card.d.ts +4 -4
- package/dist/components/hover-card.js +6 -6
- package/dist/components/input-group.d.ts +11 -11
- package/dist/components/input-group.js +22 -36
- package/dist/components/input-otp.d.ts +10 -10
- package/dist/components/input-otp.js +13 -15
- package/dist/components/input.d.ts +1 -1
- package/dist/components/input.js +7 -7
- package/dist/components/kbd.d.ts +3 -3
- package/dist/components/kbd.js +5 -5
- package/dist/components/label.d.ts +2 -2
- package/dist/components/label.js +2 -2
- package/dist/components/mention-list.d.ts +3 -3
- package/dist/components/mention-list.js +10 -10
- package/dist/components/menubar.d.ts +6 -6
- package/dist/components/menubar.js +22 -22
- package/dist/components/message-actions.d.ts +2 -2
- package/dist/components/message-actions.js +29 -31
- package/dist/components/message-response.d.ts +3 -3
- package/dist/components/message-response.js +18 -18
- package/dist/components/message-scroller.d.ts +12 -12
- package/dist/components/message-scroller.js +44 -56
- package/dist/components/message.d.ts +11 -11
- package/dist/components/message.js +25 -25
- package/dist/components/navigation-menu.d.ts +2 -2
- package/dist/components/navigation-menu.js +15 -15
- package/dist/components/notice-banner.d.ts +2 -2
- package/dist/components/notice-banner.js +2 -2
- package/dist/components/page-content.d.ts +2 -2
- package/dist/components/page-content.js +2 -2
- package/dist/components/page-header.d.ts +1 -1
- package/dist/components/page-header.js +16 -16
- package/dist/components/pagination.d.ts +9 -9
- package/dist/components/pagination.js +17 -17
- package/dist/components/plan-outline.d.ts +2 -2
- package/dist/components/plan-outline.js +43 -60
- package/dist/components/popover.d.ts +6 -6
- package/dist/components/popover.js +15 -15
- package/dist/components/presence-cursor.d.ts +2 -2
- package/dist/components/presence-cursor.js +3 -3
- package/dist/components/progress.d.ts +1 -1
- package/dist/components/progress.js +8 -8
- package/dist/components/prompt-list.d.ts +3 -3
- package/dist/components/prompt-list.js +6 -6
- package/dist/components/questionnaire.d.ts +19 -19
- package/dist/components/questionnaire.js +183 -242
- package/dist/components/radio-group.d.ts +2 -2
- package/dist/components/radio-group.js +6 -6
- package/dist/components/reasoning-effort.d.ts +3 -3
- package/dist/components/reasoning-effort.js +9 -12
- package/dist/components/record-list.d.ts +66 -0
- package/dist/components/record-list.js +151 -0
- package/dist/components/resizable.d.ts +5 -5
- package/dist/components/resizable.js +76 -102
- package/dist/components/result-card.d.ts +10 -5
- package/dist/components/result-card.js +42 -53
- package/dist/components/result-notice.d.ts +18 -0
- package/dist/components/result-notice.js +29 -0
- package/dist/components/review-card.d.ts +6 -6
- package/dist/components/review-card.js +18 -18
- package/dist/components/rich-text-editor.d.ts +2 -2
- package/dist/components/rich-text-editor.js +56 -72
- package/dist/components/schema-diagram.d.ts +3 -3
- package/dist/components/schema-diagram.js +39 -53
- package/dist/components/scroll-area.d.ts +1 -1
- package/dist/components/scroll-area.js +10 -14
- package/dist/components/search-dialog.d.ts +6 -6
- package/dist/components/search-dialog.js +16 -16
- package/dist/components/search-field.d.ts +1 -1
- package/dist/components/search-field.js +11 -11
- package/dist/components/select.d.ts +3 -3
- package/dist/components/select.js +20 -20
- package/dist/components/selection-slot.d.ts +2 -2
- package/dist/components/selection-slot.js +6 -9
- package/dist/components/separator.d.ts +15 -15
- package/dist/components/separator.js +22 -27
- package/dist/components/settings-list.d.ts +3 -3
- package/dist/components/settings-list.js +5 -5
- package/dist/components/sheet.d.ts +6 -6
- package/dist/components/sheet.js +27 -27
- package/dist/components/sidebar.d.ts +22 -22
- package/dist/components/sidebar.js +57 -58
- package/dist/components/skeleton.d.ts +5 -5
- package/dist/components/skeleton.js +14 -21
- package/dist/components/slider.d.ts +2 -2
- package/dist/components/slider.js +6 -6
- package/dist/components/spinner.d.ts +5 -5
- package/dist/components/spinner.js +22 -26
- package/dist/components/sql-viewer.d.ts +14 -14
- package/dist/components/sql-viewer.js +99 -128
- package/dist/components/state-panel-samples.d.ts +2 -2
- package/dist/components/state-panel-samples.js +209 -245
- package/dist/components/state-panel.d.ts +2 -35
- package/dist/components/state-panel.js +2 -29
- package/dist/components/state-sample.d.ts +7 -7
- package/dist/components/state-sample.js +18 -31
- package/dist/components/switch.d.ts +1 -1
- package/dist/components/switch.js +7 -7
- package/dist/components/table-nuqs.d.ts +2 -2
- package/dist/components/table-nuqs.js +11 -12
- package/dist/components/table.d.ts +4 -4
- package/dist/components/table.js +166 -235
- package/dist/components/tabs.d.ts +2 -2
- package/dist/components/tabs.js +12 -12
- package/dist/components/textarea.d.ts +2 -2
- package/dist/components/textarea.js +6 -8
- package/dist/components/timeline.d.ts +3 -0
- package/dist/components/timeline.js +3 -0
- package/dist/components/toast.d.ts +2 -2
- package/dist/components/toast.js +19 -25
- package/dist/components/toggle-group.d.ts +2 -2
- package/dist/components/toggle-group.js +18 -20
- package/dist/components/toggle.d.ts +2 -2
- package/dist/components/toggle.js +8 -8
- package/dist/components/tool-activity.d.ts +1 -1
- package/dist/components/tool-activity.js +83 -110
- package/dist/components/toolbar-status.d.ts +2 -2
- package/dist/components/toolbar-status.js +7 -7
- package/dist/components/tooltip.d.ts +5 -5
- package/dist/components/tooltip.js +12 -11
- package/dist/components/typed-text.d.ts +2 -2
- package/dist/components/typed-text.js +10 -12
- package/dist/components/view-switcher.d.ts +51 -0
- package/dist/components/view-switcher.js +114 -0
- package/dist/index.d.ts +98 -93
- package/dist/index.js +98 -93
- package/dist/internal/chart-kit.d.ts +142 -0
- package/dist/internal/chart-kit.js +200 -0
- package/dist/internal/charts/bars.d.ts +61 -0
- package/dist/internal/charts/bars.js +86 -0
- package/dist/internal/charts/lines.d.ts +67 -0
- package/dist/internal/charts/lines.js +70 -0
- package/dist/internal/charts/more.d.ts +77 -0
- package/dist/internal/charts/more.js +68 -0
- package/dist/internal/charts/parts.d.ts +54 -0
- package/dist/internal/charts/parts.js +82 -0
- package/dist/internal/charts/timeline-dates.d.ts +38 -0
- package/dist/internal/charts/timeline-dates.js +113 -0
- package/dist/internal/charts/timeline-window.d.ts +31 -0
- package/dist/internal/charts/timeline-window.js +26 -0
- package/dist/internal/charts/timeline.d.ts +72 -0
- package/dist/internal/charts/timeline.js +287 -0
- package/dist/internal/classes.d.ts +1 -1
- package/dist/internal/classes.js +7 -9
- package/dist/internal/code-tokens.d.ts +2 -2
- package/dist/internal/code-tokens.js +12 -12
- package/dist/internal/fieldset.d.ts +1 -1
- package/dist/internal/fieldset.js +6 -6
- package/dist/internal/file-kind.d.ts +1 -1
- package/dist/internal/file-kind.js +43 -51
- package/dist/internal/flow.d.ts +4 -4
- package/dist/internal/flow.js +20 -23
- package/dist/internal/languages.js +999 -999
- package/dist/internal/message-scroller.d.ts +3 -3
- package/dist/internal/message-scroller.js +64 -112
- package/dist/internal/pressable.d.ts +1 -1
- package/dist/internal/pressable.js +7 -7
- package/dist/internal/state-panel.d.ts +35 -0
- package/dist/internal/state-panel.js +22 -0
- package/dist/internal/syntax.d.ts +2 -2
- package/dist/internal/syntax.js +36 -47
- package/dist/styles/accordion.css +3 -5
- package/dist/styles/agent-fanout.css +64 -60
- package/dist/styles/alert-dialog.css +12 -26
- package/dist/styles/alert.css +10 -15
- package/dist/styles/attachment.css +51 -93
- package/dist/styles/avatar.css +17 -24
- package/dist/styles/badge.css +11 -36
- package/dist/styles/board.css +571 -0
- package/dist/styles/brand-icon.css +7 -8
- package/dist/styles/breadcrumb.css +4 -7
- package/dist/styles/button-group.css +8 -14
- package/dist/styles/button.css +22 -27
- package/dist/styles/calendar.css +24 -36
- package/dist/styles/canvas.css +2 -3
- package/dist/styles/card.css +7 -23
- package/dist/styles/carousel.css +11 -12
- package/dist/styles/chart.css +215 -31
- package/dist/styles/chat-input.css +15 -39
- package/dist/styles/chat-plan.css +3 -4
- package/dist/styles/chat-sources.css +3 -6
- package/dist/styles/checkbox.css +11 -25
- package/dist/styles/choice-list.css +17 -31
- package/dist/styles/code-block.css +11 -25
- package/dist/styles/collapsible.css +10 -15
- package/dist/styles/combobox.css +11 -15
- package/dist/styles/command.css +5 -8
- package/dist/styles/context-menu.css +2 -2
- package/dist/styles/dialog.css +5 -16
- package/dist/styles/dropdown-menu.css +2 -2
- package/dist/styles/field.css +15 -21
- package/dist/styles/file-explorer.css +19 -33
- package/dist/styles/file-viewer.css +13 -17
- package/dist/styles/form.css +3 -3
- package/dist/styles/glass-banner.css +12 -47
- package/dist/styles/gradient-banner.css +17 -35
- package/dist/styles/hover-card.css +9 -15
- package/dist/styles/index.css +116 -108
- package/dist/styles/input-group.css +25 -41
- package/dist/styles/input-otp.css +5 -6
- package/dist/styles/input.css +5 -5
- package/dist/styles/kbd.css +1 -1
- package/dist/styles/label.css +9 -30
- package/dist/styles/mention-list.css +6 -8
- package/dist/styles/menubar.css +5 -6
- package/dist/styles/message-actions.css +1 -1
- package/dist/styles/message-response.css +3 -5
- package/dist/styles/message-scroller.css +14 -21
- package/dist/styles/message.css +23 -60
- package/dist/styles/navigation-menu.css +14 -29
- package/dist/styles/notice-banner.css +1 -2
- package/dist/styles/page-header.css +7 -10
- package/dist/styles/pagination.css +1 -4
- package/dist/styles/plan-outline.css +20 -37
- package/dist/styles/popover.css +10 -19
- package/dist/styles/presence-cursor.css +1 -2
- package/dist/styles/progress.css +2 -4
- package/dist/styles/prompt-list.css +6 -17
- package/dist/styles/questionnaire.css +16 -40
- package/dist/styles/radio-group.css +12 -23
- package/dist/styles/reasoning-effort.css +8 -15
- package/dist/styles/record-list.css +243 -0
- package/dist/styles/resizable.css +10 -11
- package/dist/styles/result-card.css +17 -3
- package/dist/styles/result-notice.css +80 -0
- package/dist/styles/review-card.css +2 -3
- package/dist/styles/rich-text-editor.css +1 -2
- package/dist/styles/schema-diagram.css +12 -17
- package/dist/styles/scroll-area.css +8 -10
- package/dist/styles/search-dialog.css +1 -5
- package/dist/styles/search-field.css +1 -2
- package/dist/styles/select.css +7 -7
- package/dist/styles/selection-slot.css +1 -2
- package/dist/styles/separator.css +7 -8
- package/dist/styles/settings-list.css +1 -2
- package/dist/styles/sheet.css +40 -73
- package/dist/styles/sidebar.css +17 -21
- package/dist/styles/skeleton.css +9 -11
- package/dist/styles/slider.css +11 -21
- package/dist/styles/spinner.css +2 -2
- package/dist/styles/sql-viewer.css +29 -29
- package/dist/styles/state-panel.css +8 -9
- package/dist/styles/state-sample.css +20 -33
- package/dist/styles/switch.css +11 -18
- package/dist/styles/table.css +51 -77
- package/dist/styles/tabs.css +12 -16
- package/dist/styles/textarea.css +3 -3
- package/dist/styles/themes/chatgpt.css +11 -23
- package/dist/styles/themes/claude.css +12 -24
- package/dist/styles/themes/cloudflare.css +11 -23
- package/dist/styles/themes/discord.css +11 -23
- package/dist/styles/themes/github.css +11 -23
- package/dist/styles/themes/grok.css +11 -23
- package/dist/styles/themes/linear.css +12 -25
- package/dist/styles/themes/neutral.css +11 -23
- package/dist/styles/themes/notion.css +11 -23
- package/dist/styles/themes/perplexity.css +11 -23
- package/dist/styles/themes/raycast.css +11 -23
- package/dist/styles/themes/spotify.css +11 -23
- package/dist/styles/themes/stripe.css +11 -23
- package/dist/styles/themes/supabase.css +11 -23
- package/dist/styles/themes/tulipfarm.css +9 -10
- package/dist/styles/themes/vercel.css +12 -25
- package/dist/styles/timeline.css +276 -0
- package/dist/styles/toast.css +13 -20
- package/dist/styles/toggle-group.css +17 -23
- package/dist/styles/toggle.css +8 -8
- package/dist/styles/tool-activity.css +7 -13
- package/dist/styles/toolbar-status.css +2 -7
- package/dist/styles/tooltip.css +15 -21
- package/dist/styles/view-switcher.css +279 -0
- package/package.json +21 -1
package/README.md
CHANGED
|
@@ -62,21 +62,21 @@ The package is also on GitHub Packages. It needs a GitHub token with
|
|
|
62
62
|
Add the styles to your CSS entry:
|
|
63
63
|
|
|
64
64
|
```css
|
|
65
|
-
@import
|
|
66
|
-
@import
|
|
65
|
+
@import 'tailwindcss';
|
|
66
|
+
@import '@tulipfarm/sprout/styles.css';
|
|
67
67
|
```
|
|
68
68
|
|
|
69
69
|
Use a component:
|
|
70
70
|
|
|
71
71
|
```tsx
|
|
72
|
-
import { Button } from
|
|
73
|
-
import { Badge } from
|
|
72
|
+
import { Button } from '@tulipfarm/sprout/button';
|
|
73
|
+
import { Badge } from '@tulipfarm/sprout/badge';
|
|
74
74
|
|
|
75
75
|
export function Status() {
|
|
76
76
|
return (
|
|
77
77
|
<>
|
|
78
78
|
<Badge variant="success">Connected</Badge>
|
|
79
|
-
<Button state={{ kind:
|
|
79
|
+
<Button state={{ kind: 'busy' }} pendingLabel="Saving…">
|
|
80
80
|
Save
|
|
81
81
|
</Button>
|
|
82
82
|
</>
|
|
@@ -98,7 +98,7 @@ for notes on each one.
|
|
|
98
98
|
|
|
99
99
|
<!-- bundle-size:start -->
|
|
100
100
|
|
|
101
|
-
Full library: **
|
|
101
|
+
Full library: **842.5 kB** gzip. Each component path is smaller. Sizes are minified, with React and other peer dependencies left out.
|
|
102
102
|
|
|
103
103
|
<details>
|
|
104
104
|
<summary>Size of each component</summary>
|
|
@@ -108,11 +108,12 @@ Full library: **786.3 kB** gzip. Each component path is smaller. Sizes are minif
|
|
|
108
108
|
| `accordion` | 64.1 kB | 21.9 kB | 19.3 kB |
|
|
109
109
|
| `agent-fanout` | 260.9 kB | 86.7 kB | 74.6 kB |
|
|
110
110
|
| `alert` | 35.2 kB | 11.5 kB | 10.1 kB |
|
|
111
|
-
| `alert-dialog` | 169.1 kB | 57.0 kB | 49.
|
|
111
|
+
| `alert-dialog` | 169.1 kB | 57.0 kB | 49.7 kB |
|
|
112
112
|
| `aspect-ratio` | 30.2 kB | 9.7 kB | 8.5 kB |
|
|
113
|
-
| `attachment` |
|
|
113
|
+
| `attachment` | 352.1 kB | 118.4 kB | 97.9 kB |
|
|
114
114
|
| `avatar` | 45.5 kB | 15.4 kB | 13.6 kB |
|
|
115
115
|
| `badge` | 34.9 kB | 11.4 kB | 10.0 kB |
|
|
116
|
+
| `board` | 452.5 kB | 148.5 kB | 125.3 kB |
|
|
116
117
|
| `brand-icon` | 195.1 kB | 70.2 kB | 61.2 kB |
|
|
117
118
|
| `breadcrumb` | 40.5 kB | 13.4 kB | 11.7 kB |
|
|
118
119
|
| `button` | 50.5 kB | 16.7 kB | 14.6 kB |
|
|
@@ -121,30 +122,31 @@ Full library: **786.3 kB** gzip. Each component path is smaller. Sizes are minif
|
|
|
121
122
|
| `canvas` | 235.1 kB | 80.8 kB | 69.2 kB |
|
|
122
123
|
| `card` | 35.4 kB | 11.6 kB | 10.1 kB |
|
|
123
124
|
| `carousel` | 60.4 kB | 19.9 kB | 17.6 kB |
|
|
124
|
-
| `chart` |
|
|
125
|
-
| `
|
|
125
|
+
| `chart` | 540.1 kB | 155.5 kB | 129.9 kB |
|
|
126
|
+
| `timeline` | 598.5 kB | 175.9 kB | 147.1 kB |
|
|
127
|
+
| `chat-confirmation` | 76.7 kB | 26.3 kB | 22.4 kB |
|
|
126
128
|
| `chat-plan` | 42.3 kB | 13.4 kB | 11.7 kB |
|
|
127
|
-
| `chat-sources` | 206.2 kB | 70.5 kB | 60.
|
|
128
|
-
| `chat-input` |
|
|
129
|
+
| `chat-sources` | 206.2 kB | 70.5 kB | 60.5 kB |
|
|
130
|
+
| `chat-input` | 902.0 kB | 297.7 kB | 246.8 kB |
|
|
129
131
|
| `checkbox` | 60.0 kB | 21.0 kB | 18.5 kB |
|
|
130
132
|
| `choice-list` | 43.0 kB | 14.5 kB | 12.6 kB |
|
|
131
|
-
| `code-block` | 74.
|
|
133
|
+
| `code-block` | 74.5 kB | 26.1 kB | 22.3 kB |
|
|
132
134
|
| `collapsible` | 55.5 kB | 18.7 kB | 16.5 kB |
|
|
133
|
-
| `combobox` | 268.6 kB | 90.
|
|
135
|
+
| `combobox` | 268.6 kB | 90.8 kB | 77.7 kB |
|
|
134
136
|
| `command` | 181.9 kB | 61.6 kB | 53.5 kB |
|
|
135
|
-
| `context-menu` | 242.8 kB | 81.0 kB |
|
|
137
|
+
| `context-menu` | 242.8 kB | 81.0 kB | 70.0 kB |
|
|
136
138
|
| `dialog` | 170.7 kB | 57.5 kB | 50.2 kB |
|
|
137
139
|
| `direction` | 1.4 kB | 0.7 kB | 0.7 kB |
|
|
138
|
-
| `dropdown-menu` | 239.6 kB | 80.0 kB | 69.
|
|
139
|
-
| `field` | 97.9 kB | 34.
|
|
140
|
-
| `file-explorer` |
|
|
141
|
-
| `file-viewer` |
|
|
142
|
-
| `form` | 109.7 kB | 37.
|
|
140
|
+
| `dropdown-menu` | 239.6 kB | 80.0 kB | 69.1 kB |
|
|
141
|
+
| `field` | 97.9 kB | 34.1 kB | 29.6 kB |
|
|
142
|
+
| `file-explorer` | 175.8 kB | 61.5 kB | 51.5 kB |
|
|
143
|
+
| `file-viewer` | 320.8 kB | 108.3 kB | 90.7 kB |
|
|
144
|
+
| `form` | 109.7 kB | 37.2 kB | 32.2 kB |
|
|
143
145
|
| `glass-banner` | 33.0 kB | 10.6 kB | 9.4 kB |
|
|
144
146
|
| `gradient-banner` | 32.2 kB | 10.3 kB | 9.1 kB |
|
|
145
147
|
| `hover-card` | 163.2 kB | 56.3 kB | 49.1 kB |
|
|
146
|
-
| `input` | 108.2 kB | 37.4 kB | 32.
|
|
147
|
-
| `input-group` | 119.1 kB | 40.
|
|
148
|
+
| `input` | 108.2 kB | 37.4 kB | 32.4 kB |
|
|
149
|
+
| `input-group` | 119.1 kB | 40.4 kB | 34.8 kB |
|
|
148
150
|
| `input-otp` | 65.3 kB | 22.9 kB | 20.3 kB |
|
|
149
151
|
| `kbd` | 30.4 kB | 9.7 kB | 8.5 kB |
|
|
150
152
|
| `label` | 30.2 kB | 9.6 kB | 8.4 kB |
|
|
@@ -152,26 +154,28 @@ Full library: **786.3 kB** gzip. Each component path is smaller. Sizes are minif
|
|
|
152
154
|
| `menubar` | 244.9 kB | 82.2 kB | 70.7 kB |
|
|
153
155
|
| `message` | 36.2 kB | 11.7 kB | 10.3 kB |
|
|
154
156
|
| `message-actions` | 71.4 kB | 24.9 kB | 20.8 kB |
|
|
155
|
-
| `message-response` | 232.
|
|
157
|
+
| `message-response` | 232.8 kB | 74.3 kB | 64.2 kB |
|
|
156
158
|
| `message-scroller` | 69.0 kB | 22.1 kB | 19.6 kB |
|
|
157
|
-
| `navigation-menu` | 182.3 kB | 63.0 kB | 54.
|
|
159
|
+
| `navigation-menu` | 182.3 kB | 63.0 kB | 54.8 kB |
|
|
158
160
|
| `notice-banner` | 30.4 kB | 9.7 kB | 8.5 kB |
|
|
159
161
|
| `page-content` | 30.2 kB | 9.6 kB | 8.4 kB |
|
|
160
162
|
| `page-header` | 54.6 kB | 17.6 kB | 15.5 kB |
|
|
161
163
|
| `pagination` | 55.3 kB | 17.9 kB | 15.6 kB |
|
|
162
|
-
| `plan-outline` | 79.9 kB | 26.
|
|
163
|
-
| `popover` | 178.0 kB | 60.7 kB | 52.
|
|
164
|
+
| `plan-outline` | 79.9 kB | 26.8 kB | 22.9 kB |
|
|
165
|
+
| `popover` | 178.0 kB | 60.7 kB | 52.7 kB |
|
|
164
166
|
| `presence-cursor` | 30.8 kB | 9.9 kB | 8.6 kB |
|
|
165
167
|
| `progress` | 39.8 kB | 13.2 kB | 11.6 kB |
|
|
166
168
|
| `prompt-list` | 199.0 kB | 71.9 kB | 62.6 kB |
|
|
167
169
|
| `questionnaire` | 69.5 kB | 23.3 kB | 20.4 kB |
|
|
168
|
-
| `radio-group` | 80.8 kB | 27.9 kB | 24.
|
|
170
|
+
| `radio-group` | 80.8 kB | 27.9 kB | 24.8 kB |
|
|
169
171
|
| `reasoning-effort` | 35.5 kB | 12.0 kB | 10.5 kB |
|
|
172
|
+
| `record-list` | 65.8 kB | 22.3 kB | 19.0 kB |
|
|
170
173
|
| `resizable` | 39.4 kB | 13.4 kB | 11.8 kB |
|
|
171
|
-
| `result-card` | 240.
|
|
172
|
-
| `
|
|
174
|
+
| `result-card` | 240.3 kB | 85.3 kB | 72.4 kB |
|
|
175
|
+
| `result-notice` | 34.3 kB | 11.3 kB | 9.9 kB |
|
|
176
|
+
| `review-card` | 61.6 kB | 21.2 kB | 18.5 kB |
|
|
173
177
|
| `rich-text-editor` | 442.5 kB | 140.2 kB | 119.8 kB |
|
|
174
|
-
| `schema-diagram` | 247.9 kB | 82.9 kB | 71.
|
|
178
|
+
| `schema-diagram` | 247.9 kB | 82.9 kB | 71.3 kB |
|
|
175
179
|
| `sql-viewer` | 265.6 kB | 89.1 kB | 76.3 kB |
|
|
176
180
|
| `scroll-area` | 57.3 kB | 19.7 kB | 17.4 kB |
|
|
177
181
|
| `search-dialog` | 190.2 kB | 64.6 kB | 55.5 kB |
|
|
@@ -181,24 +185,25 @@ Full library: **786.3 kB** gzip. Each component path is smaller. Sizes are minif
|
|
|
181
185
|
| `separator` | 36.9 kB | 11.9 kB | 10.5 kB |
|
|
182
186
|
| `settings-list` | 31.1 kB | 9.9 kB | 8.7 kB |
|
|
183
187
|
| `sheet` | 213.4 kB | 72.9 kB | 63.2 kB |
|
|
184
|
-
| `sidebar` | 251.1 kB | 85.
|
|
188
|
+
| `sidebar` | 251.1 kB | 85.7 kB | 72.8 kB |
|
|
185
189
|
| `skeleton` | 35.1 kB | 11.5 kB | 10.1 kB |
|
|
186
190
|
| `slider` | 83.6 kB | 29.5 kB | 25.9 kB |
|
|
187
191
|
| `spinner` | 36.5 kB | 11.6 kB | 10.1 kB |
|
|
188
|
-
| `state-panel` |
|
|
192
|
+
| `state-panel` | 460.5 kB | 155.8 kB | 128.5 kB |
|
|
189
193
|
| `state-sample` | 33.5 kB | 10.5 kB | 9.2 kB |
|
|
190
194
|
| `switch` | 50.3 kB | 17.3 kB | 15.3 kB |
|
|
191
|
-
| `table` |
|
|
195
|
+
| `table` | 541.3 kB | 173.3 kB | 145.8 kB |
|
|
192
196
|
| `table-nuqs` | 2.1 kB | 1.1 kB | 1.0 kB |
|
|
193
|
-
| `tabs` | 80.
|
|
194
|
-
| `textarea` | 98.2 kB | 34.2 kB | 29.
|
|
195
|
-
| `toast` | 189.5 kB | 65.2 kB | 56.
|
|
197
|
+
| `tabs` | 80.3 kB | 27.6 kB | 24.5 kB |
|
|
198
|
+
| `textarea` | 98.2 kB | 34.2 kB | 29.6 kB |
|
|
199
|
+
| `toast` | 189.5 kB | 65.2 kB | 56.6 kB |
|
|
196
200
|
| `toggle` | 46.1 kB | 15.7 kB | 13.8 kB |
|
|
197
201
|
| `toggle-group` | 67.1 kB | 23.0 kB | 20.3 kB |
|
|
198
202
|
| `tool-activity` | 86.7 kB | 29.2 kB | 25.2 kB |
|
|
199
|
-
| `toolbar-status` | 189.3 kB | 64.3 kB | 55.
|
|
203
|
+
| `toolbar-status` | 189.3 kB | 64.3 kB | 55.5 kB |
|
|
200
204
|
| `tooltip` | 164.7 kB | 56.7 kB | 49.4 kB |
|
|
201
205
|
| `typed-text` | 31.2 kB | 10.1 kB | 8.8 kB |
|
|
206
|
+
| `view-switcher` | 270.2 kB | 90.6 kB | 77.1 kB |
|
|
202
207
|
|
|
203
208
|
</details>
|
|
204
209
|
<!-- bundle-size:end -->
|
|
@@ -210,7 +215,7 @@ CI compares sizes on each pull request. Run `pnpm size` to see them locally.
|
|
|
210
215
|
| **Actions** | Button · Button Group · Toggle · Toggle Group · Toolbar Status · Kbd |
|
|
211
216
|
| **Forms** | Field · Form · Label · Input · Input Group · Input OTP · Textarea · Checkbox · Radio Group · Switch · Slider · Select · Combobox · Choice List · Calendar · Search Field · Rich Text Editor · Mention List · Questionnaire · Selection Slot · Reasoning Effort |
|
|
212
217
|
| **Overlays** | Dialog · Alert Dialog · Sheet · Popover · Hover Card · Tooltip · Dropdown Menu · Context Menu · Menubar · Command · Search Dialog · Toast |
|
|
213
|
-
| **Layout & navigation** | Sidebar · Navigation Menu · Breadcrumb · Pagination · Tabs · Accordion · Collapsible · Page Header · Page Content · Settings List · Card · Carousel · Resizable · Scroll Area · Separator · Aspect Ratio · Direction · Canvas
|
|
218
|
+
| **Layout & navigation** | Sidebar · Navigation Menu · Breadcrumb · Pagination · Tabs · View Switcher · Accordion · Collapsible · Page Header · Page Content · Settings List · Card · Carousel · Resizable · Scroll Area · Separator · Aspect Ratio · Direction · Canvas |
|
|
214
219
|
| **Feedback** | Alert · Notice Banner · Badge · Progress · Spinner · Skeleton · State Panel · State Sample |
|
|
215
220
|
| **Data display** | Table · Chart · Code Block · File Viewer · Schema Diagram · Avatar · Brand Icon · Attachment · Typed Text · Gradient Banner · Glass Banner |
|
|
216
221
|
| **Agents & chat** | Message · Message Actions · Message Response · Message Scroller · Chat Confirmation · Chat Plan · Chat Sources · Plan Outline · Prompt List · Result Card · Review Card · Tool Activity |
|
|
@@ -229,7 +234,7 @@ Presets live in `@tulipfarm/sprout/themes/*`: `neutral`, `tulipfarm`, `github`,
|
|
|
229
234
|
`linear`, `vercel`, `stripe`, `notion`, and more.
|
|
230
235
|
|
|
231
236
|
```css
|
|
232
|
-
@import
|
|
237
|
+
@import '@tulipfarm/sprout/themes/tulipfarm.css';
|
|
233
238
|
```
|
|
234
239
|
|
|
235
240
|
### shadcn
|
|
@@ -252,7 +257,7 @@ After you change package code, run `pnpm --filter @tulipfarm/sprout build`.
|
|
|
252
257
|
```sh
|
|
253
258
|
pnpm build
|
|
254
259
|
pnpm typecheck
|
|
255
|
-
pnpm format
|
|
260
|
+
pnpm lint # Oxfmt check and Oxlint; `pnpm format` fixes formatting
|
|
256
261
|
pnpm test
|
|
257
262
|
pnpm exec playwright install chromium
|
|
258
263
|
pnpm test:browser
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Accordion as BaseAccordion } from
|
|
1
|
+
import { Accordion as BaseAccordion } from '@base-ui/react/accordion';
|
|
2
2
|
export declare const accordionTriggerVariantNames: readonly ["default", "quiet"];
|
|
3
3
|
export type AccordionTriggerVariant = (typeof accordionTriggerVariantNames)[number];
|
|
4
4
|
export type AccordionProps<Value = any> = BaseAccordion.Root.Props<Value>;
|
|
@@ -20,7 +20,7 @@ export interface AccordionTriggerProps extends BaseAccordion.Trigger.Props {
|
|
|
20
20
|
}
|
|
21
21
|
/** The heading button that opens and closes its section. */
|
|
22
22
|
export declare function AccordionTrigger({ className, children, variant, ...props }: AccordionTriggerProps): import("react").JSX.Element;
|
|
23
|
-
export interface AccordionContentProps extends Omit<BaseAccordion.Panel.Props,
|
|
23
|
+
export interface AccordionContentProps extends Omit<BaseAccordion.Panel.Props, 'className'> {
|
|
24
24
|
/** Classes for the padded inner box that holds the content. */
|
|
25
25
|
className?: string;
|
|
26
26
|
}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Accordion as BaseAccordion } from
|
|
4
|
-
import { ChevronDown } from
|
|
5
|
-
import { cn, stateClassName } from
|
|
6
|
-
export const accordionTriggerVariantNames = [
|
|
3
|
+
import { Accordion as BaseAccordion } from '@base-ui/react/accordion';
|
|
4
|
+
import { ChevronDown } from 'reicon-react/icons/ChevronDown';
|
|
5
|
+
import { cn, stateClassName } from '../internal/classes.js';
|
|
6
|
+
export const accordionTriggerVariantNames = ['default', 'quiet'];
|
|
7
7
|
/**
|
|
8
8
|
* A stack of sections that open in place. One section opens at a time unless
|
|
9
9
|
* you pass `multiple`. Pass `value` and `onValueChange` to control which
|
|
10
10
|
* sections are open, or `defaultValue` to let it manage itself.
|
|
11
11
|
*/
|
|
12
12
|
export function Accordion({ className, ...props }) {
|
|
13
|
-
return (_jsx(BaseAccordion.Root, { "data-slot": "accordion", ...props, className: stateClassName(
|
|
13
|
+
return (_jsx(BaseAccordion.Root, { "data-slot": "accordion", ...props, className: stateClassName('sprout-accordion', className) }));
|
|
14
14
|
}
|
|
15
15
|
/** One section. Give it a `value` to open it by default or to control it. */
|
|
16
16
|
export function AccordionItem({ className, ...props }) {
|
|
17
|
-
return (_jsx(BaseAccordion.Item, { "data-slot": "accordion-item", ...props, className: stateClassName(
|
|
17
|
+
return (_jsx(BaseAccordion.Item, { "data-slot": "accordion-item", ...props, className: stateClassName('sprout-accordion-item', className) }));
|
|
18
18
|
}
|
|
19
19
|
/** The heading button that opens and closes its section. */
|
|
20
|
-
export function AccordionTrigger({ className, children, variant =
|
|
20
|
+
export function AccordionTrigger({ className, children, variant = 'default', ...props }) {
|
|
21
21
|
return (_jsx(BaseAccordion.Header, { "data-slot": "accordion-header", className: "sprout-accordion-header", children: _jsxs(BaseAccordion.Trigger, { "data-slot": "accordion-trigger", "data-variant": variant, ...props, className: stateClassName(`sprout-accordion-trigger sprout-accordion-trigger-${variant}`, className), children: [children, _jsx(ChevronDown, { size: 16, "aria-hidden": "true", "data-slot": "accordion-trigger-icon", className: "sprout-accordion-trigger-icon" })] }) }));
|
|
22
22
|
}
|
|
23
23
|
/** The section body. It grows open and shrinks closed. */
|
|
24
24
|
export function AccordionContent({ className, children, ...props }) {
|
|
25
|
-
return (_jsx(BaseAccordion.Panel, { "data-slot": "accordion-content", ...props, className: "sprout-accordion-content", children: _jsx("div", { className: cn(
|
|
25
|
+
return (_jsx(BaseAccordion.Panel, { "data-slot": "accordion-content", ...props, className: "sprout-accordion-content", children: _jsx("div", { className: cn('sprout-accordion-content-inner', className), children: children }) }));
|
|
26
26
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ReactNode } from
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
2
|
export declare const agentFanoutStatusNames: readonly ["queued", "working", "done", "failed", "stopped"];
|
|
3
3
|
export declare const agentFanoutStateNames: readonly ["running", "done", "stopped"];
|
|
4
4
|
export type AgentFanoutStatus = (typeof agentFanoutStatusNames)[number];
|
|
@@ -15,7 +15,7 @@ export interface AgentFanoutAgent {
|
|
|
15
15
|
status: AgentFanoutStatus;
|
|
16
16
|
/** How long the subagent took, in ms. Shown once it is done. */
|
|
17
17
|
duration?: number | undefined;
|
|
18
|
-
/** Any CSS color. Defaults to the next of
|
|
18
|
+
/** Any CSS color. Defaults to the next of ten `--sprout-chart-*` colors. */
|
|
19
19
|
color?: string | undefined;
|
|
20
20
|
/** Subagents this agent calls in turn. They take its color. */
|
|
21
21
|
agents?: AgentFanoutAgent[] | undefined;
|
|
@@ -1,58 +1,52 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { BaseEdge, EdgeLabelRenderer, Handle, Position, ReactFlow, } from
|
|
4
|
-
import { useLayoutEffect, useRef, useState
|
|
5
|
-
import { Check } from
|
|
6
|
-
import { ChevronDown } from
|
|
7
|
-
import { Danger } from
|
|
8
|
-
import { MinusCircle } from
|
|
9
|
-
import { RotateLeft } from
|
|
10
|
-
import { Sparkle } from
|
|
11
|
-
import { cn } from
|
|
12
|
-
import { Button } from
|
|
13
|
-
import { Collapsible, CollapsibleContent, CollapsibleTrigger
|
|
14
|
-
export const agentFanoutStatusNames = [
|
|
15
|
-
|
|
16
|
-
"working",
|
|
17
|
-
"done",
|
|
18
|
-
"failed",
|
|
19
|
-
"stopped",
|
|
20
|
-
];
|
|
21
|
-
export const agentFanoutStateNames = ["running", "done", "stopped"];
|
|
3
|
+
import { BaseEdge, EdgeLabelRenderer, Handle, Position, ReactFlow, } from '@xyflow/react';
|
|
4
|
+
import { useLayoutEffect, useRef, useState } from 'react';
|
|
5
|
+
import { Check } from 'reicon-react/icons/Check';
|
|
6
|
+
import { ChevronDown } from 'reicon-react/icons/ChevronDown';
|
|
7
|
+
import { Danger } from 'reicon-react/icons/Danger';
|
|
8
|
+
import { MinusCircle } from 'reicon-react/icons/MinusCircle';
|
|
9
|
+
import { RotateLeft } from 'reicon-react/icons/RotateLeft';
|
|
10
|
+
import { Sparkle } from 'reicon-react/icons/Sparkle';
|
|
11
|
+
import { cn } from '../internal/classes.js';
|
|
12
|
+
import { Button } from './button.js';
|
|
13
|
+
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from './collapsible.js';
|
|
14
|
+
export const agentFanoutStatusNames = ['queued', 'working', 'done', 'failed', 'stopped'];
|
|
15
|
+
export const agentFanoutStateNames = ['running', 'done', 'stopped'];
|
|
22
16
|
const rootTop = 12;
|
|
23
17
|
const rootSize = 44;
|
|
24
18
|
const levelTop = 120;
|
|
25
19
|
const levelGap = 108;
|
|
26
20
|
const nodeLabel = 22;
|
|
27
21
|
const bottomGap = 36;
|
|
28
|
-
const colorCount =
|
|
22
|
+
const colorCount = 10;
|
|
29
23
|
const statusText = {
|
|
30
|
-
queued:
|
|
31
|
-
working:
|
|
32
|
-
done:
|
|
33
|
-
failed:
|
|
34
|
-
stopped:
|
|
24
|
+
queued: 'Queued',
|
|
25
|
+
working: 'Working',
|
|
26
|
+
done: 'Done',
|
|
27
|
+
failed: 'Failed',
|
|
28
|
+
stopped: 'Stopped',
|
|
35
29
|
};
|
|
36
30
|
const seconds = (ms) => `${(ms / 1000).toFixed(1)}s`;
|
|
37
31
|
function phaseText(agents, state, elapsed) {
|
|
38
|
-
const time = elapsed === undefined ?
|
|
39
|
-
if (state ===
|
|
40
|
-
const merged = agents.filter(
|
|
32
|
+
const time = elapsed === undefined ? '' : seconds(elapsed);
|
|
33
|
+
if (state === 'done') {
|
|
34
|
+
const merged = agents.filter(agent => agent.status === 'done').length;
|
|
41
35
|
return {
|
|
42
|
-
text: `Merged ${merged} ${merged === 1 ?
|
|
43
|
-
time:
|
|
36
|
+
text: `Merged ${merged} ${merged === 1 ? 'result' : 'results'}${time && ` in ${time}`}`,
|
|
37
|
+
time: '',
|
|
44
38
|
};
|
|
45
39
|
}
|
|
46
|
-
if (state ===
|
|
47
|
-
return { text: time ? `Stopped after ${time}` :
|
|
48
|
-
const settled = agents.filter(
|
|
49
|
-
const text = agents.every(
|
|
50
|
-
?
|
|
40
|
+
if (state === 'stopped')
|
|
41
|
+
return { text: time ? `Stopped after ${time}` : 'Stopped', time: '' };
|
|
42
|
+
const settled = agents.filter(agent => agent.status === 'done' || agent.status === 'failed').length;
|
|
43
|
+
const text = agents.every(agent => agent.status === 'queued')
|
|
44
|
+
? 'Delegating work'
|
|
51
45
|
: settled === agents.length
|
|
52
|
-
?
|
|
46
|
+
? 'Composing answer'
|
|
53
47
|
: settled > 0
|
|
54
|
-
?
|
|
55
|
-
:
|
|
48
|
+
? 'Merging results'
|
|
49
|
+
: 'Specialists working';
|
|
56
50
|
return { text, time };
|
|
57
51
|
}
|
|
58
52
|
function useWidth() {
|
|
@@ -79,31 +73,22 @@ function flatten(agents, initial, parent = rootId, depth = 1, color) {
|
|
|
79
73
|
parent,
|
|
80
74
|
depth,
|
|
81
75
|
changed: changed || undefined,
|
|
82
|
-
trip: !changed
|
|
83
|
-
? null
|
|
84
|
-
: agent.status === "working"
|
|
85
|
-
? "out"
|
|
86
|
-
: agent.status === "done"
|
|
87
|
-
? "back"
|
|
88
|
-
: null,
|
|
76
|
+
trip: !changed ? null : agent.status === 'working' ? 'out' : agent.status === 'done' ? 'back' : null,
|
|
89
77
|
style: {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
78
|
+
'--sprout-agent-fanout-color': own,
|
|
79
|
+
'--sprout-agent-fanout-index': index,
|
|
80
|
+
'--sprout-agent-fanout-depth': depth - 1,
|
|
93
81
|
},
|
|
94
82
|
};
|
|
95
|
-
return [
|
|
96
|
-
line,
|
|
97
|
-
...flatten(agent.agents ?? [], initial, agent.id, depth + 1, own),
|
|
98
|
-
];
|
|
83
|
+
return [line, ...flatten(agent.agents ?? [], initial, agent.id, depth + 1, own)];
|
|
99
84
|
});
|
|
100
85
|
}
|
|
101
|
-
const rootId =
|
|
86
|
+
const rootId = 'agent-fanout-root';
|
|
102
87
|
// Fresh node objects every render drop React Flow's measured handles, which
|
|
103
88
|
// unmounts the edges and restarts their pulses. Declared handles survive.
|
|
104
89
|
const handle = (type, x, y) => ({
|
|
105
90
|
type,
|
|
106
|
-
position: type ===
|
|
91
|
+
position: type === 'source' ? Position.Bottom : Position.Top,
|
|
107
92
|
x,
|
|
108
93
|
y,
|
|
109
94
|
width: 0,
|
|
@@ -114,49 +99,46 @@ function layout(lines, width, state, rootChanged) {
|
|
|
114
99
|
const children = new Map();
|
|
115
100
|
for (const line of lines)
|
|
116
101
|
children.set(line.parent, [...(children.get(line.parent) ?? []), line]);
|
|
117
|
-
const leaves = lines.filter(
|
|
102
|
+
const leaves = lines.filter(line => !children.has(line.agent.id)).length;
|
|
118
103
|
const column = width / Math.max(leaves, 1);
|
|
119
104
|
const centers = new Map();
|
|
120
105
|
let leaf = 0;
|
|
121
106
|
const place = (id) => {
|
|
122
107
|
const kids = children.get(id);
|
|
123
|
-
const xs = kids?.map(
|
|
108
|
+
const xs = kids?.map(kid => place(kid.agent.id));
|
|
124
109
|
const x = xs ? (xs[0] + xs.at(-1)) / 2 : (leaf++ + 0.5) * column;
|
|
125
110
|
centers.set(id, x);
|
|
126
111
|
return x;
|
|
127
112
|
};
|
|
128
113
|
place(rootId);
|
|
129
|
-
const depth = Math.max(0, ...lines.map(
|
|
114
|
+
const depth = Math.max(0, ...lines.map(line => line.depth));
|
|
130
115
|
const dot = width ? Math.min(40, Math.max(28, column - 12)) : 40;
|
|
131
116
|
const nodes = [
|
|
132
117
|
{
|
|
133
118
|
id: rootId,
|
|
134
|
-
type:
|
|
119
|
+
type: 'root',
|
|
135
120
|
position: { x: width / 2 - rootSize / 2, y: rootTop },
|
|
136
121
|
width: rootSize,
|
|
137
122
|
height: rootSize,
|
|
138
|
-
handles: [handle(
|
|
123
|
+
handles: [handle('source', rootSize / 2, rootSize)],
|
|
139
124
|
data: { state, changed: rootChanged },
|
|
140
125
|
},
|
|
141
126
|
...lines.map((line) => ({
|
|
142
127
|
id: line.agent.id,
|
|
143
|
-
type:
|
|
128
|
+
type: 'agent',
|
|
144
129
|
position: {
|
|
145
130
|
x: centers.get(line.agent.id) - column / 2,
|
|
146
131
|
y: levelTop + (line.depth - 1) * levelGap,
|
|
147
132
|
},
|
|
148
133
|
width: column,
|
|
149
134
|
height: dot + nodeLabel,
|
|
150
|
-
handles: [
|
|
151
|
-
handle("target", column / 2, 0),
|
|
152
|
-
handle("source", column / 2, dot),
|
|
153
|
-
],
|
|
135
|
+
handles: [handle('target', column / 2, 0), handle('source', column / 2, dot)],
|
|
154
136
|
data: line,
|
|
155
137
|
})),
|
|
156
138
|
];
|
|
157
|
-
const edges = lines.map(
|
|
139
|
+
const edges = lines.map(line => ({
|
|
158
140
|
id: `${line.parent}-${line.agent.id}`,
|
|
159
|
-
type:
|
|
141
|
+
type: 'trip',
|
|
160
142
|
source: line.parent,
|
|
161
143
|
target: line.agent.id,
|
|
162
144
|
data: { trip: line.trip, style: line.style },
|
|
@@ -165,20 +147,16 @@ function layout(lines, width, state, rootChanged) {
|
|
|
165
147
|
nodes,
|
|
166
148
|
edges,
|
|
167
149
|
dot,
|
|
168
|
-
height: levelTop +
|
|
169
|
-
Math.max(depth - 1, 0) * levelGap +
|
|
170
|
-
dot +
|
|
171
|
-
nodeLabel +
|
|
172
|
-
bottomGap,
|
|
150
|
+
height: levelTop + Math.max(depth - 1, 0) * levelGap + dot + nodeLabel + bottomGap,
|
|
173
151
|
};
|
|
174
152
|
}
|
|
175
153
|
function RootMark({ data: { state, changed } }) {
|
|
176
|
-
return (_jsxs("span", { "data-slot": "agent-fanout-root", "data-state": state, "data-changed": changed, className: "sprout-agent-fanout-root", children: [state ===
|
|
154
|
+
return (_jsxs("span", { "data-slot": "agent-fanout-root", "data-state": state, "data-changed": changed, className: "sprout-agent-fanout-root", children: [state === 'done' ? _jsx(Check, { size: 18 }) : state === 'stopped' ? _jsx(MinusCircle, { size: 18 }) : _jsx(Sparkle, { size: 18 }), _jsx(Handle, { type: "source", position: Position.Bottom, isConnectable: false, className: "sprout-agent-fanout-handle" })] }));
|
|
177
155
|
}
|
|
178
156
|
function AgentMark({ data: { agent, changed, style } }) {
|
|
179
157
|
return (_jsxs("div", { "data-slot": "agent-fanout-node", "data-status": agent.status, "data-changed": changed, className: "sprout-agent-fanout-node", style: style, children: [_jsxs("span", { className: "sprout-agent-fanout-dot", children: [_jsx(NodeMark, { agent: agent }), _jsx(Handle, { type: "target", position: Position.Top, isConnectable: false, className: "sprout-agent-fanout-handle" }), agent.agents && agent.agents.length > 0 && (_jsx(Handle, { type: "source", position: Position.Bottom, isConnectable: false, className: "sprout-agent-fanout-handle" }))] }), _jsx("span", { className: "sprout-agent-fanout-node-name", children: agent.name })] }));
|
|
180
158
|
}
|
|
181
|
-
function TripLine({ id, sourceX, sourceY, targetX, targetY, data
|
|
159
|
+
function TripLine({ id, sourceX, sourceY, targetX, targetY, data }) {
|
|
182
160
|
const drop = targetY - sourceY;
|
|
183
161
|
const d = `M ${sourceX} ${sourceY} C ${sourceX} ${sourceY + drop * 0.5}, ${targetX} ${sourceY + drop * 0.2}, ${targetX} ${targetY}`;
|
|
184
162
|
const trip = data?.trip;
|
|
@@ -188,16 +166,16 @@ const nodeTypes = { root: RootMark, agent: AgentMark };
|
|
|
188
166
|
const edgeTypes = { trip: TripLine };
|
|
189
167
|
const viewport = { x: 0, y: 0, zoom: 1 };
|
|
190
168
|
function NodeMark({ agent }) {
|
|
191
|
-
if (agent.status ===
|
|
192
|
-
return _jsx(Check, { size: 16, "aria-hidden": "true" });
|
|
193
|
-
if (agent.status ===
|
|
169
|
+
if (agent.status === 'done')
|
|
170
|
+
return _jsx(Check, { size: 16, strokeWidth: 2.5, "aria-hidden": "true" });
|
|
171
|
+
if (agent.status === 'failed')
|
|
194
172
|
return _jsx(Danger, { size: 16, "aria-hidden": "true" });
|
|
195
173
|
return _jsx("span", { "aria-hidden": "true", children: agent.icon });
|
|
196
174
|
}
|
|
197
175
|
function StatusMark({ agent }) {
|
|
198
|
-
if (agent.status ===
|
|
199
|
-
return (_jsxs(_Fragment, { children: [_jsx(Check, { size: 12, "aria-hidden": "true" }), agent.duration === undefined ?
|
|
200
|
-
if (agent.status ===
|
|
176
|
+
if (agent.status === 'done')
|
|
177
|
+
return (_jsxs(_Fragment, { children: [_jsx(Check, { size: 12, "aria-hidden": "true" }), agent.duration === undefined ? 'Done' : seconds(agent.duration)] }));
|
|
178
|
+
if (agent.status === 'working')
|
|
201
179
|
return (_jsxs(_Fragment, { children: [_jsx("span", { "aria-hidden": "true", className: "sprout-agent-fanout-pulse" }), "Working"] }));
|
|
202
180
|
return _jsx(_Fragment, { children: statusText[agent.status] });
|
|
203
181
|
}
|
|
@@ -206,7 +184,7 @@ function StatusMark({ agent }) {
|
|
|
206
184
|
* they find. Each status change sends a pulse along the subagent's line:
|
|
207
185
|
* down when it starts, back up when it finishes.
|
|
208
186
|
*/
|
|
209
|
-
export function AgentFanout({ task, agents, state =
|
|
187
|
+
export function AgentFanout({ task, agents, state = 'running', elapsed, label, defaultOpen = false, onStop, onRestart, className, }) {
|
|
210
188
|
const [graphRef, width] = useWidth();
|
|
211
189
|
// Only changes after the first render animate, so a finished fanout
|
|
212
190
|
// renders still instead of replaying every pulse.
|
|
@@ -217,12 +195,12 @@ export function AgentFanout({ task, agents, state = "running", elapsed, label, d
|
|
|
217
195
|
const phase = phaseText(agents, state, elapsed);
|
|
218
196
|
const lines = flatten(agents, initial.statuses);
|
|
219
197
|
const graph = layout(lines, width, state, initial.state !== state || undefined);
|
|
220
|
-
const finished = lines.filter(({ agent }) => agent.status ===
|
|
221
|
-
return (_jsxs("section", { "data-slot": "agent-fanout", "data-state": state, "aria-label": "Subagents", className: cn(
|
|
198
|
+
const finished = lines.filter(({ agent }) => agent.status === 'done' || agent.status === 'failed').length;
|
|
199
|
+
return (_jsxs("section", { "data-slot": "agent-fanout", "data-state": state, "aria-label": "Subagents", className: cn('sprout-agent-fanout', className), children: [_jsxs("div", { className: "sprout-agent-fanout-panel", children: [_jsx("div", { className: "sprout-agent-fanout-task", children: _jsx("span", { className: "sprout-agent-fanout-task-text", children: task }) }), _jsx("div", { ref: graphRef, "aria-hidden": "true", "data-slot": "agent-fanout-graph", className: "sprout-agent-fanout-graph", style: {
|
|
222
200
|
height: graph.height,
|
|
223
|
-
|
|
201
|
+
'--sprout-agent-fanout-dot': `${graph.dot}px`,
|
|
224
202
|
}, children: width > 0 && (_jsx(ReactFlow, { className: "sprout-agent-fanout-flow", nodes: graph.nodes, edges: graph.edges, nodeTypes: nodeTypes, edgeTypes: edgeTypes, defaultViewport: viewport, minZoom: 1, maxZoom: 1, panOnDrag: false, panOnScroll: false, zoomOnScroll: false, zoomOnPinch: false, zoomOnDoubleClick: false, preventScrolling: false, nodesDraggable: false, nodesConnectable: false, nodesFocusable: false, edgesFocusable: false, elementsSelectable: false, proOptions: { hideAttribution: true } })) }), _jsxs(Collapsible, { defaultOpen: defaultOpen, className: "sprout-agent-fanout-details", children: [_jsxs(CollapsibleTrigger, { className: "sprout-agent-fanout-trigger", children: [_jsx("span", { className: "sprout-agent-fanout-trigger-label", children: "Details" }), _jsx("span", { className: "sprout-agent-fanout-trigger-count", children: `${finished} of ${lines.length} finished` }), _jsx(ChevronDown, { size: 14, "aria-hidden": "true", "data-slot": "collapsible-indicator" })] }), _jsx(CollapsibleContent, { keepMounted: true, children: _jsx("ul", { "aria-label": "Subagent status", className: "sprout-agent-fanout-rows", children: lines.map(({ agent, changed, style }) => {
|
|
225
|
-
const settled = agent.status ===
|
|
226
|
-
return (_jsxs("li", { "data-slot": "agent-fanout-row", "data-status": agent.status, className: "sprout-agent-fanout-row", style: style, children: [_jsx("span", { className: "sprout-agent-fanout-row-name", children: agent.name }), _jsx("span", { "data-changed": changed, className: "sprout-agent-fanout-row-detail", children: settled && agent.result ? agent.result : agent.task }, settled && agent.result ?
|
|
227
|
-
}) }) })] })] }), _jsxs("div", { className: "sprout-agent-fanout-footer", children: [_jsxs("p", { className: "sprout-agent-fanout-phase", children: [_jsx("span", { role: "status", children: label ?? phase.text }), !label && phase.time &&
|
|
203
|
+
const settled = agent.status === 'done' || agent.status === 'failed';
|
|
204
|
+
return (_jsxs("li", { "data-slot": "agent-fanout-row", "data-status": agent.status, className: "sprout-agent-fanout-row", style: style, children: [_jsx("span", { className: "sprout-agent-fanout-row-name", children: agent.name }), _jsx("span", { "data-changed": changed, className: "sprout-agent-fanout-row-detail", children: settled && agent.result ? agent.result : agent.task }, settled && agent.result ? 'result' : 'task'), _jsx("span", { "data-changed": changed, className: "sprout-agent-fanout-row-status", children: _jsx(StatusMark, { agent: agent }) }, agent.status)] }, agent.id));
|
|
205
|
+
}) }) })] })] }), _jsxs("div", { className: "sprout-agent-fanout-footer", children: [_jsxs("p", { className: "sprout-agent-fanout-phase", children: [_jsx("span", { role: "status", children: label ?? phase.text }), !label && phase.time && _jsx("span", { className: "sprout-agent-fanout-time", children: phase.time })] }), state === 'running' && onStop && (_jsxs(Button, { variant: "outline", size: "sm", onClick: onStop, className: "sprout-agent-fanout-action", children: [_jsx(MinusCircle, { size: 14, "aria-hidden": "true" }), "Stop"] })), state !== 'running' && onRestart && (_jsxs(Button, { variant: "outline", size: "sm", onClick: onRestart, className: "sprout-agent-fanout-action", children: [_jsx(RotateLeft, { size: 14, "aria-hidden": "true" }), "Run again"] }))] })] }));
|
|
228
206
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AlertDialog as AlertDialogPrimitive } from
|
|
2
|
-
import { useRender } from
|
|
3
|
-
import { type ButtonProps, type ButtonSize, type ButtonVariant } from
|
|
1
|
+
import { AlertDialog as AlertDialogPrimitive } from '@base-ui/react/alert-dialog';
|
|
2
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
+
import { type ButtonProps, type ButtonSize, type ButtonVariant } from './button.js';
|
|
4
4
|
export declare const alertDialogSizeNames: readonly ["default", "sm"];
|
|
5
5
|
export type AlertDialogSize = (typeof alertDialogSizeNames)[number];
|
|
6
6
|
export type AlertDialogProps = AlertDialogPrimitive.Root.Props;
|
|
@@ -15,18 +15,18 @@ export interface AlertDialogContentProps extends AlertDialogPrimitive.Popup.Prop
|
|
|
15
15
|
/** `sm` centers the header and splits the footer into two equal buttons. */
|
|
16
16
|
size?: AlertDialogSize;
|
|
17
17
|
/** Where the portal renders. Defaults to `document.body`. */
|
|
18
|
-
container?: AlertDialogPrimitive.Portal.Props[
|
|
18
|
+
container?: AlertDialogPrimitive.Portal.Props['container'];
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
21
|
* The alert dialog surface. It renders its own portal and overlay, so place
|
|
22
22
|
* it directly inside `AlertDialog`.
|
|
23
23
|
*/
|
|
24
24
|
export declare function AlertDialogContent({ className, size, container, ...props }: AlertDialogContentProps): import("react").JSX.Element;
|
|
25
|
-
type PartSlot =
|
|
25
|
+
type PartSlot = 'alert-dialog-header' | 'alert-dialog-footer' | 'alert-dialog-media';
|
|
26
26
|
export interface AlertDialogPartState extends Record<string, unknown> {
|
|
27
27
|
slot: PartSlot;
|
|
28
28
|
}
|
|
29
|
-
export type AlertDialogPartProps = useRender.ComponentProps<
|
|
29
|
+
export type AlertDialogPartProps = useRender.ComponentProps<'div', AlertDialogPartState>;
|
|
30
30
|
/**
|
|
31
31
|
* Groups media, title, and description. Centered on narrow screens and in
|
|
32
32
|
* `sm` dialogs; from 640px a `default` dialog aligns it to the start with the
|