@dxc-technology/halstack-react 0.0.0-fce22b8 → 0.0.0-ff99b25
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.js +50 -0
- package/ThemeContext.js +246 -0
- package/V3Select/V3Select.js +455 -0
- package/V3Select/index.d.ts +27 -0
- package/{dist/textarea/Textarea.js → V3Textarea/V3Textarea.js} +39 -39
- package/V3Textarea/index.d.ts +27 -0
- package/accordion/Accordion.d.ts +4 -0
- package/accordion/Accordion.js +258 -0
- 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/types.d.ts +72 -0
- package/accordion-group/types.js +5 -0
- package/alert/Alert.d.ts +4 -0
- package/alert/Alert.js +290 -0
- package/alert/types.d.ts +49 -0
- package/alert/types.js +5 -0
- package/badge/Badge.js +59 -0
- package/{dist/box → box}/Box.js +9 -21
- package/box/Box.stories.jsx +132 -0
- package/box/index.d.ts +25 -0
- package/button/Button.d.ts +4 -0
- package/button/Button.js +182 -0
- package/button/Button.stories.tsx +293 -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 +32 -123
- package/card/types.d.ts +69 -0
- package/card/types.js +5 -0
- package/checkbox/Checkbox.d.ts +4 -0
- package/{dist/checkbox → checkbox}/Checkbox.js +44 -82
- package/checkbox/types.d.ts +60 -0
- package/checkbox/types.js +5 -0
- package/{dist/chip → chip}/Chip.js +42 -84
- package/chip/index.d.ts +22 -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/common/variables.js +1569 -0
- package/{dist/date → date}/Date.js +33 -51
- package/date/index.d.ts +27 -0
- package/date-input/DateInput.d.ts +4 -0
- package/date-input/DateInput.js +361 -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 +29 -100
- package/dialog/types.d.ts +43 -0
- package/dialog/types.js +5 -0
- package/dropdown/Dropdown.d.ts +4 -0
- package/dropdown/Dropdown.js +417 -0
- package/dropdown/types.d.ts +89 -0
- package/dropdown/types.js +5 -0
- package/file-input/FileInput.js +532 -0
- package/file-input/FileItem.js +193 -0
- package/file-input/index.d.ts +81 -0
- package/footer/Footer.d.ts +4 -0
- package/footer/Footer.js +266 -0
- package/footer/Footer.stories.jsx +151 -0
- package/footer/Icons.js +77 -0
- package/footer/types.d.ts +61 -0
- package/footer/types.js +5 -0
- package/header/Header.js +326 -0
- package/header/Icons.js +59 -0
- package/header/index.d.ts +25 -0
- package/{dist/heading → heading}/Heading.js +30 -76
- package/heading/index.d.ts +17 -0
- package/input-text/Icons.js +22 -0
- package/{dist/input-text → input-text}/InputText.js +120 -178
- package/input-text/index.d.ts +36 -0
- package/{dist/layout → layout}/ApplicationLayout.js +35 -131
- package/layout/Icons.js +55 -0
- package/link/Link.js +183 -0
- package/link/index.d.ts +23 -0
- package/main.d.ts +44 -0
- package/{dist/main.js → main.js} +121 -69
- package/number-input/NumberInput.js +128 -0
- package/number-input/NumberInput.stories.jsx +115 -0
- package/number-input/NumberInputContext.js +16 -0
- package/number-input/index.d.ts +113 -0
- package/package.json +34 -25
- package/paginator/Icons.js +66 -0
- package/paginator/Paginator.d.ts +4 -0
- package/paginator/Paginator.js +198 -0
- package/paginator/types.d.ts +38 -0
- package/paginator/types.js +5 -0
- package/password-input/PasswordInput.js +199 -0
- package/password-input/PasswordInput.stories.jsx +131 -0
- package/password-input/index.d.ts +94 -0
- package/progress-bar/ProgressBar.d.ts +4 -0
- package/progress-bar/ProgressBar.js +170 -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 +15 -50
- package/radio/types.d.ts +54 -0
- package/radio/types.js +5 -0
- package/{dist/resultsetTable → resultsetTable}/ResultsetTable.js +35 -136
- package/resultsetTable/index.d.ts +19 -0
- package/select/Select.js +865 -0
- package/select/index.d.ts +131 -0
- package/{dist/sidenav → sidenav}/Sidenav.js +20 -58
- package/sidenav/index.d.ts +13 -0
- package/slider/Slider.d.ts +4 -0
- package/slider/Slider.js +306 -0
- package/slider/types.d.ts +83 -0
- package/slider/types.js +5 -0
- package/spinner/Spinner.js +267 -0
- package/spinner/index.d.ts +17 -0
- package/switch/Switch.d.ts +4 -0
- package/{dist/switch → switch}/Switch.js +28 -71
- package/switch/types.d.ts +58 -0
- package/switch/types.js +5 -0
- package/table/Table.js +118 -0
- package/table/index.d.ts +13 -0
- package/tabs/Tabs.d.ts +4 -0
- package/tabs/Tabs.js +211 -0
- package/tabs/types.d.ts +71 -0
- package/tabs/types.js +5 -0
- package/{dist/tag → tag}/Tag.js +50 -122
- package/tag/index.d.ts +24 -0
- package/text-input/TextInput.js +825 -0
- package/text-input/index.d.ts +135 -0
- package/textarea/Textarea.js +317 -0
- package/textarea/Textarea.stories.jsx +135 -0
- package/textarea/index.d.ts +117 -0
- package/{dist/toggle → toggle}/Toggle.js +15 -49
- package/toggle/index.d.ts +21 -0
- package/toggle-group/ToggleGroup.js +243 -0
- package/toggle-group/index.d.ts +21 -0
- package/{dist/upload → upload}/Upload.js +11 -15
- package/upload/buttons-upload/ButtonsUpload.js +111 -0
- package/upload/buttons-upload/Icons.js +40 -0
- package/upload/dragAndDropArea/DragAndDropArea.js +225 -0
- package/upload/dragAndDropArea/Icons.js +39 -0
- package/upload/file-upload/FileToUpload.js +115 -0
- package/upload/file-upload/Icons.js +66 -0
- package/{dist/upload → upload}/files-upload/FilesToUpload.js +12 -26
- package/upload/index.d.ts +15 -0
- package/upload/transaction/Icons.js +160 -0
- package/upload/transaction/Transaction.js +104 -0
- package/upload/transactions/Transactions.js +94 -0
- package/{dist/useTheme.js → useTheme.js} +0 -0
- package/wizard/Icons.js +65 -0
- package/wizard/Wizard.js +271 -0
- package/wizard/index.d.ts +18 -0
- package/README.md +0 -66
- package/babel.config.js +0 -8
- package/dist/BackgroundColorContext.js +0 -46
- package/dist/ThemeContext.js +0 -216
- package/dist/accordion/Accordion.js +0 -340
- package/dist/accordion/Accordion.stories.js +0 -207
- package/dist/accordion/readme.md +0 -96
- package/dist/accordion-group/AccordionGroup.js +0 -188
- package/dist/accordion-group/AccordionGroup.stories.js +0 -207
- package/dist/accordion-group/readme.md +0 -70
- package/dist/alert/Alert.js +0 -388
- 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/badge/Badge.js +0 -61
- package/dist/button/Button.js +0 -228
- package/dist/button/Button.stories.js +0 -224
- package/dist/button/readme.md +0 -93
- package/dist/checkbox/Checkbox.stories.js +0 -144
- package/dist/checkbox/readme.md +0 -116
- package/dist/common/variables.js +0 -1154
- package/dist/date/Date.stories.js +0 -205
- package/dist/date/calendar.svg +0 -1
- package/dist/date/calendar_dark.svg +0 -1
- package/dist/date/readme.md +0 -73
- package/dist/dialog/Dialog.stories.js +0 -217
- package/dist/dialog/readme.md +0 -32
- package/dist/dropdown/Dropdown.js +0 -492
- 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.js +0 -405
- package/dist/footer/Footer.stories.js +0 -94
- package/dist/footer/dxc_logo_wht.png +0 -0
- package/dist/footer/readme.md +0 -41
- package/dist/header/Header.js +0 -431
- package/dist/header/Header.stories.js +0 -176
- package/dist/header/close_icon.svg +0 -1
- 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/header/hamb_menu_black.svg +0 -1
- package/dist/header/hamb_menu_white.svg +0 -1
- package/dist/header/readme.md +0 -33
- package/dist/input-text/InputText.stories.js +0 -209
- package/dist/input-text/error.svg +0 -1
- package/dist/input-text/readme.md +0 -91
- package/dist/layout/facebook.svg +0 -45
- package/dist/layout/linkedin.svg +0 -50
- package/dist/layout/twitter.svg +0 -53
- package/dist/link/Link.js +0 -212
- package/dist/link/readme.md +0 -51
- package/dist/paginator/Paginator.js +0 -283
- package/dist/paginator/images/next.svg +0 -3
- package/dist/paginator/images/nextPage.svg +0 -3
- package/dist/paginator/images/previous.svg +0 -3
- package/dist/paginator/images/previousPage.svg +0 -3
- package/dist/paginator/readme.md +0 -50
- package/dist/progress-bar/ProgressBar.js +0 -206
- package/dist/progress-bar/ProgressBar.stories.js +0 -280
- package/dist/progress-bar/readme.md +0 -63
- package/dist/radio/Radio.stories.js +0 -166
- package/dist/radio/readme.md +0 -70
- package/dist/resultsetTable/arrow_downward-24px_wht.svg +0 -1
- package/dist/resultsetTable/arrow_upward-24px_wht.svg +0 -1
- package/dist/resultsetTable/unfold_more-24px_wht.svg +0 -1
- package/dist/select/Select.js +0 -525
- package/dist/select/Select.stories.js +0 -235
- package/dist/select/readme.md +0 -72
- package/dist/slider/Slider.js +0 -315
- package/dist/slider/Slider.stories.js +0 -241
- package/dist/slider/readme.md +0 -64
- package/dist/spinner/Spinner.js +0 -214
- package/dist/spinner/Spinner.stories.js +0 -183
- package/dist/spinner/readme.md +0 -65
- package/dist/switch/Switch.stories.js +0 -134
- package/dist/switch/readme.md +0 -133
- package/dist/table/Table.js +0 -122
- package/dist/tabs/Tabs.js +0 -347
- package/dist/tabs/Tabs.stories.js +0 -130
- package/dist/tabs/readme.md +0 -78
- package/dist/tabs-for-sections/TabsForSections.js +0 -92
- package/dist/tabs-for-sections/readme.md +0 -78
- package/dist/toggle/Toggle.stories.js +0 -297
- package/dist/toggle/readme.md +0 -80
- package/dist/toggle-group/ToggleGroup.js +0 -241
- package/dist/toggle-group/readme.md +0 -82
- package/dist/upload/Upload.stories.js +0 -72
- package/dist/upload/buttons-upload/ButtonsUpload.js +0 -135
- package/dist/upload/buttons-upload/drag-drop-icon.svg +0 -4
- package/dist/upload/buttons-upload/upload-button.svg +0 -1
- package/dist/upload/dragAndDropArea/DragAndDropArea.js +0 -325
- package/dist/upload/dragAndDropArea/upload_drop.svg +0 -4
- package/dist/upload/dragAndDropArea/upload_file.svg +0 -4
- package/dist/upload/file-upload/FileToUpload.js +0 -184
- package/dist/upload/file-upload/audio-icon.svg +0 -4
- package/dist/upload/file-upload/close.svg +0 -4
- package/dist/upload/file-upload/file-icon.svg +0 -4
- package/dist/upload/file-upload/video-icon.svg +0 -4
- package/dist/upload/readme.md +0 -37
- package/dist/upload/transaction/Transaction.js +0 -171
- package/dist/upload/transaction/audio-icon-err.svg +0 -4
- package/dist/upload/transaction/audio-icon.svg +0 -4
- package/dist/upload/transaction/error-icon.svg +0 -4
- package/dist/upload/transaction/file-icon-err.svg +0 -4
- package/dist/upload/transaction/file-icon.svg +0 -4
- package/dist/upload/transaction/image-icon-err.svg +0 -4
- package/dist/upload/transaction/image-icon.svg +0 -4
- package/dist/upload/transaction/success-icon.svg +0 -4
- package/dist/upload/transaction/video-icon-err.svg +0 -4
- package/dist/upload/transaction/video-icon.svg +0 -4
- package/dist/upload/transactions/Transactions.js +0 -138
- package/dist/wizard/Wizard.js +0 -383
- package/dist/wizard/invalid_icon.svg +0 -6
- package/dist/wizard/valid_icon.svg +0 -6
- package/dist/wizard/validation-wrong.svg +0 -6
- 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 -393
- package/test/Dialog.test.js +0 -23
- package/test/Dropdown.test.js +0 -130
- package/test/Footer.test.js +0 -99
- package/test/Header.test.js +0 -39
- package/test/Heading.test.js +0 -35
- package/test/InputText.test.js +0 -240
- package/test/Link.test.js +0 -42
- package/test/Paginator.test.js +0 -177
- 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 -192
- package/test/Sidenav.test.js +0 -45
- package/test/Slider.test.js +0 -82
- package/test/Spinner.test.js +0 -27
- package/test/Switch.test.js +0 -45
- package/test/Table.test.js +0 -36
- package/test/Tabs.test.js +0 -109
- package/test/TabsForSections.test.js +0 -34
- package/test/Tag.test.js +0 -32
- package/test/TextArea.test.js +0 -52
- package/test/ToggleGroup.test.js +0 -81
- package/test/Upload.test.js +0 -60
- package/test/Wizard.test.js +0 -130
- package/test/mocks/pngMock.js +0 -1
- package/test/mocks/svgMock.js +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
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
|
});
|
|
@@ -35,17 +35,13 @@ var _RequiredComponent = _interopRequireDefault(require("../common/RequiredCompo
|
|
|
35
35
|
|
|
36
36
|
var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext.js"));
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n display: inline-block;\n position: relative;\n height: auto;\n width: ", ";\n\n .MuiTextField-root {\n width: 100%;\n\n .MuiFormHelperText-root {\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n margin-top: 6px;\n }\n .MuiFormLabel-root {\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n color: ", ";\n padding-left: \"inherit\";\n\n &.Mui-disabled {\n color: ", " !important;\n cursor: not-allowed;\n }\n\n &.Mui-focused {\n color: ", ";\n &.MuiInputLabel-shrink {\n transform: \"translate(0, 1.5px) scale(0.75);\";\n }\n }\n\n &.MuiInputLabel-shrink {\n font-family: ", ";\n transform: \"translate(0, 1.5px) scale(0.75)\";\n }\n\n &.Mui-error {\n color: ", ";\n }\n\n &:not(.MuiInputLabel-shrink) {\n font-family: ", ";\n color: ", ";\n & + div,\n & + div + p {\n color: ", ";\n }\n }\n\n &.MuiInputLabel-shrink {\n & + div::before {\n border-color: ", ";\n }\n & + div + p {\n color: ", ";\n }\n }\n }\n .MuiInputBase-root.MuiInput-root.MuiInput-underline {\n &::before {\n border-bottom: ", ";\n }\n &:not(.Mui-error)::before,\n &:not(&.Mui-focused)::before {\n border-bottom: ", ";\n }\n &::after {\n border-bottom: ", ";\n }\n\n .MuiInputBase-inputMultiline {\n overflow: auto !important;\n\n ::-webkit-scrollbar {\n width: 3px;\n }\n\n ::-webkit-scrollbar-track {\n background-color: ", ";\n border-radius: 3px;\n }\n\n ::-webkit-scrollbar-thumb {\n background-color: ", ";\n border-radius: 3px;\n }\n }\n\n &.Mui-error {\n &::before {\n border-width: 1px;\n border-color: ", ";\n }\n &::after {\n transform: scaleX(0);\n }\n }\n\n &.Mui-focused {\n &::after {\n border-width: 2px;\n border-color: ", ";\n transform: scaleX(1);\n }\n &.Mui-error::after {\n border-color: ", ";\n }\n }\n\n &.Mui-disabled {\n cursor: not-allowed;\n\n &::before {\n border-bottom: ", ";\n border-bottom-style: solid;\n }\n }\n\n .MuiInputBase-input {\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n color: ", ";\n line-height: ", ";\n padding-left: \"inherit\";\n text-overflow: ellipsis;\n\n &.Mui-disabled {\n cursor: not-allowed;\n color: ", ";\n }\n }\n\n &:hover:not(.Mui-disabled):before &:hover:not(.Mui-error):before {\n border-bottom: ", ";\n }\n }\n\n & > p {\n &.Mui-error {\n color: ", ";\n }\n &.Mui-disabled {\n color: ", " !important;\n cursor: not-allowed;\n }\n }\n }\n"]);
|
|
38
|
+
var _templateObject;
|
|
40
39
|
|
|
41
|
-
|
|
42
|
-
return data;
|
|
43
|
-
};
|
|
40
|
+
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); }
|
|
44
41
|
|
|
45
|
-
|
|
46
|
-
}
|
|
42
|
+
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; }
|
|
47
43
|
|
|
48
|
-
var
|
|
44
|
+
var V3DxcTextarea = function V3DxcTextarea(_ref) {
|
|
49
45
|
var _ref$label = _ref.label,
|
|
50
46
|
label = _ref$label === void 0 ? " " : _ref$label,
|
|
51
47
|
_ref$name = _ref.name,
|
|
@@ -106,21 +102,21 @@ var DxcTextarea = function DxcTextarea(_ref) {
|
|
|
106
102
|
}
|
|
107
103
|
};
|
|
108
104
|
|
|
109
|
-
return _react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
110
|
-
theme: colorsTheme.
|
|
111
|
-
}, _react["default"].createElement(TextContainer, {
|
|
105
|
+
return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
106
|
+
theme: colorsTheme.V3Textarea
|
|
107
|
+
}, /*#__PURE__*/_react["default"].createElement(TextContainer, {
|
|
112
108
|
required: required,
|
|
113
109
|
assistiveText: assistiveText,
|
|
114
110
|
margin: margin,
|
|
115
111
|
size: size,
|
|
116
112
|
backgroundType: backgroundType
|
|
117
|
-
}, _react["default"].createElement(_TextField["default"], {
|
|
113
|
+
}, /*#__PURE__*/_react["default"].createElement(_TextField["default"], {
|
|
118
114
|
error: invalid,
|
|
119
115
|
value: value !== null ? value : innerValue,
|
|
120
116
|
name: name,
|
|
121
117
|
multiline: true,
|
|
122
118
|
disabled: disabled,
|
|
123
|
-
label: required ? _react["default"].createElement(_react["default"].Fragment, null, _react["default"].createElement(_RequiredComponent["default"], null), label) : label,
|
|
119
|
+
label: required ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_RequiredComponent["default"], null), label) : label,
|
|
124
120
|
helperText: assistiveText,
|
|
125
121
|
onChange: handlerTextareaChange,
|
|
126
122
|
onBlur: onBlur && handlerTextareaBlur || null,
|
|
@@ -143,7 +139,7 @@ var calculateWidth = function calculateWidth(margin, size) {
|
|
|
143
139
|
return size === "fillParent" ? "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")") : sizes[size];
|
|
144
140
|
};
|
|
145
141
|
|
|
146
|
-
var TextContainer = _styledComponents["default"].div(_templateObject(), function (props) {
|
|
142
|
+
var TextContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n display: inline-block;\n position: relative;\n height: auto;\n width: ", ";\n\n .MuiTextField-root {\n width: 100%;\n\n .MuiFormHelperText-root {\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n margin-top: 6px;\n }\n .MuiFormLabel-root {\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n color: ", ";\n padding-left: \"inherit\";\n\n &.Mui-disabled {\n color: ", " !important;\n cursor: not-allowed;\n }\n\n &.Mui-focused {\n color: ", ";\n &.MuiInputLabel-shrink {\n transform: \"translate(0, 1.5px) scale(0.75);\";\n }\n }\n\n &.MuiInputLabel-shrink {\n font-family: ", ";\n transform: \"translate(0, 1.5px) scale(0.75)\";\n }\n\n &.Mui-error {\n color: ", ";\n }\n\n &:not(.MuiInputLabel-shrink) {\n font-family: ", ";\n color: ", ";\n & + div,\n & + div + p {\n color: ", ";\n }\n }\n\n &.MuiInputLabel-shrink {\n & + div::before {\n border-color: ", ";\n }\n & + div + p {\n color: ", ";\n }\n }\n }\n .MuiInputBase-root.MuiInput-root.MuiInput-underline {\n &::before {\n border-bottom: ", ";\n }\n\n &:not(.Mui-error)::before,\n &:not(&.Mui-focused)::before {\n border-bottom: ", ";\n }\n\n &::after {\n border-bottom: ", ";\n }\n\n .MuiInputBase-inputMultiline {\n overflow: auto !important;\n\n ::-webkit-scrollbar {\n width: 3px;\n }\n\n ::-webkit-scrollbar-track {\n background-color: ", ";\n border-radius: 3px;\n }\n\n ::-webkit-scrollbar-thumb {\n background-color: ", ";\n border-radius: 3px;\n }\n }\n\n &.Mui-error {\n &::before {\n border-width: ", ";\n border-color: ", ";\n }\n &::after {\n transform: scaleX(0);\n }\n }\n\n &.Mui-focused {\n &::after {\n border-width: calc(", " + 1px);\n border-color: ", ";\n }\n &.Mui-error::after {\n border-color: ", ";\n }\n }\n\n &.Mui-disabled {\n cursor: not-allowed;\n\n &::before {\n border-bottom: ", ";\n border-bottom-style: solid;\n }\n }\n\n .MuiInputBase-input {\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n letter-spacing: ", ";\n color: ", ";\n line-height: ", ";\n padding-left: \"inherit\";\n text-overflow: ellipsis;\n\n &.Mui-disabled {\n cursor: not-allowed;\n color: ", ";\n }\n }\n\n &:hover:not(.Mui-disabled):before &:hover:not(.Mui-error):before {\n border-bottom-color: ", ";\n }\n }\n\n & > p {\n &.Mui-error {\n color: ", ";\n }\n &.Mui-disabled {\n color: ", " !important;\n cursor: not-allowed;\n }\n }\n }\n"])), function (props) {
|
|
147
143
|
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
148
144
|
}, function (props) {
|
|
149
145
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
|
|
@@ -156,7 +152,7 @@ var TextContainer = _styledComponents["default"].div(_templateObject(), function
|
|
|
156
152
|
}, function (props) {
|
|
157
153
|
return calculateWidth(props.margin, props.size);
|
|
158
154
|
}, function (props) {
|
|
159
|
-
return props.theme.
|
|
155
|
+
return props.theme.fontFamily;
|
|
160
156
|
}, function (props) {
|
|
161
157
|
return props.theme.assistiveTextFontSize;
|
|
162
158
|
}, function (props) {
|
|
@@ -176,66 +172,70 @@ var TextContainer = _styledComponents["default"].div(_templateObject(), function
|
|
|
176
172
|
}, function (props) {
|
|
177
173
|
return props.backgroundType === "dark" ? props.theme.labelFontColorOnDark : props.theme.labelFontColor;
|
|
178
174
|
}, function (props) {
|
|
179
|
-
return props.backgroundType === "dark" ? props.theme.
|
|
175
|
+
return props.backgroundType === "dark" ? props.theme.disabledColorOnDark : props.theme.disabledColor;
|
|
180
176
|
}, function (props) {
|
|
181
177
|
return props.backgroundType === "dark" ? props.theme.labelFontColorOnDark : props.theme.labelFontColor;
|
|
182
178
|
}, function (props) {
|
|
183
|
-
return props.theme.
|
|
179
|
+
return props.theme.fontFamily;
|
|
184
180
|
}, function (props) {
|
|
185
181
|
return props.backgroundType === "dark" ? props.theme.errorColorOnDark : props.theme.errorColor;
|
|
186
182
|
}, function (props) {
|
|
187
|
-
return props.theme.
|
|
183
|
+
return props.theme.fontFamily;
|
|
188
184
|
}, function (props) {
|
|
189
185
|
return props.backgroundType === "dark" ? props.theme.labelFontColorOnDark : props.theme.labelFontColor;
|
|
190
186
|
}, function (props) {
|
|
191
187
|
return props.backgroundType === "dark" ? props.theme.assistiveTextFontColorOnDark : props.theme.assistiveTextFontColor;
|
|
192
188
|
}, function (props) {
|
|
193
|
-
return props.backgroundType ? props.theme.
|
|
189
|
+
return props.backgroundType ? props.theme.underlineColorOnDark : props.theme.underlineColor;
|
|
194
190
|
}, function (props) {
|
|
195
|
-
return props.backgroundType === "dark" ? props.theme.
|
|
191
|
+
return props.backgroundType === "dark" ? props.theme.labelFontColorOnDark : props.theme.labelFontColor;
|
|
196
192
|
}, function (props) {
|
|
197
|
-
return "
|
|
193
|
+
return "".concat(props.theme.underlineThickness, " solid ").concat(props.backgroundType === "dark" ? props.theme.underlineColorOnDark : props.theme.underlineColor);
|
|
198
194
|
}, function (props) {
|
|
199
|
-
return "
|
|
195
|
+
return "".concat(props.theme.underlineThickness, " solid ").concat(props.backgroundType === "dark" ? props.theme.underlineColorOnDark : props.theme.underlineColor);
|
|
200
196
|
}, function (props) {
|
|
201
|
-
return "
|
|
197
|
+
return "calc(".concat(props.theme.underlineThickness, " + 1px) solid ").concat(props.backgroundType === "dark" ? props.theme.underlineFocusColorOnDark : props.theme.underlineFocusColor);
|
|
202
198
|
}, function (props) {
|
|
203
199
|
return props.backgroundType === "dark" ? props.theme.scrollBarTrackColorOnDark : props.theme.scrollBarTrackColor;
|
|
204
200
|
}, function (props) {
|
|
205
201
|
return props.backgroundType === "dark" ? props.theme.scrollBarThumbColorOnDark : props.theme.scrollBarThumbColor;
|
|
202
|
+
}, function (props) {
|
|
203
|
+
return props.theme.underlineThickness;
|
|
206
204
|
}, function (props) {
|
|
207
205
|
return props.backgroundType === "dark" ? props.theme.errorColorOnDark : props.theme.errorColor;
|
|
208
206
|
}, function (props) {
|
|
209
|
-
return props.
|
|
207
|
+
return props.theme.underlineThickness;
|
|
208
|
+
}, function (props) {
|
|
209
|
+
return props.backgroundType === "dark" ? props.theme.underlineFocusColorOnDark : props.theme.underlineFocusColor;
|
|
210
210
|
}, function (props) {
|
|
211
211
|
return props.backgroundType === "dark" ? props.theme.errorColorOnDark : props.theme.errorColor;
|
|
212
212
|
}, function (props) {
|
|
213
|
-
return "
|
|
213
|
+
return "".concat(props.theme.underlineThickness, " solid ").concat(props.backgroundType === "dark" ? props.theme.disabledColorOnDark : props.theme.disabledColor, " !important");
|
|
214
214
|
}, function (props) {
|
|
215
|
-
return props.theme.
|
|
215
|
+
return props.theme.fontFamily;
|
|
216
216
|
}, function (props) {
|
|
217
|
-
return props.theme.
|
|
217
|
+
return props.theme.valueFontSize;
|
|
218
218
|
}, function (props) {
|
|
219
|
-
return props.theme.
|
|
219
|
+
return props.theme.valueFontStyle;
|
|
220
220
|
}, function (props) {
|
|
221
|
-
return props.theme.
|
|
221
|
+
return props.theme.valueFontWeight;
|
|
222
222
|
}, function (props) {
|
|
223
|
-
return props.theme.
|
|
223
|
+
return props.theme.valueLetterSpacing;
|
|
224
224
|
}, function (props) {
|
|
225
|
-
return props.backgroundType === "dark" ? props.theme.
|
|
225
|
+
return props.backgroundType === "dark" ? props.theme.valueFontColorOnDark : props.theme.valueFontColor;
|
|
226
226
|
}, function (props) {
|
|
227
|
-
return props.theme.
|
|
227
|
+
return props.theme.valueLineHeight;
|
|
228
228
|
}, function (props) {
|
|
229
|
-
return props.backgroundType === "dark" ? props.theme.
|
|
229
|
+
return props.backgroundType === "dark" ? props.theme.disabledColorOnDark : props.theme.disabledColor;
|
|
230
230
|
}, function (props) {
|
|
231
|
-
return props.backgroundType === "dark" ? props.theme.
|
|
231
|
+
return props.backgroundType === "dark" ? props.theme.underlineFocusColorOnDark : props.theme.underlineFocusColor;
|
|
232
232
|
}, function (props) {
|
|
233
233
|
return "".concat(props.backgroundType === "dark" ? props.theme.errorColorOnDark : props.theme.errorColor, " !important");
|
|
234
234
|
}, function (props) {
|
|
235
|
-
return props.backgroundType === "dark" ? props.theme.
|
|
235
|
+
return props.backgroundType === "dark" ? props.theme.disabledColorOnDark : props.theme.disabledColor;
|
|
236
236
|
});
|
|
237
237
|
|
|
238
|
-
|
|
238
|
+
V3DxcTextarea.propTypes = {
|
|
239
239
|
label: _propTypes["default"].string,
|
|
240
240
|
name: _propTypes["default"].string,
|
|
241
241
|
value: _propTypes["default"].string,
|
|
@@ -256,5 +256,5 @@ DxcTextarea.propTypes = {
|
|
|
256
256
|
}), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
|
|
257
257
|
tabIndex: _propTypes["default"].number
|
|
258
258
|
};
|
|
259
|
-
var _default =
|
|
259
|
+
var _default = V3DxcTextarea;
|
|
260
260
|
exports["default"] = _default;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
type Size = "small" | "medium" | "large" | "fillParent";
|
|
2
|
+
type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
3
|
+
type Margin = {
|
|
4
|
+
top?: Space;
|
|
5
|
+
bottom?: Space;
|
|
6
|
+
left?: Space;
|
|
7
|
+
right?: Space;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
type Props = {
|
|
11
|
+
label?: string;
|
|
12
|
+
name?: string;
|
|
13
|
+
value?: string;
|
|
14
|
+
assistiveText?: string;
|
|
15
|
+
disabled?: boolean,
|
|
16
|
+
onChange?: void;
|
|
17
|
+
onBlur?: void;
|
|
18
|
+
numRows?: number;
|
|
19
|
+
required?: boolean;
|
|
20
|
+
invalid?: boolean;
|
|
21
|
+
placeholder?: string;
|
|
22
|
+
margin?: Space | Margin;
|
|
23
|
+
size?: Size;
|
|
24
|
+
tabIndex?: number;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export default function V3DxcTextarea(props: Props): JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import AccordionPropsType from "./types";
|
|
3
|
+
declare const DxcAccordion: ({ label, isExpanded, iconSrc, icon, assistiveText, disabled, onChange, children, margin, padding, tabIndex, }: AccordionPropsType) => JSX.Element;
|
|
4
|
+
export default DxcAccordion;
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof3 = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports["default"] = void 0;
|
|
11
|
+
|
|
12
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
13
|
+
|
|
14
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
15
|
+
|
|
16
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
17
|
+
|
|
18
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
19
|
+
|
|
20
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
21
|
+
|
|
22
|
+
var _ExpansionPanel = _interopRequireDefault(require("@material-ui/core/ExpansionPanel"));
|
|
23
|
+
|
|
24
|
+
var _ExpansionPanelSummary = _interopRequireDefault(require("@material-ui/core/ExpansionPanelSummary"));
|
|
25
|
+
|
|
26
|
+
var _ExpansionPanelDetails = _interopRequireDefault(require("@material-ui/core/ExpansionPanelDetails"));
|
|
27
|
+
|
|
28
|
+
var _ExpandMore = _interopRequireDefault(require("@material-ui/icons/ExpandMore"));
|
|
29
|
+
|
|
30
|
+
var _utils = require("../common/utils.js");
|
|
31
|
+
|
|
32
|
+
var _variables = require("../common/variables.js");
|
|
33
|
+
|
|
34
|
+
var _useTheme = _interopRequireDefault(require("../useTheme.js"));
|
|
35
|
+
|
|
36
|
+
var _BackgroundColorContext = require("../BackgroundColorContext.js");
|
|
37
|
+
|
|
38
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
|
39
|
+
|
|
40
|
+
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); }
|
|
41
|
+
|
|
42
|
+
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; }
|
|
43
|
+
|
|
44
|
+
var DxcAccordion = function DxcAccordion(_ref) {
|
|
45
|
+
var _ref$label = _ref.label,
|
|
46
|
+
label = _ref$label === void 0 ? "" : _ref$label,
|
|
47
|
+
isExpanded = _ref.isExpanded,
|
|
48
|
+
iconSrc = _ref.iconSrc,
|
|
49
|
+
icon = _ref.icon,
|
|
50
|
+
_ref$assistiveText = _ref.assistiveText,
|
|
51
|
+
assistiveText = _ref$assistiveText === void 0 ? "" : _ref$assistiveText,
|
|
52
|
+
_ref$disabled = _ref.disabled,
|
|
53
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
54
|
+
onChange = _ref.onChange,
|
|
55
|
+
children = _ref.children,
|
|
56
|
+
margin = _ref.margin,
|
|
57
|
+
padding = _ref.padding,
|
|
58
|
+
_ref$tabIndex = _ref.tabIndex,
|
|
59
|
+
tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
|
|
60
|
+
|
|
61
|
+
var _useState = (0, _react.useState)(false),
|
|
62
|
+
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
63
|
+
innerIsExpanded = _useState2[0],
|
|
64
|
+
setInnerIsExpanded = _useState2[1];
|
|
65
|
+
|
|
66
|
+
var _useState3 = (0, _react.useState)(false),
|
|
67
|
+
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
|
68
|
+
isResponsive = _useState4[0],
|
|
69
|
+
setIsResponsive = _useState4[1];
|
|
70
|
+
|
|
71
|
+
var colorsTheme = (0, _useTheme["default"])();
|
|
72
|
+
|
|
73
|
+
var handleResize = function handleResize(width) {
|
|
74
|
+
width && width <= _variables.responsiveSizes.tablet ? setIsResponsive(true) : setIsResponsive(false);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
var handleEventListener = function handleEventListener() {
|
|
78
|
+
handleResize(window.innerWidth);
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
(0, _react.useEffect)(function () {
|
|
82
|
+
window.addEventListener("resize", handleEventListener);
|
|
83
|
+
handleResize(window.innerWidth);
|
|
84
|
+
return function () {
|
|
85
|
+
window.removeEventListener("resize", handleEventListener);
|
|
86
|
+
};
|
|
87
|
+
}, []);
|
|
88
|
+
|
|
89
|
+
var handlerAccordion = function handlerAccordion() {
|
|
90
|
+
if (isExpanded == null) {
|
|
91
|
+
setInnerIsExpanded(!innerIsExpanded);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (typeof onChange === "function") {
|
|
95
|
+
onChange(isExpanded == null ? !innerIsExpanded : !isExpanded);
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
100
|
+
theme: colorsTheme.accordion
|
|
101
|
+
}, /*#__PURE__*/_react["default"].createElement(DXCAccordion, {
|
|
102
|
+
padding: padding,
|
|
103
|
+
margin: margin,
|
|
104
|
+
disabled: disabled,
|
|
105
|
+
icon: icon || iconSrc,
|
|
106
|
+
isResponsive: isResponsive
|
|
107
|
+
}, /*#__PURE__*/_react["default"].createElement(_ExpansionPanel["default"], {
|
|
108
|
+
disabled: disabled,
|
|
109
|
+
onChange: handlerAccordion,
|
|
110
|
+
expanded: isExpanded != null ? isExpanded : innerIsExpanded
|
|
111
|
+
}, /*#__PURE__*/_react["default"].createElement(_ExpansionPanelSummary["default"], {
|
|
112
|
+
expandIcon: /*#__PURE__*/_react["default"].createElement(_ExpandMore["default"], null),
|
|
113
|
+
tabIndex: disabled ? -1 : tabIndex
|
|
114
|
+
}, /*#__PURE__*/_react["default"].createElement(AccordionInfo, {
|
|
115
|
+
disabled: disabled
|
|
116
|
+
}, /*#__PURE__*/_react["default"].createElement(AccordionLabel, null, label), icon ? /*#__PURE__*/_react["default"].createElement(IconContainer, {
|
|
117
|
+
disabled: disabled
|
|
118
|
+
}, (0, _typeof2["default"])(icon) === "object" ? icon : /*#__PURE__*/_react["default"].createElement(icon)) : iconSrc && /*#__PURE__*/_react["default"].createElement(AccordionIcon, {
|
|
119
|
+
src: iconSrc
|
|
120
|
+
})), assistiveText && /*#__PURE__*/_react["default"].createElement(AccordionAssistiveText, {
|
|
121
|
+
disabled: disabled
|
|
122
|
+
}, assistiveText)), /*#__PURE__*/_react["default"].createElement(_ExpansionPanelDetails["default"], null, /*#__PURE__*/_react["default"].createElement(AccordionContent, {
|
|
123
|
+
disabled: disabled
|
|
124
|
+
}, /*#__PURE__*/_react["default"].createElement(_BackgroundColorContext.BackgroundColorProvider, {
|
|
125
|
+
color: colorsTheme.accordion.backgroundColor
|
|
126
|
+
}, children))))));
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
var calculateWidth = function calculateWidth(margin) {
|
|
130
|
+
return "calc(100% - ".concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")");
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
var DXCAccordion = _styledComponents["default"].div(_templateObject || (_templateObject = (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"])), function (props) {
|
|
134
|
+
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
135
|
+
}, function (props) {
|
|
136
|
+
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
|
|
137
|
+
}, function (props) {
|
|
138
|
+
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.right ? _variables.spaces[props.margin.right] : "";
|
|
139
|
+
}, function (props) {
|
|
140
|
+
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.bottom ? _variables.spaces[props.margin.bottom] : "";
|
|
141
|
+
}, function (props) {
|
|
142
|
+
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
143
|
+
}, function (props) {
|
|
144
|
+
return calculateWidth(props.margin);
|
|
145
|
+
}, function (props) {
|
|
146
|
+
return props.disabled && "not-allowed" || "pointer";
|
|
147
|
+
}, function (props) {
|
|
148
|
+
return props.disabled ? props.theme.disabledBackgroundColor : props.theme.backgroundColor;
|
|
149
|
+
}, function (props) {
|
|
150
|
+
return "".concat(props.theme.boxShadowOffsetX, " ").concat(props.theme.boxShadowOffsetY, " ").concat(props.theme.boxShadowBlur, " ").concat(props.theme.boxShadowColor);
|
|
151
|
+
}, function (props) {
|
|
152
|
+
return props.theme.borderRadius;
|
|
153
|
+
}, function (props) {
|
|
154
|
+
return props.theme.borderRadius;
|
|
155
|
+
}, function (props) {
|
|
156
|
+
return props.theme.borderRadius;
|
|
157
|
+
}, function (props) {
|
|
158
|
+
return props.theme.focusBorderColor;
|
|
159
|
+
}, function (props) {
|
|
160
|
+
return props.theme.focusBorderStyle;
|
|
161
|
+
}, function (props) {
|
|
162
|
+
return props.theme.focusBorderThickness;
|
|
163
|
+
}, function (props) {
|
|
164
|
+
return props.theme.backgroundColor;
|
|
165
|
+
}, function (props) {
|
|
166
|
+
return "".concat(props.theme.hoverBackgroundColor);
|
|
167
|
+
}, function (props) {
|
|
168
|
+
return "".concat(props.theme.hoverBackgroundColor);
|
|
169
|
+
}, function (props) {
|
|
170
|
+
return props.theme.borderRadius;
|
|
171
|
+
}, function (props) {
|
|
172
|
+
return props.theme.titleLabelPaddingTop;
|
|
173
|
+
}, function (props) {
|
|
174
|
+
return props.theme.titleLabelPaddingBottom;
|
|
175
|
+
}, function (props) {
|
|
176
|
+
return props.theme.titleLabelPaddingRight;
|
|
177
|
+
}, function (props) {
|
|
178
|
+
return props.theme.titleLabelPaddingLeft;
|
|
179
|
+
}, function (props) {
|
|
180
|
+
return props.disabled ? props.theme.disabledArrowColor : props.theme.arrowColor;
|
|
181
|
+
}, function (props) {
|
|
182
|
+
return props.padding && (0, _typeof2["default"])(props.padding) !== "object" ? _variables.spaces[props.padding] : "0px";
|
|
183
|
+
}, function (props) {
|
|
184
|
+
return props.padding && (0, _typeof2["default"])(props.padding) === "object" && props.padding.top ? _variables.spaces[props.padding.top] : "";
|
|
185
|
+
}, function (props) {
|
|
186
|
+
return props.padding && (0, _typeof2["default"])(props.padding) === "object" && props.padding.right ? _variables.spaces[props.padding.right] : "";
|
|
187
|
+
}, function (props) {
|
|
188
|
+
return props.padding && (0, _typeof2["default"])(props.padding) === "object" && props.padding.bottom ? _variables.spaces[props.padding.bottom] : "";
|
|
189
|
+
}, function (props) {
|
|
190
|
+
return props.padding && (0, _typeof2["default"])(props.padding) === "object" && props.padding.left ? _variables.spaces[props.padding.left] : "";
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
var AccordionInfo = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (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"])), function (props) {
|
|
194
|
+
return props.theme.titlePaddingLeft;
|
|
195
|
+
}, function (props) {
|
|
196
|
+
return props.theme.titlePaddingRight;
|
|
197
|
+
}, function (props) {
|
|
198
|
+
return props.theme.titleLabelFontFamily;
|
|
199
|
+
}, function (props) {
|
|
200
|
+
return props.theme.titleLabelFontSize;
|
|
201
|
+
}, function (props) {
|
|
202
|
+
return props.theme.titleLabelFontStyle;
|
|
203
|
+
}, function (props) {
|
|
204
|
+
return props.theme.titleFonLabeltWeight;
|
|
205
|
+
}, function (props) {
|
|
206
|
+
return props.disabled ? props.theme.disabledTitleLabelFontColor : props.theme.titleLabelFontColor;
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
var AccordionLabel = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])([""])));
|
|
210
|
+
|
|
211
|
+
var AccordionContent = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n width: 100%;\n"])));
|
|
212
|
+
|
|
213
|
+
var AccordionAssistiveText = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (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"])), function (props) {
|
|
214
|
+
return props.theme.assistiveTextPaddingLeft;
|
|
215
|
+
}, function (props) {
|
|
216
|
+
return props.theme.assistiveTextPaddingRight;
|
|
217
|
+
}, function (props) {
|
|
218
|
+
return props.theme.assistiveTextFontSize;
|
|
219
|
+
}, function (props) {
|
|
220
|
+
return props.theme.assistiveTextFontFamily;
|
|
221
|
+
}, function (props) {
|
|
222
|
+
return props.theme.assistiveTextFontStyle;
|
|
223
|
+
}, function (props) {
|
|
224
|
+
return props.theme.assistiveTextFontWeight;
|
|
225
|
+
}, function (props) {
|
|
226
|
+
return props.disabled ? props.theme.disabledAssistiveTextFontColor : props.theme.assistiveTextFontColor;
|
|
227
|
+
}, function (props) {
|
|
228
|
+
return props.theme.assistiveTextLetterSpacing;
|
|
229
|
+
}, function (props) {
|
|
230
|
+
return props.theme.assistiveTextMinWidth;
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
var IconContainer = _styledComponents["default"].div(_templateObject6 || (_templateObject6 = (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"])), function (props) {
|
|
234
|
+
return props.theme.iconSize;
|
|
235
|
+
}, function (props) {
|
|
236
|
+
return props.theme.iconSize;
|
|
237
|
+
}, function (props) {
|
|
238
|
+
return props.theme.iconMarginLeft;
|
|
239
|
+
}, function (props) {
|
|
240
|
+
return props.theme.iconMarginRigth;
|
|
241
|
+
}, function (props) {
|
|
242
|
+
return props.disabled ? props.theme.disabledIconColor : props.theme.iconColor;
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
var AccordionIcon = _styledComponents["default"].img(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n height: ", ";\n width: ", ";\n margin-left: ", ";\n margin-right: ", ";\n overflow: hidden;\n color: ", ";\n"])), function (props) {
|
|
246
|
+
return props.theme.iconSize;
|
|
247
|
+
}, function (props) {
|
|
248
|
+
return props.theme.iconSize;
|
|
249
|
+
}, function (props) {
|
|
250
|
+
return props.theme.iconMarginLeft;
|
|
251
|
+
}, function (props) {
|
|
252
|
+
return props.theme.iconMarginRigth;
|
|
253
|
+
}, function (props) {
|
|
254
|
+
return props.disabled ? props.theme.disabledIconColor : props.theme.iconColor;
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
var _default = DxcAccordion;
|
|
258
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,68 @@
|
|
|
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 SVG = React.SVGProps<SVGSVGElement> | React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
|
|
16
|
+
declare type Props = {
|
|
17
|
+
/**
|
|
18
|
+
* The panel label.
|
|
19
|
+
*/
|
|
20
|
+
label?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Represents the state of the panel. When true, the component will be
|
|
23
|
+
* expanded. If undefined, the component will be uncontrolled and its
|
|
24
|
+
* value will be managed internally by the component.
|
|
25
|
+
*/
|
|
26
|
+
isExpanded?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Element used as the icon that will be placed next to panel label.
|
|
29
|
+
*/
|
|
30
|
+
icon?: SVG;
|
|
31
|
+
/**
|
|
32
|
+
* @deprecated URL of the icon that will be placed next to panel label.
|
|
33
|
+
*/
|
|
34
|
+
iconSrc?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Assistive text to be placed on the right side of the panel.
|
|
37
|
+
*/
|
|
38
|
+
assistiveText?: string;
|
|
39
|
+
/**
|
|
40
|
+
* If true, the component will be disabled.
|
|
41
|
+
*/
|
|
42
|
+
disabled?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* This function will be called when the user clicks the accordion to expand or collapse
|
|
45
|
+
* the panel. The new state of the panel will be passed as a parameter.
|
|
46
|
+
*/
|
|
47
|
+
onChange?: (isExpanded: boolean) => void;
|
|
48
|
+
/**
|
|
49
|
+
* The expanded panel of the accordion. This area can be used to render
|
|
50
|
+
* custom content.
|
|
51
|
+
*/
|
|
52
|
+
children: React.ReactNode;
|
|
53
|
+
/**
|
|
54
|
+
* Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
55
|
+
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
|
|
56
|
+
*/
|
|
57
|
+
margin?: Space | Margin;
|
|
58
|
+
/**
|
|
59
|
+
* Size of the padding to be applied to the custom area ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
60
|
+
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different padding sizes.
|
|
61
|
+
*/
|
|
62
|
+
padding?: Space | Padding;
|
|
63
|
+
/**
|
|
64
|
+
* Value of the tabindex.
|
|
65
|
+
*/
|
|
66
|
+
tabIndex?: number;
|
|
67
|
+
};
|
|
68
|
+
export default Props;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import AccordionGroupPropsType, { AccordionPropsType } from "./types";
|
|
3
|
+
declare const DxcAccordionGroup: {
|
|
4
|
+
({ indexActive, disabled, onActiveChange, margin, children, }: AccordionGroupPropsType): JSX.Element;
|
|
5
|
+
Accordion: ({ ...childProps }: AccordionPropsType) => JSX.Element;
|
|
6
|
+
};
|
|
7
|
+
export default DxcAccordionGroup;
|