@atlaskit/select 20.0.0 → 20.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/select
2
2
 
3
+ ## 20.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#120713](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/120713)
8
+ [`acea5ba3fdbdb`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/acea5ba3fdbdb) -
9
+ Remove old codemod and update dependencies.
10
+
3
11
  ## 20.0.0
4
12
 
5
13
  ### Major Changes
@@ -11,7 +11,7 @@ var _createSelect = _interopRequireDefault(require("./createSelect"));
11
11
  /* eslint-disable @repo/internal/react/require-jsdoc */
12
12
 
13
13
  var packageName = "@atlaskit/select";
14
- var packageVersion = "20.0.0";
14
+ var packageVersion = "20.0.1";
15
15
  var SelectWithoutAnalytics = exports.SelectWithoutAnalytics = (0, _createSelect.default)(_async.default);
16
16
  var createAndFireEventOnAtlaskit = (0, _analyticsNext.createAndFireEvent)('atlaskit');
17
17
  var Select = (0, _analyticsNext.withAnalyticsContext)({
@@ -3,8 +3,10 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.groupedCountries = exports.allCountries = void 0;
7
- var allCountries = exports.allCountries = [{
6
+ exports.groupedCountries = void 0;
7
+ // eslint-disable-next-line @repo/internal/fs/filename-pattern-match
8
+
9
+ var allCountries = [{
8
10
  icon: '🇦🇫',
9
11
  name: 'Afghanistan',
10
12
  abbr: 'AF',
@@ -3,7 +3,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
3
3
  import AsyncSelect from '@atlaskit/react-select/async';
4
4
  import createSelect from './createSelect';
5
5
  const packageName = "@atlaskit/select";
6
- const packageVersion = "20.0.0";
6
+ const packageVersion = "20.0.1";
7
7
  export const SelectWithoutAnalytics = createSelect(AsyncSelect);
8
8
  const createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
9
9
  const Select = withAnalyticsContext({
@@ -1,4 +1,6 @@
1
- export const allCountries = [{
1
+ // eslint-disable-next-line @repo/internal/fs/filename-pattern-match
2
+
3
+ const allCountries = [{
2
4
  icon: '🇦🇫',
3
5
  name: 'Afghanistan',
4
6
  abbr: 'AF',
@@ -3,7 +3,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
3
3
  import AsyncSelect from '@atlaskit/react-select/async';
4
4
  import createSelect from './createSelect';
5
5
  var packageName = "@atlaskit/select";
6
- var packageVersion = "20.0.0";
6
+ var packageVersion = "20.0.1";
7
7
  export var SelectWithoutAnalytics = createSelect(AsyncSelect);
8
8
  var createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
9
9
  var Select = withAnalyticsContext({
@@ -1,4 +1,6 @@
1
- export var allCountries = [{
1
+ // eslint-disable-next-line @repo/internal/fs/filename-pattern-match
2
+
3
+ var allCountries = [{
2
4
  icon: '🇦🇫',
3
5
  name: 'Afghanistan',
4
6
  abbr: 'AF',
@@ -5,7 +5,6 @@ interface Country {
5
5
  name: string;
6
6
  suggested?: boolean;
7
7
  }
8
- export declare const allCountries: Array<Country>;
9
8
  export declare const groupedCountries: readonly [{
10
9
  readonly label: "Suggested";
11
10
  readonly options: Country[];
@@ -5,7 +5,6 @@ interface Country {
5
5
  name: string;
6
6
  suggested?: boolean;
7
7
  }
8
- export declare const allCountries: Array<Country>;
9
8
  export declare const groupedCountries: readonly [
10
9
  {
11
10
  readonly label: "Suggested";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/select",
3
- "version": "20.0.0",
3
+ "version": "20.0.1",
4
4
  "description": "Select allows users to make a single selection or multiple selections from a list of options.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -56,7 +56,6 @@
56
56
  "@popperjs/core": "^2.11.8",
57
57
  "bind-event-listener": "^3.0.0",
58
58
  "react-focus-lock": "^2.9.5",
59
- "react-node-resolver": "^1.0.1",
60
59
  "react-popper": "^2.3.0",
61
60
  "shallow-equal": "^3.1.0"
62
61
  },
@@ -68,19 +67,24 @@
68
67
  "@af/accessibility-testing": "*",
69
68
  "@af/integration-testing": "*",
70
69
  "@af/visual-regression": "*",
70
+ "@atlaskit/button": "^21.1.1",
71
71
  "@atlaskit/checkbox": "^17.0.0",
72
+ "@atlaskit/docs": "*",
73
+ "@atlaskit/drawer": "^10.0.1",
74
+ "@atlaskit/form": "^12.0.0",
75
+ "@atlaskit/link": "*",
76
+ "@atlaskit/logo": "^16.0.0",
72
77
  "@atlaskit/modal-dialog": "^13.0.0",
73
78
  "@atlaskit/radio": "^8.0.0",
79
+ "@atlaskit/section-message": "*",
74
80
  "@atlaskit/ssr": "*",
75
- "@atlaskit/visual-regression": "*",
76
- "@atlassian/feature-flags-test-utils": "*",
77
81
  "@testing-library/react": "^13.4.0",
78
82
  "@testing-library/user-event": "^14.4.3",
79
83
  "ast-types": "^0.13.3",
84
+ "jest-in-case": "^1.0.2",
80
85
  "jscodeshift": "^0.13.0",
81
86
  "react-dom": "^18.2.0",
82
87
  "react-select-event": "^5.5.0",
83
- "react-value": "^0.2.0",
84
88
  "typescript": "~5.4.2"
85
89
  },
86
90
  "techstack": {
@@ -1,98 +0,0 @@
1
- import {
2
- addCommentToStartOfFile,
3
- getJSXAttributesByName,
4
- getSpecifierName,
5
- hasImportDeclaration,
6
- isUsingProp,
7
- } from './utils/helpers';
8
-
9
- import {
10
- type default as core,
11
- type API,
12
- type ASTPath,
13
- type FileInfo,
14
- type JSXElement,
15
- type Options,
16
- } from 'jscodeshift';
17
- import { type Collection } from 'jscodeshift/src/Collection';
18
-
19
- function updatePopperProps(j: core.JSCodeshift, source: Collection<any>, specifier: string) {
20
- source.findJSXElements(specifier).forEach((path: ASTPath<JSXElement>) => {
21
- if (
22
- isUsingProp({
23
- j,
24
- base: source,
25
- element: path,
26
- propName: 'popperProps',
27
- })
28
- ) {
29
- // Get value from prop
30
- getJSXAttributesByName({
31
- j,
32
- element: path,
33
- attributeName: 'popperProps',
34
- }).forEach((attribute) => {
35
- // convert positionFixed
36
- j(attribute)
37
- .find(j.JSXExpressionContainer)
38
- .find(j.ObjectExpression)
39
- .find(j.ObjectProperty)
40
- // @ts-ignore
41
- .filter((property) => property.node.key.name === 'positionFixed')
42
- .forEach((property) => {
43
- // @ts-ignore
44
- const strategy = property.node.value.value ? 'fixed' : 'absolute';
45
- property.replace(j.objectProperty(j.identifier('strategy'), j.stringLiteral(strategy)));
46
- });
47
-
48
- // warn about modifiers prop
49
- j(attribute)
50
- .find(j.JSXExpressionContainer)
51
- .find(j.ObjectExpression)
52
- .find(j.ObjectProperty)
53
- //@ts-ignore
54
- .filter((property) => property.node.key.name === 'modifiers')
55
- .forEach(() => {
56
- addCommentToStartOfFile({
57
- j,
58
- base: source,
59
- message: `
60
- Popper.js has been upgraded from 1.14.1 to 2.4.2,
61
- and as a result the modifier prop has changed significantly. The format has been
62
- changed from object of objects, to array of objects, with the key for each modifier
63
- replaced with a name key:value pair inside the modifier object, and an options:object
64
- pair for configuration and other changes unique to each modifier.
65
- Further details can be found in the popper docs: https://popper.js.org/docs/v2/modifiers/
66
- `,
67
- });
68
- });
69
- });
70
- }
71
- });
72
- }
73
-
74
- export default function transformer(file: FileInfo, { jscodeshift: j }: API, options: Options) {
75
- const source = j(file.source);
76
-
77
- // Exit early if not relevant
78
- // We are doing this so we don't touch the formatting of unrelated files
79
- if (!hasImportDeclaration(j, file.source, '@atlaskit/select')) {
80
- return file.source;
81
- }
82
-
83
- // Get imported name for the component
84
- const specifier = getSpecifierName({
85
- j,
86
- base: source,
87
- packageName: '@atlaskit/select',
88
- component: 'PopupSelect',
89
- });
90
- if (!specifier) {
91
- return file.source;
92
- }
93
-
94
- // Convert boundaries prop
95
- updatePopperProps(j, source, specifier);
96
-
97
- return source.toSource(options.printOptions || { quote: 'single' });
98
- }
@@ -1,233 +0,0 @@
1
- jest.autoMockOff();
2
-
3
- import transformer from '../13.0.0-popper-props';
4
-
5
- const applyTransform = require('jscodeshift/dist/testUtils').applyTransform;
6
-
7
- type TestArgs = {
8
- it: string;
9
- original: string;
10
- expected: string;
11
- mode?: 'only' | 'skip';
12
- before?: () => void;
13
- after?: () => void;
14
- };
15
-
16
- function noop() {}
17
-
18
- function check({
19
- it: name,
20
- original,
21
- expected,
22
- before = noop,
23
- after = noop,
24
- mode = undefined,
25
- }: TestArgs) {
26
- const run = mode === 'only' ? it.only : mode === 'skip' ? it.skip : it;
27
-
28
- run(name, () => {
29
- before();
30
- try {
31
- const output: string = applyTransform(
32
- { default: transformer, parser: 'tsx' },
33
- {},
34
- { source: original },
35
- );
36
- expect(output).toBe(expected.trim());
37
- } catch (e) {
38
- // a failed assertion will throw
39
- after();
40
- throw e;
41
- }
42
- // will only be hit if we don't throw
43
- after();
44
- });
45
- }
46
-
47
- /**
48
- PopupSelect has some changes to the values accepted by the `popperProps` prop.
49
- - The `positionFixed` prop has been replaced with `strategy`, which takes either `"fixed"` or `"absolute"`
50
- */
51
-
52
- describe('Convert positionFixed:boolean to strategy:"fixed"|"absolute"', () => {
53
- check({
54
- it: 'Convert `positionFixed: true` to `strategy: "fixed"`',
55
- original: `
56
- import { PopupSelect } from '@atlaskit/select';
57
-
58
- export default () => (
59
- <PopupSelect
60
- popperProps={{
61
- positionFixed: true,
62
- }}
63
- options={[
64
- { label: 'Adelaide', value: 'adelaide' },
65
- { label: 'Brisbane', value: 'brisbane' }
66
- ]}
67
- placeholder='Choose a City'
68
- target={({ ref }) => (
69
- <button ref={ref}> test </button>
70
- )}
71
- />
72
- );
73
- `,
74
- expected: `
75
- import { PopupSelect } from '@atlaskit/select';
76
-
77
- export default () => (
78
- <PopupSelect
79
- popperProps={{
80
- strategy: 'fixed',
81
- }}
82
- options={[
83
- { label: 'Adelaide', value: 'adelaide' },
84
- { label: 'Brisbane', value: 'brisbane' }
85
- ]}
86
- placeholder='Choose a City'
87
- target={({ ref }) => (
88
- <button ref={ref}> test </button>
89
- )}
90
- />
91
- );
92
- `,
93
- });
94
-
95
- check({
96
- it: 'Convert `positionFixed: {something truthy}` to `strategy: "fixed"`',
97
- original: `
98
- import { PopupSelect } from '@atlaskit/select';
99
-
100
- export default () => (
101
- <PopupSelect
102
- popperProps={{
103
- positionFixed: "yes",
104
- }}
105
- options={[
106
- { label: 'Adelaide', value: 'adelaide' },
107
- { label: 'Brisbane', value: 'brisbane' }
108
- ]}
109
- placeholder='Choose a City'
110
- target={({ ref }) => (
111
- <button ref={ref}> test </button>
112
- )}
113
- />
114
- );
115
- `,
116
- expected: `
117
- import { PopupSelect } from '@atlaskit/select';
118
-
119
- export default () => (
120
- <PopupSelect
121
- popperProps={{
122
- strategy: 'fixed',
123
- }}
124
- options={[
125
- { label: 'Adelaide', value: 'adelaide' },
126
- { label: 'Brisbane', value: 'brisbane' }
127
- ]}
128
- placeholder='Choose a City'
129
- target={({ ref }) => (
130
- <button ref={ref}> test </button>
131
- )}
132
- />
133
- );
134
- `,
135
- });
136
-
137
- check({
138
- it: 'Convert `positionFixed: false` to `strategy:"absolute"`',
139
- original: `
140
- import { PopupSelect } from '@atlaskit/select';
141
-
142
- export default () => (
143
- <PopupSelect
144
- popperProps={{
145
- positionFixed: false,
146
- }}
147
- options={[
148
- { label: 'Adelaide', value: 'adelaide' },
149
- { label: 'Brisbane', value: 'brisbane' }
150
- ]}
151
- placeholder='Choose a City'
152
- target={({ ref }) => (
153
- <button ref={ref}> test </button>
154
- )}
155
- />
156
- );
157
- `,
158
- expected: `
159
- import { PopupSelect } from '@atlaskit/select';
160
-
161
- export default () => (
162
- <PopupSelect
163
- popperProps={{
164
- strategy: 'absolute',
165
- }}
166
- options={[
167
- { label: 'Adelaide', value: 'adelaide' },
168
- { label: 'Brisbane', value: 'brisbane' }
169
- ]}
170
- placeholder='Choose a City'
171
- target={({ ref }) => (
172
- <button ref={ref}> test </button>
173
- )}
174
- />
175
- );
176
- `,
177
- });
178
- });
179
-
180
- /**
181
- PopupSelect has some changes to the values accepted by the `popperProps` prop.
182
- - Modifiers have been re-written and have a very different format`
183
- */
184
-
185
- describe('Warn use of the `modifiers` prop', () => {
186
- check({
187
- it: 'should add warning comment when using the modifier prop in `popperProps`',
188
- original: `
189
- import { PopupSelect } from '@atlaskit/select';
190
-
191
- export default () => (
192
- <PopupSelect
193
- popperProps={{
194
- modifiers: {},
195
- }}
196
- options={[
197
- { label: 'Adelaide', value: 'adelaide' },
198
- { label: 'Brisbane', value: 'brisbane' }
199
- ]}
200
- placeholder='Choose a City'
201
- target={({ ref }) => (
202
- <button ref={ref}> test </button>
203
- )}
204
- />
205
- );
206
- `,
207
- expected: `
208
- /* TODO: (from codemod) Popper.js has been upgraded from 1.14.1 to 2.4.2,
209
- and as a result the modifier prop has changed significantly. The format has been
210
- changed from object of objects, to array of objects, with the key for each modifier
211
- replaced with a name key:value pair inside the modifier object, and an options:object
212
- pair for configuration and other changes unique to each modifier.
213
- Further details can be found in the popper docs: https://popper.js.org/docs/v2/modifiers/ */
214
- import { PopupSelect } from '@atlaskit/select';
215
-
216
- export default () => (
217
- <PopupSelect
218
- popperProps={{
219
- modifiers: {},
220
- }}
221
- options={[
222
- { label: 'Adelaide', value: 'adelaide' },
223
- { label: 'Brisbane', value: 'brisbane' }
224
- ]}
225
- placeholder='Choose a City'
226
- target={({ ref }) => (
227
- <button ref={ref}> test </button>
228
- )}
229
- />
230
- );
231
- `,
232
- });
233
- });