@atlaskit/modal-dialog 17.2.6 → 17.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,24 @@
1
1
  # @atlaskit/modal-dialog
2
2
 
3
+ ## 17.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`edde589c7f2d7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/edde589c7f2d7) -
8
+ Integrate modal title warning and danger icon labels with React Intl behind
9
+ platform_modal_title_icon_label, preserving English fallbacks without a provider. Adds a React
10
+ Intl runtime dependency.
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+
16
+ ## 17.2.7
17
+
18
+ ### Patch Changes
19
+
20
+ - Updated dependencies
21
+
3
22
  ## 17.2.6
4
23
 
5
24
  ### Patch Changes
package/README.md CHANGED
@@ -12,3 +12,15 @@ yarn add @atlaskit/modal-dialog
12
12
 
13
13
  Detailed docs and example usage can be found
14
14
  [here](https://atlassian.design/components/modal-dialog/).
15
+
16
+ ## Internationalisation
17
+
18
+ With `platform_modal_title_icon_label` enabled, the warning and danger title icons use the
19
+ application's React Intl message catalog. Include translations for
20
+ `modal-dialog.title.warning-icon-label` and `modal-dialog.title.danger-icon-label` in the existing
21
+ `IntlProvider` messages. No additional modal props are needed. Missing translations and applications
22
+ without an `IntlProvider` retain the English labels.
23
+
24
+ The package is registered in `platform/i18n-resources.json` for Traduki extraction. Translation
25
+ catalog publication and inclusion in consuming applications are prerequisites for enabling the gate.
26
+ The localized title example demonstrates the catalog integration.
@@ -108,7 +108,7 @@ function useModalCloseHandler(providedOnClose) {
108
108
  action: 'closed',
109
109
  componentName: 'modalDialog',
110
110
  packageName: "@atlaskit/modal-dialog",
111
- packageVersion: "17.2.5"
111
+ packageVersion: "17.2.7"
112
112
  });
113
113
  }
114
114
  function getScrollMode(_ref) {
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.titleIconMessages = void 0;
7
+ var _reactIntl = require("react-intl");
8
+ var titleIconMessages = exports.titleIconMessages = (0, _reactIntl.defineMessages)({
9
+ warning: {
10
+ id: 'modal-dialog.title.warning-icon-label',
11
+ defaultMessage: 'warning',
12
+ description: 'Accessible label for the warning icon inside a modal dialog heading. Identifies the severity of the dialog to screen reader users.'
13
+ },
14
+ danger: {
15
+ id: 'modal-dialog.title.danger-icon-label',
16
+ defaultMessage: 'danger',
17
+ description: 'Accessible label for the error icon inside a modal dialog heading with danger appearance. Indicates a destructive or high-risk action to screen reader users.'
18
+ }
19
+ });
@@ -8,11 +8,15 @@ Object.defineProperty(exports, "__esModule", {
8
8
  });
9
9
  exports.default = void 0;
10
10
  require("./modal-title.compiled.css");
11
- var React = _interopRequireWildcard(require("react"));
11
+ var _react = _interopRequireWildcard(require("react"));
12
+ var React = _react;
12
13
  var _runtime = require("@compiled/react/runtime");
14
+ var _reactIntl = require("react-intl");
13
15
  var _statusError = _interopRequireDefault(require("@atlaskit/icon/core/status-error"));
14
16
  var _statusWarning = _interopRequireDefault(require("@atlaskit/icon/core/status-warning"));
17
+ var _fg = require("@atlaskit/platform-feature-flags/fg");
15
18
  var _hooks = require("./hooks");
19
+ var _titleIconMessages = require("./internal/title-icon-messages");
16
20
  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); }
17
21
  var iconColor = {
18
22
  danger: "var(--ds-icon-danger, #C9372C)",
@@ -24,11 +28,19 @@ var textStyles = null;
24
28
  var truncatedTextStyles = null;
25
29
  var TitleIcon = function TitleIcon(_ref) {
26
30
  var appearance = _ref.appearance;
31
+ var intl = (0, _react.useContext)(_reactIntl.IntlContext);
27
32
  var Icon = appearance === 'danger' ? _statusError.default : _statusWarning.default;
33
+ var label = appearance;
34
+ if ((0, _fg.fg)('platform_modal_title_icon_label')) {
35
+ var message = _titleIconMessages.titleIconMessages[appearance];
36
+ if (intl && message) {
37
+ label = intl.formatMessage(message);
38
+ }
39
+ }
28
40
  return /*#__PURE__*/React.createElement("span", {
29
41
  className: (0, _runtime.ax)(["_16jlidpf _1o9zidpf _i0dl1wug _syaz1kw7 _1wyb1kw7 _zg8l1kw7 _k48p1kw7 _1dyz1kw7 _vwz41kw7"])
30
42
  }, /*#__PURE__*/React.createElement(Icon, {
31
- label: appearance,
43
+ label: label,
32
44
  color: iconColor[appearance],
33
45
  spacing: "spacious"
34
46
  }));
@@ -97,7 +97,7 @@ function useModalCloseHandler(providedOnClose) {
97
97
  action: 'closed',
98
98
  componentName: 'modalDialog',
99
99
  packageName: "@atlaskit/modal-dialog",
100
- packageVersion: "17.2.5"
100
+ packageVersion: "17.2.7"
101
101
  });
102
102
  }
103
103
  function getScrollMode({
@@ -0,0 +1,13 @@
1
+ import { defineMessages } from 'react-intl';
2
+ export const titleIconMessages = defineMessages({
3
+ warning: {
4
+ id: 'modal-dialog.title.warning-icon-label',
5
+ defaultMessage: 'warning',
6
+ description: 'Accessible label for the warning icon inside a modal dialog heading. Identifies the severity of the dialog to screen reader users.'
7
+ },
8
+ danger: {
9
+ id: 'modal-dialog.title.danger-icon-label',
10
+ defaultMessage: 'danger',
11
+ description: 'Accessible label for the error icon inside a modal dialog heading with danger appearance. Indicates a destructive or high-risk action to screen reader users.'
12
+ }
13
+ });
@@ -2,9 +2,13 @@
2
2
  import "./modal-title.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
+ import { useContext } from 'react';
6
+ import { IntlContext } from 'react-intl';
5
7
  import ErrorIcon from '@atlaskit/icon/core/status-error';
6
8
  import WarningIcon from '@atlaskit/icon/core/status-warning';
9
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
7
10
  import { useModal } from './hooks';
11
+ import { titleIconMessages } from './internal/title-icon-messages';
8
12
  const iconColor = {
9
13
  danger: "var(--ds-icon-danger, #C9372C)",
10
14
  warning: "var(--ds-icon-warning, #E06C00)"
@@ -16,11 +20,19 @@ const truncatedTextStyles = null;
16
20
  const TitleIcon = ({
17
21
  appearance
18
22
  }) => {
23
+ const intl = useContext(IntlContext);
19
24
  const Icon = appearance === 'danger' ? ErrorIcon : WarningIcon;
25
+ let label = appearance;
26
+ if (fg('platform_modal_title_icon_label')) {
27
+ const message = titleIconMessages[appearance];
28
+ if (intl && message) {
29
+ label = intl.formatMessage(message);
30
+ }
31
+ }
20
32
  return /*#__PURE__*/React.createElement("span", {
21
33
  className: ax(["_16jlidpf _1o9zidpf _i0dl1wug _syaz1kw7 _1wyb1kw7 _zg8l1kw7 _k48p1kw7 _1dyz1kw7 _vwz41kw7"])
22
34
  }, /*#__PURE__*/React.createElement(Icon, {
23
- label: appearance,
35
+ label: label,
24
36
  color: iconColor[appearance],
25
37
  spacing: "spacious"
26
38
  }));
@@ -100,7 +100,7 @@ function useModalCloseHandler(providedOnClose) {
100
100
  action: 'closed',
101
101
  componentName: 'modalDialog',
102
102
  packageName: "@atlaskit/modal-dialog",
103
- packageVersion: "17.2.5"
103
+ packageVersion: "17.2.7"
104
104
  });
105
105
  }
106
106
  function getScrollMode(_ref) {
@@ -0,0 +1,13 @@
1
+ import { defineMessages } from 'react-intl';
2
+ export var titleIconMessages = defineMessages({
3
+ warning: {
4
+ id: 'modal-dialog.title.warning-icon-label',
5
+ defaultMessage: 'warning',
6
+ description: 'Accessible label for the warning icon inside a modal dialog heading. Identifies the severity of the dialog to screen reader users.'
7
+ },
8
+ danger: {
9
+ id: 'modal-dialog.title.danger-icon-label',
10
+ defaultMessage: 'danger',
11
+ description: 'Accessible label for the error icon inside a modal dialog heading with danger appearance. Indicates a destructive or high-risk action to screen reader users.'
12
+ }
13
+ });
@@ -2,9 +2,13 @@
2
2
  import "./modal-title.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
+ import { useContext } from 'react';
6
+ import { IntlContext } from 'react-intl';
5
7
  import ErrorIcon from '@atlaskit/icon/core/status-error';
6
8
  import WarningIcon from '@atlaskit/icon/core/status-warning';
9
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
7
10
  import { useModal } from './hooks';
11
+ import { titleIconMessages } from './internal/title-icon-messages';
8
12
  var iconColor = {
9
13
  danger: "var(--ds-icon-danger, #C9372C)",
10
14
  warning: "var(--ds-icon-warning, #E06C00)"
@@ -15,11 +19,19 @@ var textStyles = null;
15
19
  var truncatedTextStyles = null;
16
20
  var TitleIcon = function TitleIcon(_ref) {
17
21
  var appearance = _ref.appearance;
22
+ var intl = useContext(IntlContext);
18
23
  var Icon = appearance === 'danger' ? ErrorIcon : WarningIcon;
24
+ var label = appearance;
25
+ if (fg('platform_modal_title_icon_label')) {
26
+ var message = titleIconMessages[appearance];
27
+ if (intl && message) {
28
+ label = intl.formatMessage(message);
29
+ }
30
+ }
19
31
  return /*#__PURE__*/React.createElement("span", {
20
32
  className: ax(["_16jlidpf _1o9zidpf _i0dl1wug _syaz1kw7 _1wyb1kw7 _zg8l1kw7 _k48p1kw7 _1dyz1kw7 _vwz41kw7"])
21
33
  }, /*#__PURE__*/React.createElement(Icon, {
22
- label: appearance,
34
+ label: label,
23
35
  color: iconColor[appearance],
24
36
  spacing: "spacious"
25
37
  }));
@@ -0,0 +1,3 @@
1
+ import { type MessageDescriptor } from 'react-intl';
2
+ import { type Appearance } from '../types';
3
+ export declare const titleIconMessages: Record<Appearance, MessageDescriptor>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/modal-dialog",
3
- "version": "17.2.6",
3
+ "version": "17.3.0",
4
4
  "description": "A modal dialog displays content that requires user interaction, in a layer above the page.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -41,23 +41,24 @@
41
41
  "@atlaskit/blanket": "^16.4.0",
42
42
  "@atlaskit/button": "^25.8.0",
43
43
  "@atlaskit/css": "^1.1.0",
44
- "@atlaskit/ds-lib": "^8.0.0",
45
- "@atlaskit/icon": "^38.1.0",
44
+ "@atlaskit/ds-lib": "^9.0.0",
45
+ "@atlaskit/icon": "^38.2.0",
46
46
  "@atlaskit/layering": "^6.1.0",
47
47
  "@atlaskit/motion": "^10.0.0",
48
48
  "@atlaskit/platform-feature-flags": "^2.2.0",
49
49
  "@atlaskit/portal": "^7.1.0",
50
50
  "@atlaskit/pragmatic-drag-and-drop": "^4.0.0",
51
- "@atlaskit/primitives": "^22.7.0",
51
+ "@atlaskit/primitives": "^22.8.0",
52
52
  "@atlaskit/react-compiler-gating": "^0.2.0",
53
53
  "@atlaskit/theme": "^28.2.0",
54
- "@atlaskit/tokens": "^20.12.0",
54
+ "@atlaskit/tokens": "^20.14.0",
55
55
  "@atlaskit/top-layer": "^8.1.0",
56
56
  "@babel/runtime": "^7.0.0",
57
57
  "@compiled/react": "^1.0.2",
58
58
  "bind-event-listener": "^3.0.0",
59
59
  "raf-schd": "^4.0.3",
60
60
  "react-focus-lock": "^2.9.5",
61
+ "react-intl": "^7.0.0",
61
62
  "react-scrolllock": "^5.0.1"
62
63
  },
63
64
  "peerDependencies": {
@@ -67,7 +68,7 @@
67
68
  "@af/accessibility-testing": "workspace:^",
68
69
  "@af/integration-testing": "workspace:^",
69
70
  "@af/visual-regression": "workspace:^",
70
- "@atlaskit/avatar": "^30.1.0",
71
+ "@atlaskit/avatar": "^31.0.0",
71
72
  "@atlaskit/avatar-group": "^14.4.0",
72
73
  "@atlaskit/banner": "^15.3.0",
73
74
  "@atlaskit/breadcrumbs": "^17.8.0",
@@ -76,7 +77,7 @@
76
77
  "@atlaskit/codemod-utils": "^5.2.0",
77
78
  "@atlaskit/datetime-picker": "^19.5.0",
78
79
  "@atlaskit/docs": "^12.3.0",
79
- "@atlaskit/dropdown-menu": "^21.3.0",
80
+ "@atlaskit/dropdown-menu": "^22.0.0",
80
81
  "@atlaskit/flag": "^19.0.0",
81
82
  "@atlaskit/form": "^18.3.0",
82
83
  "@atlaskit/heading": "^8.0.0",
@@ -86,7 +87,7 @@
86
87
  "@atlaskit/section-message": "^10.3.0",
87
88
  "@atlaskit/select": "^23.2.0",
88
89
  "@atlaskit/spotlight": "^4.2.0",
89
- "@atlaskit/textfield": "^10.3.0",
90
+ "@atlaskit/textfield": "^11.0.0",
90
91
  "@atlaskit/tooltip": "^24.4.0",
91
92
  "@atlassian/feature-flags-test-utils": "^2.0.0",
92
93
  "@atlassian/ssr-tests": "workspace:^",