@visulima/tui 1.0.0-alpha.9 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +650 -0
- package/LICENSE.md +2414 -187
- package/README.md +49 -4
- package/dist/components/accordion.d.ts +59 -0
- package/dist/components/accordion.js +1 -0
- package/dist/components/alert.d.ts +26 -0
- package/dist/components/alert.js +1 -0
- package/dist/components/animate-presence.d.ts +18 -0
- package/dist/components/animate-presence.js +1 -0
- package/dist/components/approval-prompt.d.ts +65 -0
- package/dist/components/approval-prompt.js +1 -0
- package/dist/components/area-chart.d.ts +66 -0
- package/dist/components/area-chart.js +1 -0
- package/dist/components/badge.d.ts +22 -0
- package/dist/components/badge.js +1 -0
- package/dist/components/bar-chart.d.ts +67 -0
- package/dist/components/bar-chart.js +1 -0
- package/dist/components/big-text.d.ts +81 -0
- package/dist/components/big-text.js +1 -0
- package/dist/components/blink-dot.d.ts +36 -0
- package/dist/components/blink-dot.js +1 -0
- package/dist/components/box.d.ts +62 -0
- package/dist/components/box.js +1 -0
- package/dist/components/breadcrumb.d.ts +33 -0
- package/dist/components/breadcrumb.js +1 -0
- package/dist/components/button.d.ts +45 -0
- package/dist/components/button.js +1 -0
- package/dist/components/calendar.d.ts +72 -0
- package/dist/components/calendar.js +1 -0
- package/dist/components/canvas.d.ts +44 -0
- package/dist/components/canvas.js +1 -0
- package/dist/components/card.d.ts +57 -0
- package/dist/components/card.js +1 -0
- package/dist/components/checkbox.d.ts +48 -0
- package/dist/components/checkbox.js +1 -0
- package/dist/components/code.d.ts +48 -0
- package/dist/components/code.js +2 -0
- package/dist/components/collapsible.d.ts +53 -0
- package/dist/components/collapsible.js +1 -0
- package/dist/components/command-block.d.ts +47 -0
- package/dist/components/command-block.js +4 -0
- package/dist/components/command-palette.d.ts +82 -0
- package/dist/components/command-palette.js +1 -0
- package/dist/components/confirm-dialog.d.ts +75 -0
- package/dist/components/confirm-dialog.js +1 -0
- package/dist/components/confirm-input.d.ts +38 -0
- package/dist/components/confirm-input.js +1 -0
- package/dist/components/console-overlay.d.ts +54 -0
- package/dist/components/console-overlay.js +1 -0
- package/dist/components/content-switcher.d.ts +57 -0
- package/dist/components/content-switcher.js +1 -0
- package/dist/components/controlled-scroll-view.d.ts +61 -0
- package/dist/components/controlled-scroll-view.js +1 -0
- package/dist/components/cursor.d.ts +62 -0
- package/dist/components/cursor.js +1 -0
- package/dist/components/date-picker.d.ts +65 -0
- package/dist/components/date-picker.js +1 -0
- package/dist/components/definition-list.d.ts +44 -0
- package/dist/components/definition-list.js +1 -0
- package/dist/components/dialog.d.ts +117 -0
- package/dist/components/dialog.js +1 -0
- package/dist/components/diff-view.d.ts +85 -0
- package/dist/components/diff-view.js +1 -0
- package/dist/components/divider.d.ts +49 -0
- package/dist/components/divider.js +1 -0
- package/dist/components/file-picker-entry.d.ts +104 -0
- package/dist/components/file-picker-entry.js +1 -0
- package/dist/components/form.d.ts +81 -0
- package/dist/components/form.js +1 -0
- package/dist/components/gauge.d.ts +87 -0
- package/dist/components/gauge.js +1 -0
- package/dist/components/gradient.d.ts +42 -0
- package/dist/components/gradient.js +1 -0
- package/dist/components/heading.d.ts +33 -0
- package/dist/components/heading.js +1 -0
- package/dist/components/heatmap.d.ts +62 -0
- package/dist/components/heatmap.js +1 -0
- package/dist/components/help.d.ts +52 -0
- package/dist/components/help.js +1 -0
- package/dist/components/histogram.d.ts +62 -0
- package/dist/components/histogram.js +1 -0
- package/dist/components/kbd.d.ts +31 -0
- package/dist/components/kbd.js +1 -0
- package/dist/components/line-chart.d.ts +109 -0
- package/dist/components/line-chart.js +1 -0
- package/dist/components/link.d.ts +38 -0
- package/dist/components/link.js +1 -0
- package/dist/components/loading-indicator.d.ts +29 -0
- package/dist/components/loading-indicator.js +1 -0
- package/dist/components/markdown.d.ts +40 -0
- package/dist/components/markdown.js +1 -0
- package/dist/components/masked-input.d.ts +50 -0
- package/dist/components/masked-input.js +1 -0
- package/dist/components/menu.d.ts +78 -0
- package/dist/components/menu.js +1 -0
- package/dist/components/message-bubble.d.ts +43 -0
- package/dist/components/message-bubble.js +1 -0
- package/dist/components/model-badge.d.ts +39 -0
- package/dist/components/model-badge.js +1 -0
- package/dist/components/multi-select.d.ts +65 -0
- package/dist/components/multi-select.js +1 -0
- package/dist/components/newline.d.ts +15 -0
- package/dist/components/newline.js +2 -0
- package/dist/components/operation-tree.d.ts +49 -0
- package/dist/components/operation-tree.js +1 -0
- package/dist/components/option-list.d.ts +47 -0
- package/dist/components/option-list.js +1 -0
- package/dist/components/ordered-list.d.ts +24 -0
- package/dist/components/ordered-list.js +1 -0
- package/dist/components/paginator.d.ts +69 -0
- package/dist/components/paginator.js +1 -0
- package/dist/components/paragraph.d.ts +38 -0
- package/dist/components/paragraph.js +1 -0
- package/dist/components/placeholder.d.ts +55 -0
- package/dist/components/placeholder.js +1 -0
- package/dist/components/progress-bar.d.ts +56 -0
- package/dist/components/progress-bar.js +1 -0
- package/dist/components/radio-group.d.ts +74 -0
- package/dist/components/radio-group.js +1 -0
- package/dist/components/scatter-plot.d.ts +35 -0
- package/dist/components/scatter-plot.js +1 -0
- package/dist/components/scroll-bar-box.d.ts +37 -0
- package/dist/components/scroll-bar-box.js +1 -0
- package/dist/components/scroll-bar.d.ts +25 -0
- package/dist/components/scroll-bar.js +1 -0
- package/dist/components/scroll-list.d.ts +20 -0
- package/dist/components/scroll-list.js +1 -0
- package/dist/components/scroll-view.d.ts +10 -0
- package/dist/components/scroll-view.js +1 -0
- package/dist/components/search-input.d.ts +55 -0
- package/dist/components/search-input.js +1 -0
- package/dist/components/select-input-indicator.d.ts +32 -0
- package/dist/components/select-input-indicator.js +1 -0
- package/dist/components/select-input-item.d.ts +41 -0
- package/dist/components/select-input-item.js +1 -0
- package/dist/components/select-input.d.ts +110 -0
- package/dist/components/select-input.js +1 -0
- package/dist/components/shimmer-text.d.ts +47 -0
- package/dist/components/shimmer-text.js +1 -0
- package/dist/components/slider.d.ts +103 -0
- package/dist/components/slider.js +1 -0
- package/dist/components/spacer.d.ts +8 -0
- package/dist/components/spacer.js +1 -0
- package/dist/components/sparkline.d.ts +35 -0
- package/dist/components/sparkline.js +1 -0
- package/dist/components/spinner.d.ts +17 -0
- package/dist/components/spinner.js +1 -0
- package/dist/components/static-render.d.ts +55 -0
- package/dist/components/static-render.js +1 -0
- package/dist/components/static.d.ts +29 -0
- package/dist/components/static.js +1 -0
- package/dist/components/status-line.d.ts +37 -0
- package/dist/components/status-line.js +1 -0
- package/dist/components/status-message.d.ts +21 -0
- package/dist/components/status-message.js +1 -0
- package/dist/components/stepper.d.ts +48 -0
- package/dist/components/stepper.js +1 -0
- package/dist/components/stopwatch.d.ts +49 -0
- package/dist/components/stopwatch.js +1 -0
- package/dist/components/streaming-text.d.ts +46 -0
- package/dist/components/streaming-text.js +1 -0
- package/dist/components/switch.d.ts +55 -0
- package/dist/components/switch.js +1 -0
- package/dist/components/tab.d.ts +19 -0
- package/dist/components/tab.js +1 -0
- package/dist/components/table.d.ts +119 -0
- package/dist/components/table.js +1 -0
- package/dist/components/tabs.d.ts +107 -0
- package/dist/components/tabs.js +1 -0
- package/dist/components/tag.d.ts +35 -0
- package/dist/components/tag.js +1 -0
- package/dist/components/text-input.d.ts +48 -0
- package/dist/components/text-input.js +1 -0
- package/dist/components/text.d.ts +79 -0
- package/dist/components/text.js +1 -0
- package/dist/components/textarea.d.ts +68 -0
- package/dist/components/textarea.js +2 -0
- package/dist/components/timer.d.ts +59 -0
- package/dist/components/timer.js +1 -0
- package/dist/components/toast.d.ts +49 -0
- package/dist/components/toast.js +1 -0
- package/dist/components/tooltip.d.ts +43 -0
- package/dist/components/tooltip.js +1 -0
- package/dist/components/transform.d.ts +21 -0
- package/dist/components/transform.js +1 -0
- package/dist/components/transition.d.ts +74 -0
- package/dist/components/transition.js +1 -0
- package/dist/components/tree-view-entry.d.ts +357 -0
- package/dist/components/tree-view-entry.js +1 -0
- package/dist/components/unordered-list.d.ts +30 -0
- package/dist/components/unordered-list.js +1 -0
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.js +1 -1
- package/dist/ink/hooks/use-animation.d.ts +41 -0
- package/dist/ink/hooks/use-animation.js +1 -0
- package/dist/ink/hooks/use-app.d.ts +38 -0
- package/dist/ink/hooks/use-app.js +1 -0
- package/dist/ink/hooks/use-box-metrics.d.ts +66 -0
- package/dist/ink/hooks/use-box-metrics.js +1 -0
- package/dist/ink/hooks/use-clipboard.d.ts +30 -0
- package/dist/ink/hooks/use-clipboard.js +1 -0
- package/dist/ink/hooks/use-color-blindness.d.ts +33 -0
- package/dist/ink/hooks/use-color-blindness.js +1 -0
- package/dist/ink/hooks/use-console-capture.d.ts +43 -0
- package/dist/ink/hooks/use-console-capture.js +1 -0
- package/dist/ink/hooks/use-cursor.d.ts +13 -0
- package/dist/ink/hooks/use-cursor.js +1 -0
- package/dist/ink/hooks/use-focus-manager.d.ts +57 -0
- package/dist/ink/hooks/use-focus-manager.js +1 -0
- package/dist/ink/hooks/use-focus.d.ts +34 -0
- package/dist/ink/hooks/use-focus.js +1 -0
- package/dist/ink/hooks/use-form.d.ts +68 -0
- package/dist/ink/hooks/use-form.js +1 -0
- package/dist/ink/hooks/use-hotkey.d.ts +37 -0
- package/dist/ink/hooks/use-hotkey.js +1 -0
- package/dist/ink/hooks/use-input.d.ts +149 -0
- package/dist/ink/hooks/use-input.js +2 -0
- package/dist/ink/hooks/use-interval.d.ts +25 -0
- package/dist/ink/hooks/use-interval.js +1 -0
- package/dist/ink/hooks/use-is-screen-reader-enabled.d.ts +6 -0
- package/dist/ink/hooks/use-is-screen-reader-enabled.js +1 -0
- package/dist/ink/hooks/use-key-bindings.d.ts +59 -0
- package/dist/ink/hooks/use-key-bindings.js +1 -0
- package/dist/ink/hooks/use-key-chord.d.ts +25 -0
- package/dist/ink/hooks/use-key-chord.js +1 -0
- package/dist/ink/hooks/use-linked-scroll.d.ts +49 -0
- package/dist/ink/hooks/use-linked-scroll.js +1 -0
- package/dist/ink/hooks/use-paste.d.ts +45 -0
- package/dist/ink/hooks/use-paste.js +1 -0
- package/dist/ink/hooks/use-persistent-state.d.ts +65 -0
- package/dist/ink/hooks/use-persistent-state.js +2 -0
- package/dist/ink/hooks/use-scroll-acceleration.d.ts +47 -0
- package/dist/ink/hooks/use-scroll-acceleration.js +1 -0
- package/dist/ink/hooks/use-scroll-input.d.ts +34 -0
- package/dist/ink/hooks/use-scroll-input.js +1 -0
- package/dist/ink/hooks/use-stderr.d.ts +16 -0
- package/dist/ink/hooks/use-stderr.js +1 -0
- package/dist/ink/hooks/use-stdin.d.ts +30 -0
- package/dist/ink/hooks/use-stdin.js +1 -0
- package/dist/ink/hooks/use-stdout.d.ts +16 -0
- package/dist/ink/hooks/use-stdout.js +1 -0
- package/dist/ink/hooks/use-stopwatch.d.ts +39 -0
- package/dist/ink/hooks/use-stopwatch.js +1 -0
- package/dist/ink/hooks/use-terminal-palette.d.ts +20 -0
- package/dist/ink/hooks/use-terminal-palette.js +1 -0
- package/dist/ink/hooks/use-text-buffer.d.ts +42 -0
- package/dist/ink/hooks/use-text-buffer.js +4 -0
- package/dist/ink/hooks/use-text-selection.d.ts +45 -0
- package/dist/ink/hooks/use-text-selection.js +1 -0
- package/dist/ink/hooks/use-timeout.d.ts +24 -0
- package/dist/ink/hooks/use-timeout.js +1 -0
- package/dist/ink/hooks/use-timer.d.ts +48 -0
- package/dist/ink/hooks/use-timer.js +1 -0
- package/dist/ink/hooks/use-window-size.d.ts +18 -0
- package/dist/ink/hooks/use-window-size.js +1 -0
- package/dist/ink/index.d.ts +30 -6251
- 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-Cn4byU2n.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-BI9bDy-j.js +1 -0
- package/dist/packem_shared/ScrollBar-qa1IzDDv.js +1 -0
- package/dist/packem_shared/ScrollBarBox-DchESZWv.js +1 -0
- package/dist/packem_shared/ScrollList-BBAnRsrC.js +1 -0
- package/dist/packem_shared/ScrollView-CHAo7Epj.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/buffer.d-EJkZr8uH.d.ts +39 -0
- package/dist/packem_shared/calculateScroll-D4Y_JR4H.js +1 -0
- package/dist/packem_shared/{measureElement-DA8WqFP_.js → calculateScrollbarLayout-Lf6i24c9.js} +1 -1
- package/dist/packem_shared/clearOsc52-BUpnQOav.js +1 -0
- package/dist/packem_shared/clearStringWidthCache-DKFjfJuB.js +1 -0
- package/dist/packem_shared/clipboard.d-D6lZTQ21.d.ts +23 -0
- package/dist/packem_shared/color-matrix.d-DSXLsB64.d.ts +50 -0
- package/dist/packem_shared/colorize-DU4YZkp3.js +1 -0
- package/dist/packem_shared/controlled-scroll-view-BVg7ywNW.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/cursor-helpers.d-BONB9tky.d.ts +12 -0
- package/dist/packem_shared/dom-rphpG0kf.js +1 -0
- package/dist/packem_shared/dom.d-B4kXbaVY.d.ts +449 -0
- package/dist/packem_shared/format-time-fjoQHMxD.js +1 -0
- package/dist/packem_shared/{getPathToRoot-B2tKmx3i.js → getPathToRoot-PDJeqiEH.js} +1 -1
- package/dist/packem_shared/input-utils-BSWCb4F_.js +1 -0
- package/dist/packem_shared/{input.d-Bfq7oc06.d.ts → input.d-CgxV2e8U.d.ts} +1 -1
- 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-D4M9iSYp.js +1 -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-I83k6vXE.js +2 -0
- package/dist/packem_shared/reconciler-CFyBVf7l.js +1 -0
- package/dist/packem_shared/reconciler-ClpU7Y-V.js +1 -0
- package/dist/packem_shared/render-CuQecTAs.js +24 -0
- package/dist/packem_shared/render-DFZ8NHlG.js +1 -0
- package/dist/packem_shared/render.d-CBnYBDk2.d.ts +417 -0
- package/dist/packem_shared/renderToString-DwXFY8Qh.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-k-xShm1P.js +17 -0
- package/dist/packem_shared/scroll-view.d-DtpsgHLg.d.ts +119 -0
- package/dist/packem_shared/selection.d-CI3_p8wg.d.ts +62 -0
- 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/styles.d-cMo36xQz.d.ts +396 -0
- package/dist/packem_shared/terminal-palette.d-D2SQjfn-.d.ts +19 -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/variant-config.d-D5NnrrQK.d.ts +2 -0
- package/dist/packem_shared/waitFor-CTAki32d.js +4 -0
- package/dist/packem_shared/wrapOrTruncateStyledLine-46W8bTtv.js +3 -0
- package/dist/react/index.d.ts +2 -2
- package/dist/react/index.js +1 -1
- package/dist/testing/index.d.ts +5 -1
- package/dist/testing/index.js +1 -1
- package/index.js +65 -156
- package/package.json +601 -47
- package/dist/packem_shared/Accordion-BXsqchV-.js +0 -1
- package/dist/packem_shared/Alert-BhYVMHtR.js +0 -1
- package/dist/packem_shared/AnimatePresence-Eu7Z8KHc.js +0 -1
- package/dist/packem_shared/ApprovalPrompt-BSn0FT1g.js +0 -1
- package/dist/packem_shared/AreaChart-Chy-frI7.js +0 -1
- package/dist/packem_shared/Badge-B8WPyRsK.js +0 -1
- package/dist/packem_shared/BarChart-rpZtlMcF.js +0 -1
- package/dist/packem_shared/BigText-CRpwUzrt.js +0 -1
- package/dist/packem_shared/BlinkDot-BvnRuWP8.js +0 -1
- package/dist/packem_shared/Box-BwqSvWuq.js +0 -1
- package/dist/packem_shared/Breadcrumb-D0hClbRV.js +0 -1
- package/dist/packem_shared/Button-B89Yvbc6.js +0 -1
- package/dist/packem_shared/COLOR_BLINDNESS_SIMULATION-DqErf7XX.js +0 -1
- package/dist/packem_shared/Calendar-Dmflvm2S.js +0 -1
- package/dist/packem_shared/Canvas-CKg6WV47.js +0 -1
- package/dist/packem_shared/Card-B_9fXdtU.js +0 -1
- package/dist/packem_shared/Checkbox-BN71eCWU.js +0 -1
- package/dist/packem_shared/Code-HhevcyiH.js +0 -2
- package/dist/packem_shared/Collapsible-u6uf_FdV.js +0 -1
- package/dist/packem_shared/CommandBlock-B-nslpCv.js +0 -4
- package/dist/packem_shared/CommandPalette-CEFdaURo.js +0 -1
- package/dist/packem_shared/ConfirmDialog-5Jje_Xpu.js +0 -1
- package/dist/packem_shared/ConfirmInput-D44Mb9oo.js +0 -1
- package/dist/packem_shared/ConsoleOverlay-CM3APfgP.js +0 -1
- package/dist/packem_shared/ContentSwitcher-Dm5BkrCt.js +0 -1
- package/dist/packem_shared/ControlledScrollView-DI8KZOQB.js +0 -1
- package/dist/packem_shared/Cursor-BoLFIMol.js +0 -1
- package/dist/packem_shared/DatePicker-CnSrFFAE.js +0 -1
- package/dist/packem_shared/DefinitionList-v8RDuF_R.js +0 -1
- package/dist/packem_shared/DevTools-O8EbCfHa.js +0 -1
- package/dist/packem_shared/Dialog-CTaL8pn0.js +0 -1
- package/dist/packem_shared/DiffView-BUIFqUB0.js +0 -1
- package/dist/packem_shared/Divider-C47bKmqu.js +0 -1
- package/dist/packem_shared/FilePicker-CUo7R5Qb.js +0 -1
- package/dist/packem_shared/FocusContext-Xy0cwJpO.js +0 -1
- package/dist/packem_shared/FormField-af3aUpRL.js +0 -1
- package/dist/packem_shared/Fullscreen-CuJ8y0s0.js +0 -1
- package/dist/packem_shared/Gauge-Dz-usH__.js +0 -1
- package/dist/packem_shared/Gradient-DYNc0GZA.js +0 -1
- package/dist/packem_shared/Heading-mwEYza3Y.js +0 -1
- package/dist/packem_shared/Heatmap-ChL97U1-.js +0 -1
- package/dist/packem_shared/Help-Zcelyw_U.js +0 -1
- package/dist/packem_shared/Histogram-FIf2F83d.js +0 -1
- package/dist/packem_shared/IMECompositionBuffer-C89PhiOu.js +0 -1
- package/dist/packem_shared/InputParser-rZKjY_7Y.js +0 -2
- package/dist/packem_shared/KEY-Bk8B-3h_.js +0 -1
- package/dist/packem_shared/Kbd-DpkPp4jB.js +0 -1
- package/dist/packem_shared/LayoutNode-rxblE317.js +0 -1
- package/dist/packem_shared/LineChart-BXE_girm.js +0 -1
- package/dist/packem_shared/Link-i2o2EG4-.js +0 -1
- package/dist/packem_shared/LoadingIndicator-TC1Fjwyt.js +0 -1
- package/dist/packem_shared/Markdown-R1XqK63D.js +0 -1
- package/dist/packem_shared/MaskedInput-J01phOZs.js +0 -1
- package/dist/packem_shared/Menu-CfrH4ymk.js +0 -1
- package/dist/packem_shared/MessageBubble-BmBBU2Rm.js +0 -1
- package/dist/packem_shared/ModelBadge-D3wrXncu.js +0 -1
- package/dist/packem_shared/MouseProvider-pjza-lpc.js +0 -1
- package/dist/packem_shared/MultiSelect-Dqmn-bVo.js +0 -1
- package/dist/packem_shared/NAMED_COLORS-B9fJsYdg.js +0 -1
- package/dist/packem_shared/Newline-BSG4iUqp.js +0 -2
- package/dist/packem_shared/OperationTree-DksxjMIV.js +0 -1
- package/dist/packem_shared/OptionList-CNx7r9yN.js +0 -1
- package/dist/packem_shared/OrderedList-BeDy035w.js +0 -1
- package/dist/packem_shared/Paginator-B56s6bhS.js +0 -1
- package/dist/packem_shared/Paragraph-BqJlH0R-.js +0 -1
- package/dist/packem_shared/Placeholder-GMpHRGC8.js +0 -1
- package/dist/packem_shared/ProgressBar-Bj3fmORR.js +0 -1
- package/dist/packem_shared/RadioGroup-Br8BeEwS.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/ScatterPlot-OhfYco5l.js +0 -1
- package/dist/packem_shared/ScrollBar-Da5Y3z7N.js +0 -1
- package/dist/packem_shared/ScrollBarBox-Dz6F-Eat.js +0 -1
- package/dist/packem_shared/ScrollList-DiVGyEjv.js +0 -1
- package/dist/packem_shared/ScrollView-BojONotI.js +0 -1
- package/dist/packem_shared/SearchInput-BoPTRbhV.js +0 -1
- package/dist/packem_shared/SelectInput-CAJ7SCBq.js +0 -1
- package/dist/packem_shared/SelectInputIndicator-N1n8ULHs.js +0 -1
- package/dist/packem_shared/SelectInputItem-BEkbmobs.js +0 -1
- package/dist/packem_shared/ShimmerText-CuGQ2NDC.js +0 -1
- package/dist/packem_shared/Slider-Cg_tJpKa.js +0 -1
- package/dist/packem_shared/Spacer-eT3HOrXk.js +0 -1
- package/dist/packem_shared/Sparkline-T6_FPVET.js +0 -1
- package/dist/packem_shared/Spinner-B0-A50pu.js +0 -1
- package/dist/packem_shared/Static-DLynr5pn.js +0 -1
- package/dist/packem_shared/Static-jzLPaHJF.js +0 -1
- package/dist/packem_shared/StaticRender-BgD61E7x.js +0 -1
- package/dist/packem_shared/StatusLine-Ch4jjef1.js +0 -1
- package/dist/packem_shared/StatusMessage-B1qfKeMM.js +0 -1
- package/dist/packem_shared/Stepper-CNPAqxiU.js +0 -1
- package/dist/packem_shared/Stopwatch-CAx2EWwq.js +0 -1
- package/dist/packem_shared/StreamingText-BYOKSB2T.js +0 -1
- package/dist/packem_shared/Switch-DzSpKYu7.js +0 -1
- package/dist/packem_shared/Tab-BcXzSUdj.js +0 -1
- package/dist/packem_shared/Table-DJp1TLrR.js +0 -1
- package/dist/packem_shared/Tabs-D68z0SOt.js +0 -1
- package/dist/packem_shared/Tag-BvLHnYRn.js +0 -1
- package/dist/packem_shared/Text-mTAve9R2.js +0 -1
- package/dist/packem_shared/TextInput-C_gYQlnF.js +0 -1
- package/dist/packem_shared/Textarea-C2ET_oMb.js +0 -2
- package/dist/packem_shared/Timer-CI3aQX65.js +0 -1
- package/dist/packem_shared/Toast-Drvc8XfG.js +0 -1
- package/dist/packem_shared/Tooltip-C5UnQlLd.js +0 -1
- package/dist/packem_shared/Transform-fYmcdqRT.js +0 -1
- package/dist/packem_shared/Transition-CJDBKYUB.js +0 -1
- package/dist/packem_shared/TreeNodeMap-CspqSCpb.js +0 -1
- package/dist/packem_shared/TreeView-DjhacGJ5.js +0 -1
- package/dist/packem_shared/TuiApp-DrjI_i-R.js +0 -1
- package/dist/packem_shared/TuiContext-BoJvG3NN.js +0 -3
- package/dist/packem_shared/UnorderedList-BnfqexZs.js +0 -1
- package/dist/packem_shared/ansi-parser-B6uXaq65.js +0 -1
- package/dist/packem_shared/ansi-tokenizer-DqX9nJuk.js +0 -1
- package/dist/packem_shared/boxes-DyY_LXCi.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-C85EsmNz.js +0 -1
- package/dist/packem_shared/controlled-scroll-view-CmrAEvJk.js +0 -1
- package/dist/packem_shared/createInlineLoop-DRNZ7jqH.js +0 -2
- package/dist/packem_shared/createLinkedScrollGroup-BMTJ7rAj.js +0 -1
- package/dist/packem_shared/createMemoryStorage-QVZNXbWz.js +0 -2
- package/dist/packem_shared/createScreen-CrLrxA6t.js +0 -3
- package/dist/packem_shared/dom-4y__5fWB.js +0 -1
- package/dist/packem_shared/format-time-C7Q-hQZq.js +0 -1
- package/dist/packem_shared/getScrollHeight-BTEY8ewu.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/line-chart-DrM8PwnI.js +0 -1
- package/dist/packem_shared/measure-element-DSp7YDus.js +0 -2
- package/dist/packem_shared/measure-text-DDjHT1jD.js +0 -3
- package/dist/packem_shared/parseSgrMouse-Ccj70ijb.js +0 -1
- package/dist/packem_shared/processLayout-DXDfFb_d.js +0 -1
- package/dist/packem_shared/reconciler-BuOP-TZ6.js +0 -1
- package/dist/packem_shared/reconciler-DSYCrIZs.js +0 -1
- package/dist/packem_shared/render-DDqtMAFN.js +0 -1
- package/dist/packem_shared/render-_r0K9K11.js +0 -28
- package/dist/packem_shared/render.d-CNIzVQTh.d.ts +0 -1257
- package/dist/packem_shared/renderToString-DeqOWRP8.js +0 -4
- package/dist/packem_shared/renderToString-IYYPyASm.js +0 -2
- package/dist/packem_shared/renderTreeToBuffer-DPkoCgP2.js +0 -2
- package/dist/packem_shared/renderer-D2p6av2X.js +0 -17
- package/dist/packem_shared/setEnableStyledLineCache-D2gZbwFM.js +0 -1
- package/dist/packem_shared/squashTextNodesWithMap-Cpqmc45i.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-CZ9vPvM0.js +0 -2
- package/dist/packem_shared/token-to-elements-BYxT6J_Q.js +0 -1
- package/dist/packem_shared/treeViewTheme-1RIZyB4M.js +0 -1
- package/dist/packem_shared/useAnimation-B9we6ZzL.js +0 -1
- package/dist/packem_shared/useApp-B6fvM42d.js +0 -1
- package/dist/packem_shared/useBoxMetrics-D5pkIr6P.js +0 -1
- package/dist/packem_shared/useClipboard-CBxy0hT8.js +0 -1
- package/dist/packem_shared/useColorBlindness-BvWcu2Bb.js +0 -1
- package/dist/packem_shared/useConsoleCapture-BxiG8iLJ.js +0 -1
- package/dist/packem_shared/useCursor-CPu8T5Db.js +0 -1
- package/dist/packem_shared/useElementDimensions-qJ_WXFZ9.js +0 -1
- package/dist/packem_shared/useFocus-DSmziO_x.js +0 -1
- package/dist/packem_shared/useFocusManager-Uapn3LQo.js +0 -1
- package/dist/packem_shared/useForm-CzV-Oext.js +0 -1
- package/dist/packem_shared/useHotkey-D0dGey14.js +0 -1
- package/dist/packem_shared/useInput-D1_jG26Z.js +0 -2
- package/dist/packem_shared/useInterval-AobjZT3u.js +0 -1
- package/dist/packem_shared/useIsScreenReaderEnabled-DjWHh-II.js +0 -1
- package/dist/packem_shared/useKeyBindings-zabkEJQs.js +0 -1
- package/dist/packem_shared/useKeyChord-CICQIxXj.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/usePaste-CKKB9H-Z.js +0 -1
- package/dist/packem_shared/useScrollAcceleration-NrY1oVMs.js +0 -1
- package/dist/packem_shared/useScrollInput-Caghtn-Q.js +0 -1
- package/dist/packem_shared/useStderr-BDZb6InG.js +0 -1
- package/dist/packem_shared/useStdin-DKa4h35k.js +0 -1
- package/dist/packem_shared/useStdout-B-2lX4C5.js +0 -1
- package/dist/packem_shared/useStopwatch-DffK7iMh.js +0 -1
- package/dist/packem_shared/useTerminalPalette-Cv7tSduR.js +0 -1
- package/dist/packem_shared/useTextBuffer-DekkGLxI.js +0 -4
- package/dist/packem_shared/useTextSelection-CGT0GLDR.js +0 -1
- package/dist/packem_shared/useTimeout-7LEFYTnG.js +0 -1
- package/dist/packem_shared/useTimer-DyoqSyGi.js +0 -1
- package/dist/packem_shared/useTreeView-8UlTK6sW.js +0 -1
- package/dist/packem_shared/useTreeViewState-CRPCUWrb.js +0 -1
- package/dist/packem_shared/useWindowSize-yDZsXF8z.js +0 -1
- package/dist/packem_shared/utils-THUhYKG2.js +0 -1
- package/dist/packem_shared/waitFor-Dj5zfL5s.js +0 -4
- package/dist/packem_shared/wrapOrTruncateStyledLine-BZ00SM8i.js +0 -3
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { AnsiColors } from '@visulima/colorize';
|
|
2
|
+
import { ReactElement } from 'react';
|
|
3
|
+
import { LiteralUnion } from 'type-fest';
|
|
4
|
+
type Props = {
|
|
5
|
+
/**
|
|
6
|
+
* Custom character to use instead of the default line character.
|
|
7
|
+
*/
|
|
8
|
+
readonly character?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Color of the divider line.
|
|
11
|
+
*/
|
|
12
|
+
readonly color?: LiteralUnion<AnsiColors, string>;
|
|
13
|
+
/**
|
|
14
|
+
* Render the divider with dim color.
|
|
15
|
+
*/
|
|
16
|
+
readonly dimColor?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Optional label rendered in the middle of a horizontal divider.
|
|
19
|
+
*/
|
|
20
|
+
readonly label?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Padding around the label.
|
|
23
|
+
* @default 1
|
|
24
|
+
*/
|
|
25
|
+
readonly labelPadding?: number;
|
|
26
|
+
/**
|
|
27
|
+
* Total length of the divider. When omitted, horizontal dividers stretch to
|
|
28
|
+
* fill the available space and vertical dividers default to one row.
|
|
29
|
+
*/
|
|
30
|
+
readonly length?: number;
|
|
31
|
+
/**
|
|
32
|
+
* Orientation of the divider.
|
|
33
|
+
* @default "horizontal"
|
|
34
|
+
*/
|
|
35
|
+
readonly orientation?: "horizontal" | "vertical";
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Horizontal or vertical divider line, optionally with a centered label.
|
|
39
|
+
*/
|
|
40
|
+
declare function Divider({
|
|
41
|
+
character,
|
|
42
|
+
color,
|
|
43
|
+
dimColor,
|
|
44
|
+
label,
|
|
45
|
+
labelPadding,
|
|
46
|
+
length,
|
|
47
|
+
orientation
|
|
48
|
+
}: Props): ReactElement;
|
|
49
|
+
export { Divider, type Props as DividerProps, Props, Divider as default };
|
|
@@ -0,0 +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};
|
|
@@ -0,0 +1,104 @@
|
|
|
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: ({
|
|
92
|
+
accentColor,
|
|
93
|
+
directoryColor,
|
|
94
|
+
fileColor,
|
|
95
|
+
filter,
|
|
96
|
+
initialPath,
|
|
97
|
+
isFocused,
|
|
98
|
+
limit,
|
|
99
|
+
onCancel,
|
|
100
|
+
onSelect,
|
|
101
|
+
showPermissions,
|
|
102
|
+
showSize
|
|
103
|
+
}: Props) => ReactElement;
|
|
104
|
+
export { type FileEntry, FilePicker, type FilePickerFilter, type Props as FilePickerProps, FilePicker as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{default as f,default as l}from"../packem_shared/FilePicker-BLS9nOPz.js";export{f as FilePicker,l as default};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { AnsiColors } from '@visulima/colorize';
|
|
2
|
+
import { ReactNode, ReactElement } from 'react';
|
|
3
|
+
import { LiteralUnion } from 'type-fest';
|
|
4
|
+
type FormFieldProps = {
|
|
5
|
+
/**
|
|
6
|
+
* The input element (TextInput, Checkbox, Select, …).
|
|
7
|
+
*/
|
|
8
|
+
readonly children: ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* Optional helper text rendered beneath the input.
|
|
11
|
+
*/
|
|
12
|
+
readonly description?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Validation error — dimmed red below the input.
|
|
15
|
+
*/
|
|
16
|
+
readonly error?: string;
|
|
17
|
+
/**
|
|
18
|
+
* When true, the field's label and description are dim.
|
|
19
|
+
*/
|
|
20
|
+
readonly isDisabled?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Label rendered above the input.
|
|
23
|
+
*/
|
|
24
|
+
readonly label: string;
|
|
25
|
+
/**
|
|
26
|
+
* Mark the field as required (adds a trailing `*`).
|
|
27
|
+
*/
|
|
28
|
+
readonly required?: boolean;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Standard form field wrapper: label + input + helper/error.
|
|
32
|
+
*/
|
|
33
|
+
declare const FormField: ({
|
|
34
|
+
children,
|
|
35
|
+
description,
|
|
36
|
+
error,
|
|
37
|
+
isDisabled,
|
|
38
|
+
label,
|
|
39
|
+
required
|
|
40
|
+
}: FormFieldProps) => ReactElement;
|
|
41
|
+
type Props = {
|
|
42
|
+
/**
|
|
43
|
+
* Accent color for the form chrome.
|
|
44
|
+
* @default "blue"
|
|
45
|
+
*/
|
|
46
|
+
readonly accentColor?: LiteralUnion<AnsiColors, string>;
|
|
47
|
+
/**
|
|
48
|
+
* Render a border around the form.
|
|
49
|
+
* @default true
|
|
50
|
+
*/
|
|
51
|
+
readonly bordered?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Fields composed via `<FormField />`.
|
|
54
|
+
*/
|
|
55
|
+
readonly children: ReactNode;
|
|
56
|
+
/**
|
|
57
|
+
* Optional description rendered under the title.
|
|
58
|
+
*/
|
|
59
|
+
readonly description?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Optional footer rendered below the fields (buttons, hints, summary).
|
|
62
|
+
*/
|
|
63
|
+
readonly footer?: ReactNode;
|
|
64
|
+
/**
|
|
65
|
+
* Optional heading rendered at the top.
|
|
66
|
+
*/
|
|
67
|
+
readonly title?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Fixed width.
|
|
70
|
+
*/
|
|
71
|
+
readonly width?: number;
|
|
72
|
+
};
|
|
73
|
+
type FormComponent = ((props: Props) => ReactElement) & {
|
|
74
|
+
Field: typeof FormField;
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Stateless form layout. Pair with the `useForm` hook for state management
|
|
78
|
+
* and `FormField` for consistent label/error styling.
|
|
79
|
+
*/
|
|
80
|
+
declare const Form: FormComponent;
|
|
81
|
+
export { Form, FormField, FormFieldProps, type Props as FormProps, Props, Form as default };
|
|
@@ -0,0 +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};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { AnsiColors } from '@visulima/colorize';
|
|
2
|
+
import { ReactElement } from 'react';
|
|
3
|
+
import { LiteralUnion } from 'type-fest';
|
|
4
|
+
type GaugeThreshold = {
|
|
5
|
+
/**
|
|
6
|
+
* Color used for the arc segment and, when the current value falls into
|
|
7
|
+
* this segment, for the value readout.
|
|
8
|
+
*/
|
|
9
|
+
readonly color: LiteralUnion<AnsiColors, string>;
|
|
10
|
+
/**
|
|
11
|
+
* Optional label used by the legend under the gauge.
|
|
12
|
+
*/
|
|
13
|
+
readonly label?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Upper bound of this threshold segment (inclusive). Segments are sorted
|
|
16
|
+
* ascending and painted in order.
|
|
17
|
+
*/
|
|
18
|
+
readonly max: number;
|
|
19
|
+
};
|
|
20
|
+
type GaugeSize = "large" | "medium" | "small";
|
|
21
|
+
type Props = {
|
|
22
|
+
/**
|
|
23
|
+
* Color of the arc background (the portion beyond `value`).
|
|
24
|
+
* @default "gray"
|
|
25
|
+
*/
|
|
26
|
+
readonly backgroundColor?: LiteralUnion<AnsiColors, string>;
|
|
27
|
+
/**
|
|
28
|
+
* Format for the numeric readout. Defaults to rounding to an integer.
|
|
29
|
+
*/
|
|
30
|
+
readonly formatValue?: (value: number) => string;
|
|
31
|
+
/**
|
|
32
|
+
* Optional label rendered above the readout.
|
|
33
|
+
*/
|
|
34
|
+
readonly label?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Upper bound of the range.
|
|
37
|
+
* @default 100
|
|
38
|
+
*/
|
|
39
|
+
readonly max?: number;
|
|
40
|
+
/**
|
|
41
|
+
* Lower bound of the range.
|
|
42
|
+
* @default 0
|
|
43
|
+
*/
|
|
44
|
+
readonly min?: number;
|
|
45
|
+
/**
|
|
46
|
+
* Show a legend listing thresholds below the gauge.
|
|
47
|
+
* @default false
|
|
48
|
+
*/
|
|
49
|
+
readonly showLegend?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Show a numeric readout in the middle of the gauge.
|
|
52
|
+
* @default true
|
|
53
|
+
*/
|
|
54
|
+
readonly showValue?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Overall dimension preset.
|
|
57
|
+
* @default "medium"
|
|
58
|
+
*/
|
|
59
|
+
readonly size?: GaugeSize;
|
|
60
|
+
/**
|
|
61
|
+
* Color threshold ramp. When provided, segments of the arc are painted in
|
|
62
|
+
* the corresponding colors and the value readout picks up the color for
|
|
63
|
+
* the segment `value` lands in.
|
|
64
|
+
*/
|
|
65
|
+
readonly thresholds?: ReadonlyArray<GaugeThreshold>;
|
|
66
|
+
/**
|
|
67
|
+
* Current value. Clamped into the `[min, max]` range.
|
|
68
|
+
*/
|
|
69
|
+
readonly value: number;
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Semi-circular gauge rendered at 2x4 sub-cell resolution. Supports colored
|
|
73
|
+
* threshold segments and an optional needle.
|
|
74
|
+
*/
|
|
75
|
+
declare function Gauge({
|
|
76
|
+
backgroundColor,
|
|
77
|
+
formatValue,
|
|
78
|
+
label,
|
|
79
|
+
max,
|
|
80
|
+
min,
|
|
81
|
+
showLegend,
|
|
82
|
+
showValue,
|
|
83
|
+
size,
|
|
84
|
+
thresholds,
|
|
85
|
+
value
|
|
86
|
+
}: Props): ReactElement;
|
|
87
|
+
export { Gauge, type Props as GaugeProps, GaugeSize, GaugeThreshold, Props, Gauge as default };
|
|
@@ -0,0 +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};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { multilineGradient } from '@visulima/colorize/gradient';
|
|
2
|
+
import { ReactNode, ReactElement } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* A color stop for the gradient — hex string, CSS color name, RGB tuple, RGB object, or positioned stop.
|
|
5
|
+
*/
|
|
6
|
+
type GradientStop = Parameters<typeof multilineGradient>[0][number];
|
|
7
|
+
/**
|
|
8
|
+
* Built-in gradient presets.
|
|
9
|
+
*/
|
|
10
|
+
type GradientName = "atlas" | "cristal" | "fruit" | "instagram" | "mind" | "morning" | "pastel" | "passion" | "rainbow" | "retro" | "summer" | "teen" | "vice";
|
|
11
|
+
/**
|
|
12
|
+
* Custom gradient colors — an array of color stops accepted by `@visulima/colorize`'s gradient API.
|
|
13
|
+
*/
|
|
14
|
+
type GradientColors = GradientStop[];
|
|
15
|
+
type Props = {
|
|
16
|
+
/**
|
|
17
|
+
* The content to colorize.
|
|
18
|
+
*
|
|
19
|
+
* Multiple `<Text>` children are treated as separate nodes, which preserves layout when `<Gradient>` is placed inside a `<Box flexDirection="column">`.
|
|
20
|
+
*
|
|
21
|
+
* If you want a continuous gradient across multiple lines, pass a single string or a single `<Text>` with `\n`.
|
|
22
|
+
*/
|
|
23
|
+
readonly children: ReactNode;
|
|
24
|
+
/**
|
|
25
|
+
* [Colors to use to make the gradient.](https://visulima.com/packages/colorize)
|
|
26
|
+
*
|
|
27
|
+
* Mutually exclusive with `name`.
|
|
28
|
+
*/
|
|
29
|
+
readonly colors?: GradientColors;
|
|
30
|
+
/**
|
|
31
|
+
* The name of a built-in gradient preset.
|
|
32
|
+
*
|
|
33
|
+
* Mutually exclusive with `colors`.
|
|
34
|
+
*/
|
|
35
|
+
readonly name?: GradientName;
|
|
36
|
+
};
|
|
37
|
+
declare function Gradient({
|
|
38
|
+
children,
|
|
39
|
+
colors,
|
|
40
|
+
name
|
|
41
|
+
}: Props): ReactElement | null;
|
|
42
|
+
export { Gradient, type GradientColors, type GradientName, type Props as GradientProps, Props, Gradient as default };
|
|
@@ -0,0 +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};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { AnsiColors } from '@visulima/colorize';
|
|
2
|
+
import { ReactNode, ReactElement } from 'react';
|
|
3
|
+
import { LiteralUnion } from 'type-fest';
|
|
4
|
+
type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
5
|
+
type Props = {
|
|
6
|
+
/**
|
|
7
|
+
* Heading content.
|
|
8
|
+
*/
|
|
9
|
+
readonly children: ReactNode;
|
|
10
|
+
/**
|
|
11
|
+
* Explicit color. By default the color is derived from the level.
|
|
12
|
+
*/
|
|
13
|
+
readonly color?: LiteralUnion<AnsiColors, string>;
|
|
14
|
+
/**
|
|
15
|
+
* Heading level controls decoration and color.
|
|
16
|
+
* @default 1
|
|
17
|
+
*/
|
|
18
|
+
readonly level?: HeadingLevel;
|
|
19
|
+
/**
|
|
20
|
+
* When true, renders an underline on a second line.
|
|
21
|
+
*/
|
|
22
|
+
readonly underline?: boolean;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Semantic heading with level-based styling.
|
|
26
|
+
*/
|
|
27
|
+
declare function Heading({
|
|
28
|
+
children,
|
|
29
|
+
color,
|
|
30
|
+
level,
|
|
31
|
+
underline
|
|
32
|
+
}: Props): ReactElement;
|
|
33
|
+
export { Heading, HeadingLevel, type Props as HeadingProps, Props, Heading as default };
|
|
@@ -0,0 +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};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { AnsiColors } from '@visulima/colorize';
|
|
2
|
+
import { ReactElement } from 'react';
|
|
3
|
+
import { LiteralUnion } from 'type-fest';
|
|
4
|
+
type HeatmapProps = {
|
|
5
|
+
/**
|
|
6
|
+
* Width of each cell in character columns.
|
|
7
|
+
* @default 2
|
|
8
|
+
*/
|
|
9
|
+
readonly cellWidth?: number;
|
|
10
|
+
/**
|
|
11
|
+
* Glyph used to paint each heatmap cell. Defaults to `█` so the
|
|
12
|
+
* background color fills the cell.
|
|
13
|
+
* @default "█" (full block)
|
|
14
|
+
*/
|
|
15
|
+
readonly character?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Column labels rendered below the grid.
|
|
18
|
+
*/
|
|
19
|
+
readonly columnLabels?: ReadonlyArray<string>;
|
|
20
|
+
/**
|
|
21
|
+
* 2D matrix, rows × cols.
|
|
22
|
+
*/
|
|
23
|
+
readonly data: ReadonlyArray<ReadonlyArray<number>>;
|
|
24
|
+
/**
|
|
25
|
+
* Fixed maximum (for consistent scales across multiple heatmaps).
|
|
26
|
+
*/
|
|
27
|
+
readonly max?: number;
|
|
28
|
+
/**
|
|
29
|
+
* Fixed minimum.
|
|
30
|
+
*/
|
|
31
|
+
readonly min?: number;
|
|
32
|
+
/**
|
|
33
|
+
* Color palette, lowest-to-highest intensity. Values are mapped into the
|
|
34
|
+
* palette by their position in the [min, max] range.
|
|
35
|
+
* @default ["#0b1e4f", "#1f3b96", "#3258c8", "#4e84ec", "#78b0ff"]
|
|
36
|
+
*/
|
|
37
|
+
readonly palette?: ReadonlyArray<string>;
|
|
38
|
+
/**
|
|
39
|
+
* Row labels rendered to the left of the grid.
|
|
40
|
+
*/
|
|
41
|
+
readonly rowLabels?: ReadonlyArray<string>;
|
|
42
|
+
/**
|
|
43
|
+
* Foreground color override (rarely needed since the character is a full block).
|
|
44
|
+
*/
|
|
45
|
+
readonly textColor?: LiteralUnion<AnsiColors, string>;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* 2D heatmap. Each cell's background color is derived from its value's
|
|
49
|
+
* position in the [min, max] range mapped into `palette`.
|
|
50
|
+
*/
|
|
51
|
+
declare function Heatmap({
|
|
52
|
+
cellWidth,
|
|
53
|
+
character,
|
|
54
|
+
columnLabels,
|
|
55
|
+
data,
|
|
56
|
+
max: maxOverride,
|
|
57
|
+
min: minOverride,
|
|
58
|
+
palette,
|
|
59
|
+
rowLabels,
|
|
60
|
+
textColor
|
|
61
|
+
}: HeatmapProps): ReactElement;
|
|
62
|
+
export { Heatmap, HeatmapProps, Heatmap as default };
|
|
@@ -0,0 +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};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { KeyBinding } from "../ink/hooks/use-key-bindings.js";
|
|
3
|
+
type Props = {
|
|
4
|
+
/**
|
|
5
|
+
* Key bindings to display. Typically the `bindings` array returned by `useKeyBindings`.
|
|
6
|
+
*/
|
|
7
|
+
readonly bindings: ReadonlyArray<KeyBinding>;
|
|
8
|
+
/**
|
|
9
|
+
* Color for description text.
|
|
10
|
+
* @default undefined (uses dimColor)
|
|
11
|
+
*/
|
|
12
|
+
readonly descriptionColor?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Color for key labels.
|
|
15
|
+
* @default "cyan"
|
|
16
|
+
*/
|
|
17
|
+
readonly keyColor?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Maximum number of columns in full mode.
|
|
20
|
+
* @default 3
|
|
21
|
+
*/
|
|
22
|
+
readonly maxColumns?: number;
|
|
23
|
+
/**
|
|
24
|
+
* Display mode.
|
|
25
|
+
* - `"short"`: Single-line horizontal bar, truncated to terminal width.
|
|
26
|
+
* - `"full"`: Multi-column layout grouped by `group` field.
|
|
27
|
+
* @default "short"
|
|
28
|
+
*/
|
|
29
|
+
readonly mode?: "full" | "short";
|
|
30
|
+
/**
|
|
31
|
+
* Separator between key-description pairs in short mode.
|
|
32
|
+
* @default " \u00b7 "
|
|
33
|
+
*/
|
|
34
|
+
readonly separator?: string;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Renders a keybinding help bar from an array of `KeyBinding` definitions.
|
|
38
|
+
*
|
|
39
|
+
* ```tsx
|
|
40
|
+
* <Help bindings={bindings} />
|
|
41
|
+
* <Help bindings={bindings} mode="full" />
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
declare function Help({
|
|
45
|
+
bindings,
|
|
46
|
+
descriptionColor,
|
|
47
|
+
keyColor,
|
|
48
|
+
maxColumns,
|
|
49
|
+
mode,
|
|
50
|
+
separator
|
|
51
|
+
}: Props): ReactElement;
|
|
52
|
+
export { Help, type Props as HelpProps, Props, Help as default };
|
|
@@ -0,0 +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};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { AnsiColors } from '@visulima/colorize';
|
|
2
|
+
import { ReactElement } from 'react';
|
|
3
|
+
import { LiteralUnion } from 'type-fest';
|
|
4
|
+
type Props = {
|
|
5
|
+
/**
|
|
6
|
+
* Number of equal-width buckets. Ignored if `thresholds` is set.
|
|
7
|
+
* @default 10
|
|
8
|
+
*/
|
|
9
|
+
readonly bins?: number;
|
|
10
|
+
/**
|
|
11
|
+
* Bar color.
|
|
12
|
+
*/
|
|
13
|
+
readonly color?: LiteralUnion<AnsiColors, string>;
|
|
14
|
+
/**
|
|
15
|
+
* Raw values to bin.
|
|
16
|
+
*/
|
|
17
|
+
readonly data: ReadonlyArray<number>;
|
|
18
|
+
/**
|
|
19
|
+
* Plot height in character rows.
|
|
20
|
+
* @default 10
|
|
21
|
+
*/
|
|
22
|
+
readonly height?: number;
|
|
23
|
+
/**
|
|
24
|
+
* Optional fixed maximum.
|
|
25
|
+
*/
|
|
26
|
+
readonly max?: number;
|
|
27
|
+
/**
|
|
28
|
+
* Optional fixed minimum.
|
|
29
|
+
*/
|
|
30
|
+
readonly min?: number;
|
|
31
|
+
/**
|
|
32
|
+
* Render a numeric count above each bucket.
|
|
33
|
+
* @default false
|
|
34
|
+
*/
|
|
35
|
+
readonly showValues?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Explicit bin edges. When provided, `bins`, `min`, and `max` are ignored.
|
|
38
|
+
* Must be strictly increasing.
|
|
39
|
+
*/
|
|
40
|
+
readonly thresholds?: ReadonlyArray<number>;
|
|
41
|
+
/**
|
|
42
|
+
* Plot width in character columns.
|
|
43
|
+
*/
|
|
44
|
+
readonly width?: number;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Histogram built on top of BarChart. Bins the raw values (via explicit
|
|
48
|
+
* thresholds or equal-width bins) and hands the counts off to BarChart.
|
|
49
|
+
* @returns A `ReactElement` rendering a BarChart of bucket counts.
|
|
50
|
+
*/
|
|
51
|
+
declare function Histogram({
|
|
52
|
+
bins,
|
|
53
|
+
color,
|
|
54
|
+
data,
|
|
55
|
+
height,
|
|
56
|
+
max: maxOverride,
|
|
57
|
+
min: minOverride,
|
|
58
|
+
showValues,
|
|
59
|
+
thresholds,
|
|
60
|
+
width
|
|
61
|
+
}: Props): ReactElement;
|
|
62
|
+
export { Histogram, type Props as HistogramProps, Props, Histogram as default };
|
|
@@ -0,0 +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};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { AnsiColors } from '@visulima/colorize';
|
|
2
|
+
import { ReactNode, ReactElement } from 'react';
|
|
3
|
+
import { LiteralUnion } from 'type-fest';
|
|
4
|
+
type Props = {
|
|
5
|
+
/**
|
|
6
|
+
* Key cap content.
|
|
7
|
+
*/
|
|
8
|
+
readonly children: ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* Background color of the key cap.
|
|
11
|
+
* @default "gray"
|
|
12
|
+
*/
|
|
13
|
+
readonly color?: LiteralUnion<AnsiColors, string>;
|
|
14
|
+
/**
|
|
15
|
+
* Visual style.
|
|
16
|
+
* - `solid` (default): background filled
|
|
17
|
+
* - `outline`: border only
|
|
18
|
+
* - `bare`: no decoration, just dimmed text
|
|
19
|
+
*/
|
|
20
|
+
readonly variant?: "bare" | "outline" | "solid";
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Render a keyboard key (e.g. `<Kbd>Enter</Kbd>`).
|
|
24
|
+
* @returns A `ReactElement` styled as a key cap (solid / outline / bare).
|
|
25
|
+
*/
|
|
26
|
+
declare function Kbd({
|
|
27
|
+
children,
|
|
28
|
+
color,
|
|
29
|
+
variant
|
|
30
|
+
}: Props): ReactElement;
|
|
31
|
+
export { Kbd, type Props as KbdProps, Props, Kbd as default };
|
|
@@ -0,0 +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};
|