carbon-react 106.6.6 → 106.6.9

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 (76) hide show
  1. package/esm/__internal__/utils/argTypes/specialCharacters.d.ts +36 -0
  2. package/esm/__internal__/utils/argTypes/specialCharacters.js +36 -0
  3. package/esm/components/accordion/accordion-group/accordion-group.component.d.ts +9 -23
  4. package/esm/components/accordion/accordion-group/accordion-group.component.js +222 -25
  5. package/esm/components/accordion/accordion.component.d.ts +44 -2
  6. package/esm/components/accordion/accordion.component.js +648 -68
  7. package/esm/components/accordion/accordion.style.d.ts +45 -9
  8. package/esm/components/accordion/index.d.ts +4 -2
  9. package/esm/components/decimal/decimal.component.js +12 -10
  10. package/esm/components/menu/menu-item/menu-item.style.js +6 -3
  11. package/esm/components/multi-action-button/index.d.ts +2 -1
  12. package/esm/components/multi-action-button/multi-action-button.component.d.ts +9 -52
  13. package/esm/components/multi-action-button/multi-action-button.component.js +471 -67
  14. package/esm/components/multi-action-button/multi-action-button.config.d.ts +3 -3
  15. package/esm/components/multi-action-button/multi-action-button.style.d.ts +10 -2
  16. package/esm/components/multi-action-button/multi-action-button.style.js +4 -7
  17. package/esm/components/portal/portal.js +0 -5
  18. package/esm/components/portrait/portrait-initials.component.js +1 -2
  19. package/esm/components/tile-select/__internal__/accordion/accordion.style.d.ts +2 -2
  20. package/esm/components/tooltip/tooltip.component.d.ts +3 -0
  21. package/esm/style/utils/filter-out-styled-system-spacing-props.d.ts +1 -1
  22. package/esm/style/utils/filter-out-styled-system-spacing-props.js +1 -1
  23. package/lib/__internal__/utils/argTypes/specialCharacters.d.ts +36 -0
  24. package/lib/__internal__/utils/argTypes/specialCharacters.js +46 -0
  25. package/lib/components/accordion/accordion-group/accordion-group.component.d.ts +9 -23
  26. package/lib/components/accordion/accordion-group/accordion-group.component.js +225 -29
  27. package/lib/components/accordion/accordion.component.d.ts +44 -2
  28. package/lib/components/accordion/accordion.component.js +649 -70
  29. package/lib/components/accordion/accordion.style.d.ts +45 -9
  30. package/lib/components/accordion/index.d.ts +4 -2
  31. package/lib/components/decimal/decimal.component.js +12 -10
  32. package/lib/components/menu/menu-item/menu-item.style.js +6 -3
  33. package/lib/components/multi-action-button/index.d.ts +2 -1
  34. package/lib/components/multi-action-button/multi-action-button.component.d.ts +9 -52
  35. package/lib/components/multi-action-button/multi-action-button.component.js +471 -70
  36. package/lib/components/multi-action-button/multi-action-button.config.d.ts +3 -3
  37. package/lib/components/multi-action-button/multi-action-button.style.d.ts +10 -2
  38. package/lib/components/multi-action-button/multi-action-button.style.js +4 -7
  39. package/lib/components/portal/portal.js +0 -6
  40. package/lib/components/portrait/portrait-initials.component.js +1 -5
  41. package/lib/components/tile-select/__internal__/accordion/accordion.style.d.ts +2 -2
  42. package/lib/components/tooltip/tooltip.component.d.ts +3 -0
  43. package/lib/style/utils/filter-out-styled-system-spacing-props.d.ts +1 -1
  44. package/lib/style/utils/filter-out-styled-system-spacing-props.js +1 -1
  45. package/package.json +2 -1
  46. package/esm/__internal__/utils/helpers/browser/index.d.ts +0 -15
  47. package/esm/__internal__/utils/helpers/browser/index.js +0 -33
  48. package/esm/components/accordion/accordion-group/accordion-group.d.ts +0 -17
  49. package/esm/components/accordion/accordion.d.ts +0 -54
  50. package/esm/components/action-popover/action-popover-test.stories.js +0 -76
  51. package/esm/components/button-bar/button-bar-test.stories.js +0 -122
  52. package/esm/components/draggable/draggable-test.stories.js +0 -48
  53. package/esm/components/duelling-picklist/duelling-picklist-test.stories.js +0 -539
  54. package/esm/components/menu/menu-test.stories.js +0 -109
  55. package/esm/components/multi-action-button/multi-action-button.d.ts +0 -10
  56. package/esm/components/profile/profile-test.stories.js +0 -55
  57. package/esm/components/progress-tracker/progress-tracker-test.stories.js +0 -63
  58. package/esm/components/select/simple-select/simple-select-test.stories.js +0 -193
  59. package/esm/components/show-edit-pod/show-edit-pod-test.stories.js +0 -143
  60. package/esm/components/textarea/textarea-test.stories.js +0 -154
  61. package/lib/__internal__/utils/helpers/browser/index.d.ts +0 -15
  62. package/lib/__internal__/utils/helpers/browser/index.js +0 -40
  63. package/lib/__internal__/utils/helpers/browser/package.json +0 -6
  64. package/lib/components/accordion/accordion-group/accordion-group.d.ts +0 -17
  65. package/lib/components/accordion/accordion.d.ts +0 -54
  66. package/lib/components/action-popover/action-popover-test.stories.js +0 -95
  67. package/lib/components/button-bar/button-bar-test.stories.js +0 -145
  68. package/lib/components/draggable/draggable-test.stories.js +0 -66
  69. package/lib/components/duelling-picklist/duelling-picklist-test.stories.js +0 -573
  70. package/lib/components/menu/menu-test.stories.js +0 -132
  71. package/lib/components/multi-action-button/multi-action-button.d.ts +0 -10
  72. package/lib/components/profile/profile-test.stories.js +0 -75
  73. package/lib/components/progress-tracker/progress-tracker-test.stories.js +0 -79
  74. package/lib/components/select/simple-select/simple-select-test.stories.js +0 -206
  75. package/lib/components/show-edit-pod/show-edit-pod-test.stories.js +0 -165
  76. package/lib/components/textarea/textarea-test.stories.js +0 -173
@@ -69,12 +69,11 @@ exports.StyledMultiActionButton = StyledMultiActionButton;
69
69
  const StyledButtonChildrenContainer = _styledComponents.default.div`
70
70
  ${({
71
71
  theme,
72
- align
72
+ align,
73
+ minWidth
73
74
  }) => (0, _styledComponents.css)`
74
75
  background-color: var(--colorsActionMajorYang100);
75
- min-width: ${({
76
- minWidth
77
- }) => minWidth}px;
76
+ min-width: ${minWidth}px;
78
77
  white-space: nowrap;
79
78
  z-index: ${theme.zIndex.popover};
80
79
  box-shadow: var(--boxShadow100);
@@ -110,7 +109,5 @@ StyledButtonChildrenContainer.defaultProps = {
110
109
  theme: _base.default
111
110
  };
112
111
  StyledMultiActionButton.defaultProps = {
113
- theme: _base.default,
114
- size: "medium",
115
- legacyColorVariant: "blue"
112
+ theme: _base.default
116
113
  };
@@ -13,8 +13,6 @@ var _reactDom = _interopRequireDefault(require("react-dom"));
13
13
 
14
14
  var _guid = _interopRequireDefault(require("../../__internal__/utils/helpers/guid"));
15
15
 
16
- var _browser = _interopRequireDefault(require("../../__internal__/utils/helpers/browser"));
17
-
18
16
  var _carbonScopedTokensProvider = _interopRequireDefault(require("../../style/design-tokens/carbon-scoped-tokens-provider/carbon-scoped-tokens-provider.component"));
19
17
 
20
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -97,10 +95,6 @@ const Portal = ({
97
95
  return node;
98
96
  };
99
97
 
100
- if (!_browser.default.isDomAvailable()) {
101
- return null;
102
- }
103
-
104
98
  return /*#__PURE__*/_react.default.createElement("span", {
105
99
  "data-portal-entrance": uniqueId
106
100
  }, /*#__PURE__*/_reactDom.default.createPortal( /*#__PURE__*/_react.default.createElement(_carbonScopedTokensProvider.default, null, children), getPortalContainer()));
@@ -11,8 +11,6 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
11
11
 
12
12
  var _common = _interopRequireDefault(require("@sage/design-tokens/js/base/common"));
13
13
 
14
- var _browser = _interopRequireDefault(require("../../__internal__/utils/helpers/browser"));
15
-
16
14
  var _portrait = require("./portrait.style");
17
15
 
18
16
  var _portrait2 = require("./portrait.config");
@@ -47,9 +45,7 @@ const PortraitInitials = ({
47
45
  textColor,
48
46
  bgColor
49
47
  } = (0, _portrait.getColorsForInitials)(darkBackground);
50
-
51
- let canvas = _browser.default.getDocument().createElement("canvas");
52
-
48
+ let canvas = document.createElement("canvas");
53
49
  const context = canvas.getContext("2d");
54
50
  let {
55
51
  dimensions
@@ -1,2 +1,2 @@
1
- export const StyledContentContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
2
- export const StyledContent: import("styled-components").StyledComponent<"div", any, {}, never>;
1
+ export const StyledContentContainer: import("styled-components").StyledComponent<"div", any, import("../../../accordion/accordion.style").StyledAccordionContentContainerProps, never>;
2
+ export const StyledContent: import("styled-components").StyledComponent<"div", any, import("../../../accordion/accordion.style").StyledAccordionContentProps, never>;
@@ -26,8 +26,11 @@ export interface TooltipProps {
26
26
  * (see https://popper.js.org/docs/v2/modifiers/flip/#fallbackplacements)
27
27
  */
28
28
  flipOverrides?: TooltipPositions[];
29
+ /** @ignore @private */
29
30
  target?: Element;
31
+ /** @ignore @private */
30
32
  isPartOfInput?: boolean;
33
+ /** @ignore @private */
31
34
  inputSize?: InputSizes;
32
35
  }
33
36
  export declare const Tooltip: React.ForwardRefExoticComponent<TooltipProps & React.RefAttributes<HTMLDivElement | null>>;
@@ -1,2 +1,2 @@
1
- declare const filterOutStyledSystemSpacingProps: (obj: Record<string, unknown>) => Record<string, unknown>;
1
+ declare const filterOutStyledSystemSpacingProps: (props: Record<string, any>) => Record<string, unknown>;
2
2
  export default filterOutStyledSystemSpacingProps;
@@ -9,7 +9,7 @@ var _propTypes = _interopRequireDefault(require("@styled-system/prop-types"));
9
9
 
10
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
11
 
12
- const filterOutStyledSystemSpacingProps = obj => Object.fromEntries(Object.entries(obj).filter(([key]) => !_propTypes.default.space[key]));
12
+ const filterOutStyledSystemSpacingProps = props => Object.fromEntries(Object.entries(props).filter(([key]) => !_propTypes.default.space[key]));
13
13
 
14
14
  var _default = filterOutStyledSystemSpacingProps;
15
15
  exports.default = _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-react",
3
- "version": "106.6.6",
3
+ "version": "106.6.9",
4
4
  "description": "A library of reusable React components for easily building user interfaces.",
5
5
  "engineStrict": true,
6
6
  "engines": {
@@ -97,6 +97,7 @@
97
97
  "@types/node": "10.12.18",
98
98
  "@types/react": "16.9.56",
99
99
  "@types/react-dom": "16.9.8",
100
+ "@types/react-is": "^17.0.3",
100
101
  "@types/react-test-renderer": "^17.0.1",
101
102
  "@types/sprintf-js": "^1.1.2",
102
103
  "@types/styled-components": "^5.1.9",
@@ -1,15 +0,0 @@
1
- /**
2
- * Browser provides helper methods for working with Browser behavior.
3
- */
4
- declare const Browser: {
5
- isDomAvailable: () => boolean;
6
- /**
7
- * Get the current window
8
- */
9
- getWindow: () => Window | undefined;
10
- /**
11
- * Get the current document
12
- */
13
- getDocument: () => Document | undefined;
14
- };
15
- export default Browser;
@@ -1,33 +0,0 @@
1
- const globalNode = {
2
- window,
3
- document: window.document,
4
- ...global
5
- };
6
- /**
7
- * Browser provides helper methods for working with Browser behavior.
8
- */
9
-
10
- const Browser = {
11
- isDomAvailable: () => {
12
- const _window = Browser.getWindow();
13
-
14
- const _document = Browser.getDocument();
15
-
16
- return !!(typeof _window !== "undefined" && _document && _document.createElement);
17
- },
18
-
19
- /**
20
- * Get the current window
21
- */
22
- getWindow: () => {
23
- return globalNode.window;
24
- },
25
-
26
- /**
27
- * Get the current document
28
- */
29
- getDocument: () => {
30
- return globalNode.document;
31
- }
32
- };
33
- export default Browser;
@@ -1,17 +0,0 @@
1
- import * as React from "react";
2
- import { MarginProps } from "styled-system";
3
- import { AccordionProps } from "../accordion";
4
-
5
- type AccordionElement =
6
- | React.ReactElement<AccordionProps>
7
- | boolean
8
- | null
9
- | undefined;
10
-
11
- export interface AccordionGroupProps extends MarginProps {
12
- children?: AccordionElement | AccordionElement[];
13
- }
14
-
15
- declare function AccordionGroup(props: AccordionGroupProps): JSX.Element;
16
-
17
- export default AccordionGroup;
@@ -1,54 +0,0 @@
1
- import * as React from "react";
2
- import { SpaceProps } from "styled-system";
3
-
4
- export interface AccordionProps extends SpaceProps {
5
- /** Toggles left and right borders */
6
- borders?: "default" | "full" | "none";
7
- /** Renders the accordion heading in the style of a tertiary button */
8
- buttonHeading?: boolean;
9
- /** Width of the buttonHeading when it's set, defaults to 150px */
10
- buttonWidth?: number;
11
- children?: React.ReactNode;
12
- /** Set the default state of expansion of the Accordion if component is meant to be used as uncontrolled */
13
- defaultExpanded?: boolean;
14
- /** Disable padding for the content */
15
- disableContentPadding?: boolean;
16
- /** Sets the expansion state of the Accordion if component is meant to be used as controlled */
17
- expanded?: boolean;
18
- /** An error message to be displayed in the tooltip */
19
- error?: string;
20
- /** Styled system spacing props provided to Accordion Title */
21
- headerSpacing?: SpaceProps;
22
- id?: string;
23
- /** Sets icon type - accepted values: 'chevron_down' (default), 'dropdown' */
24
- iconType?: "chevron_down" | "dropdown";
25
- /** Sets icon alignment - accepted values: 'left', 'right' (default) */
26
- iconAlign?: "left" | "right";
27
- /** Sets accordion title */
28
- title: React.ReactNode;
29
- /** An info message to be displayed in the tooltip */
30
- info?: string;
31
- /** Callback fired when expansion state changes */
32
- onChange?: (
33
- event: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>,
34
- isExpanded: boolean
35
- ) => void;
36
- /** When the Accordion is open the title can change to this */
37
- openTitle?: string;
38
- /** Sets background as white or transparent */
39
- scheme?: "white" | "transparent";
40
- /** Sets accordion size */
41
- size?: "large" | "small";
42
- /** Sets accordion sub title */
43
- subTitle?: string;
44
- /** A warning message to be displayed in the tooltip */
45
- warning?: string;
46
- /** Sets accordion width */
47
- width?: string;
48
- }
49
-
50
- declare function Accordion(
51
- props: AccordionProps & React.RefAttributes<HTMLDivElement>
52
- ): JSX.Element;
53
-
54
- export default Accordion;
@@ -1,76 +0,0 @@
1
- import React from "react";
2
- import { action } from "@storybook/addon-actions";
3
- import { ActionPopover, ActionPopoverDivider, ActionPopoverItem, ActionPopoverMenu } from ".";
4
- import { FlatTable, FlatTableHead, FlatTableBody, FlatTableRow, FlatTableHeader, FlatTableCell } from "../flat-table";
5
- export default {
6
- title: "Action Popover/Test",
7
- parameters: {
8
- info: {
9
- disable: true
10
- },
11
- chromatic: {
12
- disable: true
13
- }
14
- }
15
- };
16
- export const Default = () => {
17
- const submenu = /*#__PURE__*/React.createElement(ActionPopoverMenu, null, /*#__PURE__*/React.createElement(ActionPopoverItem, {
18
- onClick: action("sub menu 1")
19
- }, "Sub Menu 1"), /*#__PURE__*/React.createElement(ActionPopoverItem, {
20
- onClick: action("sub menu 2")
21
- }, "Sub Menu 2"), /*#__PURE__*/React.createElement(ActionPopoverItem, {
22
- disabled: true,
23
- onClick: action("sub menu 3")
24
- }, "Sub Menu 3"));
25
- const submenuWithIcons = /*#__PURE__*/React.createElement(ActionPopoverMenu, null, /*#__PURE__*/React.createElement(ActionPopoverItem, {
26
- icon: "graph",
27
- onClick: action("sub menu 1")
28
- }, "Sub Menu 1"), /*#__PURE__*/React.createElement(ActionPopoverItem, {
29
- icon: "add",
30
- onClick: action("sub menu 2")
31
- }, "Sub Menu 2"), /*#__PURE__*/React.createElement(ActionPopoverItem, {
32
- icon: "print",
33
- disabled: true,
34
- onClick: action("sub menu 3")
35
- }, "Sub Menu 3"));
36
- return /*#__PURE__*/React.createElement("div", {
37
- style: {
38
- marginTop: "40px",
39
- height: "275px"
40
- }
41
- }, /*#__PURE__*/React.createElement(FlatTable, {
42
- isZebra: true
43
- }, /*#__PURE__*/React.createElement(FlatTableHead, null, /*#__PURE__*/React.createElement(FlatTableRow, null, /*#__PURE__*/React.createElement(FlatTableHeader, null, "First Name"), /*#__PURE__*/React.createElement(FlatTableHeader, null, "Last Name"), /*#__PURE__*/React.createElement(FlatTableHeader, null, "\xA0"))), /*#__PURE__*/React.createElement(FlatTableBody, null, /*#__PURE__*/React.createElement(FlatTableRow, null, /*#__PURE__*/React.createElement(FlatTableCell, null, "John"), /*#__PURE__*/React.createElement(FlatTableCell, null, "Doe"), /*#__PURE__*/React.createElement(FlatTableCell, null, /*#__PURE__*/React.createElement(ActionPopover, {
44
- onOpen: action("popover opened"),
45
- onClose: action("popover closed")
46
- }, /*#__PURE__*/React.createElement(ActionPopoverItem, {
47
- disabled: true,
48
- icon: "graph",
49
- submenu: submenu,
50
- onClick: action("email")
51
- }, "Business"), /*#__PURE__*/React.createElement(ActionPopoverItem, {
52
- icon: "email",
53
- onClick: action("email")
54
- }, "Email Invoice"), /*#__PURE__*/React.createElement(ActionPopoverItem, {
55
- icon: "print",
56
- onClick: action("print"),
57
- submenu: submenu
58
- }, "Print Invoice"), /*#__PURE__*/React.createElement(ActionPopoverItem, {
59
- icon: "pdf",
60
- submenu: submenu,
61
- onClick: action("pdf")
62
- }, "Download PDF"), /*#__PURE__*/React.createElement(ActionPopoverItem, {
63
- icon: "csv",
64
- onClick: action("csv")
65
- }, "Download CSV"), /*#__PURE__*/React.createElement(ActionPopoverDivider, null), /*#__PURE__*/React.createElement(ActionPopoverItem, {
66
- icon: "delete",
67
- onClick: action("delete")
68
- }, "Delete")))), /*#__PURE__*/React.createElement(FlatTableRow, null, /*#__PURE__*/React.createElement(FlatTableCell, null, "Jane"), /*#__PURE__*/React.createElement(FlatTableCell, null, "Smith"), /*#__PURE__*/React.createElement(FlatTableCell, null, /*#__PURE__*/React.createElement(ActionPopover, null, /*#__PURE__*/React.createElement(ActionPopoverItem, {
69
- icon: "csv",
70
- onClick: action("csv")
71
- }, "Download CSV")))), /*#__PURE__*/React.createElement(FlatTableRow, null, /*#__PURE__*/React.createElement(FlatTableCell, null, "Bob"), /*#__PURE__*/React.createElement(FlatTableCell, null, "Jones"), /*#__PURE__*/React.createElement(FlatTableCell, null, /*#__PURE__*/React.createElement(ActionPopover, null, /*#__PURE__*/React.createElement(ActionPopoverItem, {
72
- icon: "csv",
73
- submenu: submenuWithIcons,
74
- onClick: action("csv")
75
- }, "Download CSV")))))));
76
- };
@@ -1,122 +0,0 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
3
- import React from "react";
4
- import { action } from "@storybook/addon-actions";
5
- import Button from "../button";
6
- import ButtonBar from ".";
7
- import IconButton from "../icon-button";
8
- import Icon from "../icon";
9
- import { BUTTON_BAR_ICON_POSITIONS, BUTTON_BAR_SIZES } from "./button-bar.config";
10
- export default {
11
- title: "Button Bar/Test",
12
- parameters: {
13
- info: {
14
- disable: true
15
- },
16
- chromatic: {
17
- disable: true
18
- }
19
- }
20
- };
21
- const commonArgTypesButtonBar = {
22
- size: {
23
- options: BUTTON_BAR_SIZES,
24
- control: {
25
- type: "select"
26
- }
27
- },
28
- iconPosition: {
29
- options: BUTTON_BAR_ICON_POSITIONS,
30
- control: {
31
- type: "select"
32
- }
33
- }
34
- };
35
- const commonArgsButtonBar = {
36
- size: "medium",
37
- fullWidth: false,
38
- iconPosition: "before"
39
- };
40
- export const Default = ({ ...args
41
- }) => /*#__PURE__*/React.createElement(ButtonBar, _extends({
42
- onClick: action("click")
43
- }, args), /*#__PURE__*/React.createElement(Button, {
44
- iconType: "search"
45
- }, "Example Button"), /*#__PURE__*/React.createElement(Button, {
46
- iconType: "pdf"
47
- }, "Example Button"), /*#__PURE__*/React.createElement(Button, {
48
- iconType: "csv"
49
- }, "Example Button"));
50
- export const Preview = () => {
51
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ButtonBar, {
52
- ml: 2,
53
- mt: 2
54
- }, /*#__PURE__*/React.createElement(IconButton, {
55
- onAction: () => {}
56
- }, /*#__PURE__*/React.createElement(Icon, {
57
- type: "pdf"
58
- })), /*#__PURE__*/React.createElement(IconButton, {
59
- onAction: () => {}
60
- }, /*#__PURE__*/React.createElement(Icon, {
61
- type: "csv"
62
- })), /*#__PURE__*/React.createElement(IconButton, {
63
- onAction: () => {}
64
- }, /*#__PURE__*/React.createElement(Icon, {
65
- type: "search"
66
- }))), BUTTON_BAR_SIZES.map(size => /*#__PURE__*/React.createElement(ButtonBar, {
67
- key: size,
68
- size: size,
69
- ml: 2,
70
- mt: 2
71
- }, /*#__PURE__*/React.createElement(Button, {
72
- iconType: "pdf"
73
- }), /*#__PURE__*/React.createElement(Button, {
74
- iconType: "csv"
75
- }), /*#__PURE__*/React.createElement(Button, {
76
- iconType: "search"
77
- }))), BUTTON_BAR_ICON_POSITIONS.map(iconPosition => /*#__PURE__*/React.createElement(React.Fragment, {
78
- key: iconPosition
79
- }, BUTTON_BAR_SIZES.map(size => /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ButtonBar, {
80
- key: size + iconPosition,
81
- iconPosition: iconPosition,
82
- size: size,
83
- ml: 2,
84
- mt: 2
85
- }, /*#__PURE__*/React.createElement(Button, {
86
- iconType: "pdf"
87
- }, iconPosition), /*#__PURE__*/React.createElement(Button, {
88
- iconType: "csv"
89
- }, iconPosition), /*#__PURE__*/React.createElement(Button, {
90
- iconType: "search"
91
- }, iconPosition)))))), BUTTON_BAR_ICON_POSITIONS.map(iconPosition => /*#__PURE__*/React.createElement(React.Fragment, {
92
- key: iconPosition
93
- }, BUTTON_BAR_SIZES.map(size => /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ButtonBar, {
94
- fullWidth: true,
95
- key: `${size}${iconPosition}fullWidth`,
96
- iconPosition: iconPosition,
97
- size: size,
98
- ml: 2,
99
- mt: 2
100
- }, /*#__PURE__*/React.createElement(Button, {
101
- iconType: "pdf"
102
- }, iconPosition), /*#__PURE__*/React.createElement(Button, {
103
- iconType: "csv"
104
- }, iconPosition), /*#__PURE__*/React.createElement(Button, {
105
- iconType: "search"
106
- }, iconPosition)))))));
107
- };
108
- Default.story = {
109
- name: "default",
110
- args: { ...commonArgsButtonBar
111
- },
112
- argTypes: { ...commonArgTypesButtonBar
113
- }
114
- };
115
- Preview.story = {
116
- name: "visual",
117
- parameters: {
118
- chromatic: {
119
- disable: false
120
- }
121
- }
122
- };
@@ -1,48 +0,0 @@
1
- import React from "react";
2
- import { action } from "@storybook/addon-actions";
3
- import DraggableContainer from "./draggable-container.component";
4
- import DraggableItem from "./draggable-item.component";
5
- import { Checkbox } from "../checkbox";
6
- export default {
7
- title: "Draggable/Test",
8
- parameters: {
9
- info: {
10
- disable: true
11
- },
12
- chromatic: {
13
- disable: true
14
- }
15
- }
16
- };
17
- export const Default = () => {
18
- const handleUpdate = items => {
19
- action("onUpdate")(items);
20
- };
21
-
22
- return /*#__PURE__*/React.createElement(DraggableContainer, {
23
- getOrder: handleUpdate
24
- }, /*#__PURE__*/React.createElement(DraggableItem, {
25
- key: "1",
26
- id: 1
27
- }, /*#__PURE__*/React.createElement(Checkbox, {
28
- label: "Draggable Label One"
29
- })), /*#__PURE__*/React.createElement(DraggableItem, {
30
- key: "2",
31
- id: 2
32
- }, /*#__PURE__*/React.createElement(Checkbox, {
33
- label: "Draggable Label Two"
34
- })), /*#__PURE__*/React.createElement(DraggableItem, {
35
- key: "3",
36
- id: 3
37
- }, /*#__PURE__*/React.createElement(Checkbox, {
38
- label: "Draggable Label Three"
39
- })), /*#__PURE__*/React.createElement(DraggableItem, {
40
- key: "4",
41
- id: 4
42
- }, /*#__PURE__*/React.createElement(Checkbox, {
43
- label: "Draggable Label Four"
44
- })));
45
- };
46
- Default.story = {
47
- name: "default"
48
- };