@visulima/tui 1.0.0-alpha.9 → 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 +648 -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 +585 -31
- 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,59 @@
|
|
|
1
|
+
import { Ref, ReactElement } from 'react';
|
|
2
|
+
import { UseTimerResult } from "../ink/hooks/use-timer.js";
|
|
3
|
+
type TimerRef = Omit<UseTimerResult, "isFinished" | "isRunning" | "remaining">;
|
|
4
|
+
type Props = {
|
|
5
|
+
/**
|
|
6
|
+
* Whether to start the timer immediately.
|
|
7
|
+
* @default false
|
|
8
|
+
*/
|
|
9
|
+
readonly autoStart?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Make the rendered text bold.
|
|
12
|
+
*/
|
|
13
|
+
readonly bold?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Text color for the rendered time.
|
|
16
|
+
*/
|
|
17
|
+
readonly color?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Total countdown duration in milliseconds.
|
|
20
|
+
*/
|
|
21
|
+
readonly duration: number;
|
|
22
|
+
/**
|
|
23
|
+
* Custom formatter for the remaining time.
|
|
24
|
+
* Receives remaining milliseconds, returns a display string.
|
|
25
|
+
* @default formatDuration (MM:SS or HH:MM:SS)
|
|
26
|
+
*/
|
|
27
|
+
readonly format?: (remaining: number) => string;
|
|
28
|
+
/**
|
|
29
|
+
* Tick interval in milliseconds.
|
|
30
|
+
* @default 1000
|
|
31
|
+
*/
|
|
32
|
+
readonly interval?: number;
|
|
33
|
+
/**
|
|
34
|
+
* Called once when the timer reaches zero.
|
|
35
|
+
*/
|
|
36
|
+
readonly onTimeout?: () => void;
|
|
37
|
+
readonly ref?: Ref<TimerRef>;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* A countdown timer component.
|
|
41
|
+
*
|
|
42
|
+
* Exposes `start`, `stop`, `toggle`, and `reset` methods via ref.
|
|
43
|
+
*
|
|
44
|
+
* ```tsx
|
|
45
|
+
* const ref = useRef<TimerRef>(null);
|
|
46
|
+
* <Timer ref={ref} duration={60_000} autoStart />
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
declare const Timer: ({
|
|
50
|
+
autoStart,
|
|
51
|
+
bold,
|
|
52
|
+
color,
|
|
53
|
+
duration,
|
|
54
|
+
format,
|
|
55
|
+
interval,
|
|
56
|
+
onTimeout,
|
|
57
|
+
ref
|
|
58
|
+
}: Props) => ReactElement;
|
|
59
|
+
export { Props, Timer, type Props as TimerProps, TimerRef, Timer as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as l}from"react/jsx-runtime";import{useImperativeHandle as f}from"react";import p from"../ink/hooks/use-timer.js";import{f as u}from"../packem_shared/format-time-fjoQHMxD.js";import{Text as d}from"./text.js";const b=({autoStart:o,bold:r,color:e,duration:a,format:i=u,interval:m,onTimeout:s,ref:n})=>{const t=p({autoStart:o,duration:a,interval:m,onTimeout:s});return f(n,()=>({reset:t.reset,start:t.start,stop:t.stop,toggle:t.toggle}),[t.reset,t.start,t.stop,t.toggle]),l(d,{bold:r,color:e,children:i(t.remaining)})};export{b as Timer,b as default};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { ReactNode, ReactElement } from 'react';
|
|
2
|
+
import { V as Variant } from "../packem_shared/variant-config.d-D5NnrrQK.js";
|
|
3
|
+
type ToastVariant = Variant;
|
|
4
|
+
type Props = {
|
|
5
|
+
/**
|
|
6
|
+
* Toast body.
|
|
7
|
+
*/
|
|
8
|
+
readonly children: ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* Milliseconds to display before auto-dismissing. Use `0` to disable.
|
|
11
|
+
* @default 4000
|
|
12
|
+
*/
|
|
13
|
+
readonly duration?: number;
|
|
14
|
+
/**
|
|
15
|
+
* Called after the toast dismisses itself.
|
|
16
|
+
*/
|
|
17
|
+
readonly onDismiss?: () => void;
|
|
18
|
+
/**
|
|
19
|
+
* Optional title rendered before the body.
|
|
20
|
+
*/
|
|
21
|
+
readonly title?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Visual variant determining the icon and border color.
|
|
24
|
+
* @default "info"
|
|
25
|
+
*/
|
|
26
|
+
readonly variant?: ToastVariant;
|
|
27
|
+
/**
|
|
28
|
+
* Manually control visibility. When provided, `duration` is ignored.
|
|
29
|
+
*/
|
|
30
|
+
readonly visible?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Optional width override.
|
|
33
|
+
*/
|
|
34
|
+
readonly width?: number;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Ephemeral notification. Disappears automatically after `duration` ms.
|
|
38
|
+
* @returns A bordered `ReactElement` while visible; `null` once dismissed.
|
|
39
|
+
*/
|
|
40
|
+
declare function Toast({
|
|
41
|
+
children,
|
|
42
|
+
duration,
|
|
43
|
+
onDismiss,
|
|
44
|
+
title,
|
|
45
|
+
variant,
|
|
46
|
+
visible,
|
|
47
|
+
width
|
|
48
|
+
}: Props): ReactElement | null;
|
|
49
|
+
export { Props, Toast, type Props as ToastProps, ToastVariant, Toast as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsxs as c,jsx as t}from"react/jsx-runtime";import{useState as v,useRef as T,useEffect as w}from"react";import{Box as u}from"./box.js";import{Text as i}from"./text.js";import{o as g}from"../packem_shared/variant-config-BJqpNo7H.js";function B({children:f,duration:r=4e3,onDismiss:n,title:l,variant:m="info",visible:o,width:a}){const[p,h]=v(!0),e=o??p,d=T(n);if(d.current=n,w(()=>{if(o!==void 0||r<=0||!e)return;const b=setTimeout(()=>{h(!1),d.current?.()},r);return()=>{clearTimeout(b)}},[r,o,e]),!e)return null;const{color:s,icon:x}=g[m];return c(u,{borderColor:s,borderStyle:"round",gap:1,paddingX:1,width:a,children:[t(i,{color:s,children:x}),c(u,{flexDirection:"column",flexGrow:1,children:[l===void 0?void 0:t(i,{bold:!0,children:l}),t(i,{children:f})]})]})}export{B as Toast,B as default};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { AnsiColors } from '@visulima/colorize';
|
|
2
|
+
import { ReactNode, ReactElement } from 'react';
|
|
3
|
+
import { LiteralUnion } from 'type-fest';
|
|
4
|
+
type TooltipPlacement = "bottom" | "left" | "right" | "top";
|
|
5
|
+
type Props = {
|
|
6
|
+
/**
|
|
7
|
+
* The element the tooltip is attached to.
|
|
8
|
+
*/
|
|
9
|
+
readonly children: ReactNode;
|
|
10
|
+
/**
|
|
11
|
+
* Border color.
|
|
12
|
+
* @default "gray"
|
|
13
|
+
*/
|
|
14
|
+
readonly color?: LiteralUnion<AnsiColors, string>;
|
|
15
|
+
/**
|
|
16
|
+
* Tooltip body content.
|
|
17
|
+
*/
|
|
18
|
+
readonly content: ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* Controls whether the tooltip is rendered.
|
|
21
|
+
* @default true
|
|
22
|
+
*/
|
|
23
|
+
readonly isVisible?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Relative position. Terminal rendering does not support floating layers,
|
|
26
|
+
* so the tooltip is placed inline next to (or above / below) the anchor.
|
|
27
|
+
* @default "right"
|
|
28
|
+
*/
|
|
29
|
+
readonly placement?: TooltipPlacement;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Renders supplementary text next to an anchor. Because terminals don't have
|
|
33
|
+
* a floating-layer concept, the tooltip lives inline in the layout. Hide it
|
|
34
|
+
* by toggling `isVisible`.
|
|
35
|
+
*/
|
|
36
|
+
declare function Tooltip({
|
|
37
|
+
children,
|
|
38
|
+
color,
|
|
39
|
+
content,
|
|
40
|
+
isVisible,
|
|
41
|
+
placement
|
|
42
|
+
}: Props): ReactElement;
|
|
43
|
+
export { Props, Tooltip, TooltipPlacement, type Props as TooltipProps, Tooltip as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as o,jsxs as f}from"react/jsx-runtime";import{Box as t}from"./box.js";import{Text as a}from"./text.js";const m={bottom:{flexDirection:"column",orderFirst:!1},left:{flexDirection:"row",orderFirst:!0},right:{flexDirection:"row",orderFirst:!1},top:{flexDirection:"column",orderFirst:!0}};function p({children:c,color:i="gray",content:r,isVisible:s=!0,placement:e="right"}){const{flexDirection:d,orderFirst:n}=m[e],l=s?o(t,{borderColor:i,borderStyle:"round",flexShrink:0,marginLeft:e==="right"?1:0,marginRight:e==="left"?1:0,paddingX:1,children:typeof r=="string"?o(a,{color:i,children:r}):r}):void 0;return f(t,{alignItems:"center",flexDirection:d,children:[n?l:void 0,o(t,{children:c}),n?void 0:l]})}export{p as Tooltip,p as default};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ReactNode, ReactElement } from 'react';
|
|
2
|
+
type Props = {
|
|
3
|
+
/**
|
|
4
|
+
* Screen-reader-specific text to output. If this is set, all children will be ignored.
|
|
5
|
+
*/
|
|
6
|
+
readonly accessibilityLabel?: string;
|
|
7
|
+
readonly children?: ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Function that transforms children output. It accepts children and must return transformed children as well. Note that when children use `<Text>` styling props (e.g. `color`, `bold`), the string will contain ANSI escape codes.
|
|
10
|
+
*/
|
|
11
|
+
readonly transform: (children: string, index: number) => string;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Transform a string representation of React components before they're written to output. For example, you might want to apply a gradient to text, add a clickable link, or create some text effects. These use cases can't accept React nodes as input; they expect a string. That's what the <Transform> component does: it gives you an output string of its child components and lets you transform it in any way.
|
|
15
|
+
*/
|
|
16
|
+
declare function Transform({
|
|
17
|
+
accessibilityLabel,
|
|
18
|
+
children,
|
|
19
|
+
transform
|
|
20
|
+
}: Props): ReactElement | null;
|
|
21
|
+
export { Props, Transform, type Props as TransformProps, Transform as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{useContext as i}from"react";import{a as l}from"../packem_shared/accessibility-context-DDyHTwmA.js";const s={flexDirection:"row",flexGrow:0,flexShrink:1};function m({accessibilityLabel:r,children:t,transform:e}){const{isScreenReaderEnabled:n}=i(l);return t==null?null:o("ink-text",{internal_transform:e,style:s,children:n&&r?r:t})}export{m as Transform,m as default};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { ReactNode, ReactElement } from 'react';
|
|
2
|
+
type TransitionPreset = "fade" | "reveal" | "slide-down" | "slide-left" | "slide-right" | "slide-up";
|
|
3
|
+
type TransitionPhase = "entered" | "entering" | "exited" | "exiting";
|
|
4
|
+
type Props = {
|
|
5
|
+
/**
|
|
6
|
+
* Content to animate.
|
|
7
|
+
*/
|
|
8
|
+
readonly children: ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* For slide presets, how many characters of offset to animate across.
|
|
11
|
+
* For the `reveal` preset, the maximum row count to scale through.
|
|
12
|
+
* @default 4
|
|
13
|
+
*/
|
|
14
|
+
readonly distance?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Duration of both enter and exit transitions, in milliseconds.
|
|
17
|
+
* @default 240
|
|
18
|
+
*/
|
|
19
|
+
readonly duration?: number;
|
|
20
|
+
/**
|
|
21
|
+
* Called once the exit animation finishes (i.e. the component has fully
|
|
22
|
+
* transitioned out). AnimatePresence uses this to unmount the wrapper.
|
|
23
|
+
*/
|
|
24
|
+
readonly onExit?: () => void;
|
|
25
|
+
/**
|
|
26
|
+
* Animation preset controlling how the content appears/disappears.
|
|
27
|
+
* @default "fade"
|
|
28
|
+
*/
|
|
29
|
+
readonly preset?: TransitionPreset;
|
|
30
|
+
/**
|
|
31
|
+
* Controls the target phase. `true` drives towards `entered`, `false`
|
|
32
|
+
* drives towards `exited`. Flip the value to trigger animation.
|
|
33
|
+
* @default true
|
|
34
|
+
*/
|
|
35
|
+
readonly show?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Tick interval in milliseconds. Lower values yield smoother animation
|
|
38
|
+
* at the cost of CPU.
|
|
39
|
+
* @default 30
|
|
40
|
+
*/
|
|
41
|
+
readonly tickInterval?: number;
|
|
42
|
+
};
|
|
43
|
+
type TransitionComponent = ((props: Props) => ReactElement | null) & {
|
|
44
|
+
isAnimatable: true;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Animate a child's entry and exit using a TUI-friendly preset. Drive via
|
|
48
|
+
* `show`; the component toggles between enter and exit, fires `onExit` once
|
|
49
|
+
* the exit animation completes.
|
|
50
|
+
*
|
|
51
|
+
* **Fade preset note:** `dimColor` is only applied when the child is a plain
|
|
52
|
+
* string. Non-string children (Box trees, other components) pass through
|
|
53
|
+
* untouched during the transition — wrap them in `<Text>` if you need the
|
|
54
|
+
* fade effect.
|
|
55
|
+
* @returns A `ReactElement` rendering the transitioning child, or `null`
|
|
56
|
+
* once a hidden transition has fully completed.
|
|
57
|
+
*/
|
|
58
|
+
declare function Transition({
|
|
59
|
+
children,
|
|
60
|
+
distance,
|
|
61
|
+
duration,
|
|
62
|
+
onExit,
|
|
63
|
+
preset,
|
|
64
|
+
show,
|
|
65
|
+
tickInterval
|
|
66
|
+
}: Props): ReactElement | null;
|
|
67
|
+
/**
|
|
68
|
+
* Static marker used by `AnimatePresence` to recognize Transition children
|
|
69
|
+
* even when the consumer hasn't explicitly passed a `show` prop. Consumers
|
|
70
|
+
* can apply the same marker to their own wrappers (`MyWrapper.isAnimatable
|
|
71
|
+
* = true`) to opt them into animation orchestration.
|
|
72
|
+
*/
|
|
73
|
+
declare const TransitionWithMarker: TransitionComponent;
|
|
74
|
+
export { Props, Transition, TransitionPhase, TransitionPreset, type Props as TransitionProps, TransitionWithMarker as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{useState as w,useRef as d,useEffect as D}from"react";import{Box as c}from"./box.js";import{Text as b}from"./text.js";const j=(t,r)=>t>=1?e(c,{children:r}):t<=0?e(c,{}):e(c,{children:typeof r=="string"?e(b,{dimColor:t<.7,children:r}):r}),y=(t,r)=>Math.max(0,Math.min(r,Math.round((1-t)*r))),f=(t,r)=>(i,u,h)=>{const n=y(i,h);return i>=1?e(c,{children:u}):i<=0?e(c,{}):t==="x"?e(c,{paddingLeft:r===1?n:0,paddingRight:r===-1?n:0,children:u}):e(c,{flexDirection:"column",paddingBottom:r===-1?n:0,paddingTop:r===1?n:0,children:u})},A=(t,r,i)=>{if(t>=1)return e(c,{children:r});if(t<=0)return e(c,{});const u=Math.max(0,Math.min(i,Math.round(t*i)));return e(c,{flexDirection:"column",height:u,overflowY:"hidden",children:r})},C={fade:j,reveal:A,"slide-down":f("y",-1),"slide-left":f("x",-1),"slide-right":f("x",1),"slide-up":f("y",1)},O=(t,r)=>t?r>=1?"entered":"entering":r<=0?"exited":"exiting";function K({children:t,distance:r=4,duration:i=240,onExit:u,preset:h="fade",show:n=!0,tickInterval:g=30}){const[m,I]=w(n?1:0),x=d(n?1:0),M=d(Date.now()),s=d(n?1:0),a=d(!n),p=d(u);p.current=u;const[k,B]=w(0);if(D(()=>{const o=n?1:0;x.current!==o&&(x.current=o,M.current=Date.now(),s.current=m,a.current=!1,B(l=>l+1))},[n]),D(()=>{const o=x.current;if(s.current===o){o===0&&!a.current&&(a.current=!0,p.current?.());return}const l=setInterval(()=>{const R=Date.now()-M.current,v=i<=0?1:Math.min(1,R/i),T=s.current+(o-s.current)*v;I(T),v>=1&&(clearInterval(l),o===0&&!a.current&&(a.current=!0,p.current?.()))},g);return()=>{clearInterval(l)}},[k,i,g]),O(n,m)==="exited"&&!n)return null;const E=C[h];return E(m,t,r)}const Y=Object.assign(K,{isAnimatable:!0});export{K as Transition,Y as default};
|
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
import { BoxProps as Props$1 } from "./box.js";
|
|
2
|
+
import { Props as Props$2 } from "./text.js";
|
|
3
|
+
import { ReactNode, ReactElement } from 'react';
|
|
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 StyleFunctionProps = {
|
|
12
|
+
readonly depth?: number;
|
|
13
|
+
readonly hasChildren?: boolean;
|
|
14
|
+
readonly isExpanded?: boolean;
|
|
15
|
+
readonly isFocused?: boolean;
|
|
16
|
+
readonly isLoading?: boolean;
|
|
17
|
+
readonly isSelected?: boolean;
|
|
18
|
+
};
|
|
19
|
+
declare const theme: {
|
|
20
|
+
styles: {
|
|
21
|
+
container: () => Props$1;
|
|
22
|
+
expandIndicator: (_props: StyleFunctionProps) => Props$2;
|
|
23
|
+
focusIndicator: () => Props$2;
|
|
24
|
+
indent: ({
|
|
25
|
+
depth
|
|
26
|
+
}: StyleFunctionProps) => Props$1;
|
|
27
|
+
label: ({
|
|
28
|
+
isFocused,
|
|
29
|
+
isSelected
|
|
30
|
+
}: StyleFunctionProps) => Props$2;
|
|
31
|
+
loadingIndicator: () => Props$2;
|
|
32
|
+
node: ({
|
|
33
|
+
isFocused
|
|
34
|
+
}: StyleFunctionProps) => Props$1;
|
|
35
|
+
selectedIndicator: () => Props$2;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
type Theme = typeof theme;
|
|
39
|
+
/**
|
|
40
|
+
* A single node in the tree. Generic over the user's data shape.
|
|
41
|
+
* The `id` field MUST be unique across the entire tree.
|
|
42
|
+
*/
|
|
43
|
+
type TreeNode<T = Record<string, unknown>> = {
|
|
44
|
+
/** Child nodes. Undefined or empty array means leaf node. */
|
|
45
|
+
readonly children?: TreeNode<T>[];
|
|
46
|
+
/** Arbitrary user data attached to this node. */
|
|
47
|
+
readonly data?: T;
|
|
48
|
+
/** Unique identifier for this node. Used as the key for all lookups. */
|
|
49
|
+
readonly id: string;
|
|
50
|
+
/**
|
|
51
|
+
* Explicitly marks this node as a parent that can have children loaded
|
|
52
|
+
* asynchronously via `loadChildren`. When true, the node shows an expand
|
|
53
|
+
* indicator even if `children` is empty or undefined, and expanding it
|
|
54
|
+
* triggers the `loadChildren` callback.
|
|
55
|
+
*/
|
|
56
|
+
readonly isParent?: boolean;
|
|
57
|
+
/** Display label. Used by the default renderer. */
|
|
58
|
+
readonly label: string;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* For async/lazy loading: a function that resolves children on demand.
|
|
62
|
+
*/
|
|
63
|
+
type AsyncChildrenFunction<T = Record<string, unknown>> = (node: TreeNode<T>) => Promise<TreeNode<T>[]>;
|
|
64
|
+
/**
|
|
65
|
+
* State passed to custom renderers and theme functions.
|
|
66
|
+
*/
|
|
67
|
+
type TreeNodeState = {
|
|
68
|
+
/** Depth of this node in the tree (root = 0). */
|
|
69
|
+
readonly depth: number;
|
|
70
|
+
/** Whether this node has children (or a lazy loader). */
|
|
71
|
+
readonly hasChildren: boolean;
|
|
72
|
+
/** Whether this node is expanded (children visible). */
|
|
73
|
+
readonly isExpanded: boolean;
|
|
74
|
+
/** Whether this node is currently focused (cursor is on it). */
|
|
75
|
+
readonly isFocused: boolean;
|
|
76
|
+
/** Whether children are currently loading (async mode). */
|
|
77
|
+
readonly isLoading: boolean;
|
|
78
|
+
/** Whether this node is selected (in select/multi-select mode). */
|
|
79
|
+
readonly isSelected: boolean;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Props received by a custom node renderer.
|
|
83
|
+
*/
|
|
84
|
+
type TreeNodeRendererProps<T = Record<string, unknown>> = {
|
|
85
|
+
/** The tree node data. */
|
|
86
|
+
readonly node: TreeNode<T>;
|
|
87
|
+
/** Current state of this node. */
|
|
88
|
+
readonly state: TreeNodeState;
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* Selection mode for the tree view.
|
|
92
|
+
*/
|
|
93
|
+
type SelectionMode = "multiple" | "none" | "single";
|
|
94
|
+
/**
|
|
95
|
+
* A flattened representation of a tree node with navigation links.
|
|
96
|
+
*/
|
|
97
|
+
type FlatNode<T = Record<string, unknown>> = {
|
|
98
|
+
/** Ordered list of direct children IDs. */
|
|
99
|
+
readonly childrenIds: ReadonlyArray<string>;
|
|
100
|
+
/** Depth in the tree (0 for roots). */
|
|
101
|
+
readonly depth: number;
|
|
102
|
+
/** Index in the flattened DFS order (across ALL nodes, not just visible). */
|
|
103
|
+
readonly flatIndex: number;
|
|
104
|
+
/** Whether this node has children. */
|
|
105
|
+
readonly hasChildren: boolean;
|
|
106
|
+
/** Next sibling's ID, or undefined. */
|
|
107
|
+
readonly nextSiblingId: string | undefined;
|
|
108
|
+
/** The original tree node. */
|
|
109
|
+
readonly node: TreeNode<T>;
|
|
110
|
+
/** Parent's id, or undefined if root. */
|
|
111
|
+
readonly parentId: string | undefined;
|
|
112
|
+
/** Previous sibling's ID, or undefined. */
|
|
113
|
+
readonly previousSiblingId: string | undefined;
|
|
114
|
+
/** Total number of siblings (including this node). */
|
|
115
|
+
readonly siblingCount: number;
|
|
116
|
+
/** Zero-based index among siblings. */
|
|
117
|
+
readonly siblingIndex: number;
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* A flattened map of all tree nodes built via DFS traversal.
|
|
121
|
+
* Stores parent/child/sibling links for O(1) navigation.
|
|
122
|
+
*/
|
|
123
|
+
declare class TreeNodeMap<T = Record<string, unknown>> {
|
|
124
|
+
/** All node IDs in DFS order. */
|
|
125
|
+
readonly orderedIds: string[];
|
|
126
|
+
/** Root-level node IDs. */
|
|
127
|
+
readonly rootIds: string[];
|
|
128
|
+
/** Map from node ID to FlatNode. */
|
|
129
|
+
private readonly map;
|
|
130
|
+
constructor(data: TreeNode<T>[]);
|
|
131
|
+
/**
|
|
132
|
+
* Iterate over all entries.
|
|
133
|
+
*/
|
|
134
|
+
entries(): IterableIterator<[string, FlatNode<T>]>;
|
|
135
|
+
/**
|
|
136
|
+
* Get a flat node by ID.
|
|
137
|
+
*/
|
|
138
|
+
get(id: string): FlatNode<T> | undefined;
|
|
139
|
+
/**
|
|
140
|
+
* Total number of nodes in the tree.
|
|
141
|
+
*/
|
|
142
|
+
get size(): number;
|
|
143
|
+
/**
|
|
144
|
+
* Given a set of expanded node IDs, return the ordered list of
|
|
145
|
+
* VISIBLE node IDs (i.e., a node is visible if all its ancestors
|
|
146
|
+
* are expanded).
|
|
147
|
+
*
|
|
148
|
+
* Uses iterative DFS, skipping collapsed subtrees.
|
|
149
|
+
*/
|
|
150
|
+
getVisibleIds(expandedIds: ReadonlySet<string>): string[];
|
|
151
|
+
/**
|
|
152
|
+
* Check if a node is a descendant of another node.
|
|
153
|
+
*/
|
|
154
|
+
isDescendantOf(nodeId: string, ancestorId: string): boolean;
|
|
155
|
+
/**
|
|
156
|
+
* Insert dynamically-loaded children under a parent node.
|
|
157
|
+
* Returns a new TreeNodeMap (immutable operation).
|
|
158
|
+
*
|
|
159
|
+
* Rebuilds the full tree from the current map state (not the original
|
|
160
|
+
* input data), so successive calls for different parents are safe.
|
|
161
|
+
*/
|
|
162
|
+
withChildren(parentId: string, children: TreeNode<T>[]): TreeNodeMap<T>;
|
|
163
|
+
private buildFromData;
|
|
164
|
+
}
|
|
165
|
+
type Props<T = Record<string, unknown>> = {
|
|
166
|
+
/**
|
|
167
|
+
* Accessible label for the tree container.
|
|
168
|
+
* Useful when multiple tree views are on screen.
|
|
169
|
+
* @default "Tree view"
|
|
170
|
+
*/
|
|
171
|
+
readonly ariaLabel?: string;
|
|
172
|
+
/**
|
|
173
|
+
* The tree data. Array of root-level nodes.
|
|
174
|
+
*
|
|
175
|
+
* **Important:** Must be referentially stable across renders (e.g. stored
|
|
176
|
+
* in state or wrapped in `useMemo`). Passing a new array reference on
|
|
177
|
+
* every render will reset focus, expansion, and selection state.
|
|
178
|
+
*/
|
|
179
|
+
readonly data: TreeNode<T>[];
|
|
180
|
+
/**
|
|
181
|
+
* Set of node IDs that are expanded by default.
|
|
182
|
+
* If not provided, all nodes start collapsed.
|
|
183
|
+
*/
|
|
184
|
+
readonly defaultExpanded?: ReadonlySet<string> | "all";
|
|
185
|
+
/**
|
|
186
|
+
* Set of node IDs that are selected by default.
|
|
187
|
+
*/
|
|
188
|
+
readonly defaultSelected?: ReadonlySet<string>;
|
|
189
|
+
/**
|
|
190
|
+
* When disabled, user input is ignored.
|
|
191
|
+
* @default false
|
|
192
|
+
*/
|
|
193
|
+
readonly isDisabled?: boolean;
|
|
194
|
+
/**
|
|
195
|
+
* Async function to load children on demand.
|
|
196
|
+
*/
|
|
197
|
+
readonly loadChildren?: AsyncChildrenFunction<T>;
|
|
198
|
+
/** Called when expanded set changes. */
|
|
199
|
+
readonly onExpandChange?: (expandedIds: ReadonlySet<string>) => void;
|
|
200
|
+
/** Called when the focused node changes. */
|
|
201
|
+
readonly onFocusChange?: (nodeId: string) => void;
|
|
202
|
+
/**
|
|
203
|
+
* Called when `loadChildren` rejects. Receives the node ID and error.
|
|
204
|
+
*/
|
|
205
|
+
readonly onLoadError?: (nodeId: string, error: Error) => void;
|
|
206
|
+
/** Called when selection changes. */
|
|
207
|
+
readonly onSelectChange?: (selectedIds: ReadonlySet<string>) => void;
|
|
208
|
+
/**
|
|
209
|
+
* Custom node renderer. Receives node + state, returns Ink JSX.
|
|
210
|
+
*/
|
|
211
|
+
readonly renderNode?: (props: TreeNodeRendererProps<T>) => ReactNode;
|
|
212
|
+
/**
|
|
213
|
+
* Selection mode.
|
|
214
|
+
* - "none": No selection behavior (default).
|
|
215
|
+
* - "single": One node can be selected at a time.
|
|
216
|
+
* - "multiple": Multiple nodes can be selected (checkboxes shown).
|
|
217
|
+
* @default "none"
|
|
218
|
+
*/
|
|
219
|
+
readonly selectionMode?: SelectionMode;
|
|
220
|
+
/**
|
|
221
|
+
* Number of visible nodes in the viewport (for virtualization).
|
|
222
|
+
* @default Infinity (no virtualization)
|
|
223
|
+
*/
|
|
224
|
+
readonly visibleNodeCount?: number;
|
|
225
|
+
};
|
|
226
|
+
/**
|
|
227
|
+
* Renders an interactive tree view with keyboard navigation.
|
|
228
|
+
*
|
|
229
|
+
* ```tsx
|
|
230
|
+
* <TreeView
|
|
231
|
+
* data={[
|
|
232
|
+
* { id: "1", label: "Root", children: [
|
|
233
|
+
* { id: "1.1", label: "Child" },
|
|
234
|
+
* ]},
|
|
235
|
+
* ]}
|
|
236
|
+
* defaultExpanded="all"
|
|
237
|
+
* />
|
|
238
|
+
* ```
|
|
239
|
+
*/
|
|
240
|
+
declare function TreeView<T = Record<string, unknown>>({
|
|
241
|
+
ariaLabel,
|
|
242
|
+
data,
|
|
243
|
+
defaultExpanded,
|
|
244
|
+
defaultSelected,
|
|
245
|
+
isDisabled,
|
|
246
|
+
loadChildren,
|
|
247
|
+
onExpandChange,
|
|
248
|
+
onFocusChange,
|
|
249
|
+
onLoadError,
|
|
250
|
+
onSelectChange,
|
|
251
|
+
renderNode,
|
|
252
|
+
selectionMode,
|
|
253
|
+
visibleNodeCount
|
|
254
|
+
}: Props<T>): ReactElement;
|
|
255
|
+
type UseTreeViewStateProps<T = Record<string, unknown>> = {
|
|
256
|
+
/** The tree data. Array of root-level nodes. */
|
|
257
|
+
readonly data: TreeNode<T>[];
|
|
258
|
+
/**
|
|
259
|
+
* Set of node IDs that are expanded by default.
|
|
260
|
+
* If not provided, all nodes start collapsed.
|
|
261
|
+
*/
|
|
262
|
+
readonly defaultExpanded?: ReadonlySet<string> | "all";
|
|
263
|
+
/**
|
|
264
|
+
* Set of node IDs that are selected by default.
|
|
265
|
+
*/
|
|
266
|
+
readonly defaultSelected?: ReadonlySet<string>;
|
|
267
|
+
/** Called when expanded set changes. */
|
|
268
|
+
readonly onExpandChange?: (expandedIds: ReadonlySet<string>) => void;
|
|
269
|
+
/** Called when the focused node changes. */
|
|
270
|
+
readonly onFocusChange?: (nodeId: string) => void;
|
|
271
|
+
/** Called when selection changes. */
|
|
272
|
+
readonly onSelectChange?: (selectedIds: ReadonlySet<string>) => void;
|
|
273
|
+
/**
|
|
274
|
+
* Selection mode.
|
|
275
|
+
* @default "none"
|
|
276
|
+
*/
|
|
277
|
+
readonly selectionMode?: SelectionMode;
|
|
278
|
+
/**
|
|
279
|
+
* Number of visible nodes in the viewport (for virtualization).
|
|
280
|
+
* @default Infinity
|
|
281
|
+
*/
|
|
282
|
+
readonly visibleNodeCount?: number;
|
|
283
|
+
};
|
|
284
|
+
type TreeViewState<T = Record<string, unknown>> = {
|
|
285
|
+
readonly collapse: () => void;
|
|
286
|
+
readonly collapseAll: () => void;
|
|
287
|
+
readonly collapseNode: (nodeId: string) => void;
|
|
288
|
+
readonly expand: () => void;
|
|
289
|
+
readonly expandAll: () => void;
|
|
290
|
+
readonly expandedIds: ReadonlySet<string>;
|
|
291
|
+
readonly expandNode: (nodeId: string) => void;
|
|
292
|
+
readonly focusedId: string | undefined;
|
|
293
|
+
readonly focusFirst: () => void;
|
|
294
|
+
readonly focusFirstChild: () => void;
|
|
295
|
+
readonly focusLast: () => void;
|
|
296
|
+
readonly focusNext: () => void;
|
|
297
|
+
readonly focusParent: () => void;
|
|
298
|
+
readonly focusPrevious: () => void;
|
|
299
|
+
readonly hasScrollDown: boolean;
|
|
300
|
+
readonly hasScrollUp: boolean;
|
|
301
|
+
readonly insertChildren: (parentId: string, children: TreeNode<T>[]) => void;
|
|
302
|
+
readonly loadingIds: ReadonlySet<string>;
|
|
303
|
+
readonly nodeMap: TreeNodeMap<T>;
|
|
304
|
+
readonly select: () => void;
|
|
305
|
+
readonly selectedIds: ReadonlySet<string>;
|
|
306
|
+
readonly setChildrenError: (nodeId: string) => void;
|
|
307
|
+
readonly setLoading: (nodeId: string, isLoading: boolean) => void;
|
|
308
|
+
readonly toggleExpanded: () => void;
|
|
309
|
+
readonly viewportFromIndex: number;
|
|
310
|
+
readonly viewportNodes: {
|
|
311
|
+
node: TreeNode<T>;
|
|
312
|
+
state: TreeNodeState;
|
|
313
|
+
}[];
|
|
314
|
+
readonly viewportToIndex: number;
|
|
315
|
+
readonly visibleCount: number;
|
|
316
|
+
};
|
|
317
|
+
declare function useTreeViewState<T = Record<string, unknown>>({
|
|
318
|
+
data,
|
|
319
|
+
defaultExpanded,
|
|
320
|
+
defaultSelected,
|
|
321
|
+
onExpandChange,
|
|
322
|
+
onFocusChange,
|
|
323
|
+
onSelectChange,
|
|
324
|
+
selectionMode,
|
|
325
|
+
visibleNodeCount
|
|
326
|
+
}: UseTreeViewStateProps<T>): TreeViewState<T>;
|
|
327
|
+
type UseTreeViewProps<T = Record<string, unknown>> = {
|
|
328
|
+
/**
|
|
329
|
+
* When disabled, user input is ignored.
|
|
330
|
+
* @default false
|
|
331
|
+
*/
|
|
332
|
+
readonly isDisabled?: boolean;
|
|
333
|
+
/**
|
|
334
|
+
* Async function to load children on demand.
|
|
335
|
+
*/
|
|
336
|
+
readonly loadChildren?: AsyncChildrenFunction<T>;
|
|
337
|
+
/**
|
|
338
|
+
* Called when `loadChildren` rejects.
|
|
339
|
+
*/
|
|
340
|
+
readonly onLoadError?: (nodeId: string, error: Error) => void;
|
|
341
|
+
/**
|
|
342
|
+
* Selection mode.
|
|
343
|
+
*/
|
|
344
|
+
readonly selectionMode: SelectionMode;
|
|
345
|
+
/**
|
|
346
|
+
* The tree view state from `useTreeViewState`.
|
|
347
|
+
*/
|
|
348
|
+
readonly state: TreeViewState<T>;
|
|
349
|
+
};
|
|
350
|
+
declare function useTreeView<T>({
|
|
351
|
+
isDisabled,
|
|
352
|
+
loadChildren,
|
|
353
|
+
onLoadError,
|
|
354
|
+
selectionMode,
|
|
355
|
+
state
|
|
356
|
+
}: UseTreeViewProps<T>): void;
|
|
357
|
+
export { type AsyncChildrenFunction, type FlatNode, type SelectionMode, type TreeNode, TreeNodeMap, type TreeNodeRendererProps, type TreeNodeState, TreeView, type Props as TreeViewProps, type TreeViewState, type Theme as TreeViewTheme, type UseTreeViewProps, type UseTreeViewStateProps, theme as treeViewTheme, useTreeView, useTreeViewState };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{theme as o}from"../packem_shared/treeViewTheme-Dq3ekRAC.js";import{TreeNodeMap as m}from"../packem_shared/TreeNodeMap-cJlYqckB.js";import{TreeView as f}from"../packem_shared/TreeView-BsvLCsf0.js";import{useTreeView as T}from"../packem_shared/useTreeView-D5ifGwG3.js";import{useTreeViewState as w}from"../packem_shared/useTreeViewState-BiTJakkh.js";export{m as TreeNodeMap,f as TreeView,o as treeViewTheme,T as useTreeView,w as useTreeViewState};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ReactNode, ReactElement } from 'react';
|
|
2
|
+
type UnorderedListEntry = {
|
|
3
|
+
/**
|
|
4
|
+
* Content of the list entry. Can be a string or nested list.
|
|
5
|
+
*/
|
|
6
|
+
readonly children?: ReadonlyArray<UnorderedListEntry>;
|
|
7
|
+
/**
|
|
8
|
+
* Display text for this item.
|
|
9
|
+
*/
|
|
10
|
+
readonly label: ReactNode;
|
|
11
|
+
};
|
|
12
|
+
type Props = {
|
|
13
|
+
/**
|
|
14
|
+
* Entries to render as a bullet list.
|
|
15
|
+
*/
|
|
16
|
+
readonly items: ReadonlyArray<UnorderedListEntry>;
|
|
17
|
+
/**
|
|
18
|
+
* Custom bullet symbol(s). A string uses the same symbol at all depths.
|
|
19
|
+
* An array cycles through symbols by nesting depth.
|
|
20
|
+
*/
|
|
21
|
+
readonly marker?: ReadonlyArray<string> | string;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Renders a bullet list with nesting support.
|
|
25
|
+
*/
|
|
26
|
+
declare function UnorderedList({
|
|
27
|
+
items,
|
|
28
|
+
marker
|
|
29
|
+
}: Props): ReactElement;
|
|
30
|
+
export { Props, UnorderedList, UnorderedListEntry, type Props as UnorderedListProps, UnorderedList as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as o,jsxs as l}from"react/jsx-runtime";import{Box as t}from"./box.js";import{Text as c}from"./text.js";const a=["─","◦","▪"],f=r=>typeof r=="string"?[r]:Array.isArray(r)?r:a,s=(r,e,i)=>{const d=e[i%e.length]??"─";return o(t,{flexDirection:"column",children:r.map((n,m)=>l(t,{gap:1,children:[o(c,{dimColor:!0,children:d}),l(t,{flexDirection:"column",children:[o(c,{children:n.label}),n.children?s(n.children,e,i+1):void 0]})]},m))})};function x({items:r,marker:e}){const i=f(e);return s(r,i,0)}export{x as UnorderedList,x as default};
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { I as InlineLoop, a as InlineOptions, b as InlinePaintFn, c as InputParser, M as MouseEvent, T as TuiApp, d as createInlineLoop } from "../packem_shared/input.d-
|
|
2
|
-
import '
|
|
1
|
+
export { I as InlineLoop, a as InlineOptions, b as InlinePaintFn, c as InputParser, M as MouseEvent, T as TuiApp, d as createInlineLoop } from "../packem_shared/input.d-CgxV2e8U.js";
|
|
2
|
+
import 'tseep';
|
|
3
3
|
/**
|
|
4
4
|
* 2×u32 per-cell back-buffer layout:
|
|
5
5
|
* buffer[idx * 2] = charCode (Unicode codepoint, u32)
|
package/dist/core/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{TuiApp as o}from"../packem_shared/TuiApp-
|
|
1
|
+
import{TuiApp as o}from"../packem_shared/TuiApp-BPL8v1i1.js";import{Cell as t,StyleMasks as m}from"../packem_shared/Cell-BrXn3jxY.js";import{createInlineLoop as l}from"../packem_shared/createInlineLoop-BT40Wpmx.js";import{InputParser as f}from"../packem_shared/InputParser-CtwkCbrQ.js";import{Renderer as x,TerminalGuard as s,terminalSize as u}from"../packem_shared/Renderer-DsskdkUd.js";export{t as Cell,f as InputParser,x as Renderer,m as StyleMasks,s as TerminalGuard,o as TuiApp,l as createInlineLoop,u as terminalSize};
|