@wonderflow/react-components 12.7.0 → 12.9.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.
Files changed (38) hide show
  1. package/dist/components/card/card.module.css +1 -1
  2. package/dist/components/modal/header/modal-header.js +2 -2
  3. package/dist/components/popover/popover.d.ts +4 -0
  4. package/dist/components/popover/popover.d.ts.map +1 -1
  5. package/dist/components/popover/popover.js +13 -7
  6. package/dist/components/popover/popover.module.css +1 -1
  7. package/dist/components/popover/popover.stories.d.ts +8 -0
  8. package/dist/components/popover/popover.stories.d.ts.map +1 -1
  9. package/dist/components/popover/popover.stories.js +15 -2
  10. package/dist/components/popover/popover.test.js +13 -0
  11. package/dist/components/spinner/spinner.d.ts.map +1 -1
  12. package/dist/components/spinner/spinner.js +2 -2
  13. package/dist/components/split-button/split-button.stories.d.ts +1 -1
  14. package/dist/examples/charts/mock-data/channels.d.ts +45 -0
  15. package/dist/examples/charts/mock-data/channels.d.ts.map +1 -0
  16. package/dist/examples/charts/mock-data/channels.js +393 -0
  17. package/dist/examples/charts/mock-data/feedbackCount.d.ts +28 -0
  18. package/dist/examples/charts/mock-data/feedbackCount.d.ts.map +1 -0
  19. package/dist/examples/charts/mock-data/feedbackCount.js +283 -0
  20. package/dist/examples/charts/mock-data/index.d.ts +5 -0
  21. package/dist/examples/charts/mock-data/index.d.ts.map +1 -0
  22. package/dist/examples/charts/mock-data/index.js +19 -0
  23. package/dist/examples/charts/mock-data/products.d.ts +17 -0
  24. package/dist/examples/charts/mock-data/products.d.ts.map +1 -0
  25. package/dist/examples/charts/mock-data/products.js +337 -0
  26. package/dist/examples/charts/mock-data/prosCons.d.ts +7 -0
  27. package/dist/examples/charts/mock-data/prosCons.d.ts.map +1 -0
  28. package/dist/examples/charts/mock-data/prosCons.js +83 -0
  29. package/dist/examples/charts/storybook/cartesian-base.stories.d.ts +9 -0
  30. package/dist/examples/charts/storybook/cartesian-base.stories.d.ts.map +1 -0
  31. package/dist/examples/charts/storybook/cartesian-base.stories.js +183 -0
  32. package/dist/examples/charts/storybook/line-chart.stories.d.ts +231 -0
  33. package/dist/examples/charts/storybook/line-chart.stories.d.ts.map +1 -0
  34. package/dist/examples/charts/storybook/line-chart.stories.js +275 -0
  35. package/dist/examples/charts/storybook/sb-charts.module.css +1 -0
  36. package/dist/index.d.ts.map +1 -1
  37. package/dist/index.js +1 -2
  38. package/package.json +18 -14
@@ -0,0 +1,231 @@
1
+ /// <reference types="react" />
2
+ import { ComponentMeta, ComponentStory } from '@storybook/react';
3
+ import { CartesianChartLayout, LineChart } from '@wonderflow/charts';
4
+ declare const story: ComponentMeta<typeof LineChart>;
5
+ export default story;
6
+ export declare const Default: ComponentStory<import("react").ForwardRefExoticComponent<{
7
+ theme?: import("@wonderflow/charts").ThemeVariants | undefined;
8
+ layout?: CartesianChartLayout | undefined;
9
+ data: import("@wonderflow/charts").Data;
10
+ renderAs?: import("@wonderflow/charts").LineChartRenderType | undefined;
11
+ index: import("@wonderflow/charts").LineChartIndex;
12
+ series: import("@wonderflow/charts").LineChartSeries;
13
+ overlay?: import("@wonderflow/charts").LineChartOverlay | undefined;
14
+ showAverage?: boolean | undefined;
15
+ tooltip?: import("@wonderflow/charts").LineChartTooltip | undefined;
16
+ hideMissingDataConnection?: boolean | undefined;
17
+ showMarker?: boolean | undefined;
18
+ showMarkerLabel?: boolean | undefined;
19
+ hidePadding?: boolean | undefined;
20
+ } & import("type-fest/source/except").Except<import("@wonderflow/charts").CartesianBaseProps, "axis" | "axisFiltered" | "onBrushChange"> & import("react").RefAttributes<HTMLElement>>>;
21
+ export declare const withOverlay: ComponentStory<import("react").ForwardRefExoticComponent<{
22
+ theme?: import("@wonderflow/charts").ThemeVariants | undefined;
23
+ layout?: CartesianChartLayout | undefined;
24
+ data: import("@wonderflow/charts").Data;
25
+ renderAs?: import("@wonderflow/charts").LineChartRenderType | undefined;
26
+ index: import("@wonderflow/charts").LineChartIndex;
27
+ series: import("@wonderflow/charts").LineChartSeries;
28
+ overlay?: import("@wonderflow/charts").LineChartOverlay | undefined;
29
+ showAverage?: boolean | undefined;
30
+ tooltip?: import("@wonderflow/charts").LineChartTooltip | undefined;
31
+ hideMissingDataConnection?: boolean | undefined;
32
+ showMarker?: boolean | undefined;
33
+ showMarkerLabel?: boolean | undefined;
34
+ hidePadding?: boolean | undefined;
35
+ } & import("type-fest/source/except").Except<import("@wonderflow/charts").CartesianBaseProps, "axis" | "axisFiltered" | "onBrushChange"> & import("react").RefAttributes<HTMLElement>>>;
36
+ export declare const withAverage: ComponentStory<import("react").ForwardRefExoticComponent<{
37
+ theme?: import("@wonderflow/charts").ThemeVariants | undefined;
38
+ layout?: CartesianChartLayout | undefined;
39
+ data: import("@wonderflow/charts").Data;
40
+ renderAs?: import("@wonderflow/charts").LineChartRenderType | undefined;
41
+ index: import("@wonderflow/charts").LineChartIndex;
42
+ series: import("@wonderflow/charts").LineChartSeries;
43
+ overlay?: import("@wonderflow/charts").LineChartOverlay | undefined;
44
+ showAverage?: boolean | undefined;
45
+ tooltip?: import("@wonderflow/charts").LineChartTooltip | undefined;
46
+ hideMissingDataConnection?: boolean | undefined;
47
+ showMarker?: boolean | undefined;
48
+ showMarkerLabel?: boolean | undefined;
49
+ hidePadding?: boolean | undefined;
50
+ } & import("type-fest/source/except").Except<import("@wonderflow/charts").CartesianBaseProps, "axis" | "axisFiltered" | "onBrushChange"> & import("react").RefAttributes<HTMLElement>>>;
51
+ export declare const withMissingData: ComponentStory<import("react").ForwardRefExoticComponent<{
52
+ theme?: import("@wonderflow/charts").ThemeVariants | undefined;
53
+ layout?: CartesianChartLayout | undefined;
54
+ data: import("@wonderflow/charts").Data;
55
+ renderAs?: import("@wonderflow/charts").LineChartRenderType | undefined;
56
+ index: import("@wonderflow/charts").LineChartIndex;
57
+ series: import("@wonderflow/charts").LineChartSeries;
58
+ overlay?: import("@wonderflow/charts").LineChartOverlay | undefined;
59
+ showAverage?: boolean | undefined;
60
+ tooltip?: import("@wonderflow/charts").LineChartTooltip | undefined;
61
+ hideMissingDataConnection?: boolean | undefined;
62
+ showMarker?: boolean | undefined;
63
+ showMarkerLabel?: boolean | undefined;
64
+ hidePadding?: boolean | undefined;
65
+ } & import("type-fest/source/except").Except<import("@wonderflow/charts").CartesianBaseProps, "axis" | "axisFiltered" | "onBrushChange"> & import("react").RefAttributes<HTMLElement>>>;
66
+ export declare const withMultipleSeries: ComponentStory<import("react").ForwardRefExoticComponent<{
67
+ theme?: import("@wonderflow/charts").ThemeVariants | undefined;
68
+ layout?: CartesianChartLayout | undefined;
69
+ data: import("@wonderflow/charts").Data;
70
+ renderAs?: import("@wonderflow/charts").LineChartRenderType | undefined;
71
+ index: import("@wonderflow/charts").LineChartIndex;
72
+ series: import("@wonderflow/charts").LineChartSeries;
73
+ overlay?: import("@wonderflow/charts").LineChartOverlay | undefined;
74
+ showAverage?: boolean | undefined;
75
+ tooltip?: import("@wonderflow/charts").LineChartTooltip | undefined;
76
+ hideMissingDataConnection?: boolean | undefined;
77
+ showMarker?: boolean | undefined;
78
+ showMarkerLabel?: boolean | undefined;
79
+ hidePadding?: boolean | undefined;
80
+ } & import("type-fest/source/except").Except<import("@wonderflow/charts").CartesianBaseProps, "axis" | "axisFiltered" | "onBrushChange"> & import("react").RefAttributes<HTMLElement>>>;
81
+ export declare const withCategoriesOnIndex: ComponentStory<import("react").ForwardRefExoticComponent<{
82
+ theme?: import("@wonderflow/charts").ThemeVariants | undefined;
83
+ layout?: CartesianChartLayout | undefined;
84
+ data: import("@wonderflow/charts").Data;
85
+ renderAs?: import("@wonderflow/charts").LineChartRenderType | undefined;
86
+ index: import("@wonderflow/charts").LineChartIndex;
87
+ series: import("@wonderflow/charts").LineChartSeries;
88
+ overlay?: import("@wonderflow/charts").LineChartOverlay | undefined;
89
+ showAverage?: boolean | undefined;
90
+ tooltip?: import("@wonderflow/charts").LineChartTooltip | undefined;
91
+ hideMissingDataConnection?: boolean | undefined;
92
+ showMarker?: boolean | undefined;
93
+ showMarkerLabel?: boolean | undefined;
94
+ hidePadding?: boolean | undefined;
95
+ } & import("type-fest/source/except").Except<import("@wonderflow/charts").CartesianBaseProps, "axis" | "axisFiltered" | "onBrushChange"> & import("react").RefAttributes<HTMLElement>>>;
96
+ export declare const withNestedData: ComponentStory<import("react").ForwardRefExoticComponent<{
97
+ theme?: import("@wonderflow/charts").ThemeVariants | undefined;
98
+ layout?: CartesianChartLayout | undefined;
99
+ data: import("@wonderflow/charts").Data;
100
+ renderAs?: import("@wonderflow/charts").LineChartRenderType | undefined;
101
+ index: import("@wonderflow/charts").LineChartIndex;
102
+ series: import("@wonderflow/charts").LineChartSeries;
103
+ overlay?: import("@wonderflow/charts").LineChartOverlay | undefined;
104
+ showAverage?: boolean | undefined;
105
+ tooltip?: import("@wonderflow/charts").LineChartTooltip | undefined;
106
+ hideMissingDataConnection?: boolean | undefined;
107
+ showMarker?: boolean | undefined;
108
+ showMarkerLabel?: boolean | undefined;
109
+ hidePadding?: boolean | undefined;
110
+ } & import("type-fest/source/except").Except<import("@wonderflow/charts").CartesianBaseProps, "axis" | "axisFiltered" | "onBrushChange"> & import("react").RefAttributes<HTMLElement>>>;
111
+ export declare const withCustomLineStyle: ComponentStory<import("react").ForwardRefExoticComponent<{
112
+ theme?: import("@wonderflow/charts").ThemeVariants | undefined;
113
+ layout?: CartesianChartLayout | undefined;
114
+ data: import("@wonderflow/charts").Data;
115
+ renderAs?: import("@wonderflow/charts").LineChartRenderType | undefined;
116
+ index: import("@wonderflow/charts").LineChartIndex;
117
+ series: import("@wonderflow/charts").LineChartSeries;
118
+ overlay?: import("@wonderflow/charts").LineChartOverlay | undefined;
119
+ showAverage?: boolean | undefined;
120
+ tooltip?: import("@wonderflow/charts").LineChartTooltip | undefined;
121
+ hideMissingDataConnection?: boolean | undefined;
122
+ showMarker?: boolean | undefined;
123
+ showMarkerLabel?: boolean | undefined;
124
+ hidePadding?: boolean | undefined;
125
+ } & import("type-fest/source/except").Except<import("@wonderflow/charts").CartesianBaseProps, "axis" | "axisFiltered" | "onBrushChange"> & import("react").RefAttributes<HTMLElement>>>;
126
+ export declare const withBrush: ComponentStory<import("react").ForwardRefExoticComponent<{
127
+ theme?: import("@wonderflow/charts").ThemeVariants | undefined;
128
+ layout?: CartesianChartLayout | undefined;
129
+ data: import("@wonderflow/charts").Data;
130
+ renderAs?: import("@wonderflow/charts").LineChartRenderType | undefined;
131
+ index: import("@wonderflow/charts").LineChartIndex;
132
+ series: import("@wonderflow/charts").LineChartSeries;
133
+ overlay?: import("@wonderflow/charts").LineChartOverlay | undefined;
134
+ showAverage?: boolean | undefined;
135
+ tooltip?: import("@wonderflow/charts").LineChartTooltip | undefined;
136
+ hideMissingDataConnection?: boolean | undefined;
137
+ showMarker?: boolean | undefined;
138
+ showMarkerLabel?: boolean | undefined;
139
+ hidePadding?: boolean | undefined;
140
+ } & import("type-fest/source/except").Except<import("@wonderflow/charts").CartesianBaseProps, "axis" | "axisFiltered" | "onBrushChange"> & import("react").RefAttributes<HTMLElement>>>;
141
+ export declare const withCustomDomain: ComponentStory<import("react").ForwardRefExoticComponent<{
142
+ theme?: import("@wonderflow/charts").ThemeVariants | undefined;
143
+ layout?: CartesianChartLayout | undefined;
144
+ data: import("@wonderflow/charts").Data;
145
+ renderAs?: import("@wonderflow/charts").LineChartRenderType | undefined;
146
+ index: import("@wonderflow/charts").LineChartIndex;
147
+ series: import("@wonderflow/charts").LineChartSeries;
148
+ overlay?: import("@wonderflow/charts").LineChartOverlay | undefined;
149
+ showAverage?: boolean | undefined;
150
+ tooltip?: import("@wonderflow/charts").LineChartTooltip | undefined;
151
+ hideMissingDataConnection?: boolean | undefined;
152
+ showMarker?: boolean | undefined;
153
+ showMarkerLabel?: boolean | undefined;
154
+ hidePadding?: boolean | undefined;
155
+ } & import("type-fest/source/except").Except<import("@wonderflow/charts").CartesianBaseProps, "axis" | "axisFiltered" | "onBrushChange"> & import("react").RefAttributes<HTMLElement>>>;
156
+ export declare const withVerticalLayout: ComponentStory<import("react").ForwardRefExoticComponent<{
157
+ theme?: import("@wonderflow/charts").ThemeVariants | undefined;
158
+ layout?: CartesianChartLayout | undefined;
159
+ data: import("@wonderflow/charts").Data;
160
+ renderAs?: import("@wonderflow/charts").LineChartRenderType | undefined;
161
+ index: import("@wonderflow/charts").LineChartIndex;
162
+ series: import("@wonderflow/charts").LineChartSeries;
163
+ overlay?: import("@wonderflow/charts").LineChartOverlay | undefined;
164
+ showAverage?: boolean | undefined;
165
+ tooltip?: import("@wonderflow/charts").LineChartTooltip | undefined;
166
+ hideMissingDataConnection?: boolean | undefined;
167
+ showMarker?: boolean | undefined;
168
+ showMarkerLabel?: boolean | undefined;
169
+ hidePadding?: boolean | undefined;
170
+ } & import("type-fest/source/except").Except<import("@wonderflow/charts").CartesianBaseProps, "axis" | "axisFiltered" | "onBrushChange"> & import("react").RefAttributes<HTMLElement>>>;
171
+ export declare const withNoData: ComponentStory<import("react").ForwardRefExoticComponent<{
172
+ theme?: import("@wonderflow/charts").ThemeVariants | undefined;
173
+ layout?: CartesianChartLayout | undefined;
174
+ data: import("@wonderflow/charts").Data;
175
+ renderAs?: import("@wonderflow/charts").LineChartRenderType | undefined;
176
+ index: import("@wonderflow/charts").LineChartIndex;
177
+ series: import("@wonderflow/charts").LineChartSeries;
178
+ overlay?: import("@wonderflow/charts").LineChartOverlay | undefined;
179
+ showAverage?: boolean | undefined;
180
+ tooltip?: import("@wonderflow/charts").LineChartTooltip | undefined;
181
+ hideMissingDataConnection?: boolean | undefined;
182
+ showMarker?: boolean | undefined;
183
+ showMarkerLabel?: boolean | undefined;
184
+ hidePadding?: boolean | undefined;
185
+ } & import("type-fest/source/except").Except<import("@wonderflow/charts").CartesianBaseProps, "axis" | "axisFiltered" | "onBrushChange"> & import("react").RefAttributes<HTMLElement>>>;
186
+ export declare const renderAsLines: ComponentStory<import("react").ForwardRefExoticComponent<{
187
+ theme?: import("@wonderflow/charts").ThemeVariants | undefined;
188
+ layout?: CartesianChartLayout | undefined;
189
+ data: import("@wonderflow/charts").Data;
190
+ renderAs?: import("@wonderflow/charts").LineChartRenderType | undefined;
191
+ index: import("@wonderflow/charts").LineChartIndex;
192
+ series: import("@wonderflow/charts").LineChartSeries;
193
+ overlay?: import("@wonderflow/charts").LineChartOverlay | undefined;
194
+ showAverage?: boolean | undefined;
195
+ tooltip?: import("@wonderflow/charts").LineChartTooltip | undefined;
196
+ hideMissingDataConnection?: boolean | undefined;
197
+ showMarker?: boolean | undefined;
198
+ showMarkerLabel?: boolean | undefined;
199
+ hidePadding?: boolean | undefined;
200
+ } & import("type-fest/source/except").Except<import("@wonderflow/charts").CartesianBaseProps, "axis" | "axisFiltered" | "onBrushChange"> & import("react").RefAttributes<HTMLElement>>>;
201
+ export declare const renderAsSteps: ComponentStory<import("react").ForwardRefExoticComponent<{
202
+ theme?: import("@wonderflow/charts").ThemeVariants | undefined;
203
+ layout?: CartesianChartLayout | undefined;
204
+ data: import("@wonderflow/charts").Data;
205
+ renderAs?: import("@wonderflow/charts").LineChartRenderType | undefined;
206
+ index: import("@wonderflow/charts").LineChartIndex;
207
+ series: import("@wonderflow/charts").LineChartSeries;
208
+ overlay?: import("@wonderflow/charts").LineChartOverlay | undefined;
209
+ showAverage?: boolean | undefined;
210
+ tooltip?: import("@wonderflow/charts").LineChartTooltip | undefined;
211
+ hideMissingDataConnection?: boolean | undefined;
212
+ showMarker?: boolean | undefined;
213
+ showMarkerLabel?: boolean | undefined;
214
+ hidePadding?: boolean | undefined;
215
+ } & import("type-fest/source/except").Except<import("@wonderflow/charts").CartesianBaseProps, "axis" | "axisFiltered" | "onBrushChange"> & import("react").RefAttributes<HTMLElement>>>;
216
+ export declare const WithinCard: ComponentStory<import("react").ForwardRefExoticComponent<{
217
+ theme?: import("@wonderflow/charts").ThemeVariants | undefined;
218
+ layout?: CartesianChartLayout | undefined;
219
+ data: import("@wonderflow/charts").Data;
220
+ renderAs?: import("@wonderflow/charts").LineChartRenderType | undefined;
221
+ index: import("@wonderflow/charts").LineChartIndex;
222
+ series: import("@wonderflow/charts").LineChartSeries;
223
+ overlay?: import("@wonderflow/charts").LineChartOverlay | undefined;
224
+ showAverage?: boolean | undefined;
225
+ tooltip?: import("@wonderflow/charts").LineChartTooltip | undefined;
226
+ hideMissingDataConnection?: boolean | undefined;
227
+ showMarker?: boolean | undefined;
228
+ showMarkerLabel?: boolean | undefined;
229
+ hidePadding?: boolean | undefined;
230
+ } & import("type-fest/source/except").Except<import("@wonderflow/charts").CartesianBaseProps, "axis" | "axisFiltered" | "onBrushChange"> & import("react").RefAttributes<HTMLElement>>>;
231
+ //# sourceMappingURL=line-chart.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"line-chart.stories.d.ts","sourceRoot":"","sources":["../../../../src/examples/charts/storybook/line-chart.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,SAAS,EAAkB,MAAM,oBAAoB,CAAC;AAUrF,QAAA,MAAM,KAAK,EAAE,aAAa,CAAC,OAAO,SAAS,CA2C1C,CAAC;AAEF,eAAe,KAAK,CAAC;AAIrB,eAAO,MAAM,OAAO;;;;;;;;;;;;;;uLAAoB,CAAC;AAGzC,eAAO,MAAM,WAAW;;;;;;;;;;;;;;uLAAoB,CAAC;AAS7C,eAAO,MAAM,WAAW;;;;;;;;;;;;;;uLAAoB,CAAC;AAM7C,eAAO,MAAM,eAAe;;;;;;;;;;;;;;uLAAoB,CAAC;AAUjD,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;uLAAoB,CAAC;AAiBpD,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;uLAAoB,CAAC;AAevD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;uLAAoB,CAAC;AAgChD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;uLAAoB,CAAC;AA8BrD,eAAO,MAAM,SAAS;;;;;;;;;;;;;;uLAAoB,CAAC;AAiC3C,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;uLAAoB,CAAC;AAclD,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;uLAAoB,CAAC;AAiBpD,eAAO,MAAM,UAAU;;;;;;;;;;;;;;uLAAoB,CAAC;AAQ5C,eAAO,MAAM,aAAa;;;;;;;;;;;;;;uLAAoB,CAAC;AAiB/C,eAAO,MAAM,aAAa;;;;;;;;;;;;;;uLAAoB,CAAC;AA8B/C,eAAO,MAAM,UAAU;;;;;;;;;;;;;;uLAA8B,CAAC"}
@@ -0,0 +1,275 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { CartesianChartLayout, LineChart } from '@wonderflow/charts';
3
+ import { Card } from '../../..';
4
+ // import { CartesianChartLayout, LineChart, LineChartProps } from '../../../../../charts/src';
5
+ import { channels, channelsB, feedbackCount, feedbackCountGaps, proCons, products, } from '../mock-data';
6
+ import styles from './sb-charts.module.css';
7
+ const story = {
8
+ title: 'Charts/Line Chart',
9
+ component: LineChart,
10
+ args: {
11
+ title: 'Line Charts',
12
+ subtitle: 'A trend line chart',
13
+ preventResponsive: false,
14
+ isLoading: false,
15
+ showMarker: false,
16
+ showMarkerLabel: false,
17
+ hideMissingDataConnection: false,
18
+ showAverage: false,
19
+ showBrush: false,
20
+ hideLegend: false,
21
+ hidePadding: false,
22
+ layout: CartesianChartLayout.HORIZONTAL,
23
+ renderAs: 'curves',
24
+ theme: 'light',
25
+ data: feedbackCount,
26
+ index: {
27
+ dataKey: 'date',
28
+ label: 'Year',
29
+ },
30
+ series: {
31
+ dataKey: ['feedback count'],
32
+ label: 'Feedback Count',
33
+ },
34
+ overlay: undefined,
35
+ },
36
+ argTypes: {
37
+ layout: {
38
+ options: ['horizontal', 'vertical'],
39
+ control: { type: 'radio' },
40
+ },
41
+ renderAs: {
42
+ options: ['curves', 'lines', 'steps'],
43
+ control: { type: 'radio' },
44
+ },
45
+ theme: {
46
+ options: ['light', 'dark'],
47
+ control: { type: 'radio' },
48
+ },
49
+ },
50
+ };
51
+ export default story;
52
+ const Template = (args) => _jsx(LineChart, { ...args });
53
+ export const Default = Template.bind({});
54
+ Default.args = {};
55
+ export const withOverlay = Template.bind({});
56
+ withOverlay.args = {
57
+ subtitle: 'A trend line chart with overlay',
58
+ overlay: {
59
+ dataKey: 'overlay',
60
+ label: 'Overlay',
61
+ },
62
+ };
63
+ export const withAverage = Template.bind({});
64
+ withAverage.args = {
65
+ subtitle: 'A trend line chart with average',
66
+ showAverage: true,
67
+ };
68
+ export const withMissingData = Template.bind({});
69
+ withMissingData.args = {
70
+ data: feedbackCountGaps,
71
+ subtitle: 'A trend line chart with null values',
72
+ overlay: {
73
+ dataKey: 'overlay',
74
+ label: 'Overlay',
75
+ },
76
+ };
77
+ export const withMultipleSeries = Template.bind({});
78
+ withMultipleSeries.args = {
79
+ title: 'Multiple Series',
80
+ subtitle: 'A trend line chart with multiple series',
81
+ data: proCons,
82
+ index: {
83
+ dataKey: 'date',
84
+ label: 'Time',
85
+ },
86
+ series: {
87
+ domain: [0, 200],
88
+ dataKey: ['positive', 'negative', 'neutral'],
89
+ label: 'Pros & cons',
90
+ style: [undefined, undefined, { stroke: 'gray' }],
91
+ },
92
+ };
93
+ export const withCategoriesOnIndex = Template.bind({});
94
+ withCategoriesOnIndex.args = {
95
+ title: 'Multiple Series',
96
+ subtitle: 'A line chart with categories on index',
97
+ data: channels,
98
+ index: {
99
+ dataKey: 'channel',
100
+ label: 'Channels',
101
+ },
102
+ series: {
103
+ dataKey: ['1 star', '2 stars', '3 stars', '4 stars', '5 stars'],
104
+ label: 'Feedback count',
105
+ },
106
+ };
107
+ export const withNestedData = Template.bind({});
108
+ withNestedData.args = {
109
+ title: 'Multiple Series',
110
+ subtitle: 'A line chart rendered from nested data',
111
+ data: channelsB,
112
+ index: {
113
+ dataKey: 'channel',
114
+ label: 'Channels',
115
+ },
116
+ series: {
117
+ dataKey: ['1 star.value', '2 stars.value', '3 stars.value', '4 stars.value', '5 stars.value'],
118
+ label: 'Feedback count',
119
+ rename: (_, i) => Array(i + 1).fill('⭐').join(),
120
+ },
121
+ overlay: {
122
+ dataKey: 'overlay.value',
123
+ label: 'TGW',
124
+ domain: [0, 5],
125
+ style: {
126
+ strokeDasharray: '2 4',
127
+ },
128
+ },
129
+ tooltip: {
130
+ extraSeriesData: (series) => `${series.percentage}%`,
131
+ extraOverlayData: (overlay) => `${overlay.percentage}%`,
132
+ extraContent: _jsx("div", { children: "some extra content" }),
133
+ },
134
+ renderAs: 'lines',
135
+ layout: CartesianChartLayout.VERTICAL,
136
+ showMarker: true,
137
+ };
138
+ export const withCustomLineStyle = Template.bind({});
139
+ withCustomLineStyle.args = {
140
+ title: 'Multiple Series',
141
+ subtitle: 'A trend line chart with multiple series',
142
+ data: proCons,
143
+ index: {
144
+ dataKey: 'date',
145
+ label: 'Time',
146
+ },
147
+ series: {
148
+ dataKey: ['positive', 'negative', 'neutral'],
149
+ label: 'Pros & cons',
150
+ style: [
151
+ undefined,
152
+ {
153
+ stroke: 'red',
154
+ strokeDasharray: '6 8',
155
+ strokeOpacity: '0.5',
156
+ strokeWidth: '3',
157
+ },
158
+ {
159
+ stroke: 'grey',
160
+ strokeDasharray: '2 4',
161
+ strokeOpacity: '0.8',
162
+ strokeWidth: '1.5',
163
+ },
164
+ ],
165
+ },
166
+ };
167
+ export const withBrush = Template.bind({});
168
+ withBrush.args = {
169
+ data: products,
170
+ subtitle: 'A trend line chart with twelve series',
171
+ renderAs: 'lines',
172
+ showMarker: true,
173
+ showBrush: true,
174
+ index: {
175
+ dataKey: 'date',
176
+ label: 'Year',
177
+ },
178
+ series: {
179
+ dataKey: [
180
+ 'QN95B Neo QLED 4K TV',
181
+ 'Q800A Neo QLED 4K TV',
182
+ 'Q60A QLED 4K TV',
183
+ 'C2 OLED 4K TV',
184
+ 'G2 OLED Evo 4K TV',
185
+ 'B2 OLED 4K TV',
186
+ 'A95K QD-OLED 4K TV',
187
+ 'X95J LED 4K TV',
188
+ 'X85J LED 4K TV',
189
+ 'R6485Q Mini-LED QLED 4K TV',
190
+ 'S546Q 4K QLED TV',
191
+ 'S435 4K Roku TV',
192
+ ],
193
+ label: 'Product Units',
194
+ tickFormat: (l) => `${l}K`,
195
+ domain: [0, 1000],
196
+ hideZero: true,
197
+ },
198
+ };
199
+ export const withCustomDomain = Template.bind({});
200
+ withCustomDomain.args = {
201
+ subtitle: 'A trend line chart with custom domain',
202
+ series: {
203
+ dataKey: ['feedback count'],
204
+ label: 'Feedback Count',
205
+ domain: [-12000, 12000],
206
+ },
207
+ index: {
208
+ dataKey: 'date',
209
+ label: 'Year',
210
+ },
211
+ };
212
+ export const withVerticalLayout = Template.bind({});
213
+ withVerticalLayout.args = {
214
+ layout: CartesianChartLayout.VERTICAL,
215
+ overlay: {
216
+ dataKey: 'overlay',
217
+ label: 'Overlay',
218
+ },
219
+ index: {
220
+ dataKey: 'date',
221
+ label: 'Year',
222
+ },
223
+ series: {
224
+ dataKey: ['feedback count'],
225
+ label: 'Feedback Count',
226
+ },
227
+ };
228
+ export const withNoData = Template.bind({});
229
+ withNoData.args = {
230
+ data: [],
231
+ title: 'Line Charts',
232
+ subtitle: 'A trend line chart w/o data',
233
+ emptyStateMessage: 'Please select items from the right menu to render the chart.',
234
+ };
235
+ export const renderAsLines = Template.bind({});
236
+ renderAsLines.args = {
237
+ title: 'Multiple Series',
238
+ subtitle: 'A trend line chart rendered with lines',
239
+ data: proCons,
240
+ renderAs: 'lines',
241
+ index: {
242
+ dataKey: 'date',
243
+ label: 'Time',
244
+ },
245
+ series: {
246
+ domain: [0, 200],
247
+ dataKey: ['positive', 'negative'],
248
+ label: 'Pros & cons',
249
+ },
250
+ };
251
+ export const renderAsSteps = Template.bind({});
252
+ renderAsSteps.args = {
253
+ title: 'Multiple Series',
254
+ subtitle: 'A trend line chart rendered with steps',
255
+ data: proCons,
256
+ renderAs: 'steps',
257
+ index: {
258
+ dataKey: 'date',
259
+ label: 'Time',
260
+ },
261
+ series: {
262
+ domain: [0, 200],
263
+ dataKey: ['positive', 'negative'],
264
+ label: 'Pros & cons',
265
+ },
266
+ };
267
+ const WithinCardTemplate = (args) => {
268
+ const { theme } = args;
269
+ return (_jsx(Card, { bordered: true, className: styles.Card, style: { backgroundColor: theme === 'dark' ? '#202227' : undefined }, children: _jsx(LineChart, { ...args }) }));
270
+ };
271
+ export const WithinCard = WithinCardTemplate.bind({});
272
+ WithinCard.args = {
273
+ subtitle: 'A trend line chart within a card 75vh and width 100%',
274
+ hidePadding: true,
275
+ };
@@ -0,0 +1 @@
1
+ .Card{div & [data-inner-element=Content]{height:75vh;overflow:hidden;width:100%}}.InfoState{transform:translateY(50%)}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAkBA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAgBA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2022-2023 Wonderflow Design Team
2
+ * Copyright 2022-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.
@@ -13,7 +13,6 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- 'use client';
17
16
  export * from './components';
18
17
  export * from './hooks';
19
18
  export * from './providers';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wonderflow/react-components",
3
- "version": "12.7.0",
3
+ "version": "12.9.0",
4
4
  "description": "UI components from Wonderflow's Wanda design system",
5
5
  "author": "Wonderflow",
6
6
  "license": "Apache-2.0",
@@ -80,13 +80,15 @@
80
80
  "@storybook/theming": "6.5.16",
81
81
  "@types/react": "17.0.43",
82
82
  "@types/react-dom": "17.0.14",
83
- "@types/react-table": "7.7.12",
84
- "@types/react-test-renderer": "18.0.0",
85
- "@wonderflow/config": "12.7.0",
86
- "@wonderflow/tokens": "12.7.0",
83
+ "@types/react-table": "7.7.18",
84
+ "@types/react-test-renderer": "18.0.7",
85
+ "@wonderflow/config": "12.9.0",
86
+ "@wonderflow/tokens": "12.9.0",
87
+ "@wonderflow/charts": "12.9.0",
88
+ "@types/uuid": "9.0.7",
87
89
  "babel-loader": "8.2.5",
88
90
  "cpy-cli": "3.1.1",
89
- "postcss": "8.4.17",
91
+ "postcss": "8.4.32",
90
92
  "postcss-cli": "10.0.0",
91
93
  "react": "17.0.2",
92
94
  "react-dom": "17.0.2",
@@ -99,20 +101,22 @@
99
101
  "typescript-plugin-css-modules": "3.4.0"
100
102
  },
101
103
  "dependencies": {
102
- "@radix-ui/react-tabs": "1.0.0",
103
- "ahooks": "3.7.5",
104
+ "@radix-ui/react-tabs": "1.0.4",
105
+ "ahooks": "3.7.8",
104
106
  "clsx": "1.2.1",
105
107
  "constate": "3.3.2",
106
108
  "framer-motion": "6.5.1",
107
- "react-focus-on": "3.6.0",
109
+ "lodash": "4.17.21",
110
+ "react-focus-on": "3.9.1",
108
111
  "react-masonry-css": "1.0.16",
109
- "react-merge-refs": "2.0.1",
110
- "react-paginate": "8.1.3",
112
+ "react-merge-refs": "2.1.1",
113
+ "react-paginate": "8.2.0",
111
114
  "react-popper-tooltip": "4.4.2",
112
115
  "react-roving-tabindex": "3.2.0",
113
116
  "react-table": "7.8.0",
114
- "react-uid": "2.3.2",
115
- "slugify": "1.6.5",
116
- "type-fest": "3.0.0"
117
+ "react-uid": "2.3.3",
118
+ "slugify": "1.6.6",
119
+ "type-fest": "3.0.0",
120
+ "uuid": "9.0.1"
117
121
  }
118
122
  }