@dxc-technology/halstack-react 0.0.0-011babe → 0.0.0-0355f44
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/dist/BackgroundColorContext.js +46 -0
- package/dist/ThemeContext.js +168 -105
- package/dist/accordion/Accordion.js +127 -48
- package/dist/accordion-group/AccordionGroup.js +34 -4
- package/dist/alert/Alert.js +178 -82
- package/dist/alert/index.d.ts +51 -0
- package/dist/badge/Badge.js +28 -7
- package/dist/box/Box.js +28 -19
- package/dist/button/Button.js +50 -21
- package/dist/card/Card.js +72 -35
- package/dist/checkbox/Checkbox.js +95 -26
- package/dist/chip/Chip.js +88 -32
- package/dist/common/utils.js +2 -22
- package/dist/common/variables.js +1376 -238
- package/dist/date/Date.js +70 -43
- package/dist/date-input/DateInput.js +400 -0
- package/dist/date-input/index.d.ts +95 -0
- package/dist/dialog/Dialog.js +51 -34
- package/dist/dropdown/Dropdown.js +169 -79
- package/dist/file-input/FileInput.js +644 -0
- package/dist/file-input/FileItem.js +280 -0
- package/dist/file-input/index.d.ts +81 -0
- package/dist/footer/Footer.js +70 -47
- package/dist/footer/dxc_logo.svg +15 -0
- package/dist/header/Header.js +89 -58
- package/dist/header/dxc_logo_black.svg +8 -0
- package/dist/heading/Heading.js +86 -23
- package/dist/input-text/InputText.js +234 -104
- package/dist/layout/ApplicationLayout.js +11 -10
- package/dist/link/Link.js +84 -36
- package/dist/main.d.ts +8 -0
- package/dist/main.js +68 -4
- package/dist/new-select/NewSelect.js +836 -0
- package/dist/new-select/index.d.ts +53 -0
- package/dist/new-textarea/NewTextarea.js +369 -0
- package/dist/new-textarea/index.d.ts +117 -0
- package/dist/number-input/NumberInput.js +136 -0
- package/dist/number-input/NumberInputContext.js +16 -0
- package/dist/number-input/index.d.ts +113 -0
- package/dist/paginator/Paginator.js +56 -18
- package/dist/password-input/PasswordInput.js +198 -0
- package/dist/password-input/index.d.ts +94 -0
- package/dist/progress-bar/ProgressBar.js +89 -37
- package/dist/radio/Radio.js +28 -11
- package/dist/resultsetTable/ResultsetTable.js +76 -44
- package/dist/select/Select.js +215 -151
- package/dist/sidenav/Sidenav.js +64 -12
- package/dist/slider/Slider.js +190 -63
- package/dist/spinner/Spinner.js +245 -60
- package/dist/switch/Switch.js +50 -20
- package/dist/table/Table.js +46 -10
- package/dist/tabs/Tabs.js +47 -15
- package/dist/tag/Tag.js +64 -33
- package/dist/text-input/TextInput.js +971 -0
- package/dist/text-input/index.d.ts +135 -0
- package/dist/textarea/Textarea.js +68 -36
- package/dist/toggle/Toggle.js +0 -2
- package/dist/toggle-group/ToggleGroup.js +148 -34
- package/dist/upload/Upload.js +16 -13
- package/dist/upload/buttons-upload/ButtonsUpload.js +28 -12
- package/dist/upload/dragAndDropArea/DragAndDropArea.js +63 -20
- package/dist/upload/file-upload/FileToUpload.js +43 -19
- package/dist/upload/files-upload/FilesToUpload.js +9 -8
- package/dist/upload/readme.md +2 -2
- package/dist/upload/transaction/Transaction.js +39 -18
- package/dist/upload/transactions/Transactions.js +27 -11
- package/dist/wizard/Wizard.js +120 -48
- package/dist/wizard/invalid_icon.svg +4 -5
- package/dist/wizard/valid_icon.svg +4 -5
- package/package.json +6 -4
- package/test/AccordionGroup.test.js +16 -0
- package/test/Date.test.js +49 -45
- package/test/DateInput.test.js +242 -0
- package/test/Dropdown.test.js +15 -0
- package/test/FileInput.test.js +201 -0
- package/test/InputText.test.js +24 -16
- package/test/Link.test.js +3 -2
- package/test/NewTextarea.test.js +195 -0
- package/test/NumberInput.test.js +259 -0
- package/test/Paginator.test.js +1 -1
- package/test/PasswordInput.test.js +83 -0
- package/test/ResultsetTable.test.js +1 -2
- package/test/Select.test.js +44 -24
- package/test/Spinner.test.js +5 -0
- package/test/TextInput.test.js +732 -0
- package/test/ToggleGroup.test.js +5 -1
- package/test/Upload.test.js +5 -5
- package/dist/accordion/Accordion.stories.js +0 -207
- package/dist/accordion/readme.md +0 -96
- package/dist/accordion-group/AccordionGroup.stories.js +0 -207
- package/dist/accordion-group/readme.md +0 -70
- package/dist/alert/Alert.stories.js +0 -158
- package/dist/alert/close.svg +0 -4
- package/dist/alert/error.svg +0 -4
- package/dist/alert/info.svg +0 -4
- package/dist/alert/readme.md +0 -43
- package/dist/alert/success.svg +0 -4
- package/dist/alert/warning.svg +0 -4
- package/dist/button/Button.stories.js +0 -224
- package/dist/button/readme.md +0 -93
- package/dist/common/services/example-service.js +0 -10
- package/dist/common/services/example-service.test.js +0 -12
- package/dist/date/calendar.svg +0 -1
- package/dist/date/calendar_dark.svg +0 -1
- package/dist/dialog/Dialog.stories.js +0 -217
- package/dist/dialog/readme.md +0 -32
- package/dist/dropdown/Dropdown.stories.js +0 -249
- package/dist/dropdown/baseline-arrow_drop_down.svg +0 -1
- package/dist/dropdown/baseline-arrow_drop_down_wh.svg +0 -4
- package/dist/dropdown/baseline-arrow_drop_up.svg +0 -1
- package/dist/dropdown/baseline-arrow_drop_up_wh.svg +0 -4
- package/dist/dropdown/readme.md +0 -69
- package/dist/footer/Footer.stories.js +0 -94
- package/dist/footer/dxc_logo_wht.png +0 -0
- package/dist/header/dxc_logo_black.png +0 -0
- package/dist/header/dxc_logo_blk_rgb.svg +0 -6
- package/dist/header/dxc_logo_white.png +0 -0
- package/dist/input-text/InputText.stories.js +0 -209
- package/dist/select/Select.stories.js +0 -235
- package/dist/select/readme.md +0 -72
- package/dist/slider/Slider.stories.js +0 -241
- package/dist/toggle-group/readme.md +0 -82
|
@@ -9,10 +9,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
9
|
});
|
|
10
10
|
exports["default"] = void 0;
|
|
11
11
|
|
|
12
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
13
|
-
|
|
14
12
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
15
13
|
|
|
14
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
15
|
+
|
|
16
16
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
17
17
|
|
|
18
18
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
@@ -31,16 +31,16 @@ var _ExpandMore = _interopRequireDefault(require("@material-ui/icons/ExpandMore"
|
|
|
31
31
|
|
|
32
32
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
33
33
|
|
|
34
|
-
require("../common/OpenSans.css");
|
|
35
|
-
|
|
36
34
|
var _utils = require("../common/utils.js");
|
|
37
35
|
|
|
38
36
|
var _variables = require("../common/variables.js");
|
|
39
37
|
|
|
40
38
|
var _useTheme = _interopRequireDefault(require("../useTheme.js"));
|
|
41
39
|
|
|
40
|
+
var _BackgroundColorContext = require("../BackgroundColorContext.js");
|
|
41
|
+
|
|
42
42
|
function _templateObject7() {
|
|
43
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
43
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n height: ", ";\n width: ", ";\n margin-left: ", ";\n margin-right: ", ";\n overflow: hidden;\n color: ", ";\n"]);
|
|
44
44
|
|
|
45
45
|
_templateObject7 = function _templateObject7() {
|
|
46
46
|
return data;
|
|
@@ -50,7 +50,7 @@ function _templateObject7() {
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
function _templateObject6() {
|
|
53
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
53
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n height: ", ";\n width: ", ";\n margin-left: ", ";\n margin-right: ", ";\n overflow: hidden;\n color: ", ";\n\n img,\n svg {\n height: 100%;\n width: 100%;\n }\n"]);
|
|
54
54
|
|
|
55
55
|
_templateObject6 = function _templateObject6() {
|
|
56
56
|
return data;
|
|
@@ -60,7 +60,7 @@ function _templateObject6() {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
function _templateObject5() {
|
|
63
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
63
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n padding-left: ", ";\n padding-right: ", ";\n font-size: ", ";\n font-family: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n letter-spacing: ", ";\n flex: 1;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n min-width: ", ";\n text-align: end;\n"]);
|
|
64
64
|
|
|
65
65
|
_templateObject5 = function _templateObject5() {
|
|
66
66
|
return data;
|
|
@@ -90,7 +90,7 @@ function _templateObject3() {
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
function _templateObject2() {
|
|
93
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row-reverse;\n align-items: center;\n
|
|
93
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row-reverse;\n align-items: center;\n padding-left: ", ";\n padding-right: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n"]);
|
|
94
94
|
|
|
95
95
|
_templateObject2 = function _templateObject2() {
|
|
96
96
|
return data;
|
|
@@ -100,7 +100,7 @@ function _templateObject2() {
|
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
function _templateObject() {
|
|
103
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n min-width: 280px;\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n
|
|
103
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n min-width: 280px;\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n width: ", ";\n cursor: ", ";\n\n .MuiPaper-root {\n min-width: 0;\n display: flex;\n left: 85px;\n background-color: ", " !important;\n box-shadow: ", ";\n position: static;\n width: 100%;\n border-radius: ", ";\n\n &.Mui-expanded {\n border-radius: ", ";\n }\n &.MuiExpansionPanel-root {\n display: flex;\n flex-direction: column;\n min-height: 48px;\n }\n &.MuiExpansionPanel-rounded {\n border-radius: ", ";\n }\n .MuiButtonBase-root.MuiExpansionPanelSummary-root {\n min-height: 48px;\n height: 48px;\n\n :focus {\n outline-color: ", ";\n outline-style: ", ";\n outline-width: ", ";\n background-color: ", ";\n }\n :hover {\n background-color: ", ";\n }\n :active {\n background-color: ", ";\n }\n &.Mui-disabled {\n opacity: 1;\n }\n }\n .MuiButtonBase-root {\n border-radius: ", ";\n\n &.Mui-expanded {\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n .MuiSvgIcon-root {\n opacity: 1;\n }\n }\n &.MuiIconButton-root {\n height: auto;\n }\n .MuiExpansionPanelSummary-content {\n padding-top: ", ";\n padding-bottom: ", ";\n padding-right: ", ";\n padding-left: ", ";\n min-width: 0;\n align-items: baseline;\n &.Mui-expanded {\n div:nth-child(2) {\n opacity: 1;\n }\n }\n :hover {\n div {\n opacity: 1;\n }\n }\n }\n }\n .MuiTouchRipple-root {\n display: none;\n }\n }\n .MuiCollapse-hidden {\n display: none;\n }\n .MuiCollapse-container {\n border-radius: 0px 0px 4px 4px;\n cursor: default;\n width: 100%;\n }\n .MuiIconButton-label {\n & > .MuiSvgIcon-root {\n color: ", ";\n }\n }\n .MuiExpansionPanelDetails-root {\n padding: ", ";\n padding-top: ", ";\n padding-right: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n }\n"]);
|
|
104
104
|
|
|
105
105
|
_templateObject = function _templateObject() {
|
|
106
106
|
return data;
|
|
@@ -124,7 +124,9 @@ var DxcAccordion = function DxcAccordion(_ref) {
|
|
|
124
124
|
isExpanded = _ref.isExpanded,
|
|
125
125
|
children = _ref.children,
|
|
126
126
|
margin = _ref.margin,
|
|
127
|
-
padding = _ref.padding
|
|
127
|
+
padding = _ref.padding,
|
|
128
|
+
_ref$tabIndex = _ref.tabIndex,
|
|
129
|
+
tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
|
|
128
130
|
|
|
129
131
|
var _React$useState = _react["default"].useState(false),
|
|
130
132
|
_React$useState2 = (0, _slicedToArray2["default"])(_React$useState, 2),
|
|
@@ -179,39 +181,27 @@ var DxcAccordion = function DxcAccordion(_ref) {
|
|
|
179
181
|
onChange: handlerAccordion,
|
|
180
182
|
expanded: isExpanded != null ? isExpanded : innerIsExpanded
|
|
181
183
|
}, _react["default"].createElement(_ExpansionPanelSummary["default"], {
|
|
182
|
-
expandIcon: _react["default"].createElement(_ExpandMore["default"], null)
|
|
183
|
-
|
|
184
|
+
expandIcon: _react["default"].createElement(_ExpandMore["default"], null),
|
|
185
|
+
tabIndex: disabled ? -1 : tabIndex
|
|
186
|
+
}, _react["default"].createElement(AccordionInfo, {
|
|
187
|
+
disabled: disabled
|
|
188
|
+
}, _react["default"].createElement(AccordionLabel, null, label), icon ? _react["default"].createElement(IconContainer, {
|
|
189
|
+
disabled: disabled
|
|
190
|
+
}, (0, _typeof2["default"])(icon) === "object" ? icon : _react["default"].createElement(icon)) : iconSrc && _react["default"].createElement(AccordionIcon, {
|
|
184
191
|
src: iconSrc
|
|
185
|
-
})), assistiveText && _react["default"].createElement(AccordionAssistiveText,
|
|
192
|
+
})), assistiveText && _react["default"].createElement(AccordionAssistiveText, {
|
|
193
|
+
disabled: disabled
|
|
194
|
+
}, assistiveText)), _react["default"].createElement(_ExpansionPanelDetails["default"], null, _react["default"].createElement(AccordionContent, {
|
|
195
|
+
disabled: disabled
|
|
196
|
+
}, _react["default"].createElement(_BackgroundColorContext.BackgroundColorProvider, {
|
|
197
|
+
color: colorsTheme.accordion.backgroundColor
|
|
198
|
+
}, children))))));
|
|
186
199
|
};
|
|
187
200
|
|
|
188
201
|
var calculateWidth = function calculateWidth(margin) {
|
|
189
202
|
return "calc(100% - ".concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")");
|
|
190
203
|
};
|
|
191
204
|
|
|
192
|
-
DxcAccordion.propTypes = {
|
|
193
|
-
label: _propTypes["default"].string,
|
|
194
|
-
iconSrc: _propTypes["default"].string,
|
|
195
|
-
icon: _propTypes["default"].oneOfType([_propTypes["default"].element, _propTypes["default"].func]),
|
|
196
|
-
assistiveText: _propTypes["default"].string,
|
|
197
|
-
disabled: _propTypes["default"].bool,
|
|
198
|
-
onChange: _propTypes["default"].func,
|
|
199
|
-
isExpanded: _propTypes["default"].bool,
|
|
200
|
-
children: _propTypes["default"].element,
|
|
201
|
-
margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
|
202
|
-
top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
203
|
-
bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
204
|
-
left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
205
|
-
right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
|
|
206
|
-
}), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
|
|
207
|
-
padding: _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
|
208
|
-
top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
209
|
-
bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
210
|
-
left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
211
|
-
right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
|
|
212
|
-
}), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))])
|
|
213
|
-
};
|
|
214
|
-
|
|
215
205
|
var DXCAccordion = _styledComponents["default"].div(_templateObject(), function (props) {
|
|
216
206
|
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
217
207
|
}, function (props) {
|
|
@@ -224,22 +214,42 @@ var DXCAccordion = _styledComponents["default"].div(_templateObject(), function
|
|
|
224
214
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
225
215
|
}, function (props) {
|
|
226
216
|
return calculateWidth(props.margin);
|
|
227
|
-
}, function (props) {
|
|
228
|
-
return props.theme.fontFamily;
|
|
229
217
|
}, function (props) {
|
|
230
218
|
return props.disabled && "not-allowed" || "pointer";
|
|
219
|
+
}, function (props) {
|
|
220
|
+
return props.disabled ? props.theme.disabledBackgroundColor : props.theme.backgroundColor;
|
|
221
|
+
}, function (props) {
|
|
222
|
+
return "".concat(props.theme.boxShadowOffsetX, " ").concat(props.theme.boxShadowOffsetY, " ").concat(props.theme.boxShadowBlur, " ").concat(props.theme.boxShadowColor);
|
|
223
|
+
}, function (props) {
|
|
224
|
+
return props.theme.borderRadius;
|
|
225
|
+
}, function (props) {
|
|
226
|
+
return props.theme.borderRadius;
|
|
227
|
+
}, function (props) {
|
|
228
|
+
return props.theme.borderRadius;
|
|
229
|
+
}, function (props) {
|
|
230
|
+
return props.theme.focusBorderColor;
|
|
231
|
+
}, function (props) {
|
|
232
|
+
return props.theme.focusBorderStyle;
|
|
233
|
+
}, function (props) {
|
|
234
|
+
return props.theme.focusBorderThickness;
|
|
231
235
|
}, function (props) {
|
|
232
236
|
return props.theme.backgroundColor;
|
|
233
237
|
}, function (props) {
|
|
234
|
-
return props.theme.
|
|
238
|
+
return "".concat(props.theme.hoverBackgroundColor);
|
|
235
239
|
}, function (props) {
|
|
236
240
|
return "".concat(props.theme.hoverBackgroundColor);
|
|
237
241
|
}, function (props) {
|
|
238
|
-
return props.theme.
|
|
242
|
+
return props.theme.borderRadius;
|
|
239
243
|
}, function (props) {
|
|
240
|
-
return props.theme.
|
|
244
|
+
return props.theme.titleLabelPaddingTop;
|
|
241
245
|
}, function (props) {
|
|
242
|
-
return props.theme.
|
|
246
|
+
return props.theme.titleLabelPaddingBottom;
|
|
247
|
+
}, function (props) {
|
|
248
|
+
return props.theme.titleLabelPaddingRight;
|
|
249
|
+
}, function (props) {
|
|
250
|
+
return props.theme.titleLabelPaddingLeft;
|
|
251
|
+
}, function (props) {
|
|
252
|
+
return props.disabled ? props.theme.disabledArrowColor : props.theme.arrowColor;
|
|
243
253
|
}, function (props) {
|
|
244
254
|
return props.padding && (0, _typeof2["default"])(props.padding) !== "object" ? _variables.spaces[props.padding] : "0px";
|
|
245
255
|
}, function (props) {
|
|
@@ -252,23 +262,92 @@ var DXCAccordion = _styledComponents["default"].div(_templateObject(), function
|
|
|
252
262
|
return props.padding && (0, _typeof2["default"])(props.padding) === "object" && props.padding.left ? _variables.spaces[props.padding.left] : "";
|
|
253
263
|
});
|
|
254
264
|
|
|
255
|
-
var AccordionInfo = _styledComponents["default"].div(_templateObject2())
|
|
265
|
+
var AccordionInfo = _styledComponents["default"].div(_templateObject2(), function (props) {
|
|
266
|
+
return props.theme.titlePaddingLeft;
|
|
267
|
+
}, function (props) {
|
|
268
|
+
return props.theme.titlePaddingRight;
|
|
269
|
+
}, function (props) {
|
|
270
|
+
return props.theme.titleLabelFontFamily;
|
|
271
|
+
}, function (props) {
|
|
272
|
+
return props.theme.titleLabelFontSize;
|
|
273
|
+
}, function (props) {
|
|
274
|
+
return props.theme.titleLabelFontStyle;
|
|
275
|
+
}, function (props) {
|
|
276
|
+
return props.theme.titleFonLabeltWeight;
|
|
277
|
+
}, function (props) {
|
|
278
|
+
return props.disabled ? props.theme.disabledTitleLabelFontColor : props.theme.titleLabelFontColor;
|
|
279
|
+
});
|
|
256
280
|
|
|
257
281
|
var AccordionLabel = _styledComponents["default"].div(_templateObject3());
|
|
258
282
|
|
|
259
|
-
var
|
|
283
|
+
var AccordionContent = _styledComponents["default"].div(_templateObject4());
|
|
260
284
|
|
|
261
285
|
var AccordionAssistiveText = _styledComponents["default"].div(_templateObject5(), function (props) {
|
|
262
|
-
return props.theme.
|
|
286
|
+
return props.theme.assistiveTextPaddingLeft;
|
|
287
|
+
}, function (props) {
|
|
288
|
+
return props.theme.assistiveTextPaddingRight;
|
|
289
|
+
}, function (props) {
|
|
290
|
+
return props.theme.assistiveTextFontSize;
|
|
291
|
+
}, function (props) {
|
|
292
|
+
return props.theme.assistiveTextFontFamily;
|
|
293
|
+
}, function (props) {
|
|
294
|
+
return props.theme.assistiveTextFontStyle;
|
|
295
|
+
}, function (props) {
|
|
296
|
+
return props.theme.assistiveTextFontWeight;
|
|
297
|
+
}, function (props) {
|
|
298
|
+
return props.disabled ? props.theme.disabledAssistiveTextFontColor : props.theme.assistiveTextFontColor;
|
|
263
299
|
}, function (props) {
|
|
264
|
-
return props.theme.
|
|
300
|
+
return props.theme.assistiveTextLetterSpacing;
|
|
301
|
+
}, function (props) {
|
|
302
|
+
return props.theme.assistiveTextMinWidth;
|
|
265
303
|
});
|
|
266
304
|
|
|
267
305
|
var IconContainer = _styledComponents["default"].div(_templateObject6(), function (props) {
|
|
268
|
-
return props.theme.
|
|
306
|
+
return props.theme.iconSize;
|
|
307
|
+
}, function (props) {
|
|
308
|
+
return props.theme.iconSize;
|
|
309
|
+
}, function (props) {
|
|
310
|
+
return props.theme.iconMarginLeft;
|
|
311
|
+
}, function (props) {
|
|
312
|
+
return props.theme.iconMarginRigth;
|
|
313
|
+
}, function (props) {
|
|
314
|
+
return props.disabled ? props.theme.disabledIconColor : props.theme.iconColor;
|
|
269
315
|
});
|
|
270
316
|
|
|
271
|
-
var AccordionIcon = _styledComponents["default"].img(_templateObject7())
|
|
317
|
+
var AccordionIcon = _styledComponents["default"].img(_templateObject7(), function (props) {
|
|
318
|
+
return props.theme.iconSize;
|
|
319
|
+
}, function (props) {
|
|
320
|
+
return props.theme.iconSize;
|
|
321
|
+
}, function (props) {
|
|
322
|
+
return props.theme.iconMarginLeft;
|
|
323
|
+
}, function (props) {
|
|
324
|
+
return props.theme.iconMarginRigth;
|
|
325
|
+
}, function (props) {
|
|
326
|
+
return props.disabled ? props.theme.disabledIconColor : props.theme.iconColor;
|
|
327
|
+
});
|
|
272
328
|
|
|
329
|
+
DxcAccordion.propTypes = {
|
|
330
|
+
label: _propTypes["default"].string,
|
|
331
|
+
iconSrc: _propTypes["default"].string,
|
|
332
|
+
icon: _propTypes["default"].oneOfType([_propTypes["default"].element, _propTypes["default"].func]),
|
|
333
|
+
assistiveText: _propTypes["default"].string,
|
|
334
|
+
disabled: _propTypes["default"].bool,
|
|
335
|
+
onChange: _propTypes["default"].func,
|
|
336
|
+
isExpanded: _propTypes["default"].bool,
|
|
337
|
+
children: _propTypes["default"].element,
|
|
338
|
+
margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
|
339
|
+
top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
340
|
+
bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
341
|
+
left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
342
|
+
right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
|
|
343
|
+
}), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
|
|
344
|
+
padding: _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
|
345
|
+
top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
346
|
+
bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
347
|
+
left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
348
|
+
right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
|
|
349
|
+
}), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
|
|
350
|
+
tabIndex: _propTypes["default"].number
|
|
351
|
+
};
|
|
273
352
|
var _default = DxcAccordion;
|
|
274
353
|
exports["default"] = _default;
|
|
@@ -27,8 +27,6 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
27
27
|
|
|
28
28
|
var _Accordion = _interopRequireDefault(require("../accordion/Accordion"));
|
|
29
29
|
|
|
30
|
-
require("../common/OpenSans.css");
|
|
31
|
-
|
|
32
30
|
var _utils = require("../common/utils.js");
|
|
33
31
|
|
|
34
32
|
var _variables = require("../common/variables.js");
|
|
@@ -36,7 +34,7 @@ var _variables = require("../common/variables.js");
|
|
|
36
34
|
var _useTheme = _interopRequireDefault(require("../useTheme.js"));
|
|
37
35
|
|
|
38
36
|
function _templateObject() {
|
|
39
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
37
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n\n cursor: ", ";\n\n & > :not(div:last-child) {\n & > div:first-child {\n border-radius: 0;\n border-bottom: ", ";\n border-color: ", ";\n\n & > .Mui-expanded {\n border-radius: 0;\n }\n\n & > .MuiButtonBase-root {\n border-radius: 0;\n }\n }\n }\n\n & > div:first-child {\n & > div:first-child {\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n border-top-left-radius: ", ";\n border-top-right-radius: ", ";\n border-bottom: ", ";\n border-color: ", ";\n\n & > .Mui-expanded {\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n border-top-left-radius: ", ";\n border-top-right-radius: ", ";\n }\n\n & > .MuiButtonBase-root {\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n border-top-left-radius: ", ";\n border-top-right-radius: ", ";\n }\n }\n }\n\n & > div:last-child {\n & > div:first-child {\n border-bottom-left-radius: ", ";\n border-bottom-right-radius: ", ";\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n\n & > .Mui-expanded {\n border-bottom-left-radius: ", ";\n border-bottom-right-radius: ", ";\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n }\n\n & > .MuiButtonBase-root {\n border-bottom-left-radius: ", ";\n border-bottom-right-radius: ", ";\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n }\n }\n }\n"]);
|
|
40
38
|
|
|
41
39
|
_templateObject = function _templateObject() {
|
|
42
40
|
return data;
|
|
@@ -87,7 +85,7 @@ var DxcAccordionGroup = function DxcAccordionGroup(_ref2) {
|
|
|
87
85
|
}, _react["default"].createElement(AccordionGroupContainer, {
|
|
88
86
|
margin: margin,
|
|
89
87
|
disabled: disabled
|
|
90
|
-
}, children.filter(function (el) {
|
|
88
|
+
}, (Array.isArray(children) ? children : [children]).filter(function (el) {
|
|
91
89
|
return el.type === Accordion;
|
|
92
90
|
}).map(function (el, index) {
|
|
93
91
|
return _react["default"].cloneElement(el, {
|
|
@@ -123,6 +121,38 @@ var AccordionGroupContainer = _styledComponents["default"].div(_templateObject()
|
|
|
123
121
|
return margin && (0, _typeof2["default"])(margin) === "object" && margin.left ? _variables.spaces[margin.left] : "";
|
|
124
122
|
}, function (props) {
|
|
125
123
|
return props.disabled && "not-allowed" || "pointer";
|
|
124
|
+
}, function (props) {
|
|
125
|
+
return "".concat(props.theme.accordionGroupSeparatorBorderThickness, " ").concat(props.theme.accordionGroupSeparatorBorderStyle);
|
|
126
|
+
}, function (props) {
|
|
127
|
+
return props.theme.accordionGroupSeparatorBorderColor;
|
|
128
|
+
}, function (props) {
|
|
129
|
+
return props.theme.borderRadius;
|
|
130
|
+
}, function (props) {
|
|
131
|
+
return props.theme.borderRadius;
|
|
132
|
+
}, function (props) {
|
|
133
|
+
return "".concat(props.theme.accordionGroupSeparatorBorderThickness, " ").concat(props.theme.accordionGroupSeparatorBorderStyle);
|
|
134
|
+
}, function (props) {
|
|
135
|
+
return props.theme.accordionGroupSeparatorBorderColor;
|
|
136
|
+
}, function (props) {
|
|
137
|
+
return props.theme.borderRadius;
|
|
138
|
+
}, function (props) {
|
|
139
|
+
return props.theme.borderRadius;
|
|
140
|
+
}, function (props) {
|
|
141
|
+
return props.theme.borderRadius;
|
|
142
|
+
}, function (props) {
|
|
143
|
+
return props.theme.borderRadius;
|
|
144
|
+
}, function (props) {
|
|
145
|
+
return props.theme.borderRadius;
|
|
146
|
+
}, function (props) {
|
|
147
|
+
return props.theme.borderRadius;
|
|
148
|
+
}, function (props) {
|
|
149
|
+
return props.theme.borderRadius;
|
|
150
|
+
}, function (props) {
|
|
151
|
+
return props.theme.borderRadius;
|
|
152
|
+
}, function (props) {
|
|
153
|
+
return props.theme.borderRadius;
|
|
154
|
+
}, function (props) {
|
|
155
|
+
return props.theme.borderRadius;
|
|
126
156
|
});
|
|
127
157
|
|
|
128
158
|
DxcAccordionGroup.propTypes = {
|