@atlaskit/section-message 10.2.6 → 10.3.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,12 @@
1
1
  # @atlaskit/section-message
2
2
 
3
+ ## 10.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`c54a2220ddbac`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c54a2220ddbac) -
8
+ Add iconLabel for localized status icon labels
9
+
3
10
  ## 10.2.6
4
11
 
5
12
  ### Patch Changes
@@ -41,14 +41,14 @@ var appearanceIconSchema = {
41
41
  primaryIconColor: "var(--ds-icon-discovery, #AF59E1)"
42
42
  }
43
43
  };
44
- function getAppearanceIconStyles(appearance, icon) {
44
+ function getAppearanceIconStyles(appearance, icon, iconLabel) {
45
45
  var appearanceIconStyles = appearanceIconSchema[appearance] || appearanceIconSchema.information;
46
46
  var AppearanceIcon = function AppearanceIcon(_ref) {
47
47
  var primaryColor = _ref.primaryColor;
48
48
  return /*#__PURE__*/_react.default.createElement(appearanceIconStyles.Icon, {
49
49
  color: primaryColor,
50
50
  spacing: "spacious",
51
- label: appearance
51
+ label: iconLabel !== null && iconLabel !== void 0 ? iconLabel : appearance
52
52
  });
53
53
  };
54
54
  var Icon = icon || AppearanceIcon;
@@ -1,4 +1,4 @@
1
- /* section-message-action.tsx generated by @compiled/babel-plugin v3.0.2 */
1
+ /* section-message-action.tsx generated by @compiled/babel-plugin v3.0.4 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -14,7 +14,8 @@ var _runtime = require("@compiled/react/runtime");
14
14
  var _standardButton = _interopRequireDefault(require("@atlaskit/button/standard-button"));
15
15
  var _css = require("@atlaskit/css");
16
16
  var _link = _interopRequireDefault(require("@atlaskit/link/link"));
17
- var _compiled = require("@atlaskit/primitives/compiled");
17
+ var _box = require("@atlaskit/primitives/compiled/box");
18
+ var _pressable = require("@atlaskit/primitives/compiled/pressable");
18
19
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
19
20
  var styles = {
20
21
  common: "_11c8fhey",
@@ -51,14 +52,14 @@ var SectionMessageAction = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _reac
51
52
  }, children));
52
53
  }
53
54
  if (onClick) {
54
- return /*#__PURE__*/React.createElement(_compiled.Pressable, {
55
+ return /*#__PURE__*/React.createElement(_pressable.Pressable, {
55
56
  testId: testId,
56
57
  onClick: onClick,
57
58
  xcss: (0, _css.cx)(styles.common, styles.pressable),
58
59
  ref: ref
59
60
  }, children);
60
61
  }
61
- return /*#__PURE__*/React.createElement(_compiled.Box, {
62
+ return /*#__PURE__*/React.createElement(_box.Box, {
62
63
  as: "span",
63
64
  testId: testId,
64
65
  xcss: styles.common,
@@ -1,4 +1,4 @@
1
- /* section-message.tsx generated by @compiled/babel-plugin v3.0.2 */
1
+ /* section-message.tsx generated by @compiled/babel-plugin v3.0.4 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -15,7 +15,8 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
15
15
  var _button = _interopRequireDefault(require("@atlaskit/button/icon/button"));
16
16
  var _heading = _interopRequireDefault(require("@atlaskit/heading/heading"));
17
17
  var _cross = _interopRequireDefault(require("@atlaskit/icon/core/cross"));
18
- var _compiled = require("@atlaskit/primitives/compiled");
18
+ var _inline = require("@atlaskit/primitives/compiled/inline");
19
+ var _stack = require("@atlaskit/primitives/compiled/stack");
19
20
  var _appearanceIcon = require("./internal/appearance-icon");
20
21
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
21
22
  var sectionMessageStyles = {
@@ -52,6 +53,7 @@ var SectionMessage = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
52
53
  _ref$headingLevel = _ref.headingLevel,
53
54
  headingLevel = _ref$headingLevel === void 0 ? 'h2' : _ref$headingLevel,
54
55
  icon = _ref.icon,
56
+ iconLabel = _ref.iconLabel,
55
57
  isDismissible = _ref.isDismissible,
56
58
  onDismiss = _ref.onDismiss,
57
59
  testId = _ref.testId;
@@ -63,7 +65,7 @@ var SectionMessage = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
63
65
  onDismiss === null || onDismiss === void 0 || onDismiss();
64
66
  setDismissed(true);
65
67
  }, [onDismiss]);
66
- var _getAppearanceIconSty = (0, _appearanceIcon.getAppearanceIconStyles)(appearance, icon),
68
+ var _getAppearanceIconSty = (0, _appearanceIcon.getAppearanceIconStyles)(appearance, icon, iconLabel),
67
69
  primaryColor = _getAppearanceIconSty.primaryIconColor,
68
70
  secondaryColor = _getAppearanceIconSty.backgroundColor,
69
71
  Icon = _getAppearanceIconSty.Icon;
@@ -73,7 +75,7 @@ var SectionMessage = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
73
75
  "data-testid": testId,
74
76
  ref: ref,
75
77
  className: (0, _runtime.ax)([sectionMessageStyles.container, appearanceStyles[appearance]])
76
- }, /*#__PURE__*/React.createElement(_compiled.Inline, {
78
+ }, /*#__PURE__*/React.createElement(_inline.Inline, {
77
79
  space: "space.200",
78
80
  alignBlock: "stretch"
79
81
  }, /*#__PURE__*/React.createElement("div", {
@@ -86,7 +88,7 @@ var SectionMessage = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
86
88
  ,
87
89
  color: primaryColor,
88
90
  spacing: "spacious"
89
- })), /*#__PURE__*/React.createElement(_compiled.Stack, {
91
+ })), /*#__PURE__*/React.createElement(_stack.Stack, {
90
92
  space: "space.100",
91
93
  testId: testId && "".concat(testId, "--content"),
92
94
  xcss: sectionMessageStyles.contentContainer
@@ -95,7 +97,7 @@ var SectionMessage = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
95
97
  size: "small"
96
98
  }, title), /*#__PURE__*/React.createElement("div", {
97
99
  className: (0, _runtime.ax)([sectionMessageStyles.content])
98
- }, children), actionsArray.length > 0 && /*#__PURE__*/React.createElement(_compiled.Inline, {
100
+ }, children), actionsArray.length > 0 && /*#__PURE__*/React.createElement(_inline.Inline, {
99
101
  shouldWrap: true,
100
102
  testId: testId && "".concat(testId, "--actions"),
101
103
  separator: "\xB7",
@@ -109,7 +111,7 @@ var SectionMessage = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
109
111
  return (
110
112
  /*#__PURE__*/
111
113
  // Only use a listitem role if more than one action is present
112
- React.createElement(_compiled.Inline, {
114
+ React.createElement(_inline.Inline, {
113
115
  role: actionsArray.length > 1 ? 'listitem' : undefined,
114
116
  key: id
115
117
  }, action)
@@ -31,14 +31,14 @@ const appearanceIconSchema = {
31
31
  primaryIconColor: "var(--ds-icon-discovery, #AF59E1)"
32
32
  }
33
33
  };
34
- export function getAppearanceIconStyles(appearance, icon) {
34
+ export function getAppearanceIconStyles(appearance, icon, iconLabel) {
35
35
  const appearanceIconStyles = appearanceIconSchema[appearance] || appearanceIconSchema.information;
36
36
  const AppearanceIcon = ({
37
37
  primaryColor
38
38
  }) => /*#__PURE__*/React.createElement(appearanceIconStyles.Icon, {
39
39
  color: primaryColor,
40
40
  spacing: "spacious",
41
- label: appearance
41
+ label: iconLabel !== null && iconLabel !== void 0 ? iconLabel : appearance
42
42
  });
43
43
  const Icon = icon || AppearanceIcon;
44
44
  return {
@@ -1,4 +1,4 @@
1
- /* section-message-action.tsx generated by @compiled/babel-plugin v3.0.2 */
1
+ /* section-message-action.tsx generated by @compiled/babel-plugin v3.0.4 */
2
2
  import "./section-message-action.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -6,7 +6,8 @@ import { forwardRef, Fragment, memo } from 'react';
6
6
  import Button from '@atlaskit/button/standard-button';
7
7
  import { cx } from '@atlaskit/css';
8
8
  import Link from '@atlaskit/link/link';
9
- import { Box, Pressable } from '@atlaskit/primitives/compiled';
9
+ import { Box } from '@atlaskit/primitives/compiled/box';
10
+ import { Pressable } from '@atlaskit/primitives/compiled/pressable';
10
11
  const styles = {
11
12
  common: "_11c8fhey",
12
13
  anchor: "_k48pi7a9",
@@ -1,4 +1,4 @@
1
- /* section-message.tsx generated by @compiled/babel-plugin v3.0.2 */
1
+ /* section-message.tsx generated by @compiled/babel-plugin v3.0.4 */
2
2
  import "./section-message.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -6,7 +6,8 @@ import { Children, forwardRef, Fragment, useCallback, useState } from 'react';
6
6
  import IconButton from '@atlaskit/button/icon/button';
7
7
  import Heading from '@atlaskit/heading/heading';
8
8
  import CrossIcon from '@atlaskit/icon/core/cross';
9
- import { Inline, Stack } from '@atlaskit/primitives/compiled';
9
+ import { Inline } from '@atlaskit/primitives/compiled/inline';
10
+ import { Stack } from '@atlaskit/primitives/compiled/stack';
10
11
  import { getAppearanceIconStyles } from './internal/appearance-icon';
11
12
  const sectionMessageStyles = {
12
13
  container: "_2rko1mok _1rjcpxbi _18zrpxbi _1nmz1hna",
@@ -40,6 +41,7 @@ const SectionMessage = /*#__PURE__*/forwardRef(({
40
41
  title,
41
42
  headingLevel = 'h2',
42
43
  icon,
44
+ iconLabel,
43
45
  isDismissible,
44
46
  onDismiss,
45
47
  testId
@@ -53,7 +55,7 @@ const SectionMessage = /*#__PURE__*/forwardRef(({
53
55
  primaryIconColor: primaryColor,
54
56
  backgroundColor: secondaryColor,
55
57
  Icon
56
- } = getAppearanceIconStyles(appearance, icon);
58
+ } = getAppearanceIconStyles(appearance, icon, iconLabel);
57
59
  const actionElements = actions && actions.type === Fragment ? actions.props.children : actions;
58
60
  const actionsArray = Children.toArray(actionElements);
59
61
  return isDismissible && dismissed ? null : /*#__PURE__*/React.createElement("section", {
@@ -34,14 +34,14 @@ var appearanceIconSchema = {
34
34
  primaryIconColor: "var(--ds-icon-discovery, #AF59E1)"
35
35
  }
36
36
  };
37
- export function getAppearanceIconStyles(appearance, icon) {
37
+ export function getAppearanceIconStyles(appearance, icon, iconLabel) {
38
38
  var appearanceIconStyles = appearanceIconSchema[appearance] || appearanceIconSchema.information;
39
39
  var AppearanceIcon = function AppearanceIcon(_ref) {
40
40
  var primaryColor = _ref.primaryColor;
41
41
  return /*#__PURE__*/React.createElement(appearanceIconStyles.Icon, {
42
42
  color: primaryColor,
43
43
  spacing: "spacious",
44
- label: appearance
44
+ label: iconLabel !== null && iconLabel !== void 0 ? iconLabel : appearance
45
45
  });
46
46
  };
47
47
  var Icon = icon || AppearanceIcon;
@@ -1,4 +1,4 @@
1
- /* section-message-action.tsx generated by @compiled/babel-plugin v3.0.2 */
1
+ /* section-message-action.tsx generated by @compiled/babel-plugin v3.0.4 */
2
2
  import "./section-message-action.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -6,7 +6,8 @@ import { forwardRef, Fragment, memo } from 'react';
6
6
  import Button from '@atlaskit/button/standard-button';
7
7
  import { cx } from '@atlaskit/css';
8
8
  import Link from '@atlaskit/link/link';
9
- import { Box, Pressable } from '@atlaskit/primitives/compiled';
9
+ import { Box } from '@atlaskit/primitives/compiled/box';
10
+ import { Pressable } from '@atlaskit/primitives/compiled/pressable';
10
11
  var styles = {
11
12
  common: "_11c8fhey",
12
13
  anchor: "_k48pi7a9",
@@ -1,4 +1,4 @@
1
- /* section-message.tsx generated by @compiled/babel-plugin v3.0.2 */
1
+ /* section-message.tsx generated by @compiled/babel-plugin v3.0.4 */
2
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
3
  import "./section-message.compiled.css";
4
4
  import * as React from 'react';
@@ -7,7 +7,8 @@ import { Children, forwardRef, Fragment, useCallback, useState } from 'react';
7
7
  import IconButton from '@atlaskit/button/icon/button';
8
8
  import Heading from '@atlaskit/heading/heading';
9
9
  import CrossIcon from '@atlaskit/icon/core/cross';
10
- import { Inline, Stack } from '@atlaskit/primitives/compiled';
10
+ import { Inline } from '@atlaskit/primitives/compiled/inline';
11
+ import { Stack } from '@atlaskit/primitives/compiled/stack';
11
12
  import { getAppearanceIconStyles } from './internal/appearance-icon';
12
13
  var sectionMessageStyles = {
13
14
  container: "_2rko1mok _1rjcpxbi _18zrpxbi _1nmz1hna",
@@ -43,6 +44,7 @@ var SectionMessage = /*#__PURE__*/forwardRef(function (_ref, ref) {
43
44
  _ref$headingLevel = _ref.headingLevel,
44
45
  headingLevel = _ref$headingLevel === void 0 ? 'h2' : _ref$headingLevel,
45
46
  icon = _ref.icon,
47
+ iconLabel = _ref.iconLabel,
46
48
  isDismissible = _ref.isDismissible,
47
49
  onDismiss = _ref.onDismiss,
48
50
  testId = _ref.testId;
@@ -54,7 +56,7 @@ var SectionMessage = /*#__PURE__*/forwardRef(function (_ref, ref) {
54
56
  onDismiss === null || onDismiss === void 0 || onDismiss();
55
57
  setDismissed(true);
56
58
  }, [onDismiss]);
57
- var _getAppearanceIconSty = getAppearanceIconStyles(appearance, icon),
59
+ var _getAppearanceIconSty = getAppearanceIconStyles(appearance, icon, iconLabel),
58
60
  primaryColor = _getAppearanceIconSty.primaryIconColor,
59
61
  secondaryColor = _getAppearanceIconSty.backgroundColor,
60
62
  Icon = _getAppearanceIconSty.Icon;
@@ -1,6 +1,6 @@
1
1
  import React, { type ComponentType } from 'react';
2
2
  import type { Appearance, SectionMessageProps } from '../types';
3
- export declare function getAppearanceIconStyles(appearance: Appearance, icon: SectionMessageProps['icon']): {
3
+ export declare function getAppearanceIconStyles(appearance: Appearance, icon: SectionMessageProps['icon'], iconLabel: SectionMessageProps['iconLabel']): {
4
4
  Icon: React.ElementType<any, keyof React.JSX.IntrinsicElements> | (({ primaryColor }: {
5
5
  primaryColor: string;
6
6
  }) => React.JSX.Element);
@@ -39,6 +39,10 @@ interface BaseSectionMessageProps {
39
39
  * to see how to provide this icon.
40
40
  */
41
41
  icon?: React.ElementType;
42
+ /**
43
+ * Accessible label for the status icon. Use your internationalization library to provide a localized string.
44
+ */
45
+ iconLabel?: string;
42
46
  /**
43
47
  * Displays a dismiss button, that allows the user to dismiss the message.
44
48
  * It will be removed from the DOM immediately and will not be re-rendered.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/section-message",
3
- "version": "10.2.6",
3
+ "version": "10.3.0",
4
4
  "description": "A section message is used to alert users to a particular section of the screen.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -34,15 +34,15 @@
34
34
  }
35
35
  },
36
36
  "dependencies": {
37
- "@atlaskit/button": "^25.4.0",
37
+ "@atlaskit/button": "^25.8.0",
38
38
  "@atlaskit/css": "^1.1.0",
39
39
  "@atlaskit/heading": "^8.0.0",
40
40
  "@atlaskit/icon": "^38.0.0",
41
41
  "@atlaskit/link": "^5.1.0",
42
42
  "@atlaskit/platform-feature-flags": "^2.2.0",
43
- "@atlaskit/primitives": "^22.5.0",
43
+ "@atlaskit/primitives": "^22.7.0",
44
44
  "@atlaskit/react-compiler-gating": "^0.2.0",
45
- "@atlaskit/tokens": "^20.0.0",
45
+ "@atlaskit/tokens": "^20.11.0",
46
46
  "@babel/runtime": "^7.0.0"
47
47
  },
48
48
  "peerDependencies": {
@@ -52,11 +52,11 @@
52
52
  "@af/accessibility-testing": "workspace:^",
53
53
  "@af/integration-testing": "workspace:^",
54
54
  "@af/visual-regression": "workspace:^",
55
- "@atlaskit/analytics-next": "^12.5.0",
55
+ "@atlaskit/analytics-next": "^12.6.0",
56
56
  "@atlaskit/code": "^20.0.0",
57
- "@atlaskit/docs": "^12.2.0",
57
+ "@atlaskit/docs": "^12.3.0",
58
58
  "@atlaskit/ds-lib": "^8.0.0",
59
- "@atlaskit/form": "^18.0.0",
59
+ "@atlaskit/form": "^18.3.0",
60
60
  "@atlaskit/range": "^12.2.0",
61
61
  "@atlassian/ssr-tests": "workspace:^",
62
62
  "@atlassian/structured-docs-types": "workspace:^",