carbon-react 106.6.1 → 106.6.4
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.
- package/esm/__spec_helper__/expect.d.ts +8 -1
- package/esm/__spec_helper__/expect.js +1 -5
- package/esm/__spec_helper__/test-utils.d.ts +71 -33
- package/esm/__spec_helper__/test-utils.js +63 -65
- package/esm/components/action-popover/action-popover-context.d.ts +7 -2
- package/esm/components/action-popover/action-popover-context.js +1 -1
- package/esm/components/action-popover/action-popover-divider/action-popover-divider.component.d.ts +1 -1
- package/esm/components/action-popover/action-popover-item/action-popover-item.component.d.ts +28 -41
- package/esm/components/action-popover/action-popover-item/action-popover-item.component.js +99 -118
- package/esm/components/action-popover/action-popover-menu/action-popover-menu.component.d.ts +35 -2
- package/esm/components/action-popover/action-popover-menu/action-popover-menu.component.js +42 -53
- package/esm/components/action-popover/action-popover-menu-button/action-popover-menu-button.component.d.ts +20 -18
- package/esm/components/action-popover/action-popover-menu-button/action-popover-menu-button.component.js +13 -5
- package/esm/components/action-popover/action-popover-test.stories.js +76 -0
- package/esm/components/action-popover/action-popover.component.d.ts +30 -53
- package/esm/components/action-popover/action-popover.component.js +205 -67
- package/esm/components/action-popover/action-popover.style.d.ts +17 -11
- package/esm/components/action-popover/action-popover.style.js +20 -26
- package/esm/components/action-popover/index.d.ts +9 -5
- package/esm/components/box/box.component.d.ts +12 -1
- package/esm/components/box/box.component.js +12 -23
- package/esm/components/box/box.config.d.ts +10 -12
- package/esm/components/box/index.d.ts +2 -1
- package/esm/components/button-bar/button-bar-test.stories.js +122 -0
- package/esm/components/button-bar/button-bar.component.d.ts +12 -15
- package/esm/components/button-bar/button-bar.component.js +331 -33
- package/esm/components/button-bar/button-bar.config.d.ts +2 -2
- package/esm/components/button-bar/button-bar.style.d.ts +4 -4
- package/esm/components/button-bar/button-bar.style.js +18 -33
- package/esm/components/button-bar/index.d.ts +2 -1
- package/esm/components/dismissible-box/dismissible-box.style.d.ts +1 -2
- package/esm/components/drawer/drawer.style.d.ts +1 -2
- package/esm/components/duelling-picklist/picklist/picklist.style.d.ts +2 -3
- package/esm/components/flat-table/flat-table.style.d.ts +1 -2
- package/esm/components/form/form.component.js +2 -1
- package/esm/components/link/link.component.js +1 -5
- package/esm/components/menu/__internal__/spec-helper/index.js +2 -1
- package/esm/components/menu/__internal__/submenu/submenu.component.js +21 -4
- package/esm/components/menu/menu.component.js +2 -1
- package/esm/components/menu/scrollable-block/scrollable-block.component.js +4 -2
- package/esm/components/modal/modal.component.js +3 -60
- package/esm/components/toast/toast.component.js +3 -13
- package/esm/hooks/__internal__/useModalManager/index.d.ts +1 -0
- package/esm/hooks/__internal__/useModalManager/index.js +1 -0
- package/esm/hooks/__internal__/useModalManager/useModalManager.d.ts +3 -0
- package/esm/hooks/__internal__/useModalManager/useModalManager.js +66 -0
- package/lib/__spec_helper__/expect.d.ts +8 -1
- package/lib/__spec_helper__/expect.js +2 -4
- package/lib/__spec_helper__/test-utils.d.ts +71 -33
- package/lib/__spec_helper__/test-utils.js +63 -65
- package/lib/components/action-popover/action-popover-context.d.ts +7 -2
- package/lib/components/action-popover/action-popover-context.js +1 -1
- package/lib/components/action-popover/action-popover-divider/action-popover-divider.component.d.ts +1 -1
- package/lib/components/action-popover/action-popover-item/action-popover-item.component.d.ts +28 -41
- package/lib/components/action-popover/action-popover-item/action-popover-item.component.js +100 -119
- package/lib/components/action-popover/action-popover-menu/action-popover-menu.component.d.ts +35 -2
- package/lib/components/action-popover/action-popover-menu/action-popover-menu.component.js +44 -55
- package/lib/components/action-popover/action-popover-menu-button/action-popover-menu-button.component.d.ts +20 -18
- package/lib/components/action-popover/action-popover-menu-button/action-popover-menu-button.component.js +13 -5
- package/lib/components/action-popover/action-popover-test.stories.js +95 -0
- package/lib/components/action-popover/action-popover.component.d.ts +30 -53
- package/lib/components/action-popover/action-popover.component.js +206 -71
- package/lib/components/action-popover/action-popover.style.d.ts +17 -11
- package/lib/components/action-popover/action-popover.style.js +21 -28
- package/lib/components/action-popover/index.d.ts +9 -5
- package/lib/components/box/box.component.d.ts +12 -1
- package/lib/components/box/box.component.js +13 -26
- package/lib/components/box/box.config.d.ts +10 -12
- package/lib/components/box/index.d.ts +2 -1
- package/lib/components/button-bar/button-bar-test.stories.js +145 -0
- package/lib/components/button-bar/button-bar.component.d.ts +12 -15
- package/lib/components/button-bar/button-bar.component.js +336 -35
- package/lib/components/button-bar/button-bar.config.d.ts +2 -2
- package/lib/components/button-bar/button-bar.style.d.ts +4 -4
- package/lib/components/button-bar/button-bar.style.js +18 -35
- package/lib/components/button-bar/index.d.ts +2 -1
- package/lib/components/dismissible-box/dismissible-box.style.d.ts +1 -2
- package/lib/components/drawer/drawer.style.d.ts +1 -2
- package/lib/components/duelling-picklist/picklist/picklist.style.d.ts +2 -3
- package/lib/components/flat-table/flat-table.style.d.ts +1 -2
- package/lib/components/form/form.component.js +2 -1
- package/lib/components/link/link.component.js +1 -5
- package/lib/components/menu/__internal__/spec-helper/index.js +2 -1
- package/lib/components/menu/__internal__/submenu/submenu.component.js +21 -4
- package/lib/components/menu/menu.component.js +2 -1
- package/lib/components/menu/scrollable-block/scrollable-block.component.js +4 -2
- package/lib/components/modal/modal.component.js +3 -62
- package/lib/components/toast/toast.component.js +4 -17
- package/lib/hooks/__internal__/useModalManager/index.d.ts +1 -0
- package/lib/hooks/__internal__/useModalManager/index.js +15 -0
- package/lib/hooks/__internal__/useModalManager/package.json +6 -0
- package/lib/hooks/__internal__/useModalManager/useModalManager.d.ts +3 -0
- package/lib/hooks/__internal__/useModalManager/useModalManager.js +79 -0
- package/package.json +5 -1
- package/esm/components/action-popover/action-popover-divider/action-popover-divider.d.ts +0 -12
- package/esm/components/action-popover/action-popover-item/action-popover-item.d.ts +0 -26
- package/esm/components/action-popover/action-popover-menu/action-popover-menu.d.ts +0 -33
- package/esm/components/action-popover/action-popover-menu-button/action-popover-menu-button.d.ts +0 -13
- package/esm/components/action-popover/action-popover.d.ts +0 -39
- package/esm/components/box/box.d.ts +0 -31
- package/esm/components/button-bar/button-bar.d.ts +0 -24
- package/lib/components/action-popover/action-popover-divider/action-popover-divider.d.ts +0 -12
- package/lib/components/action-popover/action-popover-item/action-popover-item.d.ts +0 -26
- package/lib/components/action-popover/action-popover-menu/action-popover-menu.d.ts +0 -33
- package/lib/components/action-popover/action-popover-menu-button/action-popover-menu-button.d.ts +0 -13
- package/lib/components/action-popover/action-popover.d.ts +0 -39
- package/lib/components/box/box.d.ts +0 -31
- package/lib/components/button-bar/button-bar.d.ts +0 -24
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.StyledMenuItem = exports.MenuButtonOverrideWrapper = exports.SubMenuItemIcon = exports.MenuItemDivider = exports.MenuItemIcon = exports.StyledButtonIcon = exports.ButtonIcon = exports.MenuButton = exports.
|
|
6
|
+
exports.StyledMenuItem = exports.MenuButtonOverrideWrapper = exports.SubMenuItemIcon = exports.MenuItemDivider = exports.MenuItemIcon = exports.StyledButtonIcon = exports.ButtonIcon = exports.MenuButton = exports.Menu = void 0;
|
|
7
7
|
|
|
8
8
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
9
9
|
|
|
@@ -40,13 +40,7 @@ exports.Menu = Menu;
|
|
|
40
40
|
const StyledMenuItem = _styledComponents.default.button`
|
|
41
41
|
text-decoration: none;
|
|
42
42
|
background-color: var(--colorsActionMajorYang100);
|
|
43
|
-
|
|
44
|
-
exports.StyledMenuItem = StyledMenuItem;
|
|
45
|
-
|
|
46
|
-
const MenuItemFactory = button => (0, _styledComponents.default)(button)`
|
|
47
|
-
cursor: ${({
|
|
48
|
-
disabled
|
|
49
|
-
}) => disabled ? "not-allowed" : "pointer"};
|
|
43
|
+
cursor: pointer;
|
|
50
44
|
box-sizing: border-box;
|
|
51
45
|
padding: 0 var(--spacing150);
|
|
52
46
|
position: relative;
|
|
@@ -57,44 +51,43 @@ const MenuItemFactory = button => (0, _styledComponents.default)(button)`
|
|
|
57
51
|
align-items: center;
|
|
58
52
|
border: none;
|
|
59
53
|
width: 100%;
|
|
60
|
-
color:
|
|
61
|
-
disabled
|
|
62
|
-
}) => disabled ? "var(--colorsUtilityYin030)" : "var(--colorsUtilityYin090)"};
|
|
54
|
+
color: var(--colorsUtilityYin090);
|
|
63
55
|
font-size: 14px;
|
|
64
56
|
font-weight: 700;
|
|
65
57
|
justify-content: ${({
|
|
66
58
|
horizontalAlignment
|
|
67
59
|
}) => horizontalAlignment === "left" ? "flex-start" : "flex-end"};
|
|
68
|
-
|
|
69
|
-
&:hover {
|
|
70
|
-
${({
|
|
71
|
-
disabled
|
|
72
|
-
}) => !disabled && (0, _styledComponents.css)`
|
|
73
|
-
background-color: var(--colorsUtilityMajor025);
|
|
74
|
-
`}
|
|
75
|
-
}
|
|
60
|
+
|
|
76
61
|
&:focus {
|
|
77
62
|
outline: var(--borderWidth300) solid var(--colorsSemanticFocus500);
|
|
78
63
|
z-index: 1;
|
|
79
64
|
}
|
|
65
|
+
|
|
80
66
|
${({
|
|
81
|
-
|
|
82
|
-
}) =>
|
|
67
|
+
isDisabled
|
|
68
|
+
}) => isDisabled && (0, _styledComponents.css)`
|
|
69
|
+
color: var(--colorsUtilityYin030);
|
|
70
|
+
cursor: not-allowed;
|
|
71
|
+
|
|
83
72
|
&& ${_icon2.default} {
|
|
84
|
-
cursor:
|
|
73
|
+
cursor: not-allowed;
|
|
74
|
+
color: var(--colorsUtilityYin030);
|
|
85
75
|
}
|
|
86
76
|
`}
|
|
77
|
+
|
|
87
78
|
${({
|
|
88
|
-
|
|
89
|
-
}) =>
|
|
79
|
+
isDisabled
|
|
80
|
+
}) => !isDisabled && (0, _styledComponents.css)`
|
|
81
|
+
&:focus,
|
|
82
|
+
&:hover {
|
|
83
|
+
background-color: var(--colorsUtilityMajor025);
|
|
84
|
+
}
|
|
90
85
|
&& ${_icon2.default} {
|
|
91
|
-
cursor:
|
|
92
|
-
color: var(--colorsUtilityYin030);
|
|
86
|
+
cursor: pointer;
|
|
93
87
|
}
|
|
94
88
|
`}
|
|
95
89
|
`;
|
|
96
|
-
|
|
97
|
-
exports.MenuItemFactory = MenuItemFactory;
|
|
90
|
+
exports.StyledMenuItem = StyledMenuItem;
|
|
98
91
|
const MenuItemDivider = _styledComponents.default.div.attrs({
|
|
99
92
|
"data-element": "action-popover-divider"
|
|
100
93
|
})`
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
export { default as ActionPopover } from "./action-popover";
|
|
2
|
-
export {
|
|
3
|
-
export { default as
|
|
4
|
-
export {
|
|
5
|
-
export { default as
|
|
1
|
+
export { default as ActionPopover } from "./action-popover.component";
|
|
2
|
+
export type { ActionPopoverProps } from "./action-popover.component";
|
|
3
|
+
export { default as ActionPopoverMenu } from "./action-popover-menu/action-popover-menu.component";
|
|
4
|
+
export type { ActionPopoverMenuProps } from "./action-popover-menu/action-popover-menu.component";
|
|
5
|
+
export { default as ActionPopoverItem } from "./action-popover-item/action-popover-item.component";
|
|
6
|
+
export type { ActionPopoverItemProps } from "./action-popover-item/action-popover-item.component";
|
|
7
|
+
export { default as ActionPopoverMenuButton } from "./action-popover-menu-button/action-popover-menu-button.component";
|
|
8
|
+
export type { ActionPopoverMenuButtonProps } from "./action-popover-menu-button/action-popover-menu-button.component";
|
|
9
|
+
export { default as ActionPopoverDivider } from "./action-popover-divider/action-popover-divider.component";
|
|
@@ -1,2 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { SpaceProps, LayoutProps, FlexboxProps, ColorProps } from "styled-system";
|
|
3
|
+
export declare type OverflowWrap = "break-word" | "anywhere";
|
|
4
|
+
export declare type ScrollVariant = "light" | "dark";
|
|
5
|
+
export interface BoxProps extends SpaceProps, LayoutProps, FlexboxProps, ColorProps {
|
|
6
|
+
as?: keyof JSX.IntrinsicElements | React.ComponentType<any>;
|
|
7
|
+
/** String to set Box content break strategy. Note "anywhere" is not supported in Safari */
|
|
8
|
+
overflowWrap?: OverflowWrap;
|
|
9
|
+
/** scroll styling attribute */
|
|
10
|
+
scrollVariant?: ScrollVariant;
|
|
11
|
+
}
|
|
12
|
+
declare const Box: import("styled-components").StyledComponent<"div", any, BoxProps, never>;
|
|
1
13
|
export default Box;
|
|
2
|
-
declare const Box: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -5,10 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("@styled-system/prop-types"));
|
|
9
|
-
|
|
10
|
-
var _propTypes2 = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
8
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
13
9
|
|
|
14
10
|
var _styledSystem = require("styled-system");
|
|
@@ -19,17 +15,27 @@ var _color = _interopRequireDefault(require("../../style/utils/color"));
|
|
|
19
15
|
|
|
20
16
|
var _box = _interopRequireDefault(require("./box.config"));
|
|
21
17
|
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
|
|
22
20
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
23
21
|
|
|
24
22
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
25
23
|
|
|
26
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
|
-
|
|
28
24
|
const Box = _styledComponents.default.div`
|
|
29
25
|
${_styledSystem.space}
|
|
30
26
|
${_styledSystem.layout}
|
|
31
27
|
${_styledSystem.flexbox}
|
|
32
|
-
${
|
|
28
|
+
${({
|
|
29
|
+
color,
|
|
30
|
+
bg,
|
|
31
|
+
backgroundColor,
|
|
32
|
+
...rest
|
|
33
|
+
}) => (0, _color.default)({
|
|
34
|
+
color,
|
|
35
|
+
bg,
|
|
36
|
+
backgroundColor,
|
|
37
|
+
...rest
|
|
38
|
+
})}
|
|
33
39
|
|
|
34
40
|
${({
|
|
35
41
|
overflowWrap
|
|
@@ -54,25 +60,6 @@ const Box = _styledComponents.default.div`
|
|
|
54
60
|
}
|
|
55
61
|
`}
|
|
56
62
|
`;
|
|
57
|
-
Box.propTypes = {
|
|
58
|
-
/** Styled system box props */
|
|
59
|
-
..._propTypes.default.space,
|
|
60
|
-
|
|
61
|
-
/** Styled system flex props */
|
|
62
|
-
..._propTypes.default.flexbox,
|
|
63
|
-
|
|
64
|
-
/** Styled system layout props */
|
|
65
|
-
..._propTypes.default.layout,
|
|
66
|
-
|
|
67
|
-
/** Styled system color props */
|
|
68
|
-
..._propTypes.default.color,
|
|
69
|
-
|
|
70
|
-
/** String to set Box content break strategy. Note "anywhere" is not supported in Safari and IE11 */
|
|
71
|
-
overflowWrap: _propTypes2.default.oneOf(["break-word", "anywhere"]),
|
|
72
|
-
|
|
73
|
-
/** scroll styling attribute */
|
|
74
|
-
scrollVariant: _propTypes2.default.oneOf(["light", "dark"])
|
|
75
|
-
};
|
|
76
63
|
Box.defaultProps = {
|
|
77
64
|
theme: _base.default
|
|
78
65
|
};
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
declare
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
}
|
|
1
|
+
declare const _default: {
|
|
2
|
+
light: {
|
|
3
|
+
thumb: string;
|
|
4
|
+
track: string;
|
|
5
|
+
};
|
|
6
|
+
dark: {
|
|
7
|
+
thumb: string;
|
|
8
|
+
track: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
13
11
|
export default _default;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { default } from "./box";
|
|
1
|
+
export { default } from "./box.component";
|
|
2
|
+
export type { BoxProps } from "./box.component";
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Preview = exports.Default = exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _addonActions = require("@storybook/addon-actions");
|
|
11
|
+
|
|
12
|
+
var _button = _interopRequireDefault(require("../button"));
|
|
13
|
+
|
|
14
|
+
var _ = _interopRequireDefault(require("."));
|
|
15
|
+
|
|
16
|
+
var _iconButton = _interopRequireDefault(require("../icon-button"));
|
|
17
|
+
|
|
18
|
+
var _icon = _interopRequireDefault(require("../icon"));
|
|
19
|
+
|
|
20
|
+
var _buttonBar = require("./button-bar.config");
|
|
21
|
+
|
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
|
+
|
|
24
|
+
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); }
|
|
25
|
+
|
|
26
|
+
var _default = {
|
|
27
|
+
title: "Button Bar/Test",
|
|
28
|
+
parameters: {
|
|
29
|
+
info: {
|
|
30
|
+
disable: true
|
|
31
|
+
},
|
|
32
|
+
chromatic: {
|
|
33
|
+
disable: true
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
exports.default = _default;
|
|
38
|
+
const commonArgTypesButtonBar = {
|
|
39
|
+
size: {
|
|
40
|
+
options: _buttonBar.BUTTON_BAR_SIZES,
|
|
41
|
+
control: {
|
|
42
|
+
type: "select"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
iconPosition: {
|
|
46
|
+
options: _buttonBar.BUTTON_BAR_ICON_POSITIONS,
|
|
47
|
+
control: {
|
|
48
|
+
type: "select"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
const commonArgsButtonBar = {
|
|
53
|
+
size: "medium",
|
|
54
|
+
fullWidth: false,
|
|
55
|
+
iconPosition: "before"
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const Default = ({ ...args
|
|
59
|
+
}) => /*#__PURE__*/_react.default.createElement(_.default, _extends({
|
|
60
|
+
onClick: (0, _addonActions.action)("click")
|
|
61
|
+
}, args), /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
62
|
+
iconType: "search"
|
|
63
|
+
}, "Example Button"), /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
64
|
+
iconType: "pdf"
|
|
65
|
+
}, "Example Button"), /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
66
|
+
iconType: "csv"
|
|
67
|
+
}, "Example Button"));
|
|
68
|
+
|
|
69
|
+
exports.Default = Default;
|
|
70
|
+
|
|
71
|
+
const Preview = () => {
|
|
72
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_.default, {
|
|
73
|
+
ml: 2,
|
|
74
|
+
mt: 2
|
|
75
|
+
}, /*#__PURE__*/_react.default.createElement(_iconButton.default, {
|
|
76
|
+
onAction: () => {}
|
|
77
|
+
}, /*#__PURE__*/_react.default.createElement(_icon.default, {
|
|
78
|
+
type: "pdf"
|
|
79
|
+
})), /*#__PURE__*/_react.default.createElement(_iconButton.default, {
|
|
80
|
+
onAction: () => {}
|
|
81
|
+
}, /*#__PURE__*/_react.default.createElement(_icon.default, {
|
|
82
|
+
type: "csv"
|
|
83
|
+
})), /*#__PURE__*/_react.default.createElement(_iconButton.default, {
|
|
84
|
+
onAction: () => {}
|
|
85
|
+
}, /*#__PURE__*/_react.default.createElement(_icon.default, {
|
|
86
|
+
type: "search"
|
|
87
|
+
}))), _buttonBar.BUTTON_BAR_SIZES.map(size => /*#__PURE__*/_react.default.createElement(_.default, {
|
|
88
|
+
key: size,
|
|
89
|
+
size: size,
|
|
90
|
+
ml: 2,
|
|
91
|
+
mt: 2
|
|
92
|
+
}, /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
93
|
+
iconType: "pdf"
|
|
94
|
+
}), /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
95
|
+
iconType: "csv"
|
|
96
|
+
}), /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
97
|
+
iconType: "search"
|
|
98
|
+
}))), _buttonBar.BUTTON_BAR_ICON_POSITIONS.map(iconPosition => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
99
|
+
key: iconPosition
|
|
100
|
+
}, _buttonBar.BUTTON_BAR_SIZES.map(size => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_.default, {
|
|
101
|
+
key: size + iconPosition,
|
|
102
|
+
iconPosition: iconPosition,
|
|
103
|
+
size: size,
|
|
104
|
+
ml: 2,
|
|
105
|
+
mt: 2
|
|
106
|
+
}, /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
107
|
+
iconType: "pdf"
|
|
108
|
+
}, iconPosition), /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
109
|
+
iconType: "csv"
|
|
110
|
+
}, iconPosition), /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
111
|
+
iconType: "search"
|
|
112
|
+
}, iconPosition)))))), _buttonBar.BUTTON_BAR_ICON_POSITIONS.map(iconPosition => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
113
|
+
key: iconPosition
|
|
114
|
+
}, _buttonBar.BUTTON_BAR_SIZES.map(size => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_.default, {
|
|
115
|
+
fullWidth: true,
|
|
116
|
+
key: `${size}${iconPosition}fullWidth`,
|
|
117
|
+
iconPosition: iconPosition,
|
|
118
|
+
size: size,
|
|
119
|
+
ml: 2,
|
|
120
|
+
mt: 2
|
|
121
|
+
}, /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
122
|
+
iconType: "pdf"
|
|
123
|
+
}, iconPosition), /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
124
|
+
iconType: "csv"
|
|
125
|
+
}, iconPosition), /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
126
|
+
iconType: "search"
|
|
127
|
+
}, iconPosition)))))));
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
exports.Preview = Preview;
|
|
131
|
+
Default.story = {
|
|
132
|
+
name: "default",
|
|
133
|
+
args: { ...commonArgsButtonBar
|
|
134
|
+
},
|
|
135
|
+
argTypes: { ...commonArgTypesButtonBar
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
Preview.story = {
|
|
139
|
+
name: "visual",
|
|
140
|
+
parameters: {
|
|
141
|
+
chromatic: {
|
|
142
|
+
disable: false
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
};
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
children:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
namespace defaultProps {
|
|
12
|
-
const size: string;
|
|
13
|
-
const iconPosition: string;
|
|
14
|
-
const fullWidth: boolean;
|
|
15
|
-
}
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { SpaceProps } from "styled-system";
|
|
3
|
+
export interface ButtonBarProps extends SpaceProps {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
/** Apply fullWidth style to the button bar */
|
|
6
|
+
fullWidth?: boolean;
|
|
7
|
+
/** Defines an Icon position for buttons: "before" | "after" */
|
|
8
|
+
iconPosition?: "before" | "after";
|
|
9
|
+
/** Assigns a size to the buttons: "small" | "medium" | "large" */
|
|
10
|
+
size?: "small" | "medium" | "large";
|
|
16
11
|
}
|
|
12
|
+
declare const ButtonBar: ({ children, size, iconPosition, fullWidth, ...rest }: ButtonBarProps) => JSX.Element;
|
|
13
|
+
export default ButtonBar;
|