carbon-react 111.14.0 → 111.16.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 (39) hide show
  1. package/esm/components/box/box.component.d.ts +6 -1
  2. package/esm/components/box/box.component.js +7 -1
  3. package/esm/components/card/card.component.d.ts +8 -1
  4. package/esm/components/card/card.component.js +6 -0
  5. package/esm/components/card/card.style.d.ts +5 -0
  6. package/esm/components/card/card.style.js +5 -3
  7. package/esm/components/dialog/dialog.style.js +1 -1
  8. package/esm/components/dismissible-box/dismissible-box.component.js +1 -0
  9. package/esm/components/form/form.component.d.ts +4 -2
  10. package/esm/components/form/form.component.js +165 -6
  11. package/esm/components/form/form.style.js +6 -1
  12. package/esm/components/sidebar/__internal__/sidebar-header/sidebar-header.component.d.ts +8 -2
  13. package/esm/components/sidebar/__internal__/sidebar-header/sidebar-header.component.js +168 -6
  14. package/esm/components/sidebar/__internal__/sidebar-header/sidebar-header.style.d.ts +4 -2
  15. package/esm/components/sidebar/__internal__/sidebar-header/sidebar-header.style.js +24 -4
  16. package/esm/components/sidebar/sidebar.component.d.ts +2 -0
  17. package/esm/components/sidebar/sidebar.component.js +162 -3
  18. package/esm/style/utils/form-style-utils.d.ts +4 -2
  19. package/esm/style/utils/form-style-utils.js +7 -2
  20. package/lib/components/box/box.component.d.ts +6 -1
  21. package/lib/components/box/box.component.js +8 -1
  22. package/lib/components/card/card.component.d.ts +8 -1
  23. package/lib/components/card/card.component.js +6 -0
  24. package/lib/components/card/card.style.d.ts +5 -0
  25. package/lib/components/card/card.style.js +5 -3
  26. package/lib/components/dialog/dialog.style.js +1 -1
  27. package/lib/components/dismissible-box/dismissible-box.component.js +1 -0
  28. package/lib/components/form/form.component.d.ts +4 -2
  29. package/lib/components/form/form.component.js +165 -6
  30. package/lib/components/form/form.style.js +5 -0
  31. package/lib/components/sidebar/__internal__/sidebar-header/sidebar-header.component.d.ts +8 -2
  32. package/lib/components/sidebar/__internal__/sidebar-header/sidebar-header.component.js +167 -5
  33. package/lib/components/sidebar/__internal__/sidebar-header/sidebar-header.style.d.ts +4 -2
  34. package/lib/components/sidebar/__internal__/sidebar-header/sidebar-header.style.js +31 -4
  35. package/lib/components/sidebar/sidebar.component.d.ts +2 -0
  36. package/lib/components/sidebar/sidebar.component.js +161 -2
  37. package/lib/style/utils/form-style-utils.d.ts +4 -2
  38. package/lib/style/utils/form-style-utils.js +7 -2
  39. package/package.json +1 -1
@@ -1,11 +1,14 @@
1
1
  import React from "react";
2
2
  import { SpaceProps, LayoutProps, FlexboxProps, ColorProps, PositionProps } from "styled-system";
3
+ import * as DesignTokens from "@sage/design-tokens/js/base/common";
3
4
  declare const GAP_VALUES: readonly [0, 1, 2, 3, 4, 5, 6, 7, 8];
4
5
  export declare type OverflowWrap = "break-word" | "anywhere";
5
6
  export declare type ScrollVariant = "light" | "dark";
6
7
  export declare type BoxSizing = "content-box" | "border-box";
7
8
  export declare type AllowedNumericalValues = typeof GAP_VALUES[number];
8
9
  export declare type Gap = AllowedNumericalValues | string;
10
+ declare type DesignTokensType = keyof typeof DesignTokens;
11
+ declare type BoxShadowsType = Extract<DesignTokensType, `boxShadow${string}`>;
9
12
  export interface BoxProps extends SpaceProps, LayoutProps, FlexboxProps, ColorProps, Omit<PositionProps, "zIndex"> {
10
13
  as?: keyof JSX.IntrinsicElements | React.ComponentType<any>;
11
14
  /** String to set Box content break strategy. Note "anywhere" is not supported in Safari */
@@ -22,6 +25,8 @@ export interface BoxProps extends SpaceProps, LayoutProps, FlexboxProps, ColorPr
22
25
  columnGap?: Gap;
23
26
  /** Row gap an integer multiplier of the base spacing constant (8px) or any valid CSS string." */
24
27
  rowGap?: Gap;
28
+ /** Design Token for Box Shadow. Note: please check that the box shadow design token you are using is compatible with the Box component. */
29
+ boxShadow?: BoxShadowsType;
25
30
  }
26
- declare const Box: import("styled-components").StyledComponent<"div", any, BoxProps, never>;
31
+ export declare const Box: import("styled-components").StyledComponent<"div", any, BoxProps, never>;
27
32
  export default Box;
@@ -4,7 +4,7 @@ import BaseTheme from "../../style/themes/base";
4
4
  import styledColor from "../../style/utils/color";
5
5
  import boxConfig from "./box.config";
6
6
  const GAP_VALUES = [0, 1, 2, 3, 4, 5, 6, 7, 8];
7
- const Box = styled.div`
7
+ export const Box = styled.div`
8
8
  ${space}
9
9
  ${layout}
10
10
  ${flexbox}
@@ -69,6 +69,12 @@ const Box = styled.div`
69
69
  row-gap: ${boxConfig.gap(rowGap)};
70
70
  `}
71
71
  `};
72
+
73
+ ${({
74
+ boxShadow
75
+ }) => boxShadow && css`
76
+ box-shadow: var(--${boxShadow});
77
+ `}
72
78
  `;
73
79
  Box.defaultProps = {
74
80
  theme: BaseTheme
@@ -1,6 +1,9 @@
1
1
  import React from "react";
2
2
  import { MarginProps } from "styled-system";
3
+ import * as DesignTokens from "@sage/design-tokens/js/base/common";
3
4
  import { CardSpacing } from "./card.config";
5
+ declare type DesignTokensType = keyof typeof DesignTokens;
6
+ declare type BoxShadowsType = Extract<DesignTokensType, `boxShadow${string}`>;
4
7
  export interface CardProps extends MarginProps {
5
8
  /** Identifier used for testing purposes, applied to the root element of the component. */
6
9
  "data-element"?: string;
@@ -23,9 +26,13 @@ export interface CardProps extends MarginProps {
23
26
  interactive?: boolean;
24
27
  /** Size of card for applying padding */
25
28
  spacing?: CardSpacing;
29
+ /** Design token for custom Box Shadow. Note: please check that the box shadow design token you are using is compatible with the Card component. */
30
+ boxShadow?: BoxShadowsType;
31
+ /** Design token for custom Box Shadow on hover. Interactive prop must be True. Note: please check that the box shadow design token you are using is compatible with the Card component. */
32
+ hoverBoxShadow?: BoxShadowsType;
26
33
  }
27
34
  declare const Card: {
28
- ({ "data-element": dataElement, "data-role": dataRole, dataRole: oldDataRole, action, children, cardWidth, draggable, interactive, spacing, ...rest }: CardProps): JSX.Element;
35
+ ({ "data-element": dataElement, "data-role": dataRole, dataRole: oldDataRole, action, children, cardWidth, draggable, interactive, spacing, boxShadow, hoverBoxShadow, ...rest }: CardProps): JSX.Element;
29
36
  displayName: string;
30
37
  };
31
38
  export default Card;
@@ -24,6 +24,8 @@ const Card = ({
24
24
  draggable,
25
25
  interactive,
26
26
  spacing = "medium",
27
+ boxShadow,
28
+ hoverBoxShadow,
27
29
  ...rest
28
30
  }) => {
29
31
  if (!isDeprecationWarningTriggered && oldDataRole) {
@@ -56,6 +58,8 @@ const Card = ({
56
58
  interactive: !!interactive,
57
59
  draggable: !!draggable,
58
60
  spacing: spacing,
61
+ boxShadow: boxShadow,
62
+ hoverBoxShadow: hoverBoxShadow,
59
63
  onClick: interactive && !draggable ? action : undefined
60
64
  }, interactive && {
61
65
  tabIndex: 0,
@@ -67,12 +71,14 @@ const Card = ({
67
71
 
68
72
  Card.propTypes = {
69
73
  "action": PropTypes.func,
74
+ "boxShadow": PropTypes.any,
70
75
  "cardWidth": PropTypes.string,
71
76
  "children": PropTypes.node,
72
77
  "data-element": PropTypes.string,
73
78
  "data-role": PropTypes.string,
74
79
  "dataRole": PropTypes.string,
75
80
  "draggable": PropTypes.bool,
81
+ "hoverBoxShadow": PropTypes.any,
76
82
  "interactive": PropTypes.bool,
77
83
  "m": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
78
84
  "__@toStringTag": PropTypes.string.isRequired,
@@ -1,10 +1,15 @@
1
1
  import { MarginProps } from "styled-system";
2
+ import * as DesignTokens from "@sage/design-tokens/js/base/common";
2
3
  import { CardSpacing } from "./card.config";
4
+ declare type DesignTokensType = keyof typeof DesignTokens;
5
+ export declare type BoxShadowsType = Extract<DesignTokensType, `boxShadow${string}`>;
3
6
  export interface StyledCardProps extends MarginProps {
4
7
  cardWidth: string;
5
8
  interactive: boolean;
6
9
  draggable: boolean;
7
10
  spacing: CardSpacing;
11
+ boxShadow?: BoxShadowsType;
12
+ hoverBoxShadow?: BoxShadowsType;
8
13
  }
9
14
  declare const StyledCard: import("styled-components").StyledComponent<"div", any, StyledCardProps, never>;
10
15
  export default StyledCard;
@@ -11,11 +11,13 @@ const StyledCard = styled.div`
11
11
  cardWidth,
12
12
  interactive,
13
13
  draggable,
14
- spacing
14
+ spacing,
15
+ boxShadow = "boxShadow050",
16
+ hoverBoxShadow = "boxShadow100"
15
17
  }) => css`
16
18
  background-color: var(--colorsUtilityYang100);
17
19
  border: none;
18
- box-shadow: var(--boxShadow050);
20
+ box-shadow: var(--${boxShadow});
19
21
  color: var(--colorsUtilityYin090);
20
22
  margin: 25px;
21
23
  padding: ${paddingSizes[spacing]};
@@ -30,7 +32,7 @@ const StyledCard = styled.div`
30
32
 
31
33
  :hover,
32
34
  :focus {
33
- box-shadow: var(--boxShadow100);
35
+ box-shadow: var(--${hoverBoxShadow});
34
36
  }
35
37
  `}
36
38
 
@@ -62,7 +62,7 @@ const StyledDialog = styled.div`
62
62
  }
63
63
 
64
64
  ${StyledFormFooter}.sticky {
65
- ${calculateWidthValue};
65
+ ${calculateWidthValue}
66
66
  ${props => calculateFormSpacingValues(props, false)}
67
67
  }
68
68
 
@@ -465,6 +465,7 @@ DismissibleBox.propTypes = {
465
465
  "trimStart": PropTypes.func.isRequired,
466
466
  "valueOf": PropTypes.func.isRequired
467
467
  }), PropTypes.string]),
468
+ "boxShadow": PropTypes.any,
468
469
  "boxSizing": PropTypes.oneOf(["border-box", "content-box"]),
469
470
  "children": PropTypes.node,
470
471
  "color": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { SpaceProps } from "styled-system";
2
+ import { SpaceProps, PaddingProps } from "styled-system";
3
3
  import { FormButtonAlignment } from "./form.config";
4
4
  export interface FormProps extends SpaceProps {
5
5
  /** Alignment of buttons */
@@ -28,9 +28,11 @@ export interface FormProps extends SpaceProps {
28
28
  height?: string;
29
29
  /** Applies styling for full width buttons. Please note that you will still need to pass the `fullWidth` prop to the button you compose */
30
30
  fullWidthButtons?: boolean;
31
+ /** Padding to be set on the form footer */
32
+ footerPadding?: PaddingProps;
31
33
  }
32
34
  export declare const Form: {
33
- ({ children, saveButton, leftSideButtons, rightSideButtons, errorCount, warningCount, onSubmit, buttonAlignment, stickyFooter, fieldSpacing, noValidate, height, fullWidthButtons, ...rest }: FormProps): JSX.Element;
35
+ ({ children, saveButton, leftSideButtons, rightSideButtons, errorCount, warningCount, onSubmit, buttonAlignment, stickyFooter, fieldSpacing, noValidate, height, fullWidthButtons, footerPadding, ...rest }: FormProps): JSX.Element;
34
36
  displayName: string;
35
37
  };
36
38
  export default Form;
@@ -21,6 +21,7 @@ const Form = ({
21
21
  noValidate = true,
22
22
  height,
23
23
  fullWidthButtons = false,
24
+ footerPadding = {},
24
25
  ...rest
25
26
  }) => {
26
27
  const {
@@ -31,7 +32,9 @@ const Form = ({
31
32
  } = useContext(ModalContext);
32
33
  const formRef = useRef(null);
33
34
  const formFooterRef = useRef(null);
35
+ const hasPadding = !!Object.keys(footerPadding).length;
34
36
  const renderFooter = !!(saveButton || leftSideButtons || rightSideButtons || errorCount || warningCount);
37
+ const classNames = `${stickyFooter ? "sticky" : ""} ${hasPadding ? "padded" : ""}`.trimEnd();
35
38
  return /*#__PURE__*/React.createElement(StyledForm, _extends({
36
39
  ref: formRef,
37
40
  stickyFooter: stickyFooter,
@@ -47,28 +50,28 @@ const Form = ({
47
50
  className: stickyFooter ? "sticky" : "",
48
51
  stickyFooter: stickyFooter,
49
52
  isInModal: isInModal
50
- }, children), !fullWidthButtons && renderFooter && /*#__PURE__*/React.createElement(StyledFormFooter, {
53
+ }, children), !fullWidthButtons && renderFooter && /*#__PURE__*/React.createElement(StyledFormFooter, _extends({
51
54
  "data-element": "form-footer",
52
- className: stickyFooter ? "sticky" : "",
55
+ className: classNames,
53
56
  ref: formFooterRef,
54
57
  stickyFooter: stickyFooter,
55
58
  buttonAlignment: buttonAlignment,
56
59
  isInModal: isInModal
57
- }, leftSideButtons && /*#__PURE__*/React.createElement(StyledLeftButtons, {
60
+ }, footerPadding), leftSideButtons && /*#__PURE__*/React.createElement(StyledLeftButtons, {
58
61
  buttonAlignment: buttonAlignment
59
62
  }, leftSideButtons), /*#__PURE__*/React.createElement(FormSummary, {
60
63
  errorCount: errorCount,
61
64
  warningCount: warningCount
62
65
  }, saveButton), rightSideButtons && /*#__PURE__*/React.createElement(StyledRightButtons, {
63
66
  buttonAlignment: buttonAlignment
64
- }, rightSideButtons)), fullWidthButtons && renderFooter && /*#__PURE__*/React.createElement(StyledFormFooter, {
67
+ }, rightSideButtons)), fullWidthButtons && renderFooter && /*#__PURE__*/React.createElement(StyledFormFooter, _extends({
65
68
  "data-element": "form-footer",
66
- className: stickyFooter ? "sticky" : "",
69
+ className: classNames,
67
70
  ref: formFooterRef,
68
71
  stickyFooter: stickyFooter,
69
72
  buttonAlignment: buttonAlignment,
70
73
  fullWidthButtons: fullWidthButtons
71
- }, leftSideButtons && /*#__PURE__*/React.createElement(StyledLeftButtons, {
74
+ }, footerPadding), leftSideButtons && /*#__PURE__*/React.createElement(StyledLeftButtons, {
72
75
  fullWidthButtons: fullWidthButtons
73
76
  }, leftSideButtons), rightSideButtons && /*#__PURE__*/React.createElement(StyledRightButtons, {
74
77
  fullWidthButtons: fullWidthButtons
@@ -84,6 +87,162 @@ Form.propTypes = {
84
87
  "children": PropTypes.node,
85
88
  "errorCount": PropTypes.number,
86
89
  "fieldSpacing": PropTypes.oneOf([0, 1, 2, 3, 4, 5, 6, 7]),
90
+ "footerPadding": PropTypes.shape({
91
+ "p": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
92
+ "__@toStringTag": PropTypes.string.isRequired,
93
+ "description": PropTypes.string,
94
+ "toString": PropTypes.func.isRequired,
95
+ "valueOf": PropTypes.func.isRequired
96
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
97
+ "__@toStringTag": PropTypes.string.isRequired,
98
+ "description": PropTypes.string,
99
+ "toString": PropTypes.func.isRequired,
100
+ "valueOf": PropTypes.func.isRequired
101
+ }), PropTypes.string]),
102
+ "padding": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
103
+ "__@toStringTag": PropTypes.string.isRequired,
104
+ "description": PropTypes.string,
105
+ "toString": PropTypes.func.isRequired,
106
+ "valueOf": PropTypes.func.isRequired
107
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
108
+ "__@toStringTag": PropTypes.string.isRequired,
109
+ "description": PropTypes.string,
110
+ "toString": PropTypes.func.isRequired,
111
+ "valueOf": PropTypes.func.isRequired
112
+ }), PropTypes.string]),
113
+ "paddingBottom": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
114
+ "__@toStringTag": PropTypes.string.isRequired,
115
+ "description": PropTypes.string,
116
+ "toString": PropTypes.func.isRequired,
117
+ "valueOf": PropTypes.func.isRequired
118
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
119
+ "__@toStringTag": PropTypes.string.isRequired,
120
+ "description": PropTypes.string,
121
+ "toString": PropTypes.func.isRequired,
122
+ "valueOf": PropTypes.func.isRequired
123
+ }), PropTypes.string]),
124
+ "paddingLeft": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
125
+ "__@toStringTag": PropTypes.string.isRequired,
126
+ "description": PropTypes.string,
127
+ "toString": PropTypes.func.isRequired,
128
+ "valueOf": PropTypes.func.isRequired
129
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
130
+ "__@toStringTag": PropTypes.string.isRequired,
131
+ "description": PropTypes.string,
132
+ "toString": PropTypes.func.isRequired,
133
+ "valueOf": PropTypes.func.isRequired
134
+ }), PropTypes.string]),
135
+ "paddingRight": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
136
+ "__@toStringTag": PropTypes.string.isRequired,
137
+ "description": PropTypes.string,
138
+ "toString": PropTypes.func.isRequired,
139
+ "valueOf": PropTypes.func.isRequired
140
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
141
+ "__@toStringTag": PropTypes.string.isRequired,
142
+ "description": PropTypes.string,
143
+ "toString": PropTypes.func.isRequired,
144
+ "valueOf": PropTypes.func.isRequired
145
+ }), PropTypes.string]),
146
+ "paddingTop": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
147
+ "__@toStringTag": PropTypes.string.isRequired,
148
+ "description": PropTypes.string,
149
+ "toString": PropTypes.func.isRequired,
150
+ "valueOf": PropTypes.func.isRequired
151
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
152
+ "__@toStringTag": PropTypes.string.isRequired,
153
+ "description": PropTypes.string,
154
+ "toString": PropTypes.func.isRequired,
155
+ "valueOf": PropTypes.func.isRequired
156
+ }), PropTypes.string]),
157
+ "paddingX": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
158
+ "__@toStringTag": PropTypes.string.isRequired,
159
+ "description": PropTypes.string,
160
+ "toString": PropTypes.func.isRequired,
161
+ "valueOf": PropTypes.func.isRequired
162
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
163
+ "__@toStringTag": PropTypes.string.isRequired,
164
+ "description": PropTypes.string,
165
+ "toString": PropTypes.func.isRequired,
166
+ "valueOf": PropTypes.func.isRequired
167
+ }), PropTypes.string]),
168
+ "paddingY": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
169
+ "__@toStringTag": PropTypes.string.isRequired,
170
+ "description": PropTypes.string,
171
+ "toString": PropTypes.func.isRequired,
172
+ "valueOf": PropTypes.func.isRequired
173
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
174
+ "__@toStringTag": PropTypes.string.isRequired,
175
+ "description": PropTypes.string,
176
+ "toString": PropTypes.func.isRequired,
177
+ "valueOf": PropTypes.func.isRequired
178
+ }), PropTypes.string]),
179
+ "pb": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
180
+ "__@toStringTag": PropTypes.string.isRequired,
181
+ "description": PropTypes.string,
182
+ "toString": PropTypes.func.isRequired,
183
+ "valueOf": PropTypes.func.isRequired
184
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
185
+ "__@toStringTag": PropTypes.string.isRequired,
186
+ "description": PropTypes.string,
187
+ "toString": PropTypes.func.isRequired,
188
+ "valueOf": PropTypes.func.isRequired
189
+ }), PropTypes.string]),
190
+ "pl": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
191
+ "__@toStringTag": PropTypes.string.isRequired,
192
+ "description": PropTypes.string,
193
+ "toString": PropTypes.func.isRequired,
194
+ "valueOf": PropTypes.func.isRequired
195
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
196
+ "__@toStringTag": PropTypes.string.isRequired,
197
+ "description": PropTypes.string,
198
+ "toString": PropTypes.func.isRequired,
199
+ "valueOf": PropTypes.func.isRequired
200
+ }), PropTypes.string]),
201
+ "pr": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
202
+ "__@toStringTag": PropTypes.string.isRequired,
203
+ "description": PropTypes.string,
204
+ "toString": PropTypes.func.isRequired,
205
+ "valueOf": PropTypes.func.isRequired
206
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
207
+ "__@toStringTag": PropTypes.string.isRequired,
208
+ "description": PropTypes.string,
209
+ "toString": PropTypes.func.isRequired,
210
+ "valueOf": PropTypes.func.isRequired
211
+ }), PropTypes.string]),
212
+ "pt": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
213
+ "__@toStringTag": PropTypes.string.isRequired,
214
+ "description": PropTypes.string,
215
+ "toString": PropTypes.func.isRequired,
216
+ "valueOf": PropTypes.func.isRequired
217
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
218
+ "__@toStringTag": PropTypes.string.isRequired,
219
+ "description": PropTypes.string,
220
+ "toString": PropTypes.func.isRequired,
221
+ "valueOf": PropTypes.func.isRequired
222
+ }), PropTypes.string]),
223
+ "px": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
224
+ "__@toStringTag": PropTypes.string.isRequired,
225
+ "description": PropTypes.string,
226
+ "toString": PropTypes.func.isRequired,
227
+ "valueOf": PropTypes.func.isRequired
228
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
229
+ "__@toStringTag": PropTypes.string.isRequired,
230
+ "description": PropTypes.string,
231
+ "toString": PropTypes.func.isRequired,
232
+ "valueOf": PropTypes.func.isRequired
233
+ }), PropTypes.string]),
234
+ "py": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
235
+ "__@toStringTag": PropTypes.string.isRequired,
236
+ "description": PropTypes.string,
237
+ "toString": PropTypes.func.isRequired,
238
+ "valueOf": PropTypes.func.isRequired
239
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
240
+ "__@toStringTag": PropTypes.string.isRequired,
241
+ "description": PropTypes.string,
242
+ "toString": PropTypes.func.isRequired,
243
+ "valueOf": PropTypes.func.isRequired
244
+ }), PropTypes.string])
245
+ }),
87
246
  "fullWidthButtons": PropTypes.bool,
88
247
  "height": PropTypes.string,
89
248
  "leftSideButtons": PropTypes.node,
@@ -1,5 +1,5 @@
1
1
  import styled, { css } from "styled-components";
2
- import { space } from "styled-system";
2
+ import { space, padding } from "styled-system";
3
3
  import StyledFormField from "../../__internal__/form-field/form-field.style";
4
4
  import { StyledFieldset } from "../../__internal__/fieldset/fieldset.style";
5
5
  import StyledButton from "../button/button.style";
@@ -56,7 +56,12 @@ export const StyledFormFooter = styled.div`
56
56
  align-items: stretch;
57
57
  `}
58
58
  `}
59
+
60
+ ${padding}
59
61
  `;
62
+ StyledFormFooter.defaultProps = {
63
+ theme: baseTheme
64
+ };
60
65
 
61
66
  const formBottomMargins = fieldSpacing => ({
62
67
  0: "var(--spacing000)",
@@ -1,9 +1,15 @@
1
1
  import React from "react";
2
- interface SidebarHeaderProps {
2
+ import { PaddingProps } from "styled-system";
3
+ export interface SidebarHeaderProps extends PaddingProps {
3
4
  /** This component supports children. */
4
5
  children?: React.ReactNode;
5
6
  /** A custom id. */
6
7
  id: string;
8
+ /** Close icon button to be rendered */
9
+ closeIcon?: React.ReactNode;
7
10
  }
8
- declare const SidebarHeader: ({ children, id }: SidebarHeaderProps) => JSX.Element;
11
+ declare const SidebarHeader: {
12
+ ({ children, id, closeIcon, ...rest }: SidebarHeaderProps): JSX.Element;
13
+ displayName: string;
14
+ };
9
15
  export default SidebarHeader;
@@ -1,17 +1,179 @@
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
+
1
3
  import React from "react";
2
4
  import PropTypes from "prop-types";
3
- import SidebarHeaderStyle from "./sidebar-header.style";
5
+ import StyledSidebarHeader from "./sidebar-header.style";
4
6
 
5
7
  const SidebarHeader = ({
6
8
  children,
7
- id
8
- }) => /*#__PURE__*/React.createElement(SidebarHeaderStyle, {
9
+ id,
10
+ closeIcon,
11
+ ...rest
12
+ }) => /*#__PURE__*/React.createElement(StyledSidebarHeader, _extends({
13
+ hasClose: !!closeIcon,
9
14
  id: id,
10
- "data-component": "sidebar-header"
11
- }, children);
15
+ "data-component": "sidebar-header",
16
+ p: "27px 32px 32px"
17
+ }, rest), children, closeIcon);
12
18
 
13
19
  SidebarHeader.propTypes = {
14
20
  "children": PropTypes.node,
15
- "id": PropTypes.string.isRequired
21
+ "closeIcon": PropTypes.node,
22
+ "id": PropTypes.string.isRequired,
23
+ "p": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
24
+ "__@toStringTag": PropTypes.string.isRequired,
25
+ "description": PropTypes.string,
26
+ "toString": PropTypes.func.isRequired,
27
+ "valueOf": PropTypes.func.isRequired
28
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
29
+ "__@toStringTag": PropTypes.string.isRequired,
30
+ "description": PropTypes.string,
31
+ "toString": PropTypes.func.isRequired,
32
+ "valueOf": PropTypes.func.isRequired
33
+ }), PropTypes.string]),
34
+ "padding": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
35
+ "__@toStringTag": PropTypes.string.isRequired,
36
+ "description": PropTypes.string,
37
+ "toString": PropTypes.func.isRequired,
38
+ "valueOf": PropTypes.func.isRequired
39
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
40
+ "__@toStringTag": PropTypes.string.isRequired,
41
+ "description": PropTypes.string,
42
+ "toString": PropTypes.func.isRequired,
43
+ "valueOf": PropTypes.func.isRequired
44
+ }), PropTypes.string]),
45
+ "paddingBottom": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
46
+ "__@toStringTag": PropTypes.string.isRequired,
47
+ "description": PropTypes.string,
48
+ "toString": PropTypes.func.isRequired,
49
+ "valueOf": PropTypes.func.isRequired
50
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
51
+ "__@toStringTag": PropTypes.string.isRequired,
52
+ "description": PropTypes.string,
53
+ "toString": PropTypes.func.isRequired,
54
+ "valueOf": PropTypes.func.isRequired
55
+ }), PropTypes.string]),
56
+ "paddingLeft": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
57
+ "__@toStringTag": PropTypes.string.isRequired,
58
+ "description": PropTypes.string,
59
+ "toString": PropTypes.func.isRequired,
60
+ "valueOf": PropTypes.func.isRequired
61
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
62
+ "__@toStringTag": PropTypes.string.isRequired,
63
+ "description": PropTypes.string,
64
+ "toString": PropTypes.func.isRequired,
65
+ "valueOf": PropTypes.func.isRequired
66
+ }), PropTypes.string]),
67
+ "paddingRight": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
68
+ "__@toStringTag": PropTypes.string.isRequired,
69
+ "description": PropTypes.string,
70
+ "toString": PropTypes.func.isRequired,
71
+ "valueOf": PropTypes.func.isRequired
72
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
73
+ "__@toStringTag": PropTypes.string.isRequired,
74
+ "description": PropTypes.string,
75
+ "toString": PropTypes.func.isRequired,
76
+ "valueOf": PropTypes.func.isRequired
77
+ }), PropTypes.string]),
78
+ "paddingTop": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
79
+ "__@toStringTag": PropTypes.string.isRequired,
80
+ "description": PropTypes.string,
81
+ "toString": PropTypes.func.isRequired,
82
+ "valueOf": PropTypes.func.isRequired
83
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
84
+ "__@toStringTag": PropTypes.string.isRequired,
85
+ "description": PropTypes.string,
86
+ "toString": PropTypes.func.isRequired,
87
+ "valueOf": PropTypes.func.isRequired
88
+ }), PropTypes.string]),
89
+ "paddingX": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
90
+ "__@toStringTag": PropTypes.string.isRequired,
91
+ "description": PropTypes.string,
92
+ "toString": PropTypes.func.isRequired,
93
+ "valueOf": PropTypes.func.isRequired
94
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
95
+ "__@toStringTag": PropTypes.string.isRequired,
96
+ "description": PropTypes.string,
97
+ "toString": PropTypes.func.isRequired,
98
+ "valueOf": PropTypes.func.isRequired
99
+ }), PropTypes.string]),
100
+ "paddingY": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
101
+ "__@toStringTag": PropTypes.string.isRequired,
102
+ "description": PropTypes.string,
103
+ "toString": PropTypes.func.isRequired,
104
+ "valueOf": PropTypes.func.isRequired
105
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
106
+ "__@toStringTag": PropTypes.string.isRequired,
107
+ "description": PropTypes.string,
108
+ "toString": PropTypes.func.isRequired,
109
+ "valueOf": PropTypes.func.isRequired
110
+ }), PropTypes.string]),
111
+ "pb": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
112
+ "__@toStringTag": PropTypes.string.isRequired,
113
+ "description": PropTypes.string,
114
+ "toString": PropTypes.func.isRequired,
115
+ "valueOf": PropTypes.func.isRequired
116
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
117
+ "__@toStringTag": PropTypes.string.isRequired,
118
+ "description": PropTypes.string,
119
+ "toString": PropTypes.func.isRequired,
120
+ "valueOf": PropTypes.func.isRequired
121
+ }), PropTypes.string]),
122
+ "pl": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
123
+ "__@toStringTag": PropTypes.string.isRequired,
124
+ "description": PropTypes.string,
125
+ "toString": PropTypes.func.isRequired,
126
+ "valueOf": PropTypes.func.isRequired
127
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
128
+ "__@toStringTag": PropTypes.string.isRequired,
129
+ "description": PropTypes.string,
130
+ "toString": PropTypes.func.isRequired,
131
+ "valueOf": PropTypes.func.isRequired
132
+ }), PropTypes.string]),
133
+ "pr": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
134
+ "__@toStringTag": PropTypes.string.isRequired,
135
+ "description": PropTypes.string,
136
+ "toString": PropTypes.func.isRequired,
137
+ "valueOf": PropTypes.func.isRequired
138
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
139
+ "__@toStringTag": PropTypes.string.isRequired,
140
+ "description": PropTypes.string,
141
+ "toString": PropTypes.func.isRequired,
142
+ "valueOf": PropTypes.func.isRequired
143
+ }), PropTypes.string]),
144
+ "pt": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
145
+ "__@toStringTag": PropTypes.string.isRequired,
146
+ "description": PropTypes.string,
147
+ "toString": PropTypes.func.isRequired,
148
+ "valueOf": PropTypes.func.isRequired
149
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
150
+ "__@toStringTag": PropTypes.string.isRequired,
151
+ "description": PropTypes.string,
152
+ "toString": PropTypes.func.isRequired,
153
+ "valueOf": PropTypes.func.isRequired
154
+ }), PropTypes.string]),
155
+ "px": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
156
+ "__@toStringTag": PropTypes.string.isRequired,
157
+ "description": PropTypes.string,
158
+ "toString": PropTypes.func.isRequired,
159
+ "valueOf": PropTypes.func.isRequired
160
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
161
+ "__@toStringTag": PropTypes.string.isRequired,
162
+ "description": PropTypes.string,
163
+ "toString": PropTypes.func.isRequired,
164
+ "valueOf": PropTypes.func.isRequired
165
+ }), PropTypes.string]),
166
+ "py": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
167
+ "__@toStringTag": PropTypes.string.isRequired,
168
+ "description": PropTypes.string,
169
+ "toString": PropTypes.func.isRequired,
170
+ "valueOf": PropTypes.func.isRequired
171
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
172
+ "__@toStringTag": PropTypes.string.isRequired,
173
+ "description": PropTypes.string,
174
+ "toString": PropTypes.func.isRequired,
175
+ "valueOf": PropTypes.func.isRequired
176
+ }), PropTypes.string])
16
177
  };
178
+ SidebarHeader.displayName = "SidebarHeader";
17
179
  export default SidebarHeader;
@@ -1,2 +1,4 @@
1
- declare const SidebarHeaderStyle: import("styled-components").StyledComponent<"div", any, {}, never>;
2
- export default SidebarHeaderStyle;
1
+ declare const StyledSidebarHeader: import("styled-components").StyledComponent<"div", any, {
2
+ hasClose?: boolean | undefined;
3
+ }, never>;
4
+ export default StyledSidebarHeader;