@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.
- package/CHANGELOG.md +56 -1
- package/__perf__/button.tsx +6 -6
- package/__perf__/custom.tsx +6 -6
- package/__perf__/customised.tsx +1 -3
- package/__perf__/utils/example-runner.tsx +32 -36
- package/__perf__/utils/interaction-tasks.tsx +65 -86
- package/codemods/15.0.0-lite-mode.tsx +32 -36
- package/codemods/15.1.1-data-testid.tsx +136 -142
- package/codemods/__tests__/15.0.0-lite-mode/optimistic.tsx +121 -121
- package/codemods/__tests__/15.0.0-lite-mode/safe.tsx +54 -54
- package/codemods/__tests__/15.0.0-lite-mode/shared.tsx +96 -97
- package/codemods/__tests__/15.1.1-data-testid/rename-data-testid.tsx +32 -32
- package/codemods/__tests__/_framework.tsx +32 -32
- package/codemods/helpers/15.0.0-runner.tsx +135 -137
- package/codemods/helpers/helpers-generic.tsx +524 -556
- package/codemods/optimistic-15.0.0-lite-mode.tsx +208 -231
- package/dist/cjs/containers/button-group.js +3 -1
- package/dist/cjs/new-button/containers/split-button/split-button.js +6 -2
- package/dist/cjs/new-button/variants/default/button.js +8 -1
- package/dist/cjs/new-button/variants/default/link.js +8 -1
- package/dist/cjs/new-button/variants/default/use-default-button.js +7 -1
- package/dist/cjs/new-button/variants/icon/button.js +6 -1
- package/dist/cjs/new-button/variants/icon/link.js +6 -1
- package/dist/cjs/new-button/variants/icon/use-icon-button.js +7 -1
- package/dist/cjs/new-button/variants/shared/constants.js +7 -0
- package/dist/cjs/new-button/variants/shared/loading-overlay.js +4 -3
- package/dist/cjs/new-button/variants/shared/use-button-base.js +54 -2
- package/dist/cjs/old-button/button.js +1 -1
- package/dist/cjs/old-button/custom-theme-button/custom-theme-button.js +1 -1
- package/dist/cjs/old-button/custom-theme-button/theme.js +1 -1
- package/dist/cjs/old-button/shared/button-base.js +9 -3
- package/dist/cjs/old-button/shared/css.js +4 -3
- package/dist/es2019/containers/button-group.js +3 -1
- package/dist/es2019/new-button/containers/split-button/split-button.js +5 -2
- package/dist/es2019/new-button/variants/default/button.js +7 -0
- package/dist/es2019/new-button/variants/default/link.js +9 -2
- package/dist/es2019/new-button/variants/default/use-default-button.js +7 -1
- package/dist/es2019/new-button/variants/icon/button.js +5 -0
- package/dist/es2019/new-button/variants/icon/link.js +8 -3
- package/dist/es2019/new-button/variants/icon/use-icon-button.js +7 -1
- package/dist/es2019/new-button/variants/shared/constants.js +1 -0
- package/dist/es2019/new-button/variants/shared/loading-overlay.js +4 -3
- package/dist/es2019/new-button/variants/shared/use-button-base.js +54 -2
- package/dist/es2019/old-button/button.js +3 -0
- package/dist/es2019/old-button/custom-theme-button/custom-theme-button.js +3 -0
- package/dist/es2019/old-button/custom-theme-button/theme.js +2 -0
- package/dist/es2019/old-button/shared/button-base.js +10 -3
- package/dist/es2019/old-button/shared/css.js +4 -2
- package/dist/esm/containers/button-group.js +3 -1
- package/dist/esm/new-button/containers/split-button/split-button.js +5 -2
- package/dist/esm/new-button/variants/default/button.js +8 -1
- package/dist/esm/new-button/variants/default/link.js +10 -3
- package/dist/esm/new-button/variants/default/use-default-button.js +7 -1
- package/dist/esm/new-button/variants/icon/button.js +6 -1
- package/dist/esm/new-button/variants/icon/link.js +9 -4
- package/dist/esm/new-button/variants/icon/use-icon-button.js +7 -1
- package/dist/esm/new-button/variants/shared/constants.js +1 -0
- package/dist/esm/new-button/variants/shared/loading-overlay.js +4 -3
- package/dist/esm/new-button/variants/shared/use-button-base.js +54 -2
- package/dist/esm/old-button/button.js +3 -0
- package/dist/esm/old-button/custom-theme-button/custom-theme-button.js +3 -0
- package/dist/esm/old-button/custom-theme-button/theme.js +2 -0
- package/dist/esm/old-button/shared/button-base.js +10 -3
- package/dist/esm/old-button/shared/css.js +4 -2
- package/dist/types/entry-points/loading-button.d.ts +1 -1
- package/dist/types/entry-points/new.d.ts +3 -3
- package/dist/types/entry-points/types.d.ts +2 -2
- package/dist/types/index.d.ts +3 -3
- package/dist/types/new-button/variants/default/link.d.ts +1 -1
- package/dist/types/new-button/variants/default/types.d.ts +1 -1
- package/dist/types/new-button/variants/default/use-default-button.d.ts +4 -3
- package/dist/types/new-button/variants/icon/link.d.ts +1 -1
- package/dist/types/new-button/variants/icon/use-icon-button.d.ts +4 -3
- package/dist/types/new-button/variants/shared/constants.d.ts +1 -0
- package/dist/types/new-button/variants/shared/loading-overlay.d.ts +2 -1
- package/dist/types/new-button/variants/shared/use-button-base.d.ts +5 -1
- package/dist/types/new.d.ts +3 -3
- package/dist/types-ts4.5/entry-points/loading-button.d.ts +1 -1
- package/dist/types-ts4.5/entry-points/new.d.ts +3 -3
- package/dist/types-ts4.5/entry-points/types.d.ts +2 -2
- package/dist/types-ts4.5/index.d.ts +3 -3
- package/dist/types-ts4.5/new-button/variants/default/link.d.ts +1 -1
- package/dist/types-ts4.5/new-button/variants/default/types.d.ts +1 -1
- package/dist/types-ts4.5/new-button/variants/default/use-default-button.d.ts +4 -3
- package/dist/types-ts4.5/new-button/variants/icon/link.d.ts +1 -1
- package/dist/types-ts4.5/new-button/variants/icon/use-icon-button.d.ts +4 -3
- package/dist/types-ts4.5/new-button/variants/shared/constants.d.ts +1 -0
- package/dist/types-ts4.5/new-button/variants/shared/loading-overlay.d.ts +2 -1
- package/dist/types-ts4.5/new-button/variants/shared/use-button-base.d.ts +5 -1
- package/dist/types-ts4.5/new.d.ts +3 -3
- package/extract-react-types/custom-theme-button-props.tsx +2 -4
- package/extract-react-types/legacy-button/custom-theme-button-props.tsx +2 -4
- package/extract-react-types/legacy-button/loading-button-props.tsx +1 -1
- package/extract-react-types/legacy-button/shared-props.tsx +1 -1
- package/extract-react-types/loading-button-props.tsx +1 -1
- package/extract-react-types/new-button/containers/split-button/split-button-props.tsx +1 -1
- package/extract-react-types/new-button/variants/default/button-props.tsx +1 -1
- package/extract-react-types/new-button/variants/default/common-default-button-props.tsx +4 -4
- package/extract-react-types/new-button/variants/default/link-button-props.tsx +4 -4
- package/extract-react-types/new-button/variants/icon-button/common-icon-button-props.tsx +4 -4
- package/extract-react-types/new-button/variants/icon-button/icon-button-props.tsx +1 -1
- package/extract-react-types/new-button/variants/icon-button/link-icon-button-props.tsx +2 -4
- package/extract-react-types/shared-props.tsx +1 -1
- package/package.json +202 -201
- package/report.api.md +78 -96
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default } from '../old-button/loading-button';
|
|
2
|
-
export type { LoadingButtonProps, LoadingButtonOwnProps
|
|
2
|
+
export type { LoadingButtonProps, LoadingButtonOwnProps } from '../old-button/loading-button';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { default, type ButtonProps
|
|
2
|
-
export { default as LinkButton, type LinkButtonProps
|
|
3
|
-
export { default as IconButton, type IconButtonProps
|
|
1
|
+
export { default, type ButtonProps } from '../new-button/variants/default/button';
|
|
2
|
+
export { default as LinkButton, type LinkButtonProps } from '../new-button/variants/default/link';
|
|
3
|
+
export { default as IconButton, type IconButtonProps } from '../new-button/variants/icon/button';
|
|
4
4
|
export { default as LinkIconButton, type LinkIconButtonProps, } from '../new-button/variants/icon/link';
|
|
5
5
|
export { SplitButton } from '../new-button/containers/split-button';
|
|
6
6
|
export type { Appearance, Spacing } from '../new-button/variants/types';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { Appearance, Spacing, BaseOwnProps, BaseProps
|
|
1
|
+
export type { Appearance, Spacing, BaseOwnProps, BaseProps } from '../old-button/types';
|
|
2
2
|
export type { ButtonProps } from './standard-button';
|
|
3
|
-
export type { LoadingButtonProps, LoadingButtonOwnProps
|
|
3
|
+
export type { LoadingButtonProps, LoadingButtonOwnProps } from './loading-button';
|
|
4
4
|
export type { ThemeTokens, ThemeProps, InteractionState, CustomThemeButtonProps, CustomThemeButtonOwnProps, } from './custom-theme-button';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export type { Appearance, Spacing, BaseOwnProps, BaseProps
|
|
1
|
+
export type { Appearance, Spacing, BaseOwnProps, BaseProps } from './entry-points/types';
|
|
2
2
|
export { default, } from './entry-points/standard-button';
|
|
3
3
|
export type { ButtonProps } from './entry-points/standard-button';
|
|
4
4
|
export { default as LoadingButton } from './entry-points/loading-button';
|
|
5
|
-
export type { LoadingButtonProps, LoadingButtonOwnProps
|
|
6
|
-
export { default as CustomThemeButton, Theme
|
|
5
|
+
export type { LoadingButtonProps, LoadingButtonOwnProps } from './entry-points/loading-button';
|
|
6
|
+
export { default as CustomThemeButton, Theme } from './entry-points/custom-theme-button';
|
|
7
7
|
export type { ThemeTokens, ThemeProps, InteractionState, CustomThemeButtonProps, CustomThemeButtonOwnProps, } from './entry-points/custom-theme-button';
|
|
8
8
|
export { default as ButtonGroup } from './entry-points/button-group';
|
|
9
9
|
export type { ButtonGroupProps } from './entry-points/button-group';
|
|
@@ -2,7 +2,7 @@ import { type Ref } from 'react';
|
|
|
2
2
|
import { type AdditionalDefaultLinkVariantProps, type CommonLinkVariantProps } from '../types';
|
|
3
3
|
import { type CommonDefaultButtonProps } from './types';
|
|
4
4
|
export type LinkButtonProps<RouterLinkConfig extends Record<string, any> = never> = CommonDefaultButtonProps & CommonLinkVariantProps<RouterLinkConfig> & AdditionalDefaultLinkVariantProps;
|
|
5
|
-
declare const LinkButtonBase: <RouterLinkConfig extends Record<string, any> = never>({ 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, ...rest }: LinkButtonProps<RouterLinkConfig>, ref: Ref<HTMLAnchorElement>) => JSX.Element;
|
|
5
|
+
declare const LinkButtonBase: <RouterLinkConfig extends Record<string, any> = never>({ analyticsContext, appearance, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, 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, ...rest }: LinkButtonProps<RouterLinkConfig>, ref: Ref<HTMLAnchorElement>) => JSX.Element;
|
|
6
6
|
/**
|
|
7
7
|
* __Link Button__
|
|
8
8
|
*
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { type ButtonSpacing, type IconProp, type IconSize } from '../types';
|
|
3
3
|
export type CommonDefaultButtonProps = {
|
|
4
4
|
/**
|
|
5
|
-
* Text content to be rendered in the button.
|
|
5
|
+
* Text content to be rendered in the button.
|
|
6
6
|
*/
|
|
7
7
|
children: React.ReactNode;
|
|
8
8
|
/**
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type UseButtonBaseArgs, type UseButtonBaseReturn } from '../shared/use-button-base';
|
|
2
|
-
import {
|
|
3
|
-
type
|
|
2
|
+
import type { CommonButtonProps } from '../types';
|
|
3
|
+
import type { CommonDefaultButtonProps } from './types';
|
|
4
|
+
type UseDefaultButtonArgs<TagName extends HTMLElement> = UseButtonBaseArgs<TagName> & CommonDefaultButtonProps & Pick<CommonButtonProps<TagName>, 'testId'>;
|
|
4
5
|
type UseButtonReturn<TagName extends HTMLElement> = UseButtonBaseReturn<TagName>;
|
|
5
6
|
/**
|
|
6
7
|
* __Use default button base__
|
|
@@ -11,5 +12,5 @@ type UseButtonReturn<TagName extends HTMLElement> = UseButtonBaseReturn<TagName>
|
|
|
11
12
|
*
|
|
12
13
|
* @private
|
|
13
14
|
*/
|
|
14
|
-
declare const useDefaultButton: <TagName extends HTMLElement>({ analyticsContext, appearance, autoFocus, buttonType, children, iconAfter: IconAfter, iconBefore: IconBefore, interactionName, isDisabled, isLoading, isSelected, onClick, onClickCapture, onKeyDownCapture, onKeyUpCapture, onMouseDownCapture, onMouseUpCapture, onPointerDownCapture, onPointerUpCapture, onTouchEndCapture, onTouchStartCapture, overlay, ref, shouldFitContainer, spacing, UNSAFE_iconAfter_size, UNSAFE_iconBefore_size, }: UseDefaultButtonArgs<TagName>) => UseButtonReturn<TagName>;
|
|
15
|
+
declare const useDefaultButton: <TagName extends HTMLElement>({ analyticsContext, appearance, ariaLabel, ariaLabelledBy, autoFocus, buttonType, children, iconAfter: IconAfter, iconBefore: IconBefore, interactionName, isDisabled, isLoading, isSelected, onClick, onClickCapture, onKeyDownCapture, onKeyUpCapture, onMouseDownCapture, onMouseUpCapture, onPointerDownCapture, onPointerUpCapture, onTouchEndCapture, onTouchStartCapture, overlay, ref, shouldFitContainer, spacing, testId, UNSAFE_iconAfter_size, UNSAFE_iconBefore_size, }: UseDefaultButtonArgs<TagName>) => UseButtonReturn<TagName>;
|
|
15
16
|
export default useDefaultButton;
|
|
@@ -2,7 +2,7 @@ import { type Ref } from 'react';
|
|
|
2
2
|
import { type CommonLinkVariantProps } from '../types';
|
|
3
3
|
import { type CommonIconButtonProps } from './types';
|
|
4
4
|
export type LinkIconButtonProps<RouterLinkConfig extends Record<string, any> = never> = CommonIconButtonProps & CommonLinkVariantProps<RouterLinkConfig>;
|
|
5
|
-
declare const LinkIconButtonBase: <RouterLinkConfig extends Record<string, any> = never>({ "aria-label": preventedAriaLabel, 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, ...rest }: LinkIconButtonProps<RouterLinkConfig>, ref: Ref<HTMLAnchorElement>) => JSX.Element;
|
|
5
|
+
declare const LinkIconButtonBase: <RouterLinkConfig extends Record<string, any> = never>({ "aria-label": preventedAriaLabel, "aria-labelledby": ariaLabelledBy, 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, ...rest }: LinkIconButtonProps<RouterLinkConfig>, ref: Ref<HTMLAnchorElement>) => JSX.Element;
|
|
6
6
|
/**
|
|
7
7
|
* __Link Icon Button__
|
|
8
8
|
*
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type UseButtonBaseArgs, type UseButtonBaseReturn } from '../shared/use-button-base';
|
|
2
|
-
import {
|
|
3
|
-
type
|
|
2
|
+
import type { CommonButtonProps } from '../types';
|
|
3
|
+
import type { CommonIconButtonProps } from './types';
|
|
4
|
+
type UseIconButtonArgs<TagName extends HTMLElement> = Omit<UseButtonBaseArgs<TagName>, 'children'> & Omit<CommonIconButtonProps, 'isTooltipDisabled' | 'tooltip'> & Pick<CommonButtonProps<TagName>, 'testId'>;
|
|
4
5
|
type UseIconButtonReturn<TagName extends HTMLElement> = UseButtonBaseReturn<TagName>;
|
|
5
6
|
/**
|
|
6
7
|
* __Use icon button__
|
|
@@ -11,5 +12,5 @@ type UseIconButtonReturn<TagName extends HTMLElement> = UseButtonBaseReturn<TagN
|
|
|
11
12
|
*
|
|
12
13
|
* @private
|
|
13
14
|
*/
|
|
14
|
-
declare const useIconButton: <TagName extends HTMLElement>({ analyticsContext, appearance, autoFocus, buttonType, icon: Icon, interactionName, isDisabled, isLoading, isSelected, label, onClick, onClickCapture, onKeyDownCapture, onKeyUpCapture, onMouseDownCapture, onMouseUpCapture, onPointerDownCapture, onPointerUpCapture, onTouchEndCapture, onTouchStartCapture, overlay, ref, shape, shouldFitContainer, spacing, UNSAFE_size, }: UseIconButtonArgs<TagName>) => UseIconButtonReturn<TagName>;
|
|
15
|
+
declare const useIconButton: <TagName extends HTMLElement>({ analyticsContext, appearance, ariaLabel, ariaLabelledBy, autoFocus, buttonType, icon: Icon, interactionName, isDisabled, isLoading, isSelected, label, onClick, onClickCapture, onKeyDownCapture, onKeyUpCapture, onMouseDownCapture, onMouseUpCapture, onPointerDownCapture, onPointerUpCapture, onTouchEndCapture, onTouchStartCapture, overlay, ref, shape, shouldFitContainer, spacing, testId, UNSAFE_size, }: UseIconButtonArgs<TagName>) => UseIconButtonReturn<TagName>;
|
|
15
16
|
export default useIconButton;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const LOADING_LABEL = ", Loading";
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { type Appearance, type ButtonSpacing } from '../types';
|
|
3
|
-
export default function renderLoadingOverlay({ appearance, spacing, isDisabled, isSelected, }: {
|
|
3
|
+
export default function renderLoadingOverlay({ appearance, spacing, isDisabled, isSelected, testId, }: {
|
|
4
4
|
spacing?: ButtonSpacing;
|
|
5
5
|
appearance?: Appearance;
|
|
6
6
|
isDisabled?: boolean;
|
|
7
7
|
isSelected?: boolean;
|
|
8
|
+
testId?: string;
|
|
8
9
|
}): JSX.Element;
|
|
@@ -17,6 +17,8 @@ export type UseButtonBaseArgs<TagName extends HTMLElement> = {
|
|
|
17
17
|
children: React.ReactNode;
|
|
18
18
|
spacing?: Spacing;
|
|
19
19
|
isLoading?: boolean;
|
|
20
|
+
ariaLabel?: string;
|
|
21
|
+
ariaLabelledBy?: string;
|
|
20
22
|
} & Pick<CommonButtonProps<TagName>, 'analyticsContext' | 'autoFocus' | 'interactionName' | 'isDisabled' | 'isSelected' | 'overlay'> & ControlledEvents<TagName>;
|
|
21
23
|
type XCSS = ReturnType<typeof xcss>;
|
|
22
24
|
export type UseButtonBaseReturn<TagName extends HTMLElement> = {
|
|
@@ -24,6 +26,8 @@ export type UseButtonBaseReturn<TagName extends HTMLElement> = {
|
|
|
24
26
|
ref(node: TagName | null): void;
|
|
25
27
|
children: React.ReactNode;
|
|
26
28
|
isDisabled: boolean;
|
|
29
|
+
'aria-label'?: string;
|
|
30
|
+
'aria-labelledby'?: string;
|
|
27
31
|
} & ControlledEvents<TagName>;
|
|
28
32
|
/**
|
|
29
33
|
* __Use button base__
|
|
@@ -38,5 +42,5 @@ export type UseButtonBaseReturn<TagName extends HTMLElement> = {
|
|
|
38
42
|
*
|
|
39
43
|
* @private
|
|
40
44
|
*/
|
|
41
|
-
declare const useButtonBase: <TagName extends HTMLElement>({ appearance: propAppearance, autoFocus, isDisabled: propIsDisabled, isLoading, isSelected, isIconButton, isCircle, hasIconBefore, hasIconAfter, children, onClick, onMouseDownCapture, onMouseUpCapture, onKeyDownCapture, onKeyUpCapture, onTouchStartCapture, onTouchEndCapture, onPointerDownCapture, onPointerUpCapture, onClickCapture, overlay, ref, shouldFitContainer, spacing: propSpacing, }: UseButtonBaseArgs<TagName>) => UseButtonBaseReturn<TagName>;
|
|
45
|
+
declare const useButtonBase: <TagName extends HTMLElement>({ appearance: propAppearance, autoFocus, isDisabled: propIsDisabled, isLoading, isSelected, isIconButton, isCircle, hasIconBefore, hasIconAfter, children, onClick, onMouseDownCapture, onMouseUpCapture, onKeyDownCapture, onKeyUpCapture, onTouchStartCapture, onTouchEndCapture, onPointerDownCapture, onPointerUpCapture, onClickCapture, overlay, ref, shouldFitContainer, spacing: propSpacing, ariaLabel, ariaLabelledBy, }: UseButtonBaseArgs<TagName>) => UseButtonBaseReturn<TagName>;
|
|
42
46
|
export default useButtonBase;
|
package/dist/types/new.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { default, type ButtonProps
|
|
2
|
-
export { default as LinkButton, type LinkButtonProps
|
|
3
|
-
export { default as IconButton, type IconButtonProps
|
|
1
|
+
export { default, type ButtonProps } from './new-button/variants/default/button';
|
|
2
|
+
export { default as LinkButton, type LinkButtonProps } from './new-button/variants/default/link';
|
|
3
|
+
export { default as IconButton, type IconButtonProps } from './new-button/variants/icon/button';
|
|
4
4
|
export { default as LinkIconButton, type LinkIconButtonProps, } from './new-button/variants/icon/link';
|
|
5
5
|
export { SplitButton } from './new-button/containers/split-button';
|
|
6
6
|
export type { Appearance, Spacing } from './new-button/variants/types';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default } from '../old-button/loading-button';
|
|
2
|
-
export type { LoadingButtonProps, LoadingButtonOwnProps
|
|
2
|
+
export type { LoadingButtonProps, LoadingButtonOwnProps } from '../old-button/loading-button';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { default, type ButtonProps
|
|
2
|
-
export { default as LinkButton, type LinkButtonProps
|
|
3
|
-
export { default as IconButton, type IconButtonProps
|
|
1
|
+
export { default, type ButtonProps } from '../new-button/variants/default/button';
|
|
2
|
+
export { default as LinkButton, type LinkButtonProps } from '../new-button/variants/default/link';
|
|
3
|
+
export { default as IconButton, type IconButtonProps } from '../new-button/variants/icon/button';
|
|
4
4
|
export { default as LinkIconButton, type LinkIconButtonProps, } from '../new-button/variants/icon/link';
|
|
5
5
|
export { SplitButton } from '../new-button/containers/split-button';
|
|
6
6
|
export type { Appearance, Spacing } from '../new-button/variants/types';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { Appearance, Spacing, BaseOwnProps, BaseProps
|
|
1
|
+
export type { Appearance, Spacing, BaseOwnProps, BaseProps } from '../old-button/types';
|
|
2
2
|
export type { ButtonProps } from './standard-button';
|
|
3
|
-
export type { LoadingButtonProps, LoadingButtonOwnProps
|
|
3
|
+
export type { LoadingButtonProps, LoadingButtonOwnProps } from './loading-button';
|
|
4
4
|
export type { ThemeTokens, ThemeProps, InteractionState, CustomThemeButtonProps, CustomThemeButtonOwnProps, } from './custom-theme-button';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export type { Appearance, Spacing, BaseOwnProps, BaseProps
|
|
1
|
+
export type { Appearance, Spacing, BaseOwnProps, BaseProps } from './entry-points/types';
|
|
2
2
|
export { default, } from './entry-points/standard-button';
|
|
3
3
|
export type { ButtonProps } from './entry-points/standard-button';
|
|
4
4
|
export { default as LoadingButton } from './entry-points/loading-button';
|
|
5
|
-
export type { LoadingButtonProps, LoadingButtonOwnProps
|
|
6
|
-
export { default as CustomThemeButton, Theme
|
|
5
|
+
export type { LoadingButtonProps, LoadingButtonOwnProps } from './entry-points/loading-button';
|
|
6
|
+
export { default as CustomThemeButton, Theme } from './entry-points/custom-theme-button';
|
|
7
7
|
export type { ThemeTokens, ThemeProps, InteractionState, CustomThemeButtonProps, CustomThemeButtonOwnProps, } from './entry-points/custom-theme-button';
|
|
8
8
|
export { default as ButtonGroup } from './entry-points/button-group';
|
|
9
9
|
export type { ButtonGroupProps } from './entry-points/button-group';
|
|
@@ -2,7 +2,7 @@ import { type Ref } from 'react';
|
|
|
2
2
|
import { type AdditionalDefaultLinkVariantProps, type CommonLinkVariantProps } from '../types';
|
|
3
3
|
import { type CommonDefaultButtonProps } from './types';
|
|
4
4
|
export type LinkButtonProps<RouterLinkConfig extends Record<string, any> = never> = CommonDefaultButtonProps & CommonLinkVariantProps<RouterLinkConfig> & AdditionalDefaultLinkVariantProps;
|
|
5
|
-
declare const LinkButtonBase: <RouterLinkConfig extends Record<string, any> = never>({ 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, ...rest }: LinkButtonProps<RouterLinkConfig>, ref: Ref<HTMLAnchorElement>) => JSX.Element;
|
|
5
|
+
declare const LinkButtonBase: <RouterLinkConfig extends Record<string, any> = never>({ analyticsContext, appearance, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, 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, ...rest }: LinkButtonProps<RouterLinkConfig>, ref: Ref<HTMLAnchorElement>) => JSX.Element;
|
|
6
6
|
/**
|
|
7
7
|
* __Link Button__
|
|
8
8
|
*
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { type ButtonSpacing, type IconProp, type IconSize } from '../types';
|
|
3
3
|
export type CommonDefaultButtonProps = {
|
|
4
4
|
/**
|
|
5
|
-
* Text content to be rendered in the button.
|
|
5
|
+
* Text content to be rendered in the button.
|
|
6
6
|
*/
|
|
7
7
|
children: React.ReactNode;
|
|
8
8
|
/**
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type UseButtonBaseArgs, type UseButtonBaseReturn } from '../shared/use-button-base';
|
|
2
|
-
import {
|
|
3
|
-
type
|
|
2
|
+
import type { CommonButtonProps } from '../types';
|
|
3
|
+
import type { CommonDefaultButtonProps } from './types';
|
|
4
|
+
type UseDefaultButtonArgs<TagName extends HTMLElement> = UseButtonBaseArgs<TagName> & CommonDefaultButtonProps & Pick<CommonButtonProps<TagName>, 'testId'>;
|
|
4
5
|
type UseButtonReturn<TagName extends HTMLElement> = UseButtonBaseReturn<TagName>;
|
|
5
6
|
/**
|
|
6
7
|
* __Use default button base__
|
|
@@ -11,5 +12,5 @@ type UseButtonReturn<TagName extends HTMLElement> = UseButtonBaseReturn<TagName>
|
|
|
11
12
|
*
|
|
12
13
|
* @private
|
|
13
14
|
*/
|
|
14
|
-
declare const useDefaultButton: <TagName extends HTMLElement>({ analyticsContext, appearance, autoFocus, buttonType, children, iconAfter: IconAfter, iconBefore: IconBefore, interactionName, isDisabled, isLoading, isSelected, onClick, onClickCapture, onKeyDownCapture, onKeyUpCapture, onMouseDownCapture, onMouseUpCapture, onPointerDownCapture, onPointerUpCapture, onTouchEndCapture, onTouchStartCapture, overlay, ref, shouldFitContainer, spacing, UNSAFE_iconAfter_size, UNSAFE_iconBefore_size, }: UseDefaultButtonArgs<TagName>) => UseButtonReturn<TagName>;
|
|
15
|
+
declare const useDefaultButton: <TagName extends HTMLElement>({ analyticsContext, appearance, ariaLabel, ariaLabelledBy, autoFocus, buttonType, children, iconAfter: IconAfter, iconBefore: IconBefore, interactionName, isDisabled, isLoading, isSelected, onClick, onClickCapture, onKeyDownCapture, onKeyUpCapture, onMouseDownCapture, onMouseUpCapture, onPointerDownCapture, onPointerUpCapture, onTouchEndCapture, onTouchStartCapture, overlay, ref, shouldFitContainer, spacing, testId, UNSAFE_iconAfter_size, UNSAFE_iconBefore_size, }: UseDefaultButtonArgs<TagName>) => UseButtonReturn<TagName>;
|
|
15
16
|
export default useDefaultButton;
|
|
@@ -2,7 +2,7 @@ import { type Ref } from 'react';
|
|
|
2
2
|
import { type CommonLinkVariantProps } from '../types';
|
|
3
3
|
import { type CommonIconButtonProps } from './types';
|
|
4
4
|
export type LinkIconButtonProps<RouterLinkConfig extends Record<string, any> = never> = CommonIconButtonProps & CommonLinkVariantProps<RouterLinkConfig>;
|
|
5
|
-
declare const LinkIconButtonBase: <RouterLinkConfig extends Record<string, any> = never>({ "aria-label": preventedAriaLabel, 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, ...rest }: LinkIconButtonProps<RouterLinkConfig>, ref: Ref<HTMLAnchorElement>) => JSX.Element;
|
|
5
|
+
declare const LinkIconButtonBase: <RouterLinkConfig extends Record<string, any> = never>({ "aria-label": preventedAriaLabel, "aria-labelledby": ariaLabelledBy, 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, ...rest }: LinkIconButtonProps<RouterLinkConfig>, ref: Ref<HTMLAnchorElement>) => JSX.Element;
|
|
6
6
|
/**
|
|
7
7
|
* __Link Icon Button__
|
|
8
8
|
*
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type UseButtonBaseArgs, type UseButtonBaseReturn } from '../shared/use-button-base';
|
|
2
|
-
import {
|
|
3
|
-
type
|
|
2
|
+
import type { CommonButtonProps } from '../types';
|
|
3
|
+
import type { CommonIconButtonProps } from './types';
|
|
4
|
+
type UseIconButtonArgs<TagName extends HTMLElement> = Omit<UseButtonBaseArgs<TagName>, 'children'> & Omit<CommonIconButtonProps, 'isTooltipDisabled' | 'tooltip'> & Pick<CommonButtonProps<TagName>, 'testId'>;
|
|
4
5
|
type UseIconButtonReturn<TagName extends HTMLElement> = UseButtonBaseReturn<TagName>;
|
|
5
6
|
/**
|
|
6
7
|
* __Use icon button__
|
|
@@ -11,5 +12,5 @@ type UseIconButtonReturn<TagName extends HTMLElement> = UseButtonBaseReturn<TagN
|
|
|
11
12
|
*
|
|
12
13
|
* @private
|
|
13
14
|
*/
|
|
14
|
-
declare const useIconButton: <TagName extends HTMLElement>({ analyticsContext, appearance, autoFocus, buttonType, icon: Icon, interactionName, isDisabled, isLoading, isSelected, label, onClick, onClickCapture, onKeyDownCapture, onKeyUpCapture, onMouseDownCapture, onMouseUpCapture, onPointerDownCapture, onPointerUpCapture, onTouchEndCapture, onTouchStartCapture, overlay, ref, shape, shouldFitContainer, spacing, UNSAFE_size, }: UseIconButtonArgs<TagName>) => UseIconButtonReturn<TagName>;
|
|
15
|
+
declare const useIconButton: <TagName extends HTMLElement>({ analyticsContext, appearance, ariaLabel, ariaLabelledBy, autoFocus, buttonType, icon: Icon, interactionName, isDisabled, isLoading, isSelected, label, onClick, onClickCapture, onKeyDownCapture, onKeyUpCapture, onMouseDownCapture, onMouseUpCapture, onPointerDownCapture, onPointerUpCapture, onTouchEndCapture, onTouchStartCapture, overlay, ref, shape, shouldFitContainer, spacing, testId, UNSAFE_size, }: UseIconButtonArgs<TagName>) => UseIconButtonReturn<TagName>;
|
|
15
16
|
export default useIconButton;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const LOADING_LABEL = ", Loading";
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { type Appearance, type ButtonSpacing } from '../types';
|
|
3
|
-
export default function renderLoadingOverlay({ appearance, spacing, isDisabled, isSelected, }: {
|
|
3
|
+
export default function renderLoadingOverlay({ appearance, spacing, isDisabled, isSelected, testId, }: {
|
|
4
4
|
spacing?: ButtonSpacing;
|
|
5
5
|
appearance?: Appearance;
|
|
6
6
|
isDisabled?: boolean;
|
|
7
7
|
isSelected?: boolean;
|
|
8
|
+
testId?: string;
|
|
8
9
|
}): JSX.Element;
|
|
@@ -17,6 +17,8 @@ export type UseButtonBaseArgs<TagName extends HTMLElement> = {
|
|
|
17
17
|
children: React.ReactNode;
|
|
18
18
|
spacing?: Spacing;
|
|
19
19
|
isLoading?: boolean;
|
|
20
|
+
ariaLabel?: string;
|
|
21
|
+
ariaLabelledBy?: string;
|
|
20
22
|
} & Pick<CommonButtonProps<TagName>, 'analyticsContext' | 'autoFocus' | 'interactionName' | 'isDisabled' | 'isSelected' | 'overlay'> & ControlledEvents<TagName>;
|
|
21
23
|
type XCSS = ReturnType<typeof xcss>;
|
|
22
24
|
export type UseButtonBaseReturn<TagName extends HTMLElement> = {
|
|
@@ -24,6 +26,8 @@ export type UseButtonBaseReturn<TagName extends HTMLElement> = {
|
|
|
24
26
|
ref(node: TagName | null): void;
|
|
25
27
|
children: React.ReactNode;
|
|
26
28
|
isDisabled: boolean;
|
|
29
|
+
'aria-label'?: string;
|
|
30
|
+
'aria-labelledby'?: string;
|
|
27
31
|
} & ControlledEvents<TagName>;
|
|
28
32
|
/**
|
|
29
33
|
* __Use button base__
|
|
@@ -38,5 +42,5 @@ export type UseButtonBaseReturn<TagName extends HTMLElement> = {
|
|
|
38
42
|
*
|
|
39
43
|
* @private
|
|
40
44
|
*/
|
|
41
|
-
declare const useButtonBase: <TagName extends HTMLElement>({ appearance: propAppearance, autoFocus, isDisabled: propIsDisabled, isLoading, isSelected, isIconButton, isCircle, hasIconBefore, hasIconAfter, children, onClick, onMouseDownCapture, onMouseUpCapture, onKeyDownCapture, onKeyUpCapture, onTouchStartCapture, onTouchEndCapture, onPointerDownCapture, onPointerUpCapture, onClickCapture, overlay, ref, shouldFitContainer, spacing: propSpacing, }: UseButtonBaseArgs<TagName>) => UseButtonBaseReturn<TagName>;
|
|
45
|
+
declare const useButtonBase: <TagName extends HTMLElement>({ appearance: propAppearance, autoFocus, isDisabled: propIsDisabled, isLoading, isSelected, isIconButton, isCircle, hasIconBefore, hasIconAfter, children, onClick, onMouseDownCapture, onMouseUpCapture, onKeyDownCapture, onKeyUpCapture, onTouchStartCapture, onTouchEndCapture, onPointerDownCapture, onPointerUpCapture, onClickCapture, overlay, ref, shouldFitContainer, spacing: propSpacing, ariaLabel, ariaLabelledBy, }: UseButtonBaseArgs<TagName>) => UseButtonBaseReturn<TagName>;
|
|
42
46
|
export default useButtonBase;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { default, type ButtonProps
|
|
2
|
-
export { default as LinkButton, type LinkButtonProps
|
|
3
|
-
export { default as IconButton, type IconButtonProps
|
|
1
|
+
export { default, type ButtonProps } from './new-button/variants/default/button';
|
|
2
|
+
export { default as LinkButton, type LinkButtonProps } from './new-button/variants/default/link';
|
|
3
|
+
export { default as IconButton, type IconButtonProps } from './new-button/variants/icon/button';
|
|
4
4
|
export { default as LinkIconButton, type LinkIconButtonProps, } from './new-button/variants/icon/link';
|
|
5
5
|
export { SplitButton } from './new-button/containers/split-button';
|
|
6
6
|
export type { Appearance, Spacing } from './new-button/variants/types';
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { type CustomThemeButtonOwnProps } from '../src/old-button/custom-theme-button/custom-theme-button-types';
|
|
2
2
|
|
|
3
|
-
export default function CustomThemeButtonProps(
|
|
4
|
-
|
|
5
|
-
) {
|
|
6
|
-
return null;
|
|
3
|
+
export default function CustomThemeButtonProps(props: CustomThemeButtonOwnProps) {
|
|
4
|
+
return null;
|
|
7
5
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { type CustomThemeButtonOwnProps } from '../../src/old-button/custom-theme-button/custom-theme-button-types';
|
|
2
2
|
|
|
3
|
-
export default function CustomThemeButtonProps(
|
|
4
|
-
|
|
5
|
-
) {
|
|
6
|
-
return null;
|
|
3
|
+
export default function CustomThemeButtonProps(props: CustomThemeButtonOwnProps) {
|
|
4
|
+
return null;
|
|
7
5
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { type CommonDefaultButtonProps } from '../../../../src/new-button/variants/default/types';
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
type CommonButtonProps,
|
|
4
|
+
type SupportedElements,
|
|
5
5
|
} from '../../../../src/new-button/variants/types';
|
|
6
6
|
|
|
7
7
|
export default function CommonDefaultButtonProps(
|
|
8
|
-
|
|
8
|
+
props: CommonButtonProps<SupportedElements> & CommonDefaultButtonProps,
|
|
9
9
|
) {
|
|
10
|
-
|
|
10
|
+
return null;
|
|
11
11
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
type AdditionalCommonLinkVariantProps,
|
|
3
|
+
type AdditionalDefaultLinkVariantProps,
|
|
4
4
|
} from '../../../../src/new-button/variants/types';
|
|
5
5
|
|
|
6
6
|
export default function LinkButtonProps(
|
|
7
|
-
|
|
7
|
+
props: AdditionalCommonLinkVariantProps & AdditionalDefaultLinkVariantProps,
|
|
8
8
|
) {
|
|
9
|
-
|
|
9
|
+
return null;
|
|
10
10
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { type CommonIconButtonProps } from '../../../../src/new-button/variants/icon/types';
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
type CommonButtonProps,
|
|
4
|
+
type SupportedElements,
|
|
5
5
|
} from '../../../../src/new-button/variants/types';
|
|
6
6
|
|
|
7
7
|
export default function CommonProps(
|
|
8
|
-
|
|
8
|
+
props: CommonButtonProps<SupportedElements> & CommonIconButtonProps,
|
|
9
9
|
) {
|
|
10
|
-
|
|
10
|
+
return null;
|
|
11
11
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { type AdditionalCommonLinkVariantProps } from '../../../../src/new-button/variants/types';
|
|
2
2
|
|
|
3
|
-
export default function LinkButtonProps(
|
|
4
|
-
|
|
5
|
-
) {
|
|
6
|
-
return null;
|
|
3
|
+
export default function LinkButtonProps(props: AdditionalCommonLinkVariantProps) {
|
|
4
|
+
return null;
|
|
7
5
|
}
|