@atlaskit/section-message 6.1.10 → 6.1.13

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,34 @@
1
1
  # @atlaskit/section-message
2
2
 
3
+ ## 6.1.13
4
+
5
+ ### Patch Changes
6
+
7
+ - [`89a1b9b02d9`](https://bitbucket.org/atlassian/atlassian-frontend/commits/89a1b9b02d9) - [ux] - Actions will now wrap onto new lines rather than overflowing the edges, in cases where the actions are wider than the available width of the Section Message.
8
+
9
+ - Added test ID data attribute to actions list for testing purposes, using the existing `testId` prop.
10
+
11
+ - [`edafa2f6366`](https://bitbucket.org/atlassian/atlassian-frontend/commits/edafa2f6366) - [ux]
12
+
13
+ - Prevent long text overflowing the Section Message content box by utilising CSS property `word-break: break-word` to add line breaks. This applies to both the `title` and `children` props.
14
+ - Allow text truncation to work inside Section Message content area by adding `overflow: hidden` to the flex container. This is due to a quirk with how this property works within CSS flexbox.
15
+ - Added test ID data attribute to content container for testing purposes, using the existing `testId` prop.
16
+
17
+ - Updated dependencies
18
+
19
+ ## 6.1.12
20
+
21
+ ### Patch Changes
22
+
23
+ - Updated dependencies
24
+
25
+ ## 6.1.11
26
+
27
+ ### Patch Changes
28
+
29
+ - [`cb2392f6d33`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cb2392f6d33) - Upgrade to TypeScript 4.2.4
30
+ - Updated dependencies
31
+
3
32
  ## 6.1.10
4
33
 
5
34
  ### Patch Changes
@@ -24,7 +24,7 @@ var actionStyles = (0, _core.css)({
24
24
  margin: 0,
25
25
  alignItems: 'center',
26
26
  // eslint-disable-next-line @repo/internal/styles/no-nested-styles
27
- '& + &::before': {
27
+ '&:not(:last-child)::after': {
28
28
  display: 'inline-block',
29
29
  width: "".concat(actionsSeparatorWidth, "px"),
30
30
  color: "".concat("var(--ds-text-subtle, ".concat(_colors.N500, ")")),
@@ -45,7 +45,8 @@ var containerStyles = (0, _core.css)({
45
45
  borderRadius: "".concat((0, _constants.borderRadius)(), "px")
46
46
  });
47
47
  var contentContainerStyles = (0, _core.css)({
48
- flexGrow: 1
48
+ flexGrow: 1,
49
+ wordBreak: 'break-word'
49
50
  });
50
51
  var titleStyles = (0, _core.css)({
51
52
  margin: "0 0 ".concat(titleMarginBottom, "px"),
@@ -59,6 +60,7 @@ var actionsStyles = (0, _core.css)({
59
60
  display: 'flex',
60
61
  marginTop: "".concat(actionMarginTop, "px"),
61
62
  paddingLeft: 0,
63
+ flexWrap: 'wrap',
62
64
  listStyle: 'none'
63
65
  }); // If the icon is not wrapped in a div with a width, and we instead use margin or
64
66
  // padding, the icon is shrunk by the padding.
@@ -67,9 +69,8 @@ var actionsStyles = (0, _core.css)({
67
69
 
68
70
  var iconWrapperStyles = (0, _core.css)({
69
71
  display: 'flex',
70
- width: "".concat(iconWrapperWidth, "px"),
71
72
  margin: '-2px 0',
72
- flex: '0 0 auto'
73
+ flex: "0 0 ".concat(iconWrapperWidth, "px")
73
74
  });
74
75
  var SectionMessageWithMode = /*#__PURE__*/(0, _react.forwardRef)(function SectionMessage(_ref, ref) {
75
76
  var children = _ref.children,
@@ -110,12 +111,14 @@ var SectionMessageWithMode = /*#__PURE__*/(0, _react.forwardRef)(function Sectio
110
111
  primaryColor: primaryIconColor,
111
112
  secondaryColor: backgroundColor
112
113
  })), (0, _core.jsx)("div", {
113
- css: contentContainerStyles
114
+ css: contentContainerStyles,
115
+ "data-testid": testId && "".concat(testId, "--content")
114
116
  }, title ? (0, _core.jsx)("h1", {
115
117
  css: titleStyles,
116
118
  style: memoizedTitleColor
117
119
  }, title) : null, (0, _core.jsx)("div", null, children), actionsArray.length > 0 ? (0, _core.jsx)("ul", {
118
- css: actionsStyles
120
+ css: actionsStyles,
121
+ "data-testid": testId && "".concat(testId, "--actions")
119
122
  }, actionsArray) : null));
120
123
  });
121
124
  var SectionMessage = /*#__PURE__*/(0, _react.forwardRef)(function SectionMessage(props, ref) {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/section-message",
3
- "version": "6.1.10",
3
+ "version": "6.1.13",
4
4
  "sideEffects": false
5
5
  }
@@ -10,7 +10,7 @@ const actionStyles = css({
10
10
  margin: 0,
11
11
  alignItems: 'center',
12
12
  // eslint-disable-next-line @repo/internal/styles/no-nested-styles
13
- '& + &::before': {
13
+ '&:not(:last-child)::after': {
14
14
  display: 'inline-block',
15
15
  width: `${actionsSeparatorWidth}px`,
16
16
  color: `${`var(--ds-text-subtle, ${N500})`}`,
@@ -23,7 +23,8 @@ const containerStyles = css({
23
23
  borderRadius: `${borderRadius()}px`
24
24
  });
25
25
  const contentContainerStyles = css({
26
- flexGrow: 1
26
+ flexGrow: 1,
27
+ wordBreak: 'break-word'
27
28
  });
28
29
  const titleStyles = css({
29
30
  margin: `0 0 ${titleMarginBottom}px`,
@@ -37,6 +38,7 @@ const actionsStyles = css({
37
38
  display: 'flex',
38
39
  marginTop: `${actionMarginTop}px`,
39
40
  paddingLeft: 0,
41
+ flexWrap: 'wrap',
40
42
  listStyle: 'none'
41
43
  }); // If the icon is not wrapped in a div with a width, and we instead use margin or
42
44
  // padding, the icon is shrunk by the padding.
@@ -45,9 +47,8 @@ const actionsStyles = css({
45
47
 
46
48
  const iconWrapperStyles = css({
47
49
  display: 'flex',
48
- width: `${iconWrapperWidth}px`,
49
50
  margin: '-2px 0',
50
- flex: '0 0 auto'
51
+ flex: `0 0 ${iconWrapperWidth}px`
51
52
  });
52
53
  const SectionMessageWithMode = /*#__PURE__*/forwardRef(function SectionMessage({
53
54
  children,
@@ -81,12 +82,14 @@ const SectionMessageWithMode = /*#__PURE__*/forwardRef(function SectionMessage({
81
82
  primaryColor: primaryIconColor,
82
83
  secondaryColor: backgroundColor
83
84
  })), jsx("div", {
84
- css: contentContainerStyles
85
+ css: contentContainerStyles,
86
+ "data-testid": testId && `${testId}--content`
85
87
  }, title ? jsx("h1", {
86
88
  css: titleStyles,
87
89
  style: memoizedTitleColor
88
90
  }, title) : null, jsx("div", null, children), actionsArray.length > 0 ? jsx("ul", {
89
- css: actionsStyles
91
+ css: actionsStyles,
92
+ "data-testid": testId && `${testId}--actions`
90
93
  }, actionsArray) : null));
91
94
  });
92
95
  const SectionMessage = /*#__PURE__*/forwardRef(function SectionMessage(props, ref) {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/section-message",
3
- "version": "6.1.10",
3
+ "version": "6.1.13",
4
4
  "sideEffects": false
5
5
  }
@@ -10,7 +10,7 @@ var actionStyles = css({
10
10
  margin: 0,
11
11
  alignItems: 'center',
12
12
  // eslint-disable-next-line @repo/internal/styles/no-nested-styles
13
- '& + &::before': {
13
+ '&:not(:last-child)::after': {
14
14
  display: 'inline-block',
15
15
  width: "".concat(actionsSeparatorWidth, "px"),
16
16
  color: "".concat("var(--ds-text-subtle, ".concat(N500, ")")),
@@ -23,7 +23,8 @@ var containerStyles = css({
23
23
  borderRadius: "".concat(borderRadius(), "px")
24
24
  });
25
25
  var contentContainerStyles = css({
26
- flexGrow: 1
26
+ flexGrow: 1,
27
+ wordBreak: 'break-word'
27
28
  });
28
29
  var titleStyles = css({
29
30
  margin: "0 0 ".concat(titleMarginBottom, "px"),
@@ -37,6 +38,7 @@ var actionsStyles = css({
37
38
  display: 'flex',
38
39
  marginTop: "".concat(actionMarginTop, "px"),
39
40
  paddingLeft: 0,
41
+ flexWrap: 'wrap',
40
42
  listStyle: 'none'
41
43
  }); // If the icon is not wrapped in a div with a width, and we instead use margin or
42
44
  // padding, the icon is shrunk by the padding.
@@ -45,9 +47,8 @@ var actionsStyles = css({
45
47
 
46
48
  var iconWrapperStyles = css({
47
49
  display: 'flex',
48
- width: "".concat(iconWrapperWidth, "px"),
49
50
  margin: '-2px 0',
50
- flex: '0 0 auto'
51
+ flex: "0 0 ".concat(iconWrapperWidth, "px")
51
52
  });
52
53
  var SectionMessageWithMode = /*#__PURE__*/forwardRef(function SectionMessage(_ref, ref) {
53
54
  var children = _ref.children,
@@ -86,12 +87,14 @@ var SectionMessageWithMode = /*#__PURE__*/forwardRef(function SectionMessage(_re
86
87
  primaryColor: primaryIconColor,
87
88
  secondaryColor: backgroundColor
88
89
  })), jsx("div", {
89
- css: contentContainerStyles
90
+ css: contentContainerStyles,
91
+ "data-testid": testId && "".concat(testId, "--content")
90
92
  }, title ? jsx("h1", {
91
93
  css: titleStyles,
92
94
  style: memoizedTitleColor
93
95
  }, title) : null, jsx("div", null, children), actionsArray.length > 0 ? jsx("ul", {
94
- css: actionsStyles
96
+ css: actionsStyles,
97
+ "data-testid": testId && "".concat(testId, "--actions")
95
98
  }, actionsArray) : null));
96
99
  });
97
100
  var SectionMessage = /*#__PURE__*/forwardRef(function SectionMessage(props, ref) {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/section-message",
3
- "version": "6.1.10",
3
+ "version": "6.1.13",
4
4
  "sideEffects": false
5
5
  }
@@ -9,7 +9,7 @@ export declare const appearanceIconSchema: {
9
9
  [key in Appearance]: AppearanceIconSchema;
10
10
  };
11
11
  export declare function getAppearanceIconStyles(appearance: Appearance, icon: SectionMessageProps['icon']): {
12
- Icon: import("react").ElementType<any>;
12
+ Icon: "symbol" | "object" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "big" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "link" | "main" | "map" | "mark" | "menu" | "menuitem" | "meta" | "meter" | "nav" | "noindex" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "small" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "webview" | "svg" | "animate" | "animateMotion" | "animateTransform" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "mpath" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "switch" | "text" | "textPath" | "tspan" | "use" | "view" | import("react").ComponentClass<any, any> | import("react").FunctionComponent<any>;
13
13
  backgroundColor: string;
14
14
  primaryIconColor: string;
15
15
  };
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@atlaskit/section-message",
3
- "version": "6.1.10",
3
+ "version": "6.1.13",
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/"
7
7
  },
8
- "repository": "https://bitbucket.org/atlassian/atlassian-frontend",
8
+ "repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
9
9
  "author": "Atlassian Pty Ltd",
10
10
  "license": "Apache-2.0",
11
11
  "main": "dist/cjs/index.js",
@@ -28,11 +28,11 @@
28
28
  ".": "./src/index.ts"
29
29
  },
30
30
  "dependencies": {
31
- "@atlaskit/button": "^16.2.0",
32
- "@atlaskit/codemod-utils": "^4.0.0",
31
+ "@atlaskit/button": "^16.3.0",
32
+ "@atlaskit/codemod-utils": "^4.1.0",
33
33
  "@atlaskit/icon": "^21.10.0",
34
34
  "@atlaskit/theme": "^12.1.0",
35
- "@atlaskit/tokens": "^0.9.0",
35
+ "@atlaskit/tokens": "^0.10.0",
36
36
  "@babel/runtime": "^7.0.0",
37
37
  "@emotion/core": "^10.0.9"
38
38
  },
@@ -55,7 +55,7 @@
55
55
  "react-dom": "^16.8.0",
56
56
  "react-test-renderer": "^16.8.0",
57
57
  "storybook-addon-performance": "^0.16.0",
58
- "typescript": "3.9.10"
58
+ "typescript": "4.2.4"
59
59
  },
60
60
  "techstack": {
61
61
  "@atlassian/frontend": {
@@ -3,5 +3,6 @@
3
3
  "main": "../dist/cjs/entry-points/section-message.js",
4
4
  "module": "../dist/esm/entry-points/section-message.js",
5
5
  "module:es2019": "../dist/es2019/entry-points/section-message.js",
6
+ "sideEffects": false,
6
7
  "types": "../dist/types/entry-points/section-message.d.ts"
7
8
  }
@@ -3,5 +3,6 @@
3
3
  "main": "../dist/cjs/entry-points/section-message-action.js",
4
4
  "module": "../dist/esm/entry-points/section-message-action.js",
5
5
  "module:es2019": "../dist/es2019/entry-points/section-message-action.js",
6
+ "sideEffects": false,
6
7
  "types": "../dist/types/entry-points/section-message-action.d.ts"
7
8
  }
@@ -3,5 +3,6 @@
3
3
  "main": "../dist/cjs/entry-points/types.js",
4
4
  "module": "../dist/esm/entry-points/types.js",
5
5
  "module:es2019": "../dist/es2019/entry-points/types.js",
6
+ "sideEffects": false,
6
7
  "types": "../dist/types/entry-points/types.d.ts"
7
8
  }