@atlaskit/button 16.3.1 → 16.3.4
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 +18 -0
- package/__perf__/utils/example-runner.tsx +6 -7
- package/dist/cjs/shared/button-base.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/shared/button-base.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/shared/button-base.js +1 -1
- package/dist/esm/version.json +1 -1
- package/package.json +9 -6
- package/report.api.md +164 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/button
|
|
2
2
|
|
|
3
|
+
## 16.3.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`65a90f6ba14`](https://bitbucket.org/atlassian/atlassian-frontend/commits/65a90f6ba14) - Use medium icons for button examples
|
|
8
|
+
|
|
9
|
+
## 16.3.3
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`8a5bdb3c844`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8a5bdb3c844) - Upgrading internal dependency (bind-event-listener) for improved internal types
|
|
14
|
+
|
|
15
|
+
## 16.3.2
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
3
21
|
## 16.3.1
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React, { useLayoutEffect, useRef, useState } from 'react';
|
|
2
2
|
|
|
3
|
+
import { bindAll } from 'bind-event-listener';
|
|
4
|
+
|
|
3
5
|
import type { ButtonProps } from '../../src';
|
|
4
6
|
|
|
5
7
|
export default function Example({
|
|
@@ -24,13 +26,10 @@ export default function Example({
|
|
|
24
26
|
throw new Error('Could not find button ref');
|
|
25
27
|
}
|
|
26
28
|
|
|
27
|
-
el
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
el.removeEventListener('toggle-select', toggleSelect);
|
|
32
|
-
el.removeEventListener('toggle-disabled', toggleDisabled);
|
|
33
|
-
};
|
|
29
|
+
return bindAll(el, [
|
|
30
|
+
{ type: 'toggle-select', listener: toggleSelect },
|
|
31
|
+
{ type: 'toggle-disabled', listener: toggleDisabled },
|
|
32
|
+
]);
|
|
34
33
|
}, []);
|
|
35
34
|
|
|
36
35
|
return (
|
|
@@ -101,7 +101,7 @@ var _default = /*#__PURE__*/_react.default.forwardRef(function ButtonBase(props,
|
|
|
101
101
|
action: 'clicked',
|
|
102
102
|
componentName: 'button',
|
|
103
103
|
packageName: "@atlaskit/button",
|
|
104
|
-
packageVersion: "16.3.
|
|
104
|
+
packageVersion: "16.3.4",
|
|
105
105
|
analyticsData: analyticsContext
|
|
106
106
|
}); // Button currently calls preventDefault, which is not standard button behaviour
|
|
107
107
|
|
package/dist/cjs/version.json
CHANGED
|
@@ -70,7 +70,7 @@ export default /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref) {
|
|
|
70
70
|
action: 'clicked',
|
|
71
71
|
componentName: 'button',
|
|
72
72
|
packageName: "@atlaskit/button",
|
|
73
|
-
packageVersion: "16.3.
|
|
73
|
+
packageVersion: "16.3.4",
|
|
74
74
|
analyticsData: analyticsContext
|
|
75
75
|
}); // Button currently calls preventDefault, which is not standard button behaviour
|
|
76
76
|
|
package/dist/es2019/version.json
CHANGED
|
@@ -79,7 +79,7 @@ export default /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref) {
|
|
|
79
79
|
action: 'clicked',
|
|
80
80
|
componentName: 'button',
|
|
81
81
|
packageName: "@atlaskit/button",
|
|
82
|
-
packageVersion: "16.3.
|
|
82
|
+
packageVersion: "16.3.4",
|
|
83
83
|
analyticsData: analyticsContext
|
|
84
84
|
}); // Button currently calls preventDefault, which is not standard button behaviour
|
|
85
85
|
|
package/dist/esm/version.json
CHANGED
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/button",
|
|
3
|
-
"version": "16.3.
|
|
3
|
+
"version": "16.3.4",
|
|
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/"
|
|
7
7
|
},
|
|
8
|
-
"repository": "https://bitbucket.org/atlassian/atlassian-frontend",
|
|
8
|
+
"repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
|
|
9
9
|
"author": "Atlassian Pty Ltd",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"main": "dist/cjs/index.js",
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
"team": "Design System Team",
|
|
19
19
|
"releaseModel": "scheduled",
|
|
20
20
|
"website": {
|
|
21
|
-
"name": "Button"
|
|
21
|
+
"name": "Button",
|
|
22
|
+
"category": "Components"
|
|
22
23
|
}
|
|
23
24
|
},
|
|
24
25
|
"af:exports": {
|
|
@@ -31,7 +32,7 @@
|
|
|
31
32
|
},
|
|
32
33
|
"dependencies": {
|
|
33
34
|
"@atlaskit/analytics-next": "^8.2.0",
|
|
34
|
-
"@atlaskit/ds-lib": "^
|
|
35
|
+
"@atlaskit/ds-lib": "^2.0.0",
|
|
35
36
|
"@atlaskit/spinner": "^15.1.0",
|
|
36
37
|
"@atlaskit/theme": "^12.1.0",
|
|
37
38
|
"@atlaskit/tokens": "^0.10.0",
|
|
@@ -45,9 +46,9 @@
|
|
|
45
46
|
"@atlaskit/checkbox": "^12.3.0",
|
|
46
47
|
"@atlaskit/docs": "*",
|
|
47
48
|
"@atlaskit/icon": "^21.10.0",
|
|
48
|
-
"@atlaskit/logo": "^13.
|
|
49
|
+
"@atlaskit/logo": "^13.7.0",
|
|
49
50
|
"@atlaskit/section-message": "^6.1.0",
|
|
50
|
-
"@atlaskit/select": "^15.
|
|
51
|
+
"@atlaskit/select": "^15.3.0",
|
|
51
52
|
"@atlaskit/ssr": "*",
|
|
52
53
|
"@atlaskit/visual-regression": "*",
|
|
53
54
|
"@atlaskit/webdriver-runner": "*",
|
|
@@ -55,6 +56,7 @@
|
|
|
55
56
|
"@testing-library/react": "^8.0.1",
|
|
56
57
|
"@types/react-router-dom": "^4.3.1",
|
|
57
58
|
"ast-types": "^0.13.3",
|
|
59
|
+
"bind-event-listener": "^2.1.1",
|
|
58
60
|
"jest-emotion": "^10.0.32",
|
|
59
61
|
"jest-in-case": "^1.0.2",
|
|
60
62
|
"jscodeshift": "^0.13.0",
|
|
@@ -70,6 +72,7 @@
|
|
|
70
72
|
"import-structure": "atlassian-conventions"
|
|
71
73
|
},
|
|
72
74
|
"@repo/internal": {
|
|
75
|
+
"dom-events": "use-bind-event-listener",
|
|
73
76
|
"ui-components": "lite-mode",
|
|
74
77
|
"analytics": "analytics-next",
|
|
75
78
|
"theming": "tokens",
|
package/report.api.md
ADDED
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
## API Report File for "@atlaskit/button"
|
|
2
|
+
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
/// <reference types="react" />
|
|
7
|
+
|
|
8
|
+
import { ComponentType } from 'react';
|
|
9
|
+
import { CSSObject } from '@emotion/core';
|
|
10
|
+
import { default as React_2 } from 'react';
|
|
11
|
+
import { ReactNode } from 'react';
|
|
12
|
+
import { ThemeModes } from '@atlaskit/theme/types';
|
|
13
|
+
import { ThemeModes as ThemeModes_2 } from '@atlaskit/theme';
|
|
14
|
+
import { ThemeProp } from '@atlaskit/theme/components';
|
|
15
|
+
import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
16
|
+
|
|
17
|
+
// @public (undocumented)
|
|
18
|
+
export type Appearance =
|
|
19
|
+
| 'default'
|
|
20
|
+
| 'danger'
|
|
21
|
+
| 'link'
|
|
22
|
+
| 'primary'
|
|
23
|
+
| 'subtle'
|
|
24
|
+
| 'subtle-link'
|
|
25
|
+
| 'warning';
|
|
26
|
+
|
|
27
|
+
// @public (undocumented)
|
|
28
|
+
export type BaseOwnProps = {
|
|
29
|
+
appearance?: Appearance;
|
|
30
|
+
autoFocus?: boolean;
|
|
31
|
+
className?: string;
|
|
32
|
+
overlay?: React_2.ReactNode;
|
|
33
|
+
href?: string;
|
|
34
|
+
iconAfter?: React_2.ReactChild;
|
|
35
|
+
iconBefore?: React_2.ReactChild;
|
|
36
|
+
isDisabled?: boolean;
|
|
37
|
+
isSelected?: boolean;
|
|
38
|
+
onBlur?: React_2.FocusEventHandler<HTMLElement>;
|
|
39
|
+
onClick?: (
|
|
40
|
+
e: React_2.MouseEvent<HTMLElement>,
|
|
41
|
+
analyticsEvent: UIAnalyticsEvent,
|
|
42
|
+
) => void;
|
|
43
|
+
onFocus?: React_2.FocusEventHandler<HTMLElement>;
|
|
44
|
+
spacing?: Spacing;
|
|
45
|
+
target?: React_2.AnchorHTMLAttributes<HTMLAnchorElement>['target'];
|
|
46
|
+
type?: React_2.ButtonHTMLAttributes<HTMLButtonElement>['type'];
|
|
47
|
+
shouldFitContainer?: boolean;
|
|
48
|
+
children?: React_2.ReactNode;
|
|
49
|
+
testId?: string;
|
|
50
|
+
component?:
|
|
51
|
+
| React_2.ComponentType<React_2.AllHTMLAttributes<HTMLElement>>
|
|
52
|
+
| React_2.ElementType;
|
|
53
|
+
analyticsContext?: Record<string, any>;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
// @public (undocumented)
|
|
57
|
+
export type BaseProps = Combine<
|
|
58
|
+
Combine<
|
|
59
|
+
Omit<React_2.AllHTMLAttributes<HTMLElement>, 'disabled'>,
|
|
60
|
+
{
|
|
61
|
+
'data-testid'?: never;
|
|
62
|
+
'data-has-overlay'?: never;
|
|
63
|
+
}
|
|
64
|
+
>,
|
|
65
|
+
BaseOwnProps
|
|
66
|
+
>;
|
|
67
|
+
|
|
68
|
+
// @public (undocumented)
|
|
69
|
+
const Button: React_2.MemoExoticComponent<React_2.ForwardRefExoticComponent<
|
|
70
|
+
ButtonProps & React_2.RefAttributes<HTMLElement>
|
|
71
|
+
>>;
|
|
72
|
+
export default Button;
|
|
73
|
+
|
|
74
|
+
// @public (undocumented)
|
|
75
|
+
export function ButtonGroup({
|
|
76
|
+
appearance,
|
|
77
|
+
children,
|
|
78
|
+
}: ButtonGroupProps): JSX.Element;
|
|
79
|
+
|
|
80
|
+
// @public (undocumented)
|
|
81
|
+
export interface ButtonProps extends BaseProps {}
|
|
82
|
+
|
|
83
|
+
// @public (undocumented)
|
|
84
|
+
export const CustomThemeButton: React_2.MemoExoticComponent<React_2.ForwardRefExoticComponent<
|
|
85
|
+
Omit<BaseProps, 'overlay'> &
|
|
86
|
+
CustomThemeButtonOwnProps &
|
|
87
|
+
React_2.RefAttributes<HTMLElement>
|
|
88
|
+
>>;
|
|
89
|
+
|
|
90
|
+
// @public (undocumented)
|
|
91
|
+
export type CustomThemeButtonOwnProps = {
|
|
92
|
+
isLoading?: boolean;
|
|
93
|
+
theme?: (
|
|
94
|
+
current: (props: ThemeProps) => ThemeTokens,
|
|
95
|
+
props: ThemeProps,
|
|
96
|
+
) => ThemeTokens;
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
// @public (undocumented)
|
|
100
|
+
export type CustomThemeButtonProps = Omit<BaseProps, 'overlay'> &
|
|
101
|
+
CustomThemeButtonOwnProps;
|
|
102
|
+
|
|
103
|
+
// @public (undocumented)
|
|
104
|
+
export type InteractionState =
|
|
105
|
+
| 'disabled'
|
|
106
|
+
| 'focusSelected'
|
|
107
|
+
| 'selected'
|
|
108
|
+
| 'active'
|
|
109
|
+
| 'hover'
|
|
110
|
+
| 'focus'
|
|
111
|
+
| 'default';
|
|
112
|
+
|
|
113
|
+
// @public (undocumented)
|
|
114
|
+
export const LoadingButton: React_2.ForwardRefExoticComponent<
|
|
115
|
+
Omit<BaseProps, 'overlay'> &
|
|
116
|
+
LoadingButtonOwnProps &
|
|
117
|
+
React_2.RefAttributes<HTMLElement>
|
|
118
|
+
>;
|
|
119
|
+
|
|
120
|
+
// @public (undocumented)
|
|
121
|
+
export type LoadingButtonOwnProps = {
|
|
122
|
+
isLoading?: boolean;
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
// @public (undocumented)
|
|
126
|
+
export type LoadingButtonProps = Omit<BaseProps, 'overlay'> &
|
|
127
|
+
LoadingButtonOwnProps;
|
|
128
|
+
|
|
129
|
+
// @public (undocumented)
|
|
130
|
+
export type Spacing = 'compact' | 'default' | 'none';
|
|
131
|
+
|
|
132
|
+
// @public (undocumented)
|
|
133
|
+
export const Theme: {
|
|
134
|
+
Consumer: ComponentType<
|
|
135
|
+
{
|
|
136
|
+
children: (tokens: ThemeTokens) => ReactNode;
|
|
137
|
+
} & Partial<CustomThemeButtonProps> & {
|
|
138
|
+
state: InteractionState;
|
|
139
|
+
iconIsOnlyChild?: boolean | undefined;
|
|
140
|
+
mode?: ThemeModes_2 | undefined;
|
|
141
|
+
}
|
|
142
|
+
>;
|
|
143
|
+
Provider: ComponentType<{
|
|
144
|
+
children?: ReactNode;
|
|
145
|
+
value?: ThemeProp<ThemeTokens, ThemeProps> | undefined;
|
|
146
|
+
}>;
|
|
147
|
+
useTheme: (props: ThemeProps) => ThemeTokens;
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
// @public (undocumented)
|
|
151
|
+
export type ThemeProps = Partial<CustomThemeButtonProps> & {
|
|
152
|
+
state: InteractionState;
|
|
153
|
+
iconIsOnlyChild?: boolean;
|
|
154
|
+
mode?: ThemeModes;
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
// @public (undocumented)
|
|
158
|
+
export type ThemeTokens = {
|
|
159
|
+
buttonStyles: CSSObject;
|
|
160
|
+
spinnerStyles: CSSObject;
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
// (No @packageDocumentation comment for this package)
|
|
164
|
+
```
|