@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
package/dist/switch/readme.md
DELETED
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
# DXC Checkbox Component
|
|
2
|
-
|
|
3
|
-
## Usage
|
|
4
|
-
|
|
5
|
-
```js
|
|
6
|
-
import { DxcSwitch } from "@dxc-technology/halstack-react";
|
|
7
|
-
|
|
8
|
-
<DxcSwitch onChange={handleNewValue} label="Test Switch" checked={checked} />;
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Props
|
|
12
|
-
|
|
13
|
-
The API properties are the following:
|
|
14
|
-
|
|
15
|
-
<table>
|
|
16
|
-
<tr style="background-color: grey">
|
|
17
|
-
<td>Name</td>
|
|
18
|
-
<td>Type</td>
|
|
19
|
-
<td>Default</td>
|
|
20
|
-
<td>Required</td>
|
|
21
|
-
<td>Description</td>
|
|
22
|
-
</tr>
|
|
23
|
-
<tr>
|
|
24
|
-
<td>checked</td>
|
|
25
|
-
<td><code> boolean </code></td>
|
|
26
|
-
<td>false</td>
|
|
27
|
-
<td>No</td>
|
|
28
|
-
<td>If true, the component is checked.</td>
|
|
29
|
-
</tr>
|
|
30
|
-
<tr>
|
|
31
|
-
<td>value</td>
|
|
32
|
-
<td><code> any </code></td>
|
|
33
|
-
<td></td>
|
|
34
|
-
<td>No</td>
|
|
35
|
-
<td>Will be passed to the value attribute of the html input element. When inside a form, this value will be only submitted if the switch is checked </td>
|
|
36
|
-
</tr>
|
|
37
|
-
<tr>
|
|
38
|
-
<td>label</td>
|
|
39
|
-
<td><code>string</code></td>
|
|
40
|
-
<td></td>
|
|
41
|
-
<td>No</td>
|
|
42
|
-
<td>Text to be placed next to the switch.</td>
|
|
43
|
-
</tr>
|
|
44
|
-
<tr>
|
|
45
|
-
<td>labelPosition</td>
|
|
46
|
-
<td><code>string: 'before' | 'after'</code></td>
|
|
47
|
-
<td><code>'before'</code></td>
|
|
48
|
-
<td>No</td>
|
|
49
|
-
<td>Whether the label should appear after or before the switch.</td>
|
|
50
|
-
</tr>
|
|
51
|
-
<tr>
|
|
52
|
-
<td>theme</td>
|
|
53
|
-
<td><code> string: 'light' |
|
|
54
|
-
'dark'</code></td>
|
|
55
|
-
<td><code>'light'</code></td>
|
|
56
|
-
<td>No</td>
|
|
57
|
-
<td>Uses one of the available component themes.</td>
|
|
58
|
-
</tr>
|
|
59
|
-
<tr>
|
|
60
|
-
<td>name</td>
|
|
61
|
-
<td><code>string</code></td>
|
|
62
|
-
<td><code>false</code></td>
|
|
63
|
-
<td></td>
|
|
64
|
-
<td>Name attribute of the input element.</td>
|
|
65
|
-
</tr>
|
|
66
|
-
<tr>
|
|
67
|
-
<td>disabled</td>
|
|
68
|
-
<td><code>boolean</code></td>
|
|
69
|
-
<td><code>false</code></td>
|
|
70
|
-
<td>No</td>
|
|
71
|
-
<td>If true, the component will be disabled.</td>
|
|
72
|
-
</tr>
|
|
73
|
-
<tr>
|
|
74
|
-
<td>disableRipple</td>
|
|
75
|
-
<td><code>boolean</code></td>
|
|
76
|
-
<td><code>false</code></td>
|
|
77
|
-
<td>No</td>
|
|
78
|
-
<td>If true, the ripple effect will be disabled.</td>
|
|
79
|
-
</tr>
|
|
80
|
-
<tr>
|
|
81
|
-
<td>onChange</td>
|
|
82
|
-
<td><code>function</code></td>
|
|
83
|
-
<td></td>
|
|
84
|
-
<td>No</td>
|
|
85
|
-
<td>This function will be called when the user clicks the radio. The new value will be passed as a parameter.<br>
|
|
86
|
-
</tr>
|
|
87
|
-
</table>
|
|
88
|
-
|
|
89
|
-
## Examples
|
|
90
|
-
|
|
91
|
-
- Basic switch - Light theme - Enabled - Label after switch - With ripple
|
|
92
|
-
|
|
93
|
-
```js
|
|
94
|
-
import React from "react";
|
|
95
|
-
import { DxcSwitch } from "@dxc-technology/halstack-react";
|
|
96
|
-
|
|
97
|
-
class App extends React.Component {
|
|
98
|
-
state = {
|
|
99
|
-
isChecked: true
|
|
100
|
-
};
|
|
101
|
-
constructor() {
|
|
102
|
-
super();
|
|
103
|
-
this.handleChange = this.handleChange.bind(this);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
handleChange(checked) {
|
|
107
|
-
this.setState({
|
|
108
|
-
isChecked: checked
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
render() {
|
|
113
|
-
return (
|
|
114
|
-
<div>
|
|
115
|
-
<DxcSwitch
|
|
116
|
-
checked={this.state.isChecked}
|
|
117
|
-
value="Switch1"
|
|
118
|
-
label="Switch 1"
|
|
119
|
-
labelPosition="after"
|
|
120
|
-
theme="light"
|
|
121
|
-
name="Checkbox"
|
|
122
|
-
disabled={false}
|
|
123
|
-
disableRipple={false}
|
|
124
|
-
onChange={event => this.handleChange(event)}
|
|
125
|
-
/>
|
|
126
|
-
</div>
|
|
127
|
-
);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
export default App;
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
```
|
package/dist/tabs/Tabs.js
DELETED
|
@@ -1,343 +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 _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
15
|
-
|
|
16
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
17
|
-
|
|
18
|
-
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
19
|
-
|
|
20
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
21
|
-
|
|
22
|
-
var _react = _interopRequireDefault(require("react"));
|
|
23
|
-
|
|
24
|
-
var _Tabs = _interopRequireDefault(require("@material-ui/core/Tabs"));
|
|
25
|
-
|
|
26
|
-
var _Tab = _interopRequireDefault(require("@material-ui/core/Tab"));
|
|
27
|
-
|
|
28
|
-
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
29
|
-
|
|
30
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
31
|
-
|
|
32
|
-
var _variables = require("../common/variables.js");
|
|
33
|
-
|
|
34
|
-
var _Badge = _interopRequireDefault(require("../badge/Badge"));
|
|
35
|
-
|
|
36
|
-
var _useTheme = _interopRequireDefault(require("../useTheme.js"));
|
|
37
|
-
|
|
38
|
-
function _templateObject9() {
|
|
39
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n max-height: 22px;\n max-width: 22px;\n margin-bottom: ", ";\n margin-right: ", ";\n overflow: hidden;\n display: flex;\n align-items: center;\n img,\n svg {\n height: 100%;\n width: 100%;\n }\n"]);
|
|
40
|
-
|
|
41
|
-
_templateObject9 = function _templateObject9() {
|
|
42
|
-
return data;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
return data;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function _templateObject8() {
|
|
49
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n max-height: 22px;\n max-width: 22px;\n"]);
|
|
50
|
-
|
|
51
|
-
_templateObject8 = function _templateObject8() {
|
|
52
|
-
return data;
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
return data;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function _templateObject7() {
|
|
59
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n position: relative;\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n\n .MuiTabs-root {\n background: white;\n min-height: ", ";\n\n .MuiTabs-scroller {\n .MuiTabs-flexContainer + span {\n z-index: 4;\n }\n }\n .MuiTab-root {\n text-transform: ", " !important;\n }\n .MuiButtonBase-root {\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n\n padding: ", ";\n height: ", ";\n min-width: 90px;\n max-width: 360px;\n min-height: ", ";\n\n &:hover {\n background-color: ", ";\n }\n &:active {\n background-color: ", ";\n font-weight: ", ";\n }\n &:not(.Mui-selected) {\n background-color: ", ";\n color: ", ";\n svg {\n color: ", ";\n }\n }\n &.Mui-selected {\n background-color: ", ";\n color: ", ";\n svg {\n color: ", ";\n }\n }\n &.Mui-disabled {\n cursor: not-allowed !important;\n pointer-events: all;\n color: ", ";\n font-style: ", ";\n svg {\n color: ", ";\n }\n }\n &:focus {\n outline: ", " auto 1px;\n }\n }\n .MuiTabs-indicator {\n background-color: ", ";\n height: ", ";\n }\n .MuiTabs-scrollButtons {\n min-width: ", ";\n width: ", ";\n padding: 0;\n }\n @media (max-width: 599.95px) {\n .MuiTabs-scrollButtonsDesktop {\n display: flex;\n }\n }\n }\n"]);
|
|
60
|
-
|
|
61
|
-
_templateObject7 = function _templateObject7() {
|
|
62
|
-
return data;
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
return data;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function _templateObject6() {
|
|
69
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n left: 0px;\n bottom: 0;\n width: 100%;\n height: ", ";\n position: absolute;\n background-color: ", ";\n"]);
|
|
70
|
-
|
|
71
|
-
_templateObject6 = function _templateObject6() {
|
|
72
|
-
return data;
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
return data;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
function _templateObject5() {
|
|
79
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row;\n margin-left: ", ";\n margin-right: ", ";\n"]);
|
|
80
|
-
|
|
81
|
-
_templateObject5 = function _templateObject5() {
|
|
82
|
-
return data;
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
return data;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
function _templateObject4() {
|
|
89
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n position: absolute;\n right: 0;\n top: ", ";\n width: 23px;\n height: 17px;\n"]);
|
|
90
|
-
|
|
91
|
-
_templateObject4 = function _templateObject4() {
|
|
92
|
-
return data;
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
return data;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
function _templateObject3() {
|
|
99
|
-
var data = (0, _taggedTemplateLiteral2["default"])([""]);
|
|
100
|
-
|
|
101
|
-
_templateObject3 = function _templateObject3() {
|
|
102
|
-
return data;
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
return data;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
function _templateObject2() {
|
|
109
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: ", ";\n align-items: center;\n"]);
|
|
110
|
-
|
|
111
|
-
_templateObject2 = function _templateObject2() {
|
|
112
|
-
return data;
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
return data;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
function _templateObject() {
|
|
119
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n position: relative;\n"]);
|
|
120
|
-
|
|
121
|
-
_templateObject = function _templateObject() {
|
|
122
|
-
return data;
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
return data;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
var DxcTabs = function DxcTabs(_ref) {
|
|
129
|
-
var activeTabIndex = _ref.activeTabIndex,
|
|
130
|
-
_ref$tabs = _ref.tabs,
|
|
131
|
-
tabs = _ref$tabs === void 0 ? [] : _ref$tabs,
|
|
132
|
-
onTabClick = _ref.onTabClick,
|
|
133
|
-
onTabHover = _ref.onTabHover,
|
|
134
|
-
margin = _ref.margin,
|
|
135
|
-
_ref$iconPosition = _ref.iconPosition,
|
|
136
|
-
iconPosition = _ref$iconPosition === void 0 ? "left" : _ref$iconPosition,
|
|
137
|
-
_ref$tabIndex = _ref.tabIndex,
|
|
138
|
-
tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
|
|
139
|
-
|
|
140
|
-
var _React$useState = _react["default"].useState(0),
|
|
141
|
-
_React$useState2 = (0, _slicedToArray2["default"])(_React$useState, 2),
|
|
142
|
-
innerActiveTabIndex = _React$useState2[0],
|
|
143
|
-
setInnerActiveTabIndex = _React$useState2[1];
|
|
144
|
-
|
|
145
|
-
var colorsTheme = (0, _useTheme["default"])();
|
|
146
|
-
var hasLabelAndIcon = tabs && tabs.filter(function (tab) {
|
|
147
|
-
return tab.label && tab.icon;
|
|
148
|
-
}).length > 0;
|
|
149
|
-
|
|
150
|
-
var handleChange = function handleChange(event, newValue) {
|
|
151
|
-
if (activeTabIndex == null) {
|
|
152
|
-
setInnerActiveTabIndex(newValue);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
if (typeof onTabClick === "function") {
|
|
156
|
-
onTabClick(newValue);
|
|
157
|
-
}
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
var getTabIndex = function getTabIndex(index, disabled) {
|
|
161
|
-
return (activeTabIndex === index || innerActiveTabIndex === index) && !disabled ? tabIndex : -1;
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
var getLabelForTab = function getLabelForTab(tab) {
|
|
165
|
-
return _react["default"].createElement(ParentLabelSpan, null, _react["default"].createElement(MainLabelContainer, {
|
|
166
|
-
hasBadge: tab.notificationNumber
|
|
167
|
-
}, _react["default"].createElement(TabLabelContainer, {
|
|
168
|
-
hasLabelAndIcon: hasLabelAndIcon,
|
|
169
|
-
iconPosition: iconPosition
|
|
170
|
-
}, tab.icon ? _react["default"].createElement(TabIconContainer, {
|
|
171
|
-
hasLabelAndIcon: hasLabelAndIcon,
|
|
172
|
-
iconPosition: iconPosition
|
|
173
|
-
}, (0, _typeof2["default"])(tab.icon) === "object" ? tab.icon : _react["default"].createElement(tab.icon)) : tab.iconSrc && _react["default"].createElement(TabIcon, {
|
|
174
|
-
src: tab.iconSrc
|
|
175
|
-
}), _react["default"].createElement(LabelTextContainer, null, tab.label))), tab.notificationNumber && tab.notificationNumber !== false && _react["default"].createElement(BadgeContainer, {
|
|
176
|
-
hasLabelAndIcon: hasLabelAndIcon,
|
|
177
|
-
iconPosition: iconPosition
|
|
178
|
-
}, _react["default"].createElement(_Badge["default"], {
|
|
179
|
-
notificationText: tab.notificationNumber > 99 ? "+99" : tab.notificationNumber
|
|
180
|
-
})));
|
|
181
|
-
};
|
|
182
|
-
|
|
183
|
-
return _react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
184
|
-
theme: colorsTheme.tabs
|
|
185
|
-
}, _react["default"].createElement(DxCTabs, {
|
|
186
|
-
margin: margin,
|
|
187
|
-
hasLabelAndIcon: hasLabelAndIcon,
|
|
188
|
-
iconPosition: iconPosition
|
|
189
|
-
}, _react["default"].createElement(Underline, null), _react["default"].createElement(_Tabs["default"], {
|
|
190
|
-
value: activeTabIndex != null ? activeTabIndex : innerActiveTabIndex,
|
|
191
|
-
onChange: handleChange,
|
|
192
|
-
variant: "scrollable",
|
|
193
|
-
scrollButtons: "auto"
|
|
194
|
-
}, tabs.map(function (tab, i) {
|
|
195
|
-
var tabContent = _react["default"].forwardRef(function (props, ref) {
|
|
196
|
-
return _react["default"].createElement("div", (0, _extends2["default"])({
|
|
197
|
-
role: "button"
|
|
198
|
-
}, props, {
|
|
199
|
-
ref: ref
|
|
200
|
-
}));
|
|
201
|
-
});
|
|
202
|
-
|
|
203
|
-
return _react["default"].createElement(_Tab["default"], {
|
|
204
|
-
tabIndex: (activeTabIndex === i || innerActiveTabIndex === i) && !tab.isDisabled ? tabIndex : -1,
|
|
205
|
-
key: "tab".concat(i).concat(tab.label),
|
|
206
|
-
label: getLabelForTab(tab),
|
|
207
|
-
disabled: tab.isDisabled,
|
|
208
|
-
disableRipple: true,
|
|
209
|
-
onMouseEnter: function onMouseEnter() {
|
|
210
|
-
onTabHover(i);
|
|
211
|
-
},
|
|
212
|
-
onMouseLeave: function onMouseLeave() {
|
|
213
|
-
onTabHover(null);
|
|
214
|
-
}
|
|
215
|
-
});
|
|
216
|
-
}))));
|
|
217
|
-
};
|
|
218
|
-
|
|
219
|
-
var ParentLabelSpan = _styledComponents["default"].div(_templateObject());
|
|
220
|
-
|
|
221
|
-
var TabLabelContainer = _styledComponents["default"].div(_templateObject2(), function (props) {
|
|
222
|
-
return props.hasLabelAndIcon && props.iconPosition === "top" && "column" || "row";
|
|
223
|
-
});
|
|
224
|
-
|
|
225
|
-
var LabelTextContainer = _styledComponents["default"].div(_templateObject3());
|
|
226
|
-
|
|
227
|
-
var BadgeContainer = _styledComponents["default"].div(_templateObject4(), function (props) {
|
|
228
|
-
return props.hasLabelAndIcon && props.iconPosition === "top" && "0" || "5px";
|
|
229
|
-
});
|
|
230
|
-
|
|
231
|
-
var MainLabelContainer = _styledComponents["default"].div(_templateObject5(), function (props) {
|
|
232
|
-
return props.hasBadge && "35px" || "unset";
|
|
233
|
-
}, function (props) {
|
|
234
|
-
return props.hasBadge && "35px" || "unset";
|
|
235
|
-
});
|
|
236
|
-
|
|
237
|
-
var Underline = _styledComponents["default"].div(_templateObject6(), function (props) {
|
|
238
|
-
return props.theme.dividerThickness;
|
|
239
|
-
}, function (props) {
|
|
240
|
-
return props.theme.dividerColor;
|
|
241
|
-
});
|
|
242
|
-
|
|
243
|
-
var DxCTabs = _styledComponents["default"].div(_templateObject7(), function (props) {
|
|
244
|
-
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
245
|
-
}, function (props) {
|
|
246
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
|
|
247
|
-
}, function (props) {
|
|
248
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.right ? _variables.spaces[props.margin.right] : "";
|
|
249
|
-
}, function (props) {
|
|
250
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.bottom ? _variables.spaces[props.margin.bottom] : "";
|
|
251
|
-
}, function (props) {
|
|
252
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
253
|
-
}, function (props) {
|
|
254
|
-
return (!props.hasLabelAndIcon || props.hasLabelAndIcon && props.iconPosition !== "top") && "48px" || "72px";
|
|
255
|
-
}, function (props) {
|
|
256
|
-
return props.theme.fontTextTransform;
|
|
257
|
-
}, function (props) {
|
|
258
|
-
return props.theme.fontFamily;
|
|
259
|
-
}, function (props) {
|
|
260
|
-
return props.theme.fontSize;
|
|
261
|
-
}, function (props) {
|
|
262
|
-
return props.theme.fontStyle;
|
|
263
|
-
}, function (props) {
|
|
264
|
-
return props.theme.fontWeight;
|
|
265
|
-
}, function (props) {
|
|
266
|
-
return (!props.hasLabelAndIcon || props.hasLabelAndIcon && props.iconPosition !== "top") && "12px 16px" || "8px 16px";
|
|
267
|
-
}, function (props) {
|
|
268
|
-
return (!props.hasLabelAndIcon || props.hasLabelAndIcon && props.iconPosition !== "top") && "48px" || "72px";
|
|
269
|
-
}, function (props) {
|
|
270
|
-
return (!props.hasLabelAndIcon || props.hasLabelAndIcon && props.iconPosition !== "top") && "48px" || "72px";
|
|
271
|
-
}, function (props) {
|
|
272
|
-
return "".concat(props.theme.hoverBackgroundColor, " !important");
|
|
273
|
-
}, function (props) {
|
|
274
|
-
return "".concat(props.theme.pressedBackgroundColor, " !important");
|
|
275
|
-
}, function (props) {
|
|
276
|
-
return "".concat(props.theme.pressedFontWeight, " !important");
|
|
277
|
-
}, function (props) {
|
|
278
|
-
return props.theme.unselectedBackgroundColor;
|
|
279
|
-
}, function (props) {
|
|
280
|
-
return props.theme.unselectedFontColor;
|
|
281
|
-
}, function (props) {
|
|
282
|
-
return props.theme.unselectedIconColor;
|
|
283
|
-
}, function (props) {
|
|
284
|
-
return props.theme.selectedBackgroundColor;
|
|
285
|
-
}, function (props) {
|
|
286
|
-
return props.theme.selectedFontColor;
|
|
287
|
-
}, function (props) {
|
|
288
|
-
return props.theme.selectedIconColor;
|
|
289
|
-
}, function (props) {
|
|
290
|
-
return props.theme.disabledFontColor;
|
|
291
|
-
}, function (props) {
|
|
292
|
-
return props.theme.disabledFontStyle;
|
|
293
|
-
}, function (props) {
|
|
294
|
-
return props.theme.disabledIconColor;
|
|
295
|
-
}, function (props) {
|
|
296
|
-
return props.theme.focusOutline;
|
|
297
|
-
}, function (props) {
|
|
298
|
-
return props.theme.selectedUnderlineColor;
|
|
299
|
-
}, function (props) {
|
|
300
|
-
return props.theme.selectedUnderlineThickness;
|
|
301
|
-
}, function (props) {
|
|
302
|
-
return props.theme.scrollButtonsWidth;
|
|
303
|
-
}, function (props) {
|
|
304
|
-
return props.theme.scrollButtonsWidth;
|
|
305
|
-
});
|
|
306
|
-
|
|
307
|
-
var TabIcon = _styledComponents["default"].img(_templateObject8());
|
|
308
|
-
|
|
309
|
-
var TabIconContainer = _styledComponents["default"].div(_templateObject9(), function (props) {
|
|
310
|
-
return props.hasLabelAndIcon && props.iconPosition === "top" && "8px" || "";
|
|
311
|
-
}, function (props) {
|
|
312
|
-
return props.hasLabelAndIcon && props.iconPosition === "left" && "12px" || "";
|
|
313
|
-
});
|
|
314
|
-
|
|
315
|
-
DxcTabs.propTypes = {
|
|
316
|
-
activeTabIndex: _propTypes["default"].number,
|
|
317
|
-
onTabClick: _propTypes["default"].func,
|
|
318
|
-
onTabHover: _propTypes["default"].func,
|
|
319
|
-
tabs: _propTypes["default"].arrayOf(_propTypes["default"].shape({
|
|
320
|
-
label: _propTypes["default"].string,
|
|
321
|
-
icon: _propTypes["default"].oneOfType([_propTypes["default"].element, _propTypes["default"].func]),
|
|
322
|
-
iconSrc: _propTypes["default"].string,
|
|
323
|
-
isDisabled: _propTypes["default"].bool,
|
|
324
|
-
notificationNumber: _propTypes["default"].oneOfType([_propTypes["default"].bool, _propTypes["default"].string, _propTypes["default"].number])
|
|
325
|
-
})),
|
|
326
|
-
margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
|
327
|
-
top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
328
|
-
bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
329
|
-
left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
330
|
-
right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
|
|
331
|
-
}), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
|
|
332
|
-
iconPosition: _propTypes["default"].oneOf(["top", "left"]),
|
|
333
|
-
tabIndex: _propTypes["default"].number
|
|
334
|
-
};
|
|
335
|
-
DxcTabs.defaultProps = {
|
|
336
|
-
activeTabIndex: null,
|
|
337
|
-
tabs: [],
|
|
338
|
-
onTabClick: function onTabClick() {},
|
|
339
|
-
onTabHover: function onTabHover() {},
|
|
340
|
-
iconPosition: "top"
|
|
341
|
-
};
|
|
342
|
-
var _default = DxcTabs;
|
|
343
|
-
exports["default"] = _default;
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
6
|
-
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
|
|
9
|
-
var _react2 = require("@storybook/react");
|
|
10
|
-
|
|
11
|
-
var _addonActions = require("@storybook/addon-actions");
|
|
12
|
-
|
|
13
|
-
var _addonKnobs = require("@storybook/addon-knobs");
|
|
14
|
-
|
|
15
|
-
var _readme = _interopRequireDefault(require("./readme.md"));
|
|
16
|
-
|
|
17
|
-
var _Tabs = _interopRequireDefault(require("./Tabs"));
|
|
18
|
-
|
|
19
|
-
var _Tab = _interopRequireDefault(require("./tab/Tab"));
|
|
20
|
-
|
|
21
|
-
var _amazon = _interopRequireDefault(require("../../.storybook/public/amazon.svg"));
|
|
22
|
-
|
|
23
|
-
var _ebay = _interopRequireDefault(require("../../.storybook/public/ebay.svg"));
|
|
24
|
-
|
|
25
|
-
var _apple = _interopRequireDefault(require("../../.storybook/public/apple.svg"));
|
|
26
|
-
|
|
27
|
-
var onChange = (0, _addonActions.action)("onChange");
|
|
28
|
-
|
|
29
|
-
onChange.toString = function () {
|
|
30
|
-
return "onChangeHandler";
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
(0, _react2.storiesOf)("Form Components|Tabs", module).add("Types", function () {
|
|
34
|
-
return _react["default"].createElement("div", null, _react["default"].createElement("h3", null, "Light"), _react["default"].createElement("div", null, _react["default"].createElement(_Tabs["default"], {
|
|
35
|
-
activeTabIndex: 0,
|
|
36
|
-
activeTabIndexChange: onChange,
|
|
37
|
-
mode: "underlined"
|
|
38
|
-
}, _react["default"].createElement(_Tab["default"], {
|
|
39
|
-
label: "Tab ONE",
|
|
40
|
-
iconSrc: "",
|
|
41
|
-
disabled: false
|
|
42
|
-
}, _react["default"].createElement("div", null, "Lorem ipsum dolor sit amet consectetur adipiscing elit aliquam class orci, est lectus eros praesent rhoncus dui etiam nascetur a mauris, luctus bibendum facilisis senectus sodales lobortis condimentum porta posuere. Massa varius ac imperdiet mauris quis rhoncus, nisl interdum gravida ullamcorper aliquam aptent pellentesque, consequat leo quam nec montes. Ridiculus mollis augue nam erat volutpat nibh congue, nostra habitasse dignissim pulvinar libero iaculis taciti et, bibendum morbi potenti lobortis purus laoreet.")), _react["default"].createElement(_Tab["default"], {
|
|
43
|
-
label: "Tab TWO",
|
|
44
|
-
iconSrc: "",
|
|
45
|
-
disabled: false
|
|
46
|
-
}, _react["default"].createElement("div", null, "Lorem ipsum dolor sit amet consectetur adipiscing elit aliquam class orci, est lectus eros praesent rhoncus dui etiam nascetur a mauris, luctus bibendum facilisis senectus sodales lobortis condimentum porta posuere. Massa varius ac imperdiet mauris quis rhoncus, nisl interdum gravida ullamcorper aliquam aptent pellentesque, consequat leo quam nec montes. Ridiculus mollis augue nam erat volutpat nibh congue, nostra habitasse dignissim pulvinar libero iaculis taciti et, bibendum morbi potenti lobortis purus laoreet.")), _react["default"].createElement(_Tab["default"], {
|
|
47
|
-
label: "Tab THREE",
|
|
48
|
-
iconSrc: "",
|
|
49
|
-
disabled: false
|
|
50
|
-
}, _react["default"].createElement("div", null, "Lorem ipsum dolor sit amet consectetur adipiscing elit aliquam class orci, est lectus eros praesent rhoncus dui etiam nascetur a mauris, luctus bibendum facilisis senectus sodales lobortis condimentum porta posuere. Massa varius ac imperdiet mauris quis rhoncus, nisl interdum gravida ullamcorper aliquam aptent pellentesque, consequat leo quam nec montes. Ridiculus mollis augue nam erat volutpat nibh congue, nostra habitasse dignissim pulvinar libero iaculis taciti et, bibendum morbi potenti lobortis purus laoreet.")))), _react["default"].createElement("div", null, _react["default"].createElement(_Tabs["default"], {
|
|
51
|
-
activeTabIndex: 0,
|
|
52
|
-
activeTabIndexChange: onChange,
|
|
53
|
-
mode: "filled"
|
|
54
|
-
}, _react["default"].createElement(_Tab["default"], {
|
|
55
|
-
label: "Label 1",
|
|
56
|
-
iconSrc: _amazon["default"],
|
|
57
|
-
disabled: false
|
|
58
|
-
}, _react["default"].createElement("div", null, "Lorem ipsum dolor sit amet consectetur adipiscing elit aliquam class orci, est lectus eros praesent rhoncus dui etiam nascetur a mauris, luctus bibendum facilisis senectus sodales lobortis condimentum porta posuere. Massa varius ac imperdiet mauris quis rhoncus, nisl interdum gravida ullamcorper aliquam aptent pellentesque, consequat leo quam nec montes. Ridiculus mollis augue nam erat volutpat nibh congue, nostra habitasse dignissim pulvinar libero iaculis taciti et, bibendum morbi potenti lobortis purus laoreet.")), _react["default"].createElement(_Tab["default"], {
|
|
59
|
-
label: "Label 2",
|
|
60
|
-
iconSrc: _ebay["default"],
|
|
61
|
-
disabled: false
|
|
62
|
-
}, _react["default"].createElement("div", null, "Lorem ipsum dolor sit amet consectetur adipiscing elit aliquam class orci, est lectus eros praesent rhoncus dui etiam nascetur a mauris, luctus bibendum facilisis senectus sodales lobortis condimentum porta posuere. Massa varius ac imperdiet mauris quis rhoncus, nisl interdum gravida ullamcorper aliquam aptent pellentesque, consequat leo quam nec montes. Ridiculus mollis augue nam erat volutpat nibh congue, nostra habitasse dignissim pulvinar libero iaculis taciti et, bibendum morbi potenti lobortis purus laoreet.")), _react["default"].createElement(_Tab["default"], {
|
|
63
|
-
label: "Label 3",
|
|
64
|
-
iconSrc: _apple["default"],
|
|
65
|
-
disabled: true
|
|
66
|
-
}, _react["default"].createElement("div", null, "Lorem ipsum dolor sit amet consectetur adipiscing elit aliquam class orci, est lectus eros praesent rhoncus dui etiam nascetur a mauris, luctus bibendum facilisis senectus sodales lobortis condimentum porta posuere. Massa varius ac imperdiet mauris quis rhoncus, nisl interdum gravida ullamcorper aliquam aptent pellentesque, consequat leo quam nec montes. Ridiculus mollis augue nam erat volutpat nibh congue, nostra habitasse dignissim pulvinar libero iaculis taciti et, bibendum morbi potenti lobortis purus laoreet.")))));
|
|
67
|
-
}, {
|
|
68
|
-
notes: {
|
|
69
|
-
markdown: _readme["default"]
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
var knobProps = function knobProps() {
|
|
74
|
-
return {
|
|
75
|
-
mode: (0, _addonKnobs.select)("mode", {
|
|
76
|
-
filled: "filled",
|
|
77
|
-
underlined: "underlined"
|
|
78
|
-
}, "filled"),
|
|
79
|
-
theme: (0, _addonKnobs.select)("theme", {
|
|
80
|
-
light: "light",
|
|
81
|
-
dark: "dark"
|
|
82
|
-
}, "light"),
|
|
83
|
-
activeTabIndex: (0, _addonKnobs.number)("Tab Active", 0)
|
|
84
|
-
};
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
var knobTab1Props = function knobTab1Props() {
|
|
88
|
-
return {
|
|
89
|
-
label: (0, _addonKnobs.text)("First Tab Label", "Tab 1"),
|
|
90
|
-
disabled: (0, _addonKnobs["boolean"])("First Tab Disabled", false)
|
|
91
|
-
};
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
var knobTab2Props = function knobTab2Props() {
|
|
95
|
-
return {
|
|
96
|
-
label: (0, _addonKnobs.text)("Second Tab Label", "Tab 2"),
|
|
97
|
-
disabled: (0, _addonKnobs["boolean"])("Second Tab Disabled", false)
|
|
98
|
-
};
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
var knobTab3Props = function knobTab3Props() {
|
|
102
|
-
return {
|
|
103
|
-
label: (0, _addonKnobs.text)("Third Tab Label", "Tab 3"),
|
|
104
|
-
disabled: (0, _addonKnobs["boolean"])("Third Tab Disabled", false)
|
|
105
|
-
};
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
(0, _react2.storiesOf)("Form Components|Tabs", module).add("Knobs example", function () {
|
|
109
|
-
var props = knobProps();
|
|
110
|
-
var tab1Props = knobTab1Props();
|
|
111
|
-
var tab2Props = knobTab2Props();
|
|
112
|
-
var tab3Props = knobTab3Props();
|
|
113
|
-
return _react["default"].createElement("div", {
|
|
114
|
-
style: {
|
|
115
|
-
background: props.theme === "dark" && "black" || "transparent"
|
|
116
|
-
}
|
|
117
|
-
}, _react["default"].createElement(_Tabs["default"], (0, _extends2["default"])({}, props, {
|
|
118
|
-
activeTabIndexChange: onChange
|
|
119
|
-
}), _react["default"].createElement(_Tab["default"], (0, _extends2["default"])({}, tab1Props, {
|
|
120
|
-
iconSrc: _amazon["default"]
|
|
121
|
-
}), "Content ONE"), _react["default"].createElement(_Tab["default"], (0, _extends2["default"])({}, tab2Props, {
|
|
122
|
-
iconSrc: _ebay["default"]
|
|
123
|
-
}), "Content TWO"), _react["default"].createElement(_Tab["default"], (0, _extends2["default"])({}, tab3Props, {
|
|
124
|
-
iconSrc: _apple["default"]
|
|
125
|
-
}), "Content THREE")));
|
|
126
|
-
}, {
|
|
127
|
-
notes: {
|
|
128
|
-
markdown: _readme["default"]
|
|
129
|
-
}
|
|
130
|
-
});
|
package/dist/tabs/readme.md
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
# DXC Tabs Component
|
|
2
|
-
|
|
3
|
-
## Tab Group Props
|
|
4
|
-
|
|
5
|
-
<table>
|
|
6
|
-
<tr style="background-color: grey">
|
|
7
|
-
<td>Name</td>
|
|
8
|
-
<td>Default</td>
|
|
9
|
-
<td>Description</td>
|
|
10
|
-
</tr>
|
|
11
|
-
<tr>
|
|
12
|
-
<td>mode: 'filled' | 'underlined'</td>
|
|
13
|
-
<td><code>'filled'</code></td>
|
|
14
|
-
<td>Uses one of the available component modes.</td>
|
|
15
|
-
</tr>
|
|
16
|
-
<tr>
|
|
17
|
-
<td>theme: 'light' | 'dark'</td>
|
|
18
|
-
<td><code>'light'</code></td>
|
|
19
|
-
<td>Uses one of the available component themes.</td>
|
|
20
|
-
</tr>
|
|
21
|
-
<tr>
|
|
22
|
-
<td>showDotIndicator: boolean</td>
|
|
23
|
-
<td><code>false</code></td>
|
|
24
|
-
<td>If true, a dot indicator will be shown in the active tab.</td>
|
|
25
|
-
</tr>
|
|
26
|
-
<tr>
|
|
27
|
-
<td>disableRipple: boolean</td>
|
|
28
|
-
<td><code>false</code></td>
|
|
29
|
-
<td>If true, the ripple effect will be disabled.</td>
|
|
30
|
-
</tr>
|
|
31
|
-
<tr>
|
|
32
|
-
<td>activeTabIndex: number</td>
|
|
33
|
-
<td><code>0</code></td>
|
|
34
|
-
<td>The index of the active tab.</td>
|
|
35
|
-
</tr>
|
|
36
|
-
<tr>
|
|
37
|
-
<td>activeTabIndexChange: function</td>
|
|
38
|
-
<td></td>
|
|
39
|
-
<td>This function will be called when the user clicks on a tab. The index of the clicked tab will be passed as a parameter.</td>
|
|
40
|
-
</tr>
|
|
41
|
-
<tr>
|
|
42
|
-
<td>stepper: boolean</td>
|
|
43
|
-
<td><code>false</code></td>
|
|
44
|
-
<td>If true, the component should be rendered as a Stepper component.</td>
|
|
45
|
-
</tr>
|
|
46
|
-
<tr>
|
|
47
|
-
<td>orientation: 'horizontal' | 'vertical'</td>
|
|
48
|
-
<td><code>'horizontal'</code></td>
|
|
49
|
-
<td>Only if stepper, this parameter shows the stepper orientation.</td>
|
|
50
|
-
</tr>
|
|
51
|
-
|
|
52
|
-
</table>
|
|
53
|
-
|
|
54
|
-
## Tab Props
|
|
55
|
-
|
|
56
|
-
<table>
|
|
57
|
-
<tr style="background-color: grey">
|
|
58
|
-
<td>Name</td>
|
|
59
|
-
<td>Default</td>
|
|
60
|
-
<td>Description</td>
|
|
61
|
-
</tr>
|
|
62
|
-
<tr>
|
|
63
|
-
<td>label: string</td>
|
|
64
|
-
<td></td>
|
|
65
|
-
<td>Text to be placed within the tab.</td>
|
|
66
|
-
</tr>
|
|
67
|
-
<tr>
|
|
68
|
-
<td>iconSrc: string</td>
|
|
69
|
-
<td></td>
|
|
70
|
-
<td>The path of an icon to be placed within the tab.</td>
|
|
71
|
-
</tr>
|
|
72
|
-
<tr>
|
|
73
|
-
<td>disabled: boolean</td>
|
|
74
|
-
<td><code>false</code></td>
|
|
75
|
-
<td>Whether the tab is disabled.</td>
|
|
76
|
-
</tr>
|
|
77
|
-
</table>
|
|
78
|
-
|