@tetrascience-npm/tetrascience-react-ui 0.7.0 → 1.0.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/README.md +58 -4
- package/dist/ai/attachments.cjs +2 -0
- package/dist/ai/attachments.cjs.map +1 -0
- package/dist/ai/attachments.js +224 -0
- package/dist/ai/attachments.js.map +1 -0
- package/dist/ai/chain-of-thought.cjs +2 -0
- package/dist/ai/chain-of-thought.cjs.map +1 -0
- package/dist/ai/chain-of-thought.js +145 -0
- package/dist/ai/chain-of-thought.js.map +1 -0
- package/dist/ai/confirmation.cjs +2 -0
- package/dist/ai/confirmation.cjs.map +1 -0
- package/dist/ai/confirmation.js +109 -0
- package/dist/ai/confirmation.js.map +1 -0
- package/dist/ai/context.cjs +2 -0
- package/dist/ai/context.cjs.map +1 -0
- package/dist/ai/context.js +267 -0
- package/dist/ai/context.js.map +1 -0
- package/dist/ai/conversation.cjs +4 -0
- package/dist/ai/conversation.cjs.map +1 -0
- package/dist/ai/conversation.js +108 -0
- package/dist/ai/conversation.js.map +1 -0
- package/dist/ai/inline-citation.cjs +2 -0
- package/dist/ai/inline-citation.cjs.map +1 -0
- package/dist/ai/inline-citation.js +182 -0
- package/dist/ai/inline-citation.js.map +1 -0
- package/dist/ai/message.cjs +2 -0
- package/dist/ai/message.cjs.map +1 -0
- package/dist/ai/message.js +237 -0
- package/dist/ai/message.js.map +1 -0
- package/dist/ai/model-selector.cjs +2 -0
- package/dist/ai/model-selector.cjs.map +1 -0
- package/dist/ai/model-selector.js +77 -0
- package/dist/ai/model-selector.js.map +1 -0
- package/dist/ai/prompt-input.cjs +2 -0
- package/dist/ai/prompt-input.cjs.map +1 -0
- package/dist/ai/prompt-input.js +776 -0
- package/dist/ai/prompt-input.js.map +1 -0
- package/dist/ai/queue.cjs +2 -0
- package/dist/ai/queue.cjs.map +1 -0
- package/dist/ai/queue.js +209 -0
- package/dist/ai/queue.js.map +1 -0
- package/dist/ai/reasoning.cjs +2 -0
- package/dist/ai/reasoning.cjs.map +1 -0
- package/dist/ai/reasoning.js +129 -0
- package/dist/ai/reasoning.js.map +1 -0
- package/dist/ai/shimmer.cjs +2 -0
- package/dist/ai/shimmer.cjs.map +1 -0
- package/dist/ai/shimmer.js +49 -0
- package/dist/ai/shimmer.js.map +1 -0
- package/dist/ai/sources.cjs +2 -0
- package/dist/ai/sources.cjs.map +1 -0
- package/dist/ai/sources.js +54 -0
- package/dist/ai/sources.js.map +1 -0
- package/dist/ai/speech-input.cjs +2 -0
- package/dist/ai/speech-input.cjs.map +1 -0
- package/dist/ai/speech-input.js +123 -0
- package/dist/ai/speech-input.js.map +1 -0
- package/dist/ai/stream-status.cjs +2 -0
- package/dist/ai/stream-status.cjs.map +1 -0
- package/dist/ai/stream-status.js +108 -0
- package/dist/ai/stream-status.js.map +1 -0
- package/dist/ai/suggestion.cjs +2 -0
- package/dist/ai/suggestion.cjs.map +1 -0
- package/dist/ai/suggestion.js +38 -0
- package/dist/ai/suggestion.js.map +1 -0
- package/dist/ai/task.cjs +2 -0
- package/dist/ai/task.cjs.map +1 -0
- package/dist/ai/task.js +101 -0
- package/dist/ai/task.js.map +1 -0
- package/dist/ai/tool.cjs +2 -0
- package/dist/ai/tool.cjs.map +1 -0
- package/dist/ai/tool.js +139 -0
- package/dist/ai/tool.js.map +1 -0
- package/dist/charts/AreaPlot.cjs +2 -0
- package/dist/charts/AreaPlot.cjs.map +1 -0
- package/dist/charts/AreaPlot.js +5 -0
- package/dist/charts/AreaPlot.js.map +1 -0
- package/dist/charts/BarChart.cjs +2 -0
- package/dist/charts/BarChart.cjs.map +1 -0
- package/dist/charts/BarChart.js +5 -0
- package/dist/charts/BarChart.js.map +1 -0
- package/dist/charts/BoxPlot.cjs +2 -0
- package/dist/charts/BoxPlot.cjs.map +1 -0
- package/dist/charts/BoxPlot.js +5 -0
- package/dist/charts/BoxPlot.js.map +1 -0
- package/dist/charts/ChartTooltip.cjs +2 -0
- package/dist/charts/ChartTooltip.cjs.map +1 -0
- package/dist/charts/ChartTooltip.js +8 -0
- package/dist/charts/ChartTooltip.js.map +1 -0
- package/dist/charts/Chromatogram.cjs +2 -0
- package/dist/charts/Chromatogram.cjs.map +1 -0
- package/dist/charts/Chromatogram.js +5 -0
- package/dist/charts/Chromatogram.js.map +1 -0
- package/dist/charts/Electropherogram.cjs +2 -0
- package/dist/charts/Electropherogram.cjs.map +1 -0
- package/dist/charts/Electropherogram.js +5 -0
- package/dist/charts/Electropherogram.js.map +1 -0
- package/dist/charts/Histogram.cjs +2 -0
- package/dist/charts/Histogram.cjs.map +1 -0
- package/dist/charts/Histogram.js +5 -0
- package/dist/charts/Histogram.js.map +1 -0
- package/dist/charts/LinePlot.cjs +2 -0
- package/dist/charts/LinePlot.cjs.map +1 -0
- package/dist/charts/LinePlot.js +5 -0
- package/dist/charts/LinePlot.js.map +1 -0
- package/dist/charts/PieChart.cjs +2 -0
- package/dist/charts/PieChart.cjs.map +1 -0
- package/dist/charts/PieChart.js +5 -0
- package/dist/charts/PieChart.js.map +1 -0
- package/dist/charts/PlateMap.cjs +2 -0
- package/dist/charts/PlateMap.cjs.map +1 -0
- package/dist/charts/PlateMap.js +5 -0
- package/dist/charts/PlateMap.js.map +1 -0
- package/dist/charts/ScatterPlot.cjs +2 -0
- package/dist/charts/ScatterPlot.cjs.map +1 -0
- package/dist/charts/ScatterPlot.js +5 -0
- package/dist/charts/ScatterPlot.js.map +1 -0
- package/dist/charts/ScatterPlotInteractive.cjs +2 -0
- package/dist/charts/ScatterPlotInteractive.cjs.map +1 -0
- package/dist/charts/ScatterPlotInteractive.js +14 -0
- package/dist/charts/ScatterPlotInteractive.js.map +1 -0
- package/dist/charts/StackedChromatogram.cjs +2 -0
- package/dist/charts/StackedChromatogram.cjs.map +1 -0
- package/dist/charts/StackedChromatogram.js +7 -0
- package/dist/charts/StackedChromatogram.js.map +1 -0
- package/dist/components/ai/attachments.d.ts +54 -0
- package/dist/components/ai/chain-of-thought.d.ts +56 -0
- package/dist/components/ai/confirmation.d.ts +47 -0
- package/dist/components/ai/context.d.ts +40 -0
- package/dist/components/ai/conversation.d.ts +23 -0
- package/dist/components/ai/inline-citation.d.ts +38 -0
- package/dist/components/ai/message.d.ts +37 -0
- package/dist/components/ai/model-selector.d.ts +36 -0
- package/dist/components/ai/prompt-input.d.ts +158 -0
- package/dist/components/ai/queue.d.ts +72 -0
- package/dist/components/ai/reasoning.d.ts +26 -0
- package/dist/components/ai/shimmer.d.ts +17 -0
- package/dist/components/ai/sources.d.ts +12 -0
- package/dist/components/ai/speech-input.d.ts +54 -0
- package/dist/components/ai/stream-status.d.ts +66 -0
- package/dist/components/ai/streamdown-code-plugin.cjs +2 -0
- package/dist/components/ai/streamdown-code-plugin.cjs.map +1 -0
- package/dist/components/ai/streamdown-code-plugin.d.ts +2 -0
- package/dist/components/ai/streamdown-code-plugin.js +42 -0
- package/dist/components/ai/streamdown-code-plugin.js.map +1 -0
- package/dist/components/ai/streamdown-plugins.cjs +2 -0
- package/dist/components/ai/streamdown-plugins.cjs.map +1 -0
- package/dist/components/ai/streamdown-plugins.d.ts +2 -0
- package/dist/components/ai/streamdown-plugins.js +14 -0
- package/dist/components/ai/streamdown-plugins.js.map +1 -0
- package/dist/components/ai/suggestion.d.ts +9 -0
- package/dist/components/ai/task.d.ts +16 -0
- package/dist/components/ai/tool.d.ts +33 -0
- package/dist/components/ai/use-streamdown-plugins.cjs +2 -0
- package/dist/components/ai/use-streamdown-plugins.cjs.map +1 -0
- package/dist/components/ai/use-streamdown-plugins.d.ts +8 -0
- package/dist/components/ai/use-streamdown-plugins.js +25 -0
- package/dist/components/ai/use-streamdown-plugins.js.map +1 -0
- package/dist/components/charts/AreaPlot/AreaPlot.cjs +2 -0
- package/dist/components/charts/AreaPlot/AreaPlot.cjs.map +1 -0
- package/dist/components/charts/AreaPlot/AreaPlot.d.ts +39 -0
- package/dist/components/charts/AreaPlot/AreaPlot.js +270 -0
- package/dist/components/charts/AreaPlot/AreaPlot.js.map +1 -0
- package/dist/components/charts/AreaPlot/index.d.ts +2 -0
- package/dist/components/charts/BarChart/BarChart.cjs +2 -0
- package/dist/components/charts/BarChart/BarChart.cjs.map +1 -0
- package/dist/components/charts/BarChart/BarChart.d.ts +44 -0
- package/dist/components/charts/BarChart/BarChart.js +219 -0
- package/dist/components/charts/BarChart/BarChart.js.map +1 -0
- package/dist/components/charts/BarChart/index.d.ts +2 -0
- package/dist/components/charts/BoxPlot/BoxPlot.cjs +2 -0
- package/dist/components/charts/BoxPlot/BoxPlot.cjs.map +1 -0
- package/dist/components/charts/BoxPlot/BoxPlot.d.ts +33 -0
- package/dist/components/charts/BoxPlot/BoxPlot.js +208 -0
- package/dist/components/charts/BoxPlot/BoxPlot.js.map +1 -0
- package/dist/components/charts/BoxPlot/index.d.ts +2 -0
- package/dist/components/charts/ChartTooltip/ChartTooltip.cjs +1 -1
- package/dist/components/charts/ChartTooltip/ChartTooltip.cjs.map +1 -1
- package/dist/components/charts/ChartTooltip/ChartTooltip.d.ts +71 -0
- package/dist/components/charts/ChartTooltip/ChartTooltip.js +22 -22
- package/dist/components/charts/ChartTooltip/ChartTooltip.js.map +1 -1
- package/dist/components/charts/ChartTooltip/index.d.ts +2 -0
- package/dist/components/charts/ChartTooltip/lines.d.ts +54 -0
- package/dist/components/charts/Chromatogram/Chromatogram.cjs +1 -1
- package/dist/components/charts/Chromatogram/Chromatogram.cjs.map +1 -1
- package/dist/components/charts/Chromatogram/Chromatogram.d.ts +5 -0
- package/dist/components/charts/Chromatogram/Chromatogram.js +232 -170
- package/dist/components/charts/Chromatogram/Chromatogram.js.map +1 -1
- package/dist/components/charts/Chromatogram/annotations.cjs +2 -0
- package/dist/components/charts/Chromatogram/annotations.cjs.map +1 -0
- package/dist/components/charts/Chromatogram/annotations.d.ts +50 -0
- package/dist/components/charts/Chromatogram/annotations.js +137 -0
- package/dist/components/charts/Chromatogram/annotations.js.map +1 -0
- package/dist/components/charts/Chromatogram/boundaryMarkers.cjs +2 -0
- package/dist/components/charts/Chromatogram/boundaryMarkers.cjs.map +1 -0
- package/dist/components/charts/Chromatogram/boundaryMarkers.d.ts +14 -0
- package/dist/components/charts/Chromatogram/boundaryMarkers.js +34 -0
- package/dist/components/charts/Chromatogram/boundaryMarkers.js.map +1 -0
- package/dist/components/charts/Chromatogram/constants.cjs +2 -0
- package/dist/components/charts/Chromatogram/constants.cjs.map +1 -0
- package/dist/components/charts/Chromatogram/constants.d.ts +46 -0
- package/dist/components/charts/Chromatogram/constants.js +36 -0
- package/dist/components/charts/Chromatogram/constants.js.map +1 -0
- package/dist/components/charts/Chromatogram/dataProcessing.cjs +2 -0
- package/dist/components/charts/Chromatogram/dataProcessing.cjs.map +1 -0
- package/dist/components/charts/Chromatogram/dataProcessing.d.ts +49 -0
- package/dist/components/charts/Chromatogram/dataProcessing.js +90 -0
- package/dist/components/charts/Chromatogram/dataProcessing.js.map +1 -0
- package/dist/components/charts/Chromatogram/index.d.ts +2 -0
- package/dist/components/charts/Chromatogram/peakDetection.cjs.map +1 -0
- package/dist/components/charts/Chromatogram/peakDetection.d.ts +33 -0
- package/dist/components/charts/Chromatogram/peakDetection.js.map +1 -0
- package/dist/components/charts/Chromatogram/plotBuilder.cjs +2 -0
- package/dist/components/charts/Chromatogram/plotBuilder.cjs.map +1 -0
- package/dist/components/charts/Chromatogram/plotBuilder.d.ts +58 -0
- package/dist/components/charts/Chromatogram/plotBuilder.js +216 -0
- package/dist/components/charts/Chromatogram/plotBuilder.js.map +1 -0
- package/dist/components/charts/Chromatogram/regionOverlays.cjs +2 -0
- package/dist/components/charts/Chromatogram/regionOverlays.cjs.map +1 -0
- package/dist/components/charts/Chromatogram/regionOverlays.d.ts +9 -0
- package/dist/components/charts/Chromatogram/regionOverlays.js +26 -0
- package/dist/components/charts/Chromatogram/regionOverlays.js.map +1 -0
- package/dist/components/charts/Chromatogram/types.d.ts +258 -0
- package/dist/components/charts/Electropherogram/Electropherogram.cjs +2 -0
- package/dist/components/charts/Electropherogram/Electropherogram.cjs.map +1 -0
- package/dist/components/charts/Electropherogram/Electropherogram.d.ts +22 -0
- package/dist/components/charts/Electropherogram/Electropherogram.js +180 -0
- package/dist/components/charts/Electropherogram/Electropherogram.js.map +1 -0
- package/dist/components/charts/Electropherogram/index.d.ts +2 -0
- package/dist/components/charts/Histogram/Histogram.cjs +1 -1
- package/dist/components/charts/Histogram/Histogram.cjs.map +1 -1
- package/dist/components/charts/Histogram/Histogram.d.ts +36 -0
- package/dist/components/charts/Histogram/Histogram.js +107 -108
- package/dist/components/charts/Histogram/Histogram.js.map +1 -1
- package/dist/components/charts/Histogram/index.d.ts +2 -0
- package/dist/components/charts/LinePlot/LinePlot.cjs +2 -0
- package/dist/components/charts/LinePlot/LinePlot.cjs.map +1 -0
- package/dist/components/charts/LinePlot/LinePlot.d.ts +45 -0
- package/dist/components/charts/LinePlot/LinePlot.js +224 -0
- package/dist/components/charts/LinePlot/LinePlot.js.map +1 -0
- package/dist/components/charts/LinePlot/index.d.ts +2 -0
- package/dist/components/charts/PieChart/PieChart.cjs +1 -1
- package/dist/components/charts/PieChart/PieChart.cjs.map +1 -1
- package/dist/components/charts/PieChart/PieChart.d.ts +20 -0
- package/dist/components/charts/PieChart/PieChart.js +62 -61
- package/dist/components/charts/PieChart/PieChart.js.map +1 -1
- package/dist/components/charts/PieChart/index.d.ts +2 -0
- package/dist/components/charts/PlateMap/PlateMap.cjs +1 -1
- package/dist/components/charts/PlateMap/PlateMap.cjs.map +1 -1
- package/dist/components/charts/PlateMap/PlateMap.d.ts +29 -0
- package/dist/components/charts/PlateMap/PlateMap.js +246 -242
- package/dist/components/charts/PlateMap/PlateMap.js.map +1 -1
- package/dist/components/charts/PlateMap/constants.d.ts +75 -0
- package/dist/components/charts/PlateMap/index.d.ts +2 -0
- package/dist/components/charts/PlateMap/types.d.ts +322 -0
- package/dist/components/charts/PlateMap/utils.d.ts +133 -0
- package/dist/components/charts/ScatterPlot/ScatterPlot.cjs +2 -0
- package/dist/components/charts/ScatterPlot/ScatterPlot.cjs.map +1 -0
- package/dist/components/charts/ScatterPlot/ScatterPlot.d.ts +43 -0
- package/dist/components/charts/ScatterPlot/ScatterPlot.js +252 -0
- package/dist/components/charts/ScatterPlot/ScatterPlot.js.map +1 -0
- package/dist/components/charts/ScatterPlot/index.d.ts +2 -0
- package/dist/components/charts/ScatterPlotInteractive/ScatterPlotInteractive.cjs +2 -0
- package/dist/components/charts/ScatterPlotInteractive/ScatterPlotInteractive.cjs.map +1 -0
- package/dist/components/charts/ScatterPlotInteractive/ScatterPlotInteractive.d.ts +25 -0
- package/dist/components/charts/ScatterPlotInteractive/ScatterPlotInteractive.js +215 -0
- package/dist/components/charts/ScatterPlotInteractive/ScatterPlotInteractive.js.map +1 -0
- package/dist/components/charts/ScatterPlotInteractive/constants.cjs +2 -0
- package/dist/components/charts/ScatterPlotInteractive/constants.cjs.map +1 -0
- package/dist/components/charts/ScatterPlotInteractive/constants.d.ts +50 -0
- package/dist/components/charts/ScatterPlotInteractive/constants.js +38 -0
- package/dist/components/charts/ScatterPlotInteractive/constants.js.map +1 -0
- package/dist/components/charts/ScatterPlotInteractive/index.d.ts +3 -0
- package/dist/components/charts/ScatterPlotInteractive/types.d.ts +226 -0
- package/dist/components/charts/ScatterPlotInteractive/utils.cjs +2 -0
- package/dist/components/charts/ScatterPlotInteractive/utils.cjs.map +1 -0
- package/dist/components/charts/ScatterPlotInteractive/utils.d.ts +72 -0
- package/dist/components/charts/ScatterPlotInteractive/utils.js +261 -0
- package/dist/components/charts/ScatterPlotInteractive/utils.js.map +1 -0
- package/dist/components/charts/StackedChromatogram/StackedChromatogram.cjs +2 -0
- package/dist/components/charts/StackedChromatogram/StackedChromatogram.cjs.map +1 -0
- package/dist/components/charts/StackedChromatogram/StackedChromatogram.d.ts +3 -0
- package/dist/components/charts/StackedChromatogram/StackedChromatogram.js +40 -0
- package/dist/components/charts/StackedChromatogram/StackedChromatogram.js.map +1 -0
- package/dist/components/charts/StackedChromatogram/index.d.ts +3 -0
- package/dist/components/charts/StackedChromatogram/transforms.cjs +2 -0
- package/dist/components/charts/StackedChromatogram/transforms.cjs.map +1 -0
- package/dist/components/charts/StackedChromatogram/transforms.d.ts +9 -0
- package/dist/components/charts/StackedChromatogram/transforms.js +31 -0
- package/dist/components/charts/StackedChromatogram/transforms.js.map +1 -0
- package/dist/components/charts/StackedChromatogram/types.d.ts +26 -0
- package/dist/components/charts/plotly-loader.cjs +2 -0
- package/dist/components/charts/plotly-loader.cjs.map +1 -0
- package/dist/components/charts/plotly-loader.d.ts +29 -0
- package/dist/components/charts/plotly-loader.js +22 -0
- package/dist/components/charts/plotly-loader.js.map +1 -0
- package/dist/components/composed/AssistantLayout/AssistantLayout.cjs +2 -0
- package/dist/components/composed/AssistantLayout/AssistantLayout.cjs.map +1 -0
- package/dist/components/composed/AssistantLayout/AssistantLayout.d.ts +63 -0
- package/dist/components/composed/AssistantLayout/AssistantLayout.js +142 -0
- package/dist/components/composed/AssistantLayout/AssistantLayout.js.map +1 -0
- package/dist/components/composed/AssistantLayout/dockLayout.cjs +2 -0
- package/dist/components/composed/AssistantLayout/dockLayout.cjs.map +1 -0
- package/dist/components/composed/AssistantLayout/dockLayout.d.ts +15 -0
- package/dist/components/composed/AssistantLayout/dockLayout.js +10 -0
- package/dist/components/composed/AssistantLayout/dockLayout.js.map +1 -0
- package/dist/components/composed/AssistantLayout/index.d.ts +3 -0
- package/dist/components/composed/Chat/Chat.cjs +1 -1
- package/dist/components/composed/Chat/Chat.cjs.map +1 -1
- package/dist/components/composed/Chat/Chat.d.ts +35 -0
- package/dist/components/composed/Chat/Chat.js +28 -28
- package/dist/components/composed/Chat/Chat.js.map +1 -1
- package/dist/components/composed/Chat/index.d.ts +2 -0
- package/dist/components/composed/ConfirmDialog/ConfirmDialog.cjs +1 -1
- package/dist/components/composed/ConfirmDialog/ConfirmDialog.cjs.map +1 -1
- package/dist/components/composed/ConfirmDialog/ConfirmDialog.d.ts +23 -0
- package/dist/components/composed/ConfirmDialog/ConfirmDialog.js +33 -29
- package/dist/components/composed/ConfirmDialog/ConfirmDialog.js.map +1 -1
- package/dist/components/composed/ConfirmDialog/index.d.ts +1 -0
- package/dist/components/composed/DataAppShell/CollapseButton.cjs +2 -0
- package/dist/components/composed/DataAppShell/CollapseButton.cjs.map +1 -0
- package/dist/components/composed/DataAppShell/CollapseButton.d.ts +23 -0
- package/dist/components/composed/DataAppShell/CollapseButton.js +42 -0
- package/dist/components/composed/DataAppShell/CollapseButton.js.map +1 -0
- package/dist/components/composed/DataAppShell/DataAppShell.cjs +1 -1
- package/dist/components/composed/DataAppShell/DataAppShell.cjs.map +1 -1
- package/dist/components/composed/DataAppShell/DataAppShell.d.ts +88 -0
- package/dist/components/composed/DataAppShell/DataAppShell.js +350 -328
- package/dist/components/composed/DataAppShell/DataAppShell.js.map +1 -1
- package/dist/components/composed/DataAppShell/PrimaryNav.cjs +2 -0
- package/dist/components/composed/DataAppShell/PrimaryNav.cjs.map +1 -0
- package/dist/components/composed/DataAppShell/PrimaryNav.d.ts +64 -0
- package/dist/components/composed/DataAppShell/PrimaryNav.js +268 -0
- package/dist/components/composed/DataAppShell/PrimaryNav.js.map +1 -0
- package/dist/components/composed/DataAppShell/RightPanel.cjs +2 -0
- package/dist/components/composed/DataAppShell/RightPanel.cjs.map +1 -0
- package/dist/components/composed/DataAppShell/RightPanel.d.ts +95 -0
- package/dist/components/composed/DataAppShell/RightPanel.js +282 -0
- package/dist/components/composed/DataAppShell/RightPanel.js.map +1 -0
- package/dist/components/composed/DataAppShell/SecondaryNav.cjs +2 -0
- package/dist/components/composed/DataAppShell/SecondaryNav.cjs.map +1 -0
- package/dist/components/composed/DataAppShell/SecondaryNav.d.ts +63 -0
- package/dist/components/composed/DataAppShell/SecondaryNav.js +364 -0
- package/dist/components/composed/DataAppShell/SecondaryNav.js.map +1 -0
- package/dist/components/composed/DataAppShell/ShellContext.cjs +2 -0
- package/dist/components/composed/DataAppShell/ShellContext.cjs.map +1 -0
- package/dist/components/composed/DataAppShell/ShellContext.d.ts +20 -0
- package/dist/components/composed/DataAppShell/ShellContext.js +23 -0
- package/dist/components/composed/DataAppShell/ShellContext.js.map +1 -0
- package/dist/components/composed/DataAppShell/index.d.ts +12 -0
- package/dist/components/composed/EmptyState/EmptyState.d.ts +12 -0
- package/dist/components/composed/EmptyState/index.d.ts +2 -0
- package/dist/components/composed/FormPatterns/FormSection.cjs +1 -1
- package/dist/components/composed/FormPatterns/FormSection.cjs.map +1 -1
- package/dist/components/composed/FormPatterns/FormSection.d.ts +7 -0
- package/dist/components/composed/FormPatterns/FormSection.js +2 -2
- package/dist/components/composed/FormPatterns/index.d.ts +1 -0
- package/dist/components/composed/MoleculeStructure/MoleculeStructure.cjs +2 -0
- package/dist/components/composed/MoleculeStructure/MoleculeStructure.cjs.map +1 -0
- package/dist/components/composed/MoleculeStructure/MoleculeStructure.d.ts +43 -0
- package/dist/components/composed/MoleculeStructure/MoleculeStructure.js +87 -0
- package/dist/components/composed/MoleculeStructure/MoleculeStructure.js.map +1 -0
- package/dist/components/composed/MoleculeStructure/index.d.ts +3 -0
- package/dist/components/composed/MoleculeStructure/rdkit-loader.cjs +2 -0
- package/dist/components/composed/MoleculeStructure/rdkit-loader.cjs.map +1 -0
- package/dist/components/composed/MoleculeStructure/rdkit-loader.d.ts +104 -0
- package/dist/components/composed/MoleculeStructure/rdkit-loader.js +89 -0
- package/dist/components/composed/MoleculeStructure/rdkit-loader.js.map +1 -0
- package/dist/components/composed/MoleculeStructure/use-rdkit.cjs +2 -0
- package/dist/components/composed/MoleculeStructure/use-rdkit.cjs.map +1 -0
- package/dist/components/composed/MoleculeStructure/use-rdkit.d.ts +29 -0
- package/dist/components/composed/MoleculeStructure/use-rdkit.js +19 -0
- package/dist/components/composed/MoleculeStructure/use-rdkit.js.map +1 -0
- package/dist/components/composed/PlateMapEditor/ManifestFilterPopover.cjs +1 -1
- package/dist/components/composed/PlateMapEditor/ManifestFilterPopover.cjs.map +1 -1
- package/dist/components/composed/PlateMapEditor/ManifestFilterPopover.d.ts +12 -0
- package/dist/components/composed/PlateMapEditor/ManifestFilterPopover.js +21 -21
- package/dist/components/composed/PlateMapEditor/ManifestFilterPopover.js.map +1 -1
- package/dist/components/composed/PlateMapEditor/PlateMapActionsMenu.cjs +1 -1
- package/dist/components/composed/PlateMapEditor/PlateMapActionsMenu.cjs.map +1 -1
- package/dist/components/composed/PlateMapEditor/PlateMapActionsMenu.d.ts +22 -0
- package/dist/components/composed/PlateMapEditor/PlateMapActionsMenu.js +34 -34
- package/dist/components/composed/PlateMapEditor/PlateMapActionsMenu.js.map +1 -1
- package/dist/components/composed/PlateMapEditor/PlateMapEditor.cjs +1 -1
- package/dist/components/composed/PlateMapEditor/PlateMapEditor.cjs.map +1 -1
- package/dist/components/composed/PlateMapEditor/PlateMapEditor.d.ts +106 -0
- package/dist/components/composed/PlateMapEditor/PlateMapEditor.js +2 -2
- package/dist/components/composed/PlateMapEditor/PlateMapForm.cjs +1 -1
- package/dist/components/composed/PlateMapEditor/PlateMapForm.cjs.map +1 -1
- package/dist/components/composed/PlateMapEditor/PlateMapForm.d.ts +30 -0
- package/dist/components/composed/PlateMapEditor/PlateMapForm.js +1 -1
- package/dist/components/composed/PlateMapEditor/PlateMapGrid.cjs +1 -1
- package/dist/components/composed/PlateMapEditor/PlateMapGrid.cjs.map +1 -1
- package/dist/components/composed/PlateMapEditor/PlateMapGrid.d.ts +64 -0
- package/dist/components/composed/PlateMapEditor/PlateMapGrid.js +1 -1
- package/dist/components/composed/PlateMapEditor/PlateMapManifest.d.ts +29 -0
- package/dist/components/composed/PlateMapEditor/PlateMapPlateSelector.cjs +1 -1
- package/dist/components/composed/PlateMapEditor/PlateMapPlateSelector.cjs.map +1 -1
- package/dist/components/composed/PlateMapEditor/PlateMapPlateSelector.d.ts +19 -0
- package/dist/components/composed/PlateMapEditor/PlateMapPlateSelector.js +11 -11
- package/dist/components/composed/PlateMapEditor/PlateMapPlateSelector.js.map +1 -1
- package/dist/components/composed/PlateMapEditor/PlatePaintGrid.cjs +1 -1
- package/dist/components/composed/PlateMapEditor/PlatePaintGrid.cjs.map +1 -1
- package/dist/components/composed/PlateMapEditor/PlatePaintGrid.d.ts +73 -0
- package/dist/components/composed/PlateMapEditor/PlatePaintGrid.js +1 -1
- package/dist/components/composed/PlateMapEditor/PlatePaintGrid.js.map +1 -1
- package/dist/components/composed/PlateMapEditor/PlateZoomControl.cjs +1 -1
- package/dist/components/composed/PlateMapEditor/PlateZoomControl.cjs.map +1 -1
- package/dist/components/composed/PlateMapEditor/PlateZoomControl.d.ts +12 -0
- package/dist/components/composed/PlateMapEditor/PlateZoomControl.js +2 -2
- package/dist/components/composed/PlateMapEditor/TemplateIOPanel.cjs +1 -1
- package/dist/components/composed/PlateMapEditor/TemplateIOPanel.cjs.map +1 -1
- package/dist/components/composed/PlateMapEditor/TemplateIOPanel.d.ts +13 -0
- package/dist/components/composed/PlateMapEditor/TemplateIOPanel.js +4 -4
- package/dist/components/composed/PlateMapEditor/WellLegend.cjs +1 -1
- package/dist/components/composed/PlateMapEditor/WellLegend.cjs.map +1 -1
- package/dist/components/composed/PlateMapEditor/WellLegend.d.ts +21 -0
- package/dist/components/composed/PlateMapEditor/WellLegend.js +24 -12
- package/dist/components/composed/PlateMapEditor/WellLegend.js.map +1 -1
- package/dist/components/composed/PlateMapEditor/WellManifestTable.cjs +1 -1
- package/dist/components/composed/PlateMapEditor/WellManifestTable.cjs.map +1 -1
- package/dist/components/composed/PlateMapEditor/WellManifestTable.d.ts +46 -0
- package/dist/components/composed/PlateMapEditor/WellManifestTable.js +10 -10
- package/dist/components/composed/PlateMapEditor/WellManifestTable.js.map +1 -1
- package/dist/components/composed/PlateMapEditor/WellMetadataForm.cjs +1 -1
- package/dist/components/composed/PlateMapEditor/WellMetadataForm.cjs.map +1 -1
- package/dist/components/composed/PlateMapEditor/WellMetadataForm.d.ts +17 -0
- package/dist/components/composed/PlateMapEditor/WellMetadataForm.js +7 -7
- package/dist/components/composed/PlateMapEditor/autoFill.d.ts +26 -0
- package/dist/components/composed/PlateMapEditor/csvPlateTriage.d.ts +4 -0
- package/dist/components/composed/PlateMapEditor/helpers.d.ts +2 -0
- package/dist/components/composed/PlateMapEditor/index.d.ts +31 -0
- package/dist/components/composed/PlateMapEditor/types.d.ts +137 -0
- package/dist/components/composed/PlateMapEditor/wellGrid.d.ts +12 -0
- package/dist/components/composed/ProcessFlow/ProcessFlow.d.ts +32 -0
- package/dist/components/composed/ProcessFlow/ProcessFlow.utils.d.ts +86 -0
- package/dist/components/composed/ProcessFlow/index.d.ts +1 -0
- package/dist/components/composed/RichListItem/RichListItem.cjs +1 -1
- package/dist/components/composed/RichListItem/RichListItem.cjs.map +1 -1
- package/dist/components/composed/RichListItem/RichListItem.d.ts +22 -0
- package/dist/components/composed/RichListItem/RichListItem.js +2 -2
- package/dist/components/composed/RichListItem/index.d.ts +2 -0
- package/dist/components/composed/StatCard/StatCard.cjs +1 -1
- package/dist/components/composed/StatCard/StatCard.cjs.map +1 -1
- package/dist/components/composed/StatCard/StatCard.d.ts +11 -0
- package/dist/components/composed/StatCard/StatCard.js +1 -1
- package/dist/components/composed/StatCard/index.d.ts +1 -0
- package/dist/components/composed/TdpSearch/TdpSearch.cjs +1 -1
- package/dist/components/composed/TdpSearch/TdpSearch.cjs.map +1 -1
- package/dist/components/composed/TdpSearch/TdpSearch.d.ts +21 -0
- package/dist/components/composed/TdpSearch/TdpSearch.js +14 -13
- package/dist/components/composed/TdpSearch/TdpSearch.mocks.d.ts +5 -0
- package/dist/components/composed/TdpSearch/components/DefaultFilters.cjs +1 -1
- package/dist/components/composed/TdpSearch/components/DefaultFilters.cjs.map +1 -1
- package/dist/components/composed/TdpSearch/components/DefaultFilters.d.ts +3 -0
- package/dist/components/composed/TdpSearch/components/DefaultFilters.js +4 -4
- package/dist/components/composed/TdpSearch/components/DefaultFilters.js.map +1 -1
- package/dist/components/composed/TdpSearch/components/DefaultResults.cjs +1 -1
- package/dist/components/composed/TdpSearch/components/DefaultResults.cjs.map +1 -1
- package/dist/components/composed/TdpSearch/components/DefaultResults.d.ts +3 -0
- package/dist/components/composed/TdpSearch/components/DefaultResults.js +2 -2
- package/dist/components/composed/TdpSearch/components/DefaultSearchBar.cjs +1 -1
- package/dist/components/composed/TdpSearch/components/DefaultSearchBar.cjs.map +1 -1
- package/dist/components/composed/TdpSearch/components/DefaultSearchBar.d.ts +3 -0
- package/dist/components/composed/TdpSearch/components/DefaultSearchBar.js +2 -2
- package/dist/components/composed/TdpSearch/constants.d.ts +3 -0
- package/dist/components/composed/TdpSearch/hooks/useSearch.d.ts +2 -0
- package/dist/components/composed/TdpSearch/hooks/useTdpCredentials.d.ts +14 -0
- package/dist/components/composed/TdpSearch/index.d.ts +3 -0
- package/dist/components/composed/TdpSearch/types.d.ts +128 -0
- package/dist/components/composed/TdpSearch/utils.d.ts +3 -0
- package/dist/components/composed/TopBar/TopBar.cjs +2 -0
- package/dist/components/composed/TopBar/TopBar.cjs.map +1 -0
- package/dist/components/composed/TopBar/TopBar.d.ts +25 -0
- package/dist/components/composed/TopBar/TopBar.js +56 -0
- package/dist/components/composed/TopBar/TopBar.js.map +1 -0
- package/dist/components/composed/TopBar/index.d.ts +2 -0
- package/dist/components/composed/UserMenu/UserMenu.cjs +2 -0
- package/dist/components/composed/UserMenu/UserMenu.cjs.map +1 -0
- package/dist/components/composed/UserMenu/UserMenu.d.ts +53 -0
- package/dist/components/composed/UserMenu/UserMenu.js +99 -0
- package/dist/components/composed/UserMenu/UserMenu.js.map +1 -0
- package/dist/components/composed/UserMenu/index.d.ts +2 -0
- package/dist/components/composed/tdp-link.d.ts +110 -0
- package/dist/components/composed/tdp-url.d.ts +68 -0
- package/dist/components/ui/accordion.d.ts +7 -0
- package/dist/components/ui/alert-dialog.d.ts +18 -0
- package/dist/components/ui/alert.d.ts +10 -0
- package/dist/components/ui/aspect-ratio.d.ts +3 -0
- package/dist/components/ui/avatar.d.ts +11 -0
- package/dist/components/ui/badge.d.ts +9 -0
- package/dist/components/ui/banner.d.ts +19 -0
- package/dist/components/ui/breadcrumb.d.ts +11 -0
- package/dist/components/ui/button-group.d.ts +11 -0
- package/dist/components/ui/button.d.ts +10 -0
- package/dist/components/ui/calendar.d.ts +10 -0
- package/dist/components/ui/card.d.ts +11 -0
- package/dist/components/ui/carousel.d.ts +28 -0
- package/dist/components/ui/checkbox.d.ts +4 -0
- package/dist/components/ui/code-block.d.ts +45 -0
- package/dist/components/ui/code-editor.d.ts +18 -0
- package/dist/components/ui/collapsible.d.ts +5 -0
- package/dist/components/ui/combobox.d.ts +24 -0
- package/dist/components/ui/command.d.ts +18 -0
- package/dist/components/ui/context-menu.d.ts +31 -0
- package/dist/components/ui/data-table/data-table-column-toggle.cjs +1 -1
- package/dist/components/ui/data-table/data-table-column-toggle.cjs.map +1 -1
- package/dist/components/ui/data-table/data-table-column-toggle.d.ts +6 -0
- package/dist/components/ui/data-table/data-table-column-toggle.js +71 -63
- package/dist/components/ui/data-table/data-table-column-toggle.js.map +1 -1
- package/dist/components/ui/data-table/data-table-filter.cjs +1 -1
- package/dist/components/ui/data-table/data-table-filter.cjs.map +1 -1
- package/dist/components/ui/data-table/data-table-filter.d.ts +9 -0
- package/dist/components/ui/data-table/data-table-filter.js +26 -25
- package/dist/components/ui/data-table/data-table-filter.js.map +1 -1
- package/dist/components/ui/data-table/data-table-group.cjs +1 -1
- package/dist/components/ui/data-table/data-table-group.cjs.map +1 -1
- package/dist/components/ui/data-table/data-table-group.d.ts +9 -0
- package/dist/components/ui/data-table/data-table-group.js +18 -17
- package/dist/components/ui/data-table/data-table-group.js.map +1 -1
- package/dist/components/ui/data-table/data-table-pagination.cjs +1 -1
- package/dist/components/ui/data-table/data-table-pagination.cjs.map +1 -1
- package/dist/components/ui/data-table/data-table-pagination.d.ts +7 -0
- package/dist/components/ui/data-table/data-table-pagination.js +16 -16
- package/dist/components/ui/data-table/data-table-pagination.js.map +1 -1
- package/dist/components/ui/data-table/data-table.cjs +1 -1
- package/dist/components/ui/data-table/data-table.cjs.map +1 -1
- package/dist/components/ui/data-table/data-table.d.ts +82 -0
- package/dist/components/ui/data-table/data-table.js +191 -190
- package/dist/components/ui/data-table/data-table.js.map +1 -1
- package/dist/components/ui/data-table/index.d.ts +5 -0
- package/dist/components/ui/dialog.d.ts +18 -0
- package/dist/components/ui/dropdown-menu.d.ts +29 -0
- package/dist/components/ui/field.d.ts +24 -0
- package/dist/components/ui/hover-card.d.ts +6 -0
- package/dist/components/ui/input-group.d.ts +16 -0
- package/dist/components/ui/input.d.ts +3 -0
- package/dist/components/ui/item.d.ts +23 -0
- package/dist/components/ui/kbd.d.ts +3 -0
- package/dist/components/ui/label.d.ts +4 -0
- package/dist/components/ui/menubar.d.ts +30 -0
- package/dist/components/ui/navigation-menu.d.ts +14 -0
- package/dist/components/ui/popover.d.ts +7 -0
- package/dist/components/ui/progress.d.ts +4 -0
- package/dist/components/ui/radio-group.d.ts +5 -0
- package/dist/components/ui/resizable.d.ts +25 -0
- package/dist/components/ui/scroll-area.d.ts +5 -0
- package/dist/components/ui/select.d.ts +15 -0
- package/dist/components/ui/separator.d.ts +4 -0
- package/dist/components/ui/sheet.d.ts +14 -0
- package/dist/components/ui/sidebar.d.ts +69 -0
- package/dist/components/ui/skeleton.d.ts +2 -0
- package/dist/components/ui/slider.d.ts +4 -0
- package/dist/components/ui/snippet.d.ts +18 -0
- package/dist/components/ui/sonner.d.ts +3 -0
- package/dist/components/ui/spinner.d.ts +6 -0
- package/dist/components/ui/switch.d.ts +6 -0
- package/dist/components/ui/table.d.ts +22 -0
- package/dist/components/ui/tabs.d.ts +11 -0
- package/dist/components/ui/tetra-molecule-icon.d.ts +11 -0
- package/dist/components/ui/tetrascience-icon.d.ts +7 -0
- package/dist/components/ui/textarea.d.ts +3 -0
- package/dist/components/ui/toggle-group.d.ts +10 -0
- package/dist/components/ui/toggle.d.ts +9 -0
- package/dist/components/ui/tooltip.d.ts +7 -0
- package/dist/composed/AssistantLayout.cjs +2 -0
- package/dist/composed/AssistantLayout.cjs.map +1 -0
- package/dist/composed/AssistantLayout.js +10 -0
- package/dist/composed/AssistantLayout.js.map +1 -0
- package/dist/composed/Chat.cjs +2 -0
- package/dist/composed/Chat.cjs.map +1 -0
- package/dist/composed/Chat.js +5 -0
- package/dist/composed/Chat.js.map +1 -0
- package/dist/composed/ConfirmDialog.cjs +2 -0
- package/dist/composed/ConfirmDialog.cjs.map +1 -0
- package/dist/composed/ConfirmDialog.js +5 -0
- package/dist/composed/ConfirmDialog.js.map +1 -0
- package/dist/composed/DataAppShell.cjs +2 -0
- package/dist/composed/DataAppShell.cjs.map +1 -0
- package/dist/composed/DataAppShell.js +22 -0
- package/dist/composed/DataAppShell.js.map +1 -0
- package/dist/composed/EmptyState.cjs +2 -0
- package/dist/composed/EmptyState.cjs.map +1 -0
- package/dist/composed/EmptyState.js +5 -0
- package/dist/composed/EmptyState.js.map +1 -0
- package/dist/composed/FormPatterns.cjs +2 -0
- package/dist/composed/FormPatterns.cjs.map +1 -0
- package/dist/composed/FormPatterns.js +5 -0
- package/dist/composed/FormPatterns.js.map +1 -0
- package/dist/composed/MoleculeStructure.cjs +2 -0
- package/dist/composed/MoleculeStructure.cjs.map +1 -0
- package/dist/composed/MoleculeStructure.js +11 -0
- package/dist/composed/MoleculeStructure.js.map +1 -0
- package/dist/composed/PlateMapEditor.cjs +2 -0
- package/dist/composed/PlateMapEditor.cjs.map +1 -0
- package/dist/composed/PlateMapEditor.js +45 -0
- package/dist/composed/PlateMapEditor.js.map +1 -0
- package/dist/composed/ProcessFlow.cjs +2 -0
- package/dist/composed/ProcessFlow.cjs.map +1 -0
- package/dist/composed/ProcessFlow.js +7 -0
- package/dist/composed/ProcessFlow.js.map +1 -0
- package/dist/composed/RichListItem.cjs +2 -0
- package/dist/composed/RichListItem.cjs.map +1 -0
- package/dist/composed/RichListItem.js +6 -0
- package/dist/composed/RichListItem.js.map +1 -0
- package/dist/composed/StatCard.cjs +2 -0
- package/dist/composed/StatCard.cjs.map +1 -0
- package/dist/composed/StatCard.js +5 -0
- package/dist/composed/StatCard.js.map +1 -0
- package/dist/composed/TdpSearch.cjs +2 -0
- package/dist/composed/TdpSearch.cjs.map +1 -0
- package/dist/composed/TdpSearch.js +8 -0
- package/dist/composed/TdpSearch.js.map +1 -0
- package/dist/composed/TopBar.cjs +2 -0
- package/dist/composed/TopBar.cjs.map +1 -0
- package/dist/composed/TopBar.js +6 -0
- package/dist/composed/TopBar.js.map +1 -0
- package/dist/composed/UserMenu.cjs +2 -0
- package/dist/composed/UserMenu.cjs.map +1 -0
- package/dist/composed/UserMenu.js +7 -0
- package/dist/composed/UserMenu.js.map +1 -0
- package/dist/composed/tdp-link.cjs +2 -0
- package/dist/composed/tdp-link.cjs.map +1 -0
- package/dist/composed/tdp-link.js +84 -0
- package/dist/composed/tdp-link.js.map +1 -0
- package/dist/composed/tdp-url.cjs.map +1 -0
- package/dist/composed/tdp-url.js.map +1 -0
- package/dist/hooks/use-code-editor-theme.d.ts +34 -0
- package/dist/hooks/use-element-size.d.ts +25 -0
- package/dist/hooks/use-is-dark.d.ts +12 -0
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/hooks/use-plotly-theme.cjs +1 -1
- package/dist/hooks/use-plotly-theme.cjs.map +1 -1
- package/dist/hooks/use-plotly-theme.d.ts +49 -0
- package/dist/hooks/use-plotly-theme.js +4 -3
- package/dist/hooks/use-plotly-theme.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +102 -4404
- package/dist/index.js +698 -659
- package/dist/index.js.map +1 -1
- package/dist/index.tailwind.css +1 -1
- package/dist/jest-setup.cjs +4 -0
- package/dist/jest-setup.cjs.map +1 -0
- package/dist/jest-setup.d.ts +106 -0
- package/dist/jest-setup.js +218 -0
- package/dist/jest-setup.js.map +1 -0
- package/dist/lib/shiki.cjs +2 -0
- package/dist/lib/shiki.cjs.map +1 -0
- package/dist/lib/shiki.d.ts +32 -0
- package/dist/lib/shiki.js +72 -0
- package/dist/lib/shiki.js.map +1 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/server/auth/JwtTokenManager.cjs +1 -1
- package/dist/server/auth/JwtTokenManager.cjs.map +1 -1
- package/dist/server/auth/JwtTokenManager.d.ts +113 -0
- package/dist/server/auth/JwtTokenManager.js +44 -21
- package/dist/server/auth/JwtTokenManager.js.map +1 -1
- package/dist/server/auth/index.d.ts +5 -0
- package/dist/server/index.d.ts +8 -0
- package/dist/server/providers/AthenaProvider.cjs +1 -1
- package/dist/server/providers/AthenaProvider.cjs.map +1 -1
- package/dist/server/providers/AthenaProvider.d.ts +75 -0
- package/dist/server/providers/DatabricksProvider.cjs +1 -1
- package/dist/server/providers/DatabricksProvider.cjs.map +1 -1
- package/dist/server/providers/DatabricksProvider.d.ts +38 -0
- package/dist/server/providers/SnowflakeProvider.cjs +1 -1
- package/dist/server/providers/SnowflakeProvider.cjs.map +1 -1
- package/dist/server/providers/SnowflakeProvider.d.ts +36 -0
- package/dist/server/providers/buildProvider.d.ts +39 -0
- package/dist/server/providers/entries/athena.d.ts +24 -0
- package/dist/server/providers/entries/databricks.d.ts +25 -0
- package/dist/server/providers/entries/snowflake.d.ts +25 -0
- package/dist/server/providers/exceptions.d.ts +36 -0
- package/dist/server/providers/getProviderConfigurations.d.ts +45 -0
- package/dist/server/providers/index.d.ts +31 -0
- package/dist/server/providers/providerDiscovery.d.ts +81 -0
- package/dist/server/providers/types.d.ts +145 -0
- package/dist/server/search/TdpSearchManager.d.ts +40 -0
- package/dist/server/search/index.d.ts +5 -0
- package/dist/server.d.ts +17 -540
- package/dist/ui/accordion.cjs +2 -0
- package/dist/ui/accordion.cjs.map +1 -0
- package/dist/ui/accordion.js +83 -0
- package/dist/ui/accordion.js.map +1 -0
- package/dist/ui/alert-dialog.cjs +2 -0
- package/dist/ui/alert-dialog.cjs.map +1 -0
- package/dist/ui/alert-dialog.js +181 -0
- package/dist/ui/alert-dialog.js.map +1 -0
- package/dist/ui/alert.cjs +2 -0
- package/dist/ui/alert.cjs.map +1 -0
- package/dist/ui/alert.js +81 -0
- package/dist/ui/alert.js.map +1 -0
- package/dist/ui/aspect-ratio.cjs.map +1 -0
- package/dist/ui/aspect-ratio.js.map +1 -0
- package/dist/ui/avatar.cjs +2 -0
- package/dist/ui/avatar.cjs.map +1 -0
- package/dist/ui/avatar.js +107 -0
- package/dist/ui/avatar.js.map +1 -0
- package/dist/ui/badge.cjs +2 -0
- package/dist/ui/badge.cjs.map +1 -0
- package/dist/ui/badge.js +47 -0
- package/dist/ui/badge.js.map +1 -0
- package/dist/ui/banner.cjs +2 -0
- package/dist/ui/banner.cjs.map +1 -0
- package/dist/ui/banner.js +80 -0
- package/dist/ui/banner.js.map +1 -0
- package/dist/ui/breadcrumb.cjs +2 -0
- package/dist/ui/breadcrumb.cjs.map +1 -0
- package/dist/ui/breadcrumb.js +118 -0
- package/dist/ui/breadcrumb.js.map +1 -0
- package/dist/ui/button-group.cjs +2 -0
- package/dist/ui/button-group.cjs.map +1 -0
- package/dist/ui/button-group.js +77 -0
- package/dist/ui/button-group.js.map +1 -0
- package/dist/ui/button.cjs +2 -0
- package/dist/ui/button.cjs.map +1 -0
- package/dist/ui/button.js +57 -0
- package/dist/ui/button.js.map +1 -0
- package/dist/ui/calendar.cjs +2 -0
- package/dist/ui/calendar.cjs.map +1 -0
- package/dist/ui/calendar.js +174 -0
- package/dist/ui/calendar.js.map +1 -0
- package/dist/ui/card.cjs +2 -0
- package/dist/ui/card.cjs.map +1 -0
- package/dist/ui/card.js +102 -0
- package/dist/ui/card.js.map +1 -0
- package/dist/ui/carousel.cjs +2 -0
- package/dist/ui/carousel.cjs.map +1 -0
- package/dist/ui/carousel.js +179 -0
- package/dist/ui/carousel.js.map +1 -0
- package/dist/ui/checkbox.cjs +2 -0
- package/dist/ui/checkbox.cjs.map +1 -0
- package/dist/ui/checkbox.js +35 -0
- package/dist/ui/checkbox.js.map +1 -0
- package/dist/ui/code-block.cjs +4 -0
- package/dist/ui/code-block.cjs.map +1 -0
- package/dist/ui/code-block.js +324 -0
- package/dist/ui/code-block.js.map +1 -0
- package/dist/ui/code-editor.cjs +2 -0
- package/dist/ui/code-editor.cjs.map +1 -0
- package/dist/ui/code-editor.js +106 -0
- package/dist/ui/code-editor.js.map +1 -0
- package/dist/ui/collapsible.cjs.map +1 -0
- package/dist/ui/collapsible.js.map +1 -0
- package/dist/ui/combobox.cjs +2 -0
- package/dist/ui/combobox.cjs.map +1 -0
- package/dist/ui/combobox.js +285 -0
- package/dist/ui/combobox.js.map +1 -0
- package/dist/ui/command.cjs +2 -0
- package/dist/ui/command.cjs.map +1 -0
- package/dist/ui/command.js +178 -0
- package/dist/ui/command.js.map +1 -0
- package/dist/ui/context-menu.cjs +2 -0
- package/dist/ui/context-menu.cjs.map +1 -0
- package/dist/ui/context-menu.js +236 -0
- package/dist/ui/context-menu.js.map +1 -0
- package/dist/ui/data-table.cjs +2 -0
- package/dist/ui/data-table.cjs.map +1 -0
- package/dist/ui/data-table.js +16 -0
- package/dist/ui/data-table.js.map +1 -0
- package/dist/ui/dialog.cjs +2 -0
- package/dist/ui/dialog.cjs.map +1 -0
- package/dist/ui/dialog.js +165 -0
- package/dist/ui/dialog.js.map +1 -0
- package/dist/ui/dropdown-menu.cjs +2 -0
- package/dist/ui/dropdown-menu.cjs.map +1 -0
- package/dist/ui/dropdown-menu.js +260 -0
- package/dist/ui/dropdown-menu.js.map +1 -0
- package/dist/ui/field.cjs +2 -0
- package/dist/ui/field.cjs.map +1 -0
- package/dist/ui/field.js +210 -0
- package/dist/ui/field.js.map +1 -0
- package/dist/ui/hover-card.cjs +2 -0
- package/dist/ui/hover-card.cjs.map +1 -0
- package/dist/ui/hover-card.js +39 -0
- package/dist/ui/hover-card.js.map +1 -0
- package/dist/ui/input-group.cjs +2 -0
- package/dist/ui/input-group.cjs.map +1 -0
- package/dist/ui/input-group.js +145 -0
- package/dist/ui/input-group.js.map +1 -0
- package/dist/ui/input.cjs +2 -0
- package/dist/ui/input.cjs.map +1 -0
- package/dist/ui/input.js +20 -0
- package/dist/ui/input.js.map +1 -0
- package/dist/ui/item.cjs +2 -0
- package/dist/ui/item.cjs.map +1 -0
- package/dist/ui/item.js +199 -0
- package/dist/ui/item.js.map +1 -0
- package/dist/ui/kbd.cjs +2 -0
- package/dist/ui/kbd.cjs.map +1 -0
- package/dist/ui/kbd.js +30 -0
- package/dist/ui/kbd.js.map +1 -0
- package/dist/ui/label.cjs +2 -0
- package/dist/ui/label.cjs.map +1 -0
- package/dist/ui/label.js +23 -0
- package/dist/ui/label.js.map +1 -0
- package/dist/ui/menubar.cjs +2 -0
- package/dist/ui/menubar.cjs.map +1 -0
- package/dist/ui/menubar.js +256 -0
- package/dist/ui/menubar.js.map +1 -0
- package/dist/ui/navigation-menu.cjs +2 -0
- package/dist/ui/navigation-menu.cjs.map +1 -0
- package/dist/ui/navigation-menu.js +164 -0
- package/dist/ui/navigation-menu.js.map +1 -0
- package/dist/ui/popover.cjs +2 -0
- package/dist/ui/popover.cjs.map +1 -0
- package/dist/ui/popover.js +45 -0
- package/dist/ui/popover.js.map +1 -0
- package/dist/ui/radio-group.cjs +2 -0
- package/dist/ui/radio-group.cjs.map +1 -0
- package/dist/ui/radio-group.js +45 -0
- package/dist/ui/radio-group.js.map +1 -0
- package/dist/ui/resizable.cjs +2 -0
- package/dist/ui/resizable.cjs.map +1 -0
- package/dist/ui/resizable.js +58 -0
- package/dist/ui/resizable.js.map +1 -0
- package/dist/ui/scroll-area.cjs +2 -0
- package/dist/ui/scroll-area.cjs.map +1 -0
- package/dist/ui/scroll-area.js +61 -0
- package/dist/ui/scroll-area.js.map +1 -0
- package/dist/ui/select.cjs +2 -0
- package/dist/ui/select.cjs.map +1 -0
- package/dist/ui/select.js +184 -0
- package/dist/ui/select.js.map +1 -0
- package/dist/ui/separator.cjs +2 -0
- package/dist/ui/separator.cjs.map +1 -0
- package/dist/ui/separator.js +27 -0
- package/dist/ui/separator.js.map +1 -0
- package/dist/ui/sheet.cjs +2 -0
- package/dist/ui/sheet.cjs.map +1 -0
- package/dist/ui/sheet.js +137 -0
- package/dist/ui/sheet.js.map +1 -0
- package/dist/ui/sidebar.cjs +2 -0
- package/dist/ui/sidebar.cjs.map +1 -0
- package/dist/ui/sidebar.js +579 -0
- package/dist/ui/sidebar.js.map +1 -0
- package/dist/ui/skeleton.cjs +2 -0
- package/dist/ui/skeleton.cjs.map +1 -0
- package/dist/ui/skeleton.js +24 -0
- package/dist/ui/skeleton.js.map +1 -0
- package/dist/ui/slider.cjs +2 -0
- package/dist/ui/slider.cjs.map +1 -0
- package/dist/ui/slider.js +61 -0
- package/dist/ui/slider.js.map +1 -0
- package/dist/ui/sonner.cjs +2 -0
- package/dist/ui/sonner.cjs.map +1 -0
- package/dist/ui/sonner.js +52 -0
- package/dist/ui/sonner.js.map +1 -0
- package/dist/ui/spinner.cjs +2 -0
- package/dist/ui/spinner.cjs.map +1 -0
- package/dist/ui/spinner.js +39 -0
- package/dist/ui/spinner.js.map +1 -0
- package/dist/ui/switch.cjs +2 -0
- package/dist/ui/switch.cjs.map +1 -0
- package/dist/ui/switch.js +32 -0
- package/dist/ui/switch.js.map +1 -0
- package/dist/ui/table.cjs +2 -0
- package/dist/ui/table.cjs.map +1 -0
- package/dist/ui/table.js +153 -0
- package/dist/ui/table.js.map +1 -0
- package/dist/ui/tabs.cjs +2 -0
- package/dist/ui/tabs.cjs.map +1 -0
- package/dist/ui/tabs.js +92 -0
- package/dist/ui/tabs.js.map +1 -0
- package/dist/ui/tetra-molecule-icon.cjs +2 -0
- package/dist/ui/tetra-molecule-icon.cjs.map +1 -0
- package/dist/ui/tetra-molecule-icon.js +50 -0
- package/dist/ui/tetra-molecule-icon.js.map +1 -0
- package/dist/ui/tetrascience-icon.cjs +2 -0
- package/dist/ui/tetrascience-icon.cjs.map +1 -0
- package/dist/ui/tetrascience-icon.js +47 -0
- package/dist/ui/tetrascience-icon.js.map +1 -0
- package/dist/ui/textarea.cjs +2 -0
- package/dist/ui/textarea.cjs.map +1 -0
- package/dist/ui/textarea.js +19 -0
- package/dist/ui/textarea.js.map +1 -0
- package/dist/ui/toggle-group.cjs +2 -0
- package/dist/ui/toggle-group.cjs.map +1 -0
- package/dist/ui/toggle-group.js +81 -0
- package/dist/ui/toggle-group.js.map +1 -0
- package/dist/ui/toggle.cjs +2 -0
- package/dist/ui/toggle.cjs.map +1 -0
- package/dist/ui/toggle.js +44 -0
- package/dist/ui/toggle.js.map +1 -0
- package/dist/ui/tooltip.cjs +2 -0
- package/dist/ui/tooltip.cjs.map +1 -0
- package/dist/ui/tooltip.js +56 -0
- package/dist/ui/tooltip.js.map +1 -0
- package/dist/utils/colors.d.ts +50 -0
- package/package.json +137 -24
- package/dist/athena.d.ts +0 -167
- package/dist/components/ai/attachments.cjs +0 -2
- package/dist/components/ai/attachments.cjs.map +0 -1
- package/dist/components/ai/attachments.js +0 -224
- package/dist/components/ai/attachments.js.map +0 -1
- package/dist/components/ai/chain-of-thought.cjs +0 -2
- package/dist/components/ai/chain-of-thought.cjs.map +0 -1
- package/dist/components/ai/chain-of-thought.js +0 -145
- package/dist/components/ai/chain-of-thought.js.map +0 -1
- package/dist/components/ai/confirmation.cjs +0 -2
- package/dist/components/ai/confirmation.cjs.map +0 -1
- package/dist/components/ai/confirmation.js +0 -109
- package/dist/components/ai/confirmation.js.map +0 -1
- package/dist/components/ai/context.cjs +0 -2
- package/dist/components/ai/context.cjs.map +0 -1
- package/dist/components/ai/context.js +0 -266
- package/dist/components/ai/context.js.map +0 -1
- package/dist/components/ai/conversation.cjs +0 -4
- package/dist/components/ai/conversation.cjs.map +0 -1
- package/dist/components/ai/conversation.js +0 -108
- package/dist/components/ai/conversation.js.map +0 -1
- package/dist/components/ai/inline-citation.cjs +0 -2
- package/dist/components/ai/inline-citation.cjs.map +0 -1
- package/dist/components/ai/inline-citation.js +0 -182
- package/dist/components/ai/inline-citation.js.map +0 -1
- package/dist/components/ai/message.cjs +0 -2
- package/dist/components/ai/message.cjs.map +0 -1
- package/dist/components/ai/message.js +0 -237
- package/dist/components/ai/message.js.map +0 -1
- package/dist/components/ai/model-selector.cjs +0 -2
- package/dist/components/ai/model-selector.cjs.map +0 -1
- package/dist/components/ai/model-selector.js +0 -77
- package/dist/components/ai/model-selector.js.map +0 -1
- package/dist/components/ai/prompt-input.cjs +0 -2
- package/dist/components/ai/prompt-input.cjs.map +0 -1
- package/dist/components/ai/prompt-input.js +0 -774
- package/dist/components/ai/prompt-input.js.map +0 -1
- package/dist/components/ai/queue.cjs +0 -2
- package/dist/components/ai/queue.cjs.map +0 -1
- package/dist/components/ai/queue.js +0 -209
- package/dist/components/ai/queue.js.map +0 -1
- package/dist/components/ai/reasoning.cjs +0 -2
- package/dist/components/ai/reasoning.cjs.map +0 -1
- package/dist/components/ai/reasoning.js +0 -129
- package/dist/components/ai/reasoning.js.map +0 -1
- package/dist/components/ai/shimmer.cjs +0 -2
- package/dist/components/ai/shimmer.cjs.map +0 -1
- package/dist/components/ai/shimmer.js +0 -49
- package/dist/components/ai/shimmer.js.map +0 -1
- package/dist/components/ai/sources.cjs +0 -2
- package/dist/components/ai/sources.cjs.map +0 -1
- package/dist/components/ai/sources.js +0 -54
- package/dist/components/ai/sources.js.map +0 -1
- package/dist/components/ai/speech-input.cjs +0 -2
- package/dist/components/ai/speech-input.cjs.map +0 -1
- package/dist/components/ai/speech-input.js +0 -123
- package/dist/components/ai/speech-input.js.map +0 -1
- package/dist/components/ai/stream-status.cjs +0 -2
- package/dist/components/ai/stream-status.cjs.map +0 -1
- package/dist/components/ai/stream-status.js +0 -106
- package/dist/components/ai/stream-status.js.map +0 -1
- package/dist/components/ai/suggestion.cjs +0 -2
- package/dist/components/ai/suggestion.cjs.map +0 -1
- package/dist/components/ai/suggestion.js +0 -38
- package/dist/components/ai/suggestion.js.map +0 -1
- package/dist/components/ai/task.cjs +0 -2
- package/dist/components/ai/task.cjs.map +0 -1
- package/dist/components/ai/task.js +0 -94
- package/dist/components/ai/task.js.map +0 -1
- package/dist/components/ai/tool.cjs +0 -2
- package/dist/components/ai/tool.cjs.map +0 -1
- package/dist/components/ai/tool.js +0 -143
- package/dist/components/ai/tool.js.map +0 -1
- package/dist/components/charts/AreaGraph/AreaGraph.cjs +0 -2
- package/dist/components/charts/AreaGraph/AreaGraph.cjs.map +0 -1
- package/dist/components/charts/AreaGraph/AreaGraph.js +0 -271
- package/dist/components/charts/AreaGraph/AreaGraph.js.map +0 -1
- package/dist/components/charts/BarGraph/BarGraph.cjs +0 -2
- package/dist/components/charts/BarGraph/BarGraph.cjs.map +0 -1
- package/dist/components/charts/BarGraph/BarGraph.js +0 -220
- package/dist/components/charts/BarGraph/BarGraph.js.map +0 -1
- package/dist/components/charts/Boxplot/Boxplot.cjs +0 -2
- package/dist/components/charts/Boxplot/Boxplot.cjs.map +0 -1
- package/dist/components/charts/Boxplot/Boxplot.js +0 -209
- package/dist/components/charts/Boxplot/Boxplot.js.map +0 -1
- package/dist/components/charts/ChromatogramChart/ChromatogramChart.cjs +0 -2
- package/dist/components/charts/ChromatogramChart/ChromatogramChart.cjs.map +0 -1
- package/dist/components/charts/ChromatogramChart/ChromatogramChart.js +0 -227
- package/dist/components/charts/ChromatogramChart/ChromatogramChart.js.map +0 -1
- package/dist/components/charts/ChromatogramChart/annotations.cjs +0 -2
- package/dist/components/charts/ChromatogramChart/annotations.cjs.map +0 -1
- package/dist/components/charts/ChromatogramChart/annotations.js +0 -73
- package/dist/components/charts/ChromatogramChart/annotations.js.map +0 -1
- package/dist/components/charts/ChromatogramChart/boundaryMarkers.cjs +0 -2
- package/dist/components/charts/ChromatogramChart/boundaryMarkers.cjs.map +0 -1
- package/dist/components/charts/ChromatogramChart/boundaryMarkers.js +0 -34
- package/dist/components/charts/ChromatogramChart/boundaryMarkers.js.map +0 -1
- package/dist/components/charts/ChromatogramChart/constants.cjs +0 -2
- package/dist/components/charts/ChromatogramChart/constants.cjs.map +0 -1
- package/dist/components/charts/ChromatogramChart/constants.js +0 -30
- package/dist/components/charts/ChromatogramChart/constants.js.map +0 -1
- package/dist/components/charts/ChromatogramChart/dataProcessing.cjs +0 -2
- package/dist/components/charts/ChromatogramChart/dataProcessing.cjs.map +0 -1
- package/dist/components/charts/ChromatogramChart/dataProcessing.js +0 -79
- package/dist/components/charts/ChromatogramChart/dataProcessing.js.map +0 -1
- package/dist/components/charts/ChromatogramChart/peakDetection.cjs.map +0 -1
- package/dist/components/charts/ChromatogramChart/peakDetection.js.map +0 -1
- package/dist/components/charts/DotPlot/DotPlot.cjs +0 -2
- package/dist/components/charts/DotPlot/DotPlot.cjs.map +0 -1
- package/dist/components/charts/DotPlot/DotPlot.js +0 -208
- package/dist/components/charts/DotPlot/DotPlot.js.map +0 -1
- package/dist/components/charts/Heatmap/Heatmap.cjs +0 -2
- package/dist/components/charts/Heatmap/Heatmap.cjs.map +0 -1
- package/dist/components/charts/Heatmap/Heatmap.js +0 -67
- package/dist/components/charts/Heatmap/Heatmap.js.map +0 -1
- package/dist/components/charts/LineGraph/LineGraph.cjs +0 -2
- package/dist/components/charts/LineGraph/LineGraph.cjs.map +0 -1
- package/dist/components/charts/LineGraph/LineGraph.js +0 -225
- package/dist/components/charts/LineGraph/LineGraph.js.map +0 -1
- package/dist/components/charts/ScatterGraph/ScatterGraph.cjs +0 -2
- package/dist/components/charts/ScatterGraph/ScatterGraph.cjs.map +0 -1
- package/dist/components/charts/ScatterGraph/ScatterGraph.js +0 -234
- package/dist/components/charts/ScatterGraph/ScatterGraph.js.map +0 -1
- package/dist/components/composed/tdp-link.cjs +0 -2
- package/dist/components/composed/tdp-link.cjs.map +0 -1
- package/dist/components/composed/tdp-link.js +0 -84
- package/dist/components/composed/tdp-link.js.map +0 -1
- package/dist/components/composed/tdp-url.cjs.map +0 -1
- package/dist/components/composed/tdp-url.js.map +0 -1
- package/dist/components/ui/accordion.cjs +0 -2
- package/dist/components/ui/accordion.cjs.map +0 -1
- package/dist/components/ui/accordion.js +0 -83
- package/dist/components/ui/accordion.js.map +0 -1
- package/dist/components/ui/alert-dialog.cjs +0 -2
- package/dist/components/ui/alert-dialog.cjs.map +0 -1
- package/dist/components/ui/alert-dialog.js +0 -181
- package/dist/components/ui/alert-dialog.js.map +0 -1
- package/dist/components/ui/alert.cjs +0 -2
- package/dist/components/ui/alert.cjs.map +0 -1
- package/dist/components/ui/alert.js +0 -81
- package/dist/components/ui/alert.js.map +0 -1
- package/dist/components/ui/aspect-ratio.cjs.map +0 -1
- package/dist/components/ui/aspect-ratio.js.map +0 -1
- package/dist/components/ui/avatar.cjs +0 -2
- package/dist/components/ui/avatar.cjs.map +0 -1
- package/dist/components/ui/avatar.js +0 -107
- package/dist/components/ui/avatar.js.map +0 -1
- package/dist/components/ui/badge.cjs +0 -2
- package/dist/components/ui/badge.cjs.map +0 -1
- package/dist/components/ui/badge.js +0 -47
- package/dist/components/ui/badge.js.map +0 -1
- package/dist/components/ui/banner.cjs +0 -2
- package/dist/components/ui/banner.cjs.map +0 -1
- package/dist/components/ui/banner.js +0 -80
- package/dist/components/ui/banner.js.map +0 -1
- package/dist/components/ui/breadcrumb.cjs +0 -2
- package/dist/components/ui/breadcrumb.cjs.map +0 -1
- package/dist/components/ui/breadcrumb.js +0 -118
- package/dist/components/ui/breadcrumb.js.map +0 -1
- package/dist/components/ui/button-group.cjs +0 -2
- package/dist/components/ui/button-group.cjs.map +0 -1
- package/dist/components/ui/button-group.js +0 -77
- package/dist/components/ui/button-group.js.map +0 -1
- package/dist/components/ui/button.cjs +0 -2
- package/dist/components/ui/button.cjs.map +0 -1
- package/dist/components/ui/button.js +0 -57
- package/dist/components/ui/button.js.map +0 -1
- package/dist/components/ui/calendar.cjs +0 -2
- package/dist/components/ui/calendar.cjs.map +0 -1
- package/dist/components/ui/calendar.js +0 -174
- package/dist/components/ui/calendar.js.map +0 -1
- package/dist/components/ui/card.cjs +0 -2
- package/dist/components/ui/card.cjs.map +0 -1
- package/dist/components/ui/card.js +0 -102
- package/dist/components/ui/card.js.map +0 -1
- package/dist/components/ui/carousel.cjs +0 -2
- package/dist/components/ui/carousel.cjs.map +0 -1
- package/dist/components/ui/carousel.js +0 -179
- package/dist/components/ui/carousel.js.map +0 -1
- package/dist/components/ui/checkbox.cjs +0 -2
- package/dist/components/ui/checkbox.cjs.map +0 -1
- package/dist/components/ui/checkbox.js +0 -35
- package/dist/components/ui/checkbox.js.map +0 -1
- package/dist/components/ui/code-block.cjs +0 -4
- package/dist/components/ui/code-block.cjs.map +0 -1
- package/dist/components/ui/code-block.js +0 -306
- package/dist/components/ui/code-block.js.map +0 -1
- package/dist/components/ui/code-editor.cjs +0 -2
- package/dist/components/ui/code-editor.cjs.map +0 -1
- package/dist/components/ui/code-editor.js +0 -103
- package/dist/components/ui/code-editor.js.map +0 -1
- package/dist/components/ui/collapsible.cjs.map +0 -1
- package/dist/components/ui/collapsible.js.map +0 -1
- package/dist/components/ui/combobox.cjs +0 -2
- package/dist/components/ui/combobox.cjs.map +0 -1
- package/dist/components/ui/combobox.js +0 -281
- package/dist/components/ui/combobox.js.map +0 -1
- package/dist/components/ui/command.cjs +0 -2
- package/dist/components/ui/command.cjs.map +0 -1
- package/dist/components/ui/command.js +0 -174
- package/dist/components/ui/command.js.map +0 -1
- package/dist/components/ui/context-menu.cjs +0 -2
- package/dist/components/ui/context-menu.cjs.map +0 -1
- package/dist/components/ui/context-menu.js +0 -236
- package/dist/components/ui/context-menu.js.map +0 -1
- package/dist/components/ui/dialog.cjs +0 -2
- package/dist/components/ui/dialog.cjs.map +0 -1
- package/dist/components/ui/dialog.js +0 -165
- package/dist/components/ui/dialog.js.map +0 -1
- package/dist/components/ui/drawer.cjs +0 -2
- package/dist/components/ui/drawer.cjs.map +0 -1
- package/dist/components/ui/drawer.js +0 -125
- package/dist/components/ui/drawer.js.map +0 -1
- package/dist/components/ui/dropdown-menu.cjs +0 -2
- package/dist/components/ui/dropdown-menu.cjs.map +0 -1
- package/dist/components/ui/dropdown-menu.js +0 -252
- package/dist/components/ui/dropdown-menu.js.map +0 -1
- package/dist/components/ui/field.cjs +0 -2
- package/dist/components/ui/field.cjs.map +0 -1
- package/dist/components/ui/field.js +0 -210
- package/dist/components/ui/field.js.map +0 -1
- package/dist/components/ui/hover-card.cjs +0 -2
- package/dist/components/ui/hover-card.cjs.map +0 -1
- package/dist/components/ui/hover-card.js +0 -39
- package/dist/components/ui/hover-card.js.map +0 -1
- package/dist/components/ui/input-group.cjs +0 -2
- package/dist/components/ui/input-group.cjs.map +0 -1
- package/dist/components/ui/input-group.js +0 -145
- package/dist/components/ui/input-group.js.map +0 -1
- package/dist/components/ui/input-otp.cjs +0 -2
- package/dist/components/ui/input-otp.cjs.map +0 -1
- package/dist/components/ui/input-otp.js +0 -82
- package/dist/components/ui/input-otp.js.map +0 -1
- package/dist/components/ui/input.cjs +0 -2
- package/dist/components/ui/input.cjs.map +0 -1
- package/dist/components/ui/input.js +0 -20
- package/dist/components/ui/input.js.map +0 -1
- package/dist/components/ui/item.cjs +0 -2
- package/dist/components/ui/item.cjs.map +0 -1
- package/dist/components/ui/item.js +0 -191
- package/dist/components/ui/item.js.map +0 -1
- package/dist/components/ui/kbd.cjs +0 -2
- package/dist/components/ui/kbd.cjs.map +0 -1
- package/dist/components/ui/kbd.js +0 -30
- package/dist/components/ui/kbd.js.map +0 -1
- package/dist/components/ui/label.cjs +0 -2
- package/dist/components/ui/label.cjs.map +0 -1
- package/dist/components/ui/label.js +0 -23
- package/dist/components/ui/label.js.map +0 -1
- package/dist/components/ui/menubar.cjs +0 -2
- package/dist/components/ui/menubar.cjs.map +0 -1
- package/dist/components/ui/menubar.js +0 -256
- package/dist/components/ui/menubar.js.map +0 -1
- package/dist/components/ui/navigation-menu.cjs +0 -2
- package/dist/components/ui/navigation-menu.cjs.map +0 -1
- package/dist/components/ui/navigation-menu.js +0 -164
- package/dist/components/ui/navigation-menu.js.map +0 -1
- package/dist/components/ui/popover.cjs +0 -2
- package/dist/components/ui/popover.cjs.map +0 -1
- package/dist/components/ui/popover.js +0 -45
- package/dist/components/ui/popover.js.map +0 -1
- package/dist/components/ui/radio-group.cjs +0 -2
- package/dist/components/ui/radio-group.cjs.map +0 -1
- package/dist/components/ui/radio-group.js +0 -45
- package/dist/components/ui/radio-group.js.map +0 -1
- package/dist/components/ui/resizable.cjs +0 -2
- package/dist/components/ui/resizable.cjs.map +0 -1
- package/dist/components/ui/resizable.js +0 -58
- package/dist/components/ui/resizable.js.map +0 -1
- package/dist/components/ui/scroll-area.cjs +0 -2
- package/dist/components/ui/scroll-area.cjs.map +0 -1
- package/dist/components/ui/scroll-area.js +0 -60
- package/dist/components/ui/scroll-area.js.map +0 -1
- package/dist/components/ui/select.cjs +0 -2
- package/dist/components/ui/select.cjs.map +0 -1
- package/dist/components/ui/select.js +0 -184
- package/dist/components/ui/select.js.map +0 -1
- package/dist/components/ui/separator.cjs +0 -2
- package/dist/components/ui/separator.cjs.map +0 -1
- package/dist/components/ui/separator.js +0 -27
- package/dist/components/ui/separator.js.map +0 -1
- package/dist/components/ui/sheet.cjs +0 -2
- package/dist/components/ui/sheet.cjs.map +0 -1
- package/dist/components/ui/sheet.js +0 -137
- package/dist/components/ui/sheet.js.map +0 -1
- package/dist/components/ui/sidebar.cjs +0 -2
- package/dist/components/ui/sidebar.cjs.map +0 -1
- package/dist/components/ui/sidebar.js +0 -579
- package/dist/components/ui/sidebar.js.map +0 -1
- package/dist/components/ui/skeleton.cjs +0 -2
- package/dist/components/ui/skeleton.cjs.map +0 -1
- package/dist/components/ui/skeleton.js +0 -24
- package/dist/components/ui/skeleton.js.map +0 -1
- package/dist/components/ui/slider.cjs +0 -2
- package/dist/components/ui/slider.cjs.map +0 -1
- package/dist/components/ui/slider.js +0 -60
- package/dist/components/ui/slider.js.map +0 -1
- package/dist/components/ui/sonner.cjs +0 -2
- package/dist/components/ui/sonner.cjs.map +0 -1
- package/dist/components/ui/sonner.js +0 -37
- package/dist/components/ui/sonner.js.map +0 -1
- package/dist/components/ui/spinner.cjs +0 -2
- package/dist/components/ui/spinner.cjs.map +0 -1
- package/dist/components/ui/spinner.js +0 -39
- package/dist/components/ui/spinner.js.map +0 -1
- package/dist/components/ui/switch.cjs +0 -2
- package/dist/components/ui/switch.cjs.map +0 -1
- package/dist/components/ui/switch.js +0 -32
- package/dist/components/ui/switch.js.map +0 -1
- package/dist/components/ui/table.cjs +0 -2
- package/dist/components/ui/table.cjs.map +0 -1
- package/dist/components/ui/table.js +0 -152
- package/dist/components/ui/table.js.map +0 -1
- package/dist/components/ui/tabs.cjs +0 -2
- package/dist/components/ui/tabs.cjs.map +0 -1
- package/dist/components/ui/tabs.js +0 -92
- package/dist/components/ui/tabs.js.map +0 -1
- package/dist/components/ui/tetrascience-icon.cjs +0 -2
- package/dist/components/ui/tetrascience-icon.cjs.map +0 -1
- package/dist/components/ui/tetrascience-icon.js +0 -46
- package/dist/components/ui/tetrascience-icon.js.map +0 -1
- package/dist/components/ui/textarea.cjs +0 -2
- package/dist/components/ui/textarea.cjs.map +0 -1
- package/dist/components/ui/textarea.js +0 -19
- package/dist/components/ui/textarea.js.map +0 -1
- package/dist/components/ui/toggle-group.cjs +0 -2
- package/dist/components/ui/toggle-group.cjs.map +0 -1
- package/dist/components/ui/toggle-group.js +0 -77
- package/dist/components/ui/toggle-group.js.map +0 -1
- package/dist/components/ui/toggle.cjs +0 -2
- package/dist/components/ui/toggle.cjs.map +0 -1
- package/dist/components/ui/toggle.js +0 -44
- package/dist/components/ui/toggle.js.map +0 -1
- package/dist/components/ui/tooltip.cjs +0 -2
- package/dist/components/ui/tooltip.cjs.map +0 -1
- package/dist/components/ui/tooltip.js +0 -56
- package/dist/components/ui/tooltip.js.map +0 -1
- package/dist/databricks.d.ts +0 -129
- package/dist/providers/athena.d.ts +0 -9
- package/dist/providers/databricks.d.ts +0 -9
- package/dist/providers/snowflake.d.ts +0 -9
- package/dist/snowflake.d.ts +0 -125
- /package/dist/components/charts/{ChromatogramChart → Chromatogram}/peakDetection.cjs +0 -0
- /package/dist/components/charts/{ChromatogramChart → Chromatogram}/peakDetection.js +0 -0
- /package/dist/{components/composed → composed}/tdp-url.cjs +0 -0
- /package/dist/{components/composed → composed}/tdp-url.js +0 -0
- /package/dist/{components/ui → ui}/aspect-ratio.cjs +0 -0
- /package/dist/{components/ui → ui}/aspect-ratio.js +0 -0
- /package/dist/{components/ui → ui}/collapsible.cjs +0 -0
- /package/dist/{components/ui → ui}/collapsible.js +0 -0
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ React component library for building TetraScience applications.
|
|
|
6
6
|
|
|
7
7
|
## Version
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
v1.0.0
|
|
10
10
|
|
|
11
11
|
This library provides:
|
|
12
12
|
|
|
@@ -26,12 +26,17 @@ This library provides:
|
|
|
26
26
|
|
|
27
27
|
| Library version | React | Node.js | TDP (server utilities) |
|
|
28
28
|
| --------------- | ----- | ------- | ---------------------- |
|
|
29
|
+
| v1.0.x | 19+ | 18+ | v4.x+ |
|
|
30
|
+
| v0.7.x | 19+ | 18+ | v4.x+ |
|
|
31
|
+
| v0.6.x | 19+ | 18+ | v4.x+ |
|
|
29
32
|
| v0.5.x | 19+ | 18+ | v4.x+ |
|
|
30
33
|
| v0.4.x | 19+ | 18+ | v4.x+ |
|
|
31
34
|
|
|
32
35
|
> **Note:** The client-side components have no TDP version dependency.
|
|
33
36
|
> The `/server` utilities (JWT auth, provider helpers) require a running TDP instance of v4.x or later.
|
|
34
37
|
> Browser support follows React 19's matrix (modern evergreen browsers).
|
|
38
|
+
>
|
|
39
|
+
> As of v1.0.0, heavy dependencies are **optional peer dependencies**: install `plotly.js-dist` if you use the chart components, `@streamdown/mermaid` / `@streamdown/math` if you use the AI markdown components, `@rdkit/rdkit` if you use `MoleculeStructure`, and the provider SDKs (`@aws-sdk/client-athena`, `@databricks/sql`, `snowflake-sdk`) only for the `/server` utilities you use. Apps that don't use these components don't need to install them.
|
|
35
40
|
|
|
36
41
|
## Installation
|
|
37
42
|
|
|
@@ -61,6 +66,33 @@ function App() {
|
|
|
61
66
|
}
|
|
62
67
|
```
|
|
63
68
|
|
|
69
|
+
Only need a handful of components? Every one is also importable individually — see [Per-Component Imports](#per-component-imports) below.
|
|
70
|
+
|
|
71
|
+
### Per-Component Imports
|
|
72
|
+
|
|
73
|
+
Every component is also reachable at its own subpath, grouped by category:
|
|
74
|
+
`ui/*`, `composed/*`, `charts/*`, `ai/*`, `utils/*`:
|
|
75
|
+
|
|
76
|
+
```tsx
|
|
77
|
+
import { Button } from "@tetrascience-npm/tetrascience-react-ui/ui/button";
|
|
78
|
+
import { StatCard } from "@tetrascience-npm/tetrascience-react-ui/composed/StatCard";
|
|
79
|
+
import { AreaPlot } from "@tetrascience-npm/tetrascience-react-ui/charts/AreaPlot";
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Importing this way only pulls in that component's own module graph — the main
|
|
83
|
+
`@tetrascience-npm/tetrascience-react-ui` import still works exactly as
|
|
84
|
+
before and pulls in everything. The difference matters most for **Jest**,
|
|
85
|
+
which has no tree-shaking and re-evaluates the full import graph on every
|
|
86
|
+
test file: a full-barrel import costs ~1.2s of module evaluation per test
|
|
87
|
+
file; a single-component subpath costs ~0.1s. For a production bundler
|
|
88
|
+
(Vite, webpack 5) the difference is smaller since unused components are
|
|
89
|
+
already tree-shaken from the main import.
|
|
90
|
+
|
|
91
|
+
The subpath name always matches the component's directory/file under
|
|
92
|
+
`src/components/<category>/` — check [DESIGN.md](./DESIGN.md) or the
|
|
93
|
+
[Storybook](https://ts-lib-ui-kit-storybook.vercel.app/) sidebar for the
|
|
94
|
+
exact name.
|
|
95
|
+
|
|
64
96
|
## Styling & CSS
|
|
65
97
|
|
|
66
98
|
This library uses **Tailwind CSS 4** with design tokens defined as CSS custom properties (oklch color space). All CSS files are declared as [`sideEffects`](https://webpack.js.org/guides/tree-shaking/#mark-the-file-as-side-effect-free) in `package.json`, so bundlers will preserve them while still tree-shaking unused JavaScript.
|
|
@@ -94,7 +126,7 @@ Dark mode is supported via the `.dark` class on a parent element. See [THEMING.m
|
|
|
94
126
|
|
|
95
127
|
shadcn/ui components built on Radix UI with Tailwind CSS and CVA variants:
|
|
96
128
|
|
|
97
|
-
Accordion, Alert, AlertDialog, AspectRatio, Avatar, Badge, Breadcrumb, Button, ButtonGroup, Calendar, Card, Carousel, Checkbox, CodeEditor, Collapsible, ComboBox, Command, ContextMenu, Dialog,
|
|
129
|
+
Accordion, Alert, AlertDialog, AspectRatio, Avatar, Badge, Breadcrumb, Button, ButtonGroup, Calendar, Card, Carousel, Checkbox, CodeEditor, Collapsible, ComboBox, Command, ContextMenu, Dialog, DropdownMenu, Field, HoverCard, Input, InputGroup, Item, KBD, Label, MenuBar, NavigationMenu, RadioGroup, ResizablePanel, ScrollArea, Select, Separator, Sheet, Sidebar, Skeleton, Slider, Sonner, Spinner, Switch, Table, Tabs, Textarea, TetraScience Icon, Toggle, ToggleGroup, Tooltip
|
|
98
130
|
|
|
99
131
|
### Composed Components (`composed/`)
|
|
100
132
|
|
|
@@ -157,7 +189,7 @@ Use `ProcessFlow` from `@tetrascience-npm/tetrascience-react-ui` for multi-step
|
|
|
157
189
|
|
|
158
190
|
Plotly.js-based data visualisations:
|
|
159
191
|
|
|
160
|
-
|
|
192
|
+
AreaPlot, BarChart, BoxPlot, Chromatogram, StackedChromatogram, Electropherogram, Histogram, LinePlot, PieChart, PlateMap, ScatterPlot, ScatterPlotInteractive
|
|
161
193
|
|
|
162
194
|
## Server Utilities
|
|
163
195
|
|
|
@@ -363,9 +395,31 @@ Full TypeScript support with exported types:
|
|
|
363
395
|
|
|
364
396
|
```tsx
|
|
365
397
|
import { Button } from "@tetrascience-npm/tetrascience-react-ui";
|
|
366
|
-
import type { ButtonProps,
|
|
398
|
+
import type { ButtonProps, BarChartProps, BarDataSeries } from "@tetrascience-npm/tetrascience-react-ui";
|
|
367
399
|
```
|
|
368
400
|
|
|
401
|
+
## Testing your app with Jest
|
|
402
|
+
|
|
403
|
+
The kit ships dual ESM + CJS output, so Jest's CommonJS runtime can load every component directly — no need to mock the package. What Jest *can't* load are a few third-party dependencies that publish ESM-only (the streamdown/markdown stack, shiki, `use-stick-to-bottom`, `react-resizable-panels`) and optional peers you may not have installed (`plotly.js-dist`, `@rdkit/rdkit`). The kit ships a single setup file that stubs exactly those, plus the jsdom shims Radix-based components need (ResizeObserver, matchMedia, pointer capture, …).
|
|
404
|
+
|
|
405
|
+
Add one line to `jest.config.js`:
|
|
406
|
+
|
|
407
|
+
```js
|
|
408
|
+
module.exports = {
|
|
409
|
+
testEnvironment: "jsdom",
|
|
410
|
+
setupFiles: ["@tetrascience-npm/tetrascience-react-ui/jest-setup"],
|
|
411
|
+
};
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
Requires Jest ≥ 28 (package `exports` support) and `jest-environment-jsdom`. To override any stub, register your own mock — `jest.mock("<module>", …)` in a test file or a later setup file replaces the kit's registration. If Jest runs with `injectGlobals: false`, import `installUiKitJestMocks` / `installUiKitDomShims` from the same module and call them from your own setup file with the `jest` object.
|
|
415
|
+
|
|
416
|
+
What the stubs do:
|
|
417
|
+
|
|
418
|
+
- **Charts** render their containers; Plotly calls resolve against an inert stub (jsdom has no WebGL). Assert on props/behavior, not pixels — visual assertions belong in a real browser.
|
|
419
|
+
- **`MessageResponse` / `Reasoning`** render the markdown source as plain text, so text-content assertions work without transpiling the markdown ecosystem.
|
|
420
|
+
- **`CodeBlock`** renders unhighlighted code lines. Only the languages the kit ships by default are covered — a grammar you add yourself via `registerCodeBlockLanguage` isn't mockable by this setup file, since it isn't known ahead of time.
|
|
421
|
+
- **`MoleculeStructure`** resolves against a stub that always returns a valid, empty-SVG molecule. For real assertions (invalid-SMILES handling, actual rendered markup), use the kit's own override hook instead of relying on the stub: `configureRDKit({ importFactory: () => Promise.resolve(myFakeRDKitModule) })`, exported alongside `MoleculeStructure`.
|
|
422
|
+
|
|
369
423
|
## Examples
|
|
370
424
|
|
|
371
425
|
This repository uses component driven development with Storybook. To see the examples run the following.
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),a=require("lucide-react"),u=require("react"),A=require("../ui/button.cjs"),h=require("../ui/hover-card.cjs"),i=require("../lib/utils.cjs"),y={audio:a.Music2Icon,document:a.FileTextIcon,image:a.ImageIcon,source:a.GlobeIcon,unknown:a.PaperclipIcon,video:a.VideoIcon},x=e=>{if(e.type==="source-document")return"source";const t=e.mediaType??"";return t.startsWith("image/")?"image":t.startsWith("video/")?"video":t.startsWith("audio/")?"audio":t.startsWith("application/")||t.startsWith("text/")?"document":"unknown"},v=e=>{if(e.type==="source-document")return e.title||e.filename||"Source";const t=x(e);return e.filename||(t==="image"?"Image":"Attachment")},j=(e,t,r)=>r?n.jsx("img",{alt:t||"Image",className:"size-full object-cover",height:96,src:e,width:96}):n.jsx("img",{alt:t||"Image",className:"size-full rounded object-cover",height:20,src:e,width:20}),p=u.createContext(null),f=u.createContext(null),b=()=>u.useContext(p)??{variant:"grid"},m=()=>{const e=u.useContext(f);if(!e)throw new Error("Attachment components must be used within <Attachment>");return e},I=({variant:e="grid",className:t,children:r,...o})=>{const s=u.useMemo(()=>({variant:e}),[e]);return n.jsx(p.Provider,{value:s,children:n.jsx("div",{className:i.cn("flex items-start",e==="list"?"flex-col gap-2":"flex-wrap gap-2",e==="grid"&&"ml-auto w-fit",t),...o,children:r})})},w=({data:e,onRemove:t,className:r,children:o,...s})=>{const{variant:c}=b(),l=x(e),d=u.useMemo(()=>({data:e,mediaCategory:l,onRemove:t,variant:c}),[e,l,t,c]);return n.jsx(f.Provider,{value:d,children:n.jsx("div",{className:i.cn("group relative",c==="grid"&&"size-24 overflow-hidden rounded-lg",c==="inline"&&["flex h-8 cursor-pointer select-none items-center gap-1.5","rounded-md border border-border px-1.5","font-medium text-sm transition-all","hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50"],c==="list"&&["flex w-full items-center gap-3 rounded-lg border p-3","hover:bg-accent/50"],r),...s,children:o})})},z=({fallbackIcon:e,className:t,...r})=>{const{data:o,mediaCategory:s,variant:c}=m(),l=c==="inline"?"size-3":"size-4",d=g=>n.jsx(g,{className:i.cn(l,"text-muted-foreground")}),C=()=>{if(s==="image"&&o.type==="file"&&o.url)return j(o.url,o.filename,c==="grid");if(s==="video"&&o.type==="file"&&o.url)return n.jsx("video",{className:"size-full object-cover",muted:!0,src:o.url});const g=y[s];return e??d(g)};return n.jsx("div",{className:i.cn("flex shrink-0 items-center justify-center overflow-hidden",c==="grid"&&"size-full bg-muted",c==="inline"&&"size-5 rounded bg-background",c==="list"&&"size-12 rounded bg-muted",t),...r,children:C()})},N=({showMediaType:e=!1,className:t,...r})=>{const{data:o,variant:s}=m(),c=v(o);return s==="grid"?null:n.jsxs("div",{className:i.cn("min-w-0 flex-1",t),...r,children:[n.jsx("span",{className:"block truncate",children:c}),e&&o.mediaType&&n.jsx("span",{className:"block truncate text-muted-foreground text-xs",children:o.mediaType})]})},k=({label:e="Remove",className:t,children:r,...o})=>{const{onRemove:s,variant:c}=m(),l=u.useCallback(d=>{d.stopPropagation(),s?.()},[s]);return s?n.jsxs(A.Button,{"aria-label":e,className:i.cn(c==="grid"&&["absolute top-2 right-2 size-6 rounded-full p-0","bg-background/80 backdrop-blur-sm","opacity-0 transition-opacity group-hover:opacity-100","hover:bg-background","[&>svg]:size-3"],c==="inline"&&["size-5 rounded p-0","opacity-0 transition-opacity group-hover:opacity-100","[&>svg]:size-2.5"],c==="list"&&["size-8 shrink-0 rounded p-0","[&>svg]:size-4"],t),onClick:l,type:"button",variant:"ghost",...o,children:[r??n.jsx(a.XIcon,{}),n.jsx("span",{className:"sr-only",children:e})]}):null},H=({openDelay:e=0,closeDelay:t=0,...r})=>n.jsx(h.HoverCard,{closeDelay:t,openDelay:e,...r}),T=e=>n.jsx(h.HoverCardTrigger,{...e}),P=({align:e="start",className:t,...r})=>n.jsx(h.HoverCardContent,{align:e,className:i.cn("w-auto p-2",t),...r}),q=({className:e,children:t,...r})=>n.jsx("div",{className:i.cn("flex items-center justify-center p-4 text-muted-foreground text-sm",e),...r,children:t??"No attachments"});exports.Attachment=w;exports.AttachmentEmpty=q;exports.AttachmentHoverCard=H;exports.AttachmentHoverCardContent=P;exports.AttachmentHoverCardTrigger=T;exports.AttachmentInfo=N;exports.AttachmentPreview=z;exports.AttachmentRemove=k;exports.Attachments=I;exports.getAttachmentLabel=v;exports.getMediaCategory=x;exports.useAttachmentContext=m;exports.useAttachmentsContext=b;
|
|
2
|
+
//# sourceMappingURL=attachments.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachments.cjs","sources":["../../src/components/ai/attachments.tsx"],"sourcesContent":["import {\n FileTextIcon,\n GlobeIcon,\n ImageIcon,\n Music2Icon,\n PaperclipIcon,\n VideoIcon,\n XIcon,\n} from \"lucide-react\";\nimport { createContext, useCallback, useContext, useMemo } from \"react\";\n\nimport type { FileUIPart, SourceDocumentUIPart } from \"ai\";\nimport type { ComponentProps, HTMLAttributes, ReactNode } from \"react\";\n\nimport { Button } from \"@/components/ui/button\";\nimport {\n HoverCard,\n HoverCardContent,\n HoverCardTrigger,\n} from \"@/components/ui/hover-card\";\nimport { cn } from \"@/lib/utils\";\n\n\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport type AttachmentData =\n | (FileUIPart & { id: string })\n | (SourceDocumentUIPart & { id: string });\n\nexport type AttachmentMediaCategory =\n | \"image\"\n | \"video\"\n | \"audio\"\n | \"document\"\n | \"source\"\n | \"unknown\";\n\nexport type AttachmentVariant = \"grid\" | \"inline\" | \"list\";\n\nconst mediaCategoryIcons: Record<AttachmentMediaCategory, typeof ImageIcon> = {\n audio: Music2Icon,\n document: FileTextIcon,\n image: ImageIcon,\n source: GlobeIcon,\n unknown: PaperclipIcon,\n video: VideoIcon,\n};\n\n// ============================================================================\n// Utility Functions\n// ============================================================================\n\nexport const getMediaCategory = (\n data: AttachmentData\n): AttachmentMediaCategory => {\n if (data.type === \"source-document\") {\n return \"source\";\n }\n\n const mediaType = data.mediaType ?? \"\";\n\n if (mediaType.startsWith(\"image/\")) {\n return \"image\";\n }\n if (mediaType.startsWith(\"video/\")) {\n return \"video\";\n }\n if (mediaType.startsWith(\"audio/\")) {\n return \"audio\";\n }\n if (mediaType.startsWith(\"application/\") || mediaType.startsWith(\"text/\")) {\n return \"document\";\n }\n\n return \"unknown\";\n};\n\nexport const getAttachmentLabel = (data: AttachmentData): string => {\n if (data.type === \"source-document\") {\n return data.title || data.filename || \"Source\";\n }\n\n const category = getMediaCategory(data);\n return data.filename || (category === \"image\" ? \"Image\" : \"Attachment\");\n};\n\nconst renderAttachmentImage = (\n url: string,\n filename: string | undefined,\n isGrid: boolean\n) =>\n isGrid ? (\n <img\n alt={filename || \"Image\"}\n className=\"size-full object-cover\"\n height={96}\n src={url}\n width={96}\n />\n ) : (\n <img\n alt={filename || \"Image\"}\n className=\"size-full rounded object-cover\"\n height={20}\n src={url}\n width={20}\n />\n );\n\n// ============================================================================\n// Contexts\n// ============================================================================\n\ninterface AttachmentsContextValue {\n variant: AttachmentVariant;\n}\n\nconst AttachmentsContext = createContext<AttachmentsContextValue | null>(null);\n\ninterface AttachmentContextValue {\n data: AttachmentData;\n mediaCategory: AttachmentMediaCategory;\n onRemove?: () => void;\n variant: AttachmentVariant;\n}\n\nconst AttachmentContext = createContext<AttachmentContextValue | null>(null);\n\n// ============================================================================\n// Hooks\n// ============================================================================\n\nexport const useAttachmentsContext = () =>\n useContext(AttachmentsContext) ?? { variant: \"grid\" as const };\n\nexport const useAttachmentContext = () => {\n const ctx = useContext(AttachmentContext);\n if (!ctx) {\n throw new Error(\"Attachment components must be used within <Attachment>\");\n }\n return ctx;\n};\n\n// ============================================================================\n// Attachments - Container\n// ============================================================================\n\nexport type AttachmentsProps = HTMLAttributes<HTMLDivElement> & {\n variant?: AttachmentVariant;\n};\n\nexport const Attachments = ({\n variant = \"grid\",\n className,\n children,\n ...props\n}: AttachmentsProps) => {\n const contextValue = useMemo(() => ({ variant }), [variant]);\n\n return (\n <AttachmentsContext.Provider value={contextValue}>\n <div\n className={cn(\n \"flex items-start\",\n variant === \"list\" ? \"flex-col gap-2\" : \"flex-wrap gap-2\",\n variant === \"grid\" && \"ml-auto w-fit\",\n className\n )}\n {...props}\n >\n {children}\n </div>\n </AttachmentsContext.Provider>\n );\n};\n\n// ============================================================================\n// Attachment - Item\n// ============================================================================\n\nexport type AttachmentProps = HTMLAttributes<HTMLDivElement> & {\n data: AttachmentData;\n onRemove?: () => void;\n};\n\nexport const Attachment = ({\n data,\n onRemove,\n className,\n children,\n ...props\n}: AttachmentProps) => {\n const { variant } = useAttachmentsContext();\n const mediaCategory = getMediaCategory(data);\n\n const contextValue = useMemo<AttachmentContextValue>(\n () => ({ data, mediaCategory, onRemove, variant }),\n [data, mediaCategory, onRemove, variant]\n );\n\n return (\n <AttachmentContext.Provider value={contextValue}>\n <div\n className={cn(\n \"group relative\",\n variant === \"grid\" && \"size-24 overflow-hidden rounded-lg\",\n variant === \"inline\" && [\n \"flex h-8 cursor-pointer select-none items-center gap-1.5\",\n \"rounded-md border border-border px-1.5\",\n \"font-medium text-sm transition-all\",\n \"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50\",\n ],\n variant === \"list\" && [\n \"flex w-full items-center gap-3 rounded-lg border p-3\",\n \"hover:bg-accent/50\",\n ],\n className\n )}\n {...props}\n >\n {children}\n </div>\n </AttachmentContext.Provider>\n );\n};\n\n// ============================================================================\n// AttachmentPreview - Media preview\n// ============================================================================\n\nexport type AttachmentPreviewProps = HTMLAttributes<HTMLDivElement> & {\n fallbackIcon?: ReactNode;\n};\n\nexport const AttachmentPreview = ({\n fallbackIcon,\n className,\n ...props\n}: AttachmentPreviewProps) => {\n const { data, mediaCategory, variant } = useAttachmentContext();\n\n const iconSize = variant === \"inline\" ? \"size-3\" : \"size-4\";\n\n const renderIcon = (Icon: typeof ImageIcon) => (\n <Icon className={cn(iconSize, \"text-muted-foreground\")} />\n );\n\n const renderContent = () => {\n if (mediaCategory === \"image\" && data.type === \"file\" && data.url) {\n return renderAttachmentImage(data.url, data.filename, variant === \"grid\");\n }\n\n if (mediaCategory === \"video\" && data.type === \"file\" && data.url) {\n return <video className=\"size-full object-cover\" muted src={data.url} />;\n }\n\n const Icon = mediaCategoryIcons[mediaCategory];\n return fallbackIcon ?? renderIcon(Icon);\n };\n\n return (\n <div\n className={cn(\n \"flex shrink-0 items-center justify-center overflow-hidden\",\n variant === \"grid\" && \"size-full bg-muted\",\n variant === \"inline\" && \"size-5 rounded bg-background\",\n variant === \"list\" && \"size-12 rounded bg-muted\",\n className\n )}\n {...props}\n >\n {renderContent()}\n </div>\n );\n};\n\n// ============================================================================\n// AttachmentInfo - Name and type display\n// ============================================================================\n\nexport type AttachmentInfoProps = HTMLAttributes<HTMLDivElement> & {\n showMediaType?: boolean;\n};\n\nexport const AttachmentInfo = ({\n showMediaType = false,\n className,\n ...props\n}: AttachmentInfoProps) => {\n const { data, variant } = useAttachmentContext();\n const label = getAttachmentLabel(data);\n\n if (variant === \"grid\") {\n return null;\n }\n\n return (\n <div className={cn(\"min-w-0 flex-1\", className)} {...props}>\n <span className=\"block truncate\">{label}</span>\n {showMediaType && data.mediaType && (\n <span className=\"block truncate text-muted-foreground text-xs\">\n {data.mediaType}\n </span>\n )}\n </div>\n );\n};\n\n// ============================================================================\n// AttachmentRemove - Remove button\n// ============================================================================\n\nexport type AttachmentRemoveProps = ComponentProps<typeof Button> & {\n label?: string;\n};\n\nexport const AttachmentRemove = ({\n label = \"Remove\",\n className,\n children,\n ...props\n}: AttachmentRemoveProps) => {\n const { onRemove, variant } = useAttachmentContext();\n\n const handleClick = useCallback(\n (e: React.MouseEvent) => {\n e.stopPropagation();\n onRemove?.();\n },\n [onRemove]\n );\n\n if (!onRemove) {\n return null;\n }\n\n return (\n <Button\n aria-label={label}\n className={cn(\n variant === \"grid\" && [\n \"absolute top-2 right-2 size-6 rounded-full p-0\",\n \"bg-background/80 backdrop-blur-sm\",\n \"opacity-0 transition-opacity group-hover:opacity-100\",\n \"hover:bg-background\",\n \"[&>svg]:size-3\",\n ],\n variant === \"inline\" && [\n \"size-5 rounded p-0\",\n \"opacity-0 transition-opacity group-hover:opacity-100\",\n \"[&>svg]:size-2.5\",\n ],\n variant === \"list\" && [\"size-8 shrink-0 rounded p-0\", \"[&>svg]:size-4\"],\n className\n )}\n onClick={handleClick}\n type=\"button\"\n variant=\"ghost\"\n {...props}\n >\n {children ?? <XIcon />}\n <span className=\"sr-only\">{label}</span>\n </Button>\n );\n};\n\n// ============================================================================\n// AttachmentHoverCard - Hover preview\n// ============================================================================\n\nexport type AttachmentHoverCardProps = ComponentProps<typeof HoverCard>;\n\nexport const AttachmentHoverCard = ({\n openDelay = 0,\n closeDelay = 0,\n ...props\n}: AttachmentHoverCardProps) => (\n <HoverCard closeDelay={closeDelay} openDelay={openDelay} {...props} />\n);\n\nexport type AttachmentHoverCardTriggerProps = ComponentProps<\n typeof HoverCardTrigger\n>;\n\nexport const AttachmentHoverCardTrigger = (\n props: AttachmentHoverCardTriggerProps\n) => <HoverCardTrigger {...props} />;\n\nexport type AttachmentHoverCardContentProps = ComponentProps<\n typeof HoverCardContent\n>;\n\nexport const AttachmentHoverCardContent = ({\n align = \"start\",\n className,\n ...props\n}: AttachmentHoverCardContentProps) => (\n <HoverCardContent\n align={align}\n className={cn(\"w-auto p-2\", className)}\n {...props}\n />\n);\n\n// ============================================================================\n// AttachmentEmpty - Empty state\n// ============================================================================\n\nexport type AttachmentEmptyProps = HTMLAttributes<HTMLDivElement>;\n\nexport const AttachmentEmpty = ({\n className,\n children,\n ...props\n}: AttachmentEmptyProps) => (\n <div\n className={cn(\n \"flex items-center justify-center p-4 text-muted-foreground text-sm\",\n className\n )}\n {...props}\n >\n {children ?? \"No attachments\"}\n </div>\n);\n"],"names":["mediaCategoryIcons","Music2Icon","FileTextIcon","ImageIcon","GlobeIcon","PaperclipIcon","VideoIcon","getMediaCategory","data","mediaType","getAttachmentLabel","category","renderAttachmentImage","url","filename","isGrid","jsx","AttachmentsContext","createContext","AttachmentContext","useAttachmentsContext","useContext","useAttachmentContext","ctx","Attachments","variant","className","children","props","contextValue","useMemo","cn","Attachment","onRemove","mediaCategory","AttachmentPreview","fallbackIcon","iconSize","renderIcon","Icon","renderContent","AttachmentInfo","showMediaType","label","jsxs","AttachmentRemove","handleClick","useCallback","e","Button","XIcon","AttachmentHoverCard","openDelay","closeDelay","HoverCard","AttachmentHoverCardTrigger","HoverCardTrigger","AttachmentHoverCardContent","align","HoverCardContent","AttachmentEmpty"],"mappings":"gQA0CMA,EAAwE,CAC5E,MAAOC,EAAAA,WACP,SAAUC,EAAAA,aACV,MAAOC,EAAAA,UACP,OAAQC,EAAAA,UACR,QAASC,EAAAA,cACT,MAAOC,EAAAA,SACT,EAMaC,EACXC,GAC4B,CAC5B,GAAIA,EAAK,OAAS,kBAChB,MAAO,SAGT,MAAMC,EAAYD,EAAK,WAAa,GAEpC,OAAIC,EAAU,WAAW,QAAQ,EACxB,QAELA,EAAU,WAAW,QAAQ,EACxB,QAELA,EAAU,WAAW,QAAQ,EACxB,QAELA,EAAU,WAAW,cAAc,GAAKA,EAAU,WAAW,OAAO,EAC/D,WAGF,SACT,EAEaC,EAAsBF,GAAiC,CAClE,GAAIA,EAAK,OAAS,kBAChB,OAAOA,EAAK,OAASA,EAAK,UAAY,SAGxC,MAAMG,EAAWJ,EAAiBC,CAAI,EACtC,OAAOA,EAAK,WAAaG,IAAa,QAAU,QAAU,aAC5D,EAEMC,EAAwB,CAC5BC,EACAC,EACAC,IAEAA,EACEC,EAAAA,IAAC,MAAA,CACC,IAAKF,GAAY,QACjB,UAAU,yBACV,OAAQ,GACR,IAAKD,EACL,MAAO,EAAA,CACT,EAEAG,EAAAA,IAAC,MAAA,CACC,IAAKF,GAAY,QACjB,UAAU,iCACV,OAAQ,GACR,IAAKD,EACL,MAAO,EAAA,CACT,EAWEI,EAAqBC,EAAAA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We,EAAAA,GACT,qEACAL,CAAA,EAED,GAAGE,EAEH,SAAAD,GAAY,gBAAA,CACf"}
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import { jsx as i, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import { XIcon as y, VideoIcon as C, PaperclipIcon as A, GlobeIcon as z, ImageIcon as I, FileTextIcon as w, Music2Icon as N } from "lucide-react";
|
|
3
|
+
import { createContext as g, useMemo as h, useCallback as k, useContext as p } from "react";
|
|
4
|
+
import { Button as j } from "../ui/button.js";
|
|
5
|
+
import { HoverCard as T, HoverCardContent as H, HoverCardTrigger as P } from "../ui/hover-card.js";
|
|
6
|
+
import { cn as s } from "../lib/utils.js";
|
|
7
|
+
const W = {
|
|
8
|
+
audio: N,
|
|
9
|
+
document: w,
|
|
10
|
+
image: I,
|
|
11
|
+
source: z,
|
|
12
|
+
unknown: A,
|
|
13
|
+
video: C
|
|
14
|
+
}, f = (e) => {
|
|
15
|
+
if (e.type === "source-document")
|
|
16
|
+
return "source";
|
|
17
|
+
const t = e.mediaType ?? "";
|
|
18
|
+
return t.startsWith("image/") ? "image" : t.startsWith("video/") ? "video" : t.startsWith("audio/") ? "audio" : t.startsWith("application/") || t.startsWith("text/") ? "document" : "unknown";
|
|
19
|
+
}, M = (e) => {
|
|
20
|
+
if (e.type === "source-document")
|
|
21
|
+
return e.title || e.filename || "Source";
|
|
22
|
+
const t = f(e);
|
|
23
|
+
return e.filename || (t === "image" ? "Image" : "Attachment");
|
|
24
|
+
}, V = (e, t, r) => r ? /* @__PURE__ */ i(
|
|
25
|
+
"img",
|
|
26
|
+
{
|
|
27
|
+
alt: t || "Image",
|
|
28
|
+
className: "size-full object-cover",
|
|
29
|
+
height: 96,
|
|
30
|
+
src: e,
|
|
31
|
+
width: 96
|
|
32
|
+
}
|
|
33
|
+
) : /* @__PURE__ */ i(
|
|
34
|
+
"img",
|
|
35
|
+
{
|
|
36
|
+
alt: t || "Image",
|
|
37
|
+
className: "size-full rounded object-cover",
|
|
38
|
+
height: 20,
|
|
39
|
+
src: e,
|
|
40
|
+
width: 20
|
|
41
|
+
}
|
|
42
|
+
), v = g(null), x = g(null), E = () => p(v) ?? { variant: "grid" }, u = () => {
|
|
43
|
+
const e = p(x);
|
|
44
|
+
if (!e)
|
|
45
|
+
throw new Error("Attachment components must be used within <Attachment>");
|
|
46
|
+
return e;
|
|
47
|
+
}, X = ({
|
|
48
|
+
variant: e = "grid",
|
|
49
|
+
className: t,
|
|
50
|
+
children: r,
|
|
51
|
+
...n
|
|
52
|
+
}) => {
|
|
53
|
+
const c = h(() => ({ variant: e }), [e]);
|
|
54
|
+
return /* @__PURE__ */ i(v.Provider, { value: c, children: /* @__PURE__ */ i(
|
|
55
|
+
"div",
|
|
56
|
+
{
|
|
57
|
+
className: s(
|
|
58
|
+
"flex items-start",
|
|
59
|
+
e === "list" ? "flex-col gap-2" : "flex-wrap gap-2",
|
|
60
|
+
e === "grid" && "ml-auto w-fit",
|
|
61
|
+
t
|
|
62
|
+
),
|
|
63
|
+
...n,
|
|
64
|
+
children: r
|
|
65
|
+
}
|
|
66
|
+
) });
|
|
67
|
+
}, q = ({
|
|
68
|
+
data: e,
|
|
69
|
+
onRemove: t,
|
|
70
|
+
className: r,
|
|
71
|
+
children: n,
|
|
72
|
+
...c
|
|
73
|
+
}) => {
|
|
74
|
+
const { variant: o } = E(), a = f(e), l = h(
|
|
75
|
+
() => ({ data: e, mediaCategory: a, onRemove: t, variant: o }),
|
|
76
|
+
[e, a, t, o]
|
|
77
|
+
);
|
|
78
|
+
return /* @__PURE__ */ i(x.Provider, { value: l, children: /* @__PURE__ */ i(
|
|
79
|
+
"div",
|
|
80
|
+
{
|
|
81
|
+
className: s(
|
|
82
|
+
"group relative",
|
|
83
|
+
o === "grid" && "size-24 overflow-hidden rounded-lg",
|
|
84
|
+
o === "inline" && [
|
|
85
|
+
"flex h-8 cursor-pointer select-none items-center gap-1.5",
|
|
86
|
+
"rounded-md border border-border px-1.5",
|
|
87
|
+
"font-medium text-sm transition-all",
|
|
88
|
+
"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50"
|
|
89
|
+
],
|
|
90
|
+
o === "list" && [
|
|
91
|
+
"flex w-full items-center gap-3 rounded-lg border p-3",
|
|
92
|
+
"hover:bg-accent/50"
|
|
93
|
+
],
|
|
94
|
+
r
|
|
95
|
+
),
|
|
96
|
+
...c,
|
|
97
|
+
children: n
|
|
98
|
+
}
|
|
99
|
+
) });
|
|
100
|
+
}, D = ({
|
|
101
|
+
fallbackIcon: e,
|
|
102
|
+
className: t,
|
|
103
|
+
...r
|
|
104
|
+
}) => {
|
|
105
|
+
const { data: n, mediaCategory: c, variant: o } = u(), a = o === "inline" ? "size-3" : "size-4", l = (d) => /* @__PURE__ */ i(d, { className: s(a, "text-muted-foreground") }), b = () => {
|
|
106
|
+
if (c === "image" && n.type === "file" && n.url)
|
|
107
|
+
return V(n.url, n.filename, o === "grid");
|
|
108
|
+
if (c === "video" && n.type === "file" && n.url)
|
|
109
|
+
return /* @__PURE__ */ i("video", { className: "size-full object-cover", muted: !0, src: n.url });
|
|
110
|
+
const d = W[c];
|
|
111
|
+
return e ?? l(d);
|
|
112
|
+
};
|
|
113
|
+
return /* @__PURE__ */ i(
|
|
114
|
+
"div",
|
|
115
|
+
{
|
|
116
|
+
className: s(
|
|
117
|
+
"flex shrink-0 items-center justify-center overflow-hidden",
|
|
118
|
+
o === "grid" && "size-full bg-muted",
|
|
119
|
+
o === "inline" && "size-5 rounded bg-background",
|
|
120
|
+
o === "list" && "size-12 rounded bg-muted",
|
|
121
|
+
t
|
|
122
|
+
),
|
|
123
|
+
...r,
|
|
124
|
+
children: b()
|
|
125
|
+
}
|
|
126
|
+
);
|
|
127
|
+
}, J = ({
|
|
128
|
+
showMediaType: e = !1,
|
|
129
|
+
className: t,
|
|
130
|
+
...r
|
|
131
|
+
}) => {
|
|
132
|
+
const { data: n, variant: c } = u(), o = M(n);
|
|
133
|
+
return c === "grid" ? null : /* @__PURE__ */ m("div", { className: s("min-w-0 flex-1", t), ...r, children: [
|
|
134
|
+
/* @__PURE__ */ i("span", { className: "block truncate", children: o }),
|
|
135
|
+
e && n.mediaType && /* @__PURE__ */ i("span", { className: "block truncate text-muted-foreground text-xs", children: n.mediaType })
|
|
136
|
+
] });
|
|
137
|
+
}, K = ({
|
|
138
|
+
label: e = "Remove",
|
|
139
|
+
className: t,
|
|
140
|
+
children: r,
|
|
141
|
+
...n
|
|
142
|
+
}) => {
|
|
143
|
+
const { onRemove: c, variant: o } = u(), a = k(
|
|
144
|
+
(l) => {
|
|
145
|
+
l.stopPropagation(), c?.();
|
|
146
|
+
},
|
|
147
|
+
[c]
|
|
148
|
+
);
|
|
149
|
+
return c ? /* @__PURE__ */ m(
|
|
150
|
+
j,
|
|
151
|
+
{
|
|
152
|
+
"aria-label": e,
|
|
153
|
+
className: s(
|
|
154
|
+
o === "grid" && [
|
|
155
|
+
"absolute top-2 right-2 size-6 rounded-full p-0",
|
|
156
|
+
"bg-background/80 backdrop-blur-sm",
|
|
157
|
+
"opacity-0 transition-opacity group-hover:opacity-100",
|
|
158
|
+
"hover:bg-background",
|
|
159
|
+
"[&>svg]:size-3"
|
|
160
|
+
],
|
|
161
|
+
o === "inline" && [
|
|
162
|
+
"size-5 rounded p-0",
|
|
163
|
+
"opacity-0 transition-opacity group-hover:opacity-100",
|
|
164
|
+
"[&>svg]:size-2.5"
|
|
165
|
+
],
|
|
166
|
+
o === "list" && ["size-8 shrink-0 rounded p-0", "[&>svg]:size-4"],
|
|
167
|
+
t
|
|
168
|
+
),
|
|
169
|
+
onClick: a,
|
|
170
|
+
type: "button",
|
|
171
|
+
variant: "ghost",
|
|
172
|
+
...n,
|
|
173
|
+
children: [
|
|
174
|
+
r ?? /* @__PURE__ */ i(y, {}),
|
|
175
|
+
/* @__PURE__ */ i("span", { className: "sr-only", children: e })
|
|
176
|
+
]
|
|
177
|
+
}
|
|
178
|
+
) : null;
|
|
179
|
+
}, O = ({
|
|
180
|
+
openDelay: e = 0,
|
|
181
|
+
closeDelay: t = 0,
|
|
182
|
+
...r
|
|
183
|
+
}) => /* @__PURE__ */ i(T, { closeDelay: t, openDelay: e, ...r }), Q = (e) => /* @__PURE__ */ i(P, { ...e }), U = ({
|
|
184
|
+
align: e = "start",
|
|
185
|
+
className: t,
|
|
186
|
+
...r
|
|
187
|
+
}) => /* @__PURE__ */ i(
|
|
188
|
+
H,
|
|
189
|
+
{
|
|
190
|
+
align: e,
|
|
191
|
+
className: s("w-auto p-2", t),
|
|
192
|
+
...r
|
|
193
|
+
}
|
|
194
|
+
), Y = ({
|
|
195
|
+
className: e,
|
|
196
|
+
children: t,
|
|
197
|
+
...r
|
|
198
|
+
}) => /* @__PURE__ */ i(
|
|
199
|
+
"div",
|
|
200
|
+
{
|
|
201
|
+
className: s(
|
|
202
|
+
"flex items-center justify-center p-4 text-muted-foreground text-sm",
|
|
203
|
+
e
|
|
204
|
+
),
|
|
205
|
+
...r,
|
|
206
|
+
children: t ?? "No attachments"
|
|
207
|
+
}
|
|
208
|
+
);
|
|
209
|
+
export {
|
|
210
|
+
q as Attachment,
|
|
211
|
+
Y as AttachmentEmpty,
|
|
212
|
+
O as AttachmentHoverCard,
|
|
213
|
+
U as AttachmentHoverCardContent,
|
|
214
|
+
Q as AttachmentHoverCardTrigger,
|
|
215
|
+
J as AttachmentInfo,
|
|
216
|
+
D as AttachmentPreview,
|
|
217
|
+
K as AttachmentRemove,
|
|
218
|
+
X as Attachments,
|
|
219
|
+
M as getAttachmentLabel,
|
|
220
|
+
f as getMediaCategory,
|
|
221
|
+
u as useAttachmentContext,
|
|
222
|
+
E as useAttachmentsContext
|
|
223
|
+
};
|
|
224
|
+
//# sourceMappingURL=attachments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachments.js","sources":["../../src/components/ai/attachments.tsx"],"sourcesContent":["import {\n FileTextIcon,\n GlobeIcon,\n ImageIcon,\n Music2Icon,\n PaperclipIcon,\n VideoIcon,\n XIcon,\n} from \"lucide-react\";\nimport { createContext, useCallback, useContext, useMemo } from \"react\";\n\nimport type { FileUIPart, SourceDocumentUIPart } from \"ai\";\nimport type { ComponentProps, HTMLAttributes, ReactNode } from \"react\";\n\nimport { Button } from \"@/components/ui/button\";\nimport {\n HoverCard,\n HoverCardContent,\n HoverCardTrigger,\n} from \"@/components/ui/hover-card\";\nimport { cn } from \"@/lib/utils\";\n\n\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport type AttachmentData =\n | (FileUIPart & { id: string })\n | (SourceDocumentUIPart & { id: string });\n\nexport type AttachmentMediaCategory =\n | \"image\"\n | \"video\"\n | \"audio\"\n | \"document\"\n | \"source\"\n | \"unknown\";\n\nexport type AttachmentVariant = \"grid\" | \"inline\" | \"list\";\n\nconst mediaCategoryIcons: Record<AttachmentMediaCategory, typeof ImageIcon> = {\n audio: Music2Icon,\n document: FileTextIcon,\n image: ImageIcon,\n source: GlobeIcon,\n unknown: PaperclipIcon,\n video: VideoIcon,\n};\n\n// ============================================================================\n// Utility Functions\n// ============================================================================\n\nexport const getMediaCategory = (\n data: AttachmentData\n): AttachmentMediaCategory => {\n if (data.type === \"source-document\") {\n return \"source\";\n }\n\n const mediaType = data.mediaType ?? \"\";\n\n if (mediaType.startsWith(\"image/\")) {\n return \"image\";\n }\n if (mediaType.startsWith(\"video/\")) {\n return \"video\";\n }\n if (mediaType.startsWith(\"audio/\")) {\n return \"audio\";\n }\n if (mediaType.startsWith(\"application/\") || mediaType.startsWith(\"text/\")) {\n return \"document\";\n }\n\n return \"unknown\";\n};\n\nexport const getAttachmentLabel = (data: AttachmentData): string => {\n if (data.type === \"source-document\") {\n return data.title || data.filename || \"Source\";\n }\n\n const category = getMediaCategory(data);\n return data.filename || (category === \"image\" ? \"Image\" : \"Attachment\");\n};\n\nconst renderAttachmentImage = (\n url: string,\n filename: string | undefined,\n isGrid: boolean\n) =>\n isGrid ? (\n <img\n alt={filename || \"Image\"}\n className=\"size-full object-cover\"\n height={96}\n src={url}\n width={96}\n />\n ) : (\n <img\n alt={filename || \"Image\"}\n className=\"size-full rounded object-cover\"\n height={20}\n src={url}\n width={20}\n />\n );\n\n// ============================================================================\n// Contexts\n// ============================================================================\n\ninterface AttachmentsContextValue {\n variant: AttachmentVariant;\n}\n\nconst AttachmentsContext = createContext<AttachmentsContextValue | null>(null);\n\ninterface AttachmentContextValue {\n data: AttachmentData;\n mediaCategory: AttachmentMediaCategory;\n onRemove?: () => void;\n variant: AttachmentVariant;\n}\n\nconst AttachmentContext = createContext<AttachmentContextValue | null>(null);\n\n// ============================================================================\n// Hooks\n// ============================================================================\n\nexport const useAttachmentsContext = () =>\n useContext(AttachmentsContext) ?? { variant: \"grid\" as const };\n\nexport const useAttachmentContext = () => {\n const ctx = useContext(AttachmentContext);\n if (!ctx) {\n throw new Error(\"Attachment components must be used within <Attachment>\");\n }\n return ctx;\n};\n\n// ============================================================================\n// Attachments - Container\n// ============================================================================\n\nexport type AttachmentsProps = HTMLAttributes<HTMLDivElement> & {\n variant?: AttachmentVariant;\n};\n\nexport const Attachments = ({\n variant = \"grid\",\n className,\n children,\n ...props\n}: AttachmentsProps) => {\n const contextValue = useMemo(() => ({ variant }), [variant]);\n\n return (\n <AttachmentsContext.Provider value={contextValue}>\n <div\n className={cn(\n \"flex items-start\",\n variant === \"list\" ? \"flex-col gap-2\" : \"flex-wrap gap-2\",\n variant === \"grid\" && \"ml-auto w-fit\",\n className\n )}\n {...props}\n >\n {children}\n </div>\n </AttachmentsContext.Provider>\n );\n};\n\n// ============================================================================\n// Attachment - Item\n// ============================================================================\n\nexport type AttachmentProps = HTMLAttributes<HTMLDivElement> & {\n data: AttachmentData;\n onRemove?: () => void;\n};\n\nexport const Attachment = ({\n data,\n onRemove,\n className,\n children,\n ...props\n}: AttachmentProps) => {\n const { variant } = useAttachmentsContext();\n const mediaCategory = getMediaCategory(data);\n\n const contextValue = useMemo<AttachmentContextValue>(\n () => ({ data, mediaCategory, onRemove, variant }),\n [data, mediaCategory, onRemove, variant]\n );\n\n return (\n <AttachmentContext.Provider value={contextValue}>\n <div\n className={cn(\n \"group relative\",\n variant === \"grid\" && \"size-24 overflow-hidden rounded-lg\",\n variant === \"inline\" && [\n \"flex h-8 cursor-pointer select-none items-center gap-1.5\",\n \"rounded-md border border-border px-1.5\",\n \"font-medium text-sm transition-all\",\n \"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50\",\n ],\n variant === \"list\" && [\n \"flex w-full items-center gap-3 rounded-lg border p-3\",\n \"hover:bg-accent/50\",\n ],\n className\n )}\n {...props}\n >\n {children}\n </div>\n </AttachmentContext.Provider>\n );\n};\n\n// ============================================================================\n// AttachmentPreview - Media preview\n// ============================================================================\n\nexport type AttachmentPreviewProps = HTMLAttributes<HTMLDivElement> & {\n fallbackIcon?: ReactNode;\n};\n\nexport const AttachmentPreview = ({\n fallbackIcon,\n className,\n ...props\n}: AttachmentPreviewProps) => {\n const { data, mediaCategory, variant } = useAttachmentContext();\n\n const iconSize = variant === \"inline\" ? \"size-3\" : \"size-4\";\n\n const renderIcon = (Icon: typeof ImageIcon) => (\n <Icon className={cn(iconSize, \"text-muted-foreground\")} />\n );\n\n const renderContent = () => {\n if (mediaCategory === \"image\" && data.type === \"file\" && data.url) {\n return renderAttachmentImage(data.url, data.filename, variant === \"grid\");\n }\n\n if (mediaCategory === \"video\" && data.type === \"file\" && data.url) {\n return <video className=\"size-full object-cover\" muted src={data.url} />;\n }\n\n const Icon = mediaCategoryIcons[mediaCategory];\n return fallbackIcon ?? renderIcon(Icon);\n };\n\n return (\n <div\n className={cn(\n \"flex shrink-0 items-center justify-center overflow-hidden\",\n variant === \"grid\" && \"size-full bg-muted\",\n variant === \"inline\" && \"size-5 rounded bg-background\",\n variant === \"list\" && \"size-12 rounded bg-muted\",\n className\n )}\n {...props}\n >\n {renderContent()}\n </div>\n );\n};\n\n// ============================================================================\n// AttachmentInfo - Name and type display\n// ============================================================================\n\nexport type AttachmentInfoProps = HTMLAttributes<HTMLDivElement> & {\n showMediaType?: boolean;\n};\n\nexport const AttachmentInfo = ({\n showMediaType = false,\n className,\n ...props\n}: AttachmentInfoProps) => {\n const { data, variant } = useAttachmentContext();\n const label = getAttachmentLabel(data);\n\n if (variant === \"grid\") {\n return null;\n }\n\n return (\n <div className={cn(\"min-w-0 flex-1\", className)} {...props}>\n <span className=\"block truncate\">{label}</span>\n {showMediaType && data.mediaType && (\n <span className=\"block truncate text-muted-foreground text-xs\">\n {data.mediaType}\n </span>\n )}\n </div>\n );\n};\n\n// ============================================================================\n// AttachmentRemove - Remove button\n// ============================================================================\n\nexport type AttachmentRemoveProps = ComponentProps<typeof Button> & {\n label?: string;\n};\n\nexport const AttachmentRemove = ({\n label = \"Remove\",\n className,\n children,\n ...props\n}: AttachmentRemoveProps) => {\n const { onRemove, variant } = useAttachmentContext();\n\n const handleClick = useCallback(\n (e: React.MouseEvent) => {\n e.stopPropagation();\n onRemove?.();\n },\n [onRemove]\n );\n\n if (!onRemove) {\n return null;\n }\n\n return (\n <Button\n aria-label={label}\n className={cn(\n variant === \"grid\" && [\n \"absolute top-2 right-2 size-6 rounded-full p-0\",\n \"bg-background/80 backdrop-blur-sm\",\n \"opacity-0 transition-opacity group-hover:opacity-100\",\n \"hover:bg-background\",\n \"[&>svg]:size-3\",\n ],\n variant === \"inline\" && [\n \"size-5 rounded p-0\",\n \"opacity-0 transition-opacity group-hover:opacity-100\",\n \"[&>svg]:size-2.5\",\n ],\n variant === \"list\" && [\"size-8 shrink-0 rounded p-0\", \"[&>svg]:size-4\"],\n className\n )}\n onClick={handleClick}\n type=\"button\"\n variant=\"ghost\"\n {...props}\n >\n {children ?? <XIcon />}\n <span className=\"sr-only\">{label}</span>\n </Button>\n );\n};\n\n// ============================================================================\n// AttachmentHoverCard - Hover preview\n// ============================================================================\n\nexport type AttachmentHoverCardProps = ComponentProps<typeof HoverCard>;\n\nexport const AttachmentHoverCard = ({\n openDelay = 0,\n closeDelay = 0,\n ...props\n}: AttachmentHoverCardProps) => (\n <HoverCard closeDelay={closeDelay} openDelay={openDelay} {...props} />\n);\n\nexport type AttachmentHoverCardTriggerProps = ComponentProps<\n typeof HoverCardTrigger\n>;\n\nexport const AttachmentHoverCardTrigger = (\n props: AttachmentHoverCardTriggerProps\n) => <HoverCardTrigger {...props} />;\n\nexport type AttachmentHoverCardContentProps = ComponentProps<\n typeof HoverCardContent\n>;\n\nexport const AttachmentHoverCardContent = ({\n align = \"start\",\n className,\n ...props\n}: AttachmentHoverCardContentProps) => (\n <HoverCardContent\n align={align}\n className={cn(\"w-auto p-2\", className)}\n {...props}\n />\n);\n\n// ============================================================================\n// AttachmentEmpty - Empty state\n// ============================================================================\n\nexport type AttachmentEmptyProps = HTMLAttributes<HTMLDivElement>;\n\nexport const AttachmentEmpty = ({\n className,\n children,\n ...props\n}: AttachmentEmptyProps) => (\n <div\n className={cn(\n \"flex items-center justify-center p-4 text-muted-foreground text-sm\",\n className\n )}\n {...props}\n >\n {children ?? \"No attachments\"}\n </div>\n);\n"],"names":["mediaCategoryIcons","Music2Icon","FileTextIcon","ImageIcon","GlobeIcon","PaperclipIcon","VideoIcon","getMediaCategory","data","mediaType","getAttachmentLabel","category","renderAttachmentImage","url","filename","isGrid","jsx","AttachmentsContext","createContext","AttachmentContext","useAttachmentsContext","useContext","useAttachmentContext","ctx","Attachments","variant","className","children","props","contextValue","useMemo","cn","Attachment","onRemove","mediaCategory","AttachmentPreview","fallbackIcon","iconSize","renderIcon","Icon","renderContent","AttachmentInfo","showMediaType","label","jsxs","AttachmentRemove","handleClick","useCallback","e","Button","XIcon","AttachmentHoverCard","openDelay","closeDelay","HoverCard","AttachmentHoverCardTrigger","HoverCardTrigger","AttachmentHoverCardContent","align","HoverCardContent","AttachmentEmpty"],"mappings":";;;;;;AA0CA,MAAMA,IAAwE;AAAA,EAC5E,OAAOC;AAAA,EACP,UAAUC;AAAA,EACV,OAAOC;AAAA,EACP,QAAQC;AAAA,EACR,SAASC;AAAA,EACT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AAA,IACA,WAAW3B,EAAG,cAAcL,CAAS;AAAA,IACpC,GAAGE;AAAA,EAAA;AACN,GASWgC,IAAkB,CAAC;AAAA,EAC9B,WAAAlC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,MACE,gBAAAZ;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAWe;AAAA,MACT;AAAA,MACAL;AAAA,IAAA;AAAA,IAED,GAAGE;AAAA,IAEH,UAAAD,KAAY;AAAA,EAAA;AACf;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("lucide-react"),l=require("../ui/collapsible.cjs"),s=require("../lib/utils.cjs"),h=({className:t,defaultOpen:a=!0,...o})=>e.jsx(l.Collapsible,{className:s.cn("overflow-hidden rounded-lg text-sm",t),defaultOpen:a,...o}),u=({className:t,children:a,title:o="Chain of Thought",icon:r,isStreaming:n=!1,...p})=>e.jsx(l.CollapsibleTrigger,{className:s.cn("group flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground",t),...p,children:a??e.jsxs(e.Fragment,{children:[r??e.jsx(i.Brain,{className:"size-4 text-muted-foreground"}),e.jsxs("span",{className:"flex-1 text-left items-center gap-2",children:[o,n&&e.jsx("span",{className:"size-1.5 animate-pulse rounded-full bg-primary"})]}),e.jsx(i.ChevronUpIcon,{className:"size-4 text-muted-foreground opacity-0 transition-all group-focus-visible:opacity-100 group-hover:opacity-100 group-data-[state=open]:opacity-100 group-data-[state=closed]:rotate-180","data-slot":"collapsible-chevron"})]})}),c=({className:t,...a})=>e.jsx(l.CollapsibleContent,{className:s.cn("flex flex-col gap-2.5 pb-4 pt-3","data-[state=closed]:animate-out data-[state=open]:animate-in","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:slide-out-to-top-1 data-[state=open]:slide-in-from-top-1",t),...a}),x={bullet:e.jsx("span",{className:"mt-[7px] ml-1 size-1.5 shrink-0 rounded-full bg-muted-foreground/50"}),search:e.jsx(i.SearchIcon,{className:"mt-0.5 w-[18px] size-3.5 shrink-0 text-muted-foreground"}),image:e.jsx(i.ImageIcon,{className:"mt-0.5 size-3.5 shrink-0 text-muted-foreground"})},d=({variant:t="bullet",className:a,children:o,...r})=>{const n=typeof t=="string"?x[t]:t;return e.jsxs("div",{className:s.cn("flex items-start gap-2 text-muted-foreground",a),...r,children:[e.jsx("span",{className:"flex shrink-0",children:n}),e.jsx("span",{className:"min-w-0 flex-1 leading-relaxed",children:o})]})},g=({className:t,...a})=>e.jsx("div",{className:s.cn("ml-[6px] flex flex-wrap gap-1.5 border-l-2 border-muted-foreground/20 py-0.5 pl-3",t),...a}),m=({className:t,children:a,...o})=>e.jsx("a",{className:s.cn("inline-flex items-center rounded-full border border-border/60 bg-muted/50 px-2 py-0.5 text-xs text-muted-foreground transition-colors",o.href&&"cursor-pointer hover:bg-accent hover:text-accent-foreground",t),rel:"noreferrer",target:"_blank",...o,children:a}),f=({src:t,alt:a="",caption:o,className:r,...n})=>e.jsxs("figure",{className:s.cn("ml-[22px] overflow-hidden rounded-lg border",r),...n,children:[e.jsx("img",{alt:a,className:"max-h-64 w-full object-cover",src:t}),o&&e.jsx("figcaption",{className:"border-t px-3 py-2 text-xs italic text-muted-foreground",children:o})]});h.displayName="ChainOfThought";u.displayName="ChainOfThoughtTrigger";c.displayName="ChainOfThoughtContent";d.displayName="ChainOfThoughtStep";g.displayName="ChainOfThoughtSources";m.displayName="ChainOfThoughtSource";f.displayName="ChainOfThoughtImage";exports.ChainOfThought=h;exports.ChainOfThoughtContent=c;exports.ChainOfThoughtImage=f;exports.ChainOfThoughtSource=m;exports.ChainOfThoughtSources=g;exports.ChainOfThoughtStep=d;exports.ChainOfThoughtTrigger=u;
|
|
2
|
+
//# sourceMappingURL=chain-of-thought.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chain-of-thought.cjs","sources":["../../src/components/ai/chain-of-thought.tsx"],"sourcesContent":["import { Brain, ChevronUpIcon, ImageIcon, SearchIcon } from \"lucide-react\";\n\nimport type { ComponentProps, ReactNode } from \"react\";\n\nimport {\n Collapsible,\n CollapsibleContent,\n CollapsibleTrigger,\n} from \"@/components/ui/collapsible\";\nimport { cn } from \"@/lib/utils\";\n\n// ---------------------------------------------------------------------------\n// ChainOfThought (root)\n// ---------------------------------------------------------------------------\n\nexport type ChainOfThoughtProps = ComponentProps<typeof Collapsible>;\n\nexport const ChainOfThought = ({\n className,\n defaultOpen = true,\n ...props\n}: ChainOfThoughtProps) => (\n <Collapsible\n className={cn(\"overflow-hidden rounded-lg text-sm\", className)}\n defaultOpen={defaultOpen}\n {...props}\n />\n);\n\n// ---------------------------------------------------------------------------\n// ChainOfThoughtTrigger\n// ---------------------------------------------------------------------------\n\nexport type ChainOfThoughtTriggerProps = ComponentProps<typeof CollapsibleTrigger> & {\n title?: string;\n icon?: ReactNode;\n /** When true, renders a subtle animated dot next to the title. */\n isStreaming?: boolean;\n};\n\nexport const ChainOfThoughtTrigger = ({\n className,\n children,\n title = \"Chain of Thought\",\n icon,\n isStreaming = false,\n ...props\n}: ChainOfThoughtTriggerProps) => (\n <CollapsibleTrigger\n className={cn(\n \"group flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground\",\n className\n )}\n {...props}\n >\n {children ?? (\n <>\n {icon ?? <Brain className=\"size-4 text-muted-foreground\" />}\n <span className=\"flex-1 text-left items-center gap-2\">\n {title}\n {isStreaming && (\n <span className=\"size-1.5 animate-pulse rounded-full bg-primary\" />\n )}\n </span>\n <ChevronUpIcon\n className=\"size-4 text-muted-foreground opacity-0 transition-all group-focus-visible:opacity-100 group-hover:opacity-100 group-data-[state=open]:opacity-100 group-data-[state=closed]:rotate-180\"\n data-slot=\"collapsible-chevron\"\n />\n </>\n )}\n </CollapsibleTrigger>\n);\n\n// ---------------------------------------------------------------------------\n// ChainOfThoughtContent\n// ---------------------------------------------------------------------------\n\nexport type ChainOfThoughtContentProps = ComponentProps<typeof CollapsibleContent>;\n\nexport const ChainOfThoughtContent = ({\n className,\n ...props\n}: ChainOfThoughtContentProps) => (\n <CollapsibleContent\n className={cn(\n \"flex flex-col gap-2.5 pb-4 pt-3\",\n \"data-[state=closed]:animate-out data-[state=open]:animate-in\",\n \"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n \"data-[state=closed]:slide-out-to-top-1 data-[state=open]:slide-in-from-top-1\",\n className\n )}\n {...props}\n />\n);\n\n// ---------------------------------------------------------------------------\n// ChainOfThoughtStep\n// ---------------------------------------------------------------------------\n\nexport type ChainOfThoughtStepVariant = \"bullet\" | \"search\" | \"image\";\n\nexport type ChainOfThoughtStepProps = ComponentProps<\"div\"> & {\n /**\n * Visual prefix for the step.\n * - `\"bullet\"` — small dot (default, plain reasoning text)\n * - `\"search\"` — magnifying-glass (web search / tool call)\n * - `\"image\"` — image icon (image fetch / vision step)\n * - ReactNode — custom icon\n */\n variant?: ChainOfThoughtStepVariant | ReactNode;\n};\n\nconst STEP_ICONS: Record<ChainOfThoughtStepVariant, ReactNode> = {\n bullet: (\n <span className=\"mt-[7px] ml-1 size-1.5 shrink-0 rounded-full bg-muted-foreground/50\" />\n ),\n search: <SearchIcon className=\"mt-0.5 w-[18px] size-3.5 shrink-0 text-muted-foreground\" />,\n image: <ImageIcon className=\"mt-0.5 size-3.5 shrink-0 text-muted-foreground\" />,\n};\n\nexport const ChainOfThoughtStep = ({\n variant = \"bullet\",\n className,\n children,\n ...props\n}: ChainOfThoughtStepProps) => {\n const icon =\n typeof variant === \"string\"\n ? STEP_ICONS[variant as ChainOfThoughtStepVariant]\n : variant;\n\n return (\n <div\n className={cn(\"flex items-start gap-2 text-muted-foreground\", className)}\n {...props}\n >\n <span className=\"flex shrink-0\">{icon}</span>\n <span className=\"min-w-0 flex-1 leading-relaxed\">{children}</span>\n </div>\n );\n};\n\n// ---------------------------------------------------------------------------\n// ChainOfThoughtSources — inline chip group with left bar\n// ---------------------------------------------------------------------------\n\nexport type ChainOfThoughtSourcesProps = ComponentProps<\"div\">;\n\nexport const ChainOfThoughtSources = ({\n className,\n ...props\n}: ChainOfThoughtSourcesProps) => (\n <div\n className={cn(\n \"ml-[6px] flex flex-wrap gap-1.5 border-l-2 border-muted-foreground/20 py-0.5 pl-3\",\n className\n )}\n {...props}\n />\n);\n\nexport type ChainOfThoughtSourceProps = ComponentProps<\"a\">;\n\nexport const ChainOfThoughtSource = ({\n className,\n children,\n ...props\n}: ChainOfThoughtSourceProps) => (\n <a\n className={cn(\n \"inline-flex items-center rounded-full border border-border/60 bg-muted/50 px-2 py-0.5 text-xs text-muted-foreground transition-colors\",\n props.href && \"cursor-pointer hover:bg-accent hover:text-accent-foreground\",\n className\n )}\n rel=\"noreferrer\"\n target=\"_blank\"\n {...props}\n >\n {children}\n </a>\n);\n\n// ---------------------------------------------------------------------------\n// ChainOfThoughtImage — inline image with optional caption\n// ---------------------------------------------------------------------------\n\nexport type ChainOfThoughtImageProps = ComponentProps<\"figure\"> & {\n src: string;\n alt?: string;\n caption?: string;\n};\n\nexport const ChainOfThoughtImage = ({\n src,\n alt = \"\",\n caption,\n className,\n ...props\n}: ChainOfThoughtImageProps) => (\n <figure\n className={cn(\"ml-[22px] overflow-hidden rounded-lg border\", className)}\n {...props}\n >\n <img alt={alt} className=\"max-h-64 w-full object-cover\" src={src} />\n {caption && (\n <figcaption className=\"border-t px-3 py-2 text-xs italic text-muted-foreground\">\n {caption}\n </figcaption>\n )}\n </figure>\n);\n\nChainOfThought.displayName = \"ChainOfThought\";\nChainOfThoughtTrigger.displayName = \"ChainOfThoughtTrigger\";\nChainOfThoughtContent.displayName = \"ChainOfThoughtContent\";\nChainOfThoughtStep.displayName = \"ChainOfThoughtStep\";\nChainOfThoughtSources.displayName = \"ChainOfThoughtSources\";\nChainOfThoughtSource.displayName = \"ChainOfThoughtSource\";\nChainOfThoughtImage.displayName = \"ChainOfThoughtImage\";\n"],"names":["ChainOfThought","className","defaultOpen","props","jsx","Collapsible","cn","ChainOfThoughtTrigger","children","title","icon","isStreaming","CollapsibleTrigger","jsxs","Fragment","Brain","ChevronUpIcon","ChainOfThoughtContent","CollapsibleContent","STEP_ICONS","SearchIcon","ImageIcon","ChainOfThoughtStep","variant","ChainOfThoughtSources","ChainOfThoughtSource","ChainOfThoughtImage","src","alt","caption"],"mappings":"gNAiBaA,EAAiB,CAAC,CAC7B,UAAAC,EACA,YAAAC,EAAc,GACd,GAAGC,CACL,IACEC,EAAAA,IAACC,EAAAA,YAAA,CACC,UAAWC,EAAAA,GAAG,qCAAsCL,CAAS,EAC7D,YAAAC,EACC,GAAGC,CAAA,CACN,EAcWI,EAAwB,CAAC,CACpC,UAAAN,EACA,SAAAO,EACA,MAAAC,EAAQ,mBACR,KAAAC,EACA,YAAAC,EAAc,GACd,GAAGR,CACL,IACEC,EAAAA,IAACQ,EAAAA,mBAAA,CACC,UAAWN,EAAAA,GACT,6GACAL,CAAA,EAED,GAAGE,EAEH,YACCU,EAAAA,KAAAC,EAAAA,SAAA,CACG,SAAA,CAAAJ,GAAQN,EAAAA,IAACW,EAAAA,MAAA,CAAM,UAAU,8BAAA,CAA+B,EACzDF,EAAAA,KAAC,OAAA,CAAK,UAAU,sCACb,SAAA,CAAAJ,EACAE,GACCP,EAAAA,IAAC,OAAA,CAAK,UAAU,gDAAA,CAAiD,CAAA,EAErE,EACAA,EAAAA,IAACY,EAAAA,cAAA,CACC,UAAU,yLACV,YAAU,qBAAA,CAAA,CACZ,CAAA,CACF,CAAA,CAEJ,EASWC,EAAwB,CAAC,CACpC,UAAAhB,EACA,GAAGE,CACL,IACEC,EAAAA,IAACc,EAAAA,mBAAA,CACC,UAAWZ,EAAAA,GACT,kCACA,+DACA,6DACA,+EACAL,CAAA,EAED,GAAGE,CAAA,CACN,EAoBIgB,EAA2D,CAC/D,OACEf,EAAAA,IAAC,OAAA,CAAK,UAAU,qEAAA,CAAsE,EAExF,OAAQA,EAAAA,I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EAAe,YAAc,iBAC7BO,EAAsB,YAAc,wBACpCU,EAAsB,YAAc,wBACpCK,EAAmB,YAAc,qBACjCE,EAAsB,YAAc,wBACpCC,EAAqB,YAAc,uBACnCC,EAAoB,YAAc"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { jsx as t, jsxs as l, Fragment as d } from "react/jsx-runtime";
|
|
2
|
+
import { Brain as c, ChevronUpIcon as m, ImageIcon as h, SearchIcon as u } from "lucide-react";
|
|
3
|
+
import { Collapsible as g, CollapsibleContent as f, CollapsibleTrigger as p } from "../ui/collapsible.js";
|
|
4
|
+
import { cn as r } from "../lib/utils.js";
|
|
5
|
+
const x = ({
|
|
6
|
+
className: e,
|
|
7
|
+
defaultOpen: a = !0,
|
|
8
|
+
...o
|
|
9
|
+
}) => /* @__PURE__ */ t(
|
|
10
|
+
g,
|
|
11
|
+
{
|
|
12
|
+
className: r("overflow-hidden rounded-lg text-sm", e),
|
|
13
|
+
defaultOpen: a,
|
|
14
|
+
...o
|
|
15
|
+
}
|
|
16
|
+
), N = ({
|
|
17
|
+
className: e,
|
|
18
|
+
children: a,
|
|
19
|
+
title: o = "Chain of Thought",
|
|
20
|
+
icon: s,
|
|
21
|
+
isStreaming: n = !1,
|
|
22
|
+
...i
|
|
23
|
+
}) => /* @__PURE__ */ t(
|
|
24
|
+
p,
|
|
25
|
+
{
|
|
26
|
+
className: r(
|
|
27
|
+
"group flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground",
|
|
28
|
+
e
|
|
29
|
+
),
|
|
30
|
+
...i,
|
|
31
|
+
children: a ?? /* @__PURE__ */ l(d, { children: [
|
|
32
|
+
s ?? /* @__PURE__ */ t(c, { className: "size-4 text-muted-foreground" }),
|
|
33
|
+
/* @__PURE__ */ l("span", { className: "flex-1 text-left items-center gap-2", children: [
|
|
34
|
+
o,
|
|
35
|
+
n && /* @__PURE__ */ t("span", { className: "size-1.5 animate-pulse rounded-full bg-primary" })
|
|
36
|
+
] }),
|
|
37
|
+
/* @__PURE__ */ t(
|
|
38
|
+
m,
|
|
39
|
+
{
|
|
40
|
+
className: "size-4 text-muted-foreground opacity-0 transition-all group-focus-visible:opacity-100 group-hover:opacity-100 group-data-[state=open]:opacity-100 group-data-[state=closed]:rotate-180",
|
|
41
|
+
"data-slot": "collapsible-chevron"
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
] })
|
|
45
|
+
}
|
|
46
|
+
), C = ({
|
|
47
|
+
className: e,
|
|
48
|
+
...a
|
|
49
|
+
}) => /* @__PURE__ */ t(
|
|
50
|
+
f,
|
|
51
|
+
{
|
|
52
|
+
className: r(
|
|
53
|
+
"flex flex-col gap-2.5 pb-4 pt-3",
|
|
54
|
+
"data-[state=closed]:animate-out data-[state=open]:animate-in",
|
|
55
|
+
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
56
|
+
"data-[state=closed]:slide-out-to-top-1 data-[state=open]:slide-in-from-top-1",
|
|
57
|
+
e
|
|
58
|
+
),
|
|
59
|
+
...a
|
|
60
|
+
}
|
|
61
|
+
), b = {
|
|
62
|
+
bullet: /* @__PURE__ */ t("span", { className: "mt-[7px] ml-1 size-1.5 shrink-0 rounded-full bg-muted-foreground/50" }),
|
|
63
|
+
search: /* @__PURE__ */ t(u, { className: "mt-0.5 w-[18px] size-3.5 shrink-0 text-muted-foreground" }),
|
|
64
|
+
image: /* @__PURE__ */ t(h, { className: "mt-0.5 size-3.5 shrink-0 text-muted-foreground" })
|
|
65
|
+
}, T = ({
|
|
66
|
+
variant: e = "bullet",
|
|
67
|
+
className: a,
|
|
68
|
+
children: o,
|
|
69
|
+
...s
|
|
70
|
+
}) => {
|
|
71
|
+
const n = typeof e == "string" ? b[e] : e;
|
|
72
|
+
return /* @__PURE__ */ l(
|
|
73
|
+
"div",
|
|
74
|
+
{
|
|
75
|
+
className: r("flex items-start gap-2 text-muted-foreground", a),
|
|
76
|
+
...s,
|
|
77
|
+
children: [
|
|
78
|
+
/* @__PURE__ */ t("span", { className: "flex shrink-0", children: n }),
|
|
79
|
+
/* @__PURE__ */ t("span", { className: "min-w-0 flex-1 leading-relaxed", children: o })
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
}, y = ({
|
|
84
|
+
className: e,
|
|
85
|
+
...a
|
|
86
|
+
}) => /* @__PURE__ */ t(
|
|
87
|
+
"div",
|
|
88
|
+
{
|
|
89
|
+
className: r(
|
|
90
|
+
"ml-[6px] flex flex-wrap gap-1.5 border-l-2 border-muted-foreground/20 py-0.5 pl-3",
|
|
91
|
+
e
|
|
92
|
+
),
|
|
93
|
+
...a
|
|
94
|
+
}
|
|
95
|
+
), O = ({
|
|
96
|
+
className: e,
|
|
97
|
+
children: a,
|
|
98
|
+
...o
|
|
99
|
+
}) => /* @__PURE__ */ t(
|
|
100
|
+
"a",
|
|
101
|
+
{
|
|
102
|
+
className: r(
|
|
103
|
+
"inline-flex items-center rounded-full border border-border/60 bg-muted/50 px-2 py-0.5 text-xs text-muted-foreground transition-colors",
|
|
104
|
+
o.href && "cursor-pointer hover:bg-accent hover:text-accent-foreground",
|
|
105
|
+
e
|
|
106
|
+
),
|
|
107
|
+
rel: "noreferrer",
|
|
108
|
+
target: "_blank",
|
|
109
|
+
...o,
|
|
110
|
+
children: a
|
|
111
|
+
}
|
|
112
|
+
), v = ({
|
|
113
|
+
src: e,
|
|
114
|
+
alt: a = "",
|
|
115
|
+
caption: o,
|
|
116
|
+
className: s,
|
|
117
|
+
...n
|
|
118
|
+
}) => /* @__PURE__ */ l(
|
|
119
|
+
"figure",
|
|
120
|
+
{
|
|
121
|
+
className: r("ml-[22px] overflow-hidden rounded-lg border", s),
|
|
122
|
+
...n,
|
|
123
|
+
children: [
|
|
124
|
+
/* @__PURE__ */ t("img", { alt: a, className: "max-h-64 w-full object-cover", src: e }),
|
|
125
|
+
o && /* @__PURE__ */ t("figcaption", { className: "border-t px-3 py-2 text-xs italic text-muted-foreground", children: o })
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
);
|
|
129
|
+
x.displayName = "ChainOfThought";
|
|
130
|
+
N.displayName = "ChainOfThoughtTrigger";
|
|
131
|
+
C.displayName = "ChainOfThoughtContent";
|
|
132
|
+
T.displayName = "ChainOfThoughtStep";
|
|
133
|
+
y.displayName = "ChainOfThoughtSources";
|
|
134
|
+
O.displayName = "ChainOfThoughtSource";
|
|
135
|
+
v.displayName = "ChainOfThoughtImage";
|
|
136
|
+
export {
|
|
137
|
+
x as ChainOfThought,
|
|
138
|
+
C as ChainOfThoughtContent,
|
|
139
|
+
v as ChainOfThoughtImage,
|
|
140
|
+
O as ChainOfThoughtSource,
|
|
141
|
+
y as ChainOfThoughtSources,
|
|
142
|
+
T as ChainOfThoughtStep,
|
|
143
|
+
N as ChainOfThoughtTrigger
|
|
144
|
+
};
|
|
145
|
+
//# sourceMappingURL=chain-of-thought.js.map
|