@visulima/tui 1.0.0-alpha.1 → 1.0.0-alpha.3
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 +3 -3
- 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} +10 -3
- 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-BXpZwLWo.js → Tabs-DubuHdYV.js} +53 -35
- 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
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useRef, useLayoutEffect, useEffect, useMemo } from 'react';
|
|
3
|
+
|
|
4
|
+
const areDepsEqual = (previousDeps, nextDeps) => {
|
|
5
|
+
if (previousDeps === nextDeps) {
|
|
6
|
+
return true;
|
|
7
|
+
}
|
|
8
|
+
if (!previousDeps || !nextDeps) {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
if (previousDeps.length !== nextDeps.length) {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
for (const [index, previousDep] of previousDeps.entries()) {
|
|
15
|
+
if (!Object.is(previousDep, nextDeps[index])) {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return true;
|
|
20
|
+
};
|
|
21
|
+
const StaticRender = ({ children, deps, style, width }) => {
|
|
22
|
+
const ref = useRef(null);
|
|
23
|
+
const isRenderedRef = useRef(false);
|
|
24
|
+
const previousDepsRef = useRef(deps);
|
|
25
|
+
const previousChildrenRef = useRef(children);
|
|
26
|
+
let invalidated = false;
|
|
27
|
+
if (deps !== void 0) {
|
|
28
|
+
if (!areDepsEqual(previousDepsRef.current, deps)) {
|
|
29
|
+
invalidated = true;
|
|
30
|
+
previousDepsRef.current = deps;
|
|
31
|
+
}
|
|
32
|
+
} else if (children !== previousChildrenRef.current) {
|
|
33
|
+
invalidated = true;
|
|
34
|
+
previousChildrenRef.current = children;
|
|
35
|
+
}
|
|
36
|
+
if (invalidated) {
|
|
37
|
+
isRenderedRef.current = false;
|
|
38
|
+
if (ref.current) {
|
|
39
|
+
ref.current.cachedRender = void 0;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
useLayoutEffect(() => {
|
|
43
|
+
const node = ref.current;
|
|
44
|
+
if (node) {
|
|
45
|
+
node.internal_onRendered = () => {
|
|
46
|
+
isRenderedRef.current = true;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
useEffect(
|
|
51
|
+
() => () => {
|
|
52
|
+
const node = ref.current;
|
|
53
|
+
if (node) {
|
|
54
|
+
node.cachedRender = void 0;
|
|
55
|
+
node.internal_onRendered = void 0;
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
[]
|
|
59
|
+
);
|
|
60
|
+
const mergedStyle = useMemo(() => {
|
|
61
|
+
return {
|
|
62
|
+
...style,
|
|
63
|
+
width
|
|
64
|
+
};
|
|
65
|
+
}, [style, width]);
|
|
66
|
+
return jsx("ink-static-render", { ref, style: mergedStyle, children: isRenderedRef.current ? null : children() });
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export { StaticRender as default };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import Box from './Box-W1w_NGin.js';
|
|
3
|
+
import Text from './Text-CtUwV89_.js';
|
|
4
|
+
|
|
5
|
+
const renderSlot = (content, color) => {
|
|
6
|
+
if (content === void 0) {
|
|
7
|
+
return void 0;
|
|
8
|
+
}
|
|
9
|
+
if (typeof content === "string" || typeof content === "number") {
|
|
10
|
+
return jsx(Text, { color, children: content });
|
|
11
|
+
}
|
|
12
|
+
return content;
|
|
13
|
+
};
|
|
14
|
+
function StatusLine({ backgroundColor, center, color, left, right }) {
|
|
15
|
+
return jsxs(Box, { backgroundColor, paddingX: 1, width: "100%", children: [
|
|
16
|
+
jsx(Box, { flexGrow: 1, flexShrink: 1, minWidth: 0, children: renderSlot(left, color) }),
|
|
17
|
+
center === void 0 ? void 0 : jsx(Box, { flexGrow: 0, flexShrink: 0, justifyContent: "center", children: renderSlot(center, color) }),
|
|
18
|
+
jsx(Box, { flexGrow: 1, flexShrink: 1, justifyContent: "flex-end", minWidth: 0, children: renderSlot(right, color) })
|
|
19
|
+
] });
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { StatusLine as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import Box from './Box-
|
|
3
|
-
import Text from './Text-
|
|
2
|
+
import Box from './Box-W1w_NGin.js';
|
|
3
|
+
import Text from './Text-CtUwV89_.js';
|
|
4
4
|
import { V as VARIANT_CONFIG } from './variant-config-DSZoX5TM.js';
|
|
5
5
|
|
|
6
6
|
function StatusMessage({ children, variant }) {
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { Fragment } from 'react';
|
|
3
|
+
import Box from './Box-W1w_NGin.js';
|
|
4
|
+
import Text from './Text-CtUwV89_.js';
|
|
5
|
+
|
|
6
|
+
const STATUS_ICON = {
|
|
7
|
+
active: "●",
|
|
8
|
+
completed: "✔",
|
|
9
|
+
error: "✖",
|
|
10
|
+
pending: "○"
|
|
11
|
+
};
|
|
12
|
+
const resolveStatus = (step, index, activeIndex) => {
|
|
13
|
+
if (step.status !== void 0) {
|
|
14
|
+
return step.status;
|
|
15
|
+
}
|
|
16
|
+
if (index < activeIndex) {
|
|
17
|
+
return "completed";
|
|
18
|
+
}
|
|
19
|
+
if (index === activeIndex) {
|
|
20
|
+
return "active";
|
|
21
|
+
}
|
|
22
|
+
return "pending";
|
|
23
|
+
};
|
|
24
|
+
function Stepper({ accentColor = "blue", activeIndex = 0, errorColor = "red", orientation = "horizontal", steps }) {
|
|
25
|
+
if (orientation === "vertical") {
|
|
26
|
+
return jsx(Box, { flexDirection: "column", children: steps.map((step, index) => {
|
|
27
|
+
const status = resolveStatus(step, index, activeIndex);
|
|
28
|
+
const isLast = index === steps.length - 1;
|
|
29
|
+
const color = status === "error" ? errorColor : status === "pending" ? void 0 : accentColor;
|
|
30
|
+
return jsxs(Box, { flexDirection: "column", children: [
|
|
31
|
+
jsxs(Box, { children: [
|
|
32
|
+
jsxs(Text, { color, dimColor: status === "pending", children: [
|
|
33
|
+
STATUS_ICON[status],
|
|
34
|
+
" "
|
|
35
|
+
] }),
|
|
36
|
+
jsx(Text, { bold: status === "active", color, dimColor: status === "pending", children: step.label })
|
|
37
|
+
] }),
|
|
38
|
+
step.description === void 0 ? void 0 : jsx(Box, { marginLeft: 2, children: jsx(Text, { dimColor: true, children: step.description }) }),
|
|
39
|
+
isLast ? void 0 : jsx(Box, { marginLeft: 0, children: jsx(Text, { dimColor: true, children: "│" }) })
|
|
40
|
+
] }, step.key ?? index);
|
|
41
|
+
}) });
|
|
42
|
+
}
|
|
43
|
+
return jsx(Box, { children: steps.map((step, index) => {
|
|
44
|
+
const status = resolveStatus(step, index, activeIndex);
|
|
45
|
+
const color = status === "error" ? errorColor : status === "pending" ? void 0 : accentColor;
|
|
46
|
+
const isLast = index === steps.length - 1;
|
|
47
|
+
return jsxs(Fragment, { children: [
|
|
48
|
+
jsxs(Box, { children: [
|
|
49
|
+
jsxs(Text, { color, dimColor: status === "pending", children: [
|
|
50
|
+
STATUS_ICON[status],
|
|
51
|
+
" "
|
|
52
|
+
] }),
|
|
53
|
+
jsx(Text, { bold: status === "active", color, dimColor: status === "pending", children: step.label })
|
|
54
|
+
] }),
|
|
55
|
+
isLast ? void 0 : jsx(Text, { dimColor: true, children: " ── " })
|
|
56
|
+
] }, step.key ?? index);
|
|
57
|
+
}) });
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export { Stepper as default };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useImperativeHandle } from 'react';
|
|
3
|
+
import useStopwatch from './useStopwatch-C__Zu6hd.js';
|
|
4
|
+
import { f as formatDuration } from './format-time-BGmnDukX.js';
|
|
5
|
+
import Text from './Text-CtUwV89_.js';
|
|
6
|
+
|
|
7
|
+
const Stopwatch = ({ autoStart, bold, color, format = formatDuration, interval, ref }) => {
|
|
8
|
+
const sw = useStopwatch({ autoStart, interval });
|
|
9
|
+
useImperativeHandle(ref, () => {
|
|
10
|
+
return {
|
|
11
|
+
lap: sw.lap,
|
|
12
|
+
reset: sw.reset,
|
|
13
|
+
start: sw.start,
|
|
14
|
+
stop: sw.stop,
|
|
15
|
+
toggle: sw.toggle
|
|
16
|
+
};
|
|
17
|
+
}, [sw.lap, sw.reset, sw.start, sw.stop, sw.toggle]);
|
|
18
|
+
return jsx(Text, { bold, color, children: format(sw.elapsed) });
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export { Stopwatch as default };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { useState, useRef, useEffect } from 'react';
|
|
3
|
+
import Text from './Text-CtUwV89_.js';
|
|
4
|
+
|
|
5
|
+
function StreamingText({ color, cursor = "▊", interval = 20, onComplete, showCursorWhenDone = false, text }) {
|
|
6
|
+
const [visibleLength, setVisibleLength] = useState(0);
|
|
7
|
+
const onCompleteRef = useRef(onComplete);
|
|
8
|
+
const hasCompletedRef = useRef(false);
|
|
9
|
+
onCompleteRef.current = onComplete;
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
setVisibleLength(0);
|
|
12
|
+
hasCompletedRef.current = false;
|
|
13
|
+
}, [text]);
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
if (visibleLength >= text.length) {
|
|
16
|
+
if (!hasCompletedRef.current) {
|
|
17
|
+
hasCompletedRef.current = true;
|
|
18
|
+
onCompleteRef.current?.();
|
|
19
|
+
}
|
|
20
|
+
return void 0;
|
|
21
|
+
}
|
|
22
|
+
const timer = setTimeout(() => {
|
|
23
|
+
setVisibleLength((previous) => Math.min(text.length, previous + 1));
|
|
24
|
+
}, interval);
|
|
25
|
+
return () => {
|
|
26
|
+
clearTimeout(timer);
|
|
27
|
+
};
|
|
28
|
+
}, [visibleLength, text, interval]);
|
|
29
|
+
const done = visibleLength >= text.length;
|
|
30
|
+
const showCursor = !done || showCursorWhenDone;
|
|
31
|
+
const visible = text.slice(0, visibleLength);
|
|
32
|
+
return jsxs(Text, { color, children: [
|
|
33
|
+
visible,
|
|
34
|
+
showCursor ? cursor : ""
|
|
35
|
+
] });
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export { StreamingText as default };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useState, useCallback } from 'react';
|
|
3
|
+
import useFocus from './useFocus-DLoGQJd9.js';
|
|
4
|
+
import useInput from './useInput-DKZbqMRc.js';
|
|
5
|
+
import Box from './Box-W1w_NGin.js';
|
|
6
|
+
import Text from './Text-CtUwV89_.js';
|
|
7
|
+
|
|
8
|
+
function Switch({
|
|
9
|
+
accentColor = "green",
|
|
10
|
+
autoFocus = false,
|
|
11
|
+
children,
|
|
12
|
+
defaultValue = false,
|
|
13
|
+
isDisabled = false,
|
|
14
|
+
labels = ["off", "on"],
|
|
15
|
+
onChange,
|
|
16
|
+
value
|
|
17
|
+
}) {
|
|
18
|
+
const { isFocused } = useFocus({ autoFocus, isActive: !isDisabled });
|
|
19
|
+
const [internal, setInternal] = useState(defaultValue);
|
|
20
|
+
const current = value ?? internal;
|
|
21
|
+
useInput(
|
|
22
|
+
useCallback(
|
|
23
|
+
(input, key) => {
|
|
24
|
+
if (!isFocused) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
if (key.return || input === " ") {
|
|
28
|
+
const next = !current;
|
|
29
|
+
if (value === void 0) {
|
|
30
|
+
setInternal(next);
|
|
31
|
+
}
|
|
32
|
+
onChange?.(next);
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
[isFocused, current, value, onChange]
|
|
36
|
+
),
|
|
37
|
+
{ isActive: !isDisabled && isFocused }
|
|
38
|
+
);
|
|
39
|
+
const off = labels[0];
|
|
40
|
+
const on = labels[1];
|
|
41
|
+
const focusColor = isFocused ? accentColor : void 0;
|
|
42
|
+
return jsxs(Box, { gap: 1, children: [
|
|
43
|
+
jsxs(Box, { gap: 0, children: [
|
|
44
|
+
jsxs(Text, { backgroundColor: current ? void 0 : "gray", color: current ? void 0 : "black", dimColor: isDisabled, children: [
|
|
45
|
+
" ",
|
|
46
|
+
off,
|
|
47
|
+
" "
|
|
48
|
+
] }),
|
|
49
|
+
jsxs(Text, { backgroundColor: current ? accentColor : void 0, color: current ? "black" : void 0, dimColor: isDisabled, children: [
|
|
50
|
+
" ",
|
|
51
|
+
on,
|
|
52
|
+
" "
|
|
53
|
+
] })
|
|
54
|
+
] }),
|
|
55
|
+
children === void 0 ? void 0 : jsx(Text, { color: focusColor, dimColor: isDisabled, children })
|
|
56
|
+
] });
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export { Switch as default };
|
|
@@ -2,7 +2,7 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { Table } from '@visulima/tabular';
|
|
3
3
|
import { THICK_BORDER, ROUNDED_BORDER, NO_BORDER, MINIMAL_BORDER, MARKDOWN_BORDER, DOUBLE_BORDER, DOTS_BORDER, DEFAULT_BORDER, BLOCK_BORDER, ASCII_BORDER } from '@visulima/tabular/style';
|
|
4
4
|
import { useMemo } from 'react';
|
|
5
|
-
import Text from './Text-
|
|
5
|
+
import Text from './Text-CtUwV89_.js';
|
|
6
6
|
|
|
7
7
|
const BORDER_PRESETS = {
|
|
8
8
|
ascii: ASCII_BORDER,
|
|
@@ -16,7 +16,13 @@ const BORDER_PRESETS = {
|
|
|
16
16
|
rounded: ROUNDED_BORDER,
|
|
17
17
|
thick: THICK_BORDER
|
|
18
18
|
};
|
|
19
|
-
|
|
19
|
+
const toColumnConfig = (col) => {
|
|
20
|
+
if (typeof col === "string") {
|
|
21
|
+
return { key: col };
|
|
22
|
+
}
|
|
23
|
+
return col;
|
|
24
|
+
};
|
|
25
|
+
const TableComponent = ({
|
|
20
26
|
borderStyle = "default",
|
|
21
27
|
columns: columnsProp,
|
|
22
28
|
data,
|
|
@@ -27,14 +33,14 @@ function TableComponent({
|
|
|
27
33
|
showHeader = true,
|
|
28
34
|
skeleton = "",
|
|
29
35
|
wordWrap = false
|
|
30
|
-
}) {
|
|
36
|
+
}) => {
|
|
31
37
|
const tableString = useMemo(() => {
|
|
32
38
|
if (data.length === 0) {
|
|
33
39
|
return "";
|
|
34
40
|
}
|
|
35
41
|
let resolvedColumns;
|
|
36
42
|
if (columnsProp) {
|
|
37
|
-
resolvedColumns = columnsProp.map((col) =>
|
|
43
|
+
resolvedColumns = columnsProp.map((col) => toColumnConfig(col));
|
|
38
44
|
} else {
|
|
39
45
|
resolvedColumns = Object.keys(data[0]).map((key) => {
|
|
40
46
|
return { key };
|
|
@@ -77,6 +83,6 @@ function TableComponent({
|
|
|
77
83
|
return table.toString();
|
|
78
84
|
}, [borderStyle, columnsProp, data, formatCell, formatHeader, maxWidth, padding, showHeader, skeleton, wordWrap]);
|
|
79
85
|
return jsx(Text, { children: tableString });
|
|
80
|
-
}
|
|
86
|
+
};
|
|
81
87
|
|
|
82
88
|
export { TableComponent as default };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import { useRef, useState, useEffect, useMemo,
|
|
3
|
-
import useInput from './useInput-
|
|
4
|
-
import Box from './Box-
|
|
5
|
-
import Text from './Text-
|
|
2
|
+
import { useRef, useState, useCallback, useEffect, useMemo, Children } from 'react';
|
|
3
|
+
import useInput from './useInput-DKZbqMRc.js';
|
|
4
|
+
import Box from './Box-W1w_NGin.js';
|
|
5
|
+
import Text from './Text-CtUwV89_.js';
|
|
6
6
|
|
|
7
7
|
const NUMBER_KEY_PATTERN = /^\d$/u;
|
|
8
8
|
const isTabElement = (child) => child != null && typeof child === "object" && "props" in child && "name" in child.props;
|
|
@@ -37,6 +37,7 @@ function Tabs({
|
|
|
37
37
|
keyMap: keyMapProp,
|
|
38
38
|
onChange,
|
|
39
39
|
showIndex = true,
|
|
40
|
+
value,
|
|
40
41
|
width
|
|
41
42
|
}) {
|
|
42
43
|
const tabs = collectTabs(children);
|
|
@@ -44,16 +45,28 @@ function Tabs({
|
|
|
44
45
|
const tabsRef = useRef(tabs);
|
|
45
46
|
tabsRef.current = tabs;
|
|
46
47
|
const isColumn = flexDirection === "column" || flexDirection === "column-reverse";
|
|
47
|
-
const
|
|
48
|
-
|
|
48
|
+
const isControlled = value !== void 0;
|
|
49
|
+
const [internalTab, setInternalTab] = useState(() => {
|
|
50
|
+
const initial = value ?? defaultValue;
|
|
51
|
+
if (initial == null || tabCount === 0) {
|
|
49
52
|
return 0;
|
|
50
53
|
}
|
|
51
|
-
const foundIndex = tabs.findIndex((tab) => tab.props.name ===
|
|
54
|
+
const foundIndex = tabs.findIndex((tab) => tab.props.name === initial);
|
|
52
55
|
return foundIndex === -1 ? 0 : foundIndex;
|
|
53
56
|
});
|
|
57
|
+
const activeTab = isControlled ? Math.max(
|
|
58
|
+
0,
|
|
59
|
+
tabs.findIndex((tab) => tab.props.name === value)
|
|
60
|
+
) : internalTab;
|
|
61
|
+
const noopSetTab = useCallback(() => {
|
|
62
|
+
}, []);
|
|
63
|
+
const setActiveTab = isControlled ? noopSetTab : setInternalTab;
|
|
54
64
|
const onChangeRef = useRef(onChange);
|
|
55
65
|
onChangeRef.current = onChange;
|
|
56
66
|
useEffect(() => {
|
|
67
|
+
if (isControlled) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
57
70
|
const tab = tabsRef.current[activeTab];
|
|
58
71
|
if (tab) {
|
|
59
72
|
onChangeRef.current(tab.props.name, tab);
|
|
@@ -63,33 +76,34 @@ function Tabs({
|
|
|
63
76
|
const nextKeys = useMemo(() => keyMapProp?.next ?? [isColumn ? "downArrow" : "rightArrow"], [keyMapProp?.next, isColumn]);
|
|
64
77
|
const useNumbers = keyMapProp?.useNumbers ?? true;
|
|
65
78
|
const useTab = keyMapProp?.useTab ?? true;
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}, []);
|
|
73
|
-
const moveToNext = useCallback(() => {
|
|
74
|
-
setActiveTab((current) => {
|
|
75
|
-
const next = current + 1 >= tabCount ? 0 : current + 1;
|
|
76
|
-
const tab = tabsRef.current[next];
|
|
79
|
+
const activeTabRef = useRef(activeTab);
|
|
80
|
+
activeTabRef.current = activeTab;
|
|
81
|
+
const handleTabChange = useCallback(
|
|
82
|
+
(index) => {
|
|
83
|
+
setActiveTab(index);
|
|
84
|
+
const tab = tabsRef.current[index];
|
|
77
85
|
if (tab) {
|
|
78
86
|
onChangeRef.current(tab.props.name, tab);
|
|
79
87
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
88
|
+
},
|
|
89
|
+
[setActiveTab]
|
|
90
|
+
);
|
|
91
|
+
const moveToNext = useCallback(() => {
|
|
92
|
+
const next = (activeTabRef.current + 1) % tabCount;
|
|
93
|
+
setActiveTab(next);
|
|
94
|
+
const tab = tabsRef.current[next];
|
|
95
|
+
if (tab) {
|
|
96
|
+
onChangeRef.current(tab.props.name, tab);
|
|
97
|
+
}
|
|
98
|
+
}, [tabCount, setActiveTab]);
|
|
83
99
|
const moveToPrevious = useCallback(() => {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
});
|
|
92
|
-
}, [tabCount]);
|
|
100
|
+
const previous = (activeTabRef.current - 1 + tabCount) % tabCount;
|
|
101
|
+
setActiveTab(previous);
|
|
102
|
+
const tab = tabsRef.current[previous];
|
|
103
|
+
if (tab) {
|
|
104
|
+
onChangeRef.current(tab.props.name, tab);
|
|
105
|
+
}
|
|
106
|
+
}, [tabCount, setActiveTab]);
|
|
93
107
|
useInput(
|
|
94
108
|
useCallback(
|
|
95
109
|
(input, key) => {
|
|
@@ -129,14 +143,18 @@ function Tabs({
|
|
|
129
143
|
return jsx(Box, { flexDirection, width, children: tabs.map((child, index) => {
|
|
130
144
|
const { name } = child.props;
|
|
131
145
|
const textColors = getActiveTabColors(activeTab === index, isFocused !== false, colorsProp);
|
|
146
|
+
let indexLabel = null;
|
|
147
|
+
if (showIndex) {
|
|
148
|
+
indexLabel = jsxs(Text, { color: "grey", children: [
|
|
149
|
+
index + 1,
|
|
150
|
+
".",
|
|
151
|
+
" "
|
|
152
|
+
] });
|
|
153
|
+
}
|
|
132
154
|
return jsxs(Box, { flexDirection, children: [
|
|
133
155
|
index !== 0 && jsx(Text, { color: "dim", children: separator }),
|
|
134
156
|
jsxs(Box, { children: [
|
|
135
|
-
|
|
136
|
-
index + 1,
|
|
137
|
-
".",
|
|
138
|
-
" "
|
|
139
|
-
] }) : null,
|
|
157
|
+
indexLabel,
|
|
140
158
|
jsx(Text, { backgroundColor: textColors.backgroundColor, color: textColors.color, children: child })
|
|
141
159
|
] })
|
|
142
160
|
] }, name);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import Box from './Box-W1w_NGin.js';
|
|
3
|
+
import Text from './Text-CtUwV89_.js';
|
|
4
|
+
|
|
5
|
+
function Tag({ children, color = "blue", icon, variant = "subtle" }) {
|
|
6
|
+
if (variant === "outline") {
|
|
7
|
+
return jsx(Box, { borderColor: color, borderStyle: "round", paddingX: 1, children: jsxs(Text, { color, children: [
|
|
8
|
+
icon === void 0 ? void 0 : jsxs(Fragment, { children: [
|
|
9
|
+
icon,
|
|
10
|
+
" "
|
|
11
|
+
] }),
|
|
12
|
+
children
|
|
13
|
+
] }) });
|
|
14
|
+
}
|
|
15
|
+
if (variant === "solid") {
|
|
16
|
+
return jsxs(Text, { backgroundColor: color, color: "black", children: [
|
|
17
|
+
" ",
|
|
18
|
+
icon === void 0 ? void 0 : jsxs(Fragment, { children: [
|
|
19
|
+
icon,
|
|
20
|
+
" "
|
|
21
|
+
] }),
|
|
22
|
+
children,
|
|
23
|
+
" "
|
|
24
|
+
] });
|
|
25
|
+
}
|
|
26
|
+
return jsxs(Text, { color, children: [
|
|
27
|
+
icon === void 0 ? void 0 : jsxs(Fragment, { children: [
|
|
28
|
+
icon,
|
|
29
|
+
" "
|
|
30
|
+
] }),
|
|
31
|
+
children
|
|
32
|
+
] });
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export { Tag as default };
|
|
@@ -2,8 +2,8 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import colorizeDefault from '@visulima/colorize';
|
|
3
3
|
import { useContext, useCallback } from 'react';
|
|
4
4
|
import { c as colorize } from './colorize-88_Vk8cn.js';
|
|
5
|
-
import { a as accessibilityContext } from './
|
|
6
|
-
import { b as backgroundContext } from './
|
|
5
|
+
import { a as accessibilityContext } from './accessibility-context-BLelHhNU.js';
|
|
6
|
+
import { b as backgroundContext } from './background-context-BAUaxfOb.js';
|
|
7
7
|
|
|
8
8
|
function Text({
|
|
9
9
|
"aria-hidden": ariaHidden = false,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { useState, useRef, useCallback } from 'react';
|
|
3
|
-
import useInput from './useInput-
|
|
3
|
+
import useInput from './useInput-DKZbqMRc.js';
|
|
4
4
|
import { i as isInsertableInput } from './input-utils-ViAEXa0Z.js';
|
|
5
|
-
import Box from './Box-
|
|
6
|
-
import Text from './Text-
|
|
5
|
+
import Box from './Box-W1w_NGin.js';
|
|
6
|
+
import Text from './Text-CtUwV89_.js';
|
|
7
7
|
|
|
8
8
|
const KILL_WORD_PATTERN = /\S+\s*$/;
|
|
9
9
|
const findSuggestion = (value, suggestions) => {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { useRef, useState, useEffect, useMemo, useCallback } from 'react';
|
|
3
|
-
import useClipboard from './useClipboard-
|
|
4
|
-
import useInput from './useInput-
|
|
5
|
-
import usePaste from './usePaste-
|
|
3
|
+
import useClipboard from './useClipboard-MNj6MNR-.js';
|
|
4
|
+
import useInput from './useInput-DKZbqMRc.js';
|
|
5
|
+
import usePaste from './usePaste-png73gvT.js';
|
|
6
6
|
import useTextBuffer from './useTextBuffer-C8fEe9Ly.js';
|
|
7
7
|
import { i as isInsertableInput } from './input-utils-ViAEXa0Z.js';
|
|
8
|
-
import Box from './Box-
|
|
9
|
-
import Text from './Text-
|
|
8
|
+
import Box from './Box-W1w_NGin.js';
|
|
9
|
+
import Text from './Text-CtUwV89_.js';
|
|
10
10
|
|
|
11
11
|
const getOrderedSelection = (cursor, anchor) => {
|
|
12
12
|
if (anchor.line < cursor.line || anchor.line === cursor.line && anchor.col < cursor.col) {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useImperativeHandle } from 'react';
|
|
3
|
+
import useTimer from './useTimer-DnBtbhB5.js';
|
|
4
|
+
import { f as formatDuration } from './format-time-BGmnDukX.js';
|
|
5
|
+
import Text from './Text-CtUwV89_.js';
|
|
6
|
+
|
|
7
|
+
const Timer = ({ autoStart, bold, color, duration, format = formatDuration, interval, onTimeout, ref }) => {
|
|
8
|
+
const timer = useTimer({ autoStart, duration, interval, onTimeout });
|
|
9
|
+
useImperativeHandle(ref, () => {
|
|
10
|
+
return {
|
|
11
|
+
reset: timer.reset,
|
|
12
|
+
start: timer.start,
|
|
13
|
+
stop: timer.stop,
|
|
14
|
+
toggle: timer.toggle
|
|
15
|
+
};
|
|
16
|
+
}, [timer.reset, timer.start, timer.stop, timer.toggle]);
|
|
17
|
+
return jsx(Text, { bold, color, children: format(timer.remaining) });
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export { Timer as default };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useState, useRef, useEffect } from 'react';
|
|
3
|
+
import Box from './Box-W1w_NGin.js';
|
|
4
|
+
import Text from './Text-CtUwV89_.js';
|
|
5
|
+
import { V as VARIANT_CONFIG } from './variant-config-DSZoX5TM.js';
|
|
6
|
+
|
|
7
|
+
function Toast({ children, duration = 4e3, onDismiss, title, variant = "info", visible, width }) {
|
|
8
|
+
const [internalVisible, setInternalVisible] = useState(true);
|
|
9
|
+
const isVisible = visible ?? internalVisible;
|
|
10
|
+
const onDismissRef = useRef(onDismiss);
|
|
11
|
+
onDismissRef.current = onDismiss;
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
if (visible !== void 0 || duration <= 0 || !isVisible) {
|
|
14
|
+
return void 0;
|
|
15
|
+
}
|
|
16
|
+
const timer = setTimeout(() => {
|
|
17
|
+
setInternalVisible(false);
|
|
18
|
+
onDismissRef.current?.();
|
|
19
|
+
}, duration);
|
|
20
|
+
return () => {
|
|
21
|
+
clearTimeout(timer);
|
|
22
|
+
};
|
|
23
|
+
}, [duration, visible, isVisible]);
|
|
24
|
+
if (!isVisible) {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
const { color, icon } = VARIANT_CONFIG[variant];
|
|
28
|
+
return jsxs(Box, { borderColor: color, borderStyle: "round", gap: 1, paddingX: 1, width, children: [
|
|
29
|
+
jsx(Text, { color, children: icon }),
|
|
30
|
+
jsxs(Box, { flexDirection: "column", flexGrow: 1, children: [
|
|
31
|
+
title === void 0 ? void 0 : jsx(Text, { bold: true, children: title }),
|
|
32
|
+
jsx(Text, { children })
|
|
33
|
+
] })
|
|
34
|
+
] });
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export { Toast as default };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import Box from './Box-W1w_NGin.js';
|
|
3
|
+
import Text from './Text-CtUwV89_.js';
|
|
4
|
+
|
|
5
|
+
const PLACEMENT_STYLE = {
|
|
6
|
+
bottom: { flexDirection: "column", orderFirst: false },
|
|
7
|
+
left: { flexDirection: "row", orderFirst: true },
|
|
8
|
+
right: { flexDirection: "row", orderFirst: false },
|
|
9
|
+
top: { flexDirection: "column", orderFirst: true }
|
|
10
|
+
};
|
|
11
|
+
function Tooltip({ children, color = "gray", content, isVisible = true, placement = "right" }) {
|
|
12
|
+
const { flexDirection, orderFirst } = PLACEMENT_STYLE[placement];
|
|
13
|
+
const tooltip = isVisible ? jsx(
|
|
14
|
+
Box,
|
|
15
|
+
{
|
|
16
|
+
borderColor: color,
|
|
17
|
+
borderStyle: "round",
|
|
18
|
+
flexShrink: 0,
|
|
19
|
+
marginLeft: placement === "right" ? 1 : 0,
|
|
20
|
+
marginRight: placement === "left" ? 1 : 0,
|
|
21
|
+
paddingX: 1,
|
|
22
|
+
children: typeof content === "string" ? jsx(Text, { color, children: content }) : content
|
|
23
|
+
}
|
|
24
|
+
) : void 0;
|
|
25
|
+
return jsxs(Box, { alignItems: "center", flexDirection, children: [
|
|
26
|
+
orderFirst ? tooltip : void 0,
|
|
27
|
+
jsx(Box, { children }),
|
|
28
|
+
orderFirst ? void 0 : tooltip
|
|
29
|
+
] });
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export { Tooltip as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { useContext } from 'react';
|
|
3
|
-
import { a as accessibilityContext } from './
|
|
3
|
+
import { a as accessibilityContext } from './accessibility-context-BLelHhNU.js';
|
|
4
4
|
|
|
5
5
|
const TRANSFORM_STYLE = { flexDirection: "row", flexGrow: 0, flexShrink: 1 };
|
|
6
6
|
function Transform({ accessibilityLabel, children, transform }) {
|