carbon-react 144.13.0 → 144.14.0
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/index.d.ts +4 -0
- package/esm/components/step-sequence/index.js +2 -0
- package/esm/components/step-sequence/step-sequence-item/index.d.ts +2 -0
- package/esm/components/step-sequence/step-sequence-item/index.js +1 -0
- package/esm/components/step-sequence/step-sequence-item/step-sequence-item.component.d.ts +19 -0
- package/esm/components/step-sequence/step-sequence-item/step-sequence-item.component.js +43 -0
- package/esm/components/step-sequence/step-sequence-item/step-sequence-item.style.d.ts +6 -0
- package/esm/components/step-sequence/step-sequence-item/step-sequence-item.style.js +96 -0
- package/esm/components/step-sequence/step-sequence.component.d.ts +13 -0
- package/esm/components/step-sequence/step-sequence.component.js +23 -0
- package/esm/components/step-sequence/step-sequence.style.d.ts +4 -0
- package/esm/components/step-sequence/step-sequence.style.js +21 -0
- package/lib/components/step-sequence/index.d.ts +4 -0
- package/lib/components/step-sequence/index.js +20 -0
- package/lib/components/step-sequence/package.json +6 -0
- package/lib/components/step-sequence/step-sequence-item/index.d.ts +2 -0
- package/lib/components/step-sequence/step-sequence-item/index.js +13 -0
- package/lib/components/step-sequence/step-sequence-item/package.json +6 -0
- package/lib/components/step-sequence/step-sequence-item/step-sequence-item.component.d.ts +19 -0
- package/lib/components/step-sequence/step-sequence-item/step-sequence-item.component.js +53 -0
- package/lib/components/step-sequence/step-sequence-item/step-sequence-item.style.d.ts +6 -0
- package/lib/components/step-sequence/step-sequence-item/step-sequence-item.style.js +105 -0
- package/lib/components/step-sequence/step-sequence.component.d.ts +13 -0
- package/lib/components/step-sequence/step-sequence.component.js +31 -0
- package/lib/components/step-sequence/step-sequence.style.d.ts +4 -0
- package/lib/components/step-sequence/step-sequence.style.js +29 -0
- package/package.json +1 -1
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { default as StepSequence } from "./step-sequence.component";
|
|
2
|
+
export type { StepSequenceProps } from "./step-sequence.component";
|
|
3
|
+
export { default as StepSequenceItem } from "./step-sequence-item";
|
|
4
|
+
export type { StepSequenceItemProps } from "./step-sequence-item";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./step-sequence-item.component";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface StepSequenceItemProps {
|
|
3
|
+
/** Aria label */
|
|
4
|
+
ariaLabel?: string;
|
|
5
|
+
/** Hidden label to be displayed if item is complete */
|
|
6
|
+
hiddenCompleteLabel?: string;
|
|
7
|
+
/** Hidden label to be displayed if item is current */
|
|
8
|
+
hiddenCurrentLabel?: string;
|
|
9
|
+
/** Value to be displayed before text for incomplete steps */
|
|
10
|
+
indicator: string;
|
|
11
|
+
/** Flag to hide the indicator for incomplete steps */
|
|
12
|
+
hideIndicator?: boolean;
|
|
13
|
+
/** Status for the step */
|
|
14
|
+
status?: "complete" | "current" | "incomplete";
|
|
15
|
+
/** Content to be displayed */
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
}
|
|
18
|
+
export declare const StepSequenceItem: ({ hideIndicator, indicator, status, hiddenCompleteLabel, hiddenCurrentLabel, children, ariaLabel, ...rest }: StepSequenceItemProps) => React.JSX.Element;
|
|
19
|
+
export default StepSequenceItem;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
+
import React, { useContext } from "react";
|
|
3
|
+
import PropTypes from "prop-types";
|
|
4
|
+
import { StyledStepSequenceItem, StyledStepSequenceItemContent, StyledStepSequenceItemIndicator, StyledStepSequenceItemHiddenLabel } from "./step-sequence-item.style";
|
|
5
|
+
import Icon from "../../icon";
|
|
6
|
+
import { StepSequenceContext } from "../step-sequence.component";
|
|
7
|
+
export const StepSequenceItem = ({
|
|
8
|
+
hideIndicator = false,
|
|
9
|
+
indicator,
|
|
10
|
+
status = "incomplete",
|
|
11
|
+
hiddenCompleteLabel,
|
|
12
|
+
hiddenCurrentLabel,
|
|
13
|
+
children,
|
|
14
|
+
ariaLabel,
|
|
15
|
+
...rest
|
|
16
|
+
}) => {
|
|
17
|
+
const {
|
|
18
|
+
orientation
|
|
19
|
+
} = useContext(StepSequenceContext);
|
|
20
|
+
const indicatorText = () => {
|
|
21
|
+
return !hideIndicator ? /*#__PURE__*/React.createElement(StyledStepSequenceItemIndicator, null, indicator) : null;
|
|
22
|
+
};
|
|
23
|
+
const icon = () => status === "complete" ? /*#__PURE__*/React.createElement(Icon, {
|
|
24
|
+
type: "tick"
|
|
25
|
+
}) : indicatorText();
|
|
26
|
+
const hiddenLabel = () => {
|
|
27
|
+
if (hiddenCompleteLabel && status === "complete") {
|
|
28
|
+
return /*#__PURE__*/React.createElement(StyledStepSequenceItemHiddenLabel, null, hiddenCompleteLabel);
|
|
29
|
+
}
|
|
30
|
+
if (hiddenCurrentLabel && status === "current") {
|
|
31
|
+
return /*#__PURE__*/React.createElement(StyledStepSequenceItemHiddenLabel, null, hiddenCurrentLabel);
|
|
32
|
+
}
|
|
33
|
+
return null;
|
|
34
|
+
};
|
|
35
|
+
return /*#__PURE__*/React.createElement(StyledStepSequenceItem, _extends({
|
|
36
|
+
"data-component": "step-sequence-item",
|
|
37
|
+
orientation: orientation,
|
|
38
|
+
status: status,
|
|
39
|
+
key: `step-seq-item-${indicator}`,
|
|
40
|
+
"aria-label": ariaLabel
|
|
41
|
+
}, rest), hiddenLabel(), /*#__PURE__*/React.createElement(StyledStepSequenceItemContent, null, icon(), /*#__PURE__*/React.createElement("span", null, children)));
|
|
42
|
+
};
|
|
43
|
+
export default StepSequenceItem;
|
|
@@ -0,0 +1,6 @@
|
|
|
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>;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import styled, { css } from "styled-components";
|
|
2
|
+
import StyledIcon from "../../icon/icon.style";
|
|
3
|
+
export const StyledStepSequenceItem = styled.li`
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
flex-grow: 1;
|
|
7
|
+
text-align: right;
|
|
8
|
+
list-style-type: none;
|
|
9
|
+
color: var(--colorsUtilityYin055);
|
|
10
|
+
|
|
11
|
+
${({
|
|
12
|
+
orientation,
|
|
13
|
+
status
|
|
14
|
+
}) => {
|
|
15
|
+
const side = orientation === "vertical" ? "left" : "top";
|
|
16
|
+
return css`
|
|
17
|
+
&::before {
|
|
18
|
+
content: "";
|
|
19
|
+
flex-grow: 1;
|
|
20
|
+
display: block;
|
|
21
|
+
margin: 0 16px;
|
|
22
|
+
border-${side}: var(--sizing025) dashed var(--colorsUtilityYin055);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
& span {
|
|
26
|
+
display: flex;
|
|
27
|
+
align-items: center;
|
|
28
|
+
justify-content: center;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
${StyledIcon} {
|
|
32
|
+
margin-right: 8px;
|
|
33
|
+
color: var(--colorsBaseTheme, var(--colorsSemanticPositive500));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&:first-child {
|
|
37
|
+
flex-grow: 0;
|
|
38
|
+
|
|
39
|
+
&::before {
|
|
40
|
+
display: none;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
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
|
+
}}
|
|
79
|
+
`;
|
|
80
|
+
export const StyledStepSequenceItemContent = styled.span`
|
|
81
|
+
display: flex;
|
|
82
|
+
`;
|
|
83
|
+
export const StyledStepSequenceItemHiddenLabel = styled.span`
|
|
84
|
+
position: absolute !important;
|
|
85
|
+
height: 1px;
|
|
86
|
+
width: 1px;
|
|
87
|
+
overflow: hidden;
|
|
88
|
+
clip: rect(1px, 1px, 1px, 1px);
|
|
89
|
+
`;
|
|
90
|
+
export const StyledStepSequenceItemIndicator = styled.span`
|
|
91
|
+
display: block;
|
|
92
|
+
min-width: 16px;
|
|
93
|
+
height: 16px;
|
|
94
|
+
margin-right: 8px;
|
|
95
|
+
text-align: center;
|
|
96
|
+
`;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { SpaceProps } from "styled-system";
|
|
3
|
+
export declare const StepSequenceContext: React.Context<{
|
|
4
|
+
orientation: "horizontal" | "vertical";
|
|
5
|
+
}>;
|
|
6
|
+
export interface StepSequenceProps extends SpaceProps {
|
|
7
|
+
/** Step sequence items to be rendered */
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
/** The direction that step sequence items should be rendered */
|
|
10
|
+
orientation?: "horizontal" | "vertical";
|
|
11
|
+
}
|
|
12
|
+
export declare const StepSequence: ({ children, orientation, ...props }: StepSequenceProps) => React.JSX.Element;
|
|
13
|
+
export default StepSequence;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
+
import React from "react";
|
|
3
|
+
import PropTypes from "prop-types";
|
|
4
|
+
import StyledStepSequence from "./step-sequence.style";
|
|
5
|
+
export const StepSequenceContext = /*#__PURE__*/React.createContext({
|
|
6
|
+
orientation: "horizontal"
|
|
7
|
+
});
|
|
8
|
+
export const StepSequence = ({
|
|
9
|
+
children,
|
|
10
|
+
orientation = "horizontal",
|
|
11
|
+
...props
|
|
12
|
+
}) => {
|
|
13
|
+
return /*#__PURE__*/React.createElement(StyledStepSequence, _extends({
|
|
14
|
+
"data-component": "step-sequence",
|
|
15
|
+
orientation: orientation,
|
|
16
|
+
p: 0
|
|
17
|
+
}, props), /*#__PURE__*/React.createElement(StepSequenceContext.Provider, {
|
|
18
|
+
value: {
|
|
19
|
+
orientation
|
|
20
|
+
}
|
|
21
|
+
}, children));
|
|
22
|
+
};
|
|
23
|
+
export default StepSequence;
|
|
@@ -0,0 +1,4 @@
|
|
|
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;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import styled, { css } from "styled-components";
|
|
2
|
+
import { space } from "styled-system";
|
|
3
|
+
import { baseTheme } from "../../style/themes";
|
|
4
|
+
const StyledStepSequence = styled.ol`
|
|
5
|
+
display: flex;
|
|
6
|
+
margin: 0;
|
|
7
|
+
font-weight: var(--fontWeights500);
|
|
8
|
+
|
|
9
|
+
${({
|
|
10
|
+
orientation
|
|
11
|
+
}) => orientation === "vertical" && css`
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
height: 100%;
|
|
14
|
+
`}
|
|
15
|
+
|
|
16
|
+
${space}
|
|
17
|
+
`;
|
|
18
|
+
StyledStepSequence.defaultProps = {
|
|
19
|
+
theme: baseTheme
|
|
20
|
+
};
|
|
21
|
+
export default StyledStepSequence;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { default as StepSequence } from "./step-sequence.component";
|
|
2
|
+
export type { StepSequenceProps } from "./step-sequence.component";
|
|
3
|
+
export { default as StepSequenceItem } from "./step-sequence-item";
|
|
4
|
+
export type { StepSequenceItemProps } from "./step-sequence-item";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "StepSequence", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _stepSequence.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "StepSequenceItem", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _stepSequenceItem.default;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
var _stepSequence = _interopRequireDefault(require("./step-sequence.component"));
|
|
19
|
+
var _stepSequenceItem = _interopRequireDefault(require("./step-sequence-item"));
|
|
20
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "default", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _stepSequenceItem.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _stepSequenceItem = _interopRequireDefault(require("./step-sequence-item.component"));
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface StepSequenceItemProps {
|
|
3
|
+
/** Aria label */
|
|
4
|
+
ariaLabel?: string;
|
|
5
|
+
/** Hidden label to be displayed if item is complete */
|
|
6
|
+
hiddenCompleteLabel?: string;
|
|
7
|
+
/** Hidden label to be displayed if item is current */
|
|
8
|
+
hiddenCurrentLabel?: string;
|
|
9
|
+
/** Value to be displayed before text for incomplete steps */
|
|
10
|
+
indicator: string;
|
|
11
|
+
/** Flag to hide the indicator for incomplete steps */
|
|
12
|
+
hideIndicator?: boolean;
|
|
13
|
+
/** Status for the step */
|
|
14
|
+
status?: "complete" | "current" | "incomplete";
|
|
15
|
+
/** Content to be displayed */
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
}
|
|
18
|
+
export declare const StepSequenceItem: ({ hideIndicator, indicator, status, hiddenCompleteLabel, hiddenCurrentLabel, children, ariaLabel, ...rest }: StepSequenceItemProps) => React.JSX.Element;
|
|
19
|
+
export default StepSequenceItem;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.StepSequenceItem = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
var _stepSequenceItem = require("./step-sequence-item.style");
|
|
10
|
+
var _icon = _interopRequireDefault(require("../../icon"));
|
|
11
|
+
var _stepSequence = require("../step-sequence.component");
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
14
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
15
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
16
|
+
const StepSequenceItem = ({
|
|
17
|
+
hideIndicator = false,
|
|
18
|
+
indicator,
|
|
19
|
+
status = "incomplete",
|
|
20
|
+
hiddenCompleteLabel,
|
|
21
|
+
hiddenCurrentLabel,
|
|
22
|
+
children,
|
|
23
|
+
ariaLabel,
|
|
24
|
+
...rest
|
|
25
|
+
}) => {
|
|
26
|
+
const {
|
|
27
|
+
orientation
|
|
28
|
+
} = (0, _react.useContext)(_stepSequence.StepSequenceContext);
|
|
29
|
+
const indicatorText = () => {
|
|
30
|
+
return !hideIndicator ? /*#__PURE__*/_react.default.createElement(_stepSequenceItem.StyledStepSequenceItemIndicator, null, indicator) : null;
|
|
31
|
+
};
|
|
32
|
+
const icon = () => status === "complete" ? /*#__PURE__*/_react.default.createElement(_icon.default, {
|
|
33
|
+
type: "tick"
|
|
34
|
+
}) : indicatorText();
|
|
35
|
+
const hiddenLabel = () => {
|
|
36
|
+
if (hiddenCompleteLabel && status === "complete") {
|
|
37
|
+
return /*#__PURE__*/_react.default.createElement(_stepSequenceItem.StyledStepSequenceItemHiddenLabel, null, hiddenCompleteLabel);
|
|
38
|
+
}
|
|
39
|
+
if (hiddenCurrentLabel && status === "current") {
|
|
40
|
+
return /*#__PURE__*/_react.default.createElement(_stepSequenceItem.StyledStepSequenceItemHiddenLabel, null, hiddenCurrentLabel);
|
|
41
|
+
}
|
|
42
|
+
return null;
|
|
43
|
+
};
|
|
44
|
+
return /*#__PURE__*/_react.default.createElement(_stepSequenceItem.StyledStepSequenceItem, _extends({
|
|
45
|
+
"data-component": "step-sequence-item",
|
|
46
|
+
orientation: orientation,
|
|
47
|
+
status: status,
|
|
48
|
+
key: `step-seq-item-${indicator}`,
|
|
49
|
+
"aria-label": ariaLabel
|
|
50
|
+
}, rest), hiddenLabel(), /*#__PURE__*/_react.default.createElement(_stepSequenceItem.StyledStepSequenceItemContent, null, icon(), /*#__PURE__*/_react.default.createElement("span", null, children)));
|
|
51
|
+
};
|
|
52
|
+
exports.StepSequenceItem = StepSequenceItem;
|
|
53
|
+
var _default = exports.default = StepSequenceItem;
|
|
@@ -0,0 +1,6 @@
|
|
|
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>;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.StyledStepSequenceItemIndicator = exports.StyledStepSequenceItemHiddenLabel = exports.StyledStepSequenceItemContent = exports.StyledStepSequenceItem = void 0;
|
|
7
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
8
|
+
var _icon = _interopRequireDefault(require("../../icon/icon.style"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
11
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
12
|
+
const StyledStepSequenceItem = exports.StyledStepSequenceItem = _styledComponents.default.li`
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
flex-grow: 1;
|
|
16
|
+
text-align: right;
|
|
17
|
+
list-style-type: none;
|
|
18
|
+
color: var(--colorsUtilityYin055);
|
|
19
|
+
|
|
20
|
+
${({
|
|
21
|
+
orientation,
|
|
22
|
+
status
|
|
23
|
+
}) => {
|
|
24
|
+
const side = orientation === "vertical" ? "left" : "top";
|
|
25
|
+
return (0, _styledComponents.css)`
|
|
26
|
+
&::before {
|
|
27
|
+
content: "";
|
|
28
|
+
flex-grow: 1;
|
|
29
|
+
display: block;
|
|
30
|
+
margin: 0 16px;
|
|
31
|
+
border-${side}: var(--sizing025) dashed var(--colorsUtilityYin055);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
& span {
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
justify-content: center;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
${_icon.default} {
|
|
41
|
+
margin-right: 8px;
|
|
42
|
+
color: var(--colorsBaseTheme, var(--colorsSemanticPositive500));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&:first-child {
|
|
46
|
+
flex-grow: 0;
|
|
47
|
+
|
|
48
|
+
&::before {
|
|
49
|
+
display: none;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
${status === "current" && (0, _styledComponents.css)`
|
|
54
|
+
color: var(--colorsUtilityYin090);
|
|
55
|
+
|
|
56
|
+
&::before {
|
|
57
|
+
border-${side}-color: var(--colorsUtilityYin090);
|
|
58
|
+
border-${side}-style: solid;
|
|
59
|
+
}
|
|
60
|
+
`}
|
|
61
|
+
|
|
62
|
+
${status === "complete" && (0, _styledComponents.css)`
|
|
63
|
+
color: var(--colorsBaseTheme, var(--colorsSemanticPositive500));
|
|
64
|
+
|
|
65
|
+
&::before {
|
|
66
|
+
border-${side}-color: var(
|
|
67
|
+
--colorsBaseTheme,
|
|
68
|
+
var(--colorsSemanticPositive500)
|
|
69
|
+
);
|
|
70
|
+
border-${side}-style: solid;
|
|
71
|
+
}
|
|
72
|
+
`}
|
|
73
|
+
|
|
74
|
+
${orientation === "vertical" && (0, _styledComponents.css)`
|
|
75
|
+
flex-direction: column;
|
|
76
|
+
align-items: flex-start;
|
|
77
|
+
|
|
78
|
+
&::before {
|
|
79
|
+
flex-grow: 0;
|
|
80
|
+
border-left-width: var(--sizing025);
|
|
81
|
+
height: 100%;
|
|
82
|
+
min-height: var(--sizing300);
|
|
83
|
+
margin: 12px 8px;
|
|
84
|
+
}
|
|
85
|
+
`}
|
|
86
|
+
`;
|
|
87
|
+
}}
|
|
88
|
+
`;
|
|
89
|
+
const StyledStepSequenceItemContent = exports.StyledStepSequenceItemContent = _styledComponents.default.span`
|
|
90
|
+
display: flex;
|
|
91
|
+
`;
|
|
92
|
+
const StyledStepSequenceItemHiddenLabel = exports.StyledStepSequenceItemHiddenLabel = _styledComponents.default.span`
|
|
93
|
+
position: absolute !important;
|
|
94
|
+
height: 1px;
|
|
95
|
+
width: 1px;
|
|
96
|
+
overflow: hidden;
|
|
97
|
+
clip: rect(1px, 1px, 1px, 1px);
|
|
98
|
+
`;
|
|
99
|
+
const StyledStepSequenceItemIndicator = exports.StyledStepSequenceItemIndicator = _styledComponents.default.span`
|
|
100
|
+
display: block;
|
|
101
|
+
min-width: 16px;
|
|
102
|
+
height: 16px;
|
|
103
|
+
margin-right: 8px;
|
|
104
|
+
text-align: center;
|
|
105
|
+
`;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { SpaceProps } from "styled-system";
|
|
3
|
+
export declare const StepSequenceContext: React.Context<{
|
|
4
|
+
orientation: "horizontal" | "vertical";
|
|
5
|
+
}>;
|
|
6
|
+
export interface StepSequenceProps extends SpaceProps {
|
|
7
|
+
/** Step sequence items to be rendered */
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
/** The direction that step sequence items should be rendered */
|
|
10
|
+
orientation?: "horizontal" | "vertical";
|
|
11
|
+
}
|
|
12
|
+
export declare const StepSequence: ({ children, orientation, ...props }: StepSequenceProps) => React.JSX.Element;
|
|
13
|
+
export default StepSequence;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.StepSequenceContext = exports.StepSequence = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
var _stepSequence = _interopRequireDefault(require("./step-sequence.style"));
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
12
|
+
const StepSequenceContext = exports.StepSequenceContext = /*#__PURE__*/_react.default.createContext({
|
|
13
|
+
orientation: "horizontal"
|
|
14
|
+
});
|
|
15
|
+
const StepSequence = ({
|
|
16
|
+
children,
|
|
17
|
+
orientation = "horizontal",
|
|
18
|
+
...props
|
|
19
|
+
}) => {
|
|
20
|
+
return /*#__PURE__*/_react.default.createElement(_stepSequence.default, _extends({
|
|
21
|
+
"data-component": "step-sequence",
|
|
22
|
+
orientation: orientation,
|
|
23
|
+
p: 0
|
|
24
|
+
}, props), /*#__PURE__*/_react.default.createElement(StepSequenceContext.Provider, {
|
|
25
|
+
value: {
|
|
26
|
+
orientation
|
|
27
|
+
}
|
|
28
|
+
}, children));
|
|
29
|
+
};
|
|
30
|
+
exports.StepSequence = StepSequence;
|
|
31
|
+
var _default = exports.default = StepSequence;
|
|
@@ -0,0 +1,4 @@
|
|
|
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;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
8
|
+
var _styledSystem = require("styled-system");
|
|
9
|
+
var _themes = require("../../style/themes");
|
|
10
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
11
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
12
|
+
const StyledStepSequence = _styledComponents.default.ol`
|
|
13
|
+
display: flex;
|
|
14
|
+
margin: 0;
|
|
15
|
+
font-weight: var(--fontWeights500);
|
|
16
|
+
|
|
17
|
+
${({
|
|
18
|
+
orientation
|
|
19
|
+
}) => orientation === "vertical" && (0, _styledComponents.css)`
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
height: 100%;
|
|
22
|
+
`}
|
|
23
|
+
|
|
24
|
+
${_styledSystem.space}
|
|
25
|
+
`;
|
|
26
|
+
StyledStepSequence.defaultProps = {
|
|
27
|
+
theme: _themes.baseTheme
|
|
28
|
+
};
|
|
29
|
+
var _default = exports.default = StyledStepSequence;
|