@atlaskit/section-message 6.6.9 → 6.8.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,23 @@
1
1
  # @atlaskit/section-message
2
2
 
3
+ ## 6.8.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#170738](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/170738)
8
+ [`ee3ce64bb7f38`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ee3ce64bb7f38) -
9
+ We are testing changes behind a feature gate. Section message actions have been updated to use
10
+ automatic router link configuration (from App provider), as well as default link underlines. If
11
+ this change is successful it will be available in a later release.
12
+
13
+ ## 6.7.0
14
+
15
+ ### Minor Changes
16
+
17
+ - [#165245](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/165245)
18
+ [`6935d35339437`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6935d35339437) -
19
+ Updates internal behaviour to support new icon components
20
+
3
21
  ## 6.6.9
4
22
 
5
23
  ### Patch Changes
@@ -0,0 +1,13 @@
1
+
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
+ ._1yt4ze3t{padding:var(--ds-space-0,0)}
4
+ ._bfhksm61{background-color:var(--ds-background-neutral-subtle,#00000000)}
5
+ ._k48p1wq8{font-weight:var(--ds-font-weight-medium,500)}
6
+ ._syaz14q2{color:var(--ds-link,#0c66e4)}._1053w7te:visited{color:var(--ds-link-visited,#5e4db2)}
7
+ ._1bnx8stv:hover{text-decoration-line:underline}
8
+ ._30l314q2:hover{color:var(--ds-link,#0c66e4)}
9
+ ._9oik18uv:hover{text-decoration-color:initial}
10
+ ._jf4cnqa1:hover{text-decoration-style:solid}
11
+ ._n0fxw7te:visited:hover{color:var(--ds-link-visited,#5e4db2)}
12
+ ._1vhvg3x0:visited:active{color:var(--ds-link-visited-pressed,#352c63)}
13
+ ._9h8h16c2:active{color:var(--ds-link-pressed,#05c)}
@@ -1,3 +1,4 @@
1
+ /* section-message-action.tsx generated by @compiled/babel-plugin v0.32.2 */
1
2
  "use strict";
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -6,10 +7,21 @@ Object.defineProperty(exports, "__esModule", {
6
7
  value: true
7
8
  });
8
9
  exports.default = void 0;
10
+ require("./section-message-action.compiled.css");
11
+ var _runtime = require("@compiled/react/runtime");
9
12
  var _react = _interopRequireWildcard(require("react"));
10
13
  var _standardButton = _interopRequireDefault(require("@atlaskit/button/standard-button"));
14
+ var _css = require("@atlaskit/css");
15
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
16
+ var _primitives = require("@atlaskit/primitives");
11
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); }
12
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; }
19
+ var styles = {
20
+ common: "_syaz14q2 _11c81oud _k48p1wq8 _30l314q2 _9h8h16c2",
21
+ anchor: "_1053w7te _9oik18uv _1bnx8stv _jf4cnqa1 _n0fxw7te _1vhvg3x0",
22
+ pressable: "_bfhksm61 _1yt4ze3t _9oik18uv _1bnx8stv _jf4cnqa1"
23
+ };
24
+
13
25
  /**
14
26
  * __Section message action__
15
27
  *
@@ -25,9 +37,27 @@ var SectionMessageAction = /*#__PURE__*/(0, _react.memo)(function SectionMessage
25
37
  href = _ref.href,
26
38
  testId = _ref.testId,
27
39
  linkComponent = _ref.linkComponent;
28
- // FIXME: This path doesn't make sense
29
- // If the intent of the design for this component is to use an action, not providing `href` or `onClick`
30
- // makes the use case invalid. This should be addressed.
40
+ if (!linkComponent && (0, _platformFeatureFlags.fg)('platform_section_message_action_migration')) {
41
+ if (href) {
42
+ return /*#__PURE__*/_react.default.createElement(_primitives.Anchor, {
43
+ testId: testId,
44
+ onClick: onClick,
45
+ href: href,
46
+ xcss: (0, _css.cx)(styles.common, styles.anchor)
47
+ }, children);
48
+ }
49
+ if (onClick) {
50
+ return /*#__PURE__*/_react.default.createElement(_primitives.Pressable, {
51
+ testId: testId,
52
+ onClick: onClick,
53
+ xcss: (0, _css.cx)(styles.common, styles.pressable)
54
+ }, children);
55
+ }
56
+ return /*#__PURE__*/_react.default.createElement(_primitives.Box, {
57
+ as: "span",
58
+ testId: testId
59
+ }, children);
60
+ }
31
61
  return onClick || href ? /*#__PURE__*/_react.default.createElement(_standardButton.default, {
32
62
  testId: testId,
33
63
  appearance: "link",
@@ -37,5 +67,4 @@ var SectionMessageAction = /*#__PURE__*/(0, _react.memo)(function SectionMessage
37
67
  component: href ? linkComponent : undefined
38
68
  }, children) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, children);
39
69
  });
40
- SectionMessageAction.displayName = 'SectionMessageAction';
41
70
  var _default = exports.default = SectionMessageAction;
@@ -22,7 +22,7 @@ var bleedStyles = (0, _primitives.xcss)({
22
22
  });
23
23
  var contentStyles = (0, _primitives.xcss)({
24
24
  color: 'color.text',
25
- font: "var(--ds-font-body, normal 400 14px/20px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)"
25
+ font: 'font.body'
26
26
  });
27
27
 
28
28
  /**
@@ -64,6 +64,11 @@ var SectionMessage = /*#__PURE__*/(0, _react.forwardRef)(function SectionMessage
64
64
  size: "medium",
65
65
  primaryColor: primaryColor,
66
66
  secondaryColor: secondaryColor
67
+ // props for new icon
68
+ ,
69
+ LEGACY_size: "medium",
70
+ color: primaryColor,
71
+ spacing: "spacious"
67
72
  })), /*#__PURE__*/_react.default.createElement(_primitives.Stack, {
68
73
  space: "space.100",
69
74
  testId: testId && "".concat(testId, "--content")
@@ -0,0 +1,13 @@
1
+
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
+ ._1yt4ze3t{padding:var(--ds-space-0,0)}
4
+ ._bfhksm61{background-color:var(--ds-background-neutral-subtle,#00000000)}
5
+ ._k48p1wq8{font-weight:var(--ds-font-weight-medium,500)}
6
+ ._syaz14q2{color:var(--ds-link,#0c66e4)}._1053w7te:visited{color:var(--ds-link-visited,#5e4db2)}
7
+ ._1bnx8stv:hover{text-decoration-line:underline}
8
+ ._30l314q2:hover{color:var(--ds-link,#0c66e4)}
9
+ ._9oik18uv:hover{text-decoration-color:initial}
10
+ ._jf4cnqa1:hover{text-decoration-style:solid}
11
+ ._n0fxw7te:visited:hover{color:var(--ds-link-visited,#5e4db2)}
12
+ ._1vhvg3x0:visited:active{color:var(--ds-link-visited-pressed,#352c63)}
13
+ ._9h8h16c2:active{color:var(--ds-link-pressed,#05c)}
@@ -1,5 +1,17 @@
1
+ /* section-message-action.tsx generated by @compiled/babel-plugin v0.32.2 */
2
+ import "./section-message-action.compiled.css";
3
+ import { ax, ix } from "@compiled/react/runtime";
1
4
  import React, { memo } from 'react';
2
5
  import Button from '@atlaskit/button/standard-button';
6
+ import { cx } from '@atlaskit/css';
7
+ import { fg } from '@atlaskit/platform-feature-flags';
8
+ import { Anchor, Box, Pressable } from '@atlaskit/primitives';
9
+ const styles = {
10
+ common: "_syaz14q2 _11c81oud _k48p1wq8 _30l314q2 _9h8h16c2",
11
+ anchor: "_1053w7te _9oik18uv _1bnx8stv _jf4cnqa1 _n0fxw7te _1vhvg3x0",
12
+ pressable: "_bfhksm61 _1yt4ze3t _9oik18uv _1bnx8stv _jf4cnqa1"
13
+ };
14
+
3
15
  /**
4
16
  * __Section message action__
5
17
  *
@@ -16,9 +28,27 @@ const SectionMessageAction = /*#__PURE__*/memo(function SectionMessageAction({
16
28
  testId,
17
29
  linkComponent
18
30
  }) {
19
- // FIXME: This path doesn't make sense
20
- // If the intent of the design for this component is to use an action, not providing `href` or `onClick`
21
- // makes the use case invalid. This should be addressed.
31
+ if (!linkComponent && fg('platform_section_message_action_migration')) {
32
+ if (href) {
33
+ return /*#__PURE__*/React.createElement(Anchor, {
34
+ testId: testId,
35
+ onClick: onClick,
36
+ href: href,
37
+ xcss: cx(styles.common, styles.anchor)
38
+ }, children);
39
+ }
40
+ if (onClick) {
41
+ return /*#__PURE__*/React.createElement(Pressable, {
42
+ testId: testId,
43
+ onClick: onClick,
44
+ xcss: cx(styles.common, styles.pressable)
45
+ }, children);
46
+ }
47
+ return /*#__PURE__*/React.createElement(Box, {
48
+ as: "span",
49
+ testId: testId
50
+ }, children);
51
+ }
22
52
  return onClick || href ? /*#__PURE__*/React.createElement(Button, {
23
53
  testId: testId,
24
54
  appearance: "link",
@@ -28,5 +58,4 @@ const SectionMessageAction = /*#__PURE__*/memo(function SectionMessageAction({
28
58
  component: href ? linkComponent : undefined
29
59
  }, children) : /*#__PURE__*/React.createElement(React.Fragment, null, children);
30
60
  });
31
- SectionMessageAction.displayName = 'SectionMessageAction';
32
61
  export default SectionMessageAction;
@@ -12,7 +12,7 @@ const bleedStyles = xcss({
12
12
  });
13
13
  const contentStyles = xcss({
14
14
  color: 'color.text',
15
- font: "var(--ds-font-body, normal 400 14px/20px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)"
15
+ font: 'font.body'
16
16
  });
17
17
 
18
18
  /**
@@ -55,6 +55,11 @@ const SectionMessage = /*#__PURE__*/forwardRef(function SectionMessage({
55
55
  size: "medium",
56
56
  primaryColor: primaryColor,
57
57
  secondaryColor: secondaryColor
58
+ // props for new icon
59
+ ,
60
+ LEGACY_size: "medium",
61
+ color: primaryColor,
62
+ spacing: "spacious"
58
63
  })), /*#__PURE__*/React.createElement(Stack, {
59
64
  space: "space.100",
60
65
  testId: testId && `${testId}--content`
@@ -0,0 +1,13 @@
1
+
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
+ ._1yt4ze3t{padding:var(--ds-space-0,0)}
4
+ ._bfhksm61{background-color:var(--ds-background-neutral-subtle,#00000000)}
5
+ ._k48p1wq8{font-weight:var(--ds-font-weight-medium,500)}
6
+ ._syaz14q2{color:var(--ds-link,#0c66e4)}._1053w7te:visited{color:var(--ds-link-visited,#5e4db2)}
7
+ ._1bnx8stv:hover{text-decoration-line:underline}
8
+ ._30l314q2:hover{color:var(--ds-link,#0c66e4)}
9
+ ._9oik18uv:hover{text-decoration-color:initial}
10
+ ._jf4cnqa1:hover{text-decoration-style:solid}
11
+ ._n0fxw7te:visited:hover{color:var(--ds-link-visited,#5e4db2)}
12
+ ._1vhvg3x0:visited:active{color:var(--ds-link-visited-pressed,#352c63)}
13
+ ._9h8h16c2:active{color:var(--ds-link-pressed,#05c)}
@@ -1,5 +1,17 @@
1
+ /* section-message-action.tsx generated by @compiled/babel-plugin v0.32.2 */
2
+ import "./section-message-action.compiled.css";
3
+ import { ax, ix } from "@compiled/react/runtime";
1
4
  import React, { memo } from 'react';
2
5
  import Button from '@atlaskit/button/standard-button';
6
+ import { cx } from '@atlaskit/css';
7
+ import { fg } from '@atlaskit/platform-feature-flags';
8
+ import { Anchor, Box, Pressable } from '@atlaskit/primitives';
9
+ var styles = {
10
+ common: "_syaz14q2 _11c81oud _k48p1wq8 _30l314q2 _9h8h16c2",
11
+ anchor: "_1053w7te _9oik18uv _1bnx8stv _jf4cnqa1 _n0fxw7te _1vhvg3x0",
12
+ pressable: "_bfhksm61 _1yt4ze3t _9oik18uv _1bnx8stv _jf4cnqa1"
13
+ };
14
+
3
15
  /**
4
16
  * __Section message action__
5
17
  *
@@ -15,9 +27,27 @@ var SectionMessageAction = /*#__PURE__*/memo(function SectionMessageAction(_ref)
15
27
  href = _ref.href,
16
28
  testId = _ref.testId,
17
29
  linkComponent = _ref.linkComponent;
18
- // FIXME: This path doesn't make sense
19
- // If the intent of the design for this component is to use an action, not providing `href` or `onClick`
20
- // makes the use case invalid. This should be addressed.
30
+ if (!linkComponent && fg('platform_section_message_action_migration')) {
31
+ if (href) {
32
+ return /*#__PURE__*/React.createElement(Anchor, {
33
+ testId: testId,
34
+ onClick: onClick,
35
+ href: href,
36
+ xcss: cx(styles.common, styles.anchor)
37
+ }, children);
38
+ }
39
+ if (onClick) {
40
+ return /*#__PURE__*/React.createElement(Pressable, {
41
+ testId: testId,
42
+ onClick: onClick,
43
+ xcss: cx(styles.common, styles.pressable)
44
+ }, children);
45
+ }
46
+ return /*#__PURE__*/React.createElement(Box, {
47
+ as: "span",
48
+ testId: testId
49
+ }, children);
50
+ }
21
51
  return onClick || href ? /*#__PURE__*/React.createElement(Button, {
22
52
  testId: testId,
23
53
  appearance: "link",
@@ -27,5 +57,4 @@ var SectionMessageAction = /*#__PURE__*/memo(function SectionMessageAction(_ref)
27
57
  component: href ? linkComponent : undefined
28
58
  }, children) : /*#__PURE__*/React.createElement(React.Fragment, null, children);
29
59
  });
30
- SectionMessageAction.displayName = 'SectionMessageAction';
31
60
  export default SectionMessageAction;
@@ -12,7 +12,7 @@ var bleedStyles = xcss({
12
12
  });
13
13
  var contentStyles = xcss({
14
14
  color: 'color.text',
15
- font: "var(--ds-font-body, normal 400 14px/20px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)"
15
+ font: 'font.body'
16
16
  });
17
17
 
18
18
  /**
@@ -54,6 +54,11 @@ var SectionMessage = /*#__PURE__*/forwardRef(function SectionMessage(_ref, ref)
54
54
  size: "medium",
55
55
  primaryColor: primaryColor,
56
56
  secondaryColor: secondaryColor
57
+ // props for new icon
58
+ ,
59
+ LEGACY_size: "medium",
60
+ color: primaryColor,
61
+ spacing: "spacious"
57
62
  })), /*#__PURE__*/React.createElement(Stack, {
58
63
  space: "space.100",
59
64
  testId: testId && "".concat(testId, "--content")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/section-message",
3
- "version": "6.6.9",
3
+ "version": "6.8.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/"
@@ -28,7 +28,7 @@
28
28
  "team": "Design System Team",
29
29
  "website": {
30
30
  "name": "Section message",
31
- "category": "Components"
31
+ "category": "Messaging"
32
32
  },
33
33
  "runReact18": true
34
34
  },
@@ -41,11 +41,13 @@
41
41
  "dependencies": {
42
42
  "@atlaskit/button": "^20.3.0",
43
43
  "@atlaskit/codemod-utils": "^4.2.0",
44
+ "@atlaskit/css": "^0.6.0",
44
45
  "@atlaskit/heading": "^3.1.0",
45
- "@atlaskit/icon": "^22.24.0",
46
- "@atlaskit/primitives": "^13.2.0",
46
+ "@atlaskit/icon": "^22.28.0",
47
+ "@atlaskit/platform-feature-flags": "^0.3.0",
48
+ "@atlaskit/primitives": "^13.3.0",
47
49
  "@atlaskit/theme": "^14.0.0",
48
- "@atlaskit/tokens": "^2.2.0",
50
+ "@atlaskit/tokens": "^2.4.0",
49
51
  "@babel/runtime": "^7.0.0"
50
52
  },
51
53
  "peerDependencies": {
@@ -55,9 +57,10 @@
55
57
  "@af/accessibility-testing": "*",
56
58
  "@af/integration-testing": "*",
57
59
  "@atlaskit/analytics-next": "^10.1.0",
58
- "@atlaskit/ds-lib": "^3.2.0",
60
+ "@atlaskit/ds-lib": "^3.3.0",
59
61
  "@atlaskit/ssr": "*",
60
62
  "@atlaskit/visual-regression": "*",
63
+ "@atlassian/feature-flags-test-utils": "*",
61
64
  "@testing-library/react": "^12.1.5",
62
65
  "exenv": "^1.2.2",
63
66
  "jest-in-case": "^1.0.2",
@@ -88,5 +91,11 @@
88
91
  "deprecation": "no-deprecated-imports"
89
92
  }
90
93
  },
91
- "homepage": "https://atlassian.design/components/section-message/"
94
+ "homepage": "https://atlassian.design/components/section-message/",
95
+ "platform-feature-flags": {
96
+ "platform_section_message_action_migration": {
97
+ "type": "boolean",
98
+ "showOnWebsiteForTransitiveDependencies": true
99
+ }
100
+ }
92
101
  }