@visulima/tui 1.0.0-alpha.8 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +654 -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 +550 -692
- package/package.json +583 -32
- 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-BR3gA-N8.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,47 @@
|
|
|
1
|
+
import { AnsiColors } from '@visulima/colorize';
|
|
2
|
+
import { ReactNode, ReactElement } from 'react';
|
|
3
|
+
import { LiteralUnion } from 'type-fest';
|
|
4
|
+
type OptionListEntry = {
|
|
5
|
+
readonly description?: string;
|
|
6
|
+
readonly icon?: ReactNode;
|
|
7
|
+
readonly id: string;
|
|
8
|
+
readonly label: ReactNode;
|
|
9
|
+
readonly trailing?: ReactNode;
|
|
10
|
+
};
|
|
11
|
+
type Props = {
|
|
12
|
+
/**
|
|
13
|
+
* Highlight color for the row marked as current.
|
|
14
|
+
*/
|
|
15
|
+
readonly accentColor?: LiteralUnion<AnsiColors, string>;
|
|
16
|
+
/**
|
|
17
|
+
* Render the list with a border.
|
|
18
|
+
*/
|
|
19
|
+
readonly bordered?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Id of the row to highlight. No visual change if omitted.
|
|
22
|
+
*/
|
|
23
|
+
readonly currentId?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Icon width in characters for column alignment.
|
|
26
|
+
* @default 2
|
|
27
|
+
*/
|
|
28
|
+
readonly iconColumnWidth?: number;
|
|
29
|
+
/**
|
|
30
|
+
* Entries to render.
|
|
31
|
+
*/
|
|
32
|
+
readonly options: ReadonlyArray<OptionListEntry>;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Read-only presentational option list. Like `SelectInput` but without focus,
|
|
36
|
+
* input handling, or scrolling — just a styled list of rows. Useful inside
|
|
37
|
+
* modals, sidebars, or summary panels.
|
|
38
|
+
* @returns A `ReactElement` rendering the list; bordered when requested.
|
|
39
|
+
*/
|
|
40
|
+
declare function OptionList({
|
|
41
|
+
accentColor,
|
|
42
|
+
bordered,
|
|
43
|
+
currentId,
|
|
44
|
+
iconColumnWidth,
|
|
45
|
+
options
|
|
46
|
+
}: Props): ReactElement;
|
|
47
|
+
export { OptionList, OptionListEntry, type Props as OptionListProps, Props, OptionList as default };
|
|
@@ -0,0 +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};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ReactNode, ReactElement } from 'react';
|
|
2
|
+
type OrderedListEntry = {
|
|
3
|
+
/**
|
|
4
|
+
* Nested sub-items, rendered as a sub-list with hierarchical numbering.
|
|
5
|
+
*/
|
|
6
|
+
readonly children?: ReadonlyArray<OrderedListEntry>;
|
|
7
|
+
/**
|
|
8
|
+
* Display text for this item.
|
|
9
|
+
*/
|
|
10
|
+
readonly label: ReactNode;
|
|
11
|
+
};
|
|
12
|
+
type Props = {
|
|
13
|
+
/**
|
|
14
|
+
* Entries to render as a numbered list.
|
|
15
|
+
*/
|
|
16
|
+
readonly items: ReadonlyArray<OrderedListEntry>;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Renders a numbered list with hierarchical nesting support.
|
|
20
|
+
*/
|
|
21
|
+
declare function OrderedList({
|
|
22
|
+
items
|
|
23
|
+
}: Props): ReactElement;
|
|
24
|
+
export { OrderedList, OrderedListEntry, type Props as OrderedListProps, Props, OrderedList as default };
|
|
@@ -0,0 +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};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { ReactNode, ReactElement } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Metadata about the current page state, passed to the render-prop children.
|
|
4
|
+
*/
|
|
5
|
+
type PageMeta = {
|
|
6
|
+
readonly currentPage: number;
|
|
7
|
+
readonly endIndex: number;
|
|
8
|
+
readonly isFirstPage: boolean;
|
|
9
|
+
readonly isLastPage: boolean;
|
|
10
|
+
readonly startIndex: number;
|
|
11
|
+
readonly totalPages: number;
|
|
12
|
+
};
|
|
13
|
+
type Props<T> = {
|
|
14
|
+
/**
|
|
15
|
+
* Render-prop that receives the current page items and page metadata.
|
|
16
|
+
*/
|
|
17
|
+
readonly children: (pageItems: ReadonlyArray<T>, meta: PageMeta) => ReactNode;
|
|
18
|
+
/**
|
|
19
|
+
* Uncontrolled initial page (0-indexed).
|
|
20
|
+
* @default 0
|
|
21
|
+
*/
|
|
22
|
+
readonly defaultPage?: number;
|
|
23
|
+
/**
|
|
24
|
+
* Color for the active page indicator.
|
|
25
|
+
* @default "cyan"
|
|
26
|
+
*/
|
|
27
|
+
readonly indicatorColor?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Whether keyboard navigation is active.
|
|
30
|
+
* @default true
|
|
31
|
+
*/
|
|
32
|
+
readonly isFocused?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* The full list of items to paginate.
|
|
35
|
+
*/
|
|
36
|
+
readonly items: ReadonlyArray<T>;
|
|
37
|
+
/**
|
|
38
|
+
* Called when the page changes.
|
|
39
|
+
*/
|
|
40
|
+
readonly onChange?: (page: number) => void;
|
|
41
|
+
/**
|
|
42
|
+
* Controlled current page (0-indexed). When provided, the component is controlled.
|
|
43
|
+
*/
|
|
44
|
+
readonly page?: number;
|
|
45
|
+
/**
|
|
46
|
+
* Number of items per page.
|
|
47
|
+
*/
|
|
48
|
+
readonly pageSize: number;
|
|
49
|
+
/**
|
|
50
|
+
* Indicator style.
|
|
51
|
+
* - `"dots"`: `● ○ ○ ○`
|
|
52
|
+
* - `"numeric"`: `‹ 1 / 4 ›`
|
|
53
|
+
* - `"fraction"`: `1/4`
|
|
54
|
+
* @default "dots"
|
|
55
|
+
*/
|
|
56
|
+
readonly style?: "dots" | "fraction" | "numeric";
|
|
57
|
+
};
|
|
58
|
+
declare const Paginator: <T>({
|
|
59
|
+
children,
|
|
60
|
+
defaultPage,
|
|
61
|
+
indicatorColor,
|
|
62
|
+
isFocused,
|
|
63
|
+
items,
|
|
64
|
+
onChange,
|
|
65
|
+
page: controlledPage,
|
|
66
|
+
pageSize,
|
|
67
|
+
style
|
|
68
|
+
}: Props<T>) => ReactElement;
|
|
69
|
+
export { PageMeta, Paginator, type Props as PaginatorProps, Props, Paginator as default };
|
|
@@ -0,0 +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};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { AnsiColors } from '@visulima/colorize';
|
|
2
|
+
import { ReactNode, ReactElement } from 'react';
|
|
3
|
+
import { LiteralUnion } from 'type-fest';
|
|
4
|
+
type Props = {
|
|
5
|
+
/**
|
|
6
|
+
* Paragraph body.
|
|
7
|
+
*/
|
|
8
|
+
readonly children: ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* Foreground color.
|
|
11
|
+
*/
|
|
12
|
+
readonly color?: LiteralUnion<AnsiColors, string>;
|
|
13
|
+
/**
|
|
14
|
+
* Render the paragraph with dim color.
|
|
15
|
+
*/
|
|
16
|
+
readonly dimColor?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Blank lines to add after the paragraph.
|
|
19
|
+
* @default 1
|
|
20
|
+
*/
|
|
21
|
+
readonly marginBottom?: number;
|
|
22
|
+
/**
|
|
23
|
+
* Blank lines to add before the paragraph.
|
|
24
|
+
* @default 0
|
|
25
|
+
*/
|
|
26
|
+
readonly marginTop?: number;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Wraps body text with a trailing blank line. Useful for README-style layouts.
|
|
30
|
+
*/
|
|
31
|
+
declare function Paragraph({
|
|
32
|
+
children,
|
|
33
|
+
color,
|
|
34
|
+
dimColor,
|
|
35
|
+
marginBottom,
|
|
36
|
+
marginTop
|
|
37
|
+
}: Props): ReactElement;
|
|
38
|
+
export { Paragraph, type Props as ParagraphProps, Props, Paragraph as default };
|
|
@@ -0,0 +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};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { AnsiColors } from '@visulima/colorize';
|
|
2
|
+
import { ReactElement } from 'react';
|
|
3
|
+
import { LiteralUnion } from 'type-fest';
|
|
4
|
+
type Props = {
|
|
5
|
+
/**
|
|
6
|
+
* Whether to pulse the skeleton blocks (shimmer).
|
|
7
|
+
* @default true
|
|
8
|
+
*/
|
|
9
|
+
readonly animated?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Glyph repeated to fill each placeholder block.
|
|
12
|
+
* @default "█" (full block)
|
|
13
|
+
*/
|
|
14
|
+
readonly character?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Block color.
|
|
17
|
+
* @default "gray"
|
|
18
|
+
*/
|
|
19
|
+
readonly color?: LiteralUnion<AnsiColors, string>;
|
|
20
|
+
/**
|
|
21
|
+
* Milliseconds between pulses.
|
|
22
|
+
* @default 500
|
|
23
|
+
*/
|
|
24
|
+
readonly interval?: number;
|
|
25
|
+
/**
|
|
26
|
+
* Number of skeleton rows to render.
|
|
27
|
+
* @default 3
|
|
28
|
+
*/
|
|
29
|
+
readonly rows?: number;
|
|
30
|
+
/**
|
|
31
|
+
* Total width reference. When omitted, the block flexes to fill its
|
|
32
|
+
* parent.
|
|
33
|
+
*/
|
|
34
|
+
readonly width?: number;
|
|
35
|
+
/**
|
|
36
|
+
* Relative widths of each row (0–1). The list is sampled cyclically.
|
|
37
|
+
* @default [1, 0.85, 0.6]
|
|
38
|
+
*/
|
|
39
|
+
readonly widths?: ReadonlyArray<number>;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Skeleton loading indicator. Renders a stack of solid blocks whose widths
|
|
43
|
+
* vary to mimic text placeholders. Pair with `async` data fetching.
|
|
44
|
+
* @returns A `ReactElement` rendering the skeleton rows.
|
|
45
|
+
*/
|
|
46
|
+
declare function Placeholder({
|
|
47
|
+
animated,
|
|
48
|
+
character,
|
|
49
|
+
color,
|
|
50
|
+
interval,
|
|
51
|
+
rows,
|
|
52
|
+
width,
|
|
53
|
+
widths
|
|
54
|
+
}: Props): ReactElement;
|
|
55
|
+
export { Placeholder, type Props as PlaceholderProps, Props, Placeholder as default };
|
|
@@ -0,0 +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};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { Props as Props$1 } from "./text.js";
|
|
3
|
+
import '@visulima/colorize';
|
|
4
|
+
import 'type-fest';
|
|
5
|
+
import "../packem_shared/styles.d-cMo36xQz.js";
|
|
6
|
+
import 'cli-boxes';
|
|
7
|
+
import 'yoga-layout';
|
|
8
|
+
type Props = {
|
|
9
|
+
/** Fill glyph repeated across the completed portion of the progress bar. Defaults to "█". */
|
|
10
|
+
readonly character?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Override the terminal width used for calculation.
|
|
13
|
+
* When 0, uses the actual terminal width.
|
|
14
|
+
* @default 0
|
|
15
|
+
*/
|
|
16
|
+
readonly columns?: number;
|
|
17
|
+
/**
|
|
18
|
+
* Number of columns reserved on the left side (e.g. for labels).
|
|
19
|
+
* @default 0
|
|
20
|
+
*/
|
|
21
|
+
readonly left?: number;
|
|
22
|
+
/**
|
|
23
|
+
* Completion percentage between 0 and 1.
|
|
24
|
+
* @default 1
|
|
25
|
+
*/
|
|
26
|
+
readonly percent?: number;
|
|
27
|
+
/**
|
|
28
|
+
* Number of columns reserved on the right side (e.g. for percentage text).
|
|
29
|
+
* @default 0
|
|
30
|
+
*/
|
|
31
|
+
readonly right?: number;
|
|
32
|
+
/**
|
|
33
|
+
* Whether to pad the remaining space with whitespace.
|
|
34
|
+
* Useful when rendering the bar over a background color.
|
|
35
|
+
* @default false
|
|
36
|
+
*/
|
|
37
|
+
readonly rightPad?: boolean;
|
|
38
|
+
} & Omit<Props$1, "children">;
|
|
39
|
+
/**
|
|
40
|
+
* A terminal progress bar that fills proportionally to a percentage value.
|
|
41
|
+
*
|
|
42
|
+
* ```tsx
|
|
43
|
+
* <ProgressBar percent={0.5} />
|
|
44
|
+
* <ProgressBar percent={0.75} color="green" left={10} right={5} />
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
declare function ProgressBar({
|
|
48
|
+
character,
|
|
49
|
+
columns: columnsProp,
|
|
50
|
+
left,
|
|
51
|
+
percent,
|
|
52
|
+
right,
|
|
53
|
+
rightPad,
|
|
54
|
+
...textProps
|
|
55
|
+
}: Props): ReactElement;
|
|
56
|
+
export { ProgressBar, type Props as ProgressBarProps, Props, ProgressBar as default };
|
|
@@ -0,0 +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};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { AnsiColors } from '@visulima/colorize';
|
|
2
|
+
import { ReactElement } from 'react';
|
|
3
|
+
import { LiteralUnion } from 'type-fest';
|
|
4
|
+
type RadioOption = {
|
|
5
|
+
readonly description?: string;
|
|
6
|
+
readonly key?: string;
|
|
7
|
+
readonly label: string;
|
|
8
|
+
readonly value: string;
|
|
9
|
+
};
|
|
10
|
+
type Props = {
|
|
11
|
+
/**
|
|
12
|
+
* Accent color for the focused and selected indicator.
|
|
13
|
+
* @default "blue"
|
|
14
|
+
*/
|
|
15
|
+
readonly accentColor?: LiteralUnion<AnsiColors, string>;
|
|
16
|
+
/**
|
|
17
|
+
* Auto-focus when mounted.
|
|
18
|
+
*/
|
|
19
|
+
readonly autoFocus?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* When true, moving focus with arrow keys immediately updates the selected
|
|
22
|
+
* value (and fires `onChange`). When false, focus moves independently and
|
|
23
|
+
* selection commits only on Space or Enter.
|
|
24
|
+
* @default true
|
|
25
|
+
*/
|
|
26
|
+
readonly commitOnNavigate?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Initial selected value when uncontrolled.
|
|
29
|
+
*/
|
|
30
|
+
readonly defaultValue?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Disable input and dim labels.
|
|
33
|
+
*/
|
|
34
|
+
readonly isDisabled?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Called when selection changes.
|
|
37
|
+
*/
|
|
38
|
+
readonly onChange?: (value: string) => void;
|
|
39
|
+
/**
|
|
40
|
+
* Called when the user submits by pressing Enter.
|
|
41
|
+
*/
|
|
42
|
+
readonly onSubmit?: (value: string) => void;
|
|
43
|
+
/**
|
|
44
|
+
* Available options.
|
|
45
|
+
*/
|
|
46
|
+
readonly options: ReadonlyArray<RadioOption>;
|
|
47
|
+
/**
|
|
48
|
+
* Orientation of options.
|
|
49
|
+
* @default "vertical"
|
|
50
|
+
*/
|
|
51
|
+
readonly orientation?: "horizontal" | "vertical";
|
|
52
|
+
/**
|
|
53
|
+
* Controlled selected value.
|
|
54
|
+
*/
|
|
55
|
+
readonly value?: string;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Single-choice radio group with keyboard navigation. By default, navigation
|
|
59
|
+
* commits selection; set `commitOnNavigate={false}` to require an explicit
|
|
60
|
+
* Space/Enter commit.
|
|
61
|
+
*/
|
|
62
|
+
declare function RadioGroup({
|
|
63
|
+
accentColor,
|
|
64
|
+
autoFocus,
|
|
65
|
+
commitOnNavigate,
|
|
66
|
+
defaultValue,
|
|
67
|
+
isDisabled,
|
|
68
|
+
onChange,
|
|
69
|
+
onSubmit,
|
|
70
|
+
options,
|
|
71
|
+
orientation,
|
|
72
|
+
value
|
|
73
|
+
}: Props): ReactElement;
|
|
74
|
+
export { Props, RadioGroup, type Props as RadioGroupProps, RadioOption, RadioGroup as default };
|
|
@@ -0,0 +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};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { AnsiColors } from '@visulima/colorize';
|
|
2
|
+
import { ReactElement } from 'react';
|
|
3
|
+
import { LiteralUnion } from 'type-fest';
|
|
4
|
+
import { LineSeries } from "./line-chart.js";
|
|
5
|
+
import "../packem_shared/buffer.d-EJkZr8uH.js";
|
|
6
|
+
type Props = {
|
|
7
|
+
readonly axisColor?: LiteralUnion<AnsiColors, string>;
|
|
8
|
+
readonly height?: number;
|
|
9
|
+
readonly maxX?: number;
|
|
10
|
+
readonly maxY?: number;
|
|
11
|
+
readonly minX?: number;
|
|
12
|
+
readonly minY?: number;
|
|
13
|
+
readonly palette?: ReadonlyArray<LiteralUnion<AnsiColors, string>>;
|
|
14
|
+
readonly series: ReadonlyArray<LineSeries>;
|
|
15
|
+
readonly showLegend?: boolean;
|
|
16
|
+
readonly width?: number;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Scatter plot rendered on a braille pixel grid. Each sample lights one
|
|
20
|
+
* sub-cell pixel; overlapping points merge into denser braille glyphs.
|
|
21
|
+
* @returns A `ReactElement` containing the plot and an optional legend.
|
|
22
|
+
*/
|
|
23
|
+
declare function ScatterPlot({
|
|
24
|
+
axisColor,
|
|
25
|
+
height,
|
|
26
|
+
maxX,
|
|
27
|
+
maxY,
|
|
28
|
+
minX,
|
|
29
|
+
minY,
|
|
30
|
+
palette,
|
|
31
|
+
series,
|
|
32
|
+
showLegend,
|
|
33
|
+
width
|
|
34
|
+
}: Props): ReactElement;
|
|
35
|
+
export { Props, ScatterPlot, type Props as ScatterPlotProps, ScatterPlot as default };
|
|
@@ -0,0 +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};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BoxProps as Props } from "./box.js";
|
|
3
|
+
import 'type-fest';
|
|
4
|
+
import "../packem_shared/dom.d-B4kXbaVY.js";
|
|
5
|
+
import 'yoga-layout';
|
|
6
|
+
import "../packem_shared/cursor-helpers.d-BONB9tky.js";
|
|
7
|
+
import '@visulima/colorize';
|
|
8
|
+
import 'cli-boxes';
|
|
9
|
+
import "../packem_shared/styles.d-cMo36xQz.js";
|
|
10
|
+
interface ScrollBarBoxProps extends Props {
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
contentHeight: number;
|
|
13
|
+
scrollBarAutoHide?: boolean;
|
|
14
|
+
scrollBarPosition?: "left" | "right";
|
|
15
|
+
scrollOffset: number;
|
|
16
|
+
thumbChar?: string;
|
|
17
|
+
viewportHeight: number;
|
|
18
|
+
}
|
|
19
|
+
declare const ScrollBarBox: ({
|
|
20
|
+
borderColor,
|
|
21
|
+
borderDimColor,
|
|
22
|
+
borderLeftColor,
|
|
23
|
+
borderLeftDimColor,
|
|
24
|
+
borderRightColor,
|
|
25
|
+
borderRightDimColor,
|
|
26
|
+
borderStyle,
|
|
27
|
+
children,
|
|
28
|
+
contentHeight,
|
|
29
|
+
height,
|
|
30
|
+
scrollBarAutoHide,
|
|
31
|
+
scrollBarPosition,
|
|
32
|
+
scrollOffset,
|
|
33
|
+
thumbChar,
|
|
34
|
+
viewportHeight,
|
|
35
|
+
...boxProps
|
|
36
|
+
}: ScrollBarBoxProps) => React.JSX.Element;
|
|
37
|
+
export { ScrollBarBox, type ScrollBarBoxProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ScrollBarBox as l}from"../packem_shared/ScrollBarBox-DchESZWv.js";export{l as ScrollBarBox};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BoxProps as Props } from "./box.js";
|
|
3
|
+
import 'type-fest';
|
|
4
|
+
import "../packem_shared/dom.d-B4kXbaVY.js";
|
|
5
|
+
import 'yoga-layout';
|
|
6
|
+
import "../packem_shared/cursor-helpers.d-BONB9tky.js";
|
|
7
|
+
import '@visulima/colorize';
|
|
8
|
+
import 'cli-boxes';
|
|
9
|
+
import "../packem_shared/styles.d-cMo36xQz.js";
|
|
10
|
+
type ScrollBarPlacement = "inset" | "left" | "right";
|
|
11
|
+
type ScrollBarStyle = Props["borderStyle"] | "block" | "line" | "thick" | "dots";
|
|
12
|
+
interface ScrollBarProps {
|
|
13
|
+
autoHide?: boolean;
|
|
14
|
+
color?: string;
|
|
15
|
+
contentHeight: number;
|
|
16
|
+
dimColor?: boolean;
|
|
17
|
+
placement?: ScrollBarPlacement;
|
|
18
|
+
scrollOffset: number;
|
|
19
|
+
style?: ScrollBarStyle;
|
|
20
|
+
thumbChar?: string;
|
|
21
|
+
trackChar?: string;
|
|
22
|
+
viewportHeight: number;
|
|
23
|
+
}
|
|
24
|
+
declare const ScrollBar: React.FC<ScrollBarProps>;
|
|
25
|
+
export { ScrollBar, type ScrollBarPlacement, type ScrollBarProps, type ScrollBarStyle };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ScrollBar as l}from"../packem_shared/ScrollBar-qa1IzDDv.js";export{l as ScrollBar};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React, { Ref } from 'react';
|
|
2
|
+
import { a as ScrollViewProps, b as ScrollViewRef } from "../packem_shared/scroll-view.d-DtpsgHLg.js";
|
|
3
|
+
import "./box.js";
|
|
4
|
+
import 'type-fest';
|
|
5
|
+
import "../packem_shared/dom.d-B4kXbaVY.js";
|
|
6
|
+
import 'yoga-layout';
|
|
7
|
+
import "../packem_shared/cursor-helpers.d-BONB9tky.js";
|
|
8
|
+
import '@visulima/colorize';
|
|
9
|
+
import 'cli-boxes';
|
|
10
|
+
import "../packem_shared/styles.d-cMo36xQz.js";
|
|
11
|
+
type ScrollAlignment = "auto" | "bottom" | "center" | "top";
|
|
12
|
+
interface ScrollListProps extends ScrollViewProps {
|
|
13
|
+
readonly scrollAlignment?: ScrollAlignment;
|
|
14
|
+
readonly selectedIndex?: number;
|
|
15
|
+
}
|
|
16
|
+
type ScrollListRef = ScrollViewRef;
|
|
17
|
+
declare const ScrollList: (props: ScrollListProps & {
|
|
18
|
+
ref?: Ref<ScrollListRef>;
|
|
19
|
+
}) => React.JSX.Element;
|
|
20
|
+
export { type ScrollAlignment, ScrollList, type ScrollListProps, type ScrollListRef };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ScrollList as l}from"../packem_shared/ScrollList-BBAnRsrC.js";export{l as ScrollList};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { S as ScrollView, type a as ScrollViewProps, type b as ScrollViewRef } from "../packem_shared/scroll-view.d-DtpsgHLg.js";
|
|
2
|
+
import 'react';
|
|
3
|
+
import "./box.js";
|
|
4
|
+
import 'type-fest';
|
|
5
|
+
import "../packem_shared/dom.d-B4kXbaVY.js";
|
|
6
|
+
import 'yoga-layout';
|
|
7
|
+
import "../packem_shared/cursor-helpers.d-BONB9tky.js";
|
|
8
|
+
import '@visulima/colorize';
|
|
9
|
+
import 'cli-boxes';
|
|
10
|
+
import "../packem_shared/styles.d-cMo36xQz.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ScrollView as e}from"../packem_shared/ScrollView-CHAo7Epj.js";export{e as ScrollView};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { AnsiColors } from '@visulima/colorize';
|
|
2
|
+
import { ReactNode, ReactElement } from 'react';
|
|
3
|
+
import { LiteralUnion } from 'type-fest';
|
|
4
|
+
type Props = {
|
|
5
|
+
/**
|
|
6
|
+
* Color of the accent elements (border, icon).
|
|
7
|
+
* @default "blue"
|
|
8
|
+
*/
|
|
9
|
+
readonly accentColor?: LiteralUnion<AnsiColors, string>;
|
|
10
|
+
/**
|
|
11
|
+
* Initial value.
|
|
12
|
+
*/
|
|
13
|
+
readonly defaultValue?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Node rendered before the input as a search affordance.
|
|
16
|
+
* @default "⌕" (telephone recorder)
|
|
17
|
+
*/
|
|
18
|
+
readonly icon?: ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* Disable the input.
|
|
21
|
+
*/
|
|
22
|
+
readonly isDisabled?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Fired whenever the value changes.
|
|
25
|
+
*/
|
|
26
|
+
readonly onChange?: (value: string) => void;
|
|
27
|
+
/**
|
|
28
|
+
* Fired when the user presses Enter.
|
|
29
|
+
*/
|
|
30
|
+
readonly onSubmit?: (value: string) => void;
|
|
31
|
+
/**
|
|
32
|
+
* Placeholder text shown when the input is empty.
|
|
33
|
+
* @default "Search..."
|
|
34
|
+
*/
|
|
35
|
+
readonly placeholder?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Autocomplete suggestions.
|
|
38
|
+
*/
|
|
39
|
+
readonly suggestions?: ReadonlyArray<string>;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Search-styled text input with an icon and bordered container.
|
|
43
|
+
* @returns A `ReactElement` wrapping `TextInput` with an icon column.
|
|
44
|
+
*/
|
|
45
|
+
declare function SearchInput({
|
|
46
|
+
accentColor,
|
|
47
|
+
defaultValue,
|
|
48
|
+
icon,
|
|
49
|
+
isDisabled,
|
|
50
|
+
onChange,
|
|
51
|
+
onSubmit,
|
|
52
|
+
placeholder,
|
|
53
|
+
suggestions
|
|
54
|
+
}: Props): ReactElement;
|
|
55
|
+
export { Props, SearchInput, type Props as SearchInputProps, SearchInput as default };
|
|
@@ -0,0 +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};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { AnsiColors } from '@visulima/colorize';
|
|
2
|
+
import { ReactElement } from 'react';
|
|
3
|
+
import { LiteralUnion } from 'type-fest';
|
|
4
|
+
type Props = {
|
|
5
|
+
/**
|
|
6
|
+
* Color of the indicator when selected.
|
|
7
|
+
* @default "blue"
|
|
8
|
+
*/
|
|
9
|
+
readonly accentColor?: LiteralUnion<AnsiColors, string>;
|
|
10
|
+
/**
|
|
11
|
+
* Whether the parent SelectInput has focus.
|
|
12
|
+
* When `false`, the indicator is dimmed even if the item is selected.
|
|
13
|
+
* @default true
|
|
14
|
+
*/
|
|
15
|
+
readonly isFocused?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Whether this indicator's item is currently selected.
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
20
|
+
readonly isSelected?: boolean;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Renders a pointer indicator next to the selected item, or a blank space otherwise.
|
|
24
|
+
* When unfocused, the indicator is rendered with `dimColor` to visually distinguish
|
|
25
|
+
* the active select input from inactive ones.
|
|
26
|
+
*/
|
|
27
|
+
declare function SelectInputIndicator({
|
|
28
|
+
accentColor,
|
|
29
|
+
isFocused,
|
|
30
|
+
isSelected
|
|
31
|
+
}: Props): ReactElement;
|
|
32
|
+
export { Props, SelectInputIndicator, type Props as SelectInputIndicatorProps, SelectInputIndicator as default };
|
|
@@ -0,0 +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};
|