@atlaskit/section-message 8.0.0 → 8.0.1

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,13 @@
1
1
  # @atlaskit/section-message
2
2
 
3
+ ## 8.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#120710](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/120710)
8
+ [`f463409dcaaf5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f463409dcaaf5) -
9
+ Remove old codemod and update dependencies.
10
+
3
11
  ## 8.0.0
4
12
 
5
13
  ### Major Changes
@@ -4,7 +4,6 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.appearanceIconSchema = void 0;
8
7
  exports.getAppearanceIconStyles = getAppearanceIconStyles;
9
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
9
  var _react = _interopRequireDefault(require("react"));
@@ -16,7 +15,7 @@ var _warning = _interopRequireDefault(require("@atlaskit/icon/glyph/warning"));
16
15
  var _colors = require("@atlaskit/theme/colors");
17
16
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
18
17
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
19
- var appearanceIconSchema = exports.appearanceIconSchema = {
18
+ var appearanceIconSchema = {
20
19
  information: {
21
20
  backgroundColor: "var(--ds-background-information, ".concat(_colors.B50, ")"),
22
21
  Icon: _info.default,
@@ -5,7 +5,7 @@ import InfoIcon from '@atlaskit/icon/glyph/info';
5
5
  import QuestionCircleIcon from '@atlaskit/icon/glyph/question-circle';
6
6
  import WarningIcon from '@atlaskit/icon/glyph/warning';
7
7
  import { B50, B500, G50, G500, P50, P500, R50, R500, Y50, Y500 } from '@atlaskit/theme/colors';
8
- export const appearanceIconSchema = {
8
+ const appearanceIconSchema = {
9
9
  information: {
10
10
  backgroundColor: `var(--ds-background-information, ${B50})`,
11
11
  Icon: InfoIcon,
@@ -8,7 +8,7 @@ import InfoIcon from '@atlaskit/icon/glyph/info';
8
8
  import QuestionCircleIcon from '@atlaskit/icon/glyph/question-circle';
9
9
  import WarningIcon from '@atlaskit/icon/glyph/warning';
10
10
  import { B50, B500, G50, G500, P50, P500, R50, R500, Y50, Y500 } from '@atlaskit/theme/colors';
11
- export var appearanceIconSchema = {
11
+ var appearanceIconSchema = {
12
12
  information: {
13
13
  backgroundColor: "var(--ds-background-information, ".concat(B50, ")"),
14
14
  Icon: InfoIcon,
@@ -1,13 +1,5 @@
1
- import React, { type ComponentType } from 'react';
1
+ import React from 'react';
2
2
  import type { Appearance, SectionMessageProps } from '../types';
3
- interface AppearanceIconSchema {
4
- backgroundColor: string;
5
- primaryIconColor: string;
6
- Icon: ComponentType<any>;
7
- }
8
- export declare const appearanceIconSchema: {
9
- [key in Appearance]: AppearanceIconSchema;
10
- };
11
3
  export declare function getAppearanceIconStyles(appearance: Appearance, icon: SectionMessageProps['icon']): {
12
4
  Icon: React.ElementType<any, keyof React.JSX.IntrinsicElements> | (({ size, primaryColor, secondaryColor, }: {
13
5
  size: string;
@@ -17,4 +9,3 @@ export declare function getAppearanceIconStyles(appearance: Appearance, icon: Se
17
9
  backgroundColor: string;
18
10
  primaryIconColor: string;
19
11
  };
20
- export {};
@@ -1,13 +1,5 @@
1
- import React, { type ComponentType } from 'react';
1
+ import React from 'react';
2
2
  import type { Appearance, SectionMessageProps } from '../types';
3
- interface AppearanceIconSchema {
4
- backgroundColor: string;
5
- primaryIconColor: string;
6
- Icon: ComponentType<any>;
7
- }
8
- export declare const appearanceIconSchema: {
9
- [key in Appearance]: AppearanceIconSchema;
10
- };
11
3
  export declare function getAppearanceIconStyles(appearance: Appearance, icon: SectionMessageProps['icon']): {
12
4
  Icon: React.ElementType<any, keyof React.JSX.IntrinsicElements> | (({ size, primaryColor, secondaryColor, }: {
13
5
  size: string;
@@ -17,4 +9,3 @@ export declare function getAppearanceIconStyles(appearance: Appearance, icon: Se
17
9
  backgroundColor: string;
18
10
  primaryIconColor: string;
19
11
  };
20
- export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/section-message",
3
- "version": "8.0.0",
3
+ "version": "8.0.1",
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/"
@@ -39,15 +39,15 @@
39
39
  ".": "./src/index.tsx"
40
40
  },
41
41
  "dependencies": {
42
- "@atlaskit/button": "^21.0.0",
42
+ "@atlaskit/button": "^21.1.0",
43
43
  "@atlaskit/codemod-utils": "^4.2.0",
44
44
  "@atlaskit/css": "^0.10.0",
45
- "@atlaskit/heading": "^5.0.0",
46
- "@atlaskit/icon": "^24.0.0",
45
+ "@atlaskit/heading": "^5.1.0",
46
+ "@atlaskit/icon": "^24.1.0",
47
47
  "@atlaskit/platform-feature-flags": "^1.1.0",
48
- "@atlaskit/primitives": "^14.0.0",
48
+ "@atlaskit/primitives": "^14.1.0",
49
49
  "@atlaskit/theme": "^17.0.0",
50
- "@atlaskit/tokens": "^4.0.0",
50
+ "@atlaskit/tokens": "^4.2.0",
51
51
  "@babel/runtime": "^7.0.0"
52
52
  },
53
53
  "peerDependencies": {
@@ -56,16 +56,18 @@
56
56
  "devDependencies": {
57
57
  "@af/accessibility-testing": "*",
58
58
  "@af/integration-testing": "*",
59
+ "@af/visual-regression": "*",
59
60
  "@atlaskit/analytics-next": "^11.0.0",
61
+ "@atlaskit/code": "^16.0.0",
62
+ "@atlaskit/docs": "*",
60
63
  "@atlaskit/ds-lib": "^4.0.0",
64
+ "@atlaskit/form": "^12.0.0",
65
+ "@atlaskit/link": "*",
66
+ "@atlaskit/range": "^9.0.0",
61
67
  "@atlaskit/ssr": "*",
62
- "@atlaskit/visual-regression": "*",
63
68
  "@atlassian/feature-flags-test-utils": "*",
64
69
  "@testing-library/react": "^13.4.0",
65
- "exenv": "^1.2.2",
66
- "jscodeshift": "^0.13.0",
67
70
  "react-dom": "^18.2.0",
68
- "storybook-addon-performance": "^0.17.3",
69
71
  "typescript": "~5.4.2"
70
72
  },
71
73
  "techstack": {
@@ -1,18 +0,0 @@
1
- import { type JSCodeshift } from 'jscodeshift';
2
- import { type Collection } from 'jscodeshift/src/Collection';
3
-
4
- import { createTransformer, hasImportDeclaration } from '@atlaskit/codemod-utils';
5
-
6
- import { changeAppearanceProp } from './internal/change-appearance-prop';
7
- import { SECTION_MESSAGE_PACKAGE_NAME } from './internal/constants';
8
- import { mapActionsProp } from './internal/map-actions-prop';
9
- import { hasDynamicImport } from './internal/utils';
10
-
11
- const transformer = createTransformer(
12
- [changeAppearanceProp, mapActionsProp],
13
- (j: JSCodeshift, source: Collection<Node>) =>
14
- hasImportDeclaration(j, source, SECTION_MESSAGE_PACKAGE_NAME) ||
15
- hasDynamicImport(j, source, SECTION_MESSAGE_PACKAGE_NAME),
16
- );
17
-
18
- export default transformer;
@@ -1,320 +0,0 @@
1
- import transformer from '../6.0.0-lite-mode';
2
-
3
- const defineInlineTest = require('jscodeshift/dist/testUtils').defineInlineTest;
4
-
5
- describe('section message codemod', () => {
6
- defineInlineTest(
7
- { default: transformer, parser: 'tsx' },
8
- {},
9
- `
10
- import React from "react";
11
- import SectionMessage from "@atlaskit/section-message";
12
-
13
- const actions = [
14
- { text: 'Action 1', key: '1', testId: 'one' },
15
- { text: 'Action 2', key: '2' },
16
- { text: 'Action 3', key: '3' },
17
- { text: 'Action 4', key: '4' },
18
- ];
19
-
20
- export default () => (
21
- <SectionMessage
22
- appearance="confirmation"
23
- actions={actions}
24
- />
25
- );
26
- `,
27
- `
28
- import React from "react";
29
- import SectionMessage, { SectionMessageAction } from "@atlaskit/section-message";
30
-
31
- const actions = [
32
- { text: 'Action 1', key: '1', testId: 'one' },
33
- { text: 'Action 2', key: '2' },
34
- { text: 'Action 3', key: '3' },
35
- { text: 'Action 4', key: '4' },
36
- ];
37
-
38
- export default () => (
39
- <SectionMessage
40
- appearance="success"
41
- actions={actions.map((
42
- {
43
- text,
44
- ...restAction
45
- }
46
- ) => <SectionMessageAction {...restAction}>{text}</SectionMessageAction>)}
47
- />
48
- );
49
- `,
50
- 'should transform both appearance and actions prop',
51
- );
52
-
53
- defineInlineTest(
54
- { default: transformer, parser: 'tsx' },
55
- {},
56
- `
57
- import React from "react";
58
- import SectionMessage from "@atlaskit/section-message";
59
-
60
- const actions = [
61
- { text: 'Action 1', key: '1', testId: 'one' },
62
- { text: 'Action 2', key: '2' },
63
- { text: 'Action 3', key: '3' },
64
- { text: 'Action 4', key: '4' },
65
- ];
66
-
67
- export default () => (
68
- <SectionMessage
69
- actions={actions}
70
- appearance="info"
71
- />
72
- );
73
- `,
74
- `
75
- import React from "react";
76
- import SectionMessage, { SectionMessageAction } from "@atlaskit/section-message";
77
-
78
- const actions = [
79
- { text: 'Action 1', key: '1', testId: 'one' },
80
- { text: 'Action 2', key: '2' },
81
- { text: 'Action 3', key: '3' },
82
- { text: 'Action 4', key: '4' },
83
- ];
84
-
85
- export default () => (
86
- <SectionMessage
87
- actions={actions.map((
88
- {
89
- text,
90
- ...restAction
91
- }
92
- ) => <SectionMessageAction {...restAction}>{text}</SectionMessageAction>)}
93
- appearance="information"
94
- />
95
- );
96
- `,
97
- 'should transform both appearance and actions prop when arranged in different order',
98
- );
99
-
100
- defineInlineTest(
101
- { default: transformer, parser: 'tsx' },
102
- {},
103
- `
104
- import React from "react";
105
- import SectionMessage from "@atlaskit/section-message";
106
-
107
- const actions = [
108
- { text: 'Action 1', key: '1', testId: 'one' },
109
- { text: 'Action 2', key: '2' },
110
- { text: 'Action 3', key: '3' },
111
- { text: 'Action 4', key: '4' },
112
- ];
113
-
114
- export default () => (
115
- <SectionMessage
116
- actions={actions}
117
- title="hello"
118
- appearance="info"
119
- />
120
- );
121
- `,
122
- `
123
- import React from "react";
124
- import SectionMessage, { SectionMessageAction } from "@atlaskit/section-message";
125
-
126
- const actions = [
127
- { text: 'Action 1', key: '1', testId: 'one' },
128
- { text: 'Action 2', key: '2' },
129
- { text: 'Action 3', key: '3' },
130
- { text: 'Action 4', key: '4' },
131
- ];
132
-
133
- export default () => (
134
- <SectionMessage
135
- actions={actions.map((
136
- {
137
- text,
138
- ...restAction
139
- }
140
- ) => <SectionMessageAction {...restAction}>{text}</SectionMessageAction>)}
141
- title="hello"
142
- appearance="information"
143
- />
144
- );
145
- `,
146
- 'should transform both appearance and actions prop when a prop is in between them',
147
- );
148
-
149
- defineInlineTest(
150
- { default: transformer, parser: 'tsx' },
151
- {},
152
- `
153
- import React from "react";
154
- import SectionMessage from "@atlaskit/section-message";
155
-
156
- const actions = [
157
- { text: 'Action 1', key: '1', testId: 'one' },
158
- { text: 'Action 2', key: '2' },
159
- { text: 'Action 3', key: '3' },
160
- { text: 'Action 4', key: '4' },
161
- ];
162
-
163
- export default () => (
164
- <SectionMessage
165
- title="hello"
166
- appearance="info"
167
- />
168
- );
169
- `,
170
- `
171
- import React from "react";
172
- import SectionMessage from "@atlaskit/section-message";
173
-
174
- const actions = [
175
- { text: 'Action 1', key: '1', testId: 'one' },
176
- { text: 'Action 2', key: '2' },
177
- { text: 'Action 3', key: '3' },
178
- { text: 'Action 4', key: '4' },
179
- ];
180
-
181
- export default () => (
182
- <SectionMessage
183
- title="hello"
184
- appearance="information"
185
- />
186
- );
187
- `,
188
- 'should transform only appearance prop',
189
- );
190
-
191
- defineInlineTest(
192
- { default: transformer, parser: 'tsx' },
193
- {},
194
- `
195
- import React from "react";
196
- import SectionMessage from "@atlaskit/section-message";
197
-
198
- const actions = [
199
- { text: 'Action 1', key: '1', testId: 'one' },
200
- { text: 'Action 2', key: '2' },
201
- { text: 'Action 3', key: '3' },
202
- { text: 'Action 4', key: '4' },
203
- ];
204
-
205
- export default () => (
206
- <SectionMessage
207
- actions={actions}
208
- title="hello"
209
- />
210
- );
211
- `,
212
- `
213
- import React from "react";
214
- import SectionMessage, { SectionMessageAction } from "@atlaskit/section-message";
215
-
216
- const actions = [
217
- { text: 'Action 1', key: '1', testId: 'one' },
218
- { text: 'Action 2', key: '2' },
219
- { text: 'Action 3', key: '3' },
220
- { text: 'Action 4', key: '4' },
221
- ];
222
-
223
- export default () => (
224
- <SectionMessage
225
- actions={actions.map((
226
- {
227
- text,
228
- ...restAction
229
- }
230
- ) => <SectionMessageAction {...restAction}>{text}</SectionMessageAction>)}
231
- title="hello"
232
- />
233
- );
234
- `,
235
- 'should transform only actions prop',
236
- );
237
-
238
- defineInlineTest(
239
- { default: transformer, parser: 'tsx' },
240
- {},
241
- `
242
- import React from "react";
243
- import SectionMessage from "@atlaskit/section-message";
244
-
245
- const actions = [
246
- { text: 'Action 1', key: '1', testId: 'one' },
247
- { text: 'Action 2', key: '2' },
248
- { text: 'Action 3', key: '3' },
249
- { text: 'Action 4', key: '4' },
250
- ];
251
-
252
- const CustomLink = <a>hello</a>;
253
-
254
- export default () => (
255
- <SectionMessage
256
- actions={actions}
257
- linkComponent={CustomLink}
258
- title="hello"
259
- appearance="info"
260
- />
261
- );
262
- `,
263
- `
264
- import React from "react";
265
- import SectionMessage, { SectionMessageAction } from "@atlaskit/section-message";
266
-
267
- const actions = [
268
- { text: 'Action 1', key: '1', testId: 'one' },
269
- { text: 'Action 2', key: '2' },
270
- { text: 'Action 3', key: '3' },
271
- { text: 'Action 4', key: '4' },
272
- ];
273
-
274
- const CustomLink = <a>hello</a>;
275
-
276
- export default () => (
277
- <SectionMessage
278
- actions={actions.map((
279
- {
280
- text,
281
- ...restAction
282
- }
283
- ) => <SectionMessageAction linkComponent={CustomLink} {...restAction}>{text}</SectionMessageAction>)}
284
- title="hello"
285
- appearance="information" />
286
- );
287
- `,
288
- 'should transform both appearance and actions prop and move linkComponent to "SectionMessageAction"',
289
- );
290
-
291
- defineInlineTest(
292
- { default: transformer, parser: 'tsx' },
293
- {},
294
- `
295
- import React from "react";
296
- import SectionMessage from "@atlaskit/section-message";
297
-
298
- const CustomLink = <a>hello</a>;
299
-
300
- export default () => (
301
- <SectionMessage
302
- linkComponent={CustomLink}
303
- title="hello"
304
- appearance="info"
305
- />
306
- );
307
- `,
308
- `
309
- import React from "react";
310
- import SectionMessage from "@atlaskit/section-message";
311
-
312
- const CustomLink = <a>hello</a>;
313
-
314
- export default () => (
315
- <SectionMessage title="hello" appearance="information" />
316
- );
317
- `,
318
- 'should transform appearance prop and remove linkComponent prop if no actions prop is present',
319
- );
320
- });