@atlaskit/button 17.17.2 → 17.17.3
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 +10 -1
- package/__perf__/button.tsx +6 -6
- package/__perf__/custom.tsx +6 -6
- package/__perf__/customised.tsx +1 -3
- package/__perf__/utils/example-runner.tsx +32 -36
- package/__perf__/utils/interaction-tasks.tsx +65 -86
- package/codemods/15.0.0-lite-mode.tsx +32 -36
- package/codemods/15.1.1-data-testid.tsx +136 -142
- package/codemods/__tests__/15.0.0-lite-mode/optimistic.tsx +121 -121
- package/codemods/__tests__/15.0.0-lite-mode/safe.tsx +54 -54
- package/codemods/__tests__/15.0.0-lite-mode/shared.tsx +96 -97
- package/codemods/__tests__/15.1.1-data-testid/rename-data-testid.tsx +32 -32
- package/codemods/__tests__/_framework.tsx +32 -32
- package/codemods/helpers/15.0.0-runner.tsx +135 -137
- package/codemods/helpers/helpers-generic.tsx +524 -556
- package/codemods/optimistic-15.0.0-lite-mode.tsx +208 -231
- package/dist/cjs/old-button/shared/button-base.js +1 -1
- package/dist/es2019/new-button/variants/default/link.js +2 -2
- package/dist/es2019/new-button/variants/icon/link.js +3 -3
- package/dist/es2019/old-button/shared/button-base.js +1 -1
- package/dist/esm/new-button/variants/default/link.js +2 -2
- package/dist/esm/new-button/variants/icon/link.js +3 -3
- package/dist/esm/old-button/shared/button-base.js +1 -1
- package/dist/types/entry-points/loading-button.d.ts +1 -1
- package/dist/types/entry-points/new.d.ts +3 -3
- package/dist/types/entry-points/types.d.ts +2 -2
- package/dist/types/index.d.ts +3 -3
- package/dist/types/new.d.ts +3 -3
- package/dist/types-ts4.5/entry-points/loading-button.d.ts +1 -1
- package/dist/types-ts4.5/entry-points/new.d.ts +3 -3
- package/dist/types-ts4.5/entry-points/types.d.ts +2 -2
- package/dist/types-ts4.5/index.d.ts +3 -3
- package/dist/types-ts4.5/new.d.ts +3 -3
- package/extract-react-types/custom-theme-button-props.tsx +2 -4
- package/extract-react-types/legacy-button/custom-theme-button-props.tsx +2 -4
- package/extract-react-types/legacy-button/loading-button-props.tsx +1 -1
- package/extract-react-types/legacy-button/shared-props.tsx +1 -1
- package/extract-react-types/loading-button-props.tsx +1 -1
- package/extract-react-types/new-button/containers/split-button/split-button-props.tsx +1 -1
- package/extract-react-types/new-button/variants/default/button-props.tsx +1 -1
- package/extract-react-types/new-button/variants/default/common-default-button-props.tsx +4 -4
- package/extract-react-types/new-button/variants/default/link-button-props.tsx +4 -4
- package/extract-react-types/new-button/variants/icon-button/common-icon-button-props.tsx +4 -4
- package/extract-react-types/new-button/variants/icon-button/icon-button-props.tsx +1 -1
- package/extract-react-types/new-button/variants/icon-button/link-icon-button-props.tsx +2 -4
- package/extract-react-types/shared-props.tsx +1 -1
- package/package.json +2 -2
- package/report.api.md +78 -96
|
@@ -1,81 +1,72 @@
|
|
|
1
1
|
import { type NodePath } from 'ast-types/lib/node-path';
|
|
2
|
-
import type {
|
|
3
|
-
API,
|
|
4
|
-
default as core,
|
|
5
|
-
FileInfo,
|
|
6
|
-
JSXElement,
|
|
7
|
-
Node,
|
|
8
|
-
Options,
|
|
9
|
-
} from 'jscodeshift';
|
|
2
|
+
import type { API, default as core, FileInfo, JSXElement, Node, Options } from 'jscodeshift';
|
|
10
3
|
import { type Collection } from 'jscodeshift/src/Collection';
|
|
11
4
|
|
|
12
5
|
import { convertButtonType, transformButton } from './helpers/15.0.0-runner';
|
|
13
6
|
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
7
|
+
addCommentBefore,
|
|
8
|
+
addCommentToStartOfFile,
|
|
9
|
+
addToImport,
|
|
10
|
+
changeImportFor,
|
|
11
|
+
getDefaultSpecifierName,
|
|
12
|
+
getSafeImportName,
|
|
13
|
+
isOnlyUsingNameForJSX,
|
|
14
|
+
isUsingProp,
|
|
15
|
+
isUsingSupportedSpread,
|
|
16
|
+
type Nullable,
|
|
17
|
+
tryCreateImport,
|
|
25
18
|
} from './helpers/helpers-generic';
|
|
26
19
|
|
|
27
20
|
function changeUsage({
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
21
|
+
j,
|
|
22
|
+
base,
|
|
23
|
+
packageName,
|
|
31
24
|
}: {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
25
|
+
j: core.JSCodeshift;
|
|
26
|
+
base: Collection<Node>;
|
|
27
|
+
packageName: string;
|
|
35
28
|
}): void {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
29
|
+
// 1. Are we using the default export?
|
|
30
|
+
// If not: we can exit early!
|
|
31
|
+
const defaultName: Nullable<string> = getDefaultSpecifierName({
|
|
32
|
+
j,
|
|
33
|
+
base,
|
|
34
|
+
packageName,
|
|
35
|
+
});
|
|
36
|
+
if (defaultName == null) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
46
39
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
40
|
+
// Only supporting cases where default identifier is only used in JSX
|
|
41
|
+
const isSupported: boolean = isOnlyUsingNameForJSX({
|
|
42
|
+
j,
|
|
43
|
+
base,
|
|
44
|
+
name: defaultName,
|
|
45
|
+
});
|
|
53
46
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
47
|
+
if (!isSupported) {
|
|
48
|
+
tryCreateImport({
|
|
49
|
+
j,
|
|
50
|
+
base,
|
|
51
|
+
relativeToPackage: '@atlaskit/button',
|
|
52
|
+
packageName: '@atlaskit/button/standard-button',
|
|
53
|
+
});
|
|
54
|
+
addToImport({
|
|
55
|
+
j,
|
|
56
|
+
base,
|
|
57
|
+
// we can safely use the default name, because it was being used before
|
|
58
|
+
importSpecifier: j.importDefaultSpecifier(j.identifier(defaultName)),
|
|
59
|
+
packageName: '@atlaskit/button/standard-button',
|
|
60
|
+
});
|
|
68
61
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
),
|
|
78
|
-
message: `
|
|
62
|
+
addCommentBefore({
|
|
63
|
+
j,
|
|
64
|
+
target: base
|
|
65
|
+
.find(j.ImportDeclaration)
|
|
66
|
+
.filter(
|
|
67
|
+
(declaration) => declaration.value.source.value === '@atlaskit/button/standard-button',
|
|
68
|
+
),
|
|
69
|
+
message: `
|
|
79
70
|
This file does not exclusively use Button in JSX.
|
|
80
71
|
The codemod is unable to know which button variant, so it is using
|
|
81
72
|
the standard button: "@atlaskit/button/standard-button".
|
|
@@ -83,203 +74,189 @@ function changeUsage({
|
|
|
83
74
|
Please validate this decision.
|
|
84
75
|
You might need to change the usage of Button to either LoadingButton or CustomThemeButton
|
|
85
76
|
`,
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
77
|
+
});
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
89
80
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
81
|
+
// Find usages of the Button component
|
|
82
|
+
// There are three possible import statements:
|
|
83
|
+
// 1. import Button from '@atlaskit/button/standard';
|
|
84
|
+
// 2. import LoadingButton from '@atlaskit/button/loading-button';
|
|
85
|
+
// 3. import CustomThemeButton from '@atlaskit/button/custom-theme-button';
|
|
95
86
|
|
|
96
|
-
|
|
97
|
-
|
|
87
|
+
// What to do if any of the names clash?
|
|
88
|
+
// - In the case of clash: prefix with 'DS' (eg import DSLoadingButton from '@atlaskit/button/loading-button';)
|
|
98
89
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
90
|
+
// What to do if old Button was aliased? eg "AkButton"
|
|
91
|
+
// - We cannot use that existing alias as we might have three different Button imports in the file
|
|
92
|
+
// - We automatically will be be swapping to the standard names with 'DS' prefix for all imports
|
|
102
93
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
94
|
+
type Groups = {
|
|
95
|
+
standard: NodePath<JSXElement, JSXElement>[];
|
|
96
|
+
loading: NodePath<JSXElement, JSXElement>[];
|
|
97
|
+
customTheme: NodePath<JSXElement, JSXElement>[];
|
|
98
|
+
};
|
|
108
99
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
100
|
+
const groups: Groups = {
|
|
101
|
+
standard: [],
|
|
102
|
+
loading: [],
|
|
103
|
+
customTheme: [],
|
|
104
|
+
};
|
|
114
105
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
106
|
+
base.findJSXElements(defaultName).forEach((path) => {
|
|
107
|
+
const hasThemeProp: boolean = isUsingProp({
|
|
108
|
+
j,
|
|
109
|
+
base,
|
|
110
|
+
element: path,
|
|
111
|
+
propName: 'theme',
|
|
112
|
+
});
|
|
122
113
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
114
|
+
if (hasThemeProp) {
|
|
115
|
+
groups.customTheme.push(path);
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
127
118
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
119
|
+
if (!isUsingSupportedSpread({ j, base, element: path })) {
|
|
120
|
+
addCommentToStartOfFile({
|
|
121
|
+
j,
|
|
122
|
+
base,
|
|
123
|
+
message: `
|
|
133
124
|
Detected spreading props (<Button {...props} />) that was too complex for our codemod to understand
|
|
134
125
|
Our codemod will only look at inline objects, or objects defined in the same file (ObjectExpression's)
|
|
135
126
|
We have opted for our safest upgrade component in this file: '<CustomThemeButton />'
|
|
136
127
|
`,
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
128
|
+
});
|
|
129
|
+
groups.customTheme.push(path);
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
141
132
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
.filter((specifier) => specifier.value.imported.name === 'Theme')
|
|
152
|
-
.length > 0;
|
|
133
|
+
const isUsingThemeInFile: boolean =
|
|
134
|
+
base
|
|
135
|
+
.find(j.ImportDeclaration)
|
|
136
|
+
.filter(
|
|
137
|
+
(declaration) =>
|
|
138
|
+
declaration.value.source.value === '@atlaskit/button/custom-theme-button',
|
|
139
|
+
)
|
|
140
|
+
.find(j.ImportSpecifier)
|
|
141
|
+
.filter((specifier) => specifier.value.imported.name === 'Theme').length > 0;
|
|
153
142
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
143
|
+
if (isUsingThemeInFile) {
|
|
144
|
+
addCommentToStartOfFile({
|
|
145
|
+
j,
|
|
146
|
+
base,
|
|
147
|
+
message: `
|
|
159
148
|
Using "import { Theme } from '@atlaskit/button/custom-theme-button" in a file
|
|
160
149
|
will cause all buttons in that file to be safely converted to a <CustomThemeButton/>
|
|
161
150
|
`,
|
|
162
|
-
|
|
151
|
+
});
|
|
163
152
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
153
|
+
groups.customTheme.push(path);
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
167
156
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
157
|
+
const hasIsLoadingProp: boolean = isUsingProp({
|
|
158
|
+
j,
|
|
159
|
+
base,
|
|
160
|
+
element: path,
|
|
161
|
+
propName: 'isLoading',
|
|
162
|
+
});
|
|
174
163
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
164
|
+
if (hasIsLoadingProp) {
|
|
165
|
+
groups.loading.push(path);
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
179
168
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
169
|
+
groups.standard.push(path);
|
|
170
|
+
return;
|
|
171
|
+
});
|
|
183
172
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
173
|
+
convertButtonType({
|
|
174
|
+
j,
|
|
175
|
+
base,
|
|
176
|
+
elements: groups.standard,
|
|
177
|
+
name: getSafeImportName({
|
|
178
|
+
j,
|
|
179
|
+
base,
|
|
180
|
+
currentDefaultSpecifierName: defaultName,
|
|
181
|
+
desiredName: 'Button',
|
|
182
|
+
fallbackName: 'DSButton',
|
|
183
|
+
}),
|
|
184
|
+
newPackageName: '@atlaskit/button/standard-button',
|
|
185
|
+
});
|
|
197
186
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
187
|
+
convertButtonType({
|
|
188
|
+
j,
|
|
189
|
+
base,
|
|
190
|
+
elements: groups.loading,
|
|
191
|
+
newPackageName: '@atlaskit/button/loading-button',
|
|
192
|
+
name: getSafeImportName({
|
|
193
|
+
j,
|
|
194
|
+
base,
|
|
195
|
+
desiredName: 'LoadingButton',
|
|
196
|
+
fallbackName: 'DSLoadingButton',
|
|
197
|
+
currentDefaultSpecifierName: defaultName,
|
|
198
|
+
}),
|
|
199
|
+
});
|
|
200
|
+
convertButtonType({
|
|
201
|
+
j,
|
|
202
|
+
base,
|
|
203
|
+
elements: groups.customTheme,
|
|
204
|
+
newPackageName: '@atlaskit/button/custom-theme-button',
|
|
205
|
+
name: getSafeImportName({
|
|
206
|
+
j,
|
|
207
|
+
base,
|
|
208
|
+
currentDefaultSpecifierName: defaultName,
|
|
209
|
+
desiredName: 'CustomThemeButton',
|
|
210
|
+
fallbackName: 'DSCustomThemeButton',
|
|
211
|
+
}),
|
|
212
|
+
});
|
|
224
213
|
}
|
|
225
214
|
|
|
226
|
-
export default function transformer(
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
) {
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
},
|
|
243
|
-
oldPackagePath: '@atlaskit/button',
|
|
244
|
-
newPackagePath: '@atlaskit/button/types',
|
|
245
|
-
});
|
|
215
|
+
export default function transformer(file: FileInfo, { jscodeshift: j }: API, options: Options) {
|
|
216
|
+
return transformButton({
|
|
217
|
+
j,
|
|
218
|
+
file,
|
|
219
|
+
custom: (base: Collection<any>) => {
|
|
220
|
+
changeImportFor({
|
|
221
|
+
j,
|
|
222
|
+
base,
|
|
223
|
+
option: {
|
|
224
|
+
type: 'keep-name',
|
|
225
|
+
name: 'ButtonProps',
|
|
226
|
+
behaviour: 'keep-as-named-import',
|
|
227
|
+
},
|
|
228
|
+
oldPackagePath: '@atlaskit/button',
|
|
229
|
+
newPackagePath: '@atlaskit/button/types',
|
|
230
|
+
});
|
|
246
231
|
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
)
|
|
254
|
-
.find(j.ImportSpecifier)
|
|
255
|
-
.filter(
|
|
256
|
-
(specifier) => specifier.value.imported.name === 'ButtonProps',
|
|
257
|
-
).length > 0;
|
|
232
|
+
const isUsingButtonPropsType: boolean =
|
|
233
|
+
base
|
|
234
|
+
.find(j.ImportDeclaration)
|
|
235
|
+
.filter((declaration) => declaration.value.source.value === '@atlaskit/button/types')
|
|
236
|
+
.find(j.ImportSpecifier)
|
|
237
|
+
.filter((specifier) => specifier.value.imported.name === 'ButtonProps').length > 0;
|
|
258
238
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
j,
|
|
268
|
-
target,
|
|
269
|
-
message: `
|
|
239
|
+
if (isUsingButtonPropsType) {
|
|
240
|
+
const target = base
|
|
241
|
+
.find(j.ImportDeclaration)
|
|
242
|
+
.filter((declaration) => declaration.value.source.value === '@atlaskit/button/types');
|
|
243
|
+
addCommentBefore({
|
|
244
|
+
j,
|
|
245
|
+
target,
|
|
246
|
+
message: `
|
|
270
247
|
Verify ButtonProps is the right prop type
|
|
271
248
|
You might need the LoadingButtonProps, CustomButtonProps types which can be imported from '@atlaskit/button/types'
|
|
272
249
|
`,
|
|
273
|
-
|
|
274
|
-
|
|
250
|
+
});
|
|
251
|
+
}
|
|
275
252
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
253
|
+
changeUsage({
|
|
254
|
+
j,
|
|
255
|
+
base,
|
|
256
|
+
packageName: '@atlaskit/button',
|
|
257
|
+
});
|
|
258
|
+
},
|
|
259
|
+
});
|
|
283
260
|
}
|
|
284
261
|
|
|
285
262
|
// Note: not exporting a 'parser' because doing so
|
|
@@ -129,7 +129,7 @@ var _default = exports.default = /*#__PURE__*/_react.default.forwardRef(function
|
|
|
129
129
|
action: 'clicked',
|
|
130
130
|
componentName: 'button',
|
|
131
131
|
packageName: "@atlaskit/button",
|
|
132
|
-
packageVersion: "17.17.
|
|
132
|
+
packageVersion: "17.17.3",
|
|
133
133
|
analyticsData: analyticsContext
|
|
134
134
|
});
|
|
135
135
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React, { forwardRef, memo } from 'react';
|
|
3
|
-
import
|
|
3
|
+
import Anchor from '@atlaskit/primitives/anchor';
|
|
4
4
|
import useDefaultButton from './use-default-button';
|
|
5
5
|
const LinkButtonBase = ({
|
|
6
6
|
analyticsContext,
|
|
@@ -59,7 +59,7 @@ const LinkButtonBase = ({
|
|
|
59
59
|
UNSAFE_iconAfter_size,
|
|
60
60
|
UNSAFE_iconBefore_size
|
|
61
61
|
});
|
|
62
|
-
return /*#__PURE__*/React.createElement(
|
|
62
|
+
return /*#__PURE__*/React.createElement(Anchor
|
|
63
63
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
64
64
|
, _extends({}, rest, {
|
|
65
65
|
ref: baseProps.ref,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React, { forwardRef, memo } from 'react';
|
|
3
|
-
import
|
|
3
|
+
import Anchor from '@atlaskit/primitives/anchor';
|
|
4
4
|
import Tooltip from '@atlaskit/tooltip';
|
|
5
5
|
import useIconButton from './use-icon-button';
|
|
6
6
|
const LinkIconButtonBase = ({
|
|
@@ -77,7 +77,7 @@ const LinkIconButtonBase = ({
|
|
|
77
77
|
component: tooltip === null || tooltip === void 0 ? void 0 : tooltip.component,
|
|
78
78
|
hideTooltipOnClick: tooltip === null || tooltip === void 0 ? void 0 : tooltip.hideTooltipOnClick,
|
|
79
79
|
hideTooltipOnMouseDown: tooltip === null || tooltip === void 0 ? void 0 : tooltip.hideTooltipOnMouseDown
|
|
80
|
-
}, triggerProps => /*#__PURE__*/React.createElement(
|
|
80
|
+
}, triggerProps => /*#__PURE__*/React.createElement(Anchor
|
|
81
81
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
82
82
|
, _extends({}, rest, {
|
|
83
83
|
testId: testId,
|
|
@@ -151,7 +151,7 @@ const LinkIconButtonBase = ({
|
|
|
151
151
|
"aria-disabled": baseProps.isDisabled === true ? true : undefined
|
|
152
152
|
}), baseProps.children));
|
|
153
153
|
}
|
|
154
|
-
return /*#__PURE__*/React.createElement(
|
|
154
|
+
return /*#__PURE__*/React.createElement(Anchor
|
|
155
155
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
156
156
|
, _extends({}, rest, {
|
|
157
157
|
ref: baseProps.ref,
|
|
@@ -114,7 +114,7 @@ export default /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref) {
|
|
|
114
114
|
action: 'clicked',
|
|
115
115
|
componentName: 'button',
|
|
116
116
|
packageName: "@atlaskit/button",
|
|
117
|
-
packageVersion: "17.17.
|
|
117
|
+
packageVersion: "17.17.3",
|
|
118
118
|
analyticsData: analyticsContext
|
|
119
119
|
});
|
|
120
120
|
|
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["analyticsContext", "appearance", "autoFocus", "children", "href", "iconAfter", "iconBefore", "interactionName", "isDisabled", "isSelected", "onClick", "onClickCapture", "onKeyDownCapture", "onKeyUpCapture", "onMouseDownCapture", "onMouseUpCapture", "onPointerDownCapture", "onPointerUpCapture", "onTouchEndCapture", "onTouchStartCapture", "overlay", "shouldFitContainer", "spacing", "testId", "UNSAFE_iconAfter_size", "UNSAFE_iconBefore_size"];
|
|
4
4
|
import React, { forwardRef, memo } from 'react';
|
|
5
|
-
import
|
|
5
|
+
import Anchor from '@atlaskit/primitives/anchor';
|
|
6
6
|
import useDefaultButton from './use-default-button';
|
|
7
7
|
var LinkButtonBase = function LinkButtonBase(_ref, ref) {
|
|
8
8
|
var analyticsContext = _ref.analyticsContext,
|
|
@@ -60,7 +60,7 @@ var LinkButtonBase = function LinkButtonBase(_ref, ref) {
|
|
|
60
60
|
UNSAFE_iconAfter_size: UNSAFE_iconAfter_size,
|
|
61
61
|
UNSAFE_iconBefore_size: UNSAFE_iconBefore_size
|
|
62
62
|
});
|
|
63
|
-
return /*#__PURE__*/React.createElement(
|
|
63
|
+
return /*#__PURE__*/React.createElement(Anchor
|
|
64
64
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
65
65
|
, _extends({}, rest, {
|
|
66
66
|
ref: baseProps.ref,
|
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["aria-label", "analyticsContext", "appearance", "autoFocus", "href", "icon", "interactionName", "isDisabled", "isSelected", "isTooltipDisabled", "label", "onClick", "onClickCapture", "onKeyDownCapture", "onKeyUpCapture", "onMouseDownCapture", "onMouseUpCapture", "onPointerDownCapture", "onPointerUpCapture", "onTouchEndCapture", "onTouchStartCapture", "overlay", "shape", "spacing", "testId", "tooltip", "UNSAFE_size"];
|
|
4
4
|
import React, { forwardRef, memo } from 'react';
|
|
5
|
-
import
|
|
5
|
+
import Anchor from '@atlaskit/primitives/anchor';
|
|
6
6
|
import Tooltip from '@atlaskit/tooltip';
|
|
7
7
|
import useIconButton from './use-icon-button';
|
|
8
8
|
var LinkIconButtonBase = function LinkIconButtonBase(_ref, ref) {
|
|
@@ -79,7 +79,7 @@ var LinkIconButtonBase = function LinkIconButtonBase(_ref, ref) {
|
|
|
79
79
|
hideTooltipOnClick: tooltip === null || tooltip === void 0 ? void 0 : tooltip.hideTooltipOnClick,
|
|
80
80
|
hideTooltipOnMouseDown: tooltip === null || tooltip === void 0 ? void 0 : tooltip.hideTooltipOnMouseDown
|
|
81
81
|
}, function (triggerProps) {
|
|
82
|
-
return /*#__PURE__*/React.createElement(
|
|
82
|
+
return /*#__PURE__*/React.createElement(Anchor
|
|
83
83
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
84
84
|
, _extends({}, rest, {
|
|
85
85
|
testId: testId,
|
|
@@ -154,7 +154,7 @@ var LinkIconButtonBase = function LinkIconButtonBase(_ref, ref) {
|
|
|
154
154
|
}), baseProps.children);
|
|
155
155
|
});
|
|
156
156
|
}
|
|
157
|
-
return /*#__PURE__*/React.createElement(
|
|
157
|
+
return /*#__PURE__*/React.createElement(Anchor
|
|
158
158
|
// eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
|
|
159
159
|
, _extends({}, rest, {
|
|
160
160
|
ref: baseProps.ref,
|
|
@@ -120,7 +120,7 @@ export default /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref) {
|
|
|
120
120
|
action: 'clicked',
|
|
121
121
|
componentName: 'button',
|
|
122
122
|
packageName: "@atlaskit/button",
|
|
123
|
-
packageVersion: "17.17.
|
|
123
|
+
packageVersion: "17.17.3",
|
|
124
124
|
analyticsData: analyticsContext
|
|
125
125
|
});
|
|
126
126
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default } from '../old-button/loading-button';
|
|
2
|
-
export type { LoadingButtonProps, LoadingButtonOwnProps
|
|
2
|
+
export type { LoadingButtonProps, LoadingButtonOwnProps } from '../old-button/loading-button';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { default, type ButtonProps
|
|
2
|
-
export { default as LinkButton, type LinkButtonProps
|
|
3
|
-
export { default as IconButton, type IconButtonProps
|
|
1
|
+
export { default, type ButtonProps } from '../new-button/variants/default/button';
|
|
2
|
+
export { default as LinkButton, type LinkButtonProps } from '../new-button/variants/default/link';
|
|
3
|
+
export { default as IconButton, type IconButtonProps } from '../new-button/variants/icon/button';
|
|
4
4
|
export { default as LinkIconButton, type LinkIconButtonProps, } from '../new-button/variants/icon/link';
|
|
5
5
|
export { SplitButton } from '../new-button/containers/split-button';
|
|
6
6
|
export type { Appearance, Spacing } from '../new-button/variants/types';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { Appearance, Spacing, BaseOwnProps, BaseProps
|
|
1
|
+
export type { Appearance, Spacing, BaseOwnProps, BaseProps } from '../old-button/types';
|
|
2
2
|
export type { ButtonProps } from './standard-button';
|
|
3
|
-
export type { LoadingButtonProps, LoadingButtonOwnProps
|
|
3
|
+
export type { LoadingButtonProps, LoadingButtonOwnProps } from './loading-button';
|
|
4
4
|
export type { ThemeTokens, ThemeProps, InteractionState, CustomThemeButtonProps, CustomThemeButtonOwnProps, } from './custom-theme-button';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export type { Appearance, Spacing, BaseOwnProps, BaseProps
|
|
1
|
+
export type { Appearance, Spacing, BaseOwnProps, BaseProps } from './entry-points/types';
|
|
2
2
|
export { default, } from './entry-points/standard-button';
|
|
3
3
|
export type { ButtonProps } from './entry-points/standard-button';
|
|
4
4
|
export { default as LoadingButton } from './entry-points/loading-button';
|
|
5
|
-
export type { LoadingButtonProps, LoadingButtonOwnProps
|
|
6
|
-
export { default as CustomThemeButton, Theme
|
|
5
|
+
export type { LoadingButtonProps, LoadingButtonOwnProps } from './entry-points/loading-button';
|
|
6
|
+
export { default as CustomThemeButton, Theme } from './entry-points/custom-theme-button';
|
|
7
7
|
export type { ThemeTokens, ThemeProps, InteractionState, CustomThemeButtonProps, CustomThemeButtonOwnProps, } from './entry-points/custom-theme-button';
|
|
8
8
|
export { default as ButtonGroup } from './entry-points/button-group';
|
|
9
9
|
export type { ButtonGroupProps } from './entry-points/button-group';
|