@economic/taco 2.57.0-charts.4 → 2.57.0-charts.5

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.css CHANGED
@@ -181,29 +181,6 @@ table.yt-table tbody.yt-table__body tr.yt-table__row td.yt-table__cell {
181
181
  @apply opacity-100;
182
182
  }
183
183
  }
184
-
185
- .recharts-cartesian-axis line,
186
- .recharts-cartesian-grid-horizontal line,
187
- .recharts-cartesian-grid-vertical line {
188
- @apply !stroke-grey-100;
189
- }
190
-
191
- .recharts-cartesian-axis-tick-value {
192
- @apply !fill-grey-700;
193
- }
194
-
195
- .recharts-tooltip-cursor {
196
- @apply !fill-transparent;
197
- }
198
-
199
- .recharts-legend-wrapper {
200
- @apply !left-0 !w-full;
201
- }
202
-
203
- .recharts-sector,
204
- .recharts-wrapper > svg g {
205
- @apply !outline-none;
206
- }
207
184
  [data-taco='badge'] > [data-taco='spinner'] {
208
185
  @apply ml-2 h-3 w-3;
209
186
  }
@@ -1581,3 +1558,39 @@ table[data-taco^='table'][data-table-row-height='extra-tall'] tr[data-row-create
1581
1558
  table[data-taco^='table'] tr[data-row-create] {
1582
1559
  @apply print:hidden;
1583
1560
  }
1561
+ [data-taco='card-content'] > [data-taco='chart-wrapper']:not(:has([data-taco='chart-donut'], [data-taco='chart-pie'])) {
1562
+ @apply w-full;
1563
+ }
1564
+
1565
+ [data-taco='card-content']
1566
+ > [data-taco='chart-wrapper']:not([class*='h-']):not(:has([data-taco='chart-donut'], [data-taco='chart-pie'])) {
1567
+ @apply h-full;
1568
+ }
1569
+
1570
+ [data-taco='card-content'] > [data-taco='chart-wrapper'] [data-taco='chart-donut']:not([class*='w-']),
1571
+ [data-taco='card-content'] > [data-taco='chart-wrapper'] [data-taco='chart-pie']:not([class*='w-']) {
1572
+ @apply aspect-square w-[70%];
1573
+ }
1574
+
1575
+ .recharts-cartesian-axis line,
1576
+ .recharts-cartesian-grid-horizontal line,
1577
+ .recharts-cartesian-grid-vertical line {
1578
+ @apply !stroke-grey-100;
1579
+ }
1580
+
1581
+ .recharts-cartesian-axis-tick-value {
1582
+ @apply !fill-grey-700;
1583
+ }
1584
+
1585
+ .recharts-tooltip-cursor {
1586
+ @apply !fill-transparent;
1587
+ }
1588
+
1589
+ .recharts-legend-wrapper {
1590
+ @apply !left-0 !w-full;
1591
+ }
1592
+
1593
+ .recharts-sector,
1594
+ .recharts-wrapper > svg g {
1595
+ @apply !outline-none;
1596
+ }
package/dist/taco.js CHANGED
@@ -82757,7 +82757,7 @@ function getAxisProps(scale2, tickFormatter, dataKey, width) {
82757
82757
  width: width ?? 55
82758
82758
  };
82759
82759
  }
82760
- function ChartContainer(props) {
82760
+ function ChartWrapper(props) {
82761
82761
  const { onSetWidth: handleSetWidth, ...attributes } = props;
82762
82762
  const ref = React__default.useRef(null);
82763
82763
  React__default.useLayoutEffect(() => {
@@ -82766,7 +82766,7 @@ function ChartContainer(props) {
82766
82766
  handleSetWidth(rect.width);
82767
82767
  }
82768
82768
  }, [ref]);
82769
- const className = clsx("flex justify-center mx-auto", attributes.className);
82769
+ const className = clsx("flex justify-center m-auto", attributes.className);
82770
82770
  return /* @__PURE__ */ React__default.createElement("div", { ...attributes, className, ref }, /* @__PURE__ */ React__default.createElement(ResponsiveContainer, null, props.children));
82771
82771
  }
82772
82772
  function Tooltip(props) {
@@ -83045,9 +83045,9 @@ function AreaChart(props) {
83045
83045
  yAxisTickFormatter,
83046
83046
  ...attributes
83047
83047
  } = props;
83048
- const className = clsx("relative aspect-video", { "mb-6": showLegend }, customClassName);
83048
+ const className = clsx("relative aspect-video", { "pb-6": showLegend }, customClassName);
83049
83049
  const { items, shapes, activeIndex, setActiveIndex, toggleItem } = useChart(children);
83050
- return /* @__PURE__ */ React__default.createElement("div", { className, "data-taco": "chart-wrapper" }, /* @__PURE__ */ React__default.createElement(ChartContainer, { ...attributes, className: "h-full w-full", "data-taco": "chart-area" }, /* @__PURE__ */ React__default.createElement(
83050
+ 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-area" }, /* @__PURE__ */ React__default.createElement(
83051
83051
  AreaChart$1,
83052
83052
  {
83053
83053
  data,
@@ -83107,9 +83107,9 @@ function BarChart(props) {
83107
83107
  yAxisWidth,
83108
83108
  ...attributes
83109
83109
  } = props;
83110
- const className = clsx("relative aspect-video", { "mb-6": showLegend }, customClassName);
83110
+ const className = clsx("relative aspect-video", { "pb-6": showLegend }, customClassName);
83111
83111
  const { items, shapes, activeIndex, setActiveIndex, toggleItem } = useChart(children);
83112
- return /* @__PURE__ */ React__default.createElement("div", { className, "data-taco": "chart-wrapper" }, /* @__PURE__ */ React__default.createElement(ChartContainer, { ...attributes, className: "h-full w-full", "data-taco": "chart-bar" }, /* @__PURE__ */ React__default.createElement(
83112
+ 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(
83113
83113
  BarChart$1,
83114
83114
  {
83115
83115
  data,
@@ -83145,6 +83145,7 @@ function BarChart(props) {
83145
83145
  yAxisWidth
83146
83146
  ),
83147
83147
  hide: !showYAxis,
83148
+ minTickGap: isHorizontal ? 1 : 5,
83148
83149
  type: isHorizontal ? "category" : void 0
83149
83150
  }
83150
83151
  ),
@@ -83244,7 +83245,7 @@ function DonutChart(props) {
83244
83245
  unit: unit2,
83245
83246
  style: { top: radius / 2 - 2, width: radius + DONUT_WIDTH$1 }
83246
83247
  }
83247
- ) : null, /* @__PURE__ */ React__default.createElement(ChartContainer, { ...attributes, className, "data-taco": "chart-donut", onSetWidth: setRadius }, /* @__PURE__ */ React__default.createElement(PieChart$1, null, /* @__PURE__ */ React__default.createElement(Tooltip$1, { content: /* @__PURE__ */ React__default.createElement(Tooltip, { title: tooltipTitle }) }), /* @__PURE__ */ React__default.createElement(Pie, { ...pieProps, innerRadius: radius - DONUT_WIDTH$1 }))), showLegend ? /* @__PURE__ */ React__default.createElement(Legend$1, { items, hoverIndex: activeIndex, onHover: setActiveIndex, onToggle: toggleItem }) : null);
83248
+ ) : null, /* @__PURE__ */ React__default.createElement(ChartWrapper, { ...attributes, className, "data-taco": "chart-donut", onSetWidth: setRadius }, /* @__PURE__ */ React__default.createElement(PieChart$1, null, /* @__PURE__ */ React__default.createElement(Tooltip$1, { content: /* @__PURE__ */ React__default.createElement(Tooltip, { title: tooltipTitle }) }), /* @__PURE__ */ React__default.createElement(Pie, { ...pieProps, innerRadius: radius - DONUT_WIDTH$1 }))), showLegend ? /* @__PURE__ */ React__default.createElement(Legend$1, { items, hoverIndex: activeIndex, onHover: setActiveIndex, onToggle: toggleItem }) : null);
83248
83249
  }
83249
83250
  function Segment$2(_) {
83250
83251
  return null;
@@ -83469,9 +83470,9 @@ function LineChart(props) {
83469
83470
  yAxisTickFormatter,
83470
83471
  ...attributes
83471
83472
  } = props;
83472
- const className = clsx("relative aspect-video", { "mb-6": showLegend }, customClassName);
83473
+ const className = clsx("relative aspect-video", { "pb-6": showLegend }, customClassName);
83473
83474
  const { items, shapes, activeIndex, setActiveIndex, toggleItem } = useChart(children);
83474
- return /* @__PURE__ */ React__default.createElement("div", { className, "data-taco": "chart-wrapper" }, /* @__PURE__ */ React__default.createElement(ChartContainer, { ...attributes, className: "h-full w-full", "data-taco": "chart-line" }, /* @__PURE__ */ React__default.createElement(
83475
+ 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-line" }, /* @__PURE__ */ React__default.createElement(
83475
83476
  LineChart$1,
83476
83477
  {
83477
83478
  data,
@@ -83507,7 +83508,7 @@ function PieChart(props) {
83507
83508
  unit: unit2
83508
83509
  });
83509
83510
  const className = clsx("aspect-square", attributes.className);
83510
- return /* @__PURE__ */ React__default.createElement("div", { className: "relative", "data-taco": "chart-wrapper" }, /* @__PURE__ */ React__default.createElement(ChartContainer, { ...attributes, className, "data-taco": "chart-pie", onSetWidth: setRadius }, /* @__PURE__ */ React__default.createElement(PieChart$1, null, /* @__PURE__ */ React__default.createElement(Tooltip$1, { content: /* @__PURE__ */ React__default.createElement(Tooltip, { title: tooltipTitle }) }), /* @__PURE__ */ React__default.createElement(Pie, { ...pieProps, label: showLabels ? /* @__PURE__ */ React__default.createElement(Label, null) : void 0 }))), showLegend ? /* @__PURE__ */ React__default.createElement(Legend$1, { items, hoverIndex: activeIndex, onHover: setActiveIndex, onToggle: toggleItem }) : null);
83511
+ return /* @__PURE__ */ React__default.createElement("div", { className: "relative", "data-taco": "chart-wrapper" }, /* @__PURE__ */ React__default.createElement(ChartWrapper, { ...attributes, className, "data-taco": "chart-pie", onSetWidth: setRadius }, /* @__PURE__ */ React__default.createElement(PieChart$1, null, /* @__PURE__ */ React__default.createElement(Tooltip$1, { content: /* @__PURE__ */ React__default.createElement(Tooltip, { title: tooltipTitle }) }), /* @__PURE__ */ React__default.createElement(Pie, { ...pieProps, label: showLabels ? /* @__PURE__ */ React__default.createElement(Label, null) : void 0 }))), showLegend ? /* @__PURE__ */ React__default.createElement(Legend$1, { items, hoverIndex: activeIndex, onHover: setActiveIndex, onToggle: toggleItem }) : null);
83511
83512
  }
83512
83513
  function Segment(_) {
83513
83514
  return null;