@appquality/unguess-design-system 2.12.26 → 2.12.28

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,16 @@
1
+ # v2.12.28 (Tue Nov 15 2022)
2
+
3
+ #### 🐛 Bug Fix
4
+
5
+ - Waffle refactor [#104](https://github.com/AppQuality/unguess-design-system/pull/104) (gianpaolo.sinatra@app-quality.com [@marcbon](https://github.com/marcbon))
6
+
7
+ #### Authors: 2
8
+
9
+ - Gianpaolo Sinatra ([@sinatragianpaolo](https://github.com/sinatragianpaolo))
10
+ - Marco Bonomo ([@marcbon](https://github.com/marcbon))
11
+
12
+ ---
13
+
1
14
  # v2.12.22 (Mon Nov 14 2022)
2
15
 
3
16
  #### 🐛 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,
@@ -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.26",
3
+ "version": "2.12.28",
4
4
  "dependencies": {
5
5
  "@nivo/bar": "^0.80.0",
6
6
  "@nivo/bullet": "^0.80.0",