carbon-react 143.2.5 → 144.0.1

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 (51) hide show
  1. package/esm/components/advanced-color-picker/advanced-color-picker.style.js +1 -5
  2. package/esm/components/dialog/dialog.component.js +29 -103
  3. package/esm/components/dialog/dialog.config.d.ts +0 -4
  4. package/esm/components/dialog/dialog.config.js +1 -5
  5. package/esm/components/dialog/dialog.style.d.ts +6 -14
  6. package/esm/components/dialog/dialog.style.js +54 -83
  7. package/esm/components/dialog-full-screen/content.style.js +32 -74
  8. package/esm/components/dialog-full-screen/dialog-full-screen.style.js +0 -5
  9. package/esm/components/form/form.component.js +8 -17
  10. package/esm/components/form/form.style.d.ts +10 -6
  11. package/esm/components/form/form.style.js +12 -25
  12. package/esm/components/menu/__internal__/submenu/submenu.style.js +8 -5
  13. package/esm/components/menu/menu-item/menu-item.component.d.ts +1 -1
  14. package/esm/components/menu/menu-item/menu-item.component.js +3 -1
  15. package/esm/components/menu/menu-item/menu-item.style.d.ts +1 -0
  16. package/esm/components/menu/menu-item/menu-item.style.js +58 -24
  17. package/esm/components/menu/menu.component.d.ts +1 -1
  18. package/esm/components/menu/menu.style.js +13 -0
  19. package/esm/components/sidebar/sidebar.component.js +8 -18
  20. package/esm/components/sidebar/sidebar.config.d.ts +0 -4
  21. package/esm/components/sidebar/sidebar.config.js +1 -5
  22. package/esm/components/sidebar/sidebar.style.d.ts +4 -2
  23. package/esm/components/sidebar/sidebar.style.js +26 -12
  24. package/lib/components/advanced-color-picker/advanced-color-picker.style.js +0 -4
  25. package/lib/components/dialog/dialog.component.js +27 -101
  26. package/lib/components/dialog/dialog.config.d.ts +0 -4
  27. package/lib/components/dialog/dialog.config.js +2 -6
  28. package/lib/components/dialog/dialog.style.d.ts +6 -14
  29. package/lib/components/dialog/dialog.style.js +54 -83
  30. package/lib/components/dialog-full-screen/content.style.js +31 -73
  31. package/lib/components/dialog-full-screen/dialog-full-screen.style.js +0 -5
  32. package/lib/components/form/form.component.js +7 -16
  33. package/lib/components/form/form.style.d.ts +10 -6
  34. package/lib/components/form/form.style.js +12 -25
  35. package/lib/components/menu/__internal__/submenu/submenu.style.js +8 -5
  36. package/lib/components/menu/menu-item/menu-item.component.d.ts +1 -1
  37. package/lib/components/menu/menu-item/menu-item.component.js +3 -1
  38. package/lib/components/menu/menu-item/menu-item.style.d.ts +1 -0
  39. package/lib/components/menu/menu-item/menu-item.style.js +58 -24
  40. package/lib/components/menu/menu.component.d.ts +1 -1
  41. package/lib/components/menu/menu.style.js +13 -0
  42. package/lib/components/sidebar/sidebar.component.js +7 -17
  43. package/lib/components/sidebar/sidebar.config.d.ts +0 -4
  44. package/lib/components/sidebar/sidebar.config.js +2 -6
  45. package/lib/components/sidebar/sidebar.style.d.ts +4 -2
  46. package/lib/components/sidebar/sidebar.style.js +28 -15
  47. package/package.json +1 -1
  48. package/esm/style/utils/form-style-utils.d.ts +0 -21
  49. package/esm/style/utils/form-style-utils.js +0 -92
  50. package/lib/style/utils/form-style-utils.d.ts +0 -21
  51. package/lib/style/utils/form-style-utils.js +0 -100
@@ -4,18 +4,14 @@ import StyledFormField from "../../__internal__/form-field/form-field.style";
4
4
  import baseTheme from "../../style/themes/base";
5
5
  import StyledSearch from "../search/search.style";
6
6
  import StyledTextarea from "../textarea/textarea.style";
7
- export const StyledFormContent = styled.div`
8
- ${({
7
+ export const StyledFormContent = styled.div(({
9
8
  stickyFooter,
10
9
  isInModal
11
- }) => css`
12
- ${stickyFooter && css`
13
- /* Take responsibility for handling overflow away from parent modal */
14
- overflow-y: ${isInModal ? "auto" : "inherit"};
15
- flex: 1;
16
- `}
17
- `}
18
- `;
10
+ }) => stickyFooter && isInModal && css`
11
+ flex-grow: 1;
12
+ min-height: 0;
13
+ overflow-y: auto;
14
+ `);
19
15
  export const StyledFormFooter = styled.div`
20
16
  align-items: center;
21
17
  display: flex;
@@ -30,8 +26,7 @@ export const StyledFormFooter = styled.div`
30
26
 
31
27
  ${({
32
28
  stickyFooter,
33
- fullWidthButtons,
34
- isInModal
29
+ fullWidthButtons
35
30
  }) => css`
36
31
  ${!stickyFooter && css`
37
32
  margin-top: 48px;
@@ -44,9 +39,7 @@ export const StyledFormFooter = styled.div`
44
39
  padding: 16px 32px;
45
40
  width: 100%;
46
41
  z-index: 1000;
47
- ${!isInModal && css`
48
- position: sticky;
49
- `}
42
+ position: sticky;
50
43
  bottom: 0;
51
44
  `}
52
45
 
@@ -61,9 +54,6 @@ export const StyledFormFooter = styled.div`
61
54
  StyledFormFooter.defaultProps = {
62
55
  theme: baseTheme
63
56
  };
64
-
65
- // Accounts for height of the header of Modal parent, the height form footer and some additional spacing
66
- const HEIGHT_SPACING = 216;
67
57
  export const StyledForm = styled.form`
68
58
  ${space}
69
59
 
@@ -80,19 +70,16 @@ export const StyledForm = styled.form`
80
70
 
81
71
  ${({
82
72
  stickyFooter,
83
- isInModal,
84
- isInSidebar
73
+ isInModal
85
74
  }) => stickyFooter && css`
86
75
  display: flex;
87
76
  flex-direction: column;
88
77
  position: relative;
89
78
 
90
79
  ${isInModal && css`
91
- max-height: calc(100vh - ${HEIGHT_SPACING}px);
92
- `}
93
-
94
- ${isInSidebar && css`
95
- min-height: 100%;
80
+ flex-grow: 1;
81
+ min-height: 0;
82
+ height: 100%;
96
83
  `}
97
84
  `}
98
85
  `;
@@ -12,6 +12,7 @@ const StyledSubmenuWrapper = styled.div`
12
12
  position: relative;
13
13
  width: fit-content;
14
14
  max-width: inherit;
15
+ height: inherit;
15
16
 
16
17
  ${({
17
18
  isSubmenuOpen,
@@ -24,7 +25,8 @@ const StyledSubmenuWrapper = styled.div`
24
25
  inFullscreenView,
25
26
  menuType,
26
27
  asPassiveItem
27
- }) => inFullscreenView && css`
28
+ }) => css`
29
+ ${inFullscreenView && css`
28
30
  width: 100%;
29
31
 
30
32
  ${asPassiveItem && menuType && css`
@@ -34,6 +36,10 @@ const StyledSubmenuWrapper = styled.div`
34
36
  }
35
37
  `}
36
38
  `}
39
+ ${!inFullscreenView && css`
40
+ display: flex;
41
+ `}
42
+ `}
37
43
  `;
38
44
  const StyledSubmenu = styled.ul`
39
45
  ${({
@@ -49,6 +55,7 @@ const StyledSubmenu = styled.ul`
49
55
  ${!inFullscreenView && menuType && css`
50
56
  box-shadow: var(--boxShadow100);
51
57
  position: absolute;
58
+ top: 100%;
52
59
  background-color: ${variant === "default" ? menuConfigVariants[menuType].submenuItemBackground : menuConfigVariants[menuType].background};
53
60
 
54
61
  min-width: 100%;
@@ -170,10 +177,6 @@ const StyledSubmenu = styled.ul`
170
177
  > a,
171
178
  > button {
172
179
  padding: 11px 16px 12px;
173
-
174
- :has([data-component="icon"]) {
175
- padding: 9px 16px 7px;
176
- }
177
180
  }
178
181
  `}
179
182
 
@@ -3,7 +3,7 @@ import { FlexboxProps, LayoutProps, MaxWidthProps, PaddingProps } from "styled-s
3
3
  import { IconType } from "../../icon";
4
4
  import { TagProps } from "../../../__internal__/utils/helpers/tags";
5
5
  export declare type VariantType = "default" | "alternate";
6
- interface MenuItemBaseProps extends Omit<TagProps, "data-component">, LayoutProps, FlexboxProps, PaddingProps {
6
+ interface MenuItemBaseProps extends Omit<TagProps, "data-component">, Pick<LayoutProps, "width" | "maxWidth" | "minWidth">, FlexboxProps, PaddingProps {
7
7
  /** Custom className */
8
8
  className?: string;
9
9
  /** onClick handler */
@@ -37,6 +37,7 @@ export const MenuItem = ({
37
37
  }) => {
38
38
  !(icon || children) ? process.env.NODE_ENV !== "production" ? invariant(false, "Either prop `icon` must be defined or this node must have `children`.") : invariant(false) : void 0;
39
39
  !(children || ariaLabel || typeof submenu === "string") ? process.env.NODE_ENV !== "production" ? invariant(false, "If no text is provided an `ariaLabel` should be given to facilitate accessibility.") : invariant(false) : void 0;
40
+ !(typeof submenu === "boolean" || submenu === undefined || children && typeof submenu === "string" && submenu.length) ? process.env.NODE_ENV !== "production" ? invariant(false, "You should not pass `children` when `submenu` is an empty string") : invariant(false) : void 0;
40
41
  const {
41
42
  inFullscreenView,
42
43
  registerItem,
@@ -182,7 +183,8 @@ export const MenuItem = ({
182
183
  placeholderTabIndex: asPassiveItem
183
184
  }, paddingProps, {
184
185
  asDiv: hasInput || as === "div",
185
- hasInput: hasInput
186
+ hasInput: hasInput,
187
+ inSubmenu: !!handleSubmenuKeyDown
186
188
  }), children));
187
189
  };
188
190
  MenuItem.displayName = "MenuItem";
@@ -15,6 +15,7 @@ interface StyledMenuItemWrapperProps extends Pick<MenuWithChildren, "href" | "sh
15
15
  asDiv?: boolean;
16
16
  hasInput?: boolean;
17
17
  menuItemVariant?: Pick<MenuWithChildren, "variant">["variant"];
18
+ inSubmenu?: boolean;
18
19
  }
19
20
  declare const StyledMenuItemWrapper: import("styled-components").StyledComponent<"a", any, {
20
21
  as: import("react").ForwardRefExoticComponent<import("../../link").LinkProps & import("react").RefAttributes<HTMLButtonElement | HTMLLinkElement>>;
@@ -94,7 +94,8 @@ const StyledMenuItemWrapper = styled.a.attrs({
94
94
  overrideColor,
95
95
  asPassiveItem,
96
96
  asDiv,
97
- hasInput
97
+ hasInput,
98
+ inSubmenu
98
99
  }) => css`
99
100
  display: flex;
100
101
  align-items: center;
@@ -107,6 +108,9 @@ const StyledMenuItemWrapper = styled.a.attrs({
107
108
  a,
108
109
  button {
109
110
  cursor: pointer;
111
+ min-height: 40px;
112
+ height: 100%;
113
+ box-sizing: border-box;
110
114
  }
111
115
 
112
116
  a:focus,
@@ -123,7 +127,7 @@ const StyledMenuItemWrapper = styled.a.attrs({
123
127
  button:has([data-component="icon"]):not(:has(button))
124
128
  ${StyledContent} {
125
129
  position: relative;
126
- top: -2px;
130
+ top: -1px;
127
131
  }
128
132
  `}
129
133
 
@@ -143,11 +147,16 @@ const StyledMenuItemWrapper = styled.a.attrs({
143
147
 
144
148
  ${!inFullscreenView && css`
145
149
  max-width: inherit;
150
+ width: inherit;
151
+ height: inherit;
146
152
 
147
153
  > a,
148
154
  > button {
149
155
  display: flex;
150
156
  align-items: center;
157
+ ${!inSubmenu ? "justify-content: center;" : ""}
158
+ width: inherit;
159
+ max-width: inherit;
151
160
  }
152
161
 
153
162
  && {
@@ -194,15 +203,29 @@ const StyledMenuItemWrapper = styled.a.attrs({
194
203
 
195
204
  ${asPassiveItem ? `
196
205
  ${!inFullscreenView && `
197
- > a:not(:has(button)) {
198
- padding: 11px 16px 12px;
199
- }
206
+ > a:not(:has(button)) {
207
+ padding: 11px 16px;
208
+ }
200
209
 
201
- > a ${StyledButton}:not(.search-button) {
202
- min-height: 17px;
203
- padding: 9px 0px 11px;
204
- }
205
- `}
210
+ > a:has(${StyledButton}:not(.search-button)) {
211
+ height: 100%;
212
+
213
+ ${StyledContent} {
214
+ height: inherit;
215
+
216
+ div {
217
+ height: inherit;
218
+ }
219
+ }
220
+
221
+ ${StyledButton} {
222
+ min-height: 40px;
223
+ padding: 10px 0px;
224
+ box-sizing: border-box;
225
+ height: 100%;
226
+ }
227
+ }
228
+ `}
206
229
 
207
230
  ${StyledIconButton} {
208
231
  > span {
@@ -218,28 +241,37 @@ const StyledMenuItemWrapper = styled.a.attrs({
218
241
  }
219
242
  }
220
243
  ` : `
221
- a,
222
- ${StyledLink} a,
223
- button,
224
- ${StyledLink} button {
225
-
226
- padding: ${inFullscreenView ? "0px 16px" : "11px 16px 12px"};
227
-
228
- :has([data-component="icon"]) {
229
- padding: 9px 16px 7px;
230
- }
231
- }
244
+ ${hasSubmenu || maxWidth ? `
245
+ a,
246
+ ${StyledLink} a,
247
+ button,
248
+ ${StyledLink} button {
249
+ padding: 11px 16px ${hasSubmenu && maxWidth ? "12px" : "10px"};
250
+ }
251
+ ` : `
252
+ a,
253
+ ${StyledLink} a,
254
+ button,
255
+ ${StyledLink} button {
256
+ padding: ${!inFullscreenView ? "11px" : "0px"} 16px;
257
+ }
258
+ `}
232
259
  `}
233
260
 
234
261
  button,
235
- ${StyledLink} button {
236
- height: 40px;
262
+ ${StyledLink} button,
263
+ a,
264
+ ${StyledLink} a {
237
265
  margin: 0px;
238
266
  text-align: left;
239
267
 
240
268
  ${inFullscreenView && css`
241
269
  height: auto;
242
270
  white-space: normal;
271
+
272
+ ${StyledIcon} {
273
+ top: -2px;
274
+ }
243
275
  `}
244
276
  }
245
277
 
@@ -258,6 +290,8 @@ const StyledMenuItemWrapper = styled.a.attrs({
258
290
  ${!inFullscreenView && css`
259
291
  a > ${StyledIcon}, button > ${StyledIcon} {
260
292
  display: inline-block;
293
+ height: 18px;
294
+ top: -2px;
261
295
  }
262
296
  `}
263
297
  }
@@ -361,7 +395,7 @@ const StyledMenuItemWrapper = styled.a.attrs({
361
395
  a::before,
362
396
  button::before {
363
397
  display: block;
364
- margin-top: -2px;
398
+ margin-top: -1px;
365
399
  pointer-events: none;
366
400
  position: absolute;
367
401
  right: ${props => parsePadding(padding(props)).iconSpacing};
@@ -2,7 +2,7 @@ import React from "react";
2
2
  import { LayoutProps, FlexboxProps } from "styled-system";
3
3
  import { TagProps } from "../../__internal__/utils/helpers/tags";
4
4
  import { MenuType } from "./__internal__/menu.context";
5
- export interface MenuProps extends TagProps, LayoutProps, FlexboxProps {
5
+ export interface MenuProps extends TagProps, Pick<LayoutProps, "width" | "minWidth" | "maxWidth" | "overflow" | "overflowX" | "verticalAlign">, FlexboxProps {
6
6
  /** Children elements */
7
7
  children: React.ReactNode;
8
8
  /** Defines the color scheme of the component */
@@ -10,6 +10,8 @@ const StyledMenuWrapper = styled.ul`
10
10
  padding: 0;
11
11
  outline: none;
12
12
  display: flex;
13
+ align-items: stretch;
14
+ min-height: 40px;
13
15
 
14
16
  ${layout}
15
17
  ${flexbox}
@@ -32,6 +34,13 @@ const StyledMenuWrapper = styled.ul`
32
34
  }
33
35
  `;
34
36
  const StyledMenuItem = styled.li`
37
+ display: flex;
38
+ ${({
39
+ maxWidth
40
+ }) => maxWidth && css`
41
+ align-items: stretch;
42
+ `}
43
+
35
44
  ${layout}
36
45
  ${flexbox}
37
46
 
@@ -45,6 +54,10 @@ const StyledMenuItem = styled.li`
45
54
  ${inSubmenu && css`
46
55
  display: list-item;
47
56
  `}
57
+
58
+ ${!inSubmenu && css`
59
+ height: inherit;
60
+ `}
48
61
  `}
49
62
 
50
63
  ${({
@@ -1,13 +1,12 @@
1
1
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
- import React, { useCallback, useRef, useMemo } from "react";
2
+ import React, { useCallback, useRef } from "react";
3
3
  import PropTypes from "prop-types";
4
4
  import Modal from "../modal";
5
- import StyledSidebar from "./sidebar.style";
5
+ import { StyledSidebar, StyledSidebarContent } from "./sidebar.style";
6
6
  import IconButton from "../icon-button";
7
7
  import Icon from "../icon";
8
8
  import FocusTrap from "../../__internal__/focus-trap";
9
9
  import SidebarHeader from "./__internal__/sidebar-header";
10
- import Box from "../box";
11
10
  import createGuid from "../../__internal__/utils/helpers/guid";
12
11
  import useLocale from "../../hooks/__internal__/useLocale";
13
12
  import { filterStyledSystemPaddingProps } from "../../style/utils";
@@ -45,7 +44,6 @@ const Sidebar = /*#__PURE__*/React.forwardRef(({
45
44
  const {
46
45
  current: headerId
47
46
  } = useRef(createGuid());
48
- const hasStickyFooter = useMemo(() => React.Children.toArray(children).some(child => /*#__PURE__*/React.isValidElement(child) && child.props.stickyFooter), [children]);
49
47
  const sidebarRef = useRef(null);
50
48
  const setRefs = useCallback(reference => {
51
49
  sidebarRef.current = reference;
@@ -64,7 +62,7 @@ const Sidebar = /*#__PURE__*/React.forwardRef(({
64
62
  type: "close"
65
63
  }));
66
64
  };
67
- const sidebar = /*#__PURE__*/React.createElement(StyledSidebar, _extends({
65
+ const sidebar = /*#__PURE__*/React.createElement(StyledSidebar, {
68
66
  "aria-modal": !enableBackgroundUI && isTopModal,
69
67
  "aria-describedby": ariaDescribedBy,
70
68
  "aria-label": ariaLabel,
@@ -76,24 +74,16 @@ const Sidebar = /*#__PURE__*/React.forwardRef(({
76
74
  position: position,
77
75
  size: size,
78
76
  onCancel: onCancel,
79
- role: role
80
- }, filterStyledSystemPaddingProps(rest), {
77
+ role: role,
81
78
  width: width
82
- }), header && /*#__PURE__*/React.createElement(SidebarHeader, _extends({
79
+ }, header && /*#__PURE__*/React.createElement(SidebarHeader, _extends({
83
80
  closeIcon: closeIcon()
84
81
  }, headerPadding, {
85
82
  id: headerId
86
- }), header), !header && closeIcon(), /*#__PURE__*/React.createElement(Box, _extends({
83
+ }), header), !header && closeIcon(), /*#__PURE__*/React.createElement(StyledSidebarContent, _extends({
87
84
  "data-element": "sidebar-content",
88
- "data-role": "sidebar-content",
89
- pt: "var(--spacing300)",
90
- pb: "var(--spacing400)",
91
- px: "var(--spacing400)"
92
- }, filterStyledSystemPaddingProps(rest), {
93
- scrollVariant: "light",
94
- overflow: hasStickyFooter ? undefined : "auto",
95
- flex: "1"
96
- }), /*#__PURE__*/React.createElement(SidebarContext.Provider, {
85
+ "data-role": "sidebar-content"
86
+ }, filterStyledSystemPaddingProps(rest)), /*#__PURE__*/React.createElement(SidebarContext.Provider, {
97
87
  value: {
98
88
  isInSidebar: true
99
89
  }
@@ -9,7 +9,3 @@ export declare const SIDEBAR_SIZES_CSS: {
9
9
  };
10
10
  export declare const SIDEBAR_SIZES: string[];
11
11
  export declare const SIDEBAR_ALIGNMENTS: string[];
12
- export declare const SIDEBAR_TOP_SPACING = "27px";
13
- export declare const SIDEBAR_BOTTOM_SPACING = "var(--spacing400)";
14
- export declare const SIDEBAR_LEFT_PADDING = "var(--spacing400)";
15
- export declare const SIDEBAR_RIGHT_PADDING = "var(--spacing400)";
@@ -8,8 +8,4 @@ export const SIDEBAR_SIZES_CSS = {
8
8
  "extra-large": "814px"
9
9
  };
10
10
  export const SIDEBAR_SIZES = ["extra-small", "small", "medium-small", "medium", "medium-large", "large", "extra-large"];
11
- export const SIDEBAR_ALIGNMENTS = ["left", "right"];
12
- export const SIDEBAR_TOP_SPACING = "27px";
13
- export const SIDEBAR_BOTTOM_SPACING = "var(--spacing400)";
14
- export const SIDEBAR_LEFT_PADDING = "var(--spacing400)";
15
- export const SIDEBAR_RIGHT_PADDING = "var(--spacing400)";
11
+ export const SIDEBAR_ALIGNMENTS = ["left", "right"];
@@ -1,4 +1,6 @@
1
1
  import { PaddingProps } from "styled-system";
2
2
  import { SidebarProps } from "./sidebar.component";
3
- declare const StyledSidebar: import("styled-components").StyledComponent<"div", any, Pick<SidebarProps, "width" | "onCancel" | "size" | "position"> & PaddingProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>>, never>;
4
- export default StyledSidebar;
3
+ declare type StyledSidebarProps = Pick<SidebarProps, "onCancel" | "position" | "size" | "width">;
4
+ declare const StyledSidebar: import("styled-components").StyledComponent<"div", any, StyledSidebarProps, never>;
5
+ declare const StyledSidebarContent: import("styled-components").StyledComponent<"div", any, PaddingProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>>, never>;
6
+ export { StyledSidebar, StyledSidebarContent };
@@ -1,25 +1,16 @@
1
1
  import styled, { css } from "styled-components";
2
+ import { padding as paddingFn } from "styled-system";
2
3
  import computeSizing from "../../style/utils/element-sizing";
3
4
  import baseTheme from "../../style/themes/base";
4
5
  import StyledIconButton from "../icon-button/icon-button.style";
5
- import { calculateFormSpacingValues, calculateWidthValue } from "../../style/utils/form-style-utils";
6
- import { StyledFormContent, StyledFormFooter } from "../form/form.style";
7
6
  import { SIDEBAR_SIZES_CSS } from "./sidebar.config";
7
+ import { StyledForm, StyledFormContent } from "../form/form.style";
8
8
  const StyledSidebar = styled.div`
9
9
  // prevents outline being added in safari
10
10
  :focus {
11
11
  outline: none;
12
12
  }
13
13
 
14
- ${StyledFormContent} {
15
- ${props => calculateFormSpacingValues(props, true, "sidebar")}
16
- }
17
-
18
- ${StyledFormFooter}.sticky {
19
- ${calculateWidthValue}
20
- ${props => calculateFormSpacingValues(props, false, "sidebar")}
21
- }
22
-
23
14
  ${({
24
15
  onCancel,
25
16
  position,
@@ -58,7 +49,30 @@ const StyledSidebar = styled.div`
58
49
  `}
59
50
  `}
60
51
  `;
52
+ const StyledSidebarContent = styled.div`
53
+ box-sizing: border-box;
54
+ display: block;
55
+ overflow-y: auto;
56
+ flex-grow: 1;
57
+
58
+ padding: var(--spacing300) var(--spacing400) var(--spacing400);
59
+ ${paddingFn}
60
+
61
+ &:has(${StyledForm}.sticky) {
62
+ display: flex;
63
+ flex-direction: column;
64
+ overflow-y: hidden;
65
+ padding: 0;
66
+
67
+ ${StyledForm}.sticky {
68
+ ${StyledFormContent} {
69
+ padding: var(--spacing300) var(--spacing400) var(--spacing400);
70
+ ${paddingFn}
71
+ }
72
+ }
73
+ }
74
+ `;
61
75
  StyledSidebar.defaultProps = {
62
76
  theme: baseTheme
63
77
  };
64
- export default StyledSidebar;
78
+ export { StyledSidebar, StyledSidebarContent };
@@ -68,10 +68,6 @@ const DialogStyle = exports.DialogStyle = (0, _styledComponents.default)(_dialog
68
68
  padding: var(--spacing200);
69
69
  }
70
70
 
71
- ${_dialog.StyledDialogInnerContent} {
72
- padding: 0;
73
- }
74
-
75
71
  ${_simpleColorPicker.StyledColorOptions} {
76
72
  max-width: 285px;
77
73
  ${_simpleColor.StyledSimpleColor} {