@plenustech/design-system 0.2.2 → 0.2.4
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/dist/components/actions/ButtonTile/ButtonTile.cjs +2 -0
- package/dist/components/actions/ButtonTile/ButtonTile.cjs.map +1 -0
- package/dist/components/actions/ButtonTile/ButtonTile.js +23 -0
- package/dist/components/actions/ButtonTile/ButtonTile.js.map +1 -0
- package/dist/components/actions/ButtonTile/ButtonTile.module.css.cjs +2 -0
- package/dist/components/actions/ButtonTile/ButtonTile.module.css.cjs.map +1 -0
- package/dist/components/actions/ButtonTile/ButtonTile.module.css.js +16 -0
- package/dist/components/actions/ButtonTile/ButtonTile.module.css.js.map +1 -0
- package/dist/components/actions/Toolbar/Toolbar.cjs +2 -0
- package/dist/components/actions/Toolbar/Toolbar.cjs.map +1 -0
- package/dist/components/actions/Toolbar/Toolbar.js +118 -0
- package/dist/components/actions/Toolbar/Toolbar.js.map +1 -0
- package/dist/components/actions/Toolbar/Toolbar.module.css.cjs +2 -0
- package/dist/components/actions/Toolbar/Toolbar.module.css.cjs.map +1 -0
- package/dist/components/actions/Toolbar/Toolbar.module.css.js +20 -0
- package/dist/components/actions/Toolbar/Toolbar.module.css.js.map +1 -0
- package/dist/components/charts/ChartArea/ChartArea.cjs +1 -1
- package/dist/components/charts/ChartArea/ChartArea.cjs.map +1 -1
- package/dist/components/charts/ChartArea/ChartArea.js +196 -148
- package/dist/components/charts/ChartArea/ChartArea.js.map +1 -1
- package/dist/components/charts/ChartArea/ChartArea.module.css.cjs +1 -1
- package/dist/components/charts/ChartArea/ChartArea.module.css.js +12 -10
- package/dist/components/charts/ChartArea/ChartArea.module.css.js.map +1 -1
- package/dist/components/charts/ChartBar/ChartBar.cjs +1 -1
- package/dist/components/charts/ChartBar/ChartBar.cjs.map +1 -1
- package/dist/components/charts/ChartBar/ChartBar.js +168 -145
- package/dist/components/charts/ChartBar/ChartBar.js.map +1 -1
- package/dist/components/charts/ChartBar/ChartBar.module.css.cjs +1 -1
- package/dist/components/charts/ChartBar/ChartBar.module.css.js +12 -10
- package/dist/components/charts/ChartBar/ChartBar.module.css.js.map +1 -1
- package/dist/components/charts/ChartCombo/ChartCombo.cjs +1 -1
- package/dist/components/charts/ChartCombo/ChartCombo.cjs.map +1 -1
- package/dist/components/charts/ChartCombo/ChartCombo.js +179 -154
- package/dist/components/charts/ChartCombo/ChartCombo.js.map +1 -1
- package/dist/components/charts/ChartCombo/ChartCombo.module.css.cjs +1 -1
- package/dist/components/charts/ChartCombo/ChartCombo.module.css.js +16 -14
- package/dist/components/charts/ChartCombo/ChartCombo.module.css.js.map +1 -1
- package/dist/components/charts/ChartDonut/ChartDonut.cjs +1 -1
- package/dist/components/charts/ChartDonut/ChartDonut.cjs.map +1 -1
- package/dist/components/charts/ChartDonut/ChartDonut.js +72 -61
- package/dist/components/charts/ChartDonut/ChartDonut.js.map +1 -1
- package/dist/components/charts/ChartGauge/ChartGauge.cjs +2 -0
- package/dist/components/charts/ChartGauge/ChartGauge.cjs.map +1 -0
- package/dist/components/charts/ChartGauge/ChartGauge.js +307 -0
- package/dist/components/charts/ChartGauge/ChartGauge.js.map +1 -0
- package/dist/components/charts/ChartGauge/ChartGauge.module.css.cjs +2 -0
- package/dist/components/charts/ChartGauge/ChartGauge.module.css.cjs.map +1 -0
- package/dist/components/charts/ChartGauge/ChartGauge.module.css.js +76 -0
- package/dist/components/charts/ChartGauge/ChartGauge.module.css.js.map +1 -0
- package/dist/components/charts/ChartGauge/gaugeLayout.cjs +2 -0
- package/dist/components/charts/ChartGauge/gaugeLayout.cjs.map +1 -0
- package/dist/components/charts/ChartGauge/gaugeLayout.js +107 -0
- package/dist/components/charts/ChartGauge/gaugeLayout.js.map +1 -0
- package/dist/components/charts/ChartGauge/gaugeReading.cjs +2 -0
- package/dist/components/charts/ChartGauge/gaugeReading.cjs.map +1 -0
- package/dist/components/charts/ChartGauge/gaugeReading.js +112 -0
- package/dist/components/charts/ChartGauge/gaugeReading.js.map +1 -0
- package/dist/components/charts/ChartGauge/gaugeScale.cjs +2 -0
- package/dist/components/charts/ChartGauge/gaugeScale.cjs.map +1 -0
- package/dist/components/charts/ChartGauge/gaugeScale.js +57 -0
- package/dist/components/charts/ChartGauge/gaugeScale.js.map +1 -0
- package/dist/components/charts/ChartLine/ChartLine.cjs +1 -1
- package/dist/components/charts/ChartLine/ChartLine.cjs.map +1 -1
- package/dist/components/charts/ChartLine/ChartLine.js +196 -143
- package/dist/components/charts/ChartLine/ChartLine.js.map +1 -1
- package/dist/components/charts/ChartLine/ChartLine.module.css.cjs +1 -1
- package/dist/components/charts/ChartLine/ChartLine.module.css.js +16 -14
- package/dist/components/charts/ChartLine/ChartLine.module.css.js.map +1 -1
- package/dist/components/charts/ChartMap/ChartMap.cjs +2 -0
- package/dist/components/charts/ChartMap/ChartMap.cjs.map +1 -0
- package/dist/components/charts/ChartMap/ChartMap.js +523 -0
- package/dist/components/charts/ChartMap/ChartMap.js.map +1 -0
- package/dist/components/charts/ChartMap/ChartMap.module.css.cjs +2 -0
- package/dist/components/charts/ChartMap/ChartMap.module.css.cjs.map +1 -0
- package/dist/components/charts/ChartMap/ChartMap.module.css.js +124 -0
- package/dist/components/charts/ChartMap/ChartMap.module.css.js.map +1 -0
- package/dist/components/charts/ChartMap/ChartMapLegend.cjs +2 -0
- package/dist/components/charts/ChartMap/ChartMapLegend.cjs.map +1 -0
- package/dist/components/charts/ChartMap/ChartMapLegend.js +102 -0
- package/dist/components/charts/ChartMap/ChartMapLegend.js.map +1 -0
- package/dist/components/charts/ChartMap/ChartMapTable.cjs +2 -0
- package/dist/components/charts/ChartMap/ChartMapTable.cjs.map +1 -0
- package/dist/components/charts/ChartMap/ChartMapTable.js +118 -0
- package/dist/components/charts/ChartMap/ChartMapTable.js.map +1 -0
- package/dist/components/charts/ChartMap/mapGeometry.cjs +2 -0
- package/dist/components/charts/ChartMap/mapGeometry.cjs.map +1 -0
- package/dist/components/charts/ChartMap/mapGeometry.js +113 -0
- package/dist/components/charts/ChartMap/mapGeometry.js.map +1 -0
- package/dist/components/charts/ChartMap/mapLabels.cjs +2 -0
- package/dist/components/charts/ChartMap/mapLabels.cjs.map +1 -0
- package/dist/components/charts/ChartMap/mapLabels.js +80 -0
- package/dist/components/charts/ChartMap/mapLabels.js.map +1 -0
- package/dist/components/charts/ChartMap/mapScales.cjs +2 -0
- package/dist/components/charts/ChartMap/mapScales.cjs.map +1 -0
- package/dist/components/charts/ChartMap/mapScales.js +131 -0
- package/dist/components/charts/ChartMap/mapScales.js.map +1 -0
- package/dist/components/charts/ChartMap/polylabel.cjs +2 -0
- package/dist/components/charts/ChartMap/polylabel.cjs.map +1 -0
- package/dist/components/charts/ChartMap/polylabel.js +50 -0
- package/dist/components/charts/ChartMap/polylabel.js.map +1 -0
- package/dist/components/charts/ChartPie/ChartPie.cjs +1 -1
- package/dist/components/charts/ChartPie/ChartPie.cjs.map +1 -1
- package/dist/components/charts/ChartPie/ChartPie.js +71 -60
- package/dist/components/charts/ChartPie/ChartPie.js.map +1 -1
- package/dist/components/charts/ChartRadial/ChartRadial.cjs +1 -1
- package/dist/components/charts/ChartRadial/ChartRadial.cjs.map +1 -1
- package/dist/components/charts/ChartRadial/ChartRadial.js +101 -84
- package/dist/components/charts/ChartRadial/ChartRadial.js.map +1 -1
- package/dist/components/charts/ChartSankey/ChartSankey.cjs +1 -1
- package/dist/components/charts/ChartSankey/ChartSankey.cjs.map +1 -1
- package/dist/components/charts/ChartSankey/ChartSankey.js +148 -125
- package/dist/components/charts/ChartSankey/ChartSankey.js.map +1 -1
- package/dist/components/charts/ChartScatter/ChartScatter.cjs +1 -1
- package/dist/components/charts/ChartScatter/ChartScatter.cjs.map +1 -1
- package/dist/components/charts/ChartScatter/ChartScatter.js +138 -106
- package/dist/components/charts/ChartScatter/ChartScatter.js.map +1 -1
- package/dist/components/charts/ChartScatter/ChartScatter.module.css.cjs +1 -1
- package/dist/components/charts/ChartScatter/ChartScatter.module.css.js +3 -3
- package/dist/components/charts/ChartSunburst/ChartSunburst.cjs +1 -1
- package/dist/components/charts/ChartSunburst/ChartSunburst.cjs.map +1 -1
- package/dist/components/charts/ChartSunburst/ChartSunburst.js +115 -100
- package/dist/components/charts/ChartSunburst/ChartSunburst.js.map +1 -1
- package/dist/components/charts/ChartTimeline/ChartTimeline.cjs +2 -0
- package/dist/components/charts/ChartTimeline/ChartTimeline.cjs.map +1 -0
- package/dist/components/charts/ChartTimeline/ChartTimeline.js +703 -0
- package/dist/components/charts/ChartTimeline/ChartTimeline.js.map +1 -0
- package/dist/components/charts/ChartTimeline/ChartTimeline.module.css.cjs +2 -0
- package/dist/components/charts/ChartTimeline/ChartTimeline.module.css.cjs.map +1 -0
- package/dist/components/charts/ChartTimeline/ChartTimeline.module.css.js +124 -0
- package/dist/components/charts/ChartTimeline/ChartTimeline.module.css.js.map +1 -0
- package/dist/components/charts/ChartTimeline/ChartTimelineTable.cjs +2 -0
- package/dist/components/charts/ChartTimeline/ChartTimelineTable.cjs.map +1 -0
- package/dist/components/charts/ChartTimeline/ChartTimelineTable.js +42 -0
- package/dist/components/charts/ChartTimeline/ChartTimelineTable.js.map +1 -0
- package/dist/components/charts/ChartTimeline/timelineLayout.cjs +2 -0
- package/dist/components/charts/ChartTimeline/timelineLayout.cjs.map +1 -0
- package/dist/components/charts/ChartTimeline/timelineLayout.js +109 -0
- package/dist/components/charts/ChartTimeline/timelineLayout.js.map +1 -0
- package/dist/components/charts/ChartTimeline/timelineTime.cjs +2 -0
- package/dist/components/charts/ChartTimeline/timelineTime.cjs.map +1 -0
- package/dist/components/charts/ChartTimeline/timelineTime.js +91 -0
- package/dist/components/charts/ChartTimeline/timelineTime.js.map +1 -0
- package/dist/components/charts/ChartTimeline/timelineTooltip.cjs +2 -0
- package/dist/components/charts/ChartTimeline/timelineTooltip.cjs.map +1 -0
- package/dist/components/charts/ChartTimeline/timelineTooltip.js +77 -0
- package/dist/components/charts/ChartTimeline/timelineTooltip.js.map +1 -0
- package/dist/components/charts/ChartTooltip/ChartTooltip.cjs +1 -1
- package/dist/components/charts/ChartTooltip/ChartTooltip.cjs.map +1 -1
- package/dist/components/charts/ChartTooltip/ChartTooltip.js +1 -1
- package/dist/components/charts/ChartTooltip/ChartTooltip.js.map +1 -1
- package/dist/components/charts/ChartTreemap/ChartTreemap.cjs +1 -1
- package/dist/components/charts/ChartTreemap/ChartTreemap.cjs.map +1 -1
- package/dist/components/charts/ChartTreemap/ChartTreemap.js +100 -89
- package/dist/components/charts/ChartTreemap/ChartTreemap.js.map +1 -1
- package/dist/components/charts/ChartWaterfall/ChartWaterfall.cjs +1 -1
- package/dist/components/charts/ChartWaterfall/ChartWaterfall.cjs.map +1 -1
- package/dist/components/charts/ChartWaterfall/ChartWaterfall.js +125 -105
- package/dist/components/charts/ChartWaterfall/ChartWaterfall.js.map +1 -1
- package/dist/components/charts/ChartWaterfall/ChartWaterfall.module.css.cjs +1 -1
- package/dist/components/charts/ChartWaterfall/ChartWaterfall.module.css.js +8 -6
- package/dist/components/charts/ChartWaterfall/ChartWaterfall.module.css.js.map +1 -1
- package/dist/components/charts/core/CartesianFrame.cjs +1 -1
- package/dist/components/charts/core/CartesianFrame.cjs.map +1 -1
- package/dist/components/charts/core/CartesianFrame.js +61 -96
- package/dist/components/charts/core/CartesianFrame.js.map +1 -1
- package/dist/components/charts/core/Chart.module.css.cjs +1 -1
- package/dist/components/charts/core/Chart.module.css.js +52 -54
- package/dist/components/charts/core/Chart.module.css.js.map +1 -1
- package/dist/components/charts/core/ChartFrame.cjs +1 -1
- package/dist/components/charts/core/ChartFrame.cjs.map +1 -1
- package/dist/components/charts/core/ChartFrame.js +53 -47
- package/dist/components/charts/core/ChartFrame.js.map +1 -1
- package/dist/components/charts/core/ChartLegend.cjs +1 -1
- package/dist/components/charts/core/ChartLegend.cjs.map +1 -1
- package/dist/components/charts/core/ChartLegend.js +37 -25
- package/dist/components/charts/core/ChartLegend.js.map +1 -1
- package/dist/components/charts/core/PointBands.cjs +2 -0
- package/dist/components/charts/core/PointBands.cjs.map +1 -0
- package/dist/components/charts/core/PointBands.js +41 -0
- package/dist/components/charts/core/PointBands.js.map +1 -0
- package/dist/components/charts/core/cartesianLayout.cjs +1 -1
- package/dist/components/charts/core/cartesianLayout.cjs.map +1 -1
- package/dist/components/charts/core/cartesianLayout.js +49 -41
- package/dist/components/charts/core/cartesianLayout.js.map +1 -1
- package/dist/components/charts/core/hoverPath.cjs +2 -0
- package/dist/components/charts/core/hoverPath.cjs.map +1 -0
- package/dist/components/charts/core/hoverPath.js +7 -0
- package/dist/components/charts/core/hoverPath.js.map +1 -0
- package/dist/components/charts/core/pointLabels.cjs +2 -0
- package/dist/components/charts/core/pointLabels.cjs.map +1 -0
- package/dist/components/charts/core/pointLabels.js +12 -0
- package/dist/components/charts/core/pointLabels.js.map +1 -0
- package/dist/components/charts/core/tooltips.cjs +2 -0
- package/dist/components/charts/core/tooltips.cjs.map +1 -0
- package/dist/components/charts/core/tooltips.js +48 -0
- package/dist/components/charts/core/tooltips.js.map +1 -0
- package/dist/components/charts/core/useCartesianLayout.cjs +2 -0
- package/dist/components/charts/core/useCartesianLayout.cjs.map +1 -0
- package/dist/components/charts/core/useCartesianLayout.js +38 -0
- package/dist/components/charts/core/useCartesianLayout.js.map +1 -0
- package/dist/components/charts/core/useChartMetrics.cjs +1 -1
- package/dist/components/charts/core/useChartMetrics.cjs.map +1 -1
- package/dist/components/charts/core/useChartMetrics.js +20 -25
- package/dist/components/charts/core/useChartMetrics.js.map +1 -1
- package/dist/components/charts/core/useSeriesToggle.cjs +1 -1
- package/dist/components/charts/core/useSeriesToggle.cjs.map +1 -1
- package/dist/components/charts/core/useSeriesToggle.js +19 -12
- package/dist/components/charts/core/useSeriesToggle.js.map +1 -1
- package/dist/components/data-display/Accordion/Accordion.cjs +1 -1
- package/dist/components/data-display/Accordion/Accordion.cjs.map +1 -1
- package/dist/components/data-display/Accordion/Accordion.js +56 -46
- package/dist/components/data-display/Accordion/Accordion.js.map +1 -1
- package/dist/components/data-display/Accordion/Accordion.module.css.cjs +1 -1
- package/dist/components/data-display/Accordion/Accordion.module.css.js +16 -16
- package/dist/components/data-display/List/List.cjs.map +1 -1
- package/dist/components/data-display/List/List.js.map +1 -1
- package/dist/components/data-display/List/List.module.css.cjs +1 -1
- package/dist/components/data-display/List/List.module.css.js +34 -24
- package/dist/components/data-display/List/List.module.css.js.map +1 -1
- package/dist/components/data-display/List/ListingOptions.cjs +1 -1
- package/dist/components/data-display/List/ListingOptions.cjs.map +1 -1
- package/dist/components/data-display/List/ListingOptions.js +98 -74
- package/dist/components/data-display/List/ListingOptions.js.map +1 -1
- package/dist/components/data-display/List/useListing.cjs.map +1 -1
- package/dist/components/data-display/List/useListing.js.map +1 -1
- package/dist/components/data-display/SortableList/SortableList.cjs +2 -0
- package/dist/components/data-display/SortableList/SortableList.cjs.map +1 -0
- package/dist/components/data-display/SortableList/SortableList.js +168 -0
- package/dist/components/data-display/SortableList/SortableList.js.map +1 -0
- package/dist/components/data-display/SortableList/SortableList.module.css.cjs +2 -0
- package/dist/components/data-display/SortableList/SortableList.module.css.cjs.map +1 -0
- package/dist/components/data-display/SortableList/SortableList.module.css.js +34 -0
- package/dist/components/data-display/SortableList/SortableList.module.css.js.map +1 -0
- package/dist/components/data-display/Table/Table.cjs +1 -1
- package/dist/components/data-display/Table/Table.cjs.map +1 -1
- package/dist/components/data-display/Table/Table.js +86 -85
- package/dist/components/data-display/Table/Table.js.map +1 -1
- package/dist/components/data-display/Table/Table.module.css.cjs +1 -1
- package/dist/components/data-display/Table/Table.module.css.js +50 -51
- package/dist/components/data-display/Table/Table.module.css.js.map +1 -1
- package/dist/components/data-display/Tag/Tag.cjs +2 -0
- package/dist/components/data-display/Tag/Tag.cjs.map +1 -0
- package/dist/components/data-display/Tag/Tag.js +50 -0
- package/dist/components/data-display/Tag/Tag.js.map +1 -0
- package/dist/components/data-display/Tag/Tag.module.css.cjs +2 -0
- package/dist/components/data-display/Tag/Tag.module.css.cjs.map +1 -0
- package/dist/components/data-display/Tag/Tag.module.css.js +22 -0
- package/dist/components/data-display/Tag/Tag.module.css.js.map +1 -0
- package/dist/components/data-display/Timeline/Timeline.cjs +2 -0
- package/dist/components/data-display/Timeline/Timeline.cjs.map +1 -0
- package/dist/components/data-display/Timeline/Timeline.js +31 -0
- package/dist/components/data-display/Timeline/Timeline.js.map +1 -0
- package/dist/components/data-display/Timeline/Timeline.module.css.cjs +2 -0
- package/dist/components/data-display/Timeline/Timeline.module.css.cjs.map +1 -0
- package/dist/components/data-display/Timeline/Timeline.module.css.js +30 -0
- package/dist/components/data-display/Timeline/Timeline.module.css.js.map +1 -0
- package/dist/components/feedback/Skeleton/Skeleton.cjs +2 -0
- package/dist/components/feedback/Skeleton/Skeleton.cjs.map +1 -0
- package/dist/components/feedback/Skeleton/Skeleton.js +17 -0
- package/dist/components/feedback/Skeleton/Skeleton.js.map +1 -0
- package/dist/components/feedback/Skeleton/Skeleton.module.css.cjs +2 -0
- package/dist/components/feedback/Skeleton/Skeleton.module.css.cjs.map +1 -0
- package/dist/components/feedback/Skeleton/Skeleton.module.css.js +15 -0
- package/dist/components/feedback/Skeleton/Skeleton.module.css.js.map +1 -0
- package/dist/components/feedback/Toast/Toast.module.css.cjs +2 -0
- package/dist/components/feedback/Toast/Toast.module.css.cjs.map +1 -0
- package/dist/components/feedback/Toast/Toast.module.css.js +31 -0
- package/dist/components/feedback/Toast/Toast.module.css.js.map +1 -0
- package/dist/components/feedback/Toast/ToastRegion.cjs +2 -0
- package/dist/components/feedback/Toast/ToastRegion.cjs.map +1 -0
- package/dist/components/feedback/Toast/ToastRegion.js +62 -0
- package/dist/components/feedback/Toast/ToastRegion.js.map +1 -0
- package/dist/components/feedback/Toast/toastStore.cjs +2 -0
- package/dist/components/feedback/Toast/toastStore.cjs.map +1 -0
- package/dist/components/feedback/Toast/toastStore.js +33 -0
- package/dist/components/feedback/Toast/toastStore.js.map +1 -0
- package/dist/components/forms/Checkbox/Checkbox.cjs +1 -1
- package/dist/components/forms/Checkbox/Checkbox.cjs.map +1 -1
- package/dist/components/forms/Checkbox/Checkbox.js +43 -31
- package/dist/components/forms/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/forms/Checkbox/Checkbox.module.css.cjs +1 -1
- package/dist/components/forms/Checkbox/Checkbox.module.css.js +1 -1
- package/dist/components/forms/CheckboxGroup/CheckboxGroup.cjs +2 -0
- package/dist/components/forms/CheckboxGroup/CheckboxGroup.cjs.map +1 -0
- package/dist/components/forms/CheckboxGroup/CheckboxGroup.js +54 -0
- package/dist/components/forms/CheckboxGroup/CheckboxGroup.js.map +1 -0
- package/dist/components/forms/CheckboxGroup/CheckboxGroup.module.css.cjs +2 -0
- package/dist/components/forms/CheckboxGroup/CheckboxGroup.module.css.cjs.map +1 -0
- package/dist/components/forms/CheckboxGroup/CheckboxGroup.module.css.js +22 -0
- package/dist/components/forms/CheckboxGroup/CheckboxGroup.module.css.js.map +1 -0
- package/dist/components/forms/ColorPicker/ColorPicker.cjs +2 -0
- package/dist/components/forms/ColorPicker/ColorPicker.cjs.map +1 -0
- package/dist/components/forms/ColorPicker/ColorPicker.js +57 -0
- package/dist/components/forms/ColorPicker/ColorPicker.js.map +1 -0
- package/dist/components/forms/ColorPicker/ColorPicker.module.css.cjs +2 -0
- package/dist/components/forms/ColorPicker/ColorPicker.module.css.cjs.map +1 -0
- package/dist/components/forms/ColorPicker/ColorPicker.module.css.js +22 -0
- package/dist/components/forms/ColorPicker/ColorPicker.module.css.js.map +1 -0
- package/dist/components/forms/ComboBox/ComboBox.cjs.map +1 -1
- package/dist/components/forms/ComboBox/ComboBox.js.map +1 -1
- package/dist/components/forms/ComboBox/ComboBox.module.css.cjs +1 -1
- package/dist/components/forms/ComboBox/ComboBox.module.css.js +20 -20
- package/dist/components/forms/Field/Field.cjs +1 -1
- package/dist/components/forms/Field/Field.cjs.map +1 -1
- package/dist/components/forms/Field/Field.js +21 -20
- package/dist/components/forms/Field/Field.js.map +1 -1
- package/dist/components/forms/Field/Field.module.css.cjs +1 -1
- package/dist/components/forms/Field/Field.module.css.js +18 -12
- package/dist/components/forms/Field/Field.module.css.js.map +1 -1
- package/dist/components/forms/FileUpload/FileUpload.cjs +2 -0
- package/dist/components/forms/FileUpload/FileUpload.cjs.map +1 -0
- package/dist/components/forms/FileUpload/FileUpload.js +142 -0
- package/dist/components/forms/FileUpload/FileUpload.js.map +1 -0
- package/dist/components/forms/FileUpload/FileUpload.module.css.cjs +2 -0
- package/dist/components/forms/FileUpload/FileUpload.module.css.cjs.map +1 -0
- package/dist/components/forms/FileUpload/FileUpload.module.css.js +46 -0
- package/dist/components/forms/FileUpload/FileUpload.module.css.js.map +1 -0
- package/dist/components/forms/InputPassword/InputPassword.module.css.cjs +1 -1
- package/dist/components/forms/InputPassword/InputPassword.module.css.js +12 -12
- package/dist/components/forms/InputText/InputText.cjs +1 -1
- package/dist/components/forms/InputText/InputText.cjs.map +1 -1
- package/dist/components/forms/InputText/InputText.js +55 -47
- package/dist/components/forms/InputText/InputText.js.map +1 -1
- package/dist/components/forms/InputText/InputText.module.css.cjs +1 -1
- package/dist/components/forms/InputText/InputText.module.css.js +10 -10
- package/dist/components/forms/RadioGroup/RadioGroup.module.css.cjs +1 -1
- package/dist/components/forms/RadioGroup/RadioGroup.module.css.js +4 -4
- package/dist/components/forms/SegmentedControl/SegmentedControl.cjs +2 -0
- package/dist/components/forms/SegmentedControl/SegmentedControl.cjs.map +1 -0
- package/dist/components/forms/SegmentedControl/SegmentedControl.js +52 -0
- package/dist/components/forms/SegmentedControl/SegmentedControl.js.map +1 -0
- package/dist/components/forms/SegmentedControl/SegmentedControl.module.css.cjs +2 -0
- package/dist/components/forms/SegmentedControl/SegmentedControl.module.css.cjs.map +1 -0
- package/dist/components/forms/SegmentedControl/SegmentedControl.module.css.js +22 -0
- package/dist/components/forms/SegmentedControl/SegmentedControl.module.css.js.map +1 -0
- package/dist/components/forms/Select/Select.module.css.cjs +1 -1
- package/dist/components/forms/Select/Select.module.css.js +13 -13
- package/dist/components/forms/Switch/Switch.module.css.cjs +1 -1
- package/dist/components/forms/Switch/Switch.module.css.js +2 -2
- package/dist/components/icons/icons.cjs +1 -1
- package/dist/components/icons/icons.cjs.map +1 -1
- package/dist/components/icons/icons.js +198 -40
- package/dist/components/icons/icons.js.map +1 -1
- package/dist/components/navigation/SkipLink/SkipLink.cjs +2 -0
- package/dist/components/navigation/SkipLink/SkipLink.cjs.map +1 -0
- package/dist/components/navigation/SkipLink/SkipLink.js +9 -0
- package/dist/components/navigation/SkipLink/SkipLink.js.map +1 -0
- package/dist/components/navigation/SkipLink/SkipLink.module.css.cjs +2 -0
- package/dist/components/navigation/SkipLink/SkipLink.module.css.cjs.map +1 -0
- package/dist/components/navigation/SkipLink/SkipLink.module.css.js +8 -0
- package/dist/components/navigation/SkipLink/SkipLink.module.css.js.map +1 -0
- package/dist/components/navigation/Steps/Steps.cjs +2 -0
- package/dist/components/navigation/Steps/Steps.cjs.map +1 -0
- package/dist/components/navigation/Steps/Steps.js +30 -0
- package/dist/components/navigation/Steps/Steps.js.map +1 -0
- package/dist/components/navigation/Steps/Steps.module.css.cjs +2 -0
- package/dist/components/navigation/Steps/Steps.module.css.cjs.map +1 -0
- package/dist/components/navigation/Steps/Steps.module.css.js +26 -0
- package/dist/components/navigation/Steps/Steps.module.css.js.map +1 -0
- package/dist/components/navigation/Tabs/Tabs.cjs +1 -1
- package/dist/components/navigation/Tabs/Tabs.cjs.map +1 -1
- package/dist/components/navigation/Tabs/Tabs.js +88 -79
- package/dist/components/navigation/Tabs/Tabs.js.map +1 -1
- package/dist/components/navigation/Tabs/Tabs.module.css.cjs +1 -1
- package/dist/components/navigation/Tabs/Tabs.module.css.js +18 -14
- package/dist/components/navigation/Tabs/Tabs.module.css.js.map +1 -1
- package/dist/components/navigation/TabsNav/TabsNav.cjs +2 -0
- package/dist/components/navigation/TabsNav/TabsNav.cjs.map +1 -0
- package/dist/components/navigation/TabsNav/TabsNav.js +21 -0
- package/dist/components/navigation/TabsNav/TabsNav.js.map +1 -0
- package/dist/components/navigation/TabsNav/TabsNav.module.css.cjs +2 -0
- package/dist/components/navigation/TabsNav/TabsNav.module.css.cjs.map +1 -0
- package/dist/components/navigation/TabsNav/TabsNav.module.css.js +18 -0
- package/dist/components/navigation/TabsNav/TabsNav.module.css.js.map +1 -0
- package/dist/components/overlays/Dialog/Dialog.cjs +1 -1
- package/dist/components/overlays/Dialog/Dialog.cjs.map +1 -1
- package/dist/components/overlays/Dialog/Dialog.js +11 -58
- package/dist/components/overlays/Dialog/Dialog.js.map +1 -1
- package/dist/components/overlays/Dialog/DialogFrame.cjs +2 -0
- package/dist/components/overlays/Dialog/DialogFrame.cjs.map +1 -0
- package/dist/components/overlays/Dialog/DialogFrame.js +65 -0
- package/dist/components/overlays/Dialog/DialogFrame.js.map +1 -0
- package/dist/components/overlays/Drawer/Drawer.cjs +2 -0
- package/dist/components/overlays/Drawer/Drawer.cjs.map +1 -0
- package/dist/components/overlays/Drawer/Drawer.js +17 -0
- package/dist/components/overlays/Drawer/Drawer.js.map +1 -0
- package/dist/components/overlays/Drawer/Drawer.module.css.cjs +2 -0
- package/dist/components/overlays/Drawer/Drawer.module.css.cjs.map +1 -0
- package/dist/components/overlays/Drawer/Drawer.module.css.js +23 -0
- package/dist/components/overlays/Drawer/Drawer.module.css.js.map +1 -0
- package/dist/components/overlays/Menu/Menu.cjs +1 -1
- package/dist/components/overlays/Menu/Menu.cjs.map +1 -1
- package/dist/components/overlays/Menu/Menu.js +105 -86
- package/dist/components/overlays/Menu/Menu.js.map +1 -1
- package/dist/components/overlays/Menu/Menu.module.css.cjs +1 -1
- package/dist/components/overlays/Menu/Menu.module.css.js +24 -6
- package/dist/components/overlays/Menu/Menu.module.css.js.map +1 -1
- package/dist/design-system.css +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +190 -118
- package/dist/index.js.map +1 -1
- package/dist/types/components/actions/ButtonTile/ButtonTile.d.ts +14 -0
- package/dist/types/components/actions/ButtonTile/index.d.ts +2 -0
- package/dist/types/components/actions/Toolbar/Toolbar.d.ts +27 -0
- package/dist/types/components/actions/Toolbar/index.d.ts +2 -0
- package/dist/types/components/charts/ChartArea/ChartArea.d.ts +15 -4
- package/dist/types/components/charts/ChartBar/ChartBar.d.ts +11 -4
- package/dist/types/components/charts/ChartCombo/ChartCombo.d.ts +16 -4
- package/dist/types/components/charts/ChartDonut/ChartDonut.d.ts +5 -1
- package/dist/types/components/charts/ChartGauge/ChartGauge.d.ts +83 -0
- package/dist/types/components/charts/ChartGauge/gaugeLayout.d.ts +64 -0
- package/dist/types/components/charts/ChartGauge/gaugeReading.d.ts +97 -0
- package/dist/types/components/charts/ChartGauge/gaugeScale.d.ts +38 -0
- package/dist/types/components/charts/ChartGauge/index.d.ts +2 -0
- package/dist/types/components/charts/ChartLine/ChartLine.d.ts +15 -4
- package/dist/types/components/charts/ChartMap/ChartMap.d.ts +104 -0
- package/dist/types/components/charts/ChartMap/ChartMapLegend.d.ts +44 -0
- package/dist/types/components/charts/ChartMap/ChartMapTable.d.ts +38 -0
- package/dist/types/components/charts/ChartMap/index.d.ts +4 -0
- package/dist/types/components/charts/ChartMap/mapGeometry.d.ts +56 -0
- package/dist/types/components/charts/ChartMap/mapLabels.d.ts +51 -0
- package/dist/types/components/charts/ChartMap/mapScales.d.ts +76 -0
- package/dist/types/components/charts/ChartMap/polylabel.d.ts +9 -0
- package/dist/types/components/charts/ChartPie/ChartPie.d.ts +5 -1
- package/dist/types/components/charts/ChartRadial/ChartRadial.d.ts +5 -1
- package/dist/types/components/charts/ChartSankey/ChartSankey.d.ts +5 -1
- package/dist/types/components/charts/ChartScatter/ChartScatter.d.ts +7 -1
- package/dist/types/components/charts/ChartSunburst/ChartSunburst.d.ts +11 -2
- package/dist/types/components/charts/ChartTimeline/ChartTimeline.d.ts +137 -0
- package/dist/types/components/charts/ChartTimeline/ChartTimelineTable.d.ts +25 -0
- package/dist/types/components/charts/ChartTimeline/index.d.ts +2 -0
- package/dist/types/components/charts/ChartTimeline/timelineLayout.d.ts +70 -0
- package/dist/types/components/charts/ChartTimeline/timelineTime.d.ts +16 -0
- package/dist/types/components/charts/ChartTimeline/timelineTooltip.d.ts +45 -0
- package/dist/types/components/charts/ChartTooltip/ChartTooltip.d.ts +2 -0
- package/dist/types/components/charts/ChartTreemap/ChartTreemap.d.ts +11 -2
- package/dist/types/components/charts/ChartWaterfall/ChartWaterfall.d.ts +8 -3
- package/dist/types/components/charts/core/CartesianFrame.d.ts +6 -1
- package/dist/types/components/charts/core/ChartFrame.d.ts +7 -1
- package/dist/types/components/charts/core/ChartLegend.d.ts +3 -1
- package/dist/types/components/charts/core/PointBands.d.ts +22 -0
- package/dist/types/components/charts/core/cartesianLayout.d.ts +10 -4
- package/dist/types/components/charts/core/hoverPath.d.ts +10 -0
- package/dist/types/components/charts/core/index.d.ts +13 -3
- package/dist/types/components/charts/core/pointLabels.d.ts +13 -0
- package/dist/types/components/charts/core/tooltips.d.ts +49 -0
- package/dist/types/components/charts/core/useCartesianLayout.d.ts +20 -0
- package/dist/types/components/charts/core/useSeriesToggle.d.ts +15 -1
- package/dist/types/components/data-display/Accordion/Accordion.d.ts +6 -1
- package/dist/types/components/data-display/Accordion/index.d.ts +1 -1
- package/dist/types/components/data-display/List/List.d.ts +1 -1
- package/dist/types/components/data-display/List/useListing.d.ts +7 -1
- package/dist/types/components/data-display/SortableList/SortableList.d.ts +22 -0
- package/dist/types/components/data-display/SortableList/index.d.ts +2 -0
- package/dist/types/components/data-display/Tag/Tag.d.ts +13 -0
- package/dist/types/components/data-display/Tag/index.d.ts +2 -0
- package/dist/types/components/data-display/Timeline/Timeline.d.ts +15 -0
- package/dist/types/components/data-display/Timeline/index.d.ts +2 -0
- package/dist/types/components/feedback/Skeleton/Skeleton.d.ts +13 -0
- package/dist/types/components/feedback/Skeleton/index.d.ts +2 -0
- package/dist/types/components/feedback/Toast/ToastRegion.d.ts +2 -0
- package/dist/types/components/feedback/Toast/index.d.ts +3 -0
- package/dist/types/components/feedback/Toast/toastStore.d.ts +24 -0
- package/dist/types/components/forms/CheckboxGroup/CheckboxGroup.d.ts +28 -0
- package/dist/types/components/forms/CheckboxGroup/index.d.ts +2 -0
- package/dist/types/components/forms/ColorPicker/ColorPicker.d.ts +26 -0
- package/dist/types/components/forms/ColorPicker/index.d.ts +2 -0
- package/dist/types/components/forms/ComboBox/ComboBox.d.ts +7 -1
- package/dist/types/components/forms/Field/Field.d.ts +6 -2
- package/dist/types/components/forms/Field/index.d.ts +1 -1
- package/dist/types/components/forms/FileUpload/FileUpload.d.ts +37 -0
- package/dist/types/components/forms/FileUpload/index.d.ts +2 -0
- package/dist/types/components/forms/InputText/InputText.d.ts +4 -2
- package/dist/types/components/forms/SegmentedControl/SegmentedControl.d.ts +23 -0
- package/dist/types/components/forms/SegmentedControl/index.d.ts +2 -0
- package/dist/types/components/icons/icons.d.ts +29 -0
- package/dist/types/components/icons/index.d.ts +1 -1
- package/dist/types/components/navigation/SkipLink/SkipLink.d.ts +7 -0
- package/dist/types/components/navigation/SkipLink/index.d.ts +2 -0
- package/dist/types/components/navigation/Steps/Steps.d.ts +16 -0
- package/dist/types/components/navigation/Steps/index.d.ts +2 -0
- package/dist/types/components/navigation/Tabs/Tabs.d.ts +5 -1
- package/dist/types/components/navigation/TabsNav/TabsNav.d.ts +20 -0
- package/dist/types/components/navigation/TabsNav/index.d.ts +2 -0
- package/dist/types/components/overlays/Dialog/Dialog.d.ts +21 -9
- package/dist/types/components/overlays/Dialog/DialogFrame.d.ts +13 -0
- package/dist/types/components/overlays/Drawer/Drawer.d.ts +9 -0
- package/dist/types/components/overlays/Drawer/index.d.ts +2 -0
- package/dist/types/components/overlays/Menu/Menu.d.ts +16 -2
- package/dist/types/components/overlays/Menu/index.d.ts +1 -1
- package/dist/types/index.d.ts +43 -7
- package/dist/types/utils/formatters/formatarDuracao.d.ts +5 -0
- package/dist/types/utils/formatters/formatarNumero.d.ts +6 -1
- package/dist/types/utils/formatters/formatarTamanhoDeArquivo.d.ts +7 -0
- package/dist/types/utils/formatters/index.d.ts +4 -1
- package/dist/utils/formatters/formatarDuracao.cjs +2 -0
- package/dist/utils/formatters/formatarDuracao.cjs.map +1 -0
- package/dist/utils/formatters/formatarDuracao.js +10 -0
- package/dist/utils/formatters/formatarDuracao.js.map +1 -0
- package/dist/utils/formatters/formatarNumero.cjs +1 -1
- package/dist/utils/formatters/formatarNumero.cjs.map +1 -1
- package/dist/utils/formatters/formatarNumero.js +42 -17
- package/dist/utils/formatters/formatarNumero.js.map +1 -1
- package/dist/utils/formatters/formatarTamanhoDeArquivo.cjs +2 -0
- package/dist/utils/formatters/formatarTamanhoDeArquivo.cjs.map +1 -0
- package/dist/utils/formatters/formatarTamanhoDeArquivo.js +17 -0
- package/dist/utils/formatters/formatarTamanhoDeArquivo.js.map +1 -0
- package/package.json +3 -1
|
@@ -1,158 +1,178 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import
|
|
4
|
-
import { useChartMetrics as
|
|
5
|
-
import { useHoveredBand as
|
|
6
|
-
import { resolveSeriesColors as
|
|
7
|
-
import { domainOf as
|
|
8
|
-
import { valueLabelsFor as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { jsxs as Z, jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as f } from "react";
|
|
3
|
+
import p from "./ChartWaterfall.module.css.js";
|
|
4
|
+
import { useChartMetrics as V } from "../core/useChartMetrics.js";
|
|
5
|
+
import { useHoveredBand as oo } from "../core/useHoveredBand.js";
|
|
6
|
+
import { resolveSeriesColors as to } from "../palette/seriesColor.js";
|
|
7
|
+
import { domainOf as io, bandScale as ro, linearScale as E, ticksFor as eo } from "../scales/scales.js";
|
|
8
|
+
import { valueLabelsFor as no, markShown as ao, chartHeight as lo } from "../core/cartesianLayout.js";
|
|
9
|
+
import { useCartesianLayout as mo } from "../core/useCartesianLayout.js";
|
|
10
|
+
import { valueLabelRoom as uo } from "../core/spacing.js";
|
|
11
|
+
import { useTweenedNumbers as so } from "../core/useTweenedNumbers.js";
|
|
12
|
+
import { formatarNumero as co } from "../../../utils/formatters/formatarNumero.js";
|
|
13
|
+
import { CartesianFrame as ho } from "../core/CartesianFrame.js";
|
|
14
|
+
import { BandCursor as fo } from "../core/BandCursor.js";
|
|
15
|
+
import { roundedBarPath as bo } from "../core/shapes.js";
|
|
16
|
+
function vo(e) {
|
|
17
|
+
let m = 0;
|
|
18
|
+
return e.map((n) => {
|
|
19
|
+
if (!Number.isFinite(n.value))
|
|
19
20
|
return null;
|
|
20
|
-
const
|
|
21
|
-
return
|
|
21
|
+
const b = n.total ? 0 : m, v = b + n.value;
|
|
22
|
+
return m = v, { inicio: b, fim: v };
|
|
22
23
|
});
|
|
23
24
|
}
|
|
24
|
-
function
|
|
25
|
-
return
|
|
25
|
+
function go(e) {
|
|
26
|
+
return e.intent ? e.intent : e.total ? "neutral" : e.value < 0 ? "negative" : "positive";
|
|
26
27
|
}
|
|
27
|
-
function
|
|
28
|
-
return
|
|
28
|
+
function O(e, m) {
|
|
29
|
+
return e === 0 ? m(0) : `${e < 0 ? "-" : "+"}${m(Math.abs(e))}`;
|
|
29
30
|
}
|
|
30
|
-
function
|
|
31
|
-
emptyMessage:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
function Bo({
|
|
32
|
+
emptyMessage: e = "Sem dados no período",
|
|
33
|
+
formatTooltipValue: m,
|
|
34
|
+
formatValue: n = co,
|
|
35
|
+
height: b = 280,
|
|
36
|
+
labelAngle: v = "auto",
|
|
37
|
+
onHoverStep: T,
|
|
38
|
+
showDataLabels: x = "visible",
|
|
39
|
+
showTooltip: W = !0,
|
|
37
40
|
steps: r,
|
|
38
|
-
title:
|
|
39
|
-
xAxis:
|
|
40
|
-
yAxis:
|
|
41
|
-
yAxisRight:
|
|
41
|
+
title: _,
|
|
42
|
+
xAxis: D = "visible",
|
|
43
|
+
yAxis: S = "visible",
|
|
44
|
+
yAxisRight: C = "hidden"
|
|
42
45
|
}) {
|
|
43
|
-
|
|
44
|
-
|
|
46
|
+
var z;
|
|
47
|
+
const { font: N, height: q, radius: g, ref: G, width: $ } = V(), { fillHeight: I, value: M } = lo(b, q), { hover: k, hovered: s } = oo(T), u = f(() => vo(r), [r]), w = f(
|
|
48
|
+
() => to(r.map((o) => ({ color: o.color, intent: go(o) }))),
|
|
45
49
|
[r]
|
|
46
|
-
),
|
|
47
|
-
() =>
|
|
48
|
-
[
|
|
49
|
-
),
|
|
50
|
+
), y = f(
|
|
51
|
+
() => io(u.flatMap((o) => o ? [o.inicio, o.fim] : [])),
|
|
52
|
+
[u]
|
|
53
|
+
), F = no(y, M, n), { axisReveal: J, margins: K, plot: l, rotation: Q } = mo({
|
|
50
54
|
bottomLabels: r.map((o) => o.label),
|
|
51
|
-
font:
|
|
52
|
-
height:
|
|
53
|
-
labelAngle:
|
|
54
|
-
leftLabels:
|
|
55
|
-
rightLabels:
|
|
56
|
-
topRoom:
|
|
57
|
-
width:
|
|
58
|
-
xAxis:
|
|
59
|
-
yAxis:
|
|
60
|
-
yAxisRight:
|
|
61
|
-
}),
|
|
62
|
-
() =>
|
|
55
|
+
font: N,
|
|
56
|
+
height: M,
|
|
57
|
+
labelAngle: v,
|
|
58
|
+
leftLabels: F,
|
|
59
|
+
rightLabels: F,
|
|
60
|
+
topRoom: x === "hidden" ? 0 : uo(N),
|
|
61
|
+
width: $,
|
|
62
|
+
xAxis: D,
|
|
63
|
+
yAxis: S,
|
|
64
|
+
yAxisRight: C
|
|
65
|
+
}), c = f(
|
|
66
|
+
() => ro({ domain: r.map((o, t) => String(t)), range: [0, l.width] }),
|
|
63
67
|
[l.width, r]
|
|
64
|
-
),
|
|
65
|
-
() =>
|
|
66
|
-
[
|
|
67
|
-
), [R,
|
|
68
|
-
() =>
|
|
69
|
-
[
|
|
70
|
-
),
|
|
68
|
+
), h = (o) => c(String(o)) ?? 0, P = f(
|
|
69
|
+
() => E({ domain: y, range: [l.height, 0] }),
|
|
70
|
+
[y, l.height]
|
|
71
|
+
), [R, B] = so(P.domain()), a = f(
|
|
72
|
+
() => E({ domain: { min: R, max: B }, nice: !1, range: [l.height, 0] }),
|
|
73
|
+
[B, R, l.height]
|
|
74
|
+
), H = eo(P, l.height), U = r.map((o, t) => ({
|
|
71
75
|
label: o.label,
|
|
72
|
-
position:
|
|
73
|
-
})),
|
|
74
|
-
label:
|
|
76
|
+
position: h(t) + c.bandwidth() / 2
|
|
77
|
+
})), A = H.map((o) => ({
|
|
78
|
+
label: n(o),
|
|
75
79
|
position: a(o)
|
|
76
80
|
}));
|
|
77
81
|
function j(o) {
|
|
78
|
-
return o.total ?
|
|
82
|
+
return o.total ? n(o.value) : O(o.value, n);
|
|
79
83
|
}
|
|
80
|
-
|
|
81
|
-
|
|
84
|
+
function X(o) {
|
|
85
|
+
if (o === null || !u[o])
|
|
86
|
+
return [];
|
|
87
|
+
const t = r[o];
|
|
88
|
+
return t.total ? [{ color: w[o], label: "Total", values: [t.value] }] : [
|
|
89
|
+
{ color: w[o], format: (i) => O(i, m ?? n), label: "Variação", values: [t.value] },
|
|
90
|
+
{ label: "Acumulado", values: [u[o].fim] }
|
|
91
|
+
];
|
|
92
|
+
}
|
|
93
|
+
return /* @__PURE__ */ Z(
|
|
94
|
+
ho,
|
|
82
95
|
{
|
|
83
|
-
|
|
96
|
+
axisReveal: J,
|
|
97
|
+
containerRef: G,
|
|
84
98
|
empty: r.length === 0,
|
|
85
|
-
emptyMessage:
|
|
99
|
+
emptyMessage: e,
|
|
86
100
|
grid: [
|
|
87
101
|
{
|
|
88
102
|
baseline: a(0),
|
|
89
|
-
lines:
|
|
103
|
+
lines: H.map((o) => a(o)),
|
|
90
104
|
orientation: "horizontal"
|
|
91
105
|
}
|
|
92
106
|
],
|
|
93
|
-
fillHeight:
|
|
94
|
-
height:
|
|
107
|
+
fillHeight: I,
|
|
108
|
+
height: M,
|
|
95
109
|
legendPosition: "none",
|
|
96
|
-
margins:
|
|
110
|
+
margins: K,
|
|
97
111
|
plot: l,
|
|
98
|
-
title:
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
112
|
+
title: _,
|
|
113
|
+
tooltip: W ? {
|
|
114
|
+
columns: [{ format: m ?? n }],
|
|
115
|
+
computed: "none",
|
|
116
|
+
rows: X(s),
|
|
117
|
+
title: s === null || (z = r[s]) == null ? void 0 : z.label
|
|
118
|
+
} : void 0,
|
|
119
|
+
width: $,
|
|
120
|
+
xAxis: { labelRotation: Q, ticks: U, visibility: D },
|
|
121
|
+
yAxis: { hideLine: !0, ticks: A, visibility: S },
|
|
122
|
+
yAxisRight: { hideLine: !0, ticks: A, visibility: C },
|
|
103
123
|
children: [
|
|
104
|
-
|
|
105
|
-
/* @__PURE__ */
|
|
106
|
-
if (!o || !
|
|
124
|
+
s !== null && /* @__PURE__ */ d(fo, { offset: h(s), plot: l, size: c.bandwidth() }),
|
|
125
|
+
/* @__PURE__ */ d("g", { "aria-hidden": "true", children: u.slice(0, -1).map((o, t) => {
|
|
126
|
+
if (!o || !u[t + 1])
|
|
107
127
|
return null;
|
|
108
|
-
const
|
|
109
|
-
return /* @__PURE__ */
|
|
128
|
+
const i = a(o.fim);
|
|
129
|
+
return /* @__PURE__ */ d(
|
|
110
130
|
"line",
|
|
111
131
|
{
|
|
112
|
-
className:
|
|
113
|
-
x1:
|
|
114
|
-
x2:
|
|
115
|
-
y1:
|
|
116
|
-
y2:
|
|
132
|
+
className: p.connector,
|
|
133
|
+
x1: h(t) + c.bandwidth(),
|
|
134
|
+
x2: h(t + 1),
|
|
135
|
+
y1: i,
|
|
136
|
+
y2: i
|
|
117
137
|
},
|
|
118
138
|
t
|
|
119
139
|
);
|
|
120
140
|
}) }),
|
|
121
141
|
r.map((o, t) => {
|
|
122
|
-
const
|
|
123
|
-
if (!
|
|
142
|
+
const i = u[t];
|
|
143
|
+
if (!i)
|
|
124
144
|
return null;
|
|
125
|
-
const
|
|
126
|
-
return /* @__PURE__ */
|
|
145
|
+
const L = Math.min(a(i.inicio), a(i.fim)), Y = Math.abs(a(i.fim) - a(i.inicio));
|
|
146
|
+
return /* @__PURE__ */ d(
|
|
127
147
|
"path",
|
|
128
148
|
{
|
|
129
149
|
"aria-label": `${o.label}: ${j(o)}`,
|
|
130
|
-
className:
|
|
131
|
-
d:
|
|
150
|
+
className: p.bar,
|
|
151
|
+
d: bo(h(t), L, c.bandwidth(), Y, [
|
|
132
152
|
g,
|
|
133
153
|
g,
|
|
134
154
|
g,
|
|
135
155
|
g
|
|
136
156
|
]),
|
|
137
|
-
fill:
|
|
138
|
-
onMouseEnter: () =>
|
|
139
|
-
onMouseLeave: () =>
|
|
157
|
+
fill: w[t],
|
|
158
|
+
onMouseEnter: () => k(t),
|
|
159
|
+
onMouseLeave: () => k(null)
|
|
140
160
|
},
|
|
141
161
|
t
|
|
142
162
|
);
|
|
143
163
|
}),
|
|
144
|
-
|
|
145
|
-
const
|
|
146
|
-
if (!
|
|
164
|
+
x !== "hidden" && r.map((o, t) => {
|
|
165
|
+
const i = u[t];
|
|
166
|
+
if (!i)
|
|
147
167
|
return null;
|
|
148
|
-
const
|
|
149
|
-
return /* @__PURE__ */
|
|
168
|
+
const L = Math.min(a(i.inicio), a(i.fim));
|
|
169
|
+
return /* @__PURE__ */ d(
|
|
150
170
|
"text",
|
|
151
171
|
{
|
|
152
|
-
className:
|
|
172
|
+
className: `${p.valueLabel} ${ao(x, t === s) ? "" : p.valueLabelHidden}`,
|
|
153
173
|
textAnchor: "middle",
|
|
154
|
-
x:
|
|
155
|
-
y:
|
|
174
|
+
x: h(t) + c.bandwidth() / 2,
|
|
175
|
+
y: L - 6,
|
|
156
176
|
children: j(o)
|
|
157
177
|
},
|
|
158
178
|
t
|
|
@@ -163,6 +183,6 @@ function Co({
|
|
|
163
183
|
);
|
|
164
184
|
}
|
|
165
185
|
export {
|
|
166
|
-
|
|
186
|
+
Bo as ChartWaterfall
|
|
167
187
|
};
|
|
168
188
|
//# sourceMappingURL=ChartWaterfall.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartWaterfall.js","sources":["../../../../src/components/charts/ChartWaterfall/ChartWaterfall.tsx"],"sourcesContent":["import { useMemo } from 'react';\nimport {\n BandCursor,\n CartesianFrame,\n cartesianLayout,\n chartHeight,\n roundedBarPath,\n useChartMetrics,\n useHoveredBand,\n useTweenedNumbers,\n valueLabelRoom,\n valueLabelsFor,\n type AxisLabelAngle,\n type AxisTick,\n type AxisVisibility,\n type ChartHeight,\n} from '../core';\nimport { resolveSeriesColors, type SeriesIntent } from '../palette';\nimport { bandScale, domainOf, linearScale, ticksFor } from '../scales';\nimport { formatarNumero } from '../../../utils/formatters';\nimport styles from './ChartWaterfall.module.css';\n\nexport interface ChartWaterfallStep {\n color?: string;\n intent?: SeriesIntent;\n label: string;\n total?: boolean;\n value: number;\n}\n\nexport interface ChartWaterfallProps {\n emptyMessage?: string;\n formatValue?: (value: number) => string;\n height?: ChartHeight;\n labelAngle?: AxisLabelAngle;\n /** Indice do passo sob o ponteiro, ou `null` ao sair dele. */\n onHoverStep?: (index: number | null) => void;\n showDataLabels?: boolean;\n steps: readonly ChartWaterfallStep[];\n title: string;\n xAxis?: AxisVisibility;\n yAxis?: AxisVisibility;\n yAxisRight?: AxisVisibility;\n}\n\ninterface Trecho {\n fim: number;\n inicio: number;\n}\n\n/**\n * Cada passo ocupa a faixa entre o acumulado anterior e o novo acumulado; o total parte do zero, porque\n * fecha a conta. Passo invalido e ausente: nao se desenha nem move o acumulado.\n */\nfunction trechosDe(steps: readonly ChartWaterfallStep[]): (Trecho | null)[] {\n let acumulado = 0;\n\n return steps.map((passo) => {\n if (!Number.isFinite(passo.value)) {\n return null;\n }\n\n const inicio = passo.total ? 0 : acumulado;\n const fim = inicio + passo.value;\n acumulado = fim;\n\n return { inicio, fim };\n });\n}\n\n/** Passo sem intencao declarada recebe a do seu sinal. Total e fechamento, nao aporte. */\nfunction intencaoDe(step: ChartWaterfallStep): SeriesIntent {\n if (step.intent) {\n return step.intent;\n }\n\n if (step.total) {\n return 'neutral';\n }\n\n return step.value < 0 ? 'negative' : 'positive';\n}\n\n/**\n * O sinal e do grafico, nao do formatador: ele formata a magnitude. Delegar o\n * sinal perderia a variacao com qualquer formatador que exiba apenas o valor.\n */\nfunction comSinal(value: number, formatValue: (value: number) => string) {\n if (value === 0) {\n return formatValue(0);\n }\n\n return `${value < 0 ? '-' : '+'}${formatValue(Math.abs(value))}`;\n}\n\nexport function ChartWaterfall({\n emptyMessage = 'Sem dados no período',\n formatValue = formatarNumero,\n height = 280,\n labelAngle = 'auto',\n onHoverStep,\n showDataLabels = true,\n steps,\n title,\n xAxis = 'visible',\n yAxis = 'visible',\n yAxisRight = 'hidden',\n}: ChartWaterfallProps) {\n const { font, height: alturaMedida, radius: raioDoCanto, ref, width } = useChartMetrics();\n const { fillHeight, value: alturaDoDesenho } = chartHeight(height, alturaMedida);\n const { hover: focarPasso, hovered: passoEmFoco } = useHoveredBand(onHoverStep);\n\n const trechos = useMemo(() => trechosDe(steps), [steps]);\n\n const cores = useMemo(\n () => resolveSeriesColors(steps.map((passo) => ({ color: passo.color, intent: intencaoDe(passo) }))),\n [steps],\n );\n\n const dominio = useMemo(\n () => domainOf(trechos.flatMap((trecho) => (trecho ? [trecho.inicio, trecho.fim] : []))),\n [trechos],\n );\n\n const rotulosDeValor = valueLabelsFor(dominio, alturaDoDesenho, formatValue);\n\n const { margins, plot, rotation } = cartesianLayout({\n bottomLabels: steps.map((passo) => passo.label),\n font,\n height: alturaDoDesenho,\n labelAngle,\n leftLabels: rotulosDeValor,\n rightLabels: rotulosDeValor,\n topRoom: showDataLabels ? valueLabelRoom(font) : 0,\n width,\n xAxis,\n yAxis,\n yAxisRight,\n });\n\n // A faixa e indexada pela posicao, nao pelo rotulo: numa sequencia de passos o\n // mesmo rotulo pode repetir, e a escala categorica funde dominios iguais.\n const escalaPassos = useMemo(\n () => bandScale({ domain: steps.map((_, indice) => String(indice)), range: [0, plot.width] }),\n [plot.width, steps],\n );\n\n const faixaDe = (indice: number) => escalaPassos(String(indice)) ?? 0;\n\n // A escala alvo fixa as marcas; a animada posiciona o desenho. Sem separar as\n // duas, as marcas exibiriam valores quebrados durante a transicao.\n const escalaAlvo = useMemo(\n () => linearScale({ domain: dominio, range: [plot.height, 0] }),\n [dominio, plot.height],\n );\n\n const [minimo, maximo] = useTweenedNumbers(escalaAlvo.domain());\n\n const escalaValores = useMemo(\n () => linearScale({ domain: { min: minimo, max: maximo }, nice: false, range: [plot.height, 0] }),\n [maximo, minimo, plot.height],\n );\n\n const marcasDeValor = ticksFor(escalaAlvo, plot.height);\n\n const marcasPassos: AxisTick[] = steps.map((passo, indice) => ({\n label: passo.label,\n position: faixaDe(indice) + escalaPassos.bandwidth() / 2,\n }));\n\n const marcasValor: AxisTick[] = marcasDeValor.map((valor) => ({\n label: formatValue(valor),\n position: escalaValores(valor),\n }));\n\n function rotuloDe(passo: ChartWaterfallStep) {\n return passo.total ? formatValue(passo.value) : comSinal(passo.value, formatValue);\n }\n\n return (\n <CartesianFrame\n containerRef={ref}\n empty={steps.length === 0}\n emptyMessage={emptyMessage}\n grid={[\n {\n baseline: escalaValores(0),\n lines: marcasDeValor.map((valor) => escalaValores(valor)),\n orientation: 'horizontal',\n },\n ]}\n fillHeight={fillHeight}\n height={alturaDoDesenho}\n legendPosition=\"none\"\n margins={margins}\n plot={plot}\n title={title}\n width={width}\n xAxis={{ labelRotation: rotation, ticks: marcasPassos, visibility: xAxis }}\n yAxis={{ hideLine: true, ticks: marcasValor, visibility: yAxis }}\n yAxisRight={{ hideLine: true, ticks: marcasValor, visibility: yAxisRight }}\n >\n {passoEmFoco !== null && (\n <BandCursor offset={faixaDe(passoEmFoco)} plot={plot} size={escalaPassos.bandwidth()} />\n )}\n\n <g aria-hidden=\"true\">\n {trechos.slice(0, -1).map((trecho, indice) => {\n if (!trecho || !trechos[indice + 1]) {\n return null;\n }\n\n const nivel = escalaValores(trecho.fim);\n\n return (\n <line\n className={styles.connector}\n key={indice}\n x1={faixaDe(indice) + escalaPassos.bandwidth()}\n x2={faixaDe(indice + 1)}\n y1={nivel}\n y2={nivel}\n />\n );\n })}\n </g>\n\n {steps.map((passo, indice) => {\n const trecho = trechos[indice];\n\n if (!trecho) {\n return null;\n }\n\n const topo = Math.min(escalaValores(trecho.inicio), escalaValores(trecho.fim));\n const altura = Math.abs(escalaValores(trecho.fim) - escalaValores(trecho.inicio));\n\n return (\n <path\n aria-label={`${passo.label}: ${rotuloDe(passo)}`}\n className={styles.bar}\n d={roundedBarPath(faixaDe(indice), topo, escalaPassos.bandwidth(), altura, [\n raioDoCanto,\n raioDoCanto,\n raioDoCanto,\n raioDoCanto,\n ])}\n fill={cores[indice]}\n key={indice}\n onMouseEnter={() => focarPasso(indice)}\n onMouseLeave={() => focarPasso(null)}\n />\n );\n })}\n\n {showDataLabels &&\n steps.map((passo, indice) => {\n const trecho = trechos[indice];\n\n if (!trecho) {\n return null;\n }\n\n const topo = Math.min(escalaValores(trecho.inicio), escalaValores(trecho.fim));\n\n return (\n <text\n className={styles.valueLabel}\n key={indice}\n textAnchor=\"middle\"\n x={faixaDe(indice) + escalaPassos.bandwidth() / 2}\n y={topo - 6}\n >\n {rotuloDe(passo)}\n </text>\n );\n })}\n </CartesianFrame>\n );\n}\n"],"names":["trechosDe","steps","acumulado","passo","inicio","fim","intencaoDe","step","comSinal","value","formatValue","ChartWaterfall","emptyMessage","formatarNumero","height","labelAngle","onHoverStep","showDataLabels","title","xAxis","yAxis","yAxisRight","font","alturaMedida","raioDoCanto","ref","width","useChartMetrics","fillHeight","alturaDoDesenho","chartHeight","focarPasso","passoEmFoco","useHoveredBand","trechos","useMemo","cores","resolveSeriesColors","dominio","domainOf","trecho","rotulosDeValor","valueLabelsFor","margins","plot","rotation","cartesianLayout","valueLabelRoom","escalaPassos","bandScale","_","indice","faixaDe","escalaAlvo","linearScale","minimo","maximo","useTweenedNumbers","escalaValores","marcasDeValor","ticksFor","marcasPassos","marcasValor","valor","rotuloDe","jsxs","CartesianFrame","jsx","BandCursor","nivel","styles","topo","altura","roundedBarPath"],"mappings":";;;;;;;;;;;;;;AAsDA,SAASA,GAAUC,GAAyD;AAC1E,MAAIC,IAAY;AAEhB,SAAOD,EAAM,IAAI,CAACE,MAAU;AAC1B,QAAI,CAAC,OAAO,SAASA,EAAM,KAAK;AAC9B,aAAO;AAGT,UAAMC,IAASD,EAAM,QAAQ,IAAID,GAC3BG,IAAMD,IAASD,EAAM;AAC3B,WAAAD,IAAYG,GAEL,EAAE,QAAAD,GAAQ,KAAAC,EAAA;AAAA,EACnB,CAAC;AACH;AAGA,SAASC,GAAWC,GAAwC;AAC1D,SAAIA,EAAK,SACAA,EAAK,SAGVA,EAAK,QACA,YAGFA,EAAK,QAAQ,IAAI,aAAa;AACvC;AAMA,SAASC,GAASC,GAAeC,GAAwC;AACvE,SAAID,MAAU,IACLC,EAAY,CAAC,IAGf,GAAGD,IAAQ,IAAI,MAAM,GAAG,GAAGC,EAAY,KAAK,IAAID,CAAK,CAAC,CAAC;AAChE;AAEO,SAASE,GAAe;AAAA,EAC7B,cAAAC,IAAe;AAAA,EACf,aAAAF,IAAcG;AAAA,EACd,QAAAC,IAAS;AAAA,EACT,YAAAC,IAAa;AAAA,EACb,aAAAC;AAAA,EACA,gBAAAC,IAAiB;AAAA,EACjB,OAAAhB;AAAA,EACA,OAAAiB;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,OAAAC,IAAQ;AAAA,EACR,YAAAC,IAAa;AACf,GAAwB;AACtB,QAAM,EAAE,MAAAC,GAAM,QAAQC,GAAc,QAAQC,GAAa,KAAAC,GAAK,OAAAC,EAAA,IAAUC,EAAA,GAClE,EAAE,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AClB,GAAGG,GAAerB,EAAQD,CAAM,GAAGoB,GAAMvB,EAAa,UAAA,GAAawB,GAAQ;AAAA,gBACzEhD;AAAA,gBACAA;AAAA,gBACAA;AAAA,gBACAA;AAAA,cAAA,CACD;AAAA,cACD,MAAMY,EAAMe,CAAM;AAAA,cAElB,cAAc,MAAMpB,EAAWoB,CAAM;AAAA,cACrC,cAAc,MAAMpB,EAAW,IAAI;AAAA,YAAA;AAAA,YAF9BoB;AAAA,UAAA;AAAA,QAKX,CAAC;AAAA,QAEAlC,KACChB,EAAM,IAAI,CAACE,GAAOgD,MAAW;AAC3B,gBAAMX,IAASN,EAAQiB,CAAM;AAE7B,cAAI,CAACX;AACH,mBAAO;AAGT,gBAAM+B,IAAO,KAAK,IAAIb,EAAclB,EAAO,MAAM,GAAGkB,EAAclB,EAAO,GAAG,CAAC;AAE7E,iBACE,gBAAA2B;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAWG,EAAO;AAAA,cAElB,YAAW;AAAA,cACX,GAAGlB,EAAQD,CAAM,IAAIH,EAAa,cAAc;AAAA,cAChD,GAAGuB,IAAO;AAAA,cAET,YAASpE,CAAK;AAAA,YAAA;AAAA,YALVgD;AAAA,UAAA;AAAA,QAQX,CAAC;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGT;"}
|
|
1
|
+
{"version":3,"file":"ChartWaterfall.js","sources":["../../../../src/components/charts/ChartWaterfall/ChartWaterfall.tsx"],"sourcesContent":["import { useMemo } from 'react';\nimport {\n BandCursor,\n markShown,\n CartesianFrame,\n useCartesianLayout,\n chartHeight,\n roundedBarPath,\n useChartMetrics,\n useHoveredBand,\n useTweenedNumbers,\n valueLabelRoom,\n valueLabelsFor,\n type AxisLabelAngle,\n type AxisTick,\n type AxisVisibility,\n type MarkVisibility,\n type ChartHeight,\n} from '../core';\nimport { resolveSeriesColors, type SeriesIntent } from '../palette';\nimport { bandScale, domainOf, linearScale, ticksFor } from '../scales';\nimport { formatarNumero } from '../../../utils/formatters';\nimport styles from './ChartWaterfall.module.css';\n\nexport interface ChartWaterfallStep {\n color?: string;\n intent?: SeriesIntent;\n label: string;\n total?: boolean;\n value: number;\n}\n\nexport interface ChartWaterfallProps {\n emptyMessage?: string;\n /** Formato dos valores no balao. Sem ele, vale o `formatValue`: o eixo pode sair compacto e o balao, exato. */\n formatTooltipValue?: (value: number) => string;\n formatValue?: (value: number) => string;\n height?: ChartHeight;\n labelAngle?: AxisLabelAngle;\n /** Indice do passo sob o ponteiro, ou `null` ao sair dele. */\n onHoverStep?: (index: number | null) => void;\n /** Variacao acima de cada passo. Em `onHover`, so a do passo sob o ponteiro. */\n showDataLabels?: MarkVisibility;\n /** Balao com a variacao do passo sob o ponteiro e o acumulado ate ele. Desligue para montar o proprio `ChartTooltip`. */\n showTooltip?: boolean;\n steps: readonly ChartWaterfallStep[];\n title: string;\n xAxis?: AxisVisibility;\n yAxis?: AxisVisibility;\n yAxisRight?: AxisVisibility;\n}\n\ninterface Trecho {\n fim: number;\n inicio: number;\n}\n\n/**\n * Cada passo ocupa a faixa entre o acumulado anterior e o novo acumulado; o total parte do zero, porque\n * fecha a conta. Passo invalido e ausente: nao se desenha nem move o acumulado.\n */\nfunction trechosDe(steps: readonly ChartWaterfallStep[]): (Trecho | null)[] {\n let acumulado = 0;\n\n return steps.map((passo) => {\n if (!Number.isFinite(passo.value)) {\n return null;\n }\n\n const inicio = passo.total ? 0 : acumulado;\n const fim = inicio + passo.value;\n acumulado = fim;\n\n return { inicio, fim };\n });\n}\n\n/** Passo sem intencao declarada recebe a do seu sinal. Total e fechamento, nao aporte. */\nfunction intencaoDe(step: ChartWaterfallStep): SeriesIntent {\n if (step.intent) {\n return step.intent;\n }\n\n if (step.total) {\n return 'neutral';\n }\n\n return step.value < 0 ? 'negative' : 'positive';\n}\n\n/**\n * O sinal e do grafico, nao do formatador: ele formata a magnitude. Delegar o\n * sinal perderia a variacao com qualquer formatador que exiba apenas o valor.\n */\nfunction comSinal(value: number, formatValue: (value: number) => string) {\n if (value === 0) {\n return formatValue(0);\n }\n\n return `${value < 0 ? '-' : '+'}${formatValue(Math.abs(value))}`;\n}\n\nexport function ChartWaterfall({\n emptyMessage = 'Sem dados no período',\n formatTooltipValue,\n formatValue = formatarNumero,\n height = 280,\n labelAngle = 'auto',\n onHoverStep,\n showDataLabels = 'visible',\n showTooltip = true,\n steps,\n title,\n xAxis = 'visible',\n yAxis = 'visible',\n yAxisRight = 'hidden',\n}: ChartWaterfallProps) {\n const { font, height: alturaMedida, radius: raioDoCanto, ref, width } = useChartMetrics();\n const { fillHeight, value: alturaDoDesenho } = chartHeight(height, alturaMedida);\n const { hover: focarPasso, hovered: passoEmFoco } = useHoveredBand(onHoverStep);\n\n const trechos = useMemo(() => trechosDe(steps), [steps]);\n\n const cores = useMemo(\n () => resolveSeriesColors(steps.map((passo) => ({ color: passo.color, intent: intencaoDe(passo) }))),\n [steps],\n );\n\n const dominio = useMemo(\n () => domainOf(trechos.flatMap((trecho) => (trecho ? [trecho.inicio, trecho.fim] : []))),\n [trechos],\n );\n\n const rotulosDeValor = valueLabelsFor(dominio, alturaDoDesenho, formatValue);\n\n const { axisReveal, margins, plot, rotation } = useCartesianLayout({\n bottomLabels: steps.map((passo) => passo.label),\n font,\n height: alturaDoDesenho,\n labelAngle,\n leftLabels: rotulosDeValor,\n rightLabels: rotulosDeValor,\n topRoom: showDataLabels === 'hidden' ? 0 : valueLabelRoom(font),\n width,\n xAxis,\n yAxis,\n yAxisRight,\n });\n\n // A faixa e indexada pela posicao, nao pelo rotulo: numa sequencia de passos o\n // mesmo rotulo pode repetir, e a escala categorica funde dominios iguais.\n const escalaPassos = useMemo(\n () => bandScale({ domain: steps.map((_, indice) => String(indice)), range: [0, plot.width] }),\n [plot.width, steps],\n );\n\n const faixaDe = (indice: number) => escalaPassos(String(indice)) ?? 0;\n\n // A escala alvo fixa as marcas; a animada posiciona o desenho. Sem separar as\n // duas, as marcas exibiriam valores quebrados durante a transicao.\n const escalaAlvo = useMemo(\n () => linearScale({ domain: dominio, range: [plot.height, 0] }),\n [dominio, plot.height],\n );\n\n const [minimo, maximo] = useTweenedNumbers(escalaAlvo.domain());\n\n const escalaValores = useMemo(\n () => linearScale({ domain: { min: minimo, max: maximo }, nice: false, range: [plot.height, 0] }),\n [maximo, minimo, plot.height],\n );\n\n const marcasDeValor = ticksFor(escalaAlvo, plot.height);\n\n const marcasPassos: AxisTick[] = steps.map((passo, indice) => ({\n label: passo.label,\n position: faixaDe(indice) + escalaPassos.bandwidth() / 2,\n }));\n\n const marcasValor: AxisTick[] = marcasDeValor.map((valor) => ({\n label: formatValue(valor),\n position: escalaValores(valor),\n }));\n\n function rotuloDe(passo: ChartWaterfallStep) {\n return passo.total ? formatValue(passo.value) : comSinal(passo.value, formatValue);\n }\n\n /** O passo diz quanto mudou; o acumulado, onde a conta ficou. O total ja e o proprio acumulado. */\n function linhasDoBalao(indice: number | null) {\n if (indice === null || !trechos[indice]) {\n return [];\n }\n\n const passo = steps[indice];\n\n if (passo.total) {\n return [{ color: cores[indice], label: 'Total', values: [passo.value] }];\n }\n\n return [\n { color: cores[indice], format: (valor: number) => comSinal(valor, formatTooltipValue ?? formatValue), label: 'Variação', values: [passo.value] },\n { label: 'Acumulado', values: [trechos[indice].fim] },\n ];\n }\n\n return (\n <CartesianFrame\n axisReveal={axisReveal}\n containerRef={ref}\n empty={steps.length === 0}\n emptyMessage={emptyMessage}\n grid={[\n {\n baseline: escalaValores(0),\n lines: marcasDeValor.map((valor) => escalaValores(valor)),\n orientation: 'horizontal',\n },\n ]}\n fillHeight={fillHeight}\n height={alturaDoDesenho}\n legendPosition=\"none\"\n margins={margins}\n plot={plot}\n title={title}\n tooltip={\n showTooltip\n ? {\n columns: [{ format: formatTooltipValue ?? formatValue }],\n computed: 'none',\n rows: linhasDoBalao(passoEmFoco),\n title: passoEmFoco === null ? undefined : steps[passoEmFoco]?.label,\n }\n : undefined\n }\n width={width}\n xAxis={{ labelRotation: rotation, ticks: marcasPassos, visibility: xAxis }}\n yAxis={{ hideLine: true, ticks: marcasValor, visibility: yAxis }}\n yAxisRight={{ hideLine: true, ticks: marcasValor, visibility: yAxisRight }}\n >\n {passoEmFoco !== null && (\n <BandCursor offset={faixaDe(passoEmFoco)} plot={plot} size={escalaPassos.bandwidth()} />\n )}\n\n <g aria-hidden=\"true\">\n {trechos.slice(0, -1).map((trecho, indice) => {\n if (!trecho || !trechos[indice + 1]) {\n return null;\n }\n\n const nivel = escalaValores(trecho.fim);\n\n return (\n <line\n className={styles.connector}\n key={indice}\n x1={faixaDe(indice) + escalaPassos.bandwidth()}\n x2={faixaDe(indice + 1)}\n y1={nivel}\n y2={nivel}\n />\n );\n })}\n </g>\n\n {steps.map((passo, indice) => {\n const trecho = trechos[indice];\n\n if (!trecho) {\n return null;\n }\n\n const topo = Math.min(escalaValores(trecho.inicio), escalaValores(trecho.fim));\n const altura = Math.abs(escalaValores(trecho.fim) - escalaValores(trecho.inicio));\n\n return (\n <path\n aria-label={`${passo.label}: ${rotuloDe(passo)}`}\n className={styles.bar}\n d={roundedBarPath(faixaDe(indice), topo, escalaPassos.bandwidth(), altura, [\n raioDoCanto,\n raioDoCanto,\n raioDoCanto,\n raioDoCanto,\n ])}\n fill={cores[indice]}\n key={indice}\n onMouseEnter={() => focarPasso(indice)}\n onMouseLeave={() => focarPasso(null)}\n />\n );\n })}\n\n {showDataLabels !== 'hidden' &&\n steps.map((passo, indice) => {\n const trecho = trechos[indice];\n\n if (!trecho) {\n return null;\n }\n\n const topo = Math.min(escalaValores(trecho.inicio), escalaValores(trecho.fim));\n\n return (\n <text\n className={`${styles.valueLabel} ${markShown(showDataLabels, indice === passoEmFoco) ? '' : styles.valueLabelHidden}`}\n key={indice}\n textAnchor=\"middle\"\n x={faixaDe(indice) + escalaPassos.bandwidth() / 2}\n y={topo - 6}\n >\n {rotuloDe(passo)}\n </text>\n );\n })}\n </CartesianFrame>\n );\n}\n"],"names":["trechosDe","steps","acumulado","passo","inicio","fim","intencaoDe","step","comSinal","value","formatValue","ChartWaterfall","emptyMessage","formatTooltipValue","formatarNumero","height","labelAngle","onHoverStep","showDataLabels","showTooltip","title","xAxis","yAxis","yAxisRight","font","alturaMedida","raioDoCanto","ref","width","useChartMetrics","fillHeight","alturaDoDesenho","chartHeight","focarPasso","passoEmFoco","useHoveredBand","trechos","useMemo","cores","resolveSeriesColors","dominio","domainOf","trecho","rotulosDeValor","valueLabelsFor","axisReveal","margins","plot","rotation","useCartesianLayout","valueLabelRoom","escalaPassos","bandScale","_","indice","faixaDe","escalaAlvo","linearScale","minimo","maximo","useTweenedNumbers","escalaValores","marcasDeValor","ticksFor","marcasPassos","marcasValor","valor","rotuloDe","linhasDoBalao","jsxs","CartesianFrame","_a","jsx","BandCursor","nivel","styles","topo","altura","roundedBarPath","markShown"],"mappings":";;;;;;;;;;;;;;;AA6DA,SAASA,GAAUC,GAAyD;AAC1E,MAAIC,IAAY;AAEhB,SAAOD,EAAM,IAAI,CAACE,MAAU;AAC1B,QAAI,CAAC,OAAO,SAASA,EAAM,KAAK;AAC9B,aAAO;AAGT,UAAMC,IAASD,EAAM,QAAQ,IAAID,GAC3BG,IAAMD,IAASD,EAAM;AAC3B,WAAAD,IAAYG,GAEL,EAAE,QAAAD,GAAQ,KAAAC,EAAA;AAAA,EACnB,CAAC;AACH;AAGA,SAASC,GAAWC,GAAwC;AAC1D,SAAIA,EAAK,SACAA,EAAK,SAGVA,EAAK,QACA,YAGFA,EAAK,QAAQ,IAAI,aAAa;AACvC;AAMA,SAASC,EAASC,GAAeC,GAAwC;AACvE,SAAID,MAAU,IACLC,EAAY,CAAC,IAGf,GAAGD,IAAQ,IAAI,MAAM,GAAG,GAAGC,EAAY,KAAK,IAAID,CAAK,CAAC,CAAC;AAChE;AAEO,SAASE,GAAe;AAAA,EAC7B,cAAAC,IAAe;AAAA,EACf,oBAAAC;AAAA,EACA,aAAAH,IAAcI;AAAA,EACd,QAAAC,IAAS;AAAA,EACT,YAAAC,IAAa;AAAA,EAC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cACD,MAAMY,EAAMgB,CAAM;AAAA,cAElB,cAAc,MAAMrB,EAAWqB,CAAM;AAAA,cACrC,cAAc,MAAMrB,EAAW,IAAI;AAAA,YAAA;AAAA,YAF9BqB;AAAA,UAAA;AAAA,QAKX,CAAC;AAAA,QAEApC,MAAmB,YAClBjB,EAAM,IAAI,CAACE,GAAOmD,MAAW;AAC3B,gBAAMZ,IAASN,EAAQkB,CAAM;AAE7B,cAAI,CAACZ;AACH,mBAAO;AAGT,gBAAMkC,IAAO,KAAK,IAAIf,EAAcnB,EAAO,MAAM,GAAGmB,EAAcnB,EAAO,GAAG,CAAC;AAE7E,iBACE,gBAAA8B;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAW,GAAGG,EAAO,UAAU,IAAII,GAAU7D,GAAgBoC,MAAWpB,CAAW,IAAI,KAAKyC,EAAO,gBAAgB;AAAA,cAEnH,YAAW;AAAA,cACX,GAAGpB,EAAQD,CAAM,IAAIH,EAAa,cAAc;AAAA,cAChD,GAAGyB,IAAO;AAAA,cAET,YAASzE,CAAK;AAAA,YAAA;AAAA,YALVmD;AAAA,UAAA;AAAA,QAQX,CAAC;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGT;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="_bar_29l4p_1",l="_connector_29l4p_6",a="_valueLabel_29l4p_12 _valueLabel_yf6oe_103",n="_valueLabelHidden_29l4p_16 _valueLabelHidden_yf6oe_116",o={bar:e,connector:l,valueLabel:a,valueLabelHidden:n};exports.bar=e;exports.connector=l;exports.default=o;exports.valueLabel=a;exports.valueLabelHidden=n;
|
|
2
2
|
//# sourceMappingURL=ChartWaterfall.module.css.cjs.map
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
const e = "
|
|
1
|
+
const e = "_bar_29l4p_1", l = "_connector_29l4p_6", a = "_valueLabel_29l4p_12 _valueLabel_yf6oe_103", _ = "_valueLabelHidden_29l4p_16 _valueLabelHidden_yf6oe_116", n = {
|
|
2
2
|
bar: e,
|
|
3
|
-
connector:
|
|
4
|
-
valueLabel:
|
|
3
|
+
connector: l,
|
|
4
|
+
valueLabel: a,
|
|
5
|
+
valueLabelHidden: _
|
|
5
6
|
};
|
|
6
7
|
export {
|
|
7
8
|
e as bar,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
l as connector,
|
|
10
|
+
n as default,
|
|
11
|
+
a as valueLabel,
|
|
12
|
+
_ as valueLabelHidden
|
|
11
13
|
};
|
|
12
14
|
//# sourceMappingURL=ChartWaterfall.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartWaterfall.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ChartWaterfall.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),F=require("./Axis.cjs"),w=require("./ChartFrame.cjs"),A=require("./Grid.cjs"),f=require("./Chart.module.css.cjs");function a({axis:t,length:s,orientation:c,revealed:h}){const o=t.visibility??"visible";if(o==="hidden")return null;const d=o==="onHover",i=n.jsx(F.Axis,{hideLine:t.hideLine,labelRotation:t.labelRotation,length:s,orientation:c,ticks:t.ticks});return d?n.jsx("g",{className:`${f.default.dynamicAxis} ${h?f.default.dynamicAxisRevealed:""}`,children:i}):i}function k({axisReveal:t,children:s,containerRef:c,empty:h,emptyMessage:o,fillHeight:d,grid:i,height:j,legend:b,legendAlign:g,legendPosition:$,margins:m,onToggleSeries:q,plot:e,title:y,tooltip:C,width:L,xAxis:P,yAxis:E,yAxisRight:l}){const u=(t==null?void 0:t.revealed)??!1;return n.jsx(w.ChartFrame,{containerRef:c,empty:h,emptyMessage:o,fillHeight:d,height:j,legend:b,legendAlign:g,legendPosition:$,minLegendEntries:2,onPointerEnter:t==null?void 0:t.onPointerEnter,onPointerLeave:t==null?void 0:t.onPointerLeave,onToggleSeries:q,title:y,tooltip:C,width:L,children:n.jsxs("g",{transform:`translate(${m.left} ${m.top})`,children:[i==null?void 0:i.map(r=>n.jsx(A.Grid,{baseline:r.baseline,length:r.orientation==="horizontal"?e.width:e.height,lines:r.lines,orientation:r.orientation},r.orientation)),s,n.jsx("g",{transform:`translate(0 ${e.height})`,children:n.jsx(a,{axis:P,length:e.width,orientation:"bottom",revealed:u})}),n.jsx(a,{axis:E,length:e.height,orientation:"left",revealed:u}),l&&n.jsx("g",{transform:`translate(${e.width} 0)`,children:n.jsx(a,{axis:l,length:e.height,orientation:"right",revealed:u})})]})})}exports.CartesianFrame=k;
|
|
2
2
|
//# sourceMappingURL=CartesianFrame.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CartesianFrame.cjs","sources":["../../../../src/components/charts/core/CartesianFrame.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport { Axis, type AxisOrientation, type AxisTick } from './Axis';\nimport { ChartFrame } from './ChartFrame';\nimport type { ChartLegendAlign, ChartLegendEntry, ChartLegendPosition } from './ChartLegend';\nimport { Grid, type GridOrientation } from './Grid';\nimport type { AxisLabelRotation, AxisVisibility, ChartMargins, ChartPlot } from './cartesianLayout';\nimport styles from './Chart.module.css';\n\nexport interface CartesianAxis {\n hideLine?: boolean;\n labelRotation?: AxisLabelRotation;\n ticks: readonly AxisTick[];\n visibility?: AxisVisibility;\n}\n\nexport interface CartesianGrid {\n baseline?: number;\n lines: readonly number[];\n orientation: GridOrientation;\n}\n\nexport interface CartesianFrameProps {\n children: ReactNode;\n containerRef: (node: HTMLElement | null) => void;\n empty: boolean;\n emptyMessage: string;\n fillHeight: boolean;\n grid?: readonly CartesianGrid[];\n height: number;\n legend?: readonly ChartLegendEntry[];\n legendAlign?: ChartLegendAlign;\n legendPosition: ChartLegendPosition;\n margins: ChartMargins;\n onToggleSeries?: (label: string) => void;\n plot: ChartPlot;\n title: string;\n width: number;\n xAxis: CartesianAxis;\n yAxis: CartesianAxis;\n yAxisRight?: CartesianAxis;\n}\n\
|
|
1
|
+
{"version":3,"file":"CartesianFrame.cjs","sources":["../../../../src/components/charts/core/CartesianFrame.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport { Axis, type AxisOrientation, type AxisTick } from './Axis';\nimport { ChartFrame } from './ChartFrame';\nimport type { ChartLegendAlign, ChartLegendEntry, ChartLegendPosition } from './ChartLegend';\nimport type { ChartFrameProps } from './ChartFrame';\nimport { Grid, type GridOrientation } from './Grid';\nimport type { AxisLabelRotation, AxisVisibility, ChartMargins, ChartPlot } from './cartesianLayout';\nimport type { AxisReveal } from './useCartesianLayout';\nimport styles from './Chart.module.css';\n\nexport interface CartesianAxis {\n hideLine?: boolean;\n labelRotation?: AxisLabelRotation;\n ticks: readonly AxisTick[];\n visibility?: AxisVisibility;\n}\n\nexport interface CartesianGrid {\n baseline?: number;\n lines: readonly number[];\n orientation: GridOrientation;\n}\n\nexport interface CartesianFrameProps {\n /** Estado e gatilhos dos eixos `onHover`, vindos de `useCartesianLayout`. */\n axisReveal?: AxisReveal;\n children: ReactNode;\n containerRef: (node: HTMLElement | null) => void;\n empty: boolean;\n emptyMessage: string;\n fillHeight: boolean;\n grid?: readonly CartesianGrid[];\n height: number;\n legend?: readonly ChartLegendEntry[];\n legendAlign?: ChartLegendAlign;\n legendPosition: ChartLegendPosition;\n margins: ChartMargins;\n onToggleSeries?: (label: string) => void;\n plot: ChartPlot;\n title: string;\n tooltip?: ChartFrameProps['tooltip'];\n width: number;\n xAxis: CartesianAxis;\n yAxis: CartesianAxis;\n yAxisRight?: CartesianAxis;\n}\n\ninterface EixoProps {\n axis: CartesianAxis;\n length: number;\n orientation: AxisOrientation;\n revealed: boolean;\n}\n\n/** No modo `onHover` o eixo aparece enquanto o desenho encolhe para abrir a calha dele, e some na hora de sair. */\nfunction EixoDinamico({ axis, length, orientation, revealed }: EixoProps) {\n const visibility = axis.visibility ?? 'visible';\n\n if (visibility === 'hidden') {\n return null;\n }\n\n const dinamico = visibility === 'onHover';\n const eixo = (\n <Axis\n hideLine={axis.hideLine}\n labelRotation={axis.labelRotation}\n length={length}\n orientation={orientation}\n ticks={axis.ticks}\n />\n );\n\n if (!dinamico) {\n return eixo;\n }\n\n return <g className={`${styles.dynamicAxis} ${revealed ? styles.dynamicAxisRevealed : ''}`}>{eixo}</g>;\n}\n\n/**\n * Camada cartesiana sobre a moldura comum: grade, os dois eixos e as marcas,\n * todos dentro das margens ja calculadas a partir dos rotulos.\n */\nexport function CartesianFrame({\n axisReveal,\n children,\n containerRef,\n empty,\n emptyMessage,\n fillHeight,\n grid,\n height,\n legend,\n legendAlign,\n legendPosition,\n margins,\n onToggleSeries,\n plot,\n title,\n tooltip,\n width,\n xAxis,\n yAxis,\n yAxisRight,\n}: CartesianFrameProps) {\n const revealed = axisReveal?.revealed ?? false;\n\n return (\n <ChartFrame\n containerRef={containerRef}\n empty={empty}\n emptyMessage={emptyMessage}\n fillHeight={fillHeight}\n height={height}\n legend={legend}\n legendAlign={legendAlign}\n legendPosition={legendPosition}\n minLegendEntries={2}\n onPointerEnter={axisReveal?.onPointerEnter}\n onPointerLeave={axisReveal?.onPointerLeave}\n onToggleSeries={onToggleSeries}\n title={title}\n tooltip={tooltip}\n width={width}\n >\n <g transform={`translate(${margins.left} ${margins.top})`}>\n {grid?.map((linhas) => (\n <Grid\n baseline={linhas.baseline}\n key={linhas.orientation}\n length={linhas.orientation === 'horizontal' ? plot.width : plot.height}\n lines={linhas.lines}\n orientation={linhas.orientation}\n />\n ))}\n\n {children}\n\n <g transform={`translate(0 ${plot.height})`}>\n <EixoDinamico axis={xAxis} length={plot.width} orientation=\"bottom\" revealed={revealed} />\n </g>\n\n <EixoDinamico axis={yAxis} length={plot.height} orientation=\"left\" revealed={revealed} />\n\n {yAxisRight && (\n <g transform={`translate(${plot.width} 0)`}>\n <EixoDinamico axis={yAxisRight} length={plot.height} orientation=\"right\" revealed={revealed} />\n </g>\n )}\n </g>\n </ChartFrame>\n );\n}\n"],"names":["EixoDinamico","axis","length","orientation","revealed","visibility","dinamico","eixo","jsx","Axis","styles","CartesianFrame","axisReveal","children","containerRef","empty","emptyMessage","fillHeight","grid","height","legend","legendAlign","legendPosition","margins","onToggleSeries","plot","title","tooltip","width","xAxis","yAxis","yAxisRight","ChartFrame","jsxs","linhas","Grid"],"mappings":"uOAuDA,SAASA,EAAa,CAAE,KAAAC,EAAM,OAAAC,EAAQ,YAAAC,EAAa,SAAAC,GAAuB,CACxE,MAAMC,EAAaJ,EAAK,YAAc,UAEtC,GAAII,IAAe,SACjB,OAAO,KAGT,MAAMC,EAAWD,IAAe,UAC1BE,EACJC,EAAAA,IAACC,EAAAA,KAAA,CACC,SAAUR,EAAK,SACf,cAAeA,EAAK,cACpB,OAAAC,EACA,YAAAC,EACA,MAAOF,EAAK,KAAA,CAAA,EAIhB,OAAKK,EAIEE,EAAAA,IAAC,IAAA,CAAE,UAAW,GAAGE,EAAAA,QAAO,WAAW,IAAIN,EAAWM,EAAAA,QAAO,oBAAsB,EAAE,GAAK,SAAAH,EAAK,EAHzFA,CAIX,CAMO,SAASI,EAAe,CAC7B,WAAAC,EACA,SAAAC,EACA,aAAAC,EACA,MAAAC,EACA,aAAAC,EACA,WAAAC,EACA,KAAAC,EACA,OAAAC,EACA,OAAAC,EACA,YAAAC,EACA,eAAAC,EACA,QAAAC,EACA,eAAAC,EACA,KAAAC,EACA,MAAAC,EACA,QAAAC,EACA,MAAAC,EACA,MAAAC,EACA,MAAAC,EACA,WAAAC,CACF,EAAwB,CACtB,MAAM3B,GAAWQ,GAAA,YAAAA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