@economic/taco 17.1.0-EC-91962-test-release.0 → 17.1.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/Bar/BarChart.cjs +39 -21
- package/dist/charts/components/Bar/BarChart.d.ts +8 -0
- package/dist/charts/components/Bar/BarChart.js +40 -22
- package/dist/charts/components/Pie/PaddedSector.cjs +80 -0
- package/dist/charts/components/Pie/PaddedSector.d.ts +7 -0
- package/dist/charts/components/Pie/PaddedSector.js +63 -0
- package/dist/charts/components/Pie/util.cjs +5 -3
- package/dist/charts/components/Pie/util.d.ts +1 -0
- package/dist/charts/components/Pie/util.js +5 -3
- package/dist/components/AlertDialog/AlertDialog.d.ts +30 -0
- package/dist/components/AlertDialog/Context.d.ts +9 -0
- package/dist/components/AlertDialog/components/Content.d.ts +18 -0
- package/dist/components/AlertDialog/components/Footer.d.ts +18 -0
- package/dist/components/AlertDialog/components/Trigger.d.ts +6 -0
- package/dist/index.cjs +1 -0
- package/dist/index.js +2 -1
- package/package.json +2 -2
|
@@ -66,29 +66,46 @@ function BarChart(props) {
|
|
|
66
66
|
)), showLegend ? /* @__PURE__ */ React.createElement(Legend.Legend, { items, hoverIndex: activeIndex, onHover: setActiveIndex, onToggle: toggleItem }) : null);
|
|
67
67
|
}
|
|
68
68
|
const renderBars = (shapes, showLabels = false, stacked = false, isHorizontal = false) => {
|
|
69
|
-
return shapes.map((shape, index) =>
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
...shape,
|
|
74
|
-
activeBar: { fillOpacity: 1, strokeWidth: 0 },
|
|
75
|
-
maxBarSize: BAR_WIDTH,
|
|
76
|
-
radius: getRadius(index, shapes.length, !!stacked, isHorizontal),
|
|
77
|
-
stackId: stacked ? "stack" : void 0,
|
|
78
|
-
strokeWidth: 0
|
|
79
|
-
},
|
|
80
|
-
showLabels ? /* @__PURE__ */ React.createElement(
|
|
81
|
-
RechartsPrimitive__namespace.LabelList,
|
|
69
|
+
return shapes.map((shape, index) => {
|
|
70
|
+
const hasSeparator = stacked && index > 0;
|
|
71
|
+
return /* @__PURE__ */ React.createElement(
|
|
72
|
+
RechartsPrimitive__namespace.Bar,
|
|
82
73
|
{
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
74
|
+
key: `${index}-${shape.dataKey}`,
|
|
75
|
+
...shape,
|
|
76
|
+
activeBar: hasSeparator ? (shapeProps) => renderStackedSegment({ ...shapeProps, fillOpacity: 1, strokeWidth: 0 }, isHorizontal) : { fillOpacity: 1, strokeWidth: 0 },
|
|
77
|
+
maxBarSize: BAR_WIDTH,
|
|
78
|
+
radius: getRadius(index, shapes.length, !!stacked, isHorizontal),
|
|
79
|
+
shape: hasSeparator ? (shapeProps) => renderStackedSegment(shapeProps, isHorizontal) : void 0,
|
|
80
|
+
stackId: stacked ? "stack" : void 0,
|
|
81
|
+
strokeWidth: 0
|
|
82
|
+
},
|
|
83
|
+
showLabels ? /* @__PURE__ */ React.createElement(
|
|
84
|
+
RechartsPrimitive__namespace.LabelList,
|
|
85
|
+
{
|
|
86
|
+
position: isHorizontal ? "insideRight" : "top",
|
|
87
|
+
formatter: shape.formatter,
|
|
88
|
+
offset: 6,
|
|
89
|
+
fill: isHorizontal ? color.getInverseThemeColor(shape.color ?? "") : "black",
|
|
90
|
+
fontSize: 11
|
|
91
|
+
}
|
|
92
|
+
) : null
|
|
93
|
+
);
|
|
94
|
+
});
|
|
91
95
|
};
|
|
96
|
+
const STACK_SEPARATOR_WIDTH = 2;
|
|
97
|
+
function renderStackedSegment(props, isHorizontal) {
|
|
98
|
+
const { x = 0, width = 0, height = 0 } = props;
|
|
99
|
+
const size = isHorizontal ? width : height;
|
|
100
|
+
if (Math.abs(size) <= STACK_SEPARATOR_WIDTH) {
|
|
101
|
+
return /* @__PURE__ */ React.createElement(RechartsPrimitive__namespace.Rectangle, { ...props });
|
|
102
|
+
}
|
|
103
|
+
const inset = Math.sign(size) * STACK_SEPARATOR_WIDTH;
|
|
104
|
+
if (isHorizontal) {
|
|
105
|
+
return /* @__PURE__ */ React.createElement(RechartsPrimitive__namespace.Rectangle, { ...props, x: x + inset, width: width - inset });
|
|
106
|
+
}
|
|
107
|
+
return /* @__PURE__ */ React.createElement(RechartsPrimitive__namespace.Rectangle, { ...props, height: height - inset });
|
|
108
|
+
}
|
|
92
109
|
function getRadius(index, length, stacked, isHorizontal) {
|
|
93
110
|
if (stacked) {
|
|
94
111
|
if (index === 0) {
|
|
@@ -107,3 +124,4 @@ function Bar(_) {
|
|
|
107
124
|
BarChart.Bar = Bar;
|
|
108
125
|
exports.BarChart = BarChart;
|
|
109
126
|
exports.renderBars = renderBars;
|
|
127
|
+
exports.renderStackedSegment = renderStackedSegment;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { ChartChildProps, CartesianChartProps } from '../types';
|
|
3
3
|
import { ChartShape } from '../useChartData';
|
|
4
|
+
import * as RechartsPrimitive from 'recharts';
|
|
4
5
|
export type BarChartProps<TData extends object> = {
|
|
5
6
|
/** Orientation of the bars
|
|
6
7
|
* @default false
|
|
@@ -23,4 +24,11 @@ export declare namespace BarChart {
|
|
|
23
24
|
* Helper function to render bar shapes as Recharts Bar primitives. Extracted to be reusable across BarChart and ComposedChart.
|
|
24
25
|
*/
|
|
25
26
|
export declare const renderBars: (shapes: ChartShape[], showLabels?: boolean, stacked?: boolean | "expand", isHorizontal?: boolean) => React.JSX.Element[];
|
|
27
|
+
type RectangleProps = React.ComponentProps<typeof RechartsPrimitive.Rectangle>;
|
|
28
|
+
/**
|
|
29
|
+
* Bar shape for every stack segment except the first: insets the edge facing the previous segment,
|
|
30
|
+
* so neighbouring segments are separated by empty space.
|
|
31
|
+
*/
|
|
32
|
+
export declare function renderStackedSegment(props: RectangleProps, isHorizontal: boolean): React.JSX.Element;
|
|
26
33
|
export type BarChartBarProps<TData extends object> = ChartChildProps<TData>;
|
|
34
|
+
export {};
|
|
@@ -47,29 +47,46 @@ function BarChart(props) {
|
|
|
47
47
|
)), showLegend ? /* @__PURE__ */ React__default.createElement(Legend, { items, hoverIndex: activeIndex, onHover: setActiveIndex, onToggle: toggleItem }) : null);
|
|
48
48
|
}
|
|
49
49
|
const renderBars = (shapes, showLabels = false, stacked = false, isHorizontal = false) => {
|
|
50
|
-
return shapes.map((shape, index) =>
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
...shape,
|
|
55
|
-
activeBar: { fillOpacity: 1, strokeWidth: 0 },
|
|
56
|
-
maxBarSize: BAR_WIDTH,
|
|
57
|
-
radius: getRadius(index, shapes.length, !!stacked, isHorizontal),
|
|
58
|
-
stackId: stacked ? "stack" : void 0,
|
|
59
|
-
strokeWidth: 0
|
|
60
|
-
},
|
|
61
|
-
showLabels ? /* @__PURE__ */ React__default.createElement(
|
|
62
|
-
RechartsPrimitive.LabelList,
|
|
50
|
+
return shapes.map((shape, index) => {
|
|
51
|
+
const hasSeparator = stacked && index > 0;
|
|
52
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
53
|
+
RechartsPrimitive.Bar,
|
|
63
54
|
{
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
55
|
+
key: `${index}-${shape.dataKey}`,
|
|
56
|
+
...shape,
|
|
57
|
+
activeBar: hasSeparator ? (shapeProps) => renderStackedSegment({ ...shapeProps, fillOpacity: 1, strokeWidth: 0 }, isHorizontal) : { fillOpacity: 1, strokeWidth: 0 },
|
|
58
|
+
maxBarSize: BAR_WIDTH,
|
|
59
|
+
radius: getRadius(index, shapes.length, !!stacked, isHorizontal),
|
|
60
|
+
shape: hasSeparator ? (shapeProps) => renderStackedSegment(shapeProps, isHorizontal) : void 0,
|
|
61
|
+
stackId: stacked ? "stack" : void 0,
|
|
62
|
+
strokeWidth: 0
|
|
63
|
+
},
|
|
64
|
+
showLabels ? /* @__PURE__ */ React__default.createElement(
|
|
65
|
+
RechartsPrimitive.LabelList,
|
|
66
|
+
{
|
|
67
|
+
position: isHorizontal ? "insideRight" : "top",
|
|
68
|
+
formatter: shape.formatter,
|
|
69
|
+
offset: 6,
|
|
70
|
+
fill: isHorizontal ? getInverseThemeColor(shape.color ?? "") : "black",
|
|
71
|
+
fontSize: 11
|
|
72
|
+
}
|
|
73
|
+
) : null
|
|
74
|
+
);
|
|
75
|
+
});
|
|
72
76
|
};
|
|
77
|
+
const STACK_SEPARATOR_WIDTH = 2;
|
|
78
|
+
function renderStackedSegment(props, isHorizontal) {
|
|
79
|
+
const { x = 0, width = 0, height = 0 } = props;
|
|
80
|
+
const size = isHorizontal ? width : height;
|
|
81
|
+
if (Math.abs(size) <= STACK_SEPARATOR_WIDTH) {
|
|
82
|
+
return /* @__PURE__ */ React__default.createElement(RechartsPrimitive.Rectangle, { ...props });
|
|
83
|
+
}
|
|
84
|
+
const inset = Math.sign(size) * STACK_SEPARATOR_WIDTH;
|
|
85
|
+
if (isHorizontal) {
|
|
86
|
+
return /* @__PURE__ */ React__default.createElement(RechartsPrimitive.Rectangle, { ...props, x: x + inset, width: width - inset });
|
|
87
|
+
}
|
|
88
|
+
return /* @__PURE__ */ React__default.createElement(RechartsPrimitive.Rectangle, { ...props, height: height - inset });
|
|
89
|
+
}
|
|
73
90
|
function getRadius(index, length, stacked, isHorizontal) {
|
|
74
91
|
if (stacked) {
|
|
75
92
|
if (index === 0) {
|
|
@@ -88,5 +105,6 @@ function Bar(_) {
|
|
|
88
105
|
BarChart.Bar = Bar;
|
|
89
106
|
export {
|
|
90
107
|
BarChart,
|
|
91
|
-
renderBars
|
|
108
|
+
renderBars,
|
|
109
|
+
renderStackedSegment
|
|
92
110
|
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const cn = require("clsx");
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const RechartsPrimitive = require("recharts");
|
|
6
|
+
function _interopNamespaceDefault(e) {
|
|
7
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
8
|
+
if (e) {
|
|
9
|
+
for (const k in e) {
|
|
10
|
+
if (k !== "default") {
|
|
11
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
12
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: () => e[k]
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
n.default = e;
|
|
20
|
+
return Object.freeze(n);
|
|
21
|
+
}
|
|
22
|
+
const RechartsPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(RechartsPrimitive);
|
|
23
|
+
const SEGMENT_SEPARATOR_WIDTH = 2;
|
|
24
|
+
const HALF_SEPARATOR = SEGMENT_SEPARATOR_WIDTH / 2;
|
|
25
|
+
const RADIAN = Math.PI / 180;
|
|
26
|
+
function polarToCartesian(cx, cy, radius, angle) {
|
|
27
|
+
return {
|
|
28
|
+
x: cx + Math.cos(-RADIAN * angle) * radius,
|
|
29
|
+
y: cy + Math.sin(-RADIAN * angle) * radius
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function getTrim(radius) {
|
|
33
|
+
return Math.asin(HALF_SEPARATOR / radius) / RADIAN;
|
|
34
|
+
}
|
|
35
|
+
function PaddedSector(props) {
|
|
36
|
+
const { className, cx = 0, cy = 0, endAngle = 0, fill, innerRadius = 0, opacity, outerRadius = 0, startAngle = 0 } = props;
|
|
37
|
+
const sweep = Math.abs(endAngle - startAngle);
|
|
38
|
+
if (outerRadius <= HALF_SEPARATOR || sweep >= 360 || sweep <= 2 * getTrim(outerRadius)) {
|
|
39
|
+
return /* @__PURE__ */ React.createElement(RechartsPrimitive__namespace.Sector, { ...props });
|
|
40
|
+
}
|
|
41
|
+
const outerTrim = getTrim(outerRadius);
|
|
42
|
+
const direction = Math.sign(endAngle - startAngle);
|
|
43
|
+
const sweepFlag = direction < 0 ? 1 : 0;
|
|
44
|
+
const outerStart = polarToCartesian(cx, cy, outerRadius, startAngle + direction * outerTrim);
|
|
45
|
+
const outerEnd = polarToCartesian(cx, cy, outerRadius, endAngle - direction * outerTrim);
|
|
46
|
+
const outerArc = `A ${outerRadius},${outerRadius},0,${sweep - 2 * outerTrim > 180 ? 1 : 0},${sweepFlag},${outerEnd.x},${outerEnd.y}`;
|
|
47
|
+
let path;
|
|
48
|
+
if (innerRadius <= HALF_SEPARATOR || sweep <= 2 * getTrim(innerRadius)) {
|
|
49
|
+
if (sweep > 180) {
|
|
50
|
+
const startFoot = polarToCartesian(cx, cy, HALF_SEPARATOR, startAngle + direction * 90);
|
|
51
|
+
const endFoot = polarToCartesian(cx, cy, HALF_SEPARATOR, endAngle - direction * 90);
|
|
52
|
+
path = [
|
|
53
|
+
`M ${startFoot.x},${startFoot.y}`,
|
|
54
|
+
`L ${outerStart.x},${outerStart.y}`,
|
|
55
|
+
outerArc,
|
|
56
|
+
`L ${endFoot.x},${endFoot.y}`,
|
|
57
|
+
"Z"
|
|
58
|
+
];
|
|
59
|
+
} else {
|
|
60
|
+
const apexRadius = HALF_SEPARATOR / Math.sin(sweep / 2 * RADIAN);
|
|
61
|
+
const apex = polarToCartesian(cx, cy, apexRadius, (startAngle + endAngle) / 2);
|
|
62
|
+
path = [`M ${apex.x},${apex.y}`, `L ${outerStart.x},${outerStart.y}`, outerArc, "Z"];
|
|
63
|
+
}
|
|
64
|
+
} else {
|
|
65
|
+
const innerTrim = getTrim(innerRadius);
|
|
66
|
+
const innerStart = polarToCartesian(cx, cy, innerRadius, startAngle + direction * innerTrim);
|
|
67
|
+
const innerEnd = polarToCartesian(cx, cy, innerRadius, endAngle - direction * innerTrim);
|
|
68
|
+
const innerArc = `A ${innerRadius},${innerRadius},0,${sweep - 2 * innerTrim > 180 ? 1 : 0},${1 - sweepFlag},${innerStart.x},${innerStart.y}`;
|
|
69
|
+
path = [
|
|
70
|
+
`M ${innerStart.x},${innerStart.y}`,
|
|
71
|
+
`L ${outerStart.x},${outerStart.y}`,
|
|
72
|
+
outerArc,
|
|
73
|
+
`L ${innerEnd.x},${innerEnd.y}`,
|
|
74
|
+
innerArc,
|
|
75
|
+
"Z"
|
|
76
|
+
];
|
|
77
|
+
}
|
|
78
|
+
return /* @__PURE__ */ React.createElement("path", { className: cn("recharts-sector", className), d: path.join(" "), fill, opacity });
|
|
79
|
+
}
|
|
80
|
+
exports.PaddedSector = PaddedSector;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { PieSectorDataItem } from 'recharts/types/polar/Pie';
|
|
3
|
+
/**
|
|
4
|
+
* Pie or donut sector with both straight edges inset by half the separator width, so neighbouring
|
|
5
|
+
* segments sit exactly one separator width apart along their whole length.
|
|
6
|
+
*/
|
|
7
|
+
export declare function PaddedSector(props: PieSectorDataItem): React.JSX.Element;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import cn from "clsx";
|
|
2
|
+
import React__default from "react";
|
|
3
|
+
import * as RechartsPrimitive from "recharts";
|
|
4
|
+
const SEGMENT_SEPARATOR_WIDTH = 2;
|
|
5
|
+
const HALF_SEPARATOR = SEGMENT_SEPARATOR_WIDTH / 2;
|
|
6
|
+
const RADIAN = Math.PI / 180;
|
|
7
|
+
function polarToCartesian(cx, cy, radius, angle) {
|
|
8
|
+
return {
|
|
9
|
+
x: cx + Math.cos(-RADIAN * angle) * radius,
|
|
10
|
+
y: cy + Math.sin(-RADIAN * angle) * radius
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function getTrim(radius) {
|
|
14
|
+
return Math.asin(HALF_SEPARATOR / radius) / RADIAN;
|
|
15
|
+
}
|
|
16
|
+
function PaddedSector(props) {
|
|
17
|
+
const { className, cx = 0, cy = 0, endAngle = 0, fill, innerRadius = 0, opacity, outerRadius = 0, startAngle = 0 } = props;
|
|
18
|
+
const sweep = Math.abs(endAngle - startAngle);
|
|
19
|
+
if (outerRadius <= HALF_SEPARATOR || sweep >= 360 || sweep <= 2 * getTrim(outerRadius)) {
|
|
20
|
+
return /* @__PURE__ */ React__default.createElement(RechartsPrimitive.Sector, { ...props });
|
|
21
|
+
}
|
|
22
|
+
const outerTrim = getTrim(outerRadius);
|
|
23
|
+
const direction = Math.sign(endAngle - startAngle);
|
|
24
|
+
const sweepFlag = direction < 0 ? 1 : 0;
|
|
25
|
+
const outerStart = polarToCartesian(cx, cy, outerRadius, startAngle + direction * outerTrim);
|
|
26
|
+
const outerEnd = polarToCartesian(cx, cy, outerRadius, endAngle - direction * outerTrim);
|
|
27
|
+
const outerArc = `A ${outerRadius},${outerRadius},0,${sweep - 2 * outerTrim > 180 ? 1 : 0},${sweepFlag},${outerEnd.x},${outerEnd.y}`;
|
|
28
|
+
let path;
|
|
29
|
+
if (innerRadius <= HALF_SEPARATOR || sweep <= 2 * getTrim(innerRadius)) {
|
|
30
|
+
if (sweep > 180) {
|
|
31
|
+
const startFoot = polarToCartesian(cx, cy, HALF_SEPARATOR, startAngle + direction * 90);
|
|
32
|
+
const endFoot = polarToCartesian(cx, cy, HALF_SEPARATOR, endAngle - direction * 90);
|
|
33
|
+
path = [
|
|
34
|
+
`M ${startFoot.x},${startFoot.y}`,
|
|
35
|
+
`L ${outerStart.x},${outerStart.y}`,
|
|
36
|
+
outerArc,
|
|
37
|
+
`L ${endFoot.x},${endFoot.y}`,
|
|
38
|
+
"Z"
|
|
39
|
+
];
|
|
40
|
+
} else {
|
|
41
|
+
const apexRadius = HALF_SEPARATOR / Math.sin(sweep / 2 * RADIAN);
|
|
42
|
+
const apex = polarToCartesian(cx, cy, apexRadius, (startAngle + endAngle) / 2);
|
|
43
|
+
path = [`M ${apex.x},${apex.y}`, `L ${outerStart.x},${outerStart.y}`, outerArc, "Z"];
|
|
44
|
+
}
|
|
45
|
+
} else {
|
|
46
|
+
const innerTrim = getTrim(innerRadius);
|
|
47
|
+
const innerStart = polarToCartesian(cx, cy, innerRadius, startAngle + direction * innerTrim);
|
|
48
|
+
const innerEnd = polarToCartesian(cx, cy, innerRadius, endAngle - direction * innerTrim);
|
|
49
|
+
const innerArc = `A ${innerRadius},${innerRadius},0,${sweep - 2 * innerTrim > 180 ? 1 : 0},${1 - sweepFlag},${innerStart.x},${innerStart.y}`;
|
|
50
|
+
path = [
|
|
51
|
+
`M ${innerStart.x},${innerStart.y}`,
|
|
52
|
+
`L ${outerStart.x},${outerStart.y}`,
|
|
53
|
+
outerArc,
|
|
54
|
+
`L ${innerEnd.x},${innerEnd.y}`,
|
|
55
|
+
innerArc,
|
|
56
|
+
"Z"
|
|
57
|
+
];
|
|
58
|
+
}
|
|
59
|
+
return /* @__PURE__ */ React__default.createElement("path", { className: cn("recharts-sector", className), d: path.join(" "), fill, opacity });
|
|
60
|
+
}
|
|
61
|
+
export {
|
|
62
|
+
PaddedSector
|
|
63
|
+
};
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const React = require("react");
|
|
4
4
|
const RechartsPrimitive = require("recharts");
|
|
5
5
|
const useChartData = require("../useChartData.cjs");
|
|
6
|
+
const PaddedSector = require("./PaddedSector.cjs");
|
|
6
7
|
function _interopNamespaceDefault(e) {
|
|
7
8
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
8
9
|
if (e) {
|
|
@@ -42,7 +43,8 @@ function usePieChart(children, options) {
|
|
|
42
43
|
endAngle: -270,
|
|
43
44
|
stroke: "0",
|
|
44
45
|
labelLine: false,
|
|
45
|
-
outerRadius: radius
|
|
46
|
+
outerRadius: radius,
|
|
47
|
+
shape: (props) => /* @__PURE__ */ React.createElement(PaddedSector.PaddedSector, { ...props })
|
|
46
48
|
};
|
|
47
49
|
return { pieProps, radius, setRadius, items, activeIndex, setActiveIndex, globalFormatter, toggleItem, shapes };
|
|
48
50
|
}
|
|
@@ -50,8 +52,8 @@ const PIE_CHART_HOVER = 10;
|
|
|
50
52
|
const PIE_CHART_HOVER_OFFSET = 2;
|
|
51
53
|
function ActiveShape(props) {
|
|
52
54
|
const { outerRadius = 0, ...attributes } = props;
|
|
53
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
54
|
-
|
|
55
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(PaddedSector.PaddedSector, { ...props }), /* @__PURE__ */ React.createElement(
|
|
56
|
+
PaddedSector.PaddedSector,
|
|
55
57
|
{
|
|
56
58
|
...attributes,
|
|
57
59
|
innerRadius: outerRadius + PIE_CHART_HOVER_OFFSET,
|
|
@@ -15,6 +15,7 @@ export declare function usePieChart<TData extends object>(children: React.ReactN
|
|
|
15
15
|
stroke: string;
|
|
16
16
|
labelLine: boolean;
|
|
17
17
|
outerRadius: number;
|
|
18
|
+
shape: (props: PieSectorDataItem) => React.JSX.Element;
|
|
18
19
|
};
|
|
19
20
|
radius: number;
|
|
20
21
|
setRadius: (width: number) => void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React__default from "react";
|
|
2
2
|
import * as RechartsPrimitive from "recharts";
|
|
3
3
|
import { useChart } from "../useChartData.js";
|
|
4
|
+
import { PaddedSector } from "./PaddedSector.js";
|
|
4
5
|
const PIE_ACTIVE_WIDTH = 10;
|
|
5
6
|
const PIE_ACTIVE_WIDTH_OFFSET = 2;
|
|
6
7
|
function usePieChart(children, options) {
|
|
@@ -23,7 +24,8 @@ function usePieChart(children, options) {
|
|
|
23
24
|
endAngle: -270,
|
|
24
25
|
stroke: "0",
|
|
25
26
|
labelLine: false,
|
|
26
|
-
outerRadius: radius
|
|
27
|
+
outerRadius: radius,
|
|
28
|
+
shape: (props) => /* @__PURE__ */ React__default.createElement(PaddedSector, { ...props })
|
|
27
29
|
};
|
|
28
30
|
return { pieProps, radius, setRadius, items, activeIndex, setActiveIndex, globalFormatter, toggleItem, shapes };
|
|
29
31
|
}
|
|
@@ -31,8 +33,8 @@ const PIE_CHART_HOVER = 10;
|
|
|
31
33
|
const PIE_CHART_HOVER_OFFSET = 2;
|
|
32
34
|
function ActiveShape(props) {
|
|
33
35
|
const { outerRadius = 0, ...attributes } = props;
|
|
34
|
-
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(
|
|
35
|
-
|
|
36
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(PaddedSector, { ...props }), /* @__PURE__ */ React__default.createElement(
|
|
37
|
+
PaddedSector,
|
|
36
38
|
{
|
|
37
39
|
...attributes,
|
|
38
40
|
innerRadius: outerRadius + PIE_CHART_HOVER_OFFSET,
|
|
@@ -2,6 +2,9 @@ import { AlertDialogContentProps, AlertDialogTitleProps, AlertDialogDescriptionP
|
|
|
2
2
|
import { AlertDialogCancelProps, AlertDialogActionProps, AlertDialogFooterProps } from './components/Footer';
|
|
3
3
|
import { AlertDialogTriggerProps } from './components/Trigger';
|
|
4
4
|
import * as React from 'react';
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated Use `Dialog` instead.
|
|
7
|
+
*/
|
|
5
8
|
export type AlertDialogProps = {
|
|
6
9
|
children: React.ReactNode | React.ReactNode[];
|
|
7
10
|
/**
|
|
@@ -24,13 +27,40 @@ export type AlertDialogProps = {
|
|
|
24
27
|
*/
|
|
25
28
|
variant?: 'warning' | 'error' | 'information';
|
|
26
29
|
};
|
|
30
|
+
/**
|
|
31
|
+
* @deprecated Use `Dialog` instead.
|
|
32
|
+
*/
|
|
27
33
|
export type ForwardedAlertDialogWithStatics = React.ForwardRefExoticComponent<AlertDialogProps & React.RefAttributes<HTMLElement>> & {
|
|
34
|
+
/**
|
|
35
|
+
* @deprecated Use `Dialog` instead.
|
|
36
|
+
*/
|
|
28
37
|
Trigger: React.ForwardRefExoticComponent<AlertDialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
38
|
+
/**
|
|
39
|
+
* @deprecated Use `Dialog` instead.
|
|
40
|
+
*/
|
|
29
41
|
Content: React.ForwardRefExoticComponent<AlertDialogContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
42
|
+
/**
|
|
43
|
+
* @deprecated Use `Dialog` instead.
|
|
44
|
+
*/
|
|
30
45
|
Title: React.ForwardRefExoticComponent<AlertDialogTitleProps & React.RefAttributes<HTMLHeadingElement>>;
|
|
46
|
+
/**
|
|
47
|
+
* @deprecated Use `Dialog` instead.
|
|
48
|
+
*/
|
|
31
49
|
Description: React.ForwardRefExoticComponent<AlertDialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>>;
|
|
50
|
+
/**
|
|
51
|
+
* @deprecated Use `Dialog` instead.
|
|
52
|
+
*/
|
|
32
53
|
Footer: React.ForwardRefExoticComponent<AlertDialogFooterProps & React.RefAttributes<HTMLDivElement>>;
|
|
54
|
+
/**
|
|
55
|
+
* @deprecated Use `Dialog` instead.
|
|
56
|
+
*/
|
|
33
57
|
Action: React.ForwardRefExoticComponent<AlertDialogActionProps & React.RefAttributes<HTMLButtonElement>>;
|
|
58
|
+
/**
|
|
59
|
+
* @deprecated Use `Dialog` instead.
|
|
60
|
+
*/
|
|
34
61
|
Cancel: React.ForwardRefExoticComponent<AlertDialogCancelProps & React.RefAttributes<HTMLButtonElement>>;
|
|
35
62
|
};
|
|
63
|
+
/**
|
|
64
|
+
* @deprecated Use `Dialog` instead.
|
|
65
|
+
*/
|
|
36
66
|
export declare const AlertDialog: ForwardedAlertDialogWithStatics;
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated Use `Dialog` instead.
|
|
4
|
+
*/
|
|
2
5
|
export type AlertDialogContext = {
|
|
3
6
|
props: Record<string, unknown>;
|
|
4
7
|
ref: React.Ref<HTMLElement>;
|
|
5
8
|
};
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated Use `Dialog` instead.
|
|
11
|
+
*/
|
|
6
12
|
export declare const AlertDialogContext: React.Context<AlertDialogContext>;
|
|
13
|
+
/**
|
|
14
|
+
* @deprecated Use `Dialog` instead.
|
|
15
|
+
*/
|
|
7
16
|
export declare const useCurrentAlertDialog: () => AlertDialogContext;
|
|
@@ -1,13 +1,31 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated Use `Dialog` instead.
|
|
4
|
+
*/
|
|
2
5
|
export type AlertDialogTitleProps = React.HTMLAttributes<HTMLHeadingElement>;
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated Use `Dialog` instead.
|
|
8
|
+
*/
|
|
3
9
|
export declare const Title: React.ForwardRefExoticComponent<AlertDialogTitleProps & React.RefAttributes<HTMLHeadingElement>>;
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated Use `Dialog` instead.
|
|
12
|
+
*/
|
|
4
13
|
export type AlertDialogDescriptionProps = React.HTMLAttributes<HTMLParagraphElement>;
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated Use `Dialog` instead.
|
|
16
|
+
*/
|
|
5
17
|
export declare const Description: React.ForwardRefExoticComponent<AlertDialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>>;
|
|
18
|
+
/**
|
|
19
|
+
* @deprecated Use `Dialog` instead.
|
|
20
|
+
*/
|
|
6
21
|
export type AlertDialogContentProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> & {
|
|
7
22
|
/** An accessible label to be announced when the dialog is opened */
|
|
8
23
|
'aria-label': string;
|
|
9
24
|
children: React.ReactNode;
|
|
10
25
|
};
|
|
26
|
+
/**
|
|
27
|
+
* @deprecated Use `Dialog` instead.
|
|
28
|
+
*/
|
|
11
29
|
export declare const Content: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
12
30
|
/** An accessible label to be announced when the dialog is opened */
|
|
13
31
|
'aria-label': string;
|
|
@@ -1,15 +1,33 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated Use `Dialog` instead.
|
|
4
|
+
*/
|
|
2
5
|
export type AlertDialogFooterProps = React.HTMLAttributes<HTMLDivElement>;
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated Use `Dialog` instead.
|
|
8
|
+
*/
|
|
3
9
|
export declare const Footer: React.ForwardRefExoticComponent<AlertDialogFooterProps & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated Use `Dialog` instead.
|
|
12
|
+
*/
|
|
4
13
|
export type AlertDialogCancelProps = React.HTMLAttributes<HTMLButtonElement> & {
|
|
5
14
|
children: React.ReactElement;
|
|
6
15
|
};
|
|
16
|
+
/**
|
|
17
|
+
* @deprecated Use `Dialog` instead.
|
|
18
|
+
*/
|
|
7
19
|
export declare const Cancel: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLButtonElement> & {
|
|
8
20
|
children: React.ReactElement;
|
|
9
21
|
} & React.RefAttributes<HTMLButtonElement>>;
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated Use `Dialog` instead.
|
|
24
|
+
*/
|
|
10
25
|
export type AlertDialogActionProps = React.HTMLAttributes<HTMLButtonElement> & {
|
|
11
26
|
children: React.ReactElement;
|
|
12
27
|
};
|
|
28
|
+
/**
|
|
29
|
+
* @deprecated Use `Dialog` instead.
|
|
30
|
+
*/
|
|
13
31
|
export declare const Action: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLButtonElement> & {
|
|
14
32
|
children: React.ReactElement;
|
|
15
33
|
} & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated Use `Dialog` instead.
|
|
4
|
+
*/
|
|
2
5
|
export type AlertDialogTriggerProps = React.HTMLAttributes<HTMLButtonElement> & {
|
|
3
6
|
children: React.ReactElement;
|
|
4
7
|
};
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated Use `Dialog` instead.
|
|
10
|
+
*/
|
|
5
11
|
export declare const Trigger: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLButtonElement> & {
|
|
6
12
|
children: React.ReactElement;
|
|
7
13
|
} & React.RefAttributes<HTMLButtonElement>>;
|
package/dist/index.cjs
CHANGED
|
@@ -135,6 +135,7 @@ exports.BadgeIcon = BadgeIcon.BadgeIcon;
|
|
|
135
135
|
exports.Banner = Banner.Banner;
|
|
136
136
|
exports.BarChart = BarChart.BarChart;
|
|
137
137
|
exports.renderBars = BarChart.renderBars;
|
|
138
|
+
exports.renderStackedSegment = BarChart.renderStackedSegment;
|
|
138
139
|
exports.BarLineChart = BarLineChart.BarLineChart;
|
|
139
140
|
exports.Breadcrumbs = Breadcrumbs.Breadcrumbs;
|
|
140
141
|
exports.Button = Button.Button;
|
package/dist/index.js
CHANGED
|
@@ -28,7 +28,7 @@ import { Backdrop } from "./components/Backdrop/Backdrop.js";
|
|
|
28
28
|
import { Badge } from "./components/Badge/Badge.js";
|
|
29
29
|
import { BadgeIcon } from "./components/BadgeIcon/BadgeIcon.js";
|
|
30
30
|
import { Banner } from "./components/Banner/Banner.js";
|
|
31
|
-
import { BarChart, renderBars } from "./charts/components/Bar/BarChart.js";
|
|
31
|
+
import { BarChart, renderBars, renderStackedSegment } from "./charts/components/Bar/BarChart.js";
|
|
32
32
|
import { BarLineChart } from "./charts/components/Composed/BarLineChart.js";
|
|
33
33
|
import { Breadcrumbs } from "./components/Breadcrumbs/Breadcrumbs.js";
|
|
34
34
|
import { Button } from "./components/actions/Button/Button.js";
|
|
@@ -188,6 +188,7 @@ export {
|
|
|
188
188
|
parseFromISOString,
|
|
189
189
|
renderBars,
|
|
190
190
|
renderLines,
|
|
191
|
+
renderStackedSegment,
|
|
191
192
|
shouldTriggerShortcut,
|
|
192
193
|
useBoundaryOverflowDetection,
|
|
193
194
|
useBoundingClientRectListener,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@economic/taco",
|
|
3
|
-
"version": "17.1.0
|
|
3
|
+
"version": "17.1.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -90,5 +90,5 @@
|
|
|
90
90
|
"vitest": "^4.1.12",
|
|
91
91
|
"vitest-fail-on-console": "^0.10.1"
|
|
92
92
|
},
|
|
93
|
-
"gitHead": "
|
|
93
|
+
"gitHead": "7f70a4854f477b84a05f453c838e94433b8c7f6a"
|
|
94
94
|
}
|