carbon-react 111.11.0 → 111.12.1
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/esm/components/step-sequence/step-sequence-item/step-sequence-item.component.js +6 -6
- package/esm/components/step-sequence/step-sequence-item/step-sequence-item.style.d.ts +6 -9
- package/esm/components/step-sequence/step-sequence-item/step-sequence-item.style.js +62 -58
- package/esm/components/step-sequence/step-sequence.component.d.ts +2 -2
- package/esm/components/step-sequence/step-sequence.component.js +159 -4
- package/esm/components/step-sequence/step-sequence.style.d.ts +4 -4
- package/esm/components/step-sequence/step-sequence.style.js +6 -7
- package/esm/components/toast/toast.component.js +9 -4
- package/esm/components/toast/toast.style.js +5 -2
- package/lib/components/step-sequence/step-sequence-item/step-sequence-item.component.js +5 -5
- package/lib/components/step-sequence/step-sequence-item/step-sequence-item.style.d.ts +6 -9
- package/lib/components/step-sequence/step-sequence-item/step-sequence-item.style.js +67 -63
- package/lib/components/step-sequence/step-sequence.component.d.ts +2 -2
- package/lib/components/step-sequence/step-sequence.component.js +157 -2
- package/lib/components/step-sequence/step-sequence.style.d.ts +4 -4
- package/lib/components/step-sequence/step-sequence.style.js +5 -6
- package/lib/components/toast/toast.component.js +8 -3
- package/lib/components/toast/toast.style.js +5 -2
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
2
2
|
|
|
3
3
|
import React, { useContext } from "react";
|
|
4
4
|
import PropTypes from "prop-types";
|
|
5
|
-
import {
|
|
5
|
+
import { StyledStepSequenceItem, StyledStepSequenceItemContent, StyledStepSequenceItemIndicator, StyledStepSequenceItemHiddenLabel } from "./step-sequence-item.style";
|
|
6
6
|
import Icon from "../../icon";
|
|
7
7
|
import { StepSequenceContext } from "../step-sequence.component";
|
|
8
8
|
|
|
@@ -21,7 +21,7 @@ const StepSequenceItem = ({
|
|
|
21
21
|
} = useContext(StepSequenceContext);
|
|
22
22
|
|
|
23
23
|
const indicatorText = () => {
|
|
24
|
-
return !hideIndicator ? /*#__PURE__*/React.createElement(
|
|
24
|
+
return !hideIndicator ? /*#__PURE__*/React.createElement(StyledStepSequenceItemIndicator, null, indicator) : null;
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
const icon = () => status === "complete" ? /*#__PURE__*/React.createElement(Icon, {
|
|
@@ -30,23 +30,23 @@ const StepSequenceItem = ({
|
|
|
30
30
|
|
|
31
31
|
const hiddenLabel = () => {
|
|
32
32
|
if (hiddenCompleteLabel && status === "complete") {
|
|
33
|
-
return /*#__PURE__*/React.createElement(
|
|
33
|
+
return /*#__PURE__*/React.createElement(StyledStepSequenceItemHiddenLabel, null, hiddenCompleteLabel);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
if (hiddenCurrentLabel && status === "current") {
|
|
37
|
-
return /*#__PURE__*/React.createElement(
|
|
37
|
+
return /*#__PURE__*/React.createElement(StyledStepSequenceItemHiddenLabel, null, hiddenCurrentLabel);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
return null;
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
-
return /*#__PURE__*/React.createElement(
|
|
43
|
+
return /*#__PURE__*/React.createElement(StyledStepSequenceItem, _extends({
|
|
44
44
|
"data-component": "step-sequence-item",
|
|
45
45
|
orientation: orientation,
|
|
46
46
|
status: status,
|
|
47
47
|
key: `step-seq-item-${indicator}`,
|
|
48
48
|
"aria-label": ariaLabel
|
|
49
|
-
}, rest), hiddenLabel(), /*#__PURE__*/React.createElement(
|
|
49
|
+
}, rest), hiddenLabel(), /*#__PURE__*/React.createElement(StyledStepSequenceItemContent, null, icon(), /*#__PURE__*/React.createElement("span", null, children)));
|
|
50
50
|
};
|
|
51
51
|
|
|
52
52
|
StepSequenceItem.propTypes = {
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const StepSequenceItemHiddenLabelStyle: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
8
|
-
export declare const StepSequenceItemIndicatorStyle: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
9
|
-
export {};
|
|
1
|
+
import { StepSequenceProps } from "../step-sequence.component";
|
|
2
|
+
import { StepSequenceItemProps } from "./step-sequence-item.component";
|
|
3
|
+
export declare const StyledStepSequenceItem: import("styled-components").StyledComponent<"li", any, Pick<StepSequenceItemProps, "status"> & Pick<StepSequenceProps, "orientation">, never>;
|
|
4
|
+
export declare const StyledStepSequenceItemContent: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
5
|
+
export declare const StyledStepSequenceItemHiddenLabel: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
6
|
+
export declare const StyledStepSequenceItemIndicator: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import styled, { css } from "styled-components";
|
|
2
2
|
import StyledIcon from "../../icon/icon.style";
|
|
3
|
-
export const
|
|
3
|
+
export const StyledStepSequenceItem = styled.li`
|
|
4
4
|
display: flex;
|
|
5
5
|
align-items: center;
|
|
6
6
|
flex-grow: 1;
|
|
@@ -8,82 +8,86 @@ export const StepSequenceItemStyle = styled.li`
|
|
|
8
8
|
list-style-type: none;
|
|
9
9
|
color: var(--colorsUtilityYin055);
|
|
10
10
|
|
|
11
|
-
&::before {
|
|
12
|
-
content: "";
|
|
13
|
-
flex-grow: 1;
|
|
14
|
-
display: block;
|
|
15
|
-
height: var(--sizing025);
|
|
16
|
-
margin: 0 16px;
|
|
17
|
-
background-color: var(--colorsUtilityYin055);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
& span {
|
|
21
|
-
display: flex;
|
|
22
|
-
align-items: center;
|
|
23
|
-
justify-content: center;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
${StyledIcon} {
|
|
27
|
-
margin-right: 8px;
|
|
28
|
-
color: var(--colorsBaseTheme, var(--colorsSemanticPositive500));
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
&:first-child {
|
|
32
|
-
flex-grow: 0;
|
|
33
|
-
|
|
34
|
-
&::before {
|
|
35
|
-
display: none;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
11
|
${({
|
|
12
|
+
orientation,
|
|
40
13
|
status
|
|
41
|
-
}) =>
|
|
42
|
-
|
|
43
|
-
|
|
14
|
+
}) => {
|
|
15
|
+
const side = orientation === "vertical" ? "left" : "top";
|
|
16
|
+
return css`
|
|
44
17
|
&::before {
|
|
45
|
-
|
|
18
|
+
content: "";
|
|
19
|
+
flex-grow: 1;
|
|
20
|
+
display: block;
|
|
21
|
+
margin: 0 16px;
|
|
22
|
+
border-${side}: var(--sizing025) dashed var(--colorsUtilityYin055);
|
|
46
23
|
}
|
|
47
|
-
`}
|
|
48
24
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
&::before {
|
|
55
|
-
background-color: var(
|
|
56
|
-
--colorsBaseTheme,
|
|
57
|
-
var(--colorsSemanticPositive500)
|
|
58
|
-
);
|
|
25
|
+
& span {
|
|
26
|
+
display: flex;
|
|
27
|
+
align-items: center;
|
|
28
|
+
justify-content: center;
|
|
59
29
|
}
|
|
60
|
-
`}
|
|
61
30
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
align-items: flex-start;
|
|
31
|
+
${StyledIcon} {
|
|
32
|
+
margin-right: 8px;
|
|
33
|
+
color: var(--colorsBaseTheme, var(--colorsSemanticPositive500));
|
|
34
|
+
}
|
|
67
35
|
|
|
68
|
-
|
|
36
|
+
&:first-child {
|
|
69
37
|
flex-grow: 0;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
38
|
+
|
|
39
|
+
&::before {
|
|
40
|
+
display: none;
|
|
41
|
+
}
|
|
73
42
|
}
|
|
74
|
-
|
|
43
|
+
|
|
44
|
+
${status === "current" && css`
|
|
45
|
+
color: var(--colorsUtilityYin090);
|
|
46
|
+
|
|
47
|
+
&::before {
|
|
48
|
+
border-${side}-color: var(--colorsUtilityYin090);
|
|
49
|
+
border-${side}-style: solid;
|
|
50
|
+
}
|
|
51
|
+
`}
|
|
52
|
+
|
|
53
|
+
${status === "complete" && css`
|
|
54
|
+
color: var(--colorsBaseTheme, var(--colorsSemanticPositive500));
|
|
55
|
+
|
|
56
|
+
&::before {
|
|
57
|
+
border-${side}-color: var(
|
|
58
|
+
--colorsBaseTheme,
|
|
59
|
+
var(--colorsSemanticPositive500)
|
|
60
|
+
);
|
|
61
|
+
border-${side}-style: solid;
|
|
62
|
+
}
|
|
63
|
+
`}
|
|
64
|
+
|
|
65
|
+
${orientation === "vertical" && css`
|
|
66
|
+
flex-direction: column;
|
|
67
|
+
align-items: flex-start;
|
|
68
|
+
|
|
69
|
+
&::before {
|
|
70
|
+
flex-grow: 0;
|
|
71
|
+
border-left-width: var(--sizing025);
|
|
72
|
+
height: 100%;
|
|
73
|
+
min-height: var(--sizing300);
|
|
74
|
+
margin: 12px 8px;
|
|
75
|
+
}
|
|
76
|
+
`}
|
|
77
|
+
`;
|
|
78
|
+
}}
|
|
75
79
|
`;
|
|
76
|
-
export const
|
|
80
|
+
export const StyledStepSequenceItemContent = styled.span`
|
|
77
81
|
display: flex;
|
|
78
82
|
`;
|
|
79
|
-
export const
|
|
83
|
+
export const StyledStepSequenceItemHiddenLabel = styled.span`
|
|
80
84
|
position: absolute !important;
|
|
81
85
|
height: 1px;
|
|
82
86
|
width: 1px;
|
|
83
87
|
overflow: hidden;
|
|
84
88
|
clip: rect(1px, 1px, 1px, 1px);
|
|
85
89
|
`;
|
|
86
|
-
export const
|
|
90
|
+
export const StyledStepSequenceItemIndicator = styled.span`
|
|
87
91
|
display: block;
|
|
88
92
|
min-width: 16px;
|
|
89
93
|
height: 16px;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { SpaceProps } from "styled-system";
|
|
3
3
|
export declare const StepSequenceContext: React.Context<{
|
|
4
4
|
orientation: "horizontal" | "vertical";
|
|
5
5
|
}>;
|
|
6
|
-
export interface StepSequenceProps extends
|
|
6
|
+
export interface StepSequenceProps extends SpaceProps {
|
|
7
7
|
/** Step sequence items to be rendered */
|
|
8
8
|
children: React.ReactNode;
|
|
9
9
|
/** The direction that step sequence items should be rendered */
|
|
@@ -2,7 +2,7 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
2
2
|
|
|
3
3
|
import React from "react";
|
|
4
4
|
import PropTypes from "prop-types";
|
|
5
|
-
import
|
|
5
|
+
import StyledStepSequence from "./step-sequence.style";
|
|
6
6
|
export const StepSequenceContext = /*#__PURE__*/React.createContext({
|
|
7
7
|
orientation: "horizontal"
|
|
8
8
|
});
|
|
@@ -12,9 +12,10 @@ const StepSequence = ({
|
|
|
12
12
|
orientation = "horizontal",
|
|
13
13
|
...props
|
|
14
14
|
}) => {
|
|
15
|
-
return /*#__PURE__*/React.createElement(
|
|
15
|
+
return /*#__PURE__*/React.createElement(StyledStepSequence, _extends({
|
|
16
16
|
"data-component": "step-sequence",
|
|
17
|
-
orientation: orientation
|
|
17
|
+
orientation: orientation,
|
|
18
|
+
p: 0
|
|
18
19
|
}, props), /*#__PURE__*/React.createElement(StepSequenceContext.Provider, {
|
|
19
20
|
value: {
|
|
20
21
|
orientation
|
|
@@ -178,7 +179,161 @@ StepSequence.propTypes = {
|
|
|
178
179
|
"toString": PropTypes.func.isRequired,
|
|
179
180
|
"valueOf": PropTypes.func.isRequired
|
|
180
181
|
}), PropTypes.string]),
|
|
181
|
-
"orientation": PropTypes.oneOf(["horizontal", "vertical"])
|
|
182
|
+
"orientation": PropTypes.oneOf(["horizontal", "vertical"]),
|
|
183
|
+
"p": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
184
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
185
|
+
"description": PropTypes.string,
|
|
186
|
+
"toString": PropTypes.func.isRequired,
|
|
187
|
+
"valueOf": PropTypes.func.isRequired
|
|
188
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
189
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
190
|
+
"description": PropTypes.string,
|
|
191
|
+
"toString": PropTypes.func.isRequired,
|
|
192
|
+
"valueOf": PropTypes.func.isRequired
|
|
193
|
+
}), PropTypes.string]),
|
|
194
|
+
"padding": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
195
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
196
|
+
"description": PropTypes.string,
|
|
197
|
+
"toString": PropTypes.func.isRequired,
|
|
198
|
+
"valueOf": PropTypes.func.isRequired
|
|
199
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
200
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
201
|
+
"description": PropTypes.string,
|
|
202
|
+
"toString": PropTypes.func.isRequired,
|
|
203
|
+
"valueOf": PropTypes.func.isRequired
|
|
204
|
+
}), PropTypes.string]),
|
|
205
|
+
"paddingBottom": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
206
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
207
|
+
"description": PropTypes.string,
|
|
208
|
+
"toString": PropTypes.func.isRequired,
|
|
209
|
+
"valueOf": PropTypes.func.isRequired
|
|
210
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
211
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
212
|
+
"description": PropTypes.string,
|
|
213
|
+
"toString": PropTypes.func.isRequired,
|
|
214
|
+
"valueOf": PropTypes.func.isRequired
|
|
215
|
+
}), PropTypes.string]),
|
|
216
|
+
"paddingLeft": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
217
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
218
|
+
"description": PropTypes.string,
|
|
219
|
+
"toString": PropTypes.func.isRequired,
|
|
220
|
+
"valueOf": PropTypes.func.isRequired
|
|
221
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
222
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
223
|
+
"description": PropTypes.string,
|
|
224
|
+
"toString": PropTypes.func.isRequired,
|
|
225
|
+
"valueOf": PropTypes.func.isRequired
|
|
226
|
+
}), PropTypes.string]),
|
|
227
|
+
"paddingRight": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
228
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
229
|
+
"description": PropTypes.string,
|
|
230
|
+
"toString": PropTypes.func.isRequired,
|
|
231
|
+
"valueOf": PropTypes.func.isRequired
|
|
232
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
233
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
234
|
+
"description": PropTypes.string,
|
|
235
|
+
"toString": PropTypes.func.isRequired,
|
|
236
|
+
"valueOf": PropTypes.func.isRequired
|
|
237
|
+
}), PropTypes.string]),
|
|
238
|
+
"paddingTop": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
239
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
240
|
+
"description": PropTypes.string,
|
|
241
|
+
"toString": PropTypes.func.isRequired,
|
|
242
|
+
"valueOf": PropTypes.func.isRequired
|
|
243
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
244
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
245
|
+
"description": PropTypes.string,
|
|
246
|
+
"toString": PropTypes.func.isRequired,
|
|
247
|
+
"valueOf": PropTypes.func.isRequired
|
|
248
|
+
}), PropTypes.string]),
|
|
249
|
+
"paddingX": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
250
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
251
|
+
"description": PropTypes.string,
|
|
252
|
+
"toString": PropTypes.func.isRequired,
|
|
253
|
+
"valueOf": PropTypes.func.isRequired
|
|
254
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
255
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
256
|
+
"description": PropTypes.string,
|
|
257
|
+
"toString": PropTypes.func.isRequired,
|
|
258
|
+
"valueOf": PropTypes.func.isRequired
|
|
259
|
+
}), PropTypes.string]),
|
|
260
|
+
"paddingY": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
261
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
262
|
+
"description": PropTypes.string,
|
|
263
|
+
"toString": PropTypes.func.isRequired,
|
|
264
|
+
"valueOf": PropTypes.func.isRequired
|
|
265
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
266
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
267
|
+
"description": PropTypes.string,
|
|
268
|
+
"toString": PropTypes.func.isRequired,
|
|
269
|
+
"valueOf": PropTypes.func.isRequired
|
|
270
|
+
}), PropTypes.string]),
|
|
271
|
+
"pb": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
272
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
273
|
+
"description": PropTypes.string,
|
|
274
|
+
"toString": PropTypes.func.isRequired,
|
|
275
|
+
"valueOf": PropTypes.func.isRequired
|
|
276
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
277
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
278
|
+
"description": PropTypes.string,
|
|
279
|
+
"toString": PropTypes.func.isRequired,
|
|
280
|
+
"valueOf": PropTypes.func.isRequired
|
|
281
|
+
}), PropTypes.string]),
|
|
282
|
+
"pl": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
283
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
284
|
+
"description": PropTypes.string,
|
|
285
|
+
"toString": PropTypes.func.isRequired,
|
|
286
|
+
"valueOf": PropTypes.func.isRequired
|
|
287
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
288
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
289
|
+
"description": PropTypes.string,
|
|
290
|
+
"toString": PropTypes.func.isRequired,
|
|
291
|
+
"valueOf": PropTypes.func.isRequired
|
|
292
|
+
}), PropTypes.string]),
|
|
293
|
+
"pr": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
294
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
295
|
+
"description": PropTypes.string,
|
|
296
|
+
"toString": PropTypes.func.isRequired,
|
|
297
|
+
"valueOf": PropTypes.func.isRequired
|
|
298
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
299
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
300
|
+
"description": PropTypes.string,
|
|
301
|
+
"toString": PropTypes.func.isRequired,
|
|
302
|
+
"valueOf": PropTypes.func.isRequired
|
|
303
|
+
}), PropTypes.string]),
|
|
304
|
+
"pt": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
305
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
306
|
+
"description": PropTypes.string,
|
|
307
|
+
"toString": PropTypes.func.isRequired,
|
|
308
|
+
"valueOf": PropTypes.func.isRequired
|
|
309
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
310
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
311
|
+
"description": PropTypes.string,
|
|
312
|
+
"toString": PropTypes.func.isRequired,
|
|
313
|
+
"valueOf": PropTypes.func.isRequired
|
|
314
|
+
}), PropTypes.string]),
|
|
315
|
+
"px": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
316
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
317
|
+
"description": PropTypes.string,
|
|
318
|
+
"toString": PropTypes.func.isRequired,
|
|
319
|
+
"valueOf": PropTypes.func.isRequired
|
|
320
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
321
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
322
|
+
"description": PropTypes.string,
|
|
323
|
+
"toString": PropTypes.func.isRequired,
|
|
324
|
+
"valueOf": PropTypes.func.isRequired
|
|
325
|
+
}), PropTypes.string]),
|
|
326
|
+
"py": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
|
|
327
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
328
|
+
"description": PropTypes.string,
|
|
329
|
+
"toString": PropTypes.func.isRequired,
|
|
330
|
+
"valueOf": PropTypes.func.isRequired
|
|
331
|
+
}), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
|
|
332
|
+
"__@toStringTag": PropTypes.string.isRequired,
|
|
333
|
+
"description": PropTypes.string,
|
|
334
|
+
"toString": PropTypes.func.isRequired,
|
|
335
|
+
"valueOf": PropTypes.func.isRequired
|
|
336
|
+
}), PropTypes.string])
|
|
182
337
|
};
|
|
183
338
|
export { StepSequence };
|
|
184
339
|
export default StepSequence;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export default
|
|
1
|
+
import { SpaceProps } from "styled-system";
|
|
2
|
+
import { StepSequenceProps } from "./step-sequence.component";
|
|
3
|
+
declare const StyledStepSequence: import("styled-components").StyledComponent<"ol", any, Pick<StepSequenceProps, "orientation"> & SpaceProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol>, never>;
|
|
4
|
+
export default StyledStepSequence;
|
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
import styled, { css } from "styled-components";
|
|
2
|
-
import {
|
|
2
|
+
import { space } from "styled-system";
|
|
3
3
|
import { baseTheme } from "../../style/themes";
|
|
4
|
-
const
|
|
4
|
+
const StyledStepSequence = styled.ol`
|
|
5
5
|
display: flex;
|
|
6
6
|
margin: 0;
|
|
7
|
-
padding: 18px;
|
|
8
7
|
font-weight: bold;
|
|
9
8
|
|
|
10
9
|
${({
|
|
11
10
|
orientation
|
|
12
11
|
}) => orientation === "vertical" && css`
|
|
13
12
|
flex-direction: column;
|
|
14
|
-
|
|
13
|
+
height: 100%;
|
|
15
14
|
`}
|
|
16
15
|
|
|
17
|
-
${
|
|
16
|
+
${space}
|
|
18
17
|
`;
|
|
19
|
-
|
|
18
|
+
StyledStepSequence.defaultProps = {
|
|
20
19
|
theme: baseTheme
|
|
21
20
|
};
|
|
22
|
-
export default
|
|
21
|
+
export default StyledStepSequence;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
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); }
|
|
2
2
|
|
|
3
|
-
import React, { useCallback, useEffect, useMemo, useRef } from "react";
|
|
3
|
+
import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
4
4
|
import classNames from "classnames";
|
|
5
5
|
import { TransitionGroup, CSSTransition } from "react-transition-group";
|
|
6
6
|
import PropTypes from "prop-types";
|
|
@@ -32,6 +32,7 @@ const Toast = /*#__PURE__*/React.forwardRef(({
|
|
|
32
32
|
const toastContentNodeRef = useRef();
|
|
33
33
|
const closeIconRef = useRef();
|
|
34
34
|
const focusedElementBeforeOpening = useRef();
|
|
35
|
+
const [tabIndex, setTabIndex] = useState(0);
|
|
35
36
|
const refToPass = ref || toastRef;
|
|
36
37
|
const componentClasses = useMemo(() => {
|
|
37
38
|
return classNames(className);
|
|
@@ -53,15 +54,16 @@ const Toast = /*#__PURE__*/React.forwardRef(({
|
|
|
53
54
|
timer.current = setTimeout(() => onDismiss(), timeout);
|
|
54
55
|
}, [onDismiss, open, timeout]);
|
|
55
56
|
useEffect(() => {
|
|
56
|
-
if (
|
|
57
|
+
if (!disableAutoFocus) {
|
|
57
58
|
if (open) {
|
|
58
|
-
var
|
|
59
|
+
var _toastContentNodeRef$;
|
|
59
60
|
|
|
60
61
|
focusedElementBeforeOpening.current = document.activeElement;
|
|
61
|
-
(
|
|
62
|
+
(_toastContentNodeRef$ = toastContentNodeRef.current) === null || _toastContentNodeRef$ === void 0 ? void 0 : _toastContentNodeRef$.focus();
|
|
62
63
|
} else if (focusedElementBeforeOpening.current) {
|
|
63
64
|
focusedElementBeforeOpening.current.focus();
|
|
64
65
|
focusedElementBeforeOpening.current = undefined;
|
|
66
|
+
setTabIndex(0);
|
|
65
67
|
}
|
|
66
68
|
}
|
|
67
69
|
}, [open, onDismiss, disableAutoFocus]);
|
|
@@ -107,6 +109,9 @@ const Toast = /*#__PURE__*/React.forwardRef(({
|
|
|
107
109
|
className: componentClasses
|
|
108
110
|
}, tagComponent(restProps["data-component"] || "toast", restProps), toastProps, {
|
|
109
111
|
ref: toastContentNodeRef
|
|
112
|
+
}, !disableAutoFocus && {
|
|
113
|
+
tabIndex,
|
|
114
|
+
onBlur: () => setTabIndex(undefined)
|
|
110
115
|
}), !isNotice && /*#__PURE__*/React.createElement(TypeIcon, {
|
|
111
116
|
variant: toastProps.variant
|
|
112
117
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
@@ -50,8 +50,11 @@ const ToastStyle = styled(MessageStyle)`
|
|
|
50
50
|
margin-right: ${isCenter ? "auto" : "30px"};
|
|
51
51
|
`}
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
:focus {
|
|
54
|
+
outline: none;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&${animationName}-appear, &${animationName}-enter {
|
|
55
58
|
opacity: 0;
|
|
56
59
|
transform: scale(0.5);
|
|
57
60
|
}
|
|
@@ -38,7 +38,7 @@ const StepSequenceItem = ({
|
|
|
38
38
|
} = (0, _react.useContext)(_stepSequence.StepSequenceContext);
|
|
39
39
|
|
|
40
40
|
const indicatorText = () => {
|
|
41
|
-
return !hideIndicator ? /*#__PURE__*/_react.default.createElement(_stepSequenceItem.
|
|
41
|
+
return !hideIndicator ? /*#__PURE__*/_react.default.createElement(_stepSequenceItem.StyledStepSequenceItemIndicator, null, indicator) : null;
|
|
42
42
|
};
|
|
43
43
|
|
|
44
44
|
const icon = () => status === "complete" ? /*#__PURE__*/_react.default.createElement(_icon.default, {
|
|
@@ -47,23 +47,23 @@ const StepSequenceItem = ({
|
|
|
47
47
|
|
|
48
48
|
const hiddenLabel = () => {
|
|
49
49
|
if (hiddenCompleteLabel && status === "complete") {
|
|
50
|
-
return /*#__PURE__*/_react.default.createElement(_stepSequenceItem.
|
|
50
|
+
return /*#__PURE__*/_react.default.createElement(_stepSequenceItem.StyledStepSequenceItemHiddenLabel, null, hiddenCompleteLabel);
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
if (hiddenCurrentLabel && status === "current") {
|
|
54
|
-
return /*#__PURE__*/_react.default.createElement(_stepSequenceItem.
|
|
54
|
+
return /*#__PURE__*/_react.default.createElement(_stepSequenceItem.StyledStepSequenceItemHiddenLabel, null, hiddenCurrentLabel);
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
return null;
|
|
58
58
|
};
|
|
59
59
|
|
|
60
|
-
return /*#__PURE__*/_react.default.createElement(_stepSequenceItem.
|
|
60
|
+
return /*#__PURE__*/_react.default.createElement(_stepSequenceItem.StyledStepSequenceItem, _extends({
|
|
61
61
|
"data-component": "step-sequence-item",
|
|
62
62
|
orientation: orientation,
|
|
63
63
|
status: status,
|
|
64
64
|
key: `step-seq-item-${indicator}`,
|
|
65
65
|
"aria-label": ariaLabel
|
|
66
|
-
}, rest), hiddenLabel(), /*#__PURE__*/_react.default.createElement(_stepSequenceItem.
|
|
66
|
+
}, rest), hiddenLabel(), /*#__PURE__*/_react.default.createElement(_stepSequenceItem.StyledStepSequenceItemContent, null, icon(), /*#__PURE__*/_react.default.createElement("span", null, children)));
|
|
67
67
|
};
|
|
68
68
|
|
|
69
69
|
exports.StepSequenceItem = StepSequenceItem;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const StepSequenceItemHiddenLabelStyle: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
8
|
-
export declare const StepSequenceItemIndicatorStyle: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
9
|
-
export {};
|
|
1
|
+
import { StepSequenceProps } from "../step-sequence.component";
|
|
2
|
+
import { StepSequenceItemProps } from "./step-sequence-item.component";
|
|
3
|
+
export declare const StyledStepSequenceItem: import("styled-components").StyledComponent<"li", any, Pick<StepSequenceItemProps, "status"> & Pick<StepSequenceProps, "orientation">, never>;
|
|
4
|
+
export declare const StyledStepSequenceItemContent: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
5
|
+
export declare const StyledStepSequenceItemHiddenLabel: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
6
|
+
export declare const StyledStepSequenceItemIndicator: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.StyledStepSequenceItemIndicator = exports.StyledStepSequenceItemHiddenLabel = exports.StyledStepSequenceItemContent = exports.StyledStepSequenceItem = void 0;
|
|
7
7
|
|
|
8
8
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
9
9
|
|
|
@@ -15,7 +15,7 @@ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return
|
|
|
15
15
|
|
|
16
16
|
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; }
|
|
17
17
|
|
|
18
|
-
const
|
|
18
|
+
const StyledStepSequenceItem = _styledComponents.default.li`
|
|
19
19
|
display: flex;
|
|
20
20
|
align-items: center;
|
|
21
21
|
flex-grow: 1;
|
|
@@ -23,89 +23,93 @@ const StepSequenceItemStyle = _styledComponents.default.li`
|
|
|
23
23
|
list-style-type: none;
|
|
24
24
|
color: var(--colorsUtilityYin055);
|
|
25
25
|
|
|
26
|
-
&::before {
|
|
27
|
-
content: "";
|
|
28
|
-
flex-grow: 1;
|
|
29
|
-
display: block;
|
|
30
|
-
height: var(--sizing025);
|
|
31
|
-
margin: 0 16px;
|
|
32
|
-
background-color: var(--colorsUtilityYin055);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
& span {
|
|
36
|
-
display: flex;
|
|
37
|
-
align-items: center;
|
|
38
|
-
justify-content: center;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
${_icon.default} {
|
|
42
|
-
margin-right: 8px;
|
|
43
|
-
color: var(--colorsBaseTheme, var(--colorsSemanticPositive500));
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
&:first-child {
|
|
47
|
-
flex-grow: 0;
|
|
48
|
-
|
|
49
|
-
&::before {
|
|
50
|
-
display: none;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
26
|
${({
|
|
27
|
+
orientation,
|
|
55
28
|
status
|
|
56
|
-
}) =>
|
|
57
|
-
|
|
58
|
-
|
|
29
|
+
}) => {
|
|
30
|
+
const side = orientation === "vertical" ? "left" : "top";
|
|
31
|
+
return (0, _styledComponents.css)`
|
|
59
32
|
&::before {
|
|
60
|
-
|
|
33
|
+
content: "";
|
|
34
|
+
flex-grow: 1;
|
|
35
|
+
display: block;
|
|
36
|
+
margin: 0 16px;
|
|
37
|
+
border-${side}: var(--sizing025) dashed var(--colorsUtilityYin055);
|
|
61
38
|
}
|
|
62
|
-
`}
|
|
63
|
-
|
|
64
|
-
${({
|
|
65
|
-
status
|
|
66
|
-
}) => status === "complete" && (0, _styledComponents.css)`
|
|
67
|
-
color: var(--colorsBaseTheme, var(--colorsSemanticPositive500));
|
|
68
39
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
);
|
|
40
|
+
& span {
|
|
41
|
+
display: flex;
|
|
42
|
+
align-items: center;
|
|
43
|
+
justify-content: center;
|
|
74
44
|
}
|
|
75
|
-
`}
|
|
76
45
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
align-items: flex-start;
|
|
46
|
+
${_icon.default} {
|
|
47
|
+
margin-right: 8px;
|
|
48
|
+
color: var(--colorsBaseTheme, var(--colorsSemanticPositive500));
|
|
49
|
+
}
|
|
82
50
|
|
|
83
|
-
|
|
51
|
+
&:first-child {
|
|
84
52
|
flex-grow: 0;
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
53
|
+
|
|
54
|
+
&::before {
|
|
55
|
+
display: none;
|
|
56
|
+
}
|
|
88
57
|
}
|
|
89
|
-
|
|
58
|
+
|
|
59
|
+
${status === "current" && (0, _styledComponents.css)`
|
|
60
|
+
color: var(--colorsUtilityYin090);
|
|
61
|
+
|
|
62
|
+
&::before {
|
|
63
|
+
border-${side}-color: var(--colorsUtilityYin090);
|
|
64
|
+
border-${side}-style: solid;
|
|
65
|
+
}
|
|
66
|
+
`}
|
|
67
|
+
|
|
68
|
+
${status === "complete" && (0, _styledComponents.css)`
|
|
69
|
+
color: var(--colorsBaseTheme, var(--colorsSemanticPositive500));
|
|
70
|
+
|
|
71
|
+
&::before {
|
|
72
|
+
border-${side}-color: var(
|
|
73
|
+
--colorsBaseTheme,
|
|
74
|
+
var(--colorsSemanticPositive500)
|
|
75
|
+
);
|
|
76
|
+
border-${side}-style: solid;
|
|
77
|
+
}
|
|
78
|
+
`}
|
|
79
|
+
|
|
80
|
+
${orientation === "vertical" && (0, _styledComponents.css)`
|
|
81
|
+
flex-direction: column;
|
|
82
|
+
align-items: flex-start;
|
|
83
|
+
|
|
84
|
+
&::before {
|
|
85
|
+
flex-grow: 0;
|
|
86
|
+
border-left-width: var(--sizing025);
|
|
87
|
+
height: 100%;
|
|
88
|
+
min-height: var(--sizing300);
|
|
89
|
+
margin: 12px 8px;
|
|
90
|
+
}
|
|
91
|
+
`}
|
|
92
|
+
`;
|
|
93
|
+
}}
|
|
90
94
|
`;
|
|
91
|
-
exports.
|
|
92
|
-
const
|
|
95
|
+
exports.StyledStepSequenceItem = StyledStepSequenceItem;
|
|
96
|
+
const StyledStepSequenceItemContent = _styledComponents.default.span`
|
|
93
97
|
display: flex;
|
|
94
98
|
`;
|
|
95
|
-
exports.
|
|
96
|
-
const
|
|
99
|
+
exports.StyledStepSequenceItemContent = StyledStepSequenceItemContent;
|
|
100
|
+
const StyledStepSequenceItemHiddenLabel = _styledComponents.default.span`
|
|
97
101
|
position: absolute !important;
|
|
98
102
|
height: 1px;
|
|
99
103
|
width: 1px;
|
|
100
104
|
overflow: hidden;
|
|
101
105
|
clip: rect(1px, 1px, 1px, 1px);
|
|
102
106
|
`;
|
|
103
|
-
exports.
|
|
104
|
-
const
|
|
107
|
+
exports.StyledStepSequenceItemHiddenLabel = StyledStepSequenceItemHiddenLabel;
|
|
108
|
+
const StyledStepSequenceItemIndicator = _styledComponents.default.span`
|
|
105
109
|
display: block;
|
|
106
110
|
min-width: 16px;
|
|
107
111
|
height: 16px;
|
|
108
112
|
margin-right: 8px;
|
|
109
113
|
text-align: center;
|
|
110
114
|
`;
|
|
111
|
-
exports.
|
|
115
|
+
exports.StyledStepSequenceItemIndicator = StyledStepSequenceItemIndicator;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { SpaceProps } from "styled-system";
|
|
3
3
|
export declare const StepSequenceContext: React.Context<{
|
|
4
4
|
orientation: "horizontal" | "vertical";
|
|
5
5
|
}>;
|
|
6
|
-
export interface StepSequenceProps extends
|
|
6
|
+
export interface StepSequenceProps extends SpaceProps {
|
|
7
7
|
/** Step sequence items to be rendered */
|
|
8
8
|
children: React.ReactNode;
|
|
9
9
|
/** The direction that step sequence items should be rendered */
|
|
@@ -28,7 +28,8 @@ const StepSequence = ({
|
|
|
28
28
|
}) => {
|
|
29
29
|
return /*#__PURE__*/_react.default.createElement(_stepSequence.default, _extends({
|
|
30
30
|
"data-component": "step-sequence",
|
|
31
|
-
orientation: orientation
|
|
31
|
+
orientation: orientation,
|
|
32
|
+
p: 0
|
|
32
33
|
}, props), /*#__PURE__*/_react.default.createElement(StepSequenceContext.Provider, {
|
|
33
34
|
value: {
|
|
34
35
|
orientation
|
|
@@ -193,7 +194,161 @@ StepSequence.propTypes = {
|
|
|
193
194
|
"toString": _propTypes.default.func.isRequired,
|
|
194
195
|
"valueOf": _propTypes.default.func.isRequired
|
|
195
196
|
}), _propTypes.default.string]),
|
|
196
|
-
"orientation": _propTypes.default.oneOf(["horizontal", "vertical"])
|
|
197
|
+
"orientation": _propTypes.default.oneOf(["horizontal", "vertical"]),
|
|
198
|
+
"p": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
199
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
200
|
+
"description": _propTypes.default.string,
|
|
201
|
+
"toString": _propTypes.default.func.isRequired,
|
|
202
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
203
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
204
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
205
|
+
"description": _propTypes.default.string,
|
|
206
|
+
"toString": _propTypes.default.func.isRequired,
|
|
207
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
208
|
+
}), _propTypes.default.string]),
|
|
209
|
+
"padding": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
210
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
211
|
+
"description": _propTypes.default.string,
|
|
212
|
+
"toString": _propTypes.default.func.isRequired,
|
|
213
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
214
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
215
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
216
|
+
"description": _propTypes.default.string,
|
|
217
|
+
"toString": _propTypes.default.func.isRequired,
|
|
218
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
219
|
+
}), _propTypes.default.string]),
|
|
220
|
+
"paddingBottom": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
221
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
222
|
+
"description": _propTypes.default.string,
|
|
223
|
+
"toString": _propTypes.default.func.isRequired,
|
|
224
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
225
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
226
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
227
|
+
"description": _propTypes.default.string,
|
|
228
|
+
"toString": _propTypes.default.func.isRequired,
|
|
229
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
230
|
+
}), _propTypes.default.string]),
|
|
231
|
+
"paddingLeft": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
232
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
233
|
+
"description": _propTypes.default.string,
|
|
234
|
+
"toString": _propTypes.default.func.isRequired,
|
|
235
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
236
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
237
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
238
|
+
"description": _propTypes.default.string,
|
|
239
|
+
"toString": _propTypes.default.func.isRequired,
|
|
240
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
241
|
+
}), _propTypes.default.string]),
|
|
242
|
+
"paddingRight": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
243
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
244
|
+
"description": _propTypes.default.string,
|
|
245
|
+
"toString": _propTypes.default.func.isRequired,
|
|
246
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
247
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
248
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
249
|
+
"description": _propTypes.default.string,
|
|
250
|
+
"toString": _propTypes.default.func.isRequired,
|
|
251
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
252
|
+
}), _propTypes.default.string]),
|
|
253
|
+
"paddingTop": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
254
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
255
|
+
"description": _propTypes.default.string,
|
|
256
|
+
"toString": _propTypes.default.func.isRequired,
|
|
257
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
258
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
259
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
260
|
+
"description": _propTypes.default.string,
|
|
261
|
+
"toString": _propTypes.default.func.isRequired,
|
|
262
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
263
|
+
}), _propTypes.default.string]),
|
|
264
|
+
"paddingX": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
265
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
266
|
+
"description": _propTypes.default.string,
|
|
267
|
+
"toString": _propTypes.default.func.isRequired,
|
|
268
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
269
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
270
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
271
|
+
"description": _propTypes.default.string,
|
|
272
|
+
"toString": _propTypes.default.func.isRequired,
|
|
273
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
274
|
+
}), _propTypes.default.string]),
|
|
275
|
+
"paddingY": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
276
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
277
|
+
"description": _propTypes.default.string,
|
|
278
|
+
"toString": _propTypes.default.func.isRequired,
|
|
279
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
280
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
281
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
282
|
+
"description": _propTypes.default.string,
|
|
283
|
+
"toString": _propTypes.default.func.isRequired,
|
|
284
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
285
|
+
}), _propTypes.default.string]),
|
|
286
|
+
"pb": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
287
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
288
|
+
"description": _propTypes.default.string,
|
|
289
|
+
"toString": _propTypes.default.func.isRequired,
|
|
290
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
291
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
292
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
293
|
+
"description": _propTypes.default.string,
|
|
294
|
+
"toString": _propTypes.default.func.isRequired,
|
|
295
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
296
|
+
}), _propTypes.default.string]),
|
|
297
|
+
"pl": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
298
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
299
|
+
"description": _propTypes.default.string,
|
|
300
|
+
"toString": _propTypes.default.func.isRequired,
|
|
301
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
302
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
303
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
304
|
+
"description": _propTypes.default.string,
|
|
305
|
+
"toString": _propTypes.default.func.isRequired,
|
|
306
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
307
|
+
}), _propTypes.default.string]),
|
|
308
|
+
"pr": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
309
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
310
|
+
"description": _propTypes.default.string,
|
|
311
|
+
"toString": _propTypes.default.func.isRequired,
|
|
312
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
313
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
314
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
315
|
+
"description": _propTypes.default.string,
|
|
316
|
+
"toString": _propTypes.default.func.isRequired,
|
|
317
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
318
|
+
}), _propTypes.default.string]),
|
|
319
|
+
"pt": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
320
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
321
|
+
"description": _propTypes.default.string,
|
|
322
|
+
"toString": _propTypes.default.func.isRequired,
|
|
323
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
324
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
325
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
326
|
+
"description": _propTypes.default.string,
|
|
327
|
+
"toString": _propTypes.default.func.isRequired,
|
|
328
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
329
|
+
}), _propTypes.default.string]),
|
|
330
|
+
"px": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
331
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
332
|
+
"description": _propTypes.default.string,
|
|
333
|
+
"toString": _propTypes.default.func.isRequired,
|
|
334
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
335
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
336
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
337
|
+
"description": _propTypes.default.string,
|
|
338
|
+
"toString": _propTypes.default.func.isRequired,
|
|
339
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
340
|
+
}), _propTypes.default.string]),
|
|
341
|
+
"py": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
|
|
342
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
343
|
+
"description": _propTypes.default.string,
|
|
344
|
+
"toString": _propTypes.default.func.isRequired,
|
|
345
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
346
|
+
}), _propTypes.default.string])), _propTypes.default.number, _propTypes.default.object, _propTypes.default.shape({
|
|
347
|
+
"__@toStringTag": _propTypes.default.string.isRequired,
|
|
348
|
+
"description": _propTypes.default.string,
|
|
349
|
+
"toString": _propTypes.default.func.isRequired,
|
|
350
|
+
"valueOf": _propTypes.default.func.isRequired
|
|
351
|
+
}), _propTypes.default.string])
|
|
197
352
|
};
|
|
198
353
|
var _default = StepSequence;
|
|
199
354
|
exports.default = _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export default
|
|
1
|
+
import { SpaceProps } from "styled-system";
|
|
2
|
+
import { StepSequenceProps } from "./step-sequence.component";
|
|
3
|
+
declare const StyledStepSequence: import("styled-components").StyledComponent<"ol", any, Pick<StepSequenceProps, "orientation"> & SpaceProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol>, never>;
|
|
4
|
+
export default StyledStepSequence;
|
|
@@ -15,23 +15,22 @@ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return
|
|
|
15
15
|
|
|
16
16
|
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; }
|
|
17
17
|
|
|
18
|
-
const
|
|
18
|
+
const StyledStepSequence = _styledComponents.default.ol`
|
|
19
19
|
display: flex;
|
|
20
20
|
margin: 0;
|
|
21
|
-
padding: 18px;
|
|
22
21
|
font-weight: bold;
|
|
23
22
|
|
|
24
23
|
${({
|
|
25
24
|
orientation
|
|
26
25
|
}) => orientation === "vertical" && (0, _styledComponents.css)`
|
|
27
26
|
flex-direction: column;
|
|
28
|
-
|
|
27
|
+
height: 100%;
|
|
29
28
|
`}
|
|
30
29
|
|
|
31
|
-
${_styledSystem.
|
|
30
|
+
${_styledSystem.space}
|
|
32
31
|
`;
|
|
33
|
-
|
|
32
|
+
StyledStepSequence.defaultProps = {
|
|
34
33
|
theme: _themes.baseTheme
|
|
35
34
|
};
|
|
36
|
-
var _default =
|
|
35
|
+
var _default = StyledStepSequence;
|
|
37
36
|
exports.default = _default;
|
|
@@ -56,6 +56,7 @@ const Toast = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
56
56
|
const toastContentNodeRef = (0, _react.useRef)();
|
|
57
57
|
const closeIconRef = (0, _react.useRef)();
|
|
58
58
|
const focusedElementBeforeOpening = (0, _react.useRef)();
|
|
59
|
+
const [tabIndex, setTabIndex] = (0, _react.useState)(0);
|
|
59
60
|
const refToPass = ref || toastRef;
|
|
60
61
|
const componentClasses = (0, _react.useMemo)(() => {
|
|
61
62
|
return (0, _classnames.default)(className);
|
|
@@ -77,15 +78,16 @@ const Toast = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
77
78
|
timer.current = setTimeout(() => onDismiss(), timeout);
|
|
78
79
|
}, [onDismiss, open, timeout]);
|
|
79
80
|
(0, _react.useEffect)(() => {
|
|
80
|
-
if (
|
|
81
|
+
if (!disableAutoFocus) {
|
|
81
82
|
if (open) {
|
|
82
|
-
var
|
|
83
|
+
var _toastContentNodeRef$;
|
|
83
84
|
|
|
84
85
|
focusedElementBeforeOpening.current = document.activeElement;
|
|
85
|
-
(
|
|
86
|
+
(_toastContentNodeRef$ = toastContentNodeRef.current) === null || _toastContentNodeRef$ === void 0 ? void 0 : _toastContentNodeRef$.focus();
|
|
86
87
|
} else if (focusedElementBeforeOpening.current) {
|
|
87
88
|
focusedElementBeforeOpening.current.focus();
|
|
88
89
|
focusedElementBeforeOpening.current = undefined;
|
|
90
|
+
setTabIndex(0);
|
|
89
91
|
}
|
|
90
92
|
}
|
|
91
93
|
}, [open, onDismiss, disableAutoFocus]);
|
|
@@ -131,6 +133,9 @@ const Toast = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
131
133
|
className: componentClasses
|
|
132
134
|
}, (0, _tags.default)(restProps["data-component"] || "toast", restProps), toastProps, {
|
|
133
135
|
ref: toastContentNodeRef
|
|
136
|
+
}, !disableAutoFocus && {
|
|
137
|
+
tabIndex,
|
|
138
|
+
onBlur: () => setTabIndex(undefined)
|
|
134
139
|
}), !isNotice && /*#__PURE__*/_react.default.createElement(_toast.TypeIcon, {
|
|
135
140
|
variant: toastProps.variant
|
|
136
141
|
}, /*#__PURE__*/_react.default.createElement(_icon.default, {
|
|
@@ -78,8 +78,11 @@ const ToastStyle = (0, _styledComponents.default)(_message.default)`
|
|
|
78
78
|
margin-right: ${isCenter ? "auto" : "30px"};
|
|
79
79
|
`}
|
|
80
80
|
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
:focus {
|
|
82
|
+
outline: none;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&${animationName}-appear, &${animationName}-enter {
|
|
83
86
|
opacity: 0;
|
|
84
87
|
transform: scale(0.5);
|
|
85
88
|
}
|