@dxc-technology/halstack-react 0.0.0-e961efe → 0.0.0-e9cf865
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/BackgroundColorContext.d.ts +10 -0
- package/BackgroundColorContext.js +48 -0
- package/ThemeContext.d.ts +15 -0
- package/ThemeContext.js +243 -0
- package/{dist/V3Select → V3Select}/V3Select.js +35 -129
- package/{dist/V3Select → V3Select}/index.d.ts +0 -0
- package/{dist/V3Textarea → V3Textarea}/V3Textarea.js +12 -16
- package/{dist/V3Textarea → V3Textarea}/index.d.ts +0 -0
- package/accordion/Accordion.d.ts +4 -0
- package/{dist/accordion → accordion}/Accordion.js +37 -132
- package/accordion/types.d.ts +68 -0
- package/accordion/types.js +5 -0
- package/accordion-group/AccordionGroup.d.ts +7 -0
- package/accordion-group/AccordionGroup.js +170 -0
- package/accordion-group/AccordionGroup.stories.tsx +225 -0
- package/accordion-group/types.d.ts +72 -0
- package/accordion-group/types.js +5 -0
- package/alert/Alert.d.ts +4 -0
- package/{dist/alert → alert}/Alert.js +40 -153
- package/alert/Alert.stories.tsx +170 -0
- package/alert/types.d.ts +49 -0
- package/alert/types.js +5 -0
- package/badge/Badge.js +59 -0
- package/box/Box.d.ts +4 -0
- package/{dist/box → box}/Box.js +15 -45
- package/box/Box.stories.tsx +132 -0
- package/box/types.d.ts +43 -0
- package/box/types.js +5 -0
- package/button/Button.d.ts +4 -0
- package/{dist/button → button}/Button.js +24 -83
- package/button/Button.stories.tsx +276 -0
- package/button/types.d.ts +57 -0
- package/button/types.js +5 -0
- package/card/Card.d.ts +4 -0
- package/{dist/card → card}/Card.js +34 -124
- package/card/Card.stories.tsx +201 -0
- package/card/ice-cream.jpg +0 -0
- package/card/types.d.ts +67 -0
- package/card/types.js +5 -0
- package/checkbox/Checkbox.d.ts +4 -0
- package/{dist/checkbox → checkbox}/Checkbox.js +15 -61
- package/checkbox/Checkbox.stories.tsx +192 -0
- package/checkbox/types.d.ts +60 -0
- package/checkbox/types.js +5 -0
- package/chip/Chip.d.ts +4 -0
- package/{dist/chip → chip}/Chip.js +18 -84
- package/chip/Chip.stories.tsx +121 -0
- package/chip/types.d.ts +53 -0
- package/chip/types.js +5 -0
- package/{dist/common → common}/OpenSans.css +0 -0
- package/{dist/common → common}/RequiredComponent.js +3 -11
- package/{dist/common → common}/fonts/OpenSans-Bold.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-BoldItalic.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-ExtraBold.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-ExtraBoldItalic.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-Italic.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-Light.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-LightItalic.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-Regular.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-SemiBold.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-SemiBoldItalic.ttf +0 -0
- package/{dist/common → common}/utils.js +0 -0
- package/{dist/common → common}/variables.js +88 -88
- package/{dist/date → date}/Date.js +17 -23
- package/{dist/date → date}/index.d.ts +0 -0
- package/date-input/DateInput.d.ts +4 -0
- package/{dist/date-input → date-input}/DateInput.js +26 -68
- package/date-input/DateInput.stories.tsx +138 -0
- package/date-input/types.d.ts +100 -0
- package/date-input/types.js +5 -0
- package/dialog/Dialog.d.ts +4 -0
- package/{dist/dialog → dialog}/Dialog.js +22 -75
- package/dialog/Dialog.stories.tsx +212 -0
- package/dialog/types.d.ts +43 -0
- package/dialog/types.js +5 -0
- package/dropdown/Dropdown.d.ts +4 -0
- package/{dist/dropdown → dropdown}/Dropdown.js +45 -172
- package/dropdown/types.d.ts +89 -0
- package/dropdown/types.js +5 -0
- package/file-input/FileInput.d.ts +4 -0
- package/{dist/file-input → file-input}/FileInput.js +98 -221
- package/file-input/FileItem.d.ts +14 -0
- package/file-input/FileItem.js +184 -0
- package/file-input/types.d.ts +112 -0
- package/file-input/types.js +5 -0
- package/footer/Footer.d.ts +4 -0
- package/footer/Footer.js +260 -0
- package/footer/Footer.stories.tsx +130 -0
- package/footer/Icons.d.ts +2 -0
- package/{dist/footer → footer}/Icons.js +15 -15
- package/footer/types.d.ts +65 -0
- package/footer/types.js +5 -0
- package/header/Header.d.ts +7 -0
- package/{dist/header → header}/Header.js +58 -204
- package/header/Header.stories.tsx +162 -0
- package/header/Icons.d.ts +2 -0
- package/{dist/header → header}/Icons.js +7 -32
- package/header/types.d.ts +47 -0
- package/header/types.js +5 -0
- package/heading/Heading.d.ts +4 -0
- package/{dist/heading → heading}/Heading.js +25 -96
- package/heading/Heading.stories.tsx +53 -0
- package/heading/types.d.ts +33 -0
- package/heading/types.js +5 -0
- package/{dist/input-text → input-text}/Icons.js +2 -2
- package/{dist/input-text → input-text}/InputText.js +38 -132
- package/{dist/input-text → input-text}/index.d.ts +1 -1
- package/layout/ApplicationLayout.d.ts +10 -0
- package/{dist/layout → layout}/ApplicationLayout.js +39 -141
- package/layout/ApplicationLayout.stories.tsx +171 -0
- package/{dist/layout → layout}/Icons.js +7 -7
- package/layout/types.d.ts +57 -0
- package/layout/types.js +5 -0
- package/link/Link.d.ts +3 -0
- package/{dist/link → link}/Link.js +19 -95
- package/link/Link.stories.tsx +146 -0
- package/link/types.d.ts +74 -0
- package/link/types.js +5 -0
- package/list/List.d.ts +7 -0
- package/list/List.js +37 -0
- package/list/List.stories.tsx +70 -0
- package/main.d.ts +48 -0
- package/{dist/main.js → main.js} +118 -82
- package/number-input/NumberInput.d.ts +4 -0
- package/number-input/NumberInput.js +83 -0
- package/number-input/NumberInput.stories.tsx +115 -0
- package/number-input/NumberInputContext.d.ts +4 -0
- package/{dist/number-input → number-input}/NumberInputContext.js +5 -2
- package/number-input/numberInputContextTypes.d.ts +19 -0
- package/number-input/numberInputContextTypes.js +5 -0
- package/number-input/types.d.ts +117 -0
- package/number-input/types.js +5 -0
- package/package.json +20 -17
- package/{dist/paginator → paginator}/Icons.js +9 -9
- package/paginator/Paginator.d.ts +4 -0
- package/paginator/Paginator.js +192 -0
- package/paginator/Paginator.stories.tsx +63 -0
- package/paginator/types.d.ts +38 -0
- package/paginator/types.js +5 -0
- package/password-input/PasswordInput.d.ts +4 -0
- package/{dist/password-input → password-input}/PasswordInput.js +37 -77
- package/password-input/PasswordInput.stories.tsx +131 -0
- package/password-input/types.d.ts +107 -0
- package/password-input/types.js +5 -0
- package/progress-bar/ProgressBar.d.ts +4 -0
- package/{dist/progress-bar → progress-bar}/ProgressBar.js +22 -94
- package/progress-bar/ProgressBar.stories.jsx +58 -0
- package/progress-bar/types.d.ts +37 -0
- package/progress-bar/types.js +5 -0
- package/radio/Radio.d.ts +4 -0
- package/{dist/radio → radio}/Radio.js +17 -52
- package/radio/Radio.stories.tsx +192 -0
- package/radio/types.d.ts +54 -0
- package/radio/types.js +5 -0
- package/resultsetTable/ResultsetTable.d.ts +4 -0
- package/{dist/resultsetTable → resultsetTable}/ResultsetTable.js +39 -146
- package/resultsetTable/types.d.ts +67 -0
- package/resultsetTable/types.js +5 -0
- package/row/Row.d.ts +11 -0
- package/row/Row.js +124 -0
- package/row/Row.stories.tsx +223 -0
- package/{dist/select → select}/Select.js +254 -487
- package/select/Select.stories.tsx +572 -0
- package/select/index.d.ts +131 -0
- package/sidenav/Sidenav.d.ts +9 -0
- package/{dist/sidenav → sidenav}/Sidenav.js +21 -64
- package/sidenav/Sidenav.stories.tsx +165 -0
- package/sidenav/types.d.ts +50 -0
- package/sidenav/types.js +5 -0
- package/slider/Slider.d.ts +4 -0
- package/{dist/slider → slider}/Slider.js +74 -161
- package/slider/Slider.stories.tsx +177 -0
- package/slider/types.d.ts +78 -0
- package/slider/types.js +5 -0
- package/spinner/Spinner.d.ts +4 -0
- package/spinner/Spinner.js +250 -0
- package/spinner/Spinner.stories.jsx +102 -0
- package/spinner/types.d.ts +32 -0
- package/spinner/types.js +5 -0
- package/stack/Stack.d.ts +10 -0
- package/stack/Stack.js +94 -0
- package/stack/Stack.stories.tsx +150 -0
- package/switch/Switch.d.ts +4 -0
- package/{dist/switch → switch}/Switch.js +28 -71
- package/switch/Switch.stories.tsx +160 -0
- package/switch/types.d.ts +58 -0
- package/switch/types.js +5 -0
- package/table/Table.d.ts +4 -0
- package/{dist/table → table}/Table.js +12 -26
- package/table/Table.stories.jsx +276 -0
- package/table/types.d.ts +21 -0
- package/table/types.js +5 -0
- package/tabs/Tabs.d.ts +4 -0
- package/tabs/Tabs.js +213 -0
- package/tabs/Tabs.stories.tsx +121 -0
- package/tabs/types.d.ts +70 -0
- package/tabs/types.js +5 -0
- package/tag/Tag.d.ts +4 -0
- package/tag/Tag.js +193 -0
- package/tag/Tag.stories.tsx +145 -0
- package/tag/types.d.ts +60 -0
- package/tag/types.js +5 -0
- package/text/Text.d.ts +7 -0
- package/text/Text.js +30 -0
- package/text/Text.stories.tsx +19 -0
- package/text-input/TextInput.d.ts +4 -0
- package/{dist/text-input → text-input}/TextInput.js +269 -457
- package/text-input/TextInput.stories.tsx +456 -0
- package/text-input/types.d.ts +159 -0
- package/text-input/types.js +5 -0
- package/{dist/textarea → textarea}/Textarea.js +40 -95
- package/textarea/Textarea.stories.jsx +135 -0
- package/{dist/textarea → textarea}/index.d.ts +18 -8
- package/{dist/toggle → toggle}/Toggle.js +16 -50
- package/{dist/toggle → toggle}/index.d.ts +0 -0
- package/toggle-group/ToggleGroup.d.ts +4 -0
- package/{dist/toggle-group → toggle-group}/ToggleGroup.js +30 -140
- package/toggle-group/ToggleGroup.stories.tsx +178 -0
- package/toggle-group/types.d.ts +84 -0
- package/toggle-group/types.js +5 -0
- package/{dist/upload → upload}/Upload.js +11 -15
- package/upload/buttons-upload/ButtonsUpload.js +111 -0
- package/{dist/upload → upload}/buttons-upload/Icons.js +7 -7
- package/upload/dragAndDropArea/DragAndDropArea.js +225 -0
- package/{dist/upload → upload}/dragAndDropArea/Icons.js +6 -6
- package/upload/file-upload/FileToUpload.js +115 -0
- package/{dist/upload → upload}/file-upload/Icons.js +13 -13
- package/{dist/upload → upload}/files-upload/FilesToUpload.js +13 -27
- package/{dist/upload → upload}/index.d.ts +0 -0
- package/{dist/upload → upload}/transaction/Icons.js +31 -31
- package/upload/transaction/Transaction.js +104 -0
- package/upload/transactions/Transactions.js +94 -0
- package/useTheme.d.ts +2 -0
- package/{dist/useTheme.js → useTheme.js} +1 -1
- package/{dist/wizard → wizard}/Icons.js +8 -8
- package/wizard/Wizard.d.ts +4 -0
- package/wizard/Wizard.js +231 -0
- package/wizard/Wizard.stories.jsx +224 -0
- package/wizard/types.d.ts +64 -0
- package/wizard/types.js +5 -0
- package/README.md +0 -66
- package/babel.config.js +0 -7
- package/dist/BackgroundColorContext.js +0 -46
- package/dist/ThemeContext.js +0 -250
- package/dist/accordion/index.d.ts +0 -28
- package/dist/accordion-group/AccordionGroup.js +0 -186
- package/dist/accordion-group/index.d.ts +0 -16
- package/dist/alert/index.d.ts +0 -51
- package/dist/badge/Badge.js +0 -63
- package/dist/box/index.d.ts +0 -25
- package/dist/button/index.d.ts +0 -24
- package/dist/card/index.d.ts +0 -22
- package/dist/checkbox/index.d.ts +0 -24
- package/dist/chip/index.d.ts +0 -22
- package/dist/date-input/index.d.ts +0 -95
- package/dist/dialog/index.d.ts +0 -18
- package/dist/dropdown/index.d.ts +0 -26
- package/dist/file-input/FileItem.js +0 -287
- package/dist/file-input/index.d.ts +0 -81
- package/dist/footer/Footer.js +0 -421
- package/dist/footer/index.d.ts +0 -25
- package/dist/header/index.d.ts +0 -25
- package/dist/heading/index.d.ts +0 -17
- package/dist/link/index.d.ts +0 -23
- package/dist/main.d.ts +0 -40
- package/dist/number-input/NumberInput.js +0 -136
- package/dist/number-input/index.d.ts +0 -113
- package/dist/paginator/Paginator.js +0 -305
- package/dist/paginator/index.d.ts +0 -20
- package/dist/password-input/index.d.ts +0 -94
- package/dist/progress-bar/index.d.ts +0 -18
- package/dist/radio/index.d.ts +0 -23
- package/dist/resultsetTable/index.d.ts +0 -19
- package/dist/select/index.d.ts +0 -53
- package/dist/sidenav/index.d.ts +0 -13
- package/dist/slider/index.d.ts +0 -29
- package/dist/spinner/Spinner.js +0 -381
- package/dist/spinner/index.d.ts +0 -17
- package/dist/stories/Button.js +0 -71
- package/dist/stories/Button.stories.js +0 -55
- package/dist/stories/Header.js +0 -67
- package/dist/stories/Header.stories.js +0 -31
- package/dist/stories/Introduction.stories.mdx +0 -211
- package/dist/stories/Page.js +0 -68
- package/dist/stories/Page.stories.js +0 -39
- package/dist/stories/assets/code-brackets.svg +0 -1
- package/dist/stories/assets/colors.svg +0 -1
- package/dist/stories/assets/comments.svg +0 -1
- package/dist/stories/assets/direction.svg +0 -1
- package/dist/stories/assets/flow.svg +0 -1
- package/dist/stories/assets/plugin.svg +0 -1
- package/dist/stories/assets/repo.svg +0 -1
- package/dist/stories/assets/stackalt.svg +0 -1
- package/dist/stories/button.css +0 -30
- package/dist/stories/header.css +0 -26
- package/dist/stories/page.css +0 -69
- package/dist/switch/index.d.ts +0 -24
- package/dist/table/index.d.ts +0 -13
- package/dist/tabs/Tabs.js +0 -343
- package/dist/tabs/index.d.ts +0 -19
- package/dist/tag/Tag.js +0 -282
- package/dist/tag/index.d.ts +0 -24
- package/dist/text-input/index.d.ts +0 -135
- package/dist/toggle-group/index.d.ts +0 -21
- package/dist/upload/buttons-upload/ButtonsUpload.js +0 -135
- package/dist/upload/dragAndDropArea/DragAndDropArea.js +0 -329
- package/dist/upload/file-upload/FileToUpload.js +0 -189
- package/dist/upload/transaction/Transaction.js +0 -148
- package/dist/upload/transactions/Transactions.js +0 -138
- package/dist/wizard/Wizard.js +0 -405
- package/dist/wizard/index.d.ts +0 -18
- package/test/Accordion.test.js +0 -33
- package/test/AccordionGroup.test.js +0 -125
- package/test/Alert.test.js +0 -53
- package/test/Box.test.js +0 -10
- package/test/Button.test.js +0 -18
- package/test/Card.test.js +0 -30
- package/test/Checkbox.test.js +0 -45
- package/test/Chip.test.js +0 -25
- package/test/Date.test.js +0 -395
- package/test/DateInput.test.js +0 -242
- package/test/Dialog.test.js +0 -23
- package/test/Dropdown.test.js +0 -145
- package/test/FileInput.test.js +0 -201
- package/test/Footer.test.js +0 -94
- package/test/Header.test.js +0 -34
- package/test/Heading.test.js +0 -83
- package/test/InputText.test.js +0 -239
- package/test/Link.test.js +0 -43
- package/test/NumberInput.test.js +0 -259
- package/test/Paginator.test.js +0 -181
- package/test/PasswordInput.test.js +0 -83
- package/test/ProgressBar.test.js +0 -35
- package/test/Radio.test.js +0 -37
- package/test/ResultsetTable.test.js +0 -330
- package/test/Select.test.js +0 -415
- package/test/Sidenav.test.js +0 -45
- package/test/Slider.test.js +0 -74
- package/test/Spinner.test.js +0 -32
- package/test/Switch.test.js +0 -45
- package/test/Table.test.js +0 -36
- package/test/Tabs.test.js +0 -109
- package/test/Tag.test.js +0 -32
- package/test/TextInput.test.js +0 -732
- package/test/Textarea.test.js +0 -193
- package/test/ToggleGroup.test.js +0 -85
- package/test/Upload.test.js +0 -60
- package/test/V3Select.test.js +0 -212
- package/test/V3TextArea.test.js +0 -51
- package/test/Wizard.test.js +0 -130
- package/test/mocks/pngMock.js +0 -1
- package/test/mocks/svgMock.js +0 -1
package/{dist/box → box}/Box.js
RENAMED
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
-
|
|
5
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
4
|
|
|
5
|
+
var _typeof3 = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
10
|
exports["default"] = void 0;
|
|
11
11
|
|
|
12
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
13
|
-
|
|
14
12
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
15
13
|
|
|
16
14
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
@@ -19,45 +17,40 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
19
17
|
|
|
20
18
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
21
19
|
|
|
22
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
23
|
-
|
|
24
20
|
var _variables = require("../common/variables.js");
|
|
25
21
|
|
|
26
22
|
var _utils = require("../common/utils.js");
|
|
27
23
|
|
|
28
|
-
var _useTheme = _interopRequireDefault(require("../useTheme
|
|
24
|
+
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
29
25
|
|
|
30
|
-
var _BackgroundColorContext = require("../BackgroundColorContext
|
|
26
|
+
var _BackgroundColorContext = require("../BackgroundColorContext");
|
|
31
27
|
|
|
32
|
-
|
|
33
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: ", ";\n border-radius: ", ";\n border-width: ", ";\n border-style: ", ";\n border-color: ", ";\n letter-spacing: ", ";\n overflow: hidden;\n width: ", ";\n background-color: ", ";\n box-shadow: ", ";\n\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n\n padding: ", ";\n padding-top: ", ";\n padding-right: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n"]);
|
|
28
|
+
var _templateObject;
|
|
34
29
|
|
|
35
|
-
|
|
36
|
-
return data;
|
|
37
|
-
};
|
|
30
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
38
31
|
|
|
39
|
-
|
|
40
|
-
}
|
|
32
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
41
33
|
|
|
42
34
|
var DxcBox = function DxcBox(_ref) {
|
|
43
|
-
var shadowDepth = _ref.shadowDepth,
|
|
44
|
-
|
|
45
|
-
padding = _ref.padding,
|
|
35
|
+
var _ref$shadowDepth = _ref.shadowDepth,
|
|
36
|
+
shadowDepth = _ref$shadowDepth === void 0 ? 2 : _ref$shadowDepth,
|
|
46
37
|
_ref$display = _ref.display,
|
|
47
38
|
display = _ref$display === void 0 ? "inline-flex" : _ref$display,
|
|
48
39
|
children = _ref.children,
|
|
40
|
+
margin = _ref.margin,
|
|
41
|
+
padding = _ref.padding,
|
|
49
42
|
_ref$size = _ref.size,
|
|
50
43
|
size = _ref$size === void 0 ? "fitContent" : _ref$size;
|
|
51
44
|
var colorsTheme = (0, _useTheme["default"])();
|
|
52
|
-
return _react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
45
|
+
return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
53
46
|
theme: colorsTheme.box
|
|
54
|
-
}, _react["default"].createElement(StyledDxcBox, {
|
|
47
|
+
}, /*#__PURE__*/_react["default"].createElement(StyledDxcBox, {
|
|
55
48
|
shadowDepth: shadowDepth,
|
|
56
49
|
display: display,
|
|
57
50
|
margin: margin,
|
|
58
51
|
padding: padding,
|
|
59
52
|
size: size
|
|
60
|
-
}, _react["default"].createElement(_BackgroundColorContext.BackgroundColorProvider, {
|
|
53
|
+
}, /*#__PURE__*/_react["default"].createElement(_BackgroundColorContext.BackgroundColorProvider, {
|
|
61
54
|
color: colorsTheme.box.backgroundColor
|
|
62
55
|
}, children)));
|
|
63
56
|
};
|
|
@@ -78,7 +71,7 @@ var calculateWidth = function calculateWidth(margin, size, padding) {
|
|
|
78
71
|
return sizes[size];
|
|
79
72
|
};
|
|
80
73
|
|
|
81
|
-
var StyledDxcBox = _styledComponents["default"].div(_templateObject(), function (_ref2) {
|
|
74
|
+
var StyledDxcBox = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: ", ";\n border-radius: ", ";\n border-width: ", ";\n border-style: ", ";\n border-color: ", ";\n letter-spacing: ", ";\n overflow: hidden;\n width: ", ";\n background-color: ", ";\n box-shadow: ", ";\n\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n\n padding: ", ";\n padding-top: ", ";\n padding-right: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n"])), function (_ref2) {
|
|
82
75
|
var display = _ref2.display;
|
|
83
76
|
return display;
|
|
84
77
|
}, function (props) {
|
|
@@ -129,28 +122,5 @@ var StyledDxcBox = _styledComponents["default"].div(_templateObject(), function
|
|
|
129
122
|
return padding && padding.left ? _variables.spaces[padding.left] : "";
|
|
130
123
|
});
|
|
131
124
|
|
|
132
|
-
DxcBox.propTypes = {
|
|
133
|
-
size: _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(sizes))),
|
|
134
|
-
display: _propTypes["default"].string,
|
|
135
|
-
shadowDepth: _propTypes["default"].oneOf([0, 1, 2]),
|
|
136
|
-
margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
|
137
|
-
top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
138
|
-
bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
139
|
-
left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
140
|
-
right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
|
|
141
|
-
}), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
|
|
142
|
-
padding: _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
|
143
|
-
top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
144
|
-
bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
145
|
-
left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
146
|
-
right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
|
|
147
|
-
}), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))])
|
|
148
|
-
};
|
|
149
|
-
DxcBox.defaultProps = {
|
|
150
|
-
shadowDepth: 2,
|
|
151
|
-
display: "inline-flex",
|
|
152
|
-
margin: null,
|
|
153
|
-
padding: null
|
|
154
|
-
};
|
|
155
125
|
var _default = DxcBox;
|
|
156
126
|
exports["default"] = _default;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Title from "../../.storybook/components/Title";
|
|
3
|
+
import ExampleContainer from "../../.storybook/components/ExampleContainer";
|
|
4
|
+
import DxcBox from "./Box";
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: "Box ",
|
|
8
|
+
component: DxcBox,
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const Chromatic = () => (
|
|
12
|
+
<>
|
|
13
|
+
<Title title="Display flex" theme="light" level={2} />
|
|
14
|
+
<ExampleContainer>
|
|
15
|
+
<DxcBox display="flex" padding="medium">
|
|
16
|
+
Box
|
|
17
|
+
</DxcBox>
|
|
18
|
+
</ExampleContainer>
|
|
19
|
+
<Title title="ShadowDepth" theme="light" level={2} />
|
|
20
|
+
<ExampleContainer>
|
|
21
|
+
<Title title="ShadowDepth 0" theme="light" level={4} />
|
|
22
|
+
<DxcBox shadowDepth={0} margin="medium" padding="medium">
|
|
23
|
+
Box
|
|
24
|
+
</DxcBox>
|
|
25
|
+
</ExampleContainer>
|
|
26
|
+
<ExampleContainer>
|
|
27
|
+
<Title title="ShadowDepth 1" theme="light" level={4} />
|
|
28
|
+
<DxcBox shadowDepth={1} margin="medium" padding="medium">
|
|
29
|
+
Box
|
|
30
|
+
</DxcBox>
|
|
31
|
+
</ExampleContainer>
|
|
32
|
+
<ExampleContainer>
|
|
33
|
+
<Title title="ShadowDepth 2" theme="light" level={4} />
|
|
34
|
+
<DxcBox shadowDepth={2} margin="medium" padding="medium">
|
|
35
|
+
Box
|
|
36
|
+
</DxcBox>
|
|
37
|
+
</ExampleContainer>
|
|
38
|
+
<Title title="Paddings" theme="light" level={2} />
|
|
39
|
+
<ExampleContainer>
|
|
40
|
+
<Title title="Xxsmall padding" theme="light" level={4} />
|
|
41
|
+
<DxcBox padding="xxsmall">Box</DxcBox>
|
|
42
|
+
</ExampleContainer>
|
|
43
|
+
<ExampleContainer>
|
|
44
|
+
<Title title="Xsmall padding" theme="light" level={4} />
|
|
45
|
+
<DxcBox padding="xsmall">Box</DxcBox>
|
|
46
|
+
</ExampleContainer>
|
|
47
|
+
<ExampleContainer>
|
|
48
|
+
<Title title="Small padding" theme="light" level={4} />
|
|
49
|
+
<DxcBox padding="small">Box</DxcBox>
|
|
50
|
+
</ExampleContainer>
|
|
51
|
+
<ExampleContainer>
|
|
52
|
+
<Title title="Medium padding" theme="light" level={4} />
|
|
53
|
+
<DxcBox padding="medium">Box</DxcBox>
|
|
54
|
+
</ExampleContainer>
|
|
55
|
+
<ExampleContainer>
|
|
56
|
+
<Title title="Large padding" theme="light" level={4} />
|
|
57
|
+
<DxcBox padding="large">Box</DxcBox>
|
|
58
|
+
</ExampleContainer>
|
|
59
|
+
<ExampleContainer>
|
|
60
|
+
<Title title="Xlarge padding" theme="light" level={4} />
|
|
61
|
+
<DxcBox padding="xlarge">Box</DxcBox>
|
|
62
|
+
</ExampleContainer>
|
|
63
|
+
<ExampleContainer>
|
|
64
|
+
<Title title="Xxlarge padding" theme="light" level={4} />
|
|
65
|
+
<DxcBox padding="xxlarge">Box</DxcBox>
|
|
66
|
+
</ExampleContainer>
|
|
67
|
+
<Title title="Margins" theme="light" level={2} />
|
|
68
|
+
<ExampleContainer>
|
|
69
|
+
<Title title="Xxsmall margin" theme="light" level={4} />
|
|
70
|
+
<DxcBox margin="xxsmall" padding="medium">
|
|
71
|
+
Box
|
|
72
|
+
</DxcBox>
|
|
73
|
+
</ExampleContainer>
|
|
74
|
+
<ExampleContainer>
|
|
75
|
+
<Title title="Xsmall margin" theme="light" level={4} />
|
|
76
|
+
<DxcBox margin="xsmall" padding="medium">
|
|
77
|
+
Box
|
|
78
|
+
</DxcBox>
|
|
79
|
+
</ExampleContainer>
|
|
80
|
+
<ExampleContainer>
|
|
81
|
+
<Title title="Small margin" theme="light" level={4} />
|
|
82
|
+
<DxcBox margin="small" padding="medium">
|
|
83
|
+
Box
|
|
84
|
+
</DxcBox>
|
|
85
|
+
</ExampleContainer>
|
|
86
|
+
<ExampleContainer>
|
|
87
|
+
<Title title="Medium margin" theme="light" level={4} />
|
|
88
|
+
<DxcBox margin="medium" padding="medium">
|
|
89
|
+
Box
|
|
90
|
+
</DxcBox>
|
|
91
|
+
</ExampleContainer>
|
|
92
|
+
<ExampleContainer>
|
|
93
|
+
<Title title="Large margin" theme="light" level={4} />
|
|
94
|
+
<DxcBox margin="large" padding="medium">
|
|
95
|
+
Box
|
|
96
|
+
</DxcBox>
|
|
97
|
+
</ExampleContainer>
|
|
98
|
+
<ExampleContainer>
|
|
99
|
+
<Title title="Xlarge margin" theme="light" level={4} />
|
|
100
|
+
<DxcBox margin="xlarge" padding="medium">
|
|
101
|
+
Box
|
|
102
|
+
</DxcBox>
|
|
103
|
+
</ExampleContainer>
|
|
104
|
+
<ExampleContainer>
|
|
105
|
+
<Title title="Xxlarge margin" theme="light" level={4} />
|
|
106
|
+
<DxcBox margin="xxlarge" padding="medium">
|
|
107
|
+
Box
|
|
108
|
+
</DxcBox>
|
|
109
|
+
</ExampleContainer>
|
|
110
|
+
<Title title="Sizes" theme="light" level={2} />
|
|
111
|
+
<ExampleContainer>
|
|
112
|
+
<Title title="Small size" theme="light" level={4} />
|
|
113
|
+
<DxcBox size="small">Box</DxcBox>
|
|
114
|
+
</ExampleContainer>
|
|
115
|
+
<ExampleContainer>
|
|
116
|
+
<Title title="Medium size" theme="light" level={4} />
|
|
117
|
+
<DxcBox size="medium">Box</DxcBox>
|
|
118
|
+
</ExampleContainer>
|
|
119
|
+
<ExampleContainer>
|
|
120
|
+
<Title title="Large size" theme="light" level={4} />
|
|
121
|
+
<DxcBox size="large">Box</DxcBox>
|
|
122
|
+
</ExampleContainer>
|
|
123
|
+
<ExampleContainer>
|
|
124
|
+
<Title title="FillParent size" theme="light" level={4} />
|
|
125
|
+
<DxcBox size="fillParent">Box</DxcBox>
|
|
126
|
+
</ExampleContainer>
|
|
127
|
+
<ExampleContainer>
|
|
128
|
+
<Title title="FitContent" theme="light" level={4} />
|
|
129
|
+
<DxcBox size="fitContent">Box</DxcBox>
|
|
130
|
+
</ExampleContainer>
|
|
131
|
+
</>
|
|
132
|
+
);
|
package/box/types.d.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
3
|
+
declare type Margin = {
|
|
4
|
+
top?: Space;
|
|
5
|
+
bottom?: Space;
|
|
6
|
+
left?: Space;
|
|
7
|
+
right?: Space;
|
|
8
|
+
};
|
|
9
|
+
declare type Padding = {
|
|
10
|
+
top?: Space;
|
|
11
|
+
bottom?: Space;
|
|
12
|
+
left?: Space;
|
|
13
|
+
right?: Space;
|
|
14
|
+
};
|
|
15
|
+
declare type Props = {
|
|
16
|
+
/**
|
|
17
|
+
* The size of the shadow to be displayed around the box.
|
|
18
|
+
*/
|
|
19
|
+
shadowDepth?: 0 | 1 | 2;
|
|
20
|
+
/**
|
|
21
|
+
* Changes the display CSS property of the box div.
|
|
22
|
+
*/
|
|
23
|
+
display?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Custom content that will be placed in the box component.
|
|
26
|
+
*/
|
|
27
|
+
children: React.ReactNode;
|
|
28
|
+
/**
|
|
29
|
+
* Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
30
|
+
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
|
|
31
|
+
*/
|
|
32
|
+
margin?: Space | Margin;
|
|
33
|
+
/**
|
|
34
|
+
* Size of the padding to be applied to the custom area ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
35
|
+
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different padding sizes.
|
|
36
|
+
*/
|
|
37
|
+
padding?: Space | Padding;
|
|
38
|
+
/**
|
|
39
|
+
* Size of the component.
|
|
40
|
+
*/
|
|
41
|
+
size?: "small" | "medium" | "large" | "fillParent" | "fitContent";
|
|
42
|
+
};
|
|
43
|
+
export default Props;
|
package/box/types.js
ADDED
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
-
|
|
5
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
4
|
|
|
5
|
+
var _typeof3 = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
10
|
exports["default"] = void 0;
|
|
11
11
|
|
|
12
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
13
|
-
|
|
14
12
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
15
13
|
|
|
16
14
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
@@ -19,57 +17,21 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
19
17
|
|
|
20
18
|
var _Button = _interopRequireDefault(require("@material-ui/core/Button"));
|
|
21
19
|
|
|
22
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
23
|
-
|
|
24
20
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
25
21
|
|
|
26
22
|
var _variables = require("../common/variables.js");
|
|
27
23
|
|
|
28
24
|
var _utils = require("../common/utils.js");
|
|
29
25
|
|
|
30
|
-
var _useTheme = _interopRequireDefault(require("../useTheme
|
|
31
|
-
|
|
32
|
-
var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext.js"));
|
|
33
|
-
|
|
34
|
-
function _templateObject4() {
|
|
35
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n\n display: inline-block;\n width: ", ";\n cursor: ", ";\n\n .MuiButtonBase-root {\n padding-left: ", ";\n padding-right: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n\n .MuiButton-label {\n display: flex;\n flex-direction: ", ";\n align-items: center;\n }\n\n box-shadow: 0 0 0 2px transparent;\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n min-width: ", ";\n width: 100%;\n height: 40px;\n transition: none !important;\n\n &:focus {\n border-color: transparent;\n box-shadow: 0 0 0 2px\n ", ";\n }\n\n ", "\n }\n"]);
|
|
36
|
-
|
|
37
|
-
_templateObject4 = function _templateObject4() {
|
|
38
|
-
return data;
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
return data;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function _templateObject3() {
|
|
45
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n max-height: 24px;\n max-width: 24px;\n margin-left: ", ";\n margin-right: ", ";\n"]);
|
|
46
|
-
|
|
47
|
-
_templateObject3 = function _templateObject3() {
|
|
48
|
-
return data;
|
|
49
|
-
};
|
|
26
|
+
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
50
27
|
|
|
51
|
-
|
|
52
|
-
}
|
|
28
|
+
var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext"));
|
|
53
29
|
|
|
54
|
-
|
|
55
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n max-height: 24px;\n max-width: 24px;\n margin-left: ", ";\n margin-right: ", ";\n overflow: hidden;\n display: flex;\n img,\n svg {\n height: 100%;\n width: 100%;\n }\n"]);
|
|
30
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
56
31
|
|
|
57
|
-
|
|
58
|
-
return data;
|
|
59
|
-
};
|
|
32
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
60
33
|
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function _templateObject() {
|
|
65
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n line-height: ", ";\n font-size: ", ";\n text-overflow: ellipsis;\n overflow: hidden;\n text-transform: none;\n margin-right: ", ";\n margin-left: ", ";\n"]);
|
|
66
|
-
|
|
67
|
-
_templateObject = function _templateObject() {
|
|
68
|
-
return data;
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
return data;
|
|
72
|
-
}
|
|
34
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
73
35
|
|
|
74
36
|
var DxcButton = function DxcButton(_ref) {
|
|
75
37
|
var _ref$label = _ref.label,
|
|
@@ -82,21 +44,20 @@ var DxcButton = function DxcButton(_ref) {
|
|
|
82
44
|
iconPosition = _ref$iconPosition === void 0 ? "before" : _ref$iconPosition,
|
|
83
45
|
_ref$type = _ref.type,
|
|
84
46
|
type = _ref$type === void 0 ? "button" : _ref$type,
|
|
47
|
+
icon = _ref.icon,
|
|
85
48
|
_ref$iconSrc = _ref.iconSrc,
|
|
86
49
|
iconSrc = _ref$iconSrc === void 0 ? "" : _ref$iconSrc,
|
|
87
|
-
|
|
88
|
-
_ref$onClick = _ref.onClick,
|
|
89
|
-
_onClick = _ref$onClick === void 0 ? "" : _ref$onClick,
|
|
50
|
+
_onClick = _ref.onClick,
|
|
90
51
|
margin = _ref.margin,
|
|
91
|
-
size = _ref.size,
|
|
52
|
+
_ref$size = _ref.size,
|
|
53
|
+
size = _ref$size === void 0 ? "fitContent" : _ref$size,
|
|
92
54
|
_ref$tabIndex = _ref.tabIndex,
|
|
93
55
|
tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
|
|
94
|
-
|
|
95
56
|
var colorsTheme = (0, _useTheme["default"])();
|
|
96
57
|
var backgroundType = (0, _react.useContext)(_BackgroundColorContext["default"]);
|
|
97
|
-
return _react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
58
|
+
return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
98
59
|
theme: colorsTheme.button
|
|
99
|
-
}, _react["default"].createElement(DxCButton, {
|
|
60
|
+
}, /*#__PURE__*/_react["default"].createElement(DxCButton, {
|
|
100
61
|
type: type,
|
|
101
62
|
margin: margin,
|
|
102
63
|
mode: mode !== "primary" && mode !== "secondary" && mode !== "text" ? "primary" : mode,
|
|
@@ -105,24 +66,22 @@ var DxcButton = function DxcButton(_ref) {
|
|
|
105
66
|
size: size,
|
|
106
67
|
backgroundType: backgroundType,
|
|
107
68
|
icon: icon
|
|
108
|
-
}, _react["default"].createElement(_Button["default"], {
|
|
109
|
-
disabled: disabled,
|
|
69
|
+
}, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
110
70
|
type: type,
|
|
71
|
+
disabled: disabled,
|
|
111
72
|
disableRipple: true,
|
|
112
|
-
"aria-disabled": disabled
|
|
73
|
+
"aria-disabled": disabled,
|
|
113
74
|
tabIndex: disabled ? -1 : tabIndex,
|
|
114
75
|
onClick: function onClick() {
|
|
115
|
-
|
|
116
|
-
_onClick();
|
|
117
|
-
}
|
|
76
|
+
_onClick();
|
|
118
77
|
}
|
|
119
|
-
}, label && _react["default"].createElement(LabelContainer, {
|
|
78
|
+
}, label && /*#__PURE__*/_react["default"].createElement(LabelContainer, {
|
|
120
79
|
icon: icon,
|
|
121
80
|
iconPosition: iconPosition
|
|
122
|
-
}, label), icon ? _react["default"].createElement(IconContainer, {
|
|
81
|
+
}, label), icon ? /*#__PURE__*/_react["default"].createElement(IconContainer, {
|
|
123
82
|
label: label,
|
|
124
83
|
iconPosition: iconPosition
|
|
125
|
-
}, (0, _typeof2["default"])(icon) === "object" ? icon : _react["default"].createElement(icon)) : iconSrc && _react["default"].createElement(ButtonIcon, {
|
|
84
|
+
}, (0, _typeof2["default"])(icon) === "object" ? icon : /*#__PURE__*/_react["default"].createElement(icon)) : iconSrc && /*#__PURE__*/_react["default"].createElement(ButtonIcon, {
|
|
126
85
|
label: label,
|
|
127
86
|
iconPosition: iconPosition,
|
|
128
87
|
src: iconSrc
|
|
@@ -145,7 +104,7 @@ var calculateWidth = function calculateWidth(margin, size) {
|
|
|
145
104
|
return sizes[size];
|
|
146
105
|
};
|
|
147
106
|
|
|
148
|
-
var LabelContainer = _styledComponents["default"].span(_templateObject(), function (props) {
|
|
107
|
+
var LabelContainer = _styledComponents["default"].span(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n line-height: ", ";\n font-size: ", ";\n text-overflow: ellipsis;\n overflow: hidden;\n text-transform: none;\n white-space: nowrap;\n margin-right: ", ";\n margin-left: ", ";\n"])), function (props) {
|
|
149
108
|
return props.theme.labelFontLineHeight;
|
|
150
109
|
}, function (props) {
|
|
151
110
|
return props.theme.fontSize;
|
|
@@ -155,19 +114,19 @@ var LabelContainer = _styledComponents["default"].span(_templateObject(), functi
|
|
|
155
114
|
return !props.icon || props.iconPosition === "after" ? "8px" : "0px";
|
|
156
115
|
});
|
|
157
116
|
|
|
158
|
-
var IconContainer = _styledComponents["default"].div(_templateObject2(), function (props) {
|
|
117
|
+
var IconContainer = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n max-height: 24px;\n max-width: 24px;\n margin-left: ", ";\n margin-right: ", ";\n overflow: hidden;\n display: flex;\n img,\n svg {\n height: 100%;\n width: 100%;\n }\n"])), function (props) {
|
|
159
118
|
return !props.label ? "0px" : props.iconPosition === "after" && props.label !== "" && "8px" || "8px";
|
|
160
119
|
}, function (props) {
|
|
161
120
|
return !props.label ? "0px" : props.iconPosition === "before" && props.label !== "" && "8px" || "8px";
|
|
162
121
|
});
|
|
163
122
|
|
|
164
|
-
var ButtonIcon = _styledComponents["default"].img(_templateObject3(), function (props) {
|
|
123
|
+
var ButtonIcon = _styledComponents["default"].img(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n max-height: 24px;\n max-width: 24px;\n margin-left: ", ";\n margin-right: ", ";\n"])), function (props) {
|
|
165
124
|
return props.iconPosition === "after" && props.label !== "" && "10px" || "0px";
|
|
166
125
|
}, function (props) {
|
|
167
126
|
return props.iconPosition === "before" && props.label !== "" && "10px" || "0px";
|
|
168
127
|
});
|
|
169
128
|
|
|
170
|
-
var DxCButton = _styledComponents["default"].div(_templateObject4(), function (props) {
|
|
129
|
+
var DxCButton = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n\n display: inline-block;\n width: ", ";\n cursor: ", ";\n\n .MuiButtonBase-root {\n padding-left: ", ";\n padding-right: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n\n .MuiButton-label {\n display: flex;\n flex-direction: ", ";\n align-items: center;\n }\n\n box-shadow: 0 0 0 2px transparent;\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n min-width: ", ";\n width: 100%;\n height: 40px;\n transition: none !important;\n\n &:focus {\n border-color: transparent;\n box-shadow: 0 0 0 2px\n ", ";\n }\n\n ", "\n }\n"])), function (props) {
|
|
171
130
|
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
172
131
|
}, function (props) {
|
|
173
132
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
|
|
@@ -216,23 +175,5 @@ var DxCButton = _styledComponents["default"].div(_templateObject4(), function (p
|
|
|
216
175
|
}
|
|
217
176
|
});
|
|
218
177
|
|
|
219
|
-
DxcButton.propTypes = {
|
|
220
|
-
size: _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(sizes))),
|
|
221
|
-
margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
|
222
|
-
top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
223
|
-
bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
224
|
-
left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
225
|
-
right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
|
|
226
|
-
}), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
|
|
227
|
-
label: _propTypes["default"].string,
|
|
228
|
-
mode: _propTypes["default"].oneOf(["primary", "secondary", "text"]),
|
|
229
|
-
disabled: _propTypes["default"].bool,
|
|
230
|
-
iconPosition: _propTypes["default"].oneOf(["after", "before"]),
|
|
231
|
-
onClick: _propTypes["default"].func,
|
|
232
|
-
iconSrc: _propTypes["default"].string,
|
|
233
|
-
icon: _propTypes["default"].oneOfType([_propTypes["default"].element, _propTypes["default"].func]),
|
|
234
|
-
type: _propTypes["default"].oneOf(["button", "reset", "submit"]),
|
|
235
|
-
tabIndex: _propTypes["default"].number
|
|
236
|
-
};
|
|
237
178
|
var _default = DxcButton;
|
|
238
179
|
exports["default"] = _default;
|