@atlaskit/button 16.3.6 → 16.3.8
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 +12 -0
- package/button-group/package.json +8 -1
- package/custom-theme-button/package.json +8 -1
- package/dist/cjs/button-group.js +12 -22
- package/dist/cjs/shared/button-base.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/button-group.js +9 -20
- package/dist/es2019/shared/button-base.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/button-group.js +9 -20
- package/dist/esm/shared/button-base.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/button-group.d.ts +0 -9
- package/dist/types-ts4.0/button-group.d.ts +11 -0
- package/dist/types-ts4.0/button.d.ts +15 -0
- package/dist/types-ts4.0/custom-theme-button/custom-theme-button-types.d.ts +22 -0
- package/dist/types-ts4.0/custom-theme-button/custom-theme-button.d.ts +10 -0
- package/dist/types-ts4.0/custom-theme-button/index.d.ts +2 -0
- package/dist/types-ts4.0/custom-theme-button/theme.d.ts +21 -0
- package/dist/types-ts4.0/entry-points/button-group.d.ts +1 -0
- package/dist/types-ts4.0/entry-points/custom-theme-button.d.ts +2 -0
- package/dist/types-ts4.0/entry-points/loading-button.d.ts +2 -0
- package/dist/types-ts4.0/entry-points/standard-button.d.ts +7 -0
- package/dist/types-ts4.0/entry-points/types.d.ts +4 -0
- package/dist/types-ts4.0/index.d.ts +8 -0
- package/dist/types-ts4.0/loading-button.d.ts +15 -0
- package/dist/types-ts4.0/shared/block-events.d.ts +3 -0
- package/dist/types-ts4.0/shared/button-base.d.ts +10 -0
- package/dist/types-ts4.0/shared/colors.d.ts +31 -0
- package/dist/types-ts4.0/shared/css.d.ts +22 -0
- package/dist/types-ts4.0/shared/get-is-only-single-icon.d.ts +2 -0
- package/dist/types-ts4.0/shared/loading-spinner.d.ts +5 -0
- package/dist/types-ts4.0/types.d.ts +89 -0
- package/loading-button/package.json +8 -1
- package/package.json +14 -7
- package/standard-button/package.json +8 -1
- package/types/package.json +8 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/button
|
|
2
2
|
|
|
3
|
+
## 16.3.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) - Upgrade Typescript from `4.3.5` to `4.5.5`
|
|
8
|
+
|
|
9
|
+
## 16.3.7
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`14d635468f6`](https://bitbucket.org/atlassian/atlassian-frontend/commits/14d635468f6) - [ux] DSP-6696: prevent empty ButtonGroup items from showing spacing by switching to flexbox gap
|
|
14
|
+
|
|
3
15
|
## 16.3.6
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -4,5 +4,12 @@
|
|
|
4
4
|
"module": "../dist/esm/entry-points/button-group.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/entry-points/button-group.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"types": "../dist/types/entry-points/button-group.d.ts"
|
|
7
|
+
"types": "../dist/types/entry-points/button-group.d.ts",
|
|
8
|
+
"typesVersions": {
|
|
9
|
+
">=4.0 <4.5": {
|
|
10
|
+
"*": [
|
|
11
|
+
"../dist/types-ts4.0/entry-points/button-group.d.ts"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
8
15
|
}
|
|
@@ -4,5 +4,12 @@
|
|
|
4
4
|
"module": "../dist/esm/entry-points/custom-theme-button.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/entry-points/custom-theme-button.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"types": "../dist/types/entry-points/custom-theme-button.d.ts"
|
|
7
|
+
"types": "../dist/types/entry-points/custom-theme-button.d.ts",
|
|
8
|
+
"typesVersions": {
|
|
9
|
+
">=4.0 <4.5": {
|
|
10
|
+
"*": [
|
|
11
|
+
"../dist/types-ts4.0/entry-points/custom-theme-button.d.ts"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
8
15
|
}
|
package/dist/cjs/button-group.js
CHANGED
|
@@ -1,48 +1,38 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = ButtonGroup;
|
|
9
|
-
exports.groupItemStyles = void 0;
|
|
10
9
|
|
|
11
|
-
var _react =
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
12
11
|
|
|
13
12
|
var _core = require("@emotion/core");
|
|
14
13
|
|
|
15
|
-
|
|
14
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
|
+
|
|
16
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
16
17
|
|
|
17
18
|
/** @jsx jsx */
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
/* margins don't flip when the layout uses dir="rtl", whereas pseudos do */
|
|
23
|
-
'& + &::before': {
|
|
24
|
-
content: "''",
|
|
25
|
-
display: 'inline-block',
|
|
26
|
-
width: "".concat((0, _constants.gridSize)() / 2, "px")
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
exports.groupItemStyles = groupItemStyles;
|
|
19
|
+
var buttonGroupStyles = (0, _core.css)({
|
|
20
|
+
display: 'inline-flex',
|
|
21
|
+
gap: 4
|
|
22
|
+
});
|
|
30
23
|
|
|
31
24
|
function ButtonGroup(_ref) {
|
|
32
25
|
var appearance = _ref.appearance,
|
|
33
26
|
children = _ref.children;
|
|
34
27
|
return (0, _core.jsx)("div", {
|
|
35
|
-
css:
|
|
36
|
-
display: 'inline-flex'
|
|
37
|
-
}
|
|
28
|
+
css: buttonGroupStyles
|
|
38
29
|
}, _react.default.Children.map(children, function (child, idx) {
|
|
39
30
|
if (!child) {
|
|
40
31
|
return null;
|
|
41
32
|
}
|
|
42
33
|
|
|
43
|
-
return (0, _core.jsx)(
|
|
44
|
-
key: idx
|
|
45
|
-
css: groupItemStyles
|
|
34
|
+
return (0, _core.jsx)(_react.Fragment, {
|
|
35
|
+
key: idx
|
|
46
36
|
}, appearance ?
|
|
47
37
|
/*#__PURE__*/
|
|
48
38
|
// eslint-disable-next-line @repo/internal/react/no-clone-element
|
|
@@ -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.8",
|
|
105
105
|
analyticsData: analyticsContext
|
|
106
106
|
}); // Button currently calls preventDefault, which is not standard button behaviour
|
|
107
107
|
|
package/dist/cjs/version.json
CHANGED
|
@@ -1,34 +1,23 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { jsx } from '@emotion/core';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
/* margins don't flip when the layout uses dir="rtl", whereas pseudos do */
|
|
10
|
-
'& + &::before': {
|
|
11
|
-
content: `''`,
|
|
12
|
-
display: 'inline-block',
|
|
13
|
-
width: `${gridSize() / 2}px`
|
|
14
|
-
}
|
|
15
|
-
};
|
|
2
|
+
import React, { Fragment } from 'react';
|
|
3
|
+
import { css, jsx } from '@emotion/core';
|
|
4
|
+
const buttonGroupStyles = css({
|
|
5
|
+
display: 'inline-flex',
|
|
6
|
+
gap: 4
|
|
7
|
+
});
|
|
16
8
|
export default function ButtonGroup({
|
|
17
9
|
appearance,
|
|
18
10
|
children
|
|
19
11
|
}) {
|
|
20
12
|
return jsx("div", {
|
|
21
|
-
css:
|
|
22
|
-
display: 'inline-flex'
|
|
23
|
-
}
|
|
13
|
+
css: buttonGroupStyles
|
|
24
14
|
}, React.Children.map(children, (child, idx) => {
|
|
25
15
|
if (!child) {
|
|
26
16
|
return null;
|
|
27
17
|
}
|
|
28
18
|
|
|
29
|
-
return jsx(
|
|
30
|
-
key: idx
|
|
31
|
-
css: groupItemStyles
|
|
19
|
+
return jsx(Fragment, {
|
|
20
|
+
key: idx
|
|
32
21
|
}, appearance ?
|
|
33
22
|
/*#__PURE__*/
|
|
34
23
|
// eslint-disable-next-line @repo/internal/react/no-clone-element
|
|
@@ -68,7 +68,7 @@ export default /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref) {
|
|
|
68
68
|
action: 'clicked',
|
|
69
69
|
componentName: 'button',
|
|
70
70
|
packageName: "@atlaskit/button",
|
|
71
|
-
packageVersion: "16.3.
|
|
71
|
+
packageVersion: "16.3.8",
|
|
72
72
|
analyticsData: analyticsContext
|
|
73
73
|
}); // Button currently calls preventDefault, which is not standard button behaviour
|
|
74
74
|
|
package/dist/es2019/version.json
CHANGED
package/dist/esm/button-group.js
CHANGED
|
@@ -1,33 +1,22 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { jsx } from '@emotion/core';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
/* margins don't flip when the layout uses dir="rtl", whereas pseudos do */
|
|
10
|
-
'& + &::before': {
|
|
11
|
-
content: "''",
|
|
12
|
-
display: 'inline-block',
|
|
13
|
-
width: "".concat(gridSize() / 2, "px")
|
|
14
|
-
}
|
|
15
|
-
};
|
|
2
|
+
import React, { Fragment } from 'react';
|
|
3
|
+
import { css, jsx } from '@emotion/core';
|
|
4
|
+
var buttonGroupStyles = css({
|
|
5
|
+
display: 'inline-flex',
|
|
6
|
+
gap: 4
|
|
7
|
+
});
|
|
16
8
|
export default function ButtonGroup(_ref) {
|
|
17
9
|
var appearance = _ref.appearance,
|
|
18
10
|
children = _ref.children;
|
|
19
11
|
return jsx("div", {
|
|
20
|
-
css:
|
|
21
|
-
display: 'inline-flex'
|
|
22
|
-
}
|
|
12
|
+
css: buttonGroupStyles
|
|
23
13
|
}, React.Children.map(children, function (child, idx) {
|
|
24
14
|
if (!child) {
|
|
25
15
|
return null;
|
|
26
16
|
}
|
|
27
17
|
|
|
28
|
-
return jsx(
|
|
29
|
-
key: idx
|
|
30
|
-
css: groupItemStyles
|
|
18
|
+
return jsx(Fragment, {
|
|
19
|
+
key: idx
|
|
31
20
|
}, appearance ?
|
|
32
21
|
/*#__PURE__*/
|
|
33
22
|
// eslint-disable-next-line @repo/internal/react/no-clone-element
|
|
@@ -77,7 +77,7 @@ export default /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref) {
|
|
|
77
77
|
action: 'clicked',
|
|
78
78
|
componentName: 'button',
|
|
79
79
|
packageName: "@atlaskit/button",
|
|
80
|
-
packageVersion: "16.3.
|
|
80
|
+
packageVersion: "16.3.8",
|
|
81
81
|
analyticsData: analyticsContext
|
|
82
82
|
}); // Button currently calls preventDefault, which is not standard button behaviour
|
|
83
83
|
|
package/dist/esm/version.json
CHANGED
|
@@ -8,13 +8,4 @@ export declare type ButtonGroupProps = {
|
|
|
8
8
|
appearance?: Appearance;
|
|
9
9
|
children?: React.ReactNode;
|
|
10
10
|
};
|
|
11
|
-
export declare const groupItemStyles: {
|
|
12
|
-
flex: string;
|
|
13
|
-
display: string;
|
|
14
|
-
'& + &::before': {
|
|
15
|
-
content: string;
|
|
16
|
-
display: string;
|
|
17
|
-
width: string;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
11
|
export default function ButtonGroup({ appearance, children, }: ButtonGroupProps): JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Appearance } from './types';
|
|
4
|
+
export declare type ButtonGroupProps = {
|
|
5
|
+
/**
|
|
6
|
+
* The appearance to apply to all buttons.
|
|
7
|
+
*/
|
|
8
|
+
appearance?: Appearance;
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
};
|
|
11
|
+
export default function ButtonGroup({ appearance, children, }: ButtonGroupProps): JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BaseProps } from './types';
|
|
3
|
+
export interface ButtonProps extends BaseProps {
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* __Button__
|
|
7
|
+
*
|
|
8
|
+
* A button triggers an event or action. They let users know what will happen next.
|
|
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)
|
|
13
|
+
*/
|
|
14
|
+
declare const Button: React.MemoExoticComponent<React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLElement>>>;
|
|
15
|
+
export default Button;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { CSSObject } from '@emotion/core';
|
|
2
|
+
import { ThemeModes } from '@atlaskit/theme/types';
|
|
3
|
+
import { BaseProps } from '../types';
|
|
4
|
+
export declare type ThemeTokens = {
|
|
5
|
+
buttonStyles: CSSObject;
|
|
6
|
+
spinnerStyles: CSSObject;
|
|
7
|
+
};
|
|
8
|
+
export declare type InteractionState = 'disabled' | 'focusSelected' | 'selected' | 'active' | 'hover' | 'focus' | 'default';
|
|
9
|
+
export declare type CustomThemeButtonOwnProps = {
|
|
10
|
+
isLoading?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Slow + discouraged custom theme API
|
|
13
|
+
* See custom theme guide for usage details
|
|
14
|
+
*/
|
|
15
|
+
theme?: (current: (props: ThemeProps) => ThemeTokens, props: ThemeProps) => ThemeTokens;
|
|
16
|
+
};
|
|
17
|
+
export declare type CustomThemeButtonProps = Omit<BaseProps, 'overlay'> & CustomThemeButtonOwnProps;
|
|
18
|
+
export declare type ThemeProps = Partial<CustomThemeButtonProps> & {
|
|
19
|
+
state: InteractionState;
|
|
20
|
+
iconIsOnlyChild?: boolean;
|
|
21
|
+
mode?: ThemeModes;
|
|
22
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* __Custom theme button__
|
|
4
|
+
*
|
|
5
|
+
* A custom theme button. Avoid using this component. It exists for those already using custom theming, which is hard to use and has performance issues.
|
|
6
|
+
*
|
|
7
|
+
* - [Examples](https://atlassian.design/components/button/examples#custom-theme-button)
|
|
8
|
+
*/
|
|
9
|
+
declare const CustomThemeButton: React.MemoExoticComponent<React.ForwardRefExoticComponent<Omit<import("..").BaseProps, "overlay"> & import("./custom-theme-button-types").CustomThemeButtonOwnProps & React.RefAttributes<HTMLElement>>>;
|
|
10
|
+
export default CustomThemeButton;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { CSSObject } from '@emotion/core';
|
|
3
|
+
import { InteractionState, ThemeProps, ThemeTokens } from './custom-theme-button-types';
|
|
4
|
+
export declare function getCustomCss({ appearance, spacing, mode, isSelected, shouldFitContainer, iconIsOnlyChild, isLoading, state, }: ThemeProps): CSSObject;
|
|
5
|
+
export declare function getSpecifiers(styles: CSSObject): CSSObject;
|
|
6
|
+
export declare function defaultThemeFn(current: (values: ThemeProps) => ThemeTokens, values: ThemeProps): ThemeTokens;
|
|
7
|
+
declare const Theme: {
|
|
8
|
+
Consumer: import("react").ComponentType<{
|
|
9
|
+
children: (tokens: ThemeTokens) => import("react").ReactNode;
|
|
10
|
+
} & Partial<import("./custom-theme-button-types").CustomThemeButtonProps> & {
|
|
11
|
+
state: InteractionState;
|
|
12
|
+
iconIsOnlyChild?: boolean | undefined;
|
|
13
|
+
mode?: import("@atlaskit/theme").ThemeModes | undefined;
|
|
14
|
+
}>;
|
|
15
|
+
Provider: import("react").ComponentType<{
|
|
16
|
+
children?: import("react").ReactNode;
|
|
17
|
+
value?: import("@atlaskit/theme/components").ThemeProp<ThemeTokens, ThemeProps> | undefined;
|
|
18
|
+
}>;
|
|
19
|
+
useTheme: (props: ThemeProps) => ThemeTokens;
|
|
20
|
+
};
|
|
21
|
+
export default Theme;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '../button-group';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type { Appearance, Spacing, BaseOwnProps, BaseProps } from '../types';
|
|
2
|
+
export type { ButtonProps } from './standard-button';
|
|
3
|
+
export type { LoadingButtonProps, LoadingButtonOwnProps, } from './loading-button';
|
|
4
|
+
export type { ThemeTokens, ThemeProps, InteractionState, CustomThemeButtonProps, CustomThemeButtonOwnProps, } from './custom-theme-button';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type { Appearance, Spacing, BaseOwnProps, BaseProps, } from './entry-points/types';
|
|
2
|
+
export { default, } from './entry-points/standard-button';
|
|
3
|
+
export type { ButtonProps } from './entry-points/standard-button';
|
|
4
|
+
export { default as LoadingButton } from './entry-points/loading-button';
|
|
5
|
+
export type { LoadingButtonProps, LoadingButtonOwnProps, } from './entry-points/loading-button';
|
|
6
|
+
export { default as CustomThemeButton, Theme, } from './entry-points/custom-theme-button';
|
|
7
|
+
export type { ThemeTokens, ThemeProps, InteractionState, CustomThemeButtonProps, CustomThemeButtonOwnProps, } from './entry-points/custom-theme-button';
|
|
8
|
+
export { default as ButtonGroup } from './entry-points/button-group';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BaseProps } from './types';
|
|
3
|
+
export declare type LoadingButtonOwnProps = {
|
|
4
|
+
isLoading?: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare type LoadingButtonProps = Omit<BaseProps, 'overlay'> & LoadingButtonOwnProps;
|
|
7
|
+
/**
|
|
8
|
+
* __Loading button__
|
|
9
|
+
*
|
|
10
|
+
* 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
|
+
*
|
|
12
|
+
* - [Examples](https://atlassian.design/components/button/examples#loading-button)
|
|
13
|
+
*/
|
|
14
|
+
declare const LoadingButton: React.ForwardRefExoticComponent<Omit<BaseProps, "overlay"> & LoadingButtonOwnProps & React.RefAttributes<HTMLElement>>;
|
|
15
|
+
export default LoadingButton;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { CSSObject } from '@emotion/core';
|
|
4
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<Omit<Omit<React.AllHTMLAttributes<HTMLElement>, "disabled">, "data-testid" | "data-has-overlay"> & {
|
|
5
|
+
'data-testid'?: undefined;
|
|
6
|
+
'data-has-overlay'?: undefined;
|
|
7
|
+
}, keyof import("../types").BaseOwnProps> & import("../types").BaseOwnProps & {
|
|
8
|
+
buttonCss: CSSObject;
|
|
9
|
+
} & React.RefAttributes<HTMLElement>>;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ThemeModes } from '@atlaskit/theme/types';
|
|
2
|
+
import { Appearance } from '../types';
|
|
3
|
+
export declare type ColorRule = {
|
|
4
|
+
[key in ThemeModes]: string;
|
|
5
|
+
};
|
|
6
|
+
export declare type ColorGroup = {
|
|
7
|
+
default: ColorRule;
|
|
8
|
+
hover?: ColorRule;
|
|
9
|
+
active?: ColorRule;
|
|
10
|
+
disabled?: ColorRule;
|
|
11
|
+
selected?: ColorRule;
|
|
12
|
+
focus?: ColorRule;
|
|
13
|
+
focusSelected?: ColorRule;
|
|
14
|
+
};
|
|
15
|
+
export declare type ColorPreset = {
|
|
16
|
+
[key in Appearance]: ColorGroup;
|
|
17
|
+
};
|
|
18
|
+
export declare type BoxShadowColorGroup = {
|
|
19
|
+
focus: ColorRule;
|
|
20
|
+
focusSelected: ColorRule;
|
|
21
|
+
};
|
|
22
|
+
declare type BoxShadowColorPreset = {
|
|
23
|
+
[key in Appearance]: BoxShadowColorGroup;
|
|
24
|
+
};
|
|
25
|
+
declare type Values = {
|
|
26
|
+
background: ColorPreset;
|
|
27
|
+
boxShadowColor: BoxShadowColorPreset;
|
|
28
|
+
color: ColorPreset;
|
|
29
|
+
};
|
|
30
|
+
declare const values: Values;
|
|
31
|
+
export default values;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { CSSObject } from '@emotion/core';
|
|
2
|
+
import { ThemeModes } from '@atlaskit/theme/types';
|
|
3
|
+
import { Appearance, Spacing } from '../types';
|
|
4
|
+
export declare type GetCssArgs = {
|
|
5
|
+
appearance: Appearance;
|
|
6
|
+
spacing: Spacing;
|
|
7
|
+
mode: ThemeModes;
|
|
8
|
+
isSelected: boolean;
|
|
9
|
+
shouldFitContainer: boolean;
|
|
10
|
+
isOnlySingleIcon: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare function getCss({ appearance, spacing, mode, isSelected, shouldFitContainer, isOnlySingleIcon, }: GetCssArgs): CSSObject;
|
|
13
|
+
export declare function getIconStyle({ spacing }: {
|
|
14
|
+
spacing: Spacing;
|
|
15
|
+
}): CSSObject;
|
|
16
|
+
export declare function getContentStyle({ spacing }: {
|
|
17
|
+
spacing: Spacing;
|
|
18
|
+
}): CSSObject;
|
|
19
|
+
export declare function getFadingCss({ hasOverlay, }: {
|
|
20
|
+
hasOverlay: boolean;
|
|
21
|
+
}): CSSObject;
|
|
22
|
+
export declare const overlayCss: CSSObject;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { BaseProps } from '../types';
|
|
3
|
+
declare type LoadingSpinnerProps = Pick<BaseProps, 'appearance' | 'isDisabled' | 'isSelected' | 'spacing'>;
|
|
4
|
+
export default function LoadingSpinner({ spacing, ...rest }: LoadingSpinnerProps): JSX.Element;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
3
|
+
export declare type Appearance = 'default' | 'danger' | 'link' | 'primary' | 'subtle' | 'subtle-link' | 'warning';
|
|
4
|
+
export declare type Spacing = 'compact' | 'default' | 'none';
|
|
5
|
+
declare type Combine<First, Second> = Omit<First, keyof Second> & Second;
|
|
6
|
+
export declare type BaseOwnProps = {
|
|
7
|
+
/**
|
|
8
|
+
* The base styling to apply to the button
|
|
9
|
+
*/
|
|
10
|
+
appearance?: Appearance;
|
|
11
|
+
/**
|
|
12
|
+
* Set the button to autofocus on mount
|
|
13
|
+
*/
|
|
14
|
+
autoFocus?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Add a classname to the button
|
|
17
|
+
*/
|
|
18
|
+
className?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Used to 'overlay' something over a button. This is commonly used to display a loading spinner
|
|
21
|
+
*/
|
|
22
|
+
overlay?: React.ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* Provides a url for buttons being used as a link
|
|
25
|
+
*/
|
|
26
|
+
href?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Places an icon within the button, after the button's text
|
|
29
|
+
*/
|
|
30
|
+
iconAfter?: React.ReactChild;
|
|
31
|
+
/**
|
|
32
|
+
* Places an icon within the button, before the button's text
|
|
33
|
+
*/
|
|
34
|
+
iconBefore?: React.ReactChild;
|
|
35
|
+
/**
|
|
36
|
+
* Set if the button is disabled
|
|
37
|
+
*/
|
|
38
|
+
isDisabled?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Change the style to indicate the button is selected
|
|
41
|
+
*/
|
|
42
|
+
isSelected?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Handler to be called on blur
|
|
45
|
+
*/
|
|
46
|
+
onBlur?: React.FocusEventHandler<HTMLElement>;
|
|
47
|
+
/**
|
|
48
|
+
* Handler to be called on click. The second argument can be used to track analytics data. See the tutorial in the analytics-next package for details
|
|
49
|
+
*/
|
|
50
|
+
onClick?: (e: React.MouseEvent<HTMLElement>, analyticsEvent: UIAnalyticsEvent) => void;
|
|
51
|
+
/**
|
|
52
|
+
* Handler to be called on focus
|
|
53
|
+
*/
|
|
54
|
+
onFocus?: React.FocusEventHandler<HTMLElement>;
|
|
55
|
+
/**
|
|
56
|
+
* Set the amount of padding in the button
|
|
57
|
+
*/
|
|
58
|
+
spacing?: Spacing;
|
|
59
|
+
/**
|
|
60
|
+
* Pass target down to a link within the button component, if a href is provided
|
|
61
|
+
*/
|
|
62
|
+
target?: React.AnchorHTMLAttributes<HTMLAnchorElement>['target'];
|
|
63
|
+
/**
|
|
64
|
+
* Pass type down to a button
|
|
65
|
+
*/
|
|
66
|
+
type?: React.ButtonHTMLAttributes<HTMLButtonElement>['type'];
|
|
67
|
+
/**
|
|
68
|
+
* Option to fit button width to its parent width
|
|
69
|
+
*/
|
|
70
|
+
shouldFitContainer?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Text content to be rendered in the button
|
|
73
|
+
*/
|
|
74
|
+
children?: React.ReactNode;
|
|
75
|
+
/**
|
|
76
|
+
* A `testId` prop is provided for specified elements, which is a unique string that appears as a data attribute `data-testid` in the rendered code, serving as a hook for automated tests
|
|
77
|
+
*/
|
|
78
|
+
testId?: string;
|
|
79
|
+
component?: React.ComponentType<React.AllHTMLAttributes<HTMLElement>> | React.ElementType;
|
|
80
|
+
/**
|
|
81
|
+
* Additional information to be included in the `context` of analytics events that come from button
|
|
82
|
+
*/
|
|
83
|
+
analyticsContext?: Record<string, any>;
|
|
84
|
+
};
|
|
85
|
+
export declare type BaseProps = Combine<Combine<Omit<React.AllHTMLAttributes<HTMLElement>, 'disabled'>, {
|
|
86
|
+
'data-testid'?: never;
|
|
87
|
+
'data-has-overlay'?: never;
|
|
88
|
+
}>, BaseOwnProps>;
|
|
89
|
+
export {};
|
|
@@ -4,5 +4,12 @@
|
|
|
4
4
|
"module": "../dist/esm/entry-points/loading-button.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/entry-points/loading-button.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"types": "../dist/types/entry-points/loading-button.d.ts"
|
|
7
|
+
"types": "../dist/types/entry-points/loading-button.d.ts",
|
|
8
|
+
"typesVersions": {
|
|
9
|
+
">=4.0 <4.5": {
|
|
10
|
+
"*": [
|
|
11
|
+
"../dist/types-ts4.0/entry-points/loading-button.d.ts"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
8
15
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/button",
|
|
3
|
-
"version": "16.3.
|
|
3
|
+
"version": "16.3.8",
|
|
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/"
|
|
@@ -12,6 +12,13 @@
|
|
|
12
12
|
"module": "dist/esm/index.js",
|
|
13
13
|
"module:es2019": "dist/es2019/index.js",
|
|
14
14
|
"types": "dist/types/index.d.ts",
|
|
15
|
+
"typesVersions": {
|
|
16
|
+
">=4.0 <4.5": {
|
|
17
|
+
"*": [
|
|
18
|
+
"dist/types-ts4.0/*"
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
},
|
|
15
22
|
"sideEffects": false,
|
|
16
23
|
"atlaskit:src": "src/index.tsx",
|
|
17
24
|
"atlassian": {
|
|
@@ -34,7 +41,7 @@
|
|
|
34
41
|
"@atlaskit/analytics-next": "^8.2.0",
|
|
35
42
|
"@atlaskit/ds-lib": "^2.1.0",
|
|
36
43
|
"@atlaskit/spinner": "^15.1.0",
|
|
37
|
-
"@atlaskit/theme": "^12.
|
|
44
|
+
"@atlaskit/theme": "^12.2.0",
|
|
38
45
|
"@atlaskit/tokens": "^0.10.0",
|
|
39
46
|
"@babel/runtime": "^7.0.0",
|
|
40
47
|
"@emotion/core": "^10.0.9"
|
|
@@ -46,14 +53,14 @@
|
|
|
46
53
|
"@atlaskit/checkbox": "^12.3.0",
|
|
47
54
|
"@atlaskit/docs": "*",
|
|
48
55
|
"@atlaskit/icon": "^21.10.0",
|
|
49
|
-
"@atlaskit/logo": "^13.
|
|
50
|
-
"@atlaskit/section-message": "^6.
|
|
51
|
-
"@atlaskit/select": "^15.
|
|
56
|
+
"@atlaskit/logo": "^13.9.0",
|
|
57
|
+
"@atlaskit/section-message": "^6.2.0",
|
|
58
|
+
"@atlaskit/select": "^15.7.0",
|
|
52
59
|
"@atlaskit/ssr": "*",
|
|
53
60
|
"@atlaskit/visual-regression": "*",
|
|
54
61
|
"@atlaskit/webdriver-runner": "*",
|
|
55
62
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
56
|
-
"@testing-library/react": "^
|
|
63
|
+
"@testing-library/react": "^12.1.5",
|
|
57
64
|
"@types/react-router-dom": "^4.3.1",
|
|
58
65
|
"ast-types": "^0.13.3",
|
|
59
66
|
"bind-event-listener": "^2.1.1",
|
|
@@ -64,7 +71,7 @@
|
|
|
64
71
|
"react-router-dom": "^4.2.2",
|
|
65
72
|
"react-test-renderer": "^16.8.0",
|
|
66
73
|
"storybook-addon-performance": "^0.16.0",
|
|
67
|
-
"typescript": "4.
|
|
74
|
+
"typescript": "4.5.5",
|
|
68
75
|
"wait-for-expect": "^1.2.0"
|
|
69
76
|
},
|
|
70
77
|
"techstack": {
|
|
@@ -4,5 +4,12 @@
|
|
|
4
4
|
"module": "../dist/esm/entry-points/standard-button.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/entry-points/standard-button.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"types": "../dist/types/entry-points/standard-button.d.ts"
|
|
7
|
+
"types": "../dist/types/entry-points/standard-button.d.ts",
|
|
8
|
+
"typesVersions": {
|
|
9
|
+
">=4.0 <4.5": {
|
|
10
|
+
"*": [
|
|
11
|
+
"../dist/types-ts4.0/entry-points/standard-button.d.ts"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
8
15
|
}
|
package/types/package.json
CHANGED
|
@@ -4,5 +4,12 @@
|
|
|
4
4
|
"module": "../dist/esm/entry-points/types.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/entry-points/types.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"types": "../dist/types/entry-points/types.d.ts"
|
|
7
|
+
"types": "../dist/types/entry-points/types.d.ts",
|
|
8
|
+
"typesVersions": {
|
|
9
|
+
">=4.0 <4.5": {
|
|
10
|
+
"*": [
|
|
11
|
+
"../dist/types-ts4.0/entry-points/types.d.ts"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
8
15
|
}
|