@atlaskit/page 14.0.4 → 15.0.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 (61) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/Grid/package.json +4 -11
  3. package/GridColumn/package.json +4 -11
  4. package/Page/package.json +4 -11
  5. package/constants/package.json +10 -0
  6. package/dist/cjs/constants.js +1 -6
  7. package/dist/cjs/entry-points/constants.js +67 -0
  8. package/dist/cjs/entry-points/grid-column.js +13 -0
  9. package/dist/cjs/entry-points/grid.js +13 -0
  10. package/dist/cjs/entry-points/page.js +13 -0
  11. package/dist/cjs/entry-points/types.js +1 -0
  12. package/dist/cjs/grid-column-context.js +25 -0
  13. package/dist/cjs/grid-column.js +3 -11
  14. package/dist/cjs/grid-wrapper.js +2 -2
  15. package/dist/cjs/grid.js +2 -1
  16. package/dist/cjs/spacing-mapping.js +12 -0
  17. package/dist/es2019/constants.js +0 -5
  18. package/dist/es2019/entry-points/constants.js +2 -0
  19. package/dist/es2019/entry-points/grid-column.js +1 -0
  20. package/dist/es2019/entry-points/grid.js +1 -0
  21. package/dist/es2019/entry-points/page.js +1 -0
  22. package/dist/es2019/entry-points/types.js +0 -0
  23. package/dist/es2019/grid-column-context.js +19 -0
  24. package/dist/es2019/grid-column.js +2 -10
  25. package/dist/es2019/grid-wrapper.js +1 -1
  26. package/dist/es2019/grid.js +2 -1
  27. package/dist/es2019/spacing-mapping.js +6 -0
  28. package/dist/esm/constants.js +0 -5
  29. package/dist/esm/entry-points/constants.js +2 -0
  30. package/dist/esm/entry-points/grid-column.js +1 -0
  31. package/dist/esm/entry-points/grid.js +1 -0
  32. package/dist/esm/entry-points/page.js +1 -0
  33. package/dist/esm/entry-points/types.js +0 -0
  34. package/dist/esm/grid-column-context.js +19 -0
  35. package/dist/esm/grid-column.js +2 -10
  36. package/dist/esm/grid-wrapper.js +1 -1
  37. package/dist/esm/grid.js +2 -1
  38. package/dist/esm/spacing-mapping.js +6 -0
  39. package/dist/types/constants.d.ts +1 -5
  40. package/dist/types/entry-points/constants.d.ts +3 -0
  41. package/dist/types/entry-points/grid-column.d.ts +1 -0
  42. package/dist/types/entry-points/grid.d.ts +1 -0
  43. package/dist/types/entry-points/page.d.ts +1 -0
  44. package/dist/types/entry-points/types.d.ts +1 -0
  45. package/dist/types/grid-column-context.d.ts +12 -0
  46. package/dist/types/grid-column.d.ts +0 -8
  47. package/dist/types/grid-context.d.ts +1 -1
  48. package/dist/types/spacing-mapping.d.ts +5 -0
  49. package/grid/package.json +10 -0
  50. package/grid-column/package.json +10 -0
  51. package/package.json +10 -17
  52. package/page/package.json +10 -0
  53. package/types/package.json +4 -11
  54. package/dist/types-ts4.5/constants.d.ts +0 -24
  55. package/dist/types-ts4.5/grid-column.d.ts +0 -18
  56. package/dist/types-ts4.5/grid-context.d.ts +0 -17
  57. package/dist/types-ts4.5/grid-wrapper.d.ts +0 -11
  58. package/dist/types-ts4.5/grid.d.ts +0 -12
  59. package/dist/types-ts4.5/index.d.ts +0 -4
  60. package/dist/types-ts4.5/page.d.ts +0 -13
  61. package/dist/types-ts4.5/types.d.ts +0 -132
package/CHANGELOG.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # @atlaskit/page
2
2
 
3
+ ## 15.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [`f2dc9097319f0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f2dc9097319f0) - ###
8
+ Dropped support for _legacy_ Typescript 4 types. **Typescript 5 is now the new minimum**.
9
+
10
+ Removes the `typesVersions` property and `dist/types-ts4.5` directory from the dist.
11
+
12
+ Types are now exclusively via the `"types": "dist/types/index.d.ts"` property.
13
+
14
+ ```diff
15
+ - "typesVersions": {
16
+ - ">=4.5 <4.9": {
17
+ - "*": [
18
+ - "dist/types-ts4.5/*",
19
+ - "dist/types-ts4.5/index.d.ts"
20
+ - ]
21
+ - }
22
+ - },
23
+ ```
24
+
25
+ ## 14.1.0
26
+
27
+ ### Minor Changes
28
+
29
+ - [`aef119573f01b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/aef119573f01b) -
30
+ Autofix: add explicit package exports (barrel removal)
31
+
3
32
  ## 14.0.4
4
33
 
5
34
  ### Patch Changes
package/Grid/package.json CHANGED
@@ -1,17 +1,10 @@
1
1
  {
2
2
  "name": "@atlaskit/page/Grid",
3
- "main": "../dist/cjs/grid-wrapper.js",
4
- "module": "../dist/esm/grid-wrapper.js",
5
- "module:es2019": "../dist/es2019/grid-wrapper.js",
3
+ "main": "../dist/cjs/entry-points/grid.js",
4
+ "module": "../dist/esm/entry-points/grid.js",
5
+ "module:es2019": "../dist/es2019/entry-points/grid.js",
6
6
  "sideEffects": [
7
7
  "**/*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/grid-wrapper.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/grid-wrapper.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/entry-points/grid.d.ts"
17
10
  }
@@ -1,17 +1,10 @@
1
1
  {
2
2
  "name": "@atlaskit/page/GridColumn",
3
- "main": "../dist/cjs/grid-column.js",
4
- "module": "../dist/esm/grid-column.js",
5
- "module:es2019": "../dist/es2019/grid-column.js",
3
+ "main": "../dist/cjs/entry-points/grid-column.js",
4
+ "module": "../dist/esm/entry-points/grid-column.js",
5
+ "module:es2019": "../dist/es2019/entry-points/grid-column.js",
6
6
  "sideEffects": [
7
7
  "**/*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/grid-column.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/grid-column.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/entry-points/grid-column.d.ts"
17
10
  }
package/Page/package.json CHANGED
@@ -1,17 +1,10 @@
1
1
  {
2
2
  "name": "@atlaskit/page/Page",
3
- "main": "../dist/cjs/page.js",
4
- "module": "../dist/esm/page.js",
5
- "module:es2019": "../dist/es2019/page.js",
3
+ "main": "../dist/cjs/entry-points/page.js",
4
+ "module": "../dist/esm/entry-points/page.js",
5
+ "module:es2019": "../dist/es2019/entry-points/page.js",
6
6
  "sideEffects": [
7
7
  "**/*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/page.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/page.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/entry-points/page.d.ts"
17
10
  }
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "@atlaskit/page/constants",
3
+ "main": "../dist/cjs/entry-points/constants.js",
4
+ "module": "../dist/esm/entry-points/constants.js",
5
+ "module:es2019": "../dist/es2019/entry-points/constants.js",
6
+ "sideEffects": [
7
+ "**/*.compiled.css"
8
+ ],
9
+ "types": "../dist/types/entry-points/constants.d.ts"
10
+ }
@@ -3,15 +3,10 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.varGridSpacing = exports.varColumnsNum = exports.varColumnSpan = exports.spacingMapping = exports.defaultSpacing = exports.defaultMedium = exports.defaultLayout = exports.defaultGridColumns = exports.defaultGridColumnWidth = exports.defaultBannerHeight = void 0;
6
+ exports.varGridSpacing = exports.varColumnsNum = exports.varColumnSpan = exports.defaultSpacing = exports.defaultMedium = exports.defaultLayout = exports.defaultGridColumns = exports.defaultGridColumnWidth = exports.defaultBannerHeight = void 0;
7
7
  var defaultGridSize = 8;
8
8
  var defaultGridColumns = exports.defaultGridColumns = 12;
9
9
  var defaultGridColumnWidth = exports.defaultGridColumnWidth = defaultGridSize * 10;
10
- var spacingMapping = exports.spacingMapping = {
11
- comfortable: defaultGridSize * 5,
12
- cosy: defaultGridSize * 2,
13
- compact: defaultGridSize * 0.5
14
- };
15
10
  var defaultSpacing = exports.defaultSpacing = 'cosy';
16
11
  var defaultBannerHeight = exports.defaultBannerHeight = 52;
17
12
 
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "defaultBannerHeight", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _constants.defaultBannerHeight;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "defaultGridColumnWidth", {
13
+ enumerable: true,
14
+ get: function get() {
15
+ return _constants.defaultGridColumnWidth;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "defaultGridColumns", {
19
+ enumerable: true,
20
+ get: function get() {
21
+ return _constants.defaultGridColumns;
22
+ }
23
+ });
24
+ Object.defineProperty(exports, "defaultLayout", {
25
+ enumerable: true,
26
+ get: function get() {
27
+ return _constants.defaultLayout;
28
+ }
29
+ });
30
+ Object.defineProperty(exports, "defaultMedium", {
31
+ enumerable: true,
32
+ get: function get() {
33
+ return _constants.defaultMedium;
34
+ }
35
+ });
36
+ Object.defineProperty(exports, "defaultSpacing", {
37
+ enumerable: true,
38
+ get: function get() {
39
+ return _constants.defaultSpacing;
40
+ }
41
+ });
42
+ Object.defineProperty(exports, "spacingMapping", {
43
+ enumerable: true,
44
+ get: function get() {
45
+ return _spacingMapping.spacingMapping;
46
+ }
47
+ });
48
+ Object.defineProperty(exports, "varColumnSpan", {
49
+ enumerable: true,
50
+ get: function get() {
51
+ return _constants.varColumnSpan;
52
+ }
53
+ });
54
+ Object.defineProperty(exports, "varColumnsNum", {
55
+ enumerable: true,
56
+ get: function get() {
57
+ return _constants.varColumnsNum;
58
+ }
59
+ });
60
+ Object.defineProperty(exports, "varGridSpacing", {
61
+ enumerable: true,
62
+ get: function get() {
63
+ return _constants.varGridSpacing;
64
+ }
65
+ });
66
+ var _constants = require("../constants");
67
+ var _spacingMapping = require("../spacing-mapping");
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ Object.defineProperty(exports, "GridColumn", {
8
+ enumerable: true,
9
+ get: function get() {
10
+ return _gridColumn.default;
11
+ }
12
+ });
13
+ var _gridColumn = _interopRequireDefault(require("../grid-column"));
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ Object.defineProperty(exports, "default", {
8
+ enumerable: true,
9
+ get: function get() {
10
+ return _gridWrapper.default;
11
+ }
12
+ });
13
+ var _gridWrapper = _interopRequireDefault(require("../grid-wrapper"));
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ Object.defineProperty(exports, "default", {
8
+ enumerable: true,
9
+ get: function get() {
10
+ return _page.default;
11
+ }
12
+ });
13
+ var _page = _interopRequireDefault(require("../page"));
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.GridColumnContext = void 0;
7
+ var _react = require("react");
8
+ var _constants = require("./constants");
9
+ /**
10
+ * @jsxRuntime classic
11
+ * @jsx jsx
12
+ */
13
+
14
+ /**
15
+ * __Grid column context__
16
+ *
17
+ * A grid column context component for the Page component.
18
+ *
19
+ * - [Examples](https://atlassian.design/components/page/grid-column-context/examples)
20
+ * - [Code](https://atlassian.design/components/page/grid-column-context/code)
21
+ * - [Usage](https://atlassian.design/components/page/grid-column-context/usage)
22
+ */
23
+ var GridColumnContext = exports.GridColumnContext = /*#__PURE__*/(0, _react.createContext)({
24
+ medium: _constants.defaultMedium
25
+ });
@@ -6,13 +6,14 @@ var _typeof = require("@babel/runtime/helpers/typeof");
6
6
  Object.defineProperty(exports, "__esModule", {
7
7
  value: true
8
8
  });
9
- exports.default = exports.GridColumnContext = void 0;
9
+ exports.default = void 0;
10
10
  require("./grid-column.compiled.css");
11
11
  var _react = _interopRequireWildcard(require("react"));
12
12
  var React = _react;
13
13
  var _runtime = require("@compiled/react/runtime");
14
14
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
15
15
  var _constants = require("./constants");
16
+ var _gridColumnContext = require("./grid-column-context");
16
17
  var _gridContext = require("./grid-context");
17
18
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
18
19
  /**
@@ -75,15 +76,6 @@ var getVariant = function getVariant(_ref) {
75
76
  return ColumnVariant.FullWidth;
76
77
  };
77
78
 
78
- /**
79
- * __Grid column context__
80
- *
81
- * @internal
82
- */
83
- var GridColumnContext = exports.GridColumnContext = /*#__PURE__*/(0, _react.createContext)({
84
- medium: _constants.defaultMedium
85
- });
86
-
87
79
  /**
88
80
  * __Grid column__
89
81
  *
@@ -117,7 +109,7 @@ var GridColumn = function GridColumn(_ref2) {
117
109
  medium: medium,
118
110
  columns: columns
119
111
  });
120
- return /*#__PURE__*/React.createElement(GridColumnContext.Provider, {
112
+ return /*#__PURE__*/React.createElement(_gridColumnContext.GridColumnContext.Provider, {
121
113
  value: contextValue
122
114
  }, /*#__PURE__*/React.createElement("div", {
123
115
  style: (0, _defineProperty2.default)({}, varColumnSpan, variant === ColumnVariant.Auto ? 'auto' : colSpan),
@@ -8,7 +8,7 @@ exports.default = void 0;
8
8
  var _react = _interopRequireWildcard(require("react"));
9
9
  var _constants = require("./constants");
10
10
  var _grid = require("./grid");
11
- var _gridColumn = require("./grid-column");
11
+ var _gridColumnContext = require("./grid-column-context");
12
12
  var _gridContext = require("./grid-context");
13
13
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
14
14
  /**
@@ -31,7 +31,7 @@ var GridWrapper = function GridWrapper(_ref) {
31
31
  */
32
32
  var _useContext = (0, _react.useContext)(_gridContext.GridContext),
33
33
  isRoot = _useContext.isRoot;
34
- var _useContext2 = (0, _react.useContext)(_gridColumn.GridColumnContext),
34
+ var _useContext2 = (0, _react.useContext)(_gridColumnContext.GridColumnContext),
35
35
  medium = _useContext2.medium;
36
36
 
37
37
  /**
package/dist/cjs/grid.js CHANGED
@@ -14,6 +14,7 @@ var _runtime = require("@compiled/react/runtime");
14
14
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
15
15
  var _constants = require("./constants");
16
16
  var _gridContext = require("./grid-context");
17
+ var _spacingMapping = require("./spacing-mapping");
17
18
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
18
19
  var defaultGridColumnWidth = 80;
19
20
 
@@ -55,7 +56,7 @@ var Grid = exports.Grid = function Grid(_ref) {
55
56
  columns = _useContext.columns,
56
57
  spacing = _useContext.spacing;
57
58
  return /*#__PURE__*/React.createElement("div", {
58
- style: (0, _defineProperty2.default)((0, _defineProperty2.default)({}, varColumnsNum, columns), varGridSpacing, "".concat(_constants.spacingMapping[spacing], "px")),
59
+ style: (0, _defineProperty2.default)((0, _defineProperty2.default)({}, varColumnsNum, columns), varGridSpacing, "".concat(_spacingMapping.spacingMapping[spacing], "px")),
59
60
  "data-testid": testId,
60
61
  className: (0, _runtime.ax)([styles.grid, gridLayoutMapStyles[layout], isNested && styles.nestedGrid])
61
62
  }, children);
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.spacingMapping = void 0;
7
+ var defaultGridSize = 8;
8
+ var spacingMapping = exports.spacingMapping = {
9
+ comfortable: defaultGridSize * 5,
10
+ cosy: defaultGridSize * 2,
11
+ compact: defaultGridSize * 0.5
12
+ };
@@ -1,11 +1,6 @@
1
1
  const defaultGridSize = 8;
2
2
  export const defaultGridColumns = 12;
3
3
  export const defaultGridColumnWidth = defaultGridSize * 10;
4
- export const spacingMapping = {
5
- comfortable: defaultGridSize * 5,
6
- cosy: defaultGridSize * 2,
7
- compact: defaultGridSize * 0.5
8
- };
9
4
  export const defaultSpacing = 'cosy';
10
5
  export const defaultBannerHeight = 52;
11
6
 
@@ -0,0 +1,2 @@
1
+ export { defaultBannerHeight, defaultGridColumnWidth, defaultGridColumns, defaultLayout, defaultMedium, defaultSpacing, varColumnSpan, varColumnsNum, varGridSpacing } from '../constants';
2
+ export { spacingMapping } from '../spacing-mapping';
@@ -0,0 +1 @@
1
+ export { default as GridColumn } from '../grid-column';
@@ -0,0 +1 @@
1
+ export { default } from '../grid-wrapper';
@@ -0,0 +1 @@
1
+ export { default } from '../page';
File without changes
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import { createContext } from 'react';
6
+ import { defaultMedium } from './constants';
7
+
8
+ /**
9
+ * __Grid column context__
10
+ *
11
+ * A grid column context component for the Page component.
12
+ *
13
+ * - [Examples](https://atlassian.design/components/page/grid-column-context/examples)
14
+ * - [Code](https://atlassian.design/components/page/grid-column-context/code)
15
+ * - [Usage](https://atlassian.design/components/page/grid-column-context/usage)
16
+ */
17
+ export const GridColumnContext = /*#__PURE__*/createContext({
18
+ medium: defaultMedium
19
+ });
@@ -2,8 +2,9 @@
2
2
  import "./grid-column.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
- import { createContext, useContext, useMemo } from 'react';
5
+ import { useContext, useMemo } from 'react';
6
6
  import { defaultMedium } from './constants';
7
+ import { GridColumnContext } from './grid-column-context';
7
8
  import { GridContext } from './grid-context';
8
9
  /**
9
10
  * Determines the method by which column width is calculated.
@@ -66,15 +67,6 @@ const getVariant = ({
66
67
  return ColumnVariant.FullWidth;
67
68
  };
68
69
 
69
- /**
70
- * __Grid column context__
71
- *
72
- * @internal
73
- */
74
- export const GridColumnContext = /*#__PURE__*/createContext({
75
- medium: defaultMedium
76
- });
77
-
78
70
  /**
79
71
  * __Grid column__
80
72
  *
@@ -1,7 +1,7 @@
1
1
  import React, { useContext, useMemo } from 'react';
2
2
  import { defaultGridColumns, defaultSpacing } from './constants';
3
3
  import { Grid } from './grid';
4
- import { GridColumnContext } from './grid-column';
4
+ import { GridColumnContext } from './grid-column-context';
5
5
  import { GridContext } from './grid-context';
6
6
  /**
7
7
  * __Grid__
@@ -3,8 +3,9 @@ import "./grid.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
5
  import { useContext } from 'react';
6
- import { defaultLayout, spacingMapping } from './constants';
6
+ import { defaultLayout } from './constants';
7
7
  import { GridContext } from './grid-context';
8
+ import { spacingMapping } from './spacing-mapping';
8
9
  const defaultGridColumnWidth = 80;
9
10
 
10
11
  /**
@@ -0,0 +1,6 @@
1
+ const defaultGridSize = 8;
2
+ export const spacingMapping = {
3
+ comfortable: defaultGridSize * 5,
4
+ cosy: defaultGridSize * 2,
5
+ compact: defaultGridSize * 0.5
6
+ };
@@ -1,11 +1,6 @@
1
1
  var defaultGridSize = 8;
2
2
  export var defaultGridColumns = 12;
3
3
  export var defaultGridColumnWidth = defaultGridSize * 10;
4
- export var spacingMapping = {
5
- comfortable: defaultGridSize * 5,
6
- cosy: defaultGridSize * 2,
7
- compact: defaultGridSize * 0.5
8
- };
9
4
  export var defaultSpacing = 'cosy';
10
5
  export var defaultBannerHeight = 52;
11
6
 
@@ -0,0 +1,2 @@
1
+ export { defaultBannerHeight, defaultGridColumnWidth, defaultGridColumns, defaultLayout, defaultMedium, defaultSpacing, varColumnSpan, varColumnsNum, varGridSpacing } from '../constants';
2
+ export { spacingMapping } from '../spacing-mapping';
@@ -0,0 +1 @@
1
+ export { default as GridColumn } from '../grid-column';
@@ -0,0 +1 @@
1
+ export { default } from '../grid-wrapper';
@@ -0,0 +1 @@
1
+ export { default } from '../page';
File without changes
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import { createContext } from 'react';
6
+ import { defaultMedium } from './constants';
7
+
8
+ /**
9
+ * __Grid column context__
10
+ *
11
+ * A grid column context component for the Page component.
12
+ *
13
+ * - [Examples](https://atlassian.design/components/page/grid-column-context/examples)
14
+ * - [Code](https://atlassian.design/components/page/grid-column-context/code)
15
+ * - [Usage](https://atlassian.design/components/page/grid-column-context/usage)
16
+ */
17
+ export var GridColumnContext = /*#__PURE__*/createContext({
18
+ medium: defaultMedium
19
+ });
@@ -3,8 +3,9 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  import "./grid-column.compiled.css";
4
4
  import * as React from 'react';
5
5
  import { ax, ix } from "@compiled/react/runtime";
6
- import { createContext, useContext, useMemo } from 'react';
6
+ import { useContext, useMemo } from 'react';
7
7
  import { defaultMedium } from './constants';
8
+ import { GridColumnContext } from './grid-column-context';
8
9
  import { GridContext } from './grid-context';
9
10
  /**
10
11
  * Determines the method by which column width is calculated.
@@ -66,15 +67,6 @@ var getVariant = function getVariant(_ref) {
66
67
  return ColumnVariant.FullWidth;
67
68
  };
68
69
 
69
- /**
70
- * __Grid column context__
71
- *
72
- * @internal
73
- */
74
- export var GridColumnContext = /*#__PURE__*/createContext({
75
- medium: defaultMedium
76
- });
77
-
78
70
  /**
79
71
  * __Grid column__
80
72
  *
@@ -1,7 +1,7 @@
1
1
  import React, { useContext, useMemo } from 'react';
2
2
  import { defaultGridColumns, defaultSpacing } from './constants';
3
3
  import { Grid } from './grid';
4
- import { GridColumnContext } from './grid-column';
4
+ import { GridColumnContext } from './grid-column-context';
5
5
  import { GridContext } from './grid-context';
6
6
  /**
7
7
  * __Grid__
package/dist/esm/grid.js CHANGED
@@ -4,8 +4,9 @@ import "./grid.compiled.css";
4
4
  import * as React from 'react';
5
5
  import { ax, ix } from "@compiled/react/runtime";
6
6
  import { useContext } from 'react';
7
- import { defaultLayout, spacingMapping } from './constants';
7
+ import { defaultLayout } from './constants';
8
8
  import { GridContext } from './grid-context';
9
+ import { spacingMapping } from './spacing-mapping';
9
10
  var defaultGridColumnWidth = 80;
10
11
 
11
12
  /**
@@ -0,0 +1,6 @@
1
+ var defaultGridSize = 8;
2
+ export var spacingMapping = {
3
+ comfortable: defaultGridSize * 5,
4
+ cosy: defaultGridSize * 2,
5
+ compact: defaultGridSize * 0.5
6
+ };
@@ -1,10 +1,6 @@
1
+ import type { spacingMapping } from './spacing-mapping';
1
2
  export declare const defaultGridColumns = 12;
2
3
  export declare const defaultGridColumnWidth: number;
3
- export declare const spacingMapping: {
4
- readonly comfortable: number;
5
- readonly cosy: number;
6
- readonly compact: number;
7
- };
8
4
  export type GridSpacing = keyof typeof spacingMapping;
9
5
  export declare const defaultSpacing = "cosy";
10
6
  export declare const defaultBannerHeight = 52;
@@ -0,0 +1,3 @@
1
+ export { defaultBannerHeight, defaultGridColumnWidth, defaultGridColumns, defaultLayout, defaultMedium, defaultSpacing, varColumnSpan, varColumnsNum, varGridSpacing, } from '../constants';
2
+ export { spacingMapping } from '../spacing-mapping';
3
+ export type { GridSpacing } from '../constants';
@@ -0,0 +1 @@
1
+ export { default as GridColumn } from '../grid-column';
@@ -0,0 +1 @@
1
+ export { default } from '../grid-wrapper';
@@ -0,0 +1 @@
1
+ export { default } from '../page';
@@ -0,0 +1 @@
1
+ export type { BaseGridProps, GridColumnProps, GridLayout, GridProps, GridSpacing, PageProps, ThemeProps, } from '../types';
@@ -0,0 +1,12 @@
1
+ /**
2
+ * __Grid column context__
3
+ *
4
+ * A grid column context component for the Page component.
5
+ *
6
+ * - [Examples](https://atlassian.design/components/page/grid-column-context/examples)
7
+ * - [Code](https://atlassian.design/components/page/grid-column-context/code)
8
+ * - [Usage](https://atlassian.design/components/page/grid-column-context/usage)
9
+ */
10
+ export declare const GridColumnContext: import('react').Context<{
11
+ medium: number;
12
+ }>;
@@ -1,12 +1,4 @@
1
1
  import type { GridColumnProps } from './types';
2
- /**
3
- * __Grid column context__
4
- *
5
- * @internal
6
- */
7
- export declare const GridColumnContext: import('react').Context<{
8
- medium: number;
9
- }>;
10
2
  /**
11
3
  * __Grid column__
12
4
  *
@@ -1,4 +1,4 @@
1
- import { type GridSpacing } from './types';
1
+ import { type GridSpacing } from './constants';
2
2
  type GridContextProps = {
3
3
  isRoot: boolean;
4
4
  isNested: boolean;
@@ -0,0 +1,5 @@
1
+ export declare const spacingMapping: {
2
+ readonly comfortable: number;
3
+ readonly cosy: number;
4
+ readonly compact: number;
5
+ };
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "@atlaskit/page/grid",
3
+ "main": "../dist/cjs/entry-points/grid.js",
4
+ "module": "../dist/esm/entry-points/grid.js",
5
+ "module:es2019": "../dist/es2019/entry-points/grid.js",
6
+ "sideEffects": [
7
+ "**/*.compiled.css"
8
+ ],
9
+ "types": "../dist/types/entry-points/grid.d.ts"
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "@atlaskit/page/grid-column",
3
+ "main": "../dist/cjs/entry-points/grid-column.js",
4
+ "module": "../dist/esm/entry-points/grid-column.js",
5
+ "module:es2019": "../dist/es2019/entry-points/grid-column.js",
6
+ "sideEffects": [
7
+ "**/*.compiled.css"
8
+ ],
9
+ "types": "../dist/types/entry-points/grid-column.d.ts"
10
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/page",
3
- "version": "14.0.4",
3
+ "version": "15.0.0",
4
4
  "description": "A page layout organizes sections on a page using a grid and grid columns.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -12,14 +12,6 @@
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.5 <4.9": {
17
- "*": [
18
- "dist/types-ts4.5/*",
19
- "dist/types-ts4.5/index.d.ts"
20
- ]
21
- }
22
- },
23
15
  "sideEffects": [
24
16
  "**/*.compiled.css"
25
17
  ],
@@ -60,17 +52,18 @@
60
52
  "@af/accessibility-testing": "workspace:^",
61
53
  "@af/integration-testing": "workspace:^",
62
54
  "@af/visual-regression": "workspace:^",
63
- "@atlaskit/banner": "^14.0.0",
64
- "@atlaskit/code": "^17.4.0",
65
- "@atlaskit/docs": "^11.7.0",
66
- "@atlaskit/icon": "^34.0.0",
67
- "@atlaskit/link": "^3.3.0",
68
- "@atlaskit/primitives": "^18.1.0",
69
- "@atlaskit/section-message": "^8.12.0",
70
- "@atlaskit/tokens": "^11.4.0",
55
+ "@atlaskit/banner": "^15.0.0",
56
+ "@atlaskit/code": "^18.0.0",
57
+ "@atlaskit/docs": "^12.0.0",
58
+ "@atlaskit/icon": "^36.0.0",
59
+ "@atlaskit/link": "^4.0.0",
60
+ "@atlaskit/primitives": "^20.0.0",
61
+ "@atlaskit/section-message": "^9.0.0",
62
+ "@atlaskit/tokens": "^14.0.0",
71
63
  "@atlassian/react-compiler-gating": "workspace:^",
72
64
  "@atlassian/ssr-tests": "workspace:^",
73
65
  "@testing-library/react": "^16.3.0",
66
+ "react": "^18.2.0",
74
67
  "react-dom": "^18.2.0"
75
68
  },
76
69
  "keywords": [
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "@atlaskit/page/page",
3
+ "main": "../dist/cjs/entry-points/page.js",
4
+ "module": "../dist/esm/entry-points/page.js",
5
+ "module:es2019": "../dist/es2019/entry-points/page.js",
6
+ "sideEffects": [
7
+ "**/*.compiled.css"
8
+ ],
9
+ "types": "../dist/types/entry-points/page.d.ts"
10
+ }
@@ -1,17 +1,10 @@
1
1
  {
2
2
  "name": "@atlaskit/page/types",
3
- "main": "../dist/cjs/types.js",
4
- "module": "../dist/esm/types.js",
5
- "module:es2019": "../dist/es2019/types.js",
3
+ "main": "../dist/cjs/entry-points/types.js",
4
+ "module": "../dist/esm/entry-points/types.js",
5
+ "module:es2019": "../dist/es2019/entry-points/types.js",
6
6
  "sideEffects": [
7
7
  "**/*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/types.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/types.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/entry-points/types.d.ts"
17
10
  }
@@ -1,24 +0,0 @@
1
- export declare const defaultGridColumns = 12;
2
- export declare const defaultGridColumnWidth: number;
3
- export declare const spacingMapping: {
4
- readonly comfortable: number;
5
- readonly cosy: number;
6
- readonly compact: number;
7
- };
8
- export type GridSpacing = keyof typeof spacingMapping;
9
- export declare const defaultSpacing = "cosy";
10
- export declare const defaultBannerHeight = 52;
11
- export declare const defaultMedium = 0;
12
- export declare const defaultLayout = "fixed";
13
- /**
14
- * The number of available columns in each row.
15
- */
16
- export declare const varColumnsNum = "--ds-columns-num";
17
- /**
18
- * The number of columns that a `GridColumn` covers.
19
- */
20
- export declare const varColumnSpan = "--ds-column-span";
21
- /**
22
- * The spacing (in `px`) between each column.
23
- */
24
- export declare const varGridSpacing = "--ds-grid-spacing";
@@ -1,18 +0,0 @@
1
- import type { GridColumnProps } from './types';
2
- /**
3
- * __Grid column context__
4
- *
5
- * @internal
6
- */
7
- export declare const GridColumnContext: import('react').Context<{
8
- medium: number;
9
- }>;
10
- /**
11
- * __Grid column__
12
- *
13
- * A grid column can span one or more column positions within a grid.
14
- *
15
- * - [Examples](https://atlaskit.atlassian.com/packages/design-system/page)
16
- */
17
- declare const GridColumn: ({ medium, children, testId }: GridColumnProps) => JSX.Element;
18
- export default GridColumn;
@@ -1,17 +0,0 @@
1
- import { type GridSpacing } from './types';
2
- type GridContextProps = {
3
- isRoot: boolean;
4
- isNested: boolean;
5
- spacing: GridSpacing;
6
- columns: number;
7
- };
8
- /**
9
- * __Grid context__
10
- *
11
- * Provides contextual information which is used by both
12
- * the `Grid` and its `GridColumn` children.
13
- *
14
- * @internal
15
- */
16
- export declare const GridContext: import('react').Context<GridContextProps>;
17
- export {};
@@ -1,11 +0,0 @@
1
- import React from 'react';
2
- import type { GridProps } from './types';
3
- /**
4
- * __Grid__
5
- *
6
- * A grid contains one or more `GridColumn` to provide a grid layout.
7
- *
8
- * - [Examples](https://atlaskit.atlassian.com/packages/design-system/page)
9
- */
10
- declare const GridWrapper: ({ spacing: spacingProp, columns: columnsProp, layout, testId, children, theme, }: GridProps) => React.JSX.Element;
11
- export default GridWrapper;
@@ -1,12 +0,0 @@
1
- import type { GridProps } from './types';
2
- /**
3
- * __Grid__
4
- *
5
- * A container for one or more `GridColumn`.
6
- *
7
- * This is the internal component, which relies on the context provided by the
8
- * grid wrapper.
9
- *
10
- * @internal
11
- */
12
- export declare const Grid: ({ layout, testId, children }: GridProps) => JSX.Element;
@@ -1,4 +0,0 @@
1
- import Page from './page';
2
- export default Page;
3
- export { default as Grid } from './grid-wrapper';
4
- export { default as GridColumn } from './grid-column';
@@ -1,13 +0,0 @@
1
- import type { PageProps } from './types';
2
- /**
3
- * __Page__
4
- *
5
- * Used to build page layouts.
6
- *
7
- * Has built in support for positioning [banners](https://atlassian.design/components/banner/examples)
8
- * and the deprecated `@atlaskit/navigation`.
9
- *
10
- * - [Examples](https://atlaskit.atlassian.com/packages/design-system/page)
11
- */
12
- declare const Page: ({ isBannerOpen, bannerHeight, banner, navigation, children, testId, }: PageProps) => JSX.Element;
13
- export default Page;
@@ -1,132 +0,0 @@
1
- import type { ReactNode } from 'react';
2
- import type { GridSpacing } from './constants';
3
- export type { GridSpacing } from './constants';
4
- /**
5
- * The props accepted by the internal `Grid` element.
6
- */
7
- export type BaseGridProps = {
8
- /**
9
- * The content of the grid. Direct children should be instances of `GridColumn`.
10
- */
11
- children?: React.ReactNode;
12
- /**
13
- * Controls whether the grid should use a fixed-width layout or expand to fill available space.
14
- *
15
- * Defaults to `"fixed"`.
16
- */
17
- layout?: GridLayout;
18
- /**
19
- * A unique string that appears as a data attribute `data-testid` in the rendered code. Serves as a hook for automated tests.
20
- */
21
- testId?: string;
22
- };
23
- /**
24
- * Values set for the theme.
25
- */
26
- export type ThemeProps = {
27
- /**
28
- * Number of columns in the grid.
29
- */
30
- columns: number;
31
- /**
32
- * The amount of space between each grid column.
33
- * `comfortable` adds 40px of spacing, `cosy` adds 16px and `compact` creates 4px gap between columns.
34
- *
35
- * Defaults to `"cosy"`.
36
- */
37
- spacing: GridSpacing;
38
- /**
39
- * Sets whether the grid is nested or not.
40
- */
41
- isNestedGrid?: boolean;
42
- };
43
- /**
44
- * The props accepted by the external `Grid` element.
45
- *
46
- * @extends BaseGridProps
47
- */
48
- export type GridProps = BaseGridProps & {
49
- /**
50
- * The amount of space between each grid column.
51
- * `comfortable` adds 40px of spacing, `cosy` adds 16px and `compact` creates 4px gap between columns.
52
- *
53
- * Defaults to `"cosy"`.
54
- */
55
- spacing?: GridSpacing;
56
- /**
57
- * The total number of columns available in each row of the grid.
58
- *
59
- * Defaults to `12`.
60
- */
61
- columns?: number;
62
- /**
63
- * For consumers still using the theme prop to set the grid layout.
64
- */
65
- theme?: ThemeProps;
66
- };
67
- export type GridColumnProps = {
68
- /**
69
- * The number of columns in its parent `Grid` that the `GridColumn` should span.
70
- *
71
- * Defaults to `12`.
72
- */
73
- medium?: number;
74
- /**
75
- * The content to display within the column.
76
- */
77
- children?: ReactNode;
78
- /**
79
- * A unique string that appears as a data attribute `data-testid` in the rendered code. Serves as a hook for automated tests.
80
- */
81
- testId?: string;
82
- };
83
- export type GridLayout = 'fluid' | 'fixed';
84
- export type PageProps = {
85
- /**
86
- * If you provide the banner or banners you are to use, page will help you
87
- * coordinate the showing and hiding of them in conjunction with `isBannerOpen`.
88
- * This is designed to take [banner](https://atlassian.design/components/banner/examples) component, and
89
- * matches its animation timing.
90
- *
91
- * The only time that two banners should be rendered are when an announcement
92
- * banner is loaded alongside an error or warning banner.
93
- */
94
- banner?: ReactNode;
95
- /**
96
- * Takes [side navigation component](/components/side-navigation/) and helps
97
- * position it with consideration to rendered banners.
98
- */
99
- navigation?: ReactNode;
100
- /**
101
- * The contents of the page, to be rendered next to navigation. It will be
102
- * correctly position with relation to both any banner, as well as navigation.
103
- */
104
- children?: ReactNode;
105
- /**
106
- * Sets whether to show or hide the banner. This is responsible for moving the
107
- * page contents down, as well as whether to render the banner component.
108
- *
109
- * Defaults to `false`.
110
- */
111
- isBannerOpen?: boolean;
112
- /**
113
- * `52` is line height `(20) + 4 * grid`. This is the height of all banners aside
114
- * from the dynamically heighted announcement banner.
115
- *
116
- * Banner height can be retrieved from banner using its `innerRef`, which always
117
- * returns its height when expanded even when it's collapsed.
118
- *
119
- * In addition to setting the height of the banner's container for dynamically
120
- * heighted banners, you will need to set the `pageOffset` in navigation. Since
121
- * this is a lot to think about, [here](/components/page/examples#announcement-banners)
122
- * is an example that implements displaying both an announcement banner and a
123
- * warning banner on a page, while matching the height of each.
124
- *
125
- * Defaults to `52`.
126
- */
127
- bannerHeight?: number;
128
- /**
129
- * A unique string that appears as a data attribute `data-testid` in the rendered code. Serves as a hook for automated tests.
130
- */
131
- testId?: string;
132
- };