@astryxdesign/lab 0.0.0-bootstrap.0 → 0.1.2-canary.04e71b2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +67 -0
- package/LICENSE +21 -0
- package/README.md +47 -1
- package/dist/Chart/Chart.d.ts +77 -0
- package/dist/Chart/Chart.d.ts.map +1 -0
- package/dist/Chart/Chart.js +247 -0
- package/dist/Chart/ChartArea.d.ts +28 -0
- package/dist/Chart/ChartArea.d.ts.map +1 -0
- package/dist/Chart/ChartArea.js +71 -0
- package/dist/Chart/ChartAxis.d.ts +27 -0
- package/dist/Chart/ChartAxis.d.ts.map +1 -0
- package/dist/Chart/ChartAxis.js +147 -0
- package/dist/Chart/ChartBar.d.ts +19 -0
- package/dist/Chart/ChartBar.d.ts.map +1 -0
- package/dist/Chart/ChartBar.js +61 -0
- package/dist/Chart/ChartBrush.d.ts +59 -0
- package/dist/Chart/ChartBrush.d.ts.map +1 -0
- package/dist/Chart/ChartBrush.js +197 -0
- package/dist/Chart/ChartCandlestick.d.ts +50 -0
- package/dist/Chart/ChartCandlestick.d.ts.map +1 -0
- package/dist/Chart/ChartCandlestick.js +138 -0
- package/dist/Chart/ChartContext.d.ts +5 -0
- package/dist/Chart/ChartContext.d.ts.map +1 -0
- package/dist/Chart/ChartContext.js +20 -0
- package/dist/Chart/ChartDot.d.ts +18 -0
- package/dist/Chart/ChartDot.d.ts.map +1 -0
- package/dist/Chart/ChartDot.js +43 -0
- package/dist/Chart/ChartDotGL.d.ts +16 -0
- package/dist/Chart/ChartDotGL.d.ts.map +1 -0
- package/dist/Chart/ChartDotGL.js +135 -0
- package/dist/Chart/ChartDotGLInteractive.d.ts +41 -0
- package/dist/Chart/ChartDotGLInteractive.d.ts.map +1 -0
- package/dist/Chart/ChartDotGLInteractive.js +446 -0
- package/dist/Chart/ChartErrorBar.d.ts +23 -0
- package/dist/Chart/ChartErrorBar.d.ts.map +1 -0
- package/dist/Chart/ChartErrorBar.js +68 -0
- package/dist/Chart/ChartGrid.d.ts +17 -0
- package/dist/Chart/ChartGrid.d.ts.map +1 -0
- package/dist/Chart/ChartGrid.js +67 -0
- package/dist/Chart/ChartHeatmapGL.d.ts +10 -0
- package/dist/Chart/ChartHeatmapGL.d.ts.map +1 -0
- package/dist/Chart/ChartHeatmapGL.js +171 -0
- package/dist/Chart/ChartLegend.d.ts +60 -0
- package/dist/Chart/ChartLegend.d.ts.map +1 -0
- package/dist/Chart/ChartLegend.js +161 -0
- package/dist/Chart/ChartLine.d.ts +23 -0
- package/dist/Chart/ChartLine.d.ts.map +1 -0
- package/dist/Chart/ChartLine.js +64 -0
- package/dist/Chart/ChartReferenceLine.d.ts +11 -0
- package/dist/Chart/ChartReferenceLine.d.ts.map +1 -0
- package/dist/Chart/ChartReferenceLine.js +109 -0
- package/dist/Chart/ChartSelect.d.ts +9 -0
- package/dist/Chart/ChartSelect.d.ts.map +1 -0
- package/dist/Chart/ChartSelect.js +90 -0
- package/dist/Chart/ChartStreamGL.d.ts +17 -0
- package/dist/Chart/ChartStreamGL.d.ts.map +1 -0
- package/dist/Chart/ChartStreamGL.js +157 -0
- package/dist/Chart/ChartTooltip.d.ts +85 -0
- package/dist/Chart/ChartTooltip.d.ts.map +1 -0
- package/dist/Chart/ChartTooltip.js +335 -0
- package/dist/Chart/ChartZoom.d.ts +23 -0
- package/dist/Chart/ChartZoom.d.ts.map +1 -0
- package/dist/Chart/ChartZoom.js +314 -0
- package/dist/Chart/formatters.d.ts +33 -0
- package/dist/Chart/formatters.d.ts.map +1 -0
- package/dist/Chart/formatters.js +101 -0
- package/dist/Chart/getChartColors.d.ts +56 -0
- package/dist/Chart/getChartColors.d.ts.map +1 -0
- package/dist/Chart/getChartColors.js +150 -0
- package/dist/Chart/index.d.ts +29 -0
- package/dist/Chart/index.d.ts.map +1 -0
- package/dist/Chart/index.js +29 -0
- package/dist/Chart/m4.d.ts +36 -0
- package/dist/Chart/m4.d.ts.map +1 -0
- package/dist/Chart/m4.js +106 -0
- package/dist/Chart/types.d.ts +55 -0
- package/dist/Chart/types.d.ts.map +1 -0
- package/dist/Chart/types.js +1 -0
- package/dist/Chart/useChartColors.d.ts +16 -0
- package/dist/Chart/useChartColors.d.ts.map +1 -0
- package/dist/Chart/useChartColors.js +30 -0
- package/dist/Chart/useChartRange.d.ts +50 -0
- package/dist/Chart/useChartRange.d.ts.map +1 -0
- package/dist/Chart/useChartRange.js +90 -0
- package/dist/Chart/utils.d.ts +15 -0
- package/dist/Chart/utils.d.ts.map +1 -0
- package/dist/Chart/utils.js +24 -0
- package/dist/Chart/webgl.d.ts +62 -0
- package/dist/Chart/webgl.d.ts.map +1 -0
- package/dist/Chart/webgl.js +169 -0
- package/dist/ChartV2/Chart.d.ts +32 -0
- package/dist/ChartV2/Chart.d.ts.map +1 -0
- package/dist/ChartV2/Chart.js +281 -0
- package/dist/ChartV2/ChartAxis.d.ts +36 -0
- package/dist/ChartV2/ChartAxis.d.ts.map +1 -0
- package/dist/ChartV2/ChartAxis.js +161 -0
- package/dist/ChartV2/ChartGrid.d.ts +20 -0
- package/dist/ChartV2/ChartGrid.d.ts.map +1 -0
- package/dist/ChartV2/ChartGrid.js +76 -0
- package/dist/ChartV2/ChartLegend.d.ts +14 -0
- package/dist/ChartV2/ChartLegend.d.ts.map +1 -0
- package/dist/ChartV2/ChartLegend.js +54 -0
- package/dist/ChartV2/ChartSwatch.d.ts +36 -0
- package/dist/ChartV2/ChartSwatch.d.ts.map +1 -0
- package/dist/ChartV2/ChartSwatch.js +82 -0
- package/dist/ChartV2/ChartTooltip.d.ts +46 -0
- package/dist/ChartV2/ChartTooltip.d.ts.map +1 -0
- package/dist/ChartV2/ChartTooltip.js +267 -0
- package/dist/ChartV2/ChartV2Context.d.ts +4 -0
- package/dist/ChartV2/ChartV2Context.d.ts.map +1 -0
- package/dist/ChartV2/ChartV2Context.js +12 -0
- package/dist/ChartV2/index.d.ts +13 -0
- package/dist/ChartV2/index.d.ts.map +1 -0
- package/dist/ChartV2/index.js +10 -0
- package/dist/ChartV2/layout.d.ts +25 -0
- package/dist/ChartV2/layout.d.ts.map +1 -0
- package/dist/ChartV2/layout.js +195 -0
- package/dist/ChartV2/legend.d.ts +18 -0
- package/dist/ChartV2/legend.d.ts.map +1 -0
- package/dist/ChartV2/legend.js +24 -0
- package/dist/ChartV2/marks/area.d.ts +19 -0
- package/dist/ChartV2/marks/area.d.ts.map +1 -0
- package/dist/ChartV2/marks/area.js +109 -0
- package/dist/ChartV2/marks/band.d.ts +9 -0
- package/dist/ChartV2/marks/band.d.ts.map +1 -0
- package/dist/ChartV2/marks/band.js +59 -0
- package/dist/ChartV2/marks/bar.d.ts +17 -0
- package/dist/ChartV2/marks/bar.d.ts.map +1 -0
- package/dist/ChartV2/marks/bar.js +120 -0
- package/dist/ChartV2/marks/candlestick.d.ts +15 -0
- package/dist/ChartV2/marks/candlestick.d.ts.map +1 -0
- package/dist/ChartV2/marks/candlestick.js +83 -0
- package/dist/ChartV2/marks/dot.d.ts +15 -0
- package/dist/ChartV2/marks/dot.d.ts.map +1 -0
- package/dist/ChartV2/marks/dot.js +65 -0
- package/dist/ChartV2/marks/dotGL.d.ts +16 -0
- package/dist/ChartV2/marks/dotGL.d.ts.map +1 -0
- package/dist/ChartV2/marks/dotGL.js +178 -0
- package/dist/ChartV2/marks/dotGLInteractive.d.ts +30 -0
- package/dist/ChartV2/marks/dotGLInteractive.d.ts.map +1 -0
- package/dist/ChartV2/marks/dotGLInteractive.js +464 -0
- package/dist/ChartV2/marks/errorBar.d.ts +27 -0
- package/dist/ChartV2/marks/errorBar.d.ts.map +1 -0
- package/dist/ChartV2/marks/errorBar.js +87 -0
- package/dist/ChartV2/marks/heatmapGL.d.ts +23 -0
- package/dist/ChartV2/marks/heatmapGL.d.ts.map +1 -0
- package/dist/ChartV2/marks/heatmapGL.js +242 -0
- package/dist/ChartV2/marks/index.d.ts +13 -0
- package/dist/ChartV2/marks/index.d.ts.map +1 -0
- package/dist/ChartV2/marks/index.js +14 -0
- package/dist/ChartV2/marks/line.d.ts +18 -0
- package/dist/ChartV2/marks/line.d.ts.map +1 -0
- package/dist/ChartV2/marks/line.js +76 -0
- package/dist/ChartV2/marks/referenceLine.d.ts +35 -0
- package/dist/ChartV2/marks/referenceLine.d.ts.map +1 -0
- package/dist/ChartV2/marks/referenceLine.js +186 -0
- package/dist/ChartV2/marks/streamGL.d.ts +36 -0
- package/dist/ChartV2/marks/streamGL.d.ts.map +1 -0
- package/dist/ChartV2/marks/streamGL.js +204 -0
- package/dist/ChartV2/tooltip.d.ts +38 -0
- package/dist/ChartV2/tooltip.d.ts.map +1 -0
- package/dist/ChartV2/tooltip.js +54 -0
- package/dist/ChartV2/types.d.ts +115 -0
- package/dist/ChartV2/types.d.ts.map +1 -0
- package/dist/ChartV2/types.js +35 -0
- package/dist/ChatReasoning/ChatReasoning.d.ts +51 -0
- package/dist/ChatReasoning/ChatReasoning.d.ts.map +1 -0
- package/dist/ChatReasoning/ChatReasoning.js +236 -0
- package/dist/CircularProgress/CircularProgress.d.ts +101 -0
- package/dist/CircularProgress/CircularProgress.d.ts.map +1 -0
- package/dist/CircularProgress/CircularProgress.js +263 -0
- package/dist/CircularProgress/index.d.ts +6 -0
- package/dist/CircularProgress/index.d.ts.map +1 -0
- package/dist/CircularProgress/index.js +8 -0
- package/dist/CodeBlock/index.d.ts +8 -0
- package/dist/CodeBlock/index.d.ts.map +1 -0
- package/dist/CodeBlock/index.js +9 -0
- package/dist/CodeEditor/CodeEditor.d.ts +46 -0
- package/dist/CodeEditor/CodeEditor.d.ts.map +1 -0
- package/dist/CodeEditor/CodeEditor.js +396 -0
- package/dist/CodeEditor/index.d.ts +6 -0
- package/dist/CodeEditor/index.d.ts.map +1 -0
- package/dist/CodeEditor/index.js +7 -0
- package/dist/Radial/RadialArea.d.ts +25 -0
- package/dist/Radial/RadialArea.d.ts.map +1 -0
- package/dist/Radial/RadialArea.js +91 -0
- package/dist/Radial/RadialAxis.d.ts +14 -0
- package/dist/Radial/RadialAxis.d.ts.map +1 -0
- package/dist/Radial/RadialAxis.js +55 -0
- package/dist/Radial/RadialChart.d.ts +70 -0
- package/dist/Radial/RadialChart.d.ts.map +1 -0
- package/dist/Radial/RadialChart.js +174 -0
- package/dist/Radial/RadialContext.d.ts +5 -0
- package/dist/Radial/RadialContext.d.ts.map +1 -0
- package/dist/Radial/RadialContext.js +19 -0
- package/dist/Radial/RadialGrid.d.ts +14 -0
- package/dist/Radial/RadialGrid.d.ts.map +1 -0
- package/dist/Radial/RadialGrid.js +70 -0
- package/dist/Radial/RadialSlice.d.ts +23 -0
- package/dist/Radial/RadialSlice.d.ts.map +1 -0
- package/dist/Radial/RadialSlice.js +85 -0
- package/dist/Radial/RadialTooltip.d.ts +44 -0
- package/dist/Radial/RadialTooltip.d.ts.map +1 -0
- package/dist/Radial/RadialTooltip.js +284 -0
- package/dist/Radial/index.d.ts +9 -0
- package/dist/Radial/index.d.ts.map +1 -0
- package/dist/Radial/index.js +9 -0
- package/dist/Radial/types.d.ts +39 -0
- package/dist/Radial/types.d.ts.map +1 -0
- package/dist/Radial/types.js +1 -0
- package/dist/SVGIcon/SVGIcon.d.ts +87 -0
- package/dist/SVGIcon/SVGIcon.d.ts.map +1 -0
- package/dist/SVGIcon/SVGIcon.js +299 -0
- package/dist/SVGIcon/icons.d.ts +49 -0
- package/dist/SVGIcon/icons.d.ts.map +1 -0
- package/dist/SVGIcon/icons.js +326 -0
- package/dist/SVGIcon/index.d.ts +15 -0
- package/dist/SVGIcon/index.d.ts.map +1 -0
- package/dist/SVGIcon/index.js +22 -0
- package/dist/SVGIcon/pathTransforms.d.ts +35 -0
- package/dist/SVGIcon/pathTransforms.d.ts.map +1 -0
- package/dist/SVGIcon/pathTransforms.js +644 -0
- package/dist/SVGIcon/tokens.stylex.d.ts +37 -0
- package/dist/SVGIcon/tokens.stylex.d.ts.map +1 -0
- package/dist/SVGIcon/tokens.stylex.js +40 -0
- package/dist/SVGIcon/variations.stylex.d.ts +44 -0
- package/dist/SVGIcon/variations.stylex.d.ts.map +1 -0
- package/dist/SVGIcon/variations.stylex.js +119 -0
- package/dist/SVGIcon/xif-examples.d.ts +22 -0
- package/dist/SVGIcon/xif-examples.d.ts.map +1 -0
- package/dist/SVGIcon/xif-examples.js +202 -0
- package/dist/SVGIcon/xif-types.d.ts +129 -0
- package/dist/SVGIcon/xif-types.d.ts.map +1 -0
- package/dist/SVGIcon/xif-types.js +1 -0
- package/dist/Sankey/SankeyChart.d.ts +72 -0
- package/dist/Sankey/SankeyChart.d.ts.map +1 -0
- package/dist/Sankey/SankeyChart.js +162 -0
- package/dist/Sankey/SankeyContext.d.ts +5 -0
- package/dist/Sankey/SankeyContext.d.ts.map +1 -0
- package/dist/Sankey/SankeyContext.js +20 -0
- package/dist/Sankey/SankeyGrid.d.ts +20 -0
- package/dist/Sankey/SankeyGrid.d.ts.map +1 -0
- package/dist/Sankey/SankeyGrid.js +53 -0
- package/dist/Sankey/SankeyLabel.d.ts +11 -0
- package/dist/Sankey/SankeyLabel.d.ts.map +1 -0
- package/dist/Sankey/SankeyLabel.js +179 -0
- package/dist/Sankey/SankeyLink.d.ts +29 -0
- package/dist/Sankey/SankeyLink.d.ts.map +1 -0
- package/dist/Sankey/SankeyLink.js +139 -0
- package/dist/Sankey/SankeyNode.d.ts +15 -0
- package/dist/Sankey/SankeyNode.d.ts.map +1 -0
- package/dist/Sankey/SankeyNode.js +56 -0
- package/dist/Sankey/index.d.ts +8 -0
- package/dist/Sankey/index.d.ts.map +1 -0
- package/dist/Sankey/index.js +8 -0
- package/dist/Sankey/layout.d.ts +26 -0
- package/dist/Sankey/layout.d.ts.map +1 -0
- package/dist/Sankey/layout.js +157 -0
- package/dist/Sankey/types.d.ts +84 -0
- package/dist/Sankey/types.d.ts.map +1 -0
- package/dist/Sankey/types.js +1 -0
- package/dist/Schedule/CalendarEvent.d.ts +36 -0
- package/dist/Schedule/CalendarEvent.d.ts.map +1 -0
- package/dist/Schedule/CalendarEvent.js +35 -0
- package/dist/Schedule/DayView.d.ts +8 -0
- package/dist/Schedule/DayView.d.ts.map +1 -0
- package/dist/Schedule/DayView.js +105 -0
- package/dist/Schedule/ListView.d.ts +6 -0
- package/dist/Schedule/ListView.d.ts.map +1 -0
- package/dist/Schedule/ListView.js +171 -0
- package/dist/Schedule/MonthlyView.d.ts +6 -0
- package/dist/Schedule/MonthlyView.d.ts.map +1 -0
- package/dist/Schedule/MonthlyView.js +270 -0
- package/dist/Schedule/Schedule.d.ts +22 -0
- package/dist/Schedule/Schedule.d.ts.map +1 -0
- package/dist/Schedule/Schedule.js +185 -0
- package/dist/Schedule/TimeGridView.d.ts +12 -0
- package/dist/Schedule/TimeGridView.d.ts.map +1 -0
- package/dist/Schedule/TimeGridView.js +364 -0
- package/dist/Schedule/WeeklyView.d.ts +9 -0
- package/dist/Schedule/WeeklyView.d.ts.map +1 -0
- package/dist/Schedule/WeeklyView.js +112 -0
- package/dist/Schedule/context.d.ts +20 -0
- package/dist/Schedule/context.d.ts.map +1 -0
- package/dist/Schedule/context.js +19 -0
- package/dist/Schedule/dateMath.d.ts +21 -0
- package/dist/Schedule/dateMath.d.ts.map +1 -0
- package/dist/Schedule/dateMath.js +63 -0
- package/dist/Schedule/index.d.ts +19 -0
- package/dist/Schedule/index.d.ts.map +1 -0
- package/dist/Schedule/index.js +17 -0
- package/dist/Schedule/plugins/PaginationPlugin.d.ts +7 -0
- package/dist/Schedule/plugins/PaginationPlugin.d.ts.map +1 -0
- package/dist/Schedule/plugins/PaginationPlugin.js +81 -0
- package/dist/Schedule/plugins/ViewSelectorPlugin.d.ts +11 -0
- package/dist/Schedule/plugins/ViewSelectorPlugin.d.ts.map +1 -0
- package/dist/Schedule/plugins/ViewSelectorPlugin.js +78 -0
- package/dist/Schedule/plugins/index.d.ts +5 -0
- package/dist/Schedule/plugins/index.d.ts.map +1 -0
- package/dist/Schedule/plugins/index.js +14 -0
- package/dist/Schedule/shared.d.ts +923 -0
- package/dist/Schedule/shared.d.ts.map +1 -0
- package/dist/Schedule/shared.js +1325 -0
- package/dist/Schedule/types.d.ts +51 -0
- package/dist/Schedule/types.d.ts.map +1 -0
- package/dist/Schedule/types.js +1 -0
- package/dist/Schedule/useCurrentTime.d.ts +3 -0
- package/dist/Schedule/useCurrentTime.d.ts.map +1 -0
- package/dist/Schedule/useCurrentTime.js +43 -0
- package/dist/Schedule/zonedDateTime.d.ts +20 -0
- package/dist/Schedule/zonedDateTime.d.ts.map +1 -0
- package/dist/Schedule/zonedDateTime.js +31 -0
- package/dist/Stepper/Step.d.ts +120 -0
- package/dist/Stepper/Step.d.ts.map +1 -0
- package/dist/Stepper/Step.js +573 -0
- package/dist/Stepper/StepStatus.d.ts +24 -0
- package/dist/Stepper/StepStatus.d.ts.map +1 -0
- package/dist/Stepper/StepStatus.js +1 -0
- package/dist/Stepper/Stepper.d.ts +77 -0
- package/dist/Stepper/Stepper.d.ts.map +1 -0
- package/dist/Stepper/Stepper.js +104 -0
- package/dist/Stepper/StepperContext.d.ts +12 -0
- package/dist/Stepper/StepperContext.d.ts.map +1 -0
- package/dist/Stepper/StepperContext.js +24 -0
- package/dist/Stepper/index.d.ts +8 -0
- package/dist/Stepper/index.d.ts.map +1 -0
- package/dist/Stepper/index.js +7 -0
- package/dist/ThreeD/ThreeDAxis.d.ts +6 -0
- package/dist/ThreeD/ThreeDAxis.d.ts.map +1 -0
- package/dist/ThreeD/ThreeDAxis.js +75 -0
- package/dist/ThreeD/ThreeDBar.d.ts +7 -0
- package/dist/ThreeD/ThreeDBar.d.ts.map +1 -0
- package/dist/ThreeD/ThreeDBar.js +98 -0
- package/dist/ThreeD/ThreeDChart.d.ts +24 -0
- package/dist/ThreeD/ThreeDChart.d.ts.map +1 -0
- package/dist/ThreeD/ThreeDChart.js +202 -0
- package/dist/ThreeD/ThreeDContext.d.ts +5 -0
- package/dist/ThreeD/ThreeDContext.d.ts.map +1 -0
- package/dist/ThreeD/ThreeDContext.js +19 -0
- package/dist/ThreeD/ThreeDGrid.d.ts +5 -0
- package/dist/ThreeD/ThreeDGrid.d.ts.map +1 -0
- package/dist/ThreeD/ThreeDGrid.js +55 -0
- package/dist/ThreeD/ThreeDScatter.d.ts +7 -0
- package/dist/ThreeD/ThreeDScatter.d.ts.map +1 -0
- package/dist/ThreeD/ThreeDScatter.js +57 -0
- package/dist/ThreeD/ThreeDScatterGL.d.ts +7 -0
- package/dist/ThreeD/ThreeDScatterGL.d.ts.map +1 -0
- package/dist/ThreeD/ThreeDScatterGL.js +243 -0
- package/dist/ThreeD/ThreeDSurface.d.ts +15 -0
- package/dist/ThreeD/ThreeDSurface.d.ts.map +1 -0
- package/dist/ThreeD/ThreeDSurface.js +97 -0
- package/dist/ThreeD/index.d.ts +10 -0
- package/dist/ThreeD/index.d.ts.map +1 -0
- package/dist/ThreeD/index.js +10 -0
- package/dist/ThreeD/types.d.ts +57 -0
- package/dist/ThreeD/types.d.ts.map +1 -0
- package/dist/ThreeD/types.js +1 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +47 -0
- package/dist/lab.css +423 -0
- package/package.json +69 -4
- package/src/Chart/Chart.tsx +312 -0
- package/src/Chart/ChartArea.doc.mjs +16 -0
- package/src/Chart/ChartArea.tsx +91 -0
- package/src/Chart/ChartAxis.tsx +186 -0
- package/src/Chart/ChartBar.doc.mjs +16 -0
- package/src/Chart/ChartBar.tsx +71 -0
- package/src/Chart/ChartBrush.tsx +237 -0
- package/src/Chart/ChartCandlestick.doc.mjs +16 -0
- package/src/Chart/ChartCandlestick.tsx +186 -0
- package/src/Chart/ChartContext.ts +23 -0
- package/src/Chart/ChartDot.doc.mjs +16 -0
- package/src/Chart/ChartDot.tsx +44 -0
- package/src/Chart/ChartDotGL.doc.mjs +16 -0
- package/src/Chart/ChartDotGL.tsx +151 -0
- package/src/Chart/ChartDotGLInteractive.doc.mjs +16 -0
- package/src/Chart/ChartDotGLInteractive.tsx +519 -0
- package/src/Chart/ChartErrorBar.tsx +84 -0
- package/src/Chart/ChartGrid.tsx +86 -0
- package/src/Chart/ChartHeatmapGL.doc.mjs +16 -0
- package/src/Chart/ChartHeatmapGL.tsx +219 -0
- package/src/Chart/ChartLegend.tsx +181 -0
- package/src/Chart/ChartLine.doc.mjs +16 -0
- package/src/Chart/ChartLine.tsx +70 -0
- package/src/Chart/ChartReferenceLine.tsx +76 -0
- package/src/Chart/ChartSelect.tsx +111 -0
- package/src/Chart/ChartStreamGL.doc.mjs +16 -0
- package/src/Chart/ChartStreamGL.tsx +189 -0
- package/src/Chart/ChartTooltip.tsx +451 -0
- package/src/Chart/ChartZoom.tsx +400 -0
- package/src/Chart/formatters.ts +95 -0
- package/src/Chart/getChartColors.ts +249 -0
- package/src/Chart/index.ts +90 -0
- package/src/Chart/m4.test.ts +66 -0
- package/src/Chart/m4.ts +128 -0
- package/src/Chart/types.ts +64 -0
- package/src/Chart/useChartColors.ts +34 -0
- package/src/Chart/useChartRange.test.ts +101 -0
- package/src/Chart/useChartRange.ts +146 -0
- package/src/Chart/utils.ts +31 -0
- package/src/Chart/webgl.ts +192 -0
- package/src/ChartV2/Chart.tsx +348 -0
- package/src/ChartV2/ChartAxis.tsx +209 -0
- package/src/ChartV2/ChartGrid.tsx +99 -0
- package/src/ChartV2/ChartLegend.tsx +69 -0
- package/src/ChartV2/ChartSwatch.doc.mjs +17 -0
- package/src/ChartV2/ChartSwatch.tsx +86 -0
- package/src/ChartV2/ChartTooltip.tsx +382 -0
- package/src/ChartV2/ChartV2.doc.mjs +16 -0
- package/src/ChartV2/ChartV2Context.ts +15 -0
- package/src/ChartV2/index.ts +62 -0
- package/src/ChartV2/layout.ts +223 -0
- package/src/ChartV2/legend.ts +32 -0
- package/src/ChartV2/marks/area.tsx +122 -0
- package/src/ChartV2/marks/band.tsx +70 -0
- package/src/ChartV2/marks/bar.tsx +159 -0
- package/src/ChartV2/marks/candlestick.tsx +106 -0
- package/src/ChartV2/marks/dot.tsx +64 -0
- package/src/ChartV2/marks/dotGL.tsx +202 -0
- package/src/ChartV2/marks/dotGLInteractive.tsx +546 -0
- package/src/ChartV2/marks/errorBar.tsx +89 -0
- package/src/ChartV2/marks/heatmapGL.tsx +299 -0
- package/src/ChartV2/marks/index.ts +14 -0
- package/src/ChartV2/marks/line.tsx +94 -0
- package/src/ChartV2/marks/referenceLine.tsx +224 -0
- package/src/ChartV2/marks/streamGL.tsx +251 -0
- package/src/ChartV2/tooltip.ts +70 -0
- package/src/ChartV2/types.ts +129 -0
- package/src/ChatReasoning/ChatReasoning.doc.mjs +16 -0
- package/src/ChatReasoning/ChatReasoning.test.tsx +56 -0
- package/src/ChatReasoning/ChatReasoning.tsx +322 -0
- package/src/CircularProgress/CircularProgress.doc.mjs +174 -0
- package/src/CircularProgress/CircularProgress.test.tsx +157 -0
- package/src/CircularProgress/CircularProgress.tsx +373 -0
- package/src/CircularProgress/index.ts +15 -0
- package/src/CodeBlock/index.ts +10 -0
- package/src/CodeEditor/CodeEditor.doc.mjs +16 -0
- package/src/CodeEditor/CodeEditor.tsx +466 -0
- package/src/CodeEditor/index.ts +8 -0
- package/src/Radial/RadialArea.tsx +103 -0
- package/src/Radial/RadialAxis.tsx +60 -0
- package/src/Radial/RadialChart.doc.mjs +16 -0
- package/src/Radial/RadialChart.tsx +219 -0
- package/src/Radial/RadialContext.ts +22 -0
- package/src/Radial/RadialGrid.tsx +81 -0
- package/src/Radial/RadialSlice.tsx +130 -0
- package/src/Radial/RadialTooltip.tsx +347 -0
- package/src/Radial/index.ts +14 -0
- package/src/Radial/types.ts +46 -0
- package/src/SVGIcon/SVGIcon.doc.mjs +16 -0
- package/src/SVGIcon/SVGIcon.tsx +406 -0
- package/src/SVGIcon/icons.ts +283 -0
- package/src/SVGIcon/index.ts +73 -0
- package/src/SVGIcon/pathTransforms.ts +612 -0
- package/src/SVGIcon/tokens.stylex.ts +53 -0
- package/src/SVGIcon/variations.stylex.ts +122 -0
- package/src/SVGIcon/xif-examples.ts +191 -0
- package/src/SVGIcon/xif-types.ts +181 -0
- package/src/Sankey/SankeyChart.doc.mjs +16 -0
- package/src/Sankey/SankeyChart.tsx +220 -0
- package/src/Sankey/SankeyContext.ts +23 -0
- package/src/Sankey/SankeyGrid.tsx +69 -0
- package/src/Sankey/SankeyLabel.tsx +234 -0
- package/src/Sankey/SankeyLink.tsx +167 -0
- package/src/Sankey/SankeyNode.tsx +66 -0
- package/src/Sankey/index.ts +22 -0
- package/src/Sankey/layout.ts +219 -0
- package/src/Sankey/types.ts +93 -0
- package/src/Schedule/CalendarEvent.ts +74 -0
- package/src/Schedule/DayView.tsx +112 -0
- package/src/Schedule/ListView.tsx +236 -0
- package/src/Schedule/MonthlyView.tsx +401 -0
- package/src/Schedule/Schedule.doc.mjs +16 -0
- package/src/Schedule/Schedule.test.tsx +405 -0
- package/src/Schedule/Schedule.tsx +307 -0
- package/src/Schedule/TimeGridView.tsx +589 -0
- package/src/Schedule/WeeklyView.tsx +130 -0
- package/src/Schedule/context.tsx +49 -0
- package/src/Schedule/dateMath.ts +112 -0
- package/src/Schedule/index.ts +61 -0
- package/src/Schedule/plugins/PaginationPlugin.tsx +98 -0
- package/src/Schedule/plugins/ViewSelectorPlugin.tsx +128 -0
- package/src/Schedule/plugins/index.tsx +20 -0
- package/src/Schedule/shared.tsx +1304 -0
- package/src/Schedule/types.ts +86 -0
- package/src/Schedule/useCurrentTime.ts +50 -0
- package/src/Schedule/zonedDateTime.ts +71 -0
- package/src/Stepper/Step.doc.mjs +17 -0
- package/src/Stepper/Step.tsx +756 -0
- package/src/Stepper/StepStatus.ts +26 -0
- package/src/Stepper/Stepper.doc.mjs +265 -0
- package/src/Stepper/Stepper.test.tsx +281 -0
- package/src/Stepper/Stepper.tsx +157 -0
- package/src/Stepper/StepperContext.ts +43 -0
- package/src/Stepper/index.ts +14 -0
- package/src/ThreeD/3DBar.doc.mjs +16 -0
- package/src/ThreeD/3DChart.doc.mjs +16 -0
- package/src/ThreeD/3DScatter.doc.mjs +16 -0
- package/src/ThreeD/3DScatterGL.doc.mjs +16 -0
- package/src/ThreeD/3DSurface.doc.mjs +16 -0
- package/src/ThreeD/ThreeDAxis.tsx +86 -0
- package/src/ThreeD/ThreeDBar.tsx +130 -0
- package/src/ThreeD/ThreeDChart.tsx +262 -0
- package/src/ThreeD/ThreeDContext.ts +22 -0
- package/src/ThreeD/ThreeDGrid.tsx +68 -0
- package/src/ThreeD/ThreeDScatter.tsx +63 -0
- package/src/ThreeD/ThreeDScatterGL.tsx +270 -0
- package/src/ThreeD/ThreeDSurface.tsx +142 -0
- package/src/ThreeD/index.ts +11 -0
- package/src/ThreeD/projection.test.ts +132 -0
- package/src/ThreeD/types.ts +62 -0
- package/src/index.ts +250 -0
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @file ChatReasoning.tsx
|
|
7
|
+
* @input Uses React, StyleX, theme tokens
|
|
8
|
+
* @output Exports ChatReasoning component
|
|
9
|
+
* @position Chat component — compact collapsible reasoning/thinking display
|
|
10
|
+
*
|
|
11
|
+
* Renders model reasoning/thinking content as a compact single-line
|
|
12
|
+
* collapsed element. Expanding reveals the full reasoning text.
|
|
13
|
+
*
|
|
14
|
+
* Design: extremely compact by default. One line with ellipsis overflow.
|
|
15
|
+
* Expandable on click.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import {useState, useCallback, type ReactNode} from 'react';
|
|
19
|
+
import type {BaseProps} from '@astryxdesign/core';
|
|
20
|
+
import * as stylex from '@stylexjs/stylex';
|
|
21
|
+
import {
|
|
22
|
+
colorVars,
|
|
23
|
+
spacingVars,
|
|
24
|
+
typeScaleVars,
|
|
25
|
+
typographyVars,
|
|
26
|
+
fontWeightVars,
|
|
27
|
+
durationVars,
|
|
28
|
+
easeVars,
|
|
29
|
+
} from '@astryxdesign/core/theme/tokens.stylex';
|
|
30
|
+
import {mergeProps} from '@astryxdesign/core/utils';
|
|
31
|
+
import {themeProps} from '@astryxdesign/core/utils';
|
|
32
|
+
|
|
33
|
+
// =============================================================================
|
|
34
|
+
// Types
|
|
35
|
+
// =============================================================================
|
|
36
|
+
|
|
37
|
+
export interface ChatReasoningProps extends BaseProps<HTMLDivElement> {
|
|
38
|
+
/** Reasoning content. String renders as plain text; ReactNode for Markdown etc. */
|
|
39
|
+
children: ReactNode;
|
|
40
|
+
/** Header label. @default 'Thinking' */
|
|
41
|
+
label?: string;
|
|
42
|
+
/** Duration string shown after label (e.g. "12s"). */
|
|
43
|
+
duration?: string;
|
|
44
|
+
/** Whether reasoning is still streaming. Shows shimmer on label. */
|
|
45
|
+
isStreaming?: boolean;
|
|
46
|
+
/** Controlled expanded state. */
|
|
47
|
+
isExpanded?: boolean;
|
|
48
|
+
/** Default expanded state (uncontrolled). @default false */
|
|
49
|
+
defaultIsExpanded?: boolean;
|
|
50
|
+
/** Callback when expanded state changes. */
|
|
51
|
+
onExpandedChange?: (isExpanded: boolean) => void;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// =============================================================================
|
|
55
|
+
// Animations
|
|
56
|
+
// =============================================================================
|
|
57
|
+
|
|
58
|
+
const shimmerKeyframes = stylex.keyframes({
|
|
59
|
+
'0%': {backgroundPosition: '200% 0'},
|
|
60
|
+
'100%': {backgroundPosition: '-200% 0'},
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
// =============================================================================
|
|
64
|
+
// Styles
|
|
65
|
+
// =============================================================================
|
|
66
|
+
|
|
67
|
+
const styles = stylex.create({
|
|
68
|
+
root: {
|
|
69
|
+
display: 'flex',
|
|
70
|
+
flexDirection: 'column',
|
|
71
|
+
marginBlockStart: spacingVars['--spacing-2'],
|
|
72
|
+
},
|
|
73
|
+
header: {
|
|
74
|
+
display: 'flex',
|
|
75
|
+
alignItems: 'center',
|
|
76
|
+
gap: spacingVars['--spacing-1-5'],
|
|
77
|
+
cursor: 'pointer',
|
|
78
|
+
userSelect: 'none',
|
|
79
|
+
minHeight: '24px',
|
|
80
|
+
paddingBlock: spacingVars['--spacing-0-5'],
|
|
81
|
+
},
|
|
82
|
+
icon: {
|
|
83
|
+
display: 'inline-flex',
|
|
84
|
+
alignItems: 'center',
|
|
85
|
+
justifyContent: 'center',
|
|
86
|
+
flexShrink: 0,
|
|
87
|
+
width: '16px',
|
|
88
|
+
height: '16px',
|
|
89
|
+
color: colorVars['--color-text-secondary'],
|
|
90
|
+
},
|
|
91
|
+
labelRow: {
|
|
92
|
+
display: 'flex',
|
|
93
|
+
alignItems: 'center',
|
|
94
|
+
gap: spacingVars['--spacing-1'],
|
|
95
|
+
minWidth: 0,
|
|
96
|
+
overflow: 'hidden',
|
|
97
|
+
},
|
|
98
|
+
label: {
|
|
99
|
+
fontSize: typeScaleVars['--text-supporting-size'],
|
|
100
|
+
lineHeight: typeScaleVars['--text-supporting-leading'],
|
|
101
|
+
fontFamily: typographyVars['--font-family-body'],
|
|
102
|
+
fontWeight: fontWeightVars['--font-weight-medium'],
|
|
103
|
+
color: colorVars['--color-text-secondary'],
|
|
104
|
+
whiteSpace: 'nowrap',
|
|
105
|
+
flexShrink: 0,
|
|
106
|
+
},
|
|
107
|
+
duration: {
|
|
108
|
+
fontSize: typeScaleVars['--text-supporting-size'],
|
|
109
|
+
lineHeight: typeScaleVars['--text-supporting-leading'],
|
|
110
|
+
fontFamily: typographyVars['--font-family-body'],
|
|
111
|
+
color: colorVars['--color-text-disabled'],
|
|
112
|
+
whiteSpace: 'nowrap',
|
|
113
|
+
flexShrink: 0,
|
|
114
|
+
},
|
|
115
|
+
separator: {
|
|
116
|
+
fontSize: typeScaleVars['--text-supporting-size'],
|
|
117
|
+
color: colorVars['--color-text-disabled'],
|
|
118
|
+
flexShrink: 0,
|
|
119
|
+
},
|
|
120
|
+
preview: {
|
|
121
|
+
fontSize: typeScaleVars['--text-supporting-size'],
|
|
122
|
+
lineHeight: typeScaleVars['--text-supporting-leading'],
|
|
123
|
+
fontFamily: typographyVars['--font-family-body'],
|
|
124
|
+
color: colorVars['--color-text-disabled'],
|
|
125
|
+
whiteSpace: 'nowrap',
|
|
126
|
+
overflow: 'hidden',
|
|
127
|
+
textOverflow: 'ellipsis',
|
|
128
|
+
minWidth: 0,
|
|
129
|
+
},
|
|
130
|
+
chevron: {
|
|
131
|
+
display: 'inline-flex',
|
|
132
|
+
alignItems: 'center',
|
|
133
|
+
justifyContent: 'center',
|
|
134
|
+
flexShrink: 0,
|
|
135
|
+
width: '14px',
|
|
136
|
+
height: '14px',
|
|
137
|
+
color: colorVars['--color-text-disabled'],
|
|
138
|
+
transition: `transform ${durationVars['--duration-fast']} ${easeVars['--ease-standard']}`,
|
|
139
|
+
},
|
|
140
|
+
chevronExpanded: {
|
|
141
|
+
transform: 'rotate(180deg)',
|
|
142
|
+
},
|
|
143
|
+
shimmer: {
|
|
144
|
+
backgroundImage: `linear-gradient(90deg, ${colorVars['--color-text-secondary']} 0%, ${colorVars['--color-text-disabled']} 50%, ${colorVars['--color-text-secondary']} 100%)`,
|
|
145
|
+
backgroundSize: '200% 100%',
|
|
146
|
+
backgroundClip: 'text',
|
|
147
|
+
color: 'transparent',
|
|
148
|
+
animationName: shimmerKeyframes,
|
|
149
|
+
animationDuration: '4s',
|
|
150
|
+
animationTimingFunction: 'linear',
|
|
151
|
+
animationIterationCount: 'infinite',
|
|
152
|
+
},
|
|
153
|
+
content: {
|
|
154
|
+
display: 'grid',
|
|
155
|
+
gridTemplateRows: '0fr',
|
|
156
|
+
transition: `grid-template-rows ${durationVars['--duration-medium']} ${easeVars['--ease-standard']}`,
|
|
157
|
+
},
|
|
158
|
+
contentExpanded: {
|
|
159
|
+
gridTemplateRows: '1fr',
|
|
160
|
+
},
|
|
161
|
+
contentInner: {
|
|
162
|
+
overflow: 'hidden',
|
|
163
|
+
minHeight: 0,
|
|
164
|
+
},
|
|
165
|
+
contentPadding: {
|
|
166
|
+
paddingBlockStart: spacingVars['--spacing-2'],
|
|
167
|
+
paddingInlineStart: `calc(16px + ${spacingVars['--spacing-1-5']})`,
|
|
168
|
+
fontSize: typeScaleVars['--text-supporting-size'],
|
|
169
|
+
lineHeight: typeScaleVars['--text-supporting-leading'],
|
|
170
|
+
fontFamily: typographyVars['--font-family-body'],
|
|
171
|
+
color: colorVars['--color-text-secondary'],
|
|
172
|
+
},
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
// =============================================================================
|
|
176
|
+
// Icons
|
|
177
|
+
// =============================================================================
|
|
178
|
+
|
|
179
|
+
function ThinkingIcon() {
|
|
180
|
+
return (
|
|
181
|
+
<svg width="14" height="14" viewBox="0 0 14 14" fill="none">
|
|
182
|
+
<circle
|
|
183
|
+
cx="7"
|
|
184
|
+
cy="7"
|
|
185
|
+
r="5.5"
|
|
186
|
+
stroke="currentColor"
|
|
187
|
+
strokeWidth="1.5"
|
|
188
|
+
strokeDasharray="3 2"
|
|
189
|
+
/>
|
|
190
|
+
<circle cx="5.5" cy="7" r="0.75" fill="currentColor" />
|
|
191
|
+
<circle cx="8.5" cy="7" r="0.75" fill="currentColor" />
|
|
192
|
+
</svg>
|
|
193
|
+
);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
function ChevronDownIcon() {
|
|
197
|
+
return (
|
|
198
|
+
<svg width="12" height="12" viewBox="0 0 12 12" fill="none">
|
|
199
|
+
<path
|
|
200
|
+
d="M3 4.5L6 7.5L9 4.5"
|
|
201
|
+
stroke="currentColor"
|
|
202
|
+
strokeWidth="1.5"
|
|
203
|
+
strokeLinecap="round"
|
|
204
|
+
strokeLinejoin="round"
|
|
205
|
+
/>
|
|
206
|
+
</svg>
|
|
207
|
+
);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// =============================================================================
|
|
211
|
+
// Component
|
|
212
|
+
// =============================================================================
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Compact collapsible display for model reasoning/thinking content.
|
|
216
|
+
*
|
|
217
|
+
* Renders as a single line: icon + label + duration + ellipsized preview.
|
|
218
|
+
* Expands to show full reasoning on click.
|
|
219
|
+
*
|
|
220
|
+
* @example
|
|
221
|
+
* ```
|
|
222
|
+
* <ChatMessage sender="assistant">
|
|
223
|
+
* <ChatReasoning duration="12s">
|
|
224
|
+
* Let me work through the constraints on adjacent fields...
|
|
225
|
+
* </ChatReasoning>
|
|
226
|
+
* <Markdown>{response}</Markdown>
|
|
227
|
+
* </ChatMessage>
|
|
228
|
+
* ```
|
|
229
|
+
*/
|
|
230
|
+
export function ChatReasoning(props: ChatReasoningProps) {
|
|
231
|
+
const {
|
|
232
|
+
children,
|
|
233
|
+
label = 'Thinking',
|
|
234
|
+
duration,
|
|
235
|
+
isStreaming = false,
|
|
236
|
+
isExpanded: controlledExpanded,
|
|
237
|
+
defaultIsExpanded = false,
|
|
238
|
+
onExpandedChange,
|
|
239
|
+
xstyle,
|
|
240
|
+
className,
|
|
241
|
+
style,
|
|
242
|
+
...rest
|
|
243
|
+
} = props;
|
|
244
|
+
|
|
245
|
+
const [internalExpanded, setInternalExpanded] = useState(defaultIsExpanded);
|
|
246
|
+
const isControlled = controlledExpanded !== undefined;
|
|
247
|
+
const isExpanded = isControlled ? controlledExpanded : internalExpanded;
|
|
248
|
+
|
|
249
|
+
const toggle = useCallback(() => {
|
|
250
|
+
const next = !isExpanded;
|
|
251
|
+
if (!isControlled) {
|
|
252
|
+
setInternalExpanded(next);
|
|
253
|
+
}
|
|
254
|
+
onExpandedChange?.(next);
|
|
255
|
+
}, [isExpanded, isControlled, onExpandedChange]);
|
|
256
|
+
|
|
257
|
+
const previewText = typeof children === 'string' ? children : null;
|
|
258
|
+
|
|
259
|
+
return (
|
|
260
|
+
<div
|
|
261
|
+
{...mergeProps(
|
|
262
|
+
themeProps('chat-reasoning', {
|
|
263
|
+
expanded: isExpanded ? 'expanded' : null,
|
|
264
|
+
streaming: isStreaming ? 'streaming' : null,
|
|
265
|
+
}),
|
|
266
|
+
stylex.props(styles.root, xstyle),
|
|
267
|
+
className,
|
|
268
|
+
style,
|
|
269
|
+
)}
|
|
270
|
+
{...rest}>
|
|
271
|
+
<div
|
|
272
|
+
role="button"
|
|
273
|
+
tabIndex={0}
|
|
274
|
+
aria-expanded={isExpanded}
|
|
275
|
+
onClick={toggle}
|
|
276
|
+
onKeyDown={e => {
|
|
277
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
278
|
+
e.preventDefault();
|
|
279
|
+
toggle();
|
|
280
|
+
}
|
|
281
|
+
}}
|
|
282
|
+
{...stylex.props(styles.header)}>
|
|
283
|
+
<span {...stylex.props(styles.icon)}>
|
|
284
|
+
<ThinkingIcon />
|
|
285
|
+
</span>
|
|
286
|
+
<div {...stylex.props(styles.labelRow)}>
|
|
287
|
+
<span {...stylex.props(styles.label, isStreaming && styles.shimmer)}>
|
|
288
|
+
{label}
|
|
289
|
+
</span>
|
|
290
|
+
{duration != null && !isStreaming && (
|
|
291
|
+
<>
|
|
292
|
+
<span {...stylex.props(styles.separator)}>·</span>
|
|
293
|
+
<span {...stylex.props(styles.duration)}>{duration}</span>
|
|
294
|
+
</>
|
|
295
|
+
)}
|
|
296
|
+
{!isExpanded && previewText && !isStreaming && (
|
|
297
|
+
<>
|
|
298
|
+
<span {...stylex.props(styles.separator)}>—</span>
|
|
299
|
+
<span {...stylex.props(styles.preview)}>{previewText}</span>
|
|
300
|
+
</>
|
|
301
|
+
)}
|
|
302
|
+
</div>
|
|
303
|
+
<span
|
|
304
|
+
{...stylex.props(
|
|
305
|
+
styles.chevron,
|
|
306
|
+
isExpanded && styles.chevronExpanded,
|
|
307
|
+
)}>
|
|
308
|
+
<ChevronDownIcon />
|
|
309
|
+
</span>
|
|
310
|
+
</div>
|
|
311
|
+
|
|
312
|
+
<div
|
|
313
|
+
{...stylex.props(styles.content, isExpanded && styles.contentExpanded)}>
|
|
314
|
+
<div {...stylex.props(styles.contentInner)}>
|
|
315
|
+
<div {...stylex.props(styles.contentPadding)}>{children}</div>
|
|
316
|
+
</div>
|
|
317
|
+
</div>
|
|
318
|
+
</div>
|
|
319
|
+
);
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
ChatReasoning.displayName = 'ChatReasoning';
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('../docs-types').ComponentDoc} */
|
|
4
|
+
|
|
5
|
+
export const docs = {
|
|
6
|
+
name: 'CircularProgress',
|
|
7
|
+
displayName: 'Circular Progress',
|
|
8
|
+
category: 'Feedback & Status',
|
|
9
|
+
keywords: ["circular","progress","radial","ring","arc","determinate","indeterminate","gauge","meter","donut"],
|
|
10
|
+
props: [
|
|
11
|
+
{
|
|
12
|
+
name: 'value',
|
|
13
|
+
type: 'number',
|
|
14
|
+
description: 'Current value. When omitted, renders an indeterminate spinning animation.',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: 'max',
|
|
18
|
+
type: 'number',
|
|
19
|
+
description: 'Maximum value.',
|
|
20
|
+
default: '100',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: 'label',
|
|
24
|
+
type: 'string',
|
|
25
|
+
description: 'Accessible label for screen readers.',
|
|
26
|
+
required: true,
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: 'isLabelHidden',
|
|
30
|
+
type: 'boolean',
|
|
31
|
+
description: 'Visually hide the label (remains accessible). Defaults to true since circular progress typically shows center content instead.',
|
|
32
|
+
default: 'true',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: 'children',
|
|
36
|
+
type: 'ReactNode',
|
|
37
|
+
description: 'Content displayed in the center of the ring: percentage, icon, or custom content.',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: 'size',
|
|
41
|
+
type: "'sm' | 'md' | 'lg'",
|
|
42
|
+
description: 'Diameter of the progress ring (32px, 48px, 64px).',
|
|
43
|
+
default: "'md'",
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: 'variant',
|
|
47
|
+
type: "'accent' | 'success' | 'warning' | 'error' | 'neutral'",
|
|
48
|
+
description: 'Semantic color variant for the progress fill.',
|
|
49
|
+
default: "'accent'",
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: 'xstyle',
|
|
53
|
+
type: 'StyleXStyles',
|
|
54
|
+
description:
|
|
55
|
+
'StyleX styles for layout customization (margins, positioning). Must be a stylex.create() value.',
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
theming: {
|
|
59
|
+
targets: [
|
|
60
|
+
{className: 'astryx-circular-progress', visualProps: ['variant', 'size']},
|
|
61
|
+
{className: 'astryx-circular-progress-track'},
|
|
62
|
+
{className: 'astryx-circular-progress-fill', visualProps: ['variant']},
|
|
63
|
+
],
|
|
64
|
+
},
|
|
65
|
+
usage: {
|
|
66
|
+
description:
|
|
67
|
+
'A circular progress indicator that shows completion as a ring or arc. Use it for upload progress, score displays, dashboard gauges, or compact progress where horizontal space is limited. Complements ProgressBar for radial layouts.',
|
|
68
|
+
bestPractices: [
|
|
69
|
+
{ guidance: true, description: 'Pass a value for determinate progress; omit value for an indeterminate spinner.' },
|
|
70
|
+
{ guidance: true, description: 'Provide center content (children) to give context: a percentage, icon, or short label.' },
|
|
71
|
+
{ guidance: true, description: 'Always provide a label, even though it is visually hidden by default; screen readers need it.' },
|
|
72
|
+
{ guidance: false, description: 'Use circular progress for long text labels; use ProgressBar instead, which has more room for label and value display.' },
|
|
73
|
+
{ guidance: false, description: 'Stack multiple circular progress indicators for the same operation; use one with a value label.' },
|
|
74
|
+
],
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
/** @type {import('../docs-types').ComponentDoc} */
|
|
79
|
+
export const docsZh = {
|
|
80
|
+
name: 'CircularProgress',
|
|
81
|
+
displayName: 'Circular Progress',
|
|
82
|
+
props: [
|
|
83
|
+
{
|
|
84
|
+
name: 'value',
|
|
85
|
+
type: 'number',
|
|
86
|
+
description: '当前值。省略时渲染不确定旋转动画。',
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
name: 'max',
|
|
90
|
+
type: 'number',
|
|
91
|
+
description: '最大值。',
|
|
92
|
+
default: '100',
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
name: 'label',
|
|
96
|
+
type: 'string',
|
|
97
|
+
description: '屏幕阅读器的无障碍标签(必填)。',
|
|
98
|
+
required: true,
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
name: 'isLabelHidden',
|
|
102
|
+
type: 'boolean',
|
|
103
|
+
description: '视觉上隐藏标签(仍保持无障碍可访问性)。默认为 true,因为圆形进度条通常显示中心内容。',
|
|
104
|
+
default: 'true',
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
name: 'children',
|
|
108
|
+
type: 'ReactNode',
|
|
109
|
+
description: '在环形中心显示的内容:百分比、图标或自定义内容。',
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
name: 'size',
|
|
113
|
+
type: "'sm' | 'md' | 'lg'",
|
|
114
|
+
description: '进度环的直径(32px、48px、64px)。',
|
|
115
|
+
default: "'md'",
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
name: 'variant',
|
|
119
|
+
type: "'accent' | 'success' | 'warning' | 'error' | 'neutral'",
|
|
120
|
+
description: '进度填充的语义颜色变体。',
|
|
121
|
+
default: "'accent'",
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
name: 'xstyle',
|
|
125
|
+
type: 'StyleXStyles',
|
|
126
|
+
description: '用于布局自定义的 StyleX 样式。必须是 stylex.create() 的值。',
|
|
127
|
+
},
|
|
128
|
+
],
|
|
129
|
+
theming: {
|
|
130
|
+
targets: [
|
|
131
|
+
{className: 'astryx-circular-progress', visualProps: ['variant', 'size']},
|
|
132
|
+
{className: 'astryx-circular-progress-track'},
|
|
133
|
+
{className: 'astryx-circular-progress-fill', visualProps: ['variant']},
|
|
134
|
+
],
|
|
135
|
+
},
|
|
136
|
+
usage: {
|
|
137
|
+
description:
|
|
138
|
+
'A circular progress indicator that shows completion as a ring or arc. Use it for upload progress, score displays, dashboard gauges, or compact progress where horizontal space is limited. Complements ProgressBar for radial layouts.',
|
|
139
|
+
bestPractices: [
|
|
140
|
+
{ guidance: true, description: 'Pass a value for determinate progress; omit value for an indeterminate spinner.' },
|
|
141
|
+
{ guidance: true, description: 'Provide center content (children) to give context: a percentage, icon, or short label.' },
|
|
142
|
+
{ guidance: true, description: 'Always provide a label, even though it is visually hidden by default; screen readers need it.' },
|
|
143
|
+
{ guidance: false, description: 'Use circular progress for long text labels; use ProgressBar instead, which has more room for label and value display.' },
|
|
144
|
+
{ guidance: false, description: 'Stack multiple circular progress indicators for the same operation; use one with a value label.' },
|
|
145
|
+
],
|
|
146
|
+
},
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
/** @type {import('../docs-types').TranslationDoc} */
|
|
150
|
+
export const docsDense = {
|
|
151
|
+
description:
|
|
152
|
+
'Circular/radial progress indicator showing completion as a ring arc.',
|
|
153
|
+
usage: {
|
|
154
|
+
description:
|
|
155
|
+
'A circular progress indicator that shows completion as a ring or arc. Use it for upload progress, score displays, dashboard gauges, or compact progress where horizontal space is limited. Complements ProgressBar for radial layouts.',
|
|
156
|
+
bestPractices: [
|
|
157
|
+
{ guidance: true, description: 'Pass a value for determinate progress; omit value for an indeterminate spinner.' },
|
|
158
|
+
{ guidance: true, description: 'Provide center content (children) to give context: a percentage, icon, or short label.' },
|
|
159
|
+
{ guidance: true, description: 'Always provide a label, even though it is visually hidden by default; screen readers need it.' },
|
|
160
|
+
{ guidance: false, description: 'Use circular progress for long text labels; use ProgressBar instead, which has more room for label and value display.' },
|
|
161
|
+
{ guidance: false, description: 'Stack multiple circular progress indicators for the same operation; use one with a value label.' },
|
|
162
|
+
],
|
|
163
|
+
},
|
|
164
|
+
propDescriptions: {
|
|
165
|
+
value: 'Current value. Omit for indeterminate spinning animation.',
|
|
166
|
+
max: 'Maximum value.',
|
|
167
|
+
label: 'Accessible label for screen readers.',
|
|
168
|
+
isLabelHidden: 'Visually hide label (remains accessible). Defaults to true.',
|
|
169
|
+
children: 'Center content: percentage, icon, or custom.',
|
|
170
|
+
size: 'Ring diameter (32px, 48px, 64px).',
|
|
171
|
+
variant: 'Semantic color variant for the fill.',
|
|
172
|
+
xstyle: 'StyleX styles for layout customization. Must be stylex.create() value.',
|
|
173
|
+
},
|
|
174
|
+
};
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
import {describe, it, expect} from 'vitest';
|
|
4
|
+
import {render, screen} from '@testing-library/react';
|
|
5
|
+
import {CircularProgress} from './CircularProgress';
|
|
6
|
+
|
|
7
|
+
describe('CircularProgress', () => {
|
|
8
|
+
it('renders with default props', () => {
|
|
9
|
+
render(<CircularProgress value={50} label="Progress" />);
|
|
10
|
+
const meter = screen.getByRole('meter');
|
|
11
|
+
expect(meter).toBeInTheDocument();
|
|
12
|
+
expect(meter).toHaveAttribute('aria-valuenow', '50');
|
|
13
|
+
expect(meter).toHaveAttribute('aria-valuemin', '0');
|
|
14
|
+
expect(meter).toHaveAttribute('aria-valuemax', '100');
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it('renders label as visually hidden by default', () => {
|
|
18
|
+
render(<CircularProgress value={50} label="Upload progress" />);
|
|
19
|
+
expect(screen.getByText('Upload progress')).toBeInTheDocument();
|
|
20
|
+
const meter = screen.getByRole('meter');
|
|
21
|
+
expect(meter).toHaveAttribute('aria-labelledby');
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it('shows label visually when isLabelHidden is false', () => {
|
|
25
|
+
render(
|
|
26
|
+
<CircularProgress
|
|
27
|
+
value={50}
|
|
28
|
+
label="Upload progress"
|
|
29
|
+
isLabelHidden={false}
|
|
30
|
+
/>,
|
|
31
|
+
);
|
|
32
|
+
const label = screen.getByText('Upload progress');
|
|
33
|
+
expect(label).toBeInTheDocument();
|
|
34
|
+
const meter = screen.getByRole('meter');
|
|
35
|
+
expect(meter).toHaveAttribute('aria-labelledby');
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it('respects custom max', () => {
|
|
39
|
+
render(<CircularProgress value={3} max={10} label="Steps" />);
|
|
40
|
+
const meter = screen.getByRole('meter');
|
|
41
|
+
expect(meter).toHaveAttribute('aria-valuenow', '3');
|
|
42
|
+
expect(meter).toHaveAttribute('aria-valuemax', '10');
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it('clamps value to [0, max]', () => {
|
|
46
|
+
const {rerender} = render(
|
|
47
|
+
<CircularProgress value={150} max={100} label="Over" />,
|
|
48
|
+
);
|
|
49
|
+
let meter = screen.getByRole('meter');
|
|
50
|
+
expect(meter).toHaveAttribute('aria-valuenow', '100');
|
|
51
|
+
|
|
52
|
+
rerender(<CircularProgress value={-10} max={100} label="Under" />);
|
|
53
|
+
meter = screen.getByRole('meter');
|
|
54
|
+
expect(meter).toHaveAttribute('aria-valuenow', '0');
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
it('renders children in the center', () => {
|
|
58
|
+
render(
|
|
59
|
+
<CircularProgress value={75} label="Progress">
|
|
60
|
+
75%
|
|
61
|
+
</CircularProgress>,
|
|
62
|
+
);
|
|
63
|
+
expect(screen.getByText('75%')).toBeInTheDocument();
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it('forwards ref to outer container', () => {
|
|
67
|
+
const ref = {current: null as HTMLDivElement | null};
|
|
68
|
+
render(<CircularProgress ref={ref} value={50} label="Test" />);
|
|
69
|
+
expect(ref.current).toBeInstanceOf(HTMLDivElement);
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
it('passes data-testid', () => {
|
|
73
|
+
render(
|
|
74
|
+
<CircularProgress value={50} label="Test" data-testid="my-progress" />,
|
|
75
|
+
);
|
|
76
|
+
expect(screen.getByTestId('my-progress')).toBeInTheDocument();
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it('renders with all variant options', () => {
|
|
80
|
+
const variants = [
|
|
81
|
+
'accent',
|
|
82
|
+
'success',
|
|
83
|
+
'warning',
|
|
84
|
+
'error',
|
|
85
|
+
'neutral',
|
|
86
|
+
] as const;
|
|
87
|
+
for (const variant of variants) {
|
|
88
|
+
const {unmount} = render(
|
|
89
|
+
<CircularProgress value={50} label={variant} variant={variant} />,
|
|
90
|
+
);
|
|
91
|
+
expect(screen.getByRole('meter')).toBeInTheDocument();
|
|
92
|
+
unmount();
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
it('renders with all size options', () => {
|
|
97
|
+
const sizes = ['sm', 'md', 'lg'] as const;
|
|
98
|
+
for (const size of sizes) {
|
|
99
|
+
const {unmount} = render(
|
|
100
|
+
<CircularProgress value={50} label={size} size={size} />,
|
|
101
|
+
);
|
|
102
|
+
expect(screen.getByRole('meter')).toBeInTheDocument();
|
|
103
|
+
unmount();
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
it('handles zero max gracefully', () => {
|
|
108
|
+
render(<CircularProgress value={0} max={0} label="Empty" />);
|
|
109
|
+
const meter = screen.getByRole('meter');
|
|
110
|
+
expect(meter).toHaveAttribute('aria-valuenow', '0');
|
|
111
|
+
expect(meter).toHaveAttribute('aria-valuemax', '0');
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
describe('indeterminate mode', () => {
|
|
115
|
+
it('renders indeterminate when value is omitted', () => {
|
|
116
|
+
render(<CircularProgress label="Loading" />);
|
|
117
|
+
const progressbar = screen.getByRole('progressbar');
|
|
118
|
+
expect(progressbar).toBeInTheDocument();
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
it('does not set aria-valuenow/min/max when indeterminate', () => {
|
|
122
|
+
render(<CircularProgress label="Loading" />);
|
|
123
|
+
const progressbar = screen.getByRole('progressbar');
|
|
124
|
+
expect(progressbar).not.toHaveAttribute('aria-valuenow');
|
|
125
|
+
expect(progressbar).not.toHaveAttribute('aria-valuemin');
|
|
126
|
+
expect(progressbar).not.toHaveAttribute('aria-valuemax');
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
it('is labelled via aria-labelledby when indeterminate', () => {
|
|
130
|
+
render(<CircularProgress label="Loading data" />);
|
|
131
|
+
const progressbar = screen.getByRole('progressbar');
|
|
132
|
+
expect(progressbar).toHaveAttribute('aria-labelledby');
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
it('renders with all variants in indeterminate mode', () => {
|
|
136
|
+
const variants = [
|
|
137
|
+
'accent',
|
|
138
|
+
'success',
|
|
139
|
+
'warning',
|
|
140
|
+
'error',
|
|
141
|
+
'neutral',
|
|
142
|
+
] as const;
|
|
143
|
+
for (const variant of variants) {
|
|
144
|
+
const {unmount} = render(
|
|
145
|
+
<CircularProgress label={variant} variant={variant} />,
|
|
146
|
+
);
|
|
147
|
+
expect(screen.getByRole('progressbar')).toBeInTheDocument();
|
|
148
|
+
unmount();
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
it('renders children alongside indeterminate animation', () => {
|
|
153
|
+
render(<CircularProgress label="Loading">...</CircularProgress>);
|
|
154
|
+
expect(screen.getByText('...')).toBeInTheDocument();
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
});
|