@atlaskit/button 17.17.3 → 17.19.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 (72) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/dist/cjs/containers/button-group.js +6 -1
  3. package/dist/cjs/new-button/containers/split-button/split-button.js +9 -2
  4. package/dist/cjs/new-button/variants/default/button.js +8 -1
  5. package/dist/cjs/new-button/variants/default/link.js +8 -1
  6. package/dist/cjs/new-button/variants/default/use-default-button.js +7 -1
  7. package/dist/cjs/new-button/variants/icon/button.js +6 -1
  8. package/dist/cjs/new-button/variants/icon/link.js +6 -1
  9. package/dist/cjs/new-button/variants/icon/use-icon-button.js +7 -1
  10. package/dist/cjs/new-button/variants/shared/constants.js +7 -0
  11. package/dist/cjs/new-button/variants/shared/loading-overlay.js +4 -3
  12. package/dist/cjs/new-button/variants/shared/use-button-base.js +54 -2
  13. package/dist/cjs/old-button/button.js +1 -1
  14. package/dist/cjs/old-button/custom-theme-button/custom-theme-button.js +1 -1
  15. package/dist/cjs/old-button/custom-theme-button/theme.js +1 -1
  16. package/dist/cjs/old-button/shared/button-base.js +12 -3
  17. package/dist/cjs/old-button/shared/css.js +4 -3
  18. package/dist/es2019/containers/button-group.js +6 -1
  19. package/dist/es2019/new-button/containers/split-button/split-button.js +8 -2
  20. package/dist/es2019/new-button/variants/default/button.js +7 -0
  21. package/dist/es2019/new-button/variants/default/link.js +7 -0
  22. package/dist/es2019/new-button/variants/default/use-default-button.js +7 -1
  23. package/dist/es2019/new-button/variants/icon/button.js +5 -0
  24. package/dist/es2019/new-button/variants/icon/link.js +5 -0
  25. package/dist/es2019/new-button/variants/icon/use-icon-button.js +7 -1
  26. package/dist/es2019/new-button/variants/shared/constants.js +1 -0
  27. package/dist/es2019/new-button/variants/shared/loading-overlay.js +4 -3
  28. package/dist/es2019/new-button/variants/shared/use-button-base.js +54 -2
  29. package/dist/es2019/old-button/button.js +3 -0
  30. package/dist/es2019/old-button/custom-theme-button/custom-theme-button.js +3 -0
  31. package/dist/es2019/old-button/custom-theme-button/theme.js +2 -0
  32. package/dist/es2019/old-button/shared/button-base.js +13 -3
  33. package/dist/es2019/old-button/shared/css.js +4 -2
  34. package/dist/esm/containers/button-group.js +6 -1
  35. package/dist/esm/new-button/containers/split-button/split-button.js +8 -2
  36. package/dist/esm/new-button/variants/default/button.js +8 -1
  37. package/dist/esm/new-button/variants/default/link.js +8 -1
  38. package/dist/esm/new-button/variants/default/use-default-button.js +7 -1
  39. package/dist/esm/new-button/variants/icon/button.js +6 -1
  40. package/dist/esm/new-button/variants/icon/link.js +6 -1
  41. package/dist/esm/new-button/variants/icon/use-icon-button.js +7 -1
  42. package/dist/esm/new-button/variants/shared/constants.js +1 -0
  43. package/dist/esm/new-button/variants/shared/loading-overlay.js +4 -3
  44. package/dist/esm/new-button/variants/shared/use-button-base.js +54 -2
  45. package/dist/esm/old-button/button.js +3 -0
  46. package/dist/esm/old-button/custom-theme-button/custom-theme-button.js +3 -0
  47. package/dist/esm/old-button/custom-theme-button/theme.js +2 -0
  48. package/dist/esm/old-button/shared/button-base.js +13 -3
  49. package/dist/esm/old-button/shared/css.js +4 -2
  50. package/dist/types/containers/button-group.d.ts +3 -0
  51. package/dist/types/new-button/containers/split-button/split-button.d.ts +3 -0
  52. package/dist/types/new-button/variants/default/link.d.ts +1 -1
  53. package/dist/types/new-button/variants/default/types.d.ts +1 -1
  54. package/dist/types/new-button/variants/default/use-default-button.d.ts +4 -3
  55. package/dist/types/new-button/variants/icon/link.d.ts +1 -1
  56. package/dist/types/new-button/variants/icon/use-icon-button.d.ts +4 -3
  57. package/dist/types/new-button/variants/shared/constants.d.ts +1 -0
  58. package/dist/types/new-button/variants/shared/loading-overlay.d.ts +2 -1
  59. package/dist/types/new-button/variants/shared/use-button-base.d.ts +5 -1
  60. package/dist/types/old-button/shared/button-base.d.ts +3 -0
  61. package/dist/types-ts4.5/containers/button-group.d.ts +3 -0
  62. package/dist/types-ts4.5/new-button/containers/split-button/split-button.d.ts +3 -0
  63. package/dist/types-ts4.5/new-button/variants/default/link.d.ts +1 -1
  64. package/dist/types-ts4.5/new-button/variants/default/types.d.ts +1 -1
  65. package/dist/types-ts4.5/new-button/variants/default/use-default-button.d.ts +4 -3
  66. package/dist/types-ts4.5/new-button/variants/icon/link.d.ts +1 -1
  67. package/dist/types-ts4.5/new-button/variants/icon/use-icon-button.d.ts +4 -3
  68. package/dist/types-ts4.5/new-button/variants/shared/constants.d.ts +1 -0
  69. package/dist/types-ts4.5/new-button/variants/shared/loading-overlay.d.ts +2 -1
  70. package/dist/types-ts4.5/new-button/variants/shared/use-button-base.d.ts +5 -1
  71. package/dist/types-ts4.5/old-button/shared/button-base.d.ts +3 -0
  72. package/package.json +202 -201
@@ -27,15 +27,16 @@ export default function renderLoadingOverlay({
27
27
  appearance,
28
28
  spacing,
29
29
  isDisabled,
30
- isSelected
30
+ isSelected,
31
+ testId
31
32
  }) {
32
33
  return /*#__PURE__*/React.createElement(Spinner, {
33
- label: ", Loading",
34
34
  size: getIconSpacing(spacing),
35
35
  appearance: getSpinnerAppearance({
36
36
  appearance,
37
37
  isDisabled,
38
38
  isSelected
39
- })
39
+ }),
40
+ testId: testId ? `${testId}--loading-spinner` : undefined
40
41
  });
41
42
  }
@@ -1,12 +1,15 @@
1
1
  import React, { Fragment, useRef } from 'react';
2
+ import { uid } from 'react-uid';
2
3
  import mergeRefs from '@atlaskit/ds-lib/merge-refs';
3
4
  import useAutoFocus from '@atlaskit/ds-lib/use-auto-focus';
4
5
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
5
6
  import { Box, xcss } from '@atlaskit/primitives';
6
7
  import * as colors from '@atlaskit/theme/colors';
7
8
  import { fontSize as getFontSize } from '@atlaskit/theme/constants';
9
+ import VisuallyHidden from '@atlaskit/visually-hidden';
8
10
  import { useSplitButtonContext } from '../../containers/split-button/split-button-context';
9
11
  import blockEvents from './block-events';
12
+ import { LOADING_LABEL } from './constants';
10
13
  const fontSize = getFontSize();
11
14
  const buttonStyles = xcss({
12
15
  display: 'inline-flex',
@@ -17,10 +20,12 @@ const buttonStyles = xcss({
17
20
  alignItems: 'baseline',
18
21
  justifyContent: 'center',
19
22
  columnGap: 'space.050',
23
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
20
24
  background: `var(--ds-background-neutral, ${colors.N20A})`,
21
25
  borderRadius: 'border.radius.100',
22
26
  borderWidth: 'border.width.0',
23
27
  // @ts-expect-error
28
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
24
29
  color: `var(--ds-text, ${colors.N500})`,
25
30
  flexShrink: 0,
26
31
  height: `${32 / fontSize}em`,
@@ -31,6 +36,7 @@ const buttonStyles = xcss({
31
36
  verticalAlign: 'middle',
32
37
  ':visited': {
33
38
  // @ts-expect-error
39
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
34
40
  color: `var(--ds-text, ${colors.N500})`
35
41
  }
36
42
  });
@@ -51,12 +57,15 @@ const defaultInteractiveStyles = xcss({
51
57
  ':hover': {
52
58
  background: "var(--ds-background-neutral-hovered, #091e4214)",
53
59
  // @ts-expect-error
60
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
54
61
  color: `var(--ds-text, ${colors.N500})`,
55
62
  transitionDuration: '0s, 0.15s'
56
63
  },
57
64
  ':active': {
65
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
58
66
  background: `var(--ds-background-neutral-pressed, ${colors.B75})`,
59
67
  // @ts-expect-error
68
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
60
69
  color: `var(--ds-text, ${colors.B400})`,
61
70
  transitionDuration: '0s, 0s'
62
71
  }
@@ -160,11 +169,13 @@ const subtleInteractiveStyles = xcss({
160
169
  });
161
170
  const linkStyles = xcss({
162
171
  // @ts-expect-error
172
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
163
173
  color: `var(--ds-link, ${colors.B400})`,
164
174
  background: "var(--ds-background-neutral-subtle, transparent)",
165
175
  textDecoration: 'none',
166
176
  ':hover': {
167
177
  // @ts-expect-error
178
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
168
179
  color: `var(--ds-link, ${colors.B300})`,
169
180
  background: "var(--ds-background-neutral-subtle, transparent)"
170
181
  },
@@ -175,26 +186,31 @@ const linkStyles = xcss({
175
186
  },
176
187
  ':visited': {
177
188
  // @ts-expect-error
189
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
178
190
  color: `var(--ds-link, ${colors.B400})`
179
191
  }
180
192
  });
181
193
  const subtleLinkStyles = xcss({
182
194
  // @ts-expect-error
195
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
183
196
  color: `var(--ds-text-subtle, ${colors.N200})`,
184
197
  background: "var(--ds-background-neutral-subtle, transparent)",
185
198
  textDecoration: 'none',
186
199
  ':hover': {
187
200
  // @ts-expect-error
201
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
188
202
  color: `var(--ds-text-subtle, ${colors.N90})`,
189
203
  background: "var(--ds-background-neutral-subtle, transparent)"
190
204
  },
191
205
  ':active': {
192
206
  // @ts-expect-error
207
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
193
208
  color: `var(--ds-text, ${colors.N400})`,
194
209
  background: "var(--ds-background-neutral-subtle, transparent)"
195
210
  },
196
211
  ':visited': {
197
212
  // @ts-expect-error
213
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
198
214
  color: `var(--ds-text-subtle, ${colors.N200})`
199
215
  }
200
216
  });
@@ -221,72 +237,94 @@ const linkDecorationStyles = xcss({
221
237
  }
222
238
  });
223
239
  const disabledStyles = xcss({
240
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
224
241
  background: `var(--ds-background-disabled, ${colors.N20A})`,
225
242
  // @ts-expect-error
226
243
  color: "var(--ds-text-disabled, #091E424F)",
227
244
  ':hover': {
245
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
228
246
  background: `var(--ds-background-disabled, ${colors.N20A})`,
229
247
  // @ts-expect-error
230
248
  color: "var(--ds-text-disabled, #091E424F)"
231
249
  },
232
250
  ':active': {
251
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
233
252
  background: `var(--ds-background-disabled, ${colors.N20A})`,
234
253
  // @ts-expect-error
235
254
  color: "var(--ds-text-disabled, #091E424F)"
236
255
  }
237
256
  });
238
257
  const selectedStyles = xcss({
258
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
239
259
  background: `var(--ds-background-selected, ${colors.N700})`,
240
260
  // @ts-expect-error
261
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
241
262
  color: `var(--ds-text-selected, ${colors.N20})`,
242
263
  ':visited': {
243
264
  // @ts-expect-error
265
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
244
266
  color: `var(--ds-text-selected, ${colors.N20})`
245
267
  }
246
268
  });
247
269
  const selectedInteractiveStyles = xcss({
248
270
  ':hover': {
249
271
  // @ts-expect-error
272
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
250
273
  color: `var(--ds-text-selected, ${colors.N20})`,
274
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
251
275
  background: `var(--ds-background-selected-hovered, ${colors.N700})`
252
276
  },
253
277
  ':active': {
254
278
  // @ts-expect-error
279
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
255
280
  color: `var(--ds-text-selected, ${colors.N20})`,
281
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
256
282
  background: `var(--ds-background-selected-pressed, ${colors.N700})`
257
283
  }
258
284
  });
259
285
 
260
286
  // TODO: Remove me once we kill color fallbacks
261
287
  const selectedWarningStyles = xcss({
288
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
262
289
  background: `var(--ds-background-selected, ${colors.Y400})`,
263
290
  // @ts-expect-error
291
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
264
292
  color: `var(--ds-text-selected, ${colors.N800})`,
265
293
  ':hover': {
266
294
  // @ts-expect-error
295
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
267
296
  color: `var(--ds-text-selected, ${colors.N20})`,
297
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
268
298
  background: `var(--ds-background-selected, ${colors.Y400})`
269
299
  },
270
300
  ':active': {
271
301
  // @ts-expect-error
302
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
272
303
  color: `var(--ds-text-selected, ${colors.N20})`,
304
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
273
305
  background: `var(--ds-background-selected, ${colors.Y400})`
274
306
  }
275
307
  });
276
308
 
277
309
  // TODO: Remove me once we kill color fallbacks
278
310
  const selectedDangerStyles = xcss({
311
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
279
312
  background: `var(--ds-background-selected, ${colors.R500})`,
280
313
  // @ts-expect-error
314
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
281
315
  color: `var(--ds-text-selected, ${colors.N20})`,
282
316
  ':hover': {
283
317
  // @ts-expect-error
318
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
284
319
  color: `var(--ds-text-selected, ${colors.N20})`,
320
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
285
321
  background: `var(--ds-background-selected, ${colors.R500})`
286
322
  },
287
323
  ':active': {
288
324
  // @ts-expect-error
325
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
289
326
  color: `var(--ds-text-selected, ${colors.N20})`,
327
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
290
328
  background: `var(--ds-background-selected, ${colors.R500})`
291
329
  }
292
330
  });
@@ -295,14 +333,17 @@ const selectedDangerStyles = xcss({
295
333
  const selectedDiscoveryStyles = xcss({
296
334
  background: "var(--ds-background-selected, #403294)",
297
335
  // @ts-expect-error
336
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
298
337
  color: `var(--ds-text-selected, ${colors.N20})`,
299
338
  ':hover': {
300
339
  // @ts-expect-error
340
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
301
341
  color: `var(--ds-text-selected, ${colors.N20})`,
302
342
  background: "var(--ds-background-selected, #403294)"
303
343
  },
304
344
  ':active': {
305
345
  // @ts-expect-error
346
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
306
347
  color: `var(--ds-text-selected, ${colors.N20})`,
307
348
  background: "var(--ds-background-selected, #403294)"
308
349
  }
@@ -420,10 +461,17 @@ const useButtonBase = ({
420
461
  overlay,
421
462
  ref,
422
463
  shouldFitContainer = false,
423
- spacing: propSpacing = 'default'
464
+ spacing: propSpacing = 'default',
465
+ ariaLabel,
466
+ ariaLabelledBy
424
467
  }) => {
425
468
  const localRef = useRef(null);
426
469
  const splitButtonContext = useSplitButtonContext();
470
+ // TODO: Use React 18's useId() hook when we update.
471
+ // eslint-disable-next-line @repo/internal/react/disallow-unstable-values
472
+ const loadingLabelId = uid({
473
+ ariaLabelledBy
474
+ });
427
475
  const isSplitButton = Boolean(splitButtonContext);
428
476
  const isNavigationSplitButton = (splitButtonContext === null || splitButtonContext === void 0 ? void 0 : splitButtonContext.isNavigationSplitButton) || false;
429
477
  const appearance = (splitButtonContext === null || splitButtonContext === void 0 ? void 0 : splitButtonContext.appearance) || propAppearance;
@@ -447,7 +495,11 @@ const useButtonBase = ({
447
495
  children: /*#__PURE__*/React.createElement(Fragment, null, children, overlay ? /*#__PURE__*/React.createElement(Box, {
448
496
  as: "span",
449
497
  xcss: overlayStyles
450
- }, overlay) : null),
498
+ }, overlay) : null, isLoading && (children && !ariaLabel && !ariaLabelledBy || ariaLabelledBy) && /*#__PURE__*/React.createElement(VisuallyHidden, {
499
+ id: loadingLabelId
500
+ }, ", Loading")),
501
+ 'aria-label': isLoading && ariaLabel && !ariaLabelledBy ? `${ariaLabel} ${LOADING_LABEL}` : ariaLabel,
502
+ 'aria-labelledby': isLoading && ariaLabelledBy ? `${ariaLabelledBy} ${loadingLabelId}` : ariaLabelledBy,
451
503
  ...blockEvents(isEffectivelyDisabled, {
452
504
  onClick,
453
505
  onMouseDownCapture,
@@ -1,5 +1,8 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React, { useCallback, useMemo, useState } from 'react';
3
+
4
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
5
+
3
6
  import noop from '@atlaskit/ds-lib/noop';
4
7
  import { useGlobalTheme } from '@atlaskit/theme/components';
5
8
  import ButtonBase from './shared/button-base';
@@ -1,5 +1,8 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React, { useCallback, useState } from 'react';
3
+
4
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
5
+
3
6
  import GlobalTheme from '@atlaskit/theme/components';
4
7
  import ButtonBase from '../shared/button-base';
5
8
  import getIsOnlySingleIcon from '../shared/get-is-only-single-icon';
@@ -1,3 +1,5 @@
1
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
2
+
1
3
  import { createTheme } from '@atlaskit/theme/components';
2
4
  import { getCss } from '../shared/css';
3
5
  const stateToSelectorMap = {
@@ -1,7 +1,12 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  /* eslint-disable @atlaskit/design-system/consistent-css-prop-usage */
3
+ /**
4
+ * @jsxRuntime classic
5
+ */
3
6
  /** @jsx jsx */
4
7
  import React, { useCallback, useContext, useEffect, useRef } from 'react';
8
+
9
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
5
10
  import { css, jsx } from '@emotion/react';
6
11
  import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next';
7
12
  import noop from '@atlaskit/ds-lib/noop';
@@ -114,7 +119,7 @@ export default /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref) {
114
119
  action: 'clicked',
115
120
  componentName: 'button',
116
121
  packageName: "@atlaskit/button",
117
- packageVersion: "17.17.3",
122
+ packageVersion: "17.19.0",
118
123
  analyticsData: analyticsContext
119
124
  });
120
125
 
@@ -134,6 +139,7 @@ export default /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref) {
134
139
 
135
140
  // we are 'disabling' input with a button when there is an overlay
136
141
  const hasOverlay = Boolean(overlay);
142
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
137
143
  const fadeStyles = css(getFadingCss({
138
144
  hasOverlay
139
145
  }));
@@ -177,13 +183,17 @@ export default /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref) {
177
183
  }, blockEvents({
178
184
  isInteractive
179
185
  })), iconBefore ? jsx("span", {
180
- css: [fadeStyles, getIconStyle({
186
+ css: [fadeStyles,
187
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
188
+ getIconStyle({
181
189
  spacing
182
190
  }), getSpacingFix(children, iconBeforeSpacingFixStyle)]
183
191
  }, iconBefore) : null, getChildren(children, [fadeStyles, getContentStyle({
184
192
  spacing
185
193
  })]), iconAfter ? jsx("span", {
186
- css: [fadeStyles, getIconStyle({
194
+ css: [fadeStyles,
195
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
196
+ getIconStyle({
187
197
  spacing
188
198
  }), getSpacingFix(children, iconAfterSpacingFixStyle)]
189
199
  }, iconAfter) : null, overlay ? jsx("span", {
@@ -1,3 +1,4 @@
1
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
1
2
  import { css } from '@emotion/react';
2
3
  import { fontSize as getFontSize,
3
4
  // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
@@ -198,7 +199,7 @@ export function getIconStyle({
198
199
  return css({
199
200
  display: 'flex',
200
201
  // icon size cannot grow and shrink
201
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
202
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
202
203
  margin: spacing === 'none' ? 0 : innerMargin.icon,
203
204
  flexGrow: 0,
204
205
  flexShrink: 0,
@@ -214,7 +215,7 @@ export function getContentStyle({
214
215
  spacing
215
216
  }) {
216
217
  return css({
217
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
218
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
218
219
  margin: spacing === 'none' ? 0 : innerMargin.content,
219
220
  // content can grow and shrink
220
221
  flexGrow: 1,
@@ -229,6 +230,7 @@ export function getFadingCss({
229
230
  hasOverlay
230
231
  }) {
231
232
  return css({
233
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
232
234
  opacity: hasOverlay ? 0 : 1,
233
235
  transition: 'opacity 0.3s'
234
236
  });
@@ -1,10 +1,15 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ */
1
4
  /** @jsx jsx */
2
5
  import React, { Fragment } from 'react';
6
+
7
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
3
8
  import { css, jsx } from '@emotion/react';
4
9
  var buttonGroupStyles = css({
5
10
  display: 'inline-flex',
6
11
  gap: "var(--ds-space-050, 4px)",
7
- // eslint-disable-next-line @atlaskit/design-system/no-nested-styles
12
+ // eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
8
13
  '> *': {
9
14
  flex: '1 0 auto'
10
15
  }
@@ -1,5 +1,9 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ */
1
4
  /** @jsx jsx */
2
5
 
6
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
3
7
  import { css, jsx } from '@emotion/react';
4
8
  import { fontSize as getFontSize } from '@atlaskit/theme/constants';
5
9
  var fontSize = getFontSize();
@@ -17,9 +21,11 @@ var baseDividerStyles = css({
17
21
  zIndex: 2
18
22
  });
19
23
  var defaultDividerStyles = css({
24
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
20
25
  height: heights.default
21
26
  });
22
27
  var compactDividerStyles = css({
28
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
23
29
  height: heights.compact
24
30
  });
25
31
  var dividerDisabledStyles = css({
@@ -69,14 +75,14 @@ var splitButtonStyles = css({
69
75
  whiteSpace: 'nowrap'
70
76
  });
71
77
  var primaryButtonStyles = css({
72
- // eslint-disable-next-line @atlaskit/design-system/no-nested-styles
78
+ // eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
73
79
  'button,a': {
74
80
  borderEndEndRadius: 0,
75
81
  borderStartEndRadius: 0
76
82
  }
77
83
  });
78
84
  var secondaryButtonStyles = css({
79
- // eslint-disable-next-line @atlaskit/design-system/no-nested-styles
85
+ // eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
80
86
  'button,a': {
81
87
  borderEndStartRadius: 0,
82
88
  borderStartStartRadius: 0
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- 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"];
3
+ 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"];
4
4
  import React from 'react';
5
5
  import Pressable from '@atlaskit/primitives/pressable';
6
6
  import useDefaultButton from './use-default-button';
@@ -16,6 +16,8 @@ import useDefaultButton from './use-default-button';
16
16
  var Button = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function Button(_ref, ref) {
17
17
  var analyticsContext = _ref.analyticsContext,
18
18
  appearance = _ref.appearance,
19
+ ariaLabel = _ref['aria-label'],
20
+ ariaLabelledBy = _ref['aria-labelledby'],
19
21
  autoFocus = _ref.autoFocus,
20
22
  children = _ref.children,
21
23
  iconAfter = _ref.iconAfter,
@@ -44,6 +46,8 @@ var Button = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function But
44
46
  UNSAFE_iconBefore_size = _ref.UNSAFE_iconBefore_size,
45
47
  rest = _objectWithoutProperties(_ref, _excluded);
46
48
  var baseProps = useDefaultButton({
49
+ ariaLabel: ariaLabel,
50
+ ariaLabelledBy: ariaLabelledBy,
47
51
  analyticsContext: analyticsContext,
48
52
  appearance: appearance,
49
53
  autoFocus: autoFocus,
@@ -69,12 +73,15 @@ var Button = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function But
69
73
  ref: ref,
70
74
  shouldFitContainer: shouldFitContainer,
71
75
  spacing: spacing,
76
+ testId: testId,
72
77
  UNSAFE_iconAfter_size: UNSAFE_iconAfter_size,
73
78
  UNSAFE_iconBefore_size: UNSAFE_iconBefore_size
74
79
  });
75
80
  return /*#__PURE__*/React.createElement(Pressable
76
81
  // TODO: Remove spread props
77
82
  , _extends({}, rest, {
83
+ "aria-label": baseProps['aria-label'],
84
+ "aria-labelledby": baseProps['aria-labelledby'],
78
85
  ref: baseProps.ref,
79
86
  xcss: baseProps.xcss,
80
87
  isDisabled: baseProps.isDisabled,
@@ -1,12 +1,14 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
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"];
3
+ 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"];
4
4
  import React, { forwardRef, memo } from 'react';
5
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,
9
9
  appearance = _ref.appearance,
10
+ ariaLabel = _ref['aria-label'],
11
+ ariaLabelledBy = _ref['aria-labelledby'],
10
12
  autoFocus = _ref.autoFocus,
11
13
  children = _ref.children,
12
14
  href = _ref.href,
@@ -33,6 +35,8 @@ var LinkButtonBase = function LinkButtonBase(_ref, ref) {
33
35
  UNSAFE_iconBefore_size = _ref.UNSAFE_iconBefore_size,
34
36
  rest = _objectWithoutProperties(_ref, _excluded);
35
37
  var baseProps = useDefaultButton({
38
+ ariaLabel: ariaLabel,
39
+ ariaLabelledBy: ariaLabelledBy,
36
40
  analyticsContext: analyticsContext,
37
41
  appearance: appearance,
38
42
  autoFocus: autoFocus,
@@ -57,12 +61,15 @@ var LinkButtonBase = function LinkButtonBase(_ref, ref) {
57
61
  ref: ref,
58
62
  shouldFitContainer: shouldFitContainer,
59
63
  spacing: spacing,
64
+ testId: testId,
60
65
  UNSAFE_iconAfter_size: UNSAFE_iconAfter_size,
61
66
  UNSAFE_iconBefore_size: UNSAFE_iconBefore_size
62
67
  });
63
68
  return /*#__PURE__*/React.createElement(Anchor
64
69
  // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
65
70
  , _extends({}, rest, {
71
+ "aria-label": baseProps['aria-label'],
72
+ "aria-labelledby": baseProps['aria-labelledby'],
66
73
  ref: baseProps.ref,
67
74
  xcss: baseProps.xcss,
68
75
  onClick: baseProps.onClick,
@@ -14,6 +14,8 @@ import useButtonBase from '../shared/use-button-base';
14
14
  var useDefaultButton = function useDefaultButton(_ref) {
15
15
  var analyticsContext = _ref.analyticsContext,
16
16
  appearance = _ref.appearance,
17
+ ariaLabel = _ref.ariaLabel,
18
+ ariaLabelledBy = _ref.ariaLabelledBy,
17
19
  autoFocus = _ref.autoFocus,
18
20
  buttonType = _ref.buttonType,
19
21
  children = _ref.children,
@@ -38,6 +40,7 @@ var useDefaultButton = function useDefaultButton(_ref) {
38
40
  ref = _ref.ref,
39
41
  shouldFitContainer = _ref.shouldFitContainer,
40
42
  spacing = _ref.spacing,
43
+ testId = _ref.testId,
41
44
  UNSAFE_iconAfter_size = _ref.UNSAFE_iconAfter_size,
42
45
  UNSAFE_iconBefore_size = _ref.UNSAFE_iconBefore_size;
43
46
  var hasOverlay = Boolean(overlay || isLoading);
@@ -45,6 +48,8 @@ var useDefaultButton = function useDefaultButton(_ref) {
45
48
  analyticsContext: analyticsContext,
46
49
  appearance: appearance,
47
50
  autoFocus: autoFocus,
51
+ ariaLabel: ariaLabel,
52
+ ariaLabelledBy: ariaLabelledBy,
48
53
  buttonType: buttonType,
49
54
  children: /*#__PURE__*/React.createElement(Fragment, null, IconBefore && /*#__PURE__*/React.createElement(Content, {
50
55
  type: "icon",
@@ -83,7 +88,8 @@ var useDefaultButton = function useDefaultButton(_ref) {
83
88
  spacing: spacing,
84
89
  appearance: appearance,
85
90
  isDisabled: isDisabled,
86
- isSelected: isSelected
91
+ isSelected: isSelected,
92
+ testId: testId
87
93
  }) : overlay,
88
94
  ref: ref,
89
95
  shouldFitContainer: shouldFitContainer,
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["aria-label", "analyticsContext", "appearance", "autoFocus", "icon", "interactionName", "isDisabled", "isLoading", "isSelected", "isTooltipDisabled", "label", "onClick", "onClickCapture", "onKeyDownCapture", "onKeyUpCapture", "onMouseDownCapture", "onMouseUpCapture", "onPointerDownCapture", "onPointerUpCapture", "onTouchEndCapture", "onTouchStartCapture", "overlay", "shape", "spacing", "testId", "tooltip", "type", "UNSAFE_size"];
3
+ var _excluded = ["aria-label", "aria-labelledby", "analyticsContext", "appearance", "autoFocus", "icon", "interactionName", "isDisabled", "isLoading", "isSelected", "isTooltipDisabled", "label", "onClick", "onClickCapture", "onKeyDownCapture", "onKeyUpCapture", "onMouseDownCapture", "onMouseUpCapture", "onPointerDownCapture", "onPointerUpCapture", "onTouchEndCapture", "onTouchStartCapture", "overlay", "shape", "spacing", "testId", "tooltip", "type", "UNSAFE_size"];
4
4
  import React from 'react';
5
5
  import Pressable from '@atlaskit/primitives/pressable';
6
6
  import Tooltip from '@atlaskit/tooltip';
@@ -16,6 +16,7 @@ import useIconButton from './use-icon-button';
16
16
  */
17
17
  var IconButton = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function Button(_ref, ref) {
18
18
  var preventedAriaLabel = _ref['aria-label'],
19
+ ariaLabelledBy = _ref['aria-labelledby'],
19
20
  analyticsContext = _ref.analyticsContext,
20
21
  appearance = _ref.appearance,
21
22
  autoFocus = _ref.autoFocus,
@@ -53,6 +54,7 @@ var IconButton = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function
53
54
  var baseProps = useIconButton({
54
55
  analyticsContext: analyticsContext,
55
56
  appearance: appearance,
57
+ ariaLabelledBy: ariaLabelledBy,
56
58
  autoFocus: autoFocus,
57
59
  buttonType: 'button',
58
60
  icon: icon,
@@ -75,6 +77,7 @@ var IconButton = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function
75
77
  ref: ref,
76
78
  shape: shape,
77
79
  spacing: spacing,
80
+ testId: testId,
78
81
  UNSAFE_size: UNSAFE_size
79
82
  });
80
83
  if (!isTooltipDisabled) {
@@ -98,6 +101,7 @@ var IconButton = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function
98
101
  return /*#__PURE__*/React.createElement(Pressable
99
102
  // Top level props
100
103
  , _extends({}, rest, {
104
+ "aria-labelledby": baseProps['aria-labelledby'],
101
105
  type: type,
102
106
  testId: testId,
103
107
  componentName: "IconButton",
@@ -164,6 +168,7 @@ var IconButton = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function
164
168
  });
165
169
  }
166
170
  return /*#__PURE__*/React.createElement(Pressable, _extends({}, rest, {
171
+ "aria-labelledby": baseProps['aria-labelledby'],
167
172
  ref: baseProps.ref,
168
173
  xcss: baseProps.xcss,
169
174
  isDisabled: baseProps.isDisabled,
@@ -1,12 +1,13 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
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"];
3
+ var _excluded = ["aria-label", "aria-labelledby", "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
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) {
9
9
  var preventedAriaLabel = _ref['aria-label'],
10
+ ariaLabelledBy = _ref['aria-labelledby'],
10
11
  analyticsContext = _ref.analyticsContext,
11
12
  appearance = _ref.appearance,
12
13
  autoFocus = _ref.autoFocus,
@@ -38,6 +39,7 @@ var LinkIconButtonBase = function LinkIconButtonBase(_ref, ref) {
38
39
  var baseProps = useIconButton({
39
40
  analyticsContext: analyticsContext,
40
41
  appearance: appearance,
42
+ ariaLabelledBy: ariaLabelledBy,
41
43
  autoFocus: autoFocus,
42
44
  buttonType: 'link',
43
45
  icon: icon,
@@ -59,6 +61,7 @@ var LinkIconButtonBase = function LinkIconButtonBase(_ref, ref) {
59
61
  ref: ref,
60
62
  shape: shape,
61
63
  spacing: spacing,
64
+ testId: testId,
62
65
  UNSAFE_size: UNSAFE_size
63
66
  });
64
67
  if (!isTooltipDisabled) {
@@ -82,6 +85,7 @@ var LinkIconButtonBase = function LinkIconButtonBase(_ref, ref) {
82
85
  return /*#__PURE__*/React.createElement(Anchor
83
86
  // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
84
87
  , _extends({}, rest, {
88
+ "aria-labelledby": baseProps['aria-labelledby'],
85
89
  testId: testId,
86
90
  componentName: "LinkIconButton",
87
91
  analyticsContext: analyticsContext,
@@ -157,6 +161,7 @@ var LinkIconButtonBase = function LinkIconButtonBase(_ref, ref) {
157
161
  return /*#__PURE__*/React.createElement(Anchor
158
162
  // eslint-disable-next-line @repo/internal/react/no-unsafe-spread-props
159
163
  , _extends({}, rest, {
164
+ "aria-labelledby": baseProps['aria-labelledby'],
160
165
  ref: baseProps.ref,
161
166
  xcss: baseProps.xcss,
162
167
  onClick: baseProps.onClick,