@keboola/design 11.3.0 → 11.5.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/AGENTS.md +208 -1
- package/CHANGELOG.md +528 -0
- package/COMPONENT-API.md +68 -46
- package/dist/{AIKit-DaFT7p92.js → AIKit-CNX6aiKm.js} +338 -113
- package/dist/AIKit-CNX6aiKm.js.map +1 -0
- package/dist/{Alert-CseY3yAj.js → Alert-Ba5b2YPq.js} +3 -3
- package/dist/{Alert-CseY3yAj.js.map → Alert-Ba5b2YPq.js.map} +1 -1
- package/dist/{AlertModal-DQAGpsEy.js → AlertModal-BGJdaRRj.js} +3 -3
- package/dist/{AlertModal-DQAGpsEy.js.map → AlertModal-BGJdaRRj.js.map} +1 -1
- package/dist/{AppShell-BUoxM3fv.js → AppShell-DRgJxpXW.js} +2 -2
- package/dist/{AppShell-BUoxM3fv.js.map → AppShell-DRgJxpXW.js.map} +1 -1
- package/dist/{Badge-Ch26CXoP.js → Badge-D0pXdekt.js} +2 -2
- package/dist/Badge-D0pXdekt.js.map +1 -0
- package/dist/{BrandEditor-BnTLMRMp.js → BrandEditor-CSANsxUz.js} +8 -8
- package/dist/{BrandEditor-BnTLMRMp.js.map → BrandEditor-CSANsxUz.js.map} +1 -1
- package/dist/{BrandLogo-V2pRUAeO.js → BrandLogo-CoKBk4MI.js} +5 -5
- package/dist/BrandLogo-CoKBk4MI.js.map +1 -0
- package/dist/{Breadcrumb-CQTPn_KB.js → Breadcrumb-g_xn_-Nf.js} +3 -3
- package/dist/{Breadcrumb-CQTPn_KB.js.map → Breadcrumb-g_xn_-Nf.js.map} +1 -1
- package/dist/{Button-CPsEQuTN.js → Button-DsRrU5F1.js} +6 -5
- package/dist/Button-DsRrU5F1.js.map +1 -0
- package/dist/{Card-Cd5HSBmv.js → Card-Dyo7055Q.js} +2 -2
- package/dist/{Card-Cd5HSBmv.js.map → Card-Dyo7055Q.js.map} +1 -1
- package/dist/{Checkbox-5VNCcV7E.js → Checkbox-CUIn2jap.js} +3 -3
- package/dist/{Checkbox-5VNCcV7E.js.map → Checkbox-CUIn2jap.js.map} +1 -1
- package/dist/{Clipboard-B7rckqV_.js → Clipboard-BTW6C-b_.js} +2 -2
- package/dist/{Clipboard-B7rckqV_.js.map → Clipboard-BTW6C-b_.js.map} +1 -1
- package/dist/{ClipboardButton-CQ6Aewpg.js → ClipboardButton-CwZJdRaz.js} +3 -3
- package/dist/{ClipboardButton-CQ6Aewpg.js.map → ClipboardButton-CwZJdRaz.js.map} +1 -1
- package/dist/{CodeEditor-CUse8znx.js → CodeEditor-C9zy7PxK.js} +16 -27
- package/dist/CodeEditor-C9zy7PxK.js.map +1 -0
- package/dist/{ColorInput-Q1D9Vcc_.js → ColorInput-BZV-u_94.js} +3 -3
- package/dist/{ColorInput-Q1D9Vcc_.js.map → ColorInput-BZV-u_94.js.map} +1 -1
- package/dist/{ColorModeSwitch-B5PXCVqB.js → ColorModeSwitch-CsWLiTBX.js} +3 -3
- package/dist/{ColorModeSwitch-B5PXCVqB.js.map → ColorModeSwitch-CsWLiTBX.js.map} +1 -1
- package/dist/{Combobox-CyoRA7oY.js → Combobox-BfIfaVMA.js} +285 -109
- package/dist/Combobox-BfIfaVMA.js.map +1 -0
- package/dist/{Command-Ds68v2rX.js → Command-Bfa1kpbt.js} +6 -6
- package/dist/{Command-Ds68v2rX.js.map → Command-Bfa1kpbt.js.map} +1 -1
- package/dist/{CopyField-DI66uY_g.js → CopyField-DpT0Ngz1.js} +2 -2
- package/dist/{CopyField-DI66uY_g.js.map → CopyField-DpT0Ngz1.js.map} +1 -1
- package/dist/{DateInput-BPj2pzsn.js → DateInput-DiEd5uCL.js} +4 -4
- package/dist/{DateInput-BPj2pzsn.js.map → DateInput-DiEd5uCL.js.map} +1 -1
- package/dist/{DatePicker-DyEGuW9m.js → DatePicker-nA8YdE84.js} +2 -2
- package/dist/{DatePicker-DyEGuW9m.js.map → DatePicker-nA8YdE84.js.map} +1 -1
- package/dist/{DateRangeInput-u9DxNbHW.js → DateRangeInput-DPfVYchl.js} +4 -4
- package/dist/{DateRangeInput-u9DxNbHW.js.map → DateRangeInput-DPfVYchl.js.map} +1 -1
- package/dist/{DateRangePicker-CYYhX6S7.js → DateRangePicker-DjSUFjh4.js} +5 -5
- package/dist/{DateRangePicker-CYYhX6S7.js.map → DateRangePicker-DjSUFjh4.js.map} +1 -1
- package/dist/{DropdownMenu-DpMEcyCq.js → DropdownMenu-CASr-jgl.js} +2 -2
- package/dist/{DropdownMenu-DpMEcyCq.js.map → DropdownMenu-CASr-jgl.js.map} +1 -1
- package/dist/{FieldItem-qQKGU9lF.js → FieldItem-B7XMmZSz.js} +3 -3
- package/dist/{FieldItem-qQKGU9lF.js.map → FieldItem-B7XMmZSz.js.map} +1 -1
- package/dist/{FileUpload-C336MVnU.js → FileUpload-ABThVZyg.js} +2 -2
- package/dist/{FileUpload-C336MVnU.js.map → FileUpload-ABThVZyg.js.map} +1 -1
- package/dist/{Form-CTygENDc.js → Form-CsttTHn4.js} +8 -8
- package/dist/Form-CsttTHn4.js.map +1 -0
- package/dist/{FormGroup-BnwP0jNu.js → FormGroup-DHvTFdno.js} +3 -3
- package/dist/{FormGroup-BnwP0jNu.js.map → FormGroup-DHvTFdno.js.map} +1 -1
- package/dist/{FullScreenModal-j-M4aPFd.js → FullScreenModal-BvPuYibe.js} +3 -3
- package/dist/{FullScreenModal-j-M4aPFd.js.map → FullScreenModal-BvPuYibe.js.map} +1 -1
- package/dist/{HoverCard-yQq-O49c.js → HoverCard-B9ZMJxjn.js} +2 -2
- package/dist/{HoverCard-yQq-O49c.js.map → HoverCard-B9ZMJxjn.js.map} +1 -1
- package/dist/{InputGroup-D7zlmqPB.js → InputGroup-DcZRlVnN.js} +24 -16
- package/dist/InputGroup-DcZRlVnN.js.map +1 -0
- package/dist/{Kbd-D6LpR7G2.js → Kbd-Cvvt91Q8.js} +14 -4
- package/dist/Kbd-Cvvt91Q8.js.map +1 -0
- package/dist/MarkedText-DNGEUVWc.js +67 -0
- package/dist/MarkedText-DNGEUVWc.js.map +1 -0
- package/dist/{MermaidDiagram-JlvuGcY-.js → MermaidDiagram-CXG5tC6J.js} +19 -18
- package/dist/MermaidDiagram-CXG5tC6J.js.map +1 -0
- package/dist/{Modal-o4ATIexE.js → Modal-Coj-H02o.js} +16 -4
- package/dist/Modal-Coj-H02o.js.map +1 -0
- package/dist/{MultiActionButtonGroup-GTeFk-L8.js → MultiActionButtonGroup-DokHbPgM.js} +3 -3
- package/dist/{MultiActionButtonGroup-GTeFk-L8.js.map → MultiActionButtonGroup-DokHbPgM.js.map} +1 -1
- package/dist/{Navbar-CAQs4BZz.js → Navbar-Liy1TPI7.js} +7 -7
- package/dist/{Navbar-CAQs4BZz.js.map → Navbar-Liy1TPI7.js.map} +1 -1
- package/dist/PageHeader-Q3IpCnQd.js.map +1 -1
- package/dist/{PageToolbar-bG2YtSa3.js → PageToolbar-DExqEYGl.js} +4 -4
- package/dist/{PageToolbar-bG2YtSa3.js.map → PageToolbar-DExqEYGl.js.map} +1 -1
- package/dist/{Pagination-BB3X7ooY.js → Pagination-C_b7Xhey.js} +2 -2
- package/dist/{Pagination-BB3X7ooY.js.map → Pagination-C_b7Xhey.js.map} +1 -1
- package/dist/{Popconfirm-C2Ky5hJO.js → Popconfirm-5pBzT_HQ.js} +12 -13
- package/dist/{Popconfirm-C2Ky5hJO.js.map → Popconfirm-5pBzT_HQ.js.map} +1 -1
- package/dist/{Popover-DsbI2HKu.js → Popover-BEbQrC_P.js} +22 -19
- package/dist/Popover-BEbQrC_P.js.map +1 -0
- package/dist/{RadioGroup-BMxuZEbT.js → RadioGroup-DXPbSj8P.js} +3 -3
- package/dist/{RadioGroup-BMxuZEbT.js.map → RadioGroup-DXPbSj8P.js.map} +1 -1
- package/dist/{Search-DFeECt5D.js → Search-5uQAiNIP.js} +2 -2
- package/dist/{Search-DFeECt5D.js.map → Search-5uQAiNIP.js.map} +1 -1
- package/dist/{SearchInput-CCpdUego.js → SearchInput-D4UgAXJK.js} +3 -3
- package/dist/{SearchInput-CCpdUego.js.map → SearchInput-D4UgAXJK.js.map} +1 -1
- package/dist/{SectionNav-Bw_MVL0_.js → SectionNav-OkKCjSA-.js} +5 -5
- package/dist/{SectionNav-Bw_MVL0_.js.map → SectionNav-OkKCjSA-.js.map} +1 -1
- package/dist/{Select-D6IZVvwL.js → Select-DV3Hak_l.js} +31 -21
- package/dist/Select-DV3Hak_l.js.map +1 -0
- package/dist/{Sheet-BIzs2K2H.js → Sheet-Chf0kX1E.js} +3 -3
- package/dist/{Sheet-BIzs2K2H.js.map → Sheet-Chf0kX1E.js.map} +1 -1
- package/dist/{Sidebar-r1TW4g_b.js → Sidebar-D3cY1kha.js} +48 -22
- package/dist/Sidebar-D3cY1kha.js.map +1 -0
- package/dist/{Slider-CjxyfEty.js → Slider-CRf-bB4y.js} +3 -3
- package/dist/{Slider-CjxyfEty.js.map → Slider-CRf-bB4y.js.map} +1 -1
- package/dist/{Switch-BueTV03C.js → Switch-B0WdGSjz.js} +8 -8
- package/dist/{Switch-BueTV03C.js.map → Switch-B0WdGSjz.js.map} +1 -1
- package/dist/{Tabs-l72-WuhK.js → Tabs-eB974xJf.js} +2 -2
- package/dist/{Tabs-l72-WuhK.js.map → Tabs-eB974xJf.js.map} +1 -1
- package/dist/{TextInput-DhdRk8qm.js → TextInput-DH5SkbsE.js} +3 -3
- package/dist/{TextInput-DhdRk8qm.js.map → TextInput-DH5SkbsE.js.map} +1 -1
- package/dist/{ThemeProvider-DZfGdf1v.js → ThemeProvider-2RMdVGxO.js} +95 -15
- package/dist/ThemeProvider-2RMdVGxO.js.map +1 -0
- package/dist/{TimePicker-B6d2rAbX.js → TimePicker-BGeqc-Ed.js} +2 -2
- package/dist/{TimePicker-B6d2rAbX.js.map → TimePicker-BGeqc-Ed.js.map} +1 -1
- package/dist/{Timeline-6btyJl4D.js → Timeline-BG5Xogxh.js} +11 -11
- package/dist/{Timeline-6btyJl4D.js.map → Timeline-BG5Xogxh.js.map} +1 -1
- package/dist/{Toast-CxXUulYN.js → Toast-Dr6Uw7ao.js} +2 -2
- package/dist/{Toast-CxXUulYN.js.map → Toast-Dr6Uw7ao.js.map} +1 -1
- package/dist/{Workbench-BzE-Vvd9.js → Workbench-UR2FBC7I.js} +3 -1
- package/dist/Workbench-UR2FBC7I.js.map +1 -0
- package/dist/{ZoomableSvg-CNIzRHKH.js → ZoomableSvg-pooPb1Cu.js} +4 -4
- package/dist/{ZoomableSvg-CNIzRHKH.js.map → ZoomableSvg-pooPb1Cu.js.map} +1 -1
- package/dist/{context-BrNtMc1H.js → context-D7X470dy.js} +4 -3
- package/dist/context-D7X470dy.js.map +1 -0
- package/dist/{defaults-CTfvj2KB.js → defaults-i_xG2F_1.js} +2 -4
- package/dist/defaults-i_xG2F_1.js.map +1 -0
- package/dist/editors.js +5 -5
- package/dist/findLiteralMatches-BGBw8Vbl.js +62 -0
- package/dist/findLiteralMatches-BGBw8Vbl.js.map +1 -0
- package/dist/flint.js +134 -8
- package/dist/flint.js.map +1 -1
- package/dist/index.d.ts +1118 -566
- package/dist/index.js +64 -62
- package/dist/internal/blocks/AIKit.js +2 -2
- package/dist/internal/blocks/AppShell.js +1 -1
- package/dist/internal/blocks/AuthLayout.js +118 -0
- package/dist/internal/blocks/AuthLayout.js.map +1 -0
- package/dist/internal/blocks/BrandEditor.js +1 -1
- package/dist/internal/blocks/ChartPanel.js +1 -1
- package/dist/internal/blocks/ClipboardButton.js +1 -1
- package/dist/internal/blocks/ColorInput.js +1 -1
- package/dist/internal/blocks/ColorModeSwitch.js +1 -1
- package/dist/internal/blocks/Command.js +1 -1
- package/dist/internal/blocks/CopyField.js +1 -1
- package/dist/internal/blocks/DateInput.js +1 -1
- package/dist/internal/blocks/DateRangeInput.js +1 -1
- package/dist/internal/blocks/EmptyConfigurationActionCard.js +1 -1
- package/dist/internal/blocks/ErrorState.js +1 -1
- package/dist/internal/blocks/ExportMenu.js +5 -5
- package/dist/internal/blocks/ExportMenu.js.map +1 -1
- package/dist/internal/blocks/Form/connectors/MultiComboboxField.js +1 -1
- package/dist/internal/blocks/Form.js +1 -1
- package/dist/internal/blocks/FormGroup.js +1 -1
- package/dist/internal/blocks/MultiActionButtonGroup.js +1 -1
- package/dist/internal/blocks/MultiCombobox.js +116 -54
- package/dist/internal/blocks/MultiCombobox.js.map +1 -1
- package/dist/internal/blocks/NumberInput.js +1 -1
- package/dist/internal/blocks/PageToolbar.js +1 -1
- package/dist/internal/blocks/PasswordInput.js +2 -2
- package/dist/internal/blocks/SearchInput.js +1 -1
- package/dist/internal/blocks/SearchInputWithNavigation.js +3 -3
- package/dist/internal/blocks/SectionNav.js +1 -1
- package/dist/internal/blocks/SplitButton.js +2 -2
- package/dist/internal/blocks/StatCard.js +1 -1
- package/dist/internal/blocks/TextInput.js +1 -1
- package/dist/internal/blocks/Textarea.js +1 -1
- package/dist/internal/blocks/TimeInput.js +3 -3
- package/dist/internal/components/Alert.js +1 -1
- package/dist/internal/components/AlertModal.js +1 -1
- package/dist/internal/components/Avatar.js +1 -1
- package/dist/internal/components/Badge.js +1 -1
- package/dist/internal/components/BrandLogo.js +1 -1
- package/dist/internal/components/Breadcrumb.js +1 -1
- package/dist/internal/components/Button.js +1 -1
- package/dist/internal/components/Card.js +1 -1
- package/dist/internal/components/Checkbox.js +1 -1
- package/dist/internal/components/Clipboard.js +1 -1
- package/dist/internal/components/CollapsiblePanel.js +1 -1
- package/dist/internal/components/Combobox.js +2 -2
- package/dist/internal/components/DatePicker.js +1 -1
- package/dist/internal/components/DateRangePicker.js +1 -1
- package/dist/internal/components/DropdownMenu.js +1 -1
- package/dist/internal/components/FileUpload.js +1 -1
- package/dist/internal/components/FullScreenModal.js +1 -1
- package/dist/internal/components/HoverCard.js +1 -1
- package/dist/internal/components/InputGroup.js +1 -1
- package/dist/internal/components/Kbd.js +1 -1
- package/dist/internal/components/MarkedText.js +1 -1
- package/dist/internal/components/Modal.js +1 -1
- package/dist/internal/components/Navbar.js +1 -1
- package/dist/internal/components/Pagination.js +1 -1
- package/dist/internal/components/Popconfirm.js +1 -1
- package/dist/internal/components/Popover.js +1 -1
- package/dist/internal/components/RadioGroup.js +1 -1
- package/dist/internal/components/Search.js +1 -1
- package/dist/internal/components/Select.js +1 -1
- package/dist/internal/components/Sheet.js +1 -1
- package/dist/internal/components/Sidebar.js +1 -1
- package/dist/internal/components/Slider.js +1 -1
- package/dist/internal/components/Switch.js +1 -1
- package/dist/internal/components/Tabs.js +1 -1
- package/dist/internal/components/ThemeProvider.js +4 -4
- package/dist/internal/components/TimePicker.js +1 -1
- package/dist/internal/components/Timeline.js +1 -1
- package/dist/internal/components/Toast.js +2 -2
- package/dist/internal/components/Toggle.js +3 -3
- package/dist/internal/components/Toggle.js.map +1 -1
- package/dist/internal/components/Tooltip.js +1 -1
- package/dist/internal/components/Truncated.js +1 -1
- package/dist/internal/components/Workbench.js +1 -1
- package/dist/internal/components/ZoomableSvg.js +1 -1
- package/dist/internal/utils.js +3 -3
- package/dist/markdown-editor.js +32 -26
- package/dist/markdown-editor.js.map +1 -1
- package/dist/mermaid.js +1 -1
- package/dist/rjsf.js +24 -25
- package/dist/rjsf.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/testing.js +4 -4
- package/dist/testing.js.map +1 -1
- package/dist/{useColorSchemeState-BJEk6esG.js → themeScopeContext-D7fSyb06.js} +17 -4
- package/dist/themeScopeContext-D7fSyb06.js.map +1 -0
- package/dist/{themeTokens-7T1AFLhq.js → themeTokens-qP1-55O7.js} +38 -11
- package/dist/themeTokens-qP1-55O7.js.map +1 -0
- package/dist/{toast-BweSoKn3.js → toast-DIC0iNRf.js} +2 -2
- package/dist/{toast-BweSoKn3.js.map → toast-DIC0iNRf.js.map} +1 -1
- package/dist/{utils-B-g7d_Jb.js → utils-DSvrhU8E.js} +7 -3
- package/dist/{utils-B-g7d_Jb.js.map → utils-DSvrhU8E.js.map} +1 -1
- package/dist/vega.d.ts +1 -1
- package/dist/vega.js +3 -3
- package/dist/vega.js.map +1 -1
- package/dist/{vegaTheme-FBXgAdHK.js → vegaTheme-CSvFEMBl.js} +6 -6
- package/dist/vegaTheme-CSvFEMBl.js.map +1 -0
- package/package.json +12 -10
- package/src/styles.css +3 -0
- package/dist/AIKit-DaFT7p92.js.map +0 -1
- package/dist/Badge-Ch26CXoP.js.map +0 -1
- package/dist/BrandLogo-V2pRUAeO.js.map +0 -1
- package/dist/Button-CPsEQuTN.js.map +0 -1
- package/dist/CodeEditor-CUse8znx.js.map +0 -1
- package/dist/Combobox-CyoRA7oY.js.map +0 -1
- package/dist/Form-CTygENDc.js.map +0 -1
- package/dist/InputGroup-D7zlmqPB.js.map +0 -1
- package/dist/Kbd-D6LpR7G2.js.map +0 -1
- package/dist/MarkedText-Ckbft5mw.js +0 -44
- package/dist/MarkedText-Ckbft5mw.js.map +0 -1
- package/dist/MermaidDiagram-JlvuGcY-.js.map +0 -1
- package/dist/Modal-o4ATIexE.js.map +0 -1
- package/dist/Popover-DsbI2HKu.js.map +0 -1
- package/dist/Select-D6IZVvwL.js.map +0 -1
- package/dist/Sidebar-r1TW4g_b.js.map +0 -1
- package/dist/ThemeProvider-DZfGdf1v.js.map +0 -1
- package/dist/Workbench-BzE-Vvd9.js.map +0 -1
- package/dist/context-BrNtMc1H.js.map +0 -1
- package/dist/defaults-CTfvj2KB.js.map +0 -1
- package/dist/escapeStringRegexp-8MxP2knR.js +0 -6
- package/dist/escapeStringRegexp-8MxP2knR.js.map +0 -1
- package/dist/themeTokens-7T1AFLhq.js.map +0 -1
- package/dist/useColorSchemeState-BJEk6esG.js.map +0 -1
- package/dist/vegaTheme-FBXgAdHK.js.map +0 -1
|
@@ -1,39 +1,105 @@
|
|
|
1
1
|
import { cn } from "./classNames-BzrkDnOD.js";
|
|
2
|
-
import { Tooltip, TooltipProvider } from "./utils-
|
|
3
|
-
import { AlertCircle, ChevronDown, ChevronLeft, ChevronRight, CircleCheck, CirclePause, CircleX,
|
|
4
|
-
import { Button } from "./Button-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { Tooltip, TooltipProvider } from "./utils-DSvrhU8E.js";
|
|
3
|
+
import { AlertCircle, ChevronDown, ChevronLeft, ChevronRight, CircleCheck, CirclePause, CircleX, Loader2, Maximize2, Minimize2, Play, Send, Sparkles, ThumbsDown, ThumbsUp, TriangleAlert, X, XCircle } from "./icons-Cek151jC.js";
|
|
4
|
+
import { Button } from "./Button-DsRrU5F1.js";
|
|
5
|
+
import { ButtonGroup } from "./internal/components/ButtonGroup.js";
|
|
6
|
+
import { ClipboardButton } from "./ClipboardButton-CwZJdRaz.js";
|
|
7
|
+
import { FullScreenModal, FullScreenModalBody, FullScreenModalHeader } from "./FullScreenModal-BvPuYibe.js";
|
|
7
8
|
import { Truncated } from "./internal/components/Truncated.js";
|
|
8
|
-
import { HoverCard } from "./HoverCard-
|
|
9
|
-
import { Command } from "./Command-
|
|
10
|
-
import { TextInput } from "./TextInput-
|
|
11
|
-
import { Checkbox } from "./Checkbox-
|
|
12
|
-
import { Badge } from "./Badge-
|
|
9
|
+
import { HoverCard } from "./HoverCard-B9ZMJxjn.js";
|
|
10
|
+
import { Command } from "./Command-Bfa1kpbt.js";
|
|
11
|
+
import { TextInput } from "./TextInput-DH5SkbsE.js";
|
|
12
|
+
import { Checkbox } from "./Checkbox-CUIn2jap.js";
|
|
13
|
+
import { Badge } from "./Badge-D0pXdekt.js";
|
|
13
14
|
import { Textarea } from "./internal/blocks/Textarea.js";
|
|
14
15
|
import { Table } from "./Table-CvYuTuNU.js";
|
|
15
16
|
import { DiagramSkeleton } from "./internal/blocks/DiagramShared/DiagramSkeleton.js";
|
|
16
|
-
import { Avatar } from "./internal/components/Avatar.js";
|
|
17
17
|
import { Progress } from "./internal/components/Progress.js";
|
|
18
18
|
import { Slot } from "@radix-ui/react-slot";
|
|
19
|
-
import { Suspense, isValidElement, lazy, useEffect, useId, useRef, useState } from "react";
|
|
19
|
+
import { Suspense, isValidElement, lazy, useCallback, useEffect, useId, useRef, useState } from "react";
|
|
20
20
|
import { cva } from "class-variance-authority";
|
|
21
21
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
22
22
|
import TextareaAutosize from "react-textarea-autosize";
|
|
23
23
|
import ReactMarkdown from "react-markdown";
|
|
24
24
|
import remarkGfm from "remark-gfm";
|
|
25
|
+
//#region src/blocks/AIKit/AnswerActions.tsx
|
|
26
|
+
const VOTE_BUTTONS = [{
|
|
27
|
+
vote: "up",
|
|
28
|
+
label: "Good answer",
|
|
29
|
+
icon: /* @__PURE__ */ jsx(ThumbsUp, { className: "tw:size-4" })
|
|
30
|
+
}, {
|
|
31
|
+
vote: "down",
|
|
32
|
+
label: "Bad answer",
|
|
33
|
+
icon: /* @__PURE__ */ jsx(ThumbsDown, { className: "tw:size-4" })
|
|
34
|
+
}];
|
|
35
|
+
/**
|
|
36
|
+
* What a reader can do with a finished answer: take it away, and say whether it was any good.
|
|
37
|
+
*
|
|
38
|
+
* - **Always rendered, never hover-only.** A reveal-on-hover row does not exist for anyone
|
|
39
|
+
* reaching it without a pointer. The buttons are quiet (`invisible`) rather than hidden.
|
|
40
|
+
* - Copy sits first: it is the one action with no round trip.
|
|
41
|
+
* - **A vote can be changed but not withdrawn.** `aria-pressed` says which one is recorded, and
|
|
42
|
+
* both buttons stay focusable so a reader can switch. Pressing the pressed one re-sends the
|
|
43
|
+
* same vote.
|
|
44
|
+
* - The recorded vote and the write are the caller's: the two chats vote against different
|
|
45
|
+
* endpoints, and only the caller knows whether a turn is finished enough to rate.
|
|
46
|
+
*/
|
|
47
|
+
const AnswerActions = ({ copyText, vote, onVote }) => {
|
|
48
|
+
return /* @__PURE__ */ jsxs(ButtonGroup, {
|
|
49
|
+
space: "extra-small",
|
|
50
|
+
"aria-label": "Answer actions",
|
|
51
|
+
children: [copyText ? /* @__PURE__ */ jsx(ClipboardButton, {
|
|
52
|
+
text: copyText,
|
|
53
|
+
tooltip: "Copy answer",
|
|
54
|
+
size: "icon-xs",
|
|
55
|
+
variant: "invisible"
|
|
56
|
+
}) : null, VOTE_BUTTONS.map(({ vote: candidate, label, icon }) => {
|
|
57
|
+
const isRecorded = vote === candidate;
|
|
58
|
+
return /* @__PURE__ */ jsx(Tooltip, {
|
|
59
|
+
tooltip: label,
|
|
60
|
+
placement: "top",
|
|
61
|
+
triggerAsChild: true,
|
|
62
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
63
|
+
size: "icon-xs",
|
|
64
|
+
variant: isRecorded ? "secondary" : "invisible",
|
|
65
|
+
"aria-label": label,
|
|
66
|
+
"aria-pressed": isRecorded,
|
|
67
|
+
onClick: () => onVote(candidate),
|
|
68
|
+
children: icon
|
|
69
|
+
})
|
|
70
|
+
}, candidate);
|
|
71
|
+
})]
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
//#endregion
|
|
75
|
+
//#region src/blocks/AIKit/CollapsibleBody.tsx
|
|
76
|
+
const CollapsibleBody = ({ isExpanded, isClosing, onClosed, children }) => {
|
|
77
|
+
const handleTransitionEnd = (event) => {
|
|
78
|
+
if (event.target !== event.currentTarget) return;
|
|
79
|
+
if (event.propertyName !== "grid-template-rows") return;
|
|
80
|
+
if (!isExpanded) onClosed();
|
|
81
|
+
};
|
|
82
|
+
return /* @__PURE__ */ jsx("div", {
|
|
83
|
+
className: cn("tw:grid tw:transition-[grid-template-rows] tw:duration-300 tw:ease-out tw:motion-reduce:transition-none", isExpanded ? "tw:grid-rows-[1fr]" : "tw:grid-rows-[0fr]"),
|
|
84
|
+
onTransitionEnd: handleTransitionEnd,
|
|
85
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
86
|
+
className: "tw:min-h-0 tw:overflow-hidden",
|
|
87
|
+
children: (isExpanded || isClosing) && children
|
|
88
|
+
})
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
//#endregion
|
|
25
92
|
//#region src/blocks/AIKit/CollapsibleStepHeader.tsx
|
|
26
93
|
const variantClasses = {
|
|
27
|
-
success: "tw:text-
|
|
28
|
-
error: "tw:text-
|
|
29
|
-
processing: "tw:text-
|
|
30
|
-
dismissed: "tw:text-
|
|
94
|
+
success: "tw:text-muted-foreground tw:focus-visible:outline-ring tw:not-disabled:hover:text-foreground",
|
|
95
|
+
error: "tw:text-destructive tw:focus-visible:outline-destructive tw:not-disabled:hover:text-destructive",
|
|
96
|
+
processing: "tw:text-muted-foreground tw:focus-visible:outline-ring tw:not-disabled:hover:text-foreground",
|
|
97
|
+
dismissed: "tw:text-muted-foreground tw:focus-visible:outline-ring tw:not-disabled:hover:text-foreground"
|
|
31
98
|
};
|
|
32
|
-
const iconClasses = "tw:size-
|
|
99
|
+
const iconClasses = "tw:size-3.5 tw:shrink-0 tw:basis-3.5 tw:opacity-70";
|
|
33
100
|
const renderVariantIcon$1 = (variant) => {
|
|
34
101
|
if (variant === "processing") return /* @__PURE__ */ jsx(Loader2, { className: cn(iconClasses, "tw:animate-spin") });
|
|
35
|
-
if (variant === "error") return /* @__PURE__ */ jsx(XCircle, { className: iconClasses });
|
|
36
|
-
if (variant === "dismissed") return /* @__PURE__ */ jsx(XCircle, { className: cn(iconClasses, "tw:text-neutral-500") });
|
|
102
|
+
if (variant === "error" || variant === "dismissed") return /* @__PURE__ */ jsx(XCircle, { className: iconClasses });
|
|
37
103
|
return /* @__PURE__ */ jsx(CircleCheck, { className: iconClasses });
|
|
38
104
|
};
|
|
39
105
|
const CollapsibleStepHeader = ({ isExpanded, onToggle, label, variant = "success" }) => {
|
|
@@ -41,37 +107,40 @@ const CollapsibleStepHeader = ({ isExpanded, onToggle, label, variant = "success
|
|
|
41
107
|
type: "button",
|
|
42
108
|
"aria-expanded": isExpanded,
|
|
43
109
|
onClick: onToggle,
|
|
44
|
-
className: cn("tw:flex tw:w-fit tw:items-
|
|
110
|
+
className: cn("tw:flex tw:w-fit tw:items-center tw:gap-1.5 tw:text-left tw:text-xs tw:font-medium tw:transition-colors tw:focus-visible:outline tw:focus-visible:outline-2 tw:focus-visible:outline-offset-2 tw:disabled:opacity-40", variantClasses[variant]),
|
|
45
111
|
children: [renderVariantIcon$1(variant), /* @__PURE__ */ jsxs("span", {
|
|
46
112
|
className: "tw:min-w-0",
|
|
47
113
|
children: [label, /* @__PURE__ */ jsxs("span", {
|
|
48
114
|
className: "tw:whitespace-nowrap",
|
|
49
|
-
children: ["", /* @__PURE__ */ jsx(ChevronDown, { className: cn("tw:ml-
|
|
115
|
+
children: ["", /* @__PURE__ */ jsx(ChevronDown, { className: cn("tw:ml-1.5 tw:inline-block tw:size-3.5 tw:align-middle tw:transition-transform", isExpanded && "tw:rotate-180") })]
|
|
50
116
|
})]
|
|
51
117
|
})]
|
|
52
118
|
});
|
|
53
119
|
};
|
|
54
120
|
//#endregion
|
|
121
|
+
//#region src/blocks/AIKit/hasMotion.ts
|
|
122
|
+
const hasMotion = () => typeof window.matchMedia === "function" && !window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
123
|
+
//#endregion
|
|
55
124
|
//#region src/blocks/AIKit/InlineStepDetail.tsx
|
|
56
125
|
const InlineStepDetail = ({ children }) => /* @__PURE__ */ jsx("div", {
|
|
57
|
-
className: "tw:ml-2.5 tw:whitespace-pre-wrap tw:border-l tw:border-
|
|
126
|
+
className: "tw:ml-2.5 tw:whitespace-pre-wrap tw:border-l tw:border-border tw:pl-3 tw:text-xs tw:text-muted-foreground",
|
|
58
127
|
children
|
|
59
128
|
});
|
|
60
129
|
//#endregion
|
|
61
130
|
//#region src/blocks/AIKit/InlineStepLabel.tsx
|
|
62
131
|
const renderVariantIcon = (variant) => {
|
|
63
|
-
if (variant === "processing") return /* @__PURE__ */ jsx(Loader2, { className: "tw:size-
|
|
64
|
-
if (variant === "error") return /* @__PURE__ */ jsx(XCircle, { className: "tw:size-
|
|
65
|
-
if (variant === "dismissed") return /* @__PURE__ */ jsx(XCircle, { className: "tw:size-
|
|
66
|
-
return /* @__PURE__ */ jsx(CircleCheck, { className: "tw:size-
|
|
132
|
+
if (variant === "processing") return /* @__PURE__ */ jsx(Loader2, { className: "tw:size-3.5 tw:animate-spin tw:text-muted-foreground" });
|
|
133
|
+
if (variant === "error") return /* @__PURE__ */ jsx(XCircle, { className: "tw:size-3.5 tw:text-destructive" });
|
|
134
|
+
if (variant === "dismissed") return /* @__PURE__ */ jsx(XCircle, { className: "tw:size-3.5 tw:text-muted-foreground/50" });
|
|
135
|
+
return /* @__PURE__ */ jsx(CircleCheck, { className: "tw:size-3.5 tw:text-muted-foreground/50" });
|
|
67
136
|
};
|
|
68
137
|
const InlineStepLabel = ({ variant, children }) => /* @__PURE__ */ jsxs("div", {
|
|
69
138
|
className: "tw:flex tw:min-w-0 tw:items-center tw:gap-1",
|
|
70
139
|
children: [/* @__PURE__ */ jsx("div", {
|
|
71
|
-
className: "tw:flex tw:size-5 tw:shrink-0 tw:items-center tw:justify-center",
|
|
140
|
+
className: "tw:relative tw:flex tw:size-5 tw:shrink-0 tw:items-center tw:justify-center tw:[background:var(--inline-step-surface,transparent)]",
|
|
72
141
|
children: renderVariantIcon(variant)
|
|
73
142
|
}), /* @__PURE__ */ jsx("div", {
|
|
74
|
-
className: "tw:flex tw:min-w-0 tw:flex-wrap tw:items-center tw:gap-x-1.5 tw:gap-y-1 tw:text-
|
|
143
|
+
className: "tw:flex tw:min-w-0 tw:flex-wrap tw:items-center tw:gap-x-1.5 tw:gap-y-1 tw:text-xs tw:font-medium tw:text-muted-foreground",
|
|
75
144
|
children
|
|
76
145
|
})]
|
|
77
146
|
});
|
|
@@ -81,29 +150,40 @@ const SECTION_LABELS = {
|
|
|
81
150
|
success: "Answered questions",
|
|
82
151
|
dismissed: "Dismissed questions"
|
|
83
152
|
};
|
|
84
|
-
const AnswerSummary = ({ items, variant = "success", noAnswerLabel = "No answer" }) => {
|
|
153
|
+
const AnswerSummary = ({ items, variant = "success", noAnswerLabel = "No answer", onExpandToggle }) => {
|
|
85
154
|
const [isExpanded, setIsExpanded] = useState(false);
|
|
86
|
-
const
|
|
155
|
+
const [isClosing, setIsClosing] = useState(false);
|
|
156
|
+
const toggle = () => {
|
|
157
|
+
const next = !isExpanded;
|
|
158
|
+
if (!next) setIsClosing(hasMotion());
|
|
159
|
+
setIsExpanded(next);
|
|
160
|
+
onExpandToggle?.(next);
|
|
161
|
+
};
|
|
87
162
|
const count = items.length;
|
|
88
163
|
const [firstItem] = items;
|
|
89
164
|
const label = count === 1 && firstItem ? firstItem.question : `${count} questions`;
|
|
90
165
|
return /* @__PURE__ */ jsxs("section", {
|
|
91
|
-
className: "tw:mt-4 tw:flex tw:flex-col
|
|
166
|
+
className: "tw:mt-4 tw:flex tw:flex-col",
|
|
92
167
|
"aria-label": SECTION_LABELS[variant],
|
|
93
168
|
children: [/* @__PURE__ */ jsx(CollapsibleStepHeader, {
|
|
94
169
|
isExpanded,
|
|
95
170
|
onToggle: toggle,
|
|
96
171
|
variant,
|
|
97
172
|
label
|
|
98
|
-
}),
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
173
|
+
}), /* @__PURE__ */ jsx(CollapsibleBody, {
|
|
174
|
+
isExpanded,
|
|
175
|
+
isClosing,
|
|
176
|
+
onClosed: () => setIsClosing(false),
|
|
177
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
178
|
+
className: "tw:flex tw:flex-col tw:gap-4 tw:pt-4 tw:pl-5",
|
|
179
|
+
children: items.map(({ question, answer }, index) => /* @__PURE__ */ jsxs("div", {
|
|
180
|
+
className: "tw:flex tw:flex-col tw:gap-1",
|
|
181
|
+
children: [/* @__PURE__ */ jsx(InlineStepLabel, {
|
|
182
|
+
variant,
|
|
183
|
+
children: question
|
|
184
|
+
}), /* @__PURE__ */ jsx(InlineStepDetail, { children: answer && answer.length > 0 ? answer : noAnswerLabel })]
|
|
185
|
+
}, `${index}-${question}`))
|
|
186
|
+
})
|
|
107
187
|
})]
|
|
108
188
|
});
|
|
109
189
|
};
|
|
@@ -113,6 +193,10 @@ const MermaidDiagram = lazy(() => import("@keboola/design/mermaid").then((module
|
|
|
113
193
|
console.error("[AIKit] failed to load the MermaidDiagram chunk", error);
|
|
114
194
|
return { default: ({ code }) => /* @__PURE__ */ jsx("pre", { children: /* @__PURE__ */ jsx("code", { children: code }) }) };
|
|
115
195
|
}));
|
|
196
|
+
const FlintChart = lazy(() => import("@keboola/design/flint").then((module) => ({ default: module.FlintChart }), (error) => {
|
|
197
|
+
console.error("[AIKit] failed to load the FlintChart chunk", error);
|
|
198
|
+
return { default: ({ code }) => /* @__PURE__ */ jsx("pre", { children: /* @__PURE__ */ jsx("code", { children: code }) }) };
|
|
199
|
+
}));
|
|
116
200
|
const proseClass = "tw:prose tw:prose-sm tw:max-w-none tw:break-words tw:[&_pre]:bg-muted tw:[&_pre]:text-foreground tw:[&_:not(pre)>code]:bg-muted tw:[&_:not(pre)>code]:text-foreground tw:[&_:not(pre)>code]:rounded tw:[&_:not(pre)>code]:px-1 tw:[&_:not(pre)>code]:py-0.5 tw:[&_:not(pre)>code]:before:content-none tw:[&_:not(pre)>code]:after:content-none";
|
|
117
201
|
const getText = (node) => {
|
|
118
202
|
if (typeof node === "string") return node;
|
|
@@ -128,19 +212,56 @@ const getLanguage = (element) => {
|
|
|
128
212
|
if (typeof props.className !== "string") return void 0;
|
|
129
213
|
return props.className.match(/language-(\S+)/)?.[1];
|
|
130
214
|
};
|
|
131
|
-
|
|
215
|
+
/**
|
|
216
|
+
* The plugins this renderer always runs.
|
|
217
|
+
*
|
|
218
|
+
* - GFM is part of its contract: tables route through the design `Table`, and autolinks and
|
|
219
|
+
* task lists are what an assistant answer is written in.
|
|
220
|
+
* - A caller's own plugins are appended to these, never substituted for them.
|
|
221
|
+
*/
|
|
222
|
+
const baseRemarkPlugins = [remarkGfm];
|
|
223
|
+
/**
|
|
224
|
+
* Fence language → the renderer that draws it.
|
|
225
|
+
*
|
|
226
|
+
* - Both dialects are the agent's, not this package's: kai-agent's prompt tells the model to
|
|
227
|
+
* write ```mermaid for structure and ```flint for quantitative data, so a chat that renders
|
|
228
|
+
* one and not the other drops output the agent was instructed to produce.
|
|
229
|
+
* - `flint-chart` is an alias — it is the fence tag flint's own docs use, so a model emits it
|
|
230
|
+
* unprompted often enough to matter. `markdownComponents.tsx` in kbc-ui carries the same pair.
|
|
231
|
+
* - Read through `Object.hasOwn`, never by plain index: a fence tagged ```constructor or
|
|
232
|
+
* ```valueOf otherwise answers with an `Object.prototype` member, which is truthy, and mounting
|
|
233
|
+
* it as a component throws — taking the whole message subtree down with it.
|
|
234
|
+
*/
|
|
235
|
+
const DIAGRAM_RENDERERS = {
|
|
236
|
+
mermaid: MermaidDiagram,
|
|
237
|
+
flint: FlintChart,
|
|
238
|
+
"flint-chart": FlintChart
|
|
239
|
+
};
|
|
240
|
+
/**
|
|
241
|
+
* The fence languages this renderer draws instead of printing.
|
|
242
|
+
*
|
|
243
|
+
* - For a caller that streams: a diagram mounts a lazily loaded chunk, so an answer arriving a
|
|
244
|
+
* token at a time has to keep a fence that is still open an ordinary code block, or every
|
|
245
|
+
* keystroke fetches the chunk. Sharing the list is what keeps that hold-back from missing a
|
|
246
|
+
* dialect this map has and the caller does not.
|
|
247
|
+
* - Frozen, because it is that shared contract: a consumer that pushed onto it would change how
|
|
248
|
+
* every other app in the same bundle holds a fence back.
|
|
249
|
+
*/
|
|
250
|
+
const DIAGRAM_LANGUAGES = Object.freeze(Object.keys(DIAGRAM_RENDERERS));
|
|
251
|
+
const baseComponents = {
|
|
132
252
|
pre({ children, ...props }) {
|
|
133
253
|
const child = Array.isArray(children) ? children[0] : children;
|
|
134
|
-
|
|
135
|
-
|
|
254
|
+
const code = getText(child).replace(/\n$/, "");
|
|
255
|
+
const language = getLanguage(child);
|
|
256
|
+
const Diagram = language !== void 0 && Object.hasOwn(DIAGRAM_RENDERERS, language) ? DIAGRAM_RENDERERS[language] : void 0;
|
|
257
|
+
if (Diagram) {
|
|
136
258
|
if (!code.trim()) return null;
|
|
137
259
|
return /* @__PURE__ */ jsx(Suspense, {
|
|
138
260
|
fallback: /* @__PURE__ */ jsx(DiagramSkeleton, {}),
|
|
139
|
-
children: /* @__PURE__ */ jsx(
|
|
261
|
+
children: /* @__PURE__ */ jsx(Diagram, { code })
|
|
140
262
|
});
|
|
141
263
|
}
|
|
142
264
|
const { node: _node, ...rest } = props;
|
|
143
|
-
const code = getText(child).replace(/\n$/, "");
|
|
144
265
|
return /* @__PURE__ */ jsxs("div", {
|
|
145
266
|
className: "tw:group tw:relative",
|
|
146
267
|
children: [/* @__PURE__ */ jsx("span", {
|
|
@@ -207,13 +328,16 @@ const components = {
|
|
|
207
328
|
* `MessageBubble` to render an assistant message body. Code blocks expose a
|
|
208
329
|
* copy button, so mount a `TooltipProvider` once at the app root.
|
|
209
330
|
*/
|
|
210
|
-
const Markdown = ({ children, className }) => {
|
|
331
|
+
const Markdown = ({ children, className, remarkPlugins, components: componentOverrides }) => {
|
|
211
332
|
return /* @__PURE__ */ jsx("div", {
|
|
212
333
|
"data-prose": true,
|
|
213
334
|
className: cn(proseClass, className),
|
|
214
335
|
children: /* @__PURE__ */ jsx(ReactMarkdown, {
|
|
215
|
-
remarkPlugins: [
|
|
216
|
-
components
|
|
336
|
+
remarkPlugins: remarkPlugins === void 0 ? baseRemarkPlugins : [...baseRemarkPlugins, ...remarkPlugins],
|
|
337
|
+
components: componentOverrides === void 0 ? baseComponents : {
|
|
338
|
+
...baseComponents,
|
|
339
|
+
...componentOverrides
|
|
340
|
+
},
|
|
217
341
|
children
|
|
218
342
|
})
|
|
219
343
|
});
|
|
@@ -223,22 +347,31 @@ const Markdown = ({ children, className }) => {
|
|
|
223
347
|
const containerClasses = cva([
|
|
224
348
|
"tw:flex",
|
|
225
349
|
"tw:max-w-full",
|
|
226
|
-
"tw:gap-
|
|
350
|
+
"tw:gap-3"
|
|
227
351
|
], {
|
|
228
352
|
variants: { variant: {
|
|
229
|
-
user: ["tw:justify-
|
|
230
|
-
assistant: [
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
353
|
+
user: ["tw:justify-end"],
|
|
354
|
+
assistant: ["tw:justify-start", "tw:w-full"]
|
|
355
|
+
} },
|
|
356
|
+
defaultVariants: { variant: "assistant" }
|
|
357
|
+
});
|
|
358
|
+
const stackClasses = cva([
|
|
359
|
+
"tw:flex",
|
|
360
|
+
"tw:min-w-0",
|
|
361
|
+
"tw:flex-1",
|
|
362
|
+
"tw:flex-col",
|
|
363
|
+
"tw:gap-2"
|
|
364
|
+
], {
|
|
365
|
+
variants: { variant: {
|
|
366
|
+
user: ["tw:items-end"],
|
|
367
|
+
assistant: []
|
|
235
368
|
} },
|
|
236
369
|
defaultVariants: { variant: "assistant" }
|
|
237
370
|
});
|
|
238
371
|
const contentClasses = cva([
|
|
239
372
|
"tw:flex",
|
|
240
373
|
"tw:flex-col",
|
|
241
|
-
"tw:gap-
|
|
374
|
+
"tw:gap-3",
|
|
242
375
|
"tw:break-words",
|
|
243
376
|
"tw:leading-relaxed",
|
|
244
377
|
"tw:text-foreground",
|
|
@@ -252,33 +385,30 @@ const contentClasses = cva([
|
|
|
252
385
|
"tw:[&>*]:min-w-0"
|
|
253
386
|
],
|
|
254
387
|
user: [
|
|
255
|
-
"tw:max-w-
|
|
388
|
+
"tw:max-w-[min(85%,40rem)]",
|
|
256
389
|
"tw:w-fit",
|
|
257
390
|
"tw:bg-muted",
|
|
258
|
-
"tw:
|
|
259
|
-
"tw:
|
|
260
|
-
"tw:
|
|
391
|
+
"tw:px-3",
|
|
392
|
+
"tw:py-2",
|
|
393
|
+
"tw:rounded-xl",
|
|
261
394
|
"tw:overflow-hidden",
|
|
262
395
|
"tw:break-anywhere"
|
|
263
396
|
]
|
|
264
397
|
} },
|
|
265
398
|
defaultVariants: { variant: "assistant" }
|
|
266
399
|
});
|
|
267
|
-
const MessageBubble = ({ variant, children,
|
|
268
|
-
return /* @__PURE__ */
|
|
400
|
+
const MessageBubble = ({ variant, children, actions, createdAt }) => {
|
|
401
|
+
return /* @__PURE__ */ jsx("div", {
|
|
269
402
|
className: containerClasses({ variant }),
|
|
270
403
|
"data-testid": `chat-message-${variant}`,
|
|
271
|
-
children:
|
|
272
|
-
|
|
273
|
-
size: 30,
|
|
274
|
-
title: createdAt
|
|
275
|
-
}), /* @__PURE__ */ jsxs("div", {
|
|
276
|
-
className: "tw:flex tw:min-w-0 tw:flex-1 tw:flex-col tw:gap-2",
|
|
404
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
405
|
+
className: stackClasses({ variant }),
|
|
277
406
|
children: [/* @__PURE__ */ jsx("div", {
|
|
278
407
|
className: contentClasses({ variant }),
|
|
408
|
+
title: variant === "user" ? createdAt : void 0,
|
|
279
409
|
children
|
|
280
410
|
}), actions]
|
|
281
|
-
})
|
|
411
|
+
})
|
|
282
412
|
});
|
|
283
413
|
};
|
|
284
414
|
//#endregion
|
|
@@ -319,7 +449,7 @@ const ExpandToggle = ({ isExpanded, onToggle, showMoreLabel, showLessLabel }) =>
|
|
|
319
449
|
});
|
|
320
450
|
const ChangeRequestForm = ({ value, onValueChange, onSubmit, onKeyDown, placeholder, submitLabel, formLabel, canSubmit, isSubmitting }) => /* @__PURE__ */ jsx("form", {
|
|
321
451
|
onSubmit,
|
|
322
|
-
className: "tw:border-0 tw:border-t tw:border-solid tw:border-
|
|
452
|
+
className: "tw:border-0 tw:border-t tw:border-solid tw:border-border tw:bg-card tw:text-card-foreground tw:px-4 tw:py-3",
|
|
323
453
|
"aria-label": formLabel,
|
|
324
454
|
children: /* @__PURE__ */ jsxs("div", {
|
|
325
455
|
className: "tw:relative",
|
|
@@ -399,8 +529,10 @@ const PlanApproval = ({ status, title, summary, stepCount, planBody, defaultExpa
|
|
|
399
529
|
const canShowPlanBody = planBody != null;
|
|
400
530
|
const trimmedChangeRequest = changeRequest.trim();
|
|
401
531
|
const canSubmitChangeRequest = trimmedChangeRequest.length > 0 && !isSubmitting;
|
|
532
|
+
const [isClosing, setIsClosing] = useState(false);
|
|
402
533
|
const toggleExpanded = () => {
|
|
403
534
|
const next = !isExpanded;
|
|
535
|
+
if (!next) setIsClosing(hasMotion());
|
|
404
536
|
if (isExpandedProp === void 0) setUncontrolledExpanded(next);
|
|
405
537
|
onExpandToggle?.(next);
|
|
406
538
|
};
|
|
@@ -449,7 +581,7 @@ const PlanApproval = ({ status, title, summary, stepCount, planBody, defaultExpa
|
|
|
449
581
|
});
|
|
450
582
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("section", {
|
|
451
583
|
"aria-label": title,
|
|
452
|
-
className: cn("tw:flex tw:w-full tw:max-w-[800px] tw:flex-col tw:overflow-hidden tw:rounded-xl tw:border tw:border-solid tw:border-border tw:bg-
|
|
584
|
+
className: cn("tw:flex tw:w-full tw:max-w-[800px] tw:flex-col tw:overflow-hidden tw:rounded-xl tw:border tw:border-solid tw:border-border tw:bg-background tw:text-foreground", className),
|
|
453
585
|
"data-testid": "plan-approval-root",
|
|
454
586
|
"data-plan-status": status,
|
|
455
587
|
children: [
|
|
@@ -466,11 +598,11 @@ const PlanApproval = ({ status, title, summary, stepCount, planBody, defaultExpa
|
|
|
466
598
|
dismissedLabel: dismissedPillLabel,
|
|
467
599
|
changesRequestedLabel: changesRequestedPillLabel
|
|
468
600
|
}), stepCount != null && stepCount > 0 && /* @__PURE__ */ jsx("span", {
|
|
469
|
-
className: "tw:text-xs tw:leading-4 tw:text-
|
|
601
|
+
className: "tw:text-xs tw:leading-4 tw:text-muted-foreground",
|
|
470
602
|
children: stepCountLabel(stepCount)
|
|
471
603
|
})]
|
|
472
604
|
}), /* @__PURE__ */ jsx("p", {
|
|
473
|
-
className: "tw:m-0 tw:text-base tw:font-semibold tw:leading-6
|
|
605
|
+
className: "tw:m-0 tw:text-base tw:font-semibold tw:leading-6",
|
|
474
606
|
children: title
|
|
475
607
|
})]
|
|
476
608
|
}), /* @__PURE__ */ jsxs("div", {
|
|
@@ -499,15 +631,20 @@ const PlanApproval = ({ status, title, summary, stepCount, planBody, defaultExpa
|
|
|
499
631
|
})]
|
|
500
632
|
}),
|
|
501
633
|
summary != null && /* @__PURE__ */ jsx("div", {
|
|
502
|
-
className: cn("tw:whitespace-pre-wrap tw:border-0 tw:border-t tw:border-solid tw:border-
|
|
634
|
+
className: cn("tw:whitespace-pre-wrap tw:border-0 tw:border-t tw:border-solid tw:border-border tw:px-4 tw:pt-4 tw:text-sm", isExpanded && canShowPlanBody ? "tw:pb-4" : "tw:pb-2"),
|
|
503
635
|
children: summary
|
|
504
636
|
}),
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
637
|
+
canShowPlanBody && /* @__PURE__ */ jsx(CollapsibleBody, {
|
|
638
|
+
isExpanded,
|
|
639
|
+
isClosing,
|
|
640
|
+
onClosed: () => setIsClosing(false),
|
|
641
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
642
|
+
className: "tw:max-h-[400px] tw:overflow-y-auto tw:border-0 tw:border-t tw:border-solid tw:border-border tw:bg-card tw:p-4 tw:text-sm tw:text-card-foreground",
|
|
643
|
+
children: planBody
|
|
644
|
+
})
|
|
508
645
|
}),
|
|
509
646
|
!isFullScreen && /* @__PURE__ */ jsxs(Fragment$1, { children: [showChangeRequestForm && changeRequestForm, /* @__PURE__ */ jsxs("div", {
|
|
510
|
-
className: cn("tw:flex tw:items-center tw:gap-2 tw:overflow-x-auto tw:border-0 tw:border-t tw:border-solid tw:border-
|
|
647
|
+
className: cn("tw:flex tw:items-center tw:gap-2 tw:overflow-x-auto tw:border-0 tw:border-t tw:border-solid tw:border-border tw:bg-card tw:px-4 tw:py-3 tw:text-card-foreground", canShowPlanBody ? "tw:justify-between" : "tw:justify-end"),
|
|
511
648
|
children: [canShowPlanBody && /* @__PURE__ */ jsx("div", {
|
|
512
649
|
className: "tw:shrink-0",
|
|
513
650
|
children: /* @__PURE__ */ jsx(ExpandToggle, {
|
|
@@ -569,14 +706,14 @@ const PlanApproval = ({ status, title, summary, stepCount, planBody, defaultExpa
|
|
|
569
706
|
})
|
|
570
707
|
}),
|
|
571
708
|
/* @__PURE__ */ jsx(FullScreenModalBody, {
|
|
572
|
-
className: "tw:bg-
|
|
709
|
+
className: "tw:bg-card tw:px-6 tw:py-4 tw:text-card-foreground",
|
|
573
710
|
children: /* @__PURE__ */ jsx("div", {
|
|
574
|
-
className: "tw:mx-auto tw:w-full tw:max-w-[800px] tw:text-sm
|
|
711
|
+
className: "tw:mx-auto tw:w-full tw:max-w-[800px] tw:text-sm",
|
|
575
712
|
children: planBody
|
|
576
713
|
})
|
|
577
714
|
}),
|
|
578
715
|
(showChangeRequestForm || showActions) && /* @__PURE__ */ jsx("div", {
|
|
579
|
-
className: "tw:shrink-0 tw:border-0 tw:border-t tw:border-solid tw:border-
|
|
716
|
+
className: "tw:shrink-0 tw:border-0 tw:border-t tw:border-solid tw:border-border tw:bg-card tw:text-card-foreground",
|
|
580
717
|
children: /* @__PURE__ */ jsxs("div", {
|
|
581
718
|
className: "tw:mx-auto tw:w-full tw:max-w-[800px]",
|
|
582
719
|
children: [showChangeRequestForm && changeRequestForm, showActions && /* @__PURE__ */ jsx("div", {
|
|
@@ -665,7 +802,7 @@ const PromptInputSubmit = ({ ref, disabled, status = "ready" }) => {
|
|
|
665
802
|
const icon = (() => {
|
|
666
803
|
if (status === "streaming") return /* @__PURE__ */ jsx(CirclePause, { className: "tw:size-4" });
|
|
667
804
|
if (status === "interrupted") return /* @__PURE__ */ jsx(Play, { className: "tw:size-4" });
|
|
668
|
-
return /* @__PURE__ */ jsx(Send, { className: "tw:size-4" });
|
|
805
|
+
return /* @__PURE__ */ jsx(Send, { className: "tw:size-4 tw:translate-x-[-1px] tw:translate-y-[1px]" });
|
|
669
806
|
})();
|
|
670
807
|
const getTooltipText = () => {
|
|
671
808
|
if (status === "streaming") return "Stop";
|
|
@@ -679,9 +816,9 @@ const PromptInputSubmit = ({ ref, disabled, status = "ready" }) => {
|
|
|
679
816
|
disabled,
|
|
680
817
|
"aria-label": ARIA_LABEL_BY_STATUS[status],
|
|
681
818
|
size: "icon-sm",
|
|
682
|
-
variant: "
|
|
819
|
+
variant: "primary",
|
|
683
820
|
isLoading: status === "submitted",
|
|
684
|
-
className: "tw:ml-auto tw:flex tw:items-center tw:rounded-
|
|
821
|
+
className: cn("tw:ml-auto tw:flex tw:items-center tw:rounded-full", "tw:bg-gradient-to-br tw:from-[#61E4FF] tw:via-[#1F8FFF] tw:to-[#7C5CFF]", "tw:hover:not-disabled:brightness-110"),
|
|
685
822
|
children: status !== "submitted" && icon
|
|
686
823
|
}) })
|
|
687
824
|
}), getTooltipText() && /* @__PURE__ */ jsx(Tooltip.Content, {
|
|
@@ -742,12 +879,20 @@ const wrapperVariants = cva(null, {
|
|
|
742
879
|
inline: ""
|
|
743
880
|
} }
|
|
744
881
|
});
|
|
745
|
-
const PromptInput = ({ onSend, onAbort, onContinue, prefix, variant, suffix, disabled, disableSubmit, value = "", onValueChange, status = "ready", maxRows = 6, minRows, commands, ...textareaProps }) => {
|
|
882
|
+
const PromptInput = ({ onSend, onAbort, onContinue, prefix, variant, suffix, disabled, disableSubmit, value = "", onValueChange, status = "ready", maxRows = 6, minRows, commands, autoFocus, textareaRef: publishedRef, ...textareaProps }) => {
|
|
746
883
|
const defaultMinRows = variant === "inline" ? 1 : 2;
|
|
747
884
|
const isDisabled = (disabled || disableSubmit || !value.trim()) && status !== "streaming" && status !== "interrupted";
|
|
748
885
|
const textareaId = useId();
|
|
749
886
|
const textareaRef = useRef(null);
|
|
887
|
+
const setTextareaNode = useCallback((node) => {
|
|
888
|
+
textareaRef.current = node;
|
|
889
|
+
if (publishedRef) publishedRef.current = node;
|
|
890
|
+
}, [publishedRef]);
|
|
750
891
|
const [dismissedValue, setDismissedValue] = useState(null);
|
|
892
|
+
const autoFocusRef = useRef(autoFocus);
|
|
893
|
+
useEffect(() => {
|
|
894
|
+
if (autoFocusRef.current) textareaRef.current?.focus({ preventScroll: true });
|
|
895
|
+
}, []);
|
|
751
896
|
if (dismissedValue !== null && value !== dismissedValue) setDismissedValue(null);
|
|
752
897
|
const hasCommands = !!commands && commands.length > 0;
|
|
753
898
|
const valueLooksLikeSlashCommand = value.startsWith("/") && !/\s/.test(value);
|
|
@@ -813,7 +958,7 @@ const PromptInput = ({ onSend, onAbort, onContinue, prefix, variant, suffix, dis
|
|
|
813
958
|
minRows: minRows ?? defaultMinRows,
|
|
814
959
|
maxRows,
|
|
815
960
|
id: textareaId,
|
|
816
|
-
ref:
|
|
961
|
+
ref: setTextareaNode,
|
|
817
962
|
value,
|
|
818
963
|
onChange: handleOnChange,
|
|
819
964
|
onKeyDown: handleOnKeyDown,
|
|
@@ -1093,9 +1238,9 @@ const SuggestedPrompt = ({ label, disabled, onClick, icon, className }) => {
|
|
|
1093
1238
|
return /* @__PURE__ */ jsxs("button", {
|
|
1094
1239
|
type: "button",
|
|
1095
1240
|
disabled,
|
|
1096
|
-
className: cn("tailwindcss-preflight tw:flex tw:items-center tw:justify-start tw:gap-2 tw:whitespace-nowrap tw:rounded-lg tw:
|
|
1241
|
+
className: cn("tailwindcss-preflight tw:flex tw:items-center tw:justify-start tw:gap-2.5 tw:whitespace-nowrap", "tw:rounded-lg tw:px-3 tw:py-2", "tw:text-left tw:text-sm tw:font-medium tw:text-foreground", "tw:transition-colors tw:not-disabled:hover:bg-accent", "tw:focus-visible:outline-none tw:focus-visible:ring-2 tw:focus-visible:ring-ring tw:focus-visible:ring-offset-1", "tw:disabled:cursor-not-allowed tw:disabled:opacity-50", className),
|
|
1097
1242
|
onClick,
|
|
1098
|
-
children: [icon ?? /* @__PURE__ */ jsx(
|
|
1243
|
+
children: [icon ?? /* @__PURE__ */ jsx(Sparkles, { className: "tw:size-4 tw:shrink-0 tw:basis-4 tw:[&_*]:stroke-aigradient-600" }), /* @__PURE__ */ jsx("div", {
|
|
1099
1244
|
className: "tw:whitespace-normal tw:text-left",
|
|
1100
1245
|
children: label
|
|
1101
1246
|
})]
|
|
@@ -1105,10 +1250,10 @@ const SuggestedPrompt = ({ label, disabled, onClick, icon, className }) => {
|
|
|
1105
1250
|
//#region src/blocks/AIKit/ThinkingIndicator.tsx
|
|
1106
1251
|
const ThinkingIndicator = ({ label = "Thinking..." }) => {
|
|
1107
1252
|
return /* @__PURE__ */ jsxs("div", {
|
|
1108
|
-
className: "tw:flex tw:items-center tw:gap-
|
|
1253
|
+
className: "tw:flex tw:items-center tw:gap-1.5",
|
|
1109
1254
|
"data-testid": "chat-thinking-indicator",
|
|
1110
|
-
children: [/* @__PURE__ */ jsx(Loader2, { className: "tw:size-
|
|
1111
|
-
className: "tw:text-
|
|
1255
|
+
children: [/* @__PURE__ */ jsx(Loader2, { className: "tw:size-3.5 tw:animate-spin tw:text-muted-foreground" }), /* @__PURE__ */ jsx("span", {
|
|
1256
|
+
className: "tw:text-xs tw:font-medium tw:text-muted-foreground",
|
|
1112
1257
|
children: label
|
|
1113
1258
|
})]
|
|
1114
1259
|
});
|
|
@@ -1259,9 +1404,83 @@ const ToolCallChip = ({ label, state, icon, trailing, onClick, className }) => {
|
|
|
1259
1404
|
});
|
|
1260
1405
|
};
|
|
1261
1406
|
//#endregion
|
|
1407
|
+
//#region src/blocks/AIKit/ToolCallStatusHeader.tsx
|
|
1408
|
+
const headerVariants = cva("tw:flex tw:items-center tw:justify-between tw:gap-2 tw:px-2.5 tw:py-1.5", {
|
|
1409
|
+
variants: { status: {
|
|
1410
|
+
processing: "tw:border-b tw:border-border/60",
|
|
1411
|
+
warning: "tw:bg-warning/10",
|
|
1412
|
+
success: "tw:border-b tw:border-border/60",
|
|
1413
|
+
error: "tw:bg-destructive/10"
|
|
1414
|
+
} },
|
|
1415
|
+
defaultVariants: { status: "success" }
|
|
1416
|
+
});
|
|
1417
|
+
const statusInk = {
|
|
1418
|
+
processing: "tw:text-muted-foreground",
|
|
1419
|
+
warning: "tw:text-warning",
|
|
1420
|
+
success: "tw:text-muted-foreground",
|
|
1421
|
+
error: "tw:text-destructive"
|
|
1422
|
+
};
|
|
1423
|
+
const statusIconInk = {
|
|
1424
|
+
processing: "tw:text-muted-foreground",
|
|
1425
|
+
warning: "tw:text-warning",
|
|
1426
|
+
success: "tw:text-success/70",
|
|
1427
|
+
error: "tw:text-destructive"
|
|
1428
|
+
};
|
|
1429
|
+
const ToolCallStatusHeader = ({ icon: IconComponent, iconSpin, status, text, needsConfirmation, isCollapsible, isCollapsed, onToggleCollapse }) => {
|
|
1430
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
1431
|
+
role: isCollapsible ? "button" : void 0,
|
|
1432
|
+
tabIndex: isCollapsible ? 0 : void 0,
|
|
1433
|
+
"aria-expanded": isCollapsible ? !isCollapsed : void 0,
|
|
1434
|
+
"data-status": status,
|
|
1435
|
+
className: cn(headerVariants({ status }), isCollapsible && "tw:cursor-pointer"),
|
|
1436
|
+
onClick: isCollapsible ? onToggleCollapse : void 0,
|
|
1437
|
+
onKeyDown: isCollapsible ? (e) => {
|
|
1438
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
1439
|
+
e.preventDefault();
|
|
1440
|
+
onToggleCollapse?.();
|
|
1441
|
+
}
|
|
1442
|
+
} : void 0,
|
|
1443
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
1444
|
+
className: "tw:flex tw:min-w-0 tw:flex-1 tw:items-center tw:gap-1.5",
|
|
1445
|
+
children: [/* @__PURE__ */ jsx(IconComponent, { className: cn("tw:size-3.5 tw:shrink-0", statusIconInk[status], iconSpin && "tw:animate-spin") }), /* @__PURE__ */ jsx("span", {
|
|
1446
|
+
"data-testid": "tool-status-text",
|
|
1447
|
+
className: cn("tw:truncate tw:pr-0.5 tw:text-xs tw:font-medium", statusInk[status]),
|
|
1448
|
+
children: text
|
|
1449
|
+
})]
|
|
1450
|
+
}), (needsConfirmation || isCollapsible) && /* @__PURE__ */ jsxs("div", {
|
|
1451
|
+
className: "tw:flex tw:shrink-0 tw:items-center tw:gap-2",
|
|
1452
|
+
children: [needsConfirmation && /* @__PURE__ */ jsxs("div", {
|
|
1453
|
+
className: "tw:flex tw:items-center tw:gap-1",
|
|
1454
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
1455
|
+
"data-testid": "tool-confirmation-required",
|
|
1456
|
+
className: "tw:text-xs tw:font-medium tw:text-warning",
|
|
1457
|
+
children: "Confirmation required"
|
|
1458
|
+
}), /* @__PURE__ */ jsx(TriangleAlert, { className: "tw:size-3.5 tw:text-warning" })]
|
|
1459
|
+
}), isCollapsible && /* @__PURE__ */ jsx(ChevronDown, { className: cn("tw:size-3.5 tw:shrink-0 tw:text-muted-foreground", "tw:transition-transform tw:duration-300 tw:ease-out tw:motion-reduce:transition-none", !isCollapsed && "tw:rotate-180") })]
|
|
1460
|
+
})]
|
|
1461
|
+
});
|
|
1462
|
+
};
|
|
1463
|
+
//#endregion
|
|
1262
1464
|
//#region src/blocks/AIKit/usageStatsHelpers.ts
|
|
1263
|
-
/**
|
|
1465
|
+
/**
|
|
1466
|
+
* Clamp a percentage to 0–100 and normalize non-finite input to 0.
|
|
1467
|
+
*
|
|
1468
|
+
* - `Progress`'s indicator is unclamped, so a value over 100 slides the bar off-screen.
|
|
1469
|
+
* - `NaN` normalizes to 0 — `Math.min`/`Math.max` propagate it, and it renders as no bar at all.
|
|
1470
|
+
*/
|
|
1264
1471
|
const clampPercentage = (value) => Number.isFinite(value) ? Math.min(100, Math.max(0, value)) : 0;
|
|
1472
|
+
/**
|
|
1473
|
+
* A percentage as text — `72%`, `1.1%`, `99.9%`.
|
|
1474
|
+
*
|
|
1475
|
+
* - One decimal place, trimmed to a whole number, so `11/1000` reads as `1.1%` rather than `1%`.
|
|
1476
|
+
* - Floored, not rounded: rounding `99.96` up to `100%` disagrees with the at-limit state computed
|
|
1477
|
+
* from the raw value, exactly at the boundary everything else turns on.
|
|
1478
|
+
* - The `1e-9` nudge is for floating-point noise — `11 / 1000 * 100` is `1.0999999999999999`.
|
|
1479
|
+
*/
|
|
1480
|
+
const formatPercentage = (value) => {
|
|
1481
|
+
const floored = Math.floor(value * 10 + 1e-9) / 10;
|
|
1482
|
+
return `${Number.isInteger(floored) ? floored.toFixed(0) : floored.toFixed(1)}%`;
|
|
1483
|
+
};
|
|
1265
1484
|
//#endregion
|
|
1266
1485
|
//#region src/blocks/AIKit/UsageStatsRing.tsx
|
|
1267
1486
|
const UsageStatsRing = ({ value, size = 16, strokeWidth = 2.5, className }) => {
|
|
@@ -1280,7 +1499,7 @@ const UsageStatsRing = ({ value, size = 16, strokeWidth = 2.5, className }) => {
|
|
|
1280
1499
|
r: radius,
|
|
1281
1500
|
fill: "none",
|
|
1282
1501
|
strokeWidth,
|
|
1283
|
-
className: "tw:stroke-
|
|
1502
|
+
className: "tw:stroke-muted-foreground tw:opacity-50"
|
|
1284
1503
|
}), /* @__PURE__ */ jsx("circle", {
|
|
1285
1504
|
cx: size / 2,
|
|
1286
1505
|
cy: size / 2,
|
|
@@ -1296,26 +1515,32 @@ const UsageStatsRing = ({ value, size = 16, strokeWidth = 2.5, className }) => {
|
|
|
1296
1515
|
};
|
|
1297
1516
|
//#endregion
|
|
1298
1517
|
//#region src/blocks/AIKit/UsageStats.tsx
|
|
1299
|
-
const UsageStats = ({ value, alert = false, children, className, ariaLabel, align = "end", side = "top", sideOffset = 8 }) => {
|
|
1300
|
-
const
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1518
|
+
const UsageStats = ({ value, alert = false, children, className, ariaLabel, align = "end", side = "top", sideOffset = 8, open, onOpenChange }) => {
|
|
1519
|
+
const hasAlert = Boolean(alert);
|
|
1520
|
+
const isWarning = alert === "warning";
|
|
1521
|
+
const defaultLabel = `Usage: ${Math.round(clampPercentage(value))}%${hasAlert ? " (usage alert)" : ""}`;
|
|
1522
|
+
return /* @__PURE__ */ jsxs(HoverCard, {
|
|
1523
|
+
open,
|
|
1524
|
+
onOpenChange,
|
|
1525
|
+
children: [/* @__PURE__ */ jsx(HoverCard.Trigger, {
|
|
1526
|
+
asChild: true,
|
|
1527
|
+
children: /* @__PURE__ */ jsxs("span", {
|
|
1528
|
+
"aria-label": ariaLabel ?? defaultLabel,
|
|
1529
|
+
className: cn("tw:relative tw:inline-flex tw:size-8 tw:items-center tw:justify-center", className),
|
|
1530
|
+
children: [/* @__PURE__ */ jsx(UsageStatsRing, { value }), hasAlert && /* @__PURE__ */ jsx(AlertCircle, {
|
|
1531
|
+
"data-testid": "usage-stats-alert",
|
|
1532
|
+
className: cn("tw:absolute tw:-right-0.5 tw:-top-0.5 tw:size-3", isWarning ? "tw:text-warning-500" : "tw:text-error-500")
|
|
1533
|
+
})]
|
|
1534
|
+
})
|
|
1535
|
+
}), /* @__PURE__ */ jsx(HoverCard.Content, {
|
|
1536
|
+
align,
|
|
1537
|
+
side,
|
|
1538
|
+
sideOffset,
|
|
1539
|
+
children
|
|
1540
|
+
})]
|
|
1541
|
+
});
|
|
1317
1542
|
};
|
|
1318
1543
|
//#endregion
|
|
1319
|
-
export { AnswerSummary, CollapsibleStepHeader, InlineStepDetail, InlineStepLabel, Markdown, MessageBubble, PlanApproval, PlanRewritingIndicator, PromptInput, Question, QuestionBlock, SuggestedPrompt, ThinkingIndicator, ToolCallApproval, ToolCallChip, UsageStats, UsageStatsRing };
|
|
1544
|
+
export { AnswerActions, AnswerSummary, CollapsibleStepHeader, DIAGRAM_LANGUAGES, InlineStepDetail, InlineStepLabel, Markdown, MessageBubble, PlanApproval, PlanRewritingIndicator, PromptInput, Question, QuestionBlock, SuggestedPrompt, ThinkingIndicator, ToolCallApproval, ToolCallChip, ToolCallStatusHeader, UsageStats, UsageStatsRing, clampPercentage, formatPercentage };
|
|
1320
1545
|
|
|
1321
|
-
//# sourceMappingURL=AIKit-
|
|
1546
|
+
//# sourceMappingURL=AIKit-CNX6aiKm.js.map
|