carbon-react 111.15.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 (25) hide show
  1. package/esm/components/dialog/dialog.style.js +1 -1
  2. package/esm/components/form/form.component.d.ts +4 -2
  3. package/esm/components/form/form.component.js +165 -6
  4. package/esm/components/form/form.style.js +6 -1
  5. package/esm/components/sidebar/__internal__/sidebar-header/sidebar-header.component.d.ts +8 -2
  6. package/esm/components/sidebar/__internal__/sidebar-header/sidebar-header.component.js +168 -6
  7. package/esm/components/sidebar/__internal__/sidebar-header/sidebar-header.style.d.ts +4 -2
  8. package/esm/components/sidebar/__internal__/sidebar-header/sidebar-header.style.js +24 -4
  9. package/esm/components/sidebar/sidebar.component.d.ts +2 -0
  10. package/esm/components/sidebar/sidebar.component.js +162 -3
  11. package/esm/style/utils/form-style-utils.d.ts +4 -2
  12. package/esm/style/utils/form-style-utils.js +7 -2
  13. package/lib/components/dialog/dialog.style.js +1 -1
  14. package/lib/components/form/form.component.d.ts +4 -2
  15. package/lib/components/form/form.component.js +165 -6
  16. package/lib/components/form/form.style.js +5 -0
  17. package/lib/components/sidebar/__internal__/sidebar-header/sidebar-header.component.d.ts +8 -2
  18. package/lib/components/sidebar/__internal__/sidebar-header/sidebar-header.component.js +167 -5
  19. package/lib/components/sidebar/__internal__/sidebar-header/sidebar-header.style.d.ts +4 -2
  20. package/lib/components/sidebar/__internal__/sidebar-header/sidebar-header.style.js +31 -4
  21. package/lib/components/sidebar/sidebar.component.d.ts +2 -0
  22. package/lib/components/sidebar/sidebar.component.js +161 -2
  23. package/lib/style/utils/form-style-utils.d.ts +4 -2
  24. package/lib/style/utils/form-style-utils.js +7 -2
  25. package/package.json +1 -1
@@ -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
 
@@ -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;
@@ -1,11 +1,31 @@
1
- import styled from "styled-components";
2
- const SidebarHeaderStyle = styled.div`
1
+ import styled, { css } from "styled-components";
2
+ import { padding } from "styled-system";
3
+ import { baseTheme } from "../../../../style/themes";
4
+ import StyledIconButton from "../../../icon-button/icon-button.style";
5
+ const StyledSidebarHeader = styled.div`
3
6
  background-color: var(--colorsUtilityYang100);
4
7
  box-shadow: inset 0 -1px 0 0 var(--colorsUtilityMajor100);
5
8
  box-sizing: border-box;
6
9
  width: 100%;
7
10
  color: var(--colorsActionMinorYin090);
8
11
  transition: all 0.2s ease;
9
- padding: 27px 32px 32px 32px;
12
+
13
+ ${padding}
14
+
15
+ ${({
16
+ hasClose
17
+ }) => hasClose && css`
18
+ display: flex;
19
+ justify-content: space-between;
20
+
21
+ > ${StyledIconButton}:first-of-type {
22
+ position: absolute;
23
+ z-index: 1;
24
+ right: 25px;
25
+ }
26
+ `}
10
27
  `;
11
- export default SidebarHeaderStyle;
28
+ StyledSidebarHeader.defaultProps = {
29
+ theme: baseTheme
30
+ };
31
+ export default StyledSidebarHeader;
@@ -53,6 +53,8 @@ export interface SidebarProps extends PaddingProps, TagProps, WidthProps {
53
53
  focusableContainers?: CustomRefObject<HTMLElement>[];
54
54
  /** Optional selector to identify the focusable elements, if not provided a default selector is used */
55
55
  focusableSelectors?: string;
56
+ /** Padding to be set on the Sidebar header */
57
+ headerPadding?: PaddingProps;
56
58
  }
57
59
  export declare const Sidebar: React.ForwardRefExoticComponent<SidebarProps & React.RefAttributes<HTMLDivElement>>;
58
60
  export default Sidebar;