@wonderflow/react-components 12.5.2 → 12.6.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.
@@ -15,7 +15,7 @@ const story = {
15
15
  control: { type: 'radio' },
16
16
  },
17
17
  color: {
18
- options: ['gray', 'cyan', 'green', 'purple', 'yellow', 'red', 'blue'],
18
+ options: ['blue', 'cyan', 'dipsy', 'gray', 'green', 'indigo', 'magenta', 'purple', 'red', 'salmon', 'violet', 'yellow'],
19
19
  control: { type: 'select' },
20
20
  },
21
21
  },
@@ -14,10 +14,9 @@ export const ProductCardKpis = forwardRef(({ rating, feedbackCount, votesCount,
14
14
  iconColor: isGreaterThan(3.99, rating) ? `hsl(${tkns.color.yellow['30']})` : undefined,
15
15
  },
16
16
  {
17
- property: 'sentiment',
18
- value: formatKpiValue(sentiment, { decimal: 2, minRange: -1, maxRange: 1 }),
19
- icon: 'hearts-suit',
20
- iconColor: isGreaterThan(0.5, sentiment) ? 'var(--highlight-red-foreground)' : undefined,
17
+ property: 'nps',
18
+ value: formatKpiValue(nps, { decimal: 0, minRange: -100, maxRange: 100 }),
19
+ icon: 'nps',
21
20
  },
22
21
  {
23
22
  property: 'feedback-count',
@@ -36,14 +35,10 @@ export const ProductCardKpis = forwardRef(({ rating, feedbackCount, votesCount,
36
35
  icon: 'votes-count',
37
36
  },
38
37
  {
39
- property: 'nps',
40
- value: formatKpiValue(nps, { decimal: 0, minRange: -100, maxRange: 100 }),
41
- icon: 'nps',
42
- },
43
- {
44
- property: 'groups',
45
- value: formatKpiValue(groups),
46
- icon: 'grid',
38
+ property: 'sentiment',
39
+ value: formatKpiValue(sentiment, { decimal: 2, minRange: -1, maxRange: 1 }),
40
+ icon: 'hearts-suit',
41
+ iconColor: isGreaterThan(0.5, sentiment) ? 'var(--highlight-red-foreground)' : undefined,
47
42
  },
48
43
  {
49
44
  property: 'tgw',
@@ -55,6 +50,11 @@ export const ProductCardKpis = forwardRef(({ rating, feedbackCount, votesCount,
55
50
  value: formatPriceRangeValues(priceMin, priceMax, { currency, decimals: currencyDecimals }),
56
51
  icon: 'tags',
57
52
  },
53
+ {
54
+ property: 'groups',
55
+ value: formatKpiValue(groups),
56
+ icon: 'grid',
57
+ },
58
58
  {
59
59
  property: 'users',
60
60
  value: formatKpiValue(users, { decimal: 0, minRange: 0, cap: usersCap }),
@@ -3,6 +3,7 @@ import { ProductCard } from './product-card';
3
3
  declare const story: ComponentMeta<typeof ProductCard>;
4
4
  export default story;
5
5
  export declare const Default: ComponentStory<import("./product-card").ProductCardComponent>;
6
+ export declare const withFewKpis: ComponentStory<import("./product-card").ProductCardComponent>;
6
7
  export declare const withOverlayActions: ComponentStory<import("./product-card").ProductCardComponent>;
7
8
  export declare const withMenuActions: ComponentStory<import("./product-card").ProductCardComponent>;
8
9
  export declare const clickable: ComponentStory<import("./product-card").ProductCardComponent>;
@@ -1 +1 @@
1
- {"version":3,"file":"product-card.stories.d.ts","sourceRoot":"","sources":["../../../src/components/product-card/product-card.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAQjE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AA4C7C,QAAA,MAAM,KAAK,EAAE,aAAa,CAAC,OAAO,WAAW,CAwD5C,CAAC;AAEF,eAAe,KAAK,CAAC;AAQrB,eAAO,MAAM,OAAO,+DAAoB,CAAC;AAGzC,eAAO,MAAM,kBAAkB,+DAAoB,CAAC;AAKpD,eAAO,MAAM,eAAe,+DAAoB,CAAC;AAKjD,eAAO,MAAM,SAAS,+DAAoB,CAAC;AAK3C,eAAO,MAAM,oBAAoB,+DAAoB,CAAC;AAKtD,eAAO,MAAM,eAAe,+DAAoB,CAAC;AAKjD,eAAO,MAAM,WAAW,+DAAoB,CAAC"}
1
+ {"version":3,"file":"product-card.stories.d.ts","sourceRoot":"","sources":["../../../src/components/product-card/product-card.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAQjE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AA4C7C,QAAA,MAAM,KAAK,EAAE,aAAa,CAAC,OAAO,WAAW,CAwD5C,CAAC;AAEF,eAAe,KAAK,CAAC;AAQrB,eAAO,MAAM,OAAO,+DAAoB,CAAC;AAGzC,eAAO,MAAM,WAAW,+DAAoB,CAAC;AAkB7C,eAAO,MAAM,kBAAkB,+DAAoB,CAAC;AAKpD,eAAO,MAAM,eAAe,+DAAoB,CAAC;AAKjD,eAAO,MAAM,SAAS,+DAAoB,CAAC;AAK3C,eAAO,MAAM,oBAAoB,+DAAoB,CAAC;AAKtD,eAAO,MAAM,eAAe,+DAAoB,CAAC;AAKjD,eAAO,MAAM,WAAW,+DAAoB,CAAC"}
@@ -20,22 +20,22 @@ const story = {
20
20
  titleRows: 3,
21
21
  subtitle: 'subtitle',
22
22
  rating: 4.3,
23
- sentiment: 0.48,
23
+ nps: 23,
24
24
  feedbackCount: 123,
25
- votesCount: 3456,
26
25
  votesRating: 2.3,
27
- nps: 23,
28
- groups: 4,
26
+ votesCount: 3456,
27
+ sentiment: 0.54,
29
28
  tgw: 0.75,
30
29
  priceMin: 33,
31
30
  priceMax: 45,
32
31
  currency: 'EUR',
33
32
  currencyDecimals: 0,
33
+ groups: 4,
34
34
  users: 789,
35
35
  usersCap: 1000,
36
36
  skus: 2,
37
37
  skusCap: 1000,
38
- kpiItems: 3,
38
+ kpiItems: 11,
39
39
  kpisRowGap: 8,
40
40
  isLoading: false,
41
41
  ratio: '1',
@@ -73,6 +73,23 @@ const Template = (args) => {
73
73
  };
74
74
  export const Default = Template.bind({});
75
75
  Default.args = {};
76
+ export const withFewKpis = Template.bind({});
77
+ withFewKpis.args = {
78
+ rating: 4.3,
79
+ nps: undefined,
80
+ feedbackCount: 123,
81
+ votesRating: undefined,
82
+ votesCount: undefined,
83
+ sentiment: 0.54,
84
+ tgw: undefined,
85
+ priceMin: undefined,
86
+ priceMax: undefined,
87
+ groups: undefined,
88
+ users: undefined,
89
+ usersCap: undefined,
90
+ skus: undefined,
91
+ skusCap: undefined,
92
+ };
76
93
  export const withOverlayActions = Template.bind({});
77
94
  withOverlayActions.args = {
78
95
  overlayActions: OverlayButtons,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wonderflow/react-components",
3
- "version": "12.5.2",
3
+ "version": "12.6.0",
4
4
  "description": "UI components from Wonderflow's Wanda design system",
5
5
  "author": "Wonderflow",
6
6
  "license": "Apache-2.0",
@@ -82,8 +82,8 @@
82
82
  "@types/react-dom": "17.0.14",
83
83
  "@types/react-table": "7.7.12",
84
84
  "@types/react-test-renderer": "18.0.0",
85
- "@wonderflow/config": "12.5.2",
86
- "@wonderflow/tokens": "12.5.2",
85
+ "@wonderflow/config": "12.6.0",
86
+ "@wonderflow/tokens": "12.6.0",
87
87
  "babel-loader": "8.2.5",
88
88
  "cpy-cli": "3.1.1",
89
89
  "postcss": "8.4.17",