@dxc-technology/halstack-react 0.0.0-fc652e4 → 0.0.0-fdc49d2
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 +47 -0
- package/ThemeContext.d.ts +10 -0
- package/ThemeContext.js +243 -0
- package/accordion/Accordion.d.ts +4 -0
- package/accordion/Accordion.js +248 -0
- package/accordion/Accordion.stories.tsx +307 -0
- package/accordion/Accordion.test.js +72 -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/AccordionGroup.stories.tsx +225 -0
- package/accordion-group/AccordionGroup.test.js +133 -0
- package/accordion-group/types.d.ts +68 -0
- package/accordion-group/types.js +5 -0
- package/alert/Alert.d.ts +4 -0
- package/{dist/alert → alert}/Alert.js +44 -157
- package/alert/Alert.stories.tsx +170 -0
- package/alert/Alert.test.js +92 -0
- package/alert/types.d.ts +49 -0
- package/alert/types.js +5 -0
- package/badge/Badge.d.ts +4 -0
- package/badge/Badge.js +59 -0
- package/badge/types.d.ts +4 -0
- package/badge/types.js +5 -0
- package/bleed/Bleed.d.ts +3 -0
- package/bleed/Bleed.js +84 -0
- package/bleed/Bleed.stories.tsx +342 -0
- package/bleed/types.d.ts +37 -0
- package/bleed/types.js +5 -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/Box.test.js +18 -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 +27 -94
- package/button/Button.stories.tsx +274 -0
- package/button/Button.test.js +35 -0
- package/button/types.d.ts +53 -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/Card.test.js +50 -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 +24 -77
- package/checkbox/Checkbox.stories.tsx +192 -0
- package/checkbox/Checkbox.test.js +78 -0
- package/checkbox/types.d.ts +64 -0
- package/checkbox/types.js +5 -0
- package/chip/Chip.d.ts +4 -0
- package/chip/Chip.js +161 -0
- package/chip/Chip.stories.tsx +119 -0
- package/chip/Chip.test.js +56 -0
- package/chip/types.d.ts +45 -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 +351 -345
- package/date-input/DateInput.d.ts +4 -0
- package/date-input/DateInput.js +354 -0
- package/date-input/DateInput.stories.tsx +138 -0
- package/date-input/DateInput.test.js +492 -0
- package/date-input/types.d.ts +104 -0
- package/date-input/types.js +5 -0
- package/dialog/Dialog.d.ts +4 -0
- package/{dist/dialog → dialog}/Dialog.js +24 -76
- package/dialog/Dialog.stories.tsx +212 -0
- package/dialog/Dialog.test.js +40 -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 +54 -208
- package/dropdown/Dropdown.stories.tsx +249 -0
- package/dropdown/Dropdown.test.js +189 -0
- package/dropdown/types.d.ts +80 -0
- package/dropdown/types.js +5 -0
- package/file-input/FileInput.d.ts +4 -0
- package/file-input/FileInput.js +590 -0
- package/file-input/FileInput.stories.tsx +507 -0
- package/file-input/FileInput.test.js +457 -0
- 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 +258 -0
- package/footer/Footer.stories.tsx +130 -0
- package/footer/Footer.test.js +109 -0
- package/footer/Icons.d.ts +2 -0
- package/footer/Icons.js +77 -0
- package/footer/types.d.ts +65 -0
- package/footer/types.js +5 -0
- package/header/Header.d.ts +7 -0
- package/header/Header.js +324 -0
- package/header/Header.stories.tsx +162 -0
- package/header/Header.test.js +63 -0
- package/header/Icons.d.ts +2 -0
- package/header/Icons.js +34 -0
- 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 +31 -90
- package/heading/Heading.stories.tsx +54 -0
- package/heading/Heading.test.js +186 -0
- package/heading/types.d.ts +33 -0
- package/heading/types.js +5 -0
- package/inset/Inset.d.ts +3 -0
- package/inset/Inset.js +84 -0
- package/inset/Inset.stories.tsx +229 -0
- package/inset/types.d.ts +13 -0
- package/inset/types.js +5 -0
- package/layout/ApplicationLayout.d.ts +10 -0
- package/layout/ApplicationLayout.js +231 -0
- package/layout/ApplicationLayout.stories.tsx +171 -0
- package/layout/Icons.js +55 -0
- 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 +23 -111
- package/link/Link.stories.tsx +151 -0
- package/link/Link.test.js +91 -0
- package/link/types.d.ts +70 -0
- package/link/types.js +5 -0
- package/list/List.d.ts +4 -0
- package/list/List.js +47 -0
- package/list/List.stories.tsx +95 -0
- package/list/types.d.ts +7 -0
- package/list/types.js +5 -0
- package/main.d.ts +47 -0
- package/{dist/main.js → main.js} +135 -99
- package/number-input/NumberInput.d.ts +4 -0
- package/number-input/NumberInput.js +76 -0
- package/number-input/NumberInput.stories.tsx +115 -0
- package/number-input/NumberInput.test.js +508 -0
- package/number-input/NumberInputContext.d.ts +4 -0
- package/{dist/number/NumberContext.js → number-input/NumberInputContext.js} +6 -3
- package/number-input/numberInputContextTypes.d.ts +19 -0
- package/number-input/numberInputContextTypes.js +5 -0
- package/number-input/types.d.ts +121 -0
- package/number-input/types.js +5 -0
- package/package.json +34 -24
- package/paginator/Icons.js +66 -0
- package/paginator/Paginator.d.ts +4 -0
- package/paginator/Paginator.js +192 -0
- package/paginator/Paginator.stories.tsx +63 -0
- package/paginator/Paginator.test.js +266 -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/Password.js → password-input/PasswordInput.js} +46 -83
- package/password-input/PasswordInput.stories.tsx +131 -0
- package/password-input/PasswordInput.test.js +183 -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/ProgressBar.test.js +65 -0
- package/progress-bar/types.d.ts +37 -0
- package/progress-bar/types.js +5 -0
- package/quick-nav/QuickNav.d.ts +4 -0
- package/quick-nav/QuickNav.js +60 -0
- package/quick-nav/QuickNav.stories.tsx +237 -0
- package/quick-nav/types.d.ts +25 -0
- package/quick-nav/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/Radio.test.js +71 -0
- package/radio/types.d.ts +54 -0
- package/radio/types.js +5 -0
- package/radio-group/Radio.d.ts +4 -0
- package/radio-group/Radio.js +141 -0
- package/radio-group/RadioGroup.d.ts +4 -0
- package/radio-group/RadioGroup.js +280 -0
- package/radio-group/RadioGroup.stories.tsx +100 -0
- package/radio-group/RadioGroup.test.js +695 -0
- package/radio-group/types.d.ts +114 -0
- package/radio-group/types.js +5 -0
- package/resultsetTable/ResultsetTable.d.ts +4 -0
- package/{dist/resultsetTable → resultsetTable}/ResultsetTable.js +43 -147
- package/resultsetTable/ResultsetTable.stories.tsx +275 -0
- package/resultsetTable/ResultsetTable.test.js +306 -0
- package/resultsetTable/types.d.ts +67 -0
- package/resultsetTable/types.js +5 -0
- package/row/Row.d.ts +3 -0
- package/row/Row.js +127 -0
- package/row/Row.stories.tsx +237 -0
- package/row/types.d.ts +28 -0
- package/row/types.js +5 -0
- package/select/Icons.d.ts +10 -0
- package/select/Icons.js +93 -0
- package/select/Option.d.ts +4 -0
- package/select/Option.js +110 -0
- package/select/Select.d.ts +4 -0
- package/select/Select.js +740 -0
- package/select/Select.stories.tsx +582 -0
- package/select/Select.test.js +2016 -0
- package/select/types.d.ts +191 -0
- package/select/types.js +5 -0
- package/sidenav/Sidenav.d.ts +9 -0
- package/sidenav/Sidenav.js +136 -0
- package/sidenav/Sidenav.stories.tsx +182 -0
- package/sidenav/Sidenav.test.js +56 -0
- package/sidenav/types.d.ts +50 -0
- package/sidenav/types.js +5 -0
- package/slider/Slider.d.ts +4 -0
- package/slider/Slider.js +317 -0
- package/slider/Slider.stories.tsx +177 -0
- package/slider/Slider.test.js +129 -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 +103 -0
- package/spinner/Spinner.test.js +64 -0
- package/spinner/types.d.ts +32 -0
- package/spinner/types.js +5 -0
- package/stack/Stack.d.ts +3 -0
- package/stack/Stack.js +97 -0
- package/stack/Stack.stories.tsx +164 -0
- package/stack/types.d.ts +24 -0
- package/stack/types.js +5 -0
- package/switch/Switch.d.ts +4 -0
- package/{dist/switch → switch}/Switch.js +45 -75
- package/switch/Switch.stories.tsx +160 -0
- package/switch/Switch.test.js +98 -0
- package/switch/types.d.ts +62 -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 +277 -0
- package/table/Table.test.js +26 -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 +120 -0
- package/tabs/Tabs.test.js +123 -0
- package/tabs/types.d.ts +78 -0
- package/tabs/types.js +5 -0
- package/tag/Tag.d.ts +4 -0
- package/tag/Tag.js +186 -0
- package/tag/Tag.stories.tsx +142 -0
- package/tag/Tag.test.js +60 -0
- package/tag/types.d.ts +69 -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/text-input/TextInput.js +798 -0
- package/text-input/TextInput.stories.tsx +474 -0
- package/text-input/TextInput.test.js +1725 -0
- package/text-input/types.d.ts +163 -0
- package/text-input/types.js +5 -0
- package/textarea/Textarea.d.ts +4 -0
- package/{dist/new-textarea/NewTextarea.js → textarea/Textarea.js} +95 -155
- package/textarea/Textarea.stories.jsx +157 -0
- package/textarea/Textarea.test.js +437 -0
- package/textarea/types.d.ts +134 -0
- package/textarea/types.js +5 -0
- package/toggle-group/ToggleGroup.d.ts +4 -0
- package/toggle-group/ToggleGroup.js +214 -0
- package/toggle-group/ToggleGroup.stories.tsx +173 -0
- package/toggle-group/ToggleGroup.test.js +125 -0
- package/toggle-group/types.d.ts +97 -0
- package/toggle-group/types.js +5 -0
- package/useTheme.d.ts +2 -0
- package/{dist/useTheme.js → useTheme.js} +1 -1
- package/wizard/Wizard.d.ts +4 -0
- package/wizard/Wizard.js +286 -0
- package/wizard/Wizard.stories.tsx +214 -0
- package/wizard/Wizard.test.js +141 -0
- package/wizard/types.d.ts +64 -0
- package/wizard/types.js +5 -0
- package/README.md +0 -66
- package/babel.config.js +0 -8
- package/dist/BackgroundColorContext.js +0 -46
- package/dist/ThemeContext.js +0 -241
- package/dist/accordion/Accordion.js +0 -353
- 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/badge/Badge.js +0 -63
- package/dist/checkbox/Checkbox.stories.js +0 -144
- package/dist/checkbox/readme.md +0 -116
- package/dist/chip/Chip.js +0 -265
- package/dist/date/Date.js +0 -381
- package/dist/date/Date.stories.js +0 -205
- package/dist/date/readme.md +0 -73
- package/dist/footer/Footer.js +0 -395
- package/dist/footer/Footer.stories.js +0 -94
- package/dist/footer/dxc_logo.svg +0 -15
- package/dist/footer/readme.md +0 -41
- package/dist/header/Header.js +0 -403
- package/dist/header/Header.stories.js +0 -176
- package/dist/header/close_icon.svg +0 -1
- package/dist/header/dxc_logo_black.svg +0 -8
- 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.js +0 -707
- 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/ApplicationLayout.js +0 -331
- package/dist/layout/facebook.svg +0 -45
- package/dist/layout/linkedin.svg +0 -50
- package/dist/layout/twitter.svg +0 -53
- package/dist/link/readme.md +0 -51
- package/dist/new-date/NewDate.js +0 -403
- package/dist/new-input-text/NewInputText.js +0 -961
- package/dist/number/Number.js +0 -138
- package/dist/paginator/Paginator.js +0 -289
- 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/password/styles.css +0 -3
- 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 -585
- package/dist/select/Select.stories.js +0 -235
- package/dist/select/readme.md +0 -72
- package/dist/sidenav/Sidenav.js +0 -177
- package/dist/slider/Slider.js +0 -319
- package/dist/slider/Slider.stories.js +0 -241
- package/dist/slider/readme.md +0 -64
- package/dist/spinner/Spinner.js +0 -218
- 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/tabs/Tabs.js +0 -343
- 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/tag/Tag.js +0 -288
- package/dist/textarea/Textarea.js +0 -264
- package/dist/toggle/Toggle.js +0 -220
- package/dist/toggle/Toggle.stories.js +0 -297
- package/dist/toggle/readme.md +0 -80
- package/dist/toggle-group/ToggleGroup.js +0 -223
- package/dist/upload/Upload.js +0 -205
- package/dist/upload/Upload.stories.js +0 -72
- package/dist/upload/buttons-upload/ButtonsUpload.js +0 -139
- 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 -329
- 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/files-upload/FilesToUpload.js +0 -123
- package/dist/upload/readme.md +0 -37
- package/dist/upload/transaction/Transaction.js +0 -175
- 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 -411
- package/dist/wizard/invalid_icon.svg +0 -5
- package/dist/wizard/valid_icon.svg +0 -5
- 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 -145
- 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 -43
- package/test/NewDate.test.js +0 -203
- package/test/NewInputText.test.js +0 -817
- package/test/NewTextarea.test.js +0 -201
- package/test/Number.test.js +0 -241
- package/test/Paginator.test.js +0 -177
- package/test/Password.test.js +0 -76
- 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 -189
- 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,264 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
-
|
|
5
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
exports["default"] = void 0;
|
|
11
|
-
|
|
12
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
13
|
-
|
|
14
|
-
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
15
|
-
|
|
16
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
17
|
-
|
|
18
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
19
|
-
|
|
20
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
21
|
-
|
|
22
|
-
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
23
|
-
|
|
24
|
-
var _TextField = _interopRequireDefault(require("@material-ui/core/TextField"));
|
|
25
|
-
|
|
26
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
27
|
-
|
|
28
|
-
var _variables = require("../common/variables.js");
|
|
29
|
-
|
|
30
|
-
var _utils = require("../common/utils.js");
|
|
31
|
-
|
|
32
|
-
var _useTheme = _interopRequireDefault(require("../useTheme.js"));
|
|
33
|
-
|
|
34
|
-
var _RequiredComponent = _interopRequireDefault(require("../common/RequiredComponent"));
|
|
35
|
-
|
|
36
|
-
var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext.js"));
|
|
37
|
-
|
|
38
|
-
function _templateObject() {
|
|
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\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"]);
|
|
40
|
-
|
|
41
|
-
_templateObject = function _templateObject() {
|
|
42
|
-
return data;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
return data;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
var DxcTextarea = function DxcTextarea(_ref) {
|
|
49
|
-
var _ref$label = _ref.label,
|
|
50
|
-
label = _ref$label === void 0 ? " " : _ref$label,
|
|
51
|
-
_ref$name = _ref.name,
|
|
52
|
-
name = _ref$name === void 0 ? "" : _ref$name,
|
|
53
|
-
value = _ref.value,
|
|
54
|
-
_ref$assistiveText = _ref.assistiveText,
|
|
55
|
-
assistiveText = _ref$assistiveText === void 0 ? "" : _ref$assistiveText,
|
|
56
|
-
_ref$disabled = _ref.disabled,
|
|
57
|
-
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
58
|
-
_ref$onChange = _ref.onChange,
|
|
59
|
-
onChange = _ref$onChange === void 0 ? "" : _ref$onChange,
|
|
60
|
-
_ref$onBlur = _ref.onBlur,
|
|
61
|
-
onBlur = _ref$onBlur === void 0 ? "" : _ref$onBlur,
|
|
62
|
-
_ref$numRows = _ref.numRows,
|
|
63
|
-
numRows = _ref$numRows === void 0 ? 4 : _ref$numRows,
|
|
64
|
-
_ref$invalid = _ref.invalid,
|
|
65
|
-
invalid = _ref$invalid === void 0 ? false : _ref$invalid,
|
|
66
|
-
_ref$required = _ref.required,
|
|
67
|
-
required = _ref$required === void 0 ? false : _ref$required,
|
|
68
|
-
_ref$placeholder = _ref.placeholder,
|
|
69
|
-
placeholder = _ref$placeholder === void 0 ? "" : _ref$placeholder,
|
|
70
|
-
margin = _ref.margin,
|
|
71
|
-
_ref$size = _ref.size,
|
|
72
|
-
size = _ref$size === void 0 ? "medium" : _ref$size,
|
|
73
|
-
_ref$tabIndex = _ref.tabIndex,
|
|
74
|
-
tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
|
|
75
|
-
|
|
76
|
-
var _useState = (0, _react.useState)(""),
|
|
77
|
-
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
78
|
-
innerValue = _useState2[0],
|
|
79
|
-
setInnerValue = _useState2[1];
|
|
80
|
-
|
|
81
|
-
var colorsTheme = (0, _useTheme["default"])();
|
|
82
|
-
var backgroundType = (0, _react.useContext)(_BackgroundColorContext["default"]);
|
|
83
|
-
|
|
84
|
-
var handlerTextareaChange = function handlerTextareaChange(event) {
|
|
85
|
-
if (value === null || value === undefined) {
|
|
86
|
-
if (typeof onChange === "function") {
|
|
87
|
-
setInnerValue(event.target.value);
|
|
88
|
-
onChange(event.target.value);
|
|
89
|
-
} else {
|
|
90
|
-
setInnerValue(event.target.value);
|
|
91
|
-
}
|
|
92
|
-
} else if (onChange !== "") {
|
|
93
|
-
if (typeof onChange === "function") {
|
|
94
|
-
onChange(event.target.value);
|
|
95
|
-
} else {
|
|
96
|
-
setInnerValue(event.target.value);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
var handlerTextareaBlur = function handlerTextareaBlur(event) {
|
|
102
|
-
setInnerValue(event.target.value);
|
|
103
|
-
|
|
104
|
-
if (onBlur) {
|
|
105
|
-
onBlur(event.target.value);
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
return _react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
110
|
-
theme: colorsTheme.textarea
|
|
111
|
-
}, _react["default"].createElement(TextContainer, {
|
|
112
|
-
required: required,
|
|
113
|
-
assistiveText: assistiveText,
|
|
114
|
-
margin: margin,
|
|
115
|
-
size: size,
|
|
116
|
-
backgroundType: backgroundType
|
|
117
|
-
}, _react["default"].createElement(_TextField["default"], {
|
|
118
|
-
error: invalid,
|
|
119
|
-
value: value !== null ? value : innerValue,
|
|
120
|
-
name: name,
|
|
121
|
-
multiline: true,
|
|
122
|
-
disabled: disabled,
|
|
123
|
-
label: required ? _react["default"].createElement(_react["default"].Fragment, null, _react["default"].createElement(_RequiredComponent["default"], null), label) : label,
|
|
124
|
-
helperText: assistiveText,
|
|
125
|
-
onChange: handlerTextareaChange,
|
|
126
|
-
onBlur: onBlur && handlerTextareaBlur || null,
|
|
127
|
-
rows: numRows,
|
|
128
|
-
placeholder: placeholder,
|
|
129
|
-
inputProps: {
|
|
130
|
-
tabIndex: tabIndex
|
|
131
|
-
}
|
|
132
|
-
})));
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
var sizes = {
|
|
136
|
-
small: "42px",
|
|
137
|
-
medium: "240px",
|
|
138
|
-
large: "480px",
|
|
139
|
-
fillParent: "100%"
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
var calculateWidth = function calculateWidth(margin, size) {
|
|
143
|
-
return size === "fillParent" ? "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")") : sizes[size];
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
var TextContainer = _styledComponents["default"].div(_templateObject(), function (props) {
|
|
147
|
-
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
148
|
-
}, function (props) {
|
|
149
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
|
|
150
|
-
}, function (props) {
|
|
151
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.right ? _variables.spaces[props.margin.right] : "";
|
|
152
|
-
}, function (props) {
|
|
153
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.bottom ? _variables.spaces[props.margin.bottom] : "";
|
|
154
|
-
}, function (props) {
|
|
155
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
156
|
-
}, function (props) {
|
|
157
|
-
return calculateWidth(props.margin, props.size);
|
|
158
|
-
}, function (props) {
|
|
159
|
-
return props.theme.fontFamily;
|
|
160
|
-
}, function (props) {
|
|
161
|
-
return props.theme.assistiveTextFontSize;
|
|
162
|
-
}, function (props) {
|
|
163
|
-
return props.theme.assistiveTextFontStyle;
|
|
164
|
-
}, function (props) {
|
|
165
|
-
return props.theme.assistiveTextFontWeight;
|
|
166
|
-
}, function (props) {
|
|
167
|
-
return props.theme.assistiveTextLetterSpacing;
|
|
168
|
-
}, function (props) {
|
|
169
|
-
return props.theme.labelFontSize;
|
|
170
|
-
}, function (props) {
|
|
171
|
-
return props.theme.labelFontStyle;
|
|
172
|
-
}, function (props) {
|
|
173
|
-
return props.theme.labelFontWeight;
|
|
174
|
-
}, function (props) {
|
|
175
|
-
return props.theme.labelLetterSpacing;
|
|
176
|
-
}, function (props) {
|
|
177
|
-
return props.backgroundType === "dark" ? props.theme.labelFontColorOnDark : props.theme.labelFontColor;
|
|
178
|
-
}, function (props) {
|
|
179
|
-
return props.backgroundType === "dark" ? props.theme.disabledColorOnDark : props.theme.disabledColor;
|
|
180
|
-
}, function (props) {
|
|
181
|
-
return props.backgroundType === "dark" ? props.theme.labelFontColorOnDark : props.theme.labelFontColor;
|
|
182
|
-
}, function (props) {
|
|
183
|
-
return props.theme.fontFamily;
|
|
184
|
-
}, function (props) {
|
|
185
|
-
return props.backgroundType === "dark" ? props.theme.errorColorOnDark : props.theme.errorColor;
|
|
186
|
-
}, function (props) {
|
|
187
|
-
return props.theme.fontFamily;
|
|
188
|
-
}, function (props) {
|
|
189
|
-
return props.backgroundType === "dark" ? props.theme.labelFontColorOnDark : props.theme.labelFontColor;
|
|
190
|
-
}, function (props) {
|
|
191
|
-
return props.backgroundType === "dark" ? props.theme.assistiveTextFontColorOnDark : props.theme.assistiveTextFontColor;
|
|
192
|
-
}, function (props) {
|
|
193
|
-
return props.backgroundType ? props.theme.underlineColorOnDark : props.theme.underlineColor;
|
|
194
|
-
}, function (props) {
|
|
195
|
-
return props.backgroundType === "dark" ? props.theme.labelFontColorOnDark : props.theme.labelFontColor;
|
|
196
|
-
}, function (props) {
|
|
197
|
-
return "".concat(props.theme.underlineThickness, " solid ").concat(props.backgroundType === "dark" ? props.theme.underlineColorOnDark : props.theme.underlineColor);
|
|
198
|
-
}, function (props) {
|
|
199
|
-
return "".concat(props.theme.underlineThickness, " solid ").concat(props.backgroundType === "dark" ? props.theme.underlineColorOnDark : props.theme.underlineColor);
|
|
200
|
-
}, function (props) {
|
|
201
|
-
return "calc(".concat(props.theme.underlineThickness, " + 1px) solid ").concat(props.backgroundType === "dark" ? props.theme.underlineFocusColorOnDark : props.theme.underlineFocusColor);
|
|
202
|
-
}, function (props) {
|
|
203
|
-
return props.backgroundType === "dark" ? props.theme.scrollBarTrackColorOnDark : props.theme.scrollBarTrackColor;
|
|
204
|
-
}, function (props) {
|
|
205
|
-
return props.backgroundType === "dark" ? props.theme.scrollBarThumbColorOnDark : props.theme.scrollBarThumbColor;
|
|
206
|
-
}, function (props) {
|
|
207
|
-
return props.theme.underlineThickness;
|
|
208
|
-
}, function (props) {
|
|
209
|
-
return props.backgroundType === "dark" ? props.theme.errorColorOnDark : props.theme.errorColor;
|
|
210
|
-
}, function (props) {
|
|
211
|
-
return props.theme.underlineThickness;
|
|
212
|
-
}, function (props) {
|
|
213
|
-
return props.backgroundType === "dark" ? props.theme.underlineFocusColorOnDark : props.theme.underlineFocusColor;
|
|
214
|
-
}, function (props) {
|
|
215
|
-
return props.backgroundType === "dark" ? props.theme.errorColorOnDark : props.theme.errorColor;
|
|
216
|
-
}, function (props) {
|
|
217
|
-
return "".concat(props.theme.underlineThickness, " solid ").concat(props.backgroundType === "dark" ? props.theme.disabledColorOnDark : props.theme.disabledColor, " !important");
|
|
218
|
-
}, function (props) {
|
|
219
|
-
return props.theme.fontFamily;
|
|
220
|
-
}, function (props) {
|
|
221
|
-
return props.theme.valueFontSize;
|
|
222
|
-
}, function (props) {
|
|
223
|
-
return props.theme.valueFontStyle;
|
|
224
|
-
}, function (props) {
|
|
225
|
-
return props.theme.valueFontWeight;
|
|
226
|
-
}, function (props) {
|
|
227
|
-
return props.theme.valueLetterSpacing;
|
|
228
|
-
}, function (props) {
|
|
229
|
-
return props.backgroundType === "dark" ? props.theme.valueFontColorOnDark : props.theme.valueFontColor;
|
|
230
|
-
}, function (props) {
|
|
231
|
-
return props.theme.valueLineHeight;
|
|
232
|
-
}, function (props) {
|
|
233
|
-
return props.backgroundType === "dark" ? props.theme.disabledColorOnDark : props.theme.disabledColor;
|
|
234
|
-
}, function (props) {
|
|
235
|
-
return props.backgroundType === "dark" ? props.theme.underlineFocusColorOnDark : props.theme.underlineFocusColor;
|
|
236
|
-
}, function (props) {
|
|
237
|
-
return "".concat(props.backgroundType === "dark" ? props.theme.errorColorOnDark : props.theme.errorColor, " !important");
|
|
238
|
-
}, function (props) {
|
|
239
|
-
return props.backgroundType === "dark" ? props.theme.disabledColorOnDark : props.theme.disabledColor;
|
|
240
|
-
});
|
|
241
|
-
|
|
242
|
-
DxcTextarea.propTypes = {
|
|
243
|
-
label: _propTypes["default"].string,
|
|
244
|
-
name: _propTypes["default"].string,
|
|
245
|
-
value: _propTypes["default"].string,
|
|
246
|
-
assistiveText: _propTypes["default"].string,
|
|
247
|
-
disabled: _propTypes["default"].bool,
|
|
248
|
-
required: _propTypes["default"].bool,
|
|
249
|
-
invalid: _propTypes["default"].bool,
|
|
250
|
-
placeholder: _propTypes["default"].string,
|
|
251
|
-
onChange: _propTypes["default"].func,
|
|
252
|
-
onBlur: _propTypes["default"].func,
|
|
253
|
-
numRows: _propTypes["default"].number,
|
|
254
|
-
size: _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(sizes))),
|
|
255
|
-
margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
|
256
|
-
top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
257
|
-
bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
258
|
-
left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
259
|
-
right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
|
|
260
|
-
}), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
|
|
261
|
-
tabIndex: _propTypes["default"].number
|
|
262
|
-
};
|
|
263
|
-
var _default = DxcTextarea;
|
|
264
|
-
exports["default"] = _default;
|
package/dist/toggle/Toggle.js
DELETED
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
-
|
|
5
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
exports["default"] = void 0;
|
|
11
|
-
|
|
12
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
13
|
-
|
|
14
|
-
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
15
|
-
|
|
16
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
17
|
-
|
|
18
|
-
var _react = _interopRequireDefault(require("react"));
|
|
19
|
-
|
|
20
|
-
var _lab = require("@material-ui/lab");
|
|
21
|
-
|
|
22
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
23
|
-
|
|
24
|
-
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
25
|
-
|
|
26
|
-
var _utils = require("../common/utils.js");
|
|
27
|
-
|
|
28
|
-
var _useTheme = _interopRequireDefault(require("../useTheme.js"));
|
|
29
|
-
|
|
30
|
-
function _templateObject4() {
|
|
31
|
-
var data = (0, _taggedTemplateLiteral2["default"])([""]);
|
|
32
|
-
|
|
33
|
-
_templateObject4 = function _templateObject4() {
|
|
34
|
-
return data;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
return data;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function _templateObject3() {
|
|
41
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n width: 20px;\n height: 20px;\n line-height: 1;\n margin-right: ", ";\n margin-left: ", ";\n"]);
|
|
42
|
-
|
|
43
|
-
_templateObject3 = function _templateObject3() {
|
|
44
|
-
return data;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
return data;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function _templateObject2() {
|
|
51
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n line-height: 1;\n display: flex;\n align-items: center;\n flex-direction: ", ";\n"]);
|
|
52
|
-
|
|
53
|
-
_templateObject2 = function _templateObject2() {
|
|
54
|
-
return data;
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
return data;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function _templateObject() {
|
|
61
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n & {\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n\n opacity: ", ";\n cursor: ", ";\n display: inline-block;\n width: ", ";\n }\n\n .MuiToggleButton-label {\n font-size: 14px;\n font-family: ", ";\n color: ", ";\n }\n .MuiButtonBase-root {\n width: ", ";\n min-height: ", ";\n background-color: ", ";\n &:hover {\n background-color: ", ";\n .MuiToggleButton-label {\n color: ", ";\n }\n }\n }\n\n .MuiToggleButton-root {\n min-width: 42px;\n height: 43px;\n border: ", ";\n\n border-radius: 4px !important;\n }\n\n .MuiToggleButton-root.Mui-selected {\n background-color: ", ";\n &:hover {\n background-color: ", ";\n .MuiToggleButton-label {\n color: ", ";\n }\n }\n }\n\n .MuiToggleButton-root:last-child,\n .MuiToggleButton-root:first-child,\n .MuiToggleButton-root:not(:first-child) {\n padding: ", ";\n }\n\n .MuiTouchRipple-child {\n background-color: ", ";\n }\n"]);
|
|
62
|
-
|
|
63
|
-
_templateObject = function _templateObject() {
|
|
64
|
-
return data;
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
return data;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
var DxcToggle = function DxcToggle(_ref) {
|
|
71
|
-
var _ref$label = _ref.label,
|
|
72
|
-
label = _ref$label === void 0 ? "" : _ref$label,
|
|
73
|
-
_ref$iconSrc = _ref.iconSrc,
|
|
74
|
-
iconSrc = _ref$iconSrc === void 0 ? "" : _ref$iconSrc,
|
|
75
|
-
_ref$mode = _ref.mode,
|
|
76
|
-
mode = _ref$mode === void 0 ? "basic" : _ref$mode,
|
|
77
|
-
_ref$theme = _ref.theme,
|
|
78
|
-
theme = _ref$theme === void 0 ? "light" : _ref$theme,
|
|
79
|
-
_ref$disableRipple = _ref.disableRipple,
|
|
80
|
-
disableRipple = _ref$disableRipple === void 0 ? false : _ref$disableRipple,
|
|
81
|
-
_ref$iconPosition = _ref.iconPosition,
|
|
82
|
-
iconPosition = _ref$iconPosition === void 0 ? "before" : _ref$iconPosition,
|
|
83
|
-
_ref$disabled = _ref.disabled,
|
|
84
|
-
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
85
|
-
onClick = _ref.onClick,
|
|
86
|
-
_ref$selected = _ref.selected,
|
|
87
|
-
selected = _ref$selected === void 0 ? false : _ref$selected,
|
|
88
|
-
margin = _ref.margin,
|
|
89
|
-
_ref$size = _ref.size,
|
|
90
|
-
size = _ref$size === void 0 ? "fitContent" : _ref$size;
|
|
91
|
-
var colorsTheme = (0, _useTheme["default"])();
|
|
92
|
-
|
|
93
|
-
var handlerToggleClick = function handlerToggleClick() {
|
|
94
|
-
if (!disabled && typeof onClick === "function") {
|
|
95
|
-
onClick(!selected);
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
return _react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
100
|
-
theme: colorsTheme
|
|
101
|
-
}, _react["default"].createElement(DxcToggleContainer, {
|
|
102
|
-
margin: margin,
|
|
103
|
-
brightness: theme,
|
|
104
|
-
disabled: disabled,
|
|
105
|
-
disableRipple: disableRipple,
|
|
106
|
-
selected: selected,
|
|
107
|
-
label: label,
|
|
108
|
-
mode: mode,
|
|
109
|
-
iconPosition: iconPosition,
|
|
110
|
-
value: true,
|
|
111
|
-
size: size,
|
|
112
|
-
onClick: handlerToggleClick
|
|
113
|
-
}, _react["default"].createElement(_lab.ToggleButton, {
|
|
114
|
-
disabled: disabled,
|
|
115
|
-
disableRipple: disableRipple,
|
|
116
|
-
selected: selected,
|
|
117
|
-
label: label,
|
|
118
|
-
value: true
|
|
119
|
-
}, _react["default"].createElement(ContentContainer, {
|
|
120
|
-
iconPosition: iconPosition,
|
|
121
|
-
label: label,
|
|
122
|
-
iconSrc: iconSrc
|
|
123
|
-
}, iconSrc !== "" && _react["default"].createElement(IconContainer, {
|
|
124
|
-
iconPosition: iconPosition,
|
|
125
|
-
label: label,
|
|
126
|
-
src: iconSrc
|
|
127
|
-
}), label !== "" && _react["default"].createElement(LabelContainer, null, label)))));
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
var sizes = {
|
|
131
|
-
small: "42px",
|
|
132
|
-
medium: "120px",
|
|
133
|
-
large: "240px",
|
|
134
|
-
fillParent: "100%",
|
|
135
|
-
fitContent: "unset"
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
var calculateWidth = function calculateWidth(margin, size) {
|
|
139
|
-
if (size === "fillParent") {
|
|
140
|
-
return "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")");
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
return sizes[size];
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
var DxcToggleContainer = _styledComponents["default"].div(_templateObject(), function (props) {
|
|
147
|
-
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? spaces[props.margin] : "0px";
|
|
148
|
-
}, function (props) {
|
|
149
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? spaces[props.margin.top] : "";
|
|
150
|
-
}, function (props) {
|
|
151
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.right ? spaces[props.margin.right] : "";
|
|
152
|
-
}, function (props) {
|
|
153
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.bottom ? spaces[props.margin.bottom] : "";
|
|
154
|
-
}, function (props) {
|
|
155
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? spaces[props.margin.left] : "";
|
|
156
|
-
}, function (props) {
|
|
157
|
-
return props.disabled ? "0.5" : "1";
|
|
158
|
-
}, function (props) {
|
|
159
|
-
return props.disabled ? "not-allowed" : "pointer";
|
|
160
|
-
}, function (props) {
|
|
161
|
-
return calculateWidth(props.margin, props.size);
|
|
162
|
-
}, function (props) {
|
|
163
|
-
return props.theme.fontFamily;
|
|
164
|
-
}, function (props) {
|
|
165
|
-
return props.brightness === "dark" && props.mode === "outlined" ? props.theme.white : props.theme.black;
|
|
166
|
-
}, function (props) {
|
|
167
|
-
return calculateWidth(props.margin, props.size);
|
|
168
|
-
}, function (props) {
|
|
169
|
-
return props.mode === "outlined" ? "41px" : "43px";
|
|
170
|
-
}, function (props) {
|
|
171
|
-
return props.mode !== "outlined" ? props.theme.darkWhite : "transparent";
|
|
172
|
-
}, function (props) {
|
|
173
|
-
return props.mode === "basic" ? props.theme.lightGrey : props.brightness === "dark" ? props.theme.darkGrey : props.theme.darkWhite;
|
|
174
|
-
}, function (props) {
|
|
175
|
-
return props.brightness === "dark" && props.mode === "outlined" ? props.theme.white : props.theme.black;
|
|
176
|
-
}, function (props) {
|
|
177
|
-
return props.mode === "basic" ? "none !important" : props.brightness === "dark" && !props.selected ? "2px solid ".concat(props.theme.white, " !important") : props.brightness === "dark" && props.selected ? "2px solid ".concat(props.theme.yellow, " !important") : "2px solid ".concat(props.theme.black, " !important");
|
|
178
|
-
}, function (props) {
|
|
179
|
-
return props.mode === "outlined" ? props.brightness === "light" ? props.theme.darkWhite : "transparent" : props.theme.yellow;
|
|
180
|
-
}, function (props) {
|
|
181
|
-
return props.mode === "basic" && props.brightness === "light" ? props.theme.black : props.mode === "basic" && props.brightness === "dark" ? props.theme.lightBlack : props.brightness === "light" ? props.theme.lightGrey : props.theme.darkGrey;
|
|
182
|
-
}, function (props) {
|
|
183
|
-
return props.mode === "basic" ? props.theme.yellow : props.brightness === "dark" && props.mode === "outlined" ? props.theme.white : props.theme.black;
|
|
184
|
-
}, function (props) {
|
|
185
|
-
return props.label !== "" && props.size !== "small" ? props.mode === "outlined" ? "8px 30px " : "12px 30px" : props.mode === "outlined" ? "8px 10px " : "12px 10px";
|
|
186
|
-
}, function (props) {
|
|
187
|
-
return props.mode === "basic" ? props.selected === false ? props.theme.yellow : props.theme.darkWhite : props.selected === false ? props.theme.lightGrey : props.theme.white;
|
|
188
|
-
});
|
|
189
|
-
|
|
190
|
-
var ContentContainer = _styledComponents["default"].span(_templateObject2(), function (props) {
|
|
191
|
-
return props.iconPosition === "after" ? "row-reverse" : "row";
|
|
192
|
-
});
|
|
193
|
-
|
|
194
|
-
var IconContainer = _styledComponents["default"].img(_templateObject3(), function (props) {
|
|
195
|
-
return props.label !== "" && props.iconPosition === "before" ? "10px" : "";
|
|
196
|
-
}, function (props) {
|
|
197
|
-
return props.label !== "" && props.iconPosition === "after" ? "10px" : "";
|
|
198
|
-
});
|
|
199
|
-
|
|
200
|
-
var LabelContainer = _styledComponents["default"].span(_templateObject4());
|
|
201
|
-
|
|
202
|
-
DxcToggle.propTypes = {
|
|
203
|
-
size: _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(sizes))),
|
|
204
|
-
theme: _propTypes["default"].oneOf(["light", "dark", ""]),
|
|
205
|
-
mode: _propTypes["default"].oneOf(["basic", "outlined", ""]),
|
|
206
|
-
iconPosition: _propTypes["default"].oneOf(["before", "after", ""]),
|
|
207
|
-
iconSrc: _propTypes["default"].string,
|
|
208
|
-
selected: _propTypes["default"].bool,
|
|
209
|
-
disabled: _propTypes["default"].bool,
|
|
210
|
-
disableRipple: _propTypes["default"].bool,
|
|
211
|
-
onClick: _propTypes["default"].func,
|
|
212
|
-
margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
|
213
|
-
top: _propTypes["default"].oneOf(Object.keys(spaces)),
|
|
214
|
-
bottom: _propTypes["default"].oneOf(Object.keys(spaces)),
|
|
215
|
-
left: _propTypes["default"].oneOf(Object.keys(spaces)),
|
|
216
|
-
right: _propTypes["default"].oneOf(Object.keys(spaces))
|
|
217
|
-
}), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(spaces)))])
|
|
218
|
-
};
|
|
219
|
-
var _default = DxcToggle;
|
|
220
|
-
exports["default"] = _default;
|