@elliemae/ds-ribbon 1.57.1-rc.0 → 2.0.0-alpha.11
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/cjs/DSRibbon.js +71 -72
- package/cjs/index.js +1 -5
- package/esm/DSRibbon.js +68 -70
- package/esm/index.js +0 -4
- package/package.json +33 -11
- package/types/DSRibbon.d.ts +52 -0
- package/types/index.d.ts +1 -0
- package/DSRibbon/package.json +0 -10
- package/cjs/DSRibbon.js.map +0 -1
- package/cjs/index.js.map +0 -1
- package/esm/DSRibbon.js.map +0 -1
- package/esm/index.js.map +0 -1
package/cjs/DSRibbon.js
CHANGED
|
@@ -2,42 +2,48 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
6
|
+
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
7
|
+
require('react');
|
|
6
8
|
var reactDesc = require('react-desc');
|
|
7
9
|
var styled = require('styled-components');
|
|
10
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
8
11
|
|
|
9
12
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
13
|
|
|
11
|
-
var
|
|
14
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
15
|
+
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
12
16
|
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
13
17
|
|
|
14
|
-
|
|
15
|
-
|
|
18
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
19
|
+
|
|
20
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
21
|
+
const RibbonRow = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
16
22
|
componentId: "sc-9boes5-0"
|
|
17
|
-
})(["width:100%;display:flex;flex-direction:row;align-items:center;min-height:4rem;@media screen and (-ms-high-contrast:active),(-ms-high-contrast:none){height:5rem;overflow-y:hidden;}flex-wrap:nowrap;overflow-x:auto;", ";", ";"],
|
|
23
|
+
})(["width:100%;display:flex;flex-direction:row;align-items:center;min-height:4rem;@media screen and (-ms-high-contrast:active),(-ms-high-contrast:none){height:5rem;overflow-y:hidden;}flex-wrap:nowrap;overflow-x:auto;", ";", ";"], props => {
|
|
18
24
|
if (props.alignLeft) {
|
|
19
25
|
return "\n align-items: stretch;\n & > ".concat(RibbonCol, " {\n align-items: flex-start;\n align-self: stretch; \n flex: 0;\n @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {\n flex: 1;\n }\n ");
|
|
20
26
|
}
|
|
21
27
|
|
|
22
28
|
return "\n // flex:1;\n align-items: center;\n ";
|
|
23
|
-
},
|
|
29
|
+
}, props => {
|
|
24
30
|
if (props.solid) {
|
|
25
31
|
return "\n & > ".concat(RibbonCol, " {\n &:after{\n top: 0%;\n height: 100%;\n border-right: solid 1px #CBCFD7;\n }\n ");
|
|
26
32
|
}
|
|
27
33
|
|
|
28
34
|
return '';
|
|
29
35
|
});
|
|
30
|
-
|
|
36
|
+
const RibbonCol = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
31
37
|
componentId: "sc-9boes5-1"
|
|
32
38
|
})(["display:flex;flex-direction:column;padding:0.25rem 0.5rem;height:100%;justify-content:center;flex:1;position:relative;&:after{position:absolute;top:10%;right:0;height:80%;content:'';border-right:dashed 1px #ebedf0;}& > ", "{align-items:flex-start;}"], RibbonRow);
|
|
33
|
-
|
|
39
|
+
const RibbonWrapper = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
34
40
|
componentId: "sc-9boes5-2"
|
|
35
41
|
})(["width:100%;display:flex;flex-direction:column;padding:0.62rem 1.22rem;border-bottom:solid 1px #cfcfd7;background:#fff;& > ", "{border-bottom:solid 1px #ebedf0;width:auto;&:last-child{border:none;}& > ", "{&:last-child{&:after{display:none;}}}}"], RibbonRow, RibbonCol);
|
|
36
42
|
/* eslint-disable indent */
|
|
37
43
|
|
|
38
|
-
|
|
44
|
+
const RibbonBlockIcon = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
39
45
|
componentId: "sc-9boes5-3"
|
|
40
|
-
})(["padding-right:0.5rem;padding-top:0.1rem;svg,svg:not([fill]){fill:", ";}"],
|
|
46
|
+
})(["padding-right:0.5rem;padding-top:0.1rem;svg,svg:not([fill]){fill:", ";}"], props => {
|
|
41
47
|
if (props.info) return '#1e79c2';
|
|
42
48
|
if (props.error) return '#E34256';
|
|
43
49
|
if (props.warning) return '#FBB431';
|
|
@@ -46,95 +52,90 @@ var RibbonBlockIcon = /*#__PURE__*/styled__default['default'].div.withConfig({
|
|
|
46
52
|
});
|
|
47
53
|
/* eslint-enable indent */
|
|
48
54
|
|
|
49
|
-
|
|
55
|
+
const RibbonBlockLabel = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
50
56
|
componentId: "sc-9boes5-4"
|
|
51
57
|
})(["padding:0.25rem 0.5rem;color:#697489;font-size:0.9rem;line-height:1.2rem;"]);
|
|
52
|
-
|
|
58
|
+
const RibbonBlockValue = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
53
59
|
componentId: "sc-9boes5-5"
|
|
54
60
|
})(["flex:2;font-weight:bold;padding:0.25rem 0.5rem 0.25rem 0rem;font-size:1.1rem;color:#333333;flex-wrap:nowrap;white-space:nowrap;"]);
|
|
55
|
-
|
|
61
|
+
const RibbonBlockValueLabel = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
56
62
|
componentId: "sc-9boes5-6"
|
|
57
63
|
})(["flex:2;padding:0.25rem 0.5rem 0.25rem 0rem;font-size:0.9rem;color:#697489;flex-wrap:nowrap;white-space:nowrap;"]);
|
|
58
|
-
|
|
64
|
+
const RibbonBlockCol = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
59
65
|
componentId: "sc-9boes5-7"
|
|
60
|
-
})(["display:flex;flex-direction:column;flex:2;flex-wrap:nowrap;align-items:", ";height:100%;"],
|
|
66
|
+
})(["display:flex;flex-direction:column;flex:2;flex-wrap:nowrap;align-items:", ";height:100%;"], props => {
|
|
61
67
|
if (props.center) return 'center';
|
|
62
68
|
return '';
|
|
63
69
|
});
|
|
64
|
-
|
|
70
|
+
const RibbonBlockRow = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
65
71
|
componentId: "sc-9boes5-8"
|
|
66
|
-
})(["display:flex;flex-direction:row;flex-wrap:nowrap;flex:1;height:100%;align-items:", ";"],
|
|
72
|
+
})(["display:flex;flex-direction:row;flex-wrap:nowrap;flex:1;height:100%;align-items:", ";"], props => {
|
|
67
73
|
if (props.center) return 'center';
|
|
68
74
|
return '';
|
|
69
75
|
});
|
|
70
|
-
|
|
76
|
+
const RibbonBlock = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
71
77
|
componentId: "sc-9boes5-9"
|
|
72
78
|
})(["flex:1;height:100%;"]);
|
|
73
79
|
|
|
74
|
-
function RibbonCard(
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
_ref$warning = _ref.warning,
|
|
92
|
-
warning = _ref$warning === void 0 ? false : _ref$warning,
|
|
93
|
-
_ref$success = _ref.success,
|
|
94
|
-
success = _ref$success === void 0 ? false : _ref$success,
|
|
95
|
-
_ref$center = _ref.center,
|
|
96
|
-
center = _ref$center === void 0 ? false : _ref$center,
|
|
97
|
-
_ref$solid = _ref.solid,
|
|
98
|
-
solid = _ref$solid === void 0 ? false : _ref$solid;
|
|
99
|
-
var labelPlace = icon ? /*#__PURE__*/React__default['default'].createElement(RibbonBlockIcon, {
|
|
80
|
+
function RibbonCard({
|
|
81
|
+
containerProps = {},
|
|
82
|
+
icon = null,
|
|
83
|
+
label = '',
|
|
84
|
+
value = '',
|
|
85
|
+
additionalValue = '',
|
|
86
|
+
additionalLabel = '',
|
|
87
|
+
info = false,
|
|
88
|
+
error = false,
|
|
89
|
+
warning = false,
|
|
90
|
+
success = false,
|
|
91
|
+
center = false,
|
|
92
|
+
solid = false
|
|
93
|
+
}) {
|
|
94
|
+
var _RibbonBlockValue;
|
|
95
|
+
|
|
96
|
+
const labelPlace = icon ? /*#__PURE__*/_jsx__default["default"](RibbonBlockIcon, {
|
|
100
97
|
error: error,
|
|
101
98
|
info: info,
|
|
102
99
|
success: success,
|
|
103
100
|
warning: warning
|
|
104
|
-
}, icon) : /*#__PURE__*/
|
|
101
|
+
}, void 0, icon) : /*#__PURE__*/_jsx__default["default"](RibbonBlockLabel, {}, void 0, label);
|
|
105
102
|
|
|
106
103
|
if (additionalValue || additionalLabel) {
|
|
107
|
-
|
|
104
|
+
let additionalInformation;
|
|
108
105
|
|
|
109
106
|
if (additionalValue) {
|
|
110
|
-
additionalInformation = additionalValue && /*#__PURE__*/
|
|
107
|
+
additionalInformation = additionalValue && /*#__PURE__*/_jsx__default["default"](RibbonBlockValue, {}, void 0, additionalValue);
|
|
111
108
|
} else if (additionalLabel) {
|
|
112
|
-
additionalInformation = additionalLabel && /*#__PURE__*/
|
|
109
|
+
additionalInformation = additionalLabel && /*#__PURE__*/_jsx__default["default"](RibbonBlockValueLabel, {}, void 0, additionalLabel);
|
|
113
110
|
}
|
|
114
111
|
|
|
115
|
-
return /*#__PURE__*/
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
112
|
+
return /*#__PURE__*/jsxRuntime.jsx(RibbonBlock, _objectSpread(_objectSpread({}, containerProps), {}, {
|
|
113
|
+
children: /*#__PURE__*/_jsx__default["default"](RibbonBlockRow, {
|
|
114
|
+
className: "ribbon-block-row",
|
|
115
|
+
solid: solid,
|
|
116
|
+
style: {
|
|
117
|
+
alignItems: 'flex-start'
|
|
118
|
+
}
|
|
119
|
+
}, void 0, labelPlace, /*#__PURE__*/_jsx__default["default"](RibbonBlockCol, {
|
|
120
|
+
center: center,
|
|
121
|
+
className: "ribbon-block-col"
|
|
122
|
+
}, void 0, _RibbonBlockValue || (_RibbonBlockValue = /*#__PURE__*/_jsx__default["default"](RibbonBlockValue, {}, void 0, value)), additionalInformation))
|
|
123
|
+
}));
|
|
125
124
|
}
|
|
126
125
|
|
|
127
|
-
return /*#__PURE__*/
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
126
|
+
return /*#__PURE__*/jsxRuntime.jsx(RibbonBlock, _objectSpread(_objectSpread({}, containerProps), {}, {
|
|
127
|
+
children: /*#__PURE__*/_jsx__default["default"](RibbonBlockRow, {
|
|
128
|
+
center: center,
|
|
129
|
+
solid: solid
|
|
130
|
+
}, void 0, labelPlace, /*#__PURE__*/_jsx__default["default"](RibbonBlockValue, {}, void 0, value))
|
|
131
|
+
}));
|
|
131
132
|
}
|
|
132
133
|
|
|
133
|
-
|
|
134
|
-
RibbonWrapper
|
|
135
|
-
RibbonRow
|
|
136
|
-
RibbonCol
|
|
137
|
-
RibbonCard
|
|
134
|
+
const DSRibbon = {
|
|
135
|
+
RibbonWrapper,
|
|
136
|
+
RibbonRow,
|
|
137
|
+
RibbonCol,
|
|
138
|
+
RibbonCard
|
|
138
139
|
};
|
|
139
140
|
RibbonWrapper.propTypes = {};
|
|
140
141
|
RibbonRow.propTypes = {
|
|
@@ -142,7 +143,7 @@ RibbonRow.propTypes = {
|
|
|
142
143
|
alignLeft: reactDesc.PropTypes.bool.description('align left')
|
|
143
144
|
};
|
|
144
145
|
RibbonCol.propTypes = {};
|
|
145
|
-
|
|
146
|
+
const cardprops = {
|
|
146
147
|
/** props to inject to wrapper */
|
|
147
148
|
containerProps: reactDesc.PropTypes.object.description('props to inject to wrapper'),
|
|
148
149
|
|
|
@@ -179,10 +180,8 @@ var cardprops = {
|
|
|
179
180
|
/** solid style */
|
|
180
181
|
solid: reactDesc.PropTypes.bool.description('solid style')
|
|
181
182
|
};
|
|
182
|
-
|
|
183
|
-
var DSRibbonCardWithSchema = reactDesc.describe(RibbonCard);
|
|
183
|
+
const DSRibbonCardWithSchema = reactDesc.describe(RibbonCard);
|
|
184
184
|
DSRibbonCardWithSchema.propTypes = cardprops;
|
|
185
185
|
|
|
186
186
|
exports.DSRibbonCardWithSchema = DSRibbonCardWithSchema;
|
|
187
|
-
exports[
|
|
188
|
-
//# sourceMappingURL=DSRibbon.js.map
|
|
187
|
+
exports["default"] = DSRibbon;
|
package/cjs/index.js
CHANGED
|
@@ -3,12 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var DSRibbon = require('./DSRibbon.js');
|
|
6
|
-
require('react');
|
|
7
|
-
require('react-desc');
|
|
8
|
-
require('styled-components');
|
|
9
6
|
|
|
10
7
|
|
|
11
8
|
|
|
12
9
|
exports.DSRibbonCardWithSchema = DSRibbon.DSRibbonCardWithSchema;
|
|
13
|
-
exports
|
|
14
|
-
//# sourceMappingURL=index.js.map
|
|
10
|
+
exports["default"] = DSRibbon["default"];
|
package/esm/DSRibbon.js
CHANGED
|
@@ -1,34 +1,39 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
3
|
+
import 'react';
|
|
2
4
|
import { PropTypes, describe } from 'react-desc';
|
|
3
5
|
import styled from 'styled-components';
|
|
6
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
7
|
|
|
5
|
-
|
|
6
|
-
|
|
8
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
9
|
+
|
|
10
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
11
|
+
const RibbonRow = /*#__PURE__*/styled.div.withConfig({
|
|
7
12
|
componentId: "sc-9boes5-0"
|
|
8
|
-
})(["width:100%;display:flex;flex-direction:row;align-items:center;min-height:4rem;@media screen and (-ms-high-contrast:active),(-ms-high-contrast:none){height:5rem;overflow-y:hidden;}flex-wrap:nowrap;overflow-x:auto;", ";", ";"],
|
|
13
|
+
})(["width:100%;display:flex;flex-direction:row;align-items:center;min-height:4rem;@media screen and (-ms-high-contrast:active),(-ms-high-contrast:none){height:5rem;overflow-y:hidden;}flex-wrap:nowrap;overflow-x:auto;", ";", ";"], props => {
|
|
9
14
|
if (props.alignLeft) {
|
|
10
15
|
return "\n align-items: stretch;\n & > ".concat(RibbonCol, " {\n align-items: flex-start;\n align-self: stretch; \n flex: 0;\n @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {\n flex: 1;\n }\n ");
|
|
11
16
|
}
|
|
12
17
|
|
|
13
18
|
return "\n // flex:1;\n align-items: center;\n ";
|
|
14
|
-
},
|
|
19
|
+
}, props => {
|
|
15
20
|
if (props.solid) {
|
|
16
21
|
return "\n & > ".concat(RibbonCol, " {\n &:after{\n top: 0%;\n height: 100%;\n border-right: solid 1px #CBCFD7;\n }\n ");
|
|
17
22
|
}
|
|
18
23
|
|
|
19
24
|
return '';
|
|
20
25
|
});
|
|
21
|
-
|
|
26
|
+
const RibbonCol = /*#__PURE__*/styled.div.withConfig({
|
|
22
27
|
componentId: "sc-9boes5-1"
|
|
23
28
|
})(["display:flex;flex-direction:column;padding:0.25rem 0.5rem;height:100%;justify-content:center;flex:1;position:relative;&:after{position:absolute;top:10%;right:0;height:80%;content:'';border-right:dashed 1px #ebedf0;}& > ", "{align-items:flex-start;}"], RibbonRow);
|
|
24
|
-
|
|
29
|
+
const RibbonWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
25
30
|
componentId: "sc-9boes5-2"
|
|
26
31
|
})(["width:100%;display:flex;flex-direction:column;padding:0.62rem 1.22rem;border-bottom:solid 1px #cfcfd7;background:#fff;& > ", "{border-bottom:solid 1px #ebedf0;width:auto;&:last-child{border:none;}& > ", "{&:last-child{&:after{display:none;}}}}"], RibbonRow, RibbonCol);
|
|
27
32
|
/* eslint-disable indent */
|
|
28
33
|
|
|
29
|
-
|
|
34
|
+
const RibbonBlockIcon = /*#__PURE__*/styled.div.withConfig({
|
|
30
35
|
componentId: "sc-9boes5-3"
|
|
31
|
-
})(["padding-right:0.5rem;padding-top:0.1rem;svg,svg:not([fill]){fill:", ";}"],
|
|
36
|
+
})(["padding-right:0.5rem;padding-top:0.1rem;svg,svg:not([fill]){fill:", ";}"], props => {
|
|
32
37
|
if (props.info) return '#1e79c2';
|
|
33
38
|
if (props.error) return '#E34256';
|
|
34
39
|
if (props.warning) return '#FBB431';
|
|
@@ -37,95 +42,90 @@ var RibbonBlockIcon = /*#__PURE__*/styled.div.withConfig({
|
|
|
37
42
|
});
|
|
38
43
|
/* eslint-enable indent */
|
|
39
44
|
|
|
40
|
-
|
|
45
|
+
const RibbonBlockLabel = /*#__PURE__*/styled.div.withConfig({
|
|
41
46
|
componentId: "sc-9boes5-4"
|
|
42
47
|
})(["padding:0.25rem 0.5rem;color:#697489;font-size:0.9rem;line-height:1.2rem;"]);
|
|
43
|
-
|
|
48
|
+
const RibbonBlockValue = /*#__PURE__*/styled.div.withConfig({
|
|
44
49
|
componentId: "sc-9boes5-5"
|
|
45
50
|
})(["flex:2;font-weight:bold;padding:0.25rem 0.5rem 0.25rem 0rem;font-size:1.1rem;color:#333333;flex-wrap:nowrap;white-space:nowrap;"]);
|
|
46
|
-
|
|
51
|
+
const RibbonBlockValueLabel = /*#__PURE__*/styled.div.withConfig({
|
|
47
52
|
componentId: "sc-9boes5-6"
|
|
48
53
|
})(["flex:2;padding:0.25rem 0.5rem 0.25rem 0rem;font-size:0.9rem;color:#697489;flex-wrap:nowrap;white-space:nowrap;"]);
|
|
49
|
-
|
|
54
|
+
const RibbonBlockCol = /*#__PURE__*/styled.div.withConfig({
|
|
50
55
|
componentId: "sc-9boes5-7"
|
|
51
|
-
})(["display:flex;flex-direction:column;flex:2;flex-wrap:nowrap;align-items:", ";height:100%;"],
|
|
56
|
+
})(["display:flex;flex-direction:column;flex:2;flex-wrap:nowrap;align-items:", ";height:100%;"], props => {
|
|
52
57
|
if (props.center) return 'center';
|
|
53
58
|
return '';
|
|
54
59
|
});
|
|
55
|
-
|
|
60
|
+
const RibbonBlockRow = /*#__PURE__*/styled.div.withConfig({
|
|
56
61
|
componentId: "sc-9boes5-8"
|
|
57
|
-
})(["display:flex;flex-direction:row;flex-wrap:nowrap;flex:1;height:100%;align-items:", ";"],
|
|
62
|
+
})(["display:flex;flex-direction:row;flex-wrap:nowrap;flex:1;height:100%;align-items:", ";"], props => {
|
|
58
63
|
if (props.center) return 'center';
|
|
59
64
|
return '';
|
|
60
65
|
});
|
|
61
|
-
|
|
66
|
+
const RibbonBlock = /*#__PURE__*/styled.div.withConfig({
|
|
62
67
|
componentId: "sc-9boes5-9"
|
|
63
68
|
})(["flex:1;height:100%;"]);
|
|
64
69
|
|
|
65
|
-
function RibbonCard(
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
_ref$warning = _ref.warning,
|
|
83
|
-
warning = _ref$warning === void 0 ? false : _ref$warning,
|
|
84
|
-
_ref$success = _ref.success,
|
|
85
|
-
success = _ref$success === void 0 ? false : _ref$success,
|
|
86
|
-
_ref$center = _ref.center,
|
|
87
|
-
center = _ref$center === void 0 ? false : _ref$center,
|
|
88
|
-
_ref$solid = _ref.solid,
|
|
89
|
-
solid = _ref$solid === void 0 ? false : _ref$solid;
|
|
90
|
-
var labelPlace = icon ? /*#__PURE__*/React.createElement(RibbonBlockIcon, {
|
|
70
|
+
function RibbonCard({
|
|
71
|
+
containerProps = {},
|
|
72
|
+
icon = null,
|
|
73
|
+
label = '',
|
|
74
|
+
value = '',
|
|
75
|
+
additionalValue = '',
|
|
76
|
+
additionalLabel = '',
|
|
77
|
+
info = false,
|
|
78
|
+
error = false,
|
|
79
|
+
warning = false,
|
|
80
|
+
success = false,
|
|
81
|
+
center = false,
|
|
82
|
+
solid = false
|
|
83
|
+
}) {
|
|
84
|
+
var _RibbonBlockValue;
|
|
85
|
+
|
|
86
|
+
const labelPlace = icon ? /*#__PURE__*/_jsx(RibbonBlockIcon, {
|
|
91
87
|
error: error,
|
|
92
88
|
info: info,
|
|
93
89
|
success: success,
|
|
94
90
|
warning: warning
|
|
95
|
-
}, icon) : /*#__PURE__*/
|
|
91
|
+
}, void 0, icon) : /*#__PURE__*/_jsx(RibbonBlockLabel, {}, void 0, label);
|
|
96
92
|
|
|
97
93
|
if (additionalValue || additionalLabel) {
|
|
98
|
-
|
|
94
|
+
let additionalInformation;
|
|
99
95
|
|
|
100
96
|
if (additionalValue) {
|
|
101
|
-
additionalInformation = additionalValue && /*#__PURE__*/
|
|
97
|
+
additionalInformation = additionalValue && /*#__PURE__*/_jsx(RibbonBlockValue, {}, void 0, additionalValue);
|
|
102
98
|
} else if (additionalLabel) {
|
|
103
|
-
additionalInformation = additionalLabel && /*#__PURE__*/
|
|
99
|
+
additionalInformation = additionalLabel && /*#__PURE__*/_jsx(RibbonBlockValueLabel, {}, void 0, additionalLabel);
|
|
104
100
|
}
|
|
105
101
|
|
|
106
|
-
return /*#__PURE__*/
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
102
|
+
return /*#__PURE__*/jsx(RibbonBlock, _objectSpread(_objectSpread({}, containerProps), {}, {
|
|
103
|
+
children: /*#__PURE__*/_jsx(RibbonBlockRow, {
|
|
104
|
+
className: "ribbon-block-row",
|
|
105
|
+
solid: solid,
|
|
106
|
+
style: {
|
|
107
|
+
alignItems: 'flex-start'
|
|
108
|
+
}
|
|
109
|
+
}, void 0, labelPlace, /*#__PURE__*/_jsx(RibbonBlockCol, {
|
|
110
|
+
center: center,
|
|
111
|
+
className: "ribbon-block-col"
|
|
112
|
+
}, void 0, _RibbonBlockValue || (_RibbonBlockValue = /*#__PURE__*/_jsx(RibbonBlockValue, {}, void 0, value)), additionalInformation))
|
|
113
|
+
}));
|
|
116
114
|
}
|
|
117
115
|
|
|
118
|
-
return /*#__PURE__*/
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
116
|
+
return /*#__PURE__*/jsx(RibbonBlock, _objectSpread(_objectSpread({}, containerProps), {}, {
|
|
117
|
+
children: /*#__PURE__*/_jsx(RibbonBlockRow, {
|
|
118
|
+
center: center,
|
|
119
|
+
solid: solid
|
|
120
|
+
}, void 0, labelPlace, /*#__PURE__*/_jsx(RibbonBlockValue, {}, void 0, value))
|
|
121
|
+
}));
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
-
|
|
125
|
-
RibbonWrapper
|
|
126
|
-
RibbonRow
|
|
127
|
-
RibbonCol
|
|
128
|
-
RibbonCard
|
|
124
|
+
const DSRibbon = {
|
|
125
|
+
RibbonWrapper,
|
|
126
|
+
RibbonRow,
|
|
127
|
+
RibbonCol,
|
|
128
|
+
RibbonCard
|
|
129
129
|
};
|
|
130
130
|
RibbonWrapper.propTypes = {};
|
|
131
131
|
RibbonRow.propTypes = {
|
|
@@ -133,7 +133,7 @@ RibbonRow.propTypes = {
|
|
|
133
133
|
alignLeft: PropTypes.bool.description('align left')
|
|
134
134
|
};
|
|
135
135
|
RibbonCol.propTypes = {};
|
|
136
|
-
|
|
136
|
+
const cardprops = {
|
|
137
137
|
/** props to inject to wrapper */
|
|
138
138
|
containerProps: PropTypes.object.description('props to inject to wrapper'),
|
|
139
139
|
|
|
@@ -170,9 +170,7 @@ var cardprops = {
|
|
|
170
170
|
/** solid style */
|
|
171
171
|
solid: PropTypes.bool.description('solid style')
|
|
172
172
|
};
|
|
173
|
-
|
|
174
|
-
var DSRibbonCardWithSchema = describe(RibbonCard);
|
|
173
|
+
const DSRibbonCardWithSchema = describe(RibbonCard);
|
|
175
174
|
DSRibbonCardWithSchema.propTypes = cardprops;
|
|
176
175
|
|
|
177
176
|
export { DSRibbonCardWithSchema, DSRibbon as default };
|
|
178
|
-
//# sourceMappingURL=DSRibbon.js.map
|
package/esm/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,14 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-ribbon",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-alpha.11",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"description": "
|
|
6
|
-
"
|
|
7
|
-
"
|
|
5
|
+
"description": "ICE MT - Dimsum - Ribbon",
|
|
6
|
+
"module": "./esm/index.js",
|
|
7
|
+
"main": "./cjs/index.js",
|
|
8
|
+
"types": "./types/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./esm/index.js",
|
|
12
|
+
"require": "./cjs/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./DSRibbon": {
|
|
15
|
+
"import": "./esm/DSRibbon.js",
|
|
16
|
+
"require": "./cjs/DSRibbon.js"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
8
19
|
"sideEffects": [
|
|
9
20
|
"*.css",
|
|
10
21
|
"*.scss"
|
|
11
22
|
],
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "https://git.elliemae.io/platform-ui/dimsum.git"
|
|
26
|
+
},
|
|
27
|
+
"engines": {
|
|
28
|
+
"npm": ">=7",
|
|
29
|
+
"node": ">=14"
|
|
30
|
+
},
|
|
31
|
+
"author": "ICE MT",
|
|
12
32
|
"scripts": {
|
|
13
33
|
"dev": "cross-env NODE_ENV=development && node ../../scripts/build/build.js -w",
|
|
14
34
|
"prebuild": "exit 0",
|
|
@@ -16,19 +36,21 @@
|
|
|
16
36
|
"build": "node ../../scripts/build/build.js"
|
|
17
37
|
},
|
|
18
38
|
"dependencies": {
|
|
19
|
-
"
|
|
39
|
+
"@elliemae/ds-basic": "2.0.0-alpha.11",
|
|
40
|
+
"@elliemae/ds-classnames": "2.0.0-alpha.11"
|
|
20
41
|
},
|
|
21
42
|
"devDependencies": {
|
|
22
|
-
"styled-components": "~5.3.
|
|
43
|
+
"styled-components": "~5.3.1"
|
|
23
44
|
},
|
|
24
45
|
"peerDependencies": {
|
|
25
|
-
"lodash": "^4.17.
|
|
26
|
-
"react": "~17.0.
|
|
27
|
-
"react-dom": "^17.0.
|
|
28
|
-
"styled-components": "^5.3.
|
|
46
|
+
"lodash": "^4.17.21",
|
|
47
|
+
"react": "~17.0.2",
|
|
48
|
+
"react-dom": "^17.0.2",
|
|
49
|
+
"styled-components": "^5.3.1"
|
|
29
50
|
},
|
|
30
51
|
"publishConfig": {
|
|
31
52
|
"access": "public",
|
|
32
|
-
"directory": "dist"
|
|
53
|
+
"directory": "dist",
|
|
54
|
+
"generateSubmodules": true
|
|
33
55
|
}
|
|
34
56
|
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare function RibbonCard({ containerProps, icon, label, value, additionalValue, additionalLabel, info, error, warning, success, center, solid, }: {
|
|
3
|
+
containerProps?: {} | undefined;
|
|
4
|
+
icon?: null | undefined;
|
|
5
|
+
label?: string | undefined;
|
|
6
|
+
value?: string | undefined;
|
|
7
|
+
additionalValue?: string | undefined;
|
|
8
|
+
additionalLabel?: string | undefined;
|
|
9
|
+
info?: boolean | undefined;
|
|
10
|
+
error?: boolean | undefined;
|
|
11
|
+
warning?: boolean | undefined;
|
|
12
|
+
success?: boolean | undefined;
|
|
13
|
+
center?: boolean | undefined;
|
|
14
|
+
solid?: boolean | undefined;
|
|
15
|
+
}): JSX.Element;
|
|
16
|
+
declare namespace RibbonCard {
|
|
17
|
+
var propTypes: {
|
|
18
|
+
/** props to inject to wrapper */
|
|
19
|
+
containerProps: any;
|
|
20
|
+
/** icon for ribbon card */
|
|
21
|
+
icon: any;
|
|
22
|
+
/** label for ribbon card */
|
|
23
|
+
label: any;
|
|
24
|
+
/** value for ribbon */
|
|
25
|
+
value: any;
|
|
26
|
+
/** additional value */
|
|
27
|
+
additionalValue: any;
|
|
28
|
+
/** additional label */
|
|
29
|
+
additionalLabel: any;
|
|
30
|
+
/** for main label */
|
|
31
|
+
info: any;
|
|
32
|
+
/** error state toggle */
|
|
33
|
+
error: any;
|
|
34
|
+
/** warning state toggle */
|
|
35
|
+
warning: any;
|
|
36
|
+
/** success state toggle */
|
|
37
|
+
success: any;
|
|
38
|
+
/** align center */
|
|
39
|
+
center: any;
|
|
40
|
+
/** solid style */
|
|
41
|
+
solid: any;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
declare const DSRibbon: {
|
|
45
|
+
RibbonWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
46
|
+
RibbonRow: any;
|
|
47
|
+
RibbonCol: any;
|
|
48
|
+
RibbonCard: typeof RibbonCard;
|
|
49
|
+
};
|
|
50
|
+
declare const DSRibbonCardWithSchema: any;
|
|
51
|
+
export default DSRibbon;
|
|
52
|
+
export { DSRibbonCardWithSchema };
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default, DSRibbonCardWithSchema } from './DSRibbon';
|
package/DSRibbon/package.json
DELETED
package/cjs/DSRibbon.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DSRibbon.js","sources":["../../src/DSRibbon.tsx"],"sourcesContent":["/* eslint-disable max-lines */\n/* eslint-disable no-use-before-define */\n/* eslint-disable no-confusing-arrow */\nimport React from 'react';\nimport { PropTypes, describe } from 'react-desc';\nimport styled from 'styled-components';\n\nconst RibbonRow = styled.div`\n width: 100%;\n display: flex;\n flex-direction: row;\n align-items: center;\n min-height: 4rem;\n @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {\n height: 5rem;\n overflow-y: hidden;\n }\n flex-wrap: nowrap;\n overflow-x: auto;\n ${(props) => {\n if (props.alignLeft) {\n return `\n align-items: stretch;\n & > ${RibbonCol} {\n align-items: flex-start;\n align-self: stretch; \n flex: 0;\n @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {\n flex: 1;\n }\n `;\n }\n return `\n // flex:1;\n align-items: center;\n `;\n }};\n ${(props) => {\n if (props.solid) {\n return `\n & > ${RibbonCol} {\n &:after{\n top: 0%;\n height: 100%;\n border-right: solid 1px #CBCFD7;\n }\n `;\n }\n return '';\n }};\n`;\n\nconst RibbonCol = styled.div`\n display: flex;\n flex-direction: column;\n padding: 0.25rem 0.5rem;\n height: 100%;\n justify-content: center;\n flex: 1;\n position: relative;\n &:after {\n position: absolute;\n top: 10%;\n right: 0;\n height: 80%;\n content: '';\n border-right: dashed 1px #ebedf0;\n }\n & > ${RibbonRow} {\n align-items: flex-start;\n }\n`;\n\nconst RibbonWrapper = styled.div`\n width: 100%;\n display: flex;\n flex-direction: column;\n padding: 0.62rem 1.22rem;\n border-bottom: solid 1px #cfcfd7;\n background: #fff;\n & > ${RibbonRow} {\n border-bottom: solid 1px #ebedf0;\n width: auto;\n &:last-child {\n border: none;\n }\n & > ${RibbonCol} {\n &:last-child {\n &:after {\n display: none;\n }\n }\n }\n }\n`;\n\n/* eslint-disable indent */\nconst RibbonBlockIcon = styled.div`\n padding-right: 0.5rem;\n padding-top: 0.1rem;\n svg,\n svg:not([fill]) {\n fill: ${(props) => {\n if (props.info) return '#1e79c2';\n if (props.error) return '#E34256';\n if (props.warning) return '#FBB431';\n if (props.success) return '#32B87C';\n return '#1e79c2';\n }};\n }\n`;\n/* eslint-enable indent */\n\nconst RibbonBlockLabel = styled.div`\n padding: 0.25rem 0.5rem;\n color: #697489;\n font-size: 0.9rem;\n line-height: 1.2rem;\n`;\nconst RibbonBlockValue = styled.div`\n flex: 2;\n font-weight: bold;\n padding: 0.25rem 0.5rem 0.25rem 0rem;\n font-size: 1.1rem;\n color: #333333;\n flex-wrap: nowrap;\n white-space: nowrap;\n`;\nconst RibbonBlockValueLabel = styled.div`\n flex: 2;\n padding: 0.25rem 0.5rem 0.25rem 0rem;\n font-size: 0.9rem;\n color: #697489;\n flex-wrap: nowrap;\n white-space: nowrap;\n`;\n\nconst RibbonBlockCol = styled.div`\n display: flex;\n flex-direction: column;\n flex: 2;\n flex-wrap: nowrap;\n align-items: ${(props) => {\n if (props.center) return 'center';\n return '';\n }};\n height: 100%;\n`;\nconst RibbonBlockRow = styled.div`\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n flex: 1;\n height: 100%;\n align-items: ${(props) => {\n if (props.center) return 'center';\n return '';\n }};\n`;\nconst RibbonBlock = styled.div`\n flex: 1;\n height: 100%;\n`;\n\nfunction RibbonCard({\n containerProps = {},\n icon = null,\n label = '',\n value = '',\n additionalValue = '',\n additionalLabel = '',\n info = false,\n error = false,\n warning = false,\n success = false,\n center = false,\n solid = false,\n}) {\n const labelPlace = icon ? (\n <RibbonBlockIcon\n error={error}\n info={info}\n success={success}\n warning={warning}\n >\n {icon}\n </RibbonBlockIcon>\n ) : (\n <RibbonBlockLabel>{label}</RibbonBlockLabel>\n );\n if (additionalValue || additionalLabel) {\n let additionalInformation;\n if (additionalValue) {\n additionalInformation = additionalValue && (\n <RibbonBlockValue>{additionalValue}</RibbonBlockValue>\n );\n } else if (additionalLabel) {\n additionalInformation = additionalLabel && (\n <RibbonBlockValueLabel>{additionalLabel}</RibbonBlockValueLabel>\n );\n }\n return (\n <RibbonBlock {...containerProps}>\n <RibbonBlockRow\n className=\"ribbon-block-row\"\n solid={solid}\n style={{ alignItems: 'flex-start' }}\n >\n {labelPlace}\n <RibbonBlockCol center={center} className=\"ribbon-block-col\">\n <RibbonBlockValue>{value}</RibbonBlockValue>\n {additionalInformation}\n </RibbonBlockCol>\n </RibbonBlockRow>\n </RibbonBlock>\n );\n }\n\n return (\n <RibbonBlock {...containerProps}>\n <RibbonBlockRow center={center} solid={solid}>\n {labelPlace}\n <RibbonBlockValue>{value}</RibbonBlockValue>\n </RibbonBlockRow>\n </RibbonBlock>\n );\n}\n\nconst DSRibbon = {\n RibbonWrapper,\n RibbonRow,\n RibbonCol,\n RibbonCard,\n};\n\nRibbonWrapper.propTypes = {};\n\nRibbonRow.propTypes = {\n /** align left */\n alignLeft: PropTypes.bool.description('align left'),\n};\n\nRibbonCol.propTypes = {};\n\nconst cardprops = {\n /** props to inject to wrapper */\n containerProps: PropTypes.object.description('props to inject to wrapper'),\n /** icon for ribbon card */\n icon: PropTypes.element.description('icon for ribbon card'),\n /** label for ribbon card */\n label: PropTypes.string.description('label for ribbon card'),\n /** value for ribbon */\n value: PropTypes.string.description('value for ribbon'),\n /** additional value */\n additionalValue: PropTypes.string.description('additional value'),\n /** additional label */\n additionalLabel: PropTypes.string.description('additional label'),\n /** for main label */\n info: PropTypes.bool.description('for main label'),\n /** error state toggle */\n error: PropTypes.bool.description('error state toggle'),\n /** warning state toggle */\n warning: PropTypes.bool.description('warning state toggle'),\n /** success state toggle */\n success: PropTypes.bool.description('success state toggle'),\n /** align center */\n center: PropTypes.bool.description('align center'),\n /** solid style */\n solid: PropTypes.bool.description('solid style'),\n};\n\nRibbonCard.propTypes = cardprops;\n\nconst DSRibbonCardWithSchema = describe(RibbonCard);\nDSRibbonCardWithSchema.propTypes = cardprops;\n\nexport default DSRibbon;\nexport { DSRibbonCardWithSchema };\n"],"names":["RibbonRow","styled","div","props","alignLeft","RibbonCol","solid","RibbonWrapper","RibbonBlockIcon","info","error","warning","success","RibbonBlockLabel","RibbonBlockValue","RibbonBlockValueLabel","RibbonBlockCol","center","RibbonBlockRow","RibbonBlock","RibbonCard","containerProps","icon","label","value","additionalValue","additionalLabel","labelPlace","React","additionalInformation","alignItems","DSRibbon","propTypes","PropTypes","bool","description","cardprops","object","element","string","DSRibbonCardWithSchema","describe"],"mappings":";;;;;;;;;;;;;AAAA;AAOA,IAAMA,SAAS,gBAAGC,0BAAM,CAACC,GAAV;AAAA;AAAA,uOAYX,UAACC,KAAD,EAAW;AACX,MAAIA,KAAK,CAACC,SAAV,EAAqB;AACnB,8DAEMC,SAFN;AAUD;;AACD;AAID,CA7BY,EA8BX,UAACF,KAAD,EAAW;AACX,MAAIA,KAAK,CAACG,KAAV,EAAiB;AACf,iCACMD,SADN;AAQD;;AACD,SAAO,EAAP;AACD,CA1CY,CAAf;AA6CA,IAAMA,SAAS,gBAAGJ,0BAAM,CAACC,GAAV;AAAA;AAAA,iQAgBPF,SAhBO,CAAf;AAqBA,IAAMO,aAAa,gBAAGN,0BAAM,CAACC,GAAV;AAAA;AAAA,4PAO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AAI,EAAEwB,mBAAS,CAACC,IAAV,CAAeC,WAAf,CAA2B,gBAA3B,CAdU;;AAehB;AACAzB,EAAAA,KAAK,EAAEuB,mBAAS,CAACC,IAAV,CAAeC,WAAf,CAA2B,oBAA3B,CAhBS;;AAiBhB;AACAxB,EAAAA,OAAO,EAAEsB,mBAAS,CAACC,IAAV,CAAeC,WAAf,CAA2B,sBAA3B,CAlBO;;AAmBhB;AACAvB,EAAAA,OAAO,EAAEqB,mBAAS,CAACC,IAAV,CAAeC,WAAf,CAA2B,sBAA3B,CApBO;;AAqBhB;AACAlB,EAAAA,MAAM,EAAEgB,mBAAS,CAACC,IAAV,CAAeC,WAAf,CAA2B,cAA3B,CAtBQ;;AAuBhB;AACA7B,EAAAA,KAAK,EAAE2B,mBAAS,CAACC,IAAV,CAAeC,WAAf,CAA2B,aAA3B;AAxBS,CAAlB;AA2BAf,UAAU,CAACY,SAAX,GAAuBI,SAAvB;IAEMI,sBAAsB,GAAGC,kBAAQ,CAACrB,UAAD;AACvCoB,sBAAsB,CAACR,SAAvB,GAAmCI,SAAnC;;;;;"}
|
package/cjs/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
|
package/esm/DSRibbon.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DSRibbon.js","sources":["../../src/DSRibbon.tsx"],"sourcesContent":["/* eslint-disable max-lines */\n/* eslint-disable no-use-before-define */\n/* eslint-disable no-confusing-arrow */\nimport React from 'react';\nimport { PropTypes, describe } from 'react-desc';\nimport styled from 'styled-components';\n\nconst RibbonRow = styled.div`\n width: 100%;\n display: flex;\n flex-direction: row;\n align-items: center;\n min-height: 4rem;\n @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {\n height: 5rem;\n overflow-y: hidden;\n }\n flex-wrap: nowrap;\n overflow-x: auto;\n ${(props) => {\n if (props.alignLeft) {\n return `\n align-items: stretch;\n & > ${RibbonCol} {\n align-items: flex-start;\n align-self: stretch; \n flex: 0;\n @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {\n flex: 1;\n }\n `;\n }\n return `\n // flex:1;\n align-items: center;\n `;\n }};\n ${(props) => {\n if (props.solid) {\n return `\n & > ${RibbonCol} {\n &:after{\n top: 0%;\n height: 100%;\n border-right: solid 1px #CBCFD7;\n }\n `;\n }\n return '';\n }};\n`;\n\nconst RibbonCol = styled.div`\n display: flex;\n flex-direction: column;\n padding: 0.25rem 0.5rem;\n height: 100%;\n justify-content: center;\n flex: 1;\n position: relative;\n &:after {\n position: absolute;\n top: 10%;\n right: 0;\n height: 80%;\n content: '';\n border-right: dashed 1px #ebedf0;\n }\n & > ${RibbonRow} {\n align-items: flex-start;\n }\n`;\n\nconst RibbonWrapper = styled.div`\n width: 100%;\n display: flex;\n flex-direction: column;\n padding: 0.62rem 1.22rem;\n border-bottom: solid 1px #cfcfd7;\n background: #fff;\n & > ${RibbonRow} {\n border-bottom: solid 1px #ebedf0;\n width: auto;\n &:last-child {\n border: none;\n }\n & > ${RibbonCol} {\n &:last-child {\n &:after {\n display: none;\n }\n }\n }\n }\n`;\n\n/* eslint-disable indent */\nconst RibbonBlockIcon = styled.div`\n padding-right: 0.5rem;\n padding-top: 0.1rem;\n svg,\n svg:not([fill]) {\n fill: ${(props) => {\n if (props.info) return '#1e79c2';\n if (props.error) return '#E34256';\n if (props.warning) return '#FBB431';\n if (props.success) return '#32B87C';\n return '#1e79c2';\n }};\n }\n`;\n/* eslint-enable indent */\n\nconst RibbonBlockLabel = styled.div`\n padding: 0.25rem 0.5rem;\n color: #697489;\n font-size: 0.9rem;\n line-height: 1.2rem;\n`;\nconst RibbonBlockValue = styled.div`\n flex: 2;\n font-weight: bold;\n padding: 0.25rem 0.5rem 0.25rem 0rem;\n font-size: 1.1rem;\n color: #333333;\n flex-wrap: nowrap;\n white-space: nowrap;\n`;\nconst RibbonBlockValueLabel = styled.div`\n flex: 2;\n padding: 0.25rem 0.5rem 0.25rem 0rem;\n font-size: 0.9rem;\n color: #697489;\n flex-wrap: nowrap;\n white-space: nowrap;\n`;\n\nconst RibbonBlockCol = styled.div`\n display: flex;\n flex-direction: column;\n flex: 2;\n flex-wrap: nowrap;\n align-items: ${(props) => {\n if (props.center) return 'center';\n return '';\n }};\n height: 100%;\n`;\nconst RibbonBlockRow = styled.div`\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n flex: 1;\n height: 100%;\n align-items: ${(props) => {\n if (props.center) return 'center';\n return '';\n }};\n`;\nconst RibbonBlock = styled.div`\n flex: 1;\n height: 100%;\n`;\n\nfunction RibbonCard({\n containerProps = {},\n icon = null,\n label = '',\n value = '',\n additionalValue = '',\n additionalLabel = '',\n info = false,\n error = false,\n warning = false,\n success = false,\n center = false,\n solid = false,\n}) {\n const labelPlace = icon ? (\n <RibbonBlockIcon\n error={error}\n info={info}\n success={success}\n warning={warning}\n >\n {icon}\n </RibbonBlockIcon>\n ) : (\n <RibbonBlockLabel>{label}</RibbonBlockLabel>\n );\n if (additionalValue || additionalLabel) {\n let additionalInformation;\n if (additionalValue) {\n additionalInformation = additionalValue && (\n <RibbonBlockValue>{additionalValue}</RibbonBlockValue>\n );\n } else if (additionalLabel) {\n additionalInformation = additionalLabel && (\n <RibbonBlockValueLabel>{additionalLabel}</RibbonBlockValueLabel>\n );\n }\n return (\n <RibbonBlock {...containerProps}>\n <RibbonBlockRow\n className=\"ribbon-block-row\"\n solid={solid}\n style={{ alignItems: 'flex-start' }}\n >\n {labelPlace}\n <RibbonBlockCol center={center} className=\"ribbon-block-col\">\n <RibbonBlockValue>{value}</RibbonBlockValue>\n {additionalInformation}\n </RibbonBlockCol>\n </RibbonBlockRow>\n </RibbonBlock>\n );\n }\n\n return (\n <RibbonBlock {...containerProps}>\n <RibbonBlockRow center={center} solid={solid}>\n {labelPlace}\n <RibbonBlockValue>{value}</RibbonBlockValue>\n </RibbonBlockRow>\n </RibbonBlock>\n );\n}\n\nconst DSRibbon = {\n RibbonWrapper,\n RibbonRow,\n RibbonCol,\n RibbonCard,\n};\n\nRibbonWrapper.propTypes = {};\n\nRibbonRow.propTypes = {\n /** align left */\n alignLeft: PropTypes.bool.description('align left'),\n};\n\nRibbonCol.propTypes = {};\n\nconst cardprops = {\n /** props to inject to wrapper */\n containerProps: PropTypes.object.description('props to inject to wrapper'),\n /** icon for ribbon card */\n icon: PropTypes.element.description('icon for ribbon card'),\n /** label for ribbon card */\n label: PropTypes.string.description('label for ribbon card'),\n /** value for ribbon */\n value: PropTypes.string.description('value for ribbon'),\n /** additional value */\n additionalValue: PropTypes.string.description('additional value'),\n /** additional label */\n additionalLabel: PropTypes.string.description('additional label'),\n /** for main label */\n info: PropTypes.bool.description('for main label'),\n /** error state toggle */\n error: PropTypes.bool.description('error state toggle'),\n /** warning state toggle */\n warning: PropTypes.bool.description('warning state toggle'),\n /** success state toggle */\n success: PropTypes.bool.description('success state toggle'),\n /** align center */\n center: PropTypes.bool.description('align center'),\n /** solid style */\n solid: PropTypes.bool.description('solid style'),\n};\n\nRibbonCard.propTypes = cardprops;\n\nconst DSRibbonCardWithSchema = describe(RibbonCard);\nDSRibbonCardWithSchema.propTypes = cardprops;\n\nexport default DSRibbon;\nexport { DSRibbonCardWithSchema };\n"],"names":["RibbonRow","styled","div","props","alignLeft","RibbonCol","solid","RibbonWrapper","RibbonBlockIcon","info","error","warning","success","RibbonBlockLabel","RibbonBlockValue","RibbonBlockValueLabel","RibbonBlockCol","center","RibbonBlockRow","RibbonBlock","RibbonCard","containerProps","icon","label","value","additionalValue","additionalLabel","labelPlace","additionalInformation","alignItems","DSRibbon","propTypes","PropTypes","bool","description","cardprops","object","element","string","DSRibbonCardWithSchema","describe"],"mappings":";;;;AAAA;AAOA,IAAMA,SAAS,gBAAGC,MAAM,CAACC,GAAV;AAAA;AAAA,uOAYX,UAACC,KAAD,EAAW;AACX,MAAIA,KAAK,CAACC,SAAV,EAAqB;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