@primer/components 0.0.0-2021828205354 → 0.0.0-202182821115
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 +5 -3
- package/dist/browser.esm.js +186 -177
- package/dist/browser.esm.js.map +1 -1
- package/dist/browser.umd.js +187 -178
- package/dist/browser.umd.js.map +1 -1
- package/lib/AvatarStack.d.ts +4 -8
- package/lib/AvatarStack.js +6 -7
- package/lib/Button/Button.d.ts +3 -2
- package/lib/Button/Button.js +6 -2
- package/lib/Button/ButtonBase.d.ts +8 -5
- package/lib/Button/ButtonBase.js +5 -1
- package/lib/Button/ButtonClose.d.ts +45 -2
- package/lib/Button/ButtonClose.js +1 -1
- package/lib/Button/ButtonDanger.d.ts +3 -2
- package/lib/Button/ButtonDanger.js +6 -2
- package/lib/Button/ButtonInvisible.d.ts +3 -2
- package/lib/Button/ButtonInvisible.js +6 -2
- package/lib/Button/ButtonOutline.d.ts +3 -2
- package/lib/Button/ButtonOutline.js +6 -2
- package/lib/Button/ButtonPrimary.d.ts +3 -2
- package/lib/Button/ButtonPrimary.js +6 -2
- package/lib/Button/ButtonTableList.d.ts +2 -1
- package/lib/Button/ButtonTableList.js +1 -1
- package/lib/Dialog/ConfirmationDialog.js +3 -3
- package/lib/Dialog/Dialog.d.ts +5 -0
- package/lib/Dialog/Dialog.js +16 -4
- package/lib/Dropdown.d.ts +90 -2
- package/lib/DropdownMenu/DropdownButton.d.ts +46 -2
- package/lib-esm/AvatarStack.d.ts +4 -8
- package/lib-esm/AvatarStack.js +7 -8
- package/lib-esm/Button/Button.d.ts +3 -2
- package/lib-esm/Button/Button.js +2 -2
- package/lib-esm/Button/ButtonBase.d.ts +8 -5
- package/lib-esm/Button/ButtonBase.js +3 -1
- package/lib-esm/Button/ButtonClose.d.ts +45 -2
- package/lib-esm/Button/ButtonClose.js +2 -2
- package/lib-esm/Button/ButtonDanger.d.ts +3 -2
- package/lib-esm/Button/ButtonDanger.js +2 -2
- package/lib-esm/Button/ButtonInvisible.d.ts +3 -2
- package/lib-esm/Button/ButtonInvisible.js +2 -2
- package/lib-esm/Button/ButtonOutline.d.ts +3 -2
- package/lib-esm/Button/ButtonOutline.js +2 -2
- package/lib-esm/Button/ButtonPrimary.d.ts +3 -2
- package/lib-esm/Button/ButtonPrimary.js +2 -2
- package/lib-esm/Button/ButtonTableList.d.ts +2 -1
- package/lib-esm/Button/ButtonTableList.js +2 -2
- package/lib-esm/Dialog/ConfirmationDialog.js +3 -3
- package/lib-esm/Dialog/Dialog.d.ts +5 -0
- package/lib-esm/Dialog/Dialog.js +17 -5
- package/lib-esm/Dropdown.d.ts +90 -2
- package/lib-esm/DropdownMenu/DropdownButton.d.ts +46 -2
- package/package.json +1 -1
package/lib/AvatarStack.d.ts
CHANGED
@@ -1,12 +1,8 @@
|
|
1
|
-
|
2
|
-
import { SystemCommonProps } from './constants';
|
1
|
+
import React from 'react';
|
3
2
|
import { SxProp } from './sx';
|
4
|
-
import { ComponentProps } from './utils/types';
|
5
|
-
declare const AvatarStackWrapper: import("styled-components").StyledComponent<"span", any, {
|
6
|
-
count?: number | undefined;
|
7
|
-
} & SystemCommonProps & SxProp, never>;
|
8
3
|
export declare type AvatarStackProps = {
|
9
4
|
alignRight?: boolean;
|
10
|
-
|
11
|
-
|
5
|
+
children: React.ReactNode;
|
6
|
+
} & SxProp;
|
7
|
+
declare const AvatarStack: ({ children, alignRight, sx: sxProp }: AvatarStackProps) => JSX.Element;
|
12
8
|
export default AvatarStack;
|
package/lib/AvatarStack.js
CHANGED
@@ -19,12 +19,10 @@ var _sx = _interopRequireDefault(require("./sx"));
|
|
19
19
|
|
20
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
21
21
|
|
22
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
23
|
-
|
24
22
|
const AvatarStackWrapper = _styledComponents.default.span.withConfig({
|
25
23
|
displayName: "AvatarStack__AvatarStackWrapper",
|
26
24
|
componentId: "sc-1qgzd2v-0"
|
27
|
-
})(["display:flex;position:relative;height:20px;min-width:", ";.pc-AvatarItem{flex-shrink:0;height:20px;width:20px;box-shadow:0 0 0 1px ", ";margin-left:-11px;position:relative;overflow:hidden;transition:margin 0.2s ease-in-out,opacity 0.2s ease-in-out,visibility 0.2s ease-in-out,box-shadow 0.1s ease-in-out;&:first-child{margin-left:0;}&:nth-child(n + 4){display:none;}}&.pc-AvatarStack--two{min-width:30px;.pc-AvatarItem{&:nth-child(n + 3){display:none;}}}&.pc-AvatarStack--three-plus{min-width:38px;.pc-AvatarItem{&:nth-child(3){opacity:", "%;margin-left:-17px;}&:nth-child(4){opacity:", "%;margin-left:-17px;}&:nth-child(5){opacity:", "%;margin-left:-17px;}&:nth-child(n + 4){display:block;}&:nth-child(n + 6){opacity:0;visibility:hidden;}}}&.pc-AvatarStack--right{justify-content:flex-end;.pc-AvatarItem{margin-left:0 !important;margin-right:-11px;&:first-child{margin-right:0;}}.pc-AvatarStackBody{flex-direction:row-reverse;&:hover{.pc-AvatarItem{margin-right:", "!important;margin-left:0 !important;&:first-child{margin-right:0 !important;}}}}}&.pc-AvatarStack--three-plus.pc-AvatarStack--right{.pc-AvatarItem{&:nth-child(3){margin-right:-17px;}&:nth-child(4){margin-right:-17px;}&:nth-child(5){margin-right:-17px;}}}.pc-AvatarStackBody:hover{width:auto;.pc-AvatarItem{margin-left:", ";opacity:100%;visibility:visible;box-shadow:0 0 0 4px ", ";&:first-child{margin-left:0;}}}", "
|
25
|
+
})(["display:flex;position:relative;height:20px;min-width:", ";.pc-AvatarItem{flex-shrink:0;height:20px;width:20px;box-shadow:0 0 0 1px ", ";margin-left:-11px;position:relative;overflow:hidden;transition:margin 0.2s ease-in-out,opacity 0.2s ease-in-out,visibility 0.2s ease-in-out,box-shadow 0.1s ease-in-out;&:first-child{margin-left:0;}&:nth-child(n + 4){display:none;}}&.pc-AvatarStack--two{min-width:30px;.pc-AvatarItem{&:nth-child(n + 3){display:none;}}}&.pc-AvatarStack--three-plus{min-width:38px;.pc-AvatarItem{&:nth-child(3){opacity:", "%;margin-left:-17px;}&:nth-child(4){opacity:", "%;margin-left:-17px;}&:nth-child(5){opacity:", "%;margin-left:-17px;}&:nth-child(n + 4){display:block;}&:nth-child(n + 6){opacity:0;visibility:hidden;}}}&.pc-AvatarStack--right{justify-content:flex-end;.pc-AvatarItem{margin-left:0 !important;margin-right:-11px;&:first-child{margin-right:0;}}.pc-AvatarStackBody{flex-direction:row-reverse;&:hover{.pc-AvatarItem{margin-right:", "!important;margin-left:0 !important;&:first-child{margin-right:0 !important;}}}}}&.pc-AvatarStack--three-plus.pc-AvatarStack--right{.pc-AvatarItem{&:nth-child(3){margin-right:-17px;}&:nth-child(4){margin-right:-17px;}&:nth-child(5){margin-right:-17px;}}}.pc-AvatarStackBody:hover{width:auto;.pc-AvatarItem{margin-left:", ";opacity:100%;visibility:visible;box-shadow:0 0 0 4px ", ";&:first-child{margin-left:0;}}}", ";"], props => props.count === 1 ? '20px' : props.count === 2 ? '30px' : '38px', (0, _constants.get)('colors.canvas.default'), 100 - 3 * 15, 100 - 4 * 15, 100 - 5 * 15, (0, _constants.get)('space.1'), (0, _constants.get)('space.1'), (0, _constants.get)('colors.canvas.default'), _sx.default);
|
28
26
|
|
29
27
|
const transformChildren = children => {
|
30
28
|
return _react.default.Children.map(children, (child, index) => {
|
@@ -42,7 +40,7 @@ const transformChildren = children => {
|
|
42
40
|
const AvatarStack = ({
|
43
41
|
children,
|
44
42
|
alignRight,
|
45
|
-
|
43
|
+
sx: sxProp
|
46
44
|
}) => {
|
47
45
|
const count = _react.default.Children.count(children);
|
48
46
|
|
@@ -51,10 +49,11 @@ const AvatarStack = ({
|
|
51
49
|
'pc-AvatarStack--three-plus': count > 2,
|
52
50
|
'pc-AvatarStack--right': alignRight
|
53
51
|
});
|
54
|
-
return /*#__PURE__*/_react.default.createElement(AvatarStackWrapper,
|
52
|
+
return /*#__PURE__*/_react.default.createElement(AvatarStackWrapper, {
|
55
53
|
count: count,
|
56
|
-
className: wrapperClassNames
|
57
|
-
|
54
|
+
className: wrapperClassNames,
|
55
|
+
sx: sxProp
|
56
|
+
}, /*#__PURE__*/_react.default.createElement(_.Box, {
|
58
57
|
position: "absolute",
|
59
58
|
display: "flex",
|
60
59
|
width: "38px",
|
package/lib/Button/Button.d.ts
CHANGED
@@ -4,8 +4,9 @@ import { ComponentProps } from '../utils/types';
|
|
4
4
|
declare const Button: import("styled-components").StyledComponent<"button", any, {
|
5
5
|
as?: string | import("react").ComponentClass<any, any> | import("react").FunctionComponent<any> | undefined;
|
6
6
|
variant?: "large" | "medium" | "small" | undefined;
|
7
|
-
} & {
|
7
|
+
} & import("styled-system").FontSizeProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & {
|
8
8
|
color?: string | undefined;
|
9
|
+
fontSize?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
9
10
|
translate?: "yes" | "no" | undefined;
|
10
11
|
hidden?: boolean | undefined;
|
11
12
|
children?: import("react").ReactNode;
|
@@ -278,6 +279,6 @@ declare const Button: import("styled-components").StyledComponent<"button", any,
|
|
278
279
|
variant?: "large" | "medium" | "small" | undefined;
|
279
280
|
} & {
|
280
281
|
theme?: any;
|
281
|
-
} & SxProp, never>;
|
282
|
+
} & import("styled-system").FontSizeProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & import("../constants").SystemCommonProps & import("../constants").SystemLayoutProps & SxProp, never>;
|
282
283
|
export declare type ButtonProps = ComponentProps<typeof Button>;
|
283
284
|
export default Button;
|
package/lib/Button/Button.js
CHANGED
@@ -11,13 +11,17 @@ var _constants = require("../constants");
|
|
11
11
|
|
12
12
|
var _sx = _interopRequireDefault(require("../sx"));
|
13
13
|
|
14
|
-
var _ButtonBase =
|
14
|
+
var _ButtonBase = _interopRequireWildcard(require("./ButtonBase"));
|
15
|
+
|
16
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
17
|
+
|
18
|
+
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; }
|
15
19
|
|
16
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
17
21
|
|
18
22
|
const Button = (0, _styledComponents.default)(_ButtonBase.default).withConfig({
|
19
23
|
displayName: "Button",
|
20
24
|
componentId: "xjtz72-0"
|
21
|
-
})(["color:", ";background-color:", ";border:1px solid ", ";box-shadow:", ",", "};&:hover{background-color:", ";border-color:", ";}&:focus{border-color:", ";box-shadow:", ";}&:active{background-color:", ";box-shadow:", ";}&:disabled{color:", ";background-color:", ";border-color:", ";}", ";"], (0, _constants.get)('colors.btn.text'), (0, _constants.get)('colors.btn.bg'), (0, _constants.get)('colors.btn.border'), (0, _constants.get)('shadows.btn.shadow'), (0, _constants.get)('shadows.btn.insetShadow'), (0, _constants.get)('colors.btn.hoverBg'), (0, _constants.get)('colors.btn.hoverBorder'), (0, _constants.get)('colors.btn.focusBorder'), (0, _constants.get)('shadows.btn.focusShadow'), (0, _constants.get)('colors.btn.selectedBg'), (0, _constants.get)('shadows.btn.shadowActive'), (0, _constants.get)('colors.fg.muted'), (0, _constants.get)('colors.btn.bg'), (0, _constants.get)('colors.btn.border'), _sx.default);
|
25
|
+
})(["color:", ";background-color:", ";border:1px solid ", ";box-shadow:", ",", "};&:hover{background-color:", ";border-color:", ";}&:focus{border-color:", ";box-shadow:", ";}&:active{background-color:", ";box-shadow:", ";}&:disabled{color:", ";background-color:", ";border-color:", ";}", ";", ";"], (0, _constants.get)('colors.btn.text'), (0, _constants.get)('colors.btn.bg'), (0, _constants.get)('colors.btn.border'), (0, _constants.get)('shadows.btn.shadow'), (0, _constants.get)('shadows.btn.insetShadow'), (0, _constants.get)('colors.btn.hoverBg'), (0, _constants.get)('colors.btn.hoverBorder'), (0, _constants.get)('colors.btn.focusBorder'), (0, _constants.get)('shadows.btn.focusShadow'), (0, _constants.get)('colors.btn.selectedBg'), (0, _constants.get)('shadows.btn.shadowActive'), (0, _constants.get)('colors.fg.muted'), (0, _constants.get)('colors.btn.bg'), (0, _constants.get)('colors.btn.border'), _ButtonBase.buttonSystemProps, _sx.default);
|
22
26
|
var _default = Button;
|
23
27
|
exports.default = _default;
|
@@ -1,9 +1,12 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
+
import { FontSizeProps } from 'styled-system';
|
3
|
+
import { SystemCommonProps, SystemLayoutProps } from '../constants';
|
2
4
|
import { ComponentProps } from '../utils/types';
|
3
|
-
declare
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
export declare const buttonSystemProps: import("styled-system").styleFn;
|
6
|
+
export declare type ButtonSystemProps = FontSizeProps & SystemCommonProps & SystemLayoutProps;
|
7
|
+
declare const ButtonBase: import("styled-components").StyledComponent<"button", any, {
|
8
|
+
as?: string | import("react").ComponentClass<any, any> | import("react").FunctionComponent<any> | undefined;
|
9
|
+
variant?: "large" | "medium" | "small" | undefined;
|
10
|
+
} & FontSizeProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol>, never>;
|
8
11
|
export declare type ButtonBaseProps = ComponentProps<typeof ButtonBase>;
|
9
12
|
export default ButtonBase;
|
package/lib/Button/ButtonBase.js
CHANGED
@@ -3,16 +3,20 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.default = void 0;
|
6
|
+
exports.default = exports.buttonSystemProps = void 0;
|
7
7
|
|
8
8
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
9
9
|
|
10
10
|
var _styledSystem = require("styled-system");
|
11
11
|
|
12
|
+
var _constants = require("../constants");
|
13
|
+
|
12
14
|
var _ButtonStyles = _interopRequireDefault(require("./ButtonStyles"));
|
13
15
|
|
14
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
15
17
|
|
18
|
+
const buttonSystemProps = (0, _styledSystem.compose)(_styledSystem.fontSize, _constants.COMMON, _constants.LAYOUT);
|
19
|
+
exports.buttonSystemProps = buttonSystemProps;
|
16
20
|
const variants = (0, _styledSystem.variant)({
|
17
21
|
variants: {
|
18
22
|
small: {
|
@@ -1,13 +1,37 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { ComponentProps } from '../utils/types';
|
3
3
|
declare const ButtonClose: React.ForwardRefExoticComponent<Pick<{
|
4
|
-
|
4
|
+
backgroundColor?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
5
|
+
color?: (string & import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>>) | undefined;
|
6
|
+
display?: import("styled-system").ResponsiveValue<import("csstype").Property.Display, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
7
|
+
height?: import("styled-system").ResponsiveValue<import("csstype").Property.Height<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
8
|
+
marginBottom?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
9
|
+
marginLeft?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
10
|
+
marginRight?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
11
|
+
marginTop?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
12
|
+
maxHeight?: import("styled-system").ResponsiveValue<import("csstype").Property.MaxHeight<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
13
|
+
maxWidth?: import("styled-system").ResponsiveValue<import("csstype").Property.MaxWidth<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
14
|
+
minHeight?: import("styled-system").ResponsiveValue<import("csstype").Property.MinHeight<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
15
|
+
minWidth?: import("styled-system").ResponsiveValue<import("csstype").Property.MinWidth<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
16
|
+
opacity?: import("styled-system").ResponsiveValue<import("csstype").Property.Opacity, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
17
|
+
overflowX?: import("styled-system").ResponsiveValue<import("csstype").Property.OverflowX, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
18
|
+
overflowY?: import("styled-system").ResponsiveValue<import("csstype").Property.OverflowY, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
19
|
+
paddingBottom?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
20
|
+
paddingLeft?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
21
|
+
paddingRight?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
22
|
+
paddingTop?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
5
23
|
translate?: "yes" | "no" | undefined;
|
24
|
+
verticalAlign?: import("styled-system").ResponsiveValue<import("csstype").Property.VerticalAlign<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
25
|
+
width?: import("styled-system").ResponsiveValue<import("csstype").Property.Width<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
26
|
+
margin?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
27
|
+
overflow?: import("styled-system").ResponsiveValue<import("csstype").Property.Overflow, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
28
|
+
padding?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
6
29
|
hidden?: boolean | undefined;
|
7
30
|
children?: React.ReactNode;
|
8
31
|
value?: string | number | readonly string[] | undefined;
|
9
32
|
ref?: ((instance: HTMLButtonElement | null) => void) | React.RefObject<HTMLButtonElement> | null | undefined;
|
10
33
|
form?: string | undefined;
|
34
|
+
p?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
11
35
|
slot?: string | undefined;
|
12
36
|
style?: React.CSSProperties | undefined;
|
13
37
|
title?: string | undefined;
|
@@ -263,6 +287,25 @@ declare const ButtonClose: React.ForwardRefExoticComponent<Pick<{
|
|
263
287
|
onAnimationIterationCapture?: React.AnimationEventHandler<HTMLButtonElement> | undefined;
|
264
288
|
onTransitionEnd?: React.TransitionEventHandler<HTMLButtonElement> | undefined;
|
265
289
|
onTransitionEndCapture?: React.TransitionEventHandler<HTMLButtonElement> | undefined;
|
290
|
+
bg?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
291
|
+
m?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
292
|
+
mt?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
293
|
+
mr?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
294
|
+
mb?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
295
|
+
ml?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
296
|
+
mx?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
297
|
+
marginX?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
298
|
+
my?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
299
|
+
marginY?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
300
|
+
pt?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
301
|
+
pr?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
302
|
+
pb?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
303
|
+
pl?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
304
|
+
px?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
305
|
+
paddingX?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
306
|
+
py?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
307
|
+
paddingY?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
308
|
+
size?: import("styled-system").ResponsiveValue<import("csstype").Property.Height<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
266
309
|
sx?: import("@styled-system/css").SystemStyleObject | undefined;
|
267
310
|
autoFocus?: boolean | undefined;
|
268
311
|
disabled?: boolean | undefined;
|
@@ -273,6 +316,6 @@ declare const ButtonClose: React.ForwardRefExoticComponent<Pick<{
|
|
273
316
|
formTarget?: string | undefined;
|
274
317
|
} & {
|
275
318
|
theme?: any;
|
276
|
-
}, "color" | "translate" | "hidden" | "children" | "theme" | "value" | "form" | "slot" | "style" | "title" | "type" | "name" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "sx" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget"> & React.RefAttributes<HTMLButtonElement>>;
|
319
|
+
}, "backgroundColor" | "color" | "display" | "height" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "opacity" | "overflowX" | "overflowY" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "translate" | "verticalAlign" | "width" | "margin" | "overflow" | "padding" | "hidden" | "children" | "theme" | "value" | "form" | "p" | "slot" | "style" | "title" | "type" | "name" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "bg" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "size" | "sx" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget"> & React.RefAttributes<HTMLButtonElement>>;
|
277
320
|
export declare type ButtonCloseProps = ComponentProps<typeof ButtonClose>;
|
278
321
|
export default ButtonClose;
|
@@ -26,7 +26,7 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
26
26
|
const StyledButton = _styledComponents.default.button.withConfig({
|
27
27
|
displayName: "ButtonClose__StyledButton",
|
28
28
|
componentId: "sc-13mzqph-0"
|
29
|
-
})(["border:none;padding:0;background:transparent;outline:none;cursor:pointer;border-radius:", ";color:", ";&:focus{box-shadow:", ";}&:hover{color:", ";}", ";"], (0, _constants.get)('radii.2'), (0, _constants.get)('colors.fg.muted'), (0, _constants.get)('shadows.btn.focusShadow'), (0, _constants.get)('colors.accent.fg'), _sx.default);
|
29
|
+
})(["border:none;padding:0;background:transparent;outline:none;cursor:pointer;border-radius:", ";color:", ";&:focus{box-shadow:", ";}&:hover{color:", ";}", ";", ";", ";"], (0, _constants.get)('radii.2'), (0, _constants.get)('colors.fg.muted'), (0, _constants.get)('shadows.btn.focusShadow'), (0, _constants.get)('colors.accent.fg'), _constants.COMMON, _constants.LAYOUT, _sx.default);
|
30
30
|
|
31
31
|
const ButtonClose = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
32
32
|
return /*#__PURE__*/_react.default.createElement(StyledButton, _extends({
|
@@ -4,8 +4,9 @@ import { ComponentProps } from '../utils/types';
|
|
4
4
|
declare const ButtonDanger: import("styled-components").StyledComponent<"button", any, {
|
5
5
|
as?: string | import("react").ComponentClass<any, any> | import("react").FunctionComponent<any> | undefined;
|
6
6
|
variant?: "large" | "medium" | "small" | undefined;
|
7
|
-
} & {
|
7
|
+
} & import("styled-system").FontSizeProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & {
|
8
8
|
color?: string | undefined;
|
9
|
+
fontSize?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
9
10
|
translate?: "yes" | "no" | undefined;
|
10
11
|
hidden?: boolean | undefined;
|
11
12
|
children?: import("react").ReactNode;
|
@@ -278,6 +279,6 @@ declare const ButtonDanger: import("styled-components").StyledComponent<"button"
|
|
278
279
|
variant?: "large" | "medium" | "small" | undefined;
|
279
280
|
} & {
|
280
281
|
theme?: any;
|
281
|
-
} & SxProp, never>;
|
282
|
+
} & import("styled-system").FontSizeProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & import("../constants").SystemCommonProps & import("../constants").SystemLayoutProps & SxProp, never>;
|
282
283
|
export declare type ButtonDangerProps = ComponentProps<typeof ButtonDanger>;
|
283
284
|
export default ButtonDanger;
|
@@ -11,13 +11,17 @@ var _constants = require("../constants");
|
|
11
11
|
|
12
12
|
var _sx = _interopRequireDefault(require("../sx"));
|
13
13
|
|
14
|
-
var _ButtonBase =
|
14
|
+
var _ButtonBase = _interopRequireWildcard(require("./ButtonBase"));
|
15
|
+
|
16
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
17
|
+
|
18
|
+
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; }
|
15
19
|
|
16
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
17
21
|
|
18
22
|
const ButtonDanger = (0, _styledComponents.default)(_ButtonBase.default).withConfig({
|
19
23
|
displayName: "ButtonDanger",
|
20
24
|
componentId: "sc-13blgmk-0"
|
21
|
-
})(["color:", ";border:1px solid ", ";background-color:", ";box-shadow:", ";&:hover{color:", ";background-color:", ";border-color:", ";box-shadow:", ";}&:focus{border-color:", ";box-shadow:", ";}&:active{color:", ";background-color:", ";box-shadow:", ";border-color:", ";}&:disabled{color:", ";background-color:", ";border-color:", ";}", ";"], (0, _constants.get)('colors.btn.danger.text'), (0, _constants.get)('colors.btn.border'), (0, _constants.get)('colors.btn.bg'), (0, _constants.get)('shadows.btn.shadow'), (0, _constants.get)('colors.btn.danger.hoverText'), (0, _constants.get)('colors.btn.danger.hoverBg'), (0, _constants.get)('colors.btn.danger.hoverBorder'), (0, _constants.get)('shadows.btn.danger.hoverShadow'), (0, _constants.get)('colors.btn.danger.focusBorder'), (0, _constants.get)('shadows.btn.danger.focusShadow'), (0, _constants.get)('colors.btn.danger.selectedText'), (0, _constants.get)('colors.btn.danger.selectedBg'), (0, _constants.get)('shadows.btn.danger.selectedShadow'), (0, _constants.get)('colors.btn.danger.selectedBorder'), (0, _constants.get)('colors.btn.danger.disabledText'), (0, _constants.get)('colors.btn.danger.disabledBg'), (0, _constants.get)('colors.btn.danger.disabledBorder'), _sx.default);
|
25
|
+
})(["color:", ";border:1px solid ", ";background-color:", ";box-shadow:", ";&:hover{color:", ";background-color:", ";border-color:", ";box-shadow:", ";}&:focus{border-color:", ";box-shadow:", ";}&:active{color:", ";background-color:", ";box-shadow:", ";border-color:", ";}&:disabled{color:", ";background-color:", ";border-color:", ";}", ";", ";"], (0, _constants.get)('colors.btn.danger.text'), (0, _constants.get)('colors.btn.border'), (0, _constants.get)('colors.btn.bg'), (0, _constants.get)('shadows.btn.shadow'), (0, _constants.get)('colors.btn.danger.hoverText'), (0, _constants.get)('colors.btn.danger.hoverBg'), (0, _constants.get)('colors.btn.danger.hoverBorder'), (0, _constants.get)('shadows.btn.danger.hoverShadow'), (0, _constants.get)('colors.btn.danger.focusBorder'), (0, _constants.get)('shadows.btn.danger.focusShadow'), (0, _constants.get)('colors.btn.danger.selectedText'), (0, _constants.get)('colors.btn.danger.selectedBg'), (0, _constants.get)('shadows.btn.danger.selectedShadow'), (0, _constants.get)('colors.btn.danger.selectedBorder'), (0, _constants.get)('colors.btn.danger.disabledText'), (0, _constants.get)('colors.btn.danger.disabledBg'), (0, _constants.get)('colors.btn.danger.disabledBorder'), _ButtonBase.buttonSystemProps, _sx.default);
|
22
26
|
var _default = ButtonDanger;
|
23
27
|
exports.default = _default;
|
@@ -4,8 +4,9 @@ import { ComponentProps } from '../utils/types';
|
|
4
4
|
declare const ButtonInvisible: import("styled-components").StyledComponent<"button", any, {
|
5
5
|
as?: string | import("react").ComponentClass<any, any> | import("react").FunctionComponent<any> | undefined;
|
6
6
|
variant?: "large" | "medium" | "small" | undefined;
|
7
|
-
} & {
|
7
|
+
} & import("styled-system").FontSizeProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & {
|
8
8
|
color?: string | undefined;
|
9
|
+
fontSize?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
9
10
|
translate?: "yes" | "no" | undefined;
|
10
11
|
hidden?: boolean | undefined;
|
11
12
|
children?: import("react").ReactNode;
|
@@ -278,6 +279,6 @@ declare const ButtonInvisible: import("styled-components").StyledComponent<"butt
|
|
278
279
|
variant?: "large" | "medium" | "small" | undefined;
|
279
280
|
} & {
|
280
281
|
theme?: any;
|
281
|
-
} & SxProp, never>;
|
282
|
+
} & import("styled-system").FontSizeProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & import("../constants").SystemCommonProps & import("../constants").SystemLayoutProps & SxProp, never>;
|
282
283
|
export declare type ButtonInvisibleProps = ComponentProps<typeof ButtonInvisible>;
|
283
284
|
export default ButtonInvisible;
|
@@ -11,13 +11,17 @@ var _constants = require("../constants");
|
|
11
11
|
|
12
12
|
var _sx = _interopRequireDefault(require("../sx"));
|
13
13
|
|
14
|
-
var _ButtonBase =
|
14
|
+
var _ButtonBase = _interopRequireWildcard(require("./ButtonBase"));
|
15
|
+
|
16
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
17
|
+
|
18
|
+
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; }
|
15
19
|
|
16
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
17
21
|
|
18
22
|
const ButtonInvisible = (0, _styledComponents.default)(_ButtonBase.default).withConfig({
|
19
23
|
displayName: "ButtonInvisible",
|
20
24
|
componentId: "sc-1195tpn-0"
|
21
|
-
})(["color:", ";background-color:transparent;border:0;border-radius:", ";box-shadow:none;&:disabled{color:", ";}&:focus{box-shadow:", ";}", ""], (0, _constants.get)('colors.accent.fg'), (0, _constants.get)('radii.2'), (0, _constants.get)('colors.fg.muted'), (0, _constants.get)('shadows.btn.focusShadow'), _sx.default);
|
25
|
+
})(["color:", ";background-color:transparent;border:0;border-radius:", ";box-shadow:none;&:disabled{color:", ";}&:focus{box-shadow:", ";}", ";", ""], (0, _constants.get)('colors.accent.fg'), (0, _constants.get)('radii.2'), (0, _constants.get)('colors.fg.muted'), (0, _constants.get)('shadows.btn.focusShadow'), _ButtonBase.buttonSystemProps, _sx.default);
|
22
26
|
var _default = ButtonInvisible;
|
23
27
|
exports.default = _default;
|
@@ -4,8 +4,9 @@ import { ComponentProps } from '../utils/types';
|
|
4
4
|
declare const ButtonOutline: import("styled-components").StyledComponent<"button", any, {
|
5
5
|
as?: string | import("react").ComponentClass<any, any> | import("react").FunctionComponent<any> | undefined;
|
6
6
|
variant?: "large" | "medium" | "small" | undefined;
|
7
|
-
} & {
|
7
|
+
} & import("styled-system").FontSizeProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & {
|
8
8
|
color?: string | undefined;
|
9
|
+
fontSize?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
9
10
|
translate?: "yes" | "no" | undefined;
|
10
11
|
hidden?: boolean | undefined;
|
11
12
|
children?: import("react").ReactNode;
|
@@ -278,6 +279,6 @@ declare const ButtonOutline: import("styled-components").StyledComponent<"button
|
|
278
279
|
variant?: "large" | "medium" | "small" | undefined;
|
279
280
|
} & {
|
280
281
|
theme?: any;
|
281
|
-
} & SxProp, never>;
|
282
|
+
} & import("styled-system").FontSizeProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & import("../constants").SystemCommonProps & import("../constants").SystemLayoutProps & SxProp, never>;
|
282
283
|
export declare type ButtonOutlineProps = ComponentProps<typeof ButtonOutline>;
|
283
284
|
export default ButtonOutline;
|
@@ -11,13 +11,17 @@ var _constants = require("../constants");
|
|
11
11
|
|
12
12
|
var _sx = _interopRequireDefault(require("../sx"));
|
13
13
|
|
14
|
-
var _ButtonBase =
|
14
|
+
var _ButtonBase = _interopRequireWildcard(require("./ButtonBase"));
|
15
|
+
|
16
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
17
|
+
|
18
|
+
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; }
|
15
19
|
|
16
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
17
21
|
|
18
22
|
const ButtonOutline = (0, _styledComponents.default)(_ButtonBase.default).withConfig({
|
19
23
|
displayName: "ButtonOutline",
|
20
24
|
componentId: "sc-15gta9l-0"
|
21
|
-
})(["color:", ";border:1px solid ", ";background-color:", ";box-shadow:", ";&:hover{color:", ";background-color:", ";border-color:", ";box-shadow:", ";}&:focus{border-color:", ";box-shadow:", ";}&:active{color:", ";background-color:", ";box-shadow:", ";border-color:", ";}&:disabled{color:", ";background-color:", ";border-color:", ";}", ";"], (0, _constants.get)('colors.btn.outline.text'), (0, _constants.get)('colors.btn.border'), (0, _constants.get)('colors.btn.bg'), (0, _constants.get)('shadows.btn.shadow'), (0, _constants.get)('colors.btn.outline.hoverText'), (0, _constants.get)('colors.btn.outline.hoverBg'), (0, _constants.get)('colors.btn.outline.hoverBorder'), (0, _constants.get)('shadows.btn.outline.hoverShadow'), (0, _constants.get)('colors.btn.outline.focusBorder'), (0, _constants.get)('shadows.btn.outline.focusShadow'), (0, _constants.get)('colors.btn.outline.selectedText'), (0, _constants.get)('colors.btn.outline.selectedBg'), (0, _constants.get)('shadows.btn.outline.selectedShadow'), (0, _constants.get)('colors.btn.outline.selectedBorder'), (0, _constants.get)('colors.btn.outline.disabledText'), (0, _constants.get)('colors.btn.outline.disabledBg'), (0, _constants.get)('colors.btn.border'), _sx.default);
|
25
|
+
})(["color:", ";border:1px solid ", ";background-color:", ";box-shadow:", ";&:hover{color:", ";background-color:", ";border-color:", ";box-shadow:", ";}&:focus{border-color:", ";box-shadow:", ";}&:active{color:", ";background-color:", ";box-shadow:", ";border-color:", ";}&:disabled{color:", ";background-color:", ";border-color:", ";}", ";", ";"], (0, _constants.get)('colors.btn.outline.text'), (0, _constants.get)('colors.btn.border'), (0, _constants.get)('colors.btn.bg'), (0, _constants.get)('shadows.btn.shadow'), (0, _constants.get)('colors.btn.outline.hoverText'), (0, _constants.get)('colors.btn.outline.hoverBg'), (0, _constants.get)('colors.btn.outline.hoverBorder'), (0, _constants.get)('shadows.btn.outline.hoverShadow'), (0, _constants.get)('colors.btn.outline.focusBorder'), (0, _constants.get)('shadows.btn.outline.focusShadow'), (0, _constants.get)('colors.btn.outline.selectedText'), (0, _constants.get)('colors.btn.outline.selectedBg'), (0, _constants.get)('shadows.btn.outline.selectedShadow'), (0, _constants.get)('colors.btn.outline.selectedBorder'), (0, _constants.get)('colors.btn.outline.disabledText'), (0, _constants.get)('colors.btn.outline.disabledBg'), (0, _constants.get)('colors.btn.border'), _ButtonBase.buttonSystemProps, _sx.default);
|
22
26
|
var _default = ButtonOutline;
|
23
27
|
exports.default = _default;
|
@@ -4,8 +4,9 @@ import { ComponentProps } from '../utils/types';
|
|
4
4
|
export declare const ButtonPrimary: import("styled-components").StyledComponent<"button", any, {
|
5
5
|
as?: string | import("react").ComponentClass<any, any> | import("react").FunctionComponent<any> | undefined;
|
6
6
|
variant?: "large" | "medium" | "small" | undefined;
|
7
|
-
} & {
|
7
|
+
} & import("styled-system").FontSizeProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & {
|
8
8
|
color?: string | undefined;
|
9
|
+
fontSize?: import("styled-system").ResponsiveValue<string | number | symbol, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
9
10
|
translate?: "yes" | "no" | undefined;
|
10
11
|
hidden?: boolean | undefined;
|
11
12
|
children?: import("react").ReactNode;
|
@@ -278,6 +279,6 @@ export declare const ButtonPrimary: import("styled-components").StyledComponent<
|
|
278
279
|
variant?: "large" | "medium" | "small" | undefined;
|
279
280
|
} & {
|
280
281
|
theme?: any;
|
281
|
-
} & SxProp, never>;
|
282
|
+
} & import("styled-system").FontSizeProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & import("../constants").SystemCommonProps & import("../constants").SystemLayoutProps & SxProp, never>;
|
282
283
|
export declare type ButtonPrimaryProps = ComponentProps<typeof ButtonPrimary>;
|
283
284
|
export default ButtonPrimary;
|
@@ -11,14 +11,18 @@ var _constants = require("../constants");
|
|
11
11
|
|
12
12
|
var _sx = _interopRequireDefault(require("../sx"));
|
13
13
|
|
14
|
-
var _ButtonBase =
|
14
|
+
var _ButtonBase = _interopRequireWildcard(require("./ButtonBase"));
|
15
|
+
|
16
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
17
|
+
|
18
|
+
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; }
|
15
19
|
|
16
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
17
21
|
|
18
22
|
const ButtonPrimary = (0, _styledComponents.default)(_ButtonBase.default).withConfig({
|
19
23
|
displayName: "ButtonPrimary",
|
20
24
|
componentId: "sc-1050ge1-0"
|
21
|
-
})(["color:", ";border:1px solid ", ";background-color:", ";box-shadow:", ";&:hover{color:", ";background-color:", ";border-color:", ";box-shadow:", ";}&:focus{border-color:", ";box-shadow:", ";}&:active{background-color:", ";box-shadow:", ";}&:disabled{color:", ";background-color:", ";border-color:", ";}", ";"], (0, _constants.get)('colors.btn.primary.text'), (0, _constants.get)('colors.btn.primary.border'), (0, _constants.get)('colors.btn.primary.bg'), (0, _constants.get)('shadows.btn.primary.shadow'), (0, _constants.get)('colors.btn.primary.hoverText'), (0, _constants.get)('colors.btn.primary.hoverBg'), (0, _constants.get)('colors.btn.primary.hoverBorder'), (0, _constants.get)('shadows.btn.primary.hoverShadow'), (0, _constants.get)('colors.btn.primary.focusBorder'), (0, _constants.get)('shadows.btn.primary.focusShadow'), (0, _constants.get)('colors.btn.primary.selectedBg'), (0, _constants.get)('shadows.btn.primary.selectedShadow'), (0, _constants.get)('colors.btn.primary.disabledText'), (0, _constants.get)('colors.btn.primary.disabledBg'), (0, _constants.get)('colors.btn.primary.disabledBorder'), _sx.default);
|
25
|
+
})(["color:", ";border:1px solid ", ";background-color:", ";box-shadow:", ";&:hover{color:", ";background-color:", ";border-color:", ";box-shadow:", ";}&:focus{border-color:", ";box-shadow:", ";}&:active{background-color:", ";box-shadow:", ";}&:disabled{color:", ";background-color:", ";border-color:", ";}", ";", ";"], (0, _constants.get)('colors.btn.primary.text'), (0, _constants.get)('colors.btn.primary.border'), (0, _constants.get)('colors.btn.primary.bg'), (0, _constants.get)('shadows.btn.primary.shadow'), (0, _constants.get)('colors.btn.primary.hoverText'), (0, _constants.get)('colors.btn.primary.hoverBg'), (0, _constants.get)('colors.btn.primary.hoverBorder'), (0, _constants.get)('shadows.btn.primary.hoverShadow'), (0, _constants.get)('colors.btn.primary.focusBorder'), (0, _constants.get)('shadows.btn.primary.focusShadow'), (0, _constants.get)('colors.btn.primary.selectedBg'), (0, _constants.get)('shadows.btn.primary.selectedShadow'), (0, _constants.get)('colors.btn.primary.disabledText'), (0, _constants.get)('colors.btn.primary.disabledBg'), (0, _constants.get)('colors.btn.primary.disabledBorder'), _ButtonBase.buttonSystemProps, _sx.default);
|
22
26
|
exports.ButtonPrimary = ButtonPrimary;
|
23
27
|
var _default = ButtonPrimary;
|
24
28
|
exports.default = _default;
|
@@ -1,5 +1,6 @@
|
|
1
|
+
import { SystemCommonProps, SystemLayoutProps, SystemTypographyProps } from '../constants';
|
1
2
|
import { SxProp } from '../sx';
|
2
3
|
import { ComponentProps } from '../utils/types';
|
3
|
-
declare const ButtonTableList: import("styled-components").StyledComponent<"summary", any, SxProp, never>;
|
4
|
+
declare const ButtonTableList: import("styled-components").StyledComponent<"summary", any, SystemCommonProps & SystemTypographyProps & SystemLayoutProps & SxProp, never>;
|
4
5
|
export declare type ButtonTableListProps = ComponentProps<typeof ButtonTableList>;
|
5
6
|
export default ButtonTableList;
|
@@ -16,7 +16,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
16
16
|
const ButtonTableList = _styledComponents.default.summary.withConfig({
|
17
17
|
displayName: "ButtonTableList",
|
18
18
|
componentId: "sc-1m4q8ia-0"
|
19
|
-
})(["display:inline-block;padding:0;font-size:", ";color:", ";text-decoration:none;white-space:nowrap;cursor:pointer;user-select:none;background-color:transparent;border:0;appearance:none;&:hover{text-decoration:underline;}&:disabled{&,&:hover{color:rgba(", ",0.5);cursor:default;}}&:after{display:inline-block;margin-left:", ";width:0;height:0;vertical-align:-2px;content:'';border:4px solid transparent;border-top-color:currentcolor;}", ";"], (0, _constants.get)('fontSizes.1'), (0, _constants.get)('colors.fg.muted'), (0, _constants.get)('colors.fg.muted'), (0, _constants.get)('space.1'), _sx.default);
|
19
|
+
})(["display:inline-block;padding:0;font-size:", ";color:", ";text-decoration:none;white-space:nowrap;cursor:pointer;user-select:none;background-color:transparent;border:0;appearance:none;&:hover{text-decoration:underline;}&:disabled{&,&:hover{color:rgba(", ",0.5);cursor:default;}}&:after{display:inline-block;margin-left:", ";width:0;height:0;vertical-align:-2px;content:'';border:4px solid transparent;border-top-color:currentcolor;}", " ", " ", " ", ";"], (0, _constants.get)('fontSizes.1'), (0, _constants.get)('colors.fg.muted'), (0, _constants.get)('colors.fg.muted'), (0, _constants.get)('space.1'), _constants.COMMON, _constants.TYPOGRAPHY, _constants.LAYOUT, _sx.default);
|
20
20
|
|
21
21
|
var _default = ButtonTableList;
|
22
22
|
exports.default = _default;
|
@@ -117,13 +117,13 @@ const ConfirmationDialog = props => {
|
|
117
117
|
}, [onClose]);
|
118
118
|
const cancelButton = {
|
119
119
|
content: cancelButtonContent,
|
120
|
-
onClick: onCancelButtonClick
|
121
|
-
autoFocus: true
|
120
|
+
onClick: onCancelButtonClick
|
122
121
|
};
|
123
122
|
const confirmButton = {
|
124
123
|
content: confirmButtonContent,
|
125
124
|
buttonType: confirmButtonType,
|
126
|
-
onClick: onConfirmButtonClick
|
125
|
+
onClick: onConfirmButtonClick,
|
126
|
+
autoFocus: true
|
127
127
|
};
|
128
128
|
const footerButtons = [cancelButton, confirmButton];
|
129
129
|
return /*#__PURE__*/_react.default.createElement(_Dialog.Dialog, {
|
package/lib/Dialog/Dialog.d.ts
CHANGED
@@ -19,6 +19,11 @@ export declare type DialogButtonProps = ButtonProps & {
|
|
19
19
|
* focus this button automatically when the dialog appears.
|
20
20
|
*/
|
21
21
|
autoFocus?: boolean;
|
22
|
+
/**
|
23
|
+
* A reference to the rendered Button’s DOM node, used together with
|
24
|
+
* `autoFocus` for `focusTrap`’s `initialFocus`.
|
25
|
+
*/
|
26
|
+
ref?: React.RefObject<HTMLButtonElement>;
|
22
27
|
};
|
23
28
|
/**
|
24
29
|
* Props to customize the rendering of the Dialog.
|
package/lib/Dialog/Dialog.js
CHANGED
@@ -141,10 +141,19 @@ const _Dialog = /*#__PURE__*/_react.default.forwardRef((props, forwardedRef) =>
|
|
141
141
|
onClose,
|
142
142
|
role = 'dialog',
|
143
143
|
width = 'xlarge',
|
144
|
-
height = 'auto'
|
144
|
+
height = 'auto',
|
145
|
+
footerButtons = []
|
145
146
|
} = props;
|
146
147
|
const dialogLabelId = (0, _ssr.useSSRSafeId)();
|
147
148
|
const dialogDescriptionId = (0, _ssr.useSSRSafeId)();
|
149
|
+
const autoFocusedFooterButtonRef = (0, _react.useRef)(null);
|
150
|
+
|
151
|
+
for (const footerButton of footerButtons) {
|
152
|
+
if (footerButton.autoFocus) {
|
153
|
+
footerButton.ref = autoFocusedFooterButtonRef;
|
154
|
+
}
|
155
|
+
}
|
156
|
+
|
148
157
|
const defaultedProps = { ...props,
|
149
158
|
title,
|
150
159
|
subtitle,
|
@@ -157,7 +166,8 @@ const _Dialog = /*#__PURE__*/_react.default.forwardRef((props, forwardedRef) =>
|
|
157
166
|
const backdropRef = (0, _react.useRef)(null);
|
158
167
|
(0, _useFocusTrap.useFocusTrap)({
|
159
168
|
containerRef: dialogRef,
|
160
|
-
restoreFocusOnCleanUp: true
|
169
|
+
restoreFocusOnCleanUp: true,
|
170
|
+
initialFocusRef: autoFocusedFooterButtonRef
|
161
171
|
});
|
162
172
|
(0, _hooks.useOnEscapePress)(event => {
|
163
173
|
onClose('escape');
|
@@ -212,7 +222,9 @@ const buttonTypes = {
|
|
212
222
|
const Buttons = ({
|
213
223
|
buttons
|
214
224
|
}) => {
|
215
|
-
|
225
|
+
var _buttons$find;
|
226
|
+
|
227
|
+
const autoFocusRef = (0, _hooks.useProvidedRefOrCreate)((_buttons$find = buttons.find(button => button.autoFocus)) === null || _buttons$find === void 0 ? void 0 : _buttons$find.ref);
|
216
228
|
let autoFocusCount = 0;
|
217
229
|
const [hasRendered, setHasRendered] = (0, _react.useState)(0);
|
218
230
|
(0, _react.useEffect)(() => {
|
@@ -224,7 +236,7 @@ const Buttons = ({
|
|
224
236
|
} else {
|
225
237
|
setHasRendered(hasRendered + 1);
|
226
238
|
}
|
227
|
-
}, [hasRendered]);
|
239
|
+
}, [autoFocusRef, hasRendered]);
|
228
240
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, buttons.map((dialogButtonProps, index) => {
|
229
241
|
const {
|
230
242
|
content,
|