@appquality/unguess-design-system 2.12.46 โ 2.12.48
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/CHANGELOG.md +31 -0
- package/build/index.js +50 -15
- package/build/stories/breadcrumbs/_types.d.ts +2 -0
- package/build/stories/breadcrumbs/index.d.ts +2 -9
- package/build/stories/breadcrumbs/index.stories.d.ts +1 -1
- package/build/stories/charts/_types.d.ts +1 -1
- package/build/stories/charts/pie/_types.d.ts +11 -2
- package/build/stories/charts/pie/index.d.ts +1 -1
- package/build/stories/charts/pie/index.stories.d.ts +2 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,34 @@
|
|
|
1
|
+
# v2.12.48 (Mon Dec 12 2022)
|
|
2
|
+
|
|
3
|
+
#### ๐ Bug Fix
|
|
4
|
+
|
|
5
|
+
- Fix bullet charts and improve responsiveness on breadcrumbs [#149](https://github.com/AppQuality/unguess-design-system/pull/149) ([@iacopolea](https://github.com/iacopolea) [@marcbon](https://github.com/marcbon) [@cannarocks](https://github.com/cannarocks))
|
|
6
|
+
- feat(app-header): add onclick on header item icon [#148](https://github.com/AppQuality/unguess-design-system/pull/148) ([@marcbon](https://github.com/marcbon))
|
|
7
|
+
- feat(breadcrumbs): add responsive behavior + remove last item from story (new desktop behavior) [#147](https://github.com/AppQuality/unguess-design-system/pull/147) ([@marcbon](https://github.com/marcbon))
|
|
8
|
+
- fix(bullet): UN-209 animate measue component [#146](https://github.com/AppQuality/unguess-design-system/pull/146) ([@iacopolea](https://github.com/iacopolea))
|
|
9
|
+
|
|
10
|
+
#### Authors: 3
|
|
11
|
+
|
|
12
|
+
- Iacopo Leardini ([@iacopolea](https://github.com/iacopolea))
|
|
13
|
+
- Luca Cannarozzo ([@cannarocks](https://github.com/cannarocks))
|
|
14
|
+
- Marco Bonomo ([@marcbon](https://github.com/marcbon))
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# v2.12.47 (Wed Dec 07 2022)
|
|
19
|
+
|
|
20
|
+
#### ๐ Bug Fix
|
|
21
|
+
|
|
22
|
+
- Allow custom label on pie [#144](https://github.com/AppQuality/unguess-design-system/pull/144) ([@d-beezee](https://github.com/d-beezee) [@cannarocks](https://github.com/cannarocks))
|
|
23
|
+
- feat: Allow custom label for arclink and legend [#143](https://github.com/AppQuality/unguess-design-system/pull/143) ([@d-beezee](https://github.com/d-beezee))
|
|
24
|
+
|
|
25
|
+
#### Authors: 2
|
|
26
|
+
|
|
27
|
+
- [@d-beezee](https://github.com/d-beezee)
|
|
28
|
+
- Luca Cannarozzo ([@cannarocks](https://github.com/cannarocks))
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
1
32
|
# v2.12.46 (Tue Dec 06 2022)
|
|
2
33
|
|
|
3
34
|
#### ๐ Bug Fix
|
package/build/index.js
CHANGED
|
@@ -266,10 +266,10 @@ var isMac = function () {
|
|
|
266
266
|
var os = parser.getOS().name;
|
|
267
267
|
return os && /Mac OS|iOS/.test(os);
|
|
268
268
|
};
|
|
269
|
-
styled.css(templateObject_1$
|
|
269
|
+
styled.css(templateObject_1$1r || (templateObject_1$1r = __makeTemplateObject(["\n transition: opacity 0.2s ease;\n"], ["\n transition: opacity 0.2s ease;\n"])));
|
|
270
270
|
var sidebarNavItemExpanded = styled.css(templateObject_2$A || (templateObject_2$A = __makeTemplateObject(["\n visibility: visible;\n opacity: 1;\n // transition: opacity 0.2s ease;\n"], ["\n visibility: visible;\n opacity: 1;\n // transition: opacity 0.2s ease;\n"])));
|
|
271
271
|
var sidebarNavItemHidden = styled.css(templateObject_3$n || (templateObject_3$n = __makeTemplateObject(["\n visibility: hidden;\n pointer-events: none;\n color: transparent;\n"], ["\n visibility: hidden;\n pointer-events: none;\n color: transparent;\n"])));
|
|
272
|
-
var templateObject_1$
|
|
272
|
+
var templateObject_1$1r, templateObject_2$A, templateObject_3$n;
|
|
273
273
|
|
|
274
274
|
var gradients = {
|
|
275
275
|
horizontal: "linear-gradient(90.81deg, ".concat(hex2rgba(palette.blue[600]), " 11.98%, ").concat(hex2rgba(palette.kale[400]), " 100%);"),
|
|
@@ -295,8 +295,8 @@ var theme = __assign(__assign({}, reactTheming.DEFAULT_THEME), { breakpoints: __
|
|
|
295
295
|
modal: 200,
|
|
296
296
|
} });
|
|
297
297
|
|
|
298
|
-
var GlobalStyle = styled.createGlobalStyle(templateObject_1$
|
|
299
|
-
var templateObject_1$
|
|
298
|
+
var GlobalStyle = styled.createGlobalStyle(templateObject_1$1q || (templateObject_1$1q = __makeTemplateObject(["\n ::-webkit-scrollbar-track:hover {\n border-left: solid 1px ", ";\n border-right: solid 1px ", ";\n }\n\n ::-webkit-scrollbar {\n width: 10px;\n }\n\n ::-webkit-scrollbar-track {\n border: solid 2px transparent;\n }\n\n ::-webkit-scrollbar-thumb {\n box-shadow: inset 0 0 10px 10px ", ";\n border: solid 2px transparent;\n border-radius: 25px;\n }\n\n /* This stuff is for Firefox */\n * {\n scrollbar-color: ", " #FFFFFF;\n scrollbar-width: thin;\n }\n\n html {\n overflow-y: auto;\n }\n\n body {\n font-family: ", ";\n margin: 0;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n }\n \n svg {\n max-height: 100%;\n }\n\n"], ["\n ::-webkit-scrollbar-track:hover {\n border-left: solid 1px ", ";\n border-right: solid 1px ", ";\n }\n\n ::-webkit-scrollbar {\n width: 10px;\n }\n\n ::-webkit-scrollbar-track {\n border: solid 2px transparent;\n }\n\n ::-webkit-scrollbar-thumb {\n box-shadow: inset 0 0 10px 10px ", ";\n border: solid 2px transparent;\n border-radius: 25px;\n }\n\n /* This stuff is for Firefox */\n * {\n scrollbar-color: ", " #FFFFFF;\n scrollbar-width: thin;\n }\n\n html {\n overflow-y: auto;\n }\n\n body {\n font-family: ", ";\n margin: 0;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n }\n \n svg {\n max-height: 100%;\n }\n\n"])), theme.palette.grey["200"], theme.palette.grey["200"], theme.palette.blue["200"], theme.palette.blue["200"], theme.fonts.system);
|
|
299
|
+
var templateObject_1$1q;
|
|
300
300
|
|
|
301
301
|
/**
|
|
302
302
|
* Accordions are headers that can be expanded to reveal content or collapsed to hide it.
|
|
@@ -312,7 +312,7 @@ Accordion.Header = reactAccordions.Accordion.Header;
|
|
|
312
312
|
Accordion.Label = reactAccordions.Accordion.Label;
|
|
313
313
|
Accordion.Panel = reactAccordions.Accordion.Panel;
|
|
314
314
|
|
|
315
|
-
var UgAlert = styled__default["default"](reactNotifications.Alert)(templateObject_1$
|
|
315
|
+
var UgAlert = styled__default["default"](reactNotifications.Alert)(templateObject_1$1p || (templateObject_1$1p = __makeTemplateObject(["\n background-color: white;\n color: ", ";\n border-width: 2px;\n font-size: ", ";\n"], ["\n background-color: white;\n color: ", ";\n border-width: 2px;\n font-size: ", ";\n"])), function (_a) {
|
|
316
316
|
var theme = _a.theme;
|
|
317
317
|
return theme.palette.grey[700];
|
|
318
318
|
}, function (_a) {
|
|
@@ -333,9 +333,9 @@ var UgAlertTitle = styled__default["default"](reactNotifications.Title)(template
|
|
|
333
333
|
var Alert = function (props) { return jsxRuntime.jsx(UgAlert, __assign({}, props)); };
|
|
334
334
|
Alert.Title = UgAlertTitle;
|
|
335
335
|
Alert.Close = reactNotifications.Close;
|
|
336
|
-
var templateObject_1$
|
|
336
|
+
var templateObject_1$1p, templateObject_2$z;
|
|
337
337
|
|
|
338
|
-
var UgAvatar = styled__default["default"](reactAvatars.Avatar)(templateObject_1$
|
|
338
|
+
var UgAvatar = styled__default["default"](reactAvatars.Avatar)(templateObject_1$1o || (templateObject_1$1o = __makeTemplateObject(["\n text-transform: uppercase;\n\n ", "\n"], ["\n text-transform: uppercase;\n\n ", "\n"])), function (props) {
|
|
339
339
|
return props.avatarType &&
|
|
340
340
|
props.avatarType !== "image" &&
|
|
341
341
|
"background: ".concat(props.backgroundColor || theme.gradients.dark, ";");
|
|
@@ -359,7 +359,7 @@ var Avatar = function (props) {
|
|
|
359
359
|
return (jsxRuntime.jsx(UgAvatar, __assign({}, props, { badge: fixedBadge, children: wrapChildren(props.avatarType || "text"), size: props.size || "small" })));
|
|
360
360
|
};
|
|
361
361
|
Avatar.Text = UgAvatar.Text;
|
|
362
|
-
var templateObject_1$
|
|
362
|
+
var templateObject_1$1o;
|
|
363
363
|
|
|
364
364
|
/**
|
|
365
365
|
* Breadcrumbs mark and communicate a userโs location in the product.
|
|
@@ -368,7 +368,21 @@ var templateObject_1$1n;
|
|
|
368
368
|
- To show the user where they are in a nested navigation
|
|
369
369
|
- To provide a quick way to navigate to ancestor pages
|
|
370
370
|
*/
|
|
371
|
-
var Breadcrumb =
|
|
371
|
+
var StyledBreadcrumb$1 = styled__default["default"](reactBreadcrumbs.Breadcrumb)(templateObject_1$1n || (templateObject_1$1n = __makeTemplateObject(["\n @media (max-width: ", ") {\n > ol {\n display: block;\n\n > li {\n display: none;\n\n &:nth-last-child(", ") {\n display: block;\n width: 100%;\n text-overflow: ellipsis;\n overflow: hidden;\n position: relative;\n padding-left: ", "px;\n\n &::before {\n content: \"<\";\n position: absolute;\n left: 0;\n }\n }\n }\n }\n }\n"], ["\n @media (max-width: ", ") {\n > ol {\n display: block;\n\n > li {\n display: none;\n\n &:nth-last-child(", ") {\n display: block;\n width: 100%;\n text-overflow: ellipsis;\n overflow: hidden;\n position: relative;\n padding-left: ", "px;\n\n &::before {\n content: \"<\";\n position: absolute;\n left: 0;\n }\n }\n }\n }\n }\n"])), function (_a) {
|
|
372
|
+
var theme = _a.theme;
|
|
373
|
+
return theme.breakpoints.md;
|
|
374
|
+
}, function (_a) {
|
|
375
|
+
var showLastArrow = _a.showLastArrow;
|
|
376
|
+
return (showLastArrow ? 3 : 1);
|
|
377
|
+
}, function (_a) {
|
|
378
|
+
var theme = _a.theme;
|
|
379
|
+
return theme.space.base * 4;
|
|
380
|
+
});
|
|
381
|
+
var Breadcrumb = function (_a) {
|
|
382
|
+
var children = _a.children, _b = _a.showLastArrow, showLastArrow = _b === void 0 ? true : _b, props = __rest(_a, ["children", "showLastArrow"]);
|
|
383
|
+
return showLastArrow ? (jsxRuntime.jsxs(StyledBreadcrumb$1, __assign({}, props, { showLastArrow: true }, { children: [children, jsxRuntime.jsx("div", {})] }))) : (jsxRuntime.jsx(StyledBreadcrumb$1, __assign({}, props, { children: children })));
|
|
384
|
+
};
|
|
385
|
+
var templateObject_1$1n;
|
|
372
386
|
|
|
373
387
|
/**
|
|
374
388
|
* The Anchor is a link that helps users navigate from one location to another.
|
|
@@ -1153,7 +1167,7 @@ var CustomBulletChartMarkers = function (_a) {
|
|
|
1153
1167
|
|
|
1154
1168
|
var CustomMeasure = function (_a) {
|
|
1155
1169
|
var x = _a.x, y = _a.y, width = _a.width, height = _a.height;
|
|
1156
|
-
return (jsxRuntime.jsx(
|
|
1170
|
+
return (jsxRuntime.jsx(web.animated.rect, { x: x + 2, y: y + 2, width: width - 4, height: height - 4, fill: CHARTS_COLOR_PALETTE.darkGrey }));
|
|
1157
1171
|
};
|
|
1158
1172
|
|
|
1159
1173
|
var CustomTooltip = function (_a) {
|
|
@@ -1248,9 +1262,19 @@ var templateObject_1$18, templateObject_2$t, templateObject_3$i, templateObject_
|
|
|
1248
1262
|
|
|
1249
1263
|
var PieChart = function (_a) {
|
|
1250
1264
|
var _b;
|
|
1251
|
-
var theme = _a.theme, colors = _a.colors, width = _a.width, height = _a.height, data = _a.data, centerItem = _a.centerItem, margin = _a.margin, tooltip = _a.tooltip, legend = _a.legend, arcLinkLabelsSkipAngle = _a.arcLinkLabelsSkipAngle;
|
|
1265
|
+
var theme = _a.theme, colors = _a.colors, width = _a.width, height = _a.height, data = _a.data, centerItem = _a.centerItem, margin = _a.margin, tooltip = _a.tooltip, legend = _a.legend, arcLinkLabelsSkipAngle = _a.arcLinkLabelsSkipAngle, labelFormatter = _a.labelFormatter;
|
|
1252
1266
|
var themeContext = React.useContext(styled.ThemeContext);
|
|
1253
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ChartContainer, __assign({ width: width, height: height }, { children: jsxRuntime.jsx(pie.ResponsivePie, { theme: __assign({}, __assign(__assign(__assign({}, DEFAULT_CHARTS_THEME), theme), { labels: __assign(__assign({}, theme === null || theme === void 0 ? void 0 : theme.labels), { text: __assign({ fontWeight: themeContext.fontWeights.semibold, fill: themeContext.palette.grey[800] }, (_b = theme === null || theme === void 0 ? void 0 : theme.labels) === null || _b === void 0 ? void 0 : _b.text) }) })), arcLinkLabel: function (d) {
|
|
1267
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ChartContainer, __assign({ width: width, height: height }, { children: jsxRuntime.jsx(pie.ResponsivePie, { theme: __assign({}, __assign(__assign(__assign({}, DEFAULT_CHARTS_THEME), theme), { labels: __assign(__assign({}, theme === null || theme === void 0 ? void 0 : theme.labels), { text: __assign({ fontWeight: themeContext.fontWeights.semibold, fill: themeContext.palette.grey[800] }, (_b = theme === null || theme === void 0 ? void 0 : theme.labels) === null || _b === void 0 ? void 0 : _b.text) }) })), arcLinkLabel: function (d) {
|
|
1268
|
+
return labelFormatter
|
|
1269
|
+
? labelFormatter({
|
|
1270
|
+
label: d.label,
|
|
1271
|
+
id: d.id,
|
|
1272
|
+
value: d.value,
|
|
1273
|
+
data: d.data,
|
|
1274
|
+
labelPosition: "arclink",
|
|
1275
|
+
})
|
|
1276
|
+
: (d.label || d.id).toString();
|
|
1277
|
+
}, colors: colors !== null && colors !== void 0 ? colors : CHARTS_COLOR_SCHEME_CATEGORICAL_8_A, enableArcLabels: false, arcLinkLabelsColor: { from: "color" }, arcLinkLabelsSkipAngle: arcLinkLabelsSkipAngle !== null && arcLinkLabelsSkipAngle !== void 0 ? arcLinkLabelsSkipAngle : 10, padAngle: 2, data: data, margin: __assign({ top: 40, bottom: 40 }, margin), tooltip: tooltip
|
|
1254
1278
|
? function (node) {
|
|
1255
1279
|
var data = node.datum.data;
|
|
1256
1280
|
var label = (data === null || data === void 0 ? void 0 : data.label) || data.id;
|
|
@@ -1265,7 +1289,17 @@ var PieChart = function (_a) {
|
|
|
1265
1289
|
? [
|
|
1266
1290
|
function (props) { return (jsxRuntime.jsx(CenteredItem, __assign({}, props, { theme: themeContext, label: centerItem.label, value: centerItem.value, fontSizeMultiplier: centerItem.fontSizeMultiplier }))); },
|
|
1267
1291
|
]
|
|
1268
|
-
: []), true), activeOuterRadiusOffset: 12 }) })), jsxRuntime.jsx(ChartContainer, __assign({ width: width, height: "auto" }, { children: legend ? (jsxRuntime.jsx(Legend, { colors: colors !== null && colors !== void 0 ? colors : CHARTS_COLOR_SCHEME_CATEGORICAL_8_A, data: data.map(function (d) {
|
|
1292
|
+
: []), true), activeOuterRadiusOffset: 12 }) })), jsxRuntime.jsx(ChartContainer, __assign({ width: width, height: "auto" }, { children: legend ? (jsxRuntime.jsx(Legend, { colors: colors !== null && colors !== void 0 ? colors : CHARTS_COLOR_SCHEME_CATEGORICAL_8_A, data: data.map(function (d) {
|
|
1293
|
+
return labelFormatter
|
|
1294
|
+
? labelFormatter({
|
|
1295
|
+
label: d.label,
|
|
1296
|
+
id: d.id,
|
|
1297
|
+
value: d.value,
|
|
1298
|
+
data: d,
|
|
1299
|
+
labelPosition: "legend",
|
|
1300
|
+
})
|
|
1301
|
+
: d.id.toString();
|
|
1302
|
+
}), columns: typeof legend === "object" && legend.columns
|
|
1269
1303
|
? legend.columns
|
|
1270
1304
|
: undefined, width: typeof legend === "object" && legend.width
|
|
1271
1305
|
? legend.width
|
|
@@ -2419,7 +2453,7 @@ var WorkspacesDropdown = function (props) {
|
|
|
2419
2453
|
};
|
|
2420
2454
|
var templateObject_1$D;
|
|
2421
2455
|
|
|
2422
|
-
var LogoIconContainer = styled__default["default"](reactChrome.HeaderItem)(templateObject_1$C || (templateObject_1$C = __makeTemplateObject(["\n margin-right: 2px;\n border-right: none;\n @media (max-width: ", ") {\n right: 0;\n left: 0;\n margin-right: auto;\n margin-left: auto;\n position: absolute;\n }\n"], ["\n margin-right: 2px;\n border-right: none;\n @media (max-width: ", ") {\n right: 0;\n left: 0;\n margin-right: auto;\n margin-left: auto;\n position: absolute;\n }\n"])), function (_a) {
|
|
2456
|
+
var LogoIconContainer = styled__default["default"](reactChrome.HeaderItem)(templateObject_1$C || (templateObject_1$C = __makeTemplateObject(["\n margin-right: 2px;\n border-right: none;\n cursor: pointer;\n @media (max-width: ", ") {\n right: 0;\n left: 0;\n margin-right: auto;\n margin-left: auto;\n position: absolute;\n }\n"], ["\n margin-right: 2px;\n border-right: none;\n cursor: pointer;\n @media (max-width: ", ") {\n right: 0;\n left: 0;\n margin-right: auto;\n margin-left: auto;\n position: absolute;\n }\n"])), function (_a) {
|
|
2423
2457
|
var theme = _a.theme;
|
|
2424
2458
|
return theme.breakpoints.md;
|
|
2425
2459
|
});
|
|
@@ -2451,7 +2485,8 @@ var MenuItem$1 = styled__default["default"](reactChrome.HeaderItem)(templateObje
|
|
|
2451
2485
|
return theme.breakpoints.md;
|
|
2452
2486
|
});
|
|
2453
2487
|
var BrandItem = function (props) {
|
|
2454
|
-
|
|
2488
|
+
var menuLabel = props.menuLabel, toggleMenu = props.toggleMenu, rest = __rest(props, ["menuLabel", "toggleMenu"]);
|
|
2489
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs(MenuItem$1, __assign({ onClick: toggleMenu }, { children: [jsxRuntime.jsx(HeaderItemIcon, { children: jsxRuntime.jsx(SvgMenuStroke, {}) }), menuLabel && jsxRuntime.jsx(HeaderItemText, { children: menuLabel })] })), jsxRuntime.jsx(LogoIconContainer, __assign({}, rest, { hasLogo: true }, { children: jsxRuntime.jsx(HeaderItemIcon, { children: jsxRuntime.jsx(Logo, { type: "icon", size: 150 }) }) })), props.workspaces && props.workspaces.length > 1 ? (jsxRuntime.jsx(DropdownItem, { children: jsxRuntime.jsx(WorkspacesDropdown, { workspaces: props.workspaces, workspacesLabel: props.workspacesLabel, activeWorkspace: props.activeWorkspace, onWorkspaceChange: props.onWorkspaceChange }) })) : (jsxRuntime.jsx(jsxRuntime.Fragment, { children: props.brandName && (jsxRuntime.jsx(BrandName, __assign({}, props, { children: jsxRuntime.jsx(HeaderItemText, { children: props.brandName }) }))) }))] }));
|
|
2455
2490
|
};
|
|
2456
2491
|
var templateObject_1$C, templateObject_2$j, templateObject_3$f, templateObject_4$b;
|
|
2457
2492
|
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import { BreadcrumbArgs } from
|
|
2
|
-
|
|
3
|
-
* Breadcrumbs mark and communicate a userโs location in the product.
|
|
4
|
-
* <hr>
|
|
5
|
-
* Used for this:
|
|
6
|
-
- To show the user where they are in a nested navigation
|
|
7
|
-
- To provide a quick way to navigate to ancestor pages
|
|
8
|
-
*/
|
|
9
|
-
declare const Breadcrumb: (props: BreadcrumbArgs) => JSX.Element;
|
|
1
|
+
import { BreadcrumbArgs } from "./_types";
|
|
2
|
+
declare const Breadcrumb: ({ children, showLastArrow, ...props }: BreadcrumbArgs) => JSX.Element;
|
|
10
3
|
export { Breadcrumb };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentMeta, Story } from "@storybook/react";
|
|
2
2
|
import { BreadcrumbArgs } from "./_types";
|
|
3
3
|
export declare const Default: Story<BreadcrumbArgs>;
|
|
4
|
-
declare const _default: ComponentMeta<(props: BreadcrumbArgs) => JSX.Element>;
|
|
4
|
+
declare const _default: ComponentMeta<({ children, showLastArrow, ...props }: BreadcrumbArgs) => JSX.Element>;
|
|
5
5
|
export default _default;
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { PieSvgProps } from "@nivo/pie";
|
|
2
2
|
import { ChartTooltipFunction } from "../_types";
|
|
3
3
|
import { LegendType } from "../Legend";
|
|
4
|
+
declare type BasicPieDatum = {
|
|
5
|
+
id: string | number;
|
|
6
|
+
label?: string | number;
|
|
7
|
+
value: number;
|
|
8
|
+
};
|
|
4
9
|
declare type PieDatum = {
|
|
5
|
-
id: string;
|
|
6
|
-
label?: string;
|
|
10
|
+
id: string | number;
|
|
11
|
+
label?: string | number;
|
|
7
12
|
value: number;
|
|
8
13
|
} & {
|
|
9
14
|
[key: string]: string | number | undefined;
|
|
@@ -23,5 +28,9 @@ export interface PieChartProps {
|
|
|
23
28
|
tooltip?: ChartTooltipFunction;
|
|
24
29
|
legend?: LegendType | true;
|
|
25
30
|
arcLinkLabelsSkipAngle?: number;
|
|
31
|
+
labelFormatter?: (data: BasicPieDatum & {
|
|
32
|
+
labelPosition: "arclink" | "legend";
|
|
33
|
+
data?: PieDatum;
|
|
34
|
+
}) => string;
|
|
26
35
|
}
|
|
27
36
|
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { PieChartProps } from "./_types";
|
|
2
|
-
declare const PieChart: ({ theme, colors, width, height, data, centerItem, margin, tooltip, legend, arcLinkLabelsSkipAngle, }: PieChartProps) => JSX.Element;
|
|
2
|
+
declare const PieChart: ({ theme, colors, width, height, data, centerItem, margin, tooltip, legend, arcLinkLabelsSkipAngle, labelFormatter, }: PieChartProps) => JSX.Element;
|
|
3
3
|
export { PieChart };
|
|
@@ -2,5 +2,6 @@ import { ComponentMeta, Story } from "@storybook/react";
|
|
|
2
2
|
import { PieChartProps } from "./_types";
|
|
3
3
|
export declare const Default: Story<PieChartProps>;
|
|
4
4
|
export declare const WithCustomTooltip: Story<PieChartProps>;
|
|
5
|
-
declare const
|
|
5
|
+
export declare const WithCustomLabel: Story<PieChartProps>;
|
|
6
|
+
declare const _default: ComponentMeta<({ theme, colors, width, height, data, centerItem, margin, tooltip, legend, arcLinkLabelsSkipAngle, labelFormatter, }: PieChartProps) => JSX.Element>;
|
|
6
7
|
export default _default;
|