@dxc-technology/halstack-react 0.0.0-02e2a15 → 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/ThemeContext.js +131 -99
- package/dist/accordion/Accordion.js +119 -50
- package/dist/accordion-group/AccordionGroup.js +33 -1
- package/dist/alert/Alert.js +168 -83
- package/dist/alert/index.d.ts +51 -0
- package/dist/badge/Badge.js +29 -6
- package/dist/box/Box.js +27 -18
- package/dist/button/Button.js +39 -20
- package/dist/card/Card.js +15 -8
- package/dist/checkbox/Checkbox.js +88 -21
- package/dist/chip/Chip.js +63 -21
- package/dist/common/variables.js +1297 -316
- package/dist/date/Date.js +66 -44
- package/dist/date-input/DateInput.js +400 -0
- package/dist/date-input/index.d.ts +95 -0
- package/dist/dialog/Dialog.js +44 -29
- package/dist/dropdown/Dropdown.js +162 -74
- 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 +25 -35
- package/dist/footer/dxc_logo.svg +15 -0
- package/dist/header/Header.js +44 -26
- package/dist/header/dxc_logo_black.svg +8 -0
- package/dist/heading/Heading.js +91 -36
- package/dist/input-text/InputText.js +161 -63
- package/dist/layout/ApplicationLayout.js +3 -3
- package/dist/link/Link.js +76 -39
- package/dist/main.d.ts +8 -0
- package/dist/main.js +59 -3
- 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 +41 -13
- package/dist/password-input/PasswordInput.js +198 -0
- package/dist/password-input/index.d.ts +94 -0
- package/dist/progress-bar/ProgressBar.js +88 -38
- package/dist/radio/Radio.js +28 -9
- package/dist/resultsetTable/ResultsetTable.js +64 -38
- package/dist/select/Select.js +207 -148
- package/dist/sidenav/Sidenav.js +15 -15
- package/dist/slider/Slider.js +190 -63
- package/dist/spinner/Spinner.js +226 -59
- package/dist/switch/Switch.js +42 -14
- package/dist/table/Table.js +45 -11
- package/dist/tabs/Tabs.js +37 -19
- package/dist/tag/Tag.js +50 -36
- package/dist/text-input/TextInput.js +971 -0
- package/dist/text-input/index.d.ts +135 -0
- package/dist/textarea/Textarea.js +59 -33
- package/dist/toggle-group/ToggleGroup.js +139 -35
- package/dist/upload/Upload.js +4 -8
- package/dist/upload/buttons-upload/ButtonsUpload.js +27 -11
- package/dist/upload/dragAndDropArea/DragAndDropArea.js +54 -18
- package/dist/upload/file-upload/FileToUpload.js +37 -15
- package/dist/upload/files-upload/FilesToUpload.js +3 -3
- package/dist/upload/readme.md +2 -2
- package/dist/upload/transaction/Transaction.js +39 -16
- package/dist/upload/transactions/Transactions.js +24 -8
- package/dist/wizard/Wizard.js +106 -50
- package/dist/wizard/invalid_icon.svg +4 -5
- package/dist/wizard/valid_icon.svg +4 -5
- package/package.json +6 -4
- 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/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
package/dist/header/Header.js
CHANGED
|
@@ -33,8 +33,10 @@ var _variables = require("../common/variables.js");
|
|
|
33
33
|
|
|
34
34
|
var _useTheme = _interopRequireDefault(require("../useTheme.js"));
|
|
35
35
|
|
|
36
|
+
var _BackgroundColorContext = require("../BackgroundColorContext.js");
|
|
37
|
+
|
|
36
38
|
function _templateObject12() {
|
|
37
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background-color: ", ";\n opacity:
|
|
39
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background-color: ", ";\n opacity: ", " !important;\n visibility: ", ";\n opacity: ", ";\n display: ", ";\n transition: opacity 0.2s 0.2s ease-in-out;\n z-index: ", ";\n"]);
|
|
38
40
|
|
|
39
41
|
_templateObject12 = function _templateObject12() {
|
|
40
42
|
return data;
|
|
@@ -64,7 +66,7 @@ function _templateObject10() {
|
|
|
64
66
|
}
|
|
65
67
|
|
|
66
68
|
function _templateObject9() {
|
|
67
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: space-evenly;\n background-color: ", ";\n position: fixed;\n top: 0;\n right: 0;\n z-index:
|
|
69
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: space-evenly;\n background-color: ", ";\n position: fixed;\n top: 0;\n right: 0;\n z-index: ", ";\n width: ", ";\n height: 100vh;\n padding: 20px;\n transform: ", ";\n opacity: ", ";\n transition-property: transform, opacity;\n transition-duration: 0.6s;\n transition-timing-function: ease-in-out;\n box-sizing: border-box;\n\n & > img:first-of-type {\n position: absolute;\n top: 23px;\n left: 20px;\n }\n\n & > img:last-of-type {\n position: fixed;\n top: 23px;\n right: 20px;\n width: 24px;\n height: 24px;\n padding: ", ";\n }\n"]);
|
|
68
70
|
|
|
69
71
|
_templateObject9 = function _templateObject9() {
|
|
70
72
|
return data;
|
|
@@ -84,7 +86,7 @@ function _templateObject8() {
|
|
|
84
86
|
}
|
|
85
87
|
|
|
86
88
|
function _templateObject7() {
|
|
87
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-size: ", ";\n text-transform: ", ";\n font-weight: ", ";\n"]);
|
|
89
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-style: ", ";\n font-size: ", ";\n text-transform: ", ";\n font-weight: ", ";\n color: ", ";\n"]);
|
|
88
90
|
|
|
89
91
|
_templateObject7 = function _templateObject7() {
|
|
90
92
|
return data;
|
|
@@ -114,7 +116,7 @@ function _templateObject5() {
|
|
|
114
116
|
}
|
|
115
117
|
|
|
116
118
|
function _templateObject4() {
|
|
117
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n max-height:
|
|
119
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n max-height: ", ";\n width: ", ";\n vertical-align: middle;\n"]);
|
|
118
120
|
|
|
119
121
|
_templateObject4 = function _templateObject4() {
|
|
120
122
|
return data;
|
|
@@ -134,7 +136,7 @@ function _templateObject3() {
|
|
|
134
136
|
}
|
|
135
137
|
|
|
136
138
|
function _templateObject2() {
|
|
137
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
139
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n margin-bottom: ", ";\n\n &.MuiAppBar-colorPrimary {\n background-color: ", ";\n border-bottom: ", ";\n\n &.MuiPaper-elevation4 {\n box-shadow: none;\n }\n .ChildComponents {\n display: flex;\n align-items: center;\n }\n }\n & {\n min-height: ", ";\n }\n &.MuiAppBar-root {\n flex-direction: row;\n align-items: center;\n padding: ", ";\n justify-content: space-between;\n }\n"]);
|
|
138
140
|
|
|
139
141
|
_templateObject2 = function _templateObject2() {
|
|
140
142
|
return data;
|
|
@@ -144,7 +146,7 @@ function _templateObject2() {
|
|
|
144
146
|
}
|
|
145
147
|
|
|
146
148
|
function _templateObject() {
|
|
147
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n button {\n
|
|
149
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n button {\n background-color: transparent;\n :hover {\n background-color: transparent;\n }\n }\n"]);
|
|
148
150
|
|
|
149
151
|
_templateObject = function _templateObject() {
|
|
150
152
|
return data;
|
|
@@ -157,9 +159,7 @@ var Dropdown = function Dropdown(props) {
|
|
|
157
159
|
return _react["default"].createElement(HeaderDropdown, null, _react["default"].createElement(_Dropdown["default"], props));
|
|
158
160
|
};
|
|
159
161
|
|
|
160
|
-
var HeaderDropdown = _styledComponents["default"].div(_templateObject()
|
|
161
|
-
return props.theme.fontColor;
|
|
162
|
-
});
|
|
162
|
+
var HeaderDropdown = _styledComponents["default"].div(_templateObject());
|
|
163
163
|
|
|
164
164
|
var DxcHeader = function DxcHeader(_ref) {
|
|
165
165
|
var _ref$underlined = _ref.underlined,
|
|
@@ -275,22 +275,22 @@ var DxcHeader = function DxcHeader(_ref) {
|
|
|
275
275
|
refSize: refSize
|
|
276
276
|
}))), !isResponsive && _react["default"].createElement(ChildContainer, {
|
|
277
277
|
padding: padding
|
|
278
|
-
},
|
|
278
|
+
}, _react["default"].createElement(_BackgroundColorContext.BackgroundColorProvider, {
|
|
279
|
+
color: colorsTheme.header.backgroundColor
|
|
280
|
+
}, content))));
|
|
279
281
|
};
|
|
280
282
|
|
|
281
283
|
DxcHeader.Dropdown = Dropdown;
|
|
282
284
|
var HeaderContainer = (0, _styledComponents["default"])(_AppBar["default"])(_templateObject2(), function (props) {
|
|
283
|
-
return props.theme.fontSizeBase;
|
|
284
|
-
}, function (props) {
|
|
285
285
|
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
286
286
|
}, function (props) {
|
|
287
287
|
return props.theme.backgroundColor;
|
|
288
288
|
}, function (props) {
|
|
289
|
-
return props.theme.
|
|
289
|
+
return props.underlined && "".concat(props.theme.underlinedThickness, " ").concat(props.theme.underlinedStyle, " ").concat(props.theme.underlinedColor);
|
|
290
290
|
}, function (props) {
|
|
291
|
-
return props.
|
|
291
|
+
return props.theme.minHeight;
|
|
292
292
|
}, function (props) {
|
|
293
|
-
return props.theme.
|
|
293
|
+
return "".concat(props.theme.paddingTop, " ").concat(props.theme.paddingRight, " ").concat(props.theme.paddingBottom, " ").concat(props.theme.paddingLeft);
|
|
294
294
|
});
|
|
295
295
|
|
|
296
296
|
var LogoAnchor = _styledComponents["default"].a(_templateObject3(), function (props) {
|
|
@@ -301,7 +301,11 @@ var LogoAnchor = _styledComponents["default"].a(_templateObject3(), function (pr
|
|
|
301
301
|
}
|
|
302
302
|
});
|
|
303
303
|
|
|
304
|
-
var LogoIcon = _styledComponents["default"].img(_templateObject4())
|
|
304
|
+
var LogoIcon = _styledComponents["default"].img(_templateObject4(), function (props) {
|
|
305
|
+
return props.theme.logoHeight;
|
|
306
|
+
}, function (props) {
|
|
307
|
+
return props.theme.logoWidth;
|
|
308
|
+
});
|
|
305
309
|
|
|
306
310
|
var ChildContainer = _styledComponents["default"].div(_templateObject5(), function (props) {
|
|
307
311
|
return props.padding && (0, _typeof2["default"])(props.padding) !== "object" ? _variables.spaces[props.padding] : "0px";
|
|
@@ -316,29 +320,39 @@ var ChildContainer = _styledComponents["default"].div(_templateObject5(), functi
|
|
|
316
320
|
});
|
|
317
321
|
|
|
318
322
|
var HamburguerItem = _styledComponents["default"].div(_templateObject6(), function (props) {
|
|
319
|
-
return props.theme.
|
|
323
|
+
return props.theme.hamburguerHoverColor;
|
|
320
324
|
}, function (props) {
|
|
321
|
-
return props.theme.
|
|
325
|
+
return props.theme.hamburguerFocusColor;
|
|
322
326
|
}, function (props) {
|
|
323
|
-
return props.theme.
|
|
327
|
+
return props.theme.hamburguerIconColor;
|
|
324
328
|
});
|
|
325
329
|
|
|
326
330
|
var HamburguerTitle = _styledComponents["default"].span(_templateObject7(), function (props) {
|
|
327
|
-
return props.theme.
|
|
331
|
+
return props.theme.hamburguerFontFamily;
|
|
328
332
|
}, function (props) {
|
|
329
|
-
return props.theme.
|
|
333
|
+
return props.theme.hamburguerFontStyle;
|
|
330
334
|
}, function (props) {
|
|
331
|
-
return props.theme.
|
|
335
|
+
return props.theme.hamburguerFontSize;
|
|
336
|
+
}, function (props) {
|
|
337
|
+
return props.theme.hamburguerTextTransform;
|
|
338
|
+
}, function (props) {
|
|
339
|
+
return props.theme.hamburguerFontWeight;
|
|
340
|
+
}, function (props) {
|
|
341
|
+
return props.theme.hamburguerFontColor;
|
|
332
342
|
});
|
|
333
343
|
|
|
334
344
|
var MainContainer = _styledComponents["default"].div(_templateObject8());
|
|
335
345
|
|
|
336
346
|
var ResponsiveMenu = _styledComponents["default"].div(_templateObject9(), function (props) {
|
|
337
|
-
return props.theme.
|
|
347
|
+
return props.theme.menuBackgroundColor;
|
|
338
348
|
}, function (props) {
|
|
339
|
-
return props.theme.
|
|
349
|
+
return props.theme.menuZindex;
|
|
340
350
|
}, function (props) {
|
|
341
|
-
return props.refSize <= _variables.responsiveSizes.laptop && props.refSize > _variables.responsiveSizes.mobileLarge ? "
|
|
351
|
+
return props.refSize <= _variables.responsiveSizes.laptop && props.refSize > _variables.responsiveSizes.mobileLarge ? "".concat(function (props) {
|
|
352
|
+
return props.theme.menuTabletWidth;
|
|
353
|
+
}) : "".concat(function (props) {
|
|
354
|
+
return props.theme.menuMobileWidth;
|
|
355
|
+
});
|
|
342
356
|
}, function (props) {
|
|
343
357
|
return props.hasVisibility ? "translateX(0)" : "translateX(100vw)";
|
|
344
358
|
}, function (props) {
|
|
@@ -348,17 +362,21 @@ var ResponsiveMenu = _styledComponents["default"].div(_templateObject9(), functi
|
|
|
348
362
|
var MenuContent = _styledComponents["default"].div(_templateObject10());
|
|
349
363
|
|
|
350
364
|
var CloseContainer = _styledComponents["default"].img(_templateObject11(), function (props) {
|
|
351
|
-
return props.theme.
|
|
365
|
+
return props.theme.hamburguerFocusColor;
|
|
352
366
|
});
|
|
353
367
|
|
|
354
368
|
var Overlay = _styledComponents["default"].div(_templateObject12(), function (props) {
|
|
355
369
|
return props.theme.overlayColor;
|
|
370
|
+
}, function (props) {
|
|
371
|
+
return props.theme.overlayOpacity;
|
|
356
372
|
}, function (props) {
|
|
357
373
|
return props.hasVisibility ? "visible" : "hidden";
|
|
358
374
|
}, function (props) {
|
|
359
375
|
return props.hasVisibility ? "1" : "0";
|
|
360
376
|
}, function (props) {
|
|
361
377
|
return props.refSize <= _variables.responsiveSizes.mobileLarge ? "none" : "";
|
|
378
|
+
}, function (props) {
|
|
379
|
+
return props.theme.overlayZindex;
|
|
362
380
|
});
|
|
363
381
|
|
|
364
382
|
DxcHeader.propTypes = {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="73" height="40" viewBox="0 0 73 40">
|
|
2
|
+
<g id="g10" transform="translate(0)">
|
|
3
|
+
<g id="g12">
|
|
4
|
+
<path id="path14" d="M91.613-28.177v2.514H90.231V-28.15l-2.415-3.82h1.616l1.5,2.532,1.526-2.532h1.571ZM83.9-25.555A3.15,3.15,0,0,1,80.6-28.8v-.018a3.231,3.231,0,0,1,3.294-3.262,3.442,3.442,0,0,1,2.469.865l-.87,1.054a2.311,2.311,0,0,0-1.643-.64,1.891,1.891,0,0,0-1.8,1.964v.018a1.886,1.886,0,0,0,1.9,2,2.2,2.2,0,0,0,1.3-.378v-.9H83.858v-1.2h2.729v2.738A4.071,4.071,0,0,1,83.9-25.555Zm-6.416-3.261a1.913,1.913,0,0,0-1.9-1.982A1.883,1.883,0,0,0,73.7-28.835v.018a1.913,1.913,0,0,0,1.9,1.982A1.883,1.883,0,0,0,77.486-28.8Zm-1.9,3.261a3.225,3.225,0,0,1-3.33-3.243v-.018A3.255,3.255,0,0,1,75.6-32.078a3.225,3.225,0,0,1,3.331,3.243v.018A3.255,3.255,0,0,1,75.583-25.555Zm-9.173-.108V-31.97h1.382v5.045h3.133v1.261Zm-3.433-3.153a1.913,1.913,0,0,0-1.9-1.982,1.883,1.883,0,0,0-1.886,1.964v.018a1.913,1.913,0,0,0,1.9,1.982A1.883,1.883,0,0,0,62.978-28.8Zm-1.9,3.261a3.225,3.225,0,0,1-3.33-3.243v-.018a3.255,3.255,0,0,1,3.348-3.262,3.225,3.225,0,0,1,3.331,3.243v.018A3.255,3.255,0,0,1,61.075-25.555Zm-6.508-.108-3.043-4.009v4.009H50.159V-31.97h1.275l2.944,3.883V-31.97h1.364v6.306Zm-8.246,0v-2.531h-2.55v2.531H42.389V-31.97h1.382v2.5h2.55v-2.5H47.7v6.306Zm-8.432.108A3.178,3.178,0,0,1,34.666-28.8v-.018a3.2,3.2,0,0,1,3.276-3.262,3.237,3.237,0,0,1,2.478.973l-.88,1.018a2.315,2.315,0,0,0-1.606-.712,1.866,1.866,0,0,0-1.822,1.964v.018a1.87,1.87,0,0,0,1.822,1.982,2.265,2.265,0,0,0,1.651-.739l.88.891A3.206,3.206,0,0,1,37.889-25.555Zm-9.805-.108V-31.97h4.739v1.235H29.458v1.279h2.962v1.234H29.458V-26.9h3.411v1.234ZM24.322-30.69v5.027H22.939V-30.69H21.028v-1.28h5.206v1.28H24.322" transform="translate(-21.028 65.555)" fill="#100f0d"/>
|
|
5
|
+
<path id="path16" d="M75.836-76.712a8.975,8.975,0,0,1,2.246-3.9,8.393,8.393,0,0,1,6.058-2.457h9.824v-5.67H84.139a14.611,14.611,0,0,0-10.232,4.221,14.509,14.509,0,0,0-3.076,4.536,11.913,11.913,0,0,0-.973,3.271Zm0,4.325a8.978,8.978,0,0,0,2.246,3.9,8.394,8.394,0,0,0,6.058,2.457h9.824v5.67H84.139A14.611,14.611,0,0,1,73.907-64.58a14.506,14.506,0,0,1-3.076-4.536,11.91,11.91,0,0,1-.973-3.271ZM57.522-69.832l-7.5,9.473H42.581L53.818-74.55,42.581-88.739H50.02l7.5,9.472,7.5-9.472h7.439L61.225-74.55l11.237,14.19H65.023Zm-12.336-6.88a11.935,11.935,0,0,0-.973-3.271,14.515,14.515,0,0,0-3.076-4.536A14.612,14.612,0,0,0,30.9-88.739H21.081v5.67H30.9a8.394,8.394,0,0,1,6.058,2.457,8.978,8.978,0,0,1,2.246,3.9Zm0,4.325a11.932,11.932,0,0,1-.973,3.271,14.511,14.511,0,0,1-3.076,4.536A14.611,14.611,0,0,1,30.9-60.359H21.081v-5.67H30.9a8.4,8.4,0,0,0,6.058-2.457,8.981,8.981,0,0,0,2.246-3.9h5.978" transform="translate(-21.049 88.739)" fill="#100f0d"/>
|
|
6
|
+
</g>
|
|
7
|
+
</g>
|
|
8
|
+
</svg>
|
package/dist/heading/Heading.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
+
|
|
3
5
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
6
|
|
|
5
7
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -15,16 +17,16 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
|
|
|
15
17
|
|
|
16
18
|
var _react = _interopRequireDefault(require("react"));
|
|
17
19
|
|
|
18
|
-
var _styledComponents =
|
|
20
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
19
21
|
|
|
20
22
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
21
23
|
|
|
22
24
|
var _variables = require("../common/variables.js");
|
|
23
25
|
|
|
24
|
-
var
|
|
26
|
+
var _useTheme = _interopRequireDefault(require("../useTheme.js"));
|
|
25
27
|
|
|
26
28
|
function _templateObject6() {
|
|
27
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-size: ", ";\n line-height: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n margin: 0;\n"]);
|
|
29
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-style: ", ";\n font-size: ", ";\n line-height: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n color: ", ";\n margin: 0;\n"]);
|
|
28
30
|
|
|
29
31
|
_templateObject6 = function _templateObject6() {
|
|
30
32
|
return data;
|
|
@@ -34,7 +36,7 @@ function _templateObject6() {
|
|
|
34
36
|
}
|
|
35
37
|
|
|
36
38
|
function _templateObject5() {
|
|
37
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-size: ", ";\n line-height: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n margin: 0;\n"]);
|
|
39
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-style: ", ";\n font-size: ", ";\n line-height: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n color: ", ";\n margin: 0;\n"]);
|
|
38
40
|
|
|
39
41
|
_templateObject5 = function _templateObject5() {
|
|
40
42
|
return data;
|
|
@@ -44,7 +46,7 @@ function _templateObject5() {
|
|
|
44
46
|
}
|
|
45
47
|
|
|
46
48
|
function _templateObject4() {
|
|
47
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-size: ", ";\n line-height: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n margin: 0;\n"]);
|
|
49
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-style: ", ";\n font-size: ", ";\n line-height: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n color: ", ";\n margin: 0;\n"]);
|
|
48
50
|
|
|
49
51
|
_templateObject4 = function _templateObject4() {
|
|
50
52
|
return data;
|
|
@@ -54,7 +56,7 @@ function _templateObject4() {
|
|
|
54
56
|
}
|
|
55
57
|
|
|
56
58
|
function _templateObject3() {
|
|
57
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-size: ", ";\n line-height: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n margin: 0;\n"]);
|
|
59
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-style: ", ";\n font-size: ", ";\n line-height: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n color: ", ";\n margin: 0;\n"]);
|
|
58
60
|
|
|
59
61
|
_templateObject3 = function _templateObject3() {
|
|
60
62
|
return data;
|
|
@@ -64,7 +66,7 @@ function _templateObject3() {
|
|
|
64
66
|
}
|
|
65
67
|
|
|
66
68
|
function _templateObject2() {
|
|
67
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-size: ", ";\n line-height: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n margin: 0;\n"]);
|
|
69
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-style: ", ";\n font-size: ", ";\n line-height: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n color: ", ";\n margin: 0;\n"]);
|
|
68
70
|
|
|
69
71
|
_templateObject2 = function _templateObject2() {
|
|
70
72
|
return data;
|
|
@@ -74,7 +76,7 @@ function _templateObject2() {
|
|
|
74
76
|
}
|
|
75
77
|
|
|
76
78
|
function _templateObject() {
|
|
77
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n
|
|
79
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n"]);
|
|
78
80
|
|
|
79
81
|
_templateObject = function _templateObject() {
|
|
80
82
|
return data;
|
|
@@ -91,7 +93,10 @@ var DxcHeading = function DxcHeading(_ref) {
|
|
|
91
93
|
_ref$weight = _ref.weight,
|
|
92
94
|
weight = _ref$weight === void 0 ? "" : _ref$weight,
|
|
93
95
|
margin = _ref.margin;
|
|
94
|
-
|
|
96
|
+
var colorsTheme = (0, _useTheme["default"])();
|
|
97
|
+
return _react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
98
|
+
theme: colorsTheme.heading
|
|
99
|
+
}, _react["default"].createElement(HeadingContainer, {
|
|
95
100
|
margin: margin
|
|
96
101
|
}, level === 1 ? _react["default"].createElement(HeadingLevel1, {
|
|
97
102
|
weight: weight
|
|
@@ -103,7 +108,7 @@ var DxcHeading = function DxcHeading(_ref) {
|
|
|
103
108
|
weight: weight
|
|
104
109
|
}, text) : _react["default"].createElement(HeadingLevel5, {
|
|
105
110
|
weight: weight
|
|
106
|
-
}, text));
|
|
111
|
+
}, text)));
|
|
107
112
|
};
|
|
108
113
|
|
|
109
114
|
var HeadingContainer = _styledComponents["default"].div(_templateObject(), function (props) {
|
|
@@ -116,37 +121,87 @@ var HeadingContainer = _styledComponents["default"].div(_templateObject(), funct
|
|
|
116
121
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.bottom ? _variables.spaces[props.margin.bottom] : "";
|
|
117
122
|
}, function (props) {
|
|
118
123
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
var HeadingLevel1 = _styledComponents["default"].h1(_templateObject2(), _variables.componentTokens === null || _variables.componentTokens === void 0 ? void 0 : (_componentTokens$head3 = _variables.componentTokens.heading) === null || _componentTokens$head3 === void 0 ? void 0 : _componentTokens$head3.fontSize60, _variables.componentTokens === null || _variables.componentTokens === void 0 ? void 0 : (_componentTokens$head4 = _variables.componentTokens.heading) === null || _componentTokens$head4 === void 0 ? void 0 : _componentTokens$head4.fontHeightLevelCompact, function (props) {
|
|
122
|
-
var _componentTokens$head5, _componentTokens$head6, _componentTokens$head7;
|
|
123
|
-
|
|
124
|
-
return props.weight === "light" || props.weight === "" ? _variables.componentTokens === null || _variables.componentTokens === void 0 ? void 0 : (_componentTokens$head5 = _variables.componentTokens.heading) === null || _componentTokens$head5 === void 0 ? void 0 : _componentTokens$head5.fontWeightLight : props.weight === "normal" ? _variables.componentTokens === null || _variables.componentTokens === void 0 ? void 0 : (_componentTokens$head6 = _variables.componentTokens.heading) === null || _componentTokens$head6 === void 0 ? void 0 : _componentTokens$head6.fontWeight400 : _variables.componentTokens === null || _variables.componentTokens === void 0 ? void 0 : (_componentTokens$head7 = _variables.componentTokens.heading) === null || _componentTokens$head7 === void 0 ? void 0 : _componentTokens$head7.fontWeight600;
|
|
125
|
-
}, _variables.componentTokens === null || _variables.componentTokens === void 0 ? void 0 : (_componentTokens$head8 = _variables.componentTokens.heading) === null || _componentTokens$head8 === void 0 ? void 0 : _componentTokens$head8.fontLetterSpacingTight01);
|
|
126
|
-
|
|
127
|
-
var HeadingLevel2 = _styledComponents["default"].h2(_templateObject3(), _variables.componentTokens === null || _variables.componentTokens === void 0 ? void 0 : (_componentTokens$head9 = _variables.componentTokens.heading) === null || _componentTokens$head9 === void 0 ? void 0 : _componentTokens$head9.fontSize48, _variables.componentTokens === null || _variables.componentTokens === void 0 ? void 0 : (_componentTokens$head10 = _variables.componentTokens.heading) === null || _componentTokens$head10 === void 0 ? void 0 : _componentTokens$head10.fontHeightLevelNormal, function (props) {
|
|
128
|
-
var _componentTokens$head11, _componentTokens$head12, _componentTokens$head13;
|
|
129
|
-
|
|
130
|
-
return props.weight === "normal" || props.weight === "" ? _variables.componentTokens === null || _variables.componentTokens === void 0 ? void 0 : (_componentTokens$head11 = _variables.componentTokens.heading) === null || _componentTokens$head11 === void 0 ? void 0 : _componentTokens$head11.fontWeight400 : props.weight === "light" ? _variables.componentTokens === null || _variables.componentTokens === void 0 ? void 0 : (_componentTokens$head12 = _variables.componentTokens.heading) === null || _componentTokens$head12 === void 0 ? void 0 : _componentTokens$head12.fontWeightLight : _variables.componentTokens === null || _variables.componentTokens === void 0 ? void 0 : (_componentTokens$head13 = _variables.componentTokens.heading) === null || _componentTokens$head13 === void 0 ? void 0 : _componentTokens$head13.fontWeight600;
|
|
131
|
-
}, _variables.componentTokens === null || _variables.componentTokens === void 0 ? void 0 : (_componentTokens$head14 = _variables.componentTokens.heading) === null || _componentTokens$head14 === void 0 ? void 0 : _componentTokens$head14.type_spacing_normal);
|
|
132
|
-
|
|
133
|
-
var HeadingLevel3 = _styledComponents["default"].h3(_templateObject4(), _variables.componentTokens === null || _variables.componentTokens === void 0 ? void 0 : (_componentTokens$head15 = _variables.componentTokens.heading) === null || _componentTokens$head15 === void 0 ? void 0 : _componentTokens$head15.fontSize34, _variables.componentTokens === null || _variables.componentTokens === void 0 ? void 0 : (_componentTokens$head16 = _variables.componentTokens.heading) === null || _componentTokens$head16 === void 0 ? void 0 : _componentTokens$head16.fontHeightLevelCompact, function (props) {
|
|
134
|
-
var _componentTokens$head17, _componentTokens$head18, _componentTokens$head19;
|
|
124
|
+
});
|
|
135
125
|
|
|
136
|
-
|
|
137
|
-
|
|
126
|
+
var HeadingLevel1 = _styledComponents["default"].h1(_templateObject2(), function (props) {
|
|
127
|
+
return props.theme.level1FontFamily;
|
|
128
|
+
}, function (props) {
|
|
129
|
+
return props.theme.level1FontStyle;
|
|
130
|
+
}, function (props) {
|
|
131
|
+
return props.theme.level1FontSize;
|
|
132
|
+
}, function (props) {
|
|
133
|
+
return props.theme.level1LineHeight;
|
|
134
|
+
}, function (props) {
|
|
135
|
+
return props.weight === "normal" ? "400" : props.weight === "light" ? "300" : props.weight === "bold" ? "600" : props.theme.level1FontWeight;
|
|
136
|
+
}, function (props) {
|
|
137
|
+
return props.theme.level1LetterSpacing;
|
|
138
|
+
}, function (props) {
|
|
139
|
+
return props.theme.level1FontColor;
|
|
140
|
+
});
|
|
138
141
|
|
|
139
|
-
var
|
|
140
|
-
|
|
142
|
+
var HeadingLevel2 = _styledComponents["default"].h2(_templateObject3(), function (props) {
|
|
143
|
+
return props.theme.level2FontFamily;
|
|
144
|
+
}, function (props) {
|
|
145
|
+
return props.theme.level2FontStyle;
|
|
146
|
+
}, function (props) {
|
|
147
|
+
return props.theme.level2FontSize;
|
|
148
|
+
}, function (props) {
|
|
149
|
+
return props.theme.level2LineHeight;
|
|
150
|
+
}, function (props) {
|
|
151
|
+
return props.weight === "normal" ? "400" : props.weight === "light" ? "300" : props.weight === "bold" ? "600" : props.theme.level2FontWeight;
|
|
152
|
+
}, function (props) {
|
|
153
|
+
return props.theme.level2LetterSpacing;
|
|
154
|
+
}, function (props) {
|
|
155
|
+
return props.theme.level2FontColor;
|
|
156
|
+
});
|
|
141
157
|
|
|
142
|
-
|
|
143
|
-
|
|
158
|
+
var HeadingLevel3 = _styledComponents["default"].h3(_templateObject4(), function (props) {
|
|
159
|
+
return props.theme.level3FontFamily;
|
|
160
|
+
}, function (props) {
|
|
161
|
+
return props.theme.level3FontStyle;
|
|
162
|
+
}, function (props) {
|
|
163
|
+
return props.theme.level3FontSize;
|
|
164
|
+
}, function (props) {
|
|
165
|
+
return props.theme.level3LineHeight;
|
|
166
|
+
}, function (props) {
|
|
167
|
+
return props.weight === "normal" ? "400" : props.weight === "light" ? "300" : props.weight === "bold" ? "600" : props.theme.level3FontWeight;
|
|
168
|
+
}, function (props) {
|
|
169
|
+
return props.theme.level3LetterSpacing;
|
|
170
|
+
}, function (props) {
|
|
171
|
+
return props.theme.level3FontColor;
|
|
172
|
+
});
|
|
144
173
|
|
|
145
|
-
var
|
|
146
|
-
|
|
174
|
+
var HeadingLevel4 = _styledComponents["default"].h4(_templateObject5(), function (props) {
|
|
175
|
+
return props.theme.level4FontFamily;
|
|
176
|
+
}, function (props) {
|
|
177
|
+
return props.theme.level4FontStyle;
|
|
178
|
+
}, function (props) {
|
|
179
|
+
return props.theme.level4FontSize;
|
|
180
|
+
}, function (props) {
|
|
181
|
+
return props.theme.level4LineHeight;
|
|
182
|
+
}, function (props) {
|
|
183
|
+
return props.weight === "normal" ? "400" : props.weight === "light" ? "300" : props.weight === "bold" ? "600" : props.theme.level4FontWeight;
|
|
184
|
+
}, function (props) {
|
|
185
|
+
return props.theme.level4LetterSpacing;
|
|
186
|
+
}, function (props) {
|
|
187
|
+
return props.theme.level4FontColor;
|
|
188
|
+
});
|
|
147
189
|
|
|
148
|
-
|
|
149
|
-
|
|
190
|
+
var HeadingLevel5 = _styledComponents["default"].h5(_templateObject6(), function (props) {
|
|
191
|
+
return props.theme.level5FontFamily;
|
|
192
|
+
}, function (props) {
|
|
193
|
+
return props.theme.level5FontStyle;
|
|
194
|
+
}, function (props) {
|
|
195
|
+
return props.theme.level5FontSize;
|
|
196
|
+
}, function (props) {
|
|
197
|
+
return props.theme.level5LineHeight;
|
|
198
|
+
}, function (props) {
|
|
199
|
+
return props.weight === "normal" ? "400" : props.weight === "light" ? "300" : props.weight === "bold" ? "600" : props.theme.level5FontWeight;
|
|
200
|
+
}, function (props) {
|
|
201
|
+
return props.theme.level5LetterSpacing;
|
|
202
|
+
}, function (props) {
|
|
203
|
+
return props.theme.level5FontColor;
|
|
204
|
+
});
|
|
150
205
|
|
|
151
206
|
DxcHeading.propTypes = {
|
|
152
207
|
level: _propTypes["default"].number,
|