@appquality/unguess-design-system 2.12.30 → 2.12.31

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.31 (Tue Nov 15 2022)
2
+
3
+ #### 🐛 Bug Fix
4
+
5
+ - fix(bullet chart): tooltip & theme [#105](https://github.com/AppQuality/unguess-design-system/pull/105) ([@iacopolea](https://github.com/iacopolea) [@marcbon](https://github.com/marcbon))
6
+
7
+ #### Authors: 2
8
+
9
+ - Iacopo Leardini ([@iacopolea](https://github.com/iacopolea))
10
+ - Marco Bonomo ([@marcbon](https://github.com/marcbon))
11
+
12
+ ---
13
+
1
14
  # v2.12.30 (Tue Nov 15 2022)
2
15
 
3
16
  #### 🐛 Bug Fix
package/build/index.js CHANGED
@@ -18,6 +18,7 @@ var reactLoaders = require('@zendeskgarden/react-loaders');
18
18
  var reactTypography = require('@zendeskgarden/react-typography');
19
19
  var bar = require('@nivo/bar');
20
20
  var bullet = require('@nivo/bullet');
21
+ var web = require('@react-spring/web');
21
22
  var pie = require('@nivo/pie');
22
23
  var stream = require('@nivo/stream');
23
24
  var sunburst = require('@nivo/sunburst');
@@ -1124,34 +1125,39 @@ var BarChart = function (_a) {
1124
1125
  return (jsxRuntime.jsx(ChartContainer, __assign({ width: width, height: height }, { children: jsxRuntime.jsx(bar.ResponsiveBar, __assign({ theme: __assign(__assign({}, DEFAULT_CHARTS_THEME), theme), colors: colors !== null && colors !== void 0 ? colors : CHARTS_COLOR_SCHEME_CATEGORICAL_5, enableLabel: false }, props)) })));
1125
1126
  };
1126
1127
 
1127
- var CustomBulletChartMarker = function (_a) {
1128
- var x = _a.x, y = _a.y, bulletRadius = _a.bulletRadius, fill = _a.fill, size = _a.size;
1129
- return (jsxRuntime.jsx("circle", { r: bulletRadius, fill: fill, transform: "translate(".concat(x, ",").concat(y, ") scale(").concat(size, ")") }));
1128
+ var CustomBulletChartMarkers = function (_a) {
1129
+ var x = _a.x, y = _a.y, size = _a.size, _b = _a.animatedProps, color = _b.color, transform = _b.transform, data = _a.data, onMouseEnter = _a.onMouseEnter, onMouseMove = _a.onMouseMove, onMouseLeave = _a.onMouseLeave, onClick = _a.onClick;
1130
+ return (jsxRuntime.jsx(web.animated.circle, { transform: transform, cx: x, cy: y, fill: color, stroke: color, r: size,
1131
+ // @ts-ignore onMouseMove event for circle is not supported, but it works
1132
+ onMouseMove: function (event) { return onMouseMove(data, event); },
1133
+ // @ts-ignore onMouseEnter event for circle is not supported, but it works
1134
+ onMouseEnter: function (event) { return onMouseEnter(data, event); },
1135
+ // @ts-ignore onMouseLeave event for circle is not supported, but it works
1136
+ onMouseLeave: function (event) { return onMouseLeave(data, event); },
1137
+ // @ts-ignore onClick event for circle is not supported, but it works
1138
+ onClick: function (event) { return onClick(data, event); } }));
1130
1139
  };
1131
1140
 
1132
- var CustomBulletChartRange = function (_a) {
1133
- var x = _a.x, y = _a.y, width = _a.width, height = _a.height, fill = _a.fill;
1134
- return (jsxRuntime.jsx("rect", { x: x, y: y, width: width - 2, height: height, fill: fill }));
1141
+ var CustomMeasure = function (_a) {
1142
+ var x = _a.x, y = _a.y, width = _a.width, height = _a.height; _a.color;
1143
+ return (jsxRuntime.jsx("rect", { x: x + 2, y: y + 2, width: width - 4, height: height - 4, fill: chartColors.darkGrey }));
1135
1144
  };
1136
1145
 
1137
1146
  var UgBulletChart = styled__default["default"](bullet.ResponsiveBullet)(templateObject_1$15 || (templateObject_1$15 = __makeTemplateObject(["\n width: 100%;\n height: 100%;\n"], ["\n width: 100%;\n height: 100%;\n"])));
1138
1147
  var BulletChart = function (_a) {
1139
- var width = _a.width, height = _a.height, ranges = _a.ranges, values = _a.values, markerColor = _a.markerColor, markerSize = _a.markerSize, rangeColor = _a.rangeColor, measureSize = _a.measureSize, measureColor = _a.measureColor, props = __rest(_a, ["width", "height", "ranges", "values", "markerColor", "markerSize", "rangeColor", "measureSize", "measureColor"]);
1140
- var rangesCount = ranges.length;
1141
- return (jsxRuntime.jsx(ChartContainer, __assign({ width: width, height: height }, { children: jsxRuntime.jsx(UgBulletChart, __assign({ data: [{
1148
+ var width = _a.width, height = _a.height, ranges = _a.ranges, values = _a.values;
1149
+ return (jsxRuntime.jsx(ChartContainer, __assign({ width: width, height: height, id: "ciolla" }, { children: jsxRuntime.jsx(UgBulletChart, { theme: DEFAULT_CHARTS_THEME, data: [
1150
+ {
1142
1151
  id: "",
1143
1152
  title: "",
1144
1153
  ranges: ranges,
1145
1154
  measures: values,
1146
1155
  markers: values,
1147
- }], measureColors: measureColor !== null && measureColor !== void 0 ? measureColor : chartColors.darkGrey, measureSize: measureSize !== null && measureSize !== void 0 ? measureSize : 0.2, markerComponent: function (_a) {
1156
+ },
1157
+ ], measureComponent: CustomMeasure, markerColors: chartColors.darkPine, markerComponent: function (_a) {
1148
1158
  _a.size; var markerProps = __rest(_a, ["size"]);
1149
- return (jsxRuntime.jsx(CustomBulletChartMarker, __assign({ bulletRadius: 4, fill: markerColor !== null && markerColor !== void 0 ? markerColor : chartColors.darkPine, size: markerSize !== null && markerSize !== void 0 ? markerSize : 1 }, markerProps)));
1150
- }, rangeComponent: function (_a) {
1151
- var index = _a.index, width = _a.width, rangeProps = __rest(_a, ["index", "width"]);
1152
- var isLast = index === rangesCount - 1;
1153
- return (jsxRuntime.jsx(CustomBulletChartRange, __assign({ fill: rangeColor !== null && rangeColor !== void 0 ? rangeColor : chartColors.lightGrey }, rangeProps, { width: isLast ? width + 2 : width })));
1154
- }, margin: { top: 0, right: 10, bottom: -1, left: 10 } }, props)) })));
1159
+ return (jsxRuntime.jsx(CustomBulletChartMarkers, __assign({}, markerProps, { size: 4 })));
1160
+ }, rangeColors: chartColors.lightGrey, rangeBorderColor: "white", rangeBorderWidth: 2, margin: { top: 0, right: 10, bottom: -1, left: 10 } }) })));
1155
1161
  };
1156
1162
  var templateObject_1$15;
1157
1163
 
@@ -1,9 +1,2 @@
1
- interface CustomBulletChartMarkerProps {
2
- x: number;
3
- y: number;
4
- bulletRadius: number;
5
- fill: string;
6
- size: number;
7
- }
8
- export declare const CustomBulletChartMarker: ({ x, y, bulletRadius, fill, size, }: CustomBulletChartMarkerProps) => JSX.Element;
9
- export {};
1
+ import { BulletMarkersItemProps } from "@nivo/bullet";
2
+ export declare const CustomBulletChartMarkers: ({ x, y, size, animatedProps: { color, transform }, data, onMouseEnter, onMouseMove, onMouseLeave, onClick, }: BulletMarkersItemProps) => JSX.Element;
@@ -0,0 +1,8 @@
1
+ export interface CustomBulletChartMeasureProps {
2
+ x: number;
3
+ y: number;
4
+ color: string;
5
+ width: number;
6
+ height: number;
7
+ }
8
+ export declare const CustomMeasure: ({ x, y, width, height, color }: CustomBulletChartMeasureProps) => JSX.Element;
@@ -3,9 +3,4 @@ export interface BulletChartProps {
3
3
  values: number[];
4
4
  width?: string;
5
5
  height?: string;
6
- markerColor?: string;
7
- markerSize?: number;
8
- rangeColor?: string;
9
- measureSize?: number;
10
- measureColor?: string;
11
6
  }
@@ -1,3 +1,3 @@
1
1
  import { BulletChartProps } from "./_types";
2
- declare const BulletChart: ({ width, height, ranges, values, markerColor, markerSize, rangeColor, measureSize, measureColor, ...props }: BulletChartProps) => JSX.Element;
2
+ declare const BulletChart: ({ width, height, ranges, values }: BulletChartProps) => JSX.Element;
3
3
  export { BulletChart };
@@ -2,5 +2,5 @@ import { ComponentMeta, Story } from "@storybook/react";
2
2
  import { BulletChartProps } from "./_types";
3
3
  export declare const Default: Story<BulletChartProps>;
4
4
  export declare const Widget: Story<BulletChartProps>;
5
- declare const _default: ComponentMeta<({ width, height, ranges, values, markerColor, markerSize, rangeColor, measureSize, measureColor, ...props }: BulletChartProps) => JSX.Element>;
5
+ declare const _default: ComponentMeta<({ width, height, ranges, values }: BulletChartProps) => JSX.Element>;
6
6
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appquality/unguess-design-system",
3
- "version": "2.12.30",
3
+ "version": "2.12.31",
4
4
  "dependencies": {
5
5
  "@nivo/bar": "^0.80.0",
6
6
  "@nivo/bullet": "^0.80.0",
@@ -1,8 +0,0 @@
1
- export interface CustomBulletChartRangeProps {
2
- x: number;
3
- y: number;
4
- width: number;
5
- height: number;
6
- fill: string;
7
- }
8
- export declare const CustomBulletChartRange: ({ x, y, width, height, fill }: CustomBulletChartRangeProps) => JSX.Element;