@atlaskit/primitives 13.3.1 → 13.3.3

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 (96) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/cjs/compiled/components/anchor.js +1 -1
  3. package/dist/cjs/compiled/components/box.js +1 -1
  4. package/dist/cjs/compiled/components/pressable.js +1 -1
  5. package/dist/cjs/compiled/components/text.compiled.css +4 -1
  6. package/dist/cjs/compiled/components/text.js +7 -11
  7. package/dist/cjs/compiled/index.js +1 -1
  8. package/dist/cjs/components/anchor.js +1 -1
  9. package/dist/cjs/components/box.js +1 -1
  10. package/dist/cjs/components/grid.js +2 -3
  11. package/dist/cjs/components/pressable.js +1 -1
  12. package/dist/cjs/components/text.js +4 -7
  13. package/dist/cjs/index.js +1 -1
  14. package/dist/cjs/utils/has-text-ancestor-context.js +18 -0
  15. package/dist/es2019/compiled/components/anchor.js +1 -1
  16. package/dist/es2019/compiled/components/box.js +1 -1
  17. package/dist/es2019/compiled/components/pressable.js +1 -1
  18. package/dist/es2019/compiled/components/text.compiled.css +4 -1
  19. package/dist/es2019/compiled/components/text.js +7 -9
  20. package/dist/es2019/compiled/index.js +1 -1
  21. package/dist/es2019/components/anchor.js +1 -1
  22. package/dist/es2019/components/box.js +1 -1
  23. package/dist/es2019/components/pressable.js +1 -1
  24. package/dist/es2019/components/text.js +4 -5
  25. package/dist/es2019/index.js +1 -1
  26. package/dist/es2019/utils/has-text-ancestor-context.js +10 -0
  27. package/dist/esm/compiled/components/anchor.js +1 -1
  28. package/dist/esm/compiled/components/box.js +1 -1
  29. package/dist/esm/compiled/components/pressable.js +1 -1
  30. package/dist/esm/compiled/components/text.compiled.css +4 -1
  31. package/dist/esm/compiled/components/text.js +7 -11
  32. package/dist/esm/compiled/index.js +1 -1
  33. package/dist/esm/components/anchor.js +1 -1
  34. package/dist/esm/components/box.js +1 -1
  35. package/dist/esm/components/grid.js +2 -3
  36. package/dist/esm/components/pressable.js +1 -1
  37. package/dist/esm/components/text.js +4 -7
  38. package/dist/esm/index.js +1 -1
  39. package/dist/esm/utils/has-text-ancestor-context.js +12 -0
  40. package/dist/types/compiled/components/box.d.ts +2 -2
  41. package/dist/types/compiled/components/flex.d.ts +1 -1
  42. package/dist/types/compiled/components/inline.d.ts +1 -1
  43. package/dist/types/compiled/components/pressable.d.ts +1 -1
  44. package/dist/types/compiled/components/stack.d.ts +1 -1
  45. package/dist/types/compiled/components/text.d.ts +1 -1
  46. package/dist/types/compiled/components/types.d.ts +0 -1
  47. package/dist/types/compiled/index.d.ts +3 -2
  48. package/dist/types/components/box.d.ts +1 -1
  49. package/dist/types/components/flex.d.ts +1 -1
  50. package/dist/types/components/inline.d.ts +1 -1
  51. package/dist/types/components/pressable.d.ts +1 -1
  52. package/dist/types/components/stack.d.ts +1 -1
  53. package/dist/types/components/text.d.ts +1 -1
  54. package/dist/types/index.d.ts +1 -1
  55. package/dist/types/utils/has-text-ancestor-context.d.ts +9 -0
  56. package/dist/types/{compiled/components/internal → utils}/surface-provider.d.ts +1 -1
  57. package/dist/types/utils/types.d.ts +6 -0
  58. package/dist/types/xcss/style-maps.partial.d.ts +1 -0
  59. package/dist/types-ts4.5/compiled/components/box.d.ts +2 -2
  60. package/dist/types-ts4.5/compiled/components/flex.d.ts +1 -1
  61. package/dist/types-ts4.5/compiled/components/inline.d.ts +1 -1
  62. package/dist/types-ts4.5/compiled/components/pressable.d.ts +1 -1
  63. package/dist/types-ts4.5/compiled/components/stack.d.ts +1 -1
  64. package/dist/types-ts4.5/compiled/components/text.d.ts +1 -1
  65. package/dist/types-ts4.5/compiled/components/types.d.ts +0 -1
  66. package/dist/types-ts4.5/compiled/index.d.ts +3 -2
  67. package/dist/types-ts4.5/components/box.d.ts +1 -1
  68. package/dist/types-ts4.5/components/flex.d.ts +1 -1
  69. package/dist/types-ts4.5/components/inline.d.ts +1 -1
  70. package/dist/types-ts4.5/components/pressable.d.ts +1 -1
  71. package/dist/types-ts4.5/components/stack.d.ts +1 -1
  72. package/dist/types-ts4.5/components/text.d.ts +1 -1
  73. package/dist/types-ts4.5/index.d.ts +1 -1
  74. package/dist/types-ts4.5/utils/has-text-ancestor-context.d.ts +9 -0
  75. package/dist/types-ts4.5/{compiled/components/internal → utils}/surface-provider.d.ts +1 -1
  76. package/dist/types-ts4.5/utils/types.d.ts +6 -0
  77. package/dist/types-ts4.5/xcss/style-maps.partial.d.ts +1 -0
  78. package/package.json +5 -4
  79. package/dist/cjs/components/internal/surface-provider.js +0 -25
  80. package/dist/cjs/components/internal/types.js +0 -1
  81. package/dist/es2019/components/internal/surface-provider.js +0 -19
  82. package/dist/esm/compiled/components/internal/types.js +0 -0
  83. package/dist/esm/components/internal/surface-provider.js +0 -19
  84. package/dist/esm/components/internal/types.js +0 -0
  85. package/dist/types/compiled/components/internal/types.d.ts +0 -5
  86. package/dist/types/components/internal/surface-provider.d.ts +0 -15
  87. package/dist/types/components/internal/types.d.ts +0 -1
  88. package/dist/types-ts4.5/compiled/components/internal/types.d.ts +0 -5
  89. package/dist/types-ts4.5/components/internal/surface-provider.d.ts +0 -15
  90. package/dist/types-ts4.5/components/internal/types.d.ts +0 -1
  91. /package/dist/cjs/{compiled/components/internal → utils}/surface-provider.js +0 -0
  92. /package/dist/cjs/{compiled/components/internal → utils}/types.js +0 -0
  93. /package/dist/es2019/{compiled/components/internal → utils}/surface-provider.js +0 -0
  94. /package/dist/es2019/{compiled/components/internal → utils}/types.js +0 -0
  95. /package/dist/esm/{compiled/components/internal → utils}/surface-provider.js +0 -0
  96. /package/dist/{es2019/components/internal → esm/utils}/types.js +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @atlaskit/primitives
2
2
 
3
+ ## 13.3.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#178053](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/178053)
8
+ [`cb318c8c28c26`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/cb318c8c28c26) -
9
+ Internal changes to typography.
10
+
11
+ ## 13.3.2
12
+
13
+ ### Patch Changes
14
+
15
+ - [#175552](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/175552)
16
+ [`0384c8ac8996a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0384c8ac8996a) -
17
+ Narrow down fontStyle type definition to only allow `normal` and `italic`.
18
+
3
19
  ## 13.3.1
4
20
 
5
21
  ### Patch Changes
@@ -70,7 +70,7 @@ var AnchorNoRef = function AnchorNoRef(_ref, ref) {
70
70
  action: 'clicked',
71
71
  componentName: componentName || 'Anchor',
72
72
  packageName: "@atlaskit/primitives",
73
- packageVersion: "13.3.1",
73
+ packageVersion: "13.3.3",
74
74
  analyticsData: analyticsContext,
75
75
  actionSubject: 'link'
76
76
  });
@@ -13,7 +13,7 @@ var React = _react;
13
13
  var _runtime = require("@compiled/react/runtime");
14
14
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
15
15
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
16
- var _surfaceProvider = require("./internal/surface-provider");
16
+ var _surfaceProvider = require("../../utils/surface-provider");
17
17
  var _excluded = ["as", "children", "backgroundColor", "padding", "paddingBlock", "paddingBlockStart", "paddingBlockEnd", "paddingInline", "paddingInlineStart", "paddingInlineEnd", "style", "testId", "xcss"],
18
18
  _excluded2 = ["className"];
19
19
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
@@ -60,7 +60,7 @@ var Pressable = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
60
60
  action: 'clicked',
61
61
  componentName: componentName || 'Pressable',
62
62
  packageName: "@atlaskit/primitives",
63
- packageVersion: "13.3.1",
63
+ packageVersion: "13.3.3",
64
64
  analyticsData: analyticsContext,
65
65
  actionSubject: 'button'
66
66
  });
@@ -1,3 +1,7 @@
1
+ ._11c81doa{font:var(--ds-font-body-large,normal 400 1pc/24px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,system-ui,"Helvetica Neue",sans-serif)}
2
+ ._11c81oud{font:var(--ds-font-body,normal 400 14px/20px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,system-ui,"Helvetica Neue",sans-serif)}
3
+ ._11c81vlj{font:var(--ds-font-body-small,normal 400 11px/1pc ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,system-ui,"Helvetica Neue",sans-serif)}
4
+ ._11c8qk37{font:var(--ds-font-body-UNSAFE_small,normal 400 9pt/1pc ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,system-ui,"Helvetica Neue",sans-serif)}
1
5
  ._18m915vq{overflow-y:hidden}
2
6
  ._18u0idpf{margin-left:0}
3
7
  ._19pkidpf{margin-top:0}
@@ -8,7 +12,6 @@
8
12
  ._2hwxidpf{margin-right:0}
9
13
  ._k48p1pd9{font-weight:var(--ds-font-weight-semibold,600)}
10
14
  ._k48p1wq8{font-weight:var(--ds-font-weight-medium,500)}
11
- ._k48p8n31{font-weight:bold}
12
15
  ._k48pi7a9{font-weight:var(--ds-font-weight-regular,400)}
13
16
  ._k48pmoej{font-weight:var(--ds-font-weight-bold,700)}
14
17
  ._otyridpf{margin-bottom:0}
@@ -13,15 +13,11 @@ var React = _react;
13
13
  var _runtime = require("@compiled/react/runtime");
14
14
  var _tinyInvariant = _interopRequireDefault(require("tiny-invariant"));
15
15
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
16
- var _surfaceProvider = require("./internal/surface-provider");
16
+ var _hasTextAncestorContext = require("../../utils/has-text-ancestor-context");
17
+ var _surfaceProvider = require("../../utils/surface-provider");
17
18
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
18
19
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
19
20
  var asAllowlist = ['span', 'p', 'strong', 'em'];
20
- var HasTextAncestorContext = /*#__PURE__*/(0, _react.createContext)(false);
21
- var useHasTextAncestor = function useHasTextAncestor() {
22
- return (0, _react.useContext)(HasTextAncestorContext);
23
- };
24
-
25
21
  /**
26
22
  * Custom hook designed to abstract the parsing of the color props and make it clearer in the future how color is reconciled between themes and tokens.
27
23
  */
@@ -45,7 +41,7 @@ var useColor = function useColor(colorProp, hasTextAncestor) {
45
41
  };
46
42
  var styles = {
47
43
  root: "_19pkidpf _2hwxidpf _otyridpf _18u0idpf _1i4qfg65",
48
- 'as.strong': "_k48p8n31",
44
+ 'as.strong': "_k48pmoej",
49
45
  'as.em': "_zg8l1m30",
50
46
  'textAlign.center': "_y3gn1h6o",
51
47
  'textAlign.end': "_y3gnh9n0",
@@ -155,9 +151,9 @@ var Text = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
155
151
  maxLines = _ref.maxLines,
156
152
  children = _ref.children;
157
153
  (0, _tinyInvariant.default)(asAllowlist.includes(Component), "@atlaskit/primitives: Text received an invalid \"as\" value of \"".concat(Component, "\""));
158
- var hasTextAncestor = useHasTextAncestor();
154
+ var hasTextAncestor = (0, _hasTextAncestorContext.useHasTextAncestor)();
159
155
  var color = useColor(colorProp, hasTextAncestor);
160
- if (!(0, _platformFeatureFlags.fg)('platform-primitives-nested-text-inherit-size') && !size) {
156
+ if ((!(0, _platformFeatureFlags.fg)('platform-primitives-nested-text-inherit-size') || !hasTextAncestor) && !size) {
161
157
  size = 'medium';
162
158
  }
163
159
  var component = /*#__PURE__*/React.createElement(Component, {
@@ -167,13 +163,13 @@ var Text = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
167
163
  },
168
164
  "data-testid": testId,
169
165
  ref: ref,
170
- className: (0, _runtime.ax)([styles.root, color && textColorMap[color], maxLines && styles.truncation, maxLines === 1 && styles.breakAll, align && styles["textAlign.".concat(align)], weight && fontWeightMap[weight], Component === 'em' && styles['as.em'], Component === 'strong' && styles['as.strong']])
166
+ className: (0, _runtime.ax)([styles.root, size && fontSizeMap[size], color && textColorMap[color], maxLines && styles.truncation, maxLines === 1 && styles.breakAll, align && styles["textAlign.".concat(align)], weight && fontWeightMap[weight], Component === 'em' && styles['as.em'], Component === 'strong' && styles['as.strong']])
171
167
  }, children);
172
168
  if (hasTextAncestor) {
173
169
  // no need to re-apply context if the text is already wrapped
174
170
  return component;
175
171
  }
176
- return /*#__PURE__*/React.createElement(HasTextAncestorContext.Provider, {
172
+ return /*#__PURE__*/React.createElement(_hasTextAncestorContext.HasTextAncestorProvider, {
177
173
  value: true
178
174
  }, component);
179
175
  });
@@ -93,4 +93,4 @@ var _pressable = _interopRequireDefault(require("./components/pressable"));
93
93
  var _anchor = _interopRequireDefault(require("./components/anchor"));
94
94
  var _responsive = require("./responsive");
95
95
  var _focusable = _interopRequireDefault(require("./components/focusable"));
96
- var _surfaceProvider = require("./components/internal/surface-provider");
96
+ var _surfaceProvider = require("../utils/surface-provider");
@@ -100,7 +100,7 @@ var AnchorNoRef = function AnchorNoRef(_ref, ref) {
100
100
  action: 'clicked',
101
101
  componentName: componentName || 'Anchor',
102
102
  packageName: "@atlaskit/primitives",
103
- packageVersion: "13.3.1",
103
+ packageVersion: "13.3.3",
104
104
  analyticsData: analyticsContext,
105
105
  actionSubject: 'link'
106
106
  });
@@ -9,9 +9,9 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
9
9
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
10
  var _react = require("react");
11
11
  var _react2 = require("@emotion/react");
12
+ var _surfaceProvider = require("../utils/surface-provider");
12
13
  var _styleMaps = require("../xcss/style-maps.partial");
13
14
  var _xcss = require("../xcss/xcss");
14
- var _surfaceProvider = require("./internal/surface-provider");
15
15
  var _excluded = ["as", "children", "backgroundColor", "padding", "paddingBlock", "paddingBlockStart", "paddingBlockEnd", "paddingInline", "paddingInlineStart", "paddingInlineEnd", "style", "testId", "xcss"],
16
16
  _excluded2 = ["className"];
17
17
  /**
@@ -168,10 +168,9 @@ var Grid = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(fu
168
168
  * NOTE: If we disallow `grid-template-areas` (etc) to be set via `props.xcss`, we can remove this.
169
169
  */
170
170
  var style = (0, _react.useMemo)(function () {
171
- var _ref2;
172
- return _ref2 = {}, (0, _defineProperty2.default)(_ref2, gridTemplateAreasVar, gridTemplateAreas ? gridTemplateAreas.map(function (str) {
171
+ return (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, gridTemplateAreasVar, gridTemplateAreas ? gridTemplateAreas.map(function (str) {
173
172
  return "\"".concat(str, "\"");
174
- }).join('\n') || 'initial' : 'initial'), (0, _defineProperty2.default)(_ref2, gridTemplateColumnsVar, gridTemplateColumns || 'initial'), (0, _defineProperty2.default)(_ref2, gridTemplateRowsVar, gridTemplateRows || 'initial'), _ref2;
173
+ }).join('\n') || 'initial' : 'initial'), gridTemplateColumnsVar, gridTemplateColumns || 'initial'), gridTemplateRowsVar, gridTemplateRows || 'initial');
175
174
  }, [gridTemplateAreas, gridTemplateColumns, gridTemplateRows]);
176
175
  return (0, _react2.jsx)(Component, {
177
176
  id: id,
@@ -95,7 +95,7 @@ var Pressable = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
95
95
  action: 'clicked',
96
96
  componentName: componentName || 'Pressable',
97
97
  packageName: "@atlaskit/primitives",
98
- packageVersion: "13.3.1",
98
+ packageVersion: "13.3.3",
99
99
  analyticsData: analyticsContext,
100
100
  actionSubject: 'button'
101
101
  });
@@ -9,8 +9,9 @@ var _react = require("react");
9
9
  var _react2 = require("@emotion/react");
10
10
  var _tinyInvariant = _interopRequireDefault(require("tiny-invariant"));
11
11
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
12
+ var _hasTextAncestorContext = require("../utils/has-text-ancestor-context");
13
+ var _surfaceProvider = require("../utils/surface-provider");
12
14
  var _styleMaps = require("../xcss/style-maps.partial");
13
- var _surfaceProvider = require("./internal/surface-provider");
14
15
  /**
15
16
  * @jsxRuntime classic
16
17
  * @jsx jsx
@@ -53,10 +54,6 @@ var wordBreakMap = {
53
54
  wordBreak: 'break-all'
54
55
  })
55
56
  };
56
- var HasTextAncestorContext = /*#__PURE__*/(0, _react.createContext)(false);
57
- var useHasTextAncestor = function useHasTextAncestor() {
58
- return (0, _react.useContext)(HasTextAncestorContext);
59
- };
60
57
 
61
58
  /**
62
59
  * Custom hook designed to abstract the parsing of the color props and make it clearer in the future how color is reconciled between themes and tokens.
@@ -101,7 +98,7 @@ var Text = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
101
98
  maxLines = _ref.maxLines,
102
99
  children = _ref.children;
103
100
  (0, _tinyInvariant.default)(asAllowlist.includes(Component), "@atlaskit/primitives: Text received an invalid \"as\" value of \"".concat(Component, "\""));
104
- var hasTextAncestor = useHasTextAncestor();
101
+ var hasTextAncestor = (0, _hasTextAncestorContext.useHasTextAncestor)();
105
102
  var color = useColor(colorProp, hasTextAncestor);
106
103
  if (!(0, _platformFeatureFlags.fg)('platform-primitives-nested-text-inherit-size') && !size) {
107
104
  size = 'medium';
@@ -123,7 +120,7 @@ var Text = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
123
120
  }, children);
124
121
  return hasTextAncestor ?
125
122
  // no need to re-apply context if the text is already wrapped
126
- component : (0, _react2.jsx)(HasTextAncestorContext.Provider, {
123
+ component : (0, _react2.jsx)(_hasTextAncestorContext.HasTextAncestorProvider, {
127
124
  value: true
128
125
  }, component);
129
126
  });
package/dist/cjs/index.js CHANGED
@@ -117,5 +117,5 @@ var _text = _interopRequireDefault(require("./components/text"));
117
117
  var _pressable = _interopRequireDefault(require("./components/pressable"));
118
118
  var _anchor = _interopRequireDefault(require("./components/anchor"));
119
119
  var _responsive = require("./responsive");
120
- var _surfaceProvider = require("./components/internal/surface-provider");
120
+ var _surfaceProvider = require("./utils/surface-provider");
121
121
  var _styleMaps = require("./xcss/style-maps.partial");
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useHasTextAncestor = exports.HasTextAncestorProvider = void 0;
7
+ var _react = require("react");
8
+ var HasTextAncestorContext = /*#__PURE__*/(0, _react.createContext)(false);
9
+ /**
10
+ * @internal
11
+ */
12
+ var useHasTextAncestor = exports.useHasTextAncestor = function useHasTextAncestor() {
13
+ return (0, _react.useContext)(HasTextAncestorContext);
14
+ };
15
+ /**
16
+ * @internal
17
+ */
18
+ var HasTextAncestorProvider = exports.HasTextAncestorProvider = HasTextAncestorContext.Provider;
@@ -55,7 +55,7 @@ const AnchorNoRef = ({
55
55
  action: 'clicked',
56
56
  componentName: componentName || 'Anchor',
57
57
  packageName: "@atlaskit/primitives",
58
- packageVersion: "13.3.1",
58
+ packageVersion: "13.3.3",
59
59
  analyticsData: analyticsContext,
60
60
  actionSubject: 'link'
61
61
  });
@@ -4,7 +4,7 @@ import "./box.compiled.css";
4
4
  import * as React from 'react';
5
5
  import { ax, ix } from "@compiled/react/runtime";
6
6
  import { forwardRef } from 'react';
7
- import { SurfaceContext } from './internal/surface-provider';
7
+ import { SurfaceContext } from '../../utils/surface-provider';
8
8
 
9
9
  // Can either Exclude or Extract - here we're excluding all SVG-related elements, <button> elements (handled by Pressable), and <a> elements (handled by Anchor)
10
10
 
@@ -46,7 +46,7 @@ const Pressable = /*#__PURE__*/forwardRef(({
46
46
  action: 'clicked',
47
47
  componentName: componentName || 'Pressable',
48
48
  packageName: "@atlaskit/primitives",
49
- packageVersion: "13.3.1",
49
+ packageVersion: "13.3.3",
50
50
  analyticsData: analyticsContext,
51
51
  actionSubject: 'button'
52
52
  });
@@ -1,3 +1,7 @@
1
+ ._11c81doa{font:var(--ds-font-body-large,normal 400 1pc/24px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,system-ui,"Helvetica Neue",sans-serif)}
2
+ ._11c81oud{font:var(--ds-font-body,normal 400 14px/20px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,system-ui,"Helvetica Neue",sans-serif)}
3
+ ._11c81vlj{font:var(--ds-font-body-small,normal 400 11px/1pc ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,system-ui,"Helvetica Neue",sans-serif)}
4
+ ._11c8qk37{font:var(--ds-font-body-UNSAFE_small,normal 400 9pt/1pc ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,system-ui,"Helvetica Neue",sans-serif)}
1
5
  ._18m915vq{overflow-y:hidden}
2
6
  ._18u0idpf{margin-left:0}
3
7
  ._19pkidpf{margin-top:0}
@@ -8,7 +12,6 @@
8
12
  ._2hwxidpf{margin-right:0}
9
13
  ._k48p1pd9{font-weight:var(--ds-font-weight-semibold,600)}
10
14
  ._k48p1wq8{font-weight:var(--ds-font-weight-medium,500)}
11
- ._k48p8n31{font-weight:bold}
12
15
  ._k48pi7a9{font-weight:var(--ds-font-weight-regular,400)}
13
16
  ._k48pmoej{font-weight:var(--ds-font-weight-bold,700)}
14
17
  ._otyridpf{margin-bottom:0}
@@ -2,14 +2,12 @@
2
2
  import "./text.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
- import { createContext, forwardRef, useContext } from 'react';
5
+ import { forwardRef } from 'react';
6
6
  import invariant from 'tiny-invariant';
7
7
  import { fg } from '@atlaskit/platform-feature-flags';
8
- import { useSurface } from './internal/surface-provider';
8
+ import { HasTextAncestorProvider, useHasTextAncestor } from '../../utils/has-text-ancestor-context';
9
+ import { useSurface } from '../../utils/surface-provider';
9
10
  const asAllowlist = ['span', 'p', 'strong', 'em'];
10
- const HasTextAncestorContext = /*#__PURE__*/createContext(false);
11
- const useHasTextAncestor = () => useContext(HasTextAncestorContext);
12
-
13
11
  /**
14
12
  * Custom hook designed to abstract the parsing of the color props and make it clearer in the future how color is reconciled between themes and tokens.
15
13
  */
@@ -33,7 +31,7 @@ const useColor = (colorProp, hasTextAncestor) => {
33
31
  };
34
32
  const styles = {
35
33
  root: "_19pkidpf _2hwxidpf _otyridpf _18u0idpf _1i4qfg65",
36
- 'as.strong': "_k48p8n31",
34
+ 'as.strong': "_k48pmoej",
37
35
  'as.em': "_zg8l1m30",
38
36
  'textAlign.center': "_y3gn1h6o",
39
37
  'textAlign.end': "_y3gnh9n0",
@@ -145,7 +143,7 @@ const Text = /*#__PURE__*/forwardRef(({
145
143
  invariant(asAllowlist.includes(Component), `@atlaskit/primitives: Text received an invalid "as" value of "${Component}"`);
146
144
  const hasTextAncestor = useHasTextAncestor();
147
145
  const color = useColor(colorProp, hasTextAncestor);
148
- if (!fg('platform-primitives-nested-text-inherit-size') && !size) {
146
+ if ((!fg('platform-primitives-nested-text-inherit-size') || !hasTextAncestor) && !size) {
149
147
  size = 'medium';
150
148
  }
151
149
  const component = /*#__PURE__*/React.createElement(Component, {
@@ -155,13 +153,13 @@ const Text = /*#__PURE__*/forwardRef(({
155
153
  },
156
154
  "data-testid": testId,
157
155
  ref: ref,
158
- className: ax([styles.root, color && textColorMap[color], maxLines && styles.truncation, maxLines === 1 && styles.breakAll, align && styles[`textAlign.${align}`], weight && fontWeightMap[weight], Component === 'em' && styles['as.em'], Component === 'strong' && styles['as.strong']])
156
+ className: ax([styles.root, size && fontSizeMap[size], color && textColorMap[color], maxLines && styles.truncation, maxLines === 1 && styles.breakAll, align && styles[`textAlign.${align}`], weight && fontWeightMap[weight], Component === 'em' && styles['as.em'], Component === 'strong' && styles['as.strong']])
159
157
  }, children);
160
158
  if (hasTextAncestor) {
161
159
  // no need to re-apply context if the text is already wrapped
162
160
  return component;
163
161
  }
164
- return /*#__PURE__*/React.createElement(HasTextAncestorContext.Provider, {
162
+ return /*#__PURE__*/React.createElement(HasTextAncestorProvider, {
165
163
  value: true
166
164
  }, component);
167
165
  });
@@ -10,4 +10,4 @@ export { default as Anchor } from './components/anchor';
10
10
  export { media, UNSAFE_useMediaQuery } from './responsive';
11
11
  export { default as Focusable } from './components/focusable';
12
12
  // TODO: This is still not figured out from before…
13
- export { useSurface as UNSAFE_useSurface } from './components/internal/surface-provider';
13
+ export { useSurface as UNSAFE_useSurface } from '../utils/surface-provider';
@@ -90,7 +90,7 @@ const AnchorNoRef = ({
90
90
  action: 'clicked',
91
91
  componentName: componentName || 'Anchor',
92
92
  packageName: "@atlaskit/primitives",
93
- packageVersion: "13.3.1",
93
+ packageVersion: "13.3.3",
94
94
  analyticsData: analyticsContext,
95
95
  actionSubject: 'link'
96
96
  });
@@ -7,9 +7,9 @@ import { forwardRef } from 'react';
7
7
 
8
8
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
9
9
  import { css, jsx } from '@emotion/react';
10
+ import { SurfaceContext } from '../utils/surface-provider';
10
11
  import { backgroundColorStylesMap, isSurfaceColorToken, paddingStylesMap, surfaceColorStylesMap } from '../xcss/style-maps.partial';
11
12
  import { parseXcss } from '../xcss/xcss';
12
- import { SurfaceContext } from './internal/surface-provider';
13
13
 
14
14
  // Can either Exclude or Extract - here we're excluding all SVG-related elements, <button> elements (handled by Pressable), and <a> elements (handled by Anchor)
15
15
 
@@ -85,7 +85,7 @@ const Pressable = /*#__PURE__*/forwardRef(({
85
85
  action: 'clicked',
86
86
  componentName: componentName || 'Pressable',
87
87
  packageName: "@atlaskit/primitives",
88
- packageVersion: "13.3.1",
88
+ packageVersion: "13.3.3",
89
89
  analyticsData: analyticsContext,
90
90
  actionSubject: 'button'
91
91
  });
@@ -2,14 +2,15 @@
2
2
  * @jsxRuntime classic
3
3
  * @jsx jsx
4
4
  */
5
- import { createContext, forwardRef, useContext } from 'react';
5
+ import { forwardRef } from 'react';
6
6
 
7
7
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
8
8
  import { css, jsx } from '@emotion/react';
9
9
  import invariant from 'tiny-invariant';
10
10
  import { fg } from '@atlaskit/platform-feature-flags';
11
+ import { HasTextAncestorProvider, useHasTextAncestor } from '../utils/has-text-ancestor-context';
12
+ import { useSurface } from '../utils/surface-provider';
11
13
  import { inverseColorMap, textColorStylesMap, textSizeStylesMap, textWeightStylesMap } from '../xcss/style-maps.partial';
12
- import { useSurface } from './internal/surface-provider';
13
14
  const asAllowlist = ['span', 'p', 'strong', 'em'];
14
15
  // We're doing this because our CSS reset can add top margins to elements such as `p` which is totally insane.
15
16
  // Long term we should remove those instances from the reset - it should be a reset to 0.
@@ -45,8 +46,6 @@ const wordBreakMap = {
45
46
  wordBreak: 'break-all'
46
47
  })
47
48
  };
48
- const HasTextAncestorContext = /*#__PURE__*/createContext(false);
49
- const useHasTextAncestor = () => useContext(HasTextAncestorContext);
50
49
 
51
50
  /**
52
51
  * Custom hook designed to abstract the parsing of the color props and make it clearer in the future how color is reconciled between themes and tokens.
@@ -113,7 +112,7 @@ const Text = /*#__PURE__*/forwardRef(({
113
112
  }, children);
114
113
  return hasTextAncestor ?
115
114
  // no need to re-apply context if the text is already wrapped
116
- component : jsx(HasTextAncestorContext.Provider, {
115
+ component : jsx(HasTextAncestorProvider, {
117
116
  value: true
118
117
  }, component);
119
118
  });
@@ -13,5 +13,5 @@ export {
13
13
  */
14
14
  default as UNSAFE_ANCHOR, default as Anchor } from './components/anchor';
15
15
  export { media, UNSAFE_media, UNSAFE_BREAKPOINTS_CONFIG } from './responsive';
16
- export { useSurface as UNSAFE_useSurface } from './components/internal/surface-provider';
16
+ export { useSurface as UNSAFE_useSurface } from './utils/surface-provider';
17
17
  export { inverseColorMap as UNSAFE_inverseColorMap } from './xcss/style-maps.partial';
@@ -0,0 +1,10 @@
1
+ import { createContext, useContext } from 'react';
2
+ const HasTextAncestorContext = /*#__PURE__*/createContext(false);
3
+ /**
4
+ * @internal
5
+ */
6
+ export const useHasTextAncestor = () => useContext(HasTextAncestorContext);
7
+ /**
8
+ * @internal
9
+ */
10
+ export const HasTextAncestorProvider = HasTextAncestorContext.Provider;
@@ -60,7 +60,7 @@ var AnchorNoRef = function AnchorNoRef(_ref, ref) {
60
60
  action: 'clicked',
61
61
  componentName: componentName || 'Anchor',
62
62
  packageName: "@atlaskit/primitives",
63
- packageVersion: "13.3.1",
63
+ packageVersion: "13.3.3",
64
64
  analyticsData: analyticsContext,
65
65
  actionSubject: 'link'
66
66
  });
@@ -7,7 +7,7 @@ import "./box.compiled.css";
7
7
  import * as React from 'react';
8
8
  import { ax, ix } from "@compiled/react/runtime";
9
9
  import { forwardRef } from 'react';
10
- import { SurfaceContext } from './internal/surface-provider';
10
+ import { SurfaceContext } from '../../utils/surface-provider';
11
11
 
12
12
  // Can either Exclude or Extract - here we're excluding all SVG-related elements, <button> elements (handled by Pressable), and <a> elements (handled by Anchor)
13
13
 
@@ -50,7 +50,7 @@ var Pressable = /*#__PURE__*/forwardRef(function (_ref, ref) {
50
50
  action: 'clicked',
51
51
  componentName: componentName || 'Pressable',
52
52
  packageName: "@atlaskit/primitives",
53
- packageVersion: "13.3.1",
53
+ packageVersion: "13.3.3",
54
54
  analyticsData: analyticsContext,
55
55
  actionSubject: 'button'
56
56
  });
@@ -1,3 +1,7 @@
1
+ ._11c81doa{font:var(--ds-font-body-large,normal 400 1pc/24px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,system-ui,"Helvetica Neue",sans-serif)}
2
+ ._11c81oud{font:var(--ds-font-body,normal 400 14px/20px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,system-ui,"Helvetica Neue",sans-serif)}
3
+ ._11c81vlj{font:var(--ds-font-body-small,normal 400 11px/1pc ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,system-ui,"Helvetica Neue",sans-serif)}
4
+ ._11c8qk37{font:var(--ds-font-body-UNSAFE_small,normal 400 9pt/1pc ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,system-ui,"Helvetica Neue",sans-serif)}
1
5
  ._18m915vq{overflow-y:hidden}
2
6
  ._18u0idpf{margin-left:0}
3
7
  ._19pkidpf{margin-top:0}
@@ -8,7 +12,6 @@
8
12
  ._2hwxidpf{margin-right:0}
9
13
  ._k48p1pd9{font-weight:var(--ds-font-weight-semibold,600)}
10
14
  ._k48p1wq8{font-weight:var(--ds-font-weight-medium,500)}
11
- ._k48p8n31{font-weight:bold}
12
15
  ._k48pi7a9{font-weight:var(--ds-font-weight-regular,400)}
13
16
  ._k48pmoej{font-weight:var(--ds-font-weight-bold,700)}
14
17
  ._otyridpf{margin-bottom:0}
@@ -2,16 +2,12 @@
2
2
  import "./text.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
- import { createContext, forwardRef, useContext } from 'react';
5
+ import { forwardRef } from 'react';
6
6
  import invariant from 'tiny-invariant';
7
7
  import { fg } from '@atlaskit/platform-feature-flags';
8
- import { useSurface } from './internal/surface-provider';
8
+ import { HasTextAncestorProvider, useHasTextAncestor } from '../../utils/has-text-ancestor-context';
9
+ import { useSurface } from '../../utils/surface-provider';
9
10
  var asAllowlist = ['span', 'p', 'strong', 'em'];
10
- var HasTextAncestorContext = /*#__PURE__*/createContext(false);
11
- var useHasTextAncestor = function useHasTextAncestor() {
12
- return useContext(HasTextAncestorContext);
13
- };
14
-
15
11
  /**
16
12
  * Custom hook designed to abstract the parsing of the color props and make it clearer in the future how color is reconciled between themes and tokens.
17
13
  */
@@ -35,7 +31,7 @@ var useColor = function useColor(colorProp, hasTextAncestor) {
35
31
  };
36
32
  var styles = {
37
33
  root: "_19pkidpf _2hwxidpf _otyridpf _18u0idpf _1i4qfg65",
38
- 'as.strong': "_k48p8n31",
34
+ 'as.strong': "_k48pmoej",
39
35
  'as.em': "_zg8l1m30",
40
36
  'textAlign.center': "_y3gn1h6o",
41
37
  'textAlign.end': "_y3gnh9n0",
@@ -147,7 +143,7 @@ var Text = /*#__PURE__*/forwardRef(function (_ref, ref) {
147
143
  invariant(asAllowlist.includes(Component), "@atlaskit/primitives: Text received an invalid \"as\" value of \"".concat(Component, "\""));
148
144
  var hasTextAncestor = useHasTextAncestor();
149
145
  var color = useColor(colorProp, hasTextAncestor);
150
- if (!fg('platform-primitives-nested-text-inherit-size') && !size) {
146
+ if ((!fg('platform-primitives-nested-text-inherit-size') || !hasTextAncestor) && !size) {
151
147
  size = 'medium';
152
148
  }
153
149
  var component = /*#__PURE__*/React.createElement(Component, {
@@ -157,13 +153,13 @@ var Text = /*#__PURE__*/forwardRef(function (_ref, ref) {
157
153
  },
158
154
  "data-testid": testId,
159
155
  ref: ref,
160
- className: ax([styles.root, color && textColorMap[color], maxLines && styles.truncation, maxLines === 1 && styles.breakAll, align && styles["textAlign.".concat(align)], weight && fontWeightMap[weight], Component === 'em' && styles['as.em'], Component === 'strong' && styles['as.strong']])
156
+ className: ax([styles.root, size && fontSizeMap[size], color && textColorMap[color], maxLines && styles.truncation, maxLines === 1 && styles.breakAll, align && styles["textAlign.".concat(align)], weight && fontWeightMap[weight], Component === 'em' && styles['as.em'], Component === 'strong' && styles['as.strong']])
161
157
  }, children);
162
158
  if (hasTextAncestor) {
163
159
  // no need to re-apply context if the text is already wrapped
164
160
  return component;
165
161
  }
166
- return /*#__PURE__*/React.createElement(HasTextAncestorContext.Provider, {
162
+ return /*#__PURE__*/React.createElement(HasTextAncestorProvider, {
167
163
  value: true
168
164
  }, component);
169
165
  });
@@ -10,4 +10,4 @@ export { default as Anchor } from './components/anchor';
10
10
  export { media, UNSAFE_useMediaQuery } from './responsive';
11
11
  export { default as Focusable } from './components/focusable';
12
12
  // TODO: This is still not figured out from before…
13
- export { useSurface as UNSAFE_useSurface } from './components/internal/surface-provider';
13
+ export { useSurface as UNSAFE_useSurface } from '../utils/surface-provider';
@@ -94,7 +94,7 @@ var AnchorNoRef = function AnchorNoRef(_ref, ref) {
94
94
  action: 'clicked',
95
95
  componentName: componentName || 'Anchor',
96
96
  packageName: "@atlaskit/primitives",
97
- packageVersion: "13.3.1",
97
+ packageVersion: "13.3.3",
98
98
  analyticsData: analyticsContext,
99
99
  actionSubject: 'link'
100
100
  });
@@ -10,9 +10,9 @@ import { forwardRef } from 'react';
10
10
 
11
11
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
12
12
  import { css, jsx } from '@emotion/react';
13
+ import { SurfaceContext } from '../utils/surface-provider';
13
14
  import { backgroundColorStylesMap, isSurfaceColorToken, paddingStylesMap, surfaceColorStylesMap } from '../xcss/style-maps.partial';
14
15
  import { parseXcss } from '../xcss/xcss';
15
- import { SurfaceContext } from './internal/surface-provider';
16
16
 
17
17
  // Can either Exclude or Extract - here we're excluding all SVG-related elements, <button> elements (handled by Pressable), and <a> elements (handled by Anchor)
18
18
 
@@ -160,10 +160,9 @@ var Grid = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (_ref, ref) {
160
160
  * NOTE: If we disallow `grid-template-areas` (etc) to be set via `props.xcss`, we can remove this.
161
161
  */
162
162
  var style = useMemo(function () {
163
- var _ref2;
164
- return _ref2 = {}, _defineProperty(_ref2, gridTemplateAreasVar, gridTemplateAreas ? gridTemplateAreas.map(function (str) {
163
+ return _defineProperty(_defineProperty(_defineProperty({}, gridTemplateAreasVar, gridTemplateAreas ? gridTemplateAreas.map(function (str) {
165
164
  return "\"".concat(str, "\"");
166
- }).join('\n') || 'initial' : 'initial'), _defineProperty(_ref2, gridTemplateColumnsVar, gridTemplateColumns || 'initial'), _defineProperty(_ref2, gridTemplateRowsVar, gridTemplateRows || 'initial'), _ref2;
165
+ }).join('\n') || 'initial' : 'initial'), gridTemplateColumnsVar, gridTemplateColumns || 'initial'), gridTemplateRowsVar, gridTemplateRows || 'initial');
167
166
  }, [gridTemplateAreas, gridTemplateColumns, gridTemplateRows]);
168
167
  return jsx(Component, {
169
168
  id: id,
@@ -89,7 +89,7 @@ var Pressable = /*#__PURE__*/forwardRef(function (_ref, ref) {
89
89
  action: 'clicked',
90
90
  componentName: componentName || 'Pressable',
91
91
  packageName: "@atlaskit/primitives",
92
- packageVersion: "13.3.1",
92
+ packageVersion: "13.3.3",
93
93
  analyticsData: analyticsContext,
94
94
  actionSubject: 'button'
95
95
  });