carbon-react 134.2.0 → 135.1.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/badge/badge.component.js +3 -2
- package/esm/components/multi-action-button/multi-action-button.component.d.ts +1 -1
- package/esm/components/multi-action-button/multi-action-button.component.js +2 -1
- package/esm/components/multi-action-button/multi-action-button.config.d.ts +1 -0
- package/esm/components/multi-action-button/multi-action-button.config.js +2 -1
- package/esm/components/portal/portal.js +1 -0
- package/esm/components/split-button/split-button.component.d.ts +5 -3
- package/esm/components/split-button/split-button.component.js +2 -1
- package/esm/components/split-button/split-button.config.d.ts +1 -0
- package/esm/components/split-button/split-button.config.js +2 -1
- package/esm/components/toast/toast.component.d.ts +0 -2
- package/esm/components/toast/toast.component.js +7 -15
- package/esm/components/toast/toast.style.d.ts +0 -3
- package/esm/components/toast/toast.style.js +4 -21
- package/lib/components/badge/badge.component.js +3 -2
- package/lib/components/multi-action-button/multi-action-button.component.d.ts +1 -1
- package/lib/components/multi-action-button/multi-action-button.component.js +2 -1
- package/lib/components/multi-action-button/multi-action-button.config.d.ts +1 -0
- package/lib/components/multi-action-button/multi-action-button.config.js +3 -2
- package/lib/components/portal/portal.js +1 -0
- package/lib/components/split-button/split-button.component.d.ts +5 -3
- package/lib/components/split-button/split-button.component.js +2 -1
- package/lib/components/split-button/split-button.config.d.ts +1 -0
- package/lib/components/split-button/split-button.config.js +3 -2
- package/lib/components/toast/toast.component.d.ts +0 -2
- package/lib/components/toast/toast.component.js +7 -15
- package/lib/components/toast/toast.style.d.ts +0 -3
- package/lib/components/toast/toast.style.js +4 -21
- package/package.json +1 -1
- package/esm/components/carousel/carousel.component.d.ts +0 -25
- package/esm/components/carousel/carousel.component.js +0 -125
- package/esm/components/carousel/carousel.style.d.ts +0 -20
- package/esm/components/carousel/carousel.style.js +0 -154
- package/esm/components/carousel/index.d.ts +0 -4
- package/esm/components/carousel/index.js +0 -2
- package/esm/components/carousel/slide/index.d.ts +0 -2
- package/esm/components/carousel/slide/index.js +0 -1
- package/esm/components/carousel/slide/slide.component.d.ts +0 -12
- package/esm/components/carousel/slide/slide.component.js +0 -9
- package/esm/components/carousel/slide/slide.style.d.ts +0 -2
- package/esm/components/carousel/slide/slide.style.js +0 -32
- package/esm/components/carousel/slide.config.d.ts +0 -3
- package/esm/components/carousel/slide.config.js +0 -80
- package/esm/components/step-sequence/index.d.ts +0 -4
- package/esm/components/step-sequence/index.js +0 -2
- package/esm/components/step-sequence/step-sequence-item/index.d.ts +0 -2
- package/esm/components/step-sequence/step-sequence-item/index.js +0 -1
- package/esm/components/step-sequence/step-sequence-item/step-sequence-item.component.d.ts +0 -19
- package/esm/components/step-sequence/step-sequence-item/step-sequence-item.component.js +0 -43
- package/esm/components/step-sequence/step-sequence-item/step-sequence-item.style.d.ts +0 -6
- package/esm/components/step-sequence/step-sequence-item/step-sequence-item.style.js +0 -96
- package/esm/components/step-sequence/step-sequence.component.d.ts +0 -13
- package/esm/components/step-sequence/step-sequence.component.js +0 -29
- package/esm/components/step-sequence/step-sequence.config.d.ts +0 -2
- package/esm/components/step-sequence/step-sequence.config.js +0 -2
- package/esm/components/step-sequence/step-sequence.style.d.ts +0 -4
- package/esm/components/step-sequence/step-sequence.style.js +0 -21
- package/lib/components/carousel/carousel.component.d.ts +0 -25
- package/lib/components/carousel/carousel.component.js +0 -135
- package/lib/components/carousel/carousel.style.d.ts +0 -20
- package/lib/components/carousel/carousel.style.js +0 -162
- package/lib/components/carousel/index.d.ts +0 -4
- package/lib/components/carousel/index.js +0 -20
- package/lib/components/carousel/package.json +0 -6
- package/lib/components/carousel/slide/index.d.ts +0 -2
- package/lib/components/carousel/slide/index.js +0 -13
- package/lib/components/carousel/slide/package.json +0 -6
- package/lib/components/carousel/slide/slide.component.d.ts +0 -12
- package/lib/components/carousel/slide/slide.component.js +0 -16
- package/lib/components/carousel/slide/slide.style.d.ts +0 -2
- package/lib/components/carousel/slide/slide.style.js +0 -39
- package/lib/components/carousel/slide.config.d.ts +0 -3
- package/lib/components/carousel/slide.config.js +0 -85
- package/lib/components/step-sequence/index.d.ts +0 -4
- package/lib/components/step-sequence/index.js +0 -20
- package/lib/components/step-sequence/package.json +0 -6
- package/lib/components/step-sequence/step-sequence-item/index.d.ts +0 -2
- package/lib/components/step-sequence/step-sequence-item/index.js +0 -13
- package/lib/components/step-sequence/step-sequence-item/package.json +0 -6
- package/lib/components/step-sequence/step-sequence-item/step-sequence-item.component.d.ts +0 -19
- package/lib/components/step-sequence/step-sequence-item/step-sequence-item.component.js +0 -53
- package/lib/components/step-sequence/step-sequence-item/step-sequence-item.style.d.ts +0 -6
- package/lib/components/step-sequence/step-sequence-item/step-sequence-item.style.js +0 -105
- package/lib/components/step-sequence/step-sequence.component.d.ts +0 -13
- package/lib/components/step-sequence/step-sequence.component.js +0 -37
- package/lib/components/step-sequence/step-sequence.config.d.ts +0 -2
- package/lib/components/step-sequence/step-sequence.config.js +0 -8
- package/lib/components/step-sequence/step-sequence.style.d.ts +0 -4
- package/lib/components/step-sequence/step-sequence.style.js +0 -29
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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
|
-
import React from "react";
|
|
3
|
-
import PropTypes from "prop-types";
|
|
4
|
-
import Logger from "../../__internal__/utils/logger";
|
|
5
|
-
import StyledStepSequence from "./step-sequence.style";
|
|
6
|
-
export const StepSequenceContext = /*#__PURE__*/React.createContext({
|
|
7
|
-
orientation: "horizontal"
|
|
8
|
-
});
|
|
9
|
-
let deprecateWarnTriggered = false;
|
|
10
|
-
export const StepSequence = ({
|
|
11
|
-
children,
|
|
12
|
-
orientation = "horizontal",
|
|
13
|
-
...props
|
|
14
|
-
}) => {
|
|
15
|
-
if (!deprecateWarnTriggered) {
|
|
16
|
-
deprecateWarnTriggered = true;
|
|
17
|
-
Logger.deprecate("The `StepSequence` component is deprecated and will soon be removed," + " please use the `StepFlow` component instead.");
|
|
18
|
-
}
|
|
19
|
-
return /*#__PURE__*/React.createElement(StyledStepSequence, _extends({
|
|
20
|
-
"data-component": "step-sequence",
|
|
21
|
-
orientation: orientation,
|
|
22
|
-
p: 0
|
|
23
|
-
}, props), /*#__PURE__*/React.createElement(StepSequenceContext.Provider, {
|
|
24
|
-
value: {
|
|
25
|
-
orientation
|
|
26
|
-
}
|
|
27
|
-
}, children));
|
|
28
|
-
};
|
|
29
|
-
export default StepSequence;
|
|
@@ -1,4 +0,0 @@
|
|
|
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,21 +0,0 @@
|
|
|
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: bold;
|
|
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;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { TagProps } from "../../__internal__/utils/helpers/tags/tags";
|
|
3
|
-
export interface CarouselProps extends TagProps {
|
|
4
|
-
/** Individual tabs */
|
|
5
|
-
children?: React.ReactNode;
|
|
6
|
-
/** [legacy] Custom className */
|
|
7
|
-
className?: string;
|
|
8
|
-
/** Enables the next button */
|
|
9
|
-
enableNextButton?: boolean;
|
|
10
|
-
/** Enables the previous button */
|
|
11
|
-
enablePreviousButton?: boolean;
|
|
12
|
-
/** Enables the slide selector */
|
|
13
|
-
enableSlideSelector?: boolean;
|
|
14
|
-
/** The selected tab on page load */
|
|
15
|
-
initialSlideIndex?: number | string;
|
|
16
|
-
/** Action to be called on slide change */
|
|
17
|
-
onSlideChange?: (index: number, transitionDirection: string) => void;
|
|
18
|
-
/** The selected slide */
|
|
19
|
-
slideIndex?: number | string;
|
|
20
|
-
}
|
|
21
|
-
export declare const Carousel: {
|
|
22
|
-
({ children, className, enableSlideSelector, enablePreviousButton, enableNextButton, initialSlideIndex, onSlideChange, slideIndex, ...props }: CarouselProps): React.JSX.Element;
|
|
23
|
-
displayName: string;
|
|
24
|
-
};
|
|
25
|
-
export default Carousel;
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = exports.Carousel = void 0;
|
|
7
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var _logger = _interopRequireDefault(require("../../__internal__/utils/logger"));
|
|
10
|
-
var _tags = _interopRequireDefault(require("../../__internal__/utils/helpers/tags/tags"));
|
|
11
|
-
var _carousel = require("./carousel.style");
|
|
12
|
-
var _guid = _interopRequireDefault(require("../../__internal__/utils/helpers/guid"));
|
|
13
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
-
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); }
|
|
15
|
-
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; }
|
|
16
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
17
|
-
let deprecateWarnTriggered = false;
|
|
18
|
-
const NEXT = "next";
|
|
19
|
-
const PREVIOUS = "previous";
|
|
20
|
-
const Carousel = ({
|
|
21
|
-
children,
|
|
22
|
-
className,
|
|
23
|
-
enableSlideSelector = true,
|
|
24
|
-
enablePreviousButton = true,
|
|
25
|
-
enableNextButton = true,
|
|
26
|
-
initialSlideIndex = 0,
|
|
27
|
-
onSlideChange,
|
|
28
|
-
slideIndex,
|
|
29
|
-
...props
|
|
30
|
-
}) => {
|
|
31
|
-
if (!deprecateWarnTriggered) {
|
|
32
|
-
deprecateWarnTriggered = true;
|
|
33
|
-
_logger.default.deprecate("The Carousel component is deprecated and will soon be removed.");
|
|
34
|
-
}
|
|
35
|
-
const [selectedSlideIndex, setSelectedSlideIndex] = (0, _react.useState)(Number(slideIndex) || Number(initialSlideIndex));
|
|
36
|
-
const transitionDirection = (0, _react.useRef)(NEXT);
|
|
37
|
-
const lastSlideIndexProp = (0, _react.useRef)(slideIndex);
|
|
38
|
-
const id = (0, _react.useMemo)(() => (0, _guid.default)(), []);
|
|
39
|
-
const numOfSlides = (0, _react.useMemo)(() => {
|
|
40
|
-
return _react.default.Children.toArray(children).filter(child => /*#__PURE__*/_react.default.isValidElement(child)).length;
|
|
41
|
-
}, [children]);
|
|
42
|
-
const handleSlideChange = (0, _react.useCallback)(newIndex => {
|
|
43
|
-
setSelectedSlideIndex(newIndex);
|
|
44
|
-
if (onSlideChange) {
|
|
45
|
-
onSlideChange(newIndex, transitionDirection.current);
|
|
46
|
-
}
|
|
47
|
-
}, [onSlideChange]);
|
|
48
|
-
(0, _react.useEffect)(() => {
|
|
49
|
-
const newIndex = slideIndex;
|
|
50
|
-
const isNewIndexUndefined = typeof newIndex === "undefined";
|
|
51
|
-
const isTheSameIndex = newIndex === lastSlideIndexProp.current || newIndex === selectedSlideIndex;
|
|
52
|
-
if (isNewIndexUndefined || isTheSameIndex) return;
|
|
53
|
-
if (Number(newIndex) > Number(selectedSlideIndex)) {
|
|
54
|
-
transitionDirection.current = NEXT;
|
|
55
|
-
} else {
|
|
56
|
-
transitionDirection.current = PREVIOUS;
|
|
57
|
-
}
|
|
58
|
-
lastSlideIndexProp.current = newIndex;
|
|
59
|
-
handleSlideChange(newIndex);
|
|
60
|
-
}, [handleSlideChange, slideIndex, selectedSlideIndex]);
|
|
61
|
-
function onPreviousClick() {
|
|
62
|
-
const newIndex = selectedSlideIndex - 1;
|
|
63
|
-
transitionDirection.current = PREVIOUS;
|
|
64
|
-
handleSlideChange(newIndex);
|
|
65
|
-
}
|
|
66
|
-
function onNextClick() {
|
|
67
|
-
const newIndex = selectedSlideIndex + 1;
|
|
68
|
-
transitionDirection.current = NEXT;
|
|
69
|
-
handleSlideChange(newIndex);
|
|
70
|
-
}
|
|
71
|
-
function onSlideSelection(ev) {
|
|
72
|
-
const newSlideSelection = Number(ev.target.value);
|
|
73
|
-
transitionDirection.current = newSlideSelection > selectedSlideIndex ? NEXT : PREVIOUS;
|
|
74
|
-
handleSlideChange(newSlideSelection);
|
|
75
|
-
}
|
|
76
|
-
function slideSelector() {
|
|
77
|
-
if (!enableSlideSelector) return null;
|
|
78
|
-
const buttons = [];
|
|
79
|
-
for (let i = 0; i < numOfSlides; i++) {
|
|
80
|
-
buttons.push( /*#__PURE__*/_react.default.createElement(_carousel.CarouselSelectorInputWrapperStyle, {
|
|
81
|
-
key: i,
|
|
82
|
-
"data-element": "selector-inputs"
|
|
83
|
-
}, /*#__PURE__*/_react.default.createElement(_carousel.CarouselSelectorInputStyle, {
|
|
84
|
-
"data-element": "selector-input",
|
|
85
|
-
name: `carousel-slide-${id}`,
|
|
86
|
-
id: `carousel-slide-${i}-${id}`,
|
|
87
|
-
type: "radio",
|
|
88
|
-
value: i,
|
|
89
|
-
onChange: onSlideSelection,
|
|
90
|
-
checked: selectedSlideIndex === i
|
|
91
|
-
}), /*#__PURE__*/_react.default.createElement(_carousel.CarouselSelectorLabelStyle, {
|
|
92
|
-
"data-element": "selector-label",
|
|
93
|
-
htmlFor: `carousel-slide-${i}-${id}`
|
|
94
|
-
})));
|
|
95
|
-
}
|
|
96
|
-
return /*#__PURE__*/_react.default.createElement(_carousel.CarouselSelectorWrapperStyle, {
|
|
97
|
-
"data-element": "slide-selector"
|
|
98
|
-
}, buttons);
|
|
99
|
-
}
|
|
100
|
-
function previousButton() {
|
|
101
|
-
if (!enablePreviousButton) return null;
|
|
102
|
-
const isDisabled = selectedSlideIndex === 0;
|
|
103
|
-
return /*#__PURE__*/_react.default.createElement(_carousel.CarouselPreviousButtonWrapperStyle, null, /*#__PURE__*/_react.default.createElement(_carousel.CarouselButtonStyle, {
|
|
104
|
-
onClick: onPreviousClick,
|
|
105
|
-
"data-element": "previous",
|
|
106
|
-
"aria-label": "previous",
|
|
107
|
-
disabled: isDisabled
|
|
108
|
-
}, /*#__PURE__*/_react.default.createElement(_carousel.CarouselStyledIconLeft, {
|
|
109
|
-
type: "chevron_down"
|
|
110
|
-
})));
|
|
111
|
-
}
|
|
112
|
-
function nextButton() {
|
|
113
|
-
if (!enableNextButton) return null;
|
|
114
|
-
const isDisabled = numOfSlides === selectedSlideIndex + 1;
|
|
115
|
-
return /*#__PURE__*/_react.default.createElement(_carousel.CarouselNextButtonWrapperStyle, null, /*#__PURE__*/_react.default.createElement(_carousel.CarouselButtonStyle, {
|
|
116
|
-
onClick: onNextClick,
|
|
117
|
-
"data-element": "next",
|
|
118
|
-
"aria-label": "next",
|
|
119
|
-
type: "button",
|
|
120
|
-
disabled: isDisabled
|
|
121
|
-
}, /*#__PURE__*/_react.default.createElement(_carousel.CarouselStyledIconRight, {
|
|
122
|
-
type: "chevron_down"
|
|
123
|
-
})));
|
|
124
|
-
}
|
|
125
|
-
return /*#__PURE__*/_react.default.createElement(_carousel.CarouselWrapperStyle, _extends({
|
|
126
|
-
className: className
|
|
127
|
-
}, (0, _tags.default)("carousel", props)), /*#__PURE__*/_react.default.createElement("div", {
|
|
128
|
-
className: "carbon-carousel__content"
|
|
129
|
-
}, previousButton(), /*#__PURE__*/_react.default.createElement(_carousel.CarouselSliderWrapper, {
|
|
130
|
-
elementIndex: selectedSlideIndex
|
|
131
|
-
}, children), nextButton()), slideSelector());
|
|
132
|
-
};
|
|
133
|
-
exports.Carousel = Carousel;
|
|
134
|
-
Carousel.displayName = "Carousel";
|
|
135
|
-
var _default = exports.default = Carousel;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
declare const CarouselNavigationStyle: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
|
-
declare const CarouselPreviousButtonWrapperStyle: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
|
-
declare const CarouselNextButtonWrapperStyle: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
|
-
declare const CarouselStyledIcon: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../icon").IconProps & import("react").RefAttributes<HTMLSpanElement>>, any, {}, never>;
|
|
6
|
-
declare const CarouselStyledIconLeft: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../icon").IconProps & import("react").RefAttributes<HTMLSpanElement>>, any, {}, never>;
|
|
7
|
-
declare const CarouselStyledIconRight: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../icon").IconProps & import("react").RefAttributes<HTMLSpanElement>>, any, {}, never>;
|
|
8
|
-
declare const CarouselButtonStyle: import("styled-components").StyledComponent<"button", any, {
|
|
9
|
-
type: "button";
|
|
10
|
-
}, "type">;
|
|
11
|
-
declare const CarouselSelectorInputStyle: import("styled-components").StyledComponent<"input", any, {}, never>;
|
|
12
|
-
declare const CarouselSelectorLabelStyle: import("styled-components").StyledComponent<"label", any, {}, never>;
|
|
13
|
-
declare const CarouselSelectorWrapperStyle: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
14
|
-
declare const CarouselSelectorInputWrapperStyle: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
15
|
-
interface CarouselSliderWrapperProps {
|
|
16
|
-
elementIndex: number;
|
|
17
|
-
}
|
|
18
|
-
declare const CarouselSliderWrapper: import("styled-components").StyledComponent<"div", any, CarouselSliderWrapperProps, never>;
|
|
19
|
-
declare const CarouselWrapperStyle: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
20
|
-
export { CarouselNavigationStyle, CarouselNextButtonWrapperStyle, CarouselPreviousButtonWrapperStyle, CarouselButtonStyle, CarouselStyledIcon, CarouselStyledIconLeft, CarouselStyledIconRight, CarouselSelectorWrapperStyle, CarouselSelectorInputWrapperStyle, CarouselSelectorInputStyle, CarouselSelectorLabelStyle, CarouselWrapperStyle, CarouselSliderWrapper, };
|
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.CarouselWrapperStyle = exports.CarouselStyledIconRight = exports.CarouselStyledIconLeft = exports.CarouselStyledIcon = exports.CarouselSliderWrapper = exports.CarouselSelectorWrapperStyle = exports.CarouselSelectorLabelStyle = exports.CarouselSelectorInputWrapperStyle = exports.CarouselSelectorInputStyle = exports.CarouselPreviousButtonWrapperStyle = exports.CarouselNextButtonWrapperStyle = exports.CarouselNavigationStyle = exports.CarouselButtonStyle = void 0;
|
|
7
|
-
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
8
|
-
var _icon = _interopRequireDefault(require("../icon"));
|
|
9
|
-
var _slide = require("./slide.config");
|
|
10
|
-
var _slide2 = require("./slide/slide.style");
|
|
11
|
-
var _addFocusStyling = _interopRequireDefault(require("../../style/utils/add-focus-styling"));
|
|
12
|
-
var _base = _interopRequireDefault(require("../../style/themes/base"));
|
|
13
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
-
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); }
|
|
15
|
-
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; }
|
|
16
|
-
const CarouselNavigationStyle = exports.CarouselNavigationStyle = _styledComponents.default.div`
|
|
17
|
-
margin-top: -32.5px;
|
|
18
|
-
position: absolute;
|
|
19
|
-
top: 52%;
|
|
20
|
-
z-index: 20;
|
|
21
|
-
`;
|
|
22
|
-
const CarouselPreviousButtonWrapperStyle = exports.CarouselPreviousButtonWrapperStyle = (0, _styledComponents.default)(CarouselNavigationStyle)`
|
|
23
|
-
margin-left: 8px;
|
|
24
|
-
`;
|
|
25
|
-
const CarouselNextButtonWrapperStyle = exports.CarouselNextButtonWrapperStyle = (0, _styledComponents.default)(CarouselNavigationStyle)`
|
|
26
|
-
right: 0;
|
|
27
|
-
margin-right: 8px;
|
|
28
|
-
`;
|
|
29
|
-
const CarouselStyledIcon = exports.CarouselStyledIcon = (0, _styledComponents.default)(_icon.default)`
|
|
30
|
-
cursor: pointer;
|
|
31
|
-
color: var(--colorsActionMajorYang100);
|
|
32
|
-
&::before {
|
|
33
|
-
font-size: 16px;
|
|
34
|
-
}
|
|
35
|
-
`;
|
|
36
|
-
const CarouselStyledIconLeft = exports.CarouselStyledIconLeft = (0, _styledComponents.default)(CarouselStyledIcon)`
|
|
37
|
-
transform: rotate(90deg);
|
|
38
|
-
`;
|
|
39
|
-
const CarouselStyledIconRight = exports.CarouselStyledIconRight = (0, _styledComponents.default)(CarouselStyledIcon)`
|
|
40
|
-
transform: rotate(-90deg);
|
|
41
|
-
`;
|
|
42
|
-
const oldFocusStyling = `
|
|
43
|
-
outline: solid 2px var(--colorsSemanticFocus500);
|
|
44
|
-
`;
|
|
45
|
-
const CarouselButtonStyle = exports.CarouselButtonStyle = _styledComponents.default.button.attrs({
|
|
46
|
-
type: "button"
|
|
47
|
-
})`
|
|
48
|
-
${({
|
|
49
|
-
disabled
|
|
50
|
-
}) => (0, _styledComponents.css)`
|
|
51
|
-
border: none;
|
|
52
|
-
border-radius: var(--borderRadius400);
|
|
53
|
-
width: 40px;
|
|
54
|
-
height: 40px;
|
|
55
|
-
border-width: var(--borderWidth200);
|
|
56
|
-
border-color: var(--colorsActionMajorTransparent);
|
|
57
|
-
background-color: ${disabled ? "var(--colorsActionDisabled500)" : "var(--colorsActionMajor500)"};
|
|
58
|
-
|
|
59
|
-
${disabled && (0, _styledComponents.css)`
|
|
60
|
-
${CarouselStyledIcon} {
|
|
61
|
-
color: var(--colorsActionMajorYin030);
|
|
62
|
-
}
|
|
63
|
-
`}
|
|
64
|
-
|
|
65
|
-
&:hover {
|
|
66
|
-
background-color: var(--colorsActionMajor600);
|
|
67
|
-
cursor: ${disabled ? "default" : "pointer"};
|
|
68
|
-
|
|
69
|
-
${disabled && (0, _styledComponents.css)`
|
|
70
|
-
background-color: var(--colorsActionDisabled500);
|
|
71
|
-
cursor: default;
|
|
72
|
-
|
|
73
|
-
${CarouselStyledIcon} {
|
|
74
|
-
cursor: default;
|
|
75
|
-
}
|
|
76
|
-
`}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
&:active {
|
|
80
|
-
border: none;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
&:focus {
|
|
84
|
-
${({
|
|
85
|
-
theme
|
|
86
|
-
}) => `${!theme.focusRedesignOptOut ? (0, _addFocusStyling.default)() : /* istanbul ignore next */oldFocusStyling}`}
|
|
87
|
-
|
|
88
|
-
::-moz-focus-inner {
|
|
89
|
-
border: 0;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
${disabled && (0, _styledComponents.css)`
|
|
93
|
-
outline: none;
|
|
94
|
-
`}
|
|
95
|
-
}
|
|
96
|
-
`}
|
|
97
|
-
`;
|
|
98
|
-
CarouselButtonStyle.defaultProps = {
|
|
99
|
-
theme: _base.default
|
|
100
|
-
};
|
|
101
|
-
const CarouselSelectorInputStyle = exports.CarouselSelectorInputStyle = _styledComponents.default.input`
|
|
102
|
-
display: none;
|
|
103
|
-
`;
|
|
104
|
-
const CarouselSelectorLabelStyle = exports.CarouselSelectorLabelStyle = _styledComponents.default.label`
|
|
105
|
-
display: inline-block;
|
|
106
|
-
border-radius: var(--borderRadius100);
|
|
107
|
-
width: 10px;
|
|
108
|
-
height: 10px;
|
|
109
|
-
background: var(--colorsActionMinor200);
|
|
110
|
-
margin: 0px 4px;
|
|
111
|
-
|
|
112
|
-
&:hover {
|
|
113
|
-
cursor: pointer;
|
|
114
|
-
}
|
|
115
|
-
`;
|
|
116
|
-
const CarouselSelectorWrapperStyle = exports.CarouselSelectorWrapperStyle = _styledComponents.default.div`
|
|
117
|
-
${(0, _styledComponents.css)`
|
|
118
|
-
height: 20px;
|
|
119
|
-
margin-top: 25px;
|
|
120
|
-
text-align: center;
|
|
121
|
-
|
|
122
|
-
${CarouselSelectorInputStyle}:checked {
|
|
123
|
-
+ ${CarouselSelectorLabelStyle} {
|
|
124
|
-
width: 10px;
|
|
125
|
-
height: 10px;
|
|
126
|
-
background: var(--colorsActionMinor400);
|
|
127
|
-
border-color: transparent;
|
|
128
|
-
position: relative;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
`}
|
|
132
|
-
`;
|
|
133
|
-
const CarouselSelectorInputWrapperStyle = exports.CarouselSelectorInputWrapperStyle = _styledComponents.default.span`
|
|
134
|
-
display: inline-block;
|
|
135
|
-
line-height: 20px;
|
|
136
|
-
vertical-align: middle;
|
|
137
|
-
`;
|
|
138
|
-
const CarouselSliderWrapper = exports.CarouselSliderWrapper = _styledComponents.default.div`
|
|
139
|
-
transition: 0.4s;
|
|
140
|
-
display: flex;
|
|
141
|
-
position: relative;
|
|
142
|
-
|
|
143
|
-
${({
|
|
144
|
-
elementIndex
|
|
145
|
-
}) => (0, _styledComponents.css)`
|
|
146
|
-
left: ${10 - 80 * elementIndex}%;
|
|
147
|
-
|
|
148
|
-
${_slide2.SlideStyle}:nth-of-type(${elementIndex + 1}) {
|
|
149
|
-
transform: scale(1);
|
|
150
|
-
opacity: 1;
|
|
151
|
-
}
|
|
152
|
-
`}
|
|
153
|
-
`;
|
|
154
|
-
const CarouselWrapperStyle = exports.CarouselWrapperStyle = _styledComponents.default.div`
|
|
155
|
-
.carbon-carousel__content {
|
|
156
|
-
overflow: hidden;
|
|
157
|
-
position: relative;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
${_slide.slideAnimation};
|
|
161
|
-
${_slide.fadeAnimation};
|
|
162
|
-
`;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "Carousel", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _carousel.Carousel;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "Slide", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _slide.default;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
var _carousel = require("./carousel.component");
|
|
19
|
-
var _slide = _interopRequireDefault(require("./slide"));
|
|
20
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -1,13 +0,0 @@
|
|
|
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 _slide.default;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
var _slide = _interopRequireDefault(require("./slide.component"));
|
|
13
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
export interface SlideProps {
|
|
3
|
-
/** Content of the Slide */
|
|
4
|
-
children?: React.ReactNode;
|
|
5
|
-
/** Accepts a callback function which is triggered on Slide click */
|
|
6
|
-
onClick?: (ev: React.MouseEvent<HTMLDivElement>) => void;
|
|
7
|
-
}
|
|
8
|
-
export declare const Slide: {
|
|
9
|
-
(props: SlideProps): React.JSX.Element;
|
|
10
|
-
displayName: string;
|
|
11
|
-
};
|
|
12
|
-
export default Slide;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = exports.Slide = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var _tags = _interopRequireDefault(require("../../../__internal__/utils/helpers/tags/tags"));
|
|
10
|
-
var _slide = require("./slide.style");
|
|
11
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); } /* eslint-disable react/prop-types */
|
|
13
|
-
const Slide = props => /*#__PURE__*/_react.default.createElement(_slide.SlideStyle, _extends({}, props, (0, _tags.default)("slide", props)));
|
|
14
|
-
exports.Slide = Slide;
|
|
15
|
-
Slide.displayName = "Slide";
|
|
16
|
-
var _default = exports.default = Slide;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.SlideStyle = void 0;
|
|
7
|
-
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
8
|
-
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); }
|
|
9
|
-
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; }
|
|
10
|
-
const SlideStyle = exports.SlideStyle = _styledComponents.default.div`
|
|
11
|
-
${({
|
|
12
|
-
onClick
|
|
13
|
-
}) => (0, _styledComponents.css)`
|
|
14
|
-
box-sizing: border-box;
|
|
15
|
-
display: inline-block;
|
|
16
|
-
width: 100%;
|
|
17
|
-
z-index: 10;
|
|
18
|
-
border-radius: var(--borderRadius200);
|
|
19
|
-
overflow: hidden;
|
|
20
|
-
|
|
21
|
-
transition: 0.5s;
|
|
22
|
-
min-width: 80%;
|
|
23
|
-
transform: scale(0.9);
|
|
24
|
-
opacity: 0.3;
|
|
25
|
-
margin: 30px 0;
|
|
26
|
-
box-shadow: var(--boxShadow200);
|
|
27
|
-
background-color: var(--colorsUtilityYang100);
|
|
28
|
-
|
|
29
|
-
${onClick && (0, _styledComponents.css)`
|
|
30
|
-
:hover {
|
|
31
|
-
transition: all 0.2s ease-in;
|
|
32
|
-
transform: scale(1.02);
|
|
33
|
-
cursor: pointer;
|
|
34
|
-
}
|
|
35
|
-
`}
|
|
36
|
-
`}
|
|
37
|
-
`;
|
|
38
|
-
|
|
39
|
-
// eslint-disable-next-line import/prefer-default-export
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.slideAnimation = exports.fadeAnimation = void 0;
|
|
7
|
-
var _styledComponents = require("styled-components");
|
|
8
|
-
const animationStyle = "all 500ms cubic-bezier(.23,1.10,.69,1.01)";
|
|
9
|
-
const slideAnimation = exports.slideAnimation = (0, _styledComponents.css)`
|
|
10
|
-
// NEXT
|
|
11
|
-
.slide-next-enter {
|
|
12
|
-
opacity: 0;
|
|
13
|
-
left: 100%;
|
|
14
|
-
position: absolute;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.slide-next-enter.slide-next-enter-active {
|
|
18
|
-
opacity: 1;
|
|
19
|
-
left: 0;
|
|
20
|
-
transition: ${animationStyle};
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.slide-next-exit {
|
|
24
|
-
opacity: 1;
|
|
25
|
-
left: 0;
|
|
26
|
-
position: relative;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.slide-next-exit.slide-next-exit-active {
|
|
30
|
-
opacity: 0;
|
|
31
|
-
left: -100%;
|
|
32
|
-
transition: ${animationStyle};
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// PREVIOUS
|
|
36
|
-
.slide-previous-enter {
|
|
37
|
-
opacity: 0;
|
|
38
|
-
left: -100%;
|
|
39
|
-
position: absolute;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.slide-previous-enter.slide-previous-enter-active {
|
|
43
|
-
opacity: 1;
|
|
44
|
-
left: 0;
|
|
45
|
-
transition: ${animationStyle};
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.slide-previous-exit {
|
|
49
|
-
opacity: 1;
|
|
50
|
-
left: 0;
|
|
51
|
-
position: relative;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.slide-previous-exit.slide-previous-exit-active {
|
|
55
|
-
opacity: 0;
|
|
56
|
-
left: 100%;
|
|
57
|
-
transition: ${animationStyle};
|
|
58
|
-
}
|
|
59
|
-
`;
|
|
60
|
-
const fadeAnimation = exports.fadeAnimation = (0, _styledComponents.css)`
|
|
61
|
-
// FADE
|
|
62
|
-
.carousel-transition-fade-enter {
|
|
63
|
-
opacity: 0;
|
|
64
|
-
position: absolute;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.carousel-transition-fade-enter.carousel-transition-fade-enter-active {
|
|
68
|
-
opacity: 1;
|
|
69
|
-
transition: ${animationStyle};
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.carousel-transition-fade-exit {
|
|
73
|
-
opacity: 1;
|
|
74
|
-
position: relative;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.carousel-transition-fade-exit.carousel-transition-fade-exit-active {
|
|
78
|
-
opacity: 0;
|
|
79
|
-
transition: ${animationStyle};
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.carbon-carousel__transition {
|
|
83
|
-
height: 100%;
|
|
84
|
-
}
|
|
85
|
-
`;
|
|
@@ -1,4 +0,0 @@
|
|
|
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";
|