@appquality/unguess-design-system 2.12.27 → 2.12.29

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 CHANGED
@@ -1,3 +1,28 @@
1
+ # v2.12.29 (Tue Nov 15 2022)
2
+
3
+ #### ⚠️ Pushed to `master`
4
+
5
+ - fix(halfpie): Make toplevel component relative instead of absolute ([@d-beezee](https://github.com/d-beezee))
6
+
7
+ #### Authors: 1
8
+
9
+ - [@d-beezee](https://github.com/d-beezee)
10
+
11
+ ---
12
+
13
+ # v2.12.28 (Tue Nov 15 2022)
14
+
15
+ #### 🐛 Bug Fix
16
+
17
+ - Waffle refactor [#104](https://github.com/AppQuality/unguess-design-system/pull/104) (gianpaolo.sinatra@app-quality.com [@marcbon](https://github.com/marcbon))
18
+
19
+ #### Authors: 2
20
+
21
+ - Gianpaolo Sinatra ([@sinatragianpaolo](https://github.com/sinatragianpaolo))
22
+ - Marco Bonomo ([@marcbon](https://github.com/marcbon))
23
+
24
+ ---
25
+
1
26
  # v2.12.22 (Mon Nov 14 2022)
2
27
 
3
28
  #### 🐛 Bug Fix
package/build/index.js CHANGED
@@ -1088,6 +1088,10 @@ var chartColors = {
1088
1088
  orchidea: "#B75CAD",
1089
1089
  sky: "#3392CE",
1090
1090
  };
1091
+ var CHARTS_COLOR_SCHEME_MONO = [
1092
+ chartColors.darkPine,
1093
+ chartColors.lightGrey,
1094
+ ];
1091
1095
  var CHARTS_COLOR_SCHEME_CATEGORICAL_5 = [
1092
1096
  chartColors.greenLight,
1093
1097
  chartColors.blue,
@@ -1212,7 +1216,7 @@ var HalfPieChart = function (_a) {
1212
1216
  return newColors;
1213
1217
  };
1214
1218
  var _b = React.useState(grayOutColors(0)), currentColors = _b[0], setCurrentColors = _b[1];
1215
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(HalfPieChartComponent, { theme: theme, colors: currentColors, width: width, height: height, data: data, onMouseEnter: function (data) {
1219
+ return (jsxRuntime.jsxs("div", __assign({ style: { width: width, height: height, position: "relative" } }, { children: [jsxRuntime.jsx(HalfPieChartComponent, { theme: theme, colors: currentColors, width: "100%", height: height, data: data, onMouseEnter: function (data) {
1216
1220
  setCurrentColors(grayOutColors(data.arc.index));
1217
1221
  }, onMouseLeave: function () {
1218
1222
  setCurrentColors(grayOutColors(0));
@@ -1220,7 +1224,7 @@ var HalfPieChart = function (_a) {
1220
1224
  setCurrentColors(grayOutColors(data.arc.index));
1221
1225
  }, onMouseLeave: function () {
1222
1226
  setCurrentColors(grayOutColors(0));
1223
- }, mode: "back" })] }));
1227
+ }, mode: "back" })] })));
1224
1228
  };
1225
1229
 
1226
1230
  var StreamChart = function (_a) {
@@ -1249,10 +1253,24 @@ var CustomCell = function (_a) {
1249
1253
  };
1250
1254
 
1251
1255
  var WaffleChart = function (_a) {
1252
- var theme = _a.theme, colors = _a.colors, height = _a.height, width = _a.width, props = __rest(_a, ["theme", "colors", "height", "width"]);
1253
- return (jsxRuntime.jsx(ChartContainer, __assign({ width: width, height: height }, { children: jsxRuntime.jsx(waffle.ResponsiveWaffle, __assign({ theme: __assign(__assign({}, DEFAULT_CHARTS_THEME), theme), colors: colors !== null && colors !== void 0 ? colors : CHARTS_COLOR_SCHEME_CATEGORICAL_5, motionStiffness: 90, motionDamping: 11,
1256
+ var height = _a.height, width = _a.width, data = _a.data, total = _a.total;
1257
+ return (jsxRuntime.jsx(ChartContainer, __assign({ width: width, height: height }, { children: jsxRuntime.jsx(waffle.ResponsiveWaffle, { theme: DEFAULT_CHARTS_THEME, data: [
1258
+ {
1259
+ id: "green-circles",
1260
+ label: data.label,
1261
+ value: data.value,
1262
+ },
1263
+ {
1264
+ id: "grey-circles",
1265
+ label: total.label,
1266
+ value: total.value,
1267
+ },
1268
+ ], fillDirection: "bottom", total: total.value, rows: 8, columns: 8, colors: CHARTS_COLOR_SCHEME_MONO,
1254
1269
  // @ts-ignore property cellComponent does not exist, but it does
1255
- cellComponent: CustomCell }, props)) })));
1270
+ cellComponent: function (_a) {
1271
+ _a.borderWidth; _a.borderColor; var rest = __rest(_a, ["borderWidth", "borderColor"]);
1272
+ return (jsxRuntime.jsx(CustomCell, __assign({ borderWidth: 2, borderColor: "white" }, rest)));
1273
+ } }) })));
1256
1274
  };
1257
1275
 
1258
1276
  var UgClose = styled__default["default"](reactNotifications.Close)(templateObject_1$13 || (templateObject_1$13 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n width: ", ";\n height: ", ";\n"], ["\n display: flex;\n align-items: center;\n justify-content: center;\n width: ", ";\n height: ", ";\n"])), function (_a) {
@@ -1,6 +1,11 @@
1
- import { WaffleDatum, WaffleSvgProps } from "@nivo/waffle";
2
- export interface WaffleChartProps extends Omit<WaffleSvgProps, "width" | "height"> {
3
- data: WaffleDatum[];
1
+ interface WaffleDataItem {
2
+ label: string;
3
+ value: number;
4
+ }
5
+ export interface WaffleChartProps {
6
+ data: WaffleDataItem;
7
+ total: WaffleDataItem;
4
8
  width?: string;
5
9
  height?: string;
6
10
  }
11
+ export {};
@@ -1,3 +1,3 @@
1
1
  import { WaffleChartProps } from "./_types";
2
- declare const WaffleChart: ({ theme, colors, height, width, ...props }: WaffleChartProps) => JSX.Element;
2
+ declare const WaffleChart: ({ height, width, data, total }: WaffleChartProps) => JSX.Element;
3
3
  export { WaffleChart };
@@ -1,5 +1,5 @@
1
1
  import { ComponentMeta, Story } from "@storybook/react";
2
2
  import { WaffleChartProps } from "./_types";
3
3
  export declare const Default: Story<WaffleChartProps>;
4
- declare const _default: ComponentMeta<({ theme, colors, height, width, ...props }: WaffleChartProps) => JSX.Element>;
4
+ declare const _default: ComponentMeta<({ height, width, data, total }: WaffleChartProps) => JSX.Element>;
5
5
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appquality/unguess-design-system",
3
- "version": "2.12.27",
3
+ "version": "2.12.29",
4
4
  "dependencies": {
5
5
  "@nivo/bar": "^0.80.0",
6
6
  "@nivo/bullet": "^0.80.0",