carbon-react 109.3.4 → 109.5.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 (65) hide show
  1. package/esm/__internal__/full-screen-heading/full-screen-heading.component.d.ts +7 -0
  2. package/esm/__internal__/full-screen-heading/full-screen-heading.component.js +7 -3
  3. package/esm/__internal__/full-screen-heading/full-screen-heading.style.d.ts +6 -0
  4. package/esm/__internal__/full-screen-heading/index.d.ts +2 -0
  5. package/esm/components/box/box.component.d.ts +3 -0
  6. package/esm/components/box/box.component.js +6 -0
  7. package/esm/components/heading/heading.style.d.ts +15 -0
  8. package/esm/components/icon-button/icon-button.component.d.ts +23 -0
  9. package/esm/components/icon-button/icon-button.component.js +168 -22
  10. package/esm/components/icon-button/icon-button.style.d.ts +4 -0
  11. package/esm/components/icon-button/index.d.ts +2 -2
  12. package/esm/components/pages/index.d.ts +4 -2
  13. package/esm/components/pages/page/index.d.ts +2 -0
  14. package/esm/components/pages/page/index.js +1 -0
  15. package/esm/components/pages/page/page.component.d.ts +15 -0
  16. package/esm/components/pages/page/page.component.js +174 -19
  17. package/esm/components/pages/page/page.style.d.ts +3 -0
  18. package/esm/components/pages/page/page.style.js +5 -1
  19. package/esm/components/pages/pages.component.d.ts +23 -0
  20. package/esm/components/pages/pages.component.js +50 -13
  21. package/esm/components/pages/pages.config.d.ts +3 -0
  22. package/esm/components/pages/pages.style.d.ts +3 -0
  23. package/esm/components/pages/pages.style.js +2 -2
  24. package/esm/components/pill/pill.component.d.ts +2 -2
  25. package/esm/components/pill/pill.component.js +7 -9
  26. package/esm/components/popover-container/popover-container.component.d.ts +4 -4
  27. package/esm/components/popover-container/popover-container.style.d.ts +3 -3
  28. package/esm/components/select/multi-select/multi-select.component.js +36 -34
  29. package/lib/__internal__/full-screen-heading/full-screen-heading.component.d.ts +7 -0
  30. package/lib/__internal__/full-screen-heading/full-screen-heading.component.js +7 -3
  31. package/lib/__internal__/full-screen-heading/full-screen-heading.style.d.ts +6 -0
  32. package/lib/__internal__/full-screen-heading/index.d.ts +2 -0
  33. package/lib/components/box/box.component.d.ts +3 -0
  34. package/lib/components/box/box.component.js +6 -0
  35. package/lib/components/heading/heading.style.d.ts +15 -0
  36. package/lib/components/icon-button/icon-button.component.d.ts +23 -0
  37. package/lib/components/icon-button/icon-button.component.js +168 -25
  38. package/lib/components/icon-button/icon-button.style.d.ts +4 -0
  39. package/lib/components/icon-button/index.d.ts +2 -2
  40. package/lib/components/pages/index.d.ts +4 -2
  41. package/lib/components/pages/page/index.d.ts +2 -0
  42. package/lib/components/pages/page/index.js +15 -0
  43. package/lib/components/pages/page/package.json +5 -2
  44. package/lib/components/pages/page/page.component.d.ts +15 -0
  45. package/lib/components/pages/page/page.component.js +175 -19
  46. package/lib/components/pages/page/page.style.d.ts +3 -0
  47. package/lib/components/pages/page/page.style.js +6 -1
  48. package/lib/components/pages/pages.component.d.ts +23 -0
  49. package/lib/components/pages/pages.component.js +50 -13
  50. package/lib/components/pages/pages.config.d.ts +3 -0
  51. package/lib/components/pages/pages.style.d.ts +3 -0
  52. package/lib/components/pages/pages.style.js +2 -2
  53. package/lib/components/pill/pill.component.d.ts +2 -2
  54. package/lib/components/pill/pill.component.js +7 -9
  55. package/lib/components/popover-container/popover-container.component.d.ts +4 -4
  56. package/lib/components/popover-container/popover-container.style.d.ts +3 -3
  57. package/lib/components/select/multi-select/multi-select.component.js +36 -34
  58. package/package.json +1 -1
  59. package/esm/components/icon-button/icon-button.d.ts +0 -18
  60. package/esm/components/pages/page/package.json +0 -3
  61. package/esm/components/pages/page/page.d.ts +0 -12
  62. package/esm/components/pages/pages.d.ts +0 -23
  63. package/lib/components/icon-button/icon-button.d.ts +0 -18
  64. package/lib/components/pages/page/page.d.ts +0 -12
  65. package/lib/components/pages/pages.d.ts +0 -23
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ import { StyledFullScreenHeadingProps } from "./full-screen-heading.style";
3
+ export interface FullScreenHeadingProps extends StyledFullScreenHeadingProps {
4
+ children?: React.ReactNode;
5
+ }
6
+ declare const FullScreenHeading: React.ForwardRefExoticComponent<FullScreenHeadingProps & React.RefAttributes<HTMLDivElement>>;
7
+ export default FullScreenHeading;
@@ -7,13 +7,17 @@ import StyledFullScreenHeading, { StyledHeaderContainer } from "./full-screen-he
7
7
  const FullScreenHeading = /*#__PURE__*/React.forwardRef((props, ref) => {
8
8
  const {
9
9
  children,
10
- ...otherProps
10
+ hasContent
11
11
  } = props;
12
- return /*#__PURE__*/React.createElement(StyledFullScreenHeading, _extends({}, otherProps, tagComponent("full-screen-heading", props), {
12
+ return /*#__PURE__*/React.createElement(StyledFullScreenHeading, _extends({
13
+ hasContent: hasContent
14
+ }, tagComponent("full-screen-heading", props), {
13
15
  ref: ref
14
16
  }), /*#__PURE__*/React.createElement(StyledHeaderContainer, null, children));
15
17
  });
16
18
  FullScreenHeading.propTypes = {
17
- children: PropTypes.node
19
+ "children": PropTypes.node,
20
+ "hasContent": PropTypes.bool
18
21
  };
22
+ FullScreenHeading.displayName = "FullScreenHeading";
19
23
  export default FullScreenHeading;
@@ -0,0 +1,6 @@
1
+ export interface StyledFullScreenHeadingProps {
2
+ hasContent?: boolean;
3
+ }
4
+ export declare const StyledHeaderContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
5
+ declare const StyledFullScreenHeading: import("styled-components").StyledComponent<"div", any, StyledFullScreenHeadingProps, never>;
6
+ export default StyledFullScreenHeading;
@@ -0,0 +1,2 @@
1
+ export { default } from "./full-screen-heading.component";
2
+ export type { FullScreenHeadingProps } from "./full-screen-heading.component";
@@ -2,12 +2,15 @@ import React from "react";
2
2
  import { SpaceProps, LayoutProps, FlexboxProps, ColorProps } from "styled-system";
3
3
  export declare type OverflowWrap = "break-word" | "anywhere";
4
4
  export declare type ScrollVariant = "light" | "dark";
5
+ export declare type BoxSizing = "content-box" | "border-box";
5
6
  export interface BoxProps extends SpaceProps, LayoutProps, FlexboxProps, ColorProps {
6
7
  as?: keyof JSX.IntrinsicElements | React.ComponentType<any>;
7
8
  /** String to set Box content break strategy. Note "anywhere" is not supported in Safari */
8
9
  overflowWrap?: OverflowWrap;
9
10
  /** scroll styling attribute */
10
11
  scrollVariant?: ScrollVariant;
12
+ /** set the box-sizing attribute of the Box component */
13
+ boxSizing?: BoxSizing;
11
14
  }
12
15
  declare const Box: import("styled-components").StyledComponent<"div", any, BoxProps, never>;
13
16
  export default Box;
@@ -41,6 +41,12 @@ const Box = styled.div`
41
41
  background-color: ${boxConfig[scrollVariant].thumb};
42
42
  }
43
43
  `}
44
+
45
+ ${({
46
+ boxSizing
47
+ }) => boxSizing && css`
48
+ box-sizing: ${boxSizing};
49
+ `}
44
50
  `;
45
51
  Box.defaultProps = {
46
52
  theme: BaseTheme
@@ -0,0 +1,15 @@
1
+ export const StyledHeadingIcon: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../icon").IconProps & import("react").RefAttributes<HTMLSpanElement>>, any, {}, never>;
2
+ export const StyledHeading: import("styled-components").StyledComponent<"div", any, {}, never>;
3
+ export const StyledSubHeader: import("styled-components").StyledComponent<"div", any, {}, never>;
4
+ export const StyledHeader: import("styled-components").StyledComponent<"div", any, {}, never>;
5
+ export const StyledSeparator: import("styled-components").StyledComponent<"hr", any, {}, never>;
6
+ export const StyledHeaderHelp: import("styled-components").StyledComponent<{
7
+ ({ as, ariaLabel, children, className, href, helpId, isFocused, tabIndex, tooltipBgColor, tooltipFontColor, tooltipFlipOverrides, tooltipId, tooltipPosition, type, ...rest }: import("../help").HelpProps): JSX.Element;
8
+ displayName: string;
9
+ }, any, {}, never>;
10
+ export const StyledHeadingTitle: import("styled-components").StyledComponent<typeof Typography, any, {}, never>;
11
+ export const StyledDivider: import("styled-components").StyledComponent<({ adaptiveMxBreakpoint, ml, mr, ...rest }: import("../hr").HrProps) => JSX.Element, any, {}, never>;
12
+ export const StyledHeaderContent: import("styled-components").StyledComponent<"div", any, {}, never>;
13
+ export const StyledHeadingBackButton: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../link").LinkProps & import("react").RefAttributes<HTMLButtonElement | HTMLLinkElement>>, any, {}, never>;
14
+ export const StyledHeadingPills: import("styled-components").StyledComponent<"span", any, {}, never>;
15
+ import Typography from "../typography";
@@ -0,0 +1,23 @@
1
+ import React from "react";
2
+ import { MarginProps } from "styled-system";
3
+ import { IconProps } from "../icon";
4
+ export interface IconButtonProps extends MarginProps {
5
+ /** Prop to specify the aria-label of the icon-button component */
6
+ "aria-label"?: string;
7
+ /** Icon meant to be rendered, should be an Icon component */
8
+ children: React.ReactElement<IconProps>;
9
+ /** Callback triggered on blur */
10
+ onBlur?: (ev: React.FocusEvent<HTMLButtonElement>) => void;
11
+ /** Callback triggered on focus */
12
+ onFocus?: (ev: React.FocusEvent<HTMLButtonElement>) => void;
13
+ /** Callback triggered on mouse enter */
14
+ onMouseEnter?: (ev: React.MouseEvent<HTMLButtonElement>) => void;
15
+ /** Callback triggered on mouse leave */
16
+ onMouseLeave?: (ev: React.MouseEvent<HTMLButtonElement>) => void;
17
+ /** Action callback */
18
+ onAction: (e: React.KeyboardEvent<HTMLButtonElement> | React.MouseEvent<HTMLButtonElement>) => void;
19
+ /** Set the button to disabled */
20
+ disabled?: boolean;
21
+ }
22
+ declare const IconButton: React.ForwardRefExoticComponent<IconButtonProps & React.RefAttributes<HTMLButtonElement>>;
23
+ export default IconButton;
@@ -2,13 +2,10 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
2
2
 
3
3
  import React, { useState, useCallback } from "react";
4
4
  import PropTypes from "prop-types";
5
- import styledSystemPropTypes from "@styled-system/prop-types";
6
5
  import Events from "../../__internal__/utils/helpers/events";
7
6
  import StyledIconButton from "./icon-button.style";
8
- import Icon from "../icon";
9
7
  import { filterStyledSystemMarginProps } from "../../style/utils";
10
8
  import { TooltipProvider } from "../../__internal__/tooltip-provider";
11
- const marginPropTypes = filterStyledSystemMarginProps(styledSystemPropTypes.space);
12
9
  const IconButton = /*#__PURE__*/React.forwardRef(({
13
10
  "aria-label": ariaLabel,
14
11
  onAction,
@@ -16,10 +13,10 @@ const IconButton = /*#__PURE__*/React.forwardRef(({
16
13
  disabled,
17
14
  ...rest
18
15
  }, ref) => {
19
- const [internalRef, setInternalRef] = useState(null);
16
+ const [internalRef, setInternalRef] = useState();
20
17
  const marginProps = filterStyledSystemMarginProps(rest);
21
18
 
22
- const onKeyDown = e => {
19
+ const handleKeyDown = e => {
23
20
  if (Events.isEnterKey(e) || Events.isSpaceKey(e)) {
24
21
  e.preventDefault();
25
22
  onAction(e);
@@ -28,7 +25,7 @@ const IconButton = /*#__PURE__*/React.forwardRef(({
28
25
  }
29
26
  };
30
27
 
31
- const handleOnAction = e => {
28
+ const handleOnClick = e => {
32
29
  onAction(e);
33
30
  };
34
31
 
@@ -40,8 +37,8 @@ const IconButton = /*#__PURE__*/React.forwardRef(({
40
37
  }, [ref]);
41
38
  return /*#__PURE__*/React.createElement(StyledIconButton, _extends({}, rest, {
42
39
  "aria-label": ariaLabel,
43
- onKeyDown: onKeyDown,
44
- onClick: handleOnAction,
40
+ onKeyDown: handleKeyDown,
41
+ onClick: handleOnClick,
45
42
  ref: setRefs,
46
43
  disabled: disabled
47
44
  }, marginProps), /*#__PURE__*/React.createElement(TooltipProvider, {
@@ -50,20 +47,169 @@ const IconButton = /*#__PURE__*/React.forwardRef(({
50
47
  target: internalRef
51
48
  }, children));
52
49
  });
53
- IconButton.propTypes = { ...marginPropTypes,
54
-
55
- /** Children prop is restricted to one Icon Component */
56
- children: PropTypes.shape({
57
- type: PropTypes.oneOf([Icon, PropTypes.element])
58
- }).isRequired,
59
-
60
- /** Callback */
61
- onAction: PropTypes.func.isRequired,
62
-
63
- /** Prop to specify the aria-label of the icon-button component */
50
+ IconButton.propTypes = {
64
51
  "aria-label": PropTypes.string,
65
-
66
- /** Set the button to disabled */
67
- disabled: PropTypes.bool
52
+ "children": PropTypes.element.isRequired,
53
+ "disabled": PropTypes.bool,
54
+ "m": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
55
+ "__@toStringTag": PropTypes.string.isRequired,
56
+ "description": PropTypes.string,
57
+ "toString": PropTypes.func.isRequired,
58
+ "valueOf": PropTypes.func.isRequired
59
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
60
+ "__@toStringTag": PropTypes.string.isRequired,
61
+ "description": PropTypes.string,
62
+ "toString": PropTypes.func.isRequired,
63
+ "valueOf": PropTypes.func.isRequired
64
+ }), PropTypes.string]),
65
+ "margin": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
66
+ "__@toStringTag": PropTypes.string.isRequired,
67
+ "description": PropTypes.string,
68
+ "toString": PropTypes.func.isRequired,
69
+ "valueOf": PropTypes.func.isRequired
70
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
71
+ "__@toStringTag": PropTypes.string.isRequired,
72
+ "description": PropTypes.string,
73
+ "toString": PropTypes.func.isRequired,
74
+ "valueOf": PropTypes.func.isRequired
75
+ }), PropTypes.string]),
76
+ "marginBottom": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
77
+ "__@toStringTag": PropTypes.string.isRequired,
78
+ "description": PropTypes.string,
79
+ "toString": PropTypes.func.isRequired,
80
+ "valueOf": PropTypes.func.isRequired
81
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
82
+ "__@toStringTag": PropTypes.string.isRequired,
83
+ "description": PropTypes.string,
84
+ "toString": PropTypes.func.isRequired,
85
+ "valueOf": PropTypes.func.isRequired
86
+ }), PropTypes.string]),
87
+ "marginLeft": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
88
+ "__@toStringTag": PropTypes.string.isRequired,
89
+ "description": PropTypes.string,
90
+ "toString": PropTypes.func.isRequired,
91
+ "valueOf": PropTypes.func.isRequired
92
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
93
+ "__@toStringTag": PropTypes.string.isRequired,
94
+ "description": PropTypes.string,
95
+ "toString": PropTypes.func.isRequired,
96
+ "valueOf": PropTypes.func.isRequired
97
+ }), PropTypes.string]),
98
+ "marginRight": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
99
+ "__@toStringTag": PropTypes.string.isRequired,
100
+ "description": PropTypes.string,
101
+ "toString": PropTypes.func.isRequired,
102
+ "valueOf": PropTypes.func.isRequired
103
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
104
+ "__@toStringTag": PropTypes.string.isRequired,
105
+ "description": PropTypes.string,
106
+ "toString": PropTypes.func.isRequired,
107
+ "valueOf": PropTypes.func.isRequired
108
+ }), PropTypes.string]),
109
+ "marginTop": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
110
+ "__@toStringTag": PropTypes.string.isRequired,
111
+ "description": PropTypes.string,
112
+ "toString": PropTypes.func.isRequired,
113
+ "valueOf": PropTypes.func.isRequired
114
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
115
+ "__@toStringTag": PropTypes.string.isRequired,
116
+ "description": PropTypes.string,
117
+ "toString": PropTypes.func.isRequired,
118
+ "valueOf": PropTypes.func.isRequired
119
+ }), PropTypes.string]),
120
+ "marginX": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
121
+ "__@toStringTag": PropTypes.string.isRequired,
122
+ "description": PropTypes.string,
123
+ "toString": PropTypes.func.isRequired,
124
+ "valueOf": PropTypes.func.isRequired
125
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
126
+ "__@toStringTag": PropTypes.string.isRequired,
127
+ "description": PropTypes.string,
128
+ "toString": PropTypes.func.isRequired,
129
+ "valueOf": PropTypes.func.isRequired
130
+ }), PropTypes.string]),
131
+ "marginY": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
132
+ "__@toStringTag": PropTypes.string.isRequired,
133
+ "description": PropTypes.string,
134
+ "toString": PropTypes.func.isRequired,
135
+ "valueOf": PropTypes.func.isRequired
136
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
137
+ "__@toStringTag": PropTypes.string.isRequired,
138
+ "description": PropTypes.string,
139
+ "toString": PropTypes.func.isRequired,
140
+ "valueOf": PropTypes.func.isRequired
141
+ }), PropTypes.string]),
142
+ "mb": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
143
+ "__@toStringTag": PropTypes.string.isRequired,
144
+ "description": PropTypes.string,
145
+ "toString": PropTypes.func.isRequired,
146
+ "valueOf": PropTypes.func.isRequired
147
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
148
+ "__@toStringTag": PropTypes.string.isRequired,
149
+ "description": PropTypes.string,
150
+ "toString": PropTypes.func.isRequired,
151
+ "valueOf": PropTypes.func.isRequired
152
+ }), PropTypes.string]),
153
+ "ml": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
154
+ "__@toStringTag": PropTypes.string.isRequired,
155
+ "description": PropTypes.string,
156
+ "toString": PropTypes.func.isRequired,
157
+ "valueOf": PropTypes.func.isRequired
158
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
159
+ "__@toStringTag": PropTypes.string.isRequired,
160
+ "description": PropTypes.string,
161
+ "toString": PropTypes.func.isRequired,
162
+ "valueOf": PropTypes.func.isRequired
163
+ }), PropTypes.string]),
164
+ "mr": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
165
+ "__@toStringTag": PropTypes.string.isRequired,
166
+ "description": PropTypes.string,
167
+ "toString": PropTypes.func.isRequired,
168
+ "valueOf": PropTypes.func.isRequired
169
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
170
+ "__@toStringTag": PropTypes.string.isRequired,
171
+ "description": PropTypes.string,
172
+ "toString": PropTypes.func.isRequired,
173
+ "valueOf": PropTypes.func.isRequired
174
+ }), PropTypes.string]),
175
+ "mt": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
176
+ "__@toStringTag": PropTypes.string.isRequired,
177
+ "description": PropTypes.string,
178
+ "toString": PropTypes.func.isRequired,
179
+ "valueOf": PropTypes.func.isRequired
180
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
181
+ "__@toStringTag": PropTypes.string.isRequired,
182
+ "description": PropTypes.string,
183
+ "toString": PropTypes.func.isRequired,
184
+ "valueOf": PropTypes.func.isRequired
185
+ }), PropTypes.string]),
186
+ "mx": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
187
+ "__@toStringTag": PropTypes.string.isRequired,
188
+ "description": PropTypes.string,
189
+ "toString": PropTypes.func.isRequired,
190
+ "valueOf": PropTypes.func.isRequired
191
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
192
+ "__@toStringTag": PropTypes.string.isRequired,
193
+ "description": PropTypes.string,
194
+ "toString": PropTypes.func.isRequired,
195
+ "valueOf": PropTypes.func.isRequired
196
+ }), PropTypes.string]),
197
+ "my": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
198
+ "__@toStringTag": PropTypes.string.isRequired,
199
+ "description": PropTypes.string,
200
+ "toString": PropTypes.func.isRequired,
201
+ "valueOf": PropTypes.func.isRequired
202
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
203
+ "__@toStringTag": PropTypes.string.isRequired,
204
+ "description": PropTypes.string,
205
+ "toString": PropTypes.func.isRequired,
206
+ "valueOf": PropTypes.func.isRequired
207
+ }), PropTypes.string]),
208
+ "onAction": PropTypes.func.isRequired,
209
+ "onBlur": PropTypes.func,
210
+ "onFocus": PropTypes.func,
211
+ "onMouseEnter": PropTypes.func,
212
+ "onMouseLeave": PropTypes.func
68
213
  };
214
+ IconButton.displayName = "IconButton";
69
215
  export default IconButton;
@@ -0,0 +1,4 @@
1
+ declare const StyledIconButton: import("styled-components").StyledComponent<"button", any, {
2
+ type: "button";
3
+ }, "type">;
4
+ export default StyledIconButton;
@@ -1,2 +1,2 @@
1
- export { default } from "./icon-button";
2
- export * from "./icon-button";
1
+ export { default } from "./icon-button.component";
2
+ export type { IconButtonProps } from "./icon-button.component";
@@ -1,2 +1,4 @@
1
- export { default } from "./pages";
2
- export { default as Page } from "./page/page";
1
+ export { default } from "./pages.component";
2
+ export { default as Page } from "./page/page.component";
3
+ export type { PagesProps } from "./pages.component";
4
+ export type { PageProps } from "./page";
@@ -0,0 +1,2 @@
1
+ export { default } from "./page.component";
2
+ export type { PageProps } from "./page.component";
@@ -0,0 +1 @@
1
+ export { default } from "./page.component";
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ import { PaddingProps } from "styled-system";
3
+ export interface PageProps extends PaddingProps {
4
+ /** The title for the page, normally a Heading component. */
5
+ title: React.ReactNode;
6
+ /** This component supports children. */
7
+ children: React.ReactNode;
8
+ /** @ignore @private */
9
+ transitionName?: () => string;
10
+ }
11
+ declare const Page: {
12
+ ({ title, children, ...rest }: PageProps): JSX.Element;
13
+ displayName: string;
14
+ };
15
+ export default Page;
@@ -7,30 +7,36 @@ import tagComponent from "../../../__internal__/utils/helpers/tags/tags";
7
7
  import FullScreenHeading from "../../../__internal__/full-screen-heading";
8
8
  import Box from "../../box";
9
9
  import { StyledPage, StyledPageContent } from "./page.style";
10
+ import { filterStyledSystemPaddingProps } from "../../../style/utils";
10
11
 
11
12
  const Page = ({
12
13
  title,
13
14
  children,
14
- ...props
15
+ ...rest
15
16
  }) => {
16
- const styledPageNodeRef = useRef();
17
+ const styledPageNodeRef = useRef(null);
18
+ const {
19
+ transitionName
20
+ } = rest;
17
21
  return /*#__PURE__*/React.createElement(CSSTransition, _extends({
18
22
  className: "carbon-carousel__transition",
19
23
  timeout: {
20
24
  appear: 0,
21
25
  enter: 0,
22
26
  exit: 0
23
- } // eslint-disable-next-line react/prop-types
24
- ,
25
- classNames: props.transitionName(),
27
+ }
28
+ }, transitionName && {
29
+ classNames: transitionName()
30
+ }, {
26
31
  nodeRef: styledPageNodeRef
27
- }, props), /*#__PURE__*/React.createElement(StyledPage, _extends({}, tagComponent("page", props), {
32
+ }, rest), /*#__PURE__*/React.createElement(StyledPage, _extends({}, tagComponent("page", rest), {
28
33
  ref: styledPageNodeRef
29
34
  }), /*#__PURE__*/React.createElement(FullScreenHeading, {
30
- hasContent: title
31
- }, title), /*#__PURE__*/React.createElement(StyledPageContent, {
32
- "data-element": "carbon-page-content"
33
- }, /*#__PURE__*/React.createElement(Box, {
35
+ hasContent: true
36
+ }, title), /*#__PURE__*/React.createElement(StyledPageContent, _extends({
37
+ "data-element": "carbon-page-content",
38
+ p: "30px 40px"
39
+ }, filterStyledSystemPaddingProps(rest)), /*#__PURE__*/React.createElement(Box, {
34
40
  boxSizing: "border-box",
35
41
  maxWidth: "100%",
36
42
  minWidth: "auto",
@@ -40,14 +46,163 @@ const Page = ({
40
46
  };
41
47
 
42
48
  Page.propTypes = {
43
- /**
44
- * The title for the page, normally a Heading component.
45
- */
46
- title: PropTypes.node.isRequired,
47
-
48
- /**
49
- * This component supports children.
50
- */
51
- children: PropTypes.node.isRequired
49
+ "children": PropTypes.node,
50
+ "p": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
51
+ "__@toStringTag": PropTypes.string.isRequired,
52
+ "description": PropTypes.string,
53
+ "toString": PropTypes.func.isRequired,
54
+ "valueOf": PropTypes.func.isRequired
55
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
56
+ "__@toStringTag": PropTypes.string.isRequired,
57
+ "description": PropTypes.string,
58
+ "toString": PropTypes.func.isRequired,
59
+ "valueOf": PropTypes.func.isRequired
60
+ }), PropTypes.string]),
61
+ "padding": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
62
+ "__@toStringTag": PropTypes.string.isRequired,
63
+ "description": PropTypes.string,
64
+ "toString": PropTypes.func.isRequired,
65
+ "valueOf": PropTypes.func.isRequired
66
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
67
+ "__@toStringTag": PropTypes.string.isRequired,
68
+ "description": PropTypes.string,
69
+ "toString": PropTypes.func.isRequired,
70
+ "valueOf": PropTypes.func.isRequired
71
+ }), PropTypes.string]),
72
+ "paddingBottom": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
73
+ "__@toStringTag": PropTypes.string.isRequired,
74
+ "description": PropTypes.string,
75
+ "toString": PropTypes.func.isRequired,
76
+ "valueOf": PropTypes.func.isRequired
77
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
78
+ "__@toStringTag": PropTypes.string.isRequired,
79
+ "description": PropTypes.string,
80
+ "toString": PropTypes.func.isRequired,
81
+ "valueOf": PropTypes.func.isRequired
82
+ }), PropTypes.string]),
83
+ "paddingLeft": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
84
+ "__@toStringTag": PropTypes.string.isRequired,
85
+ "description": PropTypes.string,
86
+ "toString": PropTypes.func.isRequired,
87
+ "valueOf": PropTypes.func.isRequired
88
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
89
+ "__@toStringTag": PropTypes.string.isRequired,
90
+ "description": PropTypes.string,
91
+ "toString": PropTypes.func.isRequired,
92
+ "valueOf": PropTypes.func.isRequired
93
+ }), PropTypes.string]),
94
+ "paddingRight": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
95
+ "__@toStringTag": PropTypes.string.isRequired,
96
+ "description": PropTypes.string,
97
+ "toString": PropTypes.func.isRequired,
98
+ "valueOf": PropTypes.func.isRequired
99
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
100
+ "__@toStringTag": PropTypes.string.isRequired,
101
+ "description": PropTypes.string,
102
+ "toString": PropTypes.func.isRequired,
103
+ "valueOf": PropTypes.func.isRequired
104
+ }), PropTypes.string]),
105
+ "paddingTop": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
106
+ "__@toStringTag": PropTypes.string.isRequired,
107
+ "description": PropTypes.string,
108
+ "toString": PropTypes.func.isRequired,
109
+ "valueOf": PropTypes.func.isRequired
110
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
111
+ "__@toStringTag": PropTypes.string.isRequired,
112
+ "description": PropTypes.string,
113
+ "toString": PropTypes.func.isRequired,
114
+ "valueOf": PropTypes.func.isRequired
115
+ }), PropTypes.string]),
116
+ "paddingX": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
117
+ "__@toStringTag": PropTypes.string.isRequired,
118
+ "description": PropTypes.string,
119
+ "toString": PropTypes.func.isRequired,
120
+ "valueOf": PropTypes.func.isRequired
121
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
122
+ "__@toStringTag": PropTypes.string.isRequired,
123
+ "description": PropTypes.string,
124
+ "toString": PropTypes.func.isRequired,
125
+ "valueOf": PropTypes.func.isRequired
126
+ }), PropTypes.string]),
127
+ "paddingY": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
128
+ "__@toStringTag": PropTypes.string.isRequired,
129
+ "description": PropTypes.string,
130
+ "toString": PropTypes.func.isRequired,
131
+ "valueOf": PropTypes.func.isRequired
132
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
133
+ "__@toStringTag": PropTypes.string.isRequired,
134
+ "description": PropTypes.string,
135
+ "toString": PropTypes.func.isRequired,
136
+ "valueOf": PropTypes.func.isRequired
137
+ }), PropTypes.string]),
138
+ "pb": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
139
+ "__@toStringTag": PropTypes.string.isRequired,
140
+ "description": PropTypes.string,
141
+ "toString": PropTypes.func.isRequired,
142
+ "valueOf": PropTypes.func.isRequired
143
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
144
+ "__@toStringTag": PropTypes.string.isRequired,
145
+ "description": PropTypes.string,
146
+ "toString": PropTypes.func.isRequired,
147
+ "valueOf": PropTypes.func.isRequired
148
+ }), PropTypes.string]),
149
+ "pl": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
150
+ "__@toStringTag": PropTypes.string.isRequired,
151
+ "description": PropTypes.string,
152
+ "toString": PropTypes.func.isRequired,
153
+ "valueOf": PropTypes.func.isRequired
154
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
155
+ "__@toStringTag": PropTypes.string.isRequired,
156
+ "description": PropTypes.string,
157
+ "toString": PropTypes.func.isRequired,
158
+ "valueOf": PropTypes.func.isRequired
159
+ }), PropTypes.string]),
160
+ "pr": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
161
+ "__@toStringTag": PropTypes.string.isRequired,
162
+ "description": PropTypes.string,
163
+ "toString": PropTypes.func.isRequired,
164
+ "valueOf": PropTypes.func.isRequired
165
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
166
+ "__@toStringTag": PropTypes.string.isRequired,
167
+ "description": PropTypes.string,
168
+ "toString": PropTypes.func.isRequired,
169
+ "valueOf": PropTypes.func.isRequired
170
+ }), PropTypes.string]),
171
+ "pt": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
172
+ "__@toStringTag": PropTypes.string.isRequired,
173
+ "description": PropTypes.string,
174
+ "toString": PropTypes.func.isRequired,
175
+ "valueOf": PropTypes.func.isRequired
176
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
177
+ "__@toStringTag": PropTypes.string.isRequired,
178
+ "description": PropTypes.string,
179
+ "toString": PropTypes.func.isRequired,
180
+ "valueOf": PropTypes.func.isRequired
181
+ }), PropTypes.string]),
182
+ "px": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
183
+ "__@toStringTag": PropTypes.string.isRequired,
184
+ "description": PropTypes.string,
185
+ "toString": PropTypes.func.isRequired,
186
+ "valueOf": PropTypes.func.isRequired
187
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
188
+ "__@toStringTag": PropTypes.string.isRequired,
189
+ "description": PropTypes.string,
190
+ "toString": PropTypes.func.isRequired,
191
+ "valueOf": PropTypes.func.isRequired
192
+ }), PropTypes.string]),
193
+ "py": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
194
+ "__@toStringTag": PropTypes.string.isRequired,
195
+ "description": PropTypes.string,
196
+ "toString": PropTypes.func.isRequired,
197
+ "valueOf": PropTypes.func.isRequired
198
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
199
+ "__@toStringTag": PropTypes.string.isRequired,
200
+ "description": PropTypes.string,
201
+ "toString": PropTypes.func.isRequired,
202
+ "valueOf": PropTypes.func.isRequired
203
+ }), PropTypes.string]),
204
+ "title": PropTypes.node,
205
+ "transitionName": PropTypes.func
52
206
  };
207
+ Page.displayName = "Page";
53
208
  export default Page;
@@ -0,0 +1,3 @@
1
+ declare const StyledPage: import("styled-components").StyledComponent<"article", any, {}, never>;
2
+ declare const StyledPageContent: import("styled-components").StyledComponent<"div", any, {}, never>;
3
+ export { StyledPage, StyledPageContent };
@@ -1,12 +1,13 @@
1
1
  import styled from "styled-components";
2
+ import { padding } from "styled-system";
2
3
  import BaseTheme from "../../../style/themes/base";
3
4
  const StyledPage = styled.article`
4
5
  width: 100%;
5
6
  height: 100%;
6
7
  `;
7
8
  const StyledPageContent = styled.div`
9
+ ${padding}
8
10
  box-sizing: border-box;
9
- padding: 30px 40px;
10
11
  width: 100%;
11
12
  height: 100%;
12
13
  overflow-y: auto;
@@ -14,4 +15,7 @@ const StyledPageContent = styled.div`
14
15
  StyledPage.defaultProps = {
15
16
  theme: BaseTheme
16
17
  };
18
+ StyledPageContent.defaultProps = {
19
+ theme: BaseTheme
20
+ };
17
21
  export { StyledPage, StyledPageContent };