@economic/taco 14.0.0 → 14.1.0-EC-85807-code-report-fixes.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/charts/components/Area/AreaChart.cjs.map +1 -1
- package/dist/charts/components/Area/AreaChart.d.ts +1 -1
- package/dist/charts/components/Area/AreaChart.js.map +1 -1
- package/dist/charts/components/Bar/BarChart.cjs +2 -2
- package/dist/charts/components/Bar/BarChart.cjs.map +1 -1
- package/dist/charts/components/Bar/BarChart.d.ts +1 -1
- package/dist/charts/components/Bar/BarChart.js +2 -2
- package/dist/charts/components/Bar/BarChart.js.map +1 -1
- package/dist/charts/components/ChartWrapper.cjs.map +1 -1
- package/dist/charts/components/ChartWrapper.js.map +1 -1
- package/dist/charts/components/Composed/BarLineChart.cjs.map +1 -1
- package/dist/charts/components/Composed/BarLineChart.d.ts +2 -2
- package/dist/charts/components/Composed/BarLineChart.js.map +1 -1
- package/dist/charts/components/Donut/DonutChart.cjs.map +1 -1
- package/dist/charts/components/Donut/DonutChart.d.ts +1 -1
- package/dist/charts/components/Donut/DonutChart.js.map +1 -1
- package/dist/charts/components/LegacyDonut/ActiveShape.cjs +7 -5
- package/dist/charts/components/LegacyDonut/ActiveShape.cjs.map +1 -1
- package/dist/charts/components/LegacyDonut/ActiveShape.d.ts +6 -3
- package/dist/charts/components/LegacyDonut/ActiveShape.js +7 -5
- package/dist/charts/components/LegacyDonut/ActiveShape.js.map +1 -1
- package/dist/charts/components/LegacyDonut/CenteredLabel.cjs +1 -1
- package/dist/charts/components/LegacyDonut/CenteredLabel.cjs.map +1 -1
- package/dist/charts/components/LegacyDonut/CenteredLabel.js +1 -1
- package/dist/charts/components/LegacyDonut/CenteredLabel.js.map +1 -1
- package/dist/charts/components/LegacyDonut/LegacyDonutChart.cjs +119 -103
- package/dist/charts/components/LegacyDonut/LegacyDonutChart.cjs.map +1 -1
- package/dist/charts/components/LegacyDonut/LegacyDonutChart.d.ts +13 -2
- package/dist/charts/components/LegacyDonut/LegacyDonutChart.js +119 -103
- package/dist/charts/components/LegacyDonut/LegacyDonutChart.js.map +1 -1
- package/dist/charts/components/LegacyDonut/Legend.cjs +1 -1
- package/dist/charts/components/LegacyDonut/Legend.cjs.map +1 -1
- package/dist/charts/components/LegacyDonut/Legend.js +1 -1
- package/dist/charts/components/LegacyDonut/Legend.js.map +1 -1
- package/dist/charts/components/Legend.cjs +1 -1
- package/dist/charts/components/Legend.cjs.map +1 -1
- package/dist/charts/components/Legend.js +1 -1
- package/dist/charts/components/Legend.js.map +1 -1
- package/dist/charts/components/Line/LineChart.cjs.map +1 -1
- package/dist/charts/components/Line/LineChart.d.ts +3 -2
- package/dist/charts/components/Line/LineChart.js.map +1 -1
- package/dist/charts/components/Pie/PieChart.cjs +4 -4
- package/dist/charts/components/Pie/PieChart.cjs.map +1 -1
- package/dist/charts/components/Pie/PieChart.js +4 -4
- package/dist/charts/components/Pie/PieChart.js.map +1 -1
- package/dist/charts/components/Pie/util.cjs.map +1 -1
- package/dist/charts/components/Pie/util.d.ts +2 -1
- package/dist/charts/components/Pie/util.js.map +1 -1
- package/dist/charts/components/Tooltip.cjs.map +1 -1
- package/dist/charts/components/Tooltip.d.ts +2 -3
- package/dist/charts/components/Tooltip.js.map +1 -1
- package/dist/charts/components/types.d.ts +9 -5
- package/dist/charts/components/useChartData.cjs +5 -3
- package/dist/charts/components/useChartData.cjs.map +1 -1
- package/dist/charts/components/useChartData.d.ts +6 -2
- package/dist/charts/components/useChartData.js +5 -3
- package/dist/charts/components/useChartData.js.map +1 -1
- package/dist/charts/utils/color.cjs +6 -10
- package/dist/charts/utils/color.cjs.map +1 -1
- package/dist/charts/utils/color.js +6 -10
- package/dist/charts/utils/color.js.map +1 -1
- package/dist/charts/utils/common.cjs +10 -10
- package/dist/charts/utils/common.cjs.map +1 -1
- package/dist/charts/utils/common.d.ts +5 -6
- package/dist/charts/utils/common.js +10 -10
- package/dist/charts/utils/common.js.map +1 -1
- package/dist/components/AlertDialog/Context.cjs.map +1 -1
- package/dist/components/AlertDialog/Context.d.ts +1 -1
- package/dist/components/AlertDialog/Context.js.map +1 -1
- package/dist/components/Calendar/Calendar.cjs.map +1 -1
- package/dist/components/Calendar/Calendar.js.map +1 -1
- package/dist/components/Combobox/Combobox.cjs.map +1 -1
- package/dist/components/Combobox/Combobox.js.map +1 -1
- package/dist/components/Combobox/useCombobox.cjs +2 -4
- package/dist/components/Combobox/useCombobox.cjs.map +1 -1
- package/dist/components/Combobox/useCombobox.d.ts +1 -1
- package/dist/components/Combobox/useCombobox.js +2 -4
- package/dist/components/Combobox/useCombobox.js.map +1 -1
- package/dist/components/Datepicker/useDatepicker.cjs.map +1 -1
- package/dist/components/Datepicker/useDatepicker.js.map +1 -1
- package/dist/components/Dialog/Context.cjs.map +1 -1
- package/dist/components/Dialog/Context.d.ts +1 -1
- package/dist/components/Dialog/Context.js.map +1 -1
- package/dist/components/Dialog/components/Content.cjs.map +1 -1
- package/dist/components/Dialog/components/Content.js.map +1 -1
- package/dist/components/Drawer/components/Content.cjs +1 -1
- package/dist/components/Drawer/components/Content.cjs.map +1 -1
- package/dist/components/Drawer/components/Content.js +1 -1
- package/dist/components/Drawer/components/Content.js.map +1 -1
- package/dist/components/Drawer/useDrawerStack.cjs.map +1 -1
- package/dist/components/Drawer/useDrawerStack.js.map +1 -1
- package/dist/components/Hanger/Hanger.cjs.map +1 -1
- package/dist/components/Hanger/Hanger.js.map +1 -1
- package/dist/components/Header/Header.cjs +1 -1
- package/dist/components/Header/Header.cjs.map +1 -1
- package/dist/components/Header/Header.js +1 -1
- package/dist/components/Header/Header.js.map +1 -1
- package/dist/components/Header/components/PrimaryNavigation.cjs.map +1 -1
- package/dist/components/Header/components/PrimaryNavigation.js.map +1 -1
- package/dist/components/Icon/Icon.cjs.map +1 -1
- package/dist/components/Icon/Icon.js.map +1 -1
- package/dist/components/Layout/components/Sidebar.cjs +2 -1
- package/dist/components/Layout/components/Sidebar.cjs.map +1 -1
- package/dist/components/Layout/components/Sidebar.js +2 -1
- package/dist/components/Layout/components/Sidebar.js.map +1 -1
- package/dist/components/LegacyComponents/IconButton/IconButton.cjs.map +1 -1
- package/dist/components/LegacyComponents/IconButton/IconButton.js.map +1 -1
- package/dist/components/List/components/Toggle.cjs +0 -2
- package/dist/components/List/components/Toggle.cjs.map +1 -1
- package/dist/components/List/components/Toggle.js +0 -2
- package/dist/components/List/components/Toggle.js.map +1 -1
- package/dist/components/Listbox/Listbox.cjs +2 -5
- package/dist/components/Listbox/Listbox.cjs.map +1 -1
- package/dist/components/Listbox/Listbox.js +2 -5
- package/dist/components/Listbox/Listbox.js.map +1 -1
- package/dist/components/Listbox/useListbox.cjs +1 -1
- package/dist/components/Listbox/useListbox.cjs.map +1 -1
- package/dist/components/Listbox/useListbox.js +1 -1
- package/dist/components/Listbox/useListbox.js.map +1 -1
- package/dist/components/Listbox/useMultiListbox.cjs +1 -1
- package/dist/components/Listbox/useMultiListbox.cjs.map +1 -1
- package/dist/components/Listbox/useMultiListbox.js +1 -1
- package/dist/components/Listbox/useMultiListbox.js.map +1 -1
- package/dist/components/Listbox/util.cjs.map +1 -1
- package/dist/components/Listbox/util.js.map +1 -1
- package/dist/components/Menu/components/Content.cjs.map +1 -1
- package/dist/components/Menu/components/Content.js.map +1 -1
- package/dist/components/Menu/components/Item.cjs.map +1 -1
- package/dist/components/Menu/components/Item.d.ts +2 -2
- package/dist/components/Menu/components/Item.js.map +1 -1
- package/dist/components/Menu/components/Trigger.cjs +1 -5
- package/dist/components/Menu/components/Trigger.cjs.map +1 -1
- package/dist/components/Menu/components/Trigger.js +1 -5
- package/dist/components/Menu/components/Trigger.js.map +1 -1
- package/dist/components/Pagination/usePaginationShortcuts.cjs +0 -1
- package/dist/components/Pagination/usePaginationShortcuts.cjs.map +1 -1
- package/dist/components/Pagination/usePaginationShortcuts.js +0 -1
- package/dist/components/Pagination/usePaginationShortcuts.js.map +1 -1
- package/dist/components/Provider/Provider.cjs.map +1 -1
- package/dist/components/Provider/Provider.d.ts +1 -1
- package/dist/components/Provider/Provider.js.map +1 -1
- package/dist/components/SearchInput/SearchInput.cjs +0 -1
- package/dist/components/SearchInput/SearchInput.cjs.map +1 -1
- package/dist/components/SearchInput/SearchInput.js +0 -1
- package/dist/components/SearchInput/SearchInput.js.map +1 -1
- package/dist/components/SearchInput2/SearchInput2.cjs +0 -1
- package/dist/components/SearchInput2/SearchInput2.cjs.map +1 -1
- package/dist/components/SearchInput2/SearchInput2.js +0 -1
- package/dist/components/SearchInput2/SearchInput2.js.map +1 -1
- package/dist/components/Select2/Select2.cjs +6 -7
- package/dist/components/Select2/Select2.cjs.map +1 -1
- package/dist/components/Select2/Select2.js +6 -7
- package/dist/components/Select2/Select2.js.map +1 -1
- package/dist/components/Select2/components/Search.cjs +0 -1
- package/dist/components/Select2/components/Search.cjs.map +1 -1
- package/dist/components/Select2/components/Search.js +0 -1
- package/dist/components/Select2/components/Search.js.map +1 -1
- package/dist/components/Select2/components/Trigger.cjs +1 -1
- package/dist/components/Select2/components/Trigger.cjs.map +1 -1
- package/dist/components/Select2/components/Trigger.js +1 -1
- package/dist/components/Select2/components/Trigger.js.map +1 -1
- package/dist/components/Table3/components/Columns/Cell/EditingControlCell.cjs +1 -1
- package/dist/components/Table3/components/Columns/Cell/EditingControlCell.cjs.map +1 -1
- package/dist/components/Table3/components/Columns/Cell/EditingControlCell.js +1 -1
- package/dist/components/Table3/components/Columns/Cell/EditingControlCell.js.map +1 -1
- package/dist/components/Table3/components/Columns/Cell/util.cjs.map +1 -1
- package/dist/components/Table3/components/Columns/Cell/util.js.map +1 -1
- package/dist/components/Table3/components/Editing/Alert.cjs +4 -4
- package/dist/components/Table3/components/Editing/Alert.cjs.map +1 -1
- package/dist/components/Table3/components/Editing/Alert.js +4 -4
- package/dist/components/Table3/components/Editing/Alert.js.map +1 -1
- package/dist/components/Table3/features/useEditingState.cjs +1 -1
- package/dist/components/Table3/features/useEditingState.cjs.map +1 -1
- package/dist/components/Table3/features/useEditingState.js +1 -1
- package/dist/components/Table3/features/useEditingState.js.map +1 -1
- package/dist/components/Table3/types.d.ts +2 -2
- package/dist/components/Table3/useTable3.cjs +8 -6
- package/dist/components/Table3/useTable3.cjs.map +1 -1
- package/dist/components/Table3/useTable3.js +8 -6
- package/dist/components/Table3/useTable3.js.map +1 -1
- package/dist/components/Table3/util/editing.cjs +1 -1
- package/dist/components/Table3/util/editing.cjs.map +1 -1
- package/dist/components/Table3/util/editing.d.ts +1 -1
- package/dist/components/Table3/util/editing.js +1 -1
- package/dist/components/Table3/util/editing.js.map +1 -1
- package/dist/hooks/useBoundaryOverflowDetection.cjs.map +1 -1
- package/dist/hooks/useBoundaryOverflowDetection.d.ts +1 -1
- package/dist/hooks/useBoundaryOverflowDetection.js.map +1 -1
- package/dist/hooks/useBoundingClientRectListener.cjs.map +1 -1
- package/dist/hooks/useBoundingClientRectListener.d.ts +1 -1
- package/dist/hooks/useBoundingClientRectListener.js.map +1 -1
- package/dist/hooks/useControlled.cjs +6 -10
- package/dist/hooks/useControlled.cjs.map +1 -1
- package/dist/hooks/useControlled.js +6 -10
- package/dist/hooks/useControlled.js.map +1 -1
- package/dist/hooks/useIsFormControl.cjs.map +1 -1
- package/dist/hooks/useIsFormControl.d.ts +1 -1
- package/dist/hooks/useIsFormControl.js.map +1 -1
- package/dist/hooks/useMergedRef.cjs.map +1 -1
- package/dist/hooks/useMergedRef.js.map +1 -1
- package/dist/hooks/usePrevious.cjs.map +1 -1
- package/dist/hooks/usePrevious.js.map +1 -1
- package/dist/primitives/Button.cjs.map +1 -1
- package/dist/primitives/Button.js.map +1 -1
- package/dist/primitives/Collection/components/Root.cjs +9 -16
- package/dist/primitives/Collection/components/Root.cjs.map +1 -1
- package/dist/primitives/Collection/components/Root.js +9 -16
- package/dist/primitives/Collection/components/Root.js.map +1 -1
- package/dist/primitives/Listbox2/components/Context.cjs.map +1 -1
- package/dist/primitives/Listbox2/components/Context.d.ts +1 -0
- package/dist/primitives/Listbox2/components/Context.js.map +1 -1
- package/dist/primitives/Listbox2/components/Option.cjs +8 -2
- package/dist/primitives/Listbox2/components/Option.cjs.map +1 -1
- package/dist/primitives/Listbox2/components/Option.js +8 -2
- package/dist/primitives/Listbox2/components/Option.js.map +1 -1
- package/dist/primitives/Listbox2/components/Root.cjs +3 -2
- package/dist/primitives/Listbox2/components/Root.cjs.map +1 -1
- package/dist/primitives/Listbox2/components/Root.js +3 -2
- package/dist/primitives/Listbox2/components/Root.js.map +1 -1
- package/dist/primitives/Sortable/components/Item.cjs +2 -4
- package/dist/primitives/Sortable/components/Item.cjs.map +1 -1
- package/dist/primitives/Sortable/components/Item.js +2 -4
- package/dist/primitives/Sortable/components/Item.js.map +1 -1
- package/dist/primitives/Table/Core/components/Body/Body.cjs +4 -4
- package/dist/primitives/Table/Core/components/Body/Body.cjs.map +1 -1
- package/dist/primitives/Table/Core/components/Body/Body.js +4 -4
- package/dist/primitives/Table/Core/components/Body/Body.js.map +1 -1
- package/dist/primitives/Table/Core/components/Columns/Cell/BuiltIns/DisplayCell.cjs.map +1 -1
- package/dist/primitives/Table/Core/components/Columns/Cell/BuiltIns/DisplayCell.js.map +1 -1
- package/dist/primitives/Table/Core/components/Columns/Cell/BuiltIns/GroupedCell.cjs.map +1 -1
- package/dist/primitives/Table/Core/components/Columns/Cell/BuiltIns/GroupedCell.js.map +1 -1
- package/dist/primitives/Table/Core/components/Columns/Cell/util.cjs +22 -16
- package/dist/primitives/Table/Core/components/Columns/Cell/util.cjs.map +1 -1
- package/dist/primitives/Table/Core/components/Columns/Cell/util.js +22 -16
- package/dist/primitives/Table/Core/components/Columns/Cell/util.js.map +1 -1
- package/dist/primitives/Table/Core/components/Footer/Summary.cjs.map +1 -1
- package/dist/primitives/Table/Core/components/Footer/Summary.js.map +1 -1
- package/dist/primitives/Table/Core/components/Header/util.cjs +4 -3
- package/dist/primitives/Table/Core/components/Header/util.cjs.map +1 -1
- package/dist/primitives/Table/Core/components/Header/util.js +4 -3
- package/dist/primitives/Table/Core/components/Header/util.js.map +1 -1
- package/dist/primitives/Table/Core/components/Toolbar/components/Filters/Filters.cjs +1 -1
- package/dist/primitives/Table/Core/components/Toolbar/components/Filters/Filters.cjs.map +1 -1
- package/dist/primitives/Table/Core/components/Toolbar/components/Filters/Filters.js +1 -1
- package/dist/primitives/Table/Core/components/Toolbar/components/Filters/Filters.js.map +1 -1
- package/dist/primitives/Table/Core/components/Toolbar/components/Filters/ManageFiltersPopover.cjs +4 -2
- package/dist/primitives/Table/Core/components/Toolbar/components/Filters/ManageFiltersPopover.cjs.map +1 -1
- package/dist/primitives/Table/Core/components/Toolbar/components/Filters/ManageFiltersPopover.js +4 -2
- package/dist/primitives/Table/Core/components/Toolbar/components/Filters/ManageFiltersPopover.js.map +1 -1
- package/dist/primitives/Table/Core/components/Toolbar/components/Filters/components/Filter.cjs.map +1 -1
- package/dist/primitives/Table/Core/components/Toolbar/components/Filters/components/Filter.js.map +1 -1
- package/dist/primitives/Table/Core/components/Toolbar/components/Print/Print.cjs +1 -1
- package/dist/primitives/Table/Core/components/Toolbar/components/Print/Print.cjs.map +1 -1
- package/dist/primitives/Table/Core/components/Toolbar/components/Print/Print.js +1 -1
- package/dist/primitives/Table/Core/components/Toolbar/components/Print/Print.js.map +1 -1
- package/dist/primitives/Table/Core/features/useTableRef.cjs +7 -0
- package/dist/primitives/Table/Core/features/useTableRef.cjs.map +1 -1
- package/dist/primitives/Table/Core/features/useTableRef.js +7 -0
- package/dist/primitives/Table/Core/features/useTableRef.js.map +1 -1
- package/dist/primitives/Table/Core/features/useTableRenderer.cjs +2 -2
- package/dist/primitives/Table/Core/features/useTableRenderer.cjs.map +1 -1
- package/dist/primitives/Table/Core/features/useTableRenderer.js +2 -2
- package/dist/primitives/Table/Core/features/useTableRenderer.js.map +1 -1
- package/dist/primitives/Table/Core/features/useTableStyleColumnFreezing.cjs +2 -2
- package/dist/primitives/Table/Core/features/useTableStyleColumnFreezing.cjs.map +1 -1
- package/dist/primitives/Table/Core/features/useTableStyleColumnFreezing.js +2 -2
- package/dist/primitives/Table/Core/features/useTableStyleColumnFreezing.js.map +1 -1
- package/dist/primitives/Table/Core/features/useTableStyleGrid.cjs.map +1 -1
- package/dist/primitives/Table/Core/features/useTableStyleGrid.js.map +1 -1
- package/dist/primitives/Table/Core/listeners/useTableRowActiveListener.cjs +2 -4
- package/dist/primitives/Table/Core/listeners/useTableRowActiveListener.cjs.map +1 -1
- package/dist/primitives/Table/Core/listeners/useTableRowActiveListener.d.ts +2 -2
- package/dist/primitives/Table/Core/listeners/useTableRowActiveListener.js +2 -4
- package/dist/primitives/Table/Core/listeners/useTableRowActiveListener.js.map +1 -1
- package/dist/primitives/Table/types.cjs.map +1 -1
- package/dist/primitives/Table/types.d.ts +6 -0
- package/dist/primitives/Table/types.js.map +1 -1
- package/dist/primitives/Table/useTableDataLoader2.cjs +36 -3
- package/dist/primitives/Table/useTableDataLoader2.cjs.map +1 -1
- package/dist/primitives/Table/useTableDataLoader2.d.ts +2 -1
- package/dist/primitives/Table/useTableDataLoader2.js +36 -3
- package/dist/primitives/Table/useTableDataLoader2.js.map +1 -1
- package/dist/primitives/Table/useTableManager/features/useTableRowActive.cjs +0 -1
- package/dist/primitives/Table/useTableManager/features/useTableRowActive.cjs.map +1 -1
- package/dist/primitives/Table/useTableManager/features/useTableRowActive.d.ts +1 -1
- package/dist/primitives/Table/useTableManager/features/useTableRowActive.js +0 -1
- package/dist/primitives/Table/useTableManager/features/useTableRowActive.js.map +1 -1
- package/dist/primitives/Table/useTableManager/features/useTableRowClick.cjs +0 -2
- package/dist/primitives/Table/useTableManager/features/useTableRowClick.cjs.map +1 -1
- package/dist/primitives/Table/useTableManager/features/useTableRowClick.js +0 -2
- package/dist/primitives/Table/useTableManager/features/useTableRowClick.js.map +1 -1
- package/dist/primitives/Table/useTableManager/features/useTableRowSelection.cjs +0 -1
- package/dist/primitives/Table/useTableManager/features/useTableRowSelection.cjs.map +1 -1
- package/dist/primitives/Table/useTableManager/features/useTableRowSelection.js +0 -1
- package/dist/primitives/Table/useTableManager/features/useTableRowSelection.js.map +1 -1
- package/dist/primitives/Table/useTableManager/features/useTableServerLoading.cjs +10 -1
- package/dist/primitives/Table/useTableManager/features/useTableServerLoading.cjs.map +1 -1
- package/dist/primitives/Table/useTableManager/features/useTableServerLoading.d.ts +3 -2
- package/dist/primitives/Table/useTableManager/features/useTableServerLoading.js +10 -1
- package/dist/primitives/Table/useTableManager/features/useTableServerLoading.js.map +1 -1
- package/dist/primitives/Table/useTableManager/useTableManager.cjs +1 -5
- package/dist/primitives/Table/useTableManager/useTableManager.cjs.map +1 -1
- package/dist/primitives/Table/useTableManager/useTableManager.js +1 -5
- package/dist/primitives/Table/useTableManager/useTableManager.js.map +1 -1
- package/dist/primitives/Table/useTableManager/util/dataTypes.cjs.map +1 -1
- package/dist/primitives/Table/useTableManager/util/dataTypes.d.ts +3 -3
- package/dist/primitives/Table/useTableManager/util/dataTypes.js.map +1 -1
- package/dist/primitives/Table/useTableManager/util/filtering.cjs.map +1 -1
- package/dist/primitives/Table/useTableManager/util/filtering.js.map +1 -1
- package/dist/primitives/Table/useTableManager/util/search.cjs +1 -1
- package/dist/primitives/Table/useTableManager/util/search.cjs.map +1 -1
- package/dist/primitives/Table/useTableManager/util/search.js +1 -1
- package/dist/primitives/Table/useTableManager/util/search.js.map +1 -1
- package/dist/primitives/Table/useTableManager/util/setup.cjs +3 -3
- package/dist/primitives/Table/useTableManager/util/setup.cjs.map +1 -1
- package/dist/primitives/Table/useTableManager/util/setup.js +3 -3
- package/dist/primitives/Table/useTableManager/util/setup.js.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utils/dataTypes.cjs +4 -4
- package/dist/utils/dataTypes.cjs.map +1 -1
- package/dist/utils/dataTypes.d.ts +1 -1
- package/dist/utils/dataTypes.js +4 -4
- package/dist/utils/dataTypes.js.map +1 -1
- package/dist/utils/date.cjs +14 -16
- package/dist/utils/date.cjs.map +1 -1
- package/dist/utils/date.js +14 -16
- package/dist/utils/date.js.map +1 -1
- package/dist/utils/debounce.cjs.map +1 -1
- package/dist/utils/debounce.d.ts +1 -1
- package/dist/utils/debounce.js.map +1 -1
- package/dist/utils/device.cjs +1 -1
- package/dist/utils/device.cjs.map +1 -1
- package/dist/utils/device.js +1 -1
- package/dist/utils/device.js.map +1 -1
- package/dist/utils/dom.cjs +1 -1
- package/dist/utils/dom.cjs.map +1 -1
- package/dist/utils/dom.d.ts +2 -2
- package/dist/utils/dom.js +1 -1
- package/dist/utils/dom.js.map +1 -1
- package/dist/utils/hooks/useDraggable.cjs.map +1 -1
- package/dist/utils/hooks/useDraggable.d.ts +9 -1
- package/dist/utils/hooks/useDraggable.js.map +1 -1
- package/dist/utils/hooks/useListKeyboardNavigation.cjs +1 -1
- package/dist/utils/hooks/useListKeyboardNavigation.cjs.map +1 -1
- package/dist/utils/hooks/useListKeyboardNavigation.js +1 -1
- package/dist/utils/hooks/useListKeyboardNavigation.js.map +1 -1
- package/dist/utils/hooks/useListScrollTo.cjs.map +1 -1
- package/dist/utils/hooks/useListScrollTo.d.ts +4 -1
- package/dist/utils/hooks/useListScrollTo.js.map +1 -1
- package/dist/utils/hooks/useOnClickOutside.cjs.map +1 -1
- package/dist/utils/hooks/useOnClickOutside.d.ts +1 -1
- package/dist/utils/hooks/useOnClickOutside.js.map +1 -1
- package/dist/utils/hooks/useTruncated.cjs.map +1 -1
- package/dist/utils/hooks/useTruncated.d.ts +2 -1
- package/dist/utils/hooks/useTruncated.js.map +1 -1
- package/dist/utils/mergeRefs.cjs.map +1 -1
- package/dist/utils/mergeRefs.d.ts +1 -1
- package/dist/utils/mergeRefs.js.map +1 -1
- package/dist/utils/storyutils.d.ts +1 -3
- package/package.json +4 -5
- package/plugins/tailwindcss-group-peer.js +1 -1
- package/scripts/stylelint-plugin/radius.mjs +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AreaChart.cjs","sources":["../../../../src/charts/components/Area/AreaChart.tsx"],"sourcesContent":["import cn from 'clsx';\nimport React from 'react';\nimport * as RechartsPrimitive from 'recharts';\n\nimport { getAxisProps, stripCartesianProps } from '@/charts/utils/common';\n\nimport { ChartWrapper } from '../ChartWrapper';\nimport { Legend } from '../Legend';\nimport { Tooltip } from '../Tooltip';\nimport type { ChartChildProps, CartesianChartProps, CurveType } from '../types';\nimport { useChart } from '../useChartData';\n\nexport type AreaChartProps<TData extends object> = {\n /** Show dots for each data point\n * @default false\n */\n showDots?: boolean;\n /** Stack areas on top of one another, instead of other each other. 'expand' fills the available space\n * @default false\n */\n stacked?: boolean | 'expand';\n /** Interpolation type of the line\n * @default natural\n */\n type?: CurveType;\n} & CartesianChartProps<TData>;\n\nexport function AreaChart<TData extends object>(props: AreaChartProps<TData>) {\n const {\n children,\n className: customClassName,\n data,\n showLegend = false,\n showDots = false,\n stacked = false,\n tooltipTitle,\n type = 'natural',\n ...attributes\n } = stripCartesianProps<AreaChartProps<TData>>(props);\n\n const className = cn('relative aspect-video', { 'pb-8': showLegend }, customClassName);\n const { items, shapes, activeIndex, setActiveIndex, toggleItem } = useChart<TData>(children);\n\n return (\n <div className={className} data-taco=\"chart-wrapper\">\n <ChartWrapper {...attributes} className=\"h-full w-full\" data-taco=\"chart-area\">\n <RechartsPrimitive.AreaChart\n data={data}\n margin={{\n bottom: 0,\n // ensures dots on the edges of the chart don't get cropped\n left: 4,\n right: 4,\n top: 4,\n }}\n stackOffset={stacked === 'expand' ? 'expand' : undefined}>\n <RechartsPrimitive.CartesianGrid vertical={false} />\n <RechartsPrimitive.Tooltip content={<Tooltip title={tooltipTitle} />} />\n <RechartsPrimitive.XAxis {...getAxisProps('x', props)} />\n <RechartsPrimitive.YAxis {...getAxisProps('y', props)} />\n {shapes.map(shape => (\n <RechartsPrimitive.Area\n key={shape.dataKey}\n {...shape}\n dot={showDots ? shape.dot : false}\n fillOpacity={0.4}\n stackId={stacked ? 'stack' : undefined}\n type={type}\n />\n ))}\n </RechartsPrimitive.AreaChart>\n </ChartWrapper>\n {showLegend ? (\n <Legend<TData> items={items} hoverIndex={activeIndex} onHover={setActiveIndex} onToggle={toggleItem} />\n ) : null}\n </div>\n );\n}\n\n// oxlint-disable-next-line no-empty-object-type\nexport type AreaChartAreaProps<TData extends object> =
|
|
1
|
+
{"version":3,"file":"AreaChart.cjs","sources":["../../../../src/charts/components/Area/AreaChart.tsx"],"sourcesContent":["import cn from 'clsx';\nimport React from 'react';\nimport * as RechartsPrimitive from 'recharts';\n\nimport { getAxisProps, stripCartesianProps } from '@/charts/utils/common';\n\nimport { ChartWrapper } from '../ChartWrapper';\nimport { Legend } from '../Legend';\nimport { Tooltip } from '../Tooltip';\nimport type { ChartChildProps, CartesianChartProps, CurveType } from '../types';\nimport { useChart } from '../useChartData';\n\nexport type AreaChartProps<TData extends object> = {\n /** Show dots for each data point\n * @default false\n */\n showDots?: boolean;\n /** Stack areas on top of one another, instead of other each other. 'expand' fills the available space\n * @default false\n */\n stacked?: boolean | 'expand';\n /** Interpolation type of the line\n * @default natural\n */\n type?: CurveType;\n} & CartesianChartProps<TData>;\n\nexport function AreaChart<TData extends object>(props: AreaChartProps<TData>) {\n const {\n children,\n className: customClassName,\n data,\n showLegend = false,\n showDots = false,\n stacked = false,\n tooltipTitle,\n type = 'natural',\n ...attributes\n } = stripCartesianProps<TData, AreaChartProps<TData>>(props);\n\n const className = cn('relative aspect-video', { 'pb-8': showLegend }, customClassName);\n const { items, shapes, activeIndex, setActiveIndex, toggleItem } = useChart<TData>(children);\n\n return (\n <div className={className} data-taco=\"chart-wrapper\">\n <ChartWrapper {...attributes} className=\"h-full w-full\" data-taco=\"chart-area\">\n <RechartsPrimitive.AreaChart\n data={data}\n margin={{\n bottom: 0,\n // ensures dots on the edges of the chart don't get cropped\n left: 4,\n right: 4,\n top: 4,\n }}\n stackOffset={stacked === 'expand' ? 'expand' : undefined}>\n <RechartsPrimitive.CartesianGrid vertical={false} />\n <RechartsPrimitive.Tooltip content={<Tooltip title={tooltipTitle} />} />\n <RechartsPrimitive.XAxis {...getAxisProps('x', props)} />\n <RechartsPrimitive.YAxis {...getAxisProps('y', props)} />\n {shapes.map(shape => (\n <RechartsPrimitive.Area\n key={shape.dataKey}\n {...shape}\n dot={showDots ? shape.dot : false}\n fillOpacity={0.4}\n stackId={stacked ? 'stack' : undefined}\n type={type}\n />\n ))}\n </RechartsPrimitive.AreaChart>\n </ChartWrapper>\n {showLegend ? (\n <Legend<TData> items={items} hoverIndex={activeIndex} onHover={setActiveIndex} onToggle={toggleItem} />\n ) : null}\n </div>\n );\n}\n\n// oxlint-disable-next-line no-empty-object-type\nexport type AreaChartAreaProps<TData extends object> = ChartChildProps<TData>;\n\nfunction Area<TData extends object>(_: AreaChartAreaProps<TData>): React.JSX.Element | null {\n return null;\n}\nAreaChart.Area = Area;\n"],"names":["stripCartesianProps","useChart","ChartWrapper","RechartsPrimitive","Tooltip","getAxisProps","Legend"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BO,SAAS,UAAgC,OAA8B;AAC1E,QAAM;AAAA,IACF;AAAA,IACA,WAAW;AAAA,IACX;AAAA,IACA,aAAa;AAAA,IACb,WAAW;AAAA,IACX,UAAU;AAAA,IACV;AAAA,IACA,OAAO;AAAA,IACP,GAAG;AAAA,EAAA,IACHA,OAAAA,oBAAkD,KAAK;AAE3D,QAAM,YAAY,GAAG,yBAAyB,EAAE,QAAQ,WAAA,GAAc,eAAe;AACrF,QAAM,EAAE,OAAO,QAAQ,aAAa,gBAAgB,WAAA,IAAeC,aAAAA,SAAgB,QAAQ;AAE3F,SACI,sBAAA,cAAC,OAAA,EAAI,WAAsB,aAAU,gBAAA,GACjC,sBAAA,cAACC,aAAAA,cAAA,EAAc,GAAG,YAAY,WAAU,iBAAgB,aAAU,aAAA,GAC9D,sBAAA;AAAA,IAACC,6BAAkB;AAAA,IAAlB;AAAA,MACG;AAAA,MACA,QAAQ;AAAA,QACJ,QAAQ;AAAA;AAAA,QAER,MAAM;AAAA,QACN,OAAO;AAAA,QACP,KAAK;AAAA,MAAA;AAAA,MAET,aAAa,YAAY,WAAW,WAAW;AAAA,IAAA;AAAA,IAC/C,sBAAA,cAACA,6BAAkB,eAAlB,EAAgC,UAAU,OAAO;AAAA,IAClD,sBAAA,cAACA,6BAAkB,SAAlB,EAA0B,SAAS,sBAAA,cAACC,QAAAA,SAAA,EAAQ,OAAO,aAAA,CAAc,EAAA,CAAI;AAAA,IACtE,sBAAA,cAACD,6BAAkB,OAAlB,EAAyB,GAAGE,oBAAa,KAAK,KAAK,GAAG;AAAA,IACvD,sBAAA,cAACF,6BAAkB,OAAlB,EAAyB,GAAGE,oBAAa,KAAK,KAAK,GAAG;AAAA,IACtD,OAAO,IAAI,CAAA,UACR,sBAAA;AAAA,MAACF,6BAAkB;AAAA,MAAlB;AAAA,QACG,KAAK,MAAM;AAAA,QACV,GAAG;AAAA,QACJ,KAAK,WAAW,MAAM,MAAM;AAAA,QAC5B,aAAa;AAAA,QACb,SAAS,UAAU,UAAU;AAAA,QAC7B;AAAA,MAAA;AAAA,IAAA,CAEP;AAAA,EAAA,CAET,GACC,aACG,sBAAA,cAACG,OAAAA,QAAA,EAAc,OAAc,YAAY,aAAa,SAAS,gBAAgB,UAAU,WAAA,CAAY,IACrG,IACR;AAER;AAKA,SAAS,KAA2B,GAAwD;AACxF,SAAO;AACX;AACA,UAAU,OAAO;;"}
|
|
@@ -18,4 +18,4 @@ export declare function AreaChart<TData extends object>(props: AreaChartProps<TD
|
|
|
18
18
|
export declare namespace AreaChart {
|
|
19
19
|
var Area: <TData extends object>(_: AreaChartAreaProps<TData>) => React.JSX.Element | null;
|
|
20
20
|
}
|
|
21
|
-
export type AreaChartAreaProps<TData extends object> =
|
|
21
|
+
export type AreaChartAreaProps<TData extends object> = ChartChildProps<TData>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AreaChart.js","sources":["../../../../src/charts/components/Area/AreaChart.tsx"],"sourcesContent":["import cn from 'clsx';\nimport React from 'react';\nimport * as RechartsPrimitive from 'recharts';\n\nimport { getAxisProps, stripCartesianProps } from '@/charts/utils/common';\n\nimport { ChartWrapper } from '../ChartWrapper';\nimport { Legend } from '../Legend';\nimport { Tooltip } from '../Tooltip';\nimport type { ChartChildProps, CartesianChartProps, CurveType } from '../types';\nimport { useChart } from '../useChartData';\n\nexport type AreaChartProps<TData extends object> = {\n /** Show dots for each data point\n * @default false\n */\n showDots?: boolean;\n /** Stack areas on top of one another, instead of other each other. 'expand' fills the available space\n * @default false\n */\n stacked?: boolean | 'expand';\n /** Interpolation type of the line\n * @default natural\n */\n type?: CurveType;\n} & CartesianChartProps<TData>;\n\nexport function AreaChart<TData extends object>(props: AreaChartProps<TData>) {\n const {\n children,\n className: customClassName,\n data,\n showLegend = false,\n showDots = false,\n stacked = false,\n tooltipTitle,\n type = 'natural',\n ...attributes\n } = stripCartesianProps<AreaChartProps<TData>>(props);\n\n const className = cn('relative aspect-video', { 'pb-8': showLegend }, customClassName);\n const { items, shapes, activeIndex, setActiveIndex, toggleItem } = useChart<TData>(children);\n\n return (\n <div className={className} data-taco=\"chart-wrapper\">\n <ChartWrapper {...attributes} className=\"h-full w-full\" data-taco=\"chart-area\">\n <RechartsPrimitive.AreaChart\n data={data}\n margin={{\n bottom: 0,\n // ensures dots on the edges of the chart don't get cropped\n left: 4,\n right: 4,\n top: 4,\n }}\n stackOffset={stacked === 'expand' ? 'expand' : undefined}>\n <RechartsPrimitive.CartesianGrid vertical={false} />\n <RechartsPrimitive.Tooltip content={<Tooltip title={tooltipTitle} />} />\n <RechartsPrimitive.XAxis {...getAxisProps('x', props)} />\n <RechartsPrimitive.YAxis {...getAxisProps('y', props)} />\n {shapes.map(shape => (\n <RechartsPrimitive.Area\n key={shape.dataKey}\n {...shape}\n dot={showDots ? shape.dot : false}\n fillOpacity={0.4}\n stackId={stacked ? 'stack' : undefined}\n type={type}\n />\n ))}\n </RechartsPrimitive.AreaChart>\n </ChartWrapper>\n {showLegend ? (\n <Legend<TData> items={items} hoverIndex={activeIndex} onHover={setActiveIndex} onToggle={toggleItem} />\n ) : null}\n </div>\n );\n}\n\n// oxlint-disable-next-line no-empty-object-type\nexport type AreaChartAreaProps<TData extends object> =
|
|
1
|
+
{"version":3,"file":"AreaChart.js","sources":["../../../../src/charts/components/Area/AreaChart.tsx"],"sourcesContent":["import cn from 'clsx';\nimport React from 'react';\nimport * as RechartsPrimitive from 'recharts';\n\nimport { getAxisProps, stripCartesianProps } from '@/charts/utils/common';\n\nimport { ChartWrapper } from '../ChartWrapper';\nimport { Legend } from '../Legend';\nimport { Tooltip } from '../Tooltip';\nimport type { ChartChildProps, CartesianChartProps, CurveType } from '../types';\nimport { useChart } from '../useChartData';\n\nexport type AreaChartProps<TData extends object> = {\n /** Show dots for each data point\n * @default false\n */\n showDots?: boolean;\n /** Stack areas on top of one another, instead of other each other. 'expand' fills the available space\n * @default false\n */\n stacked?: boolean | 'expand';\n /** Interpolation type of the line\n * @default natural\n */\n type?: CurveType;\n} & CartesianChartProps<TData>;\n\nexport function AreaChart<TData extends object>(props: AreaChartProps<TData>) {\n const {\n children,\n className: customClassName,\n data,\n showLegend = false,\n showDots = false,\n stacked = false,\n tooltipTitle,\n type = 'natural',\n ...attributes\n } = stripCartesianProps<TData, AreaChartProps<TData>>(props);\n\n const className = cn('relative aspect-video', { 'pb-8': showLegend }, customClassName);\n const { items, shapes, activeIndex, setActiveIndex, toggleItem } = useChart<TData>(children);\n\n return (\n <div className={className} data-taco=\"chart-wrapper\">\n <ChartWrapper {...attributes} className=\"h-full w-full\" data-taco=\"chart-area\">\n <RechartsPrimitive.AreaChart\n data={data}\n margin={{\n bottom: 0,\n // ensures dots on the edges of the chart don't get cropped\n left: 4,\n right: 4,\n top: 4,\n }}\n stackOffset={stacked === 'expand' ? 'expand' : undefined}>\n <RechartsPrimitive.CartesianGrid vertical={false} />\n <RechartsPrimitive.Tooltip content={<Tooltip title={tooltipTitle} />} />\n <RechartsPrimitive.XAxis {...getAxisProps('x', props)} />\n <RechartsPrimitive.YAxis {...getAxisProps('y', props)} />\n {shapes.map(shape => (\n <RechartsPrimitive.Area\n key={shape.dataKey}\n {...shape}\n dot={showDots ? shape.dot : false}\n fillOpacity={0.4}\n stackId={stacked ? 'stack' : undefined}\n type={type}\n />\n ))}\n </RechartsPrimitive.AreaChart>\n </ChartWrapper>\n {showLegend ? (\n <Legend<TData> items={items} hoverIndex={activeIndex} onHover={setActiveIndex} onToggle={toggleItem} />\n ) : null}\n </div>\n );\n}\n\n// oxlint-disable-next-line no-empty-object-type\nexport type AreaChartAreaProps<TData extends object> = ChartChildProps<TData>;\n\nfunction Area<TData extends object>(_: AreaChartAreaProps<TData>): React.JSX.Element | null {\n return null;\n}\nAreaChart.Area = Area;\n"],"names":["React"],"mappings":";;;;;;;;AA2BO,SAAS,UAAgC,OAA8B;AAC1E,QAAM;AAAA,IACF;AAAA,IACA,WAAW;AAAA,IACX;AAAA,IACA,aAAa;AAAA,IACb,WAAW;AAAA,IACX,UAAU;AAAA,IACV;AAAA,IACA,OAAO;AAAA,IACP,GAAG;AAAA,EAAA,IACH,oBAAkD,KAAK;AAE3D,QAAM,YAAY,GAAG,yBAAyB,EAAE,QAAQ,WAAA,GAAc,eAAe;AACrF,QAAM,EAAE,OAAO,QAAQ,aAAa,gBAAgB,WAAA,IAAe,SAAgB,QAAQ;AAE3F,SACIA,+BAAA,cAAC,OAAA,EAAI,WAAsB,aAAU,gBAAA,GACjCA,+BAAA,cAAC,cAAA,EAAc,GAAG,YAAY,WAAU,iBAAgB,aAAU,aAAA,GAC9DA,+BAAA;AAAA,IAAC,kBAAkB;AAAA,IAAlB;AAAA,MACG;AAAA,MACA,QAAQ;AAAA,QACJ,QAAQ;AAAA;AAAA,QAER,MAAM;AAAA,QACN,OAAO;AAAA,QACP,KAAK;AAAA,MAAA;AAAA,MAET,aAAa,YAAY,WAAW,WAAW;AAAA,IAAA;AAAA,IAC/CA,+BAAA,cAAC,kBAAkB,eAAlB,EAAgC,UAAU,OAAO;AAAA,IAClDA,+BAAA,cAAC,kBAAkB,SAAlB,EAA0B,SAASA,+BAAA,cAAC,SAAA,EAAQ,OAAO,aAAA,CAAc,EAAA,CAAI;AAAA,IACtEA,+BAAA,cAAC,kBAAkB,OAAlB,EAAyB,GAAG,aAAa,KAAK,KAAK,GAAG;AAAA,IACvDA,+BAAA,cAAC,kBAAkB,OAAlB,EAAyB,GAAG,aAAa,KAAK,KAAK,GAAG;AAAA,IACtD,OAAO,IAAI,CAAA,UACRA,+BAAA;AAAA,MAAC,kBAAkB;AAAA,MAAlB;AAAA,QACG,KAAK,MAAM;AAAA,QACV,GAAG;AAAA,QACJ,KAAK,WAAW,MAAM,MAAM;AAAA,QAC5B,aAAa;AAAA,QACb,SAAS,UAAU,UAAU;AAAA,QAC7B;AAAA,MAAA;AAAA,IAAA,CAEP;AAAA,EAAA,CAET,GACC,aACGA,+BAAA,cAAC,QAAA,EAAc,OAAc,YAAY,aAAa,SAAS,gBAAgB,UAAU,WAAA,CAAY,IACrG,IACR;AAER;AAKA,SAAS,KAA2B,GAAwD;AACxF,SAAO;AACX;AACA,UAAU,OAAO;"}
|
|
@@ -32,14 +32,14 @@ function BarChart(props) {
|
|
|
32
32
|
children,
|
|
33
33
|
className: customClassName,
|
|
34
34
|
data,
|
|
35
|
-
orientation
|
|
35
|
+
orientation,
|
|
36
36
|
showLabels = false,
|
|
37
37
|
showLegend = false,
|
|
38
38
|
stacked = false,
|
|
39
39
|
tooltipTitle,
|
|
40
40
|
...attributes
|
|
41
41
|
} = common.stripCartesianProps(props);
|
|
42
|
-
const isHorizontal =
|
|
42
|
+
const isHorizontal = orientation === "horizontal";
|
|
43
43
|
const className = cn("relative aspect-video", { "pb-8": showLegend }, customClassName);
|
|
44
44
|
const { items, shapes, activeIndex, setActiveIndex, toggleItem } = useChartData.useChart(children);
|
|
45
45
|
return /* @__PURE__ */ React.createElement("div", { className, "data-taco": "chart-wrapper" }, /* @__PURE__ */ React.createElement(ChartWrapper.ChartWrapper, { ...attributes, className: "h-full w-full", "data-taco": "chart-bar" }, /* @__PURE__ */ React.createElement(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BarChart.cjs","sources":["../../../../src/charts/components/Bar/BarChart.tsx"],"sourcesContent":["import cn from 'clsx';\nimport React from 'react';\nimport * as RechartsPrimitive from 'recharts';\n\nimport { getInverseThemeColor } from '@/charts/utils/color';\nimport { getAxisProps, stripCartesianProps } from '@/charts/utils/common';\n\nimport { ChartWrapper } from '../ChartWrapper';\nimport { Legend } from '../Legend';\nimport { Tooltip } from '../Tooltip';\nimport type { ChartChildProps, CartesianChartProps } from '../types';\nimport type { ChartShape } from '../useChartData';\nimport { useChart } from '../useChartData';\n\nconst BAR_WIDTH = 18;\nexport type BarChartProps<TData extends object> = {\n /** Orientation of the bars\n * @default false\n */\n orientation?: 'horizontal' | 'vertical';\n /** Show bar values as labels next to/inside the bar\n * @default vertical\n */\n showLabels?: boolean;\n /** Stack bars on top of one another, instead of other each other. 'expand' fills the available space\n * @default false\n */\n stacked?: boolean | 'expand';\n} & CartesianChartProps<TData>;\n\nexport function BarChart<TData extends object>(props: BarChartProps<TData>) {\n const {\n children,\n className: customClassName,\n data,\n orientation
|
|
1
|
+
{"version":3,"file":"BarChart.cjs","sources":["../../../../src/charts/components/Bar/BarChart.tsx"],"sourcesContent":["import cn from 'clsx';\nimport React from 'react';\nimport * as RechartsPrimitive from 'recharts';\n\nimport { getInverseThemeColor } from '@/charts/utils/color';\nimport { getAxisProps, stripCartesianProps } from '@/charts/utils/common';\n\nimport { ChartWrapper } from '../ChartWrapper';\nimport { Legend } from '../Legend';\nimport { Tooltip } from '../Tooltip';\nimport type { ChartChildProps, CartesianChartProps } from '../types';\nimport type { ChartShape } from '../useChartData';\nimport { useChart } from '../useChartData';\n\nconst BAR_WIDTH = 18;\nexport type BarChartProps<TData extends object> = {\n /** Orientation of the bars\n * @default false\n */\n orientation?: 'horizontal' | 'vertical';\n /** Show bar values as labels next to/inside the bar\n * @default vertical\n */\n showLabels?: boolean;\n /** Stack bars on top of one another, instead of other each other. 'expand' fills the available space\n * @default false\n */\n stacked?: boolean | 'expand';\n} & CartesianChartProps<TData>;\n\nexport function BarChart<TData extends object>(props: BarChartProps<TData>) {\n const {\n children,\n className: customClassName,\n data,\n orientation,\n showLabels = false,\n showLegend = false,\n stacked = false,\n tooltipTitle,\n ...attributes\n } = stripCartesianProps<TData, BarChartProps<TData>>(props);\n const isHorizontal = orientation === 'horizontal';\n\n const className = cn('relative aspect-video', { 'pb-8': showLegend }, customClassName);\n const { items, shapes, activeIndex, setActiveIndex, toggleItem } = useChart<TData>(children);\n\n return (\n <div className={className} data-taco=\"chart-wrapper\">\n <ChartWrapper {...attributes} className=\"h-full w-full\" data-taco=\"chart-bar\">\n <RechartsPrimitive.BarChart\n data={data}\n // style props - these are % so that they \"look okay\" for really wide charts as well as small ones\n barCategoryGap=\"15%\"\n barGap=\"7.5%\"\n margin={{\n bottom: 0,\n left: 0,\n right: 0,\n // ensures labels on top of bars don't get cropped\n top: isHorizontal ? 0 : 10,\n }}\n layout={isHorizontal ? 'vertical' : undefined}\n stackOffset={stacked === 'expand' ? 'expand' : undefined}>\n <RechartsPrimitive.CartesianGrid horizontal={!isHorizontal} vertical={false} />\n <RechartsPrimitive.Tooltip content={<Tooltip title={tooltipTitle} />} />\n <RechartsPrimitive.XAxis {...getAxisProps('x', props, isHorizontal)} />\n <RechartsPrimitive.YAxis {...getAxisProps('y', props, isHorizontal)} />\n {renderBars(shapes, showLabels, stacked, isHorizontal)}\n </RechartsPrimitive.BarChart>\n </ChartWrapper>\n {showLegend ? (\n <Legend<TData> items={items} hoverIndex={activeIndex} onHover={setActiveIndex} onToggle={toggleItem} />\n ) : null}\n </div>\n );\n}\n/**\n * Helper function to render bar shapes as Recharts Bar primitives. Extracted to be reusable across BarChart and ComposedChart.\n */\nexport const renderBars = (\n shapes: ChartShape[],\n showLabels: boolean = false,\n stacked: boolean | 'expand' = false,\n isHorizontal: boolean = false\n) => {\n return shapes.map((shape, index) => (\n <RechartsPrimitive.Bar\n key={shape.dataKey}\n {...shape}\n activeBar={{ fillOpacity: 1, strokeWidth: 0 }}\n maxBarSize={BAR_WIDTH}\n radius={getRadius(index, shapes.length, !!stacked, isHorizontal)}\n stackId={stacked ? 'stack' : undefined}\n strokeWidth={0}>\n {showLabels ? (\n <RechartsPrimitive.LabelList\n position={isHorizontal ? 'insideRight' : 'top'}\n // LabelList's LabelFormatter (single arg, non-JSX return) is incompatible with the\n // series Formatter stored on the shape; the runtime label value is always numeric\n formatter={shape.formatter as React.ComponentProps<typeof RechartsPrimitive.LabelList>['formatter']}\n offset={6}\n fill={isHorizontal ? getInverseThemeColor(shape.color ?? '') : 'black'}\n fontSize={11}\n />\n ) : null}\n </RechartsPrimitive.Bar>\n ));\n};\n\nfunction getRadius(\n index: number,\n length: number,\n stacked: boolean,\n isHorizontal: boolean\n): number | [number, number, number, number] {\n if (stacked) {\n if (index === 0) {\n return isHorizontal ? [3, 0, 0, 3] : [0, 0, 3, 3];\n }\n\n if (index === length - 1) {\n return isHorizontal ? [0, 3, 3, 0] : [3, 3, 0, 0];\n }\n\n return 0;\n }\n\n return 3;\n}\n\n// oxlint-disable-next-line no-empty-object-type\nexport type BarChartBarProps<TData extends object> = ChartChildProps<TData>;\n\nfunction Bar<TData extends object>(_: BarChartBarProps<TData>): React.JSX.Element | null {\n return null;\n}\nBarChart.Bar = Bar;\n"],"names":["stripCartesianProps","useChart","ChartWrapper","RechartsPrimitive","Tooltip","getAxisProps","Legend","getInverseThemeColor"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,MAAM,YAAY;AAgBX,SAAS,SAA+B,OAA6B;AACxE,QAAM;AAAA,IACF;AAAA,IACA,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA,aAAa;AAAA,IACb,aAAa;AAAA,IACb,UAAU;AAAA,IACV;AAAA,IAC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,aAAsB,OACtB,UAA8B,OAC9B,eAAwB,UACvB;AACD,SAAO,OAAO,IAAI,CAAC,OAAO,UACtB,sBAAA;AAAA,IAACH,6BAAkB;AAAA,IAAlB;AAAA,MACG,KAAK,MAAM;AAAA,MACV,GAAG;AAAA,MACJ,WAAW,EAAE,aAAa,GAAG,aAAa,EAAA;AAAA,MAC1C,YAAY;AAAA,MACZ,QAAQ,UAAU,OAAO,OAAO,QAAQ,CAAC,CAAC,SAAS,YAAY;AAAA,MAC/D,SAAS,UAAU,UAAU;AAAA,MAC7B,aAAa;AAAA,IAAA;AAAA,IACZ,aACG,sBAAA;AAAA,MAACA,6BAAkB;AAAA,MAAlB;AAAA,QACG,UAAU,eAAe,gBAAgB;AAAA,QAGzC,WAAW,MAAM;AAAA,QACjB,QAAQ;AAAA,QACR,MAAM,eAAeI,MAAAA,qBAAqB,MAAM,SAAS,EAAE,IAAI;AAAA,QAC/D,UAAU;AAAA,MAAA;AAAA,IAAA,IAEd;AAAA,EAAA,CAEX;AACL;AAEA,SAAS,UACL,OACA,QACA,SACA,cACyC;AACzC,MAAI,SAAS;AACT,QAAI,UAAU,GAAG;AACb,aAAO,eAAe,CAAC,GAAG,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;AAAA,IACpD;AAEA,QAAI,UAAU,SAAS,GAAG;AACtB,aAAO,eAAe,CAAC,GAAG,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;AAAA,IACpD;AAEA,WAAO;AAAA,EACX;AAEA,SAAO;AACX;AAKA,SAAS,IAA0B,GAAsD;AACrF,SAAO;AACX;AACA,SAAS,MAAM;;;"}
|
|
@@ -23,4 +23,4 @@ export declare namespace BarChart {
|
|
|
23
23
|
* Helper function to render bar shapes as Recharts Bar primitives. Extracted to be reusable across BarChart and ComposedChart.
|
|
24
24
|
*/
|
|
25
25
|
export declare const renderBars: (shapes: ChartShape[], showLabels?: boolean, stacked?: boolean | "expand", isHorizontal?: boolean) => React.JSX.Element[];
|
|
26
|
-
export type BarChartBarProps<TData extends object> =
|
|
26
|
+
export type BarChartBarProps<TData extends object> = ChartChildProps<TData>;
|
|
@@ -13,14 +13,14 @@ function BarChart(props) {
|
|
|
13
13
|
children,
|
|
14
14
|
className: customClassName,
|
|
15
15
|
data,
|
|
16
|
-
orientation
|
|
16
|
+
orientation,
|
|
17
17
|
showLabels = false,
|
|
18
18
|
showLegend = false,
|
|
19
19
|
stacked = false,
|
|
20
20
|
tooltipTitle,
|
|
21
21
|
...attributes
|
|
22
22
|
} = stripCartesianProps(props);
|
|
23
|
-
const isHorizontal =
|
|
23
|
+
const isHorizontal = orientation === "horizontal";
|
|
24
24
|
const className = cn("relative aspect-video", { "pb-8": showLegend }, customClassName);
|
|
25
25
|
const { items, shapes, activeIndex, setActiveIndex, toggleItem } = useChart(children);
|
|
26
26
|
return /* @__PURE__ */ React__default.createElement("div", { className, "data-taco": "chart-wrapper" }, /* @__PURE__ */ React__default.createElement(ChartWrapper, { ...attributes, className: "h-full w-full", "data-taco": "chart-bar" }, /* @__PURE__ */ React__default.createElement(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BarChart.js","sources":["../../../../src/charts/components/Bar/BarChart.tsx"],"sourcesContent":["import cn from 'clsx';\nimport React from 'react';\nimport * as RechartsPrimitive from 'recharts';\n\nimport { getInverseThemeColor } from '@/charts/utils/color';\nimport { getAxisProps, stripCartesianProps } from '@/charts/utils/common';\n\nimport { ChartWrapper } from '../ChartWrapper';\nimport { Legend } from '../Legend';\nimport { Tooltip } from '../Tooltip';\nimport type { ChartChildProps, CartesianChartProps } from '../types';\nimport type { ChartShape } from '../useChartData';\nimport { useChart } from '../useChartData';\n\nconst BAR_WIDTH = 18;\nexport type BarChartProps<TData extends object> = {\n /** Orientation of the bars\n * @default false\n */\n orientation?: 'horizontal' | 'vertical';\n /** Show bar values as labels next to/inside the bar\n * @default vertical\n */\n showLabels?: boolean;\n /** Stack bars on top of one another, instead of other each other. 'expand' fills the available space\n * @default false\n */\n stacked?: boolean | 'expand';\n} & CartesianChartProps<TData>;\n\nexport function BarChart<TData extends object>(props: BarChartProps<TData>) {\n const {\n children,\n className: customClassName,\n data,\n orientation
|
|
1
|
+
{"version":3,"file":"BarChart.js","sources":["../../../../src/charts/components/Bar/BarChart.tsx"],"sourcesContent":["import cn from 'clsx';\nimport React from 'react';\nimport * as RechartsPrimitive from 'recharts';\n\nimport { getInverseThemeColor } from '@/charts/utils/color';\nimport { getAxisProps, stripCartesianProps } from '@/charts/utils/common';\n\nimport { ChartWrapper } from '../ChartWrapper';\nimport { Legend } from '../Legend';\nimport { Tooltip } from '../Tooltip';\nimport type { ChartChildProps, CartesianChartProps } from '../types';\nimport type { ChartShape } from '../useChartData';\nimport { useChart } from '../useChartData';\n\nconst BAR_WIDTH = 18;\nexport type BarChartProps<TData extends object> = {\n /** Orientation of the bars\n * @default false\n */\n orientation?: 'horizontal' | 'vertical';\n /** Show bar values as labels next to/inside the bar\n * @default vertical\n */\n showLabels?: boolean;\n /** Stack bars on top of one another, instead of other each other. 'expand' fills the available space\n * @default false\n */\n stacked?: boolean | 'expand';\n} & CartesianChartProps<TData>;\n\nexport function BarChart<TData extends object>(props: BarChartProps<TData>) {\n const {\n children,\n className: customClassName,\n data,\n orientation,\n showLabels = false,\n showLegend = false,\n stacked = false,\n tooltipTitle,\n ...attributes\n } = stripCartesianProps<TData, BarChartProps<TData>>(props);\n const isHorizontal = orientation === 'horizontal';\n\n const className = cn('relative aspect-video', { 'pb-8': showLegend }, customClassName);\n const { items, shapes, activeIndex, setActiveIndex, toggleItem } = useChart<TData>(children);\n\n return (\n <div className={className} data-taco=\"chart-wrapper\">\n <ChartWrapper {...attributes} className=\"h-full w-full\" data-taco=\"chart-bar\">\n <RechartsPrimitive.BarChart\n data={data}\n // style props - these are % so that they \"look okay\" for really wide charts as well as small ones\n barCategoryGap=\"15%\"\n barGap=\"7.5%\"\n margin={{\n bottom: 0,\n left: 0,\n right: 0,\n // ensures labels on top of bars don't get cropped\n top: isHorizontal ? 0 : 10,\n }}\n layout={isHorizontal ? 'vertical' : undefined}\n stackOffset={stacked === 'expand' ? 'expand' : undefined}>\n <RechartsPrimitive.CartesianGrid horizontal={!isHorizontal} vertical={false} />\n <RechartsPrimitive.Tooltip content={<Tooltip title={tooltipTitle} />} />\n <RechartsPrimitive.XAxis {...getAxisProps('x', props, isHorizontal)} />\n <RechartsPrimitive.YAxis {...getAxisProps('y', props, isHorizontal)} />\n {renderBars(shapes, showLabels, stacked, isHorizontal)}\n </RechartsPrimitive.BarChart>\n </ChartWrapper>\n {showLegend ? (\n <Legend<TData> items={items} hoverIndex={activeIndex} onHover={setActiveIndex} onToggle={toggleItem} />\n ) : null}\n </div>\n );\n}\n/**\n * Helper function to render bar shapes as Recharts Bar primitives. Extracted to be reusable across BarChart and ComposedChart.\n */\nexport const renderBars = (\n shapes: ChartShape[],\n showLabels: boolean = false,\n stacked: boolean | 'expand' = false,\n isHorizontal: boolean = false\n) => {\n return shapes.map((shape, index) => (\n <RechartsPrimitive.Bar\n key={shape.dataKey}\n {...shape}\n activeBar={{ fillOpacity: 1, strokeWidth: 0 }}\n maxBarSize={BAR_WIDTH}\n radius={getRadius(index, shapes.length, !!stacked, isHorizontal)}\n stackId={stacked ? 'stack' : undefined}\n strokeWidth={0}>\n {showLabels ? (\n <RechartsPrimitive.LabelList\n position={isHorizontal ? 'insideRight' : 'top'}\n // LabelList's LabelFormatter (single arg, non-JSX return) is incompatible with the\n // series Formatter stored on the shape; the runtime label value is always numeric\n formatter={shape.formatter as React.ComponentProps<typeof RechartsPrimitive.LabelList>['formatter']}\n offset={6}\n fill={isHorizontal ? getInverseThemeColor(shape.color ?? '') : 'black'}\n fontSize={11}\n />\n ) : null}\n </RechartsPrimitive.Bar>\n ));\n};\n\nfunction getRadius(\n index: number,\n length: number,\n stacked: boolean,\n isHorizontal: boolean\n): number | [number, number, number, number] {\n if (stacked) {\n if (index === 0) {\n return isHorizontal ? [3, 0, 0, 3] : [0, 0, 3, 3];\n }\n\n if (index === length - 1) {\n return isHorizontal ? [0, 3, 3, 0] : [3, 3, 0, 0];\n }\n\n return 0;\n }\n\n return 3;\n}\n\n// oxlint-disable-next-line no-empty-object-type\nexport type BarChartBarProps<TData extends object> = ChartChildProps<TData>;\n\nfunction Bar<TData extends object>(_: BarChartBarProps<TData>): React.JSX.Element | null {\n return null;\n}\nBarChart.Bar = Bar;\n"],"names":["React"],"mappings":";;;;;;;;;AAcA,MAAM,YAAY;AAgBX,SAAS,SAA+B,OAA6B;AACxE,QAAM;AAAA,IACF;AAAA,IACA,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA,aAAa;AAAA,IACb,aAAa;AAAA,IACb,UAAU;AAAA,IACV;AAAA,IACA,GAAG;AAAA,EAAA,IACH,oBAAiD,KAAK;AAC1D,QAAM,eAAe,gBAAgB;AAErC,QAAM,YAAY,GAAG,yBAAyB,EAAE,QAAQ,WAAA,GAAc,eAAe;AACrF,QAAM,EAAE,OAAO,QAAQ,aAAa,gBAAgB,WAAA,IAAe,SAAgB,QAAQ;AAE3F,SACIA,+BAAA,cAAC,OAAA,EAAI,WAAsB,aAAU,gBAAA,GACjCA,+BAAA,cAAC,cAAA,EAAc,GAAG,YAAY,WAAU,iBAAgB,aAAU,YAAA,GAC9DA,+BAAA;AAAA,IAAC,kBAAkB;AAAA,IAAlB;AAAA,MACG;AAAA,MAEA,gBAAe;AAAA,MACf,QAAO;AAAA,MACP,QAAQ;AAAA,QACJ,QAAQ;AAAA,QACR,MAAM;AAAA,QACN,OAAO;AAAA;AAAA,QAEP,KAAK,eAAe,IAAI;AAAA,MAAA;AAAA,MAE5B,QAAQ,eAAe,aAAa;AAAA,MACpC,aAAa,YAAY,WAAW,WAAW;AAAA,IAAA;AAAA,IAC/CA,+BAAA,cAAC,kBAAkB,eAAlB,EAAgC,YAAY,CAAC,cAAc,UAAU,OAAO;AAAA,IAC7EA,+BAAA,cAAC,kBAAk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AA,IACpD;AAEA,QAAI,UAAU,SAAS,GAAG;AACtB,aAAO,eAAe,CAAC,GAAG,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;AAAA,IACpD;AAEA,WAAO;AAAA,EACX;AAEA,SAAO;AACX;AAKA,SAAS,IAA0B,GAAsD;AACrF,SAAO;AACX;AACA,SAAS,MAAM;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartWrapper.cjs","sources":["../../../src/charts/components/ChartWrapper.tsx"],"sourcesContent":["import cn from 'clsx';\nimport React from 'react';\nimport * as RechartsPrimitive from 'recharts';\n\nimport './style.css';\n\nexport type ChartWrapperProps = {\n children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>['children'];\n onSetWidth?: (width: number) => void;\n} & React.ComponentProps<'div'>;\nexport function ChartWrapper(props: ChartWrapperProps) {\n const { onSetWidth: handleSetWidth, ...attributes } = props;\n const ref = React.useRef<HTMLDivElement>(null);\n\n React.useLayoutEffect(() => {\n if (ref.current && typeof handleSetWidth === 'function') {\n const rect = ref.current.getBoundingClientRect();\n handleSetWidth(rect.width);\n }\n }, [ref]);\n\n const className = cn('m-auto flex justify-center', attributes.className);\n\n return (\n <div {...attributes} className={className} ref={ref}>\n <RechartsPrimitive.ResponsiveContainer>{props.children}</RechartsPrimitive.ResponsiveContainer>\n </div>\n );\n}\n"],"names":["RechartsPrimitive"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"ChartWrapper.cjs","sources":["../../../src/charts/components/ChartWrapper.tsx"],"sourcesContent":["import cn from 'clsx';\nimport React from 'react';\nimport * as RechartsPrimitive from 'recharts';\n\nimport './style.css';\n\nexport type ChartWrapperProps = {\n children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>['children'];\n onSetWidth?: (width: number) => void;\n} & React.ComponentProps<'div'>;\n\nexport function ChartWrapper(props: ChartWrapperProps) {\n const { onSetWidth: handleSetWidth, ...attributes } = props;\n const ref = React.useRef<HTMLDivElement>(null);\n\n React.useLayoutEffect(() => {\n if (ref.current && typeof handleSetWidth === 'function') {\n const rect = ref.current.getBoundingClientRect();\n handleSetWidth(rect.width);\n }\n }, [ref]);\n\n const className = cn('m-auto flex justify-center', attributes.className);\n\n return (\n <div {...attributes} className={className} ref={ref}>\n <RechartsPrimitive.ResponsiveContainer>{props.children}</RechartsPrimitive.ResponsiveContainer>\n </div>\n );\n}\n"],"names":["RechartsPrimitive"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAWO,SAAS,aAAa,OAA0B;AACnD,QAAM,EAAE,YAAY,gBAAgB,GAAG,eAAe;AACtD,QAAM,MAAM,MAAM,OAAuB,IAAI;AAE7C,QAAM,gBAAgB,MAAM;AACxB,QAAI,IAAI,WAAW,OAAO,mBAAmB,YAAY;AACrD,YAAM,OAAO,IAAI,QAAQ,sBAAA;AACzB,qBAAe,KAAK,KAAK;AAAA,IAC7B;AAAA,EACJ,GAAG,CAAC,GAAG,CAAC;AAER,QAAM,YAAY,GAAG,8BAA8B,WAAW,SAAS;AAEvE,SACI,sBAAA,cAAC,OAAA,EAAK,GAAG,YAAY,WAAsB,IAAA,GACvC,sBAAA,cAACA,6BAAkB,qBAAlB,MAAuC,MAAM,QAAS,CAC3D;AAER;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartWrapper.js","sources":["../../../src/charts/components/ChartWrapper.tsx"],"sourcesContent":["import cn from 'clsx';\nimport React from 'react';\nimport * as RechartsPrimitive from 'recharts';\n\nimport './style.css';\n\nexport type ChartWrapperProps = {\n children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>['children'];\n onSetWidth?: (width: number) => void;\n} & React.ComponentProps<'div'>;\nexport function ChartWrapper(props: ChartWrapperProps) {\n const { onSetWidth: handleSetWidth, ...attributes } = props;\n const ref = React.useRef<HTMLDivElement>(null);\n\n React.useLayoutEffect(() => {\n if (ref.current && typeof handleSetWidth === 'function') {\n const rect = ref.current.getBoundingClientRect();\n handleSetWidth(rect.width);\n }\n }, [ref]);\n\n const className = cn('m-auto flex justify-center', attributes.className);\n\n return (\n <div {...attributes} className={className} ref={ref}>\n <RechartsPrimitive.ResponsiveContainer>{props.children}</RechartsPrimitive.ResponsiveContainer>\n </div>\n );\n}\n"],"names":["React"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"ChartWrapper.js","sources":["../../../src/charts/components/ChartWrapper.tsx"],"sourcesContent":["import cn from 'clsx';\nimport React from 'react';\nimport * as RechartsPrimitive from 'recharts';\n\nimport './style.css';\n\nexport type ChartWrapperProps = {\n children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>['children'];\n onSetWidth?: (width: number) => void;\n} & React.ComponentProps<'div'>;\n\nexport function ChartWrapper(props: ChartWrapperProps) {\n const { onSetWidth: handleSetWidth, ...attributes } = props;\n const ref = React.useRef<HTMLDivElement>(null);\n\n React.useLayoutEffect(() => {\n if (ref.current && typeof handleSetWidth === 'function') {\n const rect = ref.current.getBoundingClientRect();\n handleSetWidth(rect.width);\n }\n }, [ref]);\n\n const className = cn('m-auto flex justify-center', attributes.className);\n\n return (\n <div {...attributes} className={className} ref={ref}>\n <RechartsPrimitive.ResponsiveContainer>{props.children}</RechartsPrimitive.ResponsiveContainer>\n </div>\n );\n}\n"],"names":["React"],"mappings":";;;;AAWO,SAAS,aAAa,OAA0B;AACnD,QAAM,EAAE,YAAY,gBAAgB,GAAG,eAAe;AACtD,QAAM,MAAMA,eAAM,OAAuB,IAAI;AAE7CA,iBAAM,gBAAgB,MAAM;AACxB,QAAI,IAAI,WAAW,OAAO,mBAAmB,YAAY;AACrD,YAAM,OAAO,IAAI,QAAQ,sBAAA;AACzB,qBAAe,KAAK,KAAK;AAAA,IAC7B;AAAA,EACJ,GAAG,CAAC,GAAG,CAAC;AAER,QAAM,YAAY,GAAG,8BAA8B,WAAW,SAAS;AAEvE,SACIA,+BAAA,cAAC,OAAA,EAAK,GAAG,YAAY,WAAsB,IAAA,GACvCA,+BAAA,cAAC,kBAAkB,qBAAlB,MAAuC,MAAM,QAAS,CAC3D;AAER;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BarLineChart.cjs","sources":["../../../../src/charts/components/Composed/BarLineChart.tsx"],"sourcesContent":["import cn from 'clsx';\nimport React from 'react';\nimport * as RechartsPrimitive from 'recharts';\n\nimport { getAxisProps, stripCartesianProps } from '@/charts/utils/common';\n\nimport { renderBars } from '../Bar/BarChart';\nimport { ChartWrapper } from '../ChartWrapper';\nimport { Legend } from '../Legend';\nimport { renderLines } from '../Line/LineChart';\nimport { Tooltip } from '../Tooltip';\nimport type { ChartChildProps, CartesianChartProps, CurveType } from '../types';\nimport { useChart } from '../useChartData';\n\nexport type BarLineChartProps<TData extends object> = {\n /** Show bar values as labels next to/inside the bar\n * @default false\n */\n showLabels?: boolean;\n /** Stack bars on top of one another, instead of next to each other. 'expand' fills the available space\n * @default false\n */\n stacked?: boolean | 'expand';\n /** Show dots for each data point on lines\n * @default false\n */\n showDots?: boolean;\n /** Interpolation type of the line\n * @default linear\n */\n lineType?: CurveType;\n} & CartesianChartProps<TData>;\n\nexport function BarLineChart<TData extends object>(props: BarLineChartProps<TData>) {\n const {\n children,\n className: customClassName,\n data,\n showLabels = false,\n showLegend = false,\n stacked = false,\n showDots = false,\n lineType = 'linear',\n tooltipTitle,\n ...attributes\n } = stripCartesianProps<BarLineChartProps<TData>>(props);\n\n const className = cn('relative aspect-video', { 'pb-8': showLegend }, customClassName);\n const { items, shapes, activeIndex, setActiveIndex, toggleItem } = useChart<TData>(children);\n\n // Separate bars and lines based on child component type to identify bar dataKeys\n const barChildren = React.Children.toArray(children).filter(child => React.isValidElement(child) && child.type === Bar);\n // Apply same fallback as useChart: dataKey ?? label\n const barDataKeys = new Set(\n barChildren\n .filter(child => React.isValidElement<ChartChildProps<TData>>(child))\n .map(child => {\n const props = (child as React.ReactElement<ChartChildProps<TData>>).props;\n return props.dataKey ?? props.label;\n })\n );\n\n // Filter shapes from the main useChart call in order to ensure we are not rendering bars or lines that are currently hidden.\n const barShapes = shapes.filter(shape => barDataKeys.has(shape.dataKey as keyof TData & string));\n const lineShapes = shapes.filter(shape => !barDataKeys.has(shape.dataKey as keyof TData & string));\n\n return (\n <div className={className} data-taco=\"chart-wrapper\">\n <ChartWrapper {...attributes} className=\"h-full w-full\" data-taco=\"chart-bar-line\">\n <RechartsPrimitive.ComposedChart\n data={data}\n barCategoryGap=\"15%\"\n barGap=\"7.5%\"\n margin={{\n bottom: 0,\n left: 4,\n right: 4,\n top: 10,\n }}\n stackOffset={stacked === 'expand' ? 'expand' : undefined}>\n <RechartsPrimitive.CartesianGrid vertical={false} />\n <RechartsPrimitive.Tooltip content={<Tooltip title={tooltipTitle} />} />\n <RechartsPrimitive.XAxis {...getAxisProps('x', props)} />\n <RechartsPrimitive.YAxis {...getAxisProps('y', props)} />\n {renderBars(barShapes, showLabels, stacked, false)}\n {renderLines(lineShapes, showDots, lineType)}\n </RechartsPrimitive.ComposedChart>\n </ChartWrapper>\n {showLegend ? (\n <Legend<TData> items={items} hoverIndex={activeIndex} onHover={setActiveIndex} onToggle={toggleItem} />\n ) : null}\n </div>\n );\n}\n\n// oxlint-disable-next-line no-empty-object-type\nexport type BarLineChartBarProps<TData extends object> =
|
|
1
|
+
{"version":3,"file":"BarLineChart.cjs","sources":["../../../../src/charts/components/Composed/BarLineChart.tsx"],"sourcesContent":["import cn from 'clsx';\nimport React from 'react';\nimport * as RechartsPrimitive from 'recharts';\n\nimport { getAxisProps, stripCartesianProps } from '@/charts/utils/common';\n\nimport { renderBars } from '../Bar/BarChart';\nimport { ChartWrapper } from '../ChartWrapper';\nimport { Legend } from '../Legend';\nimport { renderLines } from '../Line/LineChart';\nimport { Tooltip } from '../Tooltip';\nimport type { ChartChildProps, CartesianChartProps, CurveType } from '../types';\nimport { useChart } from '../useChartData';\n\nexport type BarLineChartProps<TData extends object> = {\n /** Show bar values as labels next to/inside the bar\n * @default false\n */\n showLabels?: boolean;\n /** Stack bars on top of one another, instead of next to each other. 'expand' fills the available space\n * @default false\n */\n stacked?: boolean | 'expand';\n /** Show dots for each data point on lines\n * @default false\n */\n showDots?: boolean;\n /** Interpolation type of the line\n * @default linear\n */\n lineType?: CurveType;\n} & CartesianChartProps<TData>;\n\nexport function BarLineChart<TData extends object>(props: BarLineChartProps<TData>) {\n const {\n children,\n className: customClassName,\n data,\n showLabels = false,\n showLegend = false,\n stacked = false,\n showDots = false,\n lineType = 'linear',\n tooltipTitle,\n ...attributes\n } = stripCartesianProps<TData, BarLineChartProps<TData>>(props);\n\n const className = cn('relative aspect-video', { 'pb-8': showLegend }, customClassName);\n const { items, shapes, activeIndex, setActiveIndex, toggleItem } = useChart<TData>(children);\n\n // Separate bars and lines based on child component type to identify bar dataKeys\n const barChildren = React.Children.toArray(children).filter(child => React.isValidElement(child) && child.type === Bar);\n // Apply same fallback as useChart: dataKey ?? label\n const barDataKeys = new Set(\n barChildren\n .filter(child => React.isValidElement<ChartChildProps<TData>>(child))\n .map(child => {\n const props = (child as React.ReactElement<ChartChildProps<TData>>).props;\n return props.dataKey ?? props.label;\n })\n );\n\n // Filter shapes from the main useChart call in order to ensure we are not rendering bars or lines that are currently hidden.\n const barShapes = shapes.filter(shape => barDataKeys.has(shape.dataKey as keyof TData & string));\n const lineShapes = shapes.filter(shape => !barDataKeys.has(shape.dataKey as keyof TData & string));\n\n return (\n <div className={className} data-taco=\"chart-wrapper\">\n <ChartWrapper {...attributes} className=\"h-full w-full\" data-taco=\"chart-bar-line\">\n <RechartsPrimitive.ComposedChart\n data={data}\n barCategoryGap=\"15%\"\n barGap=\"7.5%\"\n margin={{\n bottom: 0,\n left: 4,\n right: 4,\n top: 10,\n }}\n stackOffset={stacked === 'expand' ? 'expand' : undefined}>\n <RechartsPrimitive.CartesianGrid vertical={false} />\n <RechartsPrimitive.Tooltip content={<Tooltip title={tooltipTitle} />} />\n <RechartsPrimitive.XAxis {...getAxisProps('x', props)} />\n <RechartsPrimitive.YAxis {...getAxisProps('y', props)} />\n {renderBars(barShapes, showLabels, stacked, false)}\n {renderLines(lineShapes, showDots, lineType)}\n </RechartsPrimitive.ComposedChart>\n </ChartWrapper>\n {showLegend ? (\n <Legend<TData> items={items} hoverIndex={activeIndex} onHover={setActiveIndex} onToggle={toggleItem} />\n ) : null}\n </div>\n );\n}\n\n// oxlint-disable-next-line no-empty-object-type\nexport type BarLineChartBarProps<TData extends object> = ChartChildProps<TData>;\n\nfunction Bar<TData extends object>(_: BarLineChartBarProps<TData>): React.JSX.Element | null {\n return null;\n}\n\n// oxlint-disable-next-line no-empty-object-type\nexport type BarLineChartLineProps<TData extends object> = ChartChildProps<TData>;\n\nfunction Line<TData extends object>(_: BarLineChartLineProps<TData>): React.JSX.Element | null {\n return null;\n}\n\n// Attach the marker components to BarLineChart\nBarLineChart.Bar = Bar;\nBarLineChart.Line = Line;\n"],"names":["stripCartesianProps","useChart","props","ChartWrapper","RechartsPrimitive","Tooltip","getAxisProps","renderBars","renderLines","Legend"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCO,SAAS,aAAmC,OAAiC;AAChF,QAAM;AAAA,IACF;AAAA,IACA,WAAW;AAAA,IACX;AAAA,IACA,aAAa;AAAA,IACb,aAAa;AAAA,IACb,UAAU;AAAA,IACV,WAAW;AAAA,IACX,WAAW;AAAA,IACX;AAAA,IACA,GAAG;AAAA,EAAA,IACHA,OAAAA,oBAAqD,KAAK;AAE9D,QAAM,YAAY,GAAG,yBAAyB,EAAE,QAAQ,WAAA,GAAc,eAAe;AACrF,QAAM,EAAE,OAAO,QAAQ,aAAa,gBAAgB,WAAA,IAAeC,aAAAA,SAAgB,QAAQ;AAG3F,QAAM,cAAc,MAAM,SAAS,QAAQ,QAAQ,EAAE,OAAO,CAAA,UAAS,MAAM,eAAe,KAAK,KAAK,MAAM,SAAS,GAAG;AAEtH,QAAM,cAAc,IAAI;AAAA,IACpB,YACK,OAA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ACR;AAER;AAKA,SAAS,IAA0B,GAA0D;AACzF,SAAO;AACX;AAKA,SAAS,KAA2B,GAA2D;AAC3F,SAAO;AACX;AAGA,aAAa,MAAM;AACnB,aAAa,OAAO;;"}
|
|
@@ -23,5 +23,5 @@ export declare namespace BarLineChart {
|
|
|
23
23
|
var Bar: <TData extends object>(_: BarLineChartBarProps<TData>) => React.JSX.Element | null;
|
|
24
24
|
var Line: <TData extends object>(_: BarLineChartLineProps<TData>) => React.JSX.Element | null;
|
|
25
25
|
}
|
|
26
|
-
export type BarLineChartBarProps<TData extends object> =
|
|
27
|
-
export type BarLineChartLineProps<TData extends object> =
|
|
26
|
+
export type BarLineChartBarProps<TData extends object> = ChartChildProps<TData>;
|
|
27
|
+
export type BarLineChartLineProps<TData extends object> = ChartChildProps<TData>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BarLineChart.js","sources":["../../../../src/charts/components/Composed/BarLineChart.tsx"],"sourcesContent":["import cn from 'clsx';\nimport React from 'react';\nimport * as RechartsPrimitive from 'recharts';\n\nimport { getAxisProps, stripCartesianProps } from '@/charts/utils/common';\n\nimport { renderBars } from '../Bar/BarChart';\nimport { ChartWrapper } from '../ChartWrapper';\nimport { Legend } from '../Legend';\nimport { renderLines } from '../Line/LineChart';\nimport { Tooltip } from '../Tooltip';\nimport type { ChartChildProps, CartesianChartProps, CurveType } from '../types';\nimport { useChart } from '../useChartData';\n\nexport type BarLineChartProps<TData extends object> = {\n /** Show bar values as labels next to/inside the bar\n * @default false\n */\n showLabels?: boolean;\n /** Stack bars on top of one another, instead of next to each other. 'expand' fills the available space\n * @default false\n */\n stacked?: boolean | 'expand';\n /** Show dots for each data point on lines\n * @default false\n */\n showDots?: boolean;\n /** Interpolation type of the line\n * @default linear\n */\n lineType?: CurveType;\n} & CartesianChartProps<TData>;\n\nexport function BarLineChart<TData extends object>(props: BarLineChartProps<TData>) {\n const {\n children,\n className: customClassName,\n data,\n showLabels = false,\n showLegend = false,\n stacked = false,\n showDots = false,\n lineType = 'linear',\n tooltipTitle,\n ...attributes\n } = stripCartesianProps<BarLineChartProps<TData>>(props);\n\n const className = cn('relative aspect-video', { 'pb-8': showLegend }, customClassName);\n const { items, shapes, activeIndex, setActiveIndex, toggleItem } = useChart<TData>(children);\n\n // Separate bars and lines based on child component type to identify bar dataKeys\n const barChildren = React.Children.toArray(children).filter(child => React.isValidElement(child) && child.type === Bar);\n // Apply same fallback as useChart: dataKey ?? label\n const barDataKeys = new Set(\n barChildren\n .filter(child => React.isValidElement<ChartChildProps<TData>>(child))\n .map(child => {\n const props = (child as React.ReactElement<ChartChildProps<TData>>).props;\n return props.dataKey ?? props.label;\n })\n );\n\n // Filter shapes from the main useChart call in order to ensure we are not rendering bars or lines that are currently hidden.\n const barShapes = shapes.filter(shape => barDataKeys.has(shape.dataKey as keyof TData & string));\n const lineShapes = shapes.filter(shape => !barDataKeys.has(shape.dataKey as keyof TData & string));\n\n return (\n <div className={className} data-taco=\"chart-wrapper\">\n <ChartWrapper {...attributes} className=\"h-full w-full\" data-taco=\"chart-bar-line\">\n <RechartsPrimitive.ComposedChart\n data={data}\n barCategoryGap=\"15%\"\n barGap=\"7.5%\"\n margin={{\n bottom: 0,\n left: 4,\n right: 4,\n top: 10,\n }}\n stackOffset={stacked === 'expand' ? 'expand' : undefined}>\n <RechartsPrimitive.CartesianGrid vertical={false} />\n <RechartsPrimitive.Tooltip content={<Tooltip title={tooltipTitle} />} />\n <RechartsPrimitive.XAxis {...getAxisProps('x', props)} />\n <RechartsPrimitive.YAxis {...getAxisProps('y', props)} />\n {renderBars(barShapes, showLabels, stacked, false)}\n {renderLines(lineShapes, showDots, lineType)}\n </RechartsPrimitive.ComposedChart>\n </ChartWrapper>\n {showLegend ? (\n <Legend<TData> items={items} hoverIndex={activeIndex} onHover={setActiveIndex} onToggle={toggleItem} />\n ) : null}\n </div>\n );\n}\n\n// oxlint-disable-next-line no-empty-object-type\nexport type BarLineChartBarProps<TData extends object> =
|
|
1
|
+
{"version":3,"file":"BarLineChart.js","sources":["../../../../src/charts/components/Composed/BarLineChart.tsx"],"sourcesContent":["import cn from 'clsx';\nimport React from 'react';\nimport * as RechartsPrimitive from 'recharts';\n\nimport { getAxisProps, stripCartesianProps } from '@/charts/utils/common';\n\nimport { renderBars } from '../Bar/BarChart';\nimport { ChartWrapper } from '../ChartWrapper';\nimport { Legend } from '../Legend';\nimport { renderLines } from '../Line/LineChart';\nimport { Tooltip } from '../Tooltip';\nimport type { ChartChildProps, CartesianChartProps, CurveType } from '../types';\nimport { useChart } from '../useChartData';\n\nexport type BarLineChartProps<TData extends object> = {\n /** Show bar values as labels next to/inside the bar\n * @default false\n */\n showLabels?: boolean;\n /** Stack bars on top of one another, instead of next to each other. 'expand' fills the available space\n * @default false\n */\n stacked?: boolean | 'expand';\n /** Show dots for each data point on lines\n * @default false\n */\n showDots?: boolean;\n /** Interpolation type of the line\n * @default linear\n */\n lineType?: CurveType;\n} & CartesianChartProps<TData>;\n\nexport function BarLineChart<TData extends object>(props: BarLineChartProps<TData>) {\n const {\n children,\n className: customClassName,\n data,\n showLabels = false,\n showLegend = false,\n stacked = false,\n showDots = false,\n lineType = 'linear',\n tooltipTitle,\n ...attributes\n } = stripCartesianProps<TData, BarLineChartProps<TData>>(props);\n\n const className = cn('relative aspect-video', { 'pb-8': showLegend }, customClassName);\n const { items, shapes, activeIndex, setActiveIndex, toggleItem } = useChart<TData>(children);\n\n // Separate bars and lines based on child component type to identify bar dataKeys\n const barChildren = React.Children.toArray(children).filter(child => React.isValidElement(child) && child.type === Bar);\n // Apply same fallback as useChart: dataKey ?? label\n const barDataKeys = new Set(\n barChildren\n .filter(child => React.isValidElement<ChartChildProps<TData>>(child))\n .map(child => {\n const props = (child as React.ReactElement<ChartChildProps<TData>>).props;\n return props.dataKey ?? props.label;\n })\n );\n\n // Filter shapes from the main useChart call in order to ensure we are not rendering bars or lines that are currently hidden.\n const barShapes = shapes.filter(shape => barDataKeys.has(shape.dataKey as keyof TData & string));\n const lineShapes = shapes.filter(shape => !barDataKeys.has(shape.dataKey as keyof TData & string));\n\n return (\n <div className={className} data-taco=\"chart-wrapper\">\n <ChartWrapper {...attributes} className=\"h-full w-full\" data-taco=\"chart-bar-line\">\n <RechartsPrimitive.ComposedChart\n data={data}\n barCategoryGap=\"15%\"\n barGap=\"7.5%\"\n margin={{\n bottom: 0,\n left: 4,\n right: 4,\n top: 10,\n }}\n stackOffset={stacked === 'expand' ? 'expand' : undefined}>\n <RechartsPrimitive.CartesianGrid vertical={false} />\n <RechartsPrimitive.Tooltip content={<Tooltip title={tooltipTitle} />} />\n <RechartsPrimitive.XAxis {...getAxisProps('x', props)} />\n <RechartsPrimitive.YAxis {...getAxisProps('y', props)} />\n {renderBars(barShapes, showLabels, stacked, false)}\n {renderLines(lineShapes, showDots, lineType)}\n </RechartsPrimitive.ComposedChart>\n </ChartWrapper>\n {showLegend ? (\n <Legend<TData> items={items} hoverIndex={activeIndex} onHover={setActiveIndex} onToggle={toggleItem} />\n ) : null}\n </div>\n );\n}\n\n// oxlint-disable-next-line no-empty-object-type\nexport type BarLineChartBarProps<TData extends object> = ChartChildProps<TData>;\n\nfunction Bar<TData extends object>(_: BarLineChartBarProps<TData>): React.JSX.Element | null {\n return null;\n}\n\n// oxlint-disable-next-line no-empty-object-type\nexport type BarLineChartLineProps<TData extends object> = ChartChildProps<TData>;\n\nfunction Line<TData extends object>(_: BarLineChartLineProps<TData>): React.JSX.Element | null {\n return null;\n}\n\n// Attach the marker components to BarLineChart\nBarLineChart.Bar = Bar;\nBarLineChart.Line = Line;\n"],"names":["React","props"],"mappings":";;;;;;;;;;AAiCO,SAAS,aAAmC,OAAiC;AAChF,QAAM;AAAA,IACF;AAAA,IACA,WAAW;AAAA,IACX;AAAA,IACA,aAAa;AAAA,IACb,aAAa;AAAA,IACb,UAAU;AAAA,IACV,WAAW;AAAA,IACX,WAAW;AAAA,IACX;AAAA,IACA,GAAG;AAAA,EAAA,IACH,oBAAqD,KAAK;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,IACvDA,+BAAA,cAAC,kBAAkB,OAAlB,EAAyB,GAAG,aAAa,KAAK,KAAK,GAAG;AAAA,IACtD,WAAW,WAAW,YAAY,SAAS,KAAK;AAAA,IAChD,YAAY,YAAY,UAAU,QAAQ;AAAA,EAAA,CAEnD,GACC,aACGA,+BAAA,cAAC,QAAA,EAAc,OAAc,YAAY,aAAa,SAAS,gBAAgB,UAAU,WAAA,CAAY,IACrG,IACR;AAER;AAKA,SAAS,IAA0B,GAA0D;AACzF,SAAO;AACX;AAKA,SAAS,KAA2B,GAA2D;AAC3F,SAAO;AACX;AAGA,aAAa,MAAM;AACnB,aAAa,OAAO;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DonutChart.cjs","sources":["../../../../src/charts/components/Donut/DonutChart.tsx"],"sourcesContent":["import cn from 'clsx';\nimport React from 'react';\nimport * as RechartsPrimitive from 'recharts';\n\nimport { Tooltip as TacoTooltip } from '@/components';\n\nimport { ChartWrapper } from '../ChartWrapper';\nimport { Legend } from '../Legend';\nimport type { PieChartSegmentProps } from '../Pie/PieChart';\nimport { usePieChart } from '../Pie/util';\nimport { Tooltip } from '../Tooltip';\nimport type { ChartValueFormatter, PolarChartProps } from '../types';\n\nimport './style.css';\n\nconst DONUT_WIDTH = 20;\n\nexport type DonutChartProps = {\n /** Show total value in center of Donut\n * @default false\n */\n showTotal?: boolean;\n} & PolarChartProps;\n\nexport function DonutChart<TData extends object>(props: DonutChartProps) {\n const { children, formatter, showLegend = false, showTotal = false, tooltipTitle, unit, ...attributes } = props;\n const { pieProps, radius, setRadius, items, activeIndex, setActiveIndex, globalFormatter, toggleItem } = usePieChart<TData>(\n children,\n {\n formatter,\n unit,\n }\n );\n const className = cn('aspect-square', attributes.className);\n\n return (\n <div className=\"relative\" data-taco=\"chart-wrapper\">\n <ChartWrapper {...attributes} className={className} data-taco=\"chart-donut\" onSetWidth={setRadius}>\n <RechartsPrimitive.PieChart>\n <RechartsPrimitive.Tooltip content={<Tooltip title={tooltipTitle} />} />\n <RechartsPrimitive.Pie {...pieProps} innerRadius={radius - DONUT_WIDTH} />\n </RechartsPrimitive.PieChart>\n </ChartWrapper>\n {showTotal ? (\n <Total<TData>\n formatter={globalFormatter}\n items={items as unknown[] as DonutChartSegmentProps<TData>[]}\n unit={unit}\n style={{ top: radius + DONUT_WIDTH / 2, width: radius + DONUT_WIDTH * 2 }}\n />\n ) : null}\n {showLegend ? (\n <Legend<TData> items={items} hoverIndex={activeIndex} onHover={setActiveIndex} onToggle={toggleItem} />\n ) : null}\n </div>\n );\n}\n\n// oxlint-disable-next-line no-empty-object-type\nexport type DonutChartSegmentProps<TData extends object> =
|
|
1
|
+
{"version":3,"file":"DonutChart.cjs","sources":["../../../../src/charts/components/Donut/DonutChart.tsx"],"sourcesContent":["import cn from 'clsx';\nimport React from 'react';\nimport * as RechartsPrimitive from 'recharts';\n\nimport { Tooltip as TacoTooltip } from '@/components';\n\nimport { ChartWrapper } from '../ChartWrapper';\nimport { Legend } from '../Legend';\nimport type { PieChartSegmentProps } from '../Pie/PieChart';\nimport { usePieChart } from '../Pie/util';\nimport { Tooltip } from '../Tooltip';\nimport type { ChartValueFormatter, PolarChartProps } from '../types';\n\nimport './style.css';\n\nconst DONUT_WIDTH = 20;\n\nexport type DonutChartProps = {\n /** Show total value in center of Donut\n * @default false\n */\n showTotal?: boolean;\n} & PolarChartProps;\n\nexport function DonutChart<TData extends object>(props: DonutChartProps) {\n const { children, formatter, showLegend = false, showTotal = false, tooltipTitle, unit, ...attributes } = props;\n const { pieProps, radius, setRadius, items, activeIndex, setActiveIndex, globalFormatter, toggleItem } = usePieChart<TData>(\n children,\n {\n formatter,\n unit,\n }\n );\n const className = cn('aspect-square', attributes.className);\n\n return (\n <div className=\"relative\" data-taco=\"chart-wrapper\">\n <ChartWrapper {...attributes} className={className} data-taco=\"chart-donut\" onSetWidth={setRadius}>\n <RechartsPrimitive.PieChart>\n <RechartsPrimitive.Tooltip content={<Tooltip title={tooltipTitle} />} />\n <RechartsPrimitive.Pie {...pieProps} innerRadius={radius - DONUT_WIDTH} />\n </RechartsPrimitive.PieChart>\n </ChartWrapper>\n {showTotal ? (\n <Total<TData>\n formatter={globalFormatter}\n items={items as unknown[] as DonutChartSegmentProps<TData>[]}\n unit={unit}\n style={{ top: radius + DONUT_WIDTH / 2, width: radius + DONUT_WIDTH * 2 }}\n />\n ) : null}\n {showLegend ? (\n <Legend<TData> items={items} hoverIndex={activeIndex} onHover={setActiveIndex} onToggle={toggleItem} />\n ) : null}\n </div>\n );\n}\n\n// oxlint-disable-next-line no-empty-object-type\nexport type DonutChartSegmentProps<TData extends object> = PieChartSegmentProps<TData>;\n\nfunction Segment<TData extends object>(_: DonutChartSegmentProps<TData>): React.JSX.Element | null {\n return null;\n}\nDonutChart.Segment = Segment;\n\ntype DonutTotalProps<TData extends object> = {\n formatter: ChartValueFormatter;\n items: DonutChartSegmentProps<TData>[];\n unit?: string;\n} & React.ComponentProps<'div'>;\n\nfunction Total<TData extends object>(props: DonutTotalProps<TData>) {\n const { formatter, items, unit, ...attributes } = props;\n const total = React.useMemo(() => {\n const total = items.filter(item => !item.isHidden).reduce((acc, curr) => acc + curr.value, 0);\n return formatter(total);\n }, [items]);\n\n return (\n <div\n {...attributes}\n className=\"flex aspect-video flex-col items-center justify-center overflow-hidden rounded-full absolute-center\"\n data-taco=\"chart-donut-total\">\n <TacoTooltip title={total}>\n <span className=\"w-full truncate text-center text-lg font-bold tabular-nums\">{total}</span>\n </TacoTooltip>\n {unit ? <span className=\"-mb-1 -mt-0.5 truncate text-xs text-gray-700\">{unit}</span> : null}\n </div>\n );\n}\n"],"names":["usePieChart","ChartWrapper","RechartsPrimitive","Tooltip","Legend","total","TacoTooltip"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,MAAM,cAAc;AASb,SAAS,WAAiC,OAAwB;AACrE,QAAM,EAAE,UAAU,WAAW,aAAa,OAAO,YAAY,OAAO,cAAc,MAAM,GAAG,WAAA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;AAAA,MACI,GAAG;AAAA,MACJ,WAAU;AAAA,MACV,aAAU;AAAA,IAAA;AAAA,IACV,sBAAA,cAACC,UAAAA,WAAY,OAAO,MAAA,uCACf,QAAA,EAAK,WAAU,6DAAA,GAA8D,KAAM,CACxF;AAAA,IACC,OAAO,sBAAA,cAAC,QAAA,EAAK,WAAU,+CAAA,GAAgD,IAAK,IAAU;AAAA,EAAA;AAGnG;;"}
|
|
@@ -11,4 +11,4 @@ export declare function DonutChart<TData extends object>(props: DonutChartProps)
|
|
|
11
11
|
export declare namespace DonutChart {
|
|
12
12
|
var Segment: <TData extends object>(_: DonutChartSegmentProps<TData>) => React.JSX.Element | null;
|
|
13
13
|
}
|
|
14
|
-
export type DonutChartSegmentProps<TData extends object> =
|
|
14
|
+
export type DonutChartSegmentProps<TData extends object> = PieChartSegmentProps<TData>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DonutChart.js","sources":["../../../../src/charts/components/Donut/DonutChart.tsx"],"sourcesContent":["import cn from 'clsx';\nimport React from 'react';\nimport * as RechartsPrimitive from 'recharts';\n\nimport { Tooltip as TacoTooltip } from '@/components';\n\nimport { ChartWrapper } from '../ChartWrapper';\nimport { Legend } from '../Legend';\nimport type { PieChartSegmentProps } from '../Pie/PieChart';\nimport { usePieChart } from '../Pie/util';\nimport { Tooltip } from '../Tooltip';\nimport type { ChartValueFormatter, PolarChartProps } from '../types';\n\nimport './style.css';\n\nconst DONUT_WIDTH = 20;\n\nexport type DonutChartProps = {\n /** Show total value in center of Donut\n * @default false\n */\n showTotal?: boolean;\n} & PolarChartProps;\n\nexport function DonutChart<TData extends object>(props: DonutChartProps) {\n const { children, formatter, showLegend = false, showTotal = false, tooltipTitle, unit, ...attributes } = props;\n const { pieProps, radius, setRadius, items, activeIndex, setActiveIndex, globalFormatter, toggleItem } = usePieChart<TData>(\n children,\n {\n formatter,\n unit,\n }\n );\n const className = cn('aspect-square', attributes.className);\n\n return (\n <div className=\"relative\" data-taco=\"chart-wrapper\">\n <ChartWrapper {...attributes} className={className} data-taco=\"chart-donut\" onSetWidth={setRadius}>\n <RechartsPrimitive.PieChart>\n <RechartsPrimitive.Tooltip content={<Tooltip title={tooltipTitle} />} />\n <RechartsPrimitive.Pie {...pieProps} innerRadius={radius - DONUT_WIDTH} />\n </RechartsPrimitive.PieChart>\n </ChartWrapper>\n {showTotal ? (\n <Total<TData>\n formatter={globalFormatter}\n items={items as unknown[] as DonutChartSegmentProps<TData>[]}\n unit={unit}\n style={{ top: radius + DONUT_WIDTH / 2, width: radius + DONUT_WIDTH * 2 }}\n />\n ) : null}\n {showLegend ? (\n <Legend<TData> items={items} hoverIndex={activeIndex} onHover={setActiveIndex} onToggle={toggleItem} />\n ) : null}\n </div>\n );\n}\n\n// oxlint-disable-next-line no-empty-object-type\nexport type DonutChartSegmentProps<TData extends object> =
|
|
1
|
+
{"version":3,"file":"DonutChart.js","sources":["../../../../src/charts/components/Donut/DonutChart.tsx"],"sourcesContent":["import cn from 'clsx';\nimport React from 'react';\nimport * as RechartsPrimitive from 'recharts';\n\nimport { Tooltip as TacoTooltip } from '@/components';\n\nimport { ChartWrapper } from '../ChartWrapper';\nimport { Legend } from '../Legend';\nimport type { PieChartSegmentProps } from '../Pie/PieChart';\nimport { usePieChart } from '../Pie/util';\nimport { Tooltip } from '../Tooltip';\nimport type { ChartValueFormatter, PolarChartProps } from '../types';\n\nimport './style.css';\n\nconst DONUT_WIDTH = 20;\n\nexport type DonutChartProps = {\n /** Show total value in center of Donut\n * @default false\n */\n showTotal?: boolean;\n} & PolarChartProps;\n\nexport function DonutChart<TData extends object>(props: DonutChartProps) {\n const { children, formatter, showLegend = false, showTotal = false, tooltipTitle, unit, ...attributes } = props;\n const { pieProps, radius, setRadius, items, activeIndex, setActiveIndex, globalFormatter, toggleItem } = usePieChart<TData>(\n children,\n {\n formatter,\n unit,\n }\n );\n const className = cn('aspect-square', attributes.className);\n\n return (\n <div className=\"relative\" data-taco=\"chart-wrapper\">\n <ChartWrapper {...attributes} className={className} data-taco=\"chart-donut\" onSetWidth={setRadius}>\n <RechartsPrimitive.PieChart>\n <RechartsPrimitive.Tooltip content={<Tooltip title={tooltipTitle} />} />\n <RechartsPrimitive.Pie {...pieProps} innerRadius={radius - DONUT_WIDTH} />\n </RechartsPrimitive.PieChart>\n </ChartWrapper>\n {showTotal ? (\n <Total<TData>\n formatter={globalFormatter}\n items={items as unknown[] as DonutChartSegmentProps<TData>[]}\n unit={unit}\n style={{ top: radius + DONUT_WIDTH / 2, width: radius + DONUT_WIDTH * 2 }}\n />\n ) : null}\n {showLegend ? (\n <Legend<TData> items={items} hoverIndex={activeIndex} onHover={setActiveIndex} onToggle={toggleItem} />\n ) : null}\n </div>\n );\n}\n\n// oxlint-disable-next-line no-empty-object-type\nexport type DonutChartSegmentProps<TData extends object> = PieChartSegmentProps<TData>;\n\nfunction Segment<TData extends object>(_: DonutChartSegmentProps<TData>): React.JSX.Element | null {\n return null;\n}\nDonutChart.Segment = Segment;\n\ntype DonutTotalProps<TData extends object> = {\n formatter: ChartValueFormatter;\n items: DonutChartSegmentProps<TData>[];\n unit?: string;\n} & React.ComponentProps<'div'>;\n\nfunction Total<TData extends object>(props: DonutTotalProps<TData>) {\n const { formatter, items, unit, ...attributes } = props;\n const total = React.useMemo(() => {\n const total = items.filter(item => !item.isHidden).reduce((acc, curr) => acc + curr.value, 0);\n return formatter(total);\n }, [items]);\n\n return (\n <div\n {...attributes}\n className=\"flex aspect-video flex-col items-center justify-center overflow-hidden rounded-full absolute-center\"\n data-taco=\"chart-donut-total\">\n <TacoTooltip title={total}>\n <span className=\"w-full truncate text-center text-lg font-bold tabular-nums\">{total}</span>\n </TacoTooltip>\n {unit ? <span className=\"-mb-1 -mt-0.5 truncate text-xs text-gray-700\">{unit}</span> : null}\n </div>\n );\n}\n"],"names":["React","total","TacoTooltip"],"mappings":";;;;;;;;;AAeA,MAAM,cAAc;AASb,SAAS,WAAiC,OAAwB;AACrE,QAAM,EAAE,UA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ACID,+BAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACI,GAAG;AAAA,MACJ,WAAU;AAAA,MACV,aAAU;AAAA,IAAA;AAAA,IACVA,+BAAA,cAACE,aAAY,OAAO,MAAA,gDACf,QAAA,EAAK,WAAU,6DAAA,GAA8D,KAAM,CACxF;AAAA,IACC,OAAOF,+BAAA,cAAC,QAAA,EAAK,WAAU,+CAAA,GAAgD,IAAK,IAAU;AAAA,EAAA;AAGnG;"}
|
|
@@ -23,8 +23,10 @@ function _interopNamespaceDefault(e) {
|
|
|
23
23
|
}
|
|
24
24
|
const RechartsPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(RechartsPrimitive);
|
|
25
25
|
const ActiveShape = (props) => {
|
|
26
|
-
const { cx, cy,
|
|
27
|
-
|
|
26
|
+
const { activeColorById, cx, cy, innerRadius, onClick, outerRadius = 0, payload, startAngle, endAngle, fill } = props;
|
|
27
|
+
const id = payload?.id;
|
|
28
|
+
const isActive = id !== void 0 && Object.prototype.hasOwnProperty.call(activeColorById, id);
|
|
29
|
+
return /* @__PURE__ */ React.createElement("g", { onClick: () => onClick?.(id), className: cn({ "cursor-pointer": !!onClick }) }, /* @__PURE__ */ React.createElement(
|
|
28
30
|
RechartsPrimitive__namespace.Sector,
|
|
29
31
|
{
|
|
30
32
|
cx,
|
|
@@ -35,7 +37,7 @@ const ActiveShape = (props) => {
|
|
|
35
37
|
endAngle,
|
|
36
38
|
fill
|
|
37
39
|
}
|
|
38
|
-
), /* @__PURE__ */ React.createElement(
|
|
40
|
+
), isActive ? /* @__PURE__ */ React.createElement(
|
|
39
41
|
RechartsPrimitive__namespace.Sector,
|
|
40
42
|
{
|
|
41
43
|
cx,
|
|
@@ -44,10 +46,10 @@ const ActiveShape = (props) => {
|
|
|
44
46
|
endAngle,
|
|
45
47
|
innerRadius: outerRadius + 2,
|
|
46
48
|
outerRadius: outerRadius + util.HOVER_DONUT_WIDTH,
|
|
47
|
-
fill:
|
|
49
|
+
fill: color.getThemeColor(activeColorById[id], "blue-500"),
|
|
48
50
|
opacity: 0.4
|
|
49
51
|
}
|
|
50
|
-
));
|
|
52
|
+
) : null);
|
|
51
53
|
};
|
|
52
54
|
exports.ActiveShape = ActiveShape;
|
|
53
55
|
//# sourceMappingURL=ActiveShape.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActiveShape.cjs","sources":["../../../../src/charts/components/LegacyDonut/ActiveShape.tsx"],"sourcesContent":["import cn from 'clsx';\nimport React from 'react';\nimport * as Recharts from 'recharts';\nimport type { PieSectorDataItem } from 'recharts/types/polar/Pie';\n\nimport { getThemeColor } from '@/charts/utils/color';\n\nimport { HOVER_DONUT_WIDTH } from './util';\n\ntype ActiveShapeProps = Omit<PieSectorDataItem, 'onClick'
|
|
1
|
+
{"version":3,"file":"ActiveShape.cjs","sources":["../../../../src/charts/components/LegacyDonut/ActiveShape.tsx"],"sourcesContent":["import cn from 'clsx';\nimport React from 'react';\nimport * as Recharts from 'recharts';\nimport type { PieSectorDataItem } from 'recharts/types/polar/Pie';\n\nimport { getThemeColor } from '@/charts/utils/color';\n\nimport { HOVER_DONUT_WIDTH } from './util';\n\ntype ActiveShapeProps = Partial<Omit<PieSectorDataItem, 'onClick' | 'payload'>> & {\n // v3 removed Pie's `activeIndex`, so the highlight is no longer driven by recharts. Instead this shape\n // renders every sector and draws the outer highlight ring itself when the sector's id is active.\n activeColorById: Record<string, string>;\n onClick?: (id: string | undefined) => void;\n payload?: { id?: string };\n};\n\nexport const ActiveShape = (props: ActiveShapeProps) => {\n const { activeColorById, cx, cy, innerRadius, onClick, outerRadius = 0, payload, startAngle, endAngle, fill } = props;\n const id = payload?.id;\n const isActive = id !== undefined && Object.prototype.hasOwnProperty.call(activeColorById, id);\n\n return (\n <g onClick={() => onClick?.(id)} className={cn({ 'cursor-pointer': !!onClick })}>\n <Recharts.Sector\n cx={cx}\n cy={cy}\n innerRadius={innerRadius}\n outerRadius={outerRadius}\n startAngle={startAngle}\n endAngle={endAngle}\n fill={fill}\n />\n {isActive ? (\n <Recharts.Sector\n cx={cx}\n cy={cy}\n startAngle={startAngle}\n endAngle={endAngle}\n innerRadius={outerRadius + 2}\n outerRadius={outerRadius + HOVER_DONUT_WIDTH}\n fill={getThemeColor(activeColorById[id], 'blue-500')}\n opacity={0.4}\n />\n ) : null}\n </g>\n );\n};\n"],"names":["Recharts","HOVER_DONUT_WIDTH","getThemeColor"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAiBO,MAAM,cAAc,CAAC,UAA4B;AACpD,QAAM,EAAE,iBAAiB,IAAI,IAAI,aAAa,SAAS,cAAc,GAAG,SAAS,YAAY,UAAU,KAAA,IAAS;AAChH,QAAM,KAAK,SAAS;AACpB,QAAM,WAAW,OAAO,UAAa,OAAO,UAAU,eAAe,KAAK,iBAAiB,EAAE;AAE7F,SACI,sBAAA,cAAC,KAAA,EAAE,SAAS,MAAM,UAAU,EAAE,GAAG,WAAW,GAAG,EAAE,kBAAkB,CAAC,CAAC,QAAA,CAAS,EAAA,GAC1E,sBAAA;AAAA,IAACA,6BAAS;AAAA,IAAT;AAAA,MACG;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,EAAA,GAEH,WACG,sBAAA;AAAA,IAACA,6BAAS;AAAA,IAAT;AAAA,MACG;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,aAAa,cAAc;AAAA,MAC3B,aAAa,cAAcC,KAAAA;AAAAA,MAC3B,MAAMC,MAAAA,cAAc,gBAAgB,EAAE,GAAG,UAAU;AAAA,MACnD,SAAS;AAAA,IAAA;AAAA,EAAA,IAEb,IACR;AAER;;"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { PieSectorDataItem } from 'recharts/types/polar/Pie';
|
|
3
|
-
type ActiveShapeProps = Omit<PieSectorDataItem, 'onClick'
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
type ActiveShapeProps = Partial<Omit<PieSectorDataItem, 'onClick' | 'payload'>> & {
|
|
4
|
+
activeColorById: Record<string, string>;
|
|
5
|
+
onClick?: (id: string | undefined) => void;
|
|
6
|
+
payload?: {
|
|
7
|
+
id?: string;
|
|
8
|
+
};
|
|
6
9
|
};
|
|
7
10
|
export declare const ActiveShape: (props: ActiveShapeProps) => React.JSX.Element;
|
|
8
11
|
export {};
|
|
@@ -4,8 +4,10 @@ import * as RechartsPrimitive from "recharts";
|
|
|
4
4
|
import { getThemeColor } from "../../utils/color.js";
|
|
5
5
|
import { HOVER_DONUT_WIDTH } from "./util.js";
|
|
6
6
|
const ActiveShape = (props) => {
|
|
7
|
-
const { cx, cy,
|
|
8
|
-
|
|
7
|
+
const { activeColorById, cx, cy, innerRadius, onClick, outerRadius = 0, payload, startAngle, endAngle, fill } = props;
|
|
8
|
+
const id = payload?.id;
|
|
9
|
+
const isActive = id !== void 0 && Object.prototype.hasOwnProperty.call(activeColorById, id);
|
|
10
|
+
return /* @__PURE__ */ React__default.createElement("g", { onClick: () => onClick?.(id), className: cn({ "cursor-pointer": !!onClick }) }, /* @__PURE__ */ React__default.createElement(
|
|
9
11
|
RechartsPrimitive.Sector,
|
|
10
12
|
{
|
|
11
13
|
cx,
|
|
@@ -16,7 +18,7 @@ const ActiveShape = (props) => {
|
|
|
16
18
|
endAngle,
|
|
17
19
|
fill
|
|
18
20
|
}
|
|
19
|
-
), /* @__PURE__ */ React__default.createElement(
|
|
21
|
+
), isActive ? /* @__PURE__ */ React__default.createElement(
|
|
20
22
|
RechartsPrimitive.Sector,
|
|
21
23
|
{
|
|
22
24
|
cx,
|
|
@@ -25,10 +27,10 @@ const ActiveShape = (props) => {
|
|
|
25
27
|
endAngle,
|
|
26
28
|
innerRadius: outerRadius + 2,
|
|
27
29
|
outerRadius: outerRadius + HOVER_DONUT_WIDTH,
|
|
28
|
-
fill:
|
|
30
|
+
fill: getThemeColor(activeColorById[id], "blue-500"),
|
|
29
31
|
opacity: 0.4
|
|
30
32
|
}
|
|
31
|
-
));
|
|
33
|
+
) : null);
|
|
32
34
|
};
|
|
33
35
|
export {
|
|
34
36
|
ActiveShape
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActiveShape.js","sources":["../../../../src/charts/components/LegacyDonut/ActiveShape.tsx"],"sourcesContent":["import cn from 'clsx';\nimport React from 'react';\nimport * as Recharts from 'recharts';\nimport type { PieSectorDataItem } from 'recharts/types/polar/Pie';\n\nimport { getThemeColor } from '@/charts/utils/color';\n\nimport { HOVER_DONUT_WIDTH } from './util';\n\ntype ActiveShapeProps = Omit<PieSectorDataItem, 'onClick'
|
|
1
|
+
{"version":3,"file":"ActiveShape.js","sources":["../../../../src/charts/components/LegacyDonut/ActiveShape.tsx"],"sourcesContent":["import cn from 'clsx';\nimport React from 'react';\nimport * as Recharts from 'recharts';\nimport type { PieSectorDataItem } from 'recharts/types/polar/Pie';\n\nimport { getThemeColor } from '@/charts/utils/color';\n\nimport { HOVER_DONUT_WIDTH } from './util';\n\ntype ActiveShapeProps = Partial<Omit<PieSectorDataItem, 'onClick' | 'payload'>> & {\n // v3 removed Pie's `activeIndex`, so the highlight is no longer driven by recharts. Instead this shape\n // renders every sector and draws the outer highlight ring itself when the sector's id is active.\n activeColorById: Record<string, string>;\n onClick?: (id: string | undefined) => void;\n payload?: { id?: string };\n};\n\nexport const ActiveShape = (props: ActiveShapeProps) => {\n const { activeColorById, cx, cy, innerRadius, onClick, outerRadius = 0, payload, startAngle, endAngle, fill } = props;\n const id = payload?.id;\n const isActive = id !== undefined && Object.prototype.hasOwnProperty.call(activeColorById, id);\n\n return (\n <g onClick={() => onClick?.(id)} className={cn({ 'cursor-pointer': !!onClick })}>\n <Recharts.Sector\n cx={cx}\n cy={cy}\n innerRadius={innerRadius}\n outerRadius={outerRadius}\n startAngle={startAngle}\n endAngle={endAngle}\n fill={fill}\n />\n {isActive ? (\n <Recharts.Sector\n cx={cx}\n cy={cy}\n startAngle={startAngle}\n endAngle={endAngle}\n innerRadius={outerRadius + 2}\n outerRadius={outerRadius + HOVER_DONUT_WIDTH}\n fill={getThemeColor(activeColorById[id], 'blue-500')}\n opacity={0.4}\n />\n ) : null}\n </g>\n );\n};\n"],"names":["React","Recharts"],"mappings":";;;;;AAiBO,MAAM,cAAc,CAAC,UAA4B;AACpD,QAAM,EAAE,iBAAiB,IAAI,IAAI,aAAa,SAAS,cAAc,GAAG,SAAS,YAAY,UAAU,KAAA,IAAS;AAChH,QAAM,KAAK,SAAS;AACpB,QAAM,WAAW,OAAO,UAAa,OAAO,UAAU,eAAe,KAAK,iBAAiB,EAAE;AAE7F,SACIA,+BAAA,cAAC,KAAA,EAAE,SAAS,MAAM,UAAU,EAAE,GAAG,WAAW,GAAG,EAAE,kBAAkB,CAAC,CAAC,QAAA,CAAS,EAAA,GAC1EA,+BAAA;AAAA,IAACC,kBAAS;AAAA,IAAT;AAAA,MACG;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,EAAA,GAEH,WACGD,+BAAA;AAAA,IAACC,kBAAS;AAAA,IAAT;AAAA,MACG;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,aAAa,cAAc;AAAA,MAC3B,aAAa,cAAc;AAAA,MAC3B,MAAM,cAAc,gBAAgB,EAAE,GAAG,UAAU;AAAA,MACnD,SAAS;AAAA,IAAA;AAAA,EAAA,IAEb,IACR;AAER;"}
|
|
@@ -10,8 +10,8 @@ const CenteredLabel = ({ radius, label, total, formatter }) => {
|
|
|
10
10
|
{
|
|
11
11
|
className: "absolute mt-1 flex h-12 flex-col text-center",
|
|
12
12
|
style: {
|
|
13
|
-
top: `calc(${radius}px - (3rem / 2))`,
|
|
14
13
|
// h-12 is 3rem
|
|
14
|
+
top: `calc(${radius}px - (3rem / 2))`,
|
|
15
15
|
left: `${totalInset}px`,
|
|
16
16
|
width: `${diameter - 2 * totalInset}px`
|
|
17
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CenteredLabel.cjs","sources":["../../../../src/charts/components/LegacyDonut/CenteredLabel.tsx"],"sourcesContent":["import React from 'react';\n\nimport { HOVER_DONUT_WIDTH, DONUT_WIDTH } from './util';\n\ntype CenteredLabelProps = {\n radius: number;\n label: string;\n total: number;\n formatter: ((value: number) => string) | undefined;\n};\n\nexport const CenteredLabel = ({ radius, label, total, formatter }: CenteredLabelProps) => {\n const totalInset = HOVER_DONUT_WIDTH + DONUT_WIDTH + DONUT_WIDTH;\n const diameter = radius * 2;\n\n return (\n <div\n // oxlint-disable-next-line taco/no-component-margin -- grandfathered; removing this margin is a visual breaking change\n className=\"absolute mt-1 flex h-12 flex-col text-center\"\n style={{\n top: `calc(${radius}px - (3rem / 2))
|
|
1
|
+
{"version":3,"file":"CenteredLabel.cjs","sources":["../../../../src/charts/components/LegacyDonut/CenteredLabel.tsx"],"sourcesContent":["import React from 'react';\n\nimport { HOVER_DONUT_WIDTH, DONUT_WIDTH } from './util';\n\ntype CenteredLabelProps = {\n radius: number;\n label: string;\n total: number;\n formatter: ((value: number) => string) | undefined;\n};\n\nexport const CenteredLabel = ({ radius, label, total, formatter }: CenteredLabelProps) => {\n const totalInset = HOVER_DONUT_WIDTH + DONUT_WIDTH + DONUT_WIDTH;\n const diameter = radius * 2;\n\n return (\n <div\n // oxlint-disable-next-line taco/no-component-margin -- grandfathered; removing this margin is a visual breaking change\n className=\"absolute mt-1 flex h-12 flex-col text-center\"\n style={{\n // h-12 is 3rem\n top: `calc(${radius}px - (3rem / 2))`,\n left: `${totalInset}px`,\n width: `${diameter - 2 * totalInset}px`,\n }}>\n <span className=\"w-full truncate text-lg font-bold\">{formatter ? formatter(total) : total}</span>\n {label}\n </div>\n );\n};\n"],"names":["HOVER_DONUT_WIDTH","DONUT_WIDTH"],"mappings":";;;;AAWO,MAAM,gBAAgB,CAAC,EAAE,QAAQ,OAAO,OAAO,gBAAoC;AACtF,QAAM,aAAaA,yBAAoBC,KAAAA,cAAcA,KAAAA;AACrD,QAAM,WAAW,SAAS;AAE1B,SACI,sBAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MAEG,WAAU;AAAA,MACV,OAAO;AAAA;AAAA,QAEH,KAAK,QAAQ,MAAM;AAAA,QACnB,MAAM,GAAG,UAAU;AAAA,QACnB,OAAO,GAAG,WAAW,IAAI,UAAU;AAAA,MAAA;AAAA,IACvC;AAAA,IACA,sBAAA,cAAC,UAAK,WAAU,uCAAqC,YAAY,UAAU,KAAK,IAAI,KAAM;AAAA,IACzF;AAAA,EAAA;AAGb;;"}
|
|
@@ -8,8 +8,8 @@ const CenteredLabel = ({ radius, label, total, formatter }) => {
|
|
|
8
8
|
{
|
|
9
9
|
className: "absolute mt-1 flex h-12 flex-col text-center",
|
|
10
10
|
style: {
|
|
11
|
-
top: `calc(${radius}px - (3rem / 2))`,
|
|
12
11
|
// h-12 is 3rem
|
|
12
|
+
top: `calc(${radius}px - (3rem / 2))`,
|
|
13
13
|
left: `${totalInset}px`,
|
|
14
14
|
width: `${diameter - 2 * totalInset}px`
|
|
15
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CenteredLabel.js","sources":["../../../../src/charts/components/LegacyDonut/CenteredLabel.tsx"],"sourcesContent":["import React from 'react';\n\nimport { HOVER_DONUT_WIDTH, DONUT_WIDTH } from './util';\n\ntype CenteredLabelProps = {\n radius: number;\n label: string;\n total: number;\n formatter: ((value: number) => string) | undefined;\n};\n\nexport const CenteredLabel = ({ radius, label, total, formatter }: CenteredLabelProps) => {\n const totalInset = HOVER_DONUT_WIDTH + DONUT_WIDTH + DONUT_WIDTH;\n const diameter = radius * 2;\n\n return (\n <div\n // oxlint-disable-next-line taco/no-component-margin -- grandfathered; removing this margin is a visual breaking change\n className=\"absolute mt-1 flex h-12 flex-col text-center\"\n style={{\n top: `calc(${radius}px - (3rem / 2))
|
|
1
|
+
{"version":3,"file":"CenteredLabel.js","sources":["../../../../src/charts/components/LegacyDonut/CenteredLabel.tsx"],"sourcesContent":["import React from 'react';\n\nimport { HOVER_DONUT_WIDTH, DONUT_WIDTH } from './util';\n\ntype CenteredLabelProps = {\n radius: number;\n label: string;\n total: number;\n formatter: ((value: number) => string) | undefined;\n};\n\nexport const CenteredLabel = ({ radius, label, total, formatter }: CenteredLabelProps) => {\n const totalInset = HOVER_DONUT_WIDTH + DONUT_WIDTH + DONUT_WIDTH;\n const diameter = radius * 2;\n\n return (\n <div\n // oxlint-disable-next-line taco/no-component-margin -- grandfathered; removing this margin is a visual breaking change\n className=\"absolute mt-1 flex h-12 flex-col text-center\"\n style={{\n // h-12 is 3rem\n top: `calc(${radius}px - (3rem / 2))`,\n left: `${totalInset}px`,\n width: `${diameter - 2 * totalInset}px`,\n }}>\n <span className=\"w-full truncate text-lg font-bold\">{formatter ? formatter(total) : total}</span>\n {label}\n </div>\n );\n};\n"],"names":["React"],"mappings":";;AAWO,MAAM,gBAAgB,CAAC,EAAE,QAAQ,OAAO,OAAO,gBAAoC;AACtF,QAAM,aAAa,oBAAoB,cAAc;AACrD,QAAM,WAAW,SAAS;AAE1B,SACIA,+BAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MAEG,WAAU;AAAA,MACV,OAAO;AAAA;AAAA,QAEH,KAAK,QAAQ,MAAM;AAAA,QACnB,MAAM,GAAG,UAAU;AAAA,QACnB,OAAO,GAAG,WAAW,IAAI,UAAU;AAAA,MAAA;AAAA,IACvC;AAAA,IACAA,+BAAA,cAAC,UAAK,WAAU,uCAAqC,YAAY,UAAU,KAAK,IAAI,KAAM;AAAA,IACzF;AAAA,EAAA;AAGb;"}
|