@atlaskit/primitives 13.0.0 → 13.2.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @atlaskit/primitives
2
2
 
3
+ ## 13.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#162507](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/162507)
8
+ [`55f201f2b2d04`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/55f201f2b2d04) -
9
+ [ux] Text to inherit size when nested in other Text component behind a feature flag. If testing
10
+ successful, this change will be made available in a later release.
11
+
12
+ ## 13.1.0
13
+
14
+ ### Minor Changes
15
+
16
+ - [#161694](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/161694)
17
+ [`22f69cdefebd9`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/22f69cdefebd9) -
18
+ Add compiled.css sideEffect to @atlaskit/primitives to hint and fix bundlers to load these styles
19
+
3
20
  ## 13.0.0
4
21
 
5
22
  ### Major Changes
@@ -3,7 +3,9 @@
3
3
  "main": "../dist/cjs/components/anchor.js",
4
4
  "module": "../dist/esm/components/anchor.js",
5
5
  "module:es2019": "../dist/es2019/components/anchor.js",
6
- "sideEffects": false,
6
+ "sideEffects": [
7
+ "**/*.compiled.css"
8
+ ],
7
9
  "types": "../dist/types/components/anchor.d.ts",
8
10
  "typesVersions": {
9
11
  ">=4.5 <5.4": {
package/box/package.json CHANGED
@@ -3,7 +3,9 @@
3
3
  "main": "../dist/cjs/components/box.js",
4
4
  "module": "../dist/esm/components/box.js",
5
5
  "module:es2019": "../dist/es2019/components/box.js",
6
- "sideEffects": false,
6
+ "sideEffects": [
7
+ "**/*.compiled.css"
8
+ ],
7
9
  "types": "../dist/types/components/box.d.ts",
8
10
  "typesVersions": {
9
11
  ">=4.5 <5.4": {
@@ -3,7 +3,9 @@
3
3
  "main": "../dist/cjs/compiled/index.js",
4
4
  "module": "../dist/esm/compiled/index.js",
5
5
  "module:es2019": "../dist/es2019/compiled/index.js",
6
- "sideEffects": false,
6
+ "sideEffects": [
7
+ "**/*.compiled.css"
8
+ ],
7
9
  "types": "../dist/types/compiled/index.d.ts",
8
10
  "typesVersions": {
9
11
  ">=4.5 <5.4": {
@@ -69,7 +69,7 @@ var AnchorNoRef = function AnchorNoRef(_ref, ref) {
69
69
  action: 'clicked',
70
70
  componentName: componentName || 'Anchor',
71
71
  packageName: "@atlaskit/primitives",
72
- packageVersion: "13.0.0",
72
+ packageVersion: "13.2.0",
73
73
  analyticsData: analyticsContext,
74
74
  actionSubject: 'link'
75
75
  });
@@ -59,7 +59,7 @@ var Pressable = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
59
59
  action: 'clicked',
60
60
  componentName: componentName || 'Pressable',
61
61
  packageName: "@atlaskit/primitives",
62
- packageVersion: "13.0.0",
62
+ packageVersion: "13.2.0",
63
63
  analyticsData: analyticsContext,
64
64
  actionSubject: 'button'
65
65
  });
@@ -1,7 +1,3 @@
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)}
5
1
  ._18m915vq{overflow-y:hidden}
6
2
  ._18u0idpf{margin-left:0}
7
3
  ._19pkidpf{margin-top:0}
@@ -12,6 +12,7 @@ var _react = _interopRequireWildcard(require("react"));
12
12
  var React = _react;
13
13
  var _runtime = require("@compiled/react/runtime");
14
14
  var _tinyInvariant = _interopRequireDefault(require("tiny-invariant"));
15
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
15
16
  var _surfaceProvider = require("./internal/surface-provider");
16
17
  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); }
17
18
  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; }
@@ -149,14 +150,16 @@ var Text = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
149
150
  align = _ref.align,
150
151
  testId = _ref.testId,
151
152
  id = _ref.id,
152
- _ref$size = _ref.size,
153
- size = _ref$size === void 0 ? 'medium' : _ref$size,
153
+ size = _ref.size,
154
154
  weight = _ref.weight,
155
155
  maxLines = _ref.maxLines,
156
156
  children = _ref.children;
157
157
  (0, _tinyInvariant.default)(asAllowlist.includes(Component), "@atlaskit/primitives: Text received an invalid \"as\" value of \"".concat(Component, "\""));
158
158
  var hasTextAncestor = useHasTextAncestor();
159
159
  var color = useColor(colorProp, hasTextAncestor);
160
+ if (!(0, _platformFeatureFlags.fg)('platform-primitives-nested-text-inherit-size') && !size) {
161
+ size = 'medium';
162
+ }
160
163
  var component = /*#__PURE__*/React.createElement(Component, {
161
164
  id: id,
162
165
  style: {
@@ -164,7 +167,7 @@ var Text = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
164
167
  },
165
168
  "data-testid": testId,
166
169
  ref: ref,
167
- className: (0, _runtime.ax)([styles.root, 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']])
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']])
168
171
  }, children);
169
172
  if (hasTextAncestor) {
170
173
  // no need to re-apply context if the text is already wrapped
@@ -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.0.0",
103
+ packageVersion: "13.2.0",
104
104
  analyticsData: analyticsContext,
105
105
  actionSubject: 'link'
106
106
  });
@@ -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.0.0",
98
+ packageVersion: "13.2.0",
99
99
  analyticsData: analyticsContext,
100
100
  actionSubject: 'button'
101
101
  });
@@ -8,6 +8,7 @@ exports.default = void 0;
8
8
  var _react = require("react");
9
9
  var _react2 = require("@emotion/react");
10
10
  var _tinyInvariant = _interopRequireDefault(require("tiny-invariant"));
11
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
11
12
  var _styleMaps = require("../xcss/style-maps.partial");
12
13
  var _surfaceProvider = require("./internal/surface-provider");
13
14
  /**
@@ -95,19 +96,21 @@ var Text = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
95
96
  align = _ref.align,
96
97
  testId = _ref.testId,
97
98
  id = _ref.id,
98
- _ref$size = _ref.size,
99
- size = _ref$size === void 0 ? 'medium' : _ref$size,
99
+ size = _ref.size,
100
100
  weight = _ref.weight,
101
101
  maxLines = _ref.maxLines,
102
102
  children = _ref.children;
103
103
  (0, _tinyInvariant.default)(asAllowlist.includes(Component), "@atlaskit/primitives: Text received an invalid \"as\" value of \"".concat(Component, "\""));
104
104
  var hasTextAncestor = useHasTextAncestor();
105
105
  var color = useColor(colorProp, hasTextAncestor);
106
+ if (!(0, _platformFeatureFlags.fg)('platform-primitives-nested-text-inherit-size') && !size) {
107
+ size = 'medium';
108
+ }
106
109
  var component = (0, _react2.jsx)(Component, {
107
110
  ref: ref,
108
111
  css: [resetStyles,
109
112
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
110
- _styleMaps.textSizeStylesMap[size],
113
+ size ? _styleMaps.textSizeStylesMap[size] : !hasTextAncestor && _styleMaps.textSizeStylesMap.medium,
111
114
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
112
115
  color && _styleMaps.textColorStylesMap[color], maxLines && truncationStyles, maxLines === 1 && wordBreakMap.breakAll, align && textAlignMap[align],
113
116
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
@@ -54,7 +54,7 @@ const AnchorNoRef = ({
54
54
  action: 'clicked',
55
55
  componentName: componentName || 'Anchor',
56
56
  packageName: "@atlaskit/primitives",
57
- packageVersion: "13.0.0",
57
+ packageVersion: "13.2.0",
58
58
  analyticsData: analyticsContext,
59
59
  actionSubject: 'link'
60
60
  });
@@ -45,7 +45,7 @@ const Pressable = /*#__PURE__*/forwardRef(({
45
45
  action: 'clicked',
46
46
  componentName: componentName || 'Pressable',
47
47
  packageName: "@atlaskit/primitives",
48
- packageVersion: "13.0.0",
48
+ packageVersion: "13.2.0",
49
49
  analyticsData: analyticsContext,
50
50
  actionSubject: 'button'
51
51
  });
@@ -1,7 +1,3 @@
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)}
5
1
  ._18m915vq{overflow-y:hidden}
6
2
  ._18u0idpf{margin-left:0}
7
3
  ._19pkidpf{margin-top:0}
@@ -4,6 +4,7 @@ import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
5
  import { createContext, forwardRef, useContext } from 'react';
6
6
  import invariant from 'tiny-invariant';
7
+ import { fg } from '@atlaskit/platform-feature-flags';
7
8
  import { useSurface } from './internal/surface-provider';
8
9
  const asAllowlist = ['span', 'p', 'strong', 'em'];
9
10
  const HasTextAncestorContext = /*#__PURE__*/createContext(false);
@@ -136,7 +137,7 @@ const Text = /*#__PURE__*/forwardRef(({
136
137
  align,
137
138
  testId,
138
139
  id,
139
- size = 'medium',
140
+ size,
140
141
  weight,
141
142
  maxLines,
142
143
  children
@@ -144,6 +145,9 @@ const Text = /*#__PURE__*/forwardRef(({
144
145
  invariant(asAllowlist.includes(Component), `@atlaskit/primitives: Text received an invalid "as" value of "${Component}"`);
145
146
  const hasTextAncestor = useHasTextAncestor();
146
147
  const color = useColor(colorProp, hasTextAncestor);
148
+ if (!fg('platform-primitives-nested-text-inherit-size') && !size) {
149
+ size = 'medium';
150
+ }
147
151
  const component = /*#__PURE__*/React.createElement(Component, {
148
152
  id: id,
149
153
  style: {
@@ -151,7 +155,7 @@ const Text = /*#__PURE__*/forwardRef(({
151
155
  },
152
156
  "data-testid": testId,
153
157
  ref: ref,
154
- className: ax([styles.root, 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']])
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']])
155
159
  }, children);
156
160
  if (hasTextAncestor) {
157
161
  // no need to re-apply context if the text is already wrapped
@@ -90,7 +90,7 @@ const AnchorNoRef = ({
90
90
  action: 'clicked',
91
91
  componentName: componentName || 'Anchor',
92
92
  packageName: "@atlaskit/primitives",
93
- packageVersion: "13.0.0",
93
+ packageVersion: "13.2.0",
94
94
  analyticsData: analyticsContext,
95
95
  actionSubject: 'link'
96
96
  });
@@ -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.0.0",
88
+ packageVersion: "13.2.0",
89
89
  analyticsData: analyticsContext,
90
90
  actionSubject: 'button'
91
91
  });
@@ -7,6 +7,7 @@ import { createContext, forwardRef, useContext } from 'react';
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
+ import { fg } from '@atlaskit/platform-feature-flags';
10
11
  import { inverseColorMap, textColorStylesMap, textSizeStylesMap, textWeightStylesMap } from '../xcss/style-maps.partial';
11
12
  import { useSurface } from './internal/surface-provider';
12
13
  const asAllowlist = ['span', 'p', 'strong', 'em'];
@@ -84,7 +85,7 @@ const Text = /*#__PURE__*/forwardRef(({
84
85
  align,
85
86
  testId,
86
87
  id,
87
- size = 'medium',
88
+ size,
88
89
  weight,
89
90
  maxLines,
90
91
  children
@@ -92,11 +93,14 @@ const Text = /*#__PURE__*/forwardRef(({
92
93
  invariant(asAllowlist.includes(Component), `@atlaskit/primitives: Text received an invalid "as" value of "${Component}"`);
93
94
  const hasTextAncestor = useHasTextAncestor();
94
95
  const color = useColor(colorProp, hasTextAncestor);
96
+ if (!fg('platform-primitives-nested-text-inherit-size') && !size) {
97
+ size = 'medium';
98
+ }
95
99
  const component = jsx(Component, {
96
100
  ref: ref,
97
101
  css: [resetStyles,
98
102
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
99
- textSizeStylesMap[size],
103
+ size ? textSizeStylesMap[size] : !hasTextAncestor && textSizeStylesMap.medium,
100
104
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
101
105
  color && textColorStylesMap[color], maxLines && truncationStyles, maxLines === 1 && wordBreakMap.breakAll, align && textAlignMap[align],
102
106
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
@@ -59,7 +59,7 @@ var AnchorNoRef = function AnchorNoRef(_ref, ref) {
59
59
  action: 'clicked',
60
60
  componentName: componentName || 'Anchor',
61
61
  packageName: "@atlaskit/primitives",
62
- packageVersion: "13.0.0",
62
+ packageVersion: "13.2.0",
63
63
  analyticsData: analyticsContext,
64
64
  actionSubject: 'link'
65
65
  });
@@ -49,7 +49,7 @@ var Pressable = /*#__PURE__*/forwardRef(function (_ref, ref) {
49
49
  action: 'clicked',
50
50
  componentName: componentName || 'Pressable',
51
51
  packageName: "@atlaskit/primitives",
52
- packageVersion: "13.0.0",
52
+ packageVersion: "13.2.0",
53
53
  analyticsData: analyticsContext,
54
54
  actionSubject: 'button'
55
55
  });
@@ -1,7 +1,3 @@
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)}
5
1
  ._18m915vq{overflow-y:hidden}
6
2
  ._18u0idpf{margin-left:0}
7
3
  ._19pkidpf{margin-top:0}
@@ -4,6 +4,7 @@ import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
5
  import { createContext, forwardRef, useContext } from 'react';
6
6
  import invariant from 'tiny-invariant';
7
+ import { fg } from '@atlaskit/platform-feature-flags';
7
8
  import { useSurface } from './internal/surface-provider';
8
9
  var asAllowlist = ['span', 'p', 'strong', 'em'];
9
10
  var HasTextAncestorContext = /*#__PURE__*/createContext(false);
@@ -139,14 +140,16 @@ var Text = /*#__PURE__*/forwardRef(function (_ref, ref) {
139
140
  align = _ref.align,
140
141
  testId = _ref.testId,
141
142
  id = _ref.id,
142
- _ref$size = _ref.size,
143
- size = _ref$size === void 0 ? 'medium' : _ref$size,
143
+ size = _ref.size,
144
144
  weight = _ref.weight,
145
145
  maxLines = _ref.maxLines,
146
146
  children = _ref.children;
147
147
  invariant(asAllowlist.includes(Component), "@atlaskit/primitives: Text received an invalid \"as\" value of \"".concat(Component, "\""));
148
148
  var hasTextAncestor = useHasTextAncestor();
149
149
  var color = useColor(colorProp, hasTextAncestor);
150
+ if (!fg('platform-primitives-nested-text-inherit-size') && !size) {
151
+ size = 'medium';
152
+ }
150
153
  var component = /*#__PURE__*/React.createElement(Component, {
151
154
  id: id,
152
155
  style: {
@@ -154,7 +157,7 @@ var Text = /*#__PURE__*/forwardRef(function (_ref, ref) {
154
157
  },
155
158
  "data-testid": testId,
156
159
  ref: ref,
157
- className: ax([styles.root, 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']])
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']])
158
161
  }, children);
159
162
  if (hasTextAncestor) {
160
163
  // no need to re-apply context if the text is already wrapped
@@ -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.0.0",
97
+ packageVersion: "13.2.0",
98
98
  analyticsData: analyticsContext,
99
99
  actionSubject: 'link'
100
100
  });
@@ -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.0.0",
92
+ packageVersion: "13.2.0",
93
93
  analyticsData: analyticsContext,
94
94
  actionSubject: 'button'
95
95
  });
@@ -7,6 +7,7 @@ import { createContext, forwardRef, useContext } from 'react';
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
+ import { fg } from '@atlaskit/platform-feature-flags';
10
11
  import { inverseColorMap, textColorStylesMap, textSizeStylesMap, textWeightStylesMap } from '../xcss/style-maps.partial';
11
12
  import { useSurface } from './internal/surface-provider';
12
13
  var asAllowlist = ['span', 'p', 'strong', 'em'];
@@ -87,19 +88,21 @@ var Text = /*#__PURE__*/forwardRef(function (_ref, ref) {
87
88
  align = _ref.align,
88
89
  testId = _ref.testId,
89
90
  id = _ref.id,
90
- _ref$size = _ref.size,
91
- size = _ref$size === void 0 ? 'medium' : _ref$size,
91
+ size = _ref.size,
92
92
  weight = _ref.weight,
93
93
  maxLines = _ref.maxLines,
94
94
  children = _ref.children;
95
95
  invariant(asAllowlist.includes(Component), "@atlaskit/primitives: Text received an invalid \"as\" value of \"".concat(Component, "\""));
96
96
  var hasTextAncestor = useHasTextAncestor();
97
97
  var color = useColor(colorProp, hasTextAncestor);
98
+ if (!fg('platform-primitives-nested-text-inherit-size') && !size) {
99
+ size = 'medium';
100
+ }
98
101
  var component = jsx(Component, {
99
102
  ref: ref,
100
103
  css: [resetStyles,
101
104
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
102
- textSizeStylesMap[size],
105
+ size ? textSizeStylesMap[size] : !hasTextAncestor && textSizeStylesMap.medium,
103
106
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
104
107
  color && textColorStylesMap[color], maxLines && truncationStyles, maxLines === 1 && wordBreakMap.breakAll, align && textAlignMap[align],
105
108
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
@@ -3,7 +3,9 @@
3
3
  "main": "../dist/cjs/components/inline.js",
4
4
  "module": "../dist/esm/components/inline.js",
5
5
  "module:es2019": "../dist/es2019/components/inline.js",
6
- "sideEffects": false,
6
+ "sideEffects": [
7
+ "**/*.compiled.css"
8
+ ],
7
9
  "types": "../dist/types/components/inline.d.ts",
8
10
  "typesVersions": {
9
11
  ">=4.5 <5.4": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/primitives",
3
- "version": "13.0.0",
3
+ "version": "13.2.0",
4
4
  "description": "Primitives are token-backed low-level building blocks.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -12,7 +12,9 @@
12
12
  "module": "dist/esm/index.js",
13
13
  "module:es2019": "dist/es2019/index.js",
14
14
  "types": "dist/types/index.d.ts",
15
- "sideEffects": false,
15
+ "sideEffects": [
16
+ "**/*.compiled.css"
17
+ ],
16
18
  "atlaskit:src": "src/index.tsx",
17
19
  "atlassian": {
18
20
  "team": "Design System Team",
@@ -75,7 +77,17 @@
75
77
  "title": "XCSS",
76
78
  "folder": "xcss",
77
79
  "slug": "primitives/xcss",
78
- "id": "@atlaskit/primitives/xcss"
80
+ "id": "@atlaskit/primitives/xcss",
81
+ "status": {
82
+ "type": "intent-to-deprecate",
83
+ "description": "We are planning on deprecating XCSS. We recommend using @atlaskit/css instead.",
84
+ "actions": [
85
+ {
86
+ "text": "View @atlaskit/css documentation",
87
+ "href": "https://atlassian.design/components/css/"
88
+ }
89
+ ]
90
+ }
79
91
  },
80
92
  {
81
93
  "title": "Responsive",
@@ -115,9 +127,10 @@
115
127
  "@atlaskit/analytics-next": "^10.1.0",
116
128
  "@atlaskit/app-provider": "^1.4.0",
117
129
  "@atlaskit/css": "^0.6.0",
118
- "@atlaskit/ds-lib": "^3.1.0",
130
+ "@atlaskit/ds-lib": "^3.2.0",
119
131
  "@atlaskit/interaction-context": "^2.1.0",
120
- "@atlaskit/tokens": "^2.0.0",
132
+ "@atlaskit/platform-feature-flags": "^0.3.0",
133
+ "@atlaskit/tokens": "^2.2.0",
121
134
  "@atlaskit/visually-hidden": "^1.5.0",
122
135
  "@babel/runtime": "^7.0.0",
123
136
  "@compiled/react": "^0.18.1",
@@ -134,7 +147,7 @@
134
147
  "@af/formatting": "*",
135
148
  "@atlaskit/ssr": "*",
136
149
  "@atlaskit/toggle": "^13.4.0",
137
- "@atlaskit/tooltip": "^18.8.0",
150
+ "@atlaskit/tooltip": "^18.9.0",
138
151
  "@atlaskit/visual-regression": "*",
139
152
  "@atlassian/codegen": "^0.1.0",
140
153
  "@testing-library/react": "^12.1.5",
@@ -171,6 +184,11 @@
171
184
  }
172
185
  },
173
186
  "homepage": "https://atlassian.design/components/primitives/overview/",
187
+ "platform-feature-flags": {
188
+ "platform-primitives-nested-text-inherit-size": {
189
+ "type": "boolean"
190
+ }
191
+ },
174
192
  "typesVersions": {
175
193
  ">=4.5 <4.9": {
176
194
  "*": [
@@ -3,7 +3,9 @@
3
3
  "main": "../dist/cjs/components/pressable.js",
4
4
  "module": "../dist/esm/components/pressable.js",
5
5
  "module:es2019": "../dist/es2019/components/pressable.js",
6
- "sideEffects": false,
6
+ "sideEffects": [
7
+ "**/*.compiled.css"
8
+ ],
7
9
  "types": "../dist/types/components/pressable.d.ts",
8
10
  "typesVersions": {
9
11
  ">=4.5 <5.4": {
@@ -3,7 +3,9 @@
3
3
  "main": "../dist/cjs/responsive/index.js",
4
4
  "module": "../dist/esm/responsive/index.js",
5
5
  "module:es2019": "../dist/es2019/responsive/index.js",
6
- "sideEffects": false,
6
+ "sideEffects": [
7
+ "**/*.compiled.css"
8
+ ],
7
9
  "types": "../dist/types/responsive/index.d.ts",
8
10
  "typesVersions": {
9
11
  ">=4.5 <5.4": {
@@ -3,7 +3,9 @@
3
3
  "main": "../dist/cjs/components/stack.js",
4
4
  "module": "../dist/esm/components/stack.js",
5
5
  "module:es2019": "../dist/es2019/components/stack.js",
6
- "sideEffects": false,
6
+ "sideEffects": [
7
+ "**/*.compiled.css"
8
+ ],
7
9
  "types": "../dist/types/components/stack.d.ts",
8
10
  "typesVersions": {
9
11
  ">=4.5 <5.4": {
package/text/package.json CHANGED
@@ -3,7 +3,9 @@
3
3
  "main": "../dist/cjs/components/text.js",
4
4
  "module": "../dist/esm/components/text.js",
5
5
  "module:es2019": "../dist/es2019/components/text.js",
6
- "sideEffects": false,
6
+ "sideEffects": [
7
+ "**/*.compiled.css"
8
+ ],
7
9
  "types": "../dist/types/components/text.d.ts",
8
10
  "typesVersions": {
9
11
  ">=4.5 <5.4": {
package/.eslintrc.js DELETED
@@ -1,3 +0,0 @@
1
- module.exports = {
2
- ignorePatterns: ['./scripts/codegen-file-templates/*'],
3
- };