@economic/taco 2.57.0-charts.5 → 2.57.0-charts.6
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/taco.cjs +58 -41
- package/dist/taco.cjs.map +1 -1
- package/dist/taco.css +1 -1
- package/dist/taco.js +58 -41
- package/dist/taco.js.map +1 -1
- package/package.json +2 -2
package/dist/taco.css
CHANGED
@@ -1569,7 +1569,7 @@ table[data-taco^='table'] tr[data-row-create] {
|
|
1569
1569
|
|
1570
1570
|
[data-taco='card-content'] > [data-taco='chart-wrapper'] [data-taco='chart-donut']:not([class*='w-']),
|
1571
1571
|
[data-taco='card-content'] > [data-taco='chart-wrapper'] [data-taco='chart-pie']:not([class*='w-']) {
|
1572
|
-
@apply aspect-square w-
|
1572
|
+
@apply aspect-square w-2/3;
|
1573
1573
|
}
|
1574
1574
|
|
1575
1575
|
.recharts-cartesian-axis line,
|
package/dist/taco.js
CHANGED
@@ -82781,44 +82781,6 @@ function Tooltip(props) {
|
|
82781
82781
|
}
|
82782
82782
|
return null;
|
82783
82783
|
}
|
82784
|
-
function Legend$1(props) {
|
82785
|
-
const { hoverIndex, items, onHover: handleHover, onToggle: handleToggle } = props;
|
82786
|
-
const handleMouseEnter = (item, index2) => {
|
82787
|
-
if (item.isHidden) {
|
82788
|
-
return;
|
82789
|
-
}
|
82790
|
-
handleHover(index2);
|
82791
|
-
};
|
82792
|
-
const handleMouseLeave = () => handleHover(void 0);
|
82793
|
-
const handleClick = (item) => {
|
82794
|
-
if (!item.isHidden) {
|
82795
|
-
handleHover(void 0);
|
82796
|
-
}
|
82797
|
-
handleToggle(item.dataKey);
|
82798
|
-
};
|
82799
|
-
const moreButton = (moreButtonText) => /* @__PURE__ */ React__default.createElement(Button$4, { appearance: "transparent", className: "text-grey-700 !h-5 !min-h-[1.25rem] !px-1.5 text-xs" }, moreButtonText);
|
82800
|
-
return /* @__PURE__ */ React__default.createElement(OverflowGroup, { className: "mt-2.5 w-full gap-x-1", moreButton }, items.map((item, index2) => {
|
82801
|
-
const className = clsx("mr-1 flex h-3 w-3 rounded-sm", {
|
82802
|
-
[`bg-${item.color}`]: !item.isHidden,
|
82803
|
-
border: item.isHidden
|
82804
|
-
});
|
82805
|
-
return /* @__PURE__ */ React__default.createElement(
|
82806
|
-
"button",
|
82807
|
-
{
|
82808
|
-
key: item.label,
|
82809
|
-
className: "hover:bg-grey-200 focus-visible:yt-focus flex items-center rounded px-1 !text-xs",
|
82810
|
-
onClick: (event) => {
|
82811
|
-
event == null ? void 0 : event.preventDefault();
|
82812
|
-
handleClick(item);
|
82813
|
-
},
|
82814
|
-
onMouseEnter: () => handleMouseEnter(item, index2),
|
82815
|
-
onMouseLeave: () => handleMouseLeave()
|
82816
|
-
},
|
82817
|
-
/* @__PURE__ */ React__default.createElement("span", { className }, hoverIndex === index2 ? /* @__PURE__ */ React__default.createElement(Icon$1, { name: "tick-bold", className: clsx("!h-full !w-full", { "text-white": !item.isHidden }) }) : null),
|
82818
|
-
item.label
|
82819
|
-
);
|
82820
|
-
}));
|
82821
|
-
}
|
82822
82784
|
const THEME_COLORS = {
|
82823
82785
|
transparent: "transparent",
|
82824
82786
|
current: "currentColor",
|
@@ -82970,6 +82932,47 @@ const getInverseThemeColor = (themeColor) => {
|
|
82970
82932
|
}
|
82971
82933
|
return color2 === "black" ? "white" : "black";
|
82972
82934
|
};
|
82935
|
+
function Legend$1(props) {
|
82936
|
+
const { hoverIndex, items, onHover: handleHover, onToggle: handleToggle } = props;
|
82937
|
+
const handleMouseEnter = (item, index2) => {
|
82938
|
+
if (item.isHidden) {
|
82939
|
+
return;
|
82940
|
+
}
|
82941
|
+
handleHover(index2);
|
82942
|
+
};
|
82943
|
+
const handleMouseLeave = () => handleHover(void 0);
|
82944
|
+
const handleClick = (item) => {
|
82945
|
+
if (!item.isHidden) {
|
82946
|
+
handleHover(void 0);
|
82947
|
+
}
|
82948
|
+
handleToggle(item.dataKey);
|
82949
|
+
};
|
82950
|
+
const moreButton = (moreButtonText) => /* @__PURE__ */ React__default.createElement(Button$4, { appearance: "transparent", className: "text-grey-700 !h-5 !min-h-[1.25rem] !px-1.5 text-xs" }, moreButtonText);
|
82951
|
+
return /* @__PURE__ */ React__default.createElement(OverflowGroup, { className: "mt-2.5 w-full gap-x-1", moreButton }, items.map((item, index2) => {
|
82952
|
+
const className = clsx("mr-1 flex h-3 w-3 rounded-sm", {
|
82953
|
+
border: item.isHidden
|
82954
|
+
});
|
82955
|
+
let style;
|
82956
|
+
if (!item.isHidden) {
|
82957
|
+
style = { backgroundColor: getThemeColor(item.color) };
|
82958
|
+
}
|
82959
|
+
return /* @__PURE__ */ React__default.createElement(
|
82960
|
+
"button",
|
82961
|
+
{
|
82962
|
+
key: item.label,
|
82963
|
+
className: "hover:bg-grey-200 focus-visible:yt-focus flex items-center rounded px-1 !text-xs",
|
82964
|
+
onClick: (event) => {
|
82965
|
+
event == null ? void 0 : event.preventDefault();
|
82966
|
+
handleClick(item);
|
82967
|
+
},
|
82968
|
+
onMouseEnter: () => handleMouseEnter(item, index2),
|
82969
|
+
onMouseLeave: () => handleMouseLeave()
|
82970
|
+
},
|
82971
|
+
/* @__PURE__ */ React__default.createElement("span", { className, style }, hoverIndex === index2 ? /* @__PURE__ */ React__default.createElement(Icon$1, { name: "tick-bold", className: clsx("!h-full !w-full", { "text-white": !item.isHidden }) }) : null),
|
82972
|
+
item.label
|
82973
|
+
);
|
82974
|
+
}));
|
82975
|
+
}
|
82973
82976
|
function useChart(children, options) {
|
82974
82977
|
const [activeIndex, setActiveIndex] = React__default.useState();
|
82975
82978
|
const [hiddenItems, toggleItem] = useChartDataHiddenState();
|
@@ -82999,7 +83002,7 @@ function useChart(children, options) {
|
|
82999
83002
|
},
|
83000
83003
|
isAnimationActive: false,
|
83001
83004
|
fill: color2,
|
83002
|
-
fillOpacity: 0.
|
83005
|
+
fillOpacity: 0.75,
|
83003
83006
|
formatter: item.formatter,
|
83004
83007
|
name: item.label,
|
83005
83008
|
stroke: color2,
|
@@ -83043,6 +83046,7 @@ function AreaChart(props) {
|
|
83043
83046
|
xAxisTickFormatter,
|
83044
83047
|
yAxisScale,
|
83045
83048
|
yAxisTickFormatter,
|
83049
|
+
yAxisWidth,
|
83046
83050
|
...attributes
|
83047
83051
|
} = props;
|
83048
83052
|
const className = clsx("relative aspect-video", { "pb-6": showLegend }, customClassName);
|
@@ -83069,7 +83073,13 @@ function AreaChart(props) {
|
|
83069
83073
|
hide: !showXAxis
|
83070
83074
|
}
|
83071
83075
|
),
|
83072
|
-
/* @__PURE__ */ React__default.createElement(
|
83076
|
+
/* @__PURE__ */ React__default.createElement(
|
83077
|
+
YAxis,
|
83078
|
+
{
|
83079
|
+
...getAxisProps(yAxisScale, yAxisTickFormatter, void 0, yAxisWidth),
|
83080
|
+
hide: !showYAxis
|
83081
|
+
}
|
83082
|
+
),
|
83073
83083
|
shapes.map((shape) => /* @__PURE__ */ React__default.createElement(
|
83074
83084
|
Area$1,
|
83075
83085
|
{
|
@@ -83468,6 +83478,7 @@ function LineChart(props) {
|
|
83468
83478
|
xAxisTickFormatter,
|
83469
83479
|
yAxisScale,
|
83470
83480
|
yAxisTickFormatter,
|
83481
|
+
yAxisWidth,
|
83471
83482
|
...attributes
|
83472
83483
|
} = props;
|
83473
83484
|
const className = clsx("relative aspect-video", { "pb-6": showLegend }, customClassName);
|
@@ -83493,7 +83504,13 @@ function LineChart(props) {
|
|
83493
83504
|
hide: !showXAxis
|
83494
83505
|
}
|
83495
83506
|
),
|
83496
|
-
/* @__PURE__ */ React__default.createElement(
|
83507
|
+
/* @__PURE__ */ React__default.createElement(
|
83508
|
+
YAxis,
|
83509
|
+
{
|
83510
|
+
...getAxisProps(yAxisScale, yAxisTickFormatter, void 0, yAxisWidth),
|
83511
|
+
hide: !showYAxis
|
83512
|
+
}
|
83513
|
+
),
|
83497
83514
|
shapes.map((shape) => /* @__PURE__ */ React__default.createElement(Line$1, { key: shape.dataKey, ...shape, dot: showDots ? shape.dot : false, type }))
|
83498
83515
|
)), showLegend ? /* @__PURE__ */ React__default.createElement(Legend$1, { items, hoverIndex: activeIndex, onHover: setActiveIndex, onToggle: toggleItem }) : null);
|
83499
83516
|
}
|