@atlaskit/button 18.4.0 → 19.0.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 +54 -0
- package/dist/cjs/containers/button-group.js +2 -8
- package/dist/cjs/new-button/containers/split-button/split-button.js +2 -2
- package/dist/cjs/new-button/variants/default/button.js +3 -7
- package/dist/cjs/new-button/variants/default/link.js +3 -7
- package/dist/cjs/new-button/variants/default/use-default-button.js +3 -7
- package/dist/cjs/new-button/variants/icon/button.js +2 -4
- package/dist/cjs/new-button/variants/icon/link.js +2 -4
- package/dist/cjs/new-button/variants/icon/use-icon-button.js +2 -4
- package/dist/cjs/new-button/variants/shared/icon-renderer.js +1 -4
- package/dist/cjs/new-button/variants/shared/use-button-base.js +2 -2
- package/dist/cjs/old-button/shared/button-base.js +6 -3
- package/dist/cjs/old-button/shared/css.js +3 -3
- package/dist/es2019/containers/button-group.js +1 -7
- package/dist/es2019/new-button/containers/split-button/split-button.js +2 -2
- package/dist/es2019/new-button/variants/default/button.js +3 -7
- package/dist/es2019/new-button/variants/default/link.js +3 -7
- package/dist/es2019/new-button/variants/default/use-default-button.js +3 -7
- package/dist/es2019/new-button/variants/icon/button.js +1 -3
- package/dist/es2019/new-button/variants/icon/link.js +1 -3
- package/dist/es2019/new-button/variants/icon/use-icon-button.js +2 -4
- package/dist/es2019/new-button/variants/shared/icon-renderer.js +1 -4
- package/dist/es2019/new-button/variants/shared/use-button-base.js +2 -2
- package/dist/es2019/old-button/shared/button-base.js +6 -3
- package/dist/es2019/old-button/shared/css.js +3 -3
- package/dist/esm/containers/button-group.js +2 -8
- package/dist/esm/new-button/containers/split-button/split-button.js +2 -2
- package/dist/esm/new-button/variants/default/button.js +4 -8
- package/dist/esm/new-button/variants/default/link.js +4 -8
- package/dist/esm/new-button/variants/default/use-default-button.js +3 -7
- package/dist/esm/new-button/variants/icon/button.js +2 -4
- package/dist/esm/new-button/variants/icon/link.js +2 -4
- package/dist/esm/new-button/variants/icon/use-icon-button.js +2 -4
- package/dist/esm/new-button/variants/shared/icon-renderer.js +1 -4
- package/dist/esm/new-button/variants/shared/use-button-base.js +2 -2
- package/dist/esm/old-button/shared/button-base.js +6 -3
- package/dist/esm/old-button/shared/css.js +3 -3
- package/dist/types/containers/button-group.d.ts +1 -8
- package/dist/types/new-button/variants/default/link.d.ts +1 -1
- package/dist/types/new-button/variants/default/types.d.ts +1 -15
- package/dist/types/new-button/variants/default/use-default-button.d.ts +1 -1
- package/dist/types/new-button/variants/icon/link.d.ts +1 -1
- package/dist/types/new-button/variants/icon/types.d.ts +1 -8
- package/dist/types/new-button/variants/icon/use-icon-button.d.ts +1 -1
- package/dist/types/new-button/variants/shared/icon-renderer.d.ts +1 -3
- package/dist/types/old-button/shared/button-base.d.ts +2 -2
- package/dist/types-ts4.5/containers/button-group.d.ts +1 -8
- 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 -15
- package/dist/types-ts4.5/new-button/variants/default/use-default-button.d.ts +1 -1
- package/dist/types-ts4.5/new-button/variants/icon/link.d.ts +1 -1
- package/dist/types-ts4.5/new-button/variants/icon/types.d.ts +1 -8
- package/dist/types-ts4.5/new-button/variants/icon/use-icon-button.d.ts +1 -1
- package/dist/types-ts4.5/new-button/variants/shared/icon-renderer.d.ts +1 -3
- package/dist/types-ts4.5/old-button/shared/button-base.d.ts +2 -2
- package/package.json +3 -23
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { type ButtonSpacing, type IconProp
|
|
2
|
+
import { type ButtonSpacing, type IconProp } from '../types';
|
|
3
3
|
export type CommonDefaultButtonProps = {
|
|
4
4
|
/**
|
|
5
5
|
* Text content to be rendered in the button.
|
|
@@ -9,24 +9,10 @@ export type CommonDefaultButtonProps = {
|
|
|
9
9
|
* Places an icon within the button, after the button's text.
|
|
10
10
|
*/
|
|
11
11
|
iconAfter?: IconProp;
|
|
12
|
-
/**
|
|
13
|
-
* @deprecated Prefer `iconAfter` render prop for icon customizations.
|
|
14
|
-
*
|
|
15
|
-
* Set the size of the icon after. `medium` is default, so it does not need to be specified.
|
|
16
|
-
* This is UNSAFE as it will be removed in future in favor of a 100% bounded API
|
|
17
|
-
*/
|
|
18
|
-
UNSAFE_iconAfter_size?: IconSize;
|
|
19
12
|
/**
|
|
20
13
|
* Places an icon within the button, before the button's text.
|
|
21
14
|
*/
|
|
22
15
|
iconBefore?: IconProp;
|
|
23
|
-
/**
|
|
24
|
-
* @deprecated Prefer `iconBefore` render prop for icon customizations.
|
|
25
|
-
*
|
|
26
|
-
* Set the size of the icon before. `medium` is default, so it does not need to be specified.
|
|
27
|
-
* This is UNSAFE as it will be removed in future in favor of a 100% bounded API
|
|
28
|
-
*/
|
|
29
|
-
UNSAFE_iconBefore_size?: IconSize;
|
|
30
16
|
/**
|
|
31
17
|
* Option to fit button width to its parent width.
|
|
32
18
|
*/
|
|
@@ -12,5 +12,5 @@ type UseButtonReturn<TagName extends HTMLElement> = UseButtonBaseReturn<TagName>
|
|
|
12
12
|
*
|
|
13
13
|
* @private
|
|
14
14
|
*/
|
|
15
|
-
declare const useDefaultButton: <TagName extends HTMLElement>({ analyticsContext, appearance, ariaLabel, ariaLabelledBy, autoFocus, buttonType, children, iconAfter, iconBefore, interactionName, isDisabled, isLoading, isSelected, onClick, onClickCapture, onKeyDownCapture, onKeyUpCapture, onMouseDownCapture, onMouseUpCapture, onPointerDownCapture, onPointerUpCapture, onTouchEndCapture, onTouchStartCapture, ref, shouldFitContainer, spacing, testId,
|
|
15
|
+
declare const useDefaultButton: <TagName extends HTMLElement>({ analyticsContext, appearance, ariaLabel, ariaLabelledBy, autoFocus, buttonType, children, iconAfter, iconBefore, interactionName, isDisabled, isLoading, isSelected, onClick, onClickCapture, onKeyDownCapture, onKeyUpCapture, onMouseDownCapture, onMouseUpCapture, onPointerDownCapture, onPointerUpCapture, onTouchEndCapture, onTouchStartCapture, ref, shouldFitContainer, spacing, testId, }: UseDefaultButtonArgs<TagName>) => UseButtonReturn<TagName>;
|
|
16
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, "aria-labelledby": ariaLabelledBy, analyticsContext, appearance, autoFocus, href, icon, interactionName, isDisabled, isSelected, isTooltipDisabled, label, onClick, onClickCapture, onKeyDownCapture, onKeyUpCapture, onMouseDownCapture, onMouseUpCapture, onPointerDownCapture, onPointerUpCapture, onTouchEndCapture, onTouchStartCapture, shape, spacing, testId, tooltip,
|
|
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, shape, spacing, testId, tooltip, ...unsafeRest }: LinkIconButtonProps<RouterLinkConfig>, ref: Ref<HTMLAnchorElement>) => JSX.Element;
|
|
6
6
|
/**
|
|
7
7
|
* __Link Icon Button__
|
|
8
8
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { type TooltipProps } from '@atlaskit/tooltip';
|
|
3
|
-
import { type IconButtonAppearance, type IconButtonSpacing, type IconProp
|
|
3
|
+
import { type IconButtonAppearance, type IconButtonSpacing, type IconProp } from '../types';
|
|
4
4
|
export type CommonIconButtonProps = {
|
|
5
5
|
'aria-label'?: never;
|
|
6
6
|
/**
|
|
@@ -31,11 +31,4 @@ export type CommonIconButtonProps = {
|
|
|
31
31
|
* Props passed down to the Tooltip component.
|
|
32
32
|
*/
|
|
33
33
|
tooltip?: Partial<Omit<TooltipProps, 'children'>>;
|
|
34
|
-
/**
|
|
35
|
-
* @deprecated Prefer `icon` render prop for icon customizations.
|
|
36
|
-
*
|
|
37
|
-
* Set the size of the icon. `medium` is default, so it does not need to be specified.
|
|
38
|
-
* This is UNSAFE as it will be removed in future in favor of a 100% bounded API.
|
|
39
|
-
*/
|
|
40
|
-
UNSAFE_size?: IconSize;
|
|
41
34
|
};
|
|
@@ -12,5 +12,5 @@ type UseIconButtonReturn<TagName extends HTMLElement> = UseButtonBaseReturn<TagN
|
|
|
12
12
|
*
|
|
13
13
|
* @private
|
|
14
14
|
*/
|
|
15
|
-
declare const useIconButton: <TagName extends HTMLElement>({ analyticsContext, appearance, ariaLabel, ariaLabelledBy, autoFocus, buttonType, icon, interactionName, isDisabled, isLoading, isSelected, label, onClick, onClickCapture, onKeyDownCapture, onKeyUpCapture, onMouseDownCapture, onMouseUpCapture, onPointerDownCapture, onPointerUpCapture, onTouchEndCapture, onTouchStartCapture, ref, shape, shouldFitContainer, spacing, testId,
|
|
15
|
+
declare const useIconButton: <TagName extends HTMLElement>({ analyticsContext, appearance, ariaLabel, ariaLabelledBy, autoFocus, buttonType, icon, interactionName, isDisabled, isLoading, isSelected, label, onClick, onClickCapture, onKeyDownCapture, onKeyUpCapture, onMouseDownCapture, onMouseUpCapture, onPointerDownCapture, onPointerUpCapture, onTouchEndCapture, onTouchStartCapture, ref, shape, shouldFitContainer, spacing, testId, }: UseIconButtonArgs<TagName>) => UseIconButtonReturn<TagName>;
|
|
16
16
|
export default useIconButton;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { type IconProps, type UNSAFE_NewIconProps } from '@atlaskit/icon/types';
|
|
3
2
|
import { type IconProp } from '../types';
|
|
4
3
|
/**
|
|
5
4
|
* __Icon renderer__
|
|
@@ -7,8 +6,7 @@ import { type IconProp } from '../types';
|
|
|
7
6
|
* Used to support render props with icons.
|
|
8
7
|
*
|
|
9
8
|
*/
|
|
10
|
-
declare const IconRenderer: ({ icon: Icon
|
|
9
|
+
declare const IconRenderer: ({ icon: Icon }: {
|
|
11
10
|
icon: IconProp;
|
|
12
|
-
size: IconProps['size'] | UNSAFE_NewIconProps['LEGACY_size'];
|
|
13
11
|
}) => JSX.Element;
|
|
14
12
|
export default IconRenderer;
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
/** @jsx jsx */
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { type CSSObject } from '@emotion/react';
|
|
7
|
-
declare const
|
|
7
|
+
declare const ButtonBase: React.ForwardRefExoticComponent<Omit<Omit<Omit<React.AllHTMLAttributes<HTMLElement>, "disabled">, "data-testid" | "data-has-overlay"> & {
|
|
8
8
|
'data-testid'?: undefined;
|
|
9
9
|
'data-has-overlay'?: undefined;
|
|
10
10
|
}, keyof import("../types").BaseOwnProps> & import("../types").BaseOwnProps & {
|
|
11
11
|
buttonCss: CSSObject;
|
|
12
12
|
} & React.RefAttributes<HTMLElement>>;
|
|
13
|
-
export default
|
|
13
|
+
export default ButtonBase;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/button",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "19.0.0",
|
|
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/"
|
|
@@ -138,7 +138,7 @@
|
|
|
138
138
|
"@atlaskit/primitives": "^11.0.0",
|
|
139
139
|
"@atlaskit/spinner": "^16.2.0",
|
|
140
140
|
"@atlaskit/theme": "^12.11.0",
|
|
141
|
-
"@atlaskit/tokens": "^1.
|
|
141
|
+
"@atlaskit/tokens": "^1.56.0",
|
|
142
142
|
"@atlaskit/tooltip": "^18.5.0",
|
|
143
143
|
"@atlaskit/visually-hidden": "^1.4.0",
|
|
144
144
|
"@babel/runtime": "^7.0.0",
|
|
@@ -176,32 +176,12 @@
|
|
|
176
176
|
"typescript": "~5.4.2",
|
|
177
177
|
"wait-for-expect": "^1.2.0"
|
|
178
178
|
},
|
|
179
|
-
"techstack": {
|
|
180
|
-
"@atlassian/frontend": {
|
|
181
|
-
"import-structure": "atlassian-conventions"
|
|
182
|
-
},
|
|
183
|
-
"@repo/internal": {
|
|
184
|
-
"dom-events": "use-bind-event-listener",
|
|
185
|
-
"design-system": "v1",
|
|
186
|
-
"ui-components": "lite-mode",
|
|
187
|
-
"analytics": "analytics-next",
|
|
188
|
-
"design-tokens": [
|
|
189
|
-
"color",
|
|
190
|
-
"spacing"
|
|
191
|
-
],
|
|
192
|
-
"deprecation": "no-deprecated-imports",
|
|
193
|
-
"styling": [
|
|
194
|
-
"emotion",
|
|
195
|
-
"static"
|
|
196
|
-
]
|
|
197
|
-
}
|
|
198
|
-
},
|
|
199
179
|
"homepage": "https://atlassian.design/components/button/",
|
|
200
180
|
"platform-feature-flags": {
|
|
201
181
|
"platform.design-system-team.button-tokenised-typography-styles": {
|
|
202
182
|
"type": "boolean"
|
|
203
183
|
},
|
|
204
|
-
"platform
|
|
184
|
+
"platform-component-visual-refresh": {
|
|
205
185
|
"type": "boolean"
|
|
206
186
|
},
|
|
207
187
|
"platform.design-system-team.remove-unsafe-spread-from-new-button_a2xhw": {
|