@visulima/tui-kit 1.0.2 → 1.0.4
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/CHANGELOG.md +15 -0
- package/dist/accordion.js +1 -1
- package/dist/alert.js +1 -1
- package/dist/animate-presence.js +1 -1
- package/dist/approval-prompt.js +1 -1
- package/dist/area-chart.js +1 -1
- package/dist/badge.js +1 -1
- package/dist/bar-chart.js +1 -1
- package/dist/big-text.js +1 -1
- package/dist/blink-dot.js +1 -1
- package/dist/breadcrumb.js +1 -1
- package/dist/button.js +1 -1
- package/dist/calendar.js +1 -1
- package/dist/card.js +1 -1
- package/dist/checkbox-group.js +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/code.js +2 -2
- package/dist/collapsible.js +1 -1
- package/dist/color-picker.js +1 -1
- package/dist/command-block.js +4 -4
- package/dist/command-palette.js +1 -1
- package/dist/confirm-dialog.js +1 -1
- package/dist/confirm-input.js +1 -1
- package/dist/console-overlay.js +1 -1
- package/dist/content-switcher.js +1 -1
- package/dist/controlled-scroll-view.d.ts +43 -3
- package/dist/controlled-scroll-view.js +1 -1
- package/dist/data-grid.js +1 -1
- package/dist/date-picker.js +1 -1
- package/dist/definition-list.js +1 -1
- package/dist/dialog.d.ts +1 -1
- package/dist/dialog.js +1 -1
- package/dist/diff-view.js +1 -1
- package/dist/digits.js +1 -1
- package/dist/directory-tree.js +1 -1
- package/dist/divider.js +1 -1
- package/dist/drawer.js +1 -1
- package/dist/file-change.js +1 -1
- package/dist/file-picker-entry.d.ts +92 -2
- package/dist/file-picker-entry.js +1 -1
- package/dist/form.js +1 -1
- package/dist/gauge.js +1 -1
- package/dist/gradient.js +1 -1
- package/dist/grid.js +1 -1
- package/dist/heading.js +1 -1
- package/dist/heatmap.js +1 -1
- package/dist/help.js +1 -1
- package/dist/histogram.js +1 -1
- package/dist/image.js +1 -1
- package/dist/index.d.ts +25 -9
- package/dist/index.js +1 -1
- package/dist/json.js +1 -1
- package/dist/kbd.js +1 -1
- package/dist/line-chart.js +1 -1
- package/dist/link.js +1 -1
- package/dist/loading-indicator.js +1 -1
- package/dist/log.js +1 -1
- package/dist/markdown.js +1 -1
- package/dist/masked-input.js +1 -1
- package/dist/menu.js +1 -1
- package/dist/message-bubble.js +1 -1
- package/dist/model-badge.js +1 -1
- package/dist/model-selector.js +1 -1
- package/dist/multi-progress.js +1 -1
- package/dist/multi-select.js +1 -1
- package/dist/notification-badge.js +1 -1
- package/dist/number-input.js +1 -1
- package/dist/operation-tree.js +1 -1
- package/dist/option-list.js +1 -1
- package/dist/ordered-list.js +1 -1
- package/dist/packem_shared/ControlledScrollView-soZtm3m7.js +1 -0
- package/dist/packem_shared/FilePicker-KGAg6v5x.js +1 -0
- package/dist/packem_shared/ScrollBar-arHRP6OT.js +1 -0
- package/dist/packem_shared/ScrollBarBox-C8wZ_Slk.js +1 -0
- package/dist/packem_shared/ScrollList-BCqHHps6.js +1 -0
- package/dist/packem_shared/ScrollView-Dt5E9Yl7.js +1 -0
- package/dist/packem_shared/TreeNodeMap-BK7nRlt0.js +1 -0
- package/dist/packem_shared/TreeView-BEZAFOfr.js +1 -0
- package/dist/packem_shared/controlled-scroll-view-BHCYjiKa.js +1 -0
- package/dist/packem_shared/line-chart-BqOUjZTt.js +1 -0
- package/dist/packem_shared/treeViewTheme-DuCcyBDe.js +1 -0
- package/dist/packem_shared/useTreeView-Dt_iWxVs.js +1 -0
- package/dist/packem_shared/useTreeViewState-aHwNZhIE.js +1 -0
- package/dist/packem_shared/{variant-config-BJqpNo7H.js → variant-config-BnAmf1rP.js} +1 -1
- package/dist/paginator.js +1 -1
- package/dist/paragraph.js +1 -1
- package/dist/path-input.js +1 -1
- package/dist/pie-chart.js +1 -1
- package/dist/placeholder.js +1 -1
- package/dist/popover.js +1 -1
- package/dist/progress-bar.js +1 -1
- package/dist/progress-circle.js +1 -1
- package/dist/qr-code.js +1 -1
- package/dist/r/registry.json +9 -0
- package/dist/r/reset.d.json +22 -0
- package/dist/radio-group.js +1 -1
- package/dist/scatter-plot.js +1 -1
- package/dist/scroll-bar-box.d.ts +13 -3
- package/dist/scroll-bar-box.js +1 -1
- package/dist/scroll-bar.d.ts +18 -3
- package/dist/scroll-bar.js +1 -1
- package/dist/scroll-list.d.ts +12 -3
- package/dist/scroll-list.js +1 -1
- package/dist/scroll-view.d.ts +98 -3
- package/dist/scroll-view.js +1 -1
- package/dist/search-input.js +1 -1
- package/dist/select-input-indicator.js +1 -1
- package/dist/select-input-item.js +1 -1
- package/dist/select-input.js +1 -1
- package/dist/shimmer-text.js +1 -1
- package/dist/sidebar.js +1 -1
- package/dist/slider.js +1 -1
- package/dist/sparkline.js +1 -1
- package/dist/spinner.js +1 -1
- package/dist/status-line.js +1 -1
- package/dist/status-message.js +1 -1
- package/dist/stepper.js +1 -1
- package/dist/stopwatch.js +1 -1
- package/dist/streaming-text.js +1 -1
- package/dist/switch.js +1 -1
- package/dist/tab.js +1 -1
- package/dist/table.js +1 -1
- package/dist/tabs.js +1 -1
- package/dist/tag-input.js +1 -1
- package/dist/tag.js +1 -1
- package/dist/text-input.js +1 -1
- package/dist/textarea.js +2 -2
- package/dist/thinking-block.js +1 -1
- package/dist/time-picker.js +1 -1
- package/dist/timer.js +1 -1
- package/dist/toast.js +1 -1
- package/dist/token-usage.js +1 -1
- package/dist/tool-call.js +1 -1
- package/dist/tooltip.js +1 -1
- package/dist/transition.js +1 -1
- package/dist/tree-select.js +1 -1
- package/dist/tree-view-entry.d.ts +314 -4
- package/dist/tree-view-entry.js +1 -1
- package/dist/unordered-list.js +1 -1
- package/dist/use-linked-scroll.d.ts +1 -1
- package/dist/use-linked-scroll.js +1 -1
- package/package.json +8 -8
- package/dist/packem_shared/ControlledScrollView-BzlbIUph.js +0 -1
- package/dist/packem_shared/FilePicker-V5H2fb-v.js +0 -1
- package/dist/packem_shared/ScrollBar-C9i3z3Ft.js +0 -1
- package/dist/packem_shared/ScrollBarBox-DZEC8YnV.js +0 -1
- package/dist/packem_shared/ScrollList-Djtb2vVy.js +0 -1
- package/dist/packem_shared/ScrollView-ESxpl6Hy.js +0 -1
- package/dist/packem_shared/TreeNodeMap-cJlYqckB.js +0 -1
- package/dist/packem_shared/TreeView-q0l446NV.js +0 -1
- package/dist/packem_shared/controlled-scroll-view-DerVKKv6.js +0 -1
- package/dist/packem_shared/controlled-scroll-view.d-D3kZZzjI.d.ts +0 -43
- package/dist/packem_shared/file-picker.d-CH7pccC7.d.ts +0 -92
- package/dist/packem_shared/line-chart-BbhMhcZg.js +0 -1
- package/dist/packem_shared/scroll-bar-box.d-CpTYEcTZ.d.ts +0 -13
- package/dist/packem_shared/scroll-bar.d-B4sD1hBR.d.ts +0 -18
- package/dist/packem_shared/scroll-list.d-CPCF0RwC.d.ts +0 -12
- package/dist/packem_shared/scroll-view.d-GZcgAHl4.d.ts +0 -98
- package/dist/packem_shared/treeViewTheme-Dq3ekRAC.js +0 -1
- package/dist/packem_shared/use-tree-view.d-DeMQ6G2r.d.ts +0 -314
- package/dist/packem_shared/useTreeView-D0JEqT6W.js +0 -1
- package/dist/packem_shared/useTreeViewState-BiTJakkh.js +0 -1
package/dist/divider.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as r,jsxs as
|
|
1
|
+
import{jsx as r,jsxs as s}from"react/jsx-runtime";import i from"@visulima/tui/components/box";import c from"@visulima/tui/components/text";import m from"@visulima/tui/hooks/use-window-size";function z({character:x,color:n,dimColor:t=!1,label:d,labelPadding:p=1,length:e,orientation:f="horizontal"}){const{columns:w}=m(),a=x??(f==="horizontal"?"─":"│");if(f==="vertical"){const l=e??1;return r(i,{flexDirection:"column",height:l,children:Array.from({length:l},(L,u)=>r(c,{color:n,dimColor:t,children:a},`divider-row-${u}`))})}const h=Math.min(500,e??Math.max(w,1));if(d===void 0)return r(i,{flexGrow:e===void 0?1:0,width:e,children:r(c,{color:n,dimColor:t,wrap:"truncate",children:a.repeat(h)})});const o=" ".repeat(p);return s(i,{flexGrow:e===void 0?1:0,width:e,children:[r(i,{flexGrow:1,flexShrink:1,children:r(c,{color:n,dimColor:t,wrap:"truncate",children:a.repeat(h)})}),r(i,{flexShrink:0,children:s(c,{color:n,dimColor:t,children:[o,d,o]})}),r(i,{flexGrow:1,flexShrink:1,children:r(c,{color:n,dimColor:t,wrap:"truncate",children:a.repeat(h)})})]})}export{z as Divider,z as default};
|
package/dist/drawer.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as
|
|
1
|
+
import{jsxs as c,jsx as o}from"react/jsx-runtime";import i from"@visulima/tui/components/box";import m from"@visulima/tui/components/text";import h from"@visulima/tui/hooks/use-input";import{useCallback as s}from"react";function D({accentColor:e="blue",children:f,isOpen:t,onClose:n,side:d="right",size:l=32,title:r}){const p=s((x,a)=>{a.escape&&n?.()},[n]);if(h(p,{isActive:t}),!t)return null;const u=d==="left"||d==="right";return c(i,{borderColor:e,borderStyle:"round",flexDirection:"column",height:u?void 0:l,paddingX:1,width:u?l:void 0,children:[r===void 0?void 0:c(i,{justifyContent:"space-between",children:[o(m,{bold:!0,color:e,children:r}),o(m,{dimColor:!0,children:"esc"})]}),o(i,{flexDirection:"column",marginTop:r===void 0?0:1,children:f})]})}export{D as Drawer,D as default};
|
package/dist/file-change.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as
|
|
1
|
+
import{jsxs as a,jsx as r}from"react/jsx-runtime";import i from"@visulima/tui/components/box";import e from"@visulima/tui/components/text";const p={added:{color:"green",mark:"A"},deleted:{color:"red",mark:"D"},modified:{color:"yellow",mark:"M"},renamed:{color:"blue",mark:"R"}};function M({additions:c=0,barWidth:o=10,deletions:n=0,path:h,status:u="modified"}){const t=p[u],l=c+n,m=l===0?0:Math.round(c/l*o),d=l===0?0:Math.min(o-m,Math.round(n/l*o));return a(i,{gap:1,children:[r(e,{bold:!0,color:t.color,children:t.mark}),r(e,{children:h}),r(e,{color:"green",children:`+${c}`}),r(e,{color:"red",children:`-${n}`}),a(i,{children:[r(e,{color:"green",children:"▰".repeat(m)}),r(e,{color:"red",children:"▰".repeat(d)}),r(e,{dimColor:!0,children:"▱".repeat(Math.max(0,o-m-d))})]})]})}export{M as FileChange,M as default};
|
|
@@ -1,2 +1,92 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* A single entry (file or directory) returned by the file system hook.
|
|
4
|
+
*/
|
|
5
|
+
type FileEntry = {
|
|
6
|
+
readonly isDirectory: boolean;
|
|
7
|
+
readonly isHidden: boolean;
|
|
8
|
+
readonly name: string;
|
|
9
|
+
readonly path: string;
|
|
10
|
+
readonly permissions: string;
|
|
11
|
+
readonly size: number;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Filter options for the file picker.
|
|
15
|
+
*/
|
|
16
|
+
type FilePickerFilter = {
|
|
17
|
+
/**
|
|
18
|
+
* Allowed file extensions (e.g. `[".ts", ".tsx"]`). Empty or omitted means all.
|
|
19
|
+
*/
|
|
20
|
+
readonly extensions?: ReadonlyArray<string>;
|
|
21
|
+
/**
|
|
22
|
+
* Whether to include directories in the list.
|
|
23
|
+
* @default true
|
|
24
|
+
*/
|
|
25
|
+
readonly showDirectories?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Whether to include regular files in the list.
|
|
28
|
+
* @default true
|
|
29
|
+
*/
|
|
30
|
+
readonly showFiles?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Whether to include hidden files (names starting with `.`).
|
|
33
|
+
* @default false
|
|
34
|
+
*/
|
|
35
|
+
readonly showHidden?: boolean;
|
|
36
|
+
};
|
|
37
|
+
type Props = {
|
|
38
|
+
/**
|
|
39
|
+
* Color for the focused item highlight.
|
|
40
|
+
* @default "cyan"
|
|
41
|
+
*/
|
|
42
|
+
readonly accentColor?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Color for directory entries.
|
|
45
|
+
* @default "blue"
|
|
46
|
+
*/
|
|
47
|
+
readonly directoryColor?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Color for file entries.
|
|
50
|
+
* @default "white"
|
|
51
|
+
*/
|
|
52
|
+
readonly fileColor?: string;
|
|
53
|
+
/**
|
|
54
|
+
* File filter options.
|
|
55
|
+
*/
|
|
56
|
+
readonly filter?: FilePickerFilter;
|
|
57
|
+
/**
|
|
58
|
+
* Starting directory path.
|
|
59
|
+
* @default process.cwd()
|
|
60
|
+
*/
|
|
61
|
+
readonly initialPath?: string;
|
|
62
|
+
/**
|
|
63
|
+
* Whether keyboard navigation is active.
|
|
64
|
+
* @default true
|
|
65
|
+
*/
|
|
66
|
+
readonly isFocused?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Maximum number of visible items (viewport height).
|
|
69
|
+
* @default 10
|
|
70
|
+
*/
|
|
71
|
+
readonly limit?: number;
|
|
72
|
+
/**
|
|
73
|
+
* Called when escape is pressed.
|
|
74
|
+
*/
|
|
75
|
+
readonly onCancel?: () => void;
|
|
76
|
+
/**
|
|
77
|
+
* Called when a file is selected (enter on a file entry).
|
|
78
|
+
*/
|
|
79
|
+
readonly onSelect?: (entry: FileEntry) => void;
|
|
80
|
+
/**
|
|
81
|
+
* Show file permissions column.
|
|
82
|
+
* @default false
|
|
83
|
+
*/
|
|
84
|
+
readonly showPermissions?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Show file size column.
|
|
87
|
+
* @default false
|
|
88
|
+
*/
|
|
89
|
+
readonly showSize?: boolean;
|
|
90
|
+
};
|
|
91
|
+
declare const FilePicker: ({ accentColor, directoryColor, fileColor, filter, initialPath, isFocused, limit, onCancel, onSelect, showPermissions, showSize }: Props) => ReactElement;
|
|
92
|
+
export { type FileEntry, FilePicker, type FilePickerFilter, type Props as FilePickerProps, FilePicker as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as f,default as l}from"./packem_shared/FilePicker-
|
|
1
|
+
import{default as f,default as l}from"./packem_shared/FilePicker-KGAg6v5x.js";export{f as FilePicker,l as default};
|
package/dist/form.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as
|
|
1
|
+
import{jsxs as t,jsx as o}from"react/jsx-runtime";import r from"@visulima/tui/components/box";import i from"@visulima/tui/components/text";const a=({children:e,description:d,error:l,isDisabled:n=!1,label:c,required:m=!1})=>t(r,{flexDirection:"column",marginBottom:1,children:[t(r,{children:[o(i,{bold:!0,dimColor:n,children:c}),m?o(i,{color:"red",children:" *"}):void 0]}),o(r,{marginTop:0,children:e}),l===void 0?d===void 0?void 0:o(i,{dimColor:!0,children:d}):o(i,{color:"red",children:l})]}),s=Object.assign(({accentColor:e="blue",bordered:d=!0,children:l,description:n,footer:c,title:m,width:u})=>{const h=t(r,{flexDirection:"column",children:[m===void 0?void 0:o(r,{marginBottom:1,children:o(i,{bold:!0,color:e,children:m})}),n===void 0?void 0:o(r,{marginBottom:1,children:o(i,{dimColor:!0,children:n})}),o(r,{flexDirection:"column",children:l}),c===void 0?void 0:o(r,{marginTop:1,children:c})]});return d?o(r,{borderColor:e,borderStyle:"round",flexDirection:"column",paddingX:1,paddingY:1,width:u,children:h}):o(r,{flexDirection:"column",width:u,children:h})},{Field:a});export{s as Form,a as FormField,s as default};
|
package/dist/gauge.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as
|
|
1
|
+
import{jsxs as C,jsx as s}from"react/jsx-runtime";import{createBrailleGrid as K}from"@visulima/tui/canvas";import d from"@visulima/tui/components/box";import Q from"@visulima/tui/components/canvas";import v from"@visulima/tui/components/text";import{useMemo as L}from"react";const U={large:{cols:40,rows:10},medium:{cols:24,rows:6},small:{cols:16,rows:4}},V=.9,Y=2,b=n=>String(Math.round(n)),B=(n,f,l,r)=>{const t=f+(l-f)*r;for(const g of n)if(t<=g.max)return g;return n[n.length-1]};function so({backgroundColor:n="gray",formatValue:f=b,label:l,max:r=100,min:t=0,showLegend:g=!1,showValue:E=!0,size:P="medium",thresholds:e,value:S}){const{cols:D,rows:F}=U[P],I=Math.max(t,Math.min(r,S)),N=r-t||1,m=(I-t)/N,u=L(()=>{if(!(e===void 0||e.length===0))return[...e].toSorted((o,a)=>o.max-a.max)},[e]),R=L(()=>{if(u!==void 0)return B(u,t,r,m)},[u,t,r,m]),H=f(I);return C(d,{flexDirection:"column",children:[s(Q,{draw:o=>{o.clear();const a=o.width*2,T=o.height*4,x=a/2,y=T-1,O=a/2-1,W=T-1,p=Math.max(1,Math.min(O,W)),w=new Map,j=i=>{const c=w.get(i);if(c!==void 0)return c;const h=K(o.width,o.height);return w.set(i,h),h},A=Math.max(32,Math.round(Math.PI*p)*Y);for(let i=0;i<=A;i+=1){const c=i/A,h=Math.PI*(1-c),q=Math.round(x+p*Math.cos(h)),J=Math.round(y-p*Math.sin(h));let M;c>m?M=n:u?M=B(u,t,r,c)?.color??"cyan":M="cyan",j(M).plotPoint(q,J)}const G=p*V,_=Math.PI*(1-m),X=Math.round(x+G*Math.cos(_)),Z=Math.round(y-G*Math.sin(_)),$=R?.color??"white";j($).plotLine(Math.round(x),Math.round(y),X,Z);for(const[i,c]of w)c.flush(o,{color:i})},height:F,version:[S,t,r,P,e,n],width:D}),E||l?C(d,{flexDirection:"column",children:[l===void 0?void 0:s(d,{justifyContent:"center",children:s(v,{dimColor:!0,children:l})}),E?s(d,{justifyContent:"center",children:s(v,{bold:!0,color:R?.color??"white",children:H})}):void 0]}):void 0,g&&e&&e.length>0?s(d,{gap:2,justifyContent:"center",marginTop:1,children:e.map((o,a)=>C(d,{gap:1,children:[s(v,{color:o.color,children:"●"}),s(v,{dimColor:!0,children:o.label??`≤ ${o.max}`})]},a))}):void 0]})}export{so as Gauge,so as default};
|
package/dist/gradient.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as f,Fragment as j}from"react/jsx-runtime";import{strip as B}from"@visulima/ansi";import{multilineGradient as w}from"@visulima/colorize/gradient";import P from"@visulima/tui/components/box";import C from"@visulima/tui/components/text";import h from"@visulima/tui/components/transform";import{useMemo as F,Children as x,isValidElement as S,cloneElement as y}from"react";const E={atlas:{colors:["#feac5e","#c779d0","#4bc0c8"]},cristal:{colors:["#bdfff3","#4ac29a"]},fruit:{colors:["#ff4e50","#f9d423"]},instagram:{colors:["#833ab4","#fd1d1d","#fcb045"]},mind:{colors:["#473b7b","#3584a7","#30d2be"]},morning:{colors:["#ff5f6d","#ffc371"],options:{interpolation:"hsv"}},passion:{colors:["#f43b47","#453a94"]},pastel:{colors:["#74ebd5","#74ecd5"],options:{hsvSpin:"long",interpolation:"hsv"}},rainbow:{colors:["#ff0000","#ff0100"],options:{hsvSpin:"long",interpolation:"hsv"}},retro:{colors:["#3f51b1","#5a55ae","#7b5fac","#8f6aae","#a86aa4","#cc6b8e","#f18271","#f3a469","#f7c978"]},summer:{colors:["#fdbb2d","#22c1c3"]},teen:{colors:["#77a1d3","#79cbca","#e684ae"]},vice:{colors:["#5ee7df","#b490ca"],options:{interpolation:"hsv"}}},k=o=>{let e=!1;const t=d=>{x.forEach(d,s=>{if(e||!S(s))return;if(s.type===P){e=!0;return}const a=s.props;Object.hasOwn(a,"children")&&t(a.children)})};return t(o),e},G=o=>Object.hasOwn(o,"children"),O=o=>typeof o=="string"||typeof o=="number",K=o=>o==null||typeof o=="boolean";function q({children:o,colors:e,name:t}){if(t&&e)throw new Error("The `name` and `colors` props are mutually exclusive");if(!t&&!e)throw new Error("Either `name` or `colors` prop must be provided");const d=F(()=>t?w(E[t].colors,E[t].options):w(e??[]),[t,e]),s=b=>d(B(b)),a=x.count(o);if(O(o))return f(h,{transform:s,children:o});if(a===1&&!k(o))return f(h,{transform:s,children:o});const m=b=>{const i=[];let c="",g=0;const v=()=>{const r=`gradient-node-${String(g)}`;return g+=1,r},p=(r,n)=>{i.push(f(h,{transform:s,children:r},n))},T=()=>{if(c==="")return;const r=c;c="",p(f(C,{children:r}),v())};return x.forEach(b,r=>{if(!K(r)){if(O(r)){c+=String(r);return}if(T(),S(r)){const n=r.key??v(),l=r.props;if(r.type===C){p(r,n);return}if(r.type===P){if(G(l)){const u=l.children;i.push(y(r,{key:n},m(u)));return}i.push(y(r,{key:n}));return}if(G(l)){const u=l.children;if(!k(u)){p(r,n);return}i.push(y(r,{key:n},m(u)));return}p(r,n);return}i.push(r)}}),T(),i};return f(j,{children:m(o)})}export{q as Gradient,q as default};
|
package/dist/grid.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as o}from"react/jsx-runtime";import n from"@visulima/tui/components/box";import{Children as
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import n from"@visulima/tui/components/box";import{Children as f}from"react";function w({children:l,columnGap:c=1,columns:m=2,columnWidth:a,rowGap:h=0}){const t=f.toArray(l),e=[],i=Math.max(1,m);for(let r=0;r<t.length;r+=i)e.push(t.slice(r,r+i));return o(n,{flexDirection:"column",gap:h,children:e.map((r,p)=>o(n,{gap:c,children:r.map((s,d)=>o(n,{flexShrink:0,width:a,children:s},d))},p))})}export{w as Grid,w as default};
|
package/dist/heading.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as n,jsxs as c}from"react/jsx-runtime";import l from"@visulima/tui/components/box";import s from"@visulima/tui/components/text";const m={1:"blueBright",2:"cyanBright",3:"magentaBright",4:"yellowBright",5:"green",6:"white"},a={1:"# ",2:"## ",3:"### ",4:"#### ",5:"##### ",6:"###### "};function d({children:r,color:t,level:o=1,underline:e=!1}){const i=t??m[o];return n(l,{flexDirection:"column",children:c(s,{bold:o<=2,color:i,underline:e,children:[a[o],r]})})}export{d as Heading,d as default};
|
package/dist/heatmap.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as M,jsx as
|
|
1
|
+
import{jsxs as M,jsx as f}from"react/jsx-runtime";import h from"@visulima/tui/components/box";import I from"@visulima/tui/components/canvas";import T from"@visulima/tui/components/text";import{useMemo as _}from"react";const k=["#0b1e4f","#1f3b96","#3258c8","#4e84ec","#78b0ff"];function R({cellWidth:d=2,character:y="█",columnLabels:w,data:r,max:l,min:e,palette:a=k,rowLabels:x,textColor:A}){const{cols:v,colWidth:m,extent:D,rows:g}=_(()=>{const n=r.length,t=r.reduce((i,o)=>Math.max(i,o.length),0);let c=e??1/0,s=l??-1/0;if(e===void 0||l===void 0)for(const i of r)for(const o of i)e===void 0&&o<c&&(c=o),l===void 0&&o>s&&(s=o);return{cols:t,colWidth:d,extent:{max:s,min:c},rows:n}},[r,e,l,d]),E=v*m,b=g;return M(h,{children:[x===void 0?void 0:f(h,{flexDirection:"column",marginRight:1,children:Array.from({length:g},(n,t)=>f(T,{dimColor:!0,children:x[t]??""},t))}),M(h,{flexDirection:"column",children:[f(I,{draw:n=>{n.clear();const{max:t,min:c}=D,s=t-c||1,i=a.length-1;for(let o=0;o<g;o+=1)for(let u=0;u<v;u+=1){const C=r[o]?.[u],j=C===void 0?void 0:a[Math.max(0,Math.min(i,Math.round((C-c)/s*i)))];for(let p=0;p<m;p+=1)n.setCell(u*m+p,o,y,{background:j,color:A})}},height:b,version:[r,a,d,e,l],width:E}),w===void 0?void 0:f(h,{children:w.map((n,t)=>f(h,{width:m,children:f(T,{dimColor:!0,wrap:"truncate-end",children:n})},t))})]})]})}export{R as Heatmap,R as default};
|
package/dist/help.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as n,jsxs as g}from"react/jsx-runtime";import h from"@visulima/tui/components/box";import i from"@visulima/tui/components/text";import y from"@visulima/tui/hooks/use-window-size";const m={backspace:"backspace",delete:"del",downArrow:"↓",end:"end",escape:"esc",home:"home",leftArrow:"←",pageDown:"pgdn",pageUp:"pgup",return:"enter",rightArrow:"→",tab:"tab",upArrow:"↑"};function k(e){const r=e.indexOf("+");if(r!==-1){const o=e.slice(0,r),t=e.slice(r+1);return`${o}+${m[t]??t}`}return m[e]??e}function x(e){return(typeof e=="string"?[e]:e).map(o=>k(o)).join("/")}function M({bindings:e,descriptionColor:r,keyColor:o="cyan",maxColumns:t=3,mode:c="short",separator:s=" · "}){const{columns:l}=y();return c==="full"?$(e,{columns:l,descriptionColor:r,keyColor:o,maxColumns:t}):C(e,{columns:l,descriptionColor:r,keyColor:o,separator:s})}function C(e,r){const o=[];let t=0;for(const[c,s]of e.entries()){const l=x(s.key),u=`${l} ${s.description}`,a=(c>0?r.separator.length:0)+u.length;if(t+a>r.columns&&o.length>0)break;c>0&&o.push(n(i,{dimColor:!0,children:r.separator},`sep-${c}`)),o.push(g(h,{children:[n(i,{color:r.keyColor,children:l}),n(i,{children:" "}),r.descriptionColor?n(i,{color:r.descriptionColor,children:s.description}):n(i,{dimColor:!0,children:s.description})]},`pair-${c}`)),t+=a}return n(h,{flexDirection:"row",children:o})}function $(e,r){const o=new Map;for(const u of e){const d=u.group??"";o.has(d)||o.set(d,[]),o.get(d).push(u)}const t=[...o.entries()],c=Math.min(r.maxColumns,t.length||1),s=Math.floor(r.columns/c),l=[];for(const[u,[d,a]]of t.entries()){const f=[];d&&f.push(n(i,{bold:!0,children:d},"title"));for(const[b,p]of a.entries()){const w=x(p.key);f.push(g(h,{children:[n(i,{color:r.keyColor,children:w}),n(i,{children:" "}),r.descriptionColor?n(i,{color:r.descriptionColor,children:p.description}):n(i,{dimColor:!0,children:p.description})]},`b-${b}`))}l.push(n(h,{flexDirection:"column",width:s,children:f},`col-${u}`))}return n(h,{flexDirection:"row",children:l})}export{M as Help,M as default};
|
package/dist/histogram.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as B}from"react/jsx-runtime";import{useMemo as w}from"react";import{BarChart as b}from"./bar-chart.js";const y=(r,n,t)=>{if(t<=0||r>=n)return[r,n];const l=(n-r)/t;return Array.from({length:t+1},(e,o)=>r+o*l)},m=(r,n)=>{if(n.length<2)return[];const t=Array.from({length:n.length-1}).fill(0),l=n[0],e=n[n.length-1];for(const o of r)if(!(o<l||o>e))for(let u=0;u<n.length-1;u+=1){const f=u===n.length-2,c=n[u+1];if(o<c||f&&o<=c){t[u]=(t[u]??0)+1;break}}return t.map((o,u)=>{const f=n[u],c=n[u+1];return{count:o,label:`${Math.round(f)}-${Math.round(c)}`}})};function I({bins:r=10,color:n,data:t,height:l=10,max:e,min:o,showValues:u=!1,thresholds:f,width:c}){const p=w(()=>{if(f&&f.length>=2)return m(t,f);if(t.length===0)return[];let i=o??1/0,a=e??-1/0;if(o===void 0||e===void 0)for(const g of t)o===void 0&&g<i&&(i=g),e===void 0&&g>a&&(a=g);return i===a?[{count:t.length,label:i.toString()}]:m(t,y(i,a,r))},[t,f,r,o,e]);return B(b,{data:p.map(i=>({color:n,label:i.label,value:i.count})),height:l,orientation:"vertical",showLabels:!0,showValues:u,width:c})}export{I as Histogram,I as default};
|
package/dist/image.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as n}from"react/jsx-runtime";import f from"@visulima/tui/components/box";import s from"@visulima/tui/components/text";const p="▀",a="▄";function v({emptyChar:d=" ",pixels:r}){let e=0;for(const o of r)e=Math.max(e,o.length);const h=[];for(let o=0;o<r.length;o+=2){const m=r[o]??[],u=r[o+1]??[],c=[];for(let t=0;t<e;t+=1){const l=m[t],i=u[t];if(l===void 0&&i===void 0){c.push(n(s,{children:d},t));continue}if(l===void 0){c.push(n(s,{color:i,children:a},t));continue}c.push(n(s,{backgroundColor:i,color:l,children:p},t))}h.push(n(f,{children:c},o))}return n(f,{flexDirection:"column",children:h})}export{v as Image,v as default};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,20 @@
|
|
|
1
|
-
export { Accordion,
|
|
1
|
+
export { Accordion,
|
|
2
|
+
/**
|
|
3
|
+
* Barrel for `@visulima/tui-kit`.
|
|
4
|
+
*
|
|
5
|
+
* Consumers should import each component from its own subpath
|
|
6
|
+
* (`@visulima/tui-kit/gauge`) so they only pay for what they use.
|
|
7
|
+
* This barrel exists as a maintenance index and type-coverage aid.
|
|
8
|
+
*/
|
|
9
|
+
type AccordionItem,
|
|
10
|
+
/**
|
|
11
|
+
* Barrel for `@visulima/tui-kit`.
|
|
12
|
+
*
|
|
13
|
+
* Consumers should import each component from its own subpath
|
|
14
|
+
* (`@visulima/tui-kit/gauge`) so they only pay for what they use.
|
|
15
|
+
* This barrel exists as a maintenance index and type-coverage aid.
|
|
16
|
+
*/
|
|
17
|
+
type AccordionProps } from "./accordion.js";
|
|
2
18
|
export { Alert, type AlertProps, type AlertVariant } from "./alert.js";
|
|
3
19
|
export { AnimatePresence, type AnimatePresenceProps } from "./animate-presence.js";
|
|
4
20
|
export { type ApprovalDecision, ApprovalPrompt, type ApprovalPromptProps, type ApprovalRisk } from "./approval-prompt.js";
|
|
@@ -32,7 +48,6 @@ export { type DirectoryNode, DirectoryTree, type DirectoryTreeProps } from "./di
|
|
|
32
48
|
export { Divider, type DividerProps } from "./divider.js";
|
|
33
49
|
export { Drawer, type DrawerProps } from "./drawer.js";
|
|
34
50
|
export { FileChange, type FileChangeProps, type FileChangeStatus } from "./file-change.js";
|
|
35
|
-
export { type F as FileEntry, a as FilePicker, type b as FilePickerFilter, type P as FilePickerProps } from "./packem_shared/file-picker.d-CH7pccC7.js";
|
|
36
51
|
export { Form, FormField, type FormFieldProps, type FormProps } from "./form.js";
|
|
37
52
|
export { Gauge, type GaugeProps, type GaugeSize, type GaugeThreshold } from "./gauge.js";
|
|
38
53
|
export { Gradient, type GradientColors, type GradientName, type GradientProps } from "./gradient.js";
|
|
@@ -72,11 +87,6 @@ export { ProgressCircle, type ProgressCircleProps } from "./progress-circle.js";
|
|
|
72
87
|
export { QrCode, type Props as QrCodeProps } from "./qr-code.js";
|
|
73
88
|
export { RadioGroup, type Props as RadioGroupProps, type RadioOption } from "./radio-group.js";
|
|
74
89
|
export { ScatterPlot, type Props as ScatterPlotProps } from "./scatter-plot.js";
|
|
75
|
-
export { C as ControlledScrollView, type a as ControlledScrollViewProps, type b as ControlledScrollViewRef } from "./packem_shared/controlled-scroll-view.d-D3kZZzjI.js";
|
|
76
|
-
export { S as ScrollBar, type a as ScrollBarPlacement, type b as ScrollBarProps, type c as ScrollBarStyle } from "./packem_shared/scroll-bar.d-B4sD1hBR.js";
|
|
77
|
-
export { S as ScrollBarBox, type a as ScrollBarBoxProps } from "./packem_shared/scroll-bar-box.d-CpTYEcTZ.js";
|
|
78
|
-
export { type S as ScrollAlignment, a as ScrollList, type b as ScrollListProps, type c as ScrollListRef } from "./packem_shared/scroll-list.d-CPCF0RwC.js";
|
|
79
|
-
export { S as ScrollView, type a as ScrollViewProps, type b as ScrollViewRef } from "./packem_shared/scroll-view.d-GZcgAHl4.js";
|
|
80
90
|
export { SearchInput, type Props as SearchInputProps } from "./search-input.js";
|
|
81
91
|
export { SelectInput, type SelectInputEntry, type Item as SelectInputItemType, type Props as SelectInputProps, type SelectInputSeparator } from "./select-input.js";
|
|
82
92
|
export { SelectInputIndicator, type Props as SelectInputIndicatorProps } from "./select-input-indicator.js";
|
|
@@ -108,14 +118,19 @@ export { ToolCall, type Props as ToolCallProps, type ToolCallStatus } from "./to
|
|
|
108
118
|
export { Tooltip, type TooltipPlacement, type Props as TooltipProps } from "./tooltip.js";
|
|
109
119
|
export { default as Transition, type TransitionPhase, type TransitionPreset, type Props as TransitionProps } from "./transition.js";
|
|
110
120
|
export { TreeSelect, type TreeSelectNode, type Props as TreeSelectProps } from "./tree-select.js";
|
|
111
|
-
export { type A as AsyncChildrenFunction, type F as FlatNode, type S as SelectionMode, type T as TreeNode, a as TreeNodeMap, type b as TreeNodeRendererProps, type c as TreeNodeState, d as TreeView, type P as TreeViewProps, type e as TreeViewState, type f as TreeViewTheme, type U as UseTreeViewProps, type g as UseTreeViewStateProps, t as treeViewTheme, u as useTreeView, h as useTreeViewState } from "./packem_shared/use-tree-view.d-DeMQ6G2r.js";
|
|
112
121
|
export { UnorderedList, type UnorderedListEntry, type Props as UnorderedListProps } from "./unordered-list.js";
|
|
122
|
+
export { type AsyncChildrenFunction, type FlatNode, type SelectionMode, type TreeNode, TreeNodeMap, type TreeNodeRendererProps, type TreeNodeState, TreeView, type TreeViewProps, type TreeViewState, type TreeViewTheme, type UseTreeViewProps, type UseTreeViewStateProps, treeViewTheme, useTreeView, useTreeViewState } from "./tree-view-entry.js";
|
|
123
|
+
export { ControlledScrollView, type ControlledScrollViewProps, type ControlledScrollViewRef } from "./controlled-scroll-view.js";
|
|
124
|
+
export { type FileEntry, FilePicker, type FilePickerFilter, type FilePickerProps } from "./file-picker-entry.js";
|
|
125
|
+
export { type ScrollAlignment, ScrollList, type ScrollListProps, type ScrollListRef } from "./scroll-list.js";
|
|
126
|
+
export { ScrollBar, type ScrollBarPlacement, type ScrollBarProps, type ScrollBarStyle } from "./scroll-bar.js";
|
|
127
|
+
export { ScrollBarBox, type ScrollBarBoxProps } from "./scroll-bar-box.js";
|
|
128
|
+
export { ScrollView, type ScrollViewProps, type ScrollViewRef } from "./scroll-view.js";
|
|
113
129
|
import '@visulima/colorize';
|
|
114
130
|
import 'react';
|
|
115
131
|
import 'type-fest';
|
|
116
132
|
import "./packem_shared/variant-config.d-D5NnrrQK.js";
|
|
117
133
|
import '@visulima/tui/hooks/use-console-capture';
|
|
118
|
-
import '@visulima/tui/components/box';
|
|
119
134
|
import '@visulima/colorize/gradient';
|
|
120
135
|
import '@visulima/tui/hooks/use-key-bindings';
|
|
121
136
|
import '@visulima/tui/canvas';
|
|
@@ -123,3 +138,4 @@ import '@visulima/spinner';
|
|
|
123
138
|
import '@visulima/tui/components/text';
|
|
124
139
|
import '@visulima/tui/hooks/use-stopwatch';
|
|
125
140
|
import '@visulima/tui/hooks/use-timer';
|
|
141
|
+
import '@visulima/tui/components/box';
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Accordion as e}from"./accordion.js";import{Alert as p}from"./alert.js";import{AnimatePresence as f}from"./animate-presence.js";import{ApprovalPrompt as a}from"./approval-prompt.js";import{AreaChart as l}from"./area-chart.js";import{Badge as d}from"./badge.js";import{BarChart as c}from"./bar-chart.js";import{BigText as u}from"./big-text.js";import{BlinkDot as T}from"./blink-dot.js";import{Breadcrumb as h}from"./breadcrumb.js";import{Button as k}from"./button.js";import{Calendar as I}from"./calendar.js";import{Card as w}from"./card.js";import{Checkbox as L}from"./checkbox.js";import{CheckboxGroup as V}from"./checkbox-group.js";import{Code as A}from"./code.js";import{Collapsible as v}from"./collapsible.js";import{ColorPicker as O}from"./color-picker.js";import{CommandBlock as y}from"./command-block.js";import{CommandPalette as J}from"./command-palette.js";import{ConfirmDialog as Q}from"./confirm-dialog.js";import{ConfirmInput as j}from"./confirm-input.js";import{ConsoleOverlay as z}from"./console-overlay.js";import{ContentSwitcher as W}from"./content-switcher.js";import{DataGrid as Y}from"./data-grid.js";import{DatePicker as _}from"./date-picker.js";import{DefinitionList as rr}from"./definition-list.js";import{Dialog as er}from"./dialog.js";import{DiffView as pr}from"./diff-view.js";import{Digits as fr}from"./digits.js";import{DirectoryTree as ar}from"./directory-tree.js";import{Divider as lr}from"./divider.js";import{Drawer as dr}from"./drawer.js";import{FileChange as cr}from"./file-change.js";import{Form as ur,FormField as Sr}from"./form.js";import{Gauge as Cr}from"./gauge.js";import{Gradient as Pr}from"./gradient.js";import{Grid as Br}from"./grid.js";import{Heading as br}from"./heading.js";import{Heatmap as Dr}from"./heatmap.js";import{Help as Mr}from"./help.js";import{Histogram as Gr}from"./histogram.js";import{Image as Fr}from"./image.js";import{Json as Hr}from"./json.js";import{Kbd as Nr}from"./kbd.js";import{
|
|
1
|
+
import{Accordion as e}from"./accordion.js";import{Alert as p}from"./alert.js";import{AnimatePresence as f}from"./animate-presence.js";import{ApprovalPrompt as a}from"./approval-prompt.js";import{AreaChart as l}from"./area-chart.js";import{Badge as d}from"./badge.js";import{BarChart as c}from"./bar-chart.js";import{BigText as u}from"./big-text.js";import{BlinkDot as T}from"./blink-dot.js";import{Breadcrumb as h}from"./breadcrumb.js";import{Button as k}from"./button.js";import{Calendar as I}from"./calendar.js";import{Card as w}from"./card.js";import{Checkbox as L}from"./checkbox.js";import{CheckboxGroup as V}from"./checkbox-group.js";import{Code as A}from"./code.js";import{Collapsible as v}from"./collapsible.js";import{ColorPicker as O}from"./color-picker.js";import{CommandBlock as y}from"./command-block.js";import{CommandPalette as J}from"./command-palette.js";import{ConfirmDialog as Q}from"./confirm-dialog.js";import{ConfirmInput as j}from"./confirm-input.js";import{ConsoleOverlay as z}from"./console-overlay.js";import{ContentSwitcher as W}from"./content-switcher.js";import{DataGrid as Y}from"./data-grid.js";import{DatePicker as _}from"./date-picker.js";import{DefinitionList as rr}from"./definition-list.js";import{Dialog as er}from"./dialog.js";import{DiffView as pr}from"./diff-view.js";import{Digits as fr}from"./digits.js";import{DirectoryTree as ar}from"./directory-tree.js";import{Divider as lr}from"./divider.js";import{Drawer as dr}from"./drawer.js";import{FileChange as cr}from"./file-change.js";import{Form as ur,FormField as Sr}from"./form.js";import{Gauge as Cr}from"./gauge.js";import{Gradient as Pr}from"./gradient.js";import{Grid as Br}from"./grid.js";import{Heading as br}from"./heading.js";import{Heatmap as Dr}from"./heatmap.js";import{Help as Mr}from"./help.js";import{Histogram as Gr}from"./histogram.js";import{Image as Fr}from"./image.js";import{Json as Hr}from"./json.js";import{Kbd as Nr}from"./kbd.js";import{L as Ur}from"./packem_shared/line-chart-BqOUjZTt.js";import{Link as Kr}from"./link.js";import{LoadingIndicator as Rr}from"./loading-indicator.js";import{Log as qr}from"./log.js";import{Markdown as Er}from"./markdown.js";import{MaskedInput as Xr}from"./masked-input.js";import{Menu as Zr}from"./menu.js";import{MessageBubble as $r}from"./message-bubble.js";import{ModelBadge as oo}from"./model-badge.js";import{ModelSelector as to}from"./model-selector.js";import{MultiProgress as mo}from"./multi-progress.js";import{MultiSelect as xo}from"./multi-select.js";import{NotificationBadge as io}from"./notification-badge.js";import{NumberInput as no}from"./number-input.js";import{OperationTree as co}from"./operation-tree.js";import{OptionList as uo}from"./option-list.js";import{OrderedList as To}from"./ordered-list.js";import{Paginator as ho}from"./paginator.js";import{Paragraph as ko}from"./paragraph.js";import{PathInput as Io}from"./path-input.js";import{PieChart as wo}from"./pie-chart.js";import{Placeholder as Lo}from"./placeholder.js";import{Popover as Vo}from"./popover.js";import{ProgressBar as Ao}from"./progress-bar.js";import{ProgressCircle as vo}from"./progress-circle.js";import{QrCode as Oo}from"./qr-code.js";import{RadioGroup as yo}from"./radio-group.js";import{ScatterPlot as Jo}from"./scatter-plot.js";import{SearchInput as Qo}from"./search-input.js";import{SelectInput as jo}from"./select-input.js";import{SelectInputIndicator as zo}from"./select-input-indicator.js";import{SelectInputItem as Wo}from"./select-input-item.js";import{ShimmerText as Yo}from"./shimmer-text.js";import{Sidebar as _o}from"./sidebar.js";import{Slider as re}from"./slider.js";import{Sparkline as ee}from"./sparkline.js";import{Spinner as pe}from"./spinner.js";import{StatusLine as fe}from"./status-line.js";import{StatusMessage as ae}from"./status-message.js";import{Stepper as le}from"./stepper.js";import{Stopwatch as de}from"./stopwatch.js";import{StreamingText as ce}from"./streaming-text.js";import{Switch as ue}from"./switch.js";import{Tab as Te}from"./tab.js";import{Table as he}from"./table.js";import{Tabs as ke}from"./tabs.js";import{Tag as Ie}from"./tag.js";import{TagInput as we}from"./tag-input.js";import{TextInput as Le}from"./text-input.js";import{Textarea as Ve}from"./textarea.js";import{ThinkingBlock as Ae}from"./thinking-block.js";import{TimePicker as ve}from"./time-picker.js";import{Timer as Oe}from"./timer.js";import{Toast as ye}from"./toast.js";import{TokenUsage as Je}from"./token-usage.js";import{ToolCall as Qe}from"./tool-call.js";import{Tooltip as je}from"./tooltip.js";import{default as ze}from"./transition.js";import{TreeSelect as We}from"./tree-select.js";import{UnorderedList as Ye}from"./unordered-list.js";import{default as _e}from"./packem_shared/FilePicker-KGAg6v5x.js";import{C as rt}from"./packem_shared/controlled-scroll-view-BHCYjiKa.js";import{ScrollBar as et}from"./packem_shared/ScrollBar-arHRP6OT.js";import{ScrollBarBox as pt}from"./packem_shared/ScrollBarBox-C8wZ_Slk.js";import{ScrollList as ft}from"./packem_shared/ScrollList-BCqHHps6.js";import{ScrollView as at}from"./packem_shared/ScrollView-Dt5E9Yl7.js";import{TreeNodeMap as lt}from"./packem_shared/TreeNodeMap-BK7nRlt0.js";import{TreeView as dt}from"./packem_shared/TreeView-BEZAFOfr.js";import{theme as ct}from"./packem_shared/treeViewTheme-DuCcyBDe.js";import{useTreeView as ut}from"./packem_shared/useTreeView-Dt_iWxVs.js";import{useTreeViewState as Tt}from"./packem_shared/useTreeViewState-aHwNZhIE.js";export{e as Accordion,p as Alert,f as AnimatePresence,a as ApprovalPrompt,l as AreaChart,d as Badge,c as BarChart,u as BigText,T as BlinkDot,h as Breadcrumb,k as Button,I as Calendar,w as Card,L as Checkbox,V as CheckboxGroup,A as Code,v as Collapsible,O as ColorPicker,y as CommandBlock,J as CommandPalette,Q as ConfirmDialog,j as ConfirmInput,z as ConsoleOverlay,W as ContentSwitcher,rt as ControlledScrollView,Y as DataGrid,_ as DatePicker,rr as DefinitionList,er as Dialog,pr as DiffView,fr as Digits,ar as DirectoryTree,lr as Divider,dr as Drawer,cr as FileChange,_e as FilePicker,ur as Form,Sr as FormField,Cr as Gauge,Pr as Gradient,Br as Grid,br as Heading,Dr as Heatmap,Mr as Help,Gr as Histogram,Fr as Image,Hr as Json,Nr as Kbd,Ur as LineChart,Kr as Link,Rr as LoadingIndicator,qr as Log,Er as Markdown,Xr as MaskedInput,Zr as Menu,$r as MessageBubble,oo as ModelBadge,to as ModelSelector,mo as MultiProgress,xo as MultiSelect,io as NotificationBadge,no as NumberInput,co as OperationTree,uo as OptionList,To as OrderedList,ho as Paginator,ko as Paragraph,Io as PathInput,wo as PieChart,Lo as Placeholder,Vo as Popover,Ao as ProgressBar,vo as ProgressCircle,Oo as QrCode,yo as RadioGroup,Jo as ScatterPlot,et as ScrollBar,pt as ScrollBarBox,ft as ScrollList,at as ScrollView,Qo as SearchInput,jo as SelectInput,zo as SelectInputIndicator,Wo as SelectInputItem,Yo as ShimmerText,_o as Sidebar,re as Slider,ee as Sparkline,pe as Spinner,fe as StatusLine,ae as StatusMessage,le as Stepper,de as Stopwatch,ce as StreamingText,ue as Switch,Te as Tab,he as Table,ke as Tabs,Ie as Tag,we as TagInput,Le as TextInput,Ve as Textarea,Ae as ThinkingBlock,ve as TimePicker,Oe as Timer,ye as Toast,Je as TokenUsage,Qe as ToolCall,je as Tooltip,ze as Transition,lt as TreeNodeMap,We as TreeSelect,dt as TreeView,Ye as UnorderedList,ct as treeViewTheme,ut as useTreeView,Tt as useTreeViewState};
|
package/dist/json.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as l,jsxs as
|
|
1
|
+
import{jsx as l,jsxs as j}from"react/jsx-runtime";import I from"@visulima/tui/components/box";import c from"@visulima/tui/components/text";import K from"@visulima/tui/hooks/use-focus";import M from"@visulima/tui/hooks/use-input";import{useMemo as C,useState as E,useCallback as T}from"react";const _={boolean:"yellow",bracket:"gray",key:"cyan",null:"gray",number:"green",string:"yellow"},N=n=>{if(n===null)return"null";if(Array.isArray(n))return"array";const t=typeof n;return t==="object"||t==="boolean"||t==="number"||t==="string"||t==="undefined"?t:"string"},V=n=>{const t=N(n);return t==="array"||t==="object"},B=n=>Array.isArray(n)?`[…${n.length}]`:`{…${Object.keys(n).length}}`,S=(n,t,f,s,u,m)=>{const i=V(n)&&(Array.isArray(n)?n.length>0:Object.keys(n).length>0);if(m.push({collapsible:i,depth:f,id:s,key:t,summary:i?B(n):void 0,value:n}),!(!i||u.has(s))){if(Array.isArray(n)){n.forEach((a,d)=>{S(a,String(d),f+1,`${s}.${d}`,u,m)});return}for(const[a,d]of Object.entries(n))S(d,a,f+1,`${s}.${a}`,u,m)}};function F(n,t){return t===0?0:(n%t+t)%t}function G({accentColor:n="blue",autoFocus:t=!1,collapseDepth:f=Number.POSITIVE_INFINITY,data:s,interactive:u=!0,theme:m}){const i={..._,...m},{isFocused:a}=K({autoFocus:t,isActive:u}),d=C(()=>{const r=new Set,o=(e,g,p)=>{if(!V(e))return;g>=f&&r.add(p);const b=Array.isArray(e)?e.map((k,$)=>[String($),k]):Object.entries(e);for(const[k,$]of b)o($,g+1,`${p}.${k}`)};return o(s,0,"$"),r},[f,s]),[y,w]=E(d),[A,x]=E(0),h=C(()=>{const r=[];return S(s,void 0,0,"$",y,r),r},[y,s]),O=T(r=>{w(o=>{const e=new Set(o);return e.has(r)?e.delete(r):e.add(r),e})},[]),H=T((r,o)=>{if(o.upArrow){x(b=>F(b-1,h.length));return}if(o.downArrow){x(b=>F(b+1,h.length));return}const e=h[A];if(!e?.collapsible)return;const g=o.rightArrow&&y.has(e.id),p=o.leftArrow&&!y.has(e.id);(r===" "||g||p)&&O(e.id)},[y,A,h,O]);M(H,{isActive:u&&a});const J=r=>{if(r.collapsible){const e=y.has(r.id)?"▸":"▾";return j(c,{color:i.bracket,children:[e," ",r.summary]})}const o=N(r.value);return o==="array"||o==="object"?l(c,{color:i.bracket,children:o==="array"?"[]":"{}"}):o==="string"?l(c,{color:i.string,children:JSON.stringify(r.value)}):o==="number"?l(c,{color:i.number,children:String(r.value)}):o==="boolean"?l(c,{color:i.boolean,children:String(r.value)}):l(c,{color:i.null,children:r.value===void 0?"undefined":"null"})};return l(I,{flexDirection:"column",children:h.map((r,o)=>{const e=u&&a&&o===A;return j(I,{children:[l(c,{color:e?n:void 0,children:e?"❯":" "}),l(c,{children:" ".repeat(r.depth)}),r.key===void 0?void 0:j(c,{color:i.key,children:[r.key,":"," "]}),J(r)]},r.id)})})}export{G as Json,G as default};
|
package/dist/kbd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as
|
|
1
|
+
import{jsxs as i,jsx as t}from"react/jsx-runtime";import u from"@visulima/tui/components/box";import d from"@visulima/tui/components/text";function m({children:r,color:o="gray",variant:e="solid"}){return e==="solid"?i(d,{backgroundColor:o,color:"black",children:[" ",r," "]}):e==="outline"?t(u,{borderColor:o,borderStyle:"round",paddingX:1,children:t(d,{color:o,children:r})}):t(d,{dimColor:!0,children:r})}export{m as Kbd,m as default};
|
package/dist/line-chart.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import{L as r,L as s,d as t,a as n}from"./packem_shared/line-chart-BqOUjZTt.js";export{r as LineChart,s as default,t as drawSeriesOnCanvas,n as projectPoint};
|
package/dist/link.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as p}from"react/jsx-runtime";import{hyperlink as u}from"@visulima/ansi";import m from"@visulima/tui/components/text";import c from"@visulima/tui/components/transform";import{useCallback as f}from"react";let o;const a=()=>{if(!process.stdout.isTTY)return!1;const s=process.env.TERM_PROGRAM??"",e=process.env.TERM_PROGRAM_VERSION??"";if(s==="iTerm.app")return Number.parseInt(e.split(".")[0]??"0",10)>=3;if(s==="WezTerm"||s==="ghostty")return!0;if(s==="vscode"){const r=e.split("."),n=Number.parseInt(r[0]??"0",10),i=Number.parseInt(r[1]??"0",10);return n>1||n===1&&i>=72}if(process.env.WT_SESSION)return!0;const t=process.env.VTE_VERSION;if(t){const r=Number.parseInt(t,10);return r>=5e3&&r!==5e3}return!1},R=()=>process.env.FORCE_HYPERLINK?process.env.FORCE_HYPERLINK!=="0":(o!==void 0||(o=a()),o);function d({children:s,fallback:e=!0,url:t}){const r=f(n=>R()?u(n,t):e===!1?n:typeof e=="function"?e(n,t):`${n} ${t}`,[e,t]);return p(c,{transform:r,children:p(m,{children:s})})}export{d as Link,d as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as
|
|
1
|
+
import{jsxs as m,jsx as o}from"react/jsx-runtime";import d from"@visulima/tui/components/box";import t from"@visulima/tui/components/text";import{Spinner as p}from"./spinner.js";function x({children:r,color:i="cyan",type:n="dots"}){return m(d,{gap:1,children:[o(t,{color:i,children:o(p,{type:n})}),r===void 0?void 0:o(t,{color:i,children:r})]})}export{x as LoadingIndicator,x as default};
|
package/dist/log.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as l,jsxs as u}from"react/jsx-runtime";import e from"@visulima/tui/components/box";import c from"@visulima/tui/components/text";const g={debug:{color:"gray",label:"DBG"},error:{color:"red",label:"ERR"},info:{color:"blue",label:"INF"},success:{color:"green",label:"OK "},warn:{color:"yellow",label:"WRN"}};function f({entries:o,maxLines:i,showLevel:d=!0,showTimestamp:n=!0}){const a=i!==void 0&&o.length>i?o.slice(o.length-i):o;return l(e,{flexDirection:"column",children:a.map((r,m)=>{const t=g[r.level??"info"];return u(e,{children:[n&&r.timestamp!==void 0?l(e,{marginRight:1,children:l(c,{dimColor:!0,children:r.timestamp})}):void 0,d?l(e,{marginRight:1,children:l(c,{bold:!0,color:t.color,children:t.label})}):void 0,l(c,{children:r.message})]},m)})})}export{f as Log,f as default};
|
package/dist/markdown.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as t,jsxs as k}from"react/jsx-runtime";import h from"@visulima/tui/components/box";import w from"@visulima/tui/components/newline";import m from"@visulima/tui/components/text";import F from"@visulima/tui/hooks/use-window-size";import{Lexer as D}from"marked";import g,{useMemo as x}from"react";import{Code as M}from"./code.js";import{Link as O}from"./link.js";import{OrderedList as S}from"./ordered-list.js";import{Table as W}from"./table.js";import{UnorderedList as j}from"./unordered-list.js";const q={1:"cyan",2:"green",3:"yellow",4:"blue",5:"magenta",6:"gray"};function d(i){return!i||i.length===0?null:i.map((s,o)=>{switch(s.type){case"br":return t(w,{},o);case"codespan":return k(m,{inverse:!0,children:[" ",s.text," "]},o);case"del":return t(m,{strikethrough:!0,children:d(s.tokens)},o);case"em":return t(m,{italic:!0,children:d(s.tokens)},o);case"escape":return t(g.Fragment,{children:s.text},o);case"image":{const e=s;return k(m,{dimColor:!0,children:["[image:"," ",e.text||e.href,"]"]},o)}case"link":{const e=s;return t(O,{url:e.href,children:d(e.tokens)??e.text},o)}case"strong":return t(m,{bold:!0,children:d(s.tokens)},o);case"text":return t(g.Fragment,{children:s.text},o);default:{const e="raw"in s?s.raw:"";return t(g.Fragment,{children:e},o)}}})}function L(i){return i.map(s=>{const e=s.tokens??[],r=e.find(n=>n.type==="text"),u=d(r?.tokens??e),c=e.find(n=>n.type==="list");return{children:c?L(c.items):void 0,label:u}})}function y(i,s,o){const e=[];for(const[r,u]of i.entries()){const c=u,a=r>0?1:0;switch(c.type){case"blockquote":{const n=c;e.push(t(h,{borderLeft:!0,borderLeftColor:"gray",marginTop:a,paddingLeft:1,children:t(h,{flexDirection:"column",children:y(n.tokens,s,o-3)})},r));break}case"code":{const n=c;e.push(t(h,{marginTop:a,children:t(M,{code:n.text,language:n.lang,theme:s})},r));break}case"heading":{const n=c,l=q[n.depth]??"white",b=`${"#".repeat(n.depth)} `;e.push(t(h,{marginTop:a,children:k(m,{bold:!0,color:l,children:[b,d(n.tokens)]})},r));break}case"hr":{e.push(t(h,{marginTop:a,children:t(m,{dimColor:!0,children:"─".repeat(Math.min(o,40))})},r));break}case"html":{const l=c.text.replaceAll(/<[^>]*>/g,"");l.trim()&&e.push(t(h,{marginTop:a,children:t(m,{dimColor:!0,children:l})},r));break}case"list":{const n=c,l=L(n.items);n.ordered?e.push(t(h,{marginTop:a,children:t(S,{items:l})},r)):e.push(t(h,{marginTop:a,children:t(j,{items:l})},r));break}case"paragraph":{const n=c;e.push(t(h,{marginTop:a,children:t(m,{wrap:"wrap",children:d(n.tokens)})},r));break}case"space":{e.push(t(w,{},r));break}case"table":{const n=c,l=(n.header??[]).map(p=>p.text),C=(n.rows??[]).map(p=>p.map(f=>f.text)).map(p=>{const f={};return l.forEach((I,T)=>{f[I]=p[T]??""}),f});e.push(t(h,{marginTop:a,children:t(W,{data:C})},r));break}default:{const n="raw"in c?c.raw:"",l="text"in c?c.text:n;l&&e.push(t(h,{marginTop:a,children:t(m,{children:l})},r));break}}}return e}function v(i,s){const o=D.lex(i);if(!s||i.length===0)return o;let e=0;for(const r of o)e+=r.raw?.length??0;if(e<i.length){const r=i.slice(e);r.trim().length>0&&o.push({raw:r,text:r,tokens:[{raw:r,text:r,type:"text"}],type:"paragraph"})}return o}function K({children:i,codeTheme:s="github-dark-default",maxWidth:o,streaming:e=!1}){const{columns:r}=F(),u=o??r??80,c=x(()=>v(i,e),[i,e]),a=x(()=>y(c,s,u),[c,s,u]);return t(h,{flexDirection:"column",children:a})}export{K as Markdown,K as default};
|
package/dist/masked-input.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as
|
|
1
|
+
import{jsxs as P,jsx as g}from"react/jsx-runtime";import R from"@visulima/tui/components/box";import w from"@visulima/tui/components/text";import V from"@visulima/tui/hooks/use-input";import{useMemo as _,useState as I,useCallback as A}from"react";const q=(f,n)=>{const o=[];let c=0;for(const[l,s]of[...f].entries())s===n&&(o.push({maskColumn:l,rawPosition:c}),c+=1);return o},z=(f,n,o,c)=>{let l=0,s="";for(const a of n)if(a===o){const m=f[l];m===void 0?s+=c:(s+=m,l+=1)}else s+=a;return s};function K({defaultValue:f="",isDisabled:n=!1,mask:o,onChange:c,onSubmit:l,placeholderChar:s="_",token:a="#"}){const m=_(()=>q(o,a),[o,a]),h=m.length,M=f.slice(0,h),[t,v]=I(M),[r,d]=I(M.length),x=A((i,e)=>{v(i),d(Math.max(0,Math.min(h,e))),c?.(i)},[h,c]);V(A((i,e)=>{if(e.return){l?.(t);return}if(e.leftArrow){d(u=>Math.max(0,u-1));return}if(e.rightArrow){d(u=>Math.min(t.length,u+1));return}if(e.home||e.ctrl&&i==="a"){d(0);return}if(e.end||e.ctrl&&i==="e"){d(t.length);return}if(e.backspace){if(r===0)return;const u=t.slice(0,r-1)+t.slice(r);x(u,r-1);return}if(e.delete){if(r>=t.length)return;const u=t.slice(0,r)+t.slice(r+1);x(u,r);return}if(i.length!==1||t.length>=h)return;const L=t.slice(0,r)+i+t.slice(r);x(L,r+1)},[t,r,h,x,l]),{isActive:!n});const C=z(t,o,a,s),p=m[r]?.maskColumn??o.length,j=C.slice(0,p),T=C.charAt(p)||" ",B=C.slice(p+1);return P(R,{children:[g(w,{dimColor:n,children:j}),g(w,{dimColor:n,inverse:!n,children:T}),g(w,{dimColor:n,children:B})]})}export{K as MaskedInput,K as default};
|
package/dist/menu.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as b,jsx as l}from"react/jsx-runtime";import
|
|
1
|
+
import{jsxs as b,jsx as l}from"react/jsx-runtime";import u from"@visulima/tui/components/box";import a from"@visulima/tui/components/text";import j from"@visulima/tui/hooks/use-focus";import A from"@visulima/tui/hooks/use-input";import{useMemo as D,useState as R,useRef as S,useEffect as B,useCallback as E}from"react";const M=(o,r)=>{if(r&&r.length>0){const t=[];for(const i of r){i.title!==void 0&&t.push({kind:"section-header",sectionId:i.id,title:i.title});for(const d of i.items)t.push({item:d,kind:"item",sectionId:i.id})}return t}return(o??[]).map(t=>({item:t,kind:"item",sectionId:void 0}))},C=(o,r,t)=>{const i=o.length;if(i===0)return r;for(let d=1;d<=i;d+=1){const h=(r+t*d+i*d)%i,p=o[h];if(p?.kind==="item"&&!p.item.isDisabled)return h}return r},g=o=>{for(const[r,t]of o.entries())if(t.kind==="item"&&!t.item.isDisabled)return r;return 0};function U({accentColor:o="blue",autoFocus:r=!1,bordered:t=!0,items:i,onSelect:d,sections:h,title:p}){const{isFocused:x}=j({autoFocus:r}),n=D(()=>M(i,h),[i,h]),F=D(()=>g(n),[n]),[k,v]=R(F),f=S(k);f.current=k,B(()=>{const{current:s}=f,c=n[s];if(!(c?.kind==="item"&&!c.item.isDisabled)){const m=g(n);v(m),f.current=m}},[n]),A(E((s,c)=>{if(x){if(c.downArrow||s==="j")v(C(n,f.current,1));else if(c.upArrow||s==="k")v(C(n,f.current,-1));else if(c.return){const e=n[f.current];e?.kind==="item"&&!e.item.isDisabled&&d(e.item.id)}}},[x,n,d]),{isActive:x});const w=b(u,{flexDirection:"column",children:[p===void 0?void 0:l(u,{marginBottom:1,children:l(a,{bold:!0,color:o,children:p})}),n.map((s,c)=>{if(s.kind==="section-header")return l(u,{marginTop:c===0?0:1,children:l(a,{dimColor:!0,children:s.title.toUpperCase()})},`header:${s.sectionId}`);const{item:e}=s,m=x&&c===k,I=m?o:void 0;return b(u,{children:[l(a,{color:I,dimColor:e.isDisabled,children:m?"▸ ":" "}),e.icon===void 0?void 0:b(a,{color:I,dimColor:e.isDisabled,children:[e.icon," "]}),l(u,{flexGrow:1,flexShrink:1,minWidth:0,children:l(a,{bold:m,color:I,dimColor:e.isDisabled,wrap:"truncate-end",children:e.label})}),e.hotkey===void 0?void 0:l(u,{flexShrink:0,children:b(a,{dimColor:!0,children:[" ",e.hotkey]})})]},`item:${e.id}`)})]});return t?l(u,{borderColor:x?o:void 0,borderStyle:"round",paddingX:1,children:w}):w}export{U as Menu,U as default};
|
package/dist/message-bubble.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as c,jsx as o}from"react/jsx-runtime";import i from"@visulima/tui/components/box";import
|
|
1
|
+
import{jsxs as c,jsx as o}from"react/jsx-runtime";import i from"@visulima/tui/components/box";import t from"@visulima/tui/components/text";const f={assistant:{align:"flex-start",color:"blueBright",icon:""},system:{align:"flex-start",color:"gray",icon:""},tool:{align:"flex-start",color:"magentaBright",icon:""},user:{align:"flex-end",color:"greenBright",icon:""}};function p({children:r,color:d,flat:a=!1,label:n,meta:e,role:g="assistant"}){const s=f[g],l=d??s.color;return c(i,{alignSelf:s.align,flexDirection:"column",marginBottom:1,children:[n===void 0&&e===void 0?void 0:c(i,{gap:1,paddingX:1,children:[n===void 0?void 0:o(t,{bold:!0,color:l,children:n}),e===void 0?void 0:o(t,{dimColor:!0,children:e})]}),a?c(i,{paddingX:1,children:[o(t,{color:l,children:"│ "}),o(i,{flexDirection:"column",flexGrow:1,children:typeof r=="string"?o(t,{children:r}):r})]}):o(i,{borderColor:l,borderStyle:"round",flexDirection:"column",paddingX:1,children:typeof r=="string"?o(t,{children:r}):r})]})}export{p as MessageBubble,p as default};
|
package/dist/model-badge.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as
|
|
1
|
+
import{jsxs as r,jsx as n,Fragment as f}from"react/jsx-runtime";import m from"@visulima/tui/components/box";import e from"@visulima/tui/components/text";function g({color:d="magenta",icon:l,model:t,provider:u,variant:c="solid"}){const h=i=>{const o=l===void 0?void 0:r(f,{children:[l," "]});return c==="outline"?n(m,{borderColor:d,borderStyle:"round",paddingX:1,children:r(e,{color:d,children:[o,i]})}):c==="subtle"?r(e,{color:d,children:[o,i]}):r(e,{backgroundColor:d,color:"black",children:[" ",o,i," "]})};return u===void 0?h(t):r(m,{children:[n(e,{dimColor:!0,children:u}),n(e,{dimColor:!0,children:"/"}),h(t)]})}export{g as ModelBadge,g as default};
|
package/dist/model-selector.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as i,jsxs as j}from"react/jsx-runtime";import s from"@visulima/tui/components/box";import c from"@visulima/tui/components/text";import F from"@visulima/tui/hooks/use-focus";import M from"@visulima/tui/hooks/use-input";import{useState as m,useCallback as S}from"react";function I(d,n){return n===0?0:(d%n+n)%n}function q({accentColor:d="blue",autoFocus:n=!1,defaultValue:g,models:o,onSelect:f,value:l}){const{isFocused:a}=F({autoFocus:n}),p=l!==void 0,[w,A]=m(g),v=l??w,C=Math.max(0,o.findIndex(t=>t.id===v)),[u,h]=m(C),b=S((t,e)=>{if(e.upArrow){h(r=>I(r-1,o.length));return}if(e.downArrow){h(r=>I(r+1,o.length));return}if(e.return){const r=o[u];r!==void 0&&(p||A(r.id),f?.(r))}},[u,p,o,f]);return M(b,{isActive:a}),i(s,{flexDirection:"column",children:o.map((t,e)=>{const r=a&&e===u,x=t.id===v;return j(s,{gap:1,children:[i(c,{color:r?d:void 0,children:r?"❯":" "}),i(c,{color:x?d:void 0,children:x?"●":"○"}),i(c,{bold:r,children:t.name}),t.provider===void 0?void 0:i(c,{dimColor:!0,children:t.provider}),t.context===void 0?void 0:i(s,{marginLeft:1,children:i(c,{dimColor:!0,children:t.context})})]},t.id)})})}export{q as ModelSelector,q as default};
|
package/dist/multi-progress.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as r,jsxs as
|
|
1
|
+
import{jsx as r,jsxs as d}from"react/jsx-runtime";import t from"@visulima/tui/components/box";import n from"@visulima/tui/components/text";const x=e=>Math.max(0,Math.min(1,e));function b({barWidth:e=20,color:h="cyan",emptyChar:m="░",filledChar:u="█",items:a,showPercent:f=!0}){let l=0;for(const o of a)l=Math.max(l,o.label.length);return r(t,{flexDirection:"column",children:a.map((o,p)=>{const i=x(o.value),c=Math.round(i*e);return d(t,{gap:1,children:[r(t,{flexShrink:0,width:l,children:r(n,{children:o.label.padEnd(l)})}),d(t,{children:[r(n,{color:o.color??h,children:u.repeat(c)}),r(n,{dimColor:!0,children:m.repeat(Math.max(0,e-c))})]}),f?r(n,{dimColor:!0,children:`${Math.round(i*100)}%`}):void 0]},p)})})}export{b as MultiProgress,b as default};
|