@wonderflow/react-components 12.8.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 (26) hide show
  1. package/dist/components/modal/header/modal-header.js +2 -2
  2. package/dist/components/popover/popover.d.ts +4 -0
  3. package/dist/components/popover/popover.d.ts.map +1 -1
  4. package/dist/components/popover/popover.js +13 -7
  5. package/dist/components/popover/popover.module.css +1 -1
  6. package/dist/components/popover/popover.stories.d.ts +8 -0
  7. package/dist/components/popover/popover.stories.d.ts.map +1 -1
  8. package/dist/components/popover/popover.stories.js +15 -2
  9. package/dist/components/popover/popover.test.js +13 -0
  10. package/dist/components/spinner/spinner.d.ts.map +1 -1
  11. package/dist/components/spinner/spinner.js +2 -2
  12. package/dist/examples/charts/mock-data/index.d.ts +1 -0
  13. package/dist/examples/charts/mock-data/index.d.ts.map +1 -1
  14. package/dist/examples/charts/mock-data/index.js +2 -1
  15. package/dist/examples/charts/mock-data/products.d.ts +17 -0
  16. package/dist/examples/charts/mock-data/products.d.ts.map +1 -0
  17. package/dist/examples/charts/mock-data/products.js +337 -0
  18. package/dist/examples/charts/storybook/cartesian-base.stories.d.ts +3 -4
  19. package/dist/examples/charts/storybook/cartesian-base.stories.d.ts.map +1 -1
  20. package/dist/examples/charts/storybook/cartesian-base.stories.js +72 -3
  21. package/dist/examples/charts/storybook/line-chart.stories.d.ts +226 -14
  22. package/dist/examples/charts/storybook/line-chart.stories.d.ts.map +1 -1
  23. package/dist/examples/charts/storybook/line-chart.stories.js +49 -7
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/index.js +1 -2
  26. package/package.json +16 -32
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  /*
3
- * Copyright 2022-2023 Wonderflow Design Team
3
+ * Copyright 2022-2024 Wonderflow Design Team
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
6
6
  * you may not use this file except in compliance with the License.
@@ -21,6 +21,6 @@ import * as styles from './modal-header.module.css';
21
21
  export const ModalHeader = forwardRef(({ children, className, hideCloseButton = false, hideBorder = false, theme = 'light', ...otherProps }, forwardedRef) => {
22
22
  const { onClose } = useOverlayContext();
23
23
  const isBorderHidden = useMemo(() => hideBorder || !children, [hideBorder, children]);
24
- return (_jsx("div", { "aria-label": "Header", className: clsx(styles.HeaderWrapper, className), ref: forwardedRef, "data-theme": theme, ...otherProps, children: _jsxs(Stack, { vAlign: "center", fill: false, hAlign: "space-between", direction: "row", className: styles.Header, "data-border-hidden": isBorderHidden, children: [_jsx("div", { children: children }), (onClose && !hideCloseButton) && (_jsx(IconButton, { "aria-label": "Close Button", onClick: onClose, className: styles.CloseButton, icon: "xmark", kind: "flat" }))] }) }));
24
+ return (_jsx("div", { "aria-label": "Header", className: clsx(styles.HeaderWrapper, className), ref: forwardedRef, "data-theme": theme, ...otherProps, children: _jsxs(Stack, { vAlign: "center", fill: false, hAlign: "space-between", direction: "row", className: styles.Header, "data-border-hidden": isBorderHidden, children: [_jsx("div", { children: children }), (onClose && !hideCloseButton) && (_jsx(IconButton, { "aria-label": "Close Button", onClick: onClose, autoFocus: true, className: styles.CloseButton, icon: "xmark", kind: "flat" }))] }) }));
25
25
  });
26
26
  ModalHeader.displayName = 'Modal.Header';
@@ -46,6 +46,10 @@ export declare type PopoverProps = {
46
46
  * Set the popover element the same with of the trigger element.
47
47
  */
48
48
  matchTriggerWidth?: boolean;
49
+ /**
50
+ * Auto close the popover when clicking inside of it.
51
+ */
52
+ closeOnInsideClick?: boolean;
49
53
  /**
50
54
  * Set the root element to render the Popover into.
51
55
  */
@@ -1 +1 @@
1
- {"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../../src/components/popover/popover.tsx"],"names":[],"mappings":"AAgBA,OAAO,EACL,aAAa,EAAE,aAAa,EAAY,kBAAkB,EAC3D,MAAM,gBAAgB,CAAC;AAUxB,OAAO,EAML,SAAS,EAKV,MAAM,OAAO,CAAC;AASf,oBAAY,YAAY,GAAG;IACzB;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,OAAO,EAAE,SAAS,CAAC;IACnB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,aAAa,GAAG,aAAa,GAAG,kBAAkB,CAAC;IAC/D;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;OAEG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB,CAAA;AA0BD,eAAO,MAAM,OAAO;;;iEAgIlB,CAAC"}
1
+ {"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../../src/components/popover/popover.tsx"],"names":[],"mappings":"AAgBA,OAAO,EACL,aAAa,EAAE,aAAa,EAAY,kBAAkB,EAC3D,MAAM,gBAAgB,CAAC;AASxB,OAAO,EAML,SAAS,EAKV,MAAM,OAAO,CAAC;AASf,oBAAY,YAAY,GAAG;IACzB;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,OAAO,EAAE,SAAS,CAAC;IACnB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,aAAa,GAAG,aAAa,GAAG,kBAAkB,CAAC;IAC/D;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;OAEG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB,CAAA;AA0BD,eAAO,MAAM,OAAO;;;iEAyIlB,CAAC"}
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import tkns from '@wonderflow/tokens/platforms/web/tokens.json';
3
3
  import { useFocusWithin, useKeyPress } from 'ahooks';
4
4
  import clsx from 'clsx';
5
- import { AnimatePresence, domMax, LazyMotion, m, } from 'framer-motion';
5
+ import { domMax, LazyMotion, m, } from 'framer-motion';
6
6
  import { Children, cloneElement, forwardRef, isValidElement, useEffect, useMemo, useRef, useState, } from 'react';
7
7
  import { createPortal } from 'react-dom';
8
8
  import { mergeRefs } from 'react-merge-refs';
@@ -32,7 +32,7 @@ const PopoverAnimation = {
32
32
  },
33
33
  },
34
34
  };
35
- export const Popover = forwardRef(({ children, trigger, offset = 8, placement = 'auto-start', open, disabled, closeOnOutsideClick = true, className, matchTriggerWidth, onOpenChange, root, ...otherProps }, forwardedRef) => {
35
+ export const Popover = forwardRef(({ children, trigger, offset = 8, placement = 'auto-start', open, disabled, closeOnOutsideClick = true, closeOnInsideClick = false, className, matchTriggerWidth, onOpenChange, root, ...otherProps }, forwardedRef) => {
36
36
  const seedID = useUIDSeed();
37
37
  const [isOpen, setIsOpen] = useState(false);
38
38
  const popoverContainerRef = useRef(null);
@@ -53,7 +53,13 @@ export const Popover = forwardRef(({ children, trigger, offset = 8, placement =
53
53
  s.elements.popper.style.width = `${referenceElement.offsetWidth ?? 0}px`;
54
54
  },
55
55
  }), [matchTriggerWidth]);
56
- const { getTooltipProps, setTooltipRef, setTriggerRef, tooltipRef,
56
+ const handleCloseOnClickInside = (e) => {
57
+ e.stopPropagation();
58
+ if (isOpen && closeOnInsideClick) {
59
+ setIsOpen(false);
60
+ }
61
+ };
62
+ const { getTooltipProps, setTooltipRef, setTriggerRef,
57
63
  // eslint-disable-next-line @typescript-eslint/naming-convention
58
64
  visible, } = usePopperTooltip({
59
65
  delayShow: 0,
@@ -78,8 +84,8 @@ export const Popover = forwardRef(({ children, trigger, offset = 8, placement =
78
84
  },
79
85
  ],
80
86
  });
81
- const isFocusWithin = useFocusWithin(tooltipRef, {
82
- onFocus: (e) => {
87
+ const isFocusWithin = useFocusWithin(popoverContainerRef, {
88
+ onBlur: (e) => {
83
89
  if (e.relatedTarget && visible) {
84
90
  setIsOpen(true);
85
91
  }
@@ -98,9 +104,9 @@ export const Popover = forwardRef(({ children, trigger, offset = 8, placement =
98
104
  'aria-controls': seedID('popover-dialog'),
99
105
  'aria-expanded': isOpen,
100
106
  ...otherProps,
101
- }), isBrowser() && visible && createPortal(_jsx(AnimatePresence, { children: _jsx("div", { ref: setTooltipRef, role: "tooltip", id: seedID('tooltip-content'), ...getTooltipProps({ className: styles.PopUp }), children: _jsx(LazyMotion, { features: domMax, children: _jsx(m.div, { variants: PopoverAnimation, initial: "hidden", animate: "visible", exit: "hidden", children: Children.map(children, child => isValidElement(child) && cloneElement(child, {
107
+ }), isBrowser() && visible && createPortal(_jsx("div", { "aria-hidden": true, "data-testid": "tooltip", ref: setTooltipRef, role: "tooltip", id: seedID('tooltip-content'), ...getTooltipProps({ className: styles.PopUp }), onClick: e => handleCloseOnClickInside(e), children: _jsx(LazyMotion, { features: domMax, strict: true, children: _jsx(m.div, { variants: PopoverAnimation, initial: "hidden", animate: "visible", exit: "hidden", children: _jsx("div", { children: Children.map(children, child => isValidElement(child) && cloneElement(child, {
102
108
  id: seedID('popover-dialog'),
103
109
  'aria-labelledby': seedID('popover-trigger'),
104
- })) }) }) }, seedID('tooltip-content')) }), root ?? document.body)] }));
110
+ })) }) }) }) }, seedID('tooltip-content')), root ?? document.body)] }));
105
111
  });
106
112
  Popover.displayName = 'Popover';
@@ -1 +1 @@
1
- @layer components{.Popover{display:contents}.PopUp{inline-size:max-content;z-index:5}}
1
+ @layer components{.Popover{display:contents}.PopUp{inline-size:max-content;z-index:4}}
@@ -27,4 +27,12 @@ export declare const WithCode: ComponentStory<import("react").ForwardRefExoticCo
27
27
  style?: Record<string, any> | undefined;
28
28
  className?: string | undefined;
29
29
  } & import("./popover").PopoverProps & import("react").RefAttributes<HTMLDivElement>>>;
30
+ export declare const closeOnInsideClick: ComponentStory<import("react").ForwardRefExoticComponent<{
31
+ style?: Record<string, any> | undefined;
32
+ className?: string | undefined;
33
+ } & import("./popover").PopoverProps & import("react").RefAttributes<HTMLDivElement>>>;
34
+ export declare const withLoader: ComponentStory<import("react").ForwardRefExoticComponent<{
35
+ style?: Record<string, any> | undefined;
36
+ className?: string | undefined;
37
+ } & import("./popover").PopoverProps & import("react").RefAttributes<HTMLDivElement>>>;
30
38
  //# sourceMappingURL=popover.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"popover.stories.d.ts","sourceRoot":"","sources":["../../../src/components/popover/popover.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAMjE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,QAAA,MAAM,KAAK,EAAE,aAAa,CAAC,OAAO,OAAO,CAgBxC,CAAC;AAEF,eAAe,KAAK,CAAC;AAmCrB,eAAO,MAAM,OAAO;;;sFAA2B,CAAC;AAyBhD,eAAO,MAAM,aAAa;;;sFAA0B,CAAC;AAuBrD,eAAO,MAAM,SAAS;;;sFAA6B,CAAC;AAwCpD,eAAO,MAAM,UAAU;;;sFAA8B,CAAC;AAgBtD,eAAO,MAAM,YAAY;;;sFAAgC,CAAC;AAkC1D,eAAO,MAAM,QAAQ;;;sFAA4B,CAAC"}
1
+ {"version":3,"file":"popover.stories.d.ts","sourceRoot":"","sources":["../../../src/components/popover/popover.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAOjE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,QAAA,MAAM,KAAK,EAAE,aAAa,CAAC,OAAO,OAAO,CAiBxC,CAAC;AAEF,eAAe,KAAK,CAAC;AAmCrB,eAAO,MAAM,OAAO;;;sFAA2B,CAAC;AAyBhD,eAAO,MAAM,aAAa;;;sFAA0B,CAAC;AAuBrD,eAAO,MAAM,SAAS;;;sFAA6B,CAAC;AAwCpD,eAAO,MAAM,UAAU;;;sFAA8B,CAAC;AActD,eAAO,MAAM,YAAY;;;sFAAgC,CAAC;AAkC1D,eAAO,MAAM,QAAQ;;;sFAA4B,CAAC;AA+ElD,eAAO,MAAM,kBAAkB;;;sFAA6B,CAAC;AAoD7D,eAAO,MAAM,UAAU;;;sFAA4B,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useState } from 'react';
3
- import { Button, Card, Elevator, IconButton, Menu, Stack, Textfield, } from '../..';
3
+ import { Button, Card, Elevator, IconButton, Menu, Modal, ResponsiveProvider, Skeleton, Stack, Textfield, Tooltip, } from '../..';
4
4
  import { Popover } from './popover';
5
5
  const story = {
6
6
  title: 'Dialogs/Popover',
@@ -9,6 +9,7 @@ const story = {
9
9
  placement: 'auto-start',
10
10
  offset: 8,
11
11
  closeOnOutsideClick: true,
12
+ closeOnInsideClick: false,
12
13
  matchTriggerWidth: false,
13
14
  trigger: _jsx(Button, { children: "Open Popover" }),
14
15
  },
@@ -55,7 +56,6 @@ const ControlledTemplate = (args) => {
55
56
  }, children: ["Lorem ipsum dolor, sit amet consectetur adipisicing elit. Magni error unde sapiente beatae! Nostrum praesentium similique veniam non ut nulla, incidunt velit et, placeat cupiditate, aliquid saepe. Atque, provident perferendis?", _jsx("button", { type: "button", onClick: () => setIsOpen(val => !val), children: "Close popover" })] }) }));
56
57
  };
57
58
  export const Controlled = ControlledTemplate.bind({});
58
- Controlled.args = {};
59
59
  const WithElevatorTemplate = args => (_jsx(Popover, { ...args, children: _jsx(Elevator, { resting: 2, children: _jsxs(Card, { dimmed: 0, bordered: true, children: ["Lorem ipsum dolor sit.", ' ', _jsx("a", { href: "https://design.wonderflow.ai/get-started/components/dialogs/popover", target: "_blank", rel: "noreferrer", children: "More Popover info." })] }) }) }));
60
60
  export const WithElevator = WithElevatorTemplate.bind({});
61
61
  WithElevator.args = {
@@ -78,3 +78,16 @@ WithCode.args = {
78
78
  placement: 'auto-end',
79
79
  trigger: _jsx(IconButton, { kind: "secondary", icon: "circle-info", dimension: "big", "aria-label": "Show some formatted code" }),
80
80
  };
81
+ const WithModalTemplate = (args) => {
82
+ const [isOpen, setIsOpen] = useState(false);
83
+ return (_jsxs(ResponsiveProvider, { children: [_jsx(Popover, { ...args, closeOnInsideClick: true, trigger: _jsx(Button, { children: "Open Menu" }), children: _jsx(Menu, { children: _jsx(Menu.Item, { autoFocus: true, icon: "arrow-right", value: "1", onClick: () => setIsOpen(true), children: "Open Modal" }) }) }), _jsx(Modal, { title: "A Modal ", subtitle: "opened from a Popover Menu", overlayColor: "dark", hideCloseButton: false, hideHeaderBorder: false, hideFooterBorder: false, alignActionCenter: false, alignContentCenter: false, size: "medium", theme: "auto", isLoading: false, preventCloseOnClickOutside: false, content: (_jsx("div", { children: _jsxs("p", { children: ["When", ' ', _jsx("b", { children: "closeOnInsideClick" }), ' ', "is set to `true`, the Popover will automatically close clicking on it.", _jsx(Tooltip, { placement: "right-start", delay: 500, trigger: (_jsx(IconButton, { kind: "flat", icon: "circle-info", dimension: "small", "aria-label": "Show some formatted code" })), children: _jsx("p", { children: "some extra info in a Tooltip." }) })] }) })), primaryAction: _jsx(Button, { onClick: () => setIsOpen(false), children: "Confirm" }), secondaryAction: _jsx(Button, { onClick: () => setIsOpen(false), children: "Cancel" }), isVisible: isOpen, onCloseModal: () => setIsOpen(false) })] }));
84
+ };
85
+ export const closeOnInsideClick = WithModalTemplate.bind({});
86
+ const SkeletonTemplate = (args) => {
87
+ const [isChecked, setIsChecked] = useState(false);
88
+ const [isLoading, setIsLoading] = useState(true);
89
+ return (_jsx(Popover, { ...args, placement: "right-end", children: _jsxs(Menu, { style: { minWidth: '250px' }, children: [isLoading
90
+ ? (_jsx(Stack, { hPadding: 8, children: _jsx(Skeleton, { count: 3, height: "36px" }) }))
91
+ : (_jsxs(_Fragment, { children: [_jsx(Menu.Item, { autoFocus: true, icon: "arrow-right", value: "1", children: "Sample long menu item" }), _jsx(Menu.ItemCheckbox, { onClick: () => setIsChecked(val => !val), checked: isChecked, icon: isChecked ? 'check' : undefined, value: "2", children: "Checkbox item" }), _jsx(Menu.Item, { value: "3", icon: "right-from-bracket", children: "Item option 3" })] })), _jsx(Menu.Separator, {}), _jsx(Menu.Item, { icon: isLoading ? 'minus' : 'plus', value: "4", onClick: () => setIsLoading(val => !val), children: isLoading ? 'Switch Off Loader' : 'Switch On Loader' })] }) }));
92
+ };
93
+ export const withLoader = SkeletonTemplate.bind({});
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { fireEvent, render } from '@testing-library/react';
3
3
  import { Button } from '../button';
4
+ import { Menu } from '../menu';
4
5
  import { Popover } from './popover';
5
6
  describe('<Popover>', () => {
6
7
  test(' it should render properly', () => {
@@ -23,4 +24,16 @@ describe('<Popover>', () => {
23
24
  const { container } = render(_jsx(Popover, { placement: "bottom-start", trigger: _jsx(Button, { kind: "flat", children: "Open popover" }), disabled: true, children: _jsx("div", { children: "Some Content" }) }));
24
25
  expect(container).not.toBeNull();
25
26
  });
27
+ test(' it should open/close properly', () => {
28
+ const handleClickSpy = jest.fn();
29
+ const { getByTestId } = render(_jsx(Popover, { open: true, placement: "bottom-start", trigger: _jsx(Button, { kind: "flat", children: "Open popover" }), closeOnInsideClick: true, children: _jsx(Menu, { children: _jsx(Menu.Item, { autoFocus: true, icon: "arrow-right", value: "1", onClick: handleClickSpy, "data-testid": "menu-item", children: "menu item" }) }) }));
30
+ const btn = getByTestId('Button');
31
+ const item = getByTestId('menu-item');
32
+ fireEvent.click(btn);
33
+ const tooltip = getByTestId('tooltip');
34
+ expect(item).toBeDefined();
35
+ expect(tooltip).toBeDefined();
36
+ fireEvent.click(item);
37
+ expect(handleClickSpy).toHaveBeenCalledTimes(1);
38
+ });
26
39
  });
@@ -1 +1 @@
1
- {"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../../src/components/spinner/spinner.tsx"],"names":[],"mappings":"AAkBA,OAAO,EAAc,aAAa,EAAE,MAAM,OAAO,CAAC;AAElD,oBAAY,YAAY,GAAG,aAAa,CAAC,UAAU,CAAC,GAAG;IACrD;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,KAAK,CAAC;IACxC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAA;AAED,eAAO,MAAM,OAAO;IAVlB;;OAEG;;IAEH;;OAEG;;iDA8DH,CAAC"}
1
+ {"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../../src/components/spinner/spinner.tsx"],"names":[],"mappings":"AAoBA,OAAO,EAAc,aAAa,EAAE,MAAM,OAAO,CAAC;AAElD,oBAAY,YAAY,GAAG,aAAa,CAAC,UAAU,CAAC,GAAG;IACrD;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,KAAK,CAAC;IACxC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAA;AAED,eAAO,MAAM,OAAO;IAVlB;;OAEG;;IAEH;;OAEG;;iDA8DH,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  /*
3
- * Copyright 2022-2023 Wonderflow Design Team
3
+ * Copyright 2022-2024 Wonderflow Design Team
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
6
6
  * you may not use this file except in compliance with the License.
@@ -15,7 +15,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
15
15
  * limitations under the License.
16
16
  */
17
17
  import clsx from 'clsx';
18
- import { domMax, LazyMotion, m } from 'framer-motion';
18
+ import { domMax, LazyMotion, m, } from 'framer-motion';
19
19
  import { forwardRef } from 'react';
20
20
  export const Spinner = forwardRef(({ className, style, color, dimension = 'big', }, forwardedRef) => {
21
21
  const attributes = {
@@ -1,4 +1,5 @@
1
1
  export * from './channels';
2
2
  export * from './feedbackCount';
3
+ export * from './products';
3
4
  export * from './prosCons';
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/examples/charts/mock-data/index.ts"],"names":[],"mappings":"AAgBA,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/examples/charts/mock-data/index.ts"],"names":[],"mappings":"AAgBA,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,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.
@@ -15,4 +15,5 @@
15
15
  */
16
16
  export * from './channels';
17
17
  export * from './feedbackCount';
18
+ export * from './products';
18
19
  export * from './prosCons';
@@ -0,0 +1,17 @@
1
+ export declare const products: {
2
+ date: string;
3
+ overlay: number;
4
+ 'QN95B Neo QLED 4K TV': number;
5
+ 'Q800A Neo QLED 4K TV': number;
6
+ 'Q60A QLED 4K TV': number;
7
+ 'C2 OLED 4K TV': number;
8
+ 'G2 OLED Evo 4K TV': number;
9
+ 'B2 OLED 4K TV': number;
10
+ 'A95K QD-OLED 4K TV': number;
11
+ 'X95J LED 4K TV': number;
12
+ 'X85J LED 4K TV': number;
13
+ 'R6485Q Mini-LED QLED 4K TV': number;
14
+ 'S546Q 4K QLED TV': number;
15
+ 'S435 4K Roku TV': number;
16
+ }[];
17
+ //# sourceMappingURL=products.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"products.d.ts","sourceRoot":"","sources":["../../../../src/examples/charts/mock-data/products.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;GAiUpB,CAAC"}
@@ -0,0 +1,337 @@
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 products = [
17
+ {
18
+ date: '2000',
19
+ overlay: 0.65,
20
+ 'QN95B Neo QLED 4K TV': 875,
21
+ 'Q800A Neo QLED 4K TV': 715,
22
+ 'Q60A QLED 4K TV': 184,
23
+ 'C2 OLED 4K TV': 428,
24
+ 'G2 OLED Evo 4K TV': 137,
25
+ 'B2 OLED 4K TV': 117,
26
+ 'A95K QD-OLED 4K TV': 738,
27
+ 'X95J LED 4K TV': 811,
28
+ 'X85J LED 4K TV': 101,
29
+ 'R6485Q Mini-LED QLED 4K TV': 47,
30
+ 'S546Q 4K QLED TV': 698,
31
+ 'S435 4K Roku TV': 308,
32
+ },
33
+ {
34
+ date: '2001',
35
+ overlay: 0.30,
36
+ 'QN95B Neo QLED 4K TV': 859,
37
+ 'Q800A Neo QLED 4K TV': 507,
38
+ 'Q60A QLED 4K TV': 123,
39
+ 'C2 OLED 4K TV': 322,
40
+ 'G2 OLED Evo 4K TV': 146,
41
+ 'B2 OLED 4K TV': 132,
42
+ 'A95K QD-OLED 4K TV': 605,
43
+ 'X95J LED 4K TV': 768,
44
+ 'X85J LED 4K TV': 224,
45
+ 'R6485Q Mini-LED QLED 4K TV': 61,
46
+ 'S546Q 4K QLED TV': 741,
47
+ 'S435 4K Roku TV': 259,
48
+ },
49
+ {
50
+ date: '2002',
51
+ overlay: 0.68,
52
+ 'QN95B Neo QLED 4K TV': 633,
53
+ 'Q800A Neo QLED 4K TV': 413,
54
+ 'Q60A QLED 4K TV': 237,
55
+ 'C2 OLED 4K TV': 384,
56
+ 'G2 OLED Evo 4K TV': 144,
57
+ 'B2 OLED 4K TV': 530,
58
+ 'A95K QD-OLED 4K TV': 833,
59
+ 'X95J LED 4K TV': 605,
60
+ 'X85J LED 4K TV': 316,
61
+ 'R6485Q Mini-LED QLED 4K TV': 92,
62
+ 'S546Q 4K QLED TV': 616,
63
+ 'S435 4K Roku TV': 184,
64
+ },
65
+ {
66
+ date: '2003',
67
+ overlay: 0.93,
68
+ 'QN95B Neo QLED 4K TV': 506,
69
+ 'Q800A Neo QLED 4K TV': 452,
70
+ 'Q60A QLED 4K TV': 310,
71
+ 'C2 OLED 4K TV': 226,
72
+ 'G2 OLED Evo 4K TV': 196,
73
+ 'B2 OLED 4K TV': 505,
74
+ 'A95K QD-OLED 4K TV': 777,
75
+ 'X95J LED 4K TV': 632,
76
+ 'X85J LED 4K TV': 270,
77
+ 'R6485Q Mini-LED QLED 4K TV': 63,
78
+ 'S546Q 4K QLED TV': 825,
79
+ 'S435 4K Roku TV': 155,
80
+ },
81
+ {
82
+ date: '2004',
83
+ overlay: 0.81,
84
+ 'QN95B Neo QLED 4K TV': 482,
85
+ 'Q800A Neo QLED 4K TV': 662,
86
+ 'Q60A QLED 4K TV': 275,
87
+ 'C2 OLED 4K TV': 221,
88
+ 'G2 OLED Evo 4K TV': 181,
89
+ 'B2 OLED 4K TV': 579,
90
+ 'A95K QD-OLED 4K TV': 679,
91
+ 'X95J LED 4K TV': 509,
92
+ 'X85J LED 4K TV': 271,
93
+ 'R6485Q Mini-LED QLED 4K TV': 85,
94
+ 'S546Q 4K QLED TV': 779,
95
+ 'S435 4K Roku TV': 149,
96
+ },
97
+ {
98
+ date: '2005',
99
+ overlay: 0.86,
100
+ 'QN95B Neo QLED 4K TV': 503,
101
+ 'Q800A Neo QLED 4K TV': 697,
102
+ 'Q60A QLED 4K TV': 244,
103
+ 'C2 OLED 4K TV': 216,
104
+ 'G2 OLED Evo 4K TV': 139,
105
+ 'B2 OLED 4K TV': 409,
106
+ 'A95K QD-OLED 4K TV': 875,
107
+ 'X95J LED 4K TV': 519,
108
+ 'X85J LED 4K TV': 221,
109
+ 'R6485Q Mini-LED QLED 4K TV': 56,
110
+ 'S546Q 4K QLED TV': 789,
111
+ 'S435 4K Roku TV': 116,
112
+ },
113
+ {
114
+ date: '2006',
115
+ overlay: 0.06,
116
+ 'QN95B Neo QLED 4K TV': 532,
117
+ 'Q800A Neo QLED 4K TV': 658,
118
+ 'Q60A QLED 4K TV': 214,
119
+ 'C2 OLED 4K TV': 229,
120
+ 'G2 OLED Evo 4K TV': 182,
121
+ 'B2 OLED 4K TV': 486,
122
+ 'A95K QD-OLED 4K TV': 782,
123
+ 'X95J LED 4K TV': 503,
124
+ 'X85J LED 4K TV': 252,
125
+ 'R6485Q Mini-LED QLED 4K TV': 34,
126
+ 'S546Q 4K QLED TV': 654,
127
+ 'S435 4K Roku TV': 122,
128
+ },
129
+ {
130
+ date: '2007',
131
+ overlay: 0.67,
132
+ 'QN95B Neo QLED 4K TV': 584,
133
+ 'Q800A Neo QLED 4K TV': 570,
134
+ 'Q60A QLED 4K TV': 262,
135
+ 'C2 OLED 4K TV': 183,
136
+ 'G2 OLED Evo 4K TV': 176,
137
+ 'B2 OLED 4K TV': 522,
138
+ 'A95K QD-OLED 4K TV': 649,
139
+ 'X95J LED 4K TV': 353,
140
+ 'X85J LED 4K TV': 247,
141
+ 'R6485Q Mini-LED QLED 4K TV': 41,
142
+ 'S546Q 4K QLED TV': 526,
143
+ 'S435 4K Roku TV': 266,
144
+ },
145
+ {
146
+ date: '2008',
147
+ overlay: 0.92,
148
+ 'QN95B Neo QLED 4K TV': 499,
149
+ 'Q800A Neo QLED 4K TV': 629,
150
+ 'Q60A QLED 4K TV': 130,
151
+ 'C2 OLED 4K TV': 164,
152
+ 'G2 OLED Evo 4K TV': 137,
153
+ 'B2 OLED 4K TV': 682,
154
+ 'A95K QD-OLED 4K TV': 664,
155
+ 'X95J LED 4K TV': 488,
156
+ 'X85J LED 4K TV': 156,
157
+ 'R6485Q Mini-LED QLED 4K TV': 61,
158
+ 'S546Q 4K QLED TV': 474,
159
+ 'S435 4K Roku TV': 204,
160
+ },
161
+ {
162
+ date: '2009',
163
+ overlay: 0.84,
164
+ 'QN95B Neo QLED 4K TV': 447,
165
+ 'Q800A Neo QLED 4K TV': 687,
166
+ 'Q60A QLED 4K TV': 114,
167
+ 'C2 OLED 4K TV': 236,
168
+ 'G2 OLED Evo 4K TV': 225,
169
+ 'B2 OLED 4K TV': 557,
170
+ 'A95K QD-OLED 4K TV': 556,
171
+ 'X95J LED 4K TV': 458,
172
+ 'X85J LED 4K TV': 177,
173
+ 'R6485Q Mini-LED QLED 4K TV': 89,
174
+ 'S546Q 4K QLED TV': 380,
175
+ 'S435 4K Roku TV': 253,
176
+ },
177
+ {
178
+ date: '2010',
179
+ overlay: 0.34,
180
+ 'QN95B Neo QLED 4K TV': 519,
181
+ 'Q800A Neo QLED 4K TV': 406,
182
+ 'Q60A QLED 4K TV': 155,
183
+ 'C2 OLED 4K TV': 180,
184
+ 'G2 OLED Evo 4K TV': 243,
185
+ 'B2 OLED 4K TV': 445,
186
+ 'A95K QD-OLED 4K TV': 555,
187
+ 'X95J LED 4K TV': 380,
188
+ 'X85J LED 4K TV': 160,
189
+ 'R6485Q Mini-LED QLED 4K TV': 71,
190
+ 'S546Q 4K QLED TV': 127,
191
+ 'S435 4K Roku TV': 187,
192
+ },
193
+ {
194
+ date: '2011',
195
+ overlay: 0.14,
196
+ 'QN95B Neo QLED 4K TV': 500,
197
+ 'Q800A Neo QLED 4K TV': 336,
198
+ 'Q60A QLED 4K TV': 90,
199
+ 'C2 OLED 4K TV': 221,
200
+ 'G2 OLED Evo 4K TV': 252,
201
+ 'B2 OLED 4K TV': 441,
202
+ 'A95K QD-OLED 4K TV': 570,
203
+ 'X95J LED 4K TV': 315,
204
+ 'X85J LED 4K TV': 147,
205
+ 'R6485Q Mini-LED QLED 4K TV': 77,
206
+ 'S546Q 4K QLED TV': 237,
207
+ 'S435 4K Roku TV': 169,
208
+ },
209
+ {
210
+ date: '2012',
211
+ overlay: 0.30,
212
+ 'QN95B Neo QLED 4K TV': 420,
213
+ 'Q800A Neo QLED 4K TV': 374,
214
+ 'Q60A QLED 4K TV': 82,
215
+ 'C2 OLED 4K TV': 203,
216
+ 'G2 OLED Evo 4K TV': 312,
217
+ 'B2 OLED 4K TV': 439,
218
+ 'A95K QD-OLED 4K TV': 439,
219
+ 'X95J LED 4K TV': 385,
220
+ 'X85J LED 4K TV': 184,
221
+ 'R6485Q Mini-LED QLED 4K TV': 71,
222
+ 'S546Q 4K QLED TV': 243,
223
+ 'S435 4K Roku TV': 144,
224
+ },
225
+ {
226
+ date: '2013',
227
+ overlay: 0.41,
228
+ 'QN95B Neo QLED 4K TV': 519,
229
+ 'Q800A Neo QLED 4K TV': 334,
230
+ 'Q60A QLED 4K TV': 103,
231
+ 'C2 OLED 4K TV': 192,
232
+ 'G2 OLED Evo 4K TV': 474,
233
+ 'B2 OLED 4K TV': 389,
234
+ 'A95K QD-OLED 4K TV': 414,
235
+ 'X95J LED 4K TV': 289,
236
+ 'X85J LED 4K TV': 182,
237
+ 'R6485Q Mini-LED QLED 4K TV': 40,
238
+ 'S546Q 4K QLED TV': 314,
239
+ 'S435 4K Roku TV': 241,
240
+ },
241
+ {
242
+ date: '2014',
243
+ overlay: 0.94,
244
+ 'QN95B Neo QLED 4K TV': 668,
245
+ 'Q800A Neo QLED 4K TV': 255,
246
+ 'Q60A QLED 4K TV': 121,
247
+ 'C2 OLED 4K TV': 140,
248
+ 'G2 OLED Evo 4K TV': 323,
249
+ 'B2 OLED 4K TV': 321,
250
+ 'A95K QD-OLED 4K TV': 520,
251
+ 'X95J LED 4K TV': 274,
252
+ 'X85J LED 4K TV': 207,
253
+ 'R6485Q Mini-LED QLED 4K TV': 54,
254
+ 'S546Q 4K QLED TV': 347,
255
+ 'S435 4K Roku TV': 248,
256
+ },
257
+ {
258
+ date: '2015',
259
+ overlay: 0.13,
260
+ 'QN95B Neo QLED 4K TV': 583,
261
+ 'Q800A Neo QLED 4K TV': 259,
262
+ 'Q60A QLED 4K TV': 149,
263
+ 'C2 OLED 4K TV': 155,
264
+ 'G2 OLED Evo 4K TV': 229,
265
+ 'B2 OLED 4K TV': 333,
266
+ 'A95K QD-OLED 4K TV': 474,
267
+ 'X95J LED 4K TV': 298,
268
+ 'X85J LED 4K TV': 267,
269
+ 'R6485Q Mini-LED QLED 4K TV': 78,
270
+ 'S546Q 4K QLED TV': 302,
271
+ 'S435 4K Roku TV': 310,
272
+ },
273
+ {
274
+ date: '2016',
275
+ overlay: 0.88,
276
+ 'QN95B Neo QLED 4K TV': 564,
277
+ 'Q800A Neo QLED 4K TV': 291,
278
+ 'Q60A QLED 4K TV': 101,
279
+ 'C2 OLED 4K TV': 165,
280
+ 'G2 OLED Evo 4K TV': 270,
281
+ 'B2 OLED 4K TV': 345,
282
+ 'A95K QD-OLED 4K TV': 463,
283
+ 'X95J LED 4K TV': 233,
284
+ 'X85J LED 4K TV': 293,
285
+ 'R6485Q Mini-LED QLED 4K TV': 90,
286
+ 'S546Q 4K QLED TV': 359,
287
+ 'S435 4K Roku TV': 283,
288
+ },
289
+ {
290
+ date: '2017',
291
+ overlay: 0.44,
292
+ 'QN95B Neo QLED 4K TV': 631,
293
+ 'Q800A Neo QLED 4K TV': 280,
294
+ 'Q60A QLED 4K TV': 147,
295
+ 'C2 OLED 4K TV': 185,
296
+ 'G2 OLED Evo 4K TV': 106,
297
+ 'B2 OLED 4K TV': 326,
298
+ 'A95K QD-OLED 4K TV': 426,
299
+ 'X95J LED 4K TV': 254,
300
+ 'X85J LED 4K TV': 210,
301
+ 'R6485Q Mini-LED QLED 4K TV': 89,
302
+ 'S546Q 4K QLED TV': 216,
303
+ 'S435 4K Roku TV': 294,
304
+ },
305
+ {
306
+ date: '2018',
307
+ overlay: 0.76,
308
+ 'QN95B Neo QLED 4K TV': 524,
309
+ 'Q800A Neo QLED 4K TV': 231,
310
+ 'Q60A QLED 4K TV': 196,
311
+ 'C2 OLED 4K TV': 216,
312
+ 'G2 OLED Evo 4K TV': 141,
313
+ 'B2 OLED 4K TV': 361,
314
+ 'A95K QD-OLED 4K TV': 476,
315
+ 'X95J LED 4K TV': 246,
316
+ 'X85J LED 4K TV': 267,
317
+ 'R6485Q Mini-LED QLED 4K TV': 93,
318
+ 'S546Q 4K QLED TV': 240,
319
+ 'S435 4K Roku TV': 269,
320
+ },
321
+ {
322
+ date: '2019',
323
+ overlay: 0.34,
324
+ 'QN95B Neo QLED 4K TV': 415,
325
+ 'Q800A Neo QLED 4K TV': 319,
326
+ 'Q60A QLED 4K TV': 263,
327
+ 'C2 OLED 4K TV': 275,
328
+ 'G2 OLED Evo 4K TV': 223,
329
+ 'B2 OLED 4K TV': 142,
330
+ 'A95K QD-OLED 4K TV': 575,
331
+ 'X95J LED 4K TV': 188,
332
+ 'X85J LED 4K TV': 215,
333
+ 'R6485Q Mini-LED QLED 4K TV': 82,
334
+ 'S546Q 4K QLED TV': 185,
335
+ 'S435 4K Roku TV': 321,
336
+ },
337
+ ];
@@ -3,8 +3,7 @@ import { ComponentMeta, ComponentStory } from '@storybook/react';
3
3
  import { CartesianBase } from '@wonderflow/charts';
4
4
  declare const story: ComponentMeta<typeof CartesianBase>;
5
5
  export default story;
6
- export declare const Default: ComponentStory<import("react").FC<import("@wonderflow/charts").CartesianBaseProps>>;
7
- export declare const TwoAxis: ComponentStory<import("react").FC<import("@wonderflow/charts").CartesianBaseProps>>;
8
- export declare const WithLegend: ComponentStory<import("react").FC<import("@wonderflow/charts").CartesianBaseProps>>;
9
- export declare const WithCustomEmptyState: ComponentStory<import("react").FC<import("@wonderflow/charts").CartesianBaseProps>>;
6
+ export declare const Default: ComponentStory<import("react").ForwardRefExoticComponent<import("@wonderflow/charts").CartesianBaseProps & import("react").RefAttributes<HTMLElement>>>;
7
+ export declare const TwoAxis: ComponentStory<import("react").ForwardRefExoticComponent<import("@wonderflow/charts").CartesianBaseProps & import("react").RefAttributes<HTMLElement>>>;
8
+ export declare const WithCustomEmptyState: ComponentStory<import("react").ForwardRefExoticComponent<import("@wonderflow/charts").CartesianBaseProps & import("react").RefAttributes<HTMLElement>>>;
10
9
  //# sourceMappingURL=cartesian-base.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cartesian-base.stories.d.ts","sourceRoot":"","sources":["../../../../src/examples/charts/storybook/cartesian-base.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAOnD,QAAA,MAAM,KAAK,EAAE,aAAa,CAAC,OAAO,aAAa,CAmE9C,CAAC;AAEF,eAAe,KAAK,CAAC;AAIrB,eAAO,MAAM,OAAO,qFAAoB,CAAC;AAGzC,eAAO,MAAM,OAAO,qFAAoB,CAAC;AAiCzC,eAAO,MAAM,UAAU,qFAAoB,CAAC;AAG5C,eAAO,MAAM,oBAAoB,qFAAoB,CAAC"}
1
+ {"version":3,"file":"cartesian-base.stories.d.ts","sourceRoot":"","sources":["../../../../src/examples/charts/storybook/cartesian-base.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAOnD,QAAA,MAAM,KAAK,EAAE,aAAa,CAAC,OAAO,aAAa,CAoH9C,CAAC;AAEF,eAAe,KAAK,CAAC;AAIrB,eAAO,MAAM,OAAO,yJAAoB,CAAC;AAGzC,eAAO,MAAM,OAAO,yJAAoB,CAAC;AAsDzC,eAAO,MAAM,oBAAoB,yJAAoB,CAAC"}
@@ -64,8 +64,57 @@ const story = {
64
64
  hideTicks: false,
65
65
  },
66
66
  },
67
+ axisFiltered: {
68
+ top: {
69
+ domain: [
70
+ 'ALabelThatExceedTwentyCharacters',
71
+ 'BLabelThatExceedTwentyCharacters',
72
+ 'CLabelThatExceedTwentyCharacters',
73
+ 'DLabelThatExceedTwentyCharacters',
74
+ 'ELabelThatExceedTwentyCharacters',
75
+ 'FLabelThatExceedTwentyCharacters',
76
+ ],
77
+ orientation: 'top',
78
+ scaleType: 'label',
79
+ label: 'Top Label',
80
+ paddingOuter: 0,
81
+ paddingInner: 1,
82
+ tickFormat: (v, i) => (`Prefix${i} + ${v} + Suffix`),
83
+ hideAxisLine: false,
84
+ hideTickLabel: false,
85
+ hideTicks: false,
86
+ },
87
+ right: {
88
+ domain: [0, 0.010],
89
+ orientation: 'right',
90
+ scaleType: 'linear',
91
+ label: 'Right Label',
92
+ tickFormat: (v) => `${JSON.stringify(v)} $`,
93
+ hideAxisLine: false,
94
+ hideTickLabel: false,
95
+ hideTicks: false,
96
+ },
97
+ bottom: {
98
+ domain: [new Date('2020-01-01').getTime(), new Date('2022-01-01').getTime()],
99
+ orientation: 'bottom',
100
+ label: 'Bottom Label',
101
+ scaleType: 'time',
102
+ hideAxisLine: false,
103
+ hideTickLabel: false,
104
+ hideTicks: false,
105
+ },
106
+ left: {
107
+ domain: [0, 10000],
108
+ orientation: 'left',
109
+ scaleType: 'linear',
110
+ label: 'Left Label',
111
+ hideAxisLine: false,
112
+ hideTickLabel: false,
113
+ hideTicks: false,
114
+ },
115
+ },
116
+ onBrushChange: () => ({}),
67
117
  styleConfig: {},
68
- children: undefined,
69
118
  },
70
119
  argTypes: {},
71
120
  };
@@ -104,11 +153,31 @@ TwoAxis.args = {
104
153
  numTicks: 10,
105
154
  },
106
155
  },
156
+ axisFiltered: {
157
+ top: undefined,
158
+ right: undefined,
159
+ bottom: {
160
+ domain: [new Date('2020-01-01').getTime(), new Date('2020-01-10').getTime()],
161
+ orientation: 'bottom',
162
+ label: 'Time',
163
+ scaleType: 'time',
164
+ numTicks: 10,
165
+ },
166
+ left: {
167
+ domain: [0, 1000],
168
+ orientation: 'left',
169
+ scaleType: 'linear',
170
+ label: 'Quantity',
171
+ hideAxisLine: true,
172
+ hideTicks: true,
173
+ hideZero: true,
174
+ numTicks: 10,
175
+ },
176
+ },
107
177
  };
108
- export const WithLegend = Template.bind({});
109
- WithLegend.args = { customLegend: _jsx("ul", { children: _jsx("li", { style: { fontSize: '12px' }, children: "some legend content here" }) }) };
110
178
  export const WithCustomEmptyState = Template.bind({});
111
179
  WithCustomEmptyState.args = {
112
180
  axis: { ...story.args.axis, top: undefined, right: undefined },
181
+ axisFiltered: { ...story.args.axis, top: undefined, right: undefined },
113
182
  emptyState: (_jsx(Stack, { vAlign: "center", hAlign: "center", className: styles.InfoState, children: _jsx(InfoState, { title: "With Info State", icon: "compass", children: _jsx(Stack, { hAlign: "center", fill: false, children: "This custom empty state uses an Info State component." }) }) })),
114
183
  };
@@ -1,19 +1,231 @@
1
1
  /// <reference types="react" />
2
2
  import { ComponentMeta, ComponentStory } from '@storybook/react';
3
- import { LineChart, LineChartProps } from '@wonderflow/charts';
3
+ import { CartesianChartLayout, LineChart } from '@wonderflow/charts';
4
4
  declare const story: ComponentMeta<typeof LineChart>;
5
5
  export default story;
6
- export declare const Default: ComponentStory<import("react").FC<LineChartProps>>;
7
- export declare const withOverlay: ComponentStory<import("react").FC<LineChartProps>>;
8
- export declare const withMissingData: ComponentStory<import("react").FC<LineChartProps>>;
9
- export declare const withMultipleSeries: ComponentStory<import("react").FC<LineChartProps>>;
10
- export declare const withLabelIndex: ComponentStory<import("react").FC<LineChartProps>>;
11
- export declare const withNestedData: ComponentStory<import("react").FC<LineChartProps>>;
12
- export declare const withCustomLineStyle: ComponentStory<import("react").FC<LineChartProps>>;
13
- export declare const withCustomDomain: ComponentStory<import("react").FC<LineChartProps>>;
14
- export declare const withVerticalLayout: ComponentStory<import("react").FC<LineChartProps>>;
15
- export declare const withNoData: ComponentStory<import("react").FC<LineChartProps>>;
16
- export declare const renderAsLines: ComponentStory<import("react").FC<LineChartProps>>;
17
- export declare const renderAsSteps: ComponentStory<import("react").FC<LineChartProps>>;
18
- export declare const WithinCard: ComponentStory<import("react").FC<LineChartProps>>;
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>>>;
19
231
  //# sourceMappingURL=line-chart.stories.d.ts.map
@@ -1 +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,EAAwB,SAAS,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAUrF,QAAA,MAAM,KAAK,EAAE,aAAa,CAAC,OAAO,SAAS,CAyC1C,CAAC;AAEF,eAAe,KAAK,CAAC;AAIrB,eAAO,MAAM,OAAO,oDAAoB,CAAC;AAGzC,eAAO,MAAM,WAAW,oDAAoB,CAAC;AAS7C,eAAO,MAAM,eAAe,oDAAoB,CAAC;AAUjD,eAAO,MAAM,kBAAkB,oDAAoB,CAAC;AAiBpD,eAAO,MAAM,cAAc,oDAAoB,CAAC;AAehD,eAAO,MAAM,cAAc,oDAAoB,CAAC;AAgChD,eAAO,MAAM,mBAAmB,oDAAoB,CAAC;AA8BrD,eAAO,MAAM,gBAAgB,oDAAoB,CAAC;AAclD,eAAO,MAAM,kBAAkB,oDAAoB,CAAC;AAiBpD,eAAO,MAAM,UAAU,oDAAoB,CAAC;AAQ5C,eAAO,MAAM,aAAa,oDAAoB,CAAC;AAiB/C,eAAO,MAAM,aAAa,oDAAoB,CAAC;AA0B/C,eAAO,MAAM,UAAU,oDAA8B,CAAC"}
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"}
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { CartesianChartLayout, LineChart } from '@wonderflow/charts';
3
3
  import { Card } from '../../..';
4
4
  // import { CartesianChartLayout, LineChart, LineChartProps } from '../../../../../charts/src';
5
- import { channels, channelsB, feedbackCount, feedbackCountGaps, proCons, } from '../mock-data';
5
+ import { channels, channelsB, feedbackCount, feedbackCountGaps, proCons, products, } from '../mock-data';
6
6
  import styles from './sb-charts.module.css';
7
7
  const story = {
8
8
  title: 'Charts/Line Chart',
@@ -15,6 +15,8 @@ const story = {
15
15
  showMarker: false,
16
16
  showMarkerLabel: false,
17
17
  hideMissingDataConnection: false,
18
+ showAverage: false,
19
+ showBrush: false,
18
20
  hideLegend: false,
19
21
  hidePadding: false,
20
22
  layout: CartesianChartLayout.HORIZONTAL,
@@ -58,6 +60,11 @@ withOverlay.args = {
58
60
  label: 'Overlay',
59
61
  },
60
62
  };
63
+ export const withAverage = Template.bind({});
64
+ withAverage.args = {
65
+ subtitle: 'A trend line chart with average',
66
+ showAverage: true,
67
+ };
61
68
  export const withMissingData = Template.bind({});
62
69
  withMissingData.args = {
63
70
  data: feedbackCountGaps,
@@ -83,10 +90,10 @@ withMultipleSeries.args = {
83
90
  style: [undefined, undefined, { stroke: 'gray' }],
84
91
  },
85
92
  };
86
- export const withLabelIndex = Template.bind({});
87
- withLabelIndex.args = {
93
+ export const withCategoriesOnIndex = Template.bind({});
94
+ withCategoriesOnIndex.args = {
88
95
  title: 'Multiple Series',
89
- subtitle: 'A line chart with label index',
96
+ subtitle: 'A line chart with categories on index',
90
97
  data: channels,
91
98
  index: {
92
99
  dataKey: 'channel',
@@ -120,8 +127,8 @@ withNestedData.args = {
120
127
  },
121
128
  },
122
129
  tooltip: {
123
- extraSeriesData: series => `${series.percentage}%`,
124
- extraOverlayData: overlay => `${overlay.percentage}%`,
130
+ extraSeriesData: (series) => `${series.percentage}%`,
131
+ extraOverlayData: (overlay) => `${overlay.percentage}%`,
125
132
  extraContent: _jsx("div", { children: "some extra content" }),
126
133
  },
127
134
  renderAs: 'lines',
@@ -157,6 +164,38 @@ withCustomLineStyle.args = {
157
164
  ],
158
165
  },
159
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
+ };
160
199
  export const withCustomDomain = Template.bind({});
161
200
  withCustomDomain.args = {
162
201
  subtitle: 'A trend line chart with custom domain',
@@ -225,7 +264,10 @@ renderAsSteps.args = {
225
264
  label: 'Pros & cons',
226
265
  },
227
266
  };
228
- const WithinCardTemplate = args => (_jsx(Card, { bordered: true, className: styles.Card, children: _jsx(LineChart, { ...args }) }));
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
+ };
229
271
  export const WithinCard = WithinCardTemplate.bind({});
230
272
  WithinCard.args = {
231
273
  subtitle: 'A trend line chart within a card 75vh and width 100%',
@@ -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.8.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",
@@ -78,18 +78,17 @@
78
78
  "@storybook/test-runner": "0.9.4",
79
79
  "@storybook/testing-react": "1.3.0",
80
80
  "@storybook/theming": "6.5.16",
81
- "@types/d3": "7.4.1",
82
81
  "@types/react": "17.0.43",
83
82
  "@types/react-dom": "17.0.14",
84
- "@types/react-table": "7.7.12",
85
- "@types/react-test-renderer": "18.0.0",
86
- "@wonderflow/config": "12.8.0",
87
- "@wonderflow/tokens": "12.8.0",
88
- "@wonderflow/charts": "12.8.0",
89
- "@types/uuid": "9.0.2",
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",
90
89
  "babel-loader": "8.2.5",
91
90
  "cpy-cli": "3.1.1",
92
- "postcss": "8.4.17",
91
+ "postcss": "8.4.32",
93
92
  "postcss-cli": "10.0.0",
94
93
  "react": "17.0.2",
95
94
  "react-dom": "17.0.2",
@@ -102,37 +101,22 @@
102
101
  "typescript-plugin-css-modules": "3.4.0"
103
102
  },
104
103
  "dependencies": {
105
- "@radix-ui/react-tabs": "1.0.0",
106
- "@visx/annotation": "3.3.0",
107
- "@visx/axis": "3.3.0",
108
- "@visx/curve": "3.3.0",
109
- "@visx/event": "3.3.0",
110
- "@visx/gradient": "3.3.0",
111
- "@visx/grid": "3.3.0",
112
- "@visx/group": "3.3.0",
113
- "@visx/mock-data": "3.3.0",
114
- "@visx/responsive": "3.3.0",
115
- "@visx/scale": "3.3.0",
116
- "@visx/shape": "3.3.0",
117
- "@visx/text": "3.3.0",
118
- "@visx/tooltip": "3.3.0",
119
- "@visx/vendor": "3.3.0",
120
- "ahooks": "3.7.5",
104
+ "@radix-ui/react-tabs": "1.0.4",
105
+ "ahooks": "3.7.8",
121
106
  "clsx": "1.2.1",
122
107
  "constate": "3.3.2",
123
- "d3": "7.8.5",
124
108
  "framer-motion": "6.5.1",
125
109
  "lodash": "4.17.21",
126
- "react-focus-on": "3.6.0",
110
+ "react-focus-on": "3.9.1",
127
111
  "react-masonry-css": "1.0.16",
128
- "react-merge-refs": "2.0.1",
129
- "react-paginate": "8.1.3",
112
+ "react-merge-refs": "2.1.1",
113
+ "react-paginate": "8.2.0",
130
114
  "react-popper-tooltip": "4.4.2",
131
115
  "react-roving-tabindex": "3.2.0",
132
116
  "react-table": "7.8.0",
133
- "react-uid": "2.3.2",
134
- "slugify": "1.6.5",
117
+ "react-uid": "2.3.3",
118
+ "slugify": "1.6.6",
135
119
  "type-fest": "3.0.0",
136
- "uuid": "9.0.0"
120
+ "uuid": "9.0.1"
137
121
  }
138
122
  }