@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,284 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file RadialTooltip.tsx
|
|
5
|
+
* @output Hover tooltip for radial charts (pie/donut/spider)
|
|
6
|
+
* @position Child of RadialChart; reads geometry from radial context
|
|
7
|
+
*
|
|
8
|
+
* Uses the Astryx Layer system for top-layer rendering.
|
|
9
|
+
* Hit-tests pointer position against slices (pie/donut) or axis proximity (spider).
|
|
10
|
+
* Portals the popover div outside the SVG into the chart container.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
'use client';
|
|
14
|
+
|
|
15
|
+
import { useState, useCallback, useRef } from 'react';
|
|
16
|
+
import { createPortal } from 'react-dom';
|
|
17
|
+
import { useLayer } from '@astryxdesign/core/Layer';
|
|
18
|
+
import { useRadial } from "./RadialContext.js";
|
|
19
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
20
|
+
/**
|
|
21
|
+
* Tooltip for radial charts. Detects which slice the pointer is over
|
|
22
|
+
* using polar coordinate math and renders a tooltip in the top layer.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```tsx
|
|
26
|
+
* <RadialChart data={data} valueKey="revenue" labelKey="region" height={400}>
|
|
27
|
+
* <RadialSlice colors={colors} />
|
|
28
|
+
* <RadialTooltip />
|
|
29
|
+
* </RadialChart>
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export function RadialTooltip({
|
|
33
|
+
render,
|
|
34
|
+
highlight = true,
|
|
35
|
+
highlightOffset = 6
|
|
36
|
+
}) {
|
|
37
|
+
const {
|
|
38
|
+
cx,
|
|
39
|
+
cy,
|
|
40
|
+
radius,
|
|
41
|
+
innerRadius,
|
|
42
|
+
slices,
|
|
43
|
+
mode,
|
|
44
|
+
data,
|
|
45
|
+
axes,
|
|
46
|
+
angleByAxis,
|
|
47
|
+
axisDomains
|
|
48
|
+
} = useRadial();
|
|
49
|
+
const [hoverState, setHoverState] = useState(null);
|
|
50
|
+
const [tooltipCoords, setTooltipCoords] = useState({
|
|
51
|
+
x: 0,
|
|
52
|
+
y: 0
|
|
53
|
+
});
|
|
54
|
+
const svgRef = useRef(null);
|
|
55
|
+
const portalRef = useRef(null);
|
|
56
|
+
const active = useRef(false);
|
|
57
|
+
const layer = useLayer({
|
|
58
|
+
mode: 'fixed'
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
// Resolve SVG + portal target from the <g> mount
|
|
62
|
+
const gRef = useCallback(el => {
|
|
63
|
+
if (el) {
|
|
64
|
+
svgRef.current = el.ownerSVGElement;
|
|
65
|
+
portalRef.current = el.ownerSVGElement?.parentElement ?? null;
|
|
66
|
+
}
|
|
67
|
+
}, []);
|
|
68
|
+
const hitTestPie = useCallback((localX, localY) => {
|
|
69
|
+
if (!slices || slices.length === 0) {
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
const dx = localX - cx;
|
|
73
|
+
const dy = localY - cy;
|
|
74
|
+
const dist = Math.sqrt(dx * dx + dy * dy);
|
|
75
|
+
if (dist > radius || dist < innerRadius) {
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
let angle = Math.atan2(dy, dx);
|
|
79
|
+
if (angle < -Math.PI / 2) {
|
|
80
|
+
angle += 2 * Math.PI;
|
|
81
|
+
}
|
|
82
|
+
for (let i = 0; i < slices.length; i++) {
|
|
83
|
+
const slice = slices[i];
|
|
84
|
+
if (angle >= slice.startAngle && angle <= slice.endAngle) {
|
|
85
|
+
return {
|
|
86
|
+
label: slice.key,
|
|
87
|
+
value: slice.value,
|
|
88
|
+
percentage: slice.percentage,
|
|
89
|
+
index: i
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return null;
|
|
94
|
+
}, [slices, cx, cy, radius, innerRadius]);
|
|
95
|
+
const hitTestSpider = useCallback((localX, localY) => {
|
|
96
|
+
if (!axes || !angleByAxis || !axisDomains) {
|
|
97
|
+
return null;
|
|
98
|
+
}
|
|
99
|
+
const dx = localX - cx;
|
|
100
|
+
const dy = localY - cy;
|
|
101
|
+
const dist = Math.sqrt(dx * dx + dy * dy);
|
|
102
|
+
if (dist > radius + 20) {
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
const angle = Math.atan2(dy, dx);
|
|
106
|
+
let nearestAxis = axes[0];
|
|
107
|
+
let minAngleDist = Infinity;
|
|
108
|
+
for (const [key, axisAngle] of angleByAxis) {
|
|
109
|
+
let diff = Math.abs(angle - axisAngle);
|
|
110
|
+
if (diff > Math.PI) {
|
|
111
|
+
diff = 2 * Math.PI - diff;
|
|
112
|
+
}
|
|
113
|
+
if (diff < minAngleDist) {
|
|
114
|
+
minAngleDist = diff;
|
|
115
|
+
nearestAxis = key;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
if (minAngleDist > Math.PI / axes.length) {
|
|
119
|
+
return null;
|
|
120
|
+
}
|
|
121
|
+
let bestIdx = 0;
|
|
122
|
+
let bestVal = 0;
|
|
123
|
+
for (let i = 0; i < data.length; i++) {
|
|
124
|
+
const v = data[i][nearestAxis];
|
|
125
|
+
if (typeof v === 'number' && v > bestVal) {
|
|
126
|
+
bestVal = v;
|
|
127
|
+
bestIdx = i;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return {
|
|
131
|
+
label: nearestAxis,
|
|
132
|
+
value: bestVal,
|
|
133
|
+
index: bestIdx
|
|
134
|
+
};
|
|
135
|
+
}, [axes, angleByAxis, axisDomains, cx, cy, radius, data]);
|
|
136
|
+
const updateTooltip = useCallback(e => {
|
|
137
|
+
const svg = svgRef.current;
|
|
138
|
+
if (!svg) {
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
const pt = svg.createSVGPoint();
|
|
142
|
+
pt.x = e.clientX;
|
|
143
|
+
pt.y = e.clientY;
|
|
144
|
+
const ctm = svg.getScreenCTM()?.inverse();
|
|
145
|
+
if (!ctm) {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
const local = pt.matrixTransform(ctm);
|
|
149
|
+
const hit = mode === 'pie' ? hitTestPie(local.x, local.y) : hitTestSpider(local.x, local.y);
|
|
150
|
+
if (hit) {
|
|
151
|
+
setHoverState(hit);
|
|
152
|
+
setTooltipCoords({
|
|
153
|
+
x: e.clientX + 12,
|
|
154
|
+
y: e.clientY - 8
|
|
155
|
+
});
|
|
156
|
+
layer.show();
|
|
157
|
+
} else {
|
|
158
|
+
setHoverState(null);
|
|
159
|
+
layer.hide();
|
|
160
|
+
}
|
|
161
|
+
}, [mode, hitTestPie, hitTestSpider, layer]);
|
|
162
|
+
|
|
163
|
+
// Touch: tap to show, drag to scrub
|
|
164
|
+
const handlePointerDown = useCallback(e => {
|
|
165
|
+
if (e.pointerType !== 'mouse') {
|
|
166
|
+
e.preventDefault();
|
|
167
|
+
active.current = true;
|
|
168
|
+
updateTooltip(e);
|
|
169
|
+
}
|
|
170
|
+
}, [updateTooltip]);
|
|
171
|
+
|
|
172
|
+
// Mouse: hover. Touch: drag (only if active).
|
|
173
|
+
const handlePointerMove = useCallback(e => {
|
|
174
|
+
if (e.pointerType !== 'mouse' && !active.current) {
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
updateTooltip(e);
|
|
178
|
+
}, [updateTooltip]);
|
|
179
|
+
|
|
180
|
+
// Touch: lift to dismiss
|
|
181
|
+
const handlePointerUp = useCallback(() => {
|
|
182
|
+
if (active.current) {
|
|
183
|
+
active.current = false;
|
|
184
|
+
setHoverState(null);
|
|
185
|
+
layer.hide();
|
|
186
|
+
}
|
|
187
|
+
}, [layer]);
|
|
188
|
+
const handlePointerLeave = useCallback(() => {
|
|
189
|
+
if (!active.current) {
|
|
190
|
+
setHoverState(null);
|
|
191
|
+
layer.hide();
|
|
192
|
+
}
|
|
193
|
+
}, [layer]);
|
|
194
|
+
const defaultRender = d => /*#__PURE__*/_jsxs("div", {
|
|
195
|
+
style: {
|
|
196
|
+
display: 'flex',
|
|
197
|
+
flexDirection: 'column',
|
|
198
|
+
gap: 2,
|
|
199
|
+
fontSize: 12
|
|
200
|
+
},
|
|
201
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
202
|
+
style: {
|
|
203
|
+
fontWeight: 600
|
|
204
|
+
},
|
|
205
|
+
children: d.label
|
|
206
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
207
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
208
|
+
style: {
|
|
209
|
+
color: 'var(--color-text-secondary)'
|
|
210
|
+
},
|
|
211
|
+
children: "Value:"
|
|
212
|
+
}), ' ', /*#__PURE__*/_jsx("span", {
|
|
213
|
+
style: {
|
|
214
|
+
fontWeight: 500
|
|
215
|
+
},
|
|
216
|
+
children: d.value.toLocaleString()
|
|
217
|
+
})]
|
|
218
|
+
}), d.percentage != null && /*#__PURE__*/_jsxs("div", {
|
|
219
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
220
|
+
style: {
|
|
221
|
+
color: 'var(--color-text-secondary)'
|
|
222
|
+
},
|
|
223
|
+
children: "Share:"
|
|
224
|
+
}), ' ', /*#__PURE__*/_jsxs("span", {
|
|
225
|
+
style: {
|
|
226
|
+
fontWeight: 500
|
|
227
|
+
},
|
|
228
|
+
children: [Math.round(d.percentage * 100), "%"]
|
|
229
|
+
})]
|
|
230
|
+
})]
|
|
231
|
+
});
|
|
232
|
+
const highlightSlice = highlight && hoverState && mode === 'pie' && slices?.[hoverState.index];
|
|
233
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
234
|
+
children: [/*#__PURE__*/_jsxs("g", {
|
|
235
|
+
ref: gRef,
|
|
236
|
+
children: [/*#__PURE__*/_jsx("circle", {
|
|
237
|
+
cx: cx,
|
|
238
|
+
cy: cy,
|
|
239
|
+
r: radius + 10,
|
|
240
|
+
fill: "transparent",
|
|
241
|
+
style: {
|
|
242
|
+
touchAction: 'none'
|
|
243
|
+
},
|
|
244
|
+
onPointerDown: handlePointerDown,
|
|
245
|
+
onPointerMove: handlePointerMove,
|
|
246
|
+
onPointerUp: handlePointerUp,
|
|
247
|
+
onPointerCancel: handlePointerUp,
|
|
248
|
+
onPointerLeave: handlePointerLeave
|
|
249
|
+
}), highlightSlice && /*#__PURE__*/_jsx("g", {
|
|
250
|
+
transform: (() => {
|
|
251
|
+
const midAngle = (highlightSlice.startAngle + highlightSlice.endAngle) / 2;
|
|
252
|
+
const tx = Math.cos(midAngle) * highlightOffset;
|
|
253
|
+
const ty = Math.sin(midAngle) * highlightOffset;
|
|
254
|
+
return `translate(${tx},${ty})`;
|
|
255
|
+
})(),
|
|
256
|
+
pointerEvents: "none",
|
|
257
|
+
opacity: 0.3,
|
|
258
|
+
children: /*#__PURE__*/_jsx("circle", {
|
|
259
|
+
cx: cx,
|
|
260
|
+
cy: cy,
|
|
261
|
+
r: radius,
|
|
262
|
+
fill: "none",
|
|
263
|
+
stroke: "var(--color-border-emphasized)",
|
|
264
|
+
strokeWidth: 2
|
|
265
|
+
})
|
|
266
|
+
})]
|
|
267
|
+
}), portalRef.current && /*#__PURE__*/createPortal(layer.render(hoverState ? /*#__PURE__*/_jsx("div", {
|
|
268
|
+
style: {
|
|
269
|
+
background: 'var(--color-background-popover)',
|
|
270
|
+
border: '1px solid var(--color-border)',
|
|
271
|
+
borderRadius: 8,
|
|
272
|
+
padding: '8px 12px',
|
|
273
|
+
boxShadow: 'var(--shadow-med)',
|
|
274
|
+
whiteSpace: 'nowrap',
|
|
275
|
+
width: 'fit-content',
|
|
276
|
+
pointerEvents: 'none'
|
|
277
|
+
},
|
|
278
|
+
children: render ? render(hoverState) : defaultRender(hoverState)
|
|
279
|
+
}) : null, {
|
|
280
|
+
x: tooltipCoords.x,
|
|
281
|
+
y: tooltipCoords.y
|
|
282
|
+
}), portalRef.current)]
|
|
283
|
+
});
|
|
284
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { RadialChart, type RadialChartProps } from './RadialChart';
|
|
2
|
+
export { RadialGrid, type RadialGridProps } from './RadialGrid';
|
|
3
|
+
export { RadialArea, type RadialAreaProps } from './RadialArea';
|
|
4
|
+
export { RadialAxis, type RadialAxisProps } from './RadialAxis';
|
|
5
|
+
export { RadialSlice, type RadialSliceProps } from './RadialSlice';
|
|
6
|
+
export { RadialTooltip, type RadialTooltipProps, type RadialTooltipDatum, } from './RadialTooltip';
|
|
7
|
+
export { useRadial } from './RadialContext';
|
|
8
|
+
export type { RadialContext, RadialMode } from './types';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Radial/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,WAAW,EAAE,KAAK,gBAAgB,EAAC,MAAM,eAAe,CAAC;AACjE,OAAO,EAAC,UAAU,EAAE,KAAK,eAAe,EAAC,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAC,UAAU,EAAE,KAAK,eAAe,EAAC,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAC,UAAU,EAAE,KAAK,eAAe,EAAC,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAC,WAAW,EAAE,KAAK,gBAAgB,EAAC,MAAM,eAAe,CAAC;AACjE,OAAO,EACL,aAAa,EACb,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,GACxB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAC1C,YAAY,EAAC,aAAa,EAAE,UAAU,EAAC,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
export { RadialChart } from "./RadialChart.js";
|
|
4
|
+
export { RadialGrid } from "./RadialGrid.js";
|
|
5
|
+
export { RadialArea } from "./RadialArea.js";
|
|
6
|
+
export { RadialAxis } from "./RadialAxis.js";
|
|
7
|
+
export { RadialSlice } from "./RadialSlice.js";
|
|
8
|
+
export { RadialTooltip } from "./RadialTooltip.js";
|
|
9
|
+
export { useRadial } from "./RadialContext.js";
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file types.ts
|
|
3
|
+
* @output Radial chart types and context
|
|
4
|
+
* @position Foundation types consumed by all radial sub-components
|
|
5
|
+
*/
|
|
6
|
+
/** Radial chart mode */
|
|
7
|
+
export type RadialMode = 'spider' | 'pie';
|
|
8
|
+
/** Radial context provided by RadialChart to children */
|
|
9
|
+
export interface RadialContext {
|
|
10
|
+
/** Center x pixel position */
|
|
11
|
+
cx: number;
|
|
12
|
+
/** Center y pixel position */
|
|
13
|
+
cy: number;
|
|
14
|
+
/** Outer radius in pixels */
|
|
15
|
+
radius: number;
|
|
16
|
+
/** Inner radius in pixels (>0 for donut) */
|
|
17
|
+
innerRadius: number;
|
|
18
|
+
/** The full dataset */
|
|
19
|
+
data: Record<string, unknown>[];
|
|
20
|
+
/** Chart mode */
|
|
21
|
+
mode: RadialMode;
|
|
22
|
+
/** Axis keys for spider charts */
|
|
23
|
+
axes?: string[];
|
|
24
|
+
/** Angle for each axis in radians */
|
|
25
|
+
angleByAxis?: Map<string, number>;
|
|
26
|
+
/** Radius scale: maps a normalized value (0-1) to pixel distance from center */
|
|
27
|
+
radiusScale?: (t: number) => number;
|
|
28
|
+
/** Domain [min, max] per axis for spider normalization */
|
|
29
|
+
axisDomains?: Map<string, [number, number]>;
|
|
30
|
+
/** Computed slices with start/end angles */
|
|
31
|
+
slices?: Array<{
|
|
32
|
+
key: string;
|
|
33
|
+
value: number;
|
|
34
|
+
startAngle: number;
|
|
35
|
+
endAngle: number;
|
|
36
|
+
percentage: number;
|
|
37
|
+
}>;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/Radial/types.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,wBAAwB;AACxB,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,KAAK,CAAC;AAE1C,yDAAyD;AACzD,MAAM,WAAW,aAAa;IAC5B,8BAA8B;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,8BAA8B;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,6BAA6B;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,4CAA4C;IAC5C,WAAW,EAAE,MAAM,CAAC;IACpB,uBAAuB;IACvB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IAChC,iBAAiB;IACjB,IAAI,EAAE,UAAU,CAAC;IAGjB,kCAAkC;IAClC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,qCAAqC;IACrC,WAAW,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,gFAAgF;IAChF,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IACpC,0DAA0D;IAC1D,WAAW,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAG5C,4CAA4C;IAC5C,MAAM,CAAC,EAAE,KAAK,CAAC;QACb,GAAG,EAAE,MAAM,CAAC;QACZ,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,EAAE,MAAM,CAAC;QACnB,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC,CAAC;CACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file SVGIcon.tsx
|
|
3
|
+
* @input SVG path data with per-element roles, variation preset, size, color
|
|
4
|
+
* @output CSS-variable-driven SVG icon with role-aware rendering and mask-based gaps
|
|
5
|
+
* @position Core implementation for the lab SVG icon system
|
|
6
|
+
*
|
|
7
|
+
* Two key concepts beyond basic CSS-var-driven icons:
|
|
8
|
+
*
|
|
9
|
+
* 1. Path roles — each element is either "fill" (closed shapes that switch between
|
|
10
|
+
* stroke and fill across variations) or "stroke" (lines that always stay stroked).
|
|
11
|
+
*
|
|
12
|
+
* 2. Mask-based gaps — in bold/filled mode, overlapping fill-role shapes get
|
|
13
|
+
* auto-generated SVG masks. Secondary fill shapes are knocked out of primary
|
|
14
|
+
* shapes with a configurable gap and corner rounding, producing clean negative
|
|
15
|
+
* space on any background.
|
|
16
|
+
*/
|
|
17
|
+
import { type SVGProps } from 'react';
|
|
18
|
+
export type SVGIconVariation = 'linear' | 'bold' | 'twotone' | 'bulk' | 'broken';
|
|
19
|
+
export type SVGIconSize = 'xsm' | 'sm' | 'md' | 'lg';
|
|
20
|
+
export type SVGIconColor = 'primary' | 'secondary' | 'disabled' | 'accent' | 'positive' | 'negative' | 'warning' | 'inherit';
|
|
21
|
+
/**
|
|
22
|
+
* Role determines how an element behaves across variations.
|
|
23
|
+
* - "fill": closed shapes — stroked in linear, filled in bold
|
|
24
|
+
* - "stroke": lines/detail strokes — always rendered as strokes
|
|
25
|
+
*/
|
|
26
|
+
export type IconShapeRole = 'fill' | 'stroke';
|
|
27
|
+
/** Shape element within an icon layer */
|
|
28
|
+
export interface IconShape {
|
|
29
|
+
/** SVG element type */
|
|
30
|
+
type: 'path' | 'circle' | 'rect' | 'line' | 'polyline' | 'polygon';
|
|
31
|
+
/** SVG attributes for this shape (d, cx, cy, r, points, x1, y1, etc.) */
|
|
32
|
+
attrs: Record<string, string>;
|
|
33
|
+
/**
|
|
34
|
+
* How this element behaves across variations.
|
|
35
|
+
* @default 'fill'
|
|
36
|
+
*/
|
|
37
|
+
role?: IconShapeRole;
|
|
38
|
+
}
|
|
39
|
+
/** Definition of an SVG icon's geometry */
|
|
40
|
+
export interface SVGIconDef {
|
|
41
|
+
/** Display name */
|
|
42
|
+
name: string;
|
|
43
|
+
/** ViewBox dimensions (default: "0 0 24 24") */
|
|
44
|
+
viewBox?: string;
|
|
45
|
+
/** Primary layer shapes (main outlines) */
|
|
46
|
+
primary: IconShape[];
|
|
47
|
+
/** Secondary layer shapes (detail elements) */
|
|
48
|
+
secondary?: IconShape[];
|
|
49
|
+
}
|
|
50
|
+
export interface SVGIconProps extends Omit<SVGProps<SVGSVGElement>, 'color'> {
|
|
51
|
+
/** The icon definition containing path data */
|
|
52
|
+
icon: SVGIconDef;
|
|
53
|
+
/**
|
|
54
|
+
* Visual variation preset.
|
|
55
|
+
* @default 'linear'
|
|
56
|
+
*/
|
|
57
|
+
variation?: SVGIconVariation;
|
|
58
|
+
/**
|
|
59
|
+
* Icon size with optical stroke compensation.
|
|
60
|
+
* @default 'md'
|
|
61
|
+
*/
|
|
62
|
+
size?: SVGIconSize;
|
|
63
|
+
/**
|
|
64
|
+
* Semantic color.
|
|
65
|
+
* @default 'primary'
|
|
66
|
+
*/
|
|
67
|
+
color?: SVGIconColor;
|
|
68
|
+
/** Override stroke width (bypasses optical compensation). */
|
|
69
|
+
strokeWidth?: number;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* CSS-variable-driven SVG icon with role-aware rendering.
|
|
73
|
+
*
|
|
74
|
+
* Each shape element has a role ("fill" or "stroke") that determines how it
|
|
75
|
+
* behaves across variations. In bold mode, overlapping fill-role shapes get
|
|
76
|
+
* auto-generated SVG masks for clean gap subtraction.
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```
|
|
80
|
+
* <SVGIcon icon={bellIcon} variation="twotone" size="md" color="accent" />
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
export declare function SVGIcon({ icon, variation, size, color, strokeWidth, style, ...props }: SVGIconProps): import("react").JSX.Element;
|
|
84
|
+
export declare namespace SVGIcon {
|
|
85
|
+
var displayName: string;
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=SVGIcon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SVGIcon.d.ts","sourceRoot":"","sources":["../../src/SVGIcon/SVGIcon.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAqB,KAAK,QAAQ,EAAQ,MAAM,OAAO,CAAC;AAY/D,MAAM,MAAM,gBAAgB,GACxB,QAAQ,GACR,MAAM,GACN,SAAS,GACT,MAAM,GACN,QAAQ,CAAC;AACb,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AACrD,MAAM,MAAM,YAAY,GACpB,SAAS,GACT,WAAW,GACX,UAAU,GACV,QAAQ,GACR,UAAU,GACV,UAAU,GACV,SAAS,GACT,SAAS,CAAC;AAEd;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE9C,yCAAyC;AACzC,MAAM,WAAW,SAAS;IACxB,uBAAuB;IACvB,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;IACnE,yEAAyE;IACzE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B;;;OAGG;IACH,IAAI,CAAC,EAAE,aAAa,CAAC;CACtB;AAED,2CAA2C;AAC3C,MAAM,WAAW,UAAU;IACzB,mBAAmB;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,gDAAgD;IAChD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2CAA2C;IAC3C,OAAO,EAAE,SAAS,EAAE,CAAC;IACrB,+CAA+C;IAC/C,SAAS,CAAC,EAAE,SAAS,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,YAAa,SAAQ,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;IAC1E,+CAA+C;IAC/C,IAAI,EAAE,UAAU,CAAC;IACjB;;;OAGG;IACH,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B;;;OAGG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB;;;OAGG;IACH,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,6DAA6D;IAC7D,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAkND;;;;;;;;;;;GAWG;AACH,wBAAgB,OAAO,CAAC,EACtB,IAAI,EACJ,SAAoB,EACpB,IAAW,EACX,KAAiB,EACjB,WAAW,EACX,KAAK,EACL,GAAG,KAAK,EACT,EAAE,YAAY,+BAuEd;yBA/Ee,OAAO"}
|