@visulima/tui 1.0.0-alpha.2 → 1.0.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +59 -0
- package/LICENSE.md +63 -9
- package/README.md +6 -6
- package/dist/core/index.js +3 -3
- package/dist/ink/canvas/braille.d.ts +22 -0
- package/dist/ink/canvas/buffer.d.ts +67 -0
- package/dist/ink/components/accordion.d.ts +52 -0
- package/dist/ink/components/animate-presence.d.ts +15 -0
- package/dist/ink/components/approval-prompt.d.ts +55 -0
- package/dist/ink/components/area-chart.d.ts +54 -0
- package/dist/ink/components/bar-chart.d.ts +57 -0
- package/dist/ink/components/blink-dot.d.ts +30 -0
- package/dist/ink/components/breadcrumb.d.ts +28 -0
- package/dist/ink/components/button.d.ts +38 -0
- package/dist/ink/components/calendar.d.ts +60 -0
- package/dist/ink/components/canvas.d.ts +38 -0
- package/dist/ink/components/card.d.ts +46 -0
- package/dist/ink/components/chart-utils.d.ts +54 -0
- package/dist/ink/components/checkbox.d.ts +39 -0
- package/dist/ink/components/collapsible.d.ts +43 -0
- package/dist/ink/components/command-block.d.ts +38 -0
- package/dist/ink/components/command-palette.d.ts +72 -0
- package/dist/ink/components/confirm-dialog.d.ts +63 -0
- package/dist/ink/components/content-switcher.d.ts +49 -0
- package/dist/ink/components/date-picker.d.ts +53 -0
- package/dist/ink/components/definition-list.d.ts +37 -0
- package/dist/ink/components/divider.d.ts +40 -0
- package/dist/ink/components/file-picker/{FilePicker.d.ts → file-picker.d.ts} +2 -19
- package/dist/ink/components/file-picker/types.d.ts +1 -4
- package/dist/ink/components/file-picker/use-file-system.d.ts +1 -1
- package/dist/ink/components/form.d.ts +74 -0
- package/dist/ink/components/gauge.d.ts +75 -0
- package/dist/ink/components/heading.d.ts +27 -0
- package/dist/ink/components/heatmap.d.ts +51 -0
- package/dist/ink/components/{Help.d.ts → help.d.ts} +4 -9
- package/dist/ink/components/histogram.d.ts +52 -0
- package/dist/ink/components/kbd.d.ts +27 -0
- package/dist/ink/components/line-chart.d.ts +94 -0
- package/dist/ink/components/loading-indicator.d.ts +24 -0
- package/dist/ink/components/masked-input.d.ts +41 -0
- package/dist/ink/components/menu.d.ts +70 -0
- package/dist/ink/components/message-bubble.d.ts +35 -0
- package/dist/ink/components/model-badge.d.ts +32 -0
- package/dist/ink/components/operation-tree.d.ts +46 -0
- package/dist/ink/components/option-list.d.ts +41 -0
- package/dist/ink/components/{Paginator.d.ts → paginator.d.ts} +4 -20
- package/dist/ink/components/paragraph.d.ts +31 -0
- package/dist/ink/components/placeholder.d.ts +47 -0
- package/dist/ink/components/{ProgressBar.d.ts → progress-bar.d.ts} +1 -1
- package/dist/ink/components/radio-group.d.ts +62 -0
- package/dist/ink/components/scatter-plot.d.ts +23 -0
- package/dist/ink/components/scroll/{ControlledScrollView.d.ts → controlled-scroll-view.d.ts} +1 -1
- package/dist/ink/components/scroll/index.d.ts +10 -10
- package/dist/ink/components/scroll/{ScrollBarBox.d.ts → scroll-bar-box.d.ts} +1 -1
- package/dist/ink/components/scroll/{ScrollBar.d.ts → scroll-bar.d.ts} +1 -1
- package/dist/ink/components/scroll/{ScrollList.d.ts → scroll-list.d.ts} +1 -1
- package/dist/ink/components/scroll/{ScrollView.d.ts → scroll-view.d.ts} +1 -1
- package/dist/ink/components/search-input.d.ts +46 -0
- package/dist/ink/components/{SelectInput.d.ts → select-input.d.ts} +2 -2
- package/dist/ink/components/shimmer-text.d.ts +39 -0
- package/dist/ink/components/sparkline.d.ts +30 -0
- package/dist/ink/components/{Spinner.d.ts → spinner.d.ts} +2 -4
- package/dist/ink/components/{StaticRender.d.ts → static-render.d.ts} +14 -2
- package/dist/ink/components/status-line.d.ts +30 -0
- package/dist/ink/components/stepper.d.ts +42 -0
- package/dist/ink/components/{Stopwatch.d.ts → stopwatch.d.ts} +5 -7
- package/dist/ink/components/streaming-text.d.ts +38 -0
- package/dist/ink/components/switch.d.ts +46 -0
- package/dist/ink/components/{Tabs.d.ts → tabs.d.ts} +1 -1
- package/dist/ink/components/tag.d.ts +30 -0
- package/dist/ink/components/{Timer.d.ts → timer.d.ts} +5 -7
- package/dist/ink/components/toast.d.ts +41 -0
- package/dist/ink/components/tooltip.d.ts +36 -0
- package/dist/ink/components/transition.d.ts +53 -0
- package/dist/ink/components/tree-view/theme.d.ts +2 -2
- package/dist/ink/cursor-helpers.d.ts +0 -3
- package/dist/ink/dom.d.ts +9 -8
- package/dist/ink/hooks/use-animation.d.ts +0 -2
- package/dist/ink/hooks/use-app.d.ts +1 -1
- package/dist/ink/hooks/use-focus-manager.d.ts +1 -1
- package/dist/ink/hooks/use-form.d.ts +70 -0
- package/dist/ink/hooks/use-hotkey.d.ts +37 -0
- package/dist/ink/hooks/use-interval.d.ts +25 -0
- package/dist/ink/hooks/use-key-bindings.d.ts +4 -6
- package/dist/ink/hooks/use-key-chord.d.ts +26 -0
- package/dist/ink/hooks/use-linked-scroll.d.ts +1 -1
- package/dist/ink/hooks/use-persistent-state.d.ts +56 -0
- package/dist/ink/hooks/use-stderr.d.ts +1 -1
- package/dist/ink/hooks/use-stdin.d.ts +1 -1
- package/dist/ink/hooks/use-stdout.d.ts +1 -1
- package/dist/ink/hooks/use-stopwatch.d.ts +1 -3
- package/dist/ink/hooks/use-timeout.d.ts +24 -0
- package/dist/ink/hooks/use-timer.d.ts +0 -2
- package/dist/ink/index.d.ts +228 -92
- package/dist/ink/index.js +132 -77
- package/dist/ink/ink.d.ts +7 -6
- package/dist/ink/mouse/constants.d.ts +5 -50
- package/dist/ink/mouse/index.d.ts +2 -2
- package/dist/ink/output.d.ts +2 -1
- package/dist/ink/styled-line.d.ts +10 -0
- package/dist/ink/write-synchronized.d.ts +2 -2
- package/dist/packem_shared/Accordion-BG-yfIkV.js +80 -0
- package/dist/packem_shared/{Alert-Dr3s_LD9.js → Alert-BLcwIW8V.js} +2 -2
- package/dist/packem_shared/AnimatePresence-D8nEOr_B.js +98 -0
- package/dist/packem_shared/ApprovalPrompt-BXdPros1.js +104 -0
- package/dist/packem_shared/AreaChart-CmTcxLum.js +116 -0
- package/dist/packem_shared/{Badge-Dk7EGGM6.js → Badge-CUfbXwAB.js} +1 -1
- package/dist/packem_shared/BarChart-DWRae67P.js +87 -0
- package/dist/packem_shared/{BigText-CjMdY63X.js → BigText-CVq2X7B5.js} +1 -1
- package/dist/packem_shared/BlinkDot-CrbHMR3L.js +11 -0
- package/dist/packem_shared/{Box-D_pSJ9Jp.js → Box-W1w_NGin.js} +4 -6
- package/dist/packem_shared/Breadcrumb-CPdNxVYs.js +26 -0
- package/dist/packem_shared/Button-CBmTbJ_D.js +57 -0
- package/dist/packem_shared/Calendar-C2Qxt-LA.js +139 -0
- package/dist/packem_shared/Canvas-COttmLPX.js +246 -0
- package/dist/packem_shared/Card-D3tGkNCm.js +24 -0
- package/dist/packem_shared/Checkbox-Dpy_4Lws.js +49 -0
- package/dist/packem_shared/{Code-DjQvPBD9.js → Code-CwzzbsLx.js} +3 -3
- package/dist/packem_shared/Collapsible-BMDrXf5C.js +45 -0
- package/dist/packem_shared/CommandBlock-jdOGJPjY.js +80 -0
- package/dist/packem_shared/CommandPalette-B5IfUQwi.js +146 -0
- package/dist/packem_shared/ConfirmDialog-5XJv3Cc4.js +67 -0
- package/dist/packem_shared/{ConfirmInput-85Y4kRQW.js → ConfirmInput-CxUS0XAA.js} +3 -3
- package/dist/packem_shared/{ConsoleOverlay-DBNa4vtj.js → ConsoleOverlay-BvnCEgjG.js} +2 -2
- package/dist/packem_shared/ContentSwitcher-BHFpO5Za.js +81 -0
- package/dist/packem_shared/ControlledScrollView-C2wOOlJO.js +5 -0
- package/dist/packem_shared/DatePicker-CPejKoqS.js +73 -0
- package/dist/packem_shared/DefinitionList-BAwr0l5J.js +18 -0
- package/dist/packem_shared/{DevTools-aMPIsaHx.js → DevTools-BdxRSkhL.js} +6 -4
- package/dist/packem_shared/{Dialog-DsSNAVgC.js → Dialog-S9r7Izff.js} +5 -5
- package/dist/packem_shared/{DiffView-hqaw-2S6.js → DiffView-BR4T6-Sj.js} +4 -4
- package/dist/packem_shared/Divider-DocXIqNn.js +30 -0
- package/dist/packem_shared/{FilePicker-DNwFxRhq.js → FilePicker-BZ55oF_n.js} +39 -32
- package/dist/packem_shared/FormField-BSG16cnA.js +29 -0
- package/dist/packem_shared/{Fullscreen-DrElAE1o.js → Fullscreen-DO7voOq5.js} +2 -2
- package/dist/packem_shared/Gauge-CKXUXxft.js +122 -0
- package/dist/packem_shared/{Gradient-Ql5P0GUd.js → Gradient-Dg0NezWc.js} +3 -3
- package/dist/packem_shared/Heading-BnR7McmP.js +29 -0
- package/dist/packem_shared/Heatmap-_jqISOU0.js +79 -0
- package/dist/packem_shared/{Help-6wanGG38.js → Help-0yZ_IcQg.js} +4 -11
- package/dist/packem_shared/Histogram-cgAjY5AJ.js +92 -0
- package/dist/packem_shared/{InputParser-BKHpWfvN.js → InputParser-BlsfeY9J.js} +8 -6
- package/dist/packem_shared/KEY-STOdi-nc.js +74 -0
- package/dist/packem_shared/Kbd-BNDXQgey.js +19 -0
- package/dist/packem_shared/{LayoutNode-Cjnsodiy.js → LayoutNode-DAkKg9TE.js} +5 -7
- package/dist/packem_shared/LineChart-ef3HF816.js +7 -0
- package/dist/packem_shared/{Link-COcKYfGT.js → Link-DZ2Tiq1m.js} +2 -2
- package/dist/packem_shared/LoadingIndicator-DzbLGfyJ.js +13 -0
- package/dist/packem_shared/{Markdown-y1ISztof.js → Markdown-33bpCUoe.js} +8 -8
- package/dist/packem_shared/MaskedInput-Ctr6v2dO.js +119 -0
- package/dist/packem_shared/Menu-CeKxhEix.js +112 -0
- package/dist/packem_shared/MessageBubble-BMoU8L2Q.js +26 -0
- package/dist/packem_shared/ModelBadge-CNIxPs7v.js +40 -0
- package/dist/packem_shared/{MouseProvider-Y9TSSEGl.js → MouseProvider-CekPbXCh.js} +3 -3
- package/dist/packem_shared/{MultiSelect-ChoLUcDI.js → MultiSelect-yz7-w0Zv.js} +4 -4
- package/dist/packem_shared/{NAMED_COLORS-a4QBvb5r.js → NAMED_COLORS-DcI3erCu.js} +79 -41
- package/dist/packem_shared/OperationTree-Dudx5o1o.js +67 -0
- package/dist/packem_shared/OptionList-CTyqQaZ1.js +24 -0
- package/dist/packem_shared/{OrderedList-Cp7pXr6m.js → OrderedList-VsvSmHUC.js} +2 -2
- package/dist/packem_shared/{Paginator-D1AuD-kj.js → Paginator-DmGogvEI.js} +44 -44
- package/dist/packem_shared/Paragraph-CNNhfepo.js +9 -0
- package/dist/packem_shared/Placeholder-DkM69Q8Z.js +29 -0
- package/dist/packem_shared/{ProgressBar-DOfpVagn.js → ProgressBar-B7cS4uQm.js} +2 -2
- package/dist/packem_shared/RadioGroup-B4F9PUyL.js +108 -0
- package/dist/packem_shared/{ResizeObserverEntry-Br4seLeQ.js → ResizeObserverEntry-Vr8GZ74x.js} +4 -4
- package/dist/packem_shared/ScatterPlot-CWOg4G5h.js +63 -0
- package/dist/packem_shared/{ScrollBar-EWAs2Uc7.js → ScrollBar-DFeWH43I.js} +2 -2
- package/dist/packem_shared/{ScrollBarBox-DTNNlh7R.js → ScrollBarBox-C7VL6Izd.js} +2 -2
- package/dist/packem_shared/{ScrollList-DCeIFL8M.js → ScrollList-DRcr_RrN.js} +2 -2
- package/dist/packem_shared/{ScrollView-v3MCNIyX.js → ScrollView-C6rdlGwU.js} +4 -4
- package/dist/packem_shared/SearchInput-cB8zFhSg.js +32 -0
- package/dist/packem_shared/{SelectInput-BN2TMyxp.js → SelectInput-WzZSqp72.js} +6 -6
- package/dist/packem_shared/{SelectInputIndicator-DkRMoH_b.js → SelectInputIndicator-DKeN6v5Z.js} +2 -2
- package/dist/packem_shared/{SelectInputItem-BF9LQgKu.js → SelectInputItem-CxFL3spM.js} +1 -1
- package/dist/packem_shared/ShimmerText-B2VbPUSB.js +34 -0
- package/dist/packem_shared/{Slider-BWD7xZX6.js → Slider-BOrNTOQe.js} +3 -3
- package/dist/packem_shared/{Spacer-Bs4ER-HK.js → Spacer-DhmXyTb8.js} +1 -1
- package/dist/packem_shared/Sparkline-BSbjPrwK.js +44 -0
- package/dist/packem_shared/Spinner-BcO5BCAa.js +1942 -0
- package/dist/packem_shared/StaticRender-C3XWvJdC.js +69 -0
- package/dist/packem_shared/StatusLine-DQNUstN9.js +22 -0
- package/dist/packem_shared/{StatusMessage-BtSYxzwb.js → StatusMessage-BYTL6Pl-.js} +2 -2
- package/dist/packem_shared/Stepper-CmUPRK3z.js +60 -0
- package/dist/packem_shared/Stopwatch-zqLQAxXC.js +21 -0
- package/dist/packem_shared/StreamingText-BmuoJtGu.js +38 -0
- package/dist/packem_shared/Switch-DcPdy8nm.js +59 -0
- package/dist/packem_shared/{Table-D-rSVlzb.js → Table-Bgxo87Df.js} +11 -5
- package/dist/packem_shared/{Tabs-hki-KRnx.js → Tabs-DubuHdYV.js} +30 -19
- package/dist/packem_shared/Tag-CCqM7Ee9.js +35 -0
- package/dist/packem_shared/{Text-DvAUdZcK.js → Text-CtUwV89_.js} +2 -2
- package/dist/packem_shared/{TextInput-C79WEQ5U.js → TextInput-C9r7zT0U.js} +3 -3
- package/dist/packem_shared/{Textarea-Dj06R6Zd.js → Textarea-CGmgt-Nl.js} +5 -5
- package/dist/packem_shared/Timer-D7ZZ0_wz.js +20 -0
- package/dist/packem_shared/Toast-DXSCXFPY.js +37 -0
- package/dist/packem_shared/Tooltip-SvVjj-2k.js +32 -0
- package/dist/packem_shared/{Transform-BHxY_dAM.js → Transform-Cfyva2wd.js} +1 -1
- package/dist/packem_shared/Transition-CbNfKhaj.js +108 -0
- package/dist/packem_shared/{TreeView-C2062dtj.js → TreeView-DGlZeSsK.js} +4 -4
- package/dist/packem_shared/{TuiApp-DfxOnXqi.js → TuiApp-DtdgNRWa.js} +4 -2
- package/dist/packem_shared/{TuiContext-CqEjMyXd.js → TuiContext-lXmJFd-x.js} +6 -3
- package/dist/packem_shared/{UnorderedList-DhnadWjX.js → UnorderedList-D8RPaEAW.js} +2 -2
- package/dist/packem_shared/{ansi-parser-0BdVTKho.js → ansi-parser-BOP8fNdT.js} +6 -4
- package/dist/packem_shared/braille-BoEWoH2I.js +93 -0
- package/dist/packem_shared/{comparePoints-CGMDnd3_.js → comparePoints-CAAlhiMS.js} +2 -2
- package/dist/packem_shared/{ControlledScrollView-BlOaxcsN.js → controlled-scroll-view-DJXfdWMm.js} +2 -2
- package/dist/packem_shared/{createInlineLoop-BxMmcq9D.js → createInlineLoop-Dnfm1ZSJ.js} +19 -13
- package/dist/packem_shared/createMemoryStorage-esFJ61La.js +115 -0
- package/dist/packem_shared/createScreen-Dh0sZlQ0.js +38 -0
- package/dist/packem_shared/{dom-DvzhsAez.js → dom-CrbpQgat.js} +17 -14
- package/dist/packem_shared/{getPathToRoot-a1wbwxfL.js → getPathToRoot-BbvlppLC.js} +2 -2
- package/dist/packem_shared/{getScrollHeight-BubfU_df.js → getScrollHeight-Cz3CDQN2.js} +5 -5
- package/dist/packem_shared/line-chart-VGU2l7pu.js +139 -0
- package/dist/packem_shared/{measure-element-Reza_yfC.js → measure-element-Bc6PEaIe.js} +26 -17
- package/dist/packem_shared/{measure-text-DItZYotK.js → measure-text-BdOhbOeh.js} +74 -7
- package/dist/packem_shared/{measureElement-CTgFCmKd.js → measureElement-DTELRaij.js} +2 -2
- package/dist/packem_shared/parseSgrMouse-4hpBJBsW.js +1 -0
- package/dist/packem_shared/{processLayout-BQ9kXfd3.js → processLayout-B0Coz0Ua.js} +1 -1
- package/dist/packem_shared/{reconciler-gfmqURLy.js → reconciler-Dd7Z0A97.js} +21 -5
- package/dist/packem_shared/{reconciler-BXf6miSS.js → reconciler-mzMwSOft.js} +23 -13
- package/dist/packem_shared/{render-BAwdjfki.js → render-Bm9Oa1sG.js} +72 -79
- package/dist/packem_shared/{render-Bpjhf0lD.js → render-CjlKdg4m.js} +15 -11
- package/dist/packem_shared/{renderToString-ClIaXgrC.js → renderToString-CWYS1ZXE.js} +4 -4
- package/dist/packem_shared/{renderToString-Cfg55DRD.js → renderToString-DB3ILWFm.js} +4 -4
- package/dist/packem_shared/{renderTreeToBuffer-D3mo7M7m.js → renderTreeToBuffer-CDDTGyZn.js} +8 -5
- package/dist/packem_shared/{renderer-B3wROkeg.js → renderer-GE9OLNNM.js} +47 -41
- package/dist/packem_shared/{setEnableStyledLineCache-BpskngSJ.js → setEnableStyledLineCache-D5f4favX.js} +1 -1
- package/dist/packem_shared/{text-width-DhuarWcB.js → text-width-Db-AxMea.js} +2 -1
- package/dist/packem_shared/{token-to-elements-BRFl_rzw.js → token-to-elements-CK4s8MJd.js} +2 -2
- package/dist/packem_shared/{useAnimation-kj31sA-T.js → useAnimation-DV22qxiJ.js} +2 -2
- package/dist/packem_shared/{useApp-DPQlRzi5.js → useApp-Cbi788rV.js} +1 -1
- package/dist/packem_shared/{useBoxMetrics-rBjKc-g4.js → useBoxMetrics-_5icypir.js} +2 -2
- package/dist/packem_shared/{useClipboard-B_9-adw1.js → useClipboard-MNj6MNR-.js} +1 -1
- package/dist/packem_shared/{useCursor-BIJzc8k9.js → useCursor-DS6LjIgv.js} +1 -1
- package/dist/packem_shared/{useFocus-CNl5QHHf.js → useFocus-DLoGQJd9.js} +2 -2
- package/dist/packem_shared/{useFocusManager-BPYaUuKQ.js → useFocusManager-UeZWtnNc.js} +1 -1
- package/dist/packem_shared/useForm-sQENbEuv.js +88 -0
- package/dist/packem_shared/useHotkey-D9giUX3q.js +112 -0
- package/dist/packem_shared/{useInput-Cfp5zB2s.js → useInput-DKZbqMRc.js} +2 -2
- package/dist/packem_shared/useInterval-CSXM8c2I.js +32 -0
- package/dist/packem_shared/{useIsScreenReaderEnabled-CnGKCe0f.js → useIsScreenReaderEnabled-BeoVqo1R.js} +1 -1
- package/dist/packem_shared/{useKeyBindings-B78l1E1n.js → useKeyBindings-S4fSIEAk.js} +2 -2
- package/dist/packem_shared/useKeyChord-BmXGNuEO.js +114 -0
- package/dist/packem_shared/{usePaste-Ct8J4AGR.js → usePaste-png73gvT.js} +2 -2
- package/dist/packem_shared/{useScrollInput-D3CpBq_a.js → useScrollInput-DfzRGQFe.js} +2 -2
- package/dist/packem_shared/{useStderr-CAOVUh4E.js → useStderr-BSWerMZ7.js} +1 -1
- package/dist/packem_shared/{useStdin-X-O0kd-n.js → useStdin-Rf0zPzVA.js} +1 -1
- package/dist/packem_shared/{useStdout-DyF6DSH0.js → useStdout-B5yRcg9N.js} +1 -1
- package/dist/packem_shared/{useStopwatch-qC4Beai4.js → useStopwatch-C__Zu6hd.js} +2 -2
- package/dist/packem_shared/{useTerminalPalette-BaWO2c4Q.js → useTerminalPalette-CtFG2JTq.js} +2 -2
- package/dist/packem_shared/{useTextSelection-mXtxgsPK.js → useTextSelection-ChrYZXsn.js} +2 -2
- package/dist/packem_shared/useTimeout-DuCqgWPX.js +34 -0
- package/dist/packem_shared/{useTimer-CPQ7j827.js → useTimer-DnBtbhB5.js} +1 -1
- package/dist/packem_shared/{useTreeView-BT57P3Kx.js → useTreeView-mkN5Di7w.js} +1 -1
- package/dist/packem_shared/{useWindowSize-ugEmGZJm.js → useWindowSize-D3UU41mv.js} +1 -1
- package/dist/packem_shared/waitFor-Cv9M2jKA.js +39 -0
- package/dist/packem_shared/{wrapOrTruncateStyledLine-DN3Nogoc.js → wrapOrTruncateStyledLine-49Mne3t3.js} +1 -1
- package/dist/react/index.js +7 -7
- package/dist/react/layout.d.ts +0 -2
- package/dist/testing/index.d.ts +4 -4
- package/dist/testing/index.js +6 -114
- package/dist/testing/wait-for.d.ts +0 -1
- package/index.js +691 -539
- package/package.json +17 -17
- package/dist/ink/components/file-picker/index.d.ts +0 -3
- package/dist/ink/components/tree-view/index.d.ts +0 -11
- package/dist/packem_shared/ControlledScrollView-DfAhcufF.js +0 -5
- package/dist/packem_shared/Spinner-BuI-kN4p.js +0 -1799
- package/dist/packem_shared/StaticRender-tYwH6QXl.js +0 -33
- package/dist/packem_shared/Stopwatch-DjtTCyHn.js +0 -23
- package/dist/packem_shared/Timer-wi9zuh4n.js +0 -22
- package/dist/packem_shared/parseSgrMouse-BHVBPP9G.js +0 -1
- /package/dist/ink/components/{AccessibilityContext.d.ts → accessibility-context.d.ts} +0 -0
- /package/dist/ink/components/{Alert.d.ts → alert.d.ts} +0 -0
- /package/dist/ink/components/{AnimationContext.d.ts → animation-context.d.ts} +0 -0
- /package/dist/ink/components/{AppContext.d.ts → app-context.d.ts} +0 -0
- /package/dist/ink/components/{App.d.ts → app.d.ts} +0 -0
- /package/dist/ink/components/{BackgroundContext.d.ts → background-context.d.ts} +0 -0
- /package/dist/ink/components/{Badge.d.ts → badge.d.ts} +0 -0
- /package/dist/ink/components/{BigText.d.ts → big-text.d.ts} +0 -0
- /package/dist/ink/components/{Box.d.ts → box.d.ts} +0 -0
- /package/dist/ink/components/{Code.d.ts → code.d.ts} +0 -0
- /package/dist/ink/components/{ConfirmInput.d.ts → confirm-input.d.ts} +0 -0
- /package/dist/ink/components/{ConsoleOverlay.d.ts → console-overlay.d.ts} +0 -0
- /package/dist/ink/components/{CursorContext.d.ts → cursor-context.d.ts} +0 -0
- /package/dist/ink/components/{Cursor.d.ts → cursor.d.ts} +0 -0
- /package/dist/ink/components/{Dialog.d.ts → dialog.d.ts} +0 -0
- /package/dist/ink/components/{DiffView.d.ts → diff-view.d.ts} +0 -0
- /package/dist/ink/components/{ErrorBoundary.d.ts → error-boundary.d.ts} +0 -0
- /package/dist/ink/components/{ErrorOverview.d.ts → error-overview.d.ts} +0 -0
- /package/dist/ink/components/{FocusContext.d.ts → focus-context.d.ts} +0 -0
- /package/dist/ink/components/{Gradient.d.ts → gradient.d.ts} +0 -0
- /package/dist/ink/components/{Link.d.ts → link.d.ts} +0 -0
- /package/dist/ink/components/{Markdown.d.ts → markdown.d.ts} +0 -0
- /package/dist/ink/components/{MultiSelect.d.ts → multi-select.d.ts} +0 -0
- /package/dist/ink/components/{Newline.d.ts → newline.d.ts} +0 -0
- /package/dist/ink/components/{OrderedList.d.ts → ordered-list.d.ts} +0 -0
- /package/dist/ink/components/{SelectInputIndicator.d.ts → select-input-indicator.d.ts} +0 -0
- /package/dist/ink/components/{SelectInputItem.d.ts → select-input-item.d.ts} +0 -0
- /package/dist/ink/components/{Slider.d.ts → slider.d.ts} +0 -0
- /package/dist/ink/components/{Spacer.d.ts → spacer.d.ts} +0 -0
- /package/dist/ink/components/{Static.d.ts → static.d.ts} +0 -0
- /package/dist/ink/components/{StatusMessage.d.ts → status-message.d.ts} +0 -0
- /package/dist/ink/components/{StderrContext.d.ts → stderr-context.d.ts} +0 -0
- /package/dist/ink/components/{StdinContext.d.ts → stdin-context.d.ts} +0 -0
- /package/dist/ink/components/{StdoutContext.d.ts → stdout-context.d.ts} +0 -0
- /package/dist/ink/components/{Tab.d.ts → tab.d.ts} +0 -0
- /package/dist/ink/components/{Table.d.ts → table.d.ts} +0 -0
- /package/dist/ink/components/{TextInput.d.ts → text-input.d.ts} +0 -0
- /package/dist/ink/components/{Text.d.ts → text.d.ts} +0 -0
- /package/dist/ink/components/{Textarea.d.ts → textarea.d.ts} +0 -0
- /package/dist/ink/components/{Transform.d.ts → transform.d.ts} +0 -0
- /package/dist/ink/components/tree-view/{TreeViewNode.d.ts → tree-view-node.d.ts} +0 -0
- /package/dist/ink/components/tree-view/{TreeView.d.ts → tree-view.d.ts} +0 -0
- /package/dist/ink/components/{UnorderedList.d.ts → unordered-list.d.ts} +0 -0
- /package/dist/ink/mouse/{Fullscreen.d.ts → fullscreen.d.ts} +0 -0
- /package/dist/ink/mouse/{MouseProvider.d.ts → mouse-provider.d.ts} +0 -0
- /package/dist/packem_shared/{AccessibilityContext-BLelHhNU.js → accessibility-context-BLelHhNU.js} +0 -0
- /package/dist/packem_shared/{AnimationContext-BcJg8Jr6.js → animation-context-BcJg8Jr6.js} +0 -0
- /package/dist/packem_shared/{AppContext-CP0U6H7O.js → app-context-CP0U6H7O.js} +0 -0
- /package/dist/packem_shared/{BackgroundContext-BAUaxfOb.js → background-context-BAUaxfOb.js} +0 -0
- /package/dist/packem_shared/{CursorContext-JxRzlqAx.js → cursor-context-JxRzlqAx.js} +0 -0
- /package/dist/packem_shared/{FocusContext-CWkYtgcm.js → focus-context-CWkYtgcm.js} +0 -0
- /package/dist/packem_shared/{StderrContext-Bj4Mf7v7.js → stderr-context-Bj4Mf7v7.js} +0 -0
- /package/dist/packem_shared/{StdinContext-Bq_GNJ3z.js → stdin-context-Bq_GNJ3z.js} +0 -0
- /package/dist/packem_shared/{StdoutContext-CgjWeCdO.js → stdout-context-CgjWeCdO.js} +0 -0
|
@@ -24,19 +24,17 @@
|
|
|
24
24
|
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
25
25
|
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
26
26
|
*/
|
|
27
|
-
import type { SpinnerName } from "
|
|
27
|
+
import type { SpinnerName } from "@visulima/spinner";
|
|
28
28
|
import type { ReactElement } from "react";
|
|
29
29
|
export type Props = {
|
|
30
30
|
/**
|
|
31
31
|
* Type of a spinner.
|
|
32
|
-
*
|
|
32
|
+
* Accepts any preset from `@visulima/spinner` (cli-spinners + custom frame sets).
|
|
33
33
|
* @default "dots"
|
|
34
34
|
*/
|
|
35
35
|
readonly type?: SpinnerName;
|
|
36
36
|
};
|
|
37
37
|
/**
|
|
38
38
|
* Spinner component that renders an animated loading indicator.
|
|
39
|
-
*
|
|
40
|
-
* Uses spinners from [cli-spinners](https://github.com/sindresorhus/cli-spinners).
|
|
41
39
|
*/
|
|
42
40
|
export default function Spinner({ type }: Props): ReactElement;
|
|
@@ -10,19 +10,31 @@
|
|
|
10
10
|
* is ready, the component stops calling the function so React does not
|
|
11
11
|
* re-reconcile the subtree on subsequent renders.
|
|
12
12
|
*
|
|
13
|
+
* Re-rendering the cached content is controlled via the `deps` prop (similar
|
|
14
|
+
* to React's hook deps). When `deps` changes, the cache is invalidated and
|
|
15
|
+
* `children()` is invoked again. If `deps` is omitted, the cache is
|
|
16
|
+
* invalidated whenever the `children` function reference changes.
|
|
17
|
+
*
|
|
13
18
|
* Use this for content that renders once and doesn't change (e.g., completed
|
|
14
19
|
* task output, logged messages, static headers).
|
|
15
20
|
*
|
|
16
21
|
* Ported from jacob314/ink (Google LLC, Apache-2.0).
|
|
17
22
|
* @license Apache-2.0
|
|
18
23
|
*/
|
|
19
|
-
import type { ReactNode } from "react";
|
|
24
|
+
import type { DependencyList, ReactNode } from "react";
|
|
20
25
|
import React from "react";
|
|
21
26
|
import type { Styles } from "../styles.d.ts";
|
|
27
|
+
/**
|
|
28
|
+
* @property children Render function invoked once to produce the cached content.
|
|
29
|
+
* @property deps Dependencies that control when the static content is re-rendered. When any dependency changes (shallow, Object.is comparison), the cache is invalidated and children() is invoked again. If omitted, the cache is invalidated whenever the children function reference changes.
|
|
30
|
+
* @property style Optional style applied to the static-render container.
|
|
31
|
+
* @property width Optional fixed width for the cached region.
|
|
32
|
+
*/
|
|
22
33
|
export type Props = {
|
|
23
34
|
readonly children: () => ReactNode;
|
|
35
|
+
readonly deps?: DependencyList;
|
|
24
36
|
readonly style?: Styles;
|
|
25
37
|
readonly width?: number;
|
|
26
38
|
};
|
|
27
|
-
declare const StaticRender: ({ children, style, width }: Props) => React.ReactNode;
|
|
39
|
+
declare const StaticRender: ({ children, deps, style, width }: Props) => React.ReactNode;
|
|
28
40
|
export default StaticRender;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { AnsiColors } from "@visulima/colorize";
|
|
2
|
+
import type { ReactElement, ReactNode } from "react";
|
|
3
|
+
import type { LiteralUnion } from "type-fest";
|
|
4
|
+
export type Props = {
|
|
5
|
+
/**
|
|
6
|
+
* Background color spanning the whole row.
|
|
7
|
+
*/
|
|
8
|
+
readonly backgroundColor?: LiteralUnion<AnsiColors, string>;
|
|
9
|
+
/**
|
|
10
|
+
* Content rendered in the center. Optional.
|
|
11
|
+
*/
|
|
12
|
+
readonly center?: ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Default foreground for text rendered inside the row.
|
|
15
|
+
*/
|
|
16
|
+
readonly color?: LiteralUnion<AnsiColors, string>;
|
|
17
|
+
/**
|
|
18
|
+
* Content rendered flush-left.
|
|
19
|
+
*/
|
|
20
|
+
readonly left?: ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* Content rendered flush-right.
|
|
23
|
+
*/
|
|
24
|
+
readonly right?: ReactNode;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Full-width status bar with left / center / right slots. Typically pinned to
|
|
28
|
+
* the bottom of the UI.
|
|
29
|
+
*/
|
|
30
|
+
export default function StatusLine({ backgroundColor, center, color, left, right }: Props): ReactElement;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { AnsiColors } from "@visulima/colorize";
|
|
2
|
+
import type { ReactElement, ReactNode } from "react";
|
|
3
|
+
import type { LiteralUnion } from "type-fest";
|
|
4
|
+
export type StepStatus = "active" | "completed" | "error" | "pending";
|
|
5
|
+
export type StepperStep = {
|
|
6
|
+
readonly description?: string;
|
|
7
|
+
readonly key?: string;
|
|
8
|
+
readonly label: ReactNode;
|
|
9
|
+
readonly status?: StepStatus;
|
|
10
|
+
};
|
|
11
|
+
export type Props = {
|
|
12
|
+
/**
|
|
13
|
+
* Color used for active and completed steps.
|
|
14
|
+
* @default "blue"
|
|
15
|
+
*/
|
|
16
|
+
readonly accentColor?: LiteralUnion<AnsiColors, string>;
|
|
17
|
+
/**
|
|
18
|
+
* Index of the current step (used when steps do not provide a status).
|
|
19
|
+
* @default 0
|
|
20
|
+
*/
|
|
21
|
+
readonly activeIndex?: number;
|
|
22
|
+
/**
|
|
23
|
+
* Color used for errors.
|
|
24
|
+
* @default "red"
|
|
25
|
+
*/
|
|
26
|
+
readonly errorColor?: LiteralUnion<AnsiColors, string>;
|
|
27
|
+
/**
|
|
28
|
+
* Orientation of the stepper.
|
|
29
|
+
* @default "horizontal"
|
|
30
|
+
*/
|
|
31
|
+
readonly orientation?: "horizontal" | "vertical";
|
|
32
|
+
/**
|
|
33
|
+
* List of steps.
|
|
34
|
+
*/
|
|
35
|
+
readonly steps: ReadonlyArray<StepperStep>;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Step indicator for multi-stage flows.
|
|
39
|
+
* @param props See {@link Props}.
|
|
40
|
+
* @returns A `ReactElement` rendering the steps horizontally or vertically.
|
|
41
|
+
*/
|
|
42
|
+
export default function Stepper({ accentColor, activeIndex, errorColor, orientation, steps }: Props): ReactElement;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ReactElement, Ref } from "react";
|
|
2
2
|
import type { UseStopwatchResult } from "../hooks/use-stopwatch.d.ts";
|
|
3
3
|
export type StopwatchRef = Omit<UseStopwatchResult, "elapsed" | "isRunning" | "laps">;
|
|
4
4
|
export type Props = {
|
|
5
5
|
/**
|
|
6
6
|
* Whether to start counting immediately.
|
|
7
|
-
*
|
|
8
7
|
* @default false
|
|
9
8
|
*/
|
|
10
9
|
readonly autoStart?: boolean;
|
|
@@ -19,16 +18,15 @@ export type Props = {
|
|
|
19
18
|
/**
|
|
20
19
|
* Custom formatter for the elapsed time.
|
|
21
20
|
* Receives elapsed milliseconds, returns a display string.
|
|
22
|
-
*
|
|
23
21
|
* @default formatDuration (MM:SS or HH:MM:SS)
|
|
24
22
|
*/
|
|
25
23
|
readonly format?: (elapsed: number) => string;
|
|
26
24
|
/**
|
|
27
25
|
* Tick interval in milliseconds.
|
|
28
|
-
*
|
|
29
26
|
* @default 1000
|
|
30
27
|
*/
|
|
31
28
|
readonly interval?: number;
|
|
29
|
+
readonly ref?: Ref<StopwatchRef>;
|
|
32
30
|
};
|
|
33
31
|
/**
|
|
34
32
|
* A count-up stopwatch component.
|
|
@@ -36,9 +34,9 @@ export type Props = {
|
|
|
36
34
|
* Exposes `start`, `stop`, `toggle`, `reset`, and `lap` methods via ref.
|
|
37
35
|
*
|
|
38
36
|
* ```tsx
|
|
39
|
-
* const ref = useRef
|
|
40
|
-
*
|
|
37
|
+
* const ref = useRef<StopwatchRef>(null);
|
|
38
|
+
* <Stopwatch ref={ref} autoStart />
|
|
41
39
|
* ```
|
|
42
40
|
*/
|
|
43
|
-
declare const Stopwatch:
|
|
41
|
+
declare const Stopwatch: ({ autoStart, bold, color, format, interval, ref }: Props) => ReactElement;
|
|
44
42
|
export default Stopwatch;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { AnsiColors } from "@visulima/colorize";
|
|
2
|
+
import type { ReactElement } from "react";
|
|
3
|
+
import type { LiteralUnion } from "type-fest";
|
|
4
|
+
export type Props = {
|
|
5
|
+
/**
|
|
6
|
+
* Color applied to the streamed output.
|
|
7
|
+
*/
|
|
8
|
+
readonly color?: LiteralUnion<AnsiColors, string>;
|
|
9
|
+
/**
|
|
10
|
+
* Optional cursor character rendered while streaming.
|
|
11
|
+
* @default "▊"
|
|
12
|
+
*/
|
|
13
|
+
readonly cursor?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Milliseconds between characters.
|
|
16
|
+
* @default 20
|
|
17
|
+
*/
|
|
18
|
+
readonly interval?: number;
|
|
19
|
+
/**
|
|
20
|
+
* Called exactly once per `text` value, after the full text has been revealed.
|
|
21
|
+
*/
|
|
22
|
+
readonly onComplete?: () => void;
|
|
23
|
+
/**
|
|
24
|
+
* Whether to display the cursor after streaming completes.
|
|
25
|
+
* @default false
|
|
26
|
+
*/
|
|
27
|
+
readonly showCursorWhenDone?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Full text to stream into the output.
|
|
30
|
+
*/
|
|
31
|
+
readonly text: string;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Typewriter animation that reveals text one character at a time.
|
|
35
|
+
* Automatically resets and replays when `text` changes. `onComplete`
|
|
36
|
+
* fires exactly once per `text` value once it is fully revealed.
|
|
37
|
+
*/
|
|
38
|
+
export default function StreamingText({ color, cursor, interval, onComplete, showCursorWhenDone, text }: Props): ReactElement;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { AnsiColors } from "@visulima/colorize";
|
|
2
|
+
import type { ReactElement, ReactNode } from "react";
|
|
3
|
+
import type { LiteralUnion } from "type-fest";
|
|
4
|
+
export type Props = {
|
|
5
|
+
/**
|
|
6
|
+
* Accent color for the on state.
|
|
7
|
+
* @default "green"
|
|
8
|
+
*/
|
|
9
|
+
readonly accentColor?: LiteralUnion<AnsiColors, string>;
|
|
10
|
+
/**
|
|
11
|
+
* Auto-focus when mounted if nothing else is focused.
|
|
12
|
+
*/
|
|
13
|
+
readonly autoFocus?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Optional label rendered after the switch.
|
|
16
|
+
*/
|
|
17
|
+
readonly children?: ReactNode;
|
|
18
|
+
/**
|
|
19
|
+
* Initial value when uncontrolled.
|
|
20
|
+
*/
|
|
21
|
+
readonly defaultValue?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Disable input and dim the switch.
|
|
24
|
+
*/
|
|
25
|
+
readonly isDisabled?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Labels displayed inside the switch track.
|
|
28
|
+
* @default ["off", "on"]
|
|
29
|
+
*/
|
|
30
|
+
readonly labels?: readonly [string, string];
|
|
31
|
+
/**
|
|
32
|
+
* Fired when the switch is toggled.
|
|
33
|
+
*/
|
|
34
|
+
readonly onChange?: (value: boolean) => void;
|
|
35
|
+
/**
|
|
36
|
+
* Controlled value. Pair with `onChange` to update the parent.
|
|
37
|
+
*/
|
|
38
|
+
readonly value?: boolean;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Focusable on/off switch. Toggles with Space or Enter.
|
|
42
|
+
* @param props See {@link Props}.
|
|
43
|
+
* @returns A `ReactElement` rendering two labeled segments plus an optional
|
|
44
|
+
* trailing label.
|
|
45
|
+
*/
|
|
46
|
+
export default function Switch({ accentColor, autoFocus, children, defaultValue, isDisabled, labels, onChange, value, }: Props): ReactElement;
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
import type { AnsiColors } from "@visulima/colorize";
|
|
11
11
|
import type { ReactElement, ReactNode } from "react";
|
|
12
12
|
import type { LiteralUnion } from "type-fest";
|
|
13
|
-
import type { Props as TabProps } from "./
|
|
13
|
+
import type { Props as TabProps } from "./tab.d.ts";
|
|
14
14
|
/**
|
|
15
15
|
* Keyboard navigation configuration for Tabs.
|
|
16
16
|
*/
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { AnsiColors } from "@visulima/colorize";
|
|
2
|
+
import type { ReactElement, ReactNode } from "react";
|
|
3
|
+
import type { LiteralUnion } from "type-fest";
|
|
4
|
+
export type TagVariant = "outline" | "solid" | "subtle";
|
|
5
|
+
export type Props = {
|
|
6
|
+
/**
|
|
7
|
+
* Tag content.
|
|
8
|
+
*/
|
|
9
|
+
readonly children: ReactNode;
|
|
10
|
+
/**
|
|
11
|
+
* Base color.
|
|
12
|
+
* @default "blue"
|
|
13
|
+
*/
|
|
14
|
+
readonly color?: LiteralUnion<AnsiColors, string>;
|
|
15
|
+
/**
|
|
16
|
+
* Optional symbol rendered before the label (e.g. `●`, `✔`, `★`).
|
|
17
|
+
*/
|
|
18
|
+
readonly icon?: ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* Visual style.
|
|
21
|
+
* @default "subtle"
|
|
22
|
+
*/
|
|
23
|
+
readonly variant?: TagVariant;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Render a short pill-shaped label.
|
|
27
|
+
* @param props See {@link Props}.
|
|
28
|
+
* @returns A `ReactElement` rendering the tag in the requested variant.
|
|
29
|
+
*/
|
|
30
|
+
export default function Tag({ children, color, icon, variant }: Props): ReactElement;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ReactElement, Ref } from "react";
|
|
2
2
|
import type { UseTimerResult } from "../hooks/use-timer.d.ts";
|
|
3
3
|
export type TimerRef = Omit<UseTimerResult, "isFinished" | "isRunning" | "remaining">;
|
|
4
4
|
export type Props = {
|
|
5
5
|
/**
|
|
6
6
|
* Whether to start the timer immediately.
|
|
7
|
-
*
|
|
8
7
|
* @default false
|
|
9
8
|
*/
|
|
10
9
|
readonly autoStart?: boolean;
|
|
@@ -23,13 +22,11 @@ export type Props = {
|
|
|
23
22
|
/**
|
|
24
23
|
* Custom formatter for the remaining time.
|
|
25
24
|
* Receives remaining milliseconds, returns a display string.
|
|
26
|
-
*
|
|
27
25
|
* @default formatDuration (MM:SS or HH:MM:SS)
|
|
28
26
|
*/
|
|
29
27
|
readonly format?: (remaining: number) => string;
|
|
30
28
|
/**
|
|
31
29
|
* Tick interval in milliseconds.
|
|
32
|
-
*
|
|
33
30
|
* @default 1000
|
|
34
31
|
*/
|
|
35
32
|
readonly interval?: number;
|
|
@@ -37,6 +34,7 @@ export type Props = {
|
|
|
37
34
|
* Called once when the timer reaches zero.
|
|
38
35
|
*/
|
|
39
36
|
readonly onTimeout?: () => void;
|
|
37
|
+
readonly ref?: Ref<TimerRef>;
|
|
40
38
|
};
|
|
41
39
|
/**
|
|
42
40
|
* A countdown timer component.
|
|
@@ -44,9 +42,9 @@ export type Props = {
|
|
|
44
42
|
* Exposes `start`, `stop`, `toggle`, and `reset` methods via ref.
|
|
45
43
|
*
|
|
46
44
|
* ```tsx
|
|
47
|
-
* const ref = useRef
|
|
48
|
-
*
|
|
45
|
+
* const ref = useRef<TimerRef>(null);
|
|
46
|
+
* <Timer ref={ref} duration={60_000} autoStart />
|
|
49
47
|
* ```
|
|
50
48
|
*/
|
|
51
|
-
declare const Timer:
|
|
49
|
+
declare const Timer: ({ autoStart, bold, color, duration, format, interval, onTimeout, ref }: Props) => ReactElement;
|
|
52
50
|
export default Timer;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ReactElement, ReactNode } from "react";
|
|
2
|
+
import type { Variant } from "./variant-config.d.ts";
|
|
3
|
+
export type ToastVariant = Variant;
|
|
4
|
+
export 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
|
+
* @param props See {@link Props}.
|
|
39
|
+
* @returns A bordered `ReactElement` while visible; `null` once dismissed.
|
|
40
|
+
*/
|
|
41
|
+
export default function Toast({ children, duration, onDismiss, title, variant, visible, width }: Props): ReactElement | null;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { AnsiColors } from "@visulima/colorize";
|
|
2
|
+
import type { ReactElement, ReactNode } from "react";
|
|
3
|
+
import type { LiteralUnion } from "type-fest";
|
|
4
|
+
export type TooltipPlacement = "bottom" | "left" | "right" | "top";
|
|
5
|
+
export 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
|
+
export default function Tooltip({ children, color, content, isVisible, placement }: Props): ReactElement;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { ReactElement, ReactNode } from "react";
|
|
2
|
+
export type TransitionPreset = "fade" | "reveal" | "slide-down" | "slide-left" | "slide-right" | "slide-up";
|
|
3
|
+
export type TransitionPhase = "entered" | "entering" | "exited" | "exiting";
|
|
4
|
+
export 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
|
+
* Static marker used by `AnimatePresence` to recognize Transition children
|
|
48
|
+
* even when the consumer hasn't explicitly passed a `show` prop. Consumers
|
|
49
|
+
* can apply the same marker to their own wrappers (`MyWrapper.isAnimatable
|
|
50
|
+
* = true`) to opt them into animation orchestration.
|
|
51
|
+
*/
|
|
52
|
+
declare const TransitionWithMarker: TransitionComponent;
|
|
53
|
+
export default TransitionWithMarker;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Props as BoxProps } from "../
|
|
2
|
-
import type { Props as TextProps } from "../
|
|
1
|
+
import type { Props as BoxProps } from "../box.d.ts";
|
|
2
|
+
import type { Props as TextProps } from "../text.d.ts";
|
|
3
3
|
type StyleFunctionProps = {
|
|
4
4
|
readonly depth?: number;
|
|
5
5
|
readonly hasChildren?: boolean;
|
|
@@ -2,9 +2,6 @@ export type CursorPosition = {
|
|
|
2
2
|
x: number;
|
|
3
3
|
y: number;
|
|
4
4
|
};
|
|
5
|
-
declare const showCursorEscape = "\u001B[?25h";
|
|
6
|
-
declare const hideCursorEscape = "\u001B[?25l";
|
|
7
|
-
export { hideCursorEscape, showCursorEscape };
|
|
8
5
|
/**
|
|
9
6
|
* Compare two cursor positions. Returns true if they differ.
|
|
10
7
|
*/
|
package/dist/ink/dom.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Node as YogaNode } from "yoga-layout";
|
|
2
|
+
import type { Region } from "./region.d.ts";
|
|
2
3
|
import type { OutputTransformer } from "./render-node-to-output.d.ts";
|
|
3
4
|
import type ResizeObserver from "./resize-observer.d.ts";
|
|
4
5
|
import type { ScrollState } from "./scroll.d.ts";
|
|
@@ -62,7 +63,7 @@ export type DOMElement = InkNode & {
|
|
|
62
63
|
* skipped during rendering and the cached region is composited directly.
|
|
63
64
|
* Set by setCachedRender(), cleared on unmount by cleanupNodeTree().
|
|
64
65
|
*/
|
|
65
|
-
cachedRender?:
|
|
66
|
+
cachedRender?: Region;
|
|
66
67
|
childNodes: DOMNode[];
|
|
67
68
|
internal_accessibility?: {
|
|
68
69
|
role?: "button" | "checkbox" | "combobox" | "list" | "listbox" | "listitem" | "menu" | "menuitem" | "option" | "progressbar" | "radio" | "radiogroup" | "tab" | "tablist" | "table" | "textbox" | "timer" | "toolbar";
|
|
@@ -100,6 +101,12 @@ export type DOMElement = InkNode & {
|
|
|
100
101
|
* Maximum scrollTop ever reached, used with stableScrollback.
|
|
101
102
|
*/
|
|
102
103
|
internal_maxScrollTop?: number;
|
|
104
|
+
/**
|
|
105
|
+
* Callback invoked after prepareYogaTree() caches the render output for
|
|
106
|
+
* an ink-static-render node. StaticRender uses this to set `isRendered`
|
|
107
|
+
* state, which prevents React from re-reconciling children once cached.
|
|
108
|
+
*/
|
|
109
|
+
internal_onRendered?: () => void;
|
|
103
110
|
/**
|
|
104
111
|
* Whether this element is opaque (prevents rendering of covered content beneath it).
|
|
105
112
|
*/
|
|
@@ -145,12 +152,6 @@ export type DOMElement = InkNode & {
|
|
|
145
152
|
};
|
|
146
153
|
internal_transform?: OutputTransformer;
|
|
147
154
|
isStaticDirty?: boolean;
|
|
148
|
-
/**
|
|
149
|
-
* Callback invoked after prepareYogaTree() caches the render output for
|
|
150
|
-
* an ink-static-render node. StaticRender uses this to set `isRendered`
|
|
151
|
-
* state, which prevents React from re-reconciling children once cached.
|
|
152
|
-
*/
|
|
153
|
-
internal_onRendered?: () => void;
|
|
154
155
|
/**
|
|
155
156
|
* Whether the Yoga subtree has been detached (children removed from Yoga layout)
|
|
156
157
|
* because a cachedRender was set. When cachedRender is invalidated,
|
|
@@ -195,7 +196,7 @@ export declare const emitLayoutListeners: (rootNode: DOMElement) => void;
|
|
|
195
196
|
*
|
|
196
197
|
* Ported from jacob314/ink (Google LLC, Apache-2.0).
|
|
197
198
|
*/
|
|
198
|
-
export declare const setCachedRender: (node: DOMElement, cachedRender:
|
|
199
|
+
export declare const setCachedRender: (node: DOMElement, cachedRender: Region) => void;
|
|
199
200
|
/**
|
|
200
201
|
* Get the path from the root to this node (inclusive).
|
|
201
202
|
* Returns an array starting with the root and ending with the node.
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
type Options = {
|
|
2
2
|
/**
|
|
3
3
|
* Time between ticks in milliseconds.
|
|
4
|
-
*
|
|
5
4
|
* @default 100
|
|
6
5
|
*/
|
|
7
6
|
readonly interval?: number;
|
|
8
7
|
/**
|
|
9
8
|
* Whether the animation is running. When set to `false`, the animation stops.
|
|
10
9
|
* When toggled back to `true`, all values reset to `0`.
|
|
11
|
-
*
|
|
12
10
|
* @default true
|
|
13
11
|
*/
|
|
14
12
|
readonly isActive?: boolean;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export type ValidationResult = string | undefined;
|
|
2
|
+
export type FieldValidator<V> = (value: V, values: Readonly<Record<string, unknown>>) => ValidationResult;
|
|
3
|
+
export type FieldConfig<V = unknown> = {
|
|
4
|
+
/**
|
|
5
|
+
* Initial value.
|
|
6
|
+
*/
|
|
7
|
+
readonly initialValue: V;
|
|
8
|
+
/**
|
|
9
|
+
* Optional validator. Return a string to indicate an error; return
|
|
10
|
+
* `undefined` for valid.
|
|
11
|
+
*/
|
|
12
|
+
readonly validate?: FieldValidator<V>;
|
|
13
|
+
};
|
|
14
|
+
export type FormSchema = Readonly<Record<string, FieldConfig<never>>>;
|
|
15
|
+
export type FormValues<S extends Readonly<Record<string, FieldConfig>>> = {
|
|
16
|
+
[K in keyof S]: S[K] extends FieldConfig<infer V> ? V : never;
|
|
17
|
+
};
|
|
18
|
+
export type UseFormOptions<S extends Readonly<Record<string, FieldConfig>>> = {
|
|
19
|
+
/**
|
|
20
|
+
* Field declarations.
|
|
21
|
+
*/
|
|
22
|
+
readonly fields: S;
|
|
23
|
+
/**
|
|
24
|
+
* Called on submit if all fields validate.
|
|
25
|
+
*/
|
|
26
|
+
readonly onSubmit?: (values: FormValues<S>) => void | Promise<void>;
|
|
27
|
+
};
|
|
28
|
+
export type UseFormResult<S extends Readonly<Record<string, FieldConfig>>> = {
|
|
29
|
+
/**
|
|
30
|
+
* Map of fieldName -> validation error (if any).
|
|
31
|
+
*/
|
|
32
|
+
readonly errors: Readonly<Partial<Record<keyof S, string>>>;
|
|
33
|
+
/**
|
|
34
|
+
* True while the last `submit()` is in-flight.
|
|
35
|
+
*/
|
|
36
|
+
readonly isSubmitting: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Reset all fields back to their initial values and clear errors / touched.
|
|
39
|
+
*/
|
|
40
|
+
readonly reset: () => void;
|
|
41
|
+
/**
|
|
42
|
+
* Mark a field as touched. Useful on blur.
|
|
43
|
+
*/
|
|
44
|
+
readonly setTouched: <K extends keyof S>(name: K, touched?: boolean) => void;
|
|
45
|
+
/**
|
|
46
|
+
* Update a single field.
|
|
47
|
+
*/
|
|
48
|
+
readonly setValue: <K extends keyof S>(name: K, value: FormValues<S>[K]) => void;
|
|
49
|
+
/**
|
|
50
|
+
* Trigger validation and call the `onSubmit` option. Returns true if
|
|
51
|
+
* submission succeeded (all fields valid).
|
|
52
|
+
*/
|
|
53
|
+
readonly submit: () => Promise<boolean>;
|
|
54
|
+
/**
|
|
55
|
+
* Map of fieldName -> boolean. Field is considered touched after the
|
|
56
|
+
* first `setTouched(name)` or `submit()` invocation.
|
|
57
|
+
*/
|
|
58
|
+
readonly touched: Readonly<Partial<Record<keyof S, boolean>>>;
|
|
59
|
+
/**
|
|
60
|
+
* Current values.
|
|
61
|
+
*/
|
|
62
|
+
readonly values: FormValues<S>;
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Minimal headless form state machine. Tracks values, touched state, errors,
|
|
66
|
+
* and submission in-flight. Pair with `<Form />` for default layout, or wire
|
|
67
|
+
* up your own inputs directly.
|
|
68
|
+
*/
|
|
69
|
+
declare const useForm: <S extends Readonly<Record<string, FieldConfig>>>(options: UseFormOptions<S>) => UseFormResult<S>;
|
|
70
|
+
export default useForm;
|