@theokit/ui 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1325 -0
- package/DESIGN.md +456 -0
- package/LICENSE +201 -0
- package/NOTICE +38 -0
- package/README.md +467 -0
- package/dist/chunk-27ENTTY7.js +146 -0
- package/dist/chunk-27ENTTY7.js.map +1 -0
- package/dist/chunk-2H6TQELG.js +33 -0
- package/dist/chunk-2H6TQELG.js.map +1 -0
- package/dist/chunk-2L6MRJD4.js +120 -0
- package/dist/chunk-2L6MRJD4.js.map +1 -0
- package/dist/chunk-2Y5V2PAL.js +80 -0
- package/dist/chunk-2Y5V2PAL.js.map +1 -0
- package/dist/chunk-34NAFDVL.js +46 -0
- package/dist/chunk-34NAFDVL.js.map +1 -0
- package/dist/chunk-36KJGXEK.js +112 -0
- package/dist/chunk-36KJGXEK.js.map +1 -0
- package/dist/chunk-3BMYYNN6.js +124 -0
- package/dist/chunk-3BMYYNN6.js.map +1 -0
- package/dist/chunk-3OHV7EEI.js +34 -0
- package/dist/chunk-3OHV7EEI.js.map +1 -0
- package/dist/chunk-3QKTS6F5.js +88 -0
- package/dist/chunk-3QKTS6F5.js.map +1 -0
- package/dist/chunk-3TBXLYNM.js +42 -0
- package/dist/chunk-3TBXLYNM.js.map +1 -0
- package/dist/chunk-4AM2HSXU.js +67 -0
- package/dist/chunk-4AM2HSXU.js.map +1 -0
- package/dist/chunk-4BCGKM65.js +44 -0
- package/dist/chunk-4BCGKM65.js.map +1 -0
- package/dist/chunk-4D3JILQX.js +145 -0
- package/dist/chunk-4D3JILQX.js.map +1 -0
- package/dist/chunk-4EJU2GBG.js +48 -0
- package/dist/chunk-4EJU2GBG.js.map +1 -0
- package/dist/chunk-4WKO3G5C.js +110 -0
- package/dist/chunk-4WKO3G5C.js.map +1 -0
- package/dist/chunk-53XPKI7Q.js +97 -0
- package/dist/chunk-53XPKI7Q.js.map +1 -0
- package/dist/chunk-55TDVDPG.js +58 -0
- package/dist/chunk-55TDVDPG.js.map +1 -0
- package/dist/chunk-56BJLFW7.js +26 -0
- package/dist/chunk-56BJLFW7.js.map +1 -0
- package/dist/chunk-5HOQLE6Y.js +35 -0
- package/dist/chunk-5HOQLE6Y.js.map +1 -0
- package/dist/chunk-5TY3NYF5.js +144 -0
- package/dist/chunk-5TY3NYF5.js.map +1 -0
- package/dist/chunk-5VOSCJKQ.js +92 -0
- package/dist/chunk-5VOSCJKQ.js.map +1 -0
- package/dist/chunk-65NVO6TK.js +171 -0
- package/dist/chunk-65NVO6TK.js.map +1 -0
- package/dist/chunk-6A5TPCKP.js +64 -0
- package/dist/chunk-6A5TPCKP.js.map +1 -0
- package/dist/chunk-6CO4LEXZ.js +41 -0
- package/dist/chunk-6CO4LEXZ.js.map +1 -0
- package/dist/chunk-6FVUPNPG.js +56 -0
- package/dist/chunk-6FVUPNPG.js.map +1 -0
- package/dist/chunk-76YWTIWK.js +106 -0
- package/dist/chunk-76YWTIWK.js.map +1 -0
- package/dist/chunk-7EI7424P.js +78 -0
- package/dist/chunk-7EI7424P.js.map +1 -0
- package/dist/chunk-AHTVYOPQ.js +26 -0
- package/dist/chunk-AHTVYOPQ.js.map +1 -0
- package/dist/chunk-AJTJNHKK.js +85 -0
- package/dist/chunk-AJTJNHKK.js.map +1 -0
- package/dist/chunk-AMT3CPMC.js +155 -0
- package/dist/chunk-AMT3CPMC.js.map +1 -0
- package/dist/chunk-AX5EH73R.js +59 -0
- package/dist/chunk-AX5EH73R.js.map +1 -0
- package/dist/chunk-B3VAJSZ2.js +35 -0
- package/dist/chunk-B3VAJSZ2.js.map +1 -0
- package/dist/chunk-B4CQMQ64.js +25 -0
- package/dist/chunk-B4CQMQ64.js.map +1 -0
- package/dist/chunk-BMRZXT5T.js +115 -0
- package/dist/chunk-BMRZXT5T.js.map +1 -0
- package/dist/chunk-BYZ6OFH4.js +73 -0
- package/dist/chunk-BYZ6OFH4.js.map +1 -0
- package/dist/chunk-C55VUQ7N.js +156 -0
- package/dist/chunk-C55VUQ7N.js.map +1 -0
- package/dist/chunk-D4GEAV4C.js +91 -0
- package/dist/chunk-D4GEAV4C.js.map +1 -0
- package/dist/chunk-DC43CHAM.js +152 -0
- package/dist/chunk-DC43CHAM.js.map +1 -0
- package/dist/chunk-DKCRLN35.js +92 -0
- package/dist/chunk-DKCRLN35.js.map +1 -0
- package/dist/chunk-DN5BUDBI.js +86 -0
- package/dist/chunk-DN5BUDBI.js.map +1 -0
- package/dist/chunk-DOLKDYMS.js +88 -0
- package/dist/chunk-DOLKDYMS.js.map +1 -0
- package/dist/chunk-DW34WXCG.js +28 -0
- package/dist/chunk-DW34WXCG.js.map +1 -0
- package/dist/chunk-DZAAKHGZ.js +135 -0
- package/dist/chunk-DZAAKHGZ.js.map +1 -0
- package/dist/chunk-E4IRSSHO.js +116 -0
- package/dist/chunk-E4IRSSHO.js.map +1 -0
- package/dist/chunk-E67WQXBV.js +104 -0
- package/dist/chunk-E67WQXBV.js.map +1 -0
- package/dist/chunk-EG6IHP3H.js +128 -0
- package/dist/chunk-EG6IHP3H.js.map +1 -0
- package/dist/chunk-EO7LOXG2.js +82 -0
- package/dist/chunk-EO7LOXG2.js.map +1 -0
- package/dist/chunk-EWDN56AS.js +24 -0
- package/dist/chunk-EWDN56AS.js.map +1 -0
- package/dist/chunk-F5P5P2SC.js +141 -0
- package/dist/chunk-F5P5P2SC.js.map +1 -0
- package/dist/chunk-FAWPRZTM.js +79 -0
- package/dist/chunk-FAWPRZTM.js.map +1 -0
- package/dist/chunk-FGYJ2WPX.js +36 -0
- package/dist/chunk-FGYJ2WPX.js.map +1 -0
- package/dist/chunk-GBG3I5I5.js +46 -0
- package/dist/chunk-GBG3I5I5.js.map +1 -0
- package/dist/chunk-GDMCDW66.js +19 -0
- package/dist/chunk-GDMCDW66.js.map +1 -0
- package/dist/chunk-H6HSQCOW.js +80 -0
- package/dist/chunk-H6HSQCOW.js.map +1 -0
- package/dist/chunk-HDM4RCIF.js +111 -0
- package/dist/chunk-HDM4RCIF.js.map +1 -0
- package/dist/chunk-HNTOGGVD.js +77 -0
- package/dist/chunk-HNTOGGVD.js.map +1 -0
- package/dist/chunk-HQW2ABO4.js +28 -0
- package/dist/chunk-HQW2ABO4.js.map +1 -0
- package/dist/chunk-HRDRGZ2Y.js +76 -0
- package/dist/chunk-HRDRGZ2Y.js.map +1 -0
- package/dist/chunk-HUOVA7SF.js +83 -0
- package/dist/chunk-HUOVA7SF.js.map +1 -0
- package/dist/chunk-ITA3SNOR.js +133 -0
- package/dist/chunk-ITA3SNOR.js.map +1 -0
- package/dist/chunk-IYNUPG2G.js +61 -0
- package/dist/chunk-IYNUPG2G.js.map +1 -0
- package/dist/chunk-JJ65ZI4P.js +199 -0
- package/dist/chunk-JJ65ZI4P.js.map +1 -0
- package/dist/chunk-JRBGZ6NI.js +106 -0
- package/dist/chunk-JRBGZ6NI.js.map +1 -0
- package/dist/chunk-K45OO62F.js +108 -0
- package/dist/chunk-K45OO62F.js.map +1 -0
- package/dist/chunk-KDTKA667.js +67 -0
- package/dist/chunk-KDTKA667.js.map +1 -0
- package/dist/chunk-KI7KZBSN.js +142 -0
- package/dist/chunk-KI7KZBSN.js.map +1 -0
- package/dist/chunk-KOJ7XOPZ.js +87 -0
- package/dist/chunk-KOJ7XOPZ.js.map +1 -0
- package/dist/chunk-KQTHJ22B.js +82 -0
- package/dist/chunk-KQTHJ22B.js.map +1 -0
- package/dist/chunk-KRC43RZR.js +77 -0
- package/dist/chunk-KRC43RZR.js.map +1 -0
- package/dist/chunk-LJQOEGQ2.js +116 -0
- package/dist/chunk-LJQOEGQ2.js.map +1 -0
- package/dist/chunk-LKRNUSKZ.js +149 -0
- package/dist/chunk-LKRNUSKZ.js.map +1 -0
- package/dist/chunk-LLL7QQ52.js +76 -0
- package/dist/chunk-LLL7QQ52.js.map +1 -0
- package/dist/chunk-LQ4B5X4Y.js +56 -0
- package/dist/chunk-LQ4B5X4Y.js.map +1 -0
- package/dist/chunk-M3FSLEHQ.js +76 -0
- package/dist/chunk-M3FSLEHQ.js.map +1 -0
- package/dist/chunk-M5G3O6H6.js +57 -0
- package/dist/chunk-M5G3O6H6.js.map +1 -0
- package/dist/chunk-M6JIC5PU.js +81 -0
- package/dist/chunk-M6JIC5PU.js.map +1 -0
- package/dist/chunk-N2HJ3SLS.js +186 -0
- package/dist/chunk-N2HJ3SLS.js.map +1 -0
- package/dist/chunk-NGZWBFTP.js +45 -0
- package/dist/chunk-NGZWBFTP.js.map +1 -0
- package/dist/chunk-OAKCXT35.js +34 -0
- package/dist/chunk-OAKCXT35.js.map +1 -0
- package/dist/chunk-OSD3U3HT.js +54 -0
- package/dist/chunk-OSD3U3HT.js.map +1 -0
- package/dist/chunk-OUXESQ2R.js +42 -0
- package/dist/chunk-OUXESQ2R.js.map +1 -0
- package/dist/chunk-OY2LJHMJ.js +43 -0
- package/dist/chunk-OY2LJHMJ.js.map +1 -0
- package/dist/chunk-OYEZR4CN.js +221 -0
- package/dist/chunk-OYEZR4CN.js.map +1 -0
- package/dist/chunk-P57HUMAE.js +66 -0
- package/dist/chunk-P57HUMAE.js.map +1 -0
- package/dist/chunk-P6Y2PI6L.js +82 -0
- package/dist/chunk-P6Y2PI6L.js.map +1 -0
- package/dist/chunk-PA7TDXUQ.js +51 -0
- package/dist/chunk-PA7TDXUQ.js.map +1 -0
- package/dist/chunk-PPBGGNPV.js +112 -0
- package/dist/chunk-PPBGGNPV.js.map +1 -0
- package/dist/chunk-PRH4HKND.js +48 -0
- package/dist/chunk-PRH4HKND.js.map +1 -0
- package/dist/chunk-PSPAZJUQ.js +32 -0
- package/dist/chunk-PSPAZJUQ.js.map +1 -0
- package/dist/chunk-Q5G5CGZ2.js +170 -0
- package/dist/chunk-Q5G5CGZ2.js.map +1 -0
- package/dist/chunk-QDAF3LP7.js +89 -0
- package/dist/chunk-QDAF3LP7.js.map +1 -0
- package/dist/chunk-QGVIGNJ3.js +37 -0
- package/dist/chunk-QGVIGNJ3.js.map +1 -0
- package/dist/chunk-QNUITYSY.js +68 -0
- package/dist/chunk-QNUITYSY.js.map +1 -0
- package/dist/chunk-QSWVN3RT.js +116 -0
- package/dist/chunk-QSWVN3RT.js.map +1 -0
- package/dist/chunk-QTLQZ7OJ.js +110 -0
- package/dist/chunk-QTLQZ7OJ.js.map +1 -0
- package/dist/chunk-QYAMLIG2.js +84 -0
- package/dist/chunk-QYAMLIG2.js.map +1 -0
- package/dist/chunk-REILH4XF.js +128 -0
- package/dist/chunk-REILH4XF.js.map +1 -0
- package/dist/chunk-S6SSK6QX.js +80 -0
- package/dist/chunk-S6SSK6QX.js.map +1 -0
- package/dist/chunk-SA7ED3PN.js +68 -0
- package/dist/chunk-SA7ED3PN.js.map +1 -0
- package/dist/chunk-SIJOEM4N.js +55 -0
- package/dist/chunk-SIJOEM4N.js.map +1 -0
- package/dist/chunk-SLOKAAH2.js +70 -0
- package/dist/chunk-SLOKAAH2.js.map +1 -0
- package/dist/chunk-TR6NPSMX.js +85 -0
- package/dist/chunk-TR6NPSMX.js.map +1 -0
- package/dist/chunk-TSZ5DEAT.js +106 -0
- package/dist/chunk-TSZ5DEAT.js.map +1 -0
- package/dist/chunk-TUNVF45W.js +127 -0
- package/dist/chunk-TUNVF45W.js.map +1 -0
- package/dist/chunk-TXOBNSQ5.js +63 -0
- package/dist/chunk-TXOBNSQ5.js.map +1 -0
- package/dist/chunk-U44DRLMM.js +88 -0
- package/dist/chunk-U44DRLMM.js.map +1 -0
- package/dist/chunk-U4THNRV5.js +114 -0
- package/dist/chunk-U4THNRV5.js.map +1 -0
- package/dist/chunk-UAZOFC4W.js +72 -0
- package/dist/chunk-UAZOFC4W.js.map +1 -0
- package/dist/chunk-UGKI466V.js +12 -0
- package/dist/chunk-UGKI466V.js.map +1 -0
- package/dist/chunk-VM4RMQQN.js +11 -0
- package/dist/chunk-VM4RMQQN.js.map +1 -0
- package/dist/chunk-VQ37VLAS.js +54 -0
- package/dist/chunk-VQ37VLAS.js.map +1 -0
- package/dist/chunk-VT7VSYH5.js +73 -0
- package/dist/chunk-VT7VSYH5.js.map +1 -0
- package/dist/chunk-VTIRUCLZ.js +57 -0
- package/dist/chunk-VTIRUCLZ.js.map +1 -0
- package/dist/chunk-VVBAEYKI.js +202 -0
- package/dist/chunk-VVBAEYKI.js.map +1 -0
- package/dist/chunk-WHFIQUCC.js +120 -0
- package/dist/chunk-WHFIQUCC.js.map +1 -0
- package/dist/chunk-WPSESV5Z.js +74 -0
- package/dist/chunk-WPSESV5Z.js.map +1 -0
- package/dist/chunk-WXEXCHEN.js +51 -0
- package/dist/chunk-WXEXCHEN.js.map +1 -0
- package/dist/chunk-X2DDPD3D.js +113 -0
- package/dist/chunk-X2DDPD3D.js.map +1 -0
- package/dist/chunk-X7VIMKLD.js +127 -0
- package/dist/chunk-X7VIMKLD.js.map +1 -0
- package/dist/chunk-XJ3EG6XY.js +30 -0
- package/dist/chunk-XJ3EG6XY.js.map +1 -0
- package/dist/chunk-XOT5HWSF.js +23 -0
- package/dist/chunk-XOT5HWSF.js.map +1 -0
- package/dist/chunk-Y72IP43U.js +117 -0
- package/dist/chunk-Y72IP43U.js.map +1 -0
- package/dist/chunk-YD6FLXBV.js +61 -0
- package/dist/chunk-YD6FLXBV.js.map +1 -0
- package/dist/chunk-YEQQGYYO.js +1022 -0
- package/dist/chunk-YEQQGYYO.js.map +1 -0
- package/dist/chunk-YYW6AEIT.js +46 -0
- package/dist/chunk-YYW6AEIT.js.map +1 -0
- package/dist/chunk-ZEVGXKRU.js +104 -0
- package/dist/chunk-ZEVGXKRU.js.map +1 -0
- package/dist/chunk-ZKSMMLDP.js +74 -0
- package/dist/chunk-ZKSMMLDP.js.map +1 -0
- package/dist/chunk-ZU6IM6PK.js +101 -0
- package/dist/chunk-ZU6IM6PK.js.map +1 -0
- package/dist/chunk-ZUS5KZGO.js +714 -0
- package/dist/chunk-ZUS5KZGO.js.map +1 -0
- package/dist/chunk-ZVS2GOT2.js +58 -0
- package/dist/chunk-ZVS2GOT2.js.map +1 -0
- package/dist/chunk-ZXPDS6DH.js +3 -0
- package/dist/chunk-ZXPDS6DH.js.map +1 -0
- package/dist/chunk-ZZQQJX5Z.js +173 -0
- package/dist/chunk-ZZQQJX5Z.js.map +1 -0
- package/dist/components.css +2 -0
- package/dist/composites/account-menu/index.js +6 -0
- package/dist/composites/account-menu/index.js.map +1 -0
- package/dist/composites/agent-composer/index.js +7 -0
- package/dist/composites/agent-composer/index.js.map +1 -0
- package/dist/composites/agent-editor/index.js +10 -0
- package/dist/composites/agent-editor/index.js.map +1 -0
- package/dist/composites/agent-stream/index.js +12 -0
- package/dist/composites/agent-stream/index.js.map +1 -0
- package/dist/composites/agent-timeline/index.js +5 -0
- package/dist/composites/agent-timeline/index.js.map +1 -0
- package/dist/composites/approval-card/index.js +5 -0
- package/dist/composites/approval-card/index.js.map +1 -0
- package/dist/composites/chat-composer/index.js +6 -0
- package/dist/composites/chat-composer/index.js.map +1 -0
- package/dist/composites/chat-message/index.js +6 -0
- package/dist/composites/chat-message/index.js.map +1 -0
- package/dist/composites/code-block/index.js +5 -0
- package/dist/composites/code-block/index.js.map +1 -0
- package/dist/composites/command-palette/index.js +5 -0
- package/dist/composites/command-palette/index.js.map +1 -0
- package/dist/composites/confirm-dialog/index.js +7 -0
- package/dist/composites/confirm-dialog/index.js.map +1 -0
- package/dist/composites/cron-jobs-list/index.js +5 -0
- package/dist/composites/cron-jobs-list/index.js.map +1 -0
- package/dist/composites/data-table/index.js +10 -0
- package/dist/composites/data-table/index.js.map +1 -0
- package/dist/composites/deployment-row/index.js +5 -0
- package/dist/composites/deployment-row/index.js.map +1 -0
- package/dist/composites/domain-config/index.js +7 -0
- package/dist/composites/domain-config/index.js.map +1 -0
- package/dist/composites/env-var-editor/index.js +7 -0
- package/dist/composites/env-var-editor/index.js.map +1 -0
- package/dist/composites/mcp-server-list/index.js +5 -0
- package/dist/composites/mcp-server-list/index.js.map +1 -0
- package/dist/composites/page-shell/index.js +7 -0
- package/dist/composites/page-shell/index.js.map +1 -0
- package/dist/composites/permission-modal/index.js +6 -0
- package/dist/composites/permission-modal/index.js.map +1 -0
- package/dist/composites/preview-env-card/index.js +6 -0
- package/dist/composites/preview-env-card/index.js.map +1 -0
- package/dist/composites/preview-panel/index.js +5 -0
- package/dist/composites/preview-panel/index.js.map +1 -0
- package/dist/composites/project-card/index.js +6 -0
- package/dist/composites/project-card/index.js.map +1 -0
- package/dist/composites/rollback-ui/index.js +6 -0
- package/dist/composites/rollback-ui/index.js.map +1 -0
- package/dist/composites/rule-editor/index.js +11 -0
- package/dist/composites/rule-editor/index.js.map +1 -0
- package/dist/composites/skill-editor/index.js +11 -0
- package/dist/composites/skill-editor/index.js.map +1 -0
- package/dist/composites/skills-list/index.js +5 -0
- package/dist/composites/skills-list/index.js.map +1 -0
- package/dist/composites/stability-bundle-viewer/index.js +4 -0
- package/dist/composites/stability-bundle-viewer/index.js.map +1 -0
- package/dist/composites/task-header/index.js +5 -0
- package/dist/composites/task-header/index.js.map +1 -0
- package/dist/composites/usage-meter/index.js +5 -0
- package/dist/composites/usage-meter/index.js.map +1 -0
- package/dist/fonts/LICENSE-GEIST.txt +92 -0
- package/dist/fonts/geist-400.woff2 +0 -0
- package/dist/fonts/geist-500.woff2 +0 -0
- package/dist/fonts/geist-600.woff2 +0 -0
- package/dist/fonts/geist-mono-400.woff2 +0 -0
- package/dist/fonts/geist-mono-500.woff2 +0 -0
- package/dist/fonts/geist-mono-600.woff2 +0 -0
- package/dist/fonts-cdn.css +28 -0
- package/dist/fonts.css +75 -0
- package/dist/index.d.ts +4621 -0
- package/dist/index.js +1338 -0
- package/dist/index.js.map +1 -0
- package/dist/plugin-D5xmXqYb.d.ts +172 -0
- package/dist/preset-v3-legacy.d.ts +35 -0
- package/dist/preset-v3-legacy.js +159 -0
- package/dist/preset-v3-legacy.js.map +1 -0
- package/dist/preset.css +27 -0
- package/dist/primitives/action-bar/index.js +4 -0
- package/dist/primitives/action-bar/index.js.map +1 -0
- package/dist/primitives/agent-error-card/index.js +5 -0
- package/dist/primitives/agent-error-card/index.js.map +1 -0
- package/dist/primitives/agent-event/index.js +4 -0
- package/dist/primitives/agent-event/index.js.map +1 -0
- package/dist/primitives/agent-handoff/index.js +4 -0
- package/dist/primitives/agent-handoff/index.js.map +1 -0
- package/dist/primitives/agent-profile/index.js +4 -0
- package/dist/primitives/agent-profile/index.js.map +1 -0
- package/dist/primitives/agent-starting-state/index.js +5 -0
- package/dist/primitives/agent-starting-state/index.js.map +1 -0
- package/dist/primitives/agent-streaming/index.js +5 -0
- package/dist/primitives/agent-streaming/index.js.map +1 -0
- package/dist/primitives/alert/index.js +4 -0
- package/dist/primitives/alert/index.js.map +1 -0
- package/dist/primitives/artifact-preview/index.js +4 -0
- package/dist/primitives/artifact-preview/index.js.map +1 -0
- package/dist/primitives/attachment-chip/index.js +4 -0
- package/dist/primitives/attachment-chip/index.js.map +1 -0
- package/dist/primitives/audit-log-entry/index.js +4 -0
- package/dist/primitives/audit-log-entry/index.js.map +1 -0
- package/dist/primitives/auto-compact-notice/index.js +5 -0
- package/dist/primitives/auto-compact-notice/index.js.map +1 -0
- package/dist/primitives/avatar/index.js +4 -0
- package/dist/primitives/avatar/index.js.map +1 -0
- package/dist/primitives/badge/index.js +4 -0
- package/dist/primitives/badge/index.js.map +1 -0
- package/dist/primitives/branch-indicator/index.js +4 -0
- package/dist/primitives/branch-indicator/index.js.map +1 -0
- package/dist/primitives/browser-controls/index.js +4 -0
- package/dist/primitives/browser-controls/index.js.map +1 -0
- package/dist/primitives/build-log-stream/index.js +5 -0
- package/dist/primitives/build-log-stream/index.js.map +1 -0
- package/dist/primitives/button/index.js +4 -0
- package/dist/primitives/button/index.js.map +1 -0
- package/dist/primitives/capability-indicator/index.js +4 -0
- package/dist/primitives/capability-indicator/index.js.map +1 -0
- package/dist/primitives/card/index.js +4 -0
- package/dist/primitives/card/index.js.map +1 -0
- package/dist/primitives/channel-card/index.js +4 -0
- package/dist/primitives/channel-card/index.js.map +1 -0
- package/dist/primitives/chat-thread/index.js +5 -0
- package/dist/primitives/chat-thread/index.js.map +1 -0
- package/dist/primitives/checkbox/index.js +4 -0
- package/dist/primitives/checkbox/index.js.map +1 -0
- package/dist/primitives/context-card/index.js +4 -0
- package/dist/primitives/context-card/index.js.map +1 -0
- package/dist/primitives/context-window-bar/index.js +4 -0
- package/dist/primitives/context-window-bar/index.js.map +1 -0
- package/dist/primitives/copy-button/index.js +4 -0
- package/dist/primitives/copy-button/index.js.map +1 -0
- package/dist/primitives/cost-meter/index.js +4 -0
- package/dist/primitives/cost-meter/index.js.map +1 -0
- package/dist/primitives/created-files-card/index.js +4 -0
- package/dist/primitives/created-files-card/index.js.map +1 -0
- package/dist/primitives/cron-job-card/index.js +4 -0
- package/dist/primitives/cron-job-card/index.js.map +1 -0
- package/dist/primitives/danger-zone/index.js +4 -0
- package/dist/primitives/danger-zone/index.js.map +1 -0
- package/dist/primitives/dialog/index.js +4 -0
- package/dist/primitives/dialog/index.js.map +1 -0
- package/dist/primitives/diff-viewer/index.js +4 -0
- package/dist/primitives/diff-viewer/index.js.map +1 -0
- package/dist/primitives/dropdown-menu/index.js +4 -0
- package/dist/primitives/dropdown-menu/index.js.map +1 -0
- package/dist/primitives/empty-state/index.js +4 -0
- package/dist/primitives/empty-state/index.js.map +1 -0
- package/dist/primitives/export-chat-dialog/index.js +4 -0
- package/dist/primitives/export-chat-dialog/index.js.map +1 -0
- package/dist/primitives/folder-context-card/index.js +4 -0
- package/dist/primitives/folder-context-card/index.js.map +1 -0
- package/dist/primitives/folder-selector/index.js +4 -0
- package/dist/primitives/folder-selector/index.js.map +1 -0
- package/dist/primitives/form-field/index.js +4 -0
- package/dist/primitives/form-field/index.js.map +1 -0
- package/dist/primitives/gateway-status-indicator/index.js +4 -0
- package/dist/primitives/gateway-status-indicator/index.js.map +1 -0
- package/dist/primitives/hook-config/index.js +4 -0
- package/dist/primitives/hook-config/index.js.map +1 -0
- package/dist/primitives/hook-event-log/index.js +4 -0
- package/dist/primitives/hook-event-log/index.js.map +1 -0
- package/dist/primitives/input/index.js +4 -0
- package/dist/primitives/input/index.js.map +1 -0
- package/dist/primitives/intent-selector/index.js +4 -0
- package/dist/primitives/intent-selector/index.js.map +1 -0
- package/dist/primitives/label/index.js +4 -0
- package/dist/primitives/label/index.js.map +1 -0
- package/dist/primitives/lane-board/index.js +4 -0
- package/dist/primitives/lane-board/index.js.map +1 -0
- package/dist/primitives/login-split/index.js +4 -0
- package/dist/primitives/login-split/index.js.map +1 -0
- package/dist/primitives/mcp-server-card/index.js +4 -0
- package/dist/primitives/mcp-server-card/index.js.map +1 -0
- package/dist/primitives/memory-editor/index.js +4 -0
- package/dist/primitives/memory-editor/index.js.map +1 -0
- package/dist/primitives/mention-menu/index.js +4 -0
- package/dist/primitives/mention-menu/index.js.map +1 -0
- package/dist/primitives/metrics-panel/index.js +4 -0
- package/dist/primitives/metrics-panel/index.js.map +1 -0
- package/dist/primitives/model-card/index.js +4 -0
- package/dist/primitives/model-card/index.js.map +1 -0
- package/dist/primitives/model-selector/index.js +4 -0
- package/dist/primitives/model-selector/index.js.map +1 -0
- package/dist/primitives/pagination/index.js +4 -0
- package/dist/primitives/pagination/index.js.map +1 -0
- package/dist/primitives/permission-matrix/index.js +4 -0
- package/dist/primitives/permission-matrix/index.js.map +1 -0
- package/dist/primitives/pin-input/index.js +4 -0
- package/dist/primitives/pin-input/index.js.map +1 -0
- package/dist/primitives/plan-badge/index.js +4 -0
- package/dist/primitives/plan-badge/index.js.map +1 -0
- package/dist/primitives/progress/index.js +4 -0
- package/dist/primitives/progress/index.js.map +1 -0
- package/dist/primitives/progress-checklist/index.js +4 -0
- package/dist/primitives/progress-checklist/index.js.map +1 -0
- package/dist/primitives/project-switcher/index.js +4 -0
- package/dist/primitives/project-switcher/index.js.map +1 -0
- package/dist/primitives/quick-action-chips/index.js +4 -0
- package/dist/primitives/quick-action-chips/index.js.map +1 -0
- package/dist/primitives/radio-group/index.js +4 -0
- package/dist/primitives/radio-group/index.js.map +1 -0
- package/dist/primitives/recent-folders-list/index.js +4 -0
- package/dist/primitives/recent-folders-list/index.js.map +1 -0
- package/dist/primitives/rule-card/index.js +4 -0
- package/dist/primitives/rule-card/index.js.map +1 -0
- package/dist/primitives/run-stats/index.js +4 -0
- package/dist/primitives/run-stats/index.js.map +1 -0
- package/dist/primitives/run-status-pill/index.js +4 -0
- package/dist/primitives/run-status-pill/index.js.map +1 -0
- package/dist/primitives/running-tasks-panel/index.js +4 -0
- package/dist/primitives/running-tasks-panel/index.js.map +1 -0
- package/dist/primitives/scroll-area/index.js +4 -0
- package/dist/primitives/scroll-area/index.js.map +1 -0
- package/dist/primitives/select/index.js +4 -0
- package/dist/primitives/select/index.js.map +1 -0
- package/dist/primitives/session-list-item/index.js +4 -0
- package/dist/primitives/session-list-item/index.js.map +1 -0
- package/dist/primitives/session-timeline/index.js +4 -0
- package/dist/primitives/session-timeline/index.js.map +1 -0
- package/dist/primitives/sheet/index.js +4 -0
- package/dist/primitives/sheet/index.js.map +1 -0
- package/dist/primitives/sidebar/index.js +4 -0
- package/dist/primitives/sidebar/index.js.map +1 -0
- package/dist/primitives/skeleton/index.js +5 -0
- package/dist/primitives/skeleton/index.js.map +1 -0
- package/dist/primitives/skill-card/index.js +4 -0
- package/dist/primitives/skill-card/index.js.map +1 -0
- package/dist/primitives/social-auth-row/index.js +4 -0
- package/dist/primitives/social-auth-row/index.js.map +1 -0
- package/dist/primitives/stat-tile/index.js +4 -0
- package/dist/primitives/stat-tile/index.js.map +1 -0
- package/dist/primitives/status-dot/index.js +4 -0
- package/dist/primitives/status-dot/index.js.map +1 -0
- package/dist/primitives/steps-rail/index.js +4 -0
- package/dist/primitives/steps-rail/index.js.map +1 -0
- package/dist/primitives/sub-agent-dispatch/index.js +4 -0
- package/dist/primitives/sub-agent-dispatch/index.js.map +1 -0
- package/dist/primitives/switch/index.js +4 -0
- package/dist/primitives/switch/index.js.map +1 -0
- package/dist/primitives/system-prompt-editor/index.js +4 -0
- package/dist/primitives/system-prompt-editor/index.js.map +1 -0
- package/dist/primitives/table/index.js +4 -0
- package/dist/primitives/table/index.js.map +1 -0
- package/dist/primitives/tabs/index.js +4 -0
- package/dist/primitives/tabs/index.js.map +1 -0
- package/dist/primitives/task-plan/index.js +4 -0
- package/dist/primitives/task-plan/index.js.map +1 -0
- package/dist/primitives/terminal-panel/index.js +5 -0
- package/dist/primitives/terminal-panel/index.js.map +1 -0
- package/dist/primitives/textarea/index.js +4 -0
- package/dist/primitives/textarea/index.js.map +1 -0
- package/dist/primitives/thinking-level-selector/index.js +4 -0
- package/dist/primitives/thinking-level-selector/index.js.map +1 -0
- package/dist/primitives/timestamp/index.js +4 -0
- package/dist/primitives/timestamp/index.js.map +1 -0
- package/dist/primitives/toast/index.js +4 -0
- package/dist/primitives/toast/index.js.map +1 -0
- package/dist/primitives/token-usage-chart/index.js +4 -0
- package/dist/primitives/token-usage-chart/index.js.map +1 -0
- package/dist/primitives/tool-call/index.js +4 -0
- package/dist/primitives/tool-call/index.js.map +1 -0
- package/dist/primitives/tool-call-card/index.js +4 -0
- package/dist/primitives/tool-call-card/index.js.map +1 -0
- package/dist/primitives/tool-result/index.js +4 -0
- package/dist/primitives/tool-result/index.js.map +1 -0
- package/dist/primitives/tools-list/index.js +4 -0
- package/dist/primitives/tools-list/index.js.map +1 -0
- package/dist/primitives/tooltip/index.js +4 -0
- package/dist/primitives/tooltip/index.js.map +1 -0
- package/dist/primitives/topnav/index.js +4 -0
- package/dist/primitives/topnav/index.js.map +1 -0
- package/dist/primitives/update-banner/index.js +4 -0
- package/dist/primitives/update-banner/index.js.map +1 -0
- package/dist/slide/index.d.ts +212 -0
- package/dist/slide/index.js +3 -0
- package/dist/slide/index.js.map +1 -0
- package/dist/slide/plugins/emoji/index.d.ts +29 -0
- package/dist/slide/plugins/emoji/index.js +157 -0
- package/dist/slide/plugins/emoji/index.js.map +1 -0
- package/dist/slide/plugins/math/index.d.ts +13 -0
- package/dist/slide/plugins/math/index.js +145 -0
- package/dist/slide/plugins/math/index.js.map +1 -0
- package/dist/slide/plugins/mermaid/index.d.ts +55 -0
- package/dist/slide/plugins/mermaid/index.js +218 -0
- package/dist/slide/plugins/mermaid/index.js.map +1 -0
- package/dist/slide/plugins/shiki/index.d.ts +18 -0
- package/dist/slide/plugins/shiki/index.js +87 -0
- package/dist/slide/plugins/shiki/index.js.map +1 -0
- package/dist/slide/themes/default.css +256 -0
- package/dist/slide/themes/layouts.css +143 -0
- package/dist/slide/themes/violet-forge.css +256 -0
- package/dist/slide-deck/index.css +52 -0
- package/dist/slide-deck/index.css.map +1 -0
- package/dist/slide-deck/index.d.ts +377 -0
- package/dist/slide-deck/index.js +1111 -0
- package/dist/slide-deck/index.js.map +1 -0
- package/dist/styles-v3-legacy.css +88 -0
- package/dist/styles.css +137 -0
- package/dist/tokens-v4.css +187 -0
- package/dist/tokens.css +230 -0
- package/dist/vite-plugin.d.ts +29 -0
- package/dist/vite-plugin.js +76 -0
- package/dist/vite-plugin.js.map +1 -0
- package/dist/whiteboard/index.d.ts +258 -0
- package/dist/whiteboard/index.js +738 -0
- package/dist/whiteboard/index.js.map +1 -0
- package/llms.txt +273 -0
- package/package.json +800 -0
- package/registry/index.json +856 -0
- package/registry/r/account-menu.json +24 -0
- package/registry/r/action-bar.json +22 -0
- package/registry/r/agent-composer.json +22 -0
- package/registry/r/agent-editor.json +27 -0
- package/registry/r/agent-error-card.json +22 -0
- package/registry/r/agent-event.json +24 -0
- package/registry/r/agent-handoff.json +22 -0
- package/registry/r/agent-profile.json +23 -0
- package/registry/r/agent-starting-state.json +22 -0
- package/registry/r/agent-stream.json +27 -0
- package/registry/r/agent-streaming.json +22 -0
- package/registry/r/agent-timeline.json +22 -0
- package/registry/r/agent-types.json +15 -0
- package/registry/r/alert.json +22 -0
- package/registry/r/approval-card.json +25 -0
- package/registry/r/artifact-preview.json +22 -0
- package/registry/r/attachment-chip.json +24 -0
- package/registry/r/audit-log-entry.json +23 -0
- package/registry/r/auto-compact-notice.json +22 -0
- package/registry/r/avatar.json +23 -0
- package/registry/r/badge.json +22 -0
- package/registry/r/browser-controls.json +22 -0
- package/registry/r/build-log-stream.json +19 -0
- package/registry/r/button.json +23 -0
- package/registry/r/capability-indicator.json +23 -0
- package/registry/r/card.json +22 -0
- package/registry/r/chat-composer.json +23 -0
- package/registry/r/chat-message.json +129 -0
- package/registry/r/chat-thread.json +20 -0
- package/registry/r/chat-types.json +15 -0
- package/registry/r/checkbox.json +24 -0
- package/registry/r/cn.json +19 -0
- package/registry/r/code-block.json +21 -0
- package/registry/r/command-palette.json +25 -0
- package/registry/r/confirm-dialog.json +25 -0
- package/registry/r/context-card.json +23 -0
- package/registry/r/context-window-bar.json +20 -0
- package/registry/r/copy-button.json +22 -0
- package/registry/r/cost-meter.json +22 -0
- package/registry/r/created-files-card.json +23 -0
- package/registry/r/cron-job-card.json +22 -0
- package/registry/r/cron-jobs-list.json +23 -0
- package/registry/r/danger-zone.json +20 -0
- package/registry/r/data-table.json +27 -0
- package/registry/r/deployment-row.json +23 -0
- package/registry/r/dialog.json +23 -0
- package/registry/r/diff-viewer.json +20 -0
- package/registry/r/domain-config.json +25 -0
- package/registry/r/dropdown-menu.json +23 -0
- package/registry/r/empty-state.json +20 -0
- package/registry/r/env-var-editor.json +25 -0
- package/registry/r/folder-context-card.json +23 -0
- package/registry/r/folder-selector.json +22 -0
- package/registry/r/form-field.json +23 -0
- package/registry/r/hook-config.json +22 -0
- package/registry/r/hook-event-log.json +22 -0
- package/registry/r/input.json +22 -0
- package/registry/r/intent-selector.json +24 -0
- package/registry/r/label.json +22 -0
- package/registry/r/lane-board.json +20 -0
- package/registry/r/live-region-context.json +16 -0
- package/registry/r/login-split.json +20 -0
- package/registry/r/mcp-server-card.json +22 -0
- package/registry/r/mcp-server-list.json +23 -0
- package/registry/r/memory-editor.json +23 -0
- package/registry/r/mention-menu.json +23 -0
- package/registry/r/metrics-panel.json +22 -0
- package/registry/r/mode-types.json +15 -0
- package/registry/r/model-card.json +23 -0
- package/registry/r/model-selector.json +23 -0
- package/registry/r/page-shell.json +25 -0
- package/registry/r/pagination.json +22 -0
- package/registry/r/permission-matrix.json +22 -0
- package/registry/r/permission-modal.json +24 -0
- package/registry/r/permission-types.json +15 -0
- package/registry/r/pin-input.json +20 -0
- package/registry/r/plan-badge.json +20 -0
- package/registry/r/preview-env-card.json +25 -0
- package/registry/r/preview-panel.json +21 -0
- package/registry/r/progress-checklist.json +23 -0
- package/registry/r/progress.json +20 -0
- package/registry/r/project-card.json +25 -0
- package/registry/r/project-switcher.json +22 -0
- package/registry/r/quick-action-chips.json +21 -0
- package/registry/r/radio-group.json +23 -0
- package/registry/r/recent-folders-list.json +22 -0
- package/registry/r/rollback-ui.json +24 -0
- package/registry/r/rule-card.json +23 -0
- package/registry/r/rule-editor.json +28 -0
- package/registry/r/rule-types.json +18 -0
- package/registry/r/run-stats.json +22 -0
- package/registry/r/running-tasks-panel.json +22 -0
- package/registry/r/safe-href.json +16 -0
- package/registry/r/scroll-area.json +22 -0
- package/registry/r/select.json +24 -0
- package/registry/r/session-list-item.json +20 -0
- package/registry/r/session-timeline.json +22 -0
- package/registry/r/sheet.json +24 -0
- package/registry/r/sidebar.json +19 -0
- package/registry/r/skeleton.json +19 -0
- package/registry/r/skill-card.json +24 -0
- package/registry/r/skill-editor.json +28 -0
- package/registry/r/skills-list.json +23 -0
- package/registry/r/slide-deck.json +130 -0
- package/registry/r/slide-plugin-emoji.json +28 -0
- package/registry/r/slide-plugin-math.json +24 -0
- package/registry/r/slide-plugin-mermaid.json +23 -0
- package/registry/r/slide-plugin-shiki.json +23 -0
- package/registry/r/slide.json +123 -0
- package/registry/r/social-auth-row.json +21 -0
- package/registry/r/stat-tile.json +22 -0
- package/registry/r/status-dot.json +20 -0
- package/registry/r/steps-rail.json +20 -0
- package/registry/r/sub-agent-dispatch.json +22 -0
- package/registry/r/switch.json +23 -0
- package/registry/r/system-prompt-editor.json +22 -0
- package/registry/r/table.json +22 -0
- package/registry/r/tabs.json +22 -0
- package/registry/r/tailwind-preset.json +19 -0
- package/registry/r/task-header.json +24 -0
- package/registry/r/task-plan.json +22 -0
- package/registry/r/task-types.json +15 -0
- package/registry/r/terminal-panel.json +22 -0
- package/registry/r/textarea.json +22 -0
- package/registry/r/theme-provider.json +59 -0
- package/registry/r/theme-script.json +18 -0
- package/registry/r/theo-ui-provider.json +20 -0
- package/registry/r/timestamp.json +20 -0
- package/registry/r/toast.json +30 -0
- package/registry/r/token-usage-chart.json +20 -0
- package/registry/r/tokens.json +21 -0
- package/registry/r/tool-call-card.json +23 -0
- package/registry/r/tool-call.json +22 -0
- package/registry/r/tool-result.json +20 -0
- package/registry/r/tools-list.json +23 -0
- package/registry/r/tooltip.json +22 -0
- package/registry/r/topnav.json +22 -0
- package/registry/r/types.json +15 -0
- package/registry/r/usage-meter.json +21 -0
- package/registry/r/whiteboard.json +101 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
|
+
"name": "hook-config",
|
|
4
|
+
"type": "registry:ui",
|
|
5
|
+
"title": "HookConfig",
|
|
6
|
+
"description": "Editor for lifecycle hooks (PreToolUse, PostToolUse, Stop…).",
|
|
7
|
+
"dependencies": [
|
|
8
|
+
"lucide-react"
|
|
9
|
+
],
|
|
10
|
+
"registryDependencies": [
|
|
11
|
+
"https://usetheodev.github.io/theo-ui/r/cn.json",
|
|
12
|
+
"https://usetheodev.github.io/theo-ui/r/tailwind-preset.json"
|
|
13
|
+
],
|
|
14
|
+
"files": [
|
|
15
|
+
{
|
|
16
|
+
"path": "components/primitives/hook-config/hook-config.tsx",
|
|
17
|
+
"type": "registry:ui",
|
|
18
|
+
"target": "components/ui/hook-config.tsx",
|
|
19
|
+
"content": "import { Plus, Trash2, Zap } from \"lucide-react\";\nimport { forwardRef, useState } from \"react\";\nimport type { HTMLAttributes, ReactNode } from \"react\";\nimport { cn } from \"@/lib/cn\";\n\nexport type HookEvent =\n | \"PreToolUse\"\n | \"PostToolUse\"\n | \"UserPromptSubmit\"\n | \"Stop\"\n | \"SessionStart\"\n | \"SessionEnd\";\n\nexport interface HookEntry {\n id: string;\n event: HookEvent;\n /** Tool matcher (e.g. \"Bash\", \"Write\", \"*\"). */\n matcher: string;\n /** Shell command to run. */\n command: string;\n enabled?: boolean;\n}\n\nconst HOOK_EVENTS: HookEvent[] = [\n \"PreToolUse\",\n \"PostToolUse\",\n \"UserPromptSubmit\",\n \"Stop\",\n \"SessionStart\",\n \"SessionEnd\",\n];\n\ninterface HookConfigProps extends Omit<HTMLAttributes<HTMLDivElement>, \"title\" | \"onToggle\"> {\n hooks: HookEntry[];\n onAdd?: (hook: Omit<HookEntry, \"id\">) => void;\n onRemove?: (id: string) => void;\n onToggle?: (id: string, enabled: boolean) => void;\n title?: ReactNode;\n}\n\n/**\n * HookConfig — editor for lifecycle hooks (PreToolUse, PostToolUse, Stop…).\n *\n * Mirrors Claude Code's settings.json hooks but visual. Each row is an\n * { event × matcher × command } triple with on/off toggle.\n */\nconst HookConfig = forwardRef<HTMLDivElement, HookConfigProps>(\n ({ className, hooks, onAdd, onRemove, onToggle, title = \"Hooks\", ...props }, ref) => {\n const [event, setEvent] = useState<HookEvent>(\"PreToolUse\");\n const [matcher, setMatcher] = useState(\"*\");\n const [command, setCommand] = useState(\"\");\n\n const submit = () => {\n if (!command.trim()) return;\n onAdd?.({ event, matcher: matcher.trim() || \"*\", command: command.trim() });\n setCommand(\"\");\n };\n\n return (\n <section ref={ref} className={cn(\"rounded-xl border bg-card\", className)} {...props}>\n <header className=\"flex items-baseline justify-between border-border/40 border-b px-4 py-3\">\n <div className=\"flex items-center gap-2\">\n <Zap className=\"size-4 text-primary\" aria-hidden=\"true\" />\n <h3 className=\"font-display text-title-md tracking-tight\">{title}</h3>\n </div>\n <span className=\"font-mono text-label text-muted-foreground\">\n {hooks.length} {hooks.length === 1 ? \"hook\" : \"hooks\"}\n </span>\n </header>\n\n {onAdd ? (\n <form\n className=\"grid grid-cols-[140px_140px_1fr_auto] items-center gap-2 border-border/40 border-b p-3\"\n onSubmit={(e) => {\n e.preventDefault();\n submit();\n }}\n >\n <select\n value={event}\n onChange={(e) => setEvent(e.target.value as HookEvent)}\n aria-label=\"Event\"\n className=\"h-9 rounded-md border border-input bg-card px-2 font-mono text-code-sm\"\n >\n {HOOK_EVENTS.map((evt) => (\n <option key={evt} value={evt}>\n {evt}\n </option>\n ))}\n </select>\n <input\n type=\"text\"\n value={matcher}\n onChange={(e) => setMatcher(e.target.value)}\n placeholder=\"matcher (Bash, Write, *)\"\n aria-label=\"Matcher\"\n className=\"h-9 rounded-md border border-input bg-card px-2 font-mono text-code-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n />\n <input\n type=\"text\"\n value={command}\n onChange={(e) => setCommand(e.target.value)}\n placeholder='command (e.g. \"./scripts/audit.sh\")'\n aria-label=\"Command\"\n className=\"h-9 rounded-md border border-input bg-card px-2 font-mono text-code-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n />\n <button\n type=\"submit\"\n className=\"inline-flex h-9 items-center gap-1 rounded-md bg-primary px-3 font-sans text-label text-primary-foreground hover:shadow-glow focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n >\n <Plus className=\"size-3.5\" /> Add\n </button>\n </form>\n ) : null}\n\n <ul className=\"divide-y divide-border/30\">\n {hooks.map((hook) => {\n const enabled = hook.enabled ?? true;\n return (\n <li\n key={hook.id}\n className={cn(\n \"grid grid-cols-[140px_140px_1fr_auto_auto] items-center gap-3 px-4 py-2.5\",\n !enabled && \"opacity-50\",\n )}\n >\n <span className=\"font-mono text-code-sm text-primary\">{hook.event}</span>\n <span className=\"font-mono text-code-sm text-muted-foreground\">{hook.matcher}</span>\n <span className=\"truncate font-mono text-code-sm text-foreground\">\n {hook.command}\n </span>\n {onToggle ? (\n <button\n type=\"button\"\n onClick={() => onToggle(hook.id, !enabled)}\n aria-pressed={enabled}\n className={cn(\n \"rounded-full border px-2.5 py-0.5 font-mono text-label uppercase\",\n enabled\n ? \"border-success/40 bg-success/15 text-success\"\n : \"border-border/40 bg-muted text-muted-foreground\",\n )}\n >\n {enabled ? \"On\" : \"Off\"}\n </button>\n ) : (\n <span />\n )}\n {onRemove ? (\n <button\n type=\"button\"\n onClick={() => onRemove(hook.id)}\n aria-label={`Remove hook ${hook.event} ${hook.matcher}`}\n className=\"rounded-md p-1.5 text-muted-foreground hover:bg-muted hover:text-destructive focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n >\n <Trash2 className=\"size-3.5\" />\n </button>\n ) : (\n <span />\n )}\n </li>\n );\n })}\n {hooks.length === 0 ? (\n <li className=\"px-4 py-8 text-center font-sans text-body-sm text-muted-foreground\">\n No hooks configured.\n </li>\n ) : null}\n </ul>\n </section>\n );\n },\n);\nHookConfig.displayName = \"HookConfig\";\n\nexport { HookConfig, HOOK_EVENTS };\n"
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
|
+
"name": "hook-event-log",
|
|
4
|
+
"type": "registry:ui",
|
|
5
|
+
"title": "HookEventLog",
|
|
6
|
+
"description": "Chronological list of hook firings, with result tone, the",
|
|
7
|
+
"dependencies": [
|
|
8
|
+
"lucide-react"
|
|
9
|
+
],
|
|
10
|
+
"registryDependencies": [
|
|
11
|
+
"https://usetheodev.github.io/theo-ui/r/cn.json",
|
|
12
|
+
"https://usetheodev.github.io/theo-ui/r/tailwind-preset.json"
|
|
13
|
+
],
|
|
14
|
+
"files": [
|
|
15
|
+
{
|
|
16
|
+
"path": "components/primitives/hook-event-log/hook-event-log.tsx",
|
|
17
|
+
"type": "registry:ui",
|
|
18
|
+
"target": "components/ui/hook-event-log.tsx",
|
|
19
|
+
"content": "import { CheckCircle2, CircleX, ShieldAlert } from \"lucide-react\";\nimport { forwardRef } from \"react\";\nimport type { HTMLAttributes, ReactNode } from \"react\";\nimport { cn } from \"@/lib/cn\";\n\nexport type HookEventResult = \"ok\" | \"blocked\" | \"error\";\n\nexport interface HookEventEntry {\n id: string;\n /** Hook event (e.g. PreToolUse). */\n event: string;\n /** Hook matcher (e.g. Bash). */\n matcher: string;\n /** What the hook command was. */\n command: string;\n result: HookEventResult;\n timestamp: string;\n /** Optional stderr/stdout snippet. */\n output?: string;\n /** Optional duration label, e.g. \"120ms\". */\n duration?: string;\n}\n\ninterface HookEventLogProps extends Omit<HTMLAttributes<HTMLDivElement>, \"title\"> {\n events: HookEventEntry[];\n title?: ReactNode;\n}\n\nconst RESULT_CONFIG = {\n ok: { icon: CheckCircle2, color: \"text-success\" },\n blocked: { icon: ShieldAlert, color: \"text-warning\" },\n error: { icon: CircleX, color: \"text-destructive\" },\n} as const;\n\n/**\n * HookEventLog — chronological list of hook firings, with result tone, the\n * command that ran, and an optional output preview.\n */\nconst HookEventLog = forwardRef<HTMLDivElement, HookEventLogProps>(\n ({ className, events, title = \"Hook log\", ...props }, ref) => (\n <section ref={ref} className={cn(\"rounded-xl border bg-card\", className)} {...props}>\n <header className=\"flex items-baseline justify-between border-border/40 border-b px-4 py-3\">\n <h3 className=\"font-display text-title-md tracking-tight\">{title}</h3>\n <span className=\"font-mono text-label text-muted-foreground\">\n {events.length} {events.length === 1 ? \"event\" : \"events\"}\n </span>\n </header>\n <ol className=\"divide-y divide-border/30\">\n {events.map((evt) => {\n const cfg = RESULT_CONFIG[evt.result];\n const Icon = cfg.icon;\n return (\n <li\n key={evt.id}\n className=\"grid grid-cols-[auto_1fr_auto] items-start gap-3 px-4 py-2.5\"\n >\n <Icon aria-hidden=\"true\" className={cn(\"mt-0.5 size-3.5 shrink-0\", cfg.color)} />\n <div className=\"min-w-0\">\n <p className=\"flex flex-wrap items-baseline gap-2\">\n <span className=\"font-mono text-code-sm text-primary\">{evt.event}</span>\n <span className=\"font-mono text-code-sm text-muted-foreground\">\n matcher={evt.matcher}\n </span>\n {evt.duration ? (\n <span className=\"font-mono text-label text-muted-foreground tabular-nums\">\n {evt.duration}\n </span>\n ) : null}\n </p>\n <p className=\"truncate font-mono text-code-sm text-foreground\">{evt.command}</p>\n {evt.output ? (\n <pre className=\"mt-1 max-h-24 overflow-auto rounded-md bg-muted/60 px-2 py-1 font-mono text-code-sm text-muted-foreground\">\n {evt.output}\n </pre>\n ) : null}\n </div>\n <span className=\"font-mono text-label text-muted-foreground tabular-nums\">\n {evt.timestamp}\n </span>\n </li>\n );\n })}\n {events.length === 0 ? (\n <li className=\"px-4 py-8 text-center font-sans text-body-sm text-muted-foreground\">\n No hooks have fired yet.\n </li>\n ) : null}\n </ol>\n </section>\n ),\n);\nHookEventLog.displayName = \"HookEventLog\";\n\nexport { HookEventLog };\n"
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
|
+
"name": "input",
|
|
4
|
+
"type": "registry:ui",
|
|
5
|
+
"title": "Input",
|
|
6
|
+
"description": "Text input primitive with focus ring, error state, and form-field composition support.",
|
|
7
|
+
"registryDependencies": [
|
|
8
|
+
"https://usetheodev.github.io/theo-ui/r/cn.json",
|
|
9
|
+
"https://usetheodev.github.io/theo-ui/r/tailwind-preset.json"
|
|
10
|
+
],
|
|
11
|
+
"files": [
|
|
12
|
+
{
|
|
13
|
+
"path": "components/primitives/input/input.tsx",
|
|
14
|
+
"type": "registry:ui",
|
|
15
|
+
"target": "components/ui/input.tsx",
|
|
16
|
+
"content": "import { type VariantProps, cva } from \"class-variance-authority\";\nimport { forwardRef } from \"react\";\nimport type { InputHTMLAttributes } from \"react\";\nimport { cn } from \"@/lib/cn\";\n\nconst inputVariants = cva(\n [\n \"flex w-full rounded-md border border-input bg-card\",\n \"text-foreground placeholder:text-muted-foreground\",\n \"transition-[box-shadow,border-color] duration-base ease-out-soft\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background\",\n \"focus-visible:border-primary\",\n \"disabled:cursor-not-allowed disabled:opacity-50\",\n \"file:border-0 file:bg-transparent file:font-medium file:text-body-sm\",\n ],\n {\n variants: {\n size: {\n sm: \"h-8 px-2.5 py-1 text-body-sm\",\n // md: density-tunable via CSS var. Comfortable (default) = 36px.\n md: \"h-[var(--theo-control-h,2.25rem)] px-[var(--theo-control-px,0.875rem)] py-1.5 text-body-sm\",\n lg: \"h-11 px-4 py-2.5 text-body-md\",\n },\n },\n defaultVariants: { size: \"md\" },\n },\n);\n\n/**\n * Input — text input primitive.\n *\n * Violet Forge specifics:\n * - height 40px (h-10) matching default Button md.\n * - rounded-md (6px) — slightly less than buttons to differentiate.\n * - focus uses violet ring (--ring).\n * - placeholder uses --muted-foreground.\n *\n * The `size` prop accepts `\"sm\" | \"md\" | \"lg\"`. Default `md` preserves the\n * 40px tall input from before this prop existed. EC-1 (edge-case review):\n * this overrides the native HTML `size` attribute (text-input columns) —\n * use `{...{ size: 20 } as any}` if you genuinely need the HTML attribute,\n * which is exceedingly rare.\n */\nexport interface InputProps\n extends Omit<InputHTMLAttributes<HTMLInputElement>, \"size\">,\n VariantProps<typeof inputVariants> {}\n\nconst Input = forwardRef<HTMLInputElement, InputProps>(\n ({ className, type = \"text\", size, ...props }, ref) => (\n <input ref={ref} type={type} className={cn(inputVariants({ size }), className)} {...props} />\n ),\n);\nInput.displayName = \"Input\";\n\nexport { Input, inputVariants };\n"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"dependencies": [
|
|
20
|
+
"class-variance-authority"
|
|
21
|
+
]
|
|
22
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
|
+
"name": "intent-selector",
|
|
4
|
+
"type": "registry:ui",
|
|
5
|
+
"title": "IntentSelector",
|
|
6
|
+
"description": "Chip dropdown for picking the agent's intent for the next",
|
|
7
|
+
"dependencies": [
|
|
8
|
+
"@radix-ui/react-dropdown-menu",
|
|
9
|
+
"lucide-react"
|
|
10
|
+
],
|
|
11
|
+
"registryDependencies": [
|
|
12
|
+
"https://usetheodev.github.io/theo-ui/r/cn.json",
|
|
13
|
+
"https://usetheodev.github.io/theo-ui/r/tailwind-preset.json",
|
|
14
|
+
"https://usetheodev.github.io/theo-ui/r/types.json"
|
|
15
|
+
],
|
|
16
|
+
"files": [
|
|
17
|
+
{
|
|
18
|
+
"path": "components/primitives/intent-selector/intent-selector.tsx",
|
|
19
|
+
"type": "registry:ui",
|
|
20
|
+
"target": "components/ui/intent-selector.tsx",
|
|
21
|
+
"content": "import * as DropdownMenu from \"@radix-ui/react-dropdown-menu\";\nimport { Check, ChevronDown, Pencil } from \"lucide-react\";\nimport { forwardRef } from \"react\";\nimport type { ButtonHTMLAttributes } from \"react\";\nimport { cn } from \"@/lib/cn\";\nimport type { IconComponent } from \"@/lib/types\";\n\nexport interface IntentOption {\n id: string;\n label: string;\n /** Optional one-liner shown below the label in the menu. */\n description?: string;\n /** Optional icon — defaults to a pencil for the trigger if none. */\n icon?: IconComponent;\n}\n\ninterface IntentSelectorProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, \"onChange\"> {\n value: string;\n options: IntentOption[];\n onChange?: (id: string) => void;\n}\n\n/**\n * IntentSelector — chip dropdown for picking the agent's intent for the next\n * turn (e.g. edit / plan / review). Mirrors ModelSelector: pill trigger +\n * Radix DropdownMenu of options with description and a check on the active.\n */\nconst IntentSelector = forwardRef<HTMLButtonElement, IntentSelectorProps>(\n ({ className, value, options, onChange, ...props }, ref) => {\n const current = options.find((o) => o.id === value) ?? options[0];\n const Icon = current?.icon ?? Pencil;\n return (\n <DropdownMenu.Root>\n <DropdownMenu.Trigger asChild>\n <button\n ref={ref}\n type=\"button\"\n className={cn(\n \"inline-flex h-8 items-center gap-2 rounded-full border border-border/60 bg-card px-3\",\n \"font-medium font-sans text-body-sm text-foreground\",\n \"transition-colors duration-base ease-out-soft\",\n \"hover:bg-muted\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background\",\n className,\n )}\n {...props}\n >\n <Icon className=\"size-3.5 text-primary\" aria-hidden=\"true\" />\n {current?.label ?? \"Select intent\"}\n <ChevronDown className=\"size-3 text-muted-foreground\" aria-hidden=\"true\" />\n </button>\n </DropdownMenu.Trigger>\n <DropdownMenu.Portal>\n <DropdownMenu.Content\n sideOffset={6}\n align=\"start\"\n className={cn(\n \"z-50 min-w-[16rem] overflow-hidden rounded-lg border bg-popover p-1 text-popover-foreground shadow-md\",\n \"data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:animate-in\",\n \"data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:animate-out\",\n )}\n >\n {options.map((opt) => {\n const OptIcon = opt.icon ?? Pencil;\n return (\n <DropdownMenu.Item\n key={opt.id}\n onSelect={() => onChange?.(opt.id)}\n className={cn(\n \"flex cursor-pointer items-start gap-3 rounded-md px-2 py-2\",\n \"text-body-sm\",\n \"focus:bg-muted focus:outline-none\",\n \"data-[highlighted]:bg-muted\",\n )}\n >\n <OptIcon className=\"mt-0.5 size-4 shrink-0 text-primary\" aria-hidden=\"true\" />\n <span className=\"flex flex-1 flex-col\">\n <span className=\"font-medium\">{opt.label}</span>\n {opt.description ? (\n <span className=\"text-label text-muted-foreground\">{opt.description}</span>\n ) : null}\n </span>\n {opt.id === value ? (\n <Check className=\"mt-0.5 size-3.5 shrink-0 text-primary\" />\n ) : null}\n </DropdownMenu.Item>\n );\n })}\n </DropdownMenu.Content>\n </DropdownMenu.Portal>\n </DropdownMenu.Root>\n );\n },\n);\nIntentSelector.displayName = \"IntentSelector\";\n\nexport { IntentSelector };\n"
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
|
+
"name": "label",
|
|
4
|
+
"type": "registry:ui",
|
|
5
|
+
"title": "Label",
|
|
6
|
+
"description": "Form field label built on Radix Label.",
|
|
7
|
+
"dependencies": [
|
|
8
|
+
"@radix-ui/react-label"
|
|
9
|
+
],
|
|
10
|
+
"registryDependencies": [
|
|
11
|
+
"https://usetheodev.github.io/theo-ui/r/cn.json",
|
|
12
|
+
"https://usetheodev.github.io/theo-ui/r/tailwind-preset.json"
|
|
13
|
+
],
|
|
14
|
+
"files": [
|
|
15
|
+
{
|
|
16
|
+
"path": "components/primitives/label/label.tsx",
|
|
17
|
+
"type": "registry:ui",
|
|
18
|
+
"target": "components/ui/label.tsx",
|
|
19
|
+
"content": "import * as LabelPrimitive from \"@radix-ui/react-label\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, ElementRef } from \"react\";\nimport { cn } from \"@/lib/cn\";\n\n/**\n * Label — form field label built on Radix Label.\n *\n * Behaviors:\n * - Clicking the label focuses the associated `htmlFor` input.\n * - Adds a small red asterisk when `required` is set.\n * - Inherits disabled visuals from the wrapper (`peer-disabled`).\n */\ninterface LabelProps extends ComponentPropsWithoutRef<typeof LabelPrimitive.Root> {\n required?: boolean;\n}\n\nconst Label = forwardRef<ElementRef<typeof LabelPrimitive.Root>, LabelProps>(\n ({ className, required, children, ...props }, ref) => (\n <LabelPrimitive.Root\n ref={ref}\n className={cn(\n \"inline-flex items-center gap-1 font-medium font-sans text-body-sm text-foreground\",\n \"peer-disabled:cursor-not-allowed peer-disabled:opacity-60\",\n className,\n )}\n {...props}\n >\n {children}\n {required ? (\n <span className=\"text-destructive\" aria-hidden=\"true\">\n *\n </span>\n ) : null}\n </LabelPrimitive.Root>\n ),\n);\nLabel.displayName = \"Label\";\n\nexport { Label };\n"
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
|
+
"name": "lane-board",
|
|
4
|
+
"type": "registry:ui",
|
|
5
|
+
"title": "LaneBoard",
|
|
6
|
+
"description": "Kanban-style task board with 4 lanes matching the claw-code",
|
|
7
|
+
"dependencies": [],
|
|
8
|
+
"registryDependencies": [
|
|
9
|
+
"https://usetheodev.github.io/theo-ui/r/cn.json",
|
|
10
|
+
"https://usetheodev.github.io/theo-ui/r/tailwind-preset.json"
|
|
11
|
+
],
|
|
12
|
+
"files": [
|
|
13
|
+
{
|
|
14
|
+
"path": "components/primitives/lane-board/lane-board.tsx",
|
|
15
|
+
"type": "registry:ui",
|
|
16
|
+
"target": "components/ui/lane-board.tsx",
|
|
17
|
+
"content": "import { forwardRef } from \"react\";\nimport type { HTMLAttributes, ReactNode } from \"react\";\nimport { cn } from \"@/lib/cn\";\n\nexport type LaneState = \"started\" | \"blocked\" | \"failed\" | \"finished\";\n\nexport interface LaneCard {\n id: string;\n /** Card title (e.g. task name). */\n title: ReactNode;\n /** Optional description / preview. */\n description?: ReactNode;\n /** Optional footer / metadata row. */\n footer?: ReactNode;\n}\n\nexport interface Lane {\n state: LaneState;\n cards: LaneCard[];\n}\n\ninterface LaneBoardProps extends Omit<HTMLAttributes<HTMLDivElement>, \"title\"> {\n lanes: Lane[];\n title?: ReactNode;\n}\n\nconst LANE_META: Record<LaneState, { label: string; headerClass: string; cardClass: string }> = {\n started: {\n label: \"Started\",\n headerClass: \"text-primary\",\n cardClass: \"border-primary/30 bg-primary/5\",\n },\n blocked: {\n label: \"Blocked\",\n headerClass: \"text-warning\",\n cardClass: \"border-warning/40 bg-warning/5\",\n },\n failed: {\n label: \"Failed\",\n headerClass: \"text-destructive\",\n cardClass: \"border-destructive/40 bg-destructive/5\",\n },\n finished: {\n label: \"Finished\",\n headerClass: \"text-success\",\n cardClass: \"border-success/40 bg-success/5\",\n },\n};\n\n/**\n * LaneBoard — kanban-style task board with 4 lanes matching the claw-code\n * lane event schema (started/blocked/failed/finished). Each card is a\n * machine-readable task snapshot the agent emits.\n */\nconst LaneBoard = forwardRef<HTMLDivElement, LaneBoardProps>(\n ({ className, lanes, title, ...props }, ref) => (\n <section\n ref={ref}\n className={cn(\"grid gap-3\", className)}\n aria-label=\"Agent lane board\"\n {...props}\n >\n {title ? <h3 className=\"font-display text-title-md tracking-tight\">{title}</h3> : null}\n <div className=\"grid grid-cols-1 gap-3 md:grid-cols-2 lg:grid-cols-4\">\n {lanes.map((lane) => {\n const meta = LANE_META[lane.state];\n return (\n <div\n key={lane.state}\n className=\"grid auto-rows-max gap-2 rounded-xl border border-border/40 bg-card p-3\"\n >\n <header className=\"flex items-center justify-between px-1\">\n <span\n className={cn(\n \"font-mono text-label-caps uppercase tracking-wider\",\n meta.headerClass,\n )}\n >\n {meta.label}\n </span>\n <span className=\"font-mono text-label text-muted-foreground tabular-nums\">\n {lane.cards.length}\n </span>\n </header>\n {lane.cards.length === 0 ? (\n <p className=\"rounded-md border border-border/40 border-dashed px-3 py-4 text-center font-sans text-body-sm text-muted-foreground\">\n empty\n </p>\n ) : (\n <ul className=\"grid gap-2\">\n {lane.cards.map((card) => (\n <li\n key={card.id}\n className={cn(\"grid gap-1 rounded-md border p-3\", meta.cardClass)}\n >\n <p className=\"font-medium text-body-sm text-foreground\">{card.title}</p>\n {card.description ? (\n <p className=\"text-body-sm text-muted-foreground\">{card.description}</p>\n ) : null}\n {card.footer ? (\n <p className=\"font-mono text-label text-muted-foreground\">{card.footer}</p>\n ) : null}\n </li>\n ))}\n </ul>\n )}\n </div>\n );\n })}\n </div>\n </section>\n ),\n);\nLaneBoard.displayName = \"LaneBoard\";\n\nexport { LaneBoard };\n"
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
|
+
"name": "live-region-context",
|
|
4
|
+
"type": "registry:lib",
|
|
5
|
+
"title": "LiveRegionContext",
|
|
6
|
+
"description": "React context that coordinates aria-live declarations across nested components to prevent screen-reader double-announcement (T4.1).",
|
|
7
|
+
"dependencies": [],
|
|
8
|
+
"files": [
|
|
9
|
+
{
|
|
10
|
+
"path": "lib/live-region-context.tsx",
|
|
11
|
+
"type": "registry:lib",
|
|
12
|
+
"target": "lib/live-region-context.tsx",
|
|
13
|
+
"content": "import { createContext, useContext } from \"react\";\n\n/**\n * LiveRegionContext — coordinates `aria-live` declarations across nested\n * components so screen readers don't announce content twice.\n *\n * T4.1 (MF-4, edge-case review). Problem: a container component that\n * declares `role=\"log\" aria-live=\"polite\"` (e.g. `ChatThread`,\n * `AgentStream`) may render a child component that ALSO declares its own\n * `role=\"status\" aria-live=\"polite\"` (e.g. `AgentStreaming`,\n * `AgentErrorCard`). NVDA/JAWS/VoiceOver treat each live region as an\n * independent announcement source, so updates to the child trigger TWO\n * announcements — once from the inner status, once because the outer\n * log observes the DOM mutation. Result: stutter on every streaming\n * token, every new toast, every skeleton mount inside a log.\n *\n * Solution: container components wrap their content with\n * `<LiveRegionProvider value={true}>`. Child components call\n * `useInLiveRegion()` and omit their own `aria-live` / `role` when the\n * context is true. The outer region remains the single announcement\n * source.\n *\n * Default is `false` so standalone components (e.g., a single\n * `AgentStreaming` placed directly in a page) keep their original\n * announcement semantics with zero migration cost.\n *\n * @example\n * // Container declares the live region\n * <LiveRegionProvider value={true}>\n * <div role=\"log\" aria-live=\"polite\">\n * {children}\n * </div>\n * </LiveRegionProvider>\n *\n * // Child reads context to decide its own ARIA attrs\n * const inLiveRegion = useInLiveRegion();\n * return (\n * <div\n * role={inLiveRegion ? undefined : \"status\"}\n * aria-live={inLiveRegion ? undefined : \"polite\"}\n * >\n * ...\n * </div>\n * );\n */\n\nconst LiveRegionContext = createContext<boolean>(false);\n\nexport const LiveRegionProvider = LiveRegionContext.Provider;\n\nexport function useInLiveRegion(): boolean {\n return useContext(LiveRegionContext);\n}\n"
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
|
+
"name": "login-split",
|
|
4
|
+
"type": "registry:ui",
|
|
5
|
+
"title": "LoginSplit",
|
|
6
|
+
"description": "50/50 split shell for authentication screens — form pane on the left, illustration on the right.",
|
|
7
|
+
"dependencies": [],
|
|
8
|
+
"registryDependencies": [
|
|
9
|
+
"https://usetheodev.github.io/theo-ui/r/cn.json",
|
|
10
|
+
"https://usetheodev.github.io/theo-ui/r/tailwind-preset.json"
|
|
11
|
+
],
|
|
12
|
+
"files": [
|
|
13
|
+
{
|
|
14
|
+
"path": "components/primitives/login-split/login-split.tsx",
|
|
15
|
+
"type": "registry:ui",
|
|
16
|
+
"target": "components/ui/login-split.tsx",
|
|
17
|
+
"content": "import { forwardRef } from \"react\";\nimport type { HTMLAttributes, ReactNode } from \"react\";\nimport { cn } from \"@/lib/cn\";\n\ninterface LoginSplitProps extends HTMLAttributes<HTMLDivElement> {\n /** Left pane content — form, brand, etc. */\n left: ReactNode;\n /** Right pane content — illustration, marketing, social proof. */\n right: ReactNode;\n /**\n * Optional footer rendered below both panes.\n */\n footer?: ReactNode;\n /**\n * Reverse the split (form on the right). Default = form left.\n */\n reverse?: boolean;\n}\n\n/**\n * LoginSplit — 50/50 split layout shell.\n *\n * Used for the auth flow. Two slots (`left`, `right`); the right pane has a\n * subtle violet wash so the illustration sits inside Theo identity. Mobile\n * collapses to single column.\n */\nconst LoginSplit = forwardRef<HTMLDivElement, LoginSplitProps>(\n ({ className, left, right, footer, reverse, ...props }, ref) => (\n <div ref={ref} className={cn(\"flex min-h-screen flex-col bg-background\", className)} {...props}>\n <div\n className={cn(\n \"grid flex-1 grid-cols-1 lg:grid-cols-2\",\n reverse && \"lg:[&>*:first-child]:order-2\",\n )}\n >\n <div className=\"flex items-center justify-center px-6 py-12 lg:px-12\">\n <div className=\"w-full max-w-md\">{left}</div>\n </div>\n <div\n className={cn(\n \"relative flex items-center justify-center px-6 py-12 lg:px-12\",\n \"bg-dotted-violet bg-muted/60\",\n )}\n >\n <div className=\"w-full max-w-lg\">{right}</div>\n </div>\n </div>\n {footer ? (\n <footer className=\"border-border/40 border-t px-6 py-3 text-center text-body-sm text-muted-foreground\">\n {footer}\n </footer>\n ) : null}\n </div>\n ),\n);\nLoginSplit.displayName = \"LoginSplit\";\n\nexport { LoginSplit };\n"
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
|
+
"name": "mcp-server-card",
|
|
4
|
+
"type": "registry:ui",
|
|
5
|
+
"title": "McpServerCard",
|
|
6
|
+
"description": "One MCP server entry showing connection status, the tools",
|
|
7
|
+
"dependencies": [
|
|
8
|
+
"lucide-react"
|
|
9
|
+
],
|
|
10
|
+
"registryDependencies": [
|
|
11
|
+
"https://usetheodev.github.io/theo-ui/r/cn.json",
|
|
12
|
+
"https://usetheodev.github.io/theo-ui/r/tailwind-preset.json"
|
|
13
|
+
],
|
|
14
|
+
"files": [
|
|
15
|
+
{
|
|
16
|
+
"path": "components/primitives/mcp-server-card/mcp-server-card.tsx",
|
|
17
|
+
"type": "registry:ui",
|
|
18
|
+
"target": "components/ui/mcp-server-card.tsx",
|
|
19
|
+
"content": "import { Plug, RotateCcw, Server } from \"lucide-react\";\nimport { forwardRef } from \"react\";\nimport type { HTMLAttributes, ReactNode } from \"react\";\nimport { cn } from \"@/lib/cn\";\n\nexport type MCPServerStatus = \"connected\" | \"degraded\" | \"disconnected\" | \"starting\";\n\nexport interface MCPServer {\n id: string;\n /** Friendly name, e.g. \"postgres\". */\n name: string;\n /** Transport endpoint (stdio command or URL). */\n endpoint: string;\n status: MCPServerStatus;\n /** Tools exposed by the server. */\n tools: string[];\n /** Optional resources exposed. */\n resources?: string[];\n /** Diagnostic message when degraded/disconnected. */\n message?: ReactNode;\n /** Auto-restart toggle hint. */\n autoRestart?: boolean;\n}\n\nconst STATUS_CONFIG: Record<MCPServerStatus, { label: string; class: string }> = {\n connected: { label: \"Connected\", class: \"border-success/40 bg-success/15 text-success\" },\n starting: {\n label: \"Starting\",\n class: \"border-primary/40 bg-primary/15 text-primary animate-pulse\",\n },\n degraded: { label: \"Degraded\", class: \"border-warning/40 bg-warning/15 text-warning\" },\n disconnected: {\n label: \"Disconnected\",\n class: \"border-destructive/40 bg-destructive/15 text-destructive\",\n },\n};\n\ninterface MCPServerCardProps extends HTMLAttributes<HTMLElement> {\n server: MCPServer;\n onRestart?: (id: string) => void;\n onDisconnect?: (id: string) => void;\n}\n\n/**\n * MCPServerCard — one MCP server entry showing connection status, the tools\n * it exposes, and inline controls (restart, disconnect).\n *\n * Pairs with claw-code's \"degraded startup reporting\" — failed servers can\n * still appear here with a recovery message.\n */\nconst MCPServerCard = forwardRef<HTMLElement, MCPServerCardProps>(\n ({ className, server, onRestart, onDisconnect, ...props }, ref) => {\n const cfg = STATUS_CONFIG[server.status];\n return (\n <article\n ref={ref}\n className={cn(\"grid gap-3 rounded-xl border bg-card p-4\", className)}\n {...props}\n >\n <header className=\"flex items-start justify-between gap-3\">\n <div className=\"flex min-w-0 items-center gap-2\">\n <Server className=\"size-4 shrink-0 text-primary\" aria-hidden=\"true\" />\n <div className=\"min-w-0\">\n <h4 className=\"font-medium font-mono text-body-sm text-foreground\">{server.name}</h4>\n <p className=\"truncate font-mono text-label text-muted-foreground\">\n {server.endpoint}\n </p>\n </div>\n </div>\n <span\n className={cn(\n \"inline-flex shrink-0 items-center rounded-full border px-2.5 py-0.5\",\n \"font-mono text-label uppercase tracking-wider\",\n cfg.class,\n )}\n >\n {cfg.label}\n </span>\n </header>\n\n {server.message ? (\n <p className=\"rounded-md border border-warning/30 bg-warning/10 px-3 py-2 font-mono text-code-sm text-warning\">\n {server.message}\n </p>\n ) : null}\n\n {server.tools.length > 0 ? (\n <div className=\"grid gap-1.5\">\n <span className=\"font-mono text-label-caps text-muted-foreground uppercase tracking-wider\">\n {server.tools.length} tools\n </span>\n <div className=\"flex flex-wrap gap-1.5\">\n {server.tools.map((tool) => (\n <span\n key={tool}\n className=\"inline-flex items-center rounded-md bg-muted px-2 py-0.5 font-mono text-foreground text-label\"\n >\n {tool}\n </span>\n ))}\n </div>\n </div>\n ) : null}\n\n {server.resources && server.resources.length > 0 ? (\n <div className=\"grid gap-1.5\">\n <span className=\"font-mono text-label-caps text-muted-foreground uppercase tracking-wider\">\n {server.resources.length} resources\n </span>\n <div className=\"flex flex-wrap gap-1.5\">\n {server.resources.map((r) => (\n <span\n key={r}\n className=\"inline-flex items-center rounded-md bg-accent/10 px-2 py-0.5 font-mono text-accent text-label\"\n >\n {r}\n </span>\n ))}\n </div>\n </div>\n ) : null}\n\n <footer className=\"flex items-center justify-end gap-1.5\">\n {onRestart ? (\n <button\n type=\"button\"\n onClick={() => onRestart(server.id)}\n className=\"inline-flex items-center gap-1.5 rounded-md border border-border/60 bg-card px-2.5 py-1 font-mono text-label hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n >\n <RotateCcw className=\"size-3\" /> Restart\n </button>\n ) : null}\n {onDisconnect ? (\n <button\n type=\"button\"\n onClick={() => onDisconnect(server.id)}\n className=\"inline-flex items-center gap-1.5 rounded-md border border-border/60 bg-card px-2.5 py-1 font-mono text-label hover:bg-muted hover:text-destructive focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n >\n <Plug className=\"size-3\" /> Disconnect\n </button>\n ) : null}\n </footer>\n </article>\n );\n },\n);\nMCPServerCard.displayName = \"MCPServerCard\";\n\nexport { MCPServerCard };\n"
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
|
+
"name": "mcp-server-list",
|
|
4
|
+
"type": "registry:block",
|
|
5
|
+
"title": "McpServerList",
|
|
6
|
+
"description": "Grouped MCP server inventory with status filter chips.",
|
|
7
|
+
"dependencies": [
|
|
8
|
+
"lucide-react"
|
|
9
|
+
],
|
|
10
|
+
"registryDependencies": [
|
|
11
|
+
"https://usetheodev.github.io/theo-ui/r/cn.json",
|
|
12
|
+
"https://usetheodev.github.io/theo-ui/r/mcp-server-card.json",
|
|
13
|
+
"https://usetheodev.github.io/theo-ui/r/tailwind-preset.json"
|
|
14
|
+
],
|
|
15
|
+
"files": [
|
|
16
|
+
{
|
|
17
|
+
"path": "components/composites/mcp-server-list/mcp-server-list.tsx",
|
|
18
|
+
"type": "registry:block",
|
|
19
|
+
"target": "components/blocks/mcp-server-list.tsx",
|
|
20
|
+
"content": "import { Plus } from \"lucide-react\";\nimport { forwardRef, useMemo, useState } from \"react\";\nimport type { HTMLAttributes, ReactNode } from \"react\";\nimport { cn } from \"@/lib/cn\";\nimport {\n type MCPServer,\n MCPServerCard,\n type MCPServerStatus,\n} from \"@/components/ui/mcp-server-card\";\n\ninterface MCPServerListProps extends Omit<HTMLAttributes<HTMLDivElement>, \"title\"> {\n servers: MCPServer[];\n title?: ReactNode;\n onAdd?: () => void;\n onRestart?: (id: string) => void;\n onDisconnect?: (id: string) => void;\n}\n\nconst STATUS_ORDER: MCPServerStatus[] = [\"connected\", \"starting\", \"degraded\", \"disconnected\"];\n\n/**\n * MCPServerList — grouped MCP server inventory with status filter chips.\n * Surfaces degraded/disconnected servers prominently so the user can act.\n */\nconst MCPServerList = forwardRef<HTMLDivElement, MCPServerListProps>(\n (\n { className, servers, title = \"MCP servers\", onAdd, onRestart, onDisconnect, ...props },\n ref,\n ) => {\n const [filter, setFilter] = useState<MCPServerStatus | null>(null);\n\n const counts = useMemo(() => {\n const result: Record<MCPServerStatus, number> = {\n connected: 0,\n starting: 0,\n degraded: 0,\n disconnected: 0,\n };\n for (const s of servers) result[s.status]++;\n return result;\n }, [servers]);\n\n const filtered = useMemo(\n () => (filter ? servers.filter((s) => s.status === filter) : servers),\n [servers, filter],\n );\n\n return (\n <section\n ref={ref}\n className={cn(\"grid gap-3\", className)}\n aria-label=\"MCP servers\"\n {...props}\n >\n <header className=\"flex flex-wrap items-center justify-between gap-3\">\n {title ? (\n <h3 className=\"font-display text-title-md tracking-tight\">{title}</h3>\n ) : (\n <span />\n )}\n <div className=\"flex items-center gap-2\">\n <div className=\"inline-flex rounded-lg border border-border/60 bg-muted p-0.5\">\n <button\n type=\"button\"\n onClick={() => setFilter(null)}\n aria-pressed={filter === null}\n className={cn(\n \"rounded-md px-2.5 py-1 font-mono text-label\",\n filter === null ? \"bg-card text-foreground shadow-sm\" : \"text-muted-foreground\",\n )}\n >\n All · {servers.length}\n </button>\n {STATUS_ORDER.map((status) => (\n <button\n key={status}\n type=\"button\"\n onClick={() => setFilter(status)}\n aria-pressed={filter === status}\n disabled={counts[status] === 0}\n className={cn(\n \"rounded-md px-2.5 py-1 font-mono text-label uppercase\",\n filter === status\n ? \"bg-card text-foreground shadow-sm\"\n : \"text-muted-foreground\",\n \"disabled:opacity-40\",\n )}\n >\n {status} · {counts[status]}\n </button>\n ))}\n </div>\n {onAdd ? (\n <button\n type=\"button\"\n onClick={onAdd}\n className=\"inline-flex items-center gap-1 rounded-md bg-primary px-2.5 py-1 font-sans text-label text-primary-foreground hover:shadow-glow focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n >\n <Plus className=\"size-3.5\" /> Add server\n </button>\n ) : null}\n </div>\n </header>\n\n {filtered.length === 0 ? (\n <p className=\"rounded-xl border border-border/60 border-dashed bg-muted/30 px-4 py-8 text-center font-sans text-body-sm text-muted-foreground\">\n No servers in this state.\n </p>\n ) : (\n <div className=\"grid grid-cols-1 gap-3 md:grid-cols-2\">\n {filtered.map((server) => (\n <MCPServerCard\n key={server.id}\n server={server}\n {...(onRestart ? { onRestart } : {})}\n {...(onDisconnect ? { onDisconnect } : {})}\n />\n ))}\n </div>\n )}\n </section>\n );\n },\n);\nMCPServerList.displayName = \"MCPServerList\";\n\nexport { MCPServerList };\n"
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
|
+
"name": "memory-editor",
|
|
4
|
+
"type": "registry:ui",
|
|
5
|
+
"title": "MemoryEditor",
|
|
6
|
+
"description": "Three-layer Markdown memory editor (global / project /",
|
|
7
|
+
"dependencies": [
|
|
8
|
+
"lucide-react"
|
|
9
|
+
],
|
|
10
|
+
"registryDependencies": [
|
|
11
|
+
"https://usetheodev.github.io/theo-ui/r/cn.json",
|
|
12
|
+
"https://usetheodev.github.io/theo-ui/r/tailwind-preset.json",
|
|
13
|
+
"https://usetheodev.github.io/theo-ui/r/types.json"
|
|
14
|
+
],
|
|
15
|
+
"files": [
|
|
16
|
+
{
|
|
17
|
+
"path": "components/primitives/memory-editor/memory-editor.tsx",
|
|
18
|
+
"type": "registry:ui",
|
|
19
|
+
"target": "components/ui/memory-editor.tsx",
|
|
20
|
+
"content": "import { Brain, Folder, FolderOpen, User } from \"lucide-react\";\nimport { forwardRef } from \"react\";\nimport type { HTMLAttributes, ReactNode } from \"react\";\nimport { cn } from \"@/lib/cn\";\nimport type { IconComponent } from \"@/lib/types\";\n\nexport type MemoryScope = \"global\" | \"project\" | \"session\";\n\nexport interface MemoryLayer {\n scope: MemoryScope;\n /** File path on disk for transparency. */\n path: string;\n /** Markdown content. */\n content: string;\n /** Last modified label, e.g. \"2m ago\". */\n modifiedAt?: string;\n}\n\ninterface MemoryEditorProps extends Omit<HTMLAttributes<HTMLDivElement>, \"title\"> {\n layers: MemoryLayer[];\n /** Currently active layer for editing. */\n activeScope: MemoryScope;\n onScopeChange: (scope: MemoryScope) => void;\n onContentChange: (scope: MemoryScope, next: string) => void;\n title?: ReactNode;\n}\n\nconst SCOPE_META: Record<MemoryScope, { label: string; icon: IconComponent; hint: string }> = {\n global: { label: \"Global\", icon: User, hint: \"Applies to every project for this user.\" },\n project: {\n label: \"Project\",\n icon: FolderOpen,\n hint: \"Versioned with the project. Shared by team.\",\n },\n session: { label: \"Session\", icon: Folder, hint: \"This session only. Wiped on exit.\" },\n};\n\n/**\n * MemoryEditor — three-layer Markdown memory editor (global / project /\n * session) mirroring Claude Code's CLAUDE.md hierarchy.\n *\n * Each scope keeps its own file. Switching scopes via tab updates which\n * layer is being edited. Path is shown explicitly so users know where the\n * content lives on disk.\n */\nconst MemoryEditor = forwardRef<HTMLDivElement, MemoryEditorProps>(\n (\n { className, layers, activeScope, onScopeChange, onContentChange, title = \"Memory\", ...props },\n ref,\n ) => {\n const active = layers.find((l) => l.scope === activeScope);\n const ActiveIcon = active ? SCOPE_META[active.scope].icon : Brain;\n return (\n <section ref={ref} className={cn(\"rounded-xl border bg-card\", className)} {...props}>\n <header className=\"flex items-center justify-between gap-3 border-border/40 border-b px-4 py-3\">\n <div className=\"flex items-center gap-2\">\n <Brain className=\"size-4 text-primary\" aria-hidden=\"true\" />\n <h3 className=\"font-display text-title-md tracking-tight\">{title}</h3>\n </div>\n <div className=\"inline-flex items-center rounded-lg border border-border/60 bg-muted p-0.5\">\n {([\"global\", \"project\", \"session\"] as const).map((scope) => {\n const meta = SCOPE_META[scope];\n const Icon = meta.icon;\n const isActive = scope === activeScope;\n return (\n <button\n key={scope}\n type=\"button\"\n onClick={() => onScopeChange(scope)}\n aria-pressed={isActive}\n className={cn(\n \"inline-flex items-center gap-1.5 rounded-md px-2.5 py-1\",\n \"font-sans text-label transition-colors\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n isActive\n ? \"bg-card text-foreground shadow-sm\"\n : \"text-muted-foreground hover:text-foreground\",\n )}\n >\n <Icon className=\"size-3\" />\n {meta.label}\n </button>\n );\n })}\n </div>\n </header>\n\n {active ? (\n <>\n <div className=\"flex items-center justify-between gap-3 border-border/40 border-b bg-muted/30 px-4 py-2\">\n <div className=\"flex min-w-0 items-center gap-2\">\n <ActiveIcon className=\"size-3 shrink-0 text-muted-foreground\" aria-hidden=\"true\" />\n <span className=\"truncate font-mono text-code-sm text-foreground\">\n {active.path}\n </span>\n {active.modifiedAt ? (\n <span className=\"shrink-0 font-mono text-label text-muted-foreground\">\n · {active.modifiedAt}\n </span>\n ) : null}\n </div>\n <span className=\"font-sans text-label text-muted-foreground italic\">\n {SCOPE_META[active.scope].hint}\n </span>\n </div>\n <textarea\n value={active.content}\n onChange={(e) => onContentChange(active.scope, e.target.value)}\n rows={12}\n className=\"w-full resize-y bg-transparent px-4 py-3 font-mono text-code-md text-foreground placeholder:text-muted-foreground focus:outline-none\"\n placeholder={`# ${SCOPE_META[active.scope].label} notes\\n\\nWrite Markdown the agent should keep in context.`}\n />\n </>\n ) : null}\n </section>\n );\n },\n);\nMemoryEditor.displayName = \"MemoryEditor\";\n\nexport { MemoryEditor };\n"
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
|
+
"name": "mention-menu",
|
|
4
|
+
"type": "registry:ui",
|
|
5
|
+
"title": "MentionMenu",
|
|
6
|
+
"description": "Keyboard-navigable popover for slash-command / @file / #memory",
|
|
7
|
+
"dependencies": [
|
|
8
|
+
"lucide-react"
|
|
9
|
+
],
|
|
10
|
+
"registryDependencies": [
|
|
11
|
+
"https://usetheodev.github.io/theo-ui/r/cn.json",
|
|
12
|
+
"https://usetheodev.github.io/theo-ui/r/tailwind-preset.json",
|
|
13
|
+
"https://usetheodev.github.io/theo-ui/r/types.json"
|
|
14
|
+
],
|
|
15
|
+
"files": [
|
|
16
|
+
{
|
|
17
|
+
"path": "components/primitives/mention-menu/mention-menu.tsx",
|
|
18
|
+
"type": "registry:ui",
|
|
19
|
+
"target": "components/ui/mention-menu.tsx",
|
|
20
|
+
"content": "import { Hash, type LucideIcon, Slash } from \"lucide-react\";\nimport { useEffect, useRef, useState } from \"react\";\nimport type { ReactNode } from \"react\";\nimport { cn } from \"@/lib/cn\";\nimport type { IconComponent } from \"@/lib/types\";\n\nexport interface MentionItem {\n id: string;\n /** Primary label shown on the row. */\n label: ReactNode;\n /** Secondary one-line description (optional). */\n description?: ReactNode;\n /** Optional per-row icon override. */\n icon?: IconComponent;\n}\n\n/** Trigger character — drives the default header + icon if not overridden. */\nexport type MentionTrigger = \"/\" | \"@\" | \"#\";\n\ninterface MentionMenuProps {\n /** Whether the panel is open. The consumer (composer) controls this. */\n open: boolean;\n /** Trigger character that opened the menu — used for default title + icon. */\n trigger: MentionTrigger;\n /** Items to display (already filtered by the consumer). */\n items: MentionItem[];\n /** Fires when the user selects an item via click or Enter. */\n onSelect: (item: MentionItem) => void;\n /** Fires when the user dismisses (Esc, click outside). */\n onClose: () => void;\n /** Title above the list. Defaults to the trigger's domain (\"Commands\", \"Files\", \"Memories\"). */\n title?: ReactNode;\n /** Empty-state message when items is empty. */\n emptyLabel?: ReactNode;\n /** Override the alignment relative to its anchor. Default: above-left. */\n className?: string;\n}\n\nconst DEFAULT_TITLE: Record<MentionTrigger, string> = {\n \"/\": \"Commands\",\n \"@\": \"Files\",\n \"#\": \"Memories\",\n};\n\nconst DEFAULT_ICON: Record<MentionTrigger, LucideIcon> = {\n \"/\": Slash,\n \"@\": Slash,\n \"#\": Hash,\n};\n\n/**\n * MentionMenu — keyboard-navigable popover for slash-command / @file / #memory\n * triggers inside an agent composer.\n *\n * Generic by design: the consumer decides what items appear for each trigger\n * (commands list, file search, memory lookup, …). MentionMenu owns the visual\n * presentation, selection highlight, Esc/Enter/Arrow keys.\n *\n * Position: absolute, anchored to the closest positioned ancestor — usually\n * the composer wrapper. Default `bottom-full left-0` (above the composer).\n */\nexport function MentionMenu({\n open,\n trigger,\n items,\n onSelect,\n onClose,\n title,\n emptyLabel = \"No matches\",\n className,\n}: MentionMenuProps) {\n const [activeIndex, setActiveIndex] = useState(0);\n const listRef = useRef<HTMLUListElement>(null);\n\n const resolvedTitle = title ?? DEFAULT_TITLE[trigger];\n const TriggerIcon = DEFAULT_ICON[trigger];\n\n // Clamp the highlighted index whenever items change.\n useEffect(() => {\n if (activeIndex >= items.length) setActiveIndex(Math.max(0, items.length - 1));\n }, [items.length, activeIndex]);\n\n // Reset highlight when the menu opens / trigger changes.\n // biome-ignore lint/correctness/useExhaustiveDependencies: intentional reset on open/trigger\n useEffect(() => {\n if (open) setActiveIndex(0);\n }, [open, trigger]);\n\n // Global keyboard handler — Arrows / Enter / Esc. Captures while open.\n useEffect(() => {\n if (!open) return;\n const onKey = (e: KeyboardEvent) => {\n if (e.key === \"ArrowDown\") {\n e.preventDefault();\n setActiveIndex((i) => Math.min(items.length - 1, i + 1));\n } else if (e.key === \"ArrowUp\") {\n e.preventDefault();\n setActiveIndex((i) => Math.max(0, i - 1));\n } else if (e.key === \"Enter\") {\n if (items.length === 0) return;\n e.preventDefault();\n const item = items[activeIndex];\n if (item) onSelect(item);\n } else if (e.key === \"Escape\") {\n e.preventDefault();\n onClose();\n }\n };\n window.addEventListener(\"keydown\", onKey, true);\n return () => window.removeEventListener(\"keydown\", onKey, true);\n }, [open, items, activeIndex, onSelect, onClose]);\n\n if (!open) return null;\n\n return (\n <div\n role=\"menu\"\n aria-orientation=\"vertical\"\n aria-label={typeof resolvedTitle === \"string\" ? resolvedTitle : \"Mention menu\"}\n tabIndex={-1}\n className={cn(\n \"absolute bottom-full left-0 z-40 mb-2 w-[22rem] max-w-full\",\n \"overflow-hidden rounded-lg border bg-popover text-popover-foreground shadow-md\",\n \"data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:animate-in\",\n className,\n )}\n data-state=\"open\"\n >\n <div\n role=\"presentation\"\n className=\"flex items-center justify-between gap-2 border-border/40 border-b bg-muted/30 px-3 py-2\"\n >\n <span className=\"inline-flex items-center gap-1.5 font-mono text-label text-muted-foreground uppercase tracking-wider\">\n <TriggerIcon className=\"size-3\" aria-hidden=\"true\" />\n {resolvedTitle}\n </span>\n <span className=\"font-mono text-label text-muted-foreground tabular-nums\">\n {items.length}\n </span>\n </div>\n {items.length === 0 ? (\n <div role=\"presentation\" className=\"px-3 py-4 text-body-sm text-muted-foreground\">\n {emptyLabel}\n </div>\n ) : (\n <ul ref={listRef} role=\"presentation\" className=\"max-h-[18rem] overflow-y-auto py-1\">\n {items.map((item, idx) => {\n const Icon = item.icon;\n const active = idx === activeIndex;\n return (\n <li key={item.id} role=\"presentation\">\n <button\n type=\"button\"\n role=\"menuitem\"\n onMouseEnter={() => setActiveIndex(idx)}\n // Prevent textarea from losing focus on click so the caret stays put.\n onMouseDown={(e) => e.preventDefault()}\n onClick={() => onSelect(item)}\n className={cn(\n \"flex w-full items-start gap-3 px-3 py-2 text-left\",\n \"transition-colors duration-base ease-out-soft\",\n active ? \"bg-muted\" : \"hover:bg-muted/60\",\n )}\n data-active={active || undefined}\n >\n {Icon ? (\n <Icon\n className=\"mt-0.5 size-4 shrink-0 text-muted-foreground\"\n aria-hidden=\"true\"\n />\n ) : null}\n <span className=\"grid min-w-0 flex-1 gap-0.5\">\n <span className=\"truncate font-medium font-mono text-code-md\">\n {item.label}\n </span>\n {item.description ? (\n <span className=\"truncate font-sans text-label text-muted-foreground\">\n {item.description}\n </span>\n ) : null}\n </span>\n </button>\n </li>\n );\n })}\n </ul>\n )}\n </div>\n );\n}\n"
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
|
+
"name": "metrics-panel",
|
|
4
|
+
"type": "registry:block",
|
|
5
|
+
"title": "MetricsPanel",
|
|
6
|
+
"description": "Grid of metric tiles for observability dashboards.",
|
|
7
|
+
"dependencies": [
|
|
8
|
+
"lucide-react"
|
|
9
|
+
],
|
|
10
|
+
"registryDependencies": [
|
|
11
|
+
"https://usetheodev.github.io/theo-ui/r/cn.json",
|
|
12
|
+
"https://usetheodev.github.io/theo-ui/r/tailwind-preset.json"
|
|
13
|
+
],
|
|
14
|
+
"files": [
|
|
15
|
+
{
|
|
16
|
+
"path": "components/primitives/metrics-panel/metrics-panel.tsx",
|
|
17
|
+
"type": "registry:block",
|
|
18
|
+
"target": "components/blocks/metrics-panel.tsx",
|
|
19
|
+
"content": "import { TrendingDown, TrendingUp } from \"lucide-react\";\nimport { forwardRef } from \"react\";\nimport type { HTMLAttributes, ReactNode } from \"react\";\nimport { cn } from \"@/lib/cn\";\n\nexport interface Metric {\n /**\n * Short label, e.g. \"Requests/s\", \"p95 latency\", \"Error rate\".\n */\n label: string;\n /**\n * Pre-formatted value string, e.g. \"1.2k\", \"182ms\", \"0.03%\".\n * Consumer formats; the component does not parse.\n */\n value: string;\n /**\n * Optional unit suffix appended after value with .9 opacity.\n */\n unit?: string;\n /**\n * Optional change vs comparison period, e.g. \"+12%\", \"-4ms\", \"+0.01pp\".\n */\n delta?: string;\n /**\n * If true, delta is \"good\" (success color); if false, \"bad\" (destructive).\n * If omitted, delta is rendered in muted (neutral).\n *\n * Caller decides semantics — \"more requests\" is good but \"more errors\" is bad.\n */\n deltaGood?: boolean;\n /**\n * Optional sparkline data, 0..1 normalized. Consumer is responsible for normalization.\n */\n sparkline?: number[];\n /**\n * Optional onClick to drill into the metric.\n */\n onClick?: () => void;\n /**\n * Optional override for the clickable tile's accessible name. When the\n * tile is interactive (`onClick` set), defaults to `View <label> details`.\n * Has no effect when `onClick` is absent (tile is rendered as a non-link\n * `<div>` with no button semantics). T4.3.\n */\n actionLabel?: string;\n}\n\ninterface MetricsPanelProps extends Omit<HTMLAttributes<HTMLDivElement>, \"title\"> {\n title?: ReactNode;\n description?: ReactNode;\n metrics: Metric[];\n /**\n * Grid columns. Defaults to auto-fit ~180px min.\n */\n columns?: number;\n}\n\n/**\n * MetricsPanel — grid of metric tiles for observability dashboards.\n *\n * Visual: each tile is a soft surface with a big value (font-display),\n * label uppercase muted, optional delta with arrow icon + tone color,\n * optional CSS-only sparkline drawn as flexed bars.\n *\n * No external chart lib — keeps the registry copy-pasteable.\n */\nconst MetricsPanel = forwardRef<HTMLDivElement, MetricsPanelProps>(\n ({ className, title, description, metrics, columns, ...props }, ref) => (\n <div ref={ref} className={cn(\"rounded-xl border bg-card p-5 shadow-sm\", className)} {...props}>\n {title || description ? (\n <header className=\"mb-4 grid gap-0.5\">\n {title ? <h3 className=\"font-display text-title-md tracking-tight\">{title}</h3> : null}\n {description ? <p className=\"text-body-sm text-muted-foreground\">{description}</p> : null}\n </header>\n ) : null}\n <div\n className=\"grid gap-4\"\n style={{\n gridTemplateColumns: columns\n ? `repeat(${columns}, minmax(0, 1fr))`\n : \"repeat(auto-fit, minmax(180px, 1fr))\",\n }}\n >\n {metrics.map((m) => (\n <Tile key={m.label} metric={m} />\n ))}\n </div>\n </div>\n ),\n);\nMetricsPanel.displayName = \"MetricsPanel\";\n\nfunction Tile({ metric }: { metric: Metric }) {\n const interactive = metric.onClick !== undefined;\n const Tag = interactive ? \"button\" : \"div\";\n // T4.3 (Code Issue 3): clickable tiles need an explicit accessible name\n // so AT users hear \"View Requests/s details, button\" instead of just\n // the spoken value cluster. Falls back to metric.actionLabel when the\n // caller wants custom text (e.g., \"Drill into requests\").\n const ariaLabel = interactive\n ? (metric.actionLabel ?? `View ${metric.label} details`)\n : undefined;\n return (\n <Tag\n type={interactive ? \"button\" : undefined}\n onClick={metric.onClick}\n aria-label={ariaLabel}\n className={cn(\n \"flex flex-col gap-2 rounded-lg border border-border/30 bg-muted/30 p-4 text-left\",\n \"transition-colors duration-base ease-out-soft\",\n interactive &&\n \"hover:border-primary/40 hover:bg-muted/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-card\",\n )}\n >\n <span className=\"font-sans text-label-caps text-muted-foreground uppercase\">\n {metric.label}\n </span>\n <div className=\"flex items-baseline gap-1.5\">\n <span className=\"font-bold font-display text-display-md tabular-nums leading-none\">\n {metric.value}\n </span>\n {metric.unit ? (\n <span className=\"font-mono text-body-sm text-muted-foreground\">{metric.unit}</span>\n ) : null}\n </div>\n <div className=\"flex items-center gap-2\">\n {metric.delta ? <Delta metric={metric} /> : null}\n {metric.sparkline && metric.sparkline.length > 0 ? (\n <Sparkline values={metric.sparkline} />\n ) : null}\n </div>\n </Tag>\n );\n}\n\nfunction Delta({ metric }: { metric: Metric }) {\n const tone =\n metric.deltaGood === undefined\n ? \"text-muted-foreground\"\n : metric.deltaGood\n ? \"text-success\"\n : \"text-destructive\";\n const Icon = metric.deltaGood === false ? TrendingDown : TrendingUp;\n return (\n <span className={cn(\"inline-flex items-center gap-1 font-mono text-body-sm\", tone)}>\n <Icon className=\"size-3\" /> {metric.delta}\n </span>\n );\n}\n\nfunction Sparkline({ values }: { values: number[] }) {\n const clamped = values.map((v) => Math.max(0, Math.min(1, v)));\n return (\n <span className=\"ml-auto flex h-6 items-end gap-[2px]\" aria-hidden=\"true\">\n {clamped.map((v, idx) => (\n <span\n // biome-ignore lint/suspicious/noArrayIndexKey: positional, values are not stable identifiers\n key={idx}\n className=\"w-[3px] rounded-sm bg-primary/60\"\n style={{ height: `${Math.max(8, v * 100)}%` }}\n />\n ))}\n </span>\n );\n}\n\nexport { MetricsPanel };\n"
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
|
+
"name": "mode-types",
|
|
4
|
+
"type": "registry:lib",
|
|
5
|
+
"title": "Theo UI mode types",
|
|
6
|
+
"description": "Shared Mode type — \"chat\" | \"code\" | \"infra\" — controlling app shell density and surfaces.",
|
|
7
|
+
"files": [
|
|
8
|
+
{
|
|
9
|
+
"path": "types/mode.ts",
|
|
10
|
+
"type": "registry:lib",
|
|
11
|
+
"target": "types/mode.ts",
|
|
12
|
+
"content": "/**\n * Mode — top-level density / domain the agent session is operating in.\n *\n * `chat` — conversational Q&A, lean UI.\n * `code` — code agent: read/plan/edit/verify inside the repo.\n * `infra` — operate the deployed system: metrics, deploys, logs, rollback.\n *\n * Used everywhere resources can be scoped per-mode (Skills, Agents, Rules,\n * SystemPrompt overrides, Sessions, …). `modes?: Mode[]` on a resource means\n * \"only available in these modes\"; omitting `modes` means \"available\n * globally\".\n */\nexport type Mode = \"chat\" | \"code\" | \"infra\";\n\nexport const ALL_MODES: ReadonlyArray<Mode> = [\"chat\", \"code\", \"infra\"];\n\n/** Friendly label per mode — render in chips, headers, badges. */\nexport const MODE_LABEL: Record<Mode, string> = {\n chat: \"Chat\",\n code: \"Code\",\n infra: \"Infra\",\n};\n"
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
|
+
"name": "model-card",
|
|
4
|
+
"type": "registry:ui",
|
|
5
|
+
"title": "ModelCard",
|
|
6
|
+
"description": "Full info on a model: vendor, context, output cap, pricing,",
|
|
7
|
+
"dependencies": [
|
|
8
|
+
"lucide-react"
|
|
9
|
+
],
|
|
10
|
+
"registryDependencies": [
|
|
11
|
+
"https://usetheodev.github.io/theo-ui/r/cn.json",
|
|
12
|
+
"https://usetheodev.github.io/theo-ui/r/tailwind-preset.json",
|
|
13
|
+
"https://usetheodev.github.io/theo-ui/r/types.json"
|
|
14
|
+
],
|
|
15
|
+
"files": [
|
|
16
|
+
{
|
|
17
|
+
"path": "components/primitives/model-card/model-card.tsx",
|
|
18
|
+
"type": "registry:ui",
|
|
19
|
+
"target": "components/ui/model-card.tsx",
|
|
20
|
+
"content": "import { CalendarDays, Eye, GitBranch, Image, Sparkles, Wrench } from \"lucide-react\";\nimport { forwardRef } from \"react\";\nimport type { HTMLAttributes, ReactNode } from \"react\";\nimport { cn } from \"@/lib/cn\";\nimport type { IconComponent } from \"@/lib/types\";\n\nexport interface ModelCapabilityFlag {\n id: string;\n label: string;\n icon?: IconComponent;\n enabled: boolean;\n}\n\nexport interface ModelInfo {\n id: string;\n /** Display name (e.g. \"Opus 4.7\"). */\n name: string;\n /** Vendor (Anthropic, OpenAI, …). */\n vendor: string;\n /** Optional tag (default, fast, smart, beta). */\n tag?: ReactNode;\n /** Total context window in tokens. */\n contextWindow: number;\n /** Max output tokens per turn. */\n maxOutput: number;\n /** USD per million input tokens. */\n pricePerMInput?: number;\n /** USD per million output tokens. */\n pricePerMOutput?: number;\n /** Knowledge cutoff date label (e.g. \"Jan 2026\"). */\n cutoff?: string;\n /** Capability flags shown as chips. */\n capabilities?: ModelCapabilityFlag[];\n /** Short description / positioning. */\n description?: ReactNode;\n}\n\nconst formatTokens = (n: number) => {\n if (n >= 1_000_000) return `${(n / 1_000_000).toFixed(0)}M`;\n if (n >= 1_000) return `${(n / 1_000).toFixed(0)}k`;\n return `${n}`;\n};\n\nconst formatUsd = (n: number) =>\n n >= 100 ? `$${n.toFixed(0)}` : n >= 1 ? `$${n.toFixed(2)}` : `$${n.toFixed(3)}`;\n\ninterface ModelCardProps extends Omit<HTMLAttributes<HTMLElement>, \"onSelect\"> {\n model: ModelInfo;\n /** Render as the currently-selected variant (violet ring). */\n selected?: boolean;\n /** Fires when user clicks to select. */\n onSelect?: (id: string) => void;\n}\n\n/**\n * ModelCard — full info on a model: vendor, context, output cap, pricing,\n * capabilities, knowledge cutoff. Used in the \"switch model\" surface.\n */\nconst ModelCard = forwardRef<HTMLElement, ModelCardProps>(\n ({ className, model, selected, onSelect, ...props }, ref) => {\n const Tag = onSelect ? \"button\" : \"article\";\n return (\n <Tag\n ref={ref as never}\n type={onSelect ? \"button\" : undefined}\n onClick={onSelect ? () => onSelect(model.id) : undefined}\n className={cn(\n \"grid gap-3 rounded-xl border bg-card p-4 text-left\",\n \"transition-[border-color,box-shadow] duration-base ease-out-soft\",\n selected\n ? \"border-primary shadow-glow\"\n : onSelect\n ? \"hover:border-primary/40 hover:shadow-sm\"\n : \"\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\",\n className,\n )}\n aria-pressed={onSelect ? !!selected : undefined}\n {...(props as HTMLAttributes<HTMLElement>)}\n >\n <header className=\"flex items-start justify-between gap-3\">\n <div className=\"min-w-0\">\n <h4 className=\"font-display text-title-md tracking-tight\">{model.name}</h4>\n <p className=\"font-mono text-label-caps text-muted-foreground uppercase tracking-wider\">\n {model.vendor}\n </p>\n </div>\n {model.tag ? (\n <span className=\"inline-flex items-center gap-1 rounded-full bg-accent/15 px-2 py-0.5 font-mono text-accent text-label uppercase\">\n {typeof model.tag === \"string\" && model.tag.toLowerCase() === \"smart\" ? (\n <Sparkles className=\"size-3\" />\n ) : null}\n {model.tag}\n </span>\n ) : null}\n </header>\n\n {model.description ? (\n <p className=\"text-body-sm text-muted-foreground\">{model.description}</p>\n ) : null}\n\n <dl className=\"grid grid-cols-2 gap-3 border-border/30 border-t pt-3 font-mono\">\n <div className=\"grid gap-0.5\">\n <dt className=\"text-label-caps text-muted-foreground uppercase tracking-wider\">\n Context\n </dt>\n <dd className=\"font-medium text-body-sm tabular-nums\">\n {formatTokens(model.contextWindow)} tok\n </dd>\n </div>\n <div className=\"grid gap-0.5\">\n <dt className=\"text-label-caps text-muted-foreground uppercase tracking-wider\">\n Max output\n </dt>\n <dd className=\"font-medium text-body-sm tabular-nums\">\n {formatTokens(model.maxOutput)} tok\n </dd>\n </div>\n {model.pricePerMInput !== undefined ? (\n <div className=\"grid gap-0.5\">\n <dt className=\"text-label-caps text-muted-foreground uppercase tracking-wider\">\n Input\n </dt>\n <dd className=\"font-medium text-body-sm tabular-nums\">\n {formatUsd(model.pricePerMInput)} <span className=\"text-muted-foreground\">/M</span>\n </dd>\n </div>\n ) : null}\n {model.pricePerMOutput !== undefined ? (\n <div className=\"grid gap-0.5\">\n <dt className=\"text-label-caps text-muted-foreground uppercase tracking-wider\">\n Output\n </dt>\n <dd className=\"font-medium text-body-sm tabular-nums\">\n {formatUsd(model.pricePerMOutput)} <span className=\"text-muted-foreground\">/M</span>\n </dd>\n </div>\n ) : null}\n </dl>\n\n {model.capabilities && model.capabilities.length > 0 ? (\n <div className=\"flex flex-wrap gap-1.5\">\n {model.capabilities.map((cap) => {\n const Icon = cap.icon ?? Wrench;\n return (\n <span\n key={cap.id}\n className={cn(\n \"inline-flex items-center gap-1 rounded-md px-2 py-0.5 font-mono text-label\",\n cap.enabled\n ? \"bg-success/15 text-success\"\n : \"bg-muted text-muted-foreground line-through\",\n )}\n >\n <Icon className=\"size-3\" aria-hidden=\"true\" />\n {cap.label}\n </span>\n );\n })}\n </div>\n ) : null}\n\n {model.cutoff ? (\n <p className=\"inline-flex items-center gap-1 font-mono text-label text-muted-foreground\">\n <CalendarDays className=\"size-3\" aria-hidden=\"true\" /> Knowledge cutoff · {model.cutoff}\n </p>\n ) : null}\n </Tag>\n );\n },\n);\nModelCard.displayName = \"ModelCard\";\n\n/** Pre-canned capability flags. */\nexport const modelCapabilityPresets = {\n vision: { id: \"vision\", label: \"Vision\", icon: Image as IconComponent } as const,\n tools: { id: \"tools\", label: \"Tool use\", icon: Wrench } as const,\n reasoning: { id: \"reasoning\", label: \"Reasoning\", icon: Sparkles } as const,\n fineTuning: { id: \"ft\", label: \"Fine-tuning\", icon: GitBranch } as const,\n multimodal: { id: \"multimodal\", label: \"Multimodal\", icon: Eye } as const,\n};\n\nexport { ModelCard };\n"
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
|
+
"name": "model-selector",
|
|
4
|
+
"type": "registry:ui",
|
|
5
|
+
"title": "ModelSelector",
|
|
6
|
+
"description": "Chip dropdown for picking the active LLM.",
|
|
7
|
+
"dependencies": [
|
|
8
|
+
"@radix-ui/react-dropdown-menu",
|
|
9
|
+
"lucide-react"
|
|
10
|
+
],
|
|
11
|
+
"registryDependencies": [
|
|
12
|
+
"https://usetheodev.github.io/theo-ui/r/cn.json",
|
|
13
|
+
"https://usetheodev.github.io/theo-ui/r/tailwind-preset.json"
|
|
14
|
+
],
|
|
15
|
+
"files": [
|
|
16
|
+
{
|
|
17
|
+
"path": "components/primitives/model-selector/model-selector.tsx",
|
|
18
|
+
"type": "registry:ui",
|
|
19
|
+
"target": "components/ui/model-selector.tsx",
|
|
20
|
+
"content": "import * as DropdownMenu from \"@radix-ui/react-dropdown-menu\";\nimport { Check, ChevronDown, Sparkles } from \"lucide-react\";\nimport { forwardRef } from \"react\";\nimport type { ButtonHTMLAttributes } from \"react\";\nimport { cn } from \"@/lib/cn\";\n\nexport interface ModelOption {\n id: string;\n label: string;\n /** Optional vendor hint shown small below the label. */\n vendor?: string;\n /** Optional tag e.g. \"default\", \"fast\", \"smart\". */\n tag?: string;\n}\n\ninterface ModelSelectorProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, \"onChange\"> {\n value: string;\n options: ModelOption[];\n onChange?: (id: string) => void;\n}\n\n/**\n * ModelSelector — chip dropdown for picking the active LLM.\n *\n * Visual: pill with violet dot + label + chevron. Dropdown uses Radix Menu.\n */\nconst ModelSelector = forwardRef<HTMLButtonElement, ModelSelectorProps>(\n ({ className, value, options, onChange, ...props }, ref) => {\n const current = options.find((o) => o.id === value) ?? options[0];\n return (\n <DropdownMenu.Root>\n <DropdownMenu.Trigger asChild>\n <button\n ref={ref}\n type=\"button\"\n className={cn(\n \"inline-flex h-8 items-center gap-2 rounded-full border border-border/60 bg-card px-3\",\n \"font-medium font-sans text-body-sm text-foreground\",\n \"transition-colors duration-base ease-out-soft\",\n \"hover:bg-muted\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background\",\n className,\n )}\n {...props}\n >\n <span className=\"size-1.5 rounded-full bg-primary\" aria-hidden=\"true\" />\n {current?.label ?? \"Select model\"}\n <ChevronDown className=\"size-3 text-muted-foreground\" aria-hidden=\"true\" />\n </button>\n </DropdownMenu.Trigger>\n <DropdownMenu.Portal>\n <DropdownMenu.Content\n sideOffset={6}\n align=\"end\"\n className={cn(\n \"z-50 min-w-[14rem] overflow-hidden rounded-lg border bg-popover p-1 text-popover-foreground shadow-md\",\n \"data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:animate-in\",\n \"data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:animate-out\",\n )}\n >\n {options.map((opt) => (\n <DropdownMenu.Item\n key={opt.id}\n onSelect={() => onChange?.(opt.id)}\n className={cn(\n \"flex cursor-pointer items-center justify-between gap-3 rounded-md px-2 py-2\",\n \"text-body-sm\",\n \"focus:bg-muted focus:outline-none\",\n \"data-[highlighted]:bg-muted\",\n )}\n >\n <span className=\"flex flex-col\">\n <span className=\"font-medium\">{opt.label}</span>\n {opt.vendor ? (\n <span className=\"font-mono text-label text-muted-foreground\">{opt.vendor}</span>\n ) : null}\n </span>\n <span className=\"flex items-center gap-2\">\n {opt.tag ? (\n <span className=\"inline-flex items-center gap-1 rounded-full bg-accent/15 px-2 py-0.5 font-mono text-accent text-label uppercase\">\n {opt.tag === \"smart\" ? <Sparkles className=\"size-3\" /> : null}\n {opt.tag}\n </span>\n ) : null}\n {opt.id === value ? <Check className=\"size-3.5 text-primary\" /> : null}\n </span>\n </DropdownMenu.Item>\n ))}\n </DropdownMenu.Content>\n </DropdownMenu.Portal>\n </DropdownMenu.Root>\n );\n },\n);\nModelSelector.displayName = \"ModelSelector\";\n\nexport { ModelSelector };\n"
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
|
+
"name": "page-shell",
|
|
4
|
+
"type": "registry:ui",
|
|
5
|
+
"title": "PageShell",
|
|
6
|
+
"description": "Page-level scaffold composite. Renders title + optional description + optional ActionBar (when search/primaryAction/onFilterClick provided), then one of four mutually-exclusive content states (loading > error > empty > children). Loading defaults to a centered spinner Card; loadingNode escape hatch lets consumers pass custom skeleton. Error state renders Card with message + optional retry button + optional docsHref. Empty state delegates to <EmptyState>. PageShell does NOT manage document.title — pass onTitleChange callback to wire your own hook.",
|
|
7
|
+
"dependencies": [
|
|
8
|
+
"lucide-react"
|
|
9
|
+
],
|
|
10
|
+
"registryDependencies": [
|
|
11
|
+
"https://usetheodev.github.io/theo-ui/r/cn.json",
|
|
12
|
+
"https://usetheodev.github.io/theo-ui/r/action-bar.json",
|
|
13
|
+
"https://usetheodev.github.io/theo-ui/r/card.json",
|
|
14
|
+
"https://usetheodev.github.io/theo-ui/r/empty-state.json",
|
|
15
|
+
"https://usetheodev.github.io/theo-ui/r/tailwind-preset.json"
|
|
16
|
+
],
|
|
17
|
+
"files": [
|
|
18
|
+
{
|
|
19
|
+
"path": "components/composites/page-shell/page-shell.tsx",
|
|
20
|
+
"type": "registry:ui",
|
|
21
|
+
"target": "components/ui/page-shell.tsx",
|
|
22
|
+
"content": "import { AlertCircle, Loader2 } from \"lucide-react\";\nimport { forwardRef, useEffect } from \"react\";\nimport type { ElementType, ReactNode } from \"react\";\nimport { cn } from \"@/lib/cn\";\nimport { ActionBar } from \"@/components/ui/action-bar\";\nimport { Card } from \"@/components/ui/card\";\nimport { EmptyState } from \"@/components/ui/empty-state\";\n\n/**\n * PageShell — page-level scaffold composite.\n *\n * Renders title + optional description + optional ActionBar, then\n * one of four mutually-exclusive content states:\n * 1. loading (highest precedence)\n * 2. error\n * 3. empty\n * 4. children (default)\n *\n * Scope-narrowed per Brief #5 D3: PageShell does NOT manage\n * `document.title`. Use the optional `onTitleChange` callback to\n * wire your own hook (e.g. useSetPageTitle, react-helmet,\n * next/head).\n *\n * @example\n * <PageShell\n * title=\"Domains\"\n * description=\"Custom domains and DNS verification.\"\n * search={{ placeholder: \"Search…\", value: q, onChange: setQ }}\n * primaryAction={{ label: \"Add domain\", icon: Plus, onClick: openModal }}\n * loading={isLoading}\n * error={error ? { message: error.message, onRetry: refetch } : undefined}\n * empty={data?.length === 0 ? { title: \"No domains yet\" } : undefined}\n * >\n * <DataTable columns={…} data={data} />\n * </PageShell>\n */\nexport interface PageShellProps {\n title: string;\n description?: ReactNode;\n /** Optional callback invoked when `title` changes — wire to your own document.title hook. */\n onTitleChange?: (title: string) => void;\n primaryAction?: {\n label: ReactNode;\n icon?: ElementType;\n onClick: () => void;\n loading?: boolean;\n };\n search?: {\n placeholder: string;\n value: string;\n onChange: (v: string) => void;\n };\n onFilterClick?: () => void;\n loading?: boolean;\n /** Custom loading UI. Defaults to a centered spinner card. */\n loadingNode?: ReactNode;\n error?: {\n message: string;\n onRetry?: () => void;\n docsHref?: string;\n };\n empty?: {\n icon?: ElementType;\n title: string;\n description?: ReactNode;\n action?: { label: string; onClick: () => void };\n };\n children?: ReactNode;\n className?: string;\n}\n\nconst PageShell = forwardRef<HTMLElement, PageShellProps>(\n (\n {\n title,\n description,\n onTitleChange,\n primaryAction,\n search,\n onFilterClick,\n loading = false,\n loadingNode,\n error,\n empty,\n children,\n className,\n },\n ref,\n ) => {\n useEffect(() => {\n onTitleChange?.(title);\n }, [title, onTitleChange]);\n\n const hasActionBar =\n search !== undefined || primaryAction !== undefined || onFilterClick !== undefined;\n\n // State precedence: loading > error > empty > children\n let content: ReactNode;\n if (loading) {\n content = loadingNode ?? (\n <Card className=\"flex items-center justify-center gap-3 p-12 text-muted-foreground\">\n <Loader2 aria-hidden=\"true\" className=\"size-5 animate-spin\" />\n <span className=\"font-sans text-body-sm\">Loading…</span>\n </Card>\n );\n } else if (error) {\n content = (\n <Card className=\"flex flex-col items-center gap-3 p-8 text-center\">\n <AlertCircle aria-hidden=\"true\" className=\"size-8 text-destructive\" />\n <p className=\"font-sans text-body-sm text-foreground\">{error.message}</p>\n <div className=\"flex items-center gap-3\">\n {error.onRetry ? (\n <button\n type=\"button\"\n onClick={error.onRetry}\n className={cn(\n \"inline-flex items-center rounded-md border border-border/40 px-3 py-1.5\",\n \"font-sans text-body-sm text-foreground\",\n \"transition-colors hover:bg-muted\",\n )}\n >\n Retry\n </button>\n ) : null}\n {error.docsHref ? (\n <a\n href={error.docsHref}\n className=\"font-sans text-body-sm text-primary hover:underline\"\n >\n View docs\n </a>\n ) : null}\n </div>\n </Card>\n );\n } else if (empty) {\n const emptyAction = empty.action;\n content = (\n <EmptyState\n icon={empty.icon as Parameters<typeof EmptyState>[0][\"icon\"]}\n title={empty.title}\n description={empty.description}\n action={\n emptyAction ? (\n <button\n type=\"button\"\n onClick={emptyAction.onClick}\n className={cn(\n \"inline-flex items-center rounded-md bg-primary px-3 py-1.5\",\n \"font-medium font-sans text-body-sm text-primary-foreground\",\n \"transition-colors hover:bg-primary-deep\",\n )}\n >\n {emptyAction.label}\n </button>\n ) : undefined\n }\n />\n );\n } else {\n content = children;\n }\n\n return (\n <main\n ref={ref}\n aria-busy={loading || undefined}\n className={cn(\"flex flex-col gap-6\", className)}\n >\n <header className=\"flex flex-col gap-1\">\n <h1 className=\"font-display font-semibold text-display-sm text-foreground tracking-tight\">\n {title}\n </h1>\n {description ? (\n <p className=\"font-sans text-body-md text-muted-foreground\">{description}</p>\n ) : null}\n </header>\n {hasActionBar ? (\n <ActionBar search={search} primaryAction={primaryAction} onFilterClick={onFilterClick} />\n ) : null}\n <div>{content}</div>\n </main>\n );\n },\n);\nPageShell.displayName = \"PageShell\";\n\nexport { PageShell };\n"
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
|
+
"name": "pagination",
|
|
4
|
+
"type": "registry:ui",
|
|
5
|
+
"title": "Pagination",
|
|
6
|
+
"description": "Accessible page-number navigation primitive. Renders <nav aria-label=Pagination> with first/prev/numbers/next/last buttons and visual ellipses when totalPages exceeds the visible range. Active page carries aria-current=page. Keyboard nav: ArrowLeft / ArrowRight / Home / End. Configurable siblingCount + optional jump buttons. Returns null when totalPages <= 1. Exports a pure computePageRange helper for unit testing the range logic in isolation.",
|
|
7
|
+
"dependencies": [
|
|
8
|
+
"lucide-react"
|
|
9
|
+
],
|
|
10
|
+
"registryDependencies": [
|
|
11
|
+
"https://usetheodev.github.io/theo-ui/r/cn.json",
|
|
12
|
+
"https://usetheodev.github.io/theo-ui/r/tailwind-preset.json"
|
|
13
|
+
],
|
|
14
|
+
"files": [
|
|
15
|
+
{
|
|
16
|
+
"path": "components/primitives/pagination/pagination.tsx",
|
|
17
|
+
"type": "registry:ui",
|
|
18
|
+
"target": "components/ui/pagination.tsx",
|
|
19
|
+
"content": "import { ChevronLeft, ChevronRight, ChevronsLeft, ChevronsRight } from \"lucide-react\";\nimport { forwardRef } from \"react\";\nimport type { HTMLAttributes, KeyboardEvent } from \"react\";\nimport { cn } from \"@/lib/cn\";\n\n/**\n * Pagination — accessible page-number navigation primitive.\n *\n * Renders a `<nav aria-label=\"Pagination\">` containing a button group:\n * `[<<] [<] 1 ... 5 6 [7] 8 9 ... 42 [>] [>>]`. The active page carries\n * `aria-current=\"page\"`. Keyboard navigation (ArrowLeft / ArrowRight /\n * Home / End) is wired on the nav. Ellipses are rendered as\n * non-interactive `<span>` elements with `aria-hidden`.\n *\n * Renders nothing when `totalPages <= 1` (the page is the whole list).\n *\n * `siblingCount` controls how many neighbors of the current page are\n * always visible (default 1 → \"5 6 [7] 8 9\"). `showJumpButtons`\n * toggles the first/last `<<` / `>>` buttons.\n *\n * Consumers control state (`currentPage`) and are responsible for any\n * URL routing — the buttons are `<button>`, not `<a>`.\n *\n * @example\n * <Pagination\n * currentPage={page}\n * totalPages={42}\n * onPageChange={setPage}\n * />\n */\nexport interface PaginationProps extends Omit<HTMLAttributes<HTMLElement>, \"onChange\"> {\n currentPage: number;\n totalPages: number;\n onPageChange: (page: number) => void;\n /** Neighbors of current page that stay visible. Default 1. */\n siblingCount?: number;\n /** Render `<<` / `>>` first/last buttons. Default true. */\n showJumpButtons?: boolean;\n /** Size variant. Default md. */\n size?: \"sm\" | \"md\";\n}\n\n/**\n * Pure helper: compute the visible page-range with ellipses.\n * Exported for unit testing — most pagination bugs live here.\n */\nexport function computePageRange(\n currentPage: number,\n totalPages: number,\n siblingCount = 1,\n): Array<number | \"ellipsis-start\" | \"ellipsis-end\"> {\n if (totalPages <= 1) return [];\n\n // Always keep first + last + siblings around current.\n // Total \"core\" buttons: 1 + (siblingCount * 2 + 1) + 1 = siblingCount * 2 + 3.\n // Plus possibly 2 ellipsis placeholders → max visible = siblingCount * 2 + 5.\n const totalNumbers = siblingCount * 2 + 3;\n const totalWithEdges = totalNumbers + 2;\n\n if (totalPages <= totalWithEdges) {\n return Array.from({ length: totalPages }, (_, i) => i + 1);\n }\n\n const leftSibling = Math.max(currentPage - siblingCount, 1);\n const rightSibling = Math.min(currentPage + siblingCount, totalPages);\n\n const showLeftEllipsis = leftSibling > 2;\n const showRightEllipsis = rightSibling < totalPages - 1;\n\n if (!showLeftEllipsis && showRightEllipsis) {\n const leftRangeEnd = 1 + (siblingCount * 2 + 2);\n const leftRange = Array.from({ length: leftRangeEnd }, (_, i) => i + 1);\n return [...leftRange, \"ellipsis-end\", totalPages];\n }\n\n if (showLeftEllipsis && !showRightEllipsis) {\n const rightStart = totalPages - (siblingCount * 2 + 2);\n const rightRange = Array.from(\n { length: totalPages - rightStart + 1 },\n (_, i) => rightStart + i,\n );\n return [1, \"ellipsis-start\", ...rightRange];\n }\n\n // Both sides need ellipsis.\n const middleRange = Array.from(\n { length: rightSibling - leftSibling + 1 },\n (_, i) => leftSibling + i,\n );\n return [1, \"ellipsis-start\", ...middleRange, \"ellipsis-end\", totalPages];\n}\n\nconst SIZE: Record<NonNullable<PaginationProps[\"size\"]>, string> = {\n sm: \"size-7 text-label\",\n md: \"size-8 text-body-sm\",\n};\n\nconst ICON_SIZE: Record<NonNullable<PaginationProps[\"size\"]>, string> = {\n sm: \"size-3\",\n md: \"size-3.5\",\n};\n\nconst Pagination = forwardRef<HTMLElement, PaginationProps>(\n (\n {\n className,\n currentPage,\n totalPages,\n onPageChange,\n siblingCount = 1,\n showJumpButtons = true,\n size = \"md\",\n ...props\n },\n ref,\n ) => {\n if (totalPages <= 1) {\n return null;\n }\n\n const range = computePageRange(currentPage, totalPages, siblingCount);\n const prevDisabled = currentPage <= 1;\n const nextDisabled = currentPage >= totalPages;\n const sizeClass = SIZE[size];\n const iconClass = ICON_SIZE[size];\n\n const buttonBase = cn(\n \"inline-flex items-center justify-center rounded-md font-mono tabular-nums\",\n \"transition-colors\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background\",\n sizeClass,\n );\n\n function go(page: number) {\n const clamped = Math.max(1, Math.min(totalPages, page));\n if (clamped !== currentPage) onPageChange(clamped);\n }\n\n function handleKeyDown(e: KeyboardEvent<HTMLElement>) {\n if (e.key === \"ArrowLeft\") {\n e.preventDefault();\n go(currentPage - 1);\n } else if (e.key === \"ArrowRight\") {\n e.preventDefault();\n go(currentPage + 1);\n } else if (e.key === \"Home\") {\n e.preventDefault();\n go(1);\n } else if (e.key === \"End\") {\n e.preventDefault();\n go(totalPages);\n }\n }\n\n return (\n <nav\n ref={ref}\n aria-label=\"Pagination\"\n onKeyDown={handleKeyDown}\n className={cn(\"flex items-center gap-1\", className)}\n {...props}\n >\n {showJumpButtons ? (\n <button\n type=\"button\"\n onClick={() => go(1)}\n disabled={prevDisabled}\n aria-label=\"Go to first page\"\n aria-disabled={prevDisabled || undefined}\n className={cn(\n buttonBase,\n \"text-foreground hover:bg-muted\",\n prevDisabled && \"cursor-not-allowed opacity-40 hover:bg-transparent\",\n )}\n >\n <ChevronsLeft aria-hidden=\"true\" className={iconClass} />\n </button>\n ) : null}\n <button\n type=\"button\"\n onClick={() => go(currentPage - 1)}\n disabled={prevDisabled}\n aria-label=\"Go to previous page\"\n aria-disabled={prevDisabled || undefined}\n className={cn(\n buttonBase,\n \"text-foreground hover:bg-muted\",\n prevDisabled && \"cursor-not-allowed opacity-40 hover:bg-transparent\",\n )}\n >\n <ChevronLeft aria-hidden=\"true\" className={iconClass} />\n </button>\n {range.map((item) => {\n if (item === \"ellipsis-start\" || item === \"ellipsis-end\") {\n return (\n <span\n key={item}\n aria-hidden=\"true\"\n className={cn(\n \"inline-flex items-center justify-center text-muted-foreground\",\n sizeClass,\n )}\n >\n …\n </span>\n );\n }\n const isActive = item === currentPage;\n return (\n <button\n key={item}\n type=\"button\"\n onClick={() => go(item)}\n aria-label={`Go to page ${item}`}\n aria-current={isActive ? \"page\" : undefined}\n className={cn(\n buttonBase,\n isActive\n ? \"bg-primary text-primary-foreground hover:bg-primary\"\n : \"text-foreground hover:bg-muted\",\n )}\n >\n {item}\n </button>\n );\n })}\n <button\n type=\"button\"\n onClick={() => go(currentPage + 1)}\n disabled={nextDisabled}\n aria-label=\"Go to next page\"\n aria-disabled={nextDisabled || undefined}\n className={cn(\n buttonBase,\n \"text-foreground hover:bg-muted\",\n nextDisabled && \"cursor-not-allowed opacity-40 hover:bg-transparent\",\n )}\n >\n <ChevronRight aria-hidden=\"true\" className={iconClass} />\n </button>\n {showJumpButtons ? (\n <button\n type=\"button\"\n onClick={() => go(totalPages)}\n disabled={nextDisabled}\n aria-label=\"Go to last page\"\n aria-disabled={nextDisabled || undefined}\n className={cn(\n buttonBase,\n \"text-foreground hover:bg-muted\",\n nextDisabled && \"cursor-not-allowed opacity-40 hover:bg-transparent\",\n )}\n >\n <ChevronsRight aria-hidden=\"true\" className={iconClass} />\n </button>\n ) : null}\n </nav>\n );\n },\n);\nPagination.displayName = \"Pagination\";\n\nexport { Pagination };\n"
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
}
|