@atlaskit/primitives 15.0.1 → 16.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/primitives
2
2
 
3
+ ## 16.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [`64bcecfcb59ac`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/64bcecfcb59ac) -
8
+ MetricText no longer accepts emotion-based xcss props only @atlaskit/css compiled-based props as
9
+ per the Compiled variant API.
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 15.0.1
4
16
 
5
17
  ### 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: "0.0.0-development",
73
+ packageVersion: "15.0.1",
74
74
  analyticsData: analyticsContext,
75
75
  actionSubject: 'link'
76
76
  });
@@ -61,7 +61,7 @@ var Pressable = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
61
61
  action: 'clicked',
62
62
  componentName: componentName || 'Pressable',
63
63
  packageName: "@atlaskit/primitives",
64
- packageVersion: "0.0.0-development",
64
+ packageVersion: "15.0.1",
65
65
  analyticsData: analyticsContext,
66
66
  actionSubject: 'button'
67
67
  });
@@ -105,7 +105,7 @@ var AnchorNoRef = function AnchorNoRef(_ref, ref) {
105
105
  action: 'clicked',
106
106
  componentName: componentName || 'Anchor',
107
107
  packageName: "@atlaskit/primitives",
108
- packageVersion: "0.0.0-development",
108
+ packageVersion: "15.0.1",
109
109
  analyticsData: analyticsContext,
110
110
  actionSubject: 'link'
111
111
  });
@@ -5,62 +5,20 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = void 0;
8
- var _react = require("react");
9
- var _react2 = require("@emotion/react");
10
- var _tinyInvariant = _interopRequireDefault(require("tiny-invariant"));
11
- var _styleMaps = require("../xcss/style-maps.partial");
8
+ var _metricText = _interopRequireDefault(require("../compiled/components/metric-text"));
12
9
  /**
13
- * @jsxRuntime classic
14
- * @jsx jsx
10
+ * IMPORTANT: This is a temporary mapping to avoid breaking changes.
11
+ * We will remove this once we have migrated all the components to @atlaskit/primitives/compiled.
15
12
  */
16
-
17
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
18
-
19
- var asAllowlist = ['span', 'div'];
20
- // We're doing this because our CSS reset can add top margins to elements such as `p` which is totally insane.
21
- // Long term we should remove those instances from the reset - it should be a reset to 0.
22
- // For now, at least we know <MetricText> will be unaffected by this.
23
- var resetStyles = (0, _react2.css)({
24
- margin: 0
25
- });
26
- var textAlignMap = {
27
- center: (0, _react2.css)({
28
- textAlign: 'center'
29
- }),
30
- end: (0, _react2.css)({
31
- textAlign: 'end'
32
- }),
33
- start: (0, _react2.css)({
34
- textAlign: 'start'
35
- })
36
- };
37
-
13
+ // TODO: Fill in the component {description} and ensure links point to the correct {packageName} location.
14
+ // Remove links that the component does not have (such as usage). If there are no links remove them all.
38
15
  /**
39
- * __MetricText__
16
+ * __Metric text comp__
40
17
  *
41
- * MetricText is a primitive component that has the Atlassian Design System's design guidelines baked in.
42
- * It is designed for use specifically with displaying metrics and is not to be used for headings or general UI text.
43
- * It renders a `span` by default.
18
+ * A metric text comp {description}.
44
19
  *
45
- * @internal
20
+ * - [Examples](https://atlassian.design/components/{packageName}/examples)
21
+ * - [Code](https://atlassian.design/components/{packageName}/code)
22
+ * - [Usage](https://atlassian.design/components/{packageName}/usage)
46
23
  */
47
- var MetricText = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
48
- var _ref$as = _ref.as,
49
- Component = _ref$as === void 0 ? 'span' : _ref$as,
50
- align = _ref.align,
51
- testId = _ref.testId,
52
- id = _ref.id,
53
- size = _ref.size,
54
- children = _ref.children;
55
- (0, _tinyInvariant.default)(asAllowlist.includes(Component), "@atlaskit/primitives: MetricText received an invalid \"as\" value of \"".concat(Component, "\""));
56
- var component = (0, _react2.jsx)(Component, {
57
- ref: ref,
58
- css: [resetStyles,
59
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
60
- size && _styleMaps.metricTextSizeStylesMap[size], align && textAlignMap[align]],
61
- "data-testid": testId,
62
- id: id
63
- }, children);
64
- return component;
65
- });
66
- var _default = exports.default = MetricText;
24
+ var _default = exports.default = _metricText.default;
@@ -97,7 +97,7 @@ var Pressable = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
97
97
  action: 'clicked',
98
98
  componentName: componentName || 'Pressable',
99
99
  packageName: "@atlaskit/primitives",
100
- packageVersion: "0.0.0-development",
100
+ packageVersion: "15.0.1",
101
101
  analyticsData: analyticsContext,
102
102
  actionSubject: 'button'
103
103
  });
@@ -56,7 +56,7 @@ const AnchorNoRef = ({
56
56
  action: 'clicked',
57
57
  componentName: componentName || 'Anchor',
58
58
  packageName: "@atlaskit/primitives",
59
- packageVersion: "0.0.0-development",
59
+ packageVersion: "15.0.1",
60
60
  analyticsData: analyticsContext,
61
61
  actionSubject: 'link'
62
62
  });
@@ -48,7 +48,7 @@ const Pressable = /*#__PURE__*/forwardRef(({
48
48
  action: 'clicked',
49
49
  componentName: componentName || 'Pressable',
50
50
  packageName: "@atlaskit/primitives",
51
- packageVersion: "0.0.0-development",
51
+ packageVersion: "15.0.1",
52
52
  analyticsData: analyticsContext,
53
53
  actionSubject: 'button'
54
54
  });
@@ -94,7 +94,7 @@ const AnchorNoRef = ({
94
94
  action: 'clicked',
95
95
  componentName: componentName || 'Anchor',
96
96
  packageName: "@atlaskit/primitives",
97
- packageVersion: "0.0.0-development",
97
+ packageVersion: "15.0.1",
98
98
  analyticsData: analyticsContext,
99
99
  actionSubject: 'link'
100
100
  });
@@ -1,58 +1,18 @@
1
1
  /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
2
+ * IMPORTANT: This is a temporary mapping to avoid breaking changes.
3
+ * We will remove this once we have migrated all the components to @atlaskit/primitives/compiled.
4
4
  */
5
- import { forwardRef } from 'react';
6
-
7
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
8
- import { css, jsx } from '@emotion/react';
9
- import invariant from 'tiny-invariant';
10
- import { metricTextSizeStylesMap } from '../xcss/style-maps.partial';
11
- const asAllowlist = ['span', 'div'];
12
- // We're doing this because our CSS reset can add top margins to elements such as `p` which is totally insane.
13
- // Long term we should remove those instances from the reset - it should be a reset to 0.
14
- // For now, at least we know <MetricText> will be unaffected by this.
15
- const resetStyles = css({
16
- margin: 0
17
- });
18
- const textAlignMap = {
19
- center: css({
20
- textAlign: 'center'
21
- }),
22
- end: css({
23
- textAlign: 'end'
24
- }),
25
- start: css({
26
- textAlign: 'start'
27
- })
28
- };
29
5
 
6
+ // TODO: Fill in the component {description} and ensure links point to the correct {packageName} location.
7
+ // Remove links that the component does not have (such as usage). If there are no links remove them all.
30
8
  /**
31
- * __MetricText__
9
+ * __Metric text comp__
32
10
  *
33
- * MetricText is a primitive component that has the Atlassian Design System's design guidelines baked in.
34
- * It is designed for use specifically with displaying metrics and is not to be used for headings or general UI text.
35
- * It renders a `span` by default.
11
+ * A metric text comp {description}.
36
12
  *
37
- * @internal
13
+ * - [Examples](https://atlassian.design/components/{packageName}/examples)
14
+ * - [Code](https://atlassian.design/components/{packageName}/code)
15
+ * - [Usage](https://atlassian.design/components/{packageName}/usage)
38
16
  */
39
- const MetricText = /*#__PURE__*/forwardRef(({
40
- as: Component = 'span',
41
- align,
42
- testId,
43
- id,
44
- size,
45
- children
46
- }, ref) => {
47
- invariant(asAllowlist.includes(Component), `@atlaskit/primitives: MetricText received an invalid "as" value of "${Component}"`);
48
- const component = jsx(Component, {
49
- ref: ref,
50
- css: [resetStyles,
51
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
52
- size && metricTextSizeStylesMap[size], align && textAlignMap[align]],
53
- "data-testid": testId,
54
- id: id
55
- }, children);
56
- return component;
57
- });
17
+ import MetricText from '../compiled/components/metric-text';
58
18
  export default MetricText;
@@ -86,7 +86,7 @@ const Pressable = /*#__PURE__*/forwardRef(({
86
86
  action: 'clicked',
87
87
  componentName: componentName || 'Pressable',
88
88
  packageName: "@atlaskit/primitives",
89
- packageVersion: "0.0.0-development",
89
+ packageVersion: "15.0.1",
90
90
  analyticsData: analyticsContext,
91
91
  actionSubject: 'button'
92
92
  });
@@ -61,7 +61,7 @@ var AnchorNoRef = function AnchorNoRef(_ref, ref) {
61
61
  action: 'clicked',
62
62
  componentName: componentName || 'Anchor',
63
63
  packageName: "@atlaskit/primitives",
64
- packageVersion: "0.0.0-development",
64
+ packageVersion: "15.0.1",
65
65
  analyticsData: analyticsContext,
66
66
  actionSubject: 'link'
67
67
  });
@@ -52,7 +52,7 @@ var Pressable = /*#__PURE__*/forwardRef(function (_ref, ref) {
52
52
  action: 'clicked',
53
53
  componentName: componentName || 'Pressable',
54
54
  packageName: "@atlaskit/primitives",
55
- packageVersion: "0.0.0-development",
55
+ packageVersion: "15.0.1",
56
56
  analyticsData: analyticsContext,
57
57
  actionSubject: 'button'
58
58
  });
@@ -99,7 +99,7 @@ var AnchorNoRef = function AnchorNoRef(_ref, ref) {
99
99
  action: 'clicked',
100
100
  componentName: componentName || 'Anchor',
101
101
  packageName: "@atlaskit/primitives",
102
- packageVersion: "0.0.0-development",
102
+ packageVersion: "15.0.1",
103
103
  analyticsData: analyticsContext,
104
104
  actionSubject: 'link'
105
105
  });
@@ -1,58 +1,18 @@
1
1
  /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
2
+ * IMPORTANT: This is a temporary mapping to avoid breaking changes.
3
+ * We will remove this once we have migrated all the components to @atlaskit/primitives/compiled.
4
4
  */
5
- import { forwardRef } from 'react';
6
-
7
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
8
- import { css, jsx } from '@emotion/react';
9
- import invariant from 'tiny-invariant';
10
- import { metricTextSizeStylesMap } from '../xcss/style-maps.partial';
11
- var asAllowlist = ['span', 'div'];
12
- // We're doing this because our CSS reset can add top margins to elements such as `p` which is totally insane.
13
- // Long term we should remove those instances from the reset - it should be a reset to 0.
14
- // For now, at least we know <MetricText> will be unaffected by this.
15
- var resetStyles = css({
16
- margin: 0
17
- });
18
- var textAlignMap = {
19
- center: css({
20
- textAlign: 'center'
21
- }),
22
- end: css({
23
- textAlign: 'end'
24
- }),
25
- start: css({
26
- textAlign: 'start'
27
- })
28
- };
29
5
 
6
+ // TODO: Fill in the component {description} and ensure links point to the correct {packageName} location.
7
+ // Remove links that the component does not have (such as usage). If there are no links remove them all.
30
8
  /**
31
- * __MetricText__
9
+ * __Metric text comp__
32
10
  *
33
- * MetricText is a primitive component that has the Atlassian Design System's design guidelines baked in.
34
- * It is designed for use specifically with displaying metrics and is not to be used for headings or general UI text.
35
- * It renders a `span` by default.
11
+ * A metric text comp {description}.
36
12
  *
37
- * @internal
13
+ * - [Examples](https://atlassian.design/components/{packageName}/examples)
14
+ * - [Code](https://atlassian.design/components/{packageName}/code)
15
+ * - [Usage](https://atlassian.design/components/{packageName}/usage)
38
16
  */
39
- var MetricText = /*#__PURE__*/forwardRef(function (_ref, ref) {
40
- var _ref$as = _ref.as,
41
- Component = _ref$as === void 0 ? 'span' : _ref$as,
42
- align = _ref.align,
43
- testId = _ref.testId,
44
- id = _ref.id,
45
- size = _ref.size,
46
- children = _ref.children;
47
- invariant(asAllowlist.includes(Component), "@atlaskit/primitives: MetricText received an invalid \"as\" value of \"".concat(Component, "\""));
48
- var component = jsx(Component, {
49
- ref: ref,
50
- css: [resetStyles,
51
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
52
- size && metricTextSizeStylesMap[size], align && textAlignMap[align]],
53
- "data-testid": testId,
54
- id: id
55
- }, children);
56
- return component;
57
- });
17
+ import MetricText from '../compiled/components/metric-text';
58
18
  export default MetricText;
@@ -91,7 +91,7 @@ var Pressable = /*#__PURE__*/forwardRef(function (_ref, ref) {
91
91
  action: 'clicked',
92
92
  componentName: componentName || 'Pressable',
93
93
  packageName: "@atlaskit/primitives",
94
- packageVersion: "0.0.0-development",
94
+ packageVersion: "15.0.1",
95
95
  analyticsData: analyticsContext,
96
96
  actionSubject: 'button'
97
97
  });
@@ -1,53 +1,16 @@
1
1
  /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
2
+ * IMPORTANT: This is a temporary mapping to avoid breaking changes.
3
+ * We will remove this once we have migrated all the components to @atlaskit/primitives/compiled.
4
4
  */
5
- import { type ComponentPropsWithRef, type ElementType, type ReactNode } from 'react';
6
- import { type MetricTextSize } from '../xcss/style-maps.partial';
7
- import type { BasePrimitiveProps } from './types';
8
- declare const asAllowlist: readonly ["span", "div"];
9
- type AsElement = (typeof asAllowlist)[number];
10
- type MetricTextPropsBase<T extends ElementType = 'span'> = {
11
- /**
12
- * HTML tag to be rendered. Defaults to `span`.
13
- */
14
- as?: AsElement;
15
- /**
16
- * Elements rendered within the Text element.
17
- */
18
- children: ReactNode;
19
- /**
20
- * The [HTML `id` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).
21
- */
22
- id?: string;
23
- /**
24
- * Text alignment.
25
- */
26
- align?: TextAlign;
27
- /**
28
- * Text size.
29
- */
30
- size: MetricTextSize;
31
- /**
32
- * Forwarded ref.
33
- */
34
- ref?: ComponentPropsWithRef<T>['ref'];
35
- };
36
- export type MetricTextProps<T extends ElementType = 'span'> = MetricTextPropsBase<T> & Omit<BasePrimitiveProps, 'xcss'>;
37
- type TextAlign = keyof typeof textAlignMap;
38
- declare const textAlignMap: {
39
- center: import("@emotion/react").SerializedStyles;
40
- end: import("@emotion/react").SerializedStyles;
41
- start: import("@emotion/react").SerializedStyles;
42
- };
43
5
  /**
44
- * __MetricText__
6
+ * __Metric text comp__
45
7
  *
46
- * MetricText is a primitive component that has the Atlassian Design System's design guidelines baked in.
47
- * It is designed for use specifically with displaying metrics and is not to be used for headings or general UI text.
48
- * It renders a `span` by default.
8
+ * A metric text comp {description}.
49
9
  *
50
- * @internal
10
+ * - [Examples](https://atlassian.design/components/{packageName}/examples)
11
+ * - [Code](https://atlassian.design/components/{packageName}/code)
12
+ * - [Usage](https://atlassian.design/components/{packageName}/usage)
51
13
  */
52
- declare const MetricText: React.ForwardRefExoticComponent<React.PropsWithoutRef<MetricTextProps<ElementType>> & React.RefAttributes<any>>;
14
+ import MetricText, { type MetricTextProps } from '../compiled/components/metric-text';
15
+ export type { MetricTextProps };
53
16
  export default MetricText;
@@ -1,56 +1,16 @@
1
1
  /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
2
+ * IMPORTANT: This is a temporary mapping to avoid breaking changes.
3
+ * We will remove this once we have migrated all the components to @atlaskit/primitives/compiled.
4
4
  */
5
- import { type ComponentPropsWithRef, type ElementType, type ReactNode } from 'react';
6
- import { type MetricTextSize } from '../xcss/style-maps.partial';
7
- import type { BasePrimitiveProps } from './types';
8
- declare const asAllowlist: readonly [
9
- "span",
10
- "div"
11
- ];
12
- type AsElement = (typeof asAllowlist)[number];
13
- type MetricTextPropsBase<T extends ElementType = 'span'> = {
14
- /**
15
- * HTML tag to be rendered. Defaults to `span`.
16
- */
17
- as?: AsElement;
18
- /**
19
- * Elements rendered within the Text element.
20
- */
21
- children: ReactNode;
22
- /**
23
- * The [HTML `id` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).
24
- */
25
- id?: string;
26
- /**
27
- * Text alignment.
28
- */
29
- align?: TextAlign;
30
- /**
31
- * Text size.
32
- */
33
- size: MetricTextSize;
34
- /**
35
- * Forwarded ref.
36
- */
37
- ref?: ComponentPropsWithRef<T>['ref'];
38
- };
39
- export type MetricTextProps<T extends ElementType = 'span'> = MetricTextPropsBase<T> & Omit<BasePrimitiveProps, 'xcss'>;
40
- type TextAlign = keyof typeof textAlignMap;
41
- declare const textAlignMap: {
42
- center: import("@emotion/react").SerializedStyles;
43
- end: import("@emotion/react").SerializedStyles;
44
- start: import("@emotion/react").SerializedStyles;
45
- };
46
5
  /**
47
- * __MetricText__
6
+ * __Metric text comp__
48
7
  *
49
- * MetricText is a primitive component that has the Atlassian Design System's design guidelines baked in.
50
- * It is designed for use specifically with displaying metrics and is not to be used for headings or general UI text.
51
- * It renders a `span` by default.
8
+ * A metric text comp {description}.
52
9
  *
53
- * @internal
10
+ * - [Examples](https://atlassian.design/components/{packageName}/examples)
11
+ * - [Code](https://atlassian.design/components/{packageName}/code)
12
+ * - [Usage](https://atlassian.design/components/{packageName}/usage)
54
13
  */
55
- declare const MetricText: React.ForwardRefExoticComponent<React.PropsWithoutRef<MetricTextProps<ElementType>> & React.RefAttributes<any>>;
14
+ import MetricText, { type MetricTextProps } from '../compiled/components/metric-text';
15
+ export type { MetricTextProps };
56
16
  export default MetricText;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/primitives",
3
- "version": "15.0.1",
3
+ "version": "16.0.0",
4
4
  "description": "Primitives are token-backed low-level building blocks.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"