@dxc-technology/halstack-react 3.2.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BackgroundColorContext.js +46 -0
- package/ThemeContext.js +250 -0
- package/V3Select/V3Select.js +549 -0
- package/V3Select/index.d.ts +27 -0
- package/V3Textarea/V3Textarea.js +264 -0
- package/V3Textarea/index.d.ts +27 -0
- package/{dist/accordion → accordion}/Accordion.js +119 -50
- package/accordion/index.d.ts +28 -0
- package/{dist/accordion-group → accordion-group}/AccordionGroup.js +33 -1
- package/accordion-group/index.d.ts +16 -0
- package/alert/Alert.js +403 -0
- package/alert/index.d.ts +51 -0
- package/badge/Badge.js +63 -0
- package/{dist/box → box}/Box.js +27 -18
- package/box/index.d.ts +25 -0
- package/button/Button.js +238 -0
- package/button/Button.stories.js +27 -0
- package/button/index.d.ts +24 -0
- package/{dist/card → card}/Card.js +16 -9
- package/card/index.d.ts +22 -0
- package/{dist/checkbox → checkbox}/Checkbox.js +89 -23
- package/checkbox/index.d.ts +24 -0
- package/{dist/chip → chip}/Chip.js +63 -21
- package/chip/index.d.ts +22 -0
- package/{dist/common → common}/OpenSans.css +0 -0
- package/{dist/common → common}/RequiredComponent.js +0 -0
- 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/common/utils.js +22 -0
- package/common/variables.js +1567 -0
- package/{dist/date → date}/Date.js +60 -38
- package/date/index.d.ts +27 -0
- package/date-input/DateInput.js +400 -0
- package/date-input/index.d.ts +95 -0
- package/{dist/dialog → dialog}/Dialog.js +44 -29
- package/dialog/index.d.ts +18 -0
- package/{dist/dropdown → dropdown}/Dropdown.js +162 -74
- package/dropdown/index.d.ts +26 -0
- package/file-input/FileInput.js +644 -0
- package/file-input/FileItem.js +287 -0
- package/file-input/index.d.ts +81 -0
- package/{dist/footer → footer}/Footer.js +79 -37
- package/footer/Icons.js +77 -0
- package/footer/index.d.ts +25 -0
- package/{dist/header → header}/Header.js +157 -72
- package/header/Icons.js +59 -0
- package/header/index.d.ts +25 -0
- package/heading/Heading.js +230 -0
- package/heading/index.d.ts +17 -0
- package/input-text/Icons.js +22 -0
- package/{dist/input-text → input-text}/InputText.js +162 -66
- package/input-text/index.d.ts +36 -0
- package/{dist/layout → layout}/ApplicationLayout.js +7 -11
- package/layout/Icons.js +55 -0
- package/{dist/link → link}/Link.js +76 -39
- package/link/index.d.ts +23 -0
- package/main.d.ts +40 -0
- package/{dist/main.js → main.js} +71 -15
- package/number-input/NumberInput.js +136 -0
- package/number-input/NumberInputContext.js +16 -0
- package/number-input/index.d.ts +113 -0
- package/package.json +25 -19
- package/paginator/Icons.js +66 -0
- package/{dist/paginator → paginator}/Paginator.js +86 -42
- package/paginator/index.d.ts +20 -0
- package/password-input/PasswordInput.js +203 -0
- package/password-input/index.d.ts +94 -0
- package/{dist/progress-bar → progress-bar}/ProgressBar.js +88 -38
- package/progress-bar/index.d.ts +18 -0
- package/{dist/radio → radio}/Radio.js +28 -9
- package/radio/index.d.ts +23 -0
- package/{dist/resultsetTable → resultsetTable}/ResultsetTable.js +65 -40
- package/resultsetTable/index.d.ts +19 -0
- package/select/Select.js +1138 -0
- package/select/index.d.ts +131 -0
- package/{dist/sidenav → sidenav}/Sidenav.js +47 -23
- package/sidenav/index.d.ts +13 -0
- package/slider/Slider.js +404 -0
- package/slider/index.d.ts +29 -0
- package/spinner/Spinner.js +381 -0
- package/spinner/index.d.ts +17 -0
- package/{dist/switch → switch}/Switch.js +42 -14
- package/switch/index.d.ts +24 -0
- package/{dist/table → table}/Table.js +45 -11
- package/table/index.d.ts +13 -0
- package/{dist/tabs → tabs}/Tabs.js +37 -19
- package/tabs/index.d.ts +19 -0
- package/{dist/tag → tag}/Tag.js +50 -36
- package/tag/index.d.ts +24 -0
- package/text-input/TextInput.js +992 -0
- package/text-input/index.d.ts +135 -0
- package/textarea/Textarea.js +369 -0
- package/textarea/index.d.ts +117 -0
- package/{dist/toggle → toggle}/Toggle.js +0 -0
- package/toggle/index.d.ts +21 -0
- package/toggle-group/ToggleGroup.js +327 -0
- package/toggle-group/index.d.ts +21 -0
- package/{dist/upload → upload}/Upload.js +1 -5
- package/{dist/upload → upload}/buttons-upload/ButtonsUpload.js +28 -16
- package/upload/buttons-upload/Icons.js +40 -0
- package/{dist/upload → upload}/dragAndDropArea/DragAndDropArea.js +61 -25
- package/upload/dragAndDropArea/Icons.js +39 -0
- package/{dist/upload → upload}/file-upload/FileToUpload.js +52 -25
- package/upload/file-upload/Icons.js +66 -0
- package/{dist/upload → upload}/files-upload/FilesToUpload.js +3 -3
- package/upload/index.d.ts +15 -0
- package/upload/transaction/Icons.js +160 -0
- package/{dist/upload → upload}/transaction/Transaction.js +37 -41
- package/{dist/upload → upload}/transactions/Transactions.js +24 -8
- package/{dist/useTheme.js → useTheme.js} +0 -0
- package/wizard/Icons.js +65 -0
- package/{dist/wizard → wizard}/Wizard.js +106 -56
- package/wizard/index.d.ts +18 -0
- package/README.md +0 -66
- package/babel.config.js +0 -8
- package/dist/ThemeContext.js +0 -201
- package/dist/accordion/Accordion.stories.js +0 -207
- package/dist/accordion/readme.md +0 -96
- package/dist/accordion-group/AccordionGroup.stories.js +0 -207
- package/dist/accordion-group/readme.md +0 -70
- package/dist/alert/Alert.js +0 -318
- package/dist/alert/Alert.stories.js +0 -158
- package/dist/alert/close.svg +0 -4
- package/dist/alert/error.svg +0 -4
- package/dist/alert/info.svg +0 -4
- package/dist/alert/readme.md +0 -43
- package/dist/alert/success.svg +0 -4
- package/dist/alert/warning.svg +0 -4
- package/dist/badge/Badge.js +0 -40
- package/dist/button/Button.js +0 -219
- package/dist/button/Button.stories.js +0 -224
- package/dist/button/readme.md +0 -93
- package/dist/checkbox/Checkbox.stories.js +0 -144
- package/dist/checkbox/readme.md +0 -116
- package/dist/common/utils.js +0 -42
- package/dist/common/variables.js +0 -523
- package/dist/date/Date.stories.js +0 -205
- package/dist/date/calendar.svg +0 -1
- package/dist/date/calendar_dark.svg +0 -1
- package/dist/date/readme.md +0 -73
- package/dist/dialog/Dialog.stories.js +0 -217
- package/dist/dialog/readme.md +0 -32
- package/dist/dropdown/Dropdown.stories.js +0 -249
- package/dist/dropdown/baseline-arrow_drop_down.svg +0 -1
- package/dist/dropdown/baseline-arrow_drop_down_wh.svg +0 -4
- package/dist/dropdown/baseline-arrow_drop_up.svg +0 -1
- package/dist/dropdown/baseline-arrow_drop_up_wh.svg +0 -4
- package/dist/dropdown/readme.md +0 -69
- package/dist/footer/Footer.stories.js +0 -94
- package/dist/footer/dxc_logo_wht.png +0 -0
- package/dist/footer/readme.md +0 -41
- package/dist/header/Header.stories.js +0 -176
- package/dist/header/close_icon.svg +0 -1
- package/dist/header/dxc_logo_black.png +0 -0
- package/dist/header/dxc_logo_blk_rgb.svg +0 -6
- package/dist/header/dxc_logo_white.png +0 -0
- package/dist/header/hamb_menu_black.svg +0 -1
- package/dist/header/hamb_menu_white.svg +0 -1
- package/dist/header/readme.md +0 -33
- package/dist/heading/Heading.js +0 -163
- package/dist/input-text/InputText.stories.js +0 -209
- package/dist/input-text/error.svg +0 -1
- package/dist/input-text/readme.md +0 -91
- package/dist/layout/facebook.svg +0 -45
- package/dist/layout/linkedin.svg +0 -50
- package/dist/layout/twitter.svg +0 -53
- package/dist/link/readme.md +0 -51
- package/dist/paginator/images/next.svg +0 -3
- package/dist/paginator/images/nextPage.svg +0 -3
- package/dist/paginator/images/previous.svg +0 -3
- package/dist/paginator/images/previousPage.svg +0 -3
- package/dist/paginator/readme.md +0 -50
- package/dist/progress-bar/ProgressBar.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 -490
- package/dist/select/Select.stories.js +0 -235
- package/dist/select/readme.md +0 -72
- package/dist/slider/Slider.js +0 -267
- package/dist/slider/Slider.stories.js +0 -241
- package/dist/slider/readme.md +0 -64
- package/dist/spinner/Spinner.js +0 -198
- 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.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/textarea/Textarea.js +0 -238
- 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/toggle-group/readme.md +0 -82
- package/dist/upload/Upload.stories.js +0 -72
- 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/upload_drop.svg +0 -4
- package/dist/upload/dragAndDropArea/upload_file.svg +0 -4
- package/dist/upload/file-upload/audio-icon.svg +0 -4
- package/dist/upload/file-upload/close.svg +0 -4
- package/dist/upload/file-upload/file-icon.svg +0 -4
- package/dist/upload/file-upload/video-icon.svg +0 -4
- package/dist/upload/readme.md +0 -37
- package/dist/upload/transaction/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/wizard/invalid_icon.svg +0 -6
- package/dist/wizard/valid_icon.svg +0 -6
- package/dist/wizard/validation-wrong.svg +0 -6
- package/test/Accordion.test.js +0 -33
- package/test/AccordionGroup.test.js +0 -125
- package/test/Alert.test.js +0 -53
- package/test/Box.test.js +0 -10
- package/test/Button.test.js +0 -18
- package/test/Card.test.js +0 -30
- package/test/Checkbox.test.js +0 -45
- package/test/Chip.test.js +0 -25
- package/test/Date.test.js +0 -393
- package/test/Dialog.test.js +0 -23
- package/test/Dropdown.test.js +0 -130
- package/test/Footer.test.js +0 -99
- package/test/Header.test.js +0 -39
- package/test/Heading.test.js +0 -35
- package/test/InputText.test.js +0 -240
- package/test/Link.test.js +0 -42
- package/test/Paginator.test.js +0 -177
- package/test/ProgressBar.test.js +0 -35
- package/test/Radio.test.js +0 -37
- package/test/ResultsetTable.test.js +0 -330
- package/test/Select.test.js +0 -192
- package/test/Sidenav.test.js +0 -45
- package/test/Slider.test.js +0 -82
- package/test/Spinner.test.js +0 -27
- package/test/Switch.test.js +0 -45
- package/test/Table.test.js +0 -36
- package/test/Tabs.test.js +0 -109
- package/test/TabsForSections.test.js +0 -34
- package/test/Tag.test.js +0 -32
- package/test/TextArea.test.js +0 -52
- package/test/ToggleGroup.test.js +0 -81
- package/test/Upload.test.js +0 -60
- package/test/Wizard.test.js +0 -130
- package/test/mocks/pngMock.js +0 -1
- package/test/mocks/svgMock.js +0 -1
package/dist/spinner/readme.md
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
# DXC Spinner Component
|
|
2
|
-
|
|
3
|
-
## Usage
|
|
4
|
-
|
|
5
|
-
```js
|
|
6
|
-
import { DxcSpinner } from "@dxc-technology/halstack-react";
|
|
7
|
-
|
|
8
|
-
<Spinner theme="dark" label="Processing..." />;
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Props
|
|
12
|
-
|
|
13
|
-
<table>
|
|
14
|
-
<tr style="background-color: grey">
|
|
15
|
-
<td>Name</td>
|
|
16
|
-
<td>Default</td>
|
|
17
|
-
<td>Description</td>
|
|
18
|
-
</tr>
|
|
19
|
-
<tr>
|
|
20
|
-
<td>label: string</td>
|
|
21
|
-
<td></td>
|
|
22
|
-
<td>Text to be placed inside the spinner.</td>
|
|
23
|
-
</tr>
|
|
24
|
-
<tr>
|
|
25
|
-
<td>theme: 'light' |'dark'</td>
|
|
26
|
-
<td><code>'light'</code></td>
|
|
27
|
-
<td>Uses one of the available component themes.</td>
|
|
28
|
-
</tr>
|
|
29
|
-
<tr>
|
|
30
|
-
<td>mode: 'large' | 'small' | 'overlay' </td>
|
|
31
|
-
<td>large</td>
|
|
32
|
-
<td>The spinner can have overlay or small or large size. <td>
|
|
33
|
-
</tr>
|
|
34
|
-
<tr>
|
|
35
|
-
<td>value: string</td>
|
|
36
|
-
<td></td>
|
|
37
|
-
<td>The value of the progress indicator. If it´s received the component is determinated otherwise is indeterminate</td>
|
|
38
|
-
</tr>
|
|
39
|
-
<tr>
|
|
40
|
-
<td>showValue: boolean</td>
|
|
41
|
-
<td>false</td>
|
|
42
|
-
<td>If true the value is displayed inside the spinner</td>
|
|
43
|
-
</tr>
|
|
44
|
-
</table>
|
|
45
|
-
|
|
46
|
-
## Examples
|
|
47
|
-
|
|
48
|
-
```js
|
|
49
|
-
import React from "react";
|
|
50
|
-
|
|
51
|
-
import { DxcSpinner } from "@dxc-technology/halstack-react";
|
|
52
|
-
|
|
53
|
-
function App() {
|
|
54
|
-
return (
|
|
55
|
-
<div>
|
|
56
|
-
<Spinner theme="light" label="Processing..." overlay={false} />
|
|
57
|
-
</div>
|
|
58
|
-
<div>
|
|
59
|
-
<Spinner theme="dark" label="Processing..." overlay={false} showValue value={52} />
|
|
60
|
-
</div>
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export default App;
|
|
65
|
-
```
|
|
@@ -1,134 +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 _Switch = _interopRequireDefault(require("./Switch"));
|
|
18
|
-
|
|
19
|
-
var onChange = (0, _addonActions.action)("onChange");
|
|
20
|
-
|
|
21
|
-
onChange.toString = function () {
|
|
22
|
-
return "onChangeHandler";
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
(0, _react2.storiesOf)("Form Components|Switch", module).add("Component", function () {
|
|
26
|
-
return _react["default"].createElement("div", null, _react["default"].createElement("h3", null, "Light"), _react["default"].createElement("div", null, _react["default"].createElement(_Switch["default"], {
|
|
27
|
-
checked: false,
|
|
28
|
-
label: "Switch component",
|
|
29
|
-
labelPosition: "after",
|
|
30
|
-
theme: "light",
|
|
31
|
-
onChange: onChange
|
|
32
|
-
}), _react["default"].createElement(_Switch["default"], {
|
|
33
|
-
checked: false,
|
|
34
|
-
label: "Label before",
|
|
35
|
-
labelPosition: "before",
|
|
36
|
-
theme: "light",
|
|
37
|
-
onChange: onChange
|
|
38
|
-
}), _react["default"].createElement(_Switch["default"], {
|
|
39
|
-
checked: false,
|
|
40
|
-
label: "Label after",
|
|
41
|
-
labelPosition: "after",
|
|
42
|
-
theme: "light",
|
|
43
|
-
onChange: onChange
|
|
44
|
-
}), _react["default"].createElement(_Switch["default"], {
|
|
45
|
-
checked: false,
|
|
46
|
-
label: "Disabled",
|
|
47
|
-
labelPosition: "after",
|
|
48
|
-
theme: "light",
|
|
49
|
-
disabled: true,
|
|
50
|
-
onChange: onChange
|
|
51
|
-
}), _react["default"].createElement(_Switch["default"], {
|
|
52
|
-
checked: false,
|
|
53
|
-
required: true,
|
|
54
|
-
label: "Required",
|
|
55
|
-
labelPosition: "after",
|
|
56
|
-
theme: "light",
|
|
57
|
-
disabled: false,
|
|
58
|
-
onChange: onChange
|
|
59
|
-
})), _react["default"].createElement("h3", null, "Dark"), _react["default"].createElement("div", {
|
|
60
|
-
style: {
|
|
61
|
-
background: "black"
|
|
62
|
-
}
|
|
63
|
-
}, _react["default"].createElement("div", null, _react["default"].createElement(_Switch["default"], {
|
|
64
|
-
checked: false,
|
|
65
|
-
label: "Switch component",
|
|
66
|
-
labelPosition: "after",
|
|
67
|
-
theme: "dark",
|
|
68
|
-
onChange: onChange
|
|
69
|
-
}), _react["default"].createElement(_Switch["default"], {
|
|
70
|
-
checked: false,
|
|
71
|
-
label: "Label before",
|
|
72
|
-
labelPosition: "before",
|
|
73
|
-
theme: "dark",
|
|
74
|
-
onChange: onChange
|
|
75
|
-
}), _react["default"].createElement(_Switch["default"], {
|
|
76
|
-
checked: false,
|
|
77
|
-
label: "Label after",
|
|
78
|
-
labelPosition: "after",
|
|
79
|
-
theme: "dark",
|
|
80
|
-
onChange: onChange
|
|
81
|
-
}), _react["default"].createElement(_Switch["default"], {
|
|
82
|
-
checked: false,
|
|
83
|
-
label: "Disabled",
|
|
84
|
-
labelPosition: "after",
|
|
85
|
-
theme: "dark",
|
|
86
|
-
disabled: true,
|
|
87
|
-
onChange: onChange
|
|
88
|
-
}), _react["default"].createElement(_Switch["default"], {
|
|
89
|
-
checked: false,
|
|
90
|
-
required: true,
|
|
91
|
-
label: "Required",
|
|
92
|
-
labelPosition: "after",
|
|
93
|
-
theme: "dark",
|
|
94
|
-
disabled: false,
|
|
95
|
-
onChange: onChange
|
|
96
|
-
}))));
|
|
97
|
-
}, {
|
|
98
|
-
notes: {
|
|
99
|
-
markdown: _readme["default"]
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
var knobProps = function knobProps() {
|
|
104
|
-
return {
|
|
105
|
-
label: (0, _addonKnobs.text)("Label", "Switch"),
|
|
106
|
-
disabled: (0, _addonKnobs["boolean"])("Disabled", false),
|
|
107
|
-
labelPosition: (0, _addonKnobs.select)("Label position", {
|
|
108
|
-
before: "before",
|
|
109
|
-
after: "after"
|
|
110
|
-
}, "before"),
|
|
111
|
-
theme: (0, _addonKnobs.select)("Theme", {
|
|
112
|
-
light: "light",
|
|
113
|
-
dark: "dark"
|
|
114
|
-
}, "light"),
|
|
115
|
-
disableRipple: (0, _addonKnobs["boolean"])("disableRipple", false),
|
|
116
|
-
required: (0, _addonKnobs["boolean"])("Required", false)
|
|
117
|
-
};
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
(0, _react2.storiesOf)("Form Components|Switch", module).add("Knobs example", function () {
|
|
121
|
-
var props = knobProps();
|
|
122
|
-
return _react["default"].createElement("div", {
|
|
123
|
-
style: {
|
|
124
|
-
background: props.theme === "dark" && "black" || "transparent"
|
|
125
|
-
}
|
|
126
|
-
}, _react["default"].createElement(_Switch["default"], (0, _extends2["default"])({}, props, {
|
|
127
|
-
value: "TestValue",
|
|
128
|
-
onChange: onChange
|
|
129
|
-
})));
|
|
130
|
-
}, {
|
|
131
|
-
notes: {
|
|
132
|
-
markdown: _readme["default"]
|
|
133
|
-
}
|
|
134
|
-
});
|
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
|
-
```
|
|
@@ -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
|
-
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
|
|
10
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
|
-
|
|
12
|
-
var _react = _interopRequireDefault(require("react"));
|
|
13
|
-
|
|
14
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
15
|
-
|
|
16
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
17
|
-
|
|
18
|
-
var _reactUseScrollspy = _interopRequireDefault(require("react-use-scrollspy"));
|
|
19
|
-
|
|
20
|
-
var _Tabs = _interopRequireDefault(require("../tabs/Tabs"));
|
|
21
|
-
|
|
22
|
-
function _templateObject() {
|
|
23
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n z-index: 10;\n ", "\n"]);
|
|
24
|
-
|
|
25
|
-
_templateObject = function _templateObject() {
|
|
26
|
-
return data;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
return data;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
var TABS_HEIGHT = 54;
|
|
33
|
-
|
|
34
|
-
var DxcTabsForSections = function DxcTabsForSections(_ref) {
|
|
35
|
-
var _ref$sections = _ref.sections,
|
|
36
|
-
sections = _ref$sections === void 0 ? [] : _ref$sections,
|
|
37
|
-
_ref$stickAtPx = _ref.stickAtPx,
|
|
38
|
-
stickAtPx = _ref$stickAtPx === void 0 ? 0 : _ref$stickAtPx;
|
|
39
|
-
var tabs = sections.map(function (section) {
|
|
40
|
-
return {
|
|
41
|
-
label: section.tabLabel
|
|
42
|
-
};
|
|
43
|
-
});
|
|
44
|
-
var refs = sections.map(function () {
|
|
45
|
-
return _react["default"].createRef();
|
|
46
|
-
});
|
|
47
|
-
var activeTab = (0, _reactUseScrollspy["default"])({
|
|
48
|
-
sectionElementRefs: refs,
|
|
49
|
-
offsetPx: -stickAtPx - TABS_HEIGHT
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
var onTabClick = function onTabClick(tabId) {
|
|
53
|
-
var topOfElement = refs[tabId].current.offsetTop - stickAtPx - TABS_HEIGHT + 5;
|
|
54
|
-
window.scroll({
|
|
55
|
-
top: topOfElement,
|
|
56
|
-
behavior: "smooth"
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
return _react["default"].createElement(_react["default"].Fragment, null, _react["default"].createElement(StyledTabs, {
|
|
61
|
-
stickAtPx: stickAtPx
|
|
62
|
-
}, _react["default"].createElement(_Tabs["default"], {
|
|
63
|
-
tabs: tabs,
|
|
64
|
-
activeTabIndex: activeTab,
|
|
65
|
-
onTabClick: onTabClick
|
|
66
|
-
})), sections.map(function (section, i) {
|
|
67
|
-
return _react["default"].createElement("div", {
|
|
68
|
-
key: "section".concat(i),
|
|
69
|
-
ref: refs[i]
|
|
70
|
-
}, _react["default"].createElement(section.section, null));
|
|
71
|
-
}));
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
DxcTabsForSections.propTypes = {
|
|
75
|
-
stickAtPx: _propTypes["default"].number,
|
|
76
|
-
sections: _propTypes["default"].arrayOf(_propTypes["default"].shape({
|
|
77
|
-
tabLabel: _propTypes["default"].string,
|
|
78
|
-
section: _propTypes["default"].func
|
|
79
|
-
}))
|
|
80
|
-
};
|
|
81
|
-
DxcTabsForSections.defaultProps = {
|
|
82
|
-
stickAtPx: 0,
|
|
83
|
-
sections: []
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
var StyledTabs = _styledComponents["default"].div(_templateObject(), function (_ref2) {
|
|
87
|
-
var stickAtPx = _ref2.stickAtPx;
|
|
88
|
-
return stickAtPx && "\n position: sticky;\n top: ".concat(stickAtPx, "px;\n ");
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
var _default = DxcTabsForSections;
|
|
92
|
-
exports["default"] = _default;
|