@atlaskit/section-message 6.1.1 → 6.1.5

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,30 @@
1
1
  # @atlaskit/section-message
2
2
 
3
+ ## 6.1.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [`f460cc7c411`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f460cc7c411) - Builds for this package now pass through a tokens babel plugin, removing runtime invocations of the tokens() function and improving bundle size.
8
+ - Updated dependencies
9
+
10
+ ## 6.1.4
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+
16
+ ## 6.1.3
17
+
18
+ ### Patch Changes
19
+
20
+ - Updated dependencies
21
+
22
+ ## 6.1.2
23
+
24
+ ### Patch Changes
25
+
26
+ - Updated dependencies
27
+
3
28
  ## 6.1.1
4
29
 
5
30
  ### Patch Changes
@@ -119,13 +119,13 @@ export const mapActionsProp = (
119
119
  ? `Atlaskit${SECTION_MESSAGE_ACTION_COMPONENT_NAME}`
120
120
  : SECTION_MESSAGE_ACTION_COMPONENT_NAME;
121
121
 
122
- let actionsAttributes = [];
122
+ let actionsAttributes: Collection<JSXAttribute> | null = null;
123
123
 
124
124
  source
125
125
  .findJSXElements(
126
126
  sectionMessageDefaultSpecifierName || sectionMessageDynamicImportName,
127
127
  )
128
- .forEach((element: ASTPath<JSXElement>) => {
128
+ .forEach((element) => {
129
129
  const linkComponentAttributeValue = transferLinkComponentProp(j, element);
130
130
  actionsAttributes = getJSXAttributesByName(j, element, ACTIONS_PROP_NAME);
131
131
 
@@ -185,26 +185,33 @@ export const mapActionsProp = (
185
185
  });
186
186
  });
187
187
 
188
- if (actionsAttributes.length > 0 && sectionMessageDefaultSpecifierName) {
189
- addSectionMessageActionImportSpecifier(j, source, sectionMessageActionName);
190
- }
191
-
192
- if (actionsAttributes.length > 0 && sectionMessageDynamicImportName) {
193
- addSectionMessageActionDynamicImport(
194
- j,
195
- source.find(j.VariableDeclaration).filter((variableDeclarationPath) => {
196
- return (
197
- j(variableDeclarationPath)
198
- .find(j.VariableDeclarator)
199
- .filter(
200
- (variableDeclaratorPath) =>
201
- variableDeclaratorPath.node.id.type === 'Identifier' &&
202
- variableDeclaratorPath.node.id.name ===
203
- sectionMessageDynamicImportName,
204
- ).length > 0
205
- );
206
- }),
207
- sectionMessageActionName,
208
- );
188
+ // @ts-ignore
189
+ if (actionsAttributes && actionsAttributes.length > 0) {
190
+ if (sectionMessageDefaultSpecifierName) {
191
+ addSectionMessageActionImportSpecifier(
192
+ j,
193
+ source,
194
+ sectionMessageActionName,
195
+ );
196
+ }
197
+
198
+ if (sectionMessageDynamicImportName) {
199
+ addSectionMessageActionDynamicImport(
200
+ j,
201
+ source.find(j.VariableDeclaration).filter((variableDeclarationPath) => {
202
+ return (
203
+ j(variableDeclarationPath)
204
+ .find(j.VariableDeclarator)
205
+ .filter(
206
+ (variableDeclaratorPath) =>
207
+ variableDeclaratorPath.node.id.type === 'Identifier' &&
208
+ variableDeclaratorPath.node.id.name ===
209
+ sectionMessageDynamicImportName,
210
+ ).length > 0
211
+ );
212
+ }),
213
+ sectionMessageActionName,
214
+ );
215
+ }
209
216
  }
210
217
  };
@@ -22,37 +22,35 @@ var _warning = _interopRequireDefault(require("@atlaskit/icon/glyph/warning"));
22
22
 
23
23
  var _colors = require("@atlaskit/theme/colors");
24
24
 
25
- var _tokens = require("@atlaskit/tokens");
26
-
27
25
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
28
26
 
29
27
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
30
28
 
31
29
  var appearanceIconSchema = {
32
30
  information: {
33
- backgroundColor: (0, _tokens.token)('color.background.subtleBrand.resting', _colors.B50),
31
+ backgroundColor: "var(--ds-background-subtleBrand-resting, ".concat(_colors.B50, ")"),
34
32
  Icon: _info.default,
35
- primaryIconColor: (0, _tokens.token)('color.iconBorder.brand', _colors.B500)
33
+ primaryIconColor: "var(--ds-iconBorder-brand, ".concat(_colors.B500, ")")
36
34
  },
37
35
  warning: {
38
- backgroundColor: (0, _tokens.token)('color.background.subtleWarning.resting', _colors.Y50),
36
+ backgroundColor: "var(--ds-background-subtleWarning-resting, ".concat(_colors.Y50, ")"),
39
37
  Icon: _warning.default,
40
- primaryIconColor: (0, _tokens.token)('color.iconBorder.warning', _colors.Y500)
38
+ primaryIconColor: "var(--ds-iconBorder-warning, ".concat(_colors.Y500, ")")
41
39
  },
42
40
  error: {
43
- backgroundColor: (0, _tokens.token)('color.background.subtleDanger.resting', _colors.R50),
41
+ backgroundColor: "var(--ds-background-subtleDanger-resting, ".concat(_colors.R50, ")"),
44
42
  Icon: _error.default,
45
- primaryIconColor: (0, _tokens.token)('color.iconBorder.danger', _colors.R500)
43
+ primaryIconColor: "var(--ds-iconBorder-danger, ".concat(_colors.R500, ")")
46
44
  },
47
45
  success: {
48
- backgroundColor: (0, _tokens.token)('color.background.subtleSuccess.resting', _colors.G50),
46
+ backgroundColor: "var(--ds-background-subtleSuccess-resting, ".concat(_colors.G50, ")"),
49
47
  Icon: _checkCircle.default,
50
- primaryIconColor: (0, _tokens.token)('color.iconBorder.success', _colors.G500)
48
+ primaryIconColor: "var(--ds-iconBorder-success, ".concat(_colors.G500, ")")
51
49
  },
52
50
  discovery: {
53
- backgroundColor: (0, _tokens.token)('color.background.subtleDiscovery.resting', _colors.P50),
51
+ backgroundColor: "var(--ds-background-subtleDiscovery-resting, ".concat(_colors.P50, ")"),
54
52
  Icon: _questionCircle.default,
55
- primaryIconColor: (0, _tokens.token)('color.iconBorder.discovery', _colors.P500)
53
+ primaryIconColor: "var(--ds-iconBorder-discovery, ".concat(_colors.P500, ")")
56
54
  }
57
55
  };
58
56
  exports.appearanceIconSchema = appearanceIconSchema;
@@ -17,8 +17,6 @@ var _colors = require("@atlaskit/theme/colors");
17
17
 
18
18
  var _constants = require("@atlaskit/theme/constants");
19
19
 
20
- var _tokens = require("@atlaskit/tokens");
21
-
22
20
  /** @jsx jsx */
23
21
  var actionsSeparatorWidth = (0, _constants.gridSize)() * 2;
24
22
  var actionStyles = (0, _core.css)({
@@ -29,7 +27,7 @@ var actionStyles = (0, _core.css)({
29
27
  '& + &::before': {
30
28
  display: 'inline-block',
31
29
  width: "".concat(actionsSeparatorWidth, "px"),
32
- color: "".concat((0, _tokens.token)('color.text.mediumEmphasis', _colors.N500)),
30
+ color: "".concat("var(--ds-text-mediumEmphasis, ".concat(_colors.N500, ")")),
33
31
  content: '"·"',
34
32
  textAlign: 'center',
35
33
  verticalAlign: 'middle'
@@ -23,8 +23,6 @@ var _constants = require("@atlaskit/theme/constants");
23
23
 
24
24
  var _typography = require("@atlaskit/theme/typography");
25
25
 
26
- var _tokens = require("@atlaskit/tokens");
27
-
28
26
  var _appearanceIcon = require("./internal/appearance-icon");
29
27
 
30
28
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -38,8 +36,8 @@ var containerPadding = spacing * 2;
38
36
  var actionMarginTop = spacing;
39
37
  var iconWrapperWidth = spacing * 5;
40
38
  var titleColor = {
41
- light: (0, _tokens.token)('color.text.highEmphasis', _colors.N800),
42
- dark: (0, _tokens.token)('color.text.highEmphasis', _colors.DN600)
39
+ light: "var(--ds-text-highEmphasis, ".concat(_colors.N800, ")"),
40
+ dark: "var(--ds-text-highEmphasis, ".concat(_colors.DN600, ")")
43
41
  };
44
42
  var containerStyles = (0, _core.css)({
45
43
  display: 'flex',
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/section-message",
3
- "version": "6.1.1",
3
+ "version": "6.1.5",
4
4
  "sideEffects": false
5
5
  }
@@ -4,32 +4,31 @@ import InfoIcon from '@atlaskit/icon/glyph/info';
4
4
  import QuestionCircleIcon from '@atlaskit/icon/glyph/question-circle';
5
5
  import WarningIcon from '@atlaskit/icon/glyph/warning';
6
6
  import { B50, B500, G50, G500, P50, P500, R50, R500, Y50, Y500 } from '@atlaskit/theme/colors';
7
- import { token } from '@atlaskit/tokens';
8
7
  export const appearanceIconSchema = {
9
8
  information: {
10
- backgroundColor: token('color.background.subtleBrand.resting', B50),
9
+ backgroundColor: `var(--ds-background-subtleBrand-resting, ${B50})`,
11
10
  Icon: InfoIcon,
12
- primaryIconColor: token('color.iconBorder.brand', B500)
11
+ primaryIconColor: `var(--ds-iconBorder-brand, ${B500})`
13
12
  },
14
13
  warning: {
15
- backgroundColor: token('color.background.subtleWarning.resting', Y50),
14
+ backgroundColor: `var(--ds-background-subtleWarning-resting, ${Y50})`,
16
15
  Icon: WarningIcon,
17
- primaryIconColor: token('color.iconBorder.warning', Y500)
16
+ primaryIconColor: `var(--ds-iconBorder-warning, ${Y500})`
18
17
  },
19
18
  error: {
20
- backgroundColor: token('color.background.subtleDanger.resting', R50),
19
+ backgroundColor: `var(--ds-background-subtleDanger-resting, ${R50})`,
21
20
  Icon: ErrorIcon,
22
- primaryIconColor: token('color.iconBorder.danger', R500)
21
+ primaryIconColor: `var(--ds-iconBorder-danger, ${R500})`
23
22
  },
24
23
  success: {
25
- backgroundColor: token('color.background.subtleSuccess.resting', G50),
24
+ backgroundColor: `var(--ds-background-subtleSuccess-resting, ${G50})`,
26
25
  Icon: CheckCircleIcon,
27
- primaryIconColor: token('color.iconBorder.success', G500)
26
+ primaryIconColor: `var(--ds-iconBorder-success, ${G500})`
28
27
  },
29
28
  discovery: {
30
- backgroundColor: token('color.background.subtleDiscovery.resting', P50),
29
+ backgroundColor: `var(--ds-background-subtleDiscovery-resting, ${P50})`,
31
30
  Icon: QuestionCircleIcon,
32
- primaryIconColor: token('color.iconBorder.discovery', P500)
31
+ primaryIconColor: `var(--ds-iconBorder-discovery, ${P500})`
33
32
  }
34
33
  };
35
34
  export function getAppearanceIconStyles(appearance, icon) {
@@ -4,7 +4,6 @@ import { css, jsx } from '@emotion/core';
4
4
  import Button from '@atlaskit/button/standard-button';
5
5
  import { N500 } from '@atlaskit/theme/colors';
6
6
  import { gridSize } from '@atlaskit/theme/constants';
7
- import { token } from '@atlaskit/tokens';
8
7
  const actionsSeparatorWidth = gridSize() * 2;
9
8
  const actionStyles = css({
10
9
  display: 'flex',
@@ -14,7 +13,7 @@ const actionStyles = css({
14
13
  '& + &::before': {
15
14
  display: 'inline-block',
16
15
  width: `${actionsSeparatorWidth}px`,
17
- color: `${token('color.text.mediumEmphasis', N500)}`,
16
+ color: `${`var(--ds-text-mediumEmphasis, ${N500})`}`,
18
17
  content: '"·"',
19
18
  textAlign: 'center',
20
19
  verticalAlign: 'middle'
@@ -7,7 +7,6 @@ import { DN600, N800 } from '@atlaskit/theme/colors';
7
7
  import GlobalTheme from '@atlaskit/theme/components';
8
8
  import { borderRadius, fontSize, gridSize } from '@atlaskit/theme/constants';
9
9
  import { headingSizes } from '@atlaskit/theme/typography';
10
- import { token } from '@atlaskit/tokens';
11
10
  import { getAppearanceIconStyles } from './internal/appearance-icon';
12
11
  const spacing = gridSize();
13
12
  const titleMarginBottom = spacing;
@@ -15,8 +14,8 @@ const containerPadding = spacing * 2;
15
14
  const actionMarginTop = spacing;
16
15
  const iconWrapperWidth = spacing * 5;
17
16
  const titleColor = {
18
- light: token('color.text.highEmphasis', N800),
19
- dark: token('color.text.highEmphasis', DN600)
17
+ light: `var(--ds-text-highEmphasis, ${N800})`,
18
+ dark: `var(--ds-text-highEmphasis, ${DN600})`
20
19
  };
21
20
  const containerStyles = css({
22
21
  display: 'flex',
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/section-message",
3
- "version": "6.1.1",
3
+ "version": "6.1.5",
4
4
  "sideEffects": false
5
5
  }
@@ -10,32 +10,31 @@ import InfoIcon from '@atlaskit/icon/glyph/info';
10
10
  import QuestionCircleIcon from '@atlaskit/icon/glyph/question-circle';
11
11
  import WarningIcon from '@atlaskit/icon/glyph/warning';
12
12
  import { B50, B500, G50, G500, P50, P500, R50, R500, Y50, Y500 } from '@atlaskit/theme/colors';
13
- import { token } from '@atlaskit/tokens';
14
13
  export var appearanceIconSchema = {
15
14
  information: {
16
- backgroundColor: token('color.background.subtleBrand.resting', B50),
15
+ backgroundColor: "var(--ds-background-subtleBrand-resting, ".concat(B50, ")"),
17
16
  Icon: InfoIcon,
18
- primaryIconColor: token('color.iconBorder.brand', B500)
17
+ primaryIconColor: "var(--ds-iconBorder-brand, ".concat(B500, ")")
19
18
  },
20
19
  warning: {
21
- backgroundColor: token('color.background.subtleWarning.resting', Y50),
20
+ backgroundColor: "var(--ds-background-subtleWarning-resting, ".concat(Y50, ")"),
22
21
  Icon: WarningIcon,
23
- primaryIconColor: token('color.iconBorder.warning', Y500)
22
+ primaryIconColor: "var(--ds-iconBorder-warning, ".concat(Y500, ")")
24
23
  },
25
24
  error: {
26
- backgroundColor: token('color.background.subtleDanger.resting', R50),
25
+ backgroundColor: "var(--ds-background-subtleDanger-resting, ".concat(R50, ")"),
27
26
  Icon: ErrorIcon,
28
- primaryIconColor: token('color.iconBorder.danger', R500)
27
+ primaryIconColor: "var(--ds-iconBorder-danger, ".concat(R500, ")")
29
28
  },
30
29
  success: {
31
- backgroundColor: token('color.background.subtleSuccess.resting', G50),
30
+ backgroundColor: "var(--ds-background-subtleSuccess-resting, ".concat(G50, ")"),
32
31
  Icon: CheckCircleIcon,
33
- primaryIconColor: token('color.iconBorder.success', G500)
32
+ primaryIconColor: "var(--ds-iconBorder-success, ".concat(G500, ")")
34
33
  },
35
34
  discovery: {
36
- backgroundColor: token('color.background.subtleDiscovery.resting', P50),
35
+ backgroundColor: "var(--ds-background-subtleDiscovery-resting, ".concat(P50, ")"),
37
36
  Icon: QuestionCircleIcon,
38
- primaryIconColor: token('color.iconBorder.discovery', P500)
37
+ primaryIconColor: "var(--ds-iconBorder-discovery, ".concat(P500, ")")
39
38
  }
40
39
  };
41
40
  export function getAppearanceIconStyles(appearance, icon) {
@@ -4,7 +4,6 @@ import { css, jsx } from '@emotion/core';
4
4
  import Button from '@atlaskit/button/standard-button';
5
5
  import { N500 } from '@atlaskit/theme/colors';
6
6
  import { gridSize } from '@atlaskit/theme/constants';
7
- import { token } from '@atlaskit/tokens';
8
7
  var actionsSeparatorWidth = gridSize() * 2;
9
8
  var actionStyles = css({
10
9
  display: 'flex',
@@ -14,7 +13,7 @@ var actionStyles = css({
14
13
  '& + &::before': {
15
14
  display: 'inline-block',
16
15
  width: "".concat(actionsSeparatorWidth, "px"),
17
- color: "".concat(token('color.text.mediumEmphasis', N500)),
16
+ color: "".concat("var(--ds-text-mediumEmphasis, ".concat(N500, ")")),
18
17
  content: '"·"',
19
18
  textAlign: 'center',
20
19
  verticalAlign: 'middle'
@@ -7,7 +7,6 @@ import { DN600, N800 } from '@atlaskit/theme/colors';
7
7
  import GlobalTheme from '@atlaskit/theme/components';
8
8
  import { borderRadius, fontSize, gridSize } from '@atlaskit/theme/constants';
9
9
  import { headingSizes } from '@atlaskit/theme/typography';
10
- import { token } from '@atlaskit/tokens';
11
10
  import { getAppearanceIconStyles } from './internal/appearance-icon';
12
11
  var spacing = gridSize();
13
12
  var titleMarginBottom = spacing;
@@ -15,8 +14,8 @@ var containerPadding = spacing * 2;
15
14
  var actionMarginTop = spacing;
16
15
  var iconWrapperWidth = spacing * 5;
17
16
  var titleColor = {
18
- light: token('color.text.highEmphasis', N800),
19
- dark: token('color.text.highEmphasis', DN600)
17
+ light: "var(--ds-text-highEmphasis, ".concat(N800, ")"),
18
+ dark: "var(--ds-text-highEmphasis, ".concat(DN600, ")")
20
19
  };
21
20
  var containerStyles = css({
22
21
  display: 'flex',
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/section-message",
3
- "version": "6.1.1",
3
+ "version": "6.1.5",
4
4
  "sideEffects": false
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/section-message",
3
- "version": "6.1.1",
3
+ "version": "6.1.5",
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/"
@@ -30,10 +30,10 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@atlaskit/button": "^16.1.0",
33
- "@atlaskit/codemod-utils": "^3.3.0",
34
- "@atlaskit/icon": "^21.8.0",
35
- "@atlaskit/theme": "^11.5.0",
36
- "@atlaskit/tokens": "^0.1.0",
33
+ "@atlaskit/codemod-utils": "^3.4.0",
34
+ "@atlaskit/icon": "^21.9.0",
35
+ "@atlaskit/theme": "^12.0.0",
36
+ "@atlaskit/tokens": "^0.4.0",
37
37
  "@babel/runtime": "^7.0.0",
38
38
  "@emotion/core": "^10.0.9"
39
39
  },
@@ -43,9 +43,9 @@
43
43
  "devDependencies": {
44
44
  "@atlaskit/analytics-next": "^8.1.2",
45
45
  "@atlaskit/build-utils": "*",
46
- "@atlaskit/code": "^14.0.0",
46
+ "@atlaskit/code": "^14.3.0",
47
47
  "@atlaskit/docs": "*",
48
- "@atlaskit/range": "^5.0.7",
48
+ "@atlaskit/range": "^5.1.0",
49
49
  "@atlaskit/ssr": "*",
50
50
  "@atlaskit/visual-regression": "*",
51
51
  "@atlaskit/webdriver-runner": "*",
@@ -66,7 +66,10 @@
66
66
  "@repo/internal": {
67
67
  "ui-components": "lite-mode",
68
68
  "analytics": "analytics-next",
69
- "styling": "emotion",
69
+ "styling": [
70
+ "static",
71
+ "emotion"
72
+ ],
70
73
  "theming": "tokens",
71
74
  "deprecation": "no-deprecated-imports"
72
75
  }