@atlaskit/button 17.17.2 → 17.18.0

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.
Files changed (105) hide show
  1. package/CHANGELOG.md +56 -1
  2. package/__perf__/button.tsx +6 -6
  3. package/__perf__/custom.tsx +6 -6
  4. package/__perf__/customised.tsx +1 -3
  5. package/__perf__/utils/example-runner.tsx +32 -36
  6. package/__perf__/utils/interaction-tasks.tsx +65 -86
  7. package/codemods/15.0.0-lite-mode.tsx +32 -36
  8. package/codemods/15.1.1-data-testid.tsx +136 -142
  9. package/codemods/__tests__/15.0.0-lite-mode/optimistic.tsx +121 -121
  10. package/codemods/__tests__/15.0.0-lite-mode/safe.tsx +54 -54
  11. package/codemods/__tests__/15.0.0-lite-mode/shared.tsx +96 -97
  12. package/codemods/__tests__/15.1.1-data-testid/rename-data-testid.tsx +32 -32
  13. package/codemods/__tests__/_framework.tsx +32 -32
  14. package/codemods/helpers/15.0.0-runner.tsx +135 -137
  15. package/codemods/helpers/helpers-generic.tsx +524 -556
  16. package/codemods/optimistic-15.0.0-lite-mode.tsx +208 -231
  17. package/dist/cjs/containers/button-group.js +3 -1
  18. package/dist/cjs/new-button/containers/split-button/split-button.js +6 -2
  19. package/dist/cjs/new-button/variants/default/button.js +8 -1
  20. package/dist/cjs/new-button/variants/default/link.js +8 -1
  21. package/dist/cjs/new-button/variants/default/use-default-button.js +7 -1
  22. package/dist/cjs/new-button/variants/icon/button.js +6 -1
  23. package/dist/cjs/new-button/variants/icon/link.js +6 -1
  24. package/dist/cjs/new-button/variants/icon/use-icon-button.js +7 -1
  25. package/dist/cjs/new-button/variants/shared/constants.js +7 -0
  26. package/dist/cjs/new-button/variants/shared/loading-overlay.js +4 -3
  27. package/dist/cjs/new-button/variants/shared/use-button-base.js +54 -2
  28. package/dist/cjs/old-button/button.js +1 -1
  29. package/dist/cjs/old-button/custom-theme-button/custom-theme-button.js +1 -1
  30. package/dist/cjs/old-button/custom-theme-button/theme.js +1 -1
  31. package/dist/cjs/old-button/shared/button-base.js +9 -3
  32. package/dist/cjs/old-button/shared/css.js +4 -3
  33. package/dist/es2019/containers/button-group.js +3 -1
  34. package/dist/es2019/new-button/containers/split-button/split-button.js +5 -2
  35. package/dist/es2019/new-button/variants/default/button.js +7 -0
  36. package/dist/es2019/new-button/variants/default/link.js +9 -2
  37. package/dist/es2019/new-button/variants/default/use-default-button.js +7 -1
  38. package/dist/es2019/new-button/variants/icon/button.js +5 -0
  39. package/dist/es2019/new-button/variants/icon/link.js +8 -3
  40. package/dist/es2019/new-button/variants/icon/use-icon-button.js +7 -1
  41. package/dist/es2019/new-button/variants/shared/constants.js +1 -0
  42. package/dist/es2019/new-button/variants/shared/loading-overlay.js +4 -3
  43. package/dist/es2019/new-button/variants/shared/use-button-base.js +54 -2
  44. package/dist/es2019/old-button/button.js +3 -0
  45. package/dist/es2019/old-button/custom-theme-button/custom-theme-button.js +3 -0
  46. package/dist/es2019/old-button/custom-theme-button/theme.js +2 -0
  47. package/dist/es2019/old-button/shared/button-base.js +10 -3
  48. package/dist/es2019/old-button/shared/css.js +4 -2
  49. package/dist/esm/containers/button-group.js +3 -1
  50. package/dist/esm/new-button/containers/split-button/split-button.js +5 -2
  51. package/dist/esm/new-button/variants/default/button.js +8 -1
  52. package/dist/esm/new-button/variants/default/link.js +10 -3
  53. package/dist/esm/new-button/variants/default/use-default-button.js +7 -1
  54. package/dist/esm/new-button/variants/icon/button.js +6 -1
  55. package/dist/esm/new-button/variants/icon/link.js +9 -4
  56. package/dist/esm/new-button/variants/icon/use-icon-button.js +7 -1
  57. package/dist/esm/new-button/variants/shared/constants.js +1 -0
  58. package/dist/esm/new-button/variants/shared/loading-overlay.js +4 -3
  59. package/dist/esm/new-button/variants/shared/use-button-base.js +54 -2
  60. package/dist/esm/old-button/button.js +3 -0
  61. package/dist/esm/old-button/custom-theme-button/custom-theme-button.js +3 -0
  62. package/dist/esm/old-button/custom-theme-button/theme.js +2 -0
  63. package/dist/esm/old-button/shared/button-base.js +10 -3
  64. package/dist/esm/old-button/shared/css.js +4 -2
  65. package/dist/types/entry-points/loading-button.d.ts +1 -1
  66. package/dist/types/entry-points/new.d.ts +3 -3
  67. package/dist/types/entry-points/types.d.ts +2 -2
  68. package/dist/types/index.d.ts +3 -3
  69. package/dist/types/new-button/variants/default/link.d.ts +1 -1
  70. package/dist/types/new-button/variants/default/types.d.ts +1 -1
  71. package/dist/types/new-button/variants/default/use-default-button.d.ts +4 -3
  72. package/dist/types/new-button/variants/icon/link.d.ts +1 -1
  73. package/dist/types/new-button/variants/icon/use-icon-button.d.ts +4 -3
  74. package/dist/types/new-button/variants/shared/constants.d.ts +1 -0
  75. package/dist/types/new-button/variants/shared/loading-overlay.d.ts +2 -1
  76. package/dist/types/new-button/variants/shared/use-button-base.d.ts +5 -1
  77. package/dist/types/new.d.ts +3 -3
  78. package/dist/types-ts4.5/entry-points/loading-button.d.ts +1 -1
  79. package/dist/types-ts4.5/entry-points/new.d.ts +3 -3
  80. package/dist/types-ts4.5/entry-points/types.d.ts +2 -2
  81. package/dist/types-ts4.5/index.d.ts +3 -3
  82. package/dist/types-ts4.5/new-button/variants/default/link.d.ts +1 -1
  83. package/dist/types-ts4.5/new-button/variants/default/types.d.ts +1 -1
  84. package/dist/types-ts4.5/new-button/variants/default/use-default-button.d.ts +4 -3
  85. package/dist/types-ts4.5/new-button/variants/icon/link.d.ts +1 -1
  86. package/dist/types-ts4.5/new-button/variants/icon/use-icon-button.d.ts +4 -3
  87. package/dist/types-ts4.5/new-button/variants/shared/constants.d.ts +1 -0
  88. package/dist/types-ts4.5/new-button/variants/shared/loading-overlay.d.ts +2 -1
  89. package/dist/types-ts4.5/new-button/variants/shared/use-button-base.d.ts +5 -1
  90. package/dist/types-ts4.5/new.d.ts +3 -3
  91. package/extract-react-types/custom-theme-button-props.tsx +2 -4
  92. package/extract-react-types/legacy-button/custom-theme-button-props.tsx +2 -4
  93. package/extract-react-types/legacy-button/loading-button-props.tsx +1 -1
  94. package/extract-react-types/legacy-button/shared-props.tsx +1 -1
  95. package/extract-react-types/loading-button-props.tsx +1 -1
  96. package/extract-react-types/new-button/containers/split-button/split-button-props.tsx +1 -1
  97. package/extract-react-types/new-button/variants/default/button-props.tsx +1 -1
  98. package/extract-react-types/new-button/variants/default/common-default-button-props.tsx +4 -4
  99. package/extract-react-types/new-button/variants/default/link-button-props.tsx +4 -4
  100. package/extract-react-types/new-button/variants/icon-button/common-icon-button-props.tsx +4 -4
  101. package/extract-react-types/new-button/variants/icon-button/icon-button-props.tsx +1 -1
  102. package/extract-react-types/new-button/variants/icon-button/link-icon-button-props.tsx +2 -4
  103. package/extract-react-types/shared-props.tsx +1 -1
  104. package/package.json +202 -201
  105. 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
- addCommentBefore,
15
- addCommentToStartOfFile,
16
- addToImport,
17
- changeImportFor,
18
- getDefaultSpecifierName,
19
- getSafeImportName,
20
- isOnlyUsingNameForJSX,
21
- isUsingProp,
22
- isUsingSupportedSpread,
23
- type Nullable,
24
- tryCreateImport,
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
- j,
29
- base,
30
- packageName,
21
+ j,
22
+ base,
23
+ packageName,
31
24
  }: {
32
- j: core.JSCodeshift;
33
- base: Collection<Node>;
34
- packageName: string;
25
+ j: core.JSCodeshift;
26
+ base: Collection<Node>;
27
+ packageName: string;
35
28
  }): void {
36
- // 1. Are we using the default export?
37
- // If not: we can exit early!
38
- const defaultName: Nullable<string> = getDefaultSpecifierName({
39
- j,
40
- base,
41
- packageName,
42
- });
43
- if (defaultName == null) {
44
- return;
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
- // Only supporting cases where default identifier is only used in JSX
48
- const isSupported: boolean = isOnlyUsingNameForJSX({
49
- j,
50
- base,
51
- name: defaultName,
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
- if (!isSupported) {
55
- tryCreateImport({
56
- j,
57
- base,
58
- relativeToPackage: '@atlaskit/button',
59
- packageName: '@atlaskit/button/standard-button',
60
- });
61
- addToImport({
62
- j,
63
- base,
64
- // we can safely use the default name, because it was being used before
65
- importSpecifier: j.importDefaultSpecifier(j.identifier(defaultName)),
66
- packageName: '@atlaskit/button/standard-button',
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
- addCommentBefore({
70
- j,
71
- target: base
72
- .find(j.ImportDeclaration)
73
- .filter(
74
- (declaration) =>
75
- declaration.value.source.value ===
76
- '@atlaskit/button/standard-button',
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
- return;
88
- }
77
+ });
78
+ return;
79
+ }
89
80
 
90
- // Find usages of the Button component
91
- // There are three possible import statements:
92
- // 1. import Button from '@atlaskit/button/standard';
93
- // 2. import LoadingButton from '@atlaskit/button/loading-button';
94
- // 3. import CustomThemeButton from '@atlaskit/button/custom-theme-button';
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
- // What to do if any of the names clash?
97
- // - In the case of clash: prefix with 'DS' (eg import DSLoadingButton from '@atlaskit/button/loading-button';)
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
- // What to do if old Button was aliased? eg "AkButton"
100
- // - We cannot use that existing alias as we might have three different Button imports in the file
101
- // - We automatically will be be swapping to the standard names with 'DS' prefix for all imports
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
- type Groups = {
104
- standard: NodePath<JSXElement, JSXElement>[];
105
- loading: NodePath<JSXElement, JSXElement>[];
106
- customTheme: NodePath<JSXElement, JSXElement>[];
107
- };
94
+ type Groups = {
95
+ standard: NodePath<JSXElement, JSXElement>[];
96
+ loading: NodePath<JSXElement, JSXElement>[];
97
+ customTheme: NodePath<JSXElement, JSXElement>[];
98
+ };
108
99
 
109
- const groups: Groups = {
110
- standard: [],
111
- loading: [],
112
- customTheme: [],
113
- };
100
+ const groups: Groups = {
101
+ standard: [],
102
+ loading: [],
103
+ customTheme: [],
104
+ };
114
105
 
115
- base.findJSXElements(defaultName).forEach((path) => {
116
- const hasThemeProp: boolean = isUsingProp({
117
- j,
118
- base,
119
- element: path,
120
- propName: 'theme',
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
- if (hasThemeProp) {
124
- groups.customTheme.push(path);
125
- return;
126
- }
114
+ if (hasThemeProp) {
115
+ groups.customTheme.push(path);
116
+ return;
117
+ }
127
118
 
128
- if (!isUsingSupportedSpread({ j, base, element: path })) {
129
- addCommentToStartOfFile({
130
- j,
131
- base,
132
- message: `
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
- groups.customTheme.push(path);
139
- return;
140
- }
128
+ });
129
+ groups.customTheme.push(path);
130
+ return;
131
+ }
141
132
 
142
- const isUsingThemeInFile: boolean =
143
- base
144
- .find(j.ImportDeclaration)
145
- .filter(
146
- (declaration) =>
147
- declaration.value.source.value ===
148
- '@atlaskit/button/custom-theme-button',
149
- )
150
- .find(j.ImportSpecifier)
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
- if (isUsingThemeInFile) {
155
- addCommentToStartOfFile({
156
- j,
157
- base,
158
- message: `
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
- groups.customTheme.push(path);
165
- return;
166
- }
153
+ groups.customTheme.push(path);
154
+ return;
155
+ }
167
156
 
168
- const hasIsLoadingProp: boolean = isUsingProp({
169
- j,
170
- base,
171
- element: path,
172
- propName: 'isLoading',
173
- });
157
+ const hasIsLoadingProp: boolean = isUsingProp({
158
+ j,
159
+ base,
160
+ element: path,
161
+ propName: 'isLoading',
162
+ });
174
163
 
175
- if (hasIsLoadingProp) {
176
- groups.loading.push(path);
177
- return;
178
- }
164
+ if (hasIsLoadingProp) {
165
+ groups.loading.push(path);
166
+ return;
167
+ }
179
168
 
180
- groups.standard.push(path);
181
- return;
182
- });
169
+ groups.standard.push(path);
170
+ return;
171
+ });
183
172
 
184
- convertButtonType({
185
- j,
186
- base,
187
- elements: groups.standard,
188
- name: getSafeImportName({
189
- j,
190
- base,
191
- currentDefaultSpecifierName: defaultName,
192
- desiredName: 'Button',
193
- fallbackName: 'DSButton',
194
- }),
195
- newPackageName: '@atlaskit/button/standard-button',
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
- convertButtonType({
199
- j,
200
- base,
201
- elements: groups.loading,
202
- newPackageName: '@atlaskit/button/loading-button',
203
- name: getSafeImportName({
204
- j,
205
- base,
206
- desiredName: 'LoadingButton',
207
- fallbackName: 'DSLoadingButton',
208
- currentDefaultSpecifierName: defaultName,
209
- }),
210
- });
211
- convertButtonType({
212
- j,
213
- base,
214
- elements: groups.customTheme,
215
- newPackageName: '@atlaskit/button/custom-theme-button',
216
- name: getSafeImportName({
217
- j,
218
- base,
219
- currentDefaultSpecifierName: defaultName,
220
- desiredName: 'CustomThemeButton',
221
- fallbackName: 'DSCustomThemeButton',
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
- file: FileInfo,
228
- { jscodeshift: j }: API,
229
- options: Options,
230
- ) {
231
- return transformButton({
232
- j,
233
- file,
234
- custom: (base: Collection<any>) => {
235
- changeImportFor({
236
- j,
237
- base,
238
- option: {
239
- type: 'keep-name',
240
- name: 'ButtonProps',
241
- behaviour: 'keep-as-named-import',
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
- const isUsingButtonPropsType: boolean =
248
- base
249
- .find(j.ImportDeclaration)
250
- .filter(
251
- (declaration) =>
252
- declaration.value.source.value === '@atlaskit/button/types',
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
- if (isUsingButtonPropsType) {
260
- const target = base
261
- .find(j.ImportDeclaration)
262
- .filter(
263
- (declaration) =>
264
- declaration.value.source.value === '@atlaskit/button/types',
265
- );
266
- addCommentBefore({
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
- changeUsage({
277
- j,
278
- base,
279
- packageName: '@atlaskit/button',
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
@@ -11,10 +11,12 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
11
11
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
12
12
  /** @jsx jsx */
13
13
 
14
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
15
+
14
16
  var buttonGroupStyles = (0, _react2.css)({
15
17
  display: 'inline-flex',
16
18
  gap: "var(--ds-space-050, 4px)",
17
- // eslint-disable-next-line @atlaskit/design-system/no-nested-styles
19
+ // eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
18
20
  '> *': {
19
21
  flex: '1 0 auto'
20
22
  }
@@ -10,6 +10,8 @@ var _splitButtonContext = require("./split-button-context");
10
10
  var _utils = require("./utils");
11
11
  /** @jsx jsx */
12
12
 
13
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
14
+
13
15
  var fontSize = (0, _constants.fontSize)();
14
16
  var heights = {
15
17
  default: "".concat(32 / fontSize, "em"),
@@ -23,9 +25,11 @@ var baseDividerStyles = (0, _react.css)({
23
25
  zIndex: 2
24
26
  });
25
27
  var defaultDividerStyles = (0, _react.css)({
28
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
26
29
  height: heights.default
27
30
  });
28
31
  var compactDividerStyles = (0, _react.css)({
32
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
29
33
  height: heights.compact
30
34
  });
31
35
  var dividerDisabledStyles = (0, _react.css)({
@@ -75,14 +79,14 @@ var splitButtonStyles = (0, _react.css)({
75
79
  whiteSpace: 'nowrap'
76
80
  });
77
81
  var primaryButtonStyles = (0, _react.css)({
78
- // eslint-disable-next-line @atlaskit/design-system/no-nested-styles
82
+ // eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
79
83
  'button,a': {
80
84
  borderEndEndRadius: 0,
81
85
  borderStartEndRadius: 0
82
86
  }
83
87
  });
84
88
  var secondaryButtonStyles = (0, _react.css)({
85
- // eslint-disable-next-line @atlaskit/design-system/no-nested-styles
89
+ // eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
86
90
  'button,a': {
87
91
  borderEndStartRadius: 0,
88
92
  borderStartStartRadius: 0
@@ -10,7 +10,7 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
10
10
  var _react = _interopRequireDefault(require("react"));
11
11
  var _pressable = _interopRequireDefault(require("@atlaskit/primitives/pressable"));
12
12
  var _useDefaultButton = _interopRequireDefault(require("./use-default-button"));
13
- var _excluded = ["analyticsContext", "appearance", "autoFocus", "children", "iconAfter", "iconBefore", "interactionName", "isDisabled", "isLoading", "isSelected", "onClick", "onClickCapture", "onKeyDownCapture", "onKeyUpCapture", "onMouseDownCapture", "onMouseUpCapture", "onPointerDownCapture", "onPointerUpCapture", "onTouchEndCapture", "onTouchStartCapture", "overlay", "shouldFitContainer", "spacing", "testId", "type", "UNSAFE_iconAfter_size", "UNSAFE_iconBefore_size"];
13
+ var _excluded = ["analyticsContext", "appearance", "aria-label", "aria-labelledby", "autoFocus", "children", "iconAfter", "iconBefore", "interactionName", "isDisabled", "isLoading", "isSelected", "onClick", "onClickCapture", "onKeyDownCapture", "onKeyUpCapture", "onMouseDownCapture", "onMouseUpCapture", "onPointerDownCapture", "onPointerUpCapture", "onTouchEndCapture", "onTouchStartCapture", "overlay", "shouldFitContainer", "spacing", "testId", "type", "UNSAFE_iconAfter_size", "UNSAFE_iconBefore_size"];
14
14
  /**
15
15
  * __Button__
16
16
  *
@@ -23,6 +23,8 @@ var _excluded = ["analyticsContext", "appearance", "autoFocus", "children", "ico
23
23
  var Button = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwardRef(function Button(_ref, ref) {
24
24
  var analyticsContext = _ref.analyticsContext,
25
25
  appearance = _ref.appearance,
26
+ ariaLabel = _ref['aria-label'],
27
+ ariaLabelledBy = _ref['aria-labelledby'],
26
28
  autoFocus = _ref.autoFocus,
27
29
  children = _ref.children,
28
30
  iconAfter = _ref.iconAfter,
@@ -51,6 +53,8 @@ var Button = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwa
51
53
  UNSAFE_iconBefore_size = _ref.UNSAFE_iconBefore_size,
52
54
  rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
53
55
  var baseProps = (0, _useDefaultButton.default)({
56
+ ariaLabel: ariaLabel,
57
+ ariaLabelledBy: ariaLabelledBy,
54
58
  analyticsContext: analyticsContext,
55
59
  appearance: appearance,
56
60
  autoFocus: autoFocus,
@@ -76,12 +80,15 @@ var Button = /*#__PURE__*/_react.default.memo( /*#__PURE__*/_react.default.forwa
76
80
  ref: ref,
77
81
  shouldFitContainer: shouldFitContainer,
78
82
  spacing: spacing,
83
+ testId: testId,
79
84
  UNSAFE_iconAfter_size: UNSAFE_iconAfter_size,
80
85
  UNSAFE_iconBefore_size: UNSAFE_iconBefore_size
81
86
  });
82
87
  return /*#__PURE__*/_react.default.createElement(_pressable.default
83
88
  // TODO: Remove spread props
84
89
  , (0, _extends2.default)({}, rest, {
90
+ "aria-label": baseProps['aria-label'],
91
+ "aria-labelledby": baseProps['aria-labelledby'],
85
92
  ref: baseProps.ref,
86
93
  xcss: baseProps.xcss,
87
94
  isDisabled: baseProps.isDisabled,
@@ -11,12 +11,14 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
11
11
  var _react = _interopRequireWildcard(require("react"));
12
12
  var _anchor = _interopRequireDefault(require("@atlaskit/primitives/anchor"));
13
13
  var _useDefaultButton = _interopRequireDefault(require("./use-default-button"));
14
- 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"];
14
+ var _excluded = ["analyticsContext", "appearance", "aria-label", "aria-labelledby", "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"];
15
15
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
16
16
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
17
17
  var LinkButtonBase = function LinkButtonBase(_ref, ref) {
18
18
  var analyticsContext = _ref.analyticsContext,
19
19
  appearance = _ref.appearance,
20
+ ariaLabel = _ref['aria-label'],
21
+ ariaLabelledBy = _ref['aria-labelledby'],
20
22
  autoFocus = _ref.autoFocus,
21
23
  children = _ref.children,
22
24
  href = _ref.href,
@@ -43,6 +45,8 @@ var LinkButtonBase = function LinkButtonBase(_ref, ref) {
43
45
  UNSAFE_iconBefore_size = _ref.UNSAFE_iconBefore_size,
44
46
  rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
45
47
  var baseProps = (0, _useDefaultButton.default)({
48
+ ariaLabel: ariaLabel,
49
+ ariaLabelledBy: ariaLabelledBy,
46
50
  analyticsContext: analyticsContext,
47
51
  appearance: appearance,
48
52
  autoFocus: autoFocus,
@@ -67,12 +71,15 @@ var LinkButtonBase = function LinkButtonBase(_ref, ref) {
67
71
  ref: ref,
68
72
  shouldFitContainer: shouldFitContainer,
69
73
  spacing: spacing,
74
+ testId: testId,
70
75
  UNSAFE_iconAfter_size: UNSAFE_iconAfter_size,
71
76
  UNSAFE_iconBefore_size: UNSAFE_iconBefore_size
72
77
  });
73
78
  return /*#__PURE__*/_react.default.createElement(_anchor.default
74
79
  // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
75
80
  , (0, _extends2.default)({}, rest, {
81
+ "aria-label": baseProps['aria-label'],
82
+ "aria-labelledby": baseProps['aria-labelledby'],
76
83
  ref: baseProps.ref,
77
84
  xcss: baseProps.xcss,
78
85
  onClick: baseProps.onClick,