@desynova-digital/components 9.0.26 → 9.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/_helpers/globals.js +9 -10
- package/_helpers/pagination.js +10 -15
- package/_helpers/story-example.js +16 -39
- package/_helpers/story-helpers.js +15 -14
- package/_helpers/story-stack.js +22 -43
- package/_helpers/uniqueId.js +2 -5
- package/_helpers/utils.js +28 -4
- package/atoms/avatar/avatar.js +19 -42
- package/atoms/avatar/avatar.story.js +25 -58
- package/atoms/avatar/index.js +13 -11
- package/atoms/badge/badge.js +14 -37
- package/atoms/badge/badge.story.js +45 -103
- package/atoms/badge/index.js +12 -10
- package/atoms/button/button.js +85 -161
- package/atoms/button/button.story.js +354 -508
- package/atoms/button/index.js +5 -9
- package/atoms/card/card.js +26 -55
- package/atoms/card/card.story.js +39 -88
- package/atoms/card/index.js +12 -10
- package/atoms/cardStack/cardStack.js +88 -147
- package/atoms/cardStack/cardStack.story.js +106 -210
- package/atoms/cardStack/index.js +12 -10
- package/atoms/cardV2/cardV2.js +57 -106
- package/atoms/cardV2/cardV2.story.js +184 -232
- package/atoms/cardV2/content.js +154 -256
- package/atoms/cardV2/index.js +4 -8
- package/atoms/cardV2/thumbnail.js +138 -208
- package/atoms/cardV2/timeline.js +167 -123
- package/atoms/checkbox/checkbox.js +85 -157
- package/atoms/checkbox/checkbox.story.js +237 -365
- package/atoms/checkbox/index.js +4 -9
- package/atoms/customSelect/customSelect.js +136 -215
- package/atoms/customSelect/customSelect.story.js +745 -851
- package/atoms/customSelect/index.js +4 -8
- package/atoms/datePicker/datePicker.js +299 -431
- package/atoms/datePicker/datePicker.story.js +453 -501
- package/atoms/datePicker/index.js +4 -8
- package/atoms/dateTime/dateTime.js +3 -6
- package/atoms/dateTime/dateTime.story.js +17 -63
- package/atoms/dateTime/index.js +5 -9
- package/atoms/draftInputText/draftInputText.js +121 -189
- package/atoms/draftInputText/draftInputText.story.js +200 -249
- package/atoms/draftInputText/index.js +5 -9
- package/atoms/dropdown/dropdown.js +38 -66
- package/atoms/dropdown/dropdown.story.js +102 -262
- package/atoms/dropdown/index.js +4 -8
- package/atoms/dropdownList/dropdownList.js +78 -108
- package/atoms/dropdownList/dropdownList.story.js +1546 -1621
- package/atoms/dropdownList/index.js +4 -8
- package/atoms/graphs/barGraph/barGraph.js +95 -146
- package/atoms/graphs/barGraph/barGraph.story.js +65 -87
- package/atoms/graphs/barGraph/index.js +4 -8
- package/atoms/graphs/circleDonut/circleDonut.js +177 -229
- package/atoms/graphs/circleDonut/circleDonut.story.js +328 -394
- package/atoms/graphs/circleDonut/index.js +5 -9
- package/atoms/graphs/circleGraph/circleGraph.js +60 -90
- package/atoms/graphs/circleGraph/circleGraph.story.js +36 -54
- package/atoms/graphs/circleGraph/index.js +4 -8
- package/atoms/graphs/circleNested/circleNested.js +216 -262
- package/atoms/graphs/circleNested/circleNested.story.js +91 -116
- package/atoms/graphs/circleNested/index.js +5 -9
- package/atoms/graphs/pieChart/index.js +4 -8
- package/atoms/graphs/pieChart/pieChart.js +162 -191
- package/atoms/graphs/pieChart/pieChart.story.js +147 -176
- package/atoms/graphs/verticalBarGraph/index.js +5 -9
- package/atoms/graphs/verticalBarGraph/verticalBarGraph.js +75 -98
- package/atoms/graphs/verticalBarGraph/verticalBarGraph.story.js +26 -45
- package/atoms/icon/icon.js +41 -72
- package/atoms/icon/icon.story.js +831 -260
- package/atoms/icon/index.js +19 -12
- package/atoms/image/image.js +18 -32
- package/atoms/image/image.story.js +10 -19
- package/atoms/image/index.js +4 -8
- package/atoms/inputText/index.js +4 -8
- package/atoms/inputText/inputText.js +86 -131
- package/atoms/inputText/inputText.story.js +191 -255
- package/atoms/label/index.js +4 -8
- package/atoms/label/label.js +25 -50
- package/atoms/label/label.story.js +42 -83
- package/atoms/loader/CircleLoader.js +29 -63
- package/atoms/loader/ShimmerComponent/CollabShimmerCard.js +39 -50
- package/atoms/loader/ShimmerComponent/CollabShimmerCardTray.js +41 -42
- package/atoms/loader/ShimmerComponent/FiltersShimmer.js +30 -30
- package/atoms/loader/ShimmerComponent/GraphDetailShimmer.js +21 -34
- package/atoms/loader/ShimmerComponent/GraphTitleShimmer.js +30 -34
- package/atoms/loader/ShimmerComponent/GraphsComponentShimmer.js +23 -32
- package/atoms/loader/ShimmerComponent/Shimmer.js +24 -32
- package/atoms/loader/ThreeDotLoader.js +14 -29
- package/atoms/loader/index.js +13 -11
- package/atoms/loader/loader.js +34 -58
- package/atoms/loader/loader.story.js +48 -52
- package/atoms/loader/spinningLoader.js +23 -34
- package/atoms/popup/index.js +5 -9
- package/atoms/popup/popup.js +123 -208
- package/atoms/popup/popup.story.js +97 -131
- package/atoms/radio/index.js +18 -11
- package/atoms/radio/radio.js +58 -112
- package/atoms/radio/radio.story.js +197 -420
- package/atoms/select/index.js +4 -8
- package/atoms/select/select.js +48 -86
- package/atoms/sideBar/index.js +5 -9
- package/atoms/sideBar/sidebar.js +89 -140
- package/atoms/switch/index.js +4 -8
- package/atoms/switch/switch.js +56 -86
- package/atoms/switch/switch.story.js +268 -415
- package/atoms/tag/index.js +12 -10
- package/atoms/tag/tag.js +29 -63
- package/atoms/tag/tag.story.js +135 -209
- package/atoms/textarea/index.js +5 -9
- package/atoms/textarea/textarea.js +55 -99
- package/atoms/textarea/textarea.story.js +48 -41
- package/atoms/thematicBreak/index.js +12 -10
- package/atoms/thematicBreak/thematicBreak.js +20 -38
- package/atoms/thematicBreak/thematicBreak.story.js +25 -37
- package/atoms/timeCodeInput/index.js +4 -8
- package/atoms/timeCodeInput/timCodeInput.story.js +21 -35
- package/atoms/timeCodeInput/timeCodeInput.js +33 -51
- package/atoms/timer/index.js +5 -9
- package/atoms/timer/timer.js +57 -108
- package/atoms/timer/timer.story.js +13 -26
- package/atoms/toast/index.js +5 -9
- package/atoms/toast/toast.js +81 -116
- package/atoms/toast/toast.story.js +50 -76
- package/atoms/videoCard/index.js +12 -10
- package/atoms/videoCard/videoCard.js +265 -447
- package/atoms/videoCard/videoCard.story.js +495 -710
- package/components.js +411 -294
- package/index.js +350 -61
- package/molecules/carousel/carousel.js +121 -207
- package/molecules/carousel/carousel.story.js +240 -223
- package/molecules/carousel/index.js +5 -9
- package/molecules/errorScreen/CollabErrorScreen.js +35 -66
- package/molecules/errorScreen/TableErrorScreen.js +109 -102
- package/molecules/errorScreen/TableErrorScreen.jsx +7 -6
- package/molecules/errorScreen/errorScreen.js +41 -94
- package/molecules/filter/constants.js +1 -0
- package/molecules/filter/filter.js +378 -562
- package/molecules/filter/filter.story.js +79 -104
- package/molecules/filter/index.js +5 -9
- package/molecules/graphCard/graphCard.js +97 -193
- package/molecules/graphCard/graphCard.story.js +159 -191
- package/molecules/graphCard/index.js +4 -8
- package/molecules/graphCard/loader.js +28 -68
- package/molecules/graphDetailCard/graphDetailCard.js +115 -183
- package/molecules/graphDetailCard/graphDetailCard.story.js +218 -254
- package/molecules/graphDetailCard/index.js +5 -9
- package/molecules/pageHeader/index.js +12 -10
- package/molecules/pageHeader/pageHeader.js +38 -79
- package/molecules/pageHeader/pageHeader.story.js +34 -55
- package/molecules/pagination/index.js +4 -8
- package/molecules/pagination/pagination.js +126 -202
- package/molecules/pagination/pagination.story.js +40 -52
- package/molecules/richTextInput/RichTextInput.js +354 -0
- package/molecules/richTextInput/RichTextInput.story.js +50 -0
- package/molecules/richTextInput/index.js +9 -0
- package/molecules/table/index.js +4 -8
- package/molecules/table/table-column.js +10 -16
- package/molecules/table/table-header.js +31 -72
- package/molecules/table/table.js +743 -1075
- package/molecules/table/table.story.js +274 -304
- package/molecules/tabs/index.js +4 -8
- package/molecules/tabs/tabs.js +112 -184
- package/molecules/tabs/tabs.story.js +66 -133
- package/molecules/videoCardList/index.js +4 -8
- package/molecules/videoCardList/videoCardList.js +24 -41
- package/molecules/videoCardList/videoCardList.story.js +449 -664
- package/molecules/videoPlayer/index.js +4 -8
- package/molecules/videoPlayer/videoPlayer.js +1019 -1097
- package/molecules/videoPlayer/videoPlayer.story.js +10 -21
- package/package.json +2 -2
package/atoms/button/index.js
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
|
-
|
|
7
|
-
var _button = require(
|
|
8
|
-
|
|
9
|
-
var _button2 = _interopRequireDefault(_button);
|
|
10
|
-
|
|
11
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
-
|
|
13
|
-
exports.default = _button2.default;
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _button = _interopRequireDefault(require("./button"));
|
|
9
|
+
var _default = exports["default"] = _button["default"];
|
package/atoms/card/card.js
CHANGED
|
@@ -1,32 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
|
-
exports.StyledCard =
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
var _propTypes = require('prop-types');
|
|
16
|
-
|
|
17
|
-
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
18
|
-
|
|
19
|
-
var _styledComponents = require('styled-components');
|
|
20
|
-
|
|
21
|
-
var _styledComponents2 = _interopRequireDefault(_styledComponents);
|
|
22
|
-
|
|
23
|
-
var _tokens = require('@desynova-digital/tokens');
|
|
24
|
-
|
|
25
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
26
|
-
|
|
27
|
-
function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
28
|
-
|
|
29
|
-
var StyledCard = _styledComponents2.default.div(_templateObject, function (props) {
|
|
7
|
+
exports["default"] = exports.StyledCard = void 0;
|
|
8
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
12
|
+
var _tokens = require("@desynova-digital/tokens");
|
|
13
|
+
var _templateObject, _templateObject2;
|
|
14
|
+
var StyledCard = exports.StyledCard = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n font-family: 'SFUIText-Medium';\n width: 100%;\n background: ", ";\n border-radius: ", ";\n\n height: ", ";\n color: ", ";\n"])), function (props) {
|
|
30
15
|
return _tokens.colors[props.theme].card.background;
|
|
31
16
|
}, function (props) {
|
|
32
17
|
return props.radius + 'px';
|
|
@@ -37,8 +22,7 @@ var StyledCard = _styledComponents2.default.div(_templateObject, function (props
|
|
|
37
22
|
return _tokens.colors.light.card.background;
|
|
38
23
|
}
|
|
39
24
|
});
|
|
40
|
-
|
|
41
|
-
var StyledCardBox = _styledComponents2.default.div(_templateObject2, function (props) {
|
|
25
|
+
var StyledCardBox = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-block;\n vertical-align: top;\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n\n width: ", ";\n\n ", "\n"])), function (props) {
|
|
42
26
|
return props.paddingTop ? props.paddingTop + 'px' : props.paddingTopBottom ? props.paddingTopBottom + 'px' : '';
|
|
43
27
|
}, function (props) {
|
|
44
28
|
return props.paddingBottom ? props.paddingBottom + 'px' : props.paddingTopBottom ? props.paddingTopBottom + 'px' : '';
|
|
@@ -51,42 +35,29 @@ var StyledCardBox = _styledComponents2.default.div(_templateObject2, function (p
|
|
|
51
35
|
}, function (props) {
|
|
52
36
|
return props.padding ? 'padding:' + props.padding + 'px' : '';
|
|
53
37
|
});
|
|
54
|
-
|
|
55
38
|
var Card = function Card(props) {
|
|
56
|
-
return
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
className: 'card-box'
|
|
67
|
-
},
|
|
68
|
-
_react2.default.createElement(
|
|
69
|
-
StyledCard,
|
|
70
|
-
props,
|
|
71
|
-
props.children
|
|
72
|
-
)
|
|
73
|
-
);
|
|
39
|
+
return /*#__PURE__*/_react["default"].createElement(StyledCardBox, {
|
|
40
|
+
paddingTopBottom: props.paddingTopBottom,
|
|
41
|
+
paddingTop: props.paddingTop,
|
|
42
|
+
paddingBottom: props.paddingBottom,
|
|
43
|
+
paddingLeftRight: props.paddingLeftRight,
|
|
44
|
+
paddingLeft: props.paddingLeft,
|
|
45
|
+
paddingRight: props.paddingRight,
|
|
46
|
+
width: props.width,
|
|
47
|
+
className: 'card-box'
|
|
48
|
+
}, /*#__PURE__*/_react["default"].createElement(StyledCard, props, props.children));
|
|
74
49
|
};
|
|
75
|
-
|
|
76
50
|
Card.propTypes = {
|
|
77
51
|
/** The visual style used to convey the label's purpose */
|
|
78
|
-
theme:
|
|
79
|
-
width:
|
|
80
|
-
height:
|
|
81
|
-
radius:
|
|
52
|
+
theme: _propTypes["default"].oneOf(['light', 'dark', 'nexc']),
|
|
53
|
+
width: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number]),
|
|
54
|
+
height: _propTypes["default"].number,
|
|
55
|
+
radius: _propTypes["default"].number
|
|
82
56
|
};
|
|
83
|
-
|
|
84
57
|
Card.defaultProps = {
|
|
85
58
|
theme: 'light',
|
|
86
59
|
width: 100,
|
|
87
60
|
height: 100,
|
|
88
61
|
radius: 0
|
|
89
62
|
};
|
|
90
|
-
|
|
91
|
-
exports.default = Card;
|
|
92
|
-
exports.StyledCard = StyledCard;
|
|
63
|
+
var _default = exports["default"] = Card;
|
package/atoms/card/card.story.js
CHANGED
|
@@ -1,91 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
var _react2 =
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return _react2.default.createElement(
|
|
17
|
-
_storyHelpers.Example,
|
|
18
|
-
{ title: 'Appearances Light', background: 'default' },
|
|
19
|
-
_react2.default.createElement(
|
|
20
|
-
_storyHelpers.Stack,
|
|
21
|
-
null,
|
|
22
|
-
_react2.default.createElement(
|
|
23
|
-
_components.Card,
|
|
24
|
-
null,
|
|
25
|
-
'Light Theme'
|
|
26
|
-
),
|
|
27
|
-
_react2.default.createElement(
|
|
28
|
-
_components.Card,
|
|
29
|
-
{ width: '100%', radius: 5 },
|
|
30
|
-
'Radius Light Theme'
|
|
31
|
-
),
|
|
32
|
-
_react2.default.createElement(
|
|
33
|
-
_components.Card,
|
|
34
|
-
null,
|
|
35
|
-
'Dark Theme'
|
|
36
|
-
)
|
|
37
|
-
)
|
|
38
|
-
);
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _react = _interopRequireDefault(require("react"));
|
|
5
|
+
var _react2 = require("@storybook/react");
|
|
6
|
+
var _storyHelpers = require("../../_helpers/story-helpers");
|
|
7
|
+
var _components = require("../../components");
|
|
8
|
+
(0, _react2.storiesOf)('Card').add('light theme', function () {
|
|
9
|
+
return /*#__PURE__*/_react["default"].createElement(_storyHelpers.Example, {
|
|
10
|
+
title: "Appearances Light",
|
|
11
|
+
background: "default"
|
|
12
|
+
}, /*#__PURE__*/_react["default"].createElement(_storyHelpers.Stack, null, /*#__PURE__*/_react["default"].createElement(_components.Card, null, "Light Theme"), /*#__PURE__*/_react["default"].createElement(_components.Card, {
|
|
13
|
+
width: "100%",
|
|
14
|
+
radius: 5
|
|
15
|
+
}, "Radius Light Theme"), /*#__PURE__*/_react["default"].createElement(_components.Card, null, "Dark Theme")));
|
|
39
16
|
});
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
),
|
|
53
|
-
_react2.default.createElement(
|
|
54
|
-
_components.Card,
|
|
55
|
-
{ theme: 'dark', radius: 5 },
|
|
56
|
-
'Radius Light Theme'
|
|
57
|
-
),
|
|
58
|
-
_react2.default.createElement(
|
|
59
|
-
_components.Card,
|
|
60
|
-
{ theme: 'dark' },
|
|
61
|
-
'Dark Theme'
|
|
62
|
-
)
|
|
63
|
-
)
|
|
64
|
-
);
|
|
17
|
+
(0, _react2.storiesOf)('Card').add('dark theme', function () {
|
|
18
|
+
return /*#__PURE__*/_react["default"].createElement(_storyHelpers.Example, {
|
|
19
|
+
title: "Appearances Dark",
|
|
20
|
+
background: "black"
|
|
21
|
+
}, /*#__PURE__*/_react["default"].createElement(_storyHelpers.Stack, null, /*#__PURE__*/_react["default"].createElement(_components.Card, {
|
|
22
|
+
theme: "dark"
|
|
23
|
+
}, "Light Theme"), /*#__PURE__*/_react["default"].createElement(_components.Card, {
|
|
24
|
+
theme: "dark",
|
|
25
|
+
radius: 5
|
|
26
|
+
}, "Radius Light Theme"), /*#__PURE__*/_react["default"].createElement(_components.Card, {
|
|
27
|
+
theme: "dark"
|
|
28
|
+
}, "Dark Theme")));
|
|
65
29
|
});
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
),
|
|
79
|
-
_react2.default.createElement(
|
|
80
|
-
_components.Card,
|
|
81
|
-
{ theme: 'nexc', radius: 5 },
|
|
82
|
-
'Radius Light Theme'
|
|
83
|
-
),
|
|
84
|
-
_react2.default.createElement(
|
|
85
|
-
_components.Card,
|
|
86
|
-
{ theme: 'nexc' },
|
|
87
|
-
'Dark Theme'
|
|
88
|
-
)
|
|
89
|
-
)
|
|
90
|
-
);
|
|
30
|
+
(0, _react2.storiesOf)('Card').add('nexc theme', function () {
|
|
31
|
+
return /*#__PURE__*/_react["default"].createElement(_storyHelpers.Example, {
|
|
32
|
+
title: "Appearances Dark",
|
|
33
|
+
background: "black"
|
|
34
|
+
}, /*#__PURE__*/_react["default"].createElement(_storyHelpers.Stack, null, /*#__PURE__*/_react["default"].createElement(_components.Card, {
|
|
35
|
+
theme: "nexc"
|
|
36
|
+
}, "Light Theme"), /*#__PURE__*/_react["default"].createElement(_components.Card, {
|
|
37
|
+
theme: "nexc",
|
|
38
|
+
radius: 5
|
|
39
|
+
}, "Radius Light Theme"), /*#__PURE__*/_react["default"].createElement(_components.Card, {
|
|
40
|
+
theme: "nexc"
|
|
41
|
+
}, "Dark Theme")));
|
|
91
42
|
});
|
package/atoms/card/index.js
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
|
-
exports
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
Object.defineProperty(exports, "StyledCard", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function get() {
|
|
10
|
+
return _card.StyledCard;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
exports["default"] = void 0;
|
|
14
|
+
var _card = _interopRequireWildcard(require("./card"));
|
|
15
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
16
|
+
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; }
|
|
17
|
+
var _default = exports["default"] = _card["default"];
|
|
@@ -1,55 +1,36 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
var _tokens = require('@desynova-digital/tokens');
|
|
22
|
-
|
|
23
|
-
var _propTypes = require('prop-types');
|
|
24
|
-
|
|
25
|
-
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
26
|
-
|
|
27
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
28
|
-
|
|
29
|
-
function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
30
|
-
|
|
31
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
32
|
-
|
|
33
|
-
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
34
|
-
|
|
35
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
36
|
-
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
12
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
13
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
14
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
|
+
var _react = _interopRequireDefault(require("react"));
|
|
16
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
17
|
+
var _tokens = require("@desynova-digital/tokens");
|
|
18
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
19
|
+
var _templateObject, _templateObject2, _templateObject3;
|
|
20
|
+
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
21
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
37
22
|
//import './switch.css'
|
|
38
|
-
var CardStack = function (_React$Component) {
|
|
39
|
-
_inherits(CardStack, _React$Component);
|
|
40
|
-
|
|
23
|
+
var CardStack = /*#__PURE__*/function (_React$Component) {
|
|
41
24
|
function CardStack(props) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
_this.changeCardTo = function (newIdx) {
|
|
25
|
+
var _this;
|
|
26
|
+
(0, _classCallCheck2["default"])(this, CardStack);
|
|
27
|
+
_this = _callSuper(this, CardStack, [props]);
|
|
28
|
+
(0, _defineProperty2["default"])(_this, "changeCardTo", function (newIdx) {
|
|
47
29
|
_this.setState({
|
|
48
30
|
current: newIdx,
|
|
49
31
|
last: _this.state.current ? _this.state.current : 0
|
|
50
32
|
});
|
|
51
|
-
};
|
|
52
|
-
|
|
33
|
+
});
|
|
53
34
|
_this.state = {
|
|
54
35
|
current: props.current ? props.current : 0,
|
|
55
36
|
last: props.current ? props.current : 0,
|
|
@@ -58,12 +39,11 @@ var CardStack = function (_React$Component) {
|
|
|
58
39
|
_this.cardClick = _this.cardClick.bind(_this);
|
|
59
40
|
return _this;
|
|
60
41
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
key:
|
|
42
|
+
(0, _inherits2["default"])(CardStack, _React$Component);
|
|
43
|
+
return (0, _createClass2["default"])(CardStack, [{
|
|
44
|
+
key: "cardClick",
|
|
64
45
|
value: function cardClick(e, idx) {
|
|
65
46
|
var _this2 = this;
|
|
66
|
-
|
|
67
47
|
if (this.state.current !== idx) {
|
|
68
48
|
if (!this.props.isStepform) {
|
|
69
49
|
this.setState({
|
|
@@ -78,87 +58,63 @@ var CardStack = function (_React$Component) {
|
|
|
78
58
|
}
|
|
79
59
|
}
|
|
80
60
|
}, {
|
|
81
|
-
key:
|
|
61
|
+
key: "render",
|
|
82
62
|
value: function render() {
|
|
83
63
|
var _this3 = this;
|
|
84
|
-
|
|
85
64
|
if (this.props.isStepform && this.props.current !== this.state.current) {
|
|
86
65
|
this.changeCardTo(this.props.current);
|
|
87
66
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
isStepform: _this3.props.isStepform,
|
|
105
|
-
current: _this3.state.current,
|
|
106
|
-
total: _this3.props.children.length,
|
|
107
|
-
last: _this3.state.last,
|
|
108
|
-
onClick: function onClick(e) {
|
|
109
|
-
return _this3.cardClick(e, idx);
|
|
110
|
-
},
|
|
111
|
-
titleHeight: _this3.props.titleHeight,
|
|
112
|
-
theme: _this3.props.theme ? _this3.props.theme : 'dark'
|
|
113
|
-
},
|
|
114
|
-
_react2.default.createElement(
|
|
115
|
-
'div',
|
|
116
|
-
null,
|
|
117
|
-
_react2.default.createElement(TitleComponent, { title: child.props.title, titleHeight: _this3.props.titleHeight }),
|
|
118
|
-
_this3.state.current === idx ? child : null
|
|
119
|
-
)
|
|
120
|
-
);
|
|
121
|
-
}) : this.props.children.constructor === Object ? _react2.default.createElement(
|
|
122
|
-
CardStack.Card,
|
|
123
|
-
{
|
|
124
|
-
key: 'card',
|
|
125
|
-
className: this.state.current < 0 ? 'next' : this.state.current === 0 ? 'current' : 'previous',
|
|
126
|
-
count: 0,
|
|
127
|
-
current: this.state.current,
|
|
128
|
-
isStepform: this.props.isStepform,
|
|
129
|
-
total: 1,
|
|
130
|
-
last: this.state.last,
|
|
131
|
-
onClick: function onClick(e) {
|
|
132
|
-
return _this3.cardClick(e, 0);
|
|
133
|
-
},
|
|
134
|
-
titleHeight: this.props.titleHeight,
|
|
135
|
-
theme: this.props.theme ? this.props.theme : 'dark'
|
|
67
|
+
return /*#__PURE__*/_react["default"].createElement(CardStack.CardStackBox, {
|
|
68
|
+
className: "card-stack-box",
|
|
69
|
+
theme: this.props.theme,
|
|
70
|
+
isStepform: this.props.isStepform
|
|
71
|
+
}, this.props.children.constructor === Array ? this.props.children.map(function (child, idx) {
|
|
72
|
+
//console.log('child ::',child.key);
|
|
73
|
+
return /*#__PURE__*/_react["default"].createElement(CardStack.Card, {
|
|
74
|
+
key: child.key + 0 + 'card-stack',
|
|
75
|
+
className: _this3.state.current < idx ? 'next' : _this3.state.current === idx ? 'current' : 'previous',
|
|
76
|
+
count: idx,
|
|
77
|
+
isStepform: _this3.props.isStepform,
|
|
78
|
+
current: _this3.state.current,
|
|
79
|
+
total: _this3.props.children.length,
|
|
80
|
+
last: _this3.state.last,
|
|
81
|
+
onClick: function onClick(e) {
|
|
82
|
+
return _this3.cardClick(e, idx);
|
|
136
83
|
},
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
84
|
+
titleHeight: _this3.props.titleHeight,
|
|
85
|
+
theme: _this3.props.theme ? _this3.props.theme : 'dark'
|
|
86
|
+
}, /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(TitleComponent, {
|
|
87
|
+
title: child.props.title,
|
|
88
|
+
titleHeight: _this3.props.titleHeight
|
|
89
|
+
}), _this3.state.current === idx ? child : null));
|
|
90
|
+
}) : this.props.children.constructor === Object ? /*#__PURE__*/_react["default"].createElement(CardStack.Card, {
|
|
91
|
+
key: 'card',
|
|
92
|
+
className: this.state.current < 0 ? 'next' : this.state.current === 0 ? 'current' : 'previous',
|
|
93
|
+
count: 0,
|
|
94
|
+
current: this.state.current,
|
|
95
|
+
isStepform: this.props.isStepform,
|
|
96
|
+
total: 1,
|
|
97
|
+
last: this.state.last,
|
|
98
|
+
onClick: function onClick(e) {
|
|
99
|
+
return _this3.cardClick(e, 0);
|
|
100
|
+
},
|
|
101
|
+
titleHeight: this.props.titleHeight,
|
|
102
|
+
theme: this.props.theme ? this.props.theme : 'dark'
|
|
103
|
+
}, /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(TitleComponent, {
|
|
104
|
+
title: this.props.children.props.title,
|
|
105
|
+
titleHeight: this.props.titleHeight
|
|
106
|
+
}), this.state.current === 0 ? this.props.children : null)) : null);
|
|
148
107
|
}
|
|
149
108
|
}]);
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
}(_react2.default.Component);
|
|
153
|
-
|
|
154
|
-
CardStack.CardStackBox = _styledComponents2.default.div(_templateObject, function (props) {
|
|
109
|
+
}(_react["default"].Component);
|
|
110
|
+
CardStack.CardStackBox = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\nposition:relative;\npadding: 20px;\n//min-height:250px;\n > div{\n position:relative;\n min-height:100%;\n display: flex;\n &>div{\n //width:100%;\n transition: all 0.5s ease;\n position: relative;\n }\n\n\n\n &.current{\n &>div{\n .card-title{\n position:relative;//absolute;\n bottom:0px;\n width:100%;\n display:none;\n }\n }\n }\n &.next{ \n &>div{\n .card-title{\n position:relative;//absolute;\n bottom:0px;\n width:100%;\n //color:", "\n font-size: 16px;\n display: flex;\n align-items: flex-end;\n cursor: ", "\n }\n }\n }\n &.previous{ \n &>div{\n .card-title{\n position:relative;//absolute;\n top:0px;\n width:100%;\n //color: ", ";\n font-size: 16px;\n display: flex;\n align-items: flex-start;\n cursor: pointer;\n }\n }\n }\n }\nh1{\n font-size:20px;\n}\n\n\n"])), function (props) {
|
|
155
111
|
return _tokens.colors[props.theme].card.themeColor;
|
|
156
112
|
}, function (props) {
|
|
157
113
|
return props.isStepform ? 'not-allowed' : 'pointer';
|
|
158
114
|
}, function (props) {
|
|
159
115
|
return _tokens.colors[props.theme].card.themeColor;
|
|
160
116
|
});
|
|
161
|
-
CardStack.Card =
|
|
117
|
+
CardStack.Card = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n\n margin:0px auto;\n \n top: -", "px;\n\n width: 100%;\n\n &>div{\n background: #303f51; //", ";//#fff;\n //border:1px solid #fff;\n border-bottom: 0px;\n box-shadow: 0px 0px 18px 7px rgba(0,0,0,0.3); //0 0 6px 2px #dddddd;//2px 2px 2px 2px #8a8787;\n margin:0px auto;\n transition: all 0.5s;\n ", "\n }\n\n\n\n @keyframes up {\n 0%{\n transform: translate(0, 0);\n opacity:1;\n }\n \n 70% {\n transform: translate(0, -40px);\n opacity:1;\n }\n\n 99% {\n\n }\n 100% {\n transform: translate(0, 0);\n opacity:1;\n }\n \n }\n @keyframes down {\n 0%{\n transform: translate(0, 0);\n //opacity:0;\n }\n \n 70% {\n transform: translate(0, 40px);\n }\n\n 99% {\n\n }\n 100% {\n transform: translate(0, 0);\n opacity:1;\n }\n \n }\n\n \n\n\n"])), function (props) {
|
|
162
118
|
return props.count * (props.titleHeight + 40);
|
|
163
119
|
}, function (props) {
|
|
164
120
|
return _tokens.colors[props.theme].card.background;
|
|
@@ -171,22 +127,18 @@ CardStack.Card = _styledComponents2.default.div(_templateObject2, function (prop
|
|
|
171
127
|
return 'animation: ' + (props.last > props.current ? 'up' : 'down') + ' 0.25s 1;transform: translate(0, 0); width:100%; z-index:' + props.total + ';background:#162433';
|
|
172
128
|
}
|
|
173
129
|
});
|
|
174
|
-
|
|
175
130
|
CardStack.propTypes = {
|
|
176
131
|
/** The visual style used to convey the label's purpose */
|
|
177
|
-
theme:
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
current: _propTypes2.default.number
|
|
132
|
+
theme: _propTypes["default"].oneOf(['light', 'dark', 'nexc']),
|
|
133
|
+
titleHeight: _propTypes["default"].number,
|
|
134
|
+
current: _propTypes["default"].number
|
|
181
135
|
};
|
|
182
|
-
|
|
183
136
|
CardStack.Card.propTypes = {
|
|
184
137
|
/** The visual style used to convey the label's purpose */
|
|
185
|
-
theme:
|
|
186
|
-
isStepform:
|
|
187
|
-
titleHeight:
|
|
138
|
+
theme: _propTypes["default"].oneOf(['light', 'dark', 'nexc']),
|
|
139
|
+
isStepform: _propTypes["default"].bool,
|
|
140
|
+
titleHeight: _propTypes["default"].number
|
|
188
141
|
};
|
|
189
|
-
|
|
190
142
|
CardStack.defaultProps = {
|
|
191
143
|
titleHeight: 60,
|
|
192
144
|
theme: 'dark',
|
|
@@ -198,42 +150,31 @@ CardStack.Card.defaultProps = {
|
|
|
198
150
|
activeForms: [],
|
|
199
151
|
titleHeight: 60
|
|
200
152
|
};
|
|
201
|
-
|
|
202
|
-
var TitleComponent = function (_React$Component2) {
|
|
203
|
-
_inherits(TitleComponent, _React$Component2);
|
|
204
|
-
|
|
153
|
+
var TitleComponent = /*#__PURE__*/function (_React$Component2) {
|
|
205
154
|
function TitleComponent(props) {
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
return _possibleConstructorReturn(this, (TitleComponent.__proto__ || Object.getPrototypeOf(TitleComponent)).call(this, props));
|
|
155
|
+
(0, _classCallCheck2["default"])(this, TitleComponent);
|
|
156
|
+
return _callSuper(this, TitleComponent, [props]);
|
|
209
157
|
}
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
key:
|
|
158
|
+
(0, _inherits2["default"])(TitleComponent, _React$Component2);
|
|
159
|
+
return (0, _createClass2["default"])(TitleComponent, [{
|
|
160
|
+
key: "render",
|
|
213
161
|
value: function render() {
|
|
214
162
|
var title = '';
|
|
215
163
|
if (this.props.title) {
|
|
216
164
|
if (typeof this.props.title == 'string') {
|
|
217
|
-
title =
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
);
|
|
165
|
+
title = /*#__PURE__*/_react["default"].createElement(CardStack.TitleBox, {
|
|
166
|
+
titleHeight: this.props.titleHeight,
|
|
167
|
+
className: "card-title"
|
|
168
|
+
}, this.props.title);
|
|
222
169
|
} else {
|
|
223
170
|
title = this.props.title;
|
|
224
171
|
}
|
|
225
172
|
}
|
|
226
|
-
|
|
227
173
|
return title;
|
|
228
174
|
}
|
|
229
175
|
}]);
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
}(_react2.default.Component);
|
|
233
|
-
|
|
234
|
-
CardStack.TitleBox = _styledComponents2.default.div(_templateObject3, function (props) {
|
|
176
|
+
}(_react["default"].Component);
|
|
177
|
+
CardStack.TitleBox = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n height: ", "px;\n"])), function (props) {
|
|
235
178
|
return props.titleHeight + 100;
|
|
236
179
|
});
|
|
237
|
-
|
|
238
|
-
exports.default = CardStack;
|
|
239
|
-
//export {CardStackBox}
|
|
180
|
+
var _default = exports["default"] = CardStack; //export {CardStackBox}
|