@atlaskit/button 17.16.0 → 17.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/CHANGELOG.md +20 -3
  2. package/__perf__/utils/interaction-tasks.tsx +2 -2
  3. package/codemods/15.0.0-lite-mode.tsx +3 -3
  4. package/codemods/15.1.1-data-testid.tsx +3 -3
  5. package/codemods/__tests__/_framework.tsx +1 -1
  6. package/codemods/helpers/15.0.0-runner.tsx +3 -3
  7. package/codemods/helpers/helpers-generic.tsx +4 -3
  8. package/codemods/optimistic-15.0.0-lite-mode.tsx +11 -4
  9. package/dist/cjs/new-button/variants/default/link.js +3 -3
  10. package/dist/cjs/new-button/variants/icon/button.js +3 -3
  11. package/dist/cjs/new-button/variants/icon/link.js +3 -3
  12. package/dist/cjs/new-button/variants/shared/use-button-base.js +25 -9
  13. package/dist/cjs/old-button/button.js +5 -3
  14. package/dist/cjs/old-button/loading-button.js +2 -0
  15. package/dist/cjs/old-button/shared/button-base.js +1 -1
  16. package/dist/es2019/new-button/variants/default/link.js +3 -3
  17. package/dist/es2019/new-button/variants/icon/button.js +3 -3
  18. package/dist/es2019/new-button/variants/icon/link.js +3 -3
  19. package/dist/es2019/new-button/variants/shared/use-button-base.js +25 -9
  20. package/dist/es2019/old-button/button.js +5 -3
  21. package/dist/es2019/old-button/loading-button.js +2 -0
  22. package/dist/es2019/old-button/shared/button-base.js +1 -1
  23. package/dist/esm/new-button/variants/default/link.js +3 -3
  24. package/dist/esm/new-button/variants/icon/button.js +3 -3
  25. package/dist/esm/new-button/variants/icon/link.js +3 -3
  26. package/dist/esm/new-button/variants/shared/use-button-base.js +25 -9
  27. package/dist/esm/old-button/button.js +5 -3
  28. package/dist/esm/old-button/loading-button.js +2 -0
  29. package/dist/esm/old-button/shared/button-base.js +1 -1
  30. package/dist/types/containers/button-group.d.ts +1 -1
  31. package/dist/types/new-button/containers/split-button/split-button-context.d.ts +1 -1
  32. package/dist/types/new-button/variants/default/link.d.ts +3 -3
  33. package/dist/types/new-button/variants/icon/button.d.ts +3 -3
  34. package/dist/types/new-button/variants/icon/link.d.ts +3 -3
  35. package/dist/types/new-button/variants/shared/loading-overlay.d.ts +1 -1
  36. package/dist/types/new-button/variants/types.d.ts +1 -1
  37. package/dist/types/old-button/button.d.ts +6 -4
  38. package/dist/types/old-button/custom-theme-button/custom-theme-button-types.d.ts +3 -3
  39. package/dist/types/old-button/custom-theme-button/theme.d.ts +2 -2
  40. package/dist/types/old-button/loading-button.d.ts +3 -1
  41. package/dist/types/old-button/shared/colors.d.ts +2 -2
  42. package/dist/types/old-button/shared/css.d.ts +3 -3
  43. package/dist/types/old-button/shared/get-is-only-single-icon.d.ts +1 -1
  44. package/dist/types/old-button/shared/loading-spinner.d.ts +1 -1
  45. package/dist/types/utils/variants.d.ts +1 -1
  46. package/dist/types-ts4.5/containers/button-group.d.ts +1 -1
  47. package/dist/types-ts4.5/new-button/containers/split-button/split-button-context.d.ts +1 -1
  48. package/dist/types-ts4.5/new-button/variants/default/link.d.ts +3 -3
  49. package/dist/types-ts4.5/new-button/variants/icon/button.d.ts +3 -3
  50. package/dist/types-ts4.5/new-button/variants/icon/link.d.ts +3 -3
  51. package/dist/types-ts4.5/new-button/variants/shared/loading-overlay.d.ts +1 -1
  52. package/dist/types-ts4.5/new-button/variants/types.d.ts +1 -1
  53. package/dist/types-ts4.5/old-button/button.d.ts +6 -4
  54. package/dist/types-ts4.5/old-button/custom-theme-button/custom-theme-button-types.d.ts +3 -3
  55. package/dist/types-ts4.5/old-button/custom-theme-button/theme.d.ts +2 -2
  56. package/dist/types-ts4.5/old-button/loading-button.d.ts +3 -1
  57. package/dist/types-ts4.5/old-button/shared/colors.d.ts +2 -2
  58. package/dist/types-ts4.5/old-button/shared/css.d.ts +3 -3
  59. package/dist/types-ts4.5/old-button/shared/get-is-only-single-icon.d.ts +1 -1
  60. package/dist/types-ts4.5/old-button/shared/loading-spinner.d.ts +1 -1
  61. package/dist/types-ts4.5/utils/variants.d.ts +1 -1
  62. package/extract-react-types/custom-theme-button-props.tsx +1 -1
  63. package/extract-react-types/legacy-button/custom-theme-button-props.tsx +1 -1
  64. package/extract-react-types/legacy-button/loading-button-props.tsx +1 -1
  65. package/extract-react-types/legacy-button/shared-props.tsx +1 -1
  66. package/extract-react-types/loading-button-props.tsx +1 -1
  67. package/extract-react-types/new-button/variants/default/button-props.tsx +1 -1
  68. package/extract-react-types/new-button/variants/icon-button/icon-button-props.tsx +1 -1
  69. package/extract-react-types/shared-props.tsx +1 -1
  70. package/package.json +64 -20
@@ -12,11 +12,13 @@ var isFirefox = typeof navigator !== 'undefined' && navigator.userAgent.toLowerC
12
12
  /**
13
13
  * __Button__
14
14
  *
15
+ * CAUTION: Legacy buttons will soon be deprecated. Please use the new Button components from `@atlaskit/button/new`.
16
+ *
15
17
  * A button triggers an event or action. They let users know what will happen next.
16
18
  *
17
- * - [Examples](https://atlassian.design/components/button/examples)
18
- * - [Code](https://atlassian.design/components/button/code)
19
- * - [Usage](https://atlassian.design/components/button/usage)
19
+ * - [Examples](https://atlassian.design/components/button/button-legacy/examples)
20
+ * - [Code](https://atlassian.design/components/button/button-legacy/code)
21
+ * - [Usage](https://atlassian.design/components/button/button-legacy/usage)
20
22
  */
21
23
  var Button = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function Button(_ref, ref) {
22
24
  var _ref$appearance = _ref.appearance,
@@ -7,6 +7,8 @@ import LoadingSpinner from './shared/loading-spinner';
7
7
  /**
8
8
  * __Loading button__
9
9
  *
10
+ * CAUTION: Legacy loading buttons will soon be deprecated. Please use the new Button components from `@atlaskit/button/new` with the `isLoading` prop.
11
+ *
10
12
  * A small wrapper around Button that allows you to show an @atlaskit/spinner as an overlay on the button when you set an isLoading prop to true.
11
13
  *
12
14
  * - [Examples](https://atlassian.design/components/button/examples#loading-button)
@@ -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.16.0",
123
+ packageVersion: "17.17.1",
124
124
  analyticsData: analyticsContext
125
125
  });
126
126
 
@@ -1,7 +1,7 @@
1
1
  /** @jsx jsx */
2
2
  import React from 'react';
3
3
  import { jsx } from '@emotion/react';
4
- import { Appearance } from '../old-button/types';
4
+ import { type Appearance } from '../old-button/types';
5
5
  export type ButtonGroupProps = {
6
6
  /**
7
7
  * The appearance to apply to all buttons.
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { SplitButtonAppearance, SplitButtonSpacing } from './types';
2
+ import { type SplitButtonAppearance, type SplitButtonSpacing } from './types';
3
3
  type NavigationSplitButtonContextProps = {
4
4
  appearance: 'navigation';
5
5
  isHighlighted: boolean;
@@ -8,9 +8,9 @@ declare const LinkButtonBase: <RouterLinkConfig extends Record<string, any> = ne
8
8
  *
9
9
  * Renders a link in the style of a button.
10
10
  *
11
- * - [Examples](https://atlassian.design/components/button/examples)
12
- * - [Code](https://atlassian.design/components/button/code)
13
- * - [Usage](https://atlassian.design/components/button/usage)
11
+ * - [Examples](https://atlassian.design/components/link-button/examples)
12
+ * - [Code](https://atlassian.design/components/link-button/code)
13
+ * - [Usage](https://atlassian.design/components/link-button/usage)
14
14
  */
15
15
  declare const LinkButton: <RouterLinkConfig extends Record<string, any> = never>(props: LinkButtonProps<RouterLinkConfig> & {
16
16
  ref?: Ref<HTMLAnchorElement>;
@@ -7,9 +7,9 @@ export type IconButtonProps = CommonIconButtonProps & CommonButtonVariantProps;
7
7
  *
8
8
  * TODO: Description
9
9
  *
10
- * - [Examples](https://atlassian.design/components/button/examples)
11
- * - [Code](https://atlassian.design/components/button/code)
12
- * - [Usage](https://atlassian.design/components/button/usage)
10
+ * - [Examples](https://atlassian.design/components/icon-button/examples)
11
+ * - [Code](https://atlassian.design/components/icon-button/code)
12
+ * - [Usage](https://atlassian.design/components/icon-button/usage)
13
13
  */
14
14
  declare const IconButton: React.MemoExoticComponent<React.ForwardRefExoticComponent<CommonIconButtonProps & import("../types").AdditionalButtonVariantProps & Omit<import("../types").AdditionalHTMLElementPropsExtender<Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "children">>, keyof import("../types").CommonButtonProps<TagName>> & import("../types").CommonButtonProps<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement>>>;
15
15
  export default IconButton;
@@ -8,9 +8,9 @@ declare const LinkIconButtonBase: <RouterLinkConfig extends Record<string, any>
8
8
  *
9
9
  * Renders a link in the style of an icon button.
10
10
  *
11
- * - [Examples](https://atlassian.design/components/button/examples)
12
- * - [Code](https://atlassian.design/components/button/code)
13
- * - [Usage](https://atlassian.design/components/button/usage)
11
+ * - [Examples](https://atlassian.design/components/link-icon-button/examples)
12
+ * - [Code](https://atlassian.design/components/link-icon-button/code)
13
+ * - [Usage](https://atlassian.design/components/link-icon-button/usage)
14
14
  */
15
15
  declare const LinkIconButton: <RouterLinkConfig extends Record<string, any> = never>(props: LinkIconButtonProps<RouterLinkConfig> & {
16
16
  ref?: Ref<HTMLAnchorElement>;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { Appearance, type ButtonSpacing } from '../types';
2
+ import { type Appearance, type ButtonSpacing } from '../types';
3
3
  export default function renderLoadingOverlay({ appearance, spacing, isDisabled, isSelected, }: {
4
4
  spacing?: ButtonSpacing;
5
5
  appearance?: Appearance;
@@ -84,7 +84,7 @@ export type CommonButtonVariantProps = AdditionalButtonVariantProps & CombinedBu
84
84
  */
85
85
  export type AdditionalCommonLinkVariantProps<RouterLinkConfig extends Record<string, any> = never> = {
86
86
  /**
87
- * Provides a URL for link buttons. When using an AppProvider with a configured router link component, a `RouterLinkConfig` object type can be provided for advanced usage. See the [Link Button routing example](/components/button/button-new/examples#routing) for more details.
87
+ * Provides a URL for link buttons. When using an AppProvider with a configured router link component, a `RouterLinkConfig` object type can be provided for advanced usage. See the [Link Button routing example](/components/button/examples#routing) for more details.
88
88
  */
89
89
  href: string | RouterLinkConfig;
90
90
  };
@@ -1,15 +1,17 @@
1
1
  import React from 'react';
2
- import { BaseProps } from './types';
2
+ import { type BaseProps } from './types';
3
3
  export interface ButtonProps extends BaseProps {
4
4
  }
5
5
  /**
6
6
  * __Button__
7
7
  *
8
+ * CAUTION: Legacy buttons will soon be deprecated. Please use the new Button components from `@atlaskit/button/new`.
9
+ *
8
10
  * A button triggers an event or action. They let users know what will happen next.
9
11
  *
10
- * - [Examples](https://atlassian.design/components/button/examples)
11
- * - [Code](https://atlassian.design/components/button/code)
12
- * - [Usage](https://atlassian.design/components/button/usage)
12
+ * - [Examples](https://atlassian.design/components/button/button-legacy/examples)
13
+ * - [Code](https://atlassian.design/components/button/button-legacy/code)
14
+ * - [Usage](https://atlassian.design/components/button/button-legacy/usage)
13
15
  */
14
16
  declare const Button: React.MemoExoticComponent<React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLElement>>>;
15
17
  export default Button;
@@ -1,6 +1,6 @@
1
- import { CSSObject } from '@emotion/react';
2
- import { ThemeModes } from '@atlaskit/theme/types';
3
- import { BaseProps } from '../types';
1
+ import { type CSSObject } from '@emotion/react';
2
+ import { type ThemeModes } from '@atlaskit/theme/types';
3
+ import { type BaseProps } from '../types';
4
4
  export type ThemeTokens = {
5
5
  buttonStyles: CSSObject;
6
6
  spinnerStyles: CSSObject;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { CSSObject } from '@emotion/react';
3
- import { ThemeProps, ThemeTokens } from './custom-theme-button-types';
2
+ import { type CSSObject } from '@emotion/react';
3
+ import { type ThemeProps, type ThemeTokens } from './custom-theme-button-types';
4
4
  export declare function getCustomCss({ appearance, spacing, mode, isSelected, shouldFitContainer, iconIsOnlyChild, isLoading, state, }: ThemeProps): CSSObject;
5
5
  export declare function getSpecifiers(styles: CSSObject): CSSObject;
6
6
  export declare function defaultThemeFn(current: (values: ThemeProps) => ThemeTokens, values: ThemeProps): ThemeTokens;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { BaseProps } from './types';
2
+ import { type BaseProps } from './types';
3
3
  export type LoadingButtonOwnProps = {
4
4
  isLoading?: boolean;
5
5
  };
@@ -7,6 +7,8 @@ export type LoadingButtonProps = Omit<BaseProps, 'overlay'> & LoadingButtonOwnPr
7
7
  /**
8
8
  * __Loading button__
9
9
  *
10
+ * CAUTION: Legacy loading buttons will soon be deprecated. Please use the new Button components from `@atlaskit/button/new` with the `isLoading` prop.
11
+ *
10
12
  * A small wrapper around Button that allows you to show an @atlaskit/spinner as an overlay on the button when you set an isLoading prop to true.
11
13
  *
12
14
  * - [Examples](https://atlassian.design/components/button/examples#loading-button)
@@ -1,5 +1,5 @@
1
- import { ThemeModes } from '@atlaskit/theme/types';
2
- import { Appearance } from '../types';
1
+ import { type ThemeModes } from '@atlaskit/theme/types';
2
+ import { type Appearance } from '../types';
3
3
  export type ColorRule = {
4
4
  [key in ThemeModes]: string;
5
5
  };
@@ -1,6 +1,6 @@
1
- import { CSSObject } from '@emotion/react';
2
- import { ThemeModes } from '@atlaskit/theme/types';
3
- import { Appearance, Spacing } from '../types';
1
+ import { type CSSObject } from '@emotion/react';
2
+ import { type ThemeModes } from '@atlaskit/theme/types';
3
+ import { type Appearance, type Spacing } from '../types';
4
4
  export type GetCssArgs = {
5
5
  appearance: Appearance;
6
6
  spacing: Spacing;
@@ -1,2 +1,2 @@
1
- import { BaseProps } from '../types';
1
+ import { type BaseProps } from '../types';
2
2
  export default function getIsOnlySingleIcon({ children, iconBefore, iconAfter, }: Pick<BaseProps, 'children' | 'iconBefore' | 'iconAfter'>): boolean;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { BaseProps } from '../types';
2
+ import { type BaseProps } from '../types';
3
3
  type LoadingSpinnerProps = Pick<BaseProps, 'appearance' | 'isDisabled' | 'isSelected' | 'spacing'>;
4
4
  export default function LoadingSpinner({ appearance, isDisabled, isSelected, spacing, }: LoadingSpinnerProps): JSX.Element;
5
5
  export {};
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import Button from '../new-button/variants/default/button';
3
- import { LinkButtonProps } from '../new-button/variants/default/link';
3
+ import { type LinkButtonProps } from '../new-button/variants/default/link';
4
4
  import { type IconButtonProps } from '../new-button/variants/icon/button';
5
5
  import { type LinkIconButtonProps } from '../new-button/variants/icon/link';
6
6
  import { buttonAppearances, iconButtonAppearances, linkButtonAppearances } from './appearances';
@@ -1,7 +1,7 @@
1
1
  /** @jsx jsx */
2
2
  import React from 'react';
3
3
  import { jsx } from '@emotion/react';
4
- import { Appearance } from '../old-button/types';
4
+ import { type Appearance } from '../old-button/types';
5
5
  export type ButtonGroupProps = {
6
6
  /**
7
7
  * The appearance to apply to all buttons.
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { SplitButtonAppearance, SplitButtonSpacing } from './types';
2
+ import { type SplitButtonAppearance, type SplitButtonSpacing } from './types';
3
3
  type NavigationSplitButtonContextProps = {
4
4
  appearance: 'navigation';
5
5
  isHighlighted: boolean;
@@ -8,9 +8,9 @@ declare const LinkButtonBase: <RouterLinkConfig extends Record<string, any> = ne
8
8
  *
9
9
  * Renders a link in the style of a button.
10
10
  *
11
- * - [Examples](https://atlassian.design/components/button/examples)
12
- * - [Code](https://atlassian.design/components/button/code)
13
- * - [Usage](https://atlassian.design/components/button/usage)
11
+ * - [Examples](https://atlassian.design/components/link-button/examples)
12
+ * - [Code](https://atlassian.design/components/link-button/code)
13
+ * - [Usage](https://atlassian.design/components/link-button/usage)
14
14
  */
15
15
  declare const LinkButton: <RouterLinkConfig extends Record<string, any> = never>(props: LinkButtonProps<RouterLinkConfig> & {
16
16
  ref?: Ref<HTMLAnchorElement>;
@@ -7,9 +7,9 @@ export type IconButtonProps = CommonIconButtonProps & CommonButtonVariantProps;
7
7
  *
8
8
  * TODO: Description
9
9
  *
10
- * - [Examples](https://atlassian.design/components/button/examples)
11
- * - [Code](https://atlassian.design/components/button/code)
12
- * - [Usage](https://atlassian.design/components/button/usage)
10
+ * - [Examples](https://atlassian.design/components/icon-button/examples)
11
+ * - [Code](https://atlassian.design/components/icon-button/code)
12
+ * - [Usage](https://atlassian.design/components/icon-button/usage)
13
13
  */
14
14
  declare const IconButton: React.MemoExoticComponent<React.ForwardRefExoticComponent<CommonIconButtonProps & import("../types").AdditionalButtonVariantProps & Omit<import("../types").AdditionalHTMLElementPropsExtender<Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "children">>, keyof import("../types").CommonButtonProps<TagName>> & import("../types").CommonButtonProps<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement>>>;
15
15
  export default IconButton;
@@ -8,9 +8,9 @@ declare const LinkIconButtonBase: <RouterLinkConfig extends Record<string, any>
8
8
  *
9
9
  * Renders a link in the style of an icon button.
10
10
  *
11
- * - [Examples](https://atlassian.design/components/button/examples)
12
- * - [Code](https://atlassian.design/components/button/code)
13
- * - [Usage](https://atlassian.design/components/button/usage)
11
+ * - [Examples](https://atlassian.design/components/link-icon-button/examples)
12
+ * - [Code](https://atlassian.design/components/link-icon-button/code)
13
+ * - [Usage](https://atlassian.design/components/link-icon-button/usage)
14
14
  */
15
15
  declare const LinkIconButton: <RouterLinkConfig extends Record<string, any> = never>(props: LinkIconButtonProps<RouterLinkConfig> & {
16
16
  ref?: Ref<HTMLAnchorElement>;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { Appearance, type ButtonSpacing } from '../types';
2
+ import { type Appearance, type ButtonSpacing } from '../types';
3
3
  export default function renderLoadingOverlay({ appearance, spacing, isDisabled, isSelected, }: {
4
4
  spacing?: ButtonSpacing;
5
5
  appearance?: Appearance;
@@ -84,7 +84,7 @@ export type CommonButtonVariantProps = AdditionalButtonVariantProps & CombinedBu
84
84
  */
85
85
  export type AdditionalCommonLinkVariantProps<RouterLinkConfig extends Record<string, any> = never> = {
86
86
  /**
87
- * Provides a URL for link buttons. When using an AppProvider with a configured router link component, a `RouterLinkConfig` object type can be provided for advanced usage. See the [Link Button routing example](/components/button/button-new/examples#routing) for more details.
87
+ * Provides a URL for link buttons. When using an AppProvider with a configured router link component, a `RouterLinkConfig` object type can be provided for advanced usage. See the [Link Button routing example](/components/button/examples#routing) for more details.
88
88
  */
89
89
  href: string | RouterLinkConfig;
90
90
  };
@@ -1,15 +1,17 @@
1
1
  import React from 'react';
2
- import { BaseProps } from './types';
2
+ import { type BaseProps } from './types';
3
3
  export interface ButtonProps extends BaseProps {
4
4
  }
5
5
  /**
6
6
  * __Button__
7
7
  *
8
+ * CAUTION: Legacy buttons will soon be deprecated. Please use the new Button components from `@atlaskit/button/new`.
9
+ *
8
10
  * A button triggers an event or action. They let users know what will happen next.
9
11
  *
10
- * - [Examples](https://atlassian.design/components/button/examples)
11
- * - [Code](https://atlassian.design/components/button/code)
12
- * - [Usage](https://atlassian.design/components/button/usage)
12
+ * - [Examples](https://atlassian.design/components/button/button-legacy/examples)
13
+ * - [Code](https://atlassian.design/components/button/button-legacy/code)
14
+ * - [Usage](https://atlassian.design/components/button/button-legacy/usage)
13
15
  */
14
16
  declare const Button: React.MemoExoticComponent<React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLElement>>>;
15
17
  export default Button;
@@ -1,6 +1,6 @@
1
- import { CSSObject } from '@emotion/react';
2
- import { ThemeModes } from '@atlaskit/theme/types';
3
- import { BaseProps } from '../types';
1
+ import { type CSSObject } from '@emotion/react';
2
+ import { type ThemeModes } from '@atlaskit/theme/types';
3
+ import { type BaseProps } from '../types';
4
4
  export type ThemeTokens = {
5
5
  buttonStyles: CSSObject;
6
6
  spinnerStyles: CSSObject;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { CSSObject } from '@emotion/react';
3
- import { ThemeProps, ThemeTokens } from './custom-theme-button-types';
2
+ import { type CSSObject } from '@emotion/react';
3
+ import { type ThemeProps, type ThemeTokens } from './custom-theme-button-types';
4
4
  export declare function getCustomCss({ appearance, spacing, mode, isSelected, shouldFitContainer, iconIsOnlyChild, isLoading, state, }: ThemeProps): CSSObject;
5
5
  export declare function getSpecifiers(styles: CSSObject): CSSObject;
6
6
  export declare function defaultThemeFn(current: (values: ThemeProps) => ThemeTokens, values: ThemeProps): ThemeTokens;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { BaseProps } from './types';
2
+ import { type BaseProps } from './types';
3
3
  export type LoadingButtonOwnProps = {
4
4
  isLoading?: boolean;
5
5
  };
@@ -7,6 +7,8 @@ export type LoadingButtonProps = Omit<BaseProps, 'overlay'> & LoadingButtonOwnPr
7
7
  /**
8
8
  * __Loading button__
9
9
  *
10
+ * CAUTION: Legacy loading buttons will soon be deprecated. Please use the new Button components from `@atlaskit/button/new` with the `isLoading` prop.
11
+ *
10
12
  * A small wrapper around Button that allows you to show an @atlaskit/spinner as an overlay on the button when you set an isLoading prop to true.
11
13
  *
12
14
  * - [Examples](https://atlassian.design/components/button/examples#loading-button)
@@ -1,5 +1,5 @@
1
- import { ThemeModes } from '@atlaskit/theme/types';
2
- import { Appearance } from '../types';
1
+ import { type ThemeModes } from '@atlaskit/theme/types';
2
+ import { type Appearance } from '../types';
3
3
  export type ColorRule = {
4
4
  [key in ThemeModes]: string;
5
5
  };
@@ -1,6 +1,6 @@
1
- import { CSSObject } from '@emotion/react';
2
- import { ThemeModes } from '@atlaskit/theme/types';
3
- import { Appearance, Spacing } from '../types';
1
+ import { type CSSObject } from '@emotion/react';
2
+ import { type ThemeModes } from '@atlaskit/theme/types';
3
+ import { type Appearance, type Spacing } from '../types';
4
4
  export type GetCssArgs = {
5
5
  appearance: Appearance;
6
6
  spacing: Spacing;
@@ -1,2 +1,2 @@
1
- import { BaseProps } from '../types';
1
+ import { type BaseProps } from '../types';
2
2
  export default function getIsOnlySingleIcon({ children, iconBefore, iconAfter, }: Pick<BaseProps, 'children' | 'iconBefore' | 'iconAfter'>): boolean;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { BaseProps } from '../types';
2
+ import { type BaseProps } from '../types';
3
3
  type LoadingSpinnerProps = Pick<BaseProps, 'appearance' | 'isDisabled' | 'isSelected' | 'spacing'>;
4
4
  export default function LoadingSpinner({ appearance, isDisabled, isSelected, spacing, }: LoadingSpinnerProps): JSX.Element;
5
5
  export {};
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import Button from '../new-button/variants/default/button';
3
- import { LinkButtonProps } from '../new-button/variants/default/link';
3
+ import { type LinkButtonProps } from '../new-button/variants/default/link';
4
4
  import { type IconButtonProps } from '../new-button/variants/icon/button';
5
5
  import { type LinkIconButtonProps } from '../new-button/variants/icon/link';
6
6
  import { buttonAppearances, iconButtonAppearances, linkButtonAppearances } from './appearances';
@@ -1,4 +1,4 @@
1
- import { CustomThemeButtonOwnProps } from '../src/old-button/custom-theme-button/custom-theme-button-types';
1
+ import { type CustomThemeButtonOwnProps } from '../src/old-button/custom-theme-button/custom-theme-button-types';
2
2
 
3
3
  export default function CustomThemeButtonProps(
4
4
  props: CustomThemeButtonOwnProps,
@@ -1,4 +1,4 @@
1
- import { CustomThemeButtonOwnProps } from '../../src/old-button/custom-theme-button/custom-theme-button-types';
1
+ import { type CustomThemeButtonOwnProps } from '../../src/old-button/custom-theme-button/custom-theme-button-types';
2
2
 
3
3
  export default function CustomThemeButtonProps(
4
4
  props: CustomThemeButtonOwnProps,
@@ -1,4 +1,4 @@
1
- import { LoadingButtonOwnProps } from '../../src/old-button/loading-button';
1
+ import { type LoadingButtonOwnProps } from '../../src/old-button/loading-button';
2
2
 
3
3
  export default function LoadingButtonProps(props: LoadingButtonOwnProps) {
4
4
  return null;
@@ -1,4 +1,4 @@
1
- import { BaseOwnProps } from '../../src/old-button/types';
1
+ import { type BaseOwnProps } from '../../src/old-button/types';
2
2
 
3
3
  export default function SharedProps(props: BaseOwnProps) {
4
4
  return null;
@@ -1,4 +1,4 @@
1
- import { LoadingButtonOwnProps } from '../src/old-button/loading-button';
1
+ import { type LoadingButtonOwnProps } from '../src/old-button/loading-button';
2
2
 
3
3
  export default function LoadingButtonProps(props: LoadingButtonOwnProps) {
4
4
  return null;
@@ -1,4 +1,4 @@
1
- import { AdditionalButtonVariantProps } from '../../../../src/new-button/variants/types';
1
+ import { type AdditionalButtonVariantProps } from '../../../../src/new-button/variants/types';
2
2
 
3
3
  export default function ButtonProps(props: AdditionalButtonVariantProps) {
4
4
  return null;
@@ -1,4 +1,4 @@
1
- import { AdditionalButtonVariantProps } from '../../../../src/new-button/variants/types';
1
+ import { type AdditionalButtonVariantProps } from '../../../../src/new-button/variants/types';
2
2
 
3
3
  export default function IconButtonProps(props: AdditionalButtonVariantProps) {
4
4
  return null;
@@ -1,4 +1,4 @@
1
- import { BaseOwnProps } from '../src/old-button/types';
1
+ import { type BaseOwnProps } from '../src/old-button/types';
2
2
 
3
3
  export default function SharedProps(props: BaseOwnProps) {
4
4
  return null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/button",
3
- "version": "17.16.0",
3
+ "version": "17.17.1",
4
4
  "description": "A button triggers an event or action. They let users know what will happen next.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -31,50 +31,88 @@
31
31
  "website": {
32
32
  "name": "Button",
33
33
  "category": "Components",
34
+ "status": {
35
+ "type": "beta",
36
+ "description": "New and ready to use. We'll provide comms and support for any major changes. Migrate from legacy buttons using our codemod.",
37
+ "actions": [
38
+ {
39
+ "text": "View the migration guide",
40
+ "href": "/components/button/button-legacy/migration-guide"
41
+ }
42
+ ]
43
+ },
34
44
  "subPages": [
35
45
  {
36
- "title": "Button (new)",
37
- "id": "button-new",
46
+ "title": "Icon button",
47
+ "id": "icon-button",
38
48
  "status": {
39
- "type": "beta"
49
+ "type": "beta",
50
+ "description": "New and ready to use. We'll provide comms and support for any major changes. Migrate from legacy buttons using our codemod.",
51
+ "actions": [
52
+ {
53
+ "text": "View the migration guide",
54
+ "href": "/components/button/button-legacy/migration-guide"
55
+ }
56
+ ]
40
57
  },
41
58
  "sortKey": 1
42
59
  },
43
60
  {
44
- "title": "Icon button",
45
- "id": "icon-button",
61
+ "title": "Link button",
62
+ "id": "link-button",
46
63
  "status": {
47
- "type": "beta"
64
+ "type": "beta",
65
+ "description": "New and ready to use. We'll provide comms and support for any major changes. Migrate from legacy buttons using our codemod.",
66
+ "actions": [
67
+ {
68
+ "text": "View the migration guide",
69
+ "href": "/components/button/button-legacy/migration-guide"
70
+ }
71
+ ]
48
72
  },
49
73
  "sortKey": 2
50
74
  },
51
75
  {
52
- "title": "Split button",
53
- "id": "split-button",
76
+ "title": "Link icon button",
77
+ "id": "link-icon-button",
54
78
  "status": {
55
- "type": "beta"
79
+ "type": "beta",
80
+ "description": "New and ready to use. We'll provide comms and support for any major changes. Migrate from legacy buttons using our codemod.",
81
+ "actions": [
82
+ {
83
+ "text": "View the migration guide",
84
+ "href": "/components/button/button-legacy/migration-guide"
85
+ }
86
+ ]
56
87
  },
57
88
  "sortKey": 3
58
89
  },
59
90
  {
60
- "title": "Link button",
61
- "id": "link-button",
91
+ "title": "Split button",
92
+ "id": "split-button",
62
93
  "status": {
63
94
  "type": "beta"
64
95
  },
65
96
  "sortKey": 4
66
97
  },
67
98
  {
68
- "title": "Link icon button",
69
- "id": "link-icon-button",
70
- "status": {
71
- "type": "beta"
72
- },
99
+ "title": "Button group",
100
+ "id": "button-group",
73
101
  "sortKey": 5
74
102
  },
75
103
  {
76
- "title": "Button group",
77
- "id": "button-group",
104
+ "title": "Button (legacy)",
105
+ "id": "button-legacy",
106
+ "status": {
107
+ "type": "intent-to-deprecate",
108
+ "description": "Legacy buttons will soon be deprecated. Please use the new [button](/components/button), [icon button](/components/button/icon-button), [link button](/components/button/link-button), or [link icon button](/components/button/link-icon-button). Migrate from legacy buttons using our codemod.",
109
+ "actions": [
110
+ {
111
+ "text": "View the migration guide",
112
+ "href": "/components/button/button-legacy/migration-guide"
113
+ }
114
+ ]
115
+ },
78
116
  "sortKey": 6
79
117
  }
80
118
  ]
@@ -96,6 +134,7 @@
96
134
  "@atlaskit/focus-ring": "^1.4.0",
97
135
  "@atlaskit/icon": "^22.3.0",
98
136
  "@atlaskit/interaction-context": "^2.1.0",
137
+ "@atlaskit/platform-feature-flags": "^0.2.5",
99
138
  "@atlaskit/primitives": "^6.3.0",
100
139
  "@atlaskit/spinner": "^16.1.0",
101
140
  "@atlaskit/theme": "^12.8.0",
@@ -156,5 +195,10 @@
156
195
  }
157
196
  },
158
197
  "homepage": "https://atlassian.design/components/button/",
159
- "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
198
+ "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1",
199
+ "platform-feature-flags": {
200
+ "platform.design-system-team.button-tokenised-typography-styles": {
201
+ "type": "boolean"
202
+ }
203
+ }
160
204
  }