@atlaskit/page-header 10.2.4 → 10.3.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @atlaskit/page-header
2
2
 
3
+ ## 10.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) - Upgrade Typescript from `4.3.5` to `4.5.5`
8
+
9
+ ## 10.3.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [`ae50e8dea70`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ae50e8dea70) - Updates `@emotion/core` to `@emotion/react`; v10 to v11. There is no expected behavior change.
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies
18
+
3
19
  ## 10.2.4
4
20
 
5
21
  ### Patch Changes
@@ -1,11 +1,12 @@
1
1
  import React from 'react';
2
2
 
3
3
  import Breadcrumbs, { BreadcrumbsItem } from '@atlaskit/breadcrumbs';
4
+ import __noop from '@atlaskit/ds-lib/noop';
4
5
 
5
6
  import PageHeader from '../src';
6
7
 
7
8
  const breadcrumbs = (
8
- <Breadcrumbs onExpand={() => {}}>
9
+ <Breadcrumbs onExpand={__noop}>
9
10
  <BreadcrumbsItem text="Some project" key="Some project" />
10
11
  <BreadcrumbsItem text="Parent page" key="Parent page" />
11
12
  </Breadcrumbs>
@@ -9,7 +9,7 @@ exports.TitleWrapper = exports.TitleContainer = exports.StyledTitleWrapper = exp
9
9
 
10
10
  var _react = _interopRequireDefault(require("react"));
11
11
 
12
- var _core = require("@emotion/core");
12
+ var _react2 = require("@emotion/react");
13
13
 
14
14
  var _constants = require("@atlaskit/theme/constants");
15
15
 
@@ -24,35 +24,35 @@ var _typography = require("@atlaskit/theme/typography");
24
24
 
25
25
  /** @jsx jsx */
26
26
  var gridSize = (0, _constants.gridSize)();
27
- var truncateStyles = (0, _core.css)({
27
+ var truncateStyles = (0, _react2.css)({
28
28
  overflowX: 'hidden',
29
29
  textOverflow: 'ellipsis',
30
30
  whiteSpace: 'nowrap'
31
31
  });
32
- var outerStyles = (0, _core.css)({
32
+ var outerStyles = (0, _react2.css)({
33
33
  margin: "".concat(gridSize * 3, "px 0 ").concat(gridSize * 2, "px 0")
34
34
  });
35
- var styledTitleStyles = (0, _core.css)({
35
+ var styledTitleStyles = (0, _react2.css)({
36
36
  marginTop: 0,
37
37
  lineHeight: "".concat(gridSize * 4, "px"),
38
38
  outline: 'none'
39
39
  });
40
- var titleWrapperStyles = (0, _core.css)({
40
+ var titleWrapperStyles = (0, _react2.css)({
41
41
  display: 'flex',
42
42
  alignItems: 'flex-start',
43
43
  flexWrap: 'wrap'
44
44
  });
45
- var titleWrapperTruncateStyles = (0, _core.css)({
45
+ var titleWrapperTruncateStyles = (0, _react2.css)({
46
46
  flexWrap: 'nowrap'
47
47
  });
48
- var titleContainerStyles = (0, _core.css)({
48
+ var titleContainerStyles = (0, _react2.css)({
49
49
  minWidth: 0,
50
50
  maxWidth: '100%',
51
51
  marginBottom: "".concat(gridSize, "px"),
52
52
  flex: '1 0 auto',
53
53
  flexShrink: undefined
54
54
  });
55
- var actionStyles = (0, _core.css)({
55
+ var actionStyles = (0, _react2.css)({
56
56
  maxWidth: '100%',
57
57
  marginBottom: "".concat(gridSize, "px"),
58
58
  marginLeft: 'auto',
@@ -64,10 +64,10 @@ var actionStyles = (0, _core.css)({
64
64
  textAlign: 'right'
65
65
  }
66
66
  });
67
- var titleContainerTruncateStyles = (0, _core.css)({
67
+ var titleContainerTruncateStyles = (0, _react2.css)({
68
68
  flexShrink: 1
69
69
  });
70
- var bottomBarStyles = (0, _core.css)({
70
+ var bottomBarStyles = (0, _react2.css)({
71
71
  marginTop: "".concat(gridSize * 2, "px")
72
72
  });
73
73
  /**
@@ -80,14 +80,14 @@ var bottomBarStyles = (0, _core.css)({
80
80
 
81
81
  var OuterWrapper = function OuterWrapper(_ref) {
82
82
  var children = _ref.children;
83
- return (0, _core.jsx)("div", {
83
+ return (0, _react2.jsx)("div", {
84
84
  css: outerStyles
85
85
  }, children);
86
86
  }; // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
87
87
 
88
88
 
89
89
  exports.OuterWrapper = OuterWrapper;
90
- var h700Styles = (0, _core.css)((0, _typography.h700)());
90
+ var h700Styles = (0, _react2.css)((0, _typography.h700)());
91
91
 
92
92
  /**
93
93
  * __Styled title wrapper__
@@ -99,7 +99,7 @@ var StyledTitleWrapper = /*#__PURE__*/_react.default.forwardRef(function (_ref2,
99
99
  var children = _ref2.children,
100
100
  id = _ref2.id,
101
101
  truncateTitle = _ref2.truncateTitle;
102
- return (0, _core.jsx)("h1", {
102
+ return (0, _react2.jsx)("h1", {
103
103
  css: [h700Styles, styledTitleStyles, truncateTitle && truncateStyles],
104
104
  ref: ref,
105
105
  tabIndex: -1,
@@ -118,7 +118,7 @@ exports.StyledTitleWrapper = StyledTitleWrapper;
118
118
  var TitleWrapper = function TitleWrapper(_ref3) {
119
119
  var children = _ref3.children,
120
120
  truncateTitle = _ref3.truncateTitle;
121
- return (0, _core.jsx)("div", {
121
+ return (0, _react2.jsx)("div", {
122
122
  css: [titleWrapperStyles, truncateTitle && titleWrapperTruncateStyles]
123
123
  }, children);
124
124
  };
@@ -135,7 +135,7 @@ exports.TitleWrapper = TitleWrapper;
135
135
  var TitleContainer = function TitleContainer(_ref4) {
136
136
  var children = _ref4.children,
137
137
  truncateTitle = _ref4.truncateTitle;
138
- return (0, _core.jsx)("div", {
138
+ return (0, _react2.jsx)("div", {
139
139
  css: [titleContainerStyles, truncateTitle && titleContainerTruncateStyles]
140
140
  }, children);
141
141
  };
@@ -151,7 +151,7 @@ exports.TitleContainer = TitleContainer;
151
151
 
152
152
  var ActionsWrapper = function ActionsWrapper(_ref5) {
153
153
  var children = _ref5.children;
154
- return (0, _core.jsx)("div", {
154
+ return (0, _react2.jsx)("div", {
155
155
  css: actionStyles
156
156
  }, children);
157
157
  };
@@ -167,7 +167,7 @@ exports.ActionsWrapper = ActionsWrapper;
167
167
 
168
168
  var BottomBarWrapper = function BottomBarWrapper(_ref6) {
169
169
  var children = _ref6.children;
170
- return (0, _core.jsx)("div", {
170
+ return (0, _react2.jsx)("div", {
171
171
  css: bottomBarStyles
172
172
  }, children);
173
173
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/page-header",
3
- "version": "10.2.4",
3
+ "version": "10.3.1",
4
4
  "sideEffects": false
5
5
  }
@@ -7,7 +7,7 @@
7
7
 
8
8
  /** @jsx jsx */
9
9
  import React from 'react';
10
- import { css, jsx } from '@emotion/core';
10
+ import { css, jsx } from '@emotion/react';
11
11
  import { gridSize as getGridSize } from '@atlaskit/theme/constants';
12
12
  import { h700 } from '@atlaskit/theme/typography';
13
13
  const gridSize = getGridSize();
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/page-header",
3
- "version": "10.2.4",
3
+ "version": "10.3.1",
4
4
  "sideEffects": false
5
5
  }
@@ -7,7 +7,7 @@
7
7
 
8
8
  /** @jsx jsx */
9
9
  import React from 'react';
10
- import { css, jsx } from '@emotion/core';
10
+ import { css, jsx } from '@emotion/react';
11
11
  import { gridSize as getGridSize } from '@atlaskit/theme/constants';
12
12
  import { h700 } from '@atlaskit/theme/typography';
13
13
  var gridSize = getGridSize();
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/page-header",
3
- "version": "10.2.4",
3
+ "version": "10.3.1",
4
4
  "sideEffects": false
5
5
  }
@@ -0,0 +1,47 @@
1
+ import { ReactElement, ReactNode } from 'react';
2
+ export declare type PageHeaderProps = {
3
+ /**
4
+ * Contents of the action bar to be rendered next to the page title.
5
+ */
6
+ actions?: ReactElement;
7
+ /**
8
+ * Contents of the action bar to be rendered next to the page title. Typically a button group.
9
+ */
10
+ bottomBar?: ReactElement;
11
+ /**
12
+ * Page breadcrumbs to be rendered above the title.
13
+ */
14
+ breadcrumbs?: ReactElement;
15
+ /**
16
+ * Contents of the bottom bar to be rendered below the page title. Typically contains a search bar and/or filters.
17
+ */
18
+ children?: ReactNode;
19
+ /**
20
+ * Content of the page title. The text wraps by default.
21
+ */
22
+ disableTitleStyles?: boolean;
23
+ /**
24
+ * Returns the inner ref to the DOM element of the title. This is exposed so the focus can be set.
25
+ */
26
+ innerRef?: (element: HTMLElement) => void;
27
+ /**
28
+ * Prevent the title from wrapping across lines. This should be avoided.
29
+ */
30
+ truncateTitle?: boolean;
31
+ /**
32
+ * Used as id of inner h1 tag. This is exposed so the header text can be used as label of other element by aria-labeledby
33
+ */
34
+ id?: string;
35
+ };
36
+ /**
37
+ * __Page header__
38
+ *
39
+ * A page header defines the top of a page. It contains a title and can be optionally combined with
40
+ * breadcrumbs buttons, search, and filters.
41
+ *
42
+ * - [Examples](https://atlassian.design/components/page-header/examples)
43
+ * - [Code](https://atlassian.design/components/page-header/code)
44
+ * - [Usage](https://atlassian.design/components/page-header/usage)
45
+ */
46
+ declare const PageHeader: ({ innerRef, breadcrumbs, actions, bottomBar, children, id, disableTitleStyles, truncateTitle, }: PageHeaderProps) => JSX.Element;
47
+ export default PageHeader;
@@ -0,0 +1,54 @@
1
+ /** @jsx jsx */
2
+ import React from 'react';
3
+ /**
4
+ * __Outer wrapper__
5
+ *
6
+ * An outer wrapper that is the outermost component of the PageHeader component. It wraps around the PageHeader, its Actions,
7
+ * the BottomBar and its Breadcrumbs.
8
+ *
9
+ */
10
+ export declare const OuterWrapper: React.FC<React.ReactNode>;
11
+ interface StyledTitleWrapperProps {
12
+ children?: React.ReactNode;
13
+ id?: string;
14
+ truncateTitle?: boolean;
15
+ }
16
+ /**
17
+ * __Styled title wrapper__
18
+ *
19
+ * A styled title wrapper is a wrapper around the title that controls its the styles exclusively.
20
+ *
21
+ */
22
+ export declare const StyledTitleWrapper: React.ForwardRefExoticComponent<StyledTitleWrapperProps & React.RefAttributes<HTMLHeadingElement>>;
23
+ interface TitleProps {
24
+ truncateTitle?: boolean;
25
+ }
26
+ /**
27
+ * __Title wrapper__
28
+ *
29
+ * A title wrapper is a wrapper around the title and the actions.
30
+ *
31
+ */
32
+ export declare const TitleWrapper: React.FC<TitleProps>;
33
+ /**
34
+ * Title container
35
+ *
36
+ * A title container is a container that wraps around the title and its styles (if applied).
37
+ *
38
+ */
39
+ export declare const TitleContainer: React.FC<TitleProps>;
40
+ /**
41
+ * __Actions wrapper__
42
+ *
43
+ * An actions wrapper is a wrapper for the actions, which appear on the top right of the PageHeader component.
44
+ *
45
+ */
46
+ export declare const ActionsWrapper: React.FC;
47
+ /**
48
+ * __Bottom bar wrapper__
49
+ *
50
+ * A bottom bar wrapper is a wrapper for the bottom bar, which appears at the bottom of the PageHeader component.
51
+ *
52
+ */
53
+ export declare const BottomBarWrapper: React.FC;
54
+ export {};
@@ -0,0 +1 @@
1
+ export { default } from './PageHeader';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/page-header",
3
- "version": "10.2.4",
3
+ "version": "10.3.1",
4
4
  "description": "A page header defines the top of a page. It contains a title and can be optionally combined with breadcrumbs buttons, search, and filters.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -12,6 +12,13 @@
12
12
  "module": "dist/esm/index.js",
13
13
  "module:es2019": "dist/es2019/index.js",
14
14
  "types": "dist/types/index.d.ts",
15
+ "typesVersions": {
16
+ ">=4.0 <4.5": {
17
+ "*": [
18
+ "dist/types-ts4.0/*"
19
+ ]
20
+ }
21
+ },
15
22
  "sideEffects": false,
16
23
  "atlaskit:src": "src/index.tsx",
17
24
  "homepage": "https://atlassian.design/components/page-header",
@@ -24,30 +31,31 @@
24
31
  }
25
32
  },
26
33
  "dependencies": {
27
- "@atlaskit/theme": "^12.1.0",
34
+ "@atlaskit/theme": "^12.2.0",
28
35
  "@babel/runtime": "^7.0.0",
29
- "@emotion/core": "^10.0.9"
36
+ "@emotion/react": "^11.7.1"
30
37
  },
31
38
  "peerDependencies": {
32
39
  "react": "^16.8.0",
33
40
  "react-dom": "^16.8.0"
34
41
  },
35
42
  "devDependencies": {
36
- "@atlaskit/breadcrumbs": "^11.6.0",
43
+ "@atlaskit/breadcrumbs": "^11.7.0",
37
44
  "@atlaskit/button": "^16.3.0",
38
45
  "@atlaskit/docs": "*",
39
- "@atlaskit/inline-edit": "^12.1.0",
40
- "@atlaskit/page": "^12.1.0",
41
- "@atlaskit/section-message": "^6.1.0",
42
- "@atlaskit/select": "^15.6.0",
46
+ "@atlaskit/ds-lib": "^2.0.1",
47
+ "@atlaskit/inline-edit": "^12.2.0",
48
+ "@atlaskit/page": "^12.2.0",
49
+ "@atlaskit/section-message": "^6.2.0",
50
+ "@atlaskit/select": "^15.7.0",
43
51
  "@atlaskit/ssr": "*",
44
- "@atlaskit/textfield": "^5.1.0",
52
+ "@atlaskit/textfield": "^5.2.0",
45
53
  "@atlaskit/visual-regression": "*",
46
54
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
47
55
  "enzyme": "^3.10.0",
48
56
  "react-dom": "^16.8.0",
49
57
  "react-test-renderer": "^16.8.0",
50
- "typescript": "4.3.5"
58
+ "typescript": "4.5.5"
51
59
  },
52
60
  "keywords": [
53
61
  "atlaskit",