@atlaskit/primitives 5.1.2 → 5.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,11 @@
1
1
  # @atlaskit/primitives
2
2
 
3
+ ## 5.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#86279](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/86279) [`0988fda99a0d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0988fda99a0d) - Renaming text alignment prop for Text component from `textAlign` to `align`
8
+
3
9
  ## 5.1.2
4
10
 
5
11
  ### Patch Changes
@@ -7,6 +7,7 @@ order: 0
7
7
  import Basic from '../../examples/constellation/text/basic';
8
8
  import ColorInverse from '../../examples/constellation/text/color-inverse';
9
9
  import Weight from '../../examples/constellation/text/weight';
10
+ import Align from '../../examples/constellation/text/align';
10
11
  import AsElement from '../../examples/constellation/text/as-element';
11
12
 
12
13
  ## Basic
@@ -15,19 +16,25 @@ Implements the [Atlassian typography system](/foundations/typography/) as a comp
15
16
 
16
17
  The `size` prop expresses the visual appearance of the text element.
17
18
 
18
- <Example Component={Basic} pacckageName="@atlaskit/primitives" />
19
+ <Example Component={Basic} packageName="@atlaskit/primitives" />
19
20
 
20
21
  ## Color
21
22
 
22
23
  Set `color` to change the text color, defaults to `text.color` if not nested in other Text components. When used within a [box component](/components/primitives/box) that has a bold background color, the text color will automatically be inverted.
23
24
 
24
- <Example Component={ColorInverse} pacckageName="@atlaskit/primitives" />
25
+ <Example Component={ColorInverse} packageName="@atlaskit/primitives" />
25
26
 
26
27
  ## Weight
27
28
 
28
29
  Set `weight` to change the font weight.
29
30
 
30
- <Example Component={Weight} pacckageName="@atlaskit/primitives" />
31
+ <Example Component={Weight} packageName="@atlaskit/primitives" />
32
+
33
+ ## Alignment
34
+
35
+ Set `align` to change the text alignment.
36
+
37
+ <Example Component={Align} packageName="@atlaskit/primitives" />
31
38
 
32
39
  ## Rendered HTML tag
33
40
 
@@ -76,7 +76,7 @@ var Anchor = function Anchor(_ref, ref) {
76
76
  action: 'clicked',
77
77
  componentName: componentName || 'Anchor',
78
78
  packageName: "@atlaskit/primitives",
79
- packageVersion: "5.1.2",
79
+ packageVersion: "5.2.0",
80
80
  analyticsData: analyticsContext,
81
81
  actionSubject: 'link'
82
82
  });
@@ -8,10 +8,7 @@ exports.default = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
  var _react2 = require("@emotion/react");
10
10
  var _xcss = require("../xcss/xcss");
11
- /**
12
- * @jsxRuntime classic
13
- * @jsx jsx
14
- */
11
+ /** @jsx jsx */
15
12
 
16
13
  var baseStyles = (0, _react2.css)({
17
14
  boxSizing: 'border-box'
@@ -80,7 +80,7 @@ var UNSAFE_PRESSABLE = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref)
80
80
  action: 'clicked',
81
81
  componentName: componentName || 'Pressable',
82
82
  packageName: "@atlaskit/primitives",
83
- packageVersion: "5.1.2",
83
+ packageVersion: "5.2.0",
84
84
  analyticsData: analyticsContext,
85
85
  actionSubject: 'button'
86
86
  });
@@ -87,6 +87,8 @@ var Text = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
87
87
  Component = _ref$as === void 0 ? 'span' : _ref$as,
88
88
  colorProp = _ref.color,
89
89
  textAlign = _ref.textAlign,
90
+ _ref$align = _ref.align,
91
+ align = _ref$align === void 0 ? textAlign : _ref$align,
90
92
  testId = _ref.testId,
91
93
  id = _ref.id,
92
94
  _ref$size = _ref.size,
@@ -99,7 +101,7 @@ var Text = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
99
101
  var color = useColor(colorProp, hasTextAncestor);
100
102
  var component = (0, _react2.jsx)(Component, {
101
103
  ref: ref,
102
- css: [resetStyles, _styleMaps.fontStylesMap[size], color && _styleMaps.textColorStylesMap[color], maxLines && truncationStyles, maxLines === 1 && wordBreakMap.breakAll, textAlign && textAlignMap[textAlign], weight && _styleMaps.fontWeightStylesMap[weight], Component === 'em' && emStyles, Component === 'strong' && strongStyles],
104
+ css: [resetStyles, _styleMaps.fontStylesMap[size], color && _styleMaps.textColorStylesMap[color], maxLines && truncationStyles, maxLines === 1 && wordBreakMap.breakAll, align && textAlignMap[align], weight && _styleMaps.fontWeightStylesMap[weight], Component === 'em' && emStyles, Component === 'strong' && strongStyles],
103
105
  style: {
104
106
  WebkitLineClamp: maxLines
105
107
  },
@@ -62,7 +62,7 @@ const Anchor = ({
62
62
  action: 'clicked',
63
63
  componentName: componentName || 'Anchor',
64
64
  packageName: "@atlaskit/primitives",
65
- packageVersion: "5.1.2",
65
+ packageVersion: "5.2.0",
66
66
  analyticsData: analyticsContext,
67
67
  actionSubject: 'link'
68
68
  });
@@ -1,7 +1,4 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
1
+ /** @jsx jsx */
5
2
  import React from 'react';
6
3
  import { css, jsx } from '@emotion/react';
7
4
  import { parseXcss } from '../xcss/xcss';
@@ -66,7 +66,7 @@ const UNSAFE_PRESSABLE = /*#__PURE__*/forwardRef(({
66
66
  action: 'clicked',
67
67
  componentName: componentName || 'Pressable',
68
68
  packageName: "@atlaskit/primitives",
69
- packageVersion: "5.1.2",
69
+ packageVersion: "5.2.0",
70
70
  analyticsData: analyticsContext,
71
71
  actionSubject: 'button'
72
72
  });
@@ -76,6 +76,7 @@ const Text = /*#__PURE__*/forwardRef(({
76
76
  as: Component = 'span',
77
77
  color: colorProp,
78
78
  textAlign,
79
+ align = textAlign,
79
80
  testId,
80
81
  id,
81
82
  size = 'medium',
@@ -88,7 +89,7 @@ const Text = /*#__PURE__*/forwardRef(({
88
89
  const color = useColor(colorProp, hasTextAncestor);
89
90
  const component = jsx(Component, {
90
91
  ref: ref,
91
- css: [resetStyles, fontStylesMap[size], color && textColorStylesMap[color], maxLines && truncationStyles, maxLines === 1 && wordBreakMap.breakAll, textAlign && textAlignMap[textAlign], weight && fontWeightStylesMap[weight], Component === 'em' && emStyles, Component === 'strong' && strongStyles],
92
+ css: [resetStyles, fontStylesMap[size], color && textColorStylesMap[color], maxLines && truncationStyles, maxLines === 1 && wordBreakMap.breakAll, align && textAlignMap[align], weight && fontWeightStylesMap[weight], Component === 'em' && emStyles, Component === 'strong' && strongStyles],
92
93
  style: {
93
94
  WebkitLineClamp: maxLines
94
95
  },
@@ -66,7 +66,7 @@ var Anchor = function Anchor(_ref, ref) {
66
66
  action: 'clicked',
67
67
  componentName: componentName || 'Anchor',
68
68
  packageName: "@atlaskit/primitives",
69
- packageVersion: "5.1.2",
69
+ packageVersion: "5.2.0",
70
70
  analyticsData: analyticsContext,
71
71
  actionSubject: 'link'
72
72
  });
@@ -1,7 +1,4 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
1
+ /** @jsx jsx */
5
2
  import React from 'react';
6
3
  import { css, jsx } from '@emotion/react';
7
4
  import { parseXcss } from '../xcss/xcss';
@@ -70,7 +70,7 @@ var UNSAFE_PRESSABLE = /*#__PURE__*/forwardRef(function (_ref, ref) {
70
70
  action: 'clicked',
71
71
  componentName: componentName || 'Pressable',
72
72
  packageName: "@atlaskit/primitives",
73
- packageVersion: "5.1.2",
73
+ packageVersion: "5.2.0",
74
74
  analyticsData: analyticsContext,
75
75
  actionSubject: 'button'
76
76
  });
@@ -79,6 +79,8 @@ var Text = /*#__PURE__*/forwardRef(function (_ref, ref) {
79
79
  Component = _ref$as === void 0 ? 'span' : _ref$as,
80
80
  colorProp = _ref.color,
81
81
  textAlign = _ref.textAlign,
82
+ _ref$align = _ref.align,
83
+ align = _ref$align === void 0 ? textAlign : _ref$align,
82
84
  testId = _ref.testId,
83
85
  id = _ref.id,
84
86
  _ref$size = _ref.size,
@@ -91,7 +93,7 @@ var Text = /*#__PURE__*/forwardRef(function (_ref, ref) {
91
93
  var color = useColor(colorProp, hasTextAncestor);
92
94
  var component = jsx(Component, {
93
95
  ref: ref,
94
- css: [resetStyles, fontStylesMap[size], color && textColorStylesMap[color], maxLines && truncationStyles, maxLines === 1 && wordBreakMap.breakAll, textAlign && textAlignMap[textAlign], weight && fontWeightStylesMap[weight], Component === 'em' && emStyles, Component === 'strong' && strongStyles],
96
+ css: [resetStyles, fontStylesMap[size], color && textColorStylesMap[color], maxLines && truncationStyles, maxLines === 1 && wordBreakMap.breakAll, align && textAlignMap[align], weight && fontWeightStylesMap[weight], Component === 'em' && emStyles, Component === 'strong' && strongStyles],
95
97
  style: {
96
98
  WebkitLineClamp: maxLines
97
99
  },
@@ -1,7 +1,4 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
1
+ /** @jsx jsx */
5
2
  import React, { ReactNode } from 'react';
6
3
  import { jsx } from '@emotion/react';
7
4
  import type { BasePrimitiveProps } from './types';
@@ -30,9 +30,13 @@ type TextPropsBase<T extends ElementType = 'span'> = {
30
30
  */
31
31
  maxLines?: number;
32
32
  /**
33
- * The [HTML `text-align` attribute](https://developer.mozilla.org/en-US/docs/Web/CSS/text-align).
33
+ * @deprecated The [HTML `text-align` attribute](https://developer.mozilla.org/en-US/docs/Web/CSS/text-align).
34
34
  */
35
35
  textAlign?: TextAlign;
36
+ /**
37
+ * Text alignment.
38
+ */
39
+ align?: TextAlign;
36
40
  /**
37
41
  * Text size.
38
42
  */
@@ -62,5 +66,5 @@ declare const textAlignMap: {
62
66
  *
63
67
  * @internal
64
68
  */
65
- declare const Text: import("react").ForwardRefExoticComponent<Pick<TextPropsBase<ElementType> & Omit<BasePrimitiveProps, "xcss">, "color" | "maxLines" | "textAlign" | "size" | "weight" | "children" | "as" | "id" | "role" | "testId" | "data-testid"> & import("react").RefAttributes<any>>;
69
+ declare const Text: import("react").ForwardRefExoticComponent<Pick<TextPropsBase<ElementType> & Omit<BasePrimitiveProps, "xcss">, "color" | "maxLines" | "textAlign" | "size" | "weight" | "children" | "as" | "id" | "role" | "align" | "testId" | "data-testid"> & import("react").RefAttributes<any>>;
66
70
  export default Text;
@@ -1,7 +1,4 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
1
+ /** @jsx jsx */
5
2
  import React, { ReactNode } from 'react';
6
3
  import { jsx } from '@emotion/react';
7
4
  import type { BasePrimitiveProps } from './types';
@@ -35,9 +35,13 @@ type TextPropsBase<T extends ElementType = 'span'> = {
35
35
  */
36
36
  maxLines?: number;
37
37
  /**
38
- * The [HTML `text-align` attribute](https://developer.mozilla.org/en-US/docs/Web/CSS/text-align).
38
+ * @deprecated The [HTML `text-align` attribute](https://developer.mozilla.org/en-US/docs/Web/CSS/text-align).
39
39
  */
40
40
  textAlign?: TextAlign;
41
+ /**
42
+ * Text alignment.
43
+ */
44
+ align?: TextAlign;
41
45
  /**
42
46
  * Text size.
43
47
  */
@@ -67,5 +71,5 @@ declare const textAlignMap: {
67
71
  *
68
72
  * @internal
69
73
  */
70
- declare const Text: import("react").ForwardRefExoticComponent<Pick<TextPropsBase<ElementType> & Omit<BasePrimitiveProps, "xcss">, "color" | "maxLines" | "textAlign" | "size" | "weight" | "children" | "as" | "id" | "role" | "testId" | "data-testid"> & import("react").RefAttributes<any>>;
74
+ declare const Text: import("react").ForwardRefExoticComponent<Pick<TextPropsBase<ElementType> & Omit<BasePrimitiveProps, "xcss">, "color" | "maxLines" | "textAlign" | "size" | "weight" | "children" | "as" | "id" | "role" | "align" | "testId" | "data-testid"> & import("react").RefAttributes<any>>;
71
75
  export default Text;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/primitives",
3
- "version": "5.1.2",
3
+ "version": "5.2.0",
4
4
  "description": "Primitives are token-backed low-level building blocks.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"