@wonderflow/react-components 12.11.0 → 14.0.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.
@@ -1 +1 @@
1
- @layer components{.CircularProgress{--hue:220;--track-size:4px;--track-bg:var(--dimmed-1);aspect-ratio:1/1;display:grid;font-size:1rem;font-weight:token(--wds-wds-font-weight-bold);inline-size:4rem;min-inline-size:64px;place-items:center;position:relative}.CircularProgress[data-circular-progress-show-progress=true]:after{content:attr(data-circular-progress);display:block}.CircularProgress[data-circular-progress-dimension=regular]{--track-size:8px;font-size:1.75rem;inline-size:8.5rem}.CircularProgress[data-circular-progress-dimension=big]{--track-size:16px;font-size:2.5rem;inline-size:11.5rem}.CircularProgress:before{background:conic-gradient(var(--progress-color,var(--cta-default)),var(--progress-color,var(--cta-default)) var(--progress,0),var(--track-bg) var(--progress,0) 100%);border-radius:50%;bottom:0;content:"";left:0;-webkit-mask-image:radial-gradient(transparent calc(71% - var(--track-size)),#000 calc(71% - var(--track-size) + .5px));mask-image:radial-gradient(transparent calc(71% - var(--track-size)),#000 calc(71% - var(--track-size) + .5px));position:absolute;right:0;top:0;z-index:0}}
1
+ @layer components{.CircularProgress{--hue:220;--track-size:4px;--track-bg:var(--dimmed-1);aspect-ratio:1/1;display:grid;font-size:1rem;font-weight:token(--wds-wds-font-weight-bold);inline-size:4rem;min-inline-size:64px;place-items:center;position:relative}.CircularProgress[data-circular-progress-show-progress=true]:after{content:attr(data-circular-progress);display:block}.CircularProgress[data-circular-progress-dimension=regular]{--track-size:8px;font-size:1.75rem;inline-size:8.5rem}.CircularProgress[data-circular-progress-dimension=big]{--track-size:16px;font-size:2.5rem;inline-size:11.5rem}.CircularProgress:before{background:conic-gradient(var(--progress-color,var(--cta-default)),var(--progress-color,var(--cta-default)) var(--progress,0),var(--track-bg) var(--progress,0) 100%);border-radius:50%;bottom:0;content:"";left:0;mask-image:radial-gradient(transparent calc(71% - var(--track-size)),#000 calc(71% - var(--track-size) + .5px));position:absolute;right:0;top:0;z-index:0}}
@@ -1 +1 @@
1
- @layer components{.Expander{--threshold:3rem;position:relative}.Content{-webkit-mask-image:linear-gradient(to bottom,red calc(100% - var(--threshold)*1.5),transparent 80%);mask-image:linear-gradient(to bottom,red calc(100% - var(--threshold)*1.5),transparent 80%);overflow:hidden}.Expander[data-expander-collapsed=false] .Content{height:auto;-webkit-mask-image:none;mask-image:none}.Action{margin-top:calc(var(--threshold)*-1)}.Expander[data-expander-collapsed=false] .Action{margin-top:1rem}}
1
+ @layer components{.Expander{--threshold:3rem;position:relative}.Content{mask-image:linear-gradient(to bottom,red calc(100% - var(--threshold)*1.5),transparent 80%);overflow:hidden}.Expander[data-expander-collapsed=false] .Content{height:auto;mask-image:none}.Action{margin-top:calc(var(--threshold)*-1)}.Expander[data-expander-collapsed=false] .Action{margin-top:1rem}}
@@ -26,11 +26,13 @@ describe('<ProductCard>', () => {
26
26
  expect(container).not.toBeNull();
27
27
  });
28
28
  test('it should render properly with on click', () => {
29
- const { container } = render(_jsx(ProductCard, { title: "title", subtitle: "subtitle", source: SourceImages, direction: "horizontal", rating: 1.2, feedbackCount: 1.2, votesCount: 1.2, onClick: () => console.log('clicked') }));
29
+ const spyOnClick = jest.fn();
30
+ const { container } = render(_jsx(ProductCard, { title: "title", subtitle: "subtitle", source: SourceImages, direction: "horizontal", rating: 1.2, feedbackCount: 1.2, votesCount: 1.2, onClick: spyOnClick }));
30
31
  expect(container).not.toBeNull();
31
32
  });
32
33
  test('it should render properly with children', () => {
33
- const { container } = render(_jsx(ProductCard, { title: "title", subtitle: "subtitle", source: SourceImages, direction: "horizontal", rating: 1.2, feedbackCount: 1.2, votesCount: 1.2, onClick: () => console.log('clicked'), footer: _jsx("div", { children: "some content" }), children: _jsx("div", { children: "some content" }) }));
34
+ const spyOnClick = jest.fn();
35
+ const { container } = render(_jsx(ProductCard, { title: "title", subtitle: "subtitle", source: SourceImages, direction: "horizontal", rating: 1.2, feedbackCount: 1.2, votesCount: 1.2, onClick: spyOnClick, footer: _jsx("div", { children: "some content" }), children: _jsx("div", { children: "some content" }) }));
34
36
  expect(container).not.toBeNull();
35
37
  });
36
38
  });
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Wonderflow Design Team
2
+ * Copyright 2023-2024 Wonderflow Design Team
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@ export const channels = [
20
20
  '2 stars': 51,
21
21
  '3 stars': 66,
22
22
  '4 stars': 157,
23
- '5 stars': 1500,
23
+ '5 stars': 150,
24
24
  },
25
25
  {
26
26
  channel: 'amazon.co.uk',
@@ -36,7 +36,7 @@ export const channels = [
36
36
  '2 stars': 284,
37
37
  '3 stars': 370,
38
38
  '4 stars': 866,
39
- '5 stars': 8302,
39
+ '5 stars': 830,
40
40
  },
41
41
  {
42
42
  channel: 'amazon.com.au',
@@ -100,7 +100,7 @@ export const channels = [
100
100
  '2 stars': 236,
101
101
  '3 stars': 529,
102
102
  '4 stars': 3217,
103
- '5 stars': 35541,
103
+ '5 stars': 3554,
104
104
  },
105
105
  {
106
106
  channel: 'bestbuy.ca',
@@ -108,7 +108,7 @@ export const channels = [
108
108
  '2 stars': 242,
109
109
  '3 stars': 562,
110
110
  '4 stars': 3548,
111
- '5 stars': 38635,
111
+ '5 stars': 3863,
112
112
  },
113
113
  {
114
114
  channel: 'canadiantire.ca',
@@ -116,7 +116,7 @@ export const channels = [
116
116
  '2 stars': 193,
117
117
  '3 stars': 468,
118
118
  '4 stars': 3108,
119
- '5 stars': 34484,
119
+ '5 stars': 3448,
120
120
  },
121
121
  {
122
122
  channel: 'darty.com',
@@ -132,7 +132,7 @@ export const channels = [
132
132
  '2 stars': 181,
133
133
  '3 stars': 452,
134
134
  '4 stars': 2984,
135
- '5 stars': 33501,
135
+ '5 stars': 3350,
136
136
  },
137
137
  {
138
138
  channel: 'otto.de',
@@ -156,7 +156,7 @@ export const channels = [
156
156
  '2 stars': 206,
157
157
  '3 stars': 484,
158
158
  '4 stars': 3264,
159
- '5 stars': 36357,
159
+ '5 stars': 3635,
160
160
  },
161
161
  {
162
162
  channel: 'wayfair.com',
@@ -164,7 +164,7 @@ export const channels = [
164
164
  '2 stars': 64,
165
165
  '3 stars': 120,
166
166
  '4 stars': 588,
167
- '5 stars': 7663,
167
+ '5 stars': 766,
168
168
  },
169
169
  ];
170
170
  export const channelsB = [
@@ -3,6 +3,7 @@ export declare const feedbackCount: {
3
3
  overlay: number;
4
4
  'feedback count': number;
5
5
  extraData: null;
6
+ overlayB: number;
6
7
  }[];
7
8
  export declare const feedbackCountGaps: ({
8
9
  date: string;
@@ -1 +1 @@
1
- {"version":3,"file":"feedbackCount.d.ts","sourceRoot":"","sources":["../../../../src/examples/charts/mock-data/feedbackCount.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,aAAa;;;;;GAqIzB,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;IAqI7B,CAAC"}
1
+ {"version":3,"file":"feedbackCount.d.ts","sourceRoot":"","sources":["../../../../src/examples/charts/mock-data/feedbackCount.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,aAAa;;;;;;GA2JzB,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;IAqI7B,CAAC"}
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Wonderflow Design Team
2
+ * Copyright 2023-2024 Wonderflow Design Team
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -19,132 +19,154 @@ export const feedbackCount = [
19
19
  overlay: 0.1,
20
20
  'feedback count': 16,
21
21
  extraData: null,
22
+ overlayB: 0.31,
22
23
  },
23
24
  {
24
25
  date: '2003',
25
26
  overlay: 0.11,
26
27
  'feedback count': 30,
27
28
  extraData: null,
29
+ overlayB: 0.1,
28
30
  },
29
31
  {
30
32
  date: '2004',
31
33
  overlay: 0.14,
32
34
  'feedback count': 20,
33
35
  extraData: null,
36
+ overlayB: 0.43,
34
37
  },
35
38
  {
36
39
  date: '2005',
37
40
  overlay: 0.13,
38
41
  'feedback count': 52,
39
42
  extraData: null,
43
+ overlayB: 0.33,
40
44
  },
41
45
  {
42
46
  date: '2006',
43
47
  overlay: 0.14,
44
48
  'feedback count': 131,
45
49
  extraData: null,
50
+ overlayB: 0.24,
46
51
  },
47
52
  {
48
53
  date: '2007',
49
54
  overlay: 0.18,
50
55
  'feedback count': 462,
51
56
  extraData: null,
57
+ overlayB: 0.12,
52
58
  },
53
59
  {
54
60
  date: '2008',
55
61
  overlay: 0.16,
56
62
  'feedback count': 419,
57
63
  extraData: null,
64
+ overlayB: 0.27,
58
65
  },
59
66
  {
60
67
  date: '2009',
61
68
  overlay: 0.13,
62
69
  'feedback count': 266,
63
70
  extraData: null,
71
+ overlayB: 0.31,
64
72
  },
65
73
  {
66
74
  date: '2010',
67
75
  overlay: 0.15,
68
76
  'feedback count': 273,
69
77
  extraData: null,
78
+ overlayB: 0.75,
70
79
  },
71
80
  {
72
81
  date: '2011',
73
82
  overlay: 0.21,
74
83
  'feedback count': 491,
75
84
  extraData: null,
85
+ overlayB: 0.72,
76
86
  },
77
87
  {
78
88
  date: '2012',
79
89
  overlay: 0.22,
80
90
  'feedback count': 558,
81
91
  extraData: null,
92
+ overlayB: 0.58,
82
93
  },
83
94
  {
84
95
  date: '2013',
85
96
  overlay: 0.11,
86
97
  'feedback count': 2414,
87
98
  extraData: null,
99
+ overlayB: 0.61,
88
100
  },
89
101
  {
90
102
  date: '2014',
91
103
  overlay: 0.12,
92
104
  'feedback count': 8031,
93
105
  extraData: null,
106
+ overlayB: 0.27,
94
107
  },
95
108
  {
96
109
  date: '2015',
97
110
  overlay: 0.17,
98
111
  'feedback count': 9196,
99
112
  extraData: null,
113
+ overlayB: 0.36,
100
114
  },
101
115
  {
102
116
  date: '2016',
103
117
  overlay: 0.14,
104
118
  'feedback count': 5869,
105
119
  extraData: null,
120
+ overlayB: 0.35,
106
121
  },
107
122
  {
108
123
  date: '2017',
109
124
  overlay: 0.24,
110
125
  'feedback count': 8786,
111
126
  extraData: null,
127
+ overlayB: 0.64,
112
128
  },
113
129
  {
114
130
  date: '2018',
115
131
  overlay: 0.32,
116
132
  'feedback count': 4182,
117
133
  extraData: null,
134
+ overlayB: 0.62,
118
135
  },
119
136
  {
120
137
  date: '2019',
121
138
  overlay: 0.31,
122
139
  'feedback count': 8303,
123
140
  extraData: null,
141
+ overlayB: 0.50,
124
142
  },
125
143
  {
126
144
  date: '2020',
127
145
  overlay: 0.44,
128
146
  'feedback count': 11490,
129
147
  extraData: null,
148
+ overlayB: 0.47,
130
149
  },
131
150
  {
132
151
  date: '2021',
133
152
  overlay: 0.53,
134
153
  'feedback count': 5539,
135
154
  extraData: null,
155
+ overlayB: 0.34,
136
156
  },
137
157
  {
138
158
  date: '2022',
139
159
  overlay: 0.75,
140
160
  'feedback count': 2952,
141
161
  extraData: null,
162
+ overlayB: 0.45,
142
163
  },
143
164
  {
144
165
  date: '2023',
145
166
  overlay: 0.74,
146
167
  'feedback count': 1746,
147
168
  extraData: null,
169
+ overlayB: 0.29,
148
170
  },
149
171
  ];
150
172
  export const feedbackCountGaps = [
@@ -0,0 +1,8 @@
1
+ export declare const positiveNegative: {
2
+ date: string;
3
+ overlay: number;
4
+ 'feedback count': number;
5
+ extraData: null;
6
+ overlayB: number;
7
+ }[];
8
+ //# sourceMappingURL=positiveNegative.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"positiveNegative.d.ts","sourceRoot":"","sources":["../../../../src/examples/charts/mock-data/positiveNegative.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,gBAAgB;;;;;;GA2J5B,CAAC"}
@@ -0,0 +1,171 @@
1
+ /*
2
+ * Copyright 2023-2024 Wonderflow Design Team
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export const positiveNegative = [
17
+ {
18
+ date: '2002',
19
+ overlay: 0.1,
20
+ 'feedback count': 16,
21
+ extraData: null,
22
+ overlayB: 0.31,
23
+ },
24
+ {
25
+ date: '2003',
26
+ overlay: -0.21,
27
+ 'feedback count': 30,
28
+ extraData: null,
29
+ overlayB: 0.1,
30
+ },
31
+ {
32
+ date: '2004',
33
+ overlay: -0.14,
34
+ 'feedback count': 20,
35
+ extraData: null,
36
+ overlayB: 0.43,
37
+ },
38
+ {
39
+ date: '2005',
40
+ overlay: 0.3,
41
+ 'feedback count': 52,
42
+ extraData: null,
43
+ overlayB: 0.33,
44
+ },
45
+ {
46
+ date: '2006',
47
+ overlay: 0.14,
48
+ 'feedback count': 131,
49
+ extraData: null,
50
+ overlayB: 0.24,
51
+ },
52
+ {
53
+ date: '2007',
54
+ overlay: -0.18,
55
+ 'feedback count': 462,
56
+ extraData: null,
57
+ overlayB: 0.12,
58
+ },
59
+ {
60
+ date: '2008',
61
+ overlay: 0.16,
62
+ 'feedback count': 419,
63
+ extraData: null,
64
+ overlayB: 0.27,
65
+ },
66
+ {
67
+ date: '2009',
68
+ overlay: 0.13,
69
+ 'feedback count': 266,
70
+ extraData: null,
71
+ overlayB: 0.31,
72
+ },
73
+ {
74
+ date: '2010',
75
+ overlay: 0.15,
76
+ 'feedback count': 273,
77
+ extraData: null,
78
+ overlayB: 0.75,
79
+ },
80
+ {
81
+ date: '2011',
82
+ overlay: 0.21,
83
+ 'feedback count': 491,
84
+ extraData: null,
85
+ overlayB: 0.72,
86
+ },
87
+ {
88
+ date: '2012',
89
+ overlay: 0.22,
90
+ 'feedback count': 558,
91
+ extraData: null,
92
+ overlayB: 0.58,
93
+ },
94
+ {
95
+ date: '2013',
96
+ overlay: 0.31,
97
+ 'feedback count': 2414,
98
+ extraData: null,
99
+ overlayB: 0.61,
100
+ },
101
+ {
102
+ date: '2014',
103
+ overlay: 0.12,
104
+ 'feedback count': 8031,
105
+ extraData: null,
106
+ overlayB: 0.27,
107
+ },
108
+ {
109
+ date: '2015',
110
+ overlay: 0.27,
111
+ 'feedback count': 9196,
112
+ extraData: null,
113
+ overlayB: 0.36,
114
+ },
115
+ {
116
+ date: '2016',
117
+ overlay: -0.14,
118
+ 'feedback count': 5869,
119
+ extraData: null,
120
+ overlayB: 0.35,
121
+ },
122
+ {
123
+ date: '2017',
124
+ overlay: -0.24,
125
+ 'feedback count': 8786,
126
+ extraData: null,
127
+ overlayB: 0.64,
128
+ },
129
+ {
130
+ date: '2018',
131
+ overlay: -0.32,
132
+ 'feedback count': 4182,
133
+ extraData: null,
134
+ overlayB: 0.62,
135
+ },
136
+ {
137
+ date: '2019',
138
+ overlay: 0.1,
139
+ 'feedback count': 8303,
140
+ extraData: null,
141
+ overlayB: 0.50,
142
+ },
143
+ {
144
+ date: '2020',
145
+ overlay: 0.34,
146
+ 'feedback count': 11490,
147
+ extraData: null,
148
+ overlayB: 0.47,
149
+ },
150
+ {
151
+ date: '2021',
152
+ overlay: 0.53,
153
+ 'feedback count': 5539,
154
+ extraData: null,
155
+ overlayB: 0.34,
156
+ },
157
+ {
158
+ date: '2022',
159
+ overlay: 0.75,
160
+ 'feedback count': 2952,
161
+ extraData: null,
162
+ overlayB: 0.45,
163
+ },
164
+ {
165
+ date: '2023',
166
+ overlay: 0.74,
167
+ 'feedback count': 1746,
168
+ extraData: null,
169
+ overlayB: 0.29,
170
+ },
171
+ ];
@@ -0,0 +1,22 @@
1
+ /// <reference types="react" />
2
+ import { ComponentMeta, ComponentStory } from '@storybook/react';
3
+ import { BarChart, BarChartProps } from '@wonderflow/charts';
4
+ declare const story: ComponentMeta<typeof BarChart>;
5
+ export default story;
6
+ export declare const Default: ComponentStory<import("react").FC<BarChartProps>>;
7
+ export declare const withOverlay: ComponentStory<import("react").FC<BarChartProps>>;
8
+ export declare const withMultipleOverlay: ComponentStory<import("react").FC<BarChartProps>>;
9
+ export declare const withMultipleSeries: ComponentStory<import("react").FC<BarChartProps>>;
10
+ export declare const withAverage: ComponentStory<import("react").FC<BarChartProps>>;
11
+ export declare const withTrendline: ComponentStory<import("react").FC<BarChartProps>>;
12
+ export declare const withCategoriesOnIndex: ComponentStory<import("react").FC<BarChartProps>>;
13
+ export declare const withNestedData: ComponentStory<import("react").FC<BarChartProps>>;
14
+ export declare const withBackground: ComponentStory<import("react").FC<BarChartProps>>;
15
+ export declare const PositiveAndNegative: ComponentStory<import("react").FC<BarChartProps>>;
16
+ export declare const withVerticalFixedBars: ComponentStory<import("react").FC<BarChartProps>>;
17
+ export declare const withMissingData: ComponentStory<import("react").FC<BarChartProps>>;
18
+ export declare const withCustomBarStyle: ComponentStory<import("react").FC<BarChartProps>>;
19
+ export declare const withBrush: ComponentStory<import("react").FC<BarChartProps>>;
20
+ export declare const WithMenu: ComponentStory<import("react").FC<BarChartProps>>;
21
+ export declare const WithinCard: ComponentStory<import("react").FC<BarChartProps>>;
22
+ //# sourceMappingURL=bar-chart.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bar-chart.stories.d.ts","sourceRoot":"","sources":["../../../../src/examples/charts/storybook/bar-chart.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAwB,MAAM,oBAAoB,CAAC;AAcnF,QAAA,MAAM,KAAK,EAAE,aAAa,CAAC,OAAO,QAAQ,CAiDzC,CAAC;AAEF,eAAe,KAAK,CAAC;AAIrB,eAAO,MAAM,OAAO,mDAAoB,CAAC;AAGzC,eAAO,MAAM,WAAW,mDAAoB,CAAC;AAS7C,eAAO,MAAM,mBAAmB,mDAAoB,CAAC;AAiBrD,eAAO,MAAM,kBAAkB,mDAAoB,CAAC;AAiBpD,eAAO,MAAM,WAAW,mDAAoB,CAAC;AAM7C,eAAO,MAAM,aAAa,mDAAoB,CAAC;AAW/C,eAAO,MAAM,qBAAqB,mDAAoB,CAAC;AAevD,eAAO,MAAM,cAAc,mDAAoB,CAAC;AAyBhD,eAAO,MAAM,cAAc,mDAAoB,CAAC;AAehD,eAAO,MAAM,mBAAmB,mDAAoB,CAAC;AAerD,eAAO,MAAM,qBAAqB,mDAAoB,CAAC;AAYvD,eAAO,MAAM,eAAe,mDAAoB,CAAC;AAUjD,eAAO,MAAM,kBAAkB,mDAAoB,CAAC;AA0BpD,eAAO,MAAM,SAAS,mDAAoB,CAAC;AAiC3C,eAAO,MAAM,QAAQ,mDAAoB,CAAC;AAkB1C,eAAO,MAAM,UAAU,mDAA8B,CAAC"}