@visulima/tui 1.0.0-alpha.6 → 1.0.0-alpha.8
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 +21 -0
- package/dist/core/index.js +1 -5
- package/dist/ink/index.d.ts +15 -34
- package/dist/ink/index.js +1 -155
- package/dist/packem_chunks/devtools.js +3 -26
- package/dist/packem_shared/Accordion-BXsqchV-.js +1 -0
- package/dist/packem_shared/Alert-BhYVMHtR.js +1 -0
- package/dist/packem_shared/AnimatePresence-Eu7Z8KHc.js +1 -0
- package/dist/packem_shared/ApprovalPrompt-BSn0FT1g.js +1 -0
- package/dist/packem_shared/AreaChart-Chy-frI7.js +1 -0
- package/dist/packem_shared/Badge-B8WPyRsK.js +1 -0
- package/dist/packem_shared/BarChart-rpZtlMcF.js +1 -0
- package/dist/packem_shared/BigText-CRpwUzrt.js +1 -0
- package/dist/packem_shared/BlinkDot-BvnRuWP8.js +1 -0
- package/dist/packem_shared/Box-BwqSvWuq.js +1 -0
- package/dist/packem_shared/Breadcrumb-D0hClbRV.js +1 -0
- package/dist/packem_shared/Button-B89Yvbc6.js +1 -0
- package/dist/packem_shared/COLOR_BLINDNESS_SIMULATION-DqErf7XX.js +1 -0
- package/dist/packem_shared/Calendar-Dmflvm2S.js +1 -0
- package/dist/packem_shared/Canvas-CKg6WV47.js +1 -0
- package/dist/packem_shared/Card-B_9fXdtU.js +1 -0
- package/dist/packem_shared/Cell-BrXn3jxY.js +1 -0
- package/dist/packem_shared/Checkbox-BN71eCWU.js +1 -0
- package/dist/packem_shared/Code-HhevcyiH.js +2 -0
- package/dist/packem_shared/Collapsible-u6uf_FdV.js +1 -0
- package/dist/packem_shared/CommandBlock-B-nslpCv.js +4 -0
- package/dist/packem_shared/CommandPalette-CEFdaURo.js +1 -0
- package/dist/packem_shared/ConfirmDialog-5Jje_Xpu.js +1 -0
- package/dist/packem_shared/ConfirmInput-D44Mb9oo.js +1 -0
- package/dist/packem_shared/ConsoleOverlay-CM3APfgP.js +1 -0
- package/dist/packem_shared/ContentSwitcher-Dm5BkrCt.js +1 -0
- package/dist/packem_shared/ControlledScrollView-DI8KZOQB.js +1 -0
- package/dist/packem_shared/Cursor-BoLFIMol.js +1 -0
- package/dist/packem_shared/DatePicker-CnSrFFAE.js +1 -0
- package/dist/packem_shared/DefinitionList-v8RDuF_R.js +1 -0
- package/dist/packem_shared/DevTools-O8EbCfHa.js +1 -0
- package/dist/packem_shared/Dialog-CTaL8pn0.js +1 -0
- package/dist/packem_shared/DiffView-BUIFqUB0.js +1 -0
- package/dist/packem_shared/Divider-C47bKmqu.js +1 -0
- package/dist/packem_shared/FilePicker-CUo7R5Qb.js +1 -0
- package/dist/packem_shared/FocusContext-Xy0cwJpO.js +1 -0
- package/dist/packem_shared/FormField-af3aUpRL.js +1 -0
- package/dist/packem_shared/Fullscreen-CuJ8y0s0.js +1 -0
- package/dist/packem_shared/Gauge-Dz-usH__.js +1 -0
- package/dist/packem_shared/Gradient-DYNc0GZA.js +1 -0
- package/dist/packem_shared/Heading-mwEYza3Y.js +1 -0
- package/dist/packem_shared/Heatmap-ChL97U1-.js +1 -0
- package/dist/packem_shared/Help-Zcelyw_U.js +1 -0
- package/dist/packem_shared/Histogram-FIf2F83d.js +1 -0
- package/dist/packem_shared/IMECompositionBuffer-C89PhiOu.js +1 -0
- package/dist/packem_shared/InputParser-rZKjY_7Y.js +2 -0
- package/dist/packem_shared/KEY-Bk8B-3h_.js +1 -0
- package/dist/packem_shared/Kbd-DpkPp4jB.js +1 -0
- package/dist/packem_shared/LayoutNode-rxblE317.js +1 -0
- package/dist/packem_shared/LineChart-BXE_girm.js +1 -0
- package/dist/packem_shared/Link-i2o2EG4-.js +1 -0
- package/dist/packem_shared/LoadingIndicator-TC1Fjwyt.js +1 -0
- package/dist/packem_shared/Markdown-R1XqK63D.js +1 -0
- package/dist/packem_shared/MaskedInput-J01phOZs.js +1 -0
- package/dist/packem_shared/Menu-CfrH4ymk.js +1 -0
- package/dist/packem_shared/MessageBubble-BmBBU2Rm.js +1 -0
- package/dist/packem_shared/ModelBadge-D3wrXncu.js +1 -0
- package/dist/packem_shared/MouseProvider-pjza-lpc.js +1 -0
- package/dist/packem_shared/MultiSelect-Dqmn-bVo.js +1 -0
- package/dist/packem_shared/NAMED_COLORS-B9fJsYdg.js +1 -0
- package/dist/packem_shared/Newline-BSG4iUqp.js +2 -0
- package/dist/packem_shared/OperationTree-DksxjMIV.js +1 -0
- package/dist/packem_shared/OptionList-CNx7r9yN.js +1 -0
- package/dist/packem_shared/OrderedList-BeDy035w.js +1 -0
- package/dist/packem_shared/Paginator-B56s6bhS.js +1 -0
- package/dist/packem_shared/Paragraph-BqJlH0R-.js +1 -0
- package/dist/packem_shared/Placeholder-GMpHRGC8.js +1 -0
- package/dist/packem_shared/ProgressBar-Bj3fmORR.js +1 -0
- package/dist/packem_shared/RadioGroup-Br8BeEwS.js +1 -0
- package/dist/packem_shared/Renderer-DJXooAsp.js +1 -0
- package/dist/packem_shared/ResizeObserverEntry-Dq0dk8Kq.js +1 -0
- package/dist/packem_shared/ScatterPlot-OhfYco5l.js +1 -0
- package/dist/packem_shared/ScrollBar-Da5Y3z7N.js +1 -0
- package/dist/packem_shared/ScrollBarBox-Dz6F-Eat.js +1 -0
- package/dist/packem_shared/ScrollList-DiVGyEjv.js +1 -0
- package/dist/packem_shared/ScrollView-BojONotI.js +1 -0
- package/dist/packem_shared/SearchInput-BoPTRbhV.js +1 -0
- package/dist/packem_shared/SelectInput-CAJ7SCBq.js +1 -0
- package/dist/packem_shared/SelectInputIndicator-N1n8ULHs.js +1 -0
- package/dist/packem_shared/SelectInputItem-BEkbmobs.js +1 -0
- package/dist/packem_shared/ShimmerText-CuGQ2NDC.js +1 -0
- package/dist/packem_shared/Slider-Cg_tJpKa.js +1 -0
- package/dist/packem_shared/Spacer-eT3HOrXk.js +1 -0
- package/dist/packem_shared/Sparkline-T6_FPVET.js +1 -0
- package/dist/packem_shared/Spinner-B0-A50pu.js +1 -0
- package/dist/packem_shared/Static-DLynr5pn.js +1 -0
- package/dist/packem_shared/Static-jzLPaHJF.js +1 -0
- package/dist/packem_shared/StaticRender-BgD61E7x.js +1 -0
- package/dist/packem_shared/StatusLine-Ch4jjef1.js +1 -0
- package/dist/packem_shared/StatusMessage-B1qfKeMM.js +1 -0
- package/dist/packem_shared/Stepper-CNPAqxiU.js +1 -0
- package/dist/packem_shared/Stopwatch-CAx2EWwq.js +1 -0
- package/dist/packem_shared/StreamingText-BYOKSB2T.js +1 -0
- package/dist/packem_shared/Switch-DzSpKYu7.js +1 -0
- package/dist/packem_shared/Tab-BcXzSUdj.js +1 -0
- package/dist/packem_shared/Table-DJp1TLrR.js +1 -0
- package/dist/packem_shared/Tabs-D68z0SOt.js +1 -0
- package/dist/packem_shared/Tag-BvLHnYRn.js +1 -0
- package/dist/packem_shared/Text-mTAve9R2.js +1 -0
- package/dist/packem_shared/TextInput-C_gYQlnF.js +1 -0
- package/dist/packem_shared/Textarea-C2ET_oMb.js +2 -0
- package/dist/packem_shared/Timer-CI3aQX65.js +1 -0
- package/dist/packem_shared/Toast-Drvc8XfG.js +1 -0
- package/dist/packem_shared/Tooltip-C5UnQlLd.js +1 -0
- package/dist/packem_shared/Transform-fYmcdqRT.js +1 -0
- package/dist/packem_shared/Transition-CJDBKYUB.js +1 -0
- package/dist/packem_shared/TreeNodeMap-CspqSCpb.js +1 -0
- package/dist/packem_shared/TreeView-DjhacGJ5.js +1 -0
- package/dist/packem_shared/TuiApp-DrjI_i-R.js +1 -0
- package/dist/packem_shared/TuiContext-BoJvG3NN.js +3 -0
- package/dist/packem_shared/UnorderedList-BnfqexZs.js +1 -0
- package/dist/packem_shared/accessibility-context-DDyHTwmA.js +1 -0
- package/dist/packem_shared/animation-context-DW3p-vpk.js +1 -0
- package/dist/packem_shared/ansi-parser-B6uXaq65.js +1 -0
- package/dist/packem_shared/ansi-tokenizer-DqX9nJuk.js +1 -0
- package/dist/packem_shared/app-context-BVpKlG1z.js +1 -0
- package/dist/packem_shared/background-context-rjOaWFki.js +1 -0
- package/dist/packem_shared/boxes-DyY_LXCi.js +1 -0
- package/dist/packem_shared/braille-BBjIoaN0.js +1 -0
- package/dist/packem_shared/colorize-DbTZMrJO.js +1 -0
- package/dist/packem_shared/comparePoints-C85EsmNz.js +1 -0
- package/dist/packem_shared/controlled-scroll-view-CmrAEvJk.js +1 -0
- package/dist/packem_shared/createInlineLoop-DRNZ7jqH.js +2 -0
- package/dist/packem_shared/createLinkedScrollGroup-BMTJ7rAj.js +1 -0
- package/dist/packem_shared/createMemoryStorage-QVZNXbWz.js +2 -0
- package/dist/packem_shared/createScreen-CrLrxA6t.js +3 -0
- package/dist/packem_shared/cursor-context-CFviBqPX.js +1 -0
- package/dist/packem_shared/dom-4y__5fWB.js +1 -0
- package/dist/packem_shared/focus-context-CsT69klR.js +1 -0
- package/dist/packem_shared/format-time-C7Q-hQZq.js +1 -0
- package/dist/packem_shared/getPathToRoot-B2tKmx3i.js +1 -0
- package/dist/packem_shared/getScrollHeight-BTEY8ewu.js +1 -0
- package/dist/packem_shared/input-utils-fAxzSlNh.js +1 -0
- package/dist/packem_shared/isIntersecting-B3KbKTmu.js +1 -0
- package/dist/packem_shared/isOsc52Supported-DKK7Uee6.js +1 -0
- package/dist/packem_shared/isTerminalPaletteQuerySupported-Dn2hFAZ_.js +1 -0
- package/dist/packem_shared/kittyFlags-C3rZLbcK.js +1 -0
- package/dist/packem_shared/line-chart-DrM8PwnI.js +1 -0
- package/dist/packem_shared/measure-element-DSp7YDus.js +2 -0
- package/dist/packem_shared/measure-text-DDjHT1jD.js +3 -0
- package/dist/packem_shared/measureElement-DA8WqFP_.js +1 -0
- package/dist/packem_shared/mouse-context-DaARgUu1.js +1 -0
- package/dist/packem_shared/parseSgrMouse-Ccj70ijb.js +1 -0
- package/dist/packem_shared/processLayout-DXDfFb_d.js +1 -0
- package/dist/packem_shared/reconciler-BuOP-TZ6.js +1 -0
- package/dist/packem_shared/reconciler-DSYCrIZs.js +1 -0
- package/dist/packem_shared/render-DDqtMAFN.js +1 -0
- package/dist/packem_shared/render-_r0K9K11.js +28 -0
- package/dist/packem_shared/renderToString-DeqOWRP8.js +4 -0
- package/dist/packem_shared/renderToString-IYYPyASm.js +2 -0
- package/dist/packem_shared/renderTreeToBuffer-DPkoCgP2.js +2 -0
- package/dist/packem_shared/renderer-D2p6av2X.js +17 -0
- package/dist/packem_shared/setEnableStyledLineCache-D2gZbwFM.js +1 -0
- package/dist/packem_shared/squashTextNodesWithMap-Cpqmc45i.js +1 -0
- package/dist/packem_shared/stderr-context-BzEaUICS.js +1 -0
- package/dist/packem_shared/stdin-context-BTaaFagk.js +1 -0
- package/dist/packem_shared/stdout-context-BnblEPez.js +1 -0
- package/dist/packem_shared/text-width-CZ9vPvM0.js +2 -0
- package/dist/packem_shared/token-to-elements-BYxT6J_Q.js +1 -0
- package/dist/packem_shared/treeViewTheme-1RIZyB4M.js +1 -0
- package/dist/packem_shared/useAnimation-B9we6ZzL.js +1 -0
- package/dist/packem_shared/useApp-B6fvM42d.js +1 -0
- package/dist/packem_shared/useBoxMetrics-D5pkIr6P.js +1 -0
- package/dist/packem_shared/useClipboard-CBxy0hT8.js +1 -0
- package/dist/packem_shared/useColorBlindness-BvWcu2Bb.js +1 -0
- package/dist/packem_shared/useConsoleCapture-BxiG8iLJ.js +1 -0
- package/dist/packem_shared/useCursor-CPu8T5Db.js +1 -0
- package/dist/packem_shared/useElementDimensions-qJ_WXFZ9.js +1 -0
- package/dist/packem_shared/useFocus-DSmziO_x.js +1 -0
- package/dist/packem_shared/useFocusManager-Uapn3LQo.js +1 -0
- package/dist/packem_shared/useForm-CzV-Oext.js +1 -0
- package/dist/packem_shared/useHotkey-D0dGey14.js +1 -0
- package/dist/packem_shared/useInput-D1_jG26Z.js +2 -0
- package/dist/packem_shared/useInterval-AobjZT3u.js +1 -0
- package/dist/packem_shared/useIsScreenReaderEnabled-DjWHh-II.js +1 -0
- package/dist/packem_shared/useKeyBindings-zabkEJQs.js +1 -0
- package/dist/packem_shared/useKeyChord-CICQIxXj.js +1 -0
- package/dist/packem_shared/useMouseAction-2dRfU1vE.js +1 -0
- package/dist/packem_shared/useMouseContext-C746G7kY.js +1 -0
- package/dist/packem_shared/useMousePosition-BTWfV4JK.js +1 -0
- package/dist/packem_shared/useOnMouseClick-nY8xLZmt.js +1 -0
- package/dist/packem_shared/useOnMouseHover-D3DczIol.js +1 -0
- package/dist/packem_shared/useOnMouseState-cRK8QvzD.js +1 -0
- package/dist/packem_shared/usePaste-CKKB9H-Z.js +1 -0
- package/dist/packem_shared/useScrollAcceleration-NrY1oVMs.js +1 -0
- package/dist/packem_shared/useScrollInput-Caghtn-Q.js +1 -0
- package/dist/packem_shared/useStderr-BDZb6InG.js +1 -0
- package/dist/packem_shared/useStdin-DKa4h35k.js +1 -0
- package/dist/packem_shared/useStdout-B-2lX4C5.js +1 -0
- package/dist/packem_shared/useStopwatch-DffK7iMh.js +1 -0
- package/dist/packem_shared/useTerminalPalette-Cv7tSduR.js +1 -0
- package/dist/packem_shared/useTextBuffer-DekkGLxI.js +4 -0
- package/dist/packem_shared/useTextSelection-CGT0GLDR.js +1 -0
- package/dist/packem_shared/useTimeout-7LEFYTnG.js +1 -0
- package/dist/packem_shared/useTimer-DyoqSyGi.js +1 -0
- package/dist/packem_shared/useTreeView-8UlTK6sW.js +1 -0
- package/dist/packem_shared/useTreeViewState-CRPCUWrb.js +1 -0
- package/dist/packem_shared/useWindowSize-yDZsXF8z.js +1 -0
- package/dist/packem_shared/utils-THUhYKG2.js +1 -0
- package/dist/packem_shared/variant-config-BJqpNo7H.js +1 -0
- package/dist/packem_shared/waitFor-Dj5zfL5s.js +4 -0
- package/dist/packem_shared/wrapOrTruncateStyledLine-BZ00SM8i.js +3 -0
- package/dist/react/index.js +1 -9
- package/dist/testing/index.js +1 -152
- package/package.json +9 -9
- package/dist/packem_shared/Accordion-BG-yfIkV.js +0 -80
- package/dist/packem_shared/Alert-BLcwIW8V.js +0 -17
- package/dist/packem_shared/AnimatePresence-D8nEOr_B.js +0 -98
- package/dist/packem_shared/ApprovalPrompt-BXdPros1.js +0 -104
- package/dist/packem_shared/AreaChart-CmTcxLum.js +0 -116
- package/dist/packem_shared/Badge-CUfbXwAB.js +0 -13
- package/dist/packem_shared/BarChart-DWRae67P.js +0 -87
- package/dist/packem_shared/BigText-CVq2X7B5.js +0 -24
- package/dist/packem_shared/BlinkDot-CrbHMR3L.js +0 -11
- package/dist/packem_shared/Box-W1w_NGin.js +0 -71
- package/dist/packem_shared/Breadcrumb-CPdNxVYs.js +0 -26
- package/dist/packem_shared/Button-CBmTbJ_D.js +0 -57
- package/dist/packem_shared/COLOR_BLINDNESS_SIMULATION-BsMy5Ewl.js +0 -81
- package/dist/packem_shared/Calendar-C2Qxt-LA.js +0 -139
- package/dist/packem_shared/Canvas-COttmLPX.js +0 -246
- package/dist/packem_shared/Card-D3tGkNCm.js +0 -24
- package/dist/packem_shared/Cell-DCg1kJY-.js +0 -48
- package/dist/packem_shared/Checkbox-Dpy_4Lws.js +0 -49
- package/dist/packem_shared/Code-CwzzbsLx.js +0 -53
- package/dist/packem_shared/Collapsible-BMDrXf5C.js +0 -45
- package/dist/packem_shared/CommandBlock-jdOGJPjY.js +0 -80
- package/dist/packem_shared/CommandPalette-B5IfUQwi.js +0 -146
- package/dist/packem_shared/ConfirmDialog-5XJv3Cc4.js +0 -67
- package/dist/packem_shared/ConfirmInput-CxUS0XAA.js +0 -44
- package/dist/packem_shared/ConsoleOverlay-BvnCEgjG.js +0 -57
- package/dist/packem_shared/ContentSwitcher-BHFpO5Za.js +0 -81
- package/dist/packem_shared/ControlledScrollView-C2wOOlJO.js +0 -5
- package/dist/packem_shared/Cursor-DiW7YoSK.js +0 -18
- package/dist/packem_shared/DatePicker-CPejKoqS.js +0 -73
- package/dist/packem_shared/DefinitionList-BAwr0l5J.js +0 -18
- package/dist/packem_shared/DevTools-BdxRSkhL.js +0 -63
- package/dist/packem_shared/Dialog-S9r7Izff.js +0 -71
- package/dist/packem_shared/DiffView-BR4T6-Sj.js +0 -329
- package/dist/packem_shared/Divider-DocXIqNn.js +0 -30
- package/dist/packem_shared/FilePicker-BZ55oF_n.js +0 -261
- package/dist/packem_shared/FocusContext-D5wFxSRz.js +0 -153
- package/dist/packem_shared/FormField-BSG16cnA.js +0 -29
- package/dist/packem_shared/Fullscreen-DO7voOq5.js +0 -11
- package/dist/packem_shared/Gauge-CKXUXxft.js +0 -122
- package/dist/packem_shared/Gradient-Dg0NezWc.js +0 -136
- package/dist/packem_shared/Heading-BnR7McmP.js +0 -29
- package/dist/packem_shared/Heatmap-_jqISOU0.js +0 -79
- package/dist/packem_shared/Help-0yZ_IcQg.js +0 -105
- package/dist/packem_shared/Histogram-CB6XcmZW.js +0 -92
- package/dist/packem_shared/IMECompositionBuffer-Dl3S0KnF.js +0 -55
- package/dist/packem_shared/InputParser-BlsfeY9J.js +0 -158
- package/dist/packem_shared/KEY-STOdi-nc.js +0 -74
- package/dist/packem_shared/Kbd-BNDXQgey.js +0 -19
- package/dist/packem_shared/LayoutNode-DAkKg9TE.js +0 -129
- package/dist/packem_shared/LineChart-ef3HF816.js +0 -7
- package/dist/packem_shared/Link-DZ2Tiq1m.js +0 -66
- package/dist/packem_shared/LoadingIndicator-DzbLGfyJ.js +0 -13
- package/dist/packem_shared/Markdown-33bpCUoe.js +0 -212
- package/dist/packem_shared/MaskedInput-Ctr6v2dO.js +0 -119
- package/dist/packem_shared/Menu-CeKxhEix.js +0 -112
- package/dist/packem_shared/MessageBubble-BMoU8L2Q.js +0 -26
- package/dist/packem_shared/ModelBadge-CNIxPs7v.js +0 -40
- package/dist/packem_shared/MouseProvider-CekPbXCh.js +0 -136
- package/dist/packem_shared/MultiSelect-yz7-w0Zv.js +0 -129
- package/dist/packem_shared/NAMED_COLORS-DcI3erCu.js +0 -300
- package/dist/packem_shared/Newline-DBtYEg8x.js +0 -7
- package/dist/packem_shared/OperationTree-Dudx5o1o.js +0 -67
- package/dist/packem_shared/OptionList-CTyqQaZ1.js +0 -24
- package/dist/packem_shared/OrderedList-VsvSmHUC.js +0 -26
- package/dist/packem_shared/Paginator-DmGogvEI.js +0 -104
- package/dist/packem_shared/Paragraph-CNNhfepo.js +0 -9
- package/dist/packem_shared/Placeholder-DkM69Q8Z.js +0 -29
- package/dist/packem_shared/ProgressBar-B7cS4uQm.js +0 -22
- package/dist/packem_shared/RadioGroup-B4F9PUyL.js +0 -108
- package/dist/packem_shared/Renderer-zZ5O3vxc.js +0 -31
- package/dist/packem_shared/ResizeObserverEntry-Vr8GZ74x.js +0 -102
- package/dist/packem_shared/ScatterPlot-CWOg4G5h.js +0 -63
- package/dist/packem_shared/ScrollBar-DFeWH43I.js +0 -106
- package/dist/packem_shared/ScrollBarBox-C7VL6Izd.js +0 -72
- package/dist/packem_shared/ScrollList-DRcr_RrN.js +0 -227
- package/dist/packem_shared/ScrollView-C6rdlGwU.js +0 -196
- package/dist/packem_shared/SearchInput-cB8zFhSg.js +0 -32
- package/dist/packem_shared/SelectInput-WzZSqp72.js +0 -260
- package/dist/packem_shared/SelectInputIndicator-DKeN6v5Z.js +0 -9
- package/dist/packem_shared/SelectInputItem-CxFL3spM.js +0 -8
- package/dist/packem_shared/ShimmerText-B2VbPUSB.js +0 -34
- package/dist/packem_shared/Slider-BOrNTOQe.js +0 -116
- package/dist/packem_shared/Spacer-DhmXyTb8.js +0 -8
- package/dist/packem_shared/Sparkline-BSbjPrwK.js +0 -44
- package/dist/packem_shared/Spinner-BcO5BCAa.js +0 -1942
- package/dist/packem_shared/Static-DpTd6Eed.js +0 -22
- package/dist/packem_shared/Static-xmD9giJj.js +0 -18
- package/dist/packem_shared/StaticRender-C3XWvJdC.js +0 -69
- package/dist/packem_shared/StatusLine-DQNUstN9.js +0 -22
- package/dist/packem_shared/StatusMessage-BYTL6Pl-.js +0 -14
- package/dist/packem_shared/Stepper-CmUPRK3z.js +0 -60
- package/dist/packem_shared/Stopwatch-zqLQAxXC.js +0 -21
- package/dist/packem_shared/StreamingText-BmuoJtGu.js +0 -38
- package/dist/packem_shared/Switch-DcPdy8nm.js +0 -59
- package/dist/packem_shared/Tab-C6r5q4hR.js +0 -7
- package/dist/packem_shared/Table-Bgxo87Df.js +0 -88
- package/dist/packem_shared/Tabs-DubuHdYV.js +0 -164
- package/dist/packem_shared/Tag-CCqM7Ee9.js +0 -35
- package/dist/packem_shared/Text-CtUwV89_.js +0 -65
- package/dist/packem_shared/TextInput-C9r7zT0U.js +0 -137
- package/dist/packem_shared/Textarea-CGmgt-Nl.js +0 -272
- package/dist/packem_shared/Timer-D7ZZ0_wz.js +0 -20
- package/dist/packem_shared/Toast-DXSCXFPY.js +0 -37
- package/dist/packem_shared/Tooltip-SvVjj-2k.js +0 -32
- package/dist/packem_shared/Transform-Cfyva2wd.js +0 -14
- package/dist/packem_shared/Transition-CbNfKhaj.js +0 -108
- package/dist/packem_shared/TreeNodeMap-CtJUvBnd.js +0 -155
- package/dist/packem_shared/TreeView-DGlZeSsK.js +0 -148
- package/dist/packem_shared/TuiApp-DtdgNRWa.js +0 -122
- package/dist/packem_shared/TuiContext-lXmJFd-x.js +0 -418
- package/dist/packem_shared/UnorderedList-D8RPaEAW.js +0 -33
- package/dist/packem_shared/accessibility-context-BLelHhNU.js +0 -7
- package/dist/packem_shared/animation-context-BcJg8Jr6.js +0 -15
- package/dist/packem_shared/ansi-parser-BOP8fNdT.js +0 -43
- package/dist/packem_shared/ansi-tokenizer-LHq2LUWA.js +0 -307
- package/dist/packem_shared/app-context-CP0U6H7O.js +0 -11
- package/dist/packem_shared/background-context-BAUaxfOb.js +0 -5
- package/dist/packem_shared/boxes-oi3WUbyR.js +0 -92
- package/dist/packem_shared/braille-BoEWoH2I.js +0 -93
- package/dist/packem_shared/colorize-88_Vk8cn.js +0 -48
- package/dist/packem_shared/comparePoints-CAAlhiMS.js +0 -287
- package/dist/packem_shared/controlled-scroll-view-DJXfdWMm.js +0 -286
- package/dist/packem_shared/createInlineLoop-Dnfm1ZSJ.js +0 -99
- package/dist/packem_shared/createLinkedScrollGroup-Djw4Ceo0.js +0 -44
- package/dist/packem_shared/createMemoryStorage-esFJ61La.js +0 -115
- package/dist/packem_shared/createScreen-Dh0sZlQ0.js +0 -38
- package/dist/packem_shared/cursor-context-JxRzlqAx.js +0 -9
- package/dist/packem_shared/dom-CrbpQgat.js +0 -228
- package/dist/packem_shared/focus-context-CWkYtgcm.js +0 -26
- package/dist/packem_shared/format-time-BGmnDukX.js +0 -12
- package/dist/packem_shared/getPathToRoot-BbvlppLC.js +0 -4
- package/dist/packem_shared/getScrollHeight-Cz3CDQN2.js +0 -63
- package/dist/packem_shared/input-utils-ViAEXa0Z.js +0 -19
- package/dist/packem_shared/isIntersecting-fEXHJN5R.js +0 -10
- package/dist/packem_shared/isOsc52Supported-G0k4sXJx.js +0 -36
- package/dist/packem_shared/isTerminalPaletteQuerySupported-EeiwMKbr.js +0 -93
- package/dist/packem_shared/kittyFlags-bNNf_9kX.js +0 -26
- package/dist/packem_shared/line-chart-VGU2l7pu.js +0 -139
- package/dist/packem_shared/measure-element-Bc6PEaIe.js +0 -405
- package/dist/packem_shared/measure-text-BdOhbOeh.js +0 -1256
- package/dist/packem_shared/measureElement-DTELRaij.js +0 -4
- package/dist/packem_shared/mouse-context-BUHWKEIe.js +0 -6
- package/dist/packem_shared/parseSgrMouse-4hpBJBsW.js +0 -1
- package/dist/packem_shared/processLayout-B0Coz0Ua.js +0 -2
- package/dist/packem_shared/reconciler-Dd7Z0A97.js +0 -696
- package/dist/packem_shared/reconciler-mzMwSOft.js +0 -221
- package/dist/packem_shared/render-Bm9Oa1sG.js +0 -2799
- package/dist/packem_shared/render-CjlKdg4m.js +0 -199
- package/dist/packem_shared/renderToString-CWYS1ZXE.js +0 -86
- package/dist/packem_shared/renderToString-DB3ILWFm.js +0 -62
- package/dist/packem_shared/renderTreeToBuffer-CDDTGyZn.js +0 -311
- package/dist/packem_shared/renderer-GE9OLNNM.js +0 -1437
- package/dist/packem_shared/setEnableStyledLineCache-D5f4favX.js +0 -2
- package/dist/packem_shared/squashTextNodesWithMap-iqm6OMMT.js +0 -100
- package/dist/packem_shared/stderr-context-Bj4Mf7v7.js +0 -17
- package/dist/packem_shared/stdin-context-Bq_GNJ3z.js +0 -38
- package/dist/packem_shared/stdout-context-CgjWeCdO.js +0 -17
- package/dist/packem_shared/text-width-Db-AxMea.js +0 -43
- package/dist/packem_shared/token-to-elements-CK4s8MJd.js +0 -249
- package/dist/packem_shared/treeViewTheme-BpSw9TMf.js +0 -52
- package/dist/packem_shared/useAnimation-DV22qxiJ.js +0 -62
- package/dist/packem_shared/useApp-Cbi788rV.js +0 -6
- package/dist/packem_shared/useBoxMetrics-_5icypir.js +0 -54
- package/dist/packem_shared/useClipboard-MNj6MNR-.js +0 -23
- package/dist/packem_shared/useColorBlindness-D_sTIhcb.js +0 -30
- package/dist/packem_shared/useConsoleCapture-Dvt7G1W1.js +0 -61
- package/dist/packem_shared/useCursor-DS6LjIgv.js +0 -19
- package/dist/packem_shared/useElementDimensions-CAoKitVD.js +0 -67
- package/dist/packem_shared/useFocus-DLoGQJd9.js +0 -37
- package/dist/packem_shared/useFocusManager-UeZWtnNc.js +0 -16
- package/dist/packem_shared/useForm-sQENbEuv.js +0 -88
- package/dist/packem_shared/useHotkey-D9giUX3q.js +0 -112
- package/dist/packem_shared/useInput-DKZbqMRc.js +0 -594
- package/dist/packem_shared/useInterval-CSXM8c2I.js +0 -32
- package/dist/packem_shared/useIsScreenReaderEnabled-BeoVqo1R.js +0 -9
- package/dist/packem_shared/useKeyBindings-S4fSIEAk.js +0 -66
- package/dist/packem_shared/useKeyChord-BmXGNuEO.js +0 -114
- package/dist/packem_shared/useMouseAction-C5gZ2nj7.js +0 -29
- package/dist/packem_shared/useMouseContext-D-rFy60Q.js +0 -12
- package/dist/packem_shared/useMousePosition-BHBJ-kBk.js +0 -25
- package/dist/packem_shared/useOnMouseClick--ZIyBOBO.js +0 -35
- package/dist/packem_shared/useOnMouseHover-26diuXUC.js +0 -32
- package/dist/packem_shared/useOnMouseState-NO_Kda_C.js +0 -13
- package/dist/packem_shared/usePaste-png73gvT.js +0 -35
- package/dist/packem_shared/useScrollAcceleration-R9LfrPVG.js +0 -73
- package/dist/packem_shared/useScrollInput-DfzRGQFe.js +0 -72
- package/dist/packem_shared/useStderr-BSWerMZ7.js +0 -6
- package/dist/packem_shared/useStdin-Rf0zPzVA.js +0 -7
- package/dist/packem_shared/useStdout-B5yRcg9N.js +0 -6
- package/dist/packem_shared/useStopwatch-C__Zu6hd.js +0 -33
- package/dist/packem_shared/useTerminalPalette-CtFG2JTq.js +0 -38
- package/dist/packem_shared/useTextBuffer-C8fEe9Ly.js +0 -398
- package/dist/packem_shared/useTextSelection-ChrYZXsn.js +0 -50
- package/dist/packem_shared/useTimeout-DuCqgWPX.js +0 -34
- package/dist/packem_shared/useTimer-DnBtbhB5.js +0 -46
- package/dist/packem_shared/useTreeView-mkN5Di7w.js +0 -101
- package/dist/packem_shared/useTreeViewState-BpS_KZ-K.js +0 -502
- package/dist/packem_shared/useWindowSize-D3UU41mv.js +0 -20
- package/dist/packem_shared/utils-BgdlrbOH.js +0 -140
- package/dist/packem_shared/variant-config-DSZoX5TM.js +0 -8
- package/dist/packem_shared/waitFor-Cv9M2jKA.js +0 -39
- package/dist/packem_shared/wrapOrTruncateStyledLine-49Mne3t3.js +0 -147
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { useState, useMemo, useLayoutEffect } from 'react';
|
|
3
|
-
|
|
4
|
-
function Static(props) {
|
|
5
|
-
const { children: render, items, style: customStyle } = props;
|
|
6
|
-
const [index, setIndex] = useState(0);
|
|
7
|
-
const itemsToRender = useMemo(() => items.slice(index), [items, index]);
|
|
8
|
-
useLayoutEffect(() => {
|
|
9
|
-
setIndex(items.length);
|
|
10
|
-
}, [items.length]);
|
|
11
|
-
const children = itemsToRender.map((item, itemIndex) => render(item, index + itemIndex));
|
|
12
|
-
const style = useMemo(() => {
|
|
13
|
-
return {
|
|
14
|
-
flexDirection: "column",
|
|
15
|
-
position: "absolute",
|
|
16
|
-
...customStyle
|
|
17
|
-
};
|
|
18
|
-
}, [customStyle]);
|
|
19
|
-
return jsx("ink-box", { internal_static: true, style, children });
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export { Static as default };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React, { useRef, useMemo } from 'react';
|
|
2
|
-
|
|
3
|
-
function Static({ children: renderItem, items, style }) {
|
|
4
|
-
const committedRef = useRef([]);
|
|
5
|
-
const lastIndexRef = useRef(0);
|
|
6
|
-
if (items.length > lastIndexRef.current) {
|
|
7
|
-
for (let i = lastIndexRef.current; i < items.length; i++) {
|
|
8
|
-
committedRef.current.push(renderItem(items[i], i));
|
|
9
|
-
}
|
|
10
|
-
lastIndexRef.current = items.length;
|
|
11
|
-
}
|
|
12
|
-
const containerStyle = useMemo(() => {
|
|
13
|
-
return { flexDirection: "column", ...style };
|
|
14
|
-
}, [style]);
|
|
15
|
-
return React.createElement("box", containerStyle, ...committedRef.current);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export { Static };
|
|
@@ -1,69 +0,0 @@
|
|
|
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 };
|
|
@@ -1,22 +0,0 @@
|
|
|
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,14 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import Box from './Box-W1w_NGin.js';
|
|
3
|
-
import Text from './Text-CtUwV89_.js';
|
|
4
|
-
import { V as VARIANT_CONFIG } from './variant-config-DSZoX5TM.js';
|
|
5
|
-
|
|
6
|
-
function StatusMessage({ children, variant }) {
|
|
7
|
-
const { color, icon } = VARIANT_CONFIG[variant];
|
|
8
|
-
return jsxs(Box, { gap: 1, children: [
|
|
9
|
-
jsx(Text, { color, children: icon }),
|
|
10
|
-
jsx(Text, { children })
|
|
11
|
-
] });
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export { StatusMessage as default };
|
|
@@ -1,60 +0,0 @@
|
|
|
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 };
|
|
@@ -1,21 +0,0 @@
|
|
|
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 };
|
|
@@ -1,38 +0,0 @@
|
|
|
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 };
|
|
@@ -1,59 +0,0 @@
|
|
|
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 };
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { Table } from '@visulima/tabular';
|
|
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
|
-
import { useMemo } from 'react';
|
|
5
|
-
import Text from './Text-CtUwV89_.js';
|
|
6
|
-
|
|
7
|
-
const BORDER_PRESETS = {
|
|
8
|
-
ascii: ASCII_BORDER,
|
|
9
|
-
block: BLOCK_BORDER,
|
|
10
|
-
default: DEFAULT_BORDER,
|
|
11
|
-
dots: DOTS_BORDER,
|
|
12
|
-
double: DOUBLE_BORDER,
|
|
13
|
-
markdown: MARKDOWN_BORDER,
|
|
14
|
-
minimal: MINIMAL_BORDER,
|
|
15
|
-
none: NO_BORDER,
|
|
16
|
-
rounded: ROUNDED_BORDER,
|
|
17
|
-
thick: THICK_BORDER
|
|
18
|
-
};
|
|
19
|
-
const toColumnConfig = (col) => {
|
|
20
|
-
if (typeof col === "string") {
|
|
21
|
-
return { key: col };
|
|
22
|
-
}
|
|
23
|
-
return col;
|
|
24
|
-
};
|
|
25
|
-
const TableComponent = ({
|
|
26
|
-
borderStyle = "default",
|
|
27
|
-
columns: columnsProp,
|
|
28
|
-
data,
|
|
29
|
-
formatCell,
|
|
30
|
-
formatHeader,
|
|
31
|
-
maxWidth,
|
|
32
|
-
padding = 1,
|
|
33
|
-
showHeader = true,
|
|
34
|
-
skeleton = "",
|
|
35
|
-
wordWrap = false
|
|
36
|
-
}) => {
|
|
37
|
-
const tableString = useMemo(() => {
|
|
38
|
-
if (data.length === 0) {
|
|
39
|
-
return "";
|
|
40
|
-
}
|
|
41
|
-
let resolvedColumns;
|
|
42
|
-
if (columnsProp) {
|
|
43
|
-
resolvedColumns = columnsProp.map((col) => toColumnConfig(col));
|
|
44
|
-
} else {
|
|
45
|
-
resolvedColumns = Object.keys(data[0]).map((key) => {
|
|
46
|
-
return { key };
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
if (resolvedColumns.length === 0) {
|
|
50
|
-
return "";
|
|
51
|
-
}
|
|
52
|
-
const border = typeof borderStyle === "string" ? BORDER_PRESETS[borderStyle] ?? DEFAULT_BORDER : borderStyle;
|
|
53
|
-
const columnWidths = resolvedColumns.map((col) => col.width);
|
|
54
|
-
const hasFixedWidths = columnWidths.some((w) => w !== void 0);
|
|
55
|
-
const table = new Table({
|
|
56
|
-
columnWidths: hasFixedWidths ? columnWidths : void 0,
|
|
57
|
-
maxWidth,
|
|
58
|
-
showHeader,
|
|
59
|
-
style: {
|
|
60
|
-
border,
|
|
61
|
-
paddingLeft: padding,
|
|
62
|
-
paddingRight: padding
|
|
63
|
-
},
|
|
64
|
-
wordWrap
|
|
65
|
-
});
|
|
66
|
-
if (showHeader) {
|
|
67
|
-
const headers = resolvedColumns.map((col) => {
|
|
68
|
-
const label = col.header ?? col.key;
|
|
69
|
-
return formatHeader ? formatHeader(col.key) : label;
|
|
70
|
-
});
|
|
71
|
-
table.setHeaders(headers);
|
|
72
|
-
}
|
|
73
|
-
for (const [rowIndex, row] of data.entries()) {
|
|
74
|
-
const cells = resolvedColumns.map((col) => {
|
|
75
|
-
const value = row[col.key];
|
|
76
|
-
if (formatCell) {
|
|
77
|
-
return formatCell(value, col.key, rowIndex);
|
|
78
|
-
}
|
|
79
|
-
return value === void 0 || value === null ? skeleton : String(value);
|
|
80
|
-
});
|
|
81
|
-
table.addRow(cells);
|
|
82
|
-
}
|
|
83
|
-
return table.toString();
|
|
84
|
-
}, [borderStyle, columnsProp, data, formatCell, formatHeader, maxWidth, padding, showHeader, skeleton, wordWrap]);
|
|
85
|
-
return jsx(Text, { children: tableString });
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
export { TableComponent as default };
|
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
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
|
-
|
|
7
|
-
const NUMBER_KEY_PATTERN = /^\d$/u;
|
|
8
|
-
const isTabElement = (child) => child != null && typeof child === "object" && "props" in child && "name" in child.props;
|
|
9
|
-
const collectTabs = (children) => {
|
|
10
|
-
const result = [];
|
|
11
|
-
for (const child of Children.toArray(children)) {
|
|
12
|
-
if (isTabElement(child)) {
|
|
13
|
-
result.push(child);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
return result;
|
|
17
|
-
};
|
|
18
|
-
const matchesAnyKey = (keys, key) => keys.some((keyName) => key[keyName]);
|
|
19
|
-
const getActiveTabColors = (isActive, focused, colorsProp) => {
|
|
20
|
-
if (!isActive) {
|
|
21
|
-
return { backgroundColor: void 0, color: void 0 };
|
|
22
|
-
}
|
|
23
|
-
if (focused) {
|
|
24
|
-
return {
|
|
25
|
-
backgroundColor: colorsProp?.activeTab?.backgroundColor ?? "green",
|
|
26
|
-
color: colorsProp?.activeTab?.color ?? "black"
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
return { backgroundColor: "gray", color: "black" };
|
|
30
|
-
};
|
|
31
|
-
function Tabs({
|
|
32
|
-
children,
|
|
33
|
-
colors: colorsProp,
|
|
34
|
-
defaultValue,
|
|
35
|
-
flexDirection = "row",
|
|
36
|
-
isFocused,
|
|
37
|
-
keyMap: keyMapProp,
|
|
38
|
-
onChange,
|
|
39
|
-
showIndex = true,
|
|
40
|
-
value,
|
|
41
|
-
width
|
|
42
|
-
}) {
|
|
43
|
-
const tabs = collectTabs(children);
|
|
44
|
-
const tabCount = tabs.length;
|
|
45
|
-
const tabsRef = useRef(tabs);
|
|
46
|
-
tabsRef.current = tabs;
|
|
47
|
-
const isColumn = flexDirection === "column" || flexDirection === "column-reverse";
|
|
48
|
-
const isControlled = value !== void 0;
|
|
49
|
-
const [internalTab, setInternalTab] = useState(() => {
|
|
50
|
-
const initial = value ?? defaultValue;
|
|
51
|
-
if (initial == null || tabCount === 0) {
|
|
52
|
-
return 0;
|
|
53
|
-
}
|
|
54
|
-
const foundIndex = tabs.findIndex((tab) => tab.props.name === initial);
|
|
55
|
-
return foundIndex === -1 ? 0 : foundIndex;
|
|
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;
|
|
64
|
-
const onChangeRef = useRef(onChange);
|
|
65
|
-
onChangeRef.current = onChange;
|
|
66
|
-
useEffect(() => {
|
|
67
|
-
if (isControlled) {
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
const tab = tabsRef.current[activeTab];
|
|
71
|
-
if (tab) {
|
|
72
|
-
onChangeRef.current(tab.props.name, tab);
|
|
73
|
-
}
|
|
74
|
-
}, []);
|
|
75
|
-
const previousKeys = useMemo(() => keyMapProp?.previous ?? [isColumn ? "upArrow" : "leftArrow"], [keyMapProp?.previous, isColumn]);
|
|
76
|
-
const nextKeys = useMemo(() => keyMapProp?.next ?? [isColumn ? "downArrow" : "rightArrow"], [keyMapProp?.next, isColumn]);
|
|
77
|
-
const useNumbers = keyMapProp?.useNumbers ?? true;
|
|
78
|
-
const useTab = keyMapProp?.useTab ?? true;
|
|
79
|
-
const activeTabRef = useRef(activeTab);
|
|
80
|
-
activeTabRef.current = activeTab;
|
|
81
|
-
const handleTabChange = useCallback(
|
|
82
|
-
(index) => {
|
|
83
|
-
setActiveTab(index);
|
|
84
|
-
const tab = tabsRef.current[index];
|
|
85
|
-
if (tab) {
|
|
86
|
-
onChangeRef.current(tab.props.name, tab);
|
|
87
|
-
}
|
|
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]);
|
|
99
|
-
const moveToPrevious = useCallback(() => {
|
|
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]);
|
|
107
|
-
useInput(
|
|
108
|
-
useCallback(
|
|
109
|
-
(input, key) => {
|
|
110
|
-
if (matchesAnyKey(previousKeys, key)) {
|
|
111
|
-
moveToPrevious();
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
if (matchesAnyKey(nextKeys, key)) {
|
|
115
|
-
moveToNext();
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
if (key.tab && useTab && isFocused == null) {
|
|
119
|
-
if (key.shift) {
|
|
120
|
-
moveToPrevious();
|
|
121
|
-
} else {
|
|
122
|
-
moveToNext();
|
|
123
|
-
}
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
|
-
if (useNumbers && key.meta && NUMBER_KEY_PATTERN.test(input)) {
|
|
127
|
-
const tabIndex = input === "0" ? 9 : Number.parseInt(input, 10) - 1;
|
|
128
|
-
if (tabIndex < tabCount) {
|
|
129
|
-
handleTabChange(tabIndex);
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
},
|
|
133
|
-
[previousKeys, nextKeys, useTab, useNumbers, isFocused, moveToPrevious, moveToNext, tabCount, handleTabChange]
|
|
134
|
-
),
|
|
135
|
-
{ isActive: isFocused !== false }
|
|
136
|
-
);
|
|
137
|
-
const separatorWidth = typeof width === "number" ? width : 6;
|
|
138
|
-
const separator = useMemo(
|
|
139
|
-
// eslint-disable-next-line @stylistic/no-extra-parens
|
|
140
|
-
() => isColumn ? "─".repeat(separatorWidth) : " | ",
|
|
141
|
-
[isColumn, separatorWidth]
|
|
142
|
-
);
|
|
143
|
-
return jsx(Box, { flexDirection, width, children: tabs.map((child, index) => {
|
|
144
|
-
const { name } = child.props;
|
|
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
|
-
}
|
|
154
|
-
return jsxs(Box, { flexDirection, children: [
|
|
155
|
-
index !== 0 && jsx(Text, { color: "dim", children: separator }),
|
|
156
|
-
jsxs(Box, { children: [
|
|
157
|
-
indexLabel,
|
|
158
|
-
jsx(Text, { backgroundColor: textColors.backgroundColor, color: textColors.color, children: child })
|
|
159
|
-
] })
|
|
160
|
-
] }, name);
|
|
161
|
-
}) });
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
export { Tabs as default };
|
|
@@ -1,35 +0,0 @@
|
|
|
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 };
|