@cloudflare/component-button 2.12.1 → 2.12.5
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 +32 -0
- package/dist/Button.d.ts +110 -0
- package/dist/index.d.ts +2 -2
- package/es/Button.js +2 -3
- package/es/index.js +2 -2
- package/lib/Button.js +5 -3
- package/lib/index.js +14 -2
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,38 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [2.12.5](http://stash.cfops.it:7999/fe/stratus/compare/@cloudflare/component-button@2.12.4...@cloudflare/component-button@2.12.5) (2022-02-08)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @cloudflare/component-button
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [2.12.4](http://stash.cfops.it:7999/fe/stratus/compare/@cloudflare/component-button@2.12.3...@cloudflare/component-button@2.12.4) (2022-02-08)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @cloudflare/component-button
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [2.12.3](http://stash.cfops.it:7999/fe/stratus/compare/@cloudflare/component-button@2.12.2...@cloudflare/component-button@2.12.3) (2022-02-04)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @cloudflare/component-button
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## [2.12.2](http://stash.cfops.it:7999/fe/stratus/compare/@cloudflare/component-button@2.12.1...@cloudflare/component-button@2.12.2) (2022-02-01)
|
|
31
|
+
|
|
32
|
+
**Note:** Version bump only for package @cloudflare/component-button
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
6
38
|
## [2.12.1](http://stash.cfops.it:7999/fe/stratus/compare/@cloudflare/component-button@2.12.0...@cloudflare/component-button@2.12.1) (2022-01-19)
|
|
7
39
|
|
|
8
40
|
**Note:** Version bump only for package @cloudflare/component-button
|
package/dist/Button.d.ts
CHANGED
|
@@ -1,5 +1,115 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { ThemeProp } from '@cloudflare/style-container';
|
|
2
3
|
import { IconType } from '@cloudflare/component-icon';
|
|
4
|
+
export declare const buttonStyles: (props: PropsWithTheme) => {
|
|
5
|
+
readonly '&:hover': {
|
|
6
|
+
backgroundColor: string | undefined;
|
|
7
|
+
color: string | undefined;
|
|
8
|
+
} | undefined;
|
|
9
|
+
readonly '&:active': {
|
|
10
|
+
backgroundColor: string | undefined;
|
|
11
|
+
color: string | undefined;
|
|
12
|
+
} | undefined;
|
|
13
|
+
readonly '&:focus': {
|
|
14
|
+
backgroundColor: string | undefined;
|
|
15
|
+
color: string | undefined;
|
|
16
|
+
} | undefined;
|
|
17
|
+
readonly '&:focus-visible': {
|
|
18
|
+
readonly outlineOffset: 3;
|
|
19
|
+
readonly outlineStyle: "auto";
|
|
20
|
+
readonly outlineColor: string;
|
|
21
|
+
};
|
|
22
|
+
readonly '&:focus-within:hover': {
|
|
23
|
+
backgroundColor: string | undefined;
|
|
24
|
+
color: string | undefined;
|
|
25
|
+
} | undefined;
|
|
26
|
+
readonly '&:active:hover': {
|
|
27
|
+
backgroundColor: string | undefined;
|
|
28
|
+
color: string | undefined;
|
|
29
|
+
} | undefined;
|
|
30
|
+
readonly '&[title]': {
|
|
31
|
+
readonly pointerEvents: "none" | "auto";
|
|
32
|
+
};
|
|
33
|
+
readonly backgroundColor: string | undefined;
|
|
34
|
+
readonly color: string | undefined;
|
|
35
|
+
readonly cursor: "default" | "pointer";
|
|
36
|
+
readonly display: "inline-flex";
|
|
37
|
+
readonly flexGrow: 1 | undefined;
|
|
38
|
+
readonly alignItems: "center";
|
|
39
|
+
readonly justifyContent: "center";
|
|
40
|
+
readonly fontFamily: "-apple-system, system-ui, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen, Ubuntu, \"Helvetica Neue\", Arial, sans-serif";
|
|
41
|
+
readonly fontSize: 2;
|
|
42
|
+
readonly fontWeight: 400;
|
|
43
|
+
readonly lineHeight: 1.2;
|
|
44
|
+
readonly borderBottomWidth: 0 | "1px";
|
|
45
|
+
readonly borderLeftWidth: 0 | "1px";
|
|
46
|
+
readonly borderRightWidth: 0 | "1px";
|
|
47
|
+
readonly borderTopWidth: 0 | "1px";
|
|
48
|
+
readonly borderBottomStyle: "solid";
|
|
49
|
+
readonly borderTopStyle: "solid";
|
|
50
|
+
readonly borderLeftStyle: "solid";
|
|
51
|
+
readonly borderRightStyle: "solid";
|
|
52
|
+
readonly borderColor: string | undefined;
|
|
53
|
+
readonly borderTopRightRadius: 0 | 5;
|
|
54
|
+
readonly borderTopLeftRadius: 0 | 5;
|
|
55
|
+
readonly borderBottomLeftRadius: 0 | 5;
|
|
56
|
+
readonly borderBottomRightRadius: 0 | 5;
|
|
57
|
+
readonly '&::before': {
|
|
58
|
+
content: string;
|
|
59
|
+
color: string | undefined;
|
|
60
|
+
display: string;
|
|
61
|
+
alignItems: string;
|
|
62
|
+
justifyContent: string;
|
|
63
|
+
position: string;
|
|
64
|
+
left: number;
|
|
65
|
+
height: string;
|
|
66
|
+
width: string;
|
|
67
|
+
opacity: number;
|
|
68
|
+
animationName: {
|
|
69
|
+
'50%': {
|
|
70
|
+
opacity: number;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
animationDuration: string;
|
|
74
|
+
animationIterationCount: string;
|
|
75
|
+
animationTimingFunction: string;
|
|
76
|
+
} | undefined;
|
|
77
|
+
readonly opacity: "inherit" | 0.5;
|
|
78
|
+
readonly mt: number;
|
|
79
|
+
readonly mr: 0;
|
|
80
|
+
readonly mb: 0;
|
|
81
|
+
readonly ml: number;
|
|
82
|
+
readonly px: 3;
|
|
83
|
+
readonly py: 2;
|
|
84
|
+
readonly pointerEvents: "none" | "auto";
|
|
85
|
+
readonly position: "relative";
|
|
86
|
+
readonly textAlign: "center";
|
|
87
|
+
readonly transitionProperty: "background-color,border-color" | "background-color,border-color,color";
|
|
88
|
+
readonly transitionDuration: "200ms";
|
|
89
|
+
readonly transitionTimingFunction: "ease";
|
|
90
|
+
readonly userSelect: "none";
|
|
91
|
+
readonly maxWidth: "initial";
|
|
92
|
+
readonly float: "none";
|
|
93
|
+
readonly whiteSpace: "nowrap";
|
|
94
|
+
readonly width: "auto" | "100%";
|
|
95
|
+
};
|
|
96
|
+
declare type Props = {
|
|
97
|
+
submit?: boolean;
|
|
98
|
+
spaced?: boolean;
|
|
99
|
+
space?: number;
|
|
100
|
+
direction?: 'column' | 'row';
|
|
101
|
+
group?: 'first' | 'inbetween' | 'last';
|
|
102
|
+
type?: 'default' | 'primary' | 'success' | 'warning' | 'danger';
|
|
103
|
+
testId?: string;
|
|
104
|
+
loading?: boolean;
|
|
105
|
+
inverted?: boolean;
|
|
106
|
+
iconType?: IconType;
|
|
107
|
+
iconLabel?: string;
|
|
108
|
+
iconSize?: number;
|
|
109
|
+
ariaLabel?: string;
|
|
110
|
+
stretch?: boolean;
|
|
111
|
+
} & Pick<JSX.IntrinsicElements['button'], 'onClick' | 'disabled' | 'form' | 'tabIndex' | 'className'>;
|
|
112
|
+
declare type PropsWithTheme = Props & ThemeProp;
|
|
3
113
|
declare const _default: React.ComponentType<{
|
|
4
114
|
form?: string | undefined;
|
|
5
115
|
key?: React.Key | null | undefined;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import Button from './Button';
|
|
1
|
+
import Button, { buttonStyles } from './Button';
|
|
2
2
|
import ButtonGroup from './ButtonGroup';
|
|
3
3
|
import TextButton from './TextButton';
|
|
4
4
|
import IconTextButton from './IconTextButton';
|
|
5
5
|
import UnstyledButton from './UnstyledButton';
|
|
6
|
-
export { Button, ButtonGroup, TextButton, IconTextButton, UnstyledButton };
|
|
6
|
+
export { buttonStyles, Button, ButtonGroup, TextButton, IconTextButton, UnstyledButton };
|
package/es/Button.js
CHANGED
|
@@ -139,7 +139,7 @@ const interactionStyleAccessor = (interactionState, props) => {
|
|
|
139
139
|
} : undefined;
|
|
140
140
|
};
|
|
141
141
|
|
|
142
|
-
const
|
|
142
|
+
export const buttonStyles = props => {
|
|
143
143
|
const theme = props.theme,
|
|
144
144
|
_props$loading = props.loading,
|
|
145
145
|
loading = _props$loading === void 0 ? false : _props$loading,
|
|
@@ -236,7 +236,6 @@ const styles = props => {
|
|
|
236
236
|
width: direction === 'column' ? '100%' : 'auto'
|
|
237
237
|
};
|
|
238
238
|
};
|
|
239
|
-
|
|
240
239
|
const Button = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
241
240
|
const _props$submit = props.submit,
|
|
242
241
|
submit = _props$submit === void 0 ? false : _props$submit,
|
|
@@ -294,4 +293,4 @@ Button.propTypes = {
|
|
|
294
293
|
stretch: PropTypes.bool
|
|
295
294
|
};
|
|
296
295
|
Button.displayName = 'Button';
|
|
297
|
-
export default createStyledComponent(
|
|
296
|
+
export default createStyledComponent(buttonStyles, Button);
|
package/es/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import Button from './Button';
|
|
1
|
+
import Button, { buttonStyles } from './Button';
|
|
2
2
|
import ButtonGroup from './ButtonGroup';
|
|
3
3
|
import TextButton from './TextButton';
|
|
4
4
|
import IconTextButton from './IconTextButton';
|
|
5
5
|
import UnstyledButton from './UnstyledButton';
|
|
6
|
-
export { Button, ButtonGroup, TextButton, IconTextButton, UnstyledButton };
|
|
6
|
+
export { buttonStyles, Button, ButtonGroup, TextButton, IconTextButton, UnstyledButton };
|
package/lib/Button.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = void 0;
|
|
6
|
+
exports.default = exports.buttonStyles = void 0;
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
@@ -155,7 +155,7 @@ var interactionStyleAccessor = function interactionStyleAccessor(interactionStat
|
|
|
155
155
|
} : undefined;
|
|
156
156
|
};
|
|
157
157
|
|
|
158
|
-
var
|
|
158
|
+
var buttonStyles = function buttonStyles(props) {
|
|
159
159
|
var theme = props.theme,
|
|
160
160
|
_props$loading = props.loading,
|
|
161
161
|
loading = _props$loading === void 0 ? false : _props$loading,
|
|
@@ -253,6 +253,8 @@ var styles = function styles(props) {
|
|
|
253
253
|
};
|
|
254
254
|
};
|
|
255
255
|
|
|
256
|
+
exports.buttonStyles = buttonStyles;
|
|
257
|
+
|
|
256
258
|
var Button = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
257
259
|
var _props$submit = props.submit,
|
|
258
260
|
submit = _props$submit === void 0 ? false : _props$submit,
|
|
@@ -314,6 +316,6 @@ Button.propTypes = {
|
|
|
314
316
|
};
|
|
315
317
|
Button.displayName = 'Button';
|
|
316
318
|
|
|
317
|
-
var _default = (0, _styleContainer.createStyledComponent)(
|
|
319
|
+
var _default = (0, _styleContainer.createStyledComponent)(buttonStyles, Button);
|
|
318
320
|
|
|
319
321
|
exports.default = _default;
|
package/lib/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
@@ -9,6 +11,12 @@ Object.defineProperty(exports, "Button", {
|
|
|
9
11
|
return _Button.default;
|
|
10
12
|
}
|
|
11
13
|
});
|
|
14
|
+
Object.defineProperty(exports, "buttonStyles", {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function get() {
|
|
17
|
+
return _Button.buttonStyles;
|
|
18
|
+
}
|
|
19
|
+
});
|
|
12
20
|
Object.defineProperty(exports, "ButtonGroup", {
|
|
13
21
|
enumerable: true,
|
|
14
22
|
get: function get() {
|
|
@@ -34,7 +42,7 @@ Object.defineProperty(exports, "UnstyledButton", {
|
|
|
34
42
|
}
|
|
35
43
|
});
|
|
36
44
|
|
|
37
|
-
var _Button =
|
|
45
|
+
var _Button = _interopRequireWildcard(require("./Button"));
|
|
38
46
|
|
|
39
47
|
var _ButtonGroup = _interopRequireDefault(require("./ButtonGroup"));
|
|
40
48
|
|
|
@@ -44,4 +52,8 @@ var _IconTextButton = _interopRequireDefault(require("./IconTextButton"));
|
|
|
44
52
|
|
|
45
53
|
var _UnstyledButton = _interopRequireDefault(require("./UnstyledButton"));
|
|
46
54
|
|
|
47
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
55
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
56
|
+
|
|
57
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
58
|
+
|
|
59
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudflare/component-button",
|
|
3
3
|
"description": "Cloudflare Button Component",
|
|
4
|
-
"version": "2.12.
|
|
4
|
+
"version": "2.12.5",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
7
7
|
"author": "James Kyle <jkyle@cloudflare.com>",
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
"access": "public"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@cloudflare/component-icon": "^6.6.
|
|
16
|
-
"@cloudflare/style-const": "^5.2.
|
|
17
|
-
"@cloudflare/style-container": "^7.6.
|
|
15
|
+
"@cloudflare/component-icon": "^6.6.13",
|
|
16
|
+
"@cloudflare/style-const": "^5.2.3",
|
|
17
|
+
"@cloudflare/style-container": "^7.6.4",
|
|
18
18
|
"polished": "^1.9.3",
|
|
19
19
|
"prop-types": "^15.6.0"
|
|
20
20
|
},
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"test-coverage": "stratus test --coverage",
|
|
33
33
|
"test-watch": "stratus test --watch"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "4cae13e569aecfe2e562957bef3e38c0cdfcffa7"
|
|
36
36
|
}
|