@visulima/tui 1.0.0-alpha.23 → 1.0.0-alpha.24
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 +45 -0
- package/README.md +17 -0
- package/dist/components/accordion.js +1 -1
- package/dist/components/alert.js +1 -1
- package/dist/components/animate-presence.js +1 -1
- package/dist/components/approval-prompt.js +1 -1
- package/dist/components/area-chart.js +1 -1
- package/dist/components/badge.js +1 -1
- package/dist/components/bar-chart.js +1 -1
- package/dist/components/big-text.js +1 -1
- package/dist/components/blink-dot.js +1 -1
- package/dist/components/box.d.ts +1 -1
- package/dist/components/breadcrumb.js +1 -1
- package/dist/components/button.js +1 -1
- package/dist/components/calendar.js +1 -1
- package/dist/components/canvas.d.ts +1 -1
- package/dist/components/canvas.js +1 -1
- package/dist/components/card.js +1 -1
- package/dist/components/checkbox.js +1 -1
- package/dist/components/code.js +2 -2
- package/dist/components/collapsible.js +1 -1
- package/dist/components/command-block.js +4 -4
- package/dist/components/command-palette.js +1 -1
- package/dist/components/confirm-dialog.js +1 -1
- package/dist/components/confirm-input.js +1 -1
- package/dist/components/console-overlay.js +1 -1
- package/dist/components/content-switcher.js +1 -1
- package/dist/components/controlled-scroll-view.d.ts +1 -1
- package/dist/components/controlled-scroll-view.js +1 -1
- package/dist/components/cursor.d.ts +1 -1
- package/dist/components/cursor.js +1 -1
- package/dist/components/date-picker.js +1 -1
- package/dist/components/definition-list.js +1 -1
- package/dist/components/dialog.d.ts +1 -1
- package/dist/components/dialog.js +1 -1
- package/dist/components/diff-view.js +1 -1
- package/dist/components/divider.js +1 -1
- package/dist/components/file-picker-entry.js +1 -1
- package/dist/components/form.js +1 -1
- package/dist/components/gauge.js +1 -1
- package/dist/components/gradient.js +1 -1
- package/dist/components/heading.js +1 -1
- package/dist/components/heatmap.js +1 -1
- package/dist/components/help.js +1 -1
- package/dist/components/histogram.js +1 -1
- package/dist/components/kbd.js +1 -1
- package/dist/components/line-chart.js +1 -1
- package/dist/components/link.js +1 -1
- package/dist/components/loading-indicator.js +1 -1
- package/dist/components/markdown.js +1 -1
- package/dist/components/masked-input.js +1 -1
- package/dist/components/menu.js +1 -1
- package/dist/components/message-bubble.js +1 -1
- package/dist/components/model-badge.js +1 -1
- package/dist/components/multi-select.js +1 -1
- package/dist/components/newline.js +2 -2
- package/dist/components/operation-tree.js +1 -1
- package/dist/components/option-list.js +1 -1
- package/dist/components/ordered-list.js +1 -1
- package/dist/components/paginator.js +1 -1
- package/dist/components/paragraph.js +1 -1
- package/dist/components/placeholder.js +1 -1
- package/dist/components/progress-bar.js +1 -1
- package/dist/components/radio-group.js +1 -1
- package/dist/components/scatter-plot.js +1 -1
- package/dist/components/scroll-bar-box.d.ts +1 -1
- package/dist/components/scroll-bar-box.js +1 -1
- package/dist/components/scroll-bar.d.ts +1 -1
- package/dist/components/scroll-bar.js +1 -1
- package/dist/components/scroll-list.d.ts +1 -1
- package/dist/components/scroll-list.js +1 -1
- package/dist/components/scroll-view.d.ts +1 -1
- package/dist/components/scroll-view.js +1 -1
- package/dist/components/search-input.js +1 -1
- package/dist/components/select-input-indicator.js +1 -1
- package/dist/components/select-input-item.js +1 -1
- package/dist/components/select-input.js +1 -1
- package/dist/components/shimmer-text.js +1 -1
- package/dist/components/slider.js +1 -1
- package/dist/components/spacer.js +1 -1
- package/dist/components/sparkline.js +1 -1
- package/dist/components/spinner.js +1 -1
- package/dist/components/static-render.d.ts +1 -1
- package/dist/components/static-render.js +1 -1
- package/dist/components/static.js +1 -1
- package/dist/components/status-line.js +1 -1
- package/dist/components/status-message.js +1 -1
- package/dist/components/stepper.js +1 -1
- package/dist/components/stopwatch.js +1 -1
- package/dist/components/streaming-text.js +1 -1
- package/dist/components/switch.js +1 -1
- package/dist/components/tab.js +1 -1
- package/dist/components/table.js +1 -1
- package/dist/components/tabs.js +1 -1
- package/dist/components/tag.js +1 -1
- package/dist/components/text-input.js +1 -1
- package/dist/components/text.js +1 -1
- package/dist/components/textarea.js +2 -2
- package/dist/components/timer.js +1 -1
- package/dist/components/toast.js +1 -1
- package/dist/components/tooltip.js +1 -1
- package/dist/components/transform.js +1 -1
- package/dist/components/transition.js +1 -1
- package/dist/components/tree-view-entry.d.ts +1 -1
- package/dist/components/tree-view-entry.js +1 -1
- package/dist/components/unordered-list.js +1 -1
- package/dist/core/index.js +1 -1
- package/dist/ink/hooks/use-animation.js +1 -1
- package/dist/ink/hooks/use-app.js +1 -1
- package/dist/ink/hooks/use-box-metrics.d.ts +1 -1
- package/dist/ink/hooks/use-box-metrics.js +1 -1
- package/dist/ink/hooks/use-clipboard.js +1 -1
- package/dist/ink/hooks/use-color-blindness.js +1 -1
- package/dist/ink/hooks/use-console-capture.js +1 -1
- package/dist/ink/hooks/use-cursor.js +1 -1
- package/dist/ink/hooks/use-focus-manager.js +1 -1
- package/dist/ink/hooks/use-focus.js +1 -1
- package/dist/ink/hooks/use-form.js +1 -1
- package/dist/ink/hooks/use-hotkey.js +1 -1
- package/dist/ink/hooks/use-input.js +2 -2
- package/dist/ink/hooks/use-interval.js +1 -1
- package/dist/ink/hooks/use-is-screen-reader-enabled.js +1 -1
- package/dist/ink/hooks/use-key-bindings.js +1 -1
- package/dist/ink/hooks/use-key-chord.js +1 -1
- package/dist/ink/hooks/use-linked-scroll.d.ts +1 -1
- package/dist/ink/hooks/use-linked-scroll.js +1 -1
- package/dist/ink/hooks/use-paste.js +1 -1
- package/dist/ink/hooks/use-persistent-state.d.ts +12 -3
- package/dist/ink/hooks/use-persistent-state.js +2 -2
- package/dist/ink/hooks/use-scroll-acceleration.js +1 -1
- package/dist/ink/hooks/use-scroll-input.js +1 -1
- package/dist/ink/hooks/use-stderr.js +1 -1
- package/dist/ink/hooks/use-stdin.js +1 -1
- package/dist/ink/hooks/use-stdout.js +1 -1
- package/dist/ink/hooks/use-stopwatch.js +1 -1
- package/dist/ink/hooks/use-terminal-palette.js +1 -1
- package/dist/ink/hooks/use-text-buffer.js +4 -4
- package/dist/ink/hooks/use-text-selection.d.ts +2 -2
- package/dist/ink/hooks/use-text-selection.js +1 -1
- package/dist/ink/hooks/use-timeout.js +1 -1
- package/dist/ink/hooks/use-timer.js +1 -1
- package/dist/ink/hooks/use-window-size.js +1 -1
- package/dist/ink/index.d.ts +17 -62
- package/dist/ink/index.js +1 -1
- package/dist/ink/mouse/use-element-position.d.ts +31 -0
- package/dist/ink/mouse/use-element-position.js +1 -0
- package/dist/ink/mouse/use-mouse-action.d.ts +5 -0
- package/dist/ink/mouse/use-mouse-action.js +1 -0
- package/dist/ink/mouse/use-mouse-position.d.ts +5 -0
- package/dist/ink/mouse/use-mouse-position.js +1 -0
- package/dist/ink/mouse/use-mouse.d.ts +5 -0
- package/dist/ink/mouse/use-mouse.js +1 -0
- package/dist/ink/mouse/use-on-mouse-click.d.ts +16 -0
- package/dist/ink/mouse/use-on-mouse-click.js +1 -0
- package/dist/ink/mouse/use-on-mouse-hover.d.ts +10 -0
- package/dist/ink/mouse/use-on-mouse-hover.js +1 -0
- package/dist/ink/mouse/use-on-mouse-state.d.ts +13 -0
- package/dist/ink/mouse/use-on-mouse-state.js +1 -0
- package/dist/packem_chunks/devtools.js +1 -1
- package/dist/packem_shared/COLOR_BLINDNESS_COMPENSATION-Ilnoyeqc.js +1 -0
- package/dist/packem_shared/ControlledScrollView-BoN5Oi-p.js +1 -0
- package/dist/packem_shared/DevTools-k6uiVzqv.js +1 -0
- package/dist/packem_shared/FilePicker-BLS9nOPz.js +1 -0
- package/dist/packem_shared/FocusContext-C2Sosxa4.js +1 -0
- package/dist/packem_shared/Fullscreen-BRhuBLBh.js +1 -0
- package/dist/packem_shared/IMECompositionBuffer-VhC9HRCv.js +1 -0
- package/dist/packem_shared/InputParser-CtwkCbrQ.js +2 -0
- package/dist/packem_shared/KEY-C--kOw41.js +1 -0
- package/dist/packem_shared/LayoutNode-LPYsuzBg.js +1 -0
- package/dist/packem_shared/MouseProvider-DUqQ3Eaa.js +1 -0
- package/dist/packem_shared/NAMED_COLORS-82DpREQV.js +1 -0
- package/dist/packem_shared/Range-BsVYNWtg.js +1 -0
- package/dist/packem_shared/Renderer-DsskdkUd.js +1 -0
- package/dist/packem_shared/ResizeObserver-aX8XOr2u.js +1 -0
- package/dist/packem_shared/ScrollBar-BKCK8jsb.js +1 -0
- package/dist/packem_shared/ScrollBarBox-CBhLo6eZ.js +1 -0
- package/dist/packem_shared/ScrollList-DyFyVs6I.js +1 -0
- package/dist/packem_shared/ScrollView-BEgrtSnt.js +1 -0
- package/dist/packem_shared/Static-DSzsElz4.js +1 -0
- package/dist/packem_shared/TreeNodeMap-cJlYqckB.js +1 -0
- package/dist/packem_shared/TreeView-BsvLCsf0.js +1 -0
- package/dist/packem_shared/TuiApp-BPL8v1i1.js +1 -0
- package/dist/packem_shared/TuiContext-BNmP0lMY.js +3 -0
- package/dist/packem_shared/ansi-parser-DlgLtOYO.js +1 -0
- package/dist/packem_shared/ansi-tokenizer-BU67A126.js +1 -0
- package/dist/packem_shared/braille-ch3O5D7I.js +1 -0
- package/dist/packem_shared/calculateScroll-D4Y_JR4H.js +1 -0
- package/dist/packem_shared/calculateScrollbarLayout--eUVRLw7.js +1 -0
- package/dist/packem_shared/clearOsc52-BUpnQOav.js +1 -0
- package/dist/packem_shared/clearStringWidthCache-DKFjfJuB.js +1 -0
- package/dist/packem_shared/colorize-DU4YZkp3.js +1 -0
- package/dist/packem_shared/controlled-scroll-view-t55HU9L8.js +1 -0
- package/dist/packem_shared/createInlineLoop-BT40Wpmx.js +2 -0
- package/dist/packem_shared/createScreen-DoYpyL0V.js +3 -0
- package/dist/packem_shared/dom-rphpG0kf.js +1 -0
- package/dist/packem_shared/{dom.d-C1IxuLJ9.d.ts → dom.d-B4kXbaVY.d.ts} +35 -0
- package/dist/packem_shared/format-time-fjoQHMxD.js +1 -0
- package/dist/packem_shared/{getPathToRoot-BuAM_kmj.js → getPathToRoot-PDJeqiEH.js} +1 -1
- package/dist/packem_shared/input-utils-BSWCb4F_.js +1 -0
- package/dist/packem_shared/isIntersecting-Bo2npvMR.js +1 -0
- package/dist/packem_shared/isTerminalPaletteQuerySupported-BYzmqq9-.js +1 -0
- package/dist/packem_shared/kittyFlags-g8ALyoCU.js +1 -0
- package/dist/packem_shared/line-chart-C7CUrvVs.js +1 -0
- package/dist/packem_shared/load-native-root-binding-DDikxNox.js +1 -0
- package/dist/packem_shared/measure-element-Cs7_proT.js +2 -0
- package/dist/packem_shared/measure-text-B7juNq4Y.js +3 -0
- package/dist/packem_shared/mouse-context.d-BfL9xGk_.d.ts +30 -0
- package/dist/packem_shared/parseSgrMouse-bUrqPrh-.js +1 -0
- package/dist/packem_shared/processLayout-tAee0ytT.js +1 -0
- package/dist/packem_shared/reconciler-ClpU7Y-V.js +1 -0
- package/dist/packem_shared/reconciler-DhUGYWCr.js +1 -0
- package/dist/packem_shared/render-DFZ8NHlG.js +1 -0
- package/dist/packem_shared/render-v2x7ZRzT.js +24 -0
- package/dist/packem_shared/{render.d-DuyG0zip.d.ts → render.d-CBnYBDk2.d.ts} +1 -1
- package/dist/packem_shared/renderToString-C2YmVNLG.js +4 -0
- package/dist/packem_shared/renderToString-L_bpw4OQ.js +2 -0
- package/dist/packem_shared/renderTreeToBuffer-C8lS0lJ2.js +2 -0
- package/dist/packem_shared/renderer-COXHo5Xk.js +17 -0
- package/dist/packem_shared/{selection.d-Dbha5bMS.d.ts → selection.d-CI3_p8wg.d.ts} +1 -1
- package/dist/packem_shared/squashTextNodesWithMap-BmUSBPfc.js +1 -0
- package/dist/packem_shared/stderr-context-Bvnik0hL.js +1 -0
- package/dist/packem_shared/stdin-context-88AhuztD.js +1 -0
- package/dist/packem_shared/text-width-e49vlbQH.js +2 -0
- package/dist/packem_shared/token-to-elements-D6J6-P2A.js +1 -0
- package/dist/packem_shared/treeViewTheme-Dq3ekRAC.js +1 -0
- package/dist/packem_shared/useTreeView-D5ifGwG3.js +1 -0
- package/dist/packem_shared/useTreeViewState-BiTJakkh.js +1 -0
- package/dist/packem_shared/utils-Bup8lyK8.js +1 -0
- package/dist/packem_shared/waitFor-CTAki32d.js +4 -0
- package/dist/packem_shared/wrapOrTruncateStyledLine-46W8bTtv.js +3 -0
- package/dist/react/index.js +1 -1
- package/dist/testing/index.d.ts +2 -2
- package/dist/testing/index.js +1 -1
- package/index.js +691 -539
- package/package.json +48 -23
- package/dist/packem_shared/COLOR_BLINDNESS_SIMULATION-DqErf7XX.js +0 -1
- package/dist/packem_shared/ControlledScrollView-CIc-x1Cx.js +0 -1
- package/dist/packem_shared/DevTools-ClAYpMVI.js +0 -1
- package/dist/packem_shared/FilePicker-tYj_CIau.js +0 -1
- package/dist/packem_shared/FocusContext-Xy0cwJpO.js +0 -1
- package/dist/packem_shared/Fullscreen-CxLd1-Zu.js +0 -1
- package/dist/packem_shared/IMECompositionBuffer-C89PhiOu.js +0 -1
- package/dist/packem_shared/InputParser-B_qZcN3r.js +0 -2
- package/dist/packem_shared/KEY-Bk8B-3h_.js +0 -1
- package/dist/packem_shared/LayoutNode-B8zej4dm.js +0 -1
- package/dist/packem_shared/MouseProvider-PnIUKURs.js +0 -1
- package/dist/packem_shared/NAMED_COLORS-B9fJsYdg.js +0 -1
- package/dist/packem_shared/Renderer-DJXooAsp.js +0 -1
- package/dist/packem_shared/ResizeObserverEntry-Dq0dk8Kq.js +0 -1
- package/dist/packem_shared/ScrollBar-U_37hlIT.js +0 -1
- package/dist/packem_shared/ScrollBarBox-DwiCxilX.js +0 -1
- package/dist/packem_shared/ScrollList-C7nZ9ufK.js +0 -1
- package/dist/packem_shared/ScrollView-DKZ8OM-m.js +0 -1
- package/dist/packem_shared/Static-DLynr5pn.js +0 -1
- package/dist/packem_shared/TreeNodeMap-CspqSCpb.js +0 -1
- package/dist/packem_shared/TreeView-C0Iv3et8.js +0 -1
- package/dist/packem_shared/TuiApp-BVDXP0Cv.js +0 -1
- package/dist/packem_shared/TuiContext-BoJvG3NN.js +0 -3
- package/dist/packem_shared/ansi-parser-B6uXaq65.js +0 -1
- package/dist/packem_shared/ansi-tokenizer-DqX9nJuk.js +0 -1
- package/dist/packem_shared/braille-BBjIoaN0.js +0 -1
- package/dist/packem_shared/colorize-DbTZMrJO.js +0 -1
- package/dist/packem_shared/comparePoints-C3NJirbh.js +0 -1
- package/dist/packem_shared/controlled-scroll-view-CcUS50jx.js +0 -1
- package/dist/packem_shared/createInlineLoop-DRNZ7jqH.js +0 -2
- package/dist/packem_shared/createScreen-CrLrxA6t.js +0 -3
- package/dist/packem_shared/dom-CXB-19sK.js +0 -1
- package/dist/packem_shared/format-time-C7Q-hQZq.js +0 -1
- package/dist/packem_shared/getScrollHeight-ClEOyLHH.js +0 -1
- package/dist/packem_shared/input-utils-fAxzSlNh.js +0 -1
- package/dist/packem_shared/isIntersecting-B3KbKTmu.js +0 -1
- package/dist/packem_shared/isOsc52Supported-DKK7Uee6.js +0 -1
- package/dist/packem_shared/isTerminalPaletteQuerySupported-Dn2hFAZ_.js +0 -1
- package/dist/packem_shared/kittyFlags-C3rZLbcK.js +0 -1
- package/dist/packem_shared/layout-BMo200nF.js +0 -2
- package/dist/packem_shared/line-chart-kf7uhR0K.js +0 -1
- package/dist/packem_shared/measure-text-Ce2widM1.js +0 -3
- package/dist/packem_shared/measureElement-BTtTFZg4.js +0 -1
- package/dist/packem_shared/parseSgrMouse-Ccj70ijb.js +0 -1
- package/dist/packem_shared/processLayout-FEKj_mWu.js +0 -1
- package/dist/packem_shared/reconciler-DIfG72R9.js +0 -1
- package/dist/packem_shared/reconciler-DYE5h4K4.js +0 -1
- package/dist/packem_shared/render-BRR1ESvR.js +0 -26
- package/dist/packem_shared/render-Dh7HMhK1.js +0 -1
- package/dist/packem_shared/renderToString-BbQiRHrd.js +0 -2
- package/dist/packem_shared/renderToString-vEQyGmv6.js +0 -4
- package/dist/packem_shared/renderTreeToBuffer-CZilzyhN.js +0 -2
- package/dist/packem_shared/renderer-maLLQcut.js +0 -17
- package/dist/packem_shared/setEnableStyledLineCache-DSbMbENc.js +0 -1
- package/dist/packem_shared/squashTextNodesWithMap-DCdi3SZ2.js +0 -1
- package/dist/packem_shared/stderr-context-BzEaUICS.js +0 -1
- package/dist/packem_shared/stdin-context-BTaaFagk.js +0 -1
- package/dist/packem_shared/text-width-BU2eeTWn.js +0 -2
- package/dist/packem_shared/token-to-elements-BAZpNZsu.js +0 -1
- package/dist/packem_shared/treeViewTheme-1RIZyB4M.js +0 -1
- package/dist/packem_shared/useElementDimensions-qJ_WXFZ9.js +0 -1
- package/dist/packem_shared/useMouseAction-2dRfU1vE.js +0 -1
- package/dist/packem_shared/useMouseContext-C746G7kY.js +0 -1
- package/dist/packem_shared/useMousePosition-BTWfV4JK.js +0 -1
- package/dist/packem_shared/useOnMouseClick-nY8xLZmt.js +0 -1
- package/dist/packem_shared/useOnMouseHover-D3DczIol.js +0 -1
- package/dist/packem_shared/useOnMouseState-cRK8QvzD.js +0 -1
- package/dist/packem_shared/useTreeView-BoMMeRPq.js +0 -1
- package/dist/packem_shared/useTreeViewState-CRPCUWrb.js +0 -1
- package/dist/packem_shared/utils-CoviI5Vm.js +0 -1
- package/dist/packem_shared/waitFor-Dj5zfL5s.js +0 -4
- package/dist/packem_shared/wrapOrTruncateStyledLine-C5rcIrNb.js +0 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsx as r,jsxs as f}from"react/jsx-runtime";import w from"../ink/hooks/use-window-size.js";import{Box as e}from"./box.js";import{Text as t}from"./text.js";function S({character:x,color:i,dimColor:l=!1,label:a,labelPadding:s=1,length:o,orientation:d="horizontal"}){const{columns:p}=w(),n=x??(d==="horizontal"?"─":"│");if(d==="vertical"){const m=o??1;return r(e,{flexDirection:"column",height:m,children:Array.from({length:m},(v,u)=>r(t,{color:i,dimColor:l,children:n},`divider-row-${u}`))})}const c=Math.min(500,o??Math.max(p,1));if(a===void 0)return r(e,{flexGrow:o===void 0?1:0,width:o,children:r(t,{color:i,dimColor:l,wrap:"truncate",children:n.repeat(c)})});const h=" ".repeat(s);return f(e,{flexGrow:o===void 0?1:0,width:o,children:[r(e,{flexGrow:1,flexShrink:1,children:r(t,{color:i,dimColor:l,wrap:"truncate",children:n.repeat(c)})}),r(e,{flexShrink:0,children:f(t,{color:i,dimColor:l,children:[h,a,h]})}),r(e,{flexGrow:1,flexShrink:1,children:r(t,{color:i,dimColor:l,wrap:"truncate",children:n.repeat(c)})})]})}export{S as Divider,S 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-BLS9nOPz.js";export{f as FilePicker,l as default};
|
package/dist/components/form.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsxs as m,jsx as r}from"react/jsx-runtime";import{Box as o}from"./box.js";import{Text as i}from"./text.js";const a=({children:e,description:d,error:l,isDisabled:n=!1,label:c,required:t=!1})=>m(o,{flexDirection:"column",marginBottom:1,children:[m(o,{children:[r(i,{bold:!0,dimColor:n,children:c}),t?r(i,{color:"red",children:" *"}):void 0]}),r(o,{marginTop:0,children:e}),l===void 0?d===void 0?void 0:r(i,{dimColor:!0,children:d}):r(i,{color:"red",children:l})]}),x=Object.assign(({accentColor:e="blue",bordered:d=!0,children:l,description:n,footer:c,title:t,width:h})=>{const s=m(o,{flexDirection:"column",children:[t===void 0?void 0:r(o,{marginBottom:1,children:r(i,{bold:!0,color:e,children:t})}),n===void 0?void 0:r(o,{marginBottom:1,children:r(i,{dimColor:!0,children:n})}),r(o,{flexDirection:"column",children:l}),c===void 0?void 0:r(o,{marginTop:1,children:c})]});return d?r(o,{borderColor:e,borderStyle:"round",flexDirection:"column",paddingX:1,paddingY:1,width:h,children:s}):r(o,{flexDirection:"column",width:h,children:s})},{Field:a});export{x as Form,a as FormField,x as default};
|
package/dist/components/gauge.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsxs as C,jsx as l}from"react/jsx-runtime";import{useMemo as q}from"react";import{c as T}from"../packem_shared/braille-ch3O5D7I.js";import{Box as s}from"./box.js";import{Canvas as U}from"./canvas.js";import{Text as x}from"./text.js";const W={large:{cols:40,rows:10},medium:{cols:24,rows:6},small:{cols:16,rows:4}},X=.9,_=2,Y=r=>String(Math.round(r)),z=(r,m,c,e)=>{const t=m+(c-m)*e;for(const f of r)if(t<=f.max)return f;return r[r.length-1]};function no({backgroundColor:r="gray",formatValue:m=Y,label:c,max:e=100,min:t=0,showLegend:f=!1,showValue:j=!0,size:b="medium",thresholds:n,value:P}){const{cols:A,rows:E}=W[b],I=Math.max(t,Math.min(e,P)),F=e-t||1,M=(I-t)/F,d=q(()=>{if(!(n===void 0||n.length===0))return[...n].toSorted((o,h)=>o.max-h.max)},[n]),k=q(()=>{if(d!==void 0)return z(d,t,e,M)},[d,t,e,M]),G=m(I);return C(s,{flexDirection:"column",children:[l(U,{draw:o=>{o.clear();const h=o.width*2,B=o.height*4,w=h/2,v=B-1,H=h/2-1,J=B-1,g=Math.max(1,Math.min(H,J)),y=new Map,D=i=>{const a=y.get(i);if(a!==void 0)return a;const u=T(o.width,o.height);return y.set(i,u),u},L=Math.max(32,Math.round(Math.PI*g)*_);for(let i=0;i<=L;i+=1){const a=i/L,u=Math.PI*(1-a),Q=Math.round(w+g*Math.cos(u)),R=Math.round(v-g*Math.sin(u));let p;a>M?p=r:d?p=z(d,t,e,a)?.color??"cyan":p="cyan",D(p).plotPoint(Q,R)}const S=g*X,V=Math.PI*(1-M),K=Math.round(w+S*Math.cos(V)),N=Math.round(v-S*Math.sin(V)),O=k?.color??"white";D(O).plotLine(Math.round(w),Math.round(v),K,N);for(const[i,a]of y)a.flush(o,{color:i})},height:E,version:[P,t,e,b,n,r],width:A}),j||c?C(s,{flexDirection:"column",children:[c===void 0?void 0:l(s,{justifyContent:"center",children:l(x,{dimColor:!0,children:c})}),j?l(s,{justifyContent:"center",children:l(x,{bold:!0,color:k?.color??"white",children:G})}):void 0]}):void 0,f&&n&&n.length>0?l(s,{gap:2,justifyContent:"center",marginTop:1,children:n.map((o,h)=>C(s,{gap:1,children:[l(x,{color:o.color,children:"●"}),l(x,{dimColor:!0,children:o.label??`≤ ${o.max}`})]},h))}):void 0]})}export{no as Gauge,no as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsx as c,Fragment as C}from"react/jsx-runtime";import{strip as F}from"@visulima/ansi";import{multilineGradient as k}from"@visulima/colorize/gradient";import{useMemo as M,Children as g,isValidElement as G,cloneElement as b}from"react";import{Box as B}from"./box.js";import{Text as x}from"./text.js";import{Transform as y}from"./transform.js";const S={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"}}},O=o=>{let t=!1;const n=u=>{g.forEach(u,s=>{if(t||!G(s))return;if(s.type===B){t=!0;return}const f=s.props;Object.hasOwn(f,"children")&&n(f.children)})};return n(o),t},T=o=>Object.hasOwn(o,"children"),j=o=>typeof o=="string"||typeof o=="number",N=o=>o==null||typeof o=="boolean";function J({children:o,colors:t,name:n}){if(n&&t)throw new Error("The `name` and `colors` props are mutually exclusive");if(!n&&!t)throw new Error("Either `name` or `colors` prop must be provided");const u=M(()=>n?k(S[n].colors,S[n].options):k(t??[]),[n,t]),s=h=>u(F(h)),f=g.count(o);if(j(o))return c(y,{transform:s,children:o});if(f===1&&!O(o))return c(y,{transform:s,children:o});const m=h=>{const i=[];let a="",v=0;const w=()=>{const r=`gradient-node-${String(v)}`;return v+=1,r},l=(r,e)=>{i.push(c(y,{transform:s,children:r},e))},E=()=>{if(a==="")return;const r=a;a="",l(c(x,{children:r}),w())};return g.forEach(h,r=>{if(!N(r)){if(j(r)){a+=String(r);return}if(E(),G(r)){const e=r.key??w(),p=r.props;if(r.type===x){l(r,e);return}if(r.type===B){if(T(p)){const d=p.children;i.push(b(r,{key:e},m(d)));return}i.push(b(r,{key:e}));return}if(T(p)){const d=p.children;if(!O(d)){l(r,e);return}i.push(b(r,{key:e},m(d)));return}l(r,e);return}i.push(r)}}),E(),i};return c(C,{children:m(o)})}export{J as Gradient,J as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsx as l,jsxs as t}from"react/jsx-runtime";import{Box as c}from"./box.js";import{Text as a}from"./text.js";const s={1:"blueBright",2:"cyanBright",3:"magentaBright",4:"yellowBright",5:"green",6:"white"},d={1:"# ",2:"## ",3:"### ",4:"#### ",5:"##### ",6:"###### "};function g({children:e,color:o,level:r=1,underline:n=!1}){const i=o??s[r];return l(c,{flexDirection:"column",children:t(a,{bold:r<=2,color:i,underline:n,children:[d[r],e]})})}export{g as Heading,g as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsxs as C,jsx as a}from"react/jsx-runtime";import{useMemo as R}from"react";import{Box as m}from"./box.js";import{Canvas as A}from"./canvas.js";import{Text as M}from"./text.js";const B=["#0b1e4f","#1f3b96","#3258c8","#4e84ec","#78b0ff"];function G({cellWidth:s=2,character:k="█",columnLabels:p,data:t,max:c,min:l,palette:x=B,rowLabels:w,textColor:L}){const{cols:g,colWidth:f,extent:W,rows:u}=R(()=>{const e=t.length,r=t.reduce((n,o)=>Math.max(n,o.length),0);let i=l??1/0,d=c??-1/0;if(l===void 0||c===void 0)for(const n of t)for(const o of n)l===void 0&&o<i&&(i=o),c===void 0&&o>d&&(d=o);return{cols:r,colWidth:s,extent:{max:d,min:i},rows:e}},[t,l,c,s]),j=g*f,D=u;return C(m,{children:[w===void 0?void 0:a(m,{flexDirection:"column",marginRight:1,children:Array.from({length:u},(e,r)=>a(M,{dimColor:!0,children:w[r]??""},r))}),C(m,{flexDirection:"column",children:[a(A,{draw:e=>{e.clear();const{max:r,min:i}=W,d=r-i||1,n=x.length-1;for(let o=0;o<u;o+=1)for(let h=0;h<g;h+=1){const b=t[o]?.[h],H=b===void 0?void 0:x[Math.max(0,Math.min(n,Math.round((b-i)/d*n)))];for(let v=0;v<f;v+=1)e.setCell(h*f+v,o,k,{background:H,color:L})}},height:D,version:[t,x,s,l,c],width:j}),p===void 0?void 0:a(m,{children:p.map((e,r)=>a(m,{width:f,children:a(M,{dimColor:!0,wrap:"truncate-end",children:e})},r))})]})]})}export{G as Heatmap,G as default};
|
package/dist/components/help.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsx as e,jsxs as m}from"react/jsx-runtime";import w from"../ink/hooks/use-window-size.js";import{Box as a}from"./box.js";import{Text as i}from"./text.js";const f={backspace:"backspace",delete:"del",downArrow:"↓",end:"end",escape:"esc",home:"home",leftArrow:"←",pageDown:"pgdn",pageUp:"pgup",return:"enter",rightArrow:"→",tab:"tab",upArrow:"↑"};function y(r){const o=r.indexOf("+");if(o!==-1){const n=r.slice(0,o),t=r.slice(o+1);return`${n}+${f[t]??t}`}return f[r]??r}function C(r){return(typeof r=="string"?[r]:r).map(o=>y(o)).join("/")}function B({bindings:r,descriptionColor:o,keyColor:n="cyan",maxColumns:t=3,mode:s="short",separator:l=" · "}){const{columns:p}=w();return s==="full"?$(r,{columns:p,descriptionColor:o,keyColor:n,maxColumns:t}):b(r,{columns:p,descriptionColor:o,keyColor:n,separator:l})}function b(r,o){const n=[];let t=0;for(const[s,l]of r.entries()){const p=C(l.key),d=`${p} ${l.description}`,c=(s>0?o.separator.length:0)+d.length;if(t+c>o.columns&&n.length>0)break;s>0&&n.push(e(i,{dimColor:!0,children:o.separator},`sep-${s}`)),n.push(m(a,{children:[e(i,{color:o.keyColor,children:p}),e(i,{children:" "}),o.descriptionColor?e(i,{color:o.descriptionColor,children:l.description}):e(i,{dimColor:!0,children:l.description})]},`pair-${s}`)),t+=c}return e(a,{flexDirection:"row",children:n})}function $(r,o){const n=new Map;for(const d of r){const c=d.group??"";n.has(c)||n.set(c,[]),n.get(c).push(d)}const t=[...n.entries()],s=Math.min(o.maxColumns,t.length||1),l=Math.floor(o.columns/s),p=[];for(const[d,[c,g]]of t.entries()){const u=[];c&&u.push(e(i,{bold:!0,children:c},"title"));for(const[x,h]of g.entries()){const k=C(h.key);u.push(m(a,{children:[e(i,{color:o.keyColor,children:k}),e(i,{children:" "}),o.descriptionColor?e(i,{color:o.descriptionColor,children:h.description}):e(i,{dimColor:!0,children:h.description})]},`b-${x}`))}p.push(e(a,{flexDirection:"column",width:l,children:u},`col-${d}`))}return e(a,{flexDirection:"row",children:p})}export{B as Help,B as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsx as g}from"react/jsx-runtime";import{useMemo as d}from"react";import{BarChart as b}from"./bar-chart.js";const p=(l,t,o)=>{if(o<=0||l>=t)return[l,t];const s=(t-l)/o;return Array.from({length:o+1},(n,r)=>l+r*s)},c=(l,t)=>{if(t.length<2)return[];const o=Array.from({length:t.length-1}).fill(0),s=t[0],n=t[t.length-1];for(const r of l)if(!(r<s||r>n))for(let e=0;e<t.length-1;e+=1){const a=e===t.length-2,h=t[e+1];if(r<h||a&&r<=h){o[e]=(o[e]??0)+1;break}}return o.map((r,e)=>{const a=t[e],h=t[e+1];return{count:r,label:`${Math.round(a)}-${Math.round(h)}`}})};function x({bins:l=10,color:t,data:o,height:s=10,max:n,min:r,showValues:e=!1,thresholds:a,width:h}){const m=d(()=>{if(a&&a.length>=2)return c(o,a);if(o.length===0)return[];let i=r??1/0,f=n??-1/0;if(r===void 0||n===void 0)for(const u of o)r===void 0&&u<i&&(i=u),n===void 0&&u>f&&(f=u);return i===f?[{count:o.length,label:i.toString()}]:c(o,p(i,f,l))},[o,a,l,r,n]);return g(b,{data:m.map(i=>({color:t,label:i.label,value:i.count})),height:s,orientation:"vertical",showLabels:!0,showValues:e,width:h})}export{x as Histogram,x as default};
|
package/dist/components/kbd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsxs as i,jsx as l}from"react/jsx-runtime";import{Box as n}from"./box.js";import{Text as d}from"./text.js";function s({children:r,color:o="gray",variant:e="solid"}){return e==="solid"?i(d,{backgroundColor:o,color:"black",children:[" ",r," "]}):e==="outline"?l(n,{borderColor:o,borderStyle:"round",paddingX:1,children:l(d,{color:o,children:r})}):l(d,{dimColor:!0,children:r})}export{s as Kbd,s as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"react/jsx-runtime";import"react";import"../packem_shared/braille-
|
|
1
|
+
import"react/jsx-runtime";import"react";import"../packem_shared/braille-ch3O5D7I.js";import"./box.js";import"./canvas.js";import{h as s,h as n,d,a as h}from"../packem_shared/line-chart-C7CUrvVs.js";import"./text.js";export{s as LineChart,n as default,d as drawSeriesOnCanvas,h as projectPoint};
|
package/dist/components/link.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsx as i}from"react/jsx-runtime";import{hyperlink as u}from"@visulima/ansi";import{useCallback as c}from"react";import{Text as f}from"./text.js";import{Transform as a}from"./transform.js";let n;const m=()=>{if(!process.stdout.isTTY)return!1;const o=process.env.TERM_PROGRAM??"",r=process.env.TERM_PROGRAM_VERSION??"";if(o==="iTerm.app")return Number.parseInt(r.split(".")[0]??"0",10)>=3;if(o==="WezTerm"||o==="ghostty")return!0;if(o==="vscode"){const s=r.split("."),t=Number.parseInt(s[0]??"0",10),p=Number.parseInt(s[1]??"0",10);return t>1||t===1&&p>=72}if(process.env.WT_SESSION)return!0;const e=process.env.VTE_VERSION;if(e){const s=Number.parseInt(e,10);return s>=5e3&&s!==5e3}return!1},l=()=>process.env.FORCE_HYPERLINK?process.env.FORCE_HYPERLINK!=="0":(n!==void 0||(n=m()),n);function v({children:o,fallback:r=!0,url:e}){const s=c(t=>l()?u(t,e):r===!1?t:typeof r=="function"?r(t,e):`${t} ${e}`,[r,e]);return i(a,{transform:s,children:i(f,{children:o})})}export{v as Link,v as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsxs as a,jsx as o}from"react/jsx-runtime";import{Box as c}from"./box.js";import{Spinner as d}from"./spinner.js";import{Text as i}from"./text.js";function m({children:r,color:n="cyan",type:t="dots"}){return a(c,{gap:1,children:[o(i,{color:n,children:o(d,{type:t})}),r===void 0?void 0:o(i,{color:n,children:r})]})}export{m as LoadingIndicator,m as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsx as r,jsxs as x}from"react/jsx-runtime";import{Lexer as C}from"marked";import k,{useMemo as b}from"react";import D from"../ink/hooks/use-window-size.js";import{Box as l}from"./box.js";import{Code as F}from"./code.js";import{Link as M}from"./link.js";import{Newline as w}from"./newline.js";import{OrderedList as j}from"./ordered-list.js";import{Table as v}from"./table.js";import{Text as m}from"./text.js";import{UnorderedList as B}from"./unordered-list.js";const q={1:"cyan",2:"green",3:"yellow",4:"blue",5:"magenta",6:"gray"};function p(c){return!c||c.length===0?null:c.map((a,t)=>{switch(a.type){case"br":return r(w,{},t);case"codespan":return x(m,{inverse:!0,children:[" ",a.text," "]},t);case"del":return r(m,{strikethrough:!0,children:p(a.tokens)},t);case"em":return r(m,{italic:!0,children:p(a.tokens)},t);case"escape":return r(k.Fragment,{children:a.text},t);case"image":{const e=a;return x(m,{dimColor:!0,children:["[image:"," ",e.text||e.href,"]"]},t)}case"link":{const e=a;return r(M,{url:e.href,children:p(e.tokens)??e.text},t)}case"strong":return r(m,{bold:!0,children:p(a.tokens)},t);case"text":return r(k.Fragment,{children:a.text},t);default:{const e="raw"in a?a.raw:"";return r(k.Fragment,{children:e},t)}}})}function T(c){return c.map(a=>{const t=a.tokens??[],e=t.find(i=>i.type==="text"),n=p(e?.tokens??t),h=t.find(i=>i.type==="list");return{children:h?T(h.items):void 0,label:n}})}function $(c,a,t){const e=[];for(const[n,h]of c.entries()){const i=h,s=n>0?1:0;switch(i.type){case"blockquote":{const o=i;e.push(r(l,{borderLeft:!0,borderLeftColor:"gray",marginTop:s,paddingLeft:1,children:r(l,{flexDirection:"column",children:$(o.tokens,a,t-3)})},n));break}case"code":{const o=i;e.push(r(l,{marginTop:s,children:r(F,{code:o.text,language:o.lang,theme:a})},n));break}case"heading":{const o=i,d=q[o.depth]??"white",g=`${"#".repeat(o.depth)} `;e.push(r(l,{marginTop:s,children:x(m,{bold:!0,color:d,children:[g,p(o.tokens)]})},n));break}case"hr":{e.push(r(l,{marginTop:s,children:r(m,{dimColor:!0,children:"─".repeat(Math.min(t,40))})},n));break}case"html":{const o=i.text.replaceAll(/<[^>]*>/g,"");o.trim()&&e.push(r(l,{marginTop:s,children:r(m,{dimColor:!0,children:o})},n));break}case"list":{const o=i,d=T(o.items);o.ordered?e.push(r(l,{marginTop:s,children:r(j,{items:d})},n)):e.push(r(l,{marginTop:s,children:r(B,{items:d})},n));break}case"paragraph":{const o=i;e.push(r(l,{marginTop:s,children:r(m,{wrap:"wrap",children:p(o.tokens)})},n));break}case"space":{e.push(r(w,{},n));break}case"table":{const o=i,d=(o.header??[]).map(u=>u.text),g=(o.rows??[]).map(u=>u.map(f=>f.text)).map(u=>{const f={};return d.forEach((y,L)=>{f[y]=u[L]??""}),f});e.push(r(l,{marginTop:s,children:r(v,{data:g})},n));break}default:{const o="raw"in i?i.raw:"",d="text"in i?i.text:o;d&&e.push(r(l,{marginTop:s,children:r(m,{children:d})},n));break}}}return e}function A(c,a){const t=C.lex(c);if(!a||c.length===0)return t;let e=0;for(const n of t)e+=n.raw?.length??0;if(e<c.length){const n=c.slice(e);n.trim().length>0&&t.push({raw:n,text:n,tokens:[{raw:n,text:n,type:"text"}],type:"paragraph"})}return t}function P({children:c,codeTheme:a="github-dark-default",maxWidth:t,streaming:e=!1}){const{columns:n}=D(),h=t??n??80,i=b(()=>A(c,e),[c,e]),s=b(()=>$(i,a,h),[i,a,h]);return r(l,{flexDirection:"column",children:s})}export{P as Markdown,P as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsxs as T,jsx as x}from"react/jsx-runtime";import{useMemo as V,useState as M,useCallback as A}from"react";import B from"../ink/hooks/use-input.js";import{Box as D}from"./box.js";import{Text as C}from"./text.js";const I=(m,n)=>{const s=[];let i=0;for(const[l,o]of[...m].entries())o===n&&(s.push({maskColumn:l,rawPosition:i}),i+=1);return s},L=(m,n,s,i)=>{let l=0,o="";for(const f of n)if(f===s){const u=m[l];u===void 0?o+=i:(o+=u,l+=1)}else o+=f;return o};function F({defaultValue:m="",isDisabled:n=!1,mask:s,onChange:i,onSubmit:l,placeholderChar:o="_",token:f="#"}){const u=V(()=>I(s,f),[s,f]),h=u.length,b=m.slice(0,h),[e,v]=M(b),[t,d]=M(b.length),g=A((c,r)=>{v(c),d(Math.max(0,Math.min(h,r))),i?.(c)},[h,i]);B(A((c,r)=>{if(r.return){l?.(e);return}if(r.leftArrow){d(a=>Math.max(0,a-1));return}if(r.rightArrow){d(a=>Math.min(e.length,a+1));return}if(r.home||r.ctrl&&c==="a"){d(0);return}if(r.end||r.ctrl&&c==="e"){d(e.length);return}if(r.backspace){if(t===0)return;const a=e.slice(0,t-1)+e.slice(t);g(a,t-1);return}if(r.delete){if(t>=e.length)return;const a=e.slice(0,t)+e.slice(t+1);g(a,t);return}if(c.length!==1||e.length>=h)return;const S=e.slice(0,t)+c+e.slice(t);g(S,t+1)},[e,t,h,g,l]),{isActive:!n});const p=L(e,s,f,o),k=u[t]?.maskColumn??s.length,w=p.slice(0,k),j=p.charAt(k)||" ",P=p.slice(k+1);return T(D,{children:[x(C,{dimColor:n,children:w}),x(C,{dimColor:n,inverse:!n,children:j}),x(C,{dimColor:n,children:P})]})}export{F as MaskedInput,F as default};
|
package/dist/components/menu.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsxs as b,jsx as l}from"react/jsx-runtime";import{useMemo as g,useState as A,useRef as F,useEffect as j,useCallback as y}from"react";import M from"../ink/hooks/use-focus.js";import $ from"../ink/hooks/use-input.js";import{Box as m}from"./box.js";import{Text as f}from"./text.js";const B=(t,r)=>{if(r&&r.length>0){const o=[];for(const i of r){i.title!==void 0&&o.push({kind:"section-header",sectionId:i.id,title:i.title});for(const d of i.items)o.push({item:d,kind:"item",sectionId:i.id})}return o}return(t??[]).map(o=>({item:o,kind:"item",sectionId:void 0}))},w=(t,r,o)=>{const i=t.length;if(i===0)return r;for(let d=1;d<=i;d+=1){const a=(r+o*d+i*d)%i,h=t[a];if(h?.kind==="item"&&!h.item.isDisabled)return a}return r},I=t=>{for(const[r,o]of t.entries())if(o.kind==="item"&&!o.item.isDisabled)return r;return 0};function W({accentColor:t="blue",autoFocus:r=!1,bordered:o=!0,items:i,onSelect:d,sections:a,title:h}){const{isFocused:p}=M({autoFocus:r}),n=g(()=>B(i,a),[i,a]),S=g(()=>I(n),[n]),[k,v]=A(S),u=F(k);u.current=k,j(()=>{const{current:s}=u,c=n[s];if(!(c?.kind==="item"&&!c.item.isDisabled)){const e=I(n);v(e),u.current=e}},[n]),$(y((s,c)=>{if(p){if(c.downArrow||s==="j")v(w(n,u.current,1));else if(c.upArrow||s==="k")v(w(n,u.current,-1));else if(c.return){const e=n[u.current];e?.kind==="item"&&!e.item.isDisabled&&d(e.item.id)}}},[p,n,d]),{isActive:p});const D=b(m,{flexDirection:"column",children:[h===void 0?void 0:l(m,{marginBottom:1,children:l(f,{bold:!0,color:t,children:h})}),n.map((s,c)=>{if(s.kind==="section-header")return l(m,{marginTop:c===0?0:1,children:l(f,{dimColor:!0,children:s.title.toUpperCase()})},`header:${s.sectionId}`);const{item:e}=s,x=p&&c===k,C=x?t:void 0;return b(m,{children:[l(f,{color:C,dimColor:e.isDisabled,children:x?"▸ ":" "}),e.icon===void 0?void 0:b(f,{color:C,dimColor:e.isDisabled,children:[e.icon," "]}),l(m,{flexGrow:1,flexShrink:1,minWidth:0,children:l(f,{bold:x,color:C,dimColor:e.isDisabled,wrap:"truncate-end",children:e.label})}),e.hotkey===void 0?void 0:l(m,{flexShrink:0,children:b(f,{dimColor:!0,children:[" ",e.hotkey]})})]},`item:${e.id}`)})]});return o?l(m,{borderColor:p?t:void 0,borderStyle:"round",paddingX:1,children:D}):D}export{W as Menu,W as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsxs as a,jsx as o}from"react/jsx-runtime";import{Box as i}from"./box.js";import{Text as e}from"./text.js";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 u({children:r,color:d,flat:s=!1,label:l,meta:n,role:g="assistant"}){const c=f[g],t=d??c.color;return a(i,{alignSelf:c.align,flexDirection:"column",marginBottom:1,children:[l===void 0&&n===void 0?void 0:a(i,{gap:1,paddingX:1,children:[l===void 0?void 0:o(e,{bold:!0,color:t,children:l}),n===void 0?void 0:o(e,{dimColor:!0,children:n})]}),s?a(i,{paddingX:1,children:[o(e,{color:t,children:"│ "}),o(i,{flexDirection:"column",flexGrow:1,children:typeof r=="string"?o(e,{children:r}):r})]}):o(i,{borderColor:t,borderStyle:"round",flexDirection:"column",paddingX:1,children:typeof r=="string"?o(e,{children:r}):r})]})}export{u as MessageBubble,u as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsxs as o,jsx as l,Fragment as u}from"react/jsx-runtime";import{Box as m}from"./box.js";import{Text as r}from"./text.js";function g({color:e="magenta",icon:i,model:c,provider:t,variant:a="solid"}){const s=d=>{const n=i===void 0?void 0:o(u,{children:[i," "]});return a==="outline"?l(m,{borderColor:e,borderStyle:"round",paddingX:1,children:o(r,{color:e,children:[n,d]})}):a==="subtle"?o(r,{color:e,children:[n,d]}):o(r,{backgroundColor:e,color:"black",children:[" ",n,d," "]})};return t===void 0?s(c):o(m,{children:[l(r,{dimColor:!0,children:t}),l(r,{dimColor:!0,children:"/"}),s(c)]})}export{g as ModelBadge,g as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsx as m,jsxs as S}from"react/jsx-runtime";import{useReducer as V,useState as B,useRef as f,useMemo as E,useCallback as F}from"react";import U from"../ink/hooks/use-input.js";import W from"../ink/hooks/use-window-size.js";import{Box as A}from"./box.js";import{Text as a}from"./text.js";const Y=[],q=(o,u)=>{switch(u.type){case"focus":return{...o,focusedIndex:u.index};case"focus-next":{const i=o.focusedIndex+1,c=i>=o.visibleFrom+u.limit;return{...o,focusedIndex:i,visibleFrom:c?o.visibleFrom+1:o.visibleFrom}}case"focus-prev":{const i=o.focusedIndex-1,c=i<o.visibleFrom;return{...o,focusedIndex:i,visibleFrom:c?o.visibleFrom-1:o.visibleFrom}}default:return o}};function N({accentColor:o="blue",defaultColor:u,defaultValue:i=Y,isDisabled:c=!1,isFocused:v=!0,limit:g,onChange:C,onSubmit:I,options:t}){const{rows:D}=W(),l=Math.min(typeof g=="number"?g:D,t.length),[s,w]=V(q,{focusedIndex:0,visibleFrom:0}),[b,k]=B(i),M=f(b);M.current=b;const j=f(I);j.current=I;const p=f(C);p.current=C;const x=f(s);x.current=s;const T=E(()=>t.slice(s.visibleFrom,s.visibleFrom+l),[t,s.visibleFrom,l]),y=F(()=>{const e=t[x.current.focusedIndex]?.value;e&&k(r=>{const n=r.includes(e)?r.filter(d=>d!==e):[...r,e];return p.current?.(n),n})},[t]),R=F(()=>{k(e=>{const r=e.length===t.length?[]:t.map(n=>n.value);return p.current?.(r),r})},[t]);return U(F((e,r)=>{const{focusedIndex:n}=x.current;(r.downArrow||e==="j")&&n<t.length-1&&w({limit:l,type:"focus-next"}),(r.upArrow||e==="k")&&n>0&&w({limit:l,type:"focus-prev"}),e===" "&&y(),e==="a"&&R(),r.return&&j.current?.(M.current)},[t.length,l,y,R]),{isActive:!c&&v}),m(A,{flexDirection:"column",children:T.map((e,r)=>{const n=s.visibleFrom+r===s.focusedIndex,d=b.includes(e.value);let h=u;return d?h="green":n&&(h=o),S(A,{gap:1,children:[n?m(a,{color:o,dimColor:!v,children:"▸"}):m(a,{children:" "}),S(a,{color:h,dimColor:c,children:[d?"◼":"◻"," ",e.label]}),d?m(a,{color:"green",dimColor:!v,children:"✓"}):void 0]},e.key??e.value)})})}export{N as MultiSelect,N as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
`.repeat(e)})}
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";function r({count:e=1}){return t("ink-text",{children:`
|
|
2
|
+
`.repeat(e)})}export{r as Newline,r as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsx as n,jsxs as s,Fragment as S}from"react/jsx-runtime";import{Box as t}from"./box.js";import{Spinner as k}from"./spinner.js";import{Text as o}from"./text.js";const w={completed:"green",error:"red",pending:"gray",running:"cyan",skipped:"yellow"},C={completed:"✔",error:"✖",pending:"○",skipped:"⊘"},y=e=>{if(e<1e3)return`${Math.round(e)}ms`;if(e<6e4)return`${(e/1e3).toFixed(1)}s`;const r=Math.round(e/1e3),i=Math.floor(r/60),d=r%60;return`${i}m ${d}s`},h=({isLast:e,node:r,prefix:i,showSpinner:d})=>{const p=w[r.status],c=e?"└─ ":"├─ ",u=i.length===0?"":c,l=i+(e?" ":"│ "),m=d?n(k,{type:"dots"}):"…",f=r.status==="running"?m:C[r.status];return s(S,{children:[s(t,{children:[n(o,{dimColor:!0,children:i}),n(o,{dimColor:!0,children:u}),n(t,{flexShrink:0,children:n(o,{color:p,children:f})}),n(o,{children:" "}),n(t,{flexGrow:1,flexShrink:1,minWidth:0,children:n(o,{bold:r.status==="running",color:r.status==="pending"?"gray":void 0,dimColor:r.status==="skipped",wrap:"truncate-end",children:r.label})}),r.durationMs===void 0?void 0:n(t,{flexShrink:0,children:s(o,{dimColor:!0,children:[" ",y(r.durationMs)]})})]}),r.details===void 0?void 0:s(t,{children:[n(o,{dimColor:!0,children:l}),n(o,{dimColor:!0,children:r.details})]}),r.children?.map((a,x,g)=>n(h,{isLast:x===g.length-1,node:a,prefix:l,showSpinner:d},a.id))]})};function T({nodes:e,showSpinner:r=!0}){return n(t,{flexDirection:"column",children:e.map((i,d)=>n(h,{isLast:d===e.length-1,node:i,prefix:"",showSpinner:r},i.id))})}export{T as OperationTree,T as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsx as i,jsxs as c}from"react/jsx-runtime";import{Box as r}from"./box.js";import{Text as o}from"./text.js";function x({accentColor:a="blue",bordered:h=!1,currentId:s,iconColumnWidth:d=2,options:f}){const l=i(r,{flexDirection:"column",children:f.map(n=>{const e=n.id===s,t=e?a:void 0;return c(r,{flexDirection:"column",children:[c(r,{children:[i(r,{flexShrink:0,width:d,children:i(o,{color:t,children:n.icon??(e?"▸":" ")})}),i(r,{flexGrow:1,flexShrink:1,minWidth:0,children:i(o,{bold:e,color:t,wrap:"truncate-end",children:n.label})}),n.trailing===void 0?void 0:i(r,{flexShrink:0,children:n.trailing})]}),n.description===void 0?void 0:i(r,{marginLeft:d,children:i(o,{dimColor:!0,wrap:"truncate-end",children:n.description})})]},n.id)})});return h?i(r,{borderStyle:"round",paddingX:1,children:l}):l}export{x as OptionList,x as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsx as e,jsxs as l}from"react/jsx-runtime";import{Box as n}from"./box.js";import{Text as c}from"./text.js";const d=(r,s)=>{const m=String(r.length).length;return e(n,{flexDirection:"column",children:r.map((t,i)=>{const a=`${String(i+1).padStart(m)}.`,o=`${s}${a}`;return l(n,{gap:1,children:[e(c,{dimColor:!0,children:o}),l(n,{flexDirection:"column",children:[e(c,{children:t.label}),t.children?d(t.children,o):void 0]})]},i)})})};function f({items:r}){return d(r,"")}export{f as OrderedList,f as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsxs as m,jsx as r}from"react/jsx-runtime";import{useState as j,useCallback as M}from"react";import k from"../ink/hooks/use-input.js";import{Box as p}from"./box.js";import{Text as e}from"./text.js";const D=({color:i,currentPage:c,style:u,totalPages:l})=>{if(u==="fraction")return m(e,{children:[r(e,{color:i,children:c+1}),m(e,{dimColor:!0,children:["/",l]})]});if(u==="numeric"){const h=c>0?r(e,{color:i,children:"‹ "}):r(e,{dimColor:!0,children:"‹ "}),n=c<l-1?r(e,{color:i,children:" ›"}):r(e,{dimColor:!0,children:" ›"});return m(p,{children:[h,r(e,{color:i,children:c+1}),m(e,{dimColor:!0,children:[" ","/",l]}),n]})}const d=Array.from({length:l},(h,n)=>n===c?r(e,{color:i,children:"●"},n):r(e,{dimColor:!0,children:"○"},n));return r(p,{gap:1,children:d})},L=({children:i,defaultPage:c=0,indicatorColor:u="cyan",isFocused:l=!0,items:d,onChange:h,page:n,pageSize:g,style:y="dots"})=>{const f=n!==void 0,[w,A]=j(c),v=f?n:w,o=Math.max(1,Math.ceil(d.length/g)),a=Math.max(0,Math.min(v,o-1)),s=M(C=>{const t=Math.max(0,Math.min(C,o-1));f||A(t),h?.(t)},[o,f,h]);k(M((C,t)=>{t.leftArrow||t.pageUp?s(a-1):t.rightArrow||t.pageDown?s(a+1):t.home?s(0):t.end&&s(o-1)},[a,o,s]),{isActive:l});const x=a*g,P=Math.min(x+g,d.length),I=d.slice(x,P),b={currentPage:a,endIndex:P,isFirstPage:a===0,isLastPage:a===o-1,startIndex:x,totalPages:o};return m(p,{flexDirection:"column",children:[i(I,b),o>1&&r(D,{color:u,currentPage:a,style:y,totalPages:o})]})};export{L as Paginator,L as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{Box as t}from"./box.js";import{Text as l}from"./text.js";function p({children:r,color:i,dimColor:m=!1,marginBottom:a=1,marginTop:n=0}){return o(t,{flexDirection:"column",marginBottom:a,marginTop:n,children:o(l,{color:i,dimColor:m,children:r})})}export{p as Paragraph,p as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import w from"../ink/hooks/use-animation.js";import g from"../ink/hooks/use-window-size.js";import{Box as i}from"./box.js";import{Text as v}from"./text.js";const y=[1,.85,.6];function C({animated:o=!0,character:l="█",color:m="gray",interval:c=500,rows:h=3,width:e,widths:r=y}){const{frame:d}=w({interval:c,isActive:o}),{columns:s}=g(),f=o&&d%2===0,u=e??Math.max(1,s);return t(i,{flexDirection:"column",width:e,children:Array.from({length:h},(M,a)=>{const p=r.length>0?r[a%r.length]??1:1,n=Math.max(1,Math.round(u*p)),x=l.repeat(n);return t(i,{width:n,children:t(v,{color:m,dimColor:f,wrap:"truncate-end",children:x})},a)})})}export{C as Placeholder,C as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsx as f}from"react/jsx-runtime";import l from"../ink/hooks/use-window-size.js";import{Text as p}from"./text.js";function d({character:a="█",columns:e=0,left:o=0,percent:m=1,right:i=0,rightPad:n=!1,...s}){const{columns:c}=l(),r=Math.max(0,(e||c||80)-i-o),t=Math.min(Math.floor(r*Math.max(0,Math.min(1,m))),r),h=a.repeat(t)+(n?" ".repeat(r-t):"");return f(p,{...s,children:h})}export{d as ProgressBar,d as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsx as h,jsxs as D}from"react/jsx-runtime";import{useState as z,useRef as G,useCallback as F}from"react";import S from"../ink/hooks/use-focus.js";import T from"../ink/hooks/use-input.js";import{Box as M}from"./box.js";import{Text as w}from"./text.js";const $=(x,s)=>{if(s===void 0)return 0;const l=x.findIndex(b=>b.value===s);return Math.max(l,0)};function E({accentColor:x="blue",autoFocus:s=!1,commitOnNavigate:l=!0,defaultValue:b,isDisabled:d=!1,onChange:A,onSubmit:k,options:t,orientation:i="vertical",value:m}){const{isFocused:a}=S({autoFocus:s,isActive:!d}),[C,R]=z(b??t[0]?.value),v=m??C,[g,j]=z(()=>$(t,v)),u=G(g);u.current=g;const c=F(r=>{const o=t[r];if(!o)return;const n=m??C;o.value!==n&&(m===void 0&&R(o.value),A?.(o.value))},[t,m,C,A]);return T(F((r,o)=>{if(!a)return;const n=t.length;if(n===0)return;const f=o.downArrow&&i==="vertical"||o.rightArrow&&i==="horizontal"||r==="j",p=o.upArrow&&i==="vertical"||o.leftArrow&&i==="horizontal"||r==="k";if(f){const e=Math.min(n-1,u.current+1);j(e),l&&c(e);return}if(p){const e=Math.max(0,u.current-1);j(e),l&&c(e);return}if(r===" "){c(u.current);return}if(o.return){l||c(u.current);const e=t[u.current]?.value??v;e!==void 0&&k?.(e)}},[a,t,i,c,l,v,k]),{isActive:!d&&a}),h(M,{flexDirection:i==="vertical"?"column":"row",gap:i==="vertical"?0:2,children:t.map((r,o)=>{const n=r.value===v,f=a&&o===g,p=(n||f)&&a?x:void 0;return D(M,{gap:1,children:[h(w,{color:p,dimColor:d,children:n?"●":"○"}),h(w,{bold:f,color:p,dimColor:d,children:r.label}),r.description===void 0?void 0:h(w,{dimColor:!0,children:r.description})]},r.key??r.value)})})}export{E as RadioGroup,E as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsxs as T,jsx as t}from"react/jsx-runtime";import{useMemo as h}from"react";import{Box as c}from"./box.js";import{Canvas as E}from"./canvas.js";import{t as f,p as g,c as y,D as b,d as C}from"../packem_shared/line-chart-C7CUrvVs.js";import{Text as N}from"./text.js";const S=b;function P({axisColor:a="gray",height:I=10,maxX:o,maxY:n,minX:m,minY:x,palette:s=S,series:l,showLegend:u=!0,width:p=40}){const d=h(()=>{const r=l.map((i,M)=>({color:g(i,M,s),points:f(i.data),series:i})),e=y(r);return{axisColor:a,palette:s,seriesList:r,xMax:o??(e.xMax===Number.NEGATIVE_INFINITY?1:e.xMax),xMin:m??(e.xMin===Number.POSITIVE_INFINITY?0:e.xMin),yMax:n??(e.yMax===Number.NEGATIVE_INFINITY?1:e.yMax),yMin:x??(e.yMin===Number.POSITIVE_INFINITY?0:e.yMin)}},[l,a,s,m,o,x,n]);return T(c,{flexDirection:"column",children:[t(E,{draw:r=>{C(r,"scatter",d)},height:I,version:[l,p,I,m,o,x,n,a,s],width:p}),u?t(c,{gap:2,marginTop:1,children:d.seriesList.map(({color:r,series:e},i)=>T(c,{gap:1,children:[t(N,{color:r,children:"●"}),t(N,{children:e.label??`Series ${i+1}`})]},`${i}:${e.label??""}`))}):void 0]})}export{P as ScatterPlot,P as default};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BoxProps as Props } from "./box.js";
|
|
3
3
|
import 'type-fest';
|
|
4
|
-
import "../packem_shared/dom.d-
|
|
4
|
+
import "../packem_shared/dom.d-B4kXbaVY.js";
|
|
5
5
|
import 'yoga-layout';
|
|
6
6
|
import "../packem_shared/cursor-helpers.d-BONB9tky.js";
|
|
7
7
|
import '@visulima/colorize';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ScrollBarBox as l}from"../packem_shared/ScrollBarBox-
|
|
1
|
+
import{ScrollBarBox as l}from"../packem_shared/ScrollBarBox-CBhLo6eZ.js";export{l as ScrollBarBox};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BoxProps as Props } from "./box.js";
|
|
3
3
|
import 'type-fest';
|
|
4
|
-
import "../packem_shared/dom.d-
|
|
4
|
+
import "../packem_shared/dom.d-B4kXbaVY.js";
|
|
5
5
|
import 'yoga-layout';
|
|
6
6
|
import "../packem_shared/cursor-helpers.d-BONB9tky.js";
|
|
7
7
|
import '@visulima/colorize';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ScrollBar as l}from"../packem_shared/ScrollBar-
|
|
1
|
+
import{ScrollBar as l}from"../packem_shared/ScrollBar-BKCK8jsb.js";export{l as ScrollBar};
|
|
@@ -2,7 +2,7 @@ import React, { Ref } from 'react';
|
|
|
2
2
|
import { a as ScrollViewProps, b as ScrollViewRef } from "../packem_shared/scroll-view.d-DtpsgHLg.js";
|
|
3
3
|
import "./box.js";
|
|
4
4
|
import 'type-fest';
|
|
5
|
-
import "../packem_shared/dom.d-
|
|
5
|
+
import "../packem_shared/dom.d-B4kXbaVY.js";
|
|
6
6
|
import 'yoga-layout';
|
|
7
7
|
import "../packem_shared/cursor-helpers.d-BONB9tky.js";
|
|
8
8
|
import '@visulima/colorize';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ScrollList as l}from"../packem_shared/ScrollList-
|
|
1
|
+
import{ScrollList as l}from"../packem_shared/ScrollList-DyFyVs6I.js";export{l as ScrollList};
|
|
@@ -2,7 +2,7 @@ export { S as ScrollView, type a as ScrollViewProps, type b as ScrollViewRef } f
|
|
|
2
2
|
import 'react';
|
|
3
3
|
import "./box.js";
|
|
4
4
|
import 'type-fest';
|
|
5
|
-
import "../packem_shared/dom.d-
|
|
5
|
+
import "../packem_shared/dom.d-B4kXbaVY.js";
|
|
6
6
|
import 'yoga-layout';
|
|
7
7
|
import "../packem_shared/cursor-helpers.d-BONB9tky.js";
|
|
8
8
|
import '@visulima/colorize';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ScrollView as e}from"../packem_shared/ScrollView-
|
|
1
|
+
import{ScrollView as e}from"../packem_shared/ScrollView-BEgrtSnt.js";export{e as ScrollView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsxs as u,jsx as e}from"react/jsx-runtime";import{Box as r}from"./box.js";import{Text as c}from"./text.js";import{TextInput as p}from"./text-input.js";function b({accentColor:o="blue",defaultValue:a="",icon:l="⌕",isDisabled:n=!1,onChange:t,onSubmit:s,placeholder:i="Search...",suggestions:d}){return u(r,{borderColor:o,borderStyle:"round",gap:1,paddingX:1,children:[e(c,{color:o,children:l}),e(r,{flexGrow:1,children:e(p,{defaultValue:a,isDisabled:n,onChange:t,onSubmit:s,placeholder:i,suggestions:d})})]})}export{b as SearchInput,b as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{Box as c}from"./box.js";import{Text as e}from"./text.js";function s({accentColor:o="blue",isFocused:t=!0,isSelected:i=!1}){return r(c,{marginRight:1,children:i?r(e,{color:o,dimColor:!t,children:"❯"}):r(e,{children:" "})})}export{s as SelectInputIndicator,s as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsx as a}from"react/jsx-runtime";import{Text as c}from"./text.js";function i({accentColor:o="blue",defaultColor:t,isFocused:l=!0,isSelected:e=!1,label:r}){return a(c,{color:e?o:t,dimColor:e&&!l,children:r})}export{i as SelectInputItem,i as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{createRequire as ee}from"node:module";import{jsx as F,jsxs as re}from"react/jsx-runtime";import{useReducer as se,useRef as v,useMemo as ce,useEffect as V,useCallback as R,createElement as X}from"react";import ie from"../ink/hooks/use-input.js";import ae from"../ink/hooks/use-window-size.js";import{Box as D}from"./box.js";import{SelectInputIndicator as le}from"./select-input-indicator.js";import{SelectInputItem as de}from"./select-input-item.js";import{Text as ue}from"./text.js";const te=ee(import.meta.url),M=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ne=n=>{if(typeof M<"u"&&M.versions&&M.versions.node){const[t,o]=M.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return M.getBuiltinModule(n)}return te(n)},{isDeepStrictEqual:oe}=ne("node:util"),h=n=>"isSeparator"in n&&n.isSeparator,fe=[],pe=/^[1-9]$/,l=-1,me="───",Ie=Symbol("separator"),xe=(n,t)=>{switch(t.type){case"navigate":return{rotateIndex:t.rotateIndex,selectedIndex:t.selectedIndex};case"reset":return{rotateIndex:0,selectedIndex:t.hasInitialSelection?t.initialIndex:l};case"set":return{rotateIndex:t.selectedIndex,selectedIndex:t.selectedIndex};default:return n}},ge=(n,t)=>{const{length:o}=n;if(o===0)return[];const u=(t%o+o)%o;return[...n.slice(u),...n.slice(0,u)]},b=(n,t,o,u)=>t?ge(n,o).slice(0,u):n,q=(n,t,o)=>{const{length:u}=n;for(let S=0;S<u;S+=1){const C=((t+(S+1)*o)%u+u)%u;if(!h(n[C]))return C}return l},Y=(n,t)=>{if(t<0||t>=n.length)return l;const o=n[t];return o&&!h(o)?t:q(n,t-1,1)};function Me({accentColor:n="blue",defaultColor:t,index:o,indicatorComponent:u=le,initialIndex:S,isFocused:C=!0,itemComponent:Z=de,items:r=fe,limit:E,onHighlight:f,onSelect:N,resetOnItemsChange:B=!0}){const{rows:Q}=ae(),H=typeof E=="number"?E:Q,s=r.length>H,d=s?Math.min(H,r.length):r.length,j=d-1,O=typeof o=="number"||typeof S=="number",P=typeof o=="number"?o:S??l,w=P===l?l:Y(r,Math.min(P,j)),[T,_]=se(xe,{rotateIndex:w>j?j-w:0,selectedIndex:w}),z=v(O),G=v(w),J=v(T);J.current=T;const A=v(N);A.current=N;const W=v(r),k=ce(()=>r.map(e=>h(e)?Ie:e.value),[r]),K=v(k);z.current=O,G.current=w,V(()=>{B&&!oe(K.current,k)&&_({hasInitialSelection:z.current,initialIndex:G.current,type:"reset"}),K.current=k,W.current=r},[r,k,B]),V(()=>{if(typeof o=="number"){const e=Y(r,Math.min(o,j));_({selectedIndex:e===l?0:e,type:"set"})}},[o,r,j]);const L=R((e,c)=>{const i=b(r,s,e,d);if(c===l){const x=q(i,0,-1);if(x===l)return;_({rotateIndex:e,selectedIndex:x,type:"navigate"}),typeof f=="function"&&f(i[x],x);return}const g=(s?d:r.length)-1,a=c===0,p=a?g:c-1,m=a&&s?e+1:e,y=b(r,s,m,d),I=h(y[p])?q(y,p,-1):p;I!==l&&(_({rotateIndex:m,selectedIndex:I,type:"navigate"}),typeof f=="function"&&f(y[I],I))},[s,d,r,f]),U=R((e,c)=>{const i=b(r,s,e,d);if(c===l){const x=q(i,i.length-1,1);if(x===l)return;_({rotateIndex:e,selectedIndex:x,type:"navigate"}),typeof f=="function"&&f(i[x],x);return}const g=(s?d:r.length)-1,a=c===g,p=a?0:c+1,m=a&&s?e-1:e,y=b(r,s,m,d),I=h(y[p])?q(y,p,1):p;I!==l&&(_({rotateIndex:m,selectedIndex:I,type:"navigate"}),typeof f=="function"&&f(y[I],I))},[s,d,r,f]);ie(R((e,c)=>{const{rotateIndex:i,selectedIndex:g}=J.current;if((e==="k"||c.upArrow)&&L(i,g),(e==="j"||c.downArrow)&&U(i,g),pe.test(e)){const a=Number.parseInt(e,10)-1,p=b(r,s,i,d);if(a>=0&&a<p.length){const m=p[a];m&&!h(m)&&(A.current?.(m),m.action?.())}}if(c.return&&g!==l){const a=b(r,s,i,d)[g];a&&!h(a)&&(A.current?.(a),a.action?.())}},[L,U,s,d,r]),{isActive:C});const $=b(r,s,T.rotateIndex,d);return F(D,{flexDirection:"column",children:$.map((e,c)=>{if(h(e))return F(D,{children:F(ue,{dimColor:!0,children:e.label??me})},e.key??`separator-${String(c)}`);const i=c===T.selectedIndex;return re(D,{children:[X(u,{accentColor:n,isFocused:C,isSelected:i}),X(Z,{...e,accentColor:n,defaultColor:t,isFocused:C,isSelected:i})]},e.key??String(e.value))})})}export{Me as SelectInput,Me as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{useMemo as f}from"react";import g from"../ink/hooks/use-animation.js";import{Text as i}from"./text.js";function j({bandWidth:m=3,color:r,highlightColor:a="white",interval:d=60,text:n}){const{frame:u}=g({interval:d}),t=f(()=>[...n],[n]),l=t.length,p=l+m,x=l===0?0:u%p,b=f(()=>t.map((o,c)=>e(i,{color:r,dimColor:r===void 0,children:o},c)),[t,r]);if(l===0)return e(i,{color:r,children:n});const h=[];for(const[o,c]of t.entries()){const s=x-o;if(!(s>=0&&s<m)){h.push(b[o]);continue}h.push(e(i,{bold:!0,color:a,children:c},`band-${o}`))}return e(i,{children:h})}export{j as ShimmerText,j as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsx as c,jsxs as H}from"react/jsx-runtime";import{useState as R,useRef as I,useCallback as J}from"react";import T from"../ink/hooks/use-input.js";import{Box as A}from"./box.js";import{Text as C}from"./text.js";const y=(u,d,x)=>Math.min(x,Math.max(d,u));function P({accentColor:u="green",defaultColor:d="gray",defaultValue:x=0,emptyCharacter:D="░",filledCharacter:j="█",isDisabled:e=!1,isFocused:K=!0,max:k=100,min:z=0,onChange:F,orientation:h="horizontal",step:m=1,thumbCharacter:N="●",value:q,width:L=20}){const o=Math.min(z,k),i=Math.max(z,k),b=q!==void 0,[O,Q]=R(y(x,o,i)),v=b?y(q,o,i):O,G=I(F);G.current=F;const s=I(v);s.current=v;const n=J(t=>{const r=y(t,o,i);b||Q(r),G.current?.(r)},[o,i,b]),w=m*10,f=i-o,S=J((t,r)=>{const M=h==="horizontal"?r.rightArrow:r.upArrow,p=h==="horizontal"?r.leftArrow:r.downArrow;if(M){n(s.current+m);return}if(p){n(s.current-m);return}if(r.pageUp){n(s.current+w);return}if(r.pageDown){n(s.current-w);return}if(r.home){n(o);return}if(r.end){n(i);return}if(t>="0"&&t<="9"){const E=Number.parseInt(t,10)/10;n(o+f*E)}},[m,w,o,i,f,h,n]);T(S,{isActive:K&&!e});const g=Math.max(1,L),V=f===0?0:(v-o)/f,l=Math.round(V*(g-1));if(h==="vertical"){const t=[];for(let r=g-1;r>=0;r--){const M=r===l,p=r<=l;t.push(c(A,{children:c(C,{color:e?void 0:p?u:d,dimColor:e,children:M?N:p?j:D})},r))}return c(A,{flexDirection:"column",children:t})}let a="";for(let t=0;t<g;t++)t===l?a+=N:t<l?a+=j:a+=D;const W=a.slice(0,l),$=a[l]??"",B=a.slice(l+1);return H(A,{children:[c(C,{color:e?void 0:u,dimColor:e,children:W}),c(C,{bold:!0,color:e?void 0:u,dimColor:e,children:$}),c(C,{color:e?void 0:d,dimColor:e,children:B})]})}export{P as Slider,P as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{Box as o}from"./box.js";function a(){return r(o,{flexGrow:1})}export{a as Spacer,a as default};
|