@dxc-technology/halstack-react 0.0.0-beebecd → 0.0.0-bfdc357
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BackgroundColorContext.js +50 -0
- package/ThemeContext.js +246 -0
- package/{dist/select/Select.js → V3Select/V3Select.js} +38 -132
- package/V3Select/index.d.ts +27 -0
- package/{dist/textarea/Textarea.js → V3Textarea/V3Textarea.js} +14 -18
- package/V3Textarea/index.d.ts +27 -0
- package/accordion/Accordion.d.ts +4 -0
- package/{dist/accordion → accordion}/Accordion.js +35 -130
- package/accordion/types.d.ts +68 -0
- package/accordion/types.js +5 -0
- package/accordion-group/AccordionGroup.d.ts +7 -0
- package/accordion-group/AccordionGroup.js +170 -0
- package/accordion-group/types.d.ts +72 -0
- package/accordion-group/types.js +5 -0
- package/alert/Alert.d.ts +4 -0
- package/{dist/alert → alert}/Alert.js +38 -151
- package/alert/Alert.stories.tsx +170 -0
- package/alert/types.d.ts +49 -0
- package/alert/types.js +5 -0
- package/badge/Badge.js +59 -0
- package/box/Box.d.ts +4 -0
- package/{dist/box → box}/Box.js +13 -43
- package/box/Box.stories.tsx +132 -0
- package/box/types.d.ts +43 -0
- package/box/types.js +5 -0
- package/button/Button.d.ts +4 -0
- package/{dist/button → button}/Button.js +23 -84
- package/button/Button.stories.tsx +276 -0
- package/button/types.d.ts +57 -0
- package/button/types.js +5 -0
- package/card/Card.d.ts +4 -0
- package/{dist/card → card}/Card.js +33 -123
- package/card/types.d.ts +69 -0
- package/card/types.js +5 -0
- package/checkbox/Checkbox.d.ts +4 -0
- package/{dist/checkbox → checkbox}/Checkbox.js +16 -63
- package/checkbox/Checkbox.stories.tsx +192 -0
- package/checkbox/types.d.ts +60 -0
- package/checkbox/types.js +5 -0
- package/{dist/chip → chip}/Chip.js +17 -61
- package/chip/Chip.stories.tsx +121 -0
- package/chip/index.d.ts +22 -0
- package/{dist/common → common}/OpenSans.css +0 -0
- package/{dist/common → common}/RequiredComponent.js +3 -11
- package/{dist/common → common}/fonts/OpenSans-Bold.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-BoldItalic.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-ExtraBold.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-ExtraBoldItalic.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-Italic.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-Light.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-LightItalic.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-Regular.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-SemiBold.ttf +0 -0
- package/{dist/common → common}/fonts/OpenSans-SemiBoldItalic.ttf +0 -0
- package/{dist/common → common}/utils.js +0 -0
- package/{dist/common → common}/variables.js +165 -157
- package/{dist/date → date}/Date.js +16 -22
- package/date/index.d.ts +27 -0
- package/date-input/DateInput.d.ts +4 -0
- package/{dist/date-input → date-input}/DateInput.js +22 -61
- package/date-input/DateInput.stories.tsx +138 -0
- package/date-input/types.d.ts +100 -0
- package/date-input/types.js +5 -0
- package/dialog/Dialog.d.ts +4 -0
- package/{dist/dialog → dialog}/Dialog.js +20 -73
- package/dialog/Dialog.stories.tsx +212 -0
- package/dialog/types.d.ts +43 -0
- package/dialog/types.js +5 -0
- package/dropdown/Dropdown.d.ts +4 -0
- package/{dist/dropdown → dropdown}/Dropdown.js +44 -171
- package/dropdown/types.d.ts +89 -0
- package/dropdown/types.js +5 -0
- package/file-input/FileInput.d.ts +4 -0
- package/{dist/file-input → file-input}/FileInput.js +56 -189
- package/file-input/FileItem.d.ts +14 -0
- package/file-input/FileItem.js +182 -0
- package/file-input/types.d.ts +87 -0
- package/file-input/types.js +5 -0
- package/footer/Footer.d.ts +4 -0
- package/footer/Footer.js +266 -0
- package/footer/Footer.stories.jsx +151 -0
- package/footer/Icons.js +77 -0
- package/footer/types.d.ts +61 -0
- package/footer/types.js +5 -0
- package/header/Header.d.ts +7 -0
- package/header/Header.js +324 -0
- package/header/Header.stories.tsx +162 -0
- package/header/Icons.js +34 -0
- package/header/types.d.ts +45 -0
- package/header/types.js +5 -0
- package/heading/Heading.d.ts +4 -0
- package/{dist/heading → heading}/Heading.js +30 -89
- package/heading/types.d.ts +33 -0
- package/heading/types.js +5 -0
- package/input-text/Icons.js +22 -0
- package/{dist/input-text → input-text}/InputText.js +37 -133
- package/input-text/index.d.ts +36 -0
- package/{dist/layout → layout}/ApplicationLayout.js +35 -131
- package/layout/Icons.js +55 -0
- package/link/Link.d.ts +3 -0
- package/{dist/link → link}/Link.js +18 -94
- package/link/Link.stories.tsx +146 -0
- package/link/types.d.ts +74 -0
- package/link/types.js +5 -0
- package/main.d.ts +44 -0
- package/{dist/main.js → main.js} +95 -99
- package/number-input/NumberInput.d.ts +4 -0
- package/number-input/NumberInput.js +86 -0
- package/number-input/NumberInput.stories.tsx +115 -0
- package/{dist/number-input → number-input}/NumberInputContext.js +1 -1
- package/number-input/types.d.ts +117 -0
- package/number-input/types.js +5 -0
- package/package.json +32 -25
- package/paginator/Icons.js +66 -0
- package/paginator/Paginator.d.ts +4 -0
- package/paginator/Paginator.js +198 -0
- package/paginator/Paginator.stories.tsx +63 -0
- package/paginator/types.d.ts +38 -0
- package/paginator/types.js +5 -0
- package/password-input/PasswordInput.d.ts +4 -0
- package/{dist/password-input → password-input}/PasswordInput.js +24 -60
- package/password-input/PasswordInput.stories.tsx +131 -0
- package/password-input/types.d.ts +100 -0
- package/password-input/types.js +5 -0
- package/progress-bar/ProgressBar.d.ts +4 -0
- package/{dist/progress-bar → progress-bar}/ProgressBar.js +20 -92
- package/progress-bar/ProgressBar.stories.jsx +58 -0
- package/progress-bar/types.d.ts +37 -0
- package/progress-bar/types.js +5 -0
- package/radio/Radio.d.ts +4 -0
- package/{dist/radio → radio}/Radio.js +15 -50
- package/radio/Radio.stories.tsx +192 -0
- package/radio/types.d.ts +54 -0
- package/radio/types.js +5 -0
- package/{dist/resultsetTable → resultsetTable}/ResultsetTable.js +35 -119
- package/resultsetTable/index.d.ts +19 -0
- package/select/Select.js +865 -0
- package/select/Select.stories.tsx +572 -0
- package/select/index.d.ts +131 -0
- package/sidenav/Sidenav.d.ts +9 -0
- package/{dist/sidenav → sidenav}/Sidenav.js +19 -62
- package/sidenav/types.d.ts +50 -0
- package/sidenav/types.js +5 -0
- package/slider/Slider.d.ts +4 -0
- package/{dist/slider → slider}/Slider.js +75 -152
- package/slider/Slider.stories.tsx +177 -0
- package/slider/types.d.ts +78 -0
- package/slider/types.js +5 -0
- package/spinner/Spinner.d.ts +4 -0
- package/spinner/Spinner.js +250 -0
- package/spinner/Spinner.stories.jsx +102 -0
- package/spinner/types.d.ts +32 -0
- package/spinner/types.js +5 -0
- package/switch/Switch.d.ts +4 -0
- package/{dist/switch → switch}/Switch.js +26 -69
- package/switch/Switch.stories.tsx +160 -0
- package/switch/types.d.ts +58 -0
- package/switch/types.js +5 -0
- package/table/Table.d.ts +4 -0
- package/{dist/table → table}/Table.js +10 -24
- package/table/Table.stories.jsx +276 -0
- package/table/types.d.ts +21 -0
- package/table/types.js +5 -0
- package/tabs/Tabs.d.ts +4 -0
- package/tabs/Tabs.js +211 -0
- package/tabs/types.d.ts +71 -0
- package/tabs/types.js +5 -0
- package/tag/Tag.d.ts +4 -0
- package/tag/Tag.js +193 -0
- package/tag/Tag.stories.tsx +145 -0
- package/tag/types.d.ts +60 -0
- package/tag/types.js +5 -0
- package/{dist/text-input → text-input}/TextInput.js +244 -390
- package/{dist/text-input → text-input}/index.d.ts +2 -2
- package/{dist/new-textarea/NewTextarea.js → textarea/Textarea.js} +23 -75
- package/textarea/Textarea.stories.jsx +135 -0
- package/{dist/new-textarea → textarea}/index.d.ts +1 -1
- package/{dist/toggle → toggle}/Toggle.js +15 -49
- package/toggle/index.d.ts +21 -0
- package/{dist/toggle-group → toggle-group}/ToggleGroup.js +23 -107
- package/toggle-group/ToggleGroup.stories.tsx +178 -0
- package/toggle-group/index.d.ts +21 -0
- package/{dist/upload → upload}/Upload.js +11 -15
- package/upload/buttons-upload/ButtonsUpload.js +111 -0
- package/upload/buttons-upload/Icons.js +40 -0
- package/upload/dragAndDropArea/DragAndDropArea.js +225 -0
- package/upload/dragAndDropArea/Icons.js +39 -0
- package/upload/file-upload/FileToUpload.js +115 -0
- package/upload/file-upload/Icons.js +66 -0
- package/{dist/upload → upload}/files-upload/FilesToUpload.js +12 -26
- package/upload/index.d.ts +15 -0
- package/upload/transaction/Icons.js +160 -0
- package/upload/transaction/Transaction.js +104 -0
- package/upload/transactions/Transactions.js +94 -0
- package/{dist/useTheme.js → useTheme.js} +0 -0
- package/wizard/Icons.js +65 -0
- package/wizard/Wizard.d.ts +4 -0
- package/{dist/wizard → wizard}/Wizard.js +33 -213
- package/wizard/Wizard.stories.jsx +224 -0
- package/wizard/types.d.ts +64 -0
- package/wizard/types.js +5 -0
- package/README.md +0 -66
- package/babel.config.js +0 -8
- package/dist/BackgroundColorContext.js +0 -46
- package/dist/ThemeContext.js +0 -248
- package/dist/accordion-group/AccordionGroup.js +0 -186
- package/dist/alert/index.d.ts +0 -51
- package/dist/badge/Badge.js +0 -63
- package/dist/checkbox/Checkbox.stories.js +0 -144
- package/dist/checkbox/readme.md +0 -116
- package/dist/date/Date.stories.js +0 -205
- package/dist/date/readme.md +0 -73
- package/dist/date-input/index.d.ts +0 -95
- package/dist/file-input/FileItem.js +0 -280
- package/dist/file-input/index.d.ts +0 -81
- package/dist/footer/Footer.js +0 -395
- 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/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/main.d.ts +0 -8
- package/dist/new-select/NewSelect.js +0 -836
- package/dist/new-select/index.d.ts +0 -53
- package/dist/number-input/NumberInput.js +0 -136
- package/dist/number-input/index.d.ts +0 -113
- 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-input/index.d.ts +0 -94
- 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/slider/readme.md +0 -64
- package/dist/spinner/Spinner.js +0 -381
- 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 -282
- package/dist/toggle/Toggle.stories.js +0 -297
- package/dist/toggle/readme.md +0 -80
- 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/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/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/DateInput.test.js +0 -242
- package/test/Dialog.test.js +0 -23
- package/test/Dropdown.test.js +0 -145
- package/test/FileInput.test.js +0 -201
- package/test/Footer.test.js +0 -99
- package/test/Header.test.js +0 -39
- package/test/Heading.test.js +0 -35
- package/test/InputText.test.js +0 -248
- package/test/Link.test.js +0 -43
- package/test/NewTextarea.test.js +0 -195
- package/test/NumberInput.test.js +0 -259
- package/test/Paginator.test.js +0 -177
- package/test/PasswordInput.test.js +0 -83
- package/test/ProgressBar.test.js +0 -35
- package/test/Radio.test.js +0 -37
- package/test/ResultsetTable.test.js +0 -329
- package/test/Select.test.js +0 -212
- package/test/Sidenav.test.js +0 -45
- package/test/Slider.test.js +0 -82
- package/test/Spinner.test.js +0 -32
- package/test/Switch.test.js +0 -45
- package/test/Table.test.js +0 -36
- package/test/Tabs.test.js +0 -109
- package/test/TabsForSections.test.js +0 -34
- package/test/Tag.test.js +0 -32
- package/test/TextArea.test.js +0 -52
- package/test/TextInput.test.js +0 -732
- package/test/ToggleGroup.test.js +0 -85
- 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,94 +0,0 @@
|
|
|
1
|
-
type Size = "small" | "medium" | "large" | "fillParent";
|
|
2
|
-
type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
3
|
-
type Margin = {
|
|
4
|
-
top?: Space;
|
|
5
|
-
bottom?: Space;
|
|
6
|
-
left?: Space;
|
|
7
|
-
right?: Space;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
type Props = {
|
|
11
|
-
/**
|
|
12
|
-
* Text to be placed above the password.
|
|
13
|
-
*/
|
|
14
|
-
label?: string;
|
|
15
|
-
/**
|
|
16
|
-
* Name attribute of the input element.
|
|
17
|
-
*/
|
|
18
|
-
name?: string;
|
|
19
|
-
/**
|
|
20
|
-
* Value of the input element. If undefined, the component will be uncontrolled and the value will be managed internally by the component.
|
|
21
|
-
*/
|
|
22
|
-
value?: string;
|
|
23
|
-
/**
|
|
24
|
-
* Helper text to be placed above the password.
|
|
25
|
-
*/
|
|
26
|
-
helperText?: string;
|
|
27
|
-
/**
|
|
28
|
-
* If true, the password input will have an action to clear the entered value.
|
|
29
|
-
*/
|
|
30
|
-
clearable?: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* This function will be called when the user types within the input
|
|
33
|
-
* element of the component. An object including the current value and
|
|
34
|
-
* the error (if the value entered is not valid) will be passed to this
|
|
35
|
-
* function. If there is no error, error will be null.
|
|
36
|
-
* */
|
|
37
|
-
onChange?: (val: { value: string; error: string }) => void;
|
|
38
|
-
/**
|
|
39
|
-
* This function will be called when the input element loses the focus.
|
|
40
|
-
* An object including the input value and the error (if the value entered is
|
|
41
|
-
* not valid) will be passed to this function. If there is no error, error will be null.
|
|
42
|
-
*/
|
|
43
|
-
onBlur?: (val: { value: string; error: string }) => void;
|
|
44
|
-
/**
|
|
45
|
-
* If it is defined, the component will change its appearance, showing
|
|
46
|
-
* the error below the password input component. If it is not defined, the
|
|
47
|
-
* error messages will be managed internally, but never displayed on its own.
|
|
48
|
-
*/
|
|
49
|
-
error?: string;
|
|
50
|
-
/**
|
|
51
|
-
* Regular expression that defines the valid format allowed by the
|
|
52
|
-
* password input. This will be checked both when the input element loses the
|
|
53
|
-
* focus and while typing within it. If the string entered does not match
|
|
54
|
-
* the pattern, the onBlur and onChange functions will be called with the
|
|
55
|
-
* current value and an internal error informing that this value does not
|
|
56
|
-
* match the pattern. If the pattern is met, the error parameter of both
|
|
57
|
-
* events will be null.
|
|
58
|
-
*/
|
|
59
|
-
pattern?: string;
|
|
60
|
-
/**
|
|
61
|
-
* Specifies the minimun and maximum length allowed by the password input.
|
|
62
|
-
* This will be checked both when the input element loses the
|
|
63
|
-
* focus and while typing within it. If the string entered does not
|
|
64
|
-
* comply the length, the onBlur and onChange functions will be called
|
|
65
|
-
* with the current value and an internal error informing that the value
|
|
66
|
-
* length does not comply the specified range. If a valid length is
|
|
67
|
-
* reached, the error parameter of both events will be null.
|
|
68
|
-
*/
|
|
69
|
-
length?: { min?: number; max?: number };
|
|
70
|
-
/**
|
|
71
|
-
* HTML autocomplete attribute. Lets the user specify if any permission the user agent has to provide automated assistance in filling out the input value.
|
|
72
|
-
* Its value must be one of all the possible values of the HTML autocomplete attribute: 'on', 'off', 'email', 'username', 'new-password', ...
|
|
73
|
-
*/
|
|
74
|
-
autocomplete?: string;
|
|
75
|
-
/**
|
|
76
|
-
* Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
77
|
-
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
|
|
78
|
-
*/
|
|
79
|
-
margin?: Space | Margin;
|
|
80
|
-
/**
|
|
81
|
-
* Size of the component ('small' | 'medium' | 'large' | 'fillParent').
|
|
82
|
-
*/
|
|
83
|
-
size?: Size;
|
|
84
|
-
/**
|
|
85
|
-
* Value of the tabindex attribute.
|
|
86
|
-
*/
|
|
87
|
-
tabIndex?: number;
|
|
88
|
-
/**
|
|
89
|
-
* Reference to the component.
|
|
90
|
-
*/
|
|
91
|
-
ref?: React.RefObject<HTMLDivElement>;
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
export default function DxcPasswordInput(props: Props): JSX.Element;
|
|
@@ -1,280 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
6
|
-
|
|
7
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
8
|
-
|
|
9
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
10
|
-
|
|
11
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
12
|
-
|
|
13
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
14
|
-
|
|
15
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
16
|
-
|
|
17
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
18
|
-
|
|
19
|
-
var _react = _interopRequireDefault(require("react"));
|
|
20
|
-
|
|
21
|
-
var _react2 = require("@storybook/react");
|
|
22
|
-
|
|
23
|
-
var _addonKnobs = require("@storybook/addon-knobs");
|
|
24
|
-
|
|
25
|
-
var _readme = _interopRequireDefault(require("./readme.md"));
|
|
26
|
-
|
|
27
|
-
var _ProgressBar = _interopRequireDefault(require("./ProgressBar"));
|
|
28
|
-
|
|
29
|
-
var _Button = _interopRequireDefault(require("../button/Button"));
|
|
30
|
-
|
|
31
|
-
(0, _react2.storiesOf)("Form Components|Progress Bar", module).add("Types", function () {
|
|
32
|
-
var ControlledStory =
|
|
33
|
-
/*#__PURE__*/
|
|
34
|
-
function (_React$Component) {
|
|
35
|
-
(0, _inherits2["default"])(ControlledStory, _React$Component);
|
|
36
|
-
|
|
37
|
-
function ControlledStory(props) {
|
|
38
|
-
var _this;
|
|
39
|
-
|
|
40
|
-
(0, _classCallCheck2["default"])(this, ControlledStory);
|
|
41
|
-
_this = (0, _possibleConstructorReturn2["default"])(this, (0, _getPrototypeOf2["default"])(ControlledStory).call(this, props));
|
|
42
|
-
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "openProgressBar", function () {
|
|
43
|
-
_this.setState({
|
|
44
|
-
isVisible: !_this.state.isVisible
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
_this.state = {
|
|
48
|
-
isVisible: false
|
|
49
|
-
};
|
|
50
|
-
return _this;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
(0, _createClass2["default"])(ControlledStory, [{
|
|
54
|
-
key: "render",
|
|
55
|
-
value: function render() {
|
|
56
|
-
return _react["default"].createElement("div", null, _react["default"].createElement("div", null, _react["default"].createElement("h3", null, "Determined and undetermined progress bar"), _react["default"].createElement("div", null, _react["default"].createElement("div", {
|
|
57
|
-
style: {
|
|
58
|
-
display: "flex",
|
|
59
|
-
flexDirection: "row"
|
|
60
|
-
}
|
|
61
|
-
}, _react["default"].createElement("div", {
|
|
62
|
-
style: {
|
|
63
|
-
display: "flex",
|
|
64
|
-
flexDirection: "column"
|
|
65
|
-
}
|
|
66
|
-
}, _react["default"].createElement(_ProgressBar["default"], {
|
|
67
|
-
label: "Loading...",
|
|
68
|
-
theme: "light",
|
|
69
|
-
overlay: false,
|
|
70
|
-
showValue: true,
|
|
71
|
-
value: 0
|
|
72
|
-
}), _react["default"].createElement(_ProgressBar["default"], {
|
|
73
|
-
label: "Loading...",
|
|
74
|
-
theme: "light",
|
|
75
|
-
overlay: false,
|
|
76
|
-
showValue: true,
|
|
77
|
-
value: 15
|
|
78
|
-
}), _react["default"].createElement(_ProgressBar["default"], {
|
|
79
|
-
label: "Loading...",
|
|
80
|
-
theme: "light",
|
|
81
|
-
overlay: false,
|
|
82
|
-
showValue: true,
|
|
83
|
-
value: 52
|
|
84
|
-
}), _react["default"].createElement(_ProgressBar["default"], {
|
|
85
|
-
label: "Loading...",
|
|
86
|
-
theme: "light",
|
|
87
|
-
overlay: false,
|
|
88
|
-
showValue: true,
|
|
89
|
-
value: 80
|
|
90
|
-
})), _react["default"].createElement("div", {
|
|
91
|
-
style: {
|
|
92
|
-
display: "flex",
|
|
93
|
-
flexDirection: "column"
|
|
94
|
-
}
|
|
95
|
-
}, _react["default"].createElement(_ProgressBar["default"], {
|
|
96
|
-
label: "Loading...",
|
|
97
|
-
theme: "light",
|
|
98
|
-
overlay: false,
|
|
99
|
-
value: 0
|
|
100
|
-
}), _react["default"].createElement(_ProgressBar["default"], {
|
|
101
|
-
label: "Loading...",
|
|
102
|
-
theme: "light",
|
|
103
|
-
overlay: false,
|
|
104
|
-
value: 15
|
|
105
|
-
}), _react["default"].createElement(_ProgressBar["default"], {
|
|
106
|
-
label: "Loading...",
|
|
107
|
-
theme: "light",
|
|
108
|
-
overlay: false,
|
|
109
|
-
value: 52
|
|
110
|
-
}), _react["default"].createElement(_ProgressBar["default"], {
|
|
111
|
-
label: "Loading...",
|
|
112
|
-
theme: "light",
|
|
113
|
-
overlay: false,
|
|
114
|
-
value: 80
|
|
115
|
-
}))))), _react["default"].createElement("div", null, _react["default"].createElement("h3", null, "Dark"), _react["default"].createElement("div", {
|
|
116
|
-
style: {
|
|
117
|
-
display: "flex",
|
|
118
|
-
flexDirection: "row",
|
|
119
|
-
background: "black"
|
|
120
|
-
}
|
|
121
|
-
}, _react["default"].createElement("div", {
|
|
122
|
-
style: {
|
|
123
|
-
display: "flex",
|
|
124
|
-
flexDirection: "column"
|
|
125
|
-
}
|
|
126
|
-
}, _react["default"].createElement(_ProgressBar["default"], {
|
|
127
|
-
label: "Loading...",
|
|
128
|
-
theme: "dark",
|
|
129
|
-
overlay: false,
|
|
130
|
-
showValue: true,
|
|
131
|
-
value: 0
|
|
132
|
-
}), _react["default"].createElement(_ProgressBar["default"], {
|
|
133
|
-
label: "Loading...",
|
|
134
|
-
theme: "dark",
|
|
135
|
-
overlay: false,
|
|
136
|
-
showValue: true,
|
|
137
|
-
value: 15
|
|
138
|
-
}), _react["default"].createElement(_ProgressBar["default"], {
|
|
139
|
-
label: "Loading...",
|
|
140
|
-
theme: "dark",
|
|
141
|
-
overlay: false,
|
|
142
|
-
showValue: true,
|
|
143
|
-
value: 52
|
|
144
|
-
}), _react["default"].createElement(_ProgressBar["default"], {
|
|
145
|
-
label: "Loading...",
|
|
146
|
-
theme: "dark",
|
|
147
|
-
overlay: false,
|
|
148
|
-
showValue: true,
|
|
149
|
-
value: 80
|
|
150
|
-
})), _react["default"].createElement("div", {
|
|
151
|
-
style: {
|
|
152
|
-
display: "flex",
|
|
153
|
-
flexDirection: "column"
|
|
154
|
-
}
|
|
155
|
-
}, _react["default"].createElement(_ProgressBar["default"], {
|
|
156
|
-
label: "Loading...",
|
|
157
|
-
theme: "dark",
|
|
158
|
-
overlay: false,
|
|
159
|
-
value: 0
|
|
160
|
-
}), _react["default"].createElement(_ProgressBar["default"], {
|
|
161
|
-
label: "Loading...",
|
|
162
|
-
theme: "dark",
|
|
163
|
-
overlay: false,
|
|
164
|
-
value: 15
|
|
165
|
-
}), _react["default"].createElement(_ProgressBar["default"], {
|
|
166
|
-
label: "Loading...",
|
|
167
|
-
theme: "dark",
|
|
168
|
-
overlay: false,
|
|
169
|
-
value: 52
|
|
170
|
-
}), _react["default"].createElement(_ProgressBar["default"], {
|
|
171
|
-
label: "Loading...",
|
|
172
|
-
theme: "dark",
|
|
173
|
-
overlay: false,
|
|
174
|
-
value: 80
|
|
175
|
-
})))), _react["default"].createElement("div", null, _react["default"].createElement("h3", null, "Simplified"), _react["default"].createElement("div", {
|
|
176
|
-
style: {
|
|
177
|
-
display: "flex",
|
|
178
|
-
flexDirection: "row"
|
|
179
|
-
}
|
|
180
|
-
}, _react["default"].createElement("div", {
|
|
181
|
-
style: {
|
|
182
|
-
display: "flex",
|
|
183
|
-
flexDirection: "column"
|
|
184
|
-
}
|
|
185
|
-
}, _react["default"].createElement(_ProgressBar["default"], {
|
|
186
|
-
theme: "light",
|
|
187
|
-
overlay: false
|
|
188
|
-
}), _react["default"].createElement(_ProgressBar["default"], {
|
|
189
|
-
theme: "light",
|
|
190
|
-
overlay: false
|
|
191
|
-
}), _react["default"].createElement(_ProgressBar["default"], {
|
|
192
|
-
theme: "light",
|
|
193
|
-
overlay: false
|
|
194
|
-
}), _react["default"].createElement(_ProgressBar["default"], {
|
|
195
|
-
theme: "light",
|
|
196
|
-
overlay: false
|
|
197
|
-
})), _react["default"].createElement("div", {
|
|
198
|
-
style: {
|
|
199
|
-
display: "flex",
|
|
200
|
-
flexDirection: "column"
|
|
201
|
-
}
|
|
202
|
-
}, _react["default"].createElement(_ProgressBar["default"], {
|
|
203
|
-
theme: "light",
|
|
204
|
-
overlay: false,
|
|
205
|
-
showValue: true,
|
|
206
|
-
value: 0
|
|
207
|
-
}), _react["default"].createElement(_ProgressBar["default"], {
|
|
208
|
-
theme: "light",
|
|
209
|
-
overlay: false,
|
|
210
|
-
showValue: true,
|
|
211
|
-
value: 20
|
|
212
|
-
}), _react["default"].createElement(_ProgressBar["default"], {
|
|
213
|
-
theme: "light",
|
|
214
|
-
overlay: false,
|
|
215
|
-
showValue: true,
|
|
216
|
-
value: 30
|
|
217
|
-
}), _react["default"].createElement(_ProgressBar["default"], {
|
|
218
|
-
theme: "light",
|
|
219
|
-
overlay: false,
|
|
220
|
-
showValue: true,
|
|
221
|
-
value: 50
|
|
222
|
-
})))), _react["default"].createElement("div", null, _react["default"].createElement("h3", null, "Overlay"), _react["default"].createElement("div", null, _react["default"].createElement(_Button["default"], {
|
|
223
|
-
mode: "basic",
|
|
224
|
-
theme: "light",
|
|
225
|
-
label: "Overlay Progress Bar",
|
|
226
|
-
onClick: this.openProgressBar
|
|
227
|
-
}), this.state.isVisible && _react["default"].createElement("div", {
|
|
228
|
-
onClick: this.openProgressBar,
|
|
229
|
-
style: {
|
|
230
|
-
position: "fixed",
|
|
231
|
-
top: 0,
|
|
232
|
-
left: 0,
|
|
233
|
-
right: 0,
|
|
234
|
-
bottom: 0,
|
|
235
|
-
zIndex: 1000
|
|
236
|
-
}
|
|
237
|
-
}, _react["default"].createElement(_ProgressBar["default"], {
|
|
238
|
-
theme: "light",
|
|
239
|
-
label: "Loading...",
|
|
240
|
-
overlay: true,
|
|
241
|
-
showValue: true,
|
|
242
|
-
value: 33
|
|
243
|
-
})))));
|
|
244
|
-
}
|
|
245
|
-
}]);
|
|
246
|
-
return ControlledStory;
|
|
247
|
-
}(_react["default"].Component);
|
|
248
|
-
|
|
249
|
-
return _react["default"].createElement(ControlledStory, null);
|
|
250
|
-
}, {
|
|
251
|
-
notes: {
|
|
252
|
-
markdown: _readme["default"]
|
|
253
|
-
}
|
|
254
|
-
});
|
|
255
|
-
|
|
256
|
-
var knobProps = function knobProps() {
|
|
257
|
-
return {
|
|
258
|
-
label: (0, _addonKnobs.text)("label", "Loading..."),
|
|
259
|
-
theme: (0, _addonKnobs.select)("theme", {
|
|
260
|
-
light: "light",
|
|
261
|
-
dark: "dark"
|
|
262
|
-
}, "light"),
|
|
263
|
-
value: (0, _addonKnobs.number)("value", ""),
|
|
264
|
-
overlay: (0, _addonKnobs["boolean"])("overlay", false),
|
|
265
|
-
showValue: (0, _addonKnobs["boolean"])("showValue", false)
|
|
266
|
-
};
|
|
267
|
-
};
|
|
268
|
-
|
|
269
|
-
(0, _react2.storiesOf)("Form Components|Progress Bar", module).add("Knobs example", function () {
|
|
270
|
-
var props = knobProps();
|
|
271
|
-
return _react["default"].createElement("div", {
|
|
272
|
-
style: {
|
|
273
|
-
background: props.theme === "dark" && "black" || "transparent"
|
|
274
|
-
}
|
|
275
|
-
}, _react["default"].createElement(_ProgressBar["default"], props));
|
|
276
|
-
}, {
|
|
277
|
-
notes: {
|
|
278
|
-
markdown: _readme["default"]
|
|
279
|
-
}
|
|
280
|
-
});
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
# DXC ProgressBar Component
|
|
2
|
-
|
|
3
|
-
## Usage
|
|
4
|
-
|
|
5
|
-
```js
|
|
6
|
-
import { DxcProgressBar } from "@dxc-technology/halstack-react";
|
|
7
|
-
|
|
8
|
-
<DxcProgressBar onClick={handleClick} label="Test Button" />;
|
|
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 above the progressbar.</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>overlay: boolean</td>
|
|
31
|
-
<td>true</td>
|
|
32
|
-
<td>If true, the progressbar will be over a darker background</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 above the progressbar</td>
|
|
43
|
-
</tr>
|
|
44
|
-
</table>
|
|
45
|
-
|
|
46
|
-
## Examples
|
|
47
|
-
|
|
48
|
-
```js
|
|
49
|
-
import React from "react";
|
|
50
|
-
import { DxcSpinner } from "@dxc-technology/halstack-react";
|
|
51
|
-
|
|
52
|
-
function App() {
|
|
53
|
-
return (
|
|
54
|
-
<div>
|
|
55
|
-
<ProgressBar label="Loading..." theme="light" overlay={false} value={20} />
|
|
56
|
-
</div>
|
|
57
|
-
<div>
|
|
58
|
-
<ProgressBar label="Loading..." theme="dark" showValue value={52} />
|
|
59
|
-
</div>
|
|
60
|
-
);
|
|
61
|
-
}
|
|
62
|
-
export default App;
|
|
63
|
-
```
|
|
@@ -1,166 +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 _Radio = _interopRequireDefault(require("./Radio"));
|
|
18
|
-
|
|
19
|
-
var onChange = (0, _addonActions.action)("onChange");
|
|
20
|
-
|
|
21
|
-
onChange.toString = function () {
|
|
22
|
-
return "onChangeHandler";
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
(0, _react2.storiesOf)("Form Components|Radio", 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(_Radio["default"], {
|
|
27
|
-
checked: false,
|
|
28
|
-
theme: "light",
|
|
29
|
-
value: "TestValue",
|
|
30
|
-
label: "Enable Radio",
|
|
31
|
-
labelPosition: "after",
|
|
32
|
-
onChange: onChange,
|
|
33
|
-
disabled: false,
|
|
34
|
-
required: true
|
|
35
|
-
}), _react["default"].createElement(_Radio["default"], {
|
|
36
|
-
checked: false,
|
|
37
|
-
theme: "light",
|
|
38
|
-
value: "TestValue",
|
|
39
|
-
label: "Label before",
|
|
40
|
-
labelPosition: "before",
|
|
41
|
-
onChange: onChange,
|
|
42
|
-
disabled: false
|
|
43
|
-
}), _react["default"].createElement(_Radio["default"], {
|
|
44
|
-
checked: false,
|
|
45
|
-
theme: "light",
|
|
46
|
-
value: "TestValue",
|
|
47
|
-
label: "Label after",
|
|
48
|
-
labelPosition: "after",
|
|
49
|
-
onChange: onChange,
|
|
50
|
-
disabled: false
|
|
51
|
-
}), _react["default"].createElement(_Radio["default"], {
|
|
52
|
-
checked: true,
|
|
53
|
-
theme: "light",
|
|
54
|
-
value: "TestValue",
|
|
55
|
-
label: "Selected Radio",
|
|
56
|
-
labelPosition: "before",
|
|
57
|
-
onChange: onChange,
|
|
58
|
-
disabled: false
|
|
59
|
-
}), _react["default"].createElement(_Radio["default"], {
|
|
60
|
-
checked: false,
|
|
61
|
-
theme: "light",
|
|
62
|
-
value: "TestValue",
|
|
63
|
-
label: "Disabled Radio",
|
|
64
|
-
labelPosition: "before",
|
|
65
|
-
onChange: onChange,
|
|
66
|
-
disabled: true
|
|
67
|
-
}), _react["default"].createElement(_Radio["default"], {
|
|
68
|
-
checked: true,
|
|
69
|
-
theme: "light",
|
|
70
|
-
value: "TestValue",
|
|
71
|
-
label: "Disabled Selected Radio",
|
|
72
|
-
labelPosition: "before",
|
|
73
|
-
onChange: onChange,
|
|
74
|
-
disabled: true
|
|
75
|
-
})), _react["default"].createElement("h3", null, "Dark"), _react["default"].createElement("div", {
|
|
76
|
-
style: {
|
|
77
|
-
background: "black"
|
|
78
|
-
}
|
|
79
|
-
}, _react["default"].createElement(_Radio["default"], {
|
|
80
|
-
checked: false,
|
|
81
|
-
theme: "dark",
|
|
82
|
-
value: "TestValue",
|
|
83
|
-
label: "Enable Radio",
|
|
84
|
-
labelPosition: "after",
|
|
85
|
-
onChange: onChange,
|
|
86
|
-
disabled: false
|
|
87
|
-
}), _react["default"].createElement(_Radio["default"], {
|
|
88
|
-
checked: false,
|
|
89
|
-
theme: "dark",
|
|
90
|
-
value: "TestValue",
|
|
91
|
-
label: "Label before",
|
|
92
|
-
labelPosition: "before",
|
|
93
|
-
onChange: onChange,
|
|
94
|
-
disabled: false,
|
|
95
|
-
required: true
|
|
96
|
-
}), _react["default"].createElement(_Radio["default"], {
|
|
97
|
-
checked: false,
|
|
98
|
-
theme: "dark",
|
|
99
|
-
value: "TestValue",
|
|
100
|
-
label: "Label after",
|
|
101
|
-
labelPosition: "after",
|
|
102
|
-
onChange: onChange,
|
|
103
|
-
disabled: false
|
|
104
|
-
}), _react["default"].createElement(_Radio["default"], {
|
|
105
|
-
checked: true,
|
|
106
|
-
theme: "dark",
|
|
107
|
-
value: "TestValue",
|
|
108
|
-
label: "Selected Radio",
|
|
109
|
-
labelPosition: "before",
|
|
110
|
-
onChange: onChange,
|
|
111
|
-
disabled: false
|
|
112
|
-
}), _react["default"].createElement(_Radio["default"], {
|
|
113
|
-
checked: false,
|
|
114
|
-
theme: "dark",
|
|
115
|
-
value: "TestValue",
|
|
116
|
-
label: "Disabled Radio",
|
|
117
|
-
labelPosition: "before",
|
|
118
|
-
onChange: onChange,
|
|
119
|
-
disabled: true
|
|
120
|
-
}), _react["default"].createElement(_Radio["default"], {
|
|
121
|
-
checked: true,
|
|
122
|
-
theme: "dark",
|
|
123
|
-
value: "TestValue",
|
|
124
|
-
label: "Disabled Selected Radio",
|
|
125
|
-
labelPosition: "before",
|
|
126
|
-
onChange: onChange,
|
|
127
|
-
disabled: true
|
|
128
|
-
})));
|
|
129
|
-
}, {
|
|
130
|
-
notes: {
|
|
131
|
-
markdown: _readme["default"]
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
var knobProps = function knobProps() {
|
|
136
|
-
return {
|
|
137
|
-
label: (0, _addonKnobs.text)("Label", "Test Checkbox"),
|
|
138
|
-
disabled: (0, _addonKnobs["boolean"])("Disabled", false),
|
|
139
|
-
labelPosition: (0, _addonKnobs.select)("Label position", {
|
|
140
|
-
before: "before",
|
|
141
|
-
after: "after"
|
|
142
|
-
}, "before"),
|
|
143
|
-
theme: (0, _addonKnobs.select)("Theme", {
|
|
144
|
-
light: "light",
|
|
145
|
-
dark: "dark"
|
|
146
|
-
}, "light"),
|
|
147
|
-
disableRipple: (0, _addonKnobs["boolean"])("disableRipple", false),
|
|
148
|
-
required: (0, _addonKnobs["boolean"])("Required", false)
|
|
149
|
-
};
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
(0, _react2.storiesOf)("Form Components|Radio", module).add("Knobs example", function () {
|
|
153
|
-
var props = knobProps();
|
|
154
|
-
return _react["default"].createElement("div", {
|
|
155
|
-
style: {
|
|
156
|
-
background: props.theme === "dark" && "black" || "transparent"
|
|
157
|
-
}
|
|
158
|
-
}, _react["default"].createElement(_Radio["default"], (0, _extends2["default"])({}, props, {
|
|
159
|
-
value: "TestValue",
|
|
160
|
-
onChange: onChange
|
|
161
|
-
})));
|
|
162
|
-
}, {
|
|
163
|
-
notes: {
|
|
164
|
-
markdown: _readme["default"]
|
|
165
|
-
}
|
|
166
|
-
});
|
package/dist/radio/readme.md
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
# DXC Radio Component
|
|
2
|
-
|
|
3
|
-
## Usage
|
|
4
|
-
|
|
5
|
-
```js
|
|
6
|
-
import { DxcRadio } from "@dxc-technology/halstack-react";
|
|
7
|
-
|
|
8
|
-
<DxcRadio onChange={handleNewValue} label="Test Radio" checked={checked} />;
|
|
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>checked: boolean</td>
|
|
21
|
-
<td><code>false</code></td>
|
|
22
|
-
<td>If true, the component is checked.</td>
|
|
23
|
-
</tr>
|
|
24
|
-
<tr>
|
|
25
|
-
<td>value: any</td>
|
|
26
|
-
<td></td>
|
|
27
|
-
<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 radio is checked </td>
|
|
28
|
-
</tr>
|
|
29
|
-
<tr>
|
|
30
|
-
<td>label: string</td>
|
|
31
|
-
<td></td>
|
|
32
|
-
<td>Text to be placed next to the radio.</td>
|
|
33
|
-
</tr>
|
|
34
|
-
<tr>
|
|
35
|
-
<td>labelPosition: 'before' | 'after'</td>
|
|
36
|
-
<td><code>'before'</code></td>
|
|
37
|
-
<td>Whether the label should appear after or before the radio.</td>
|
|
38
|
-
</tr>
|
|
39
|
-
<tr>
|
|
40
|
-
<td>theme: 'light' | 'dark'</td>
|
|
41
|
-
<td><code>'light'</code></td>
|
|
42
|
-
<td>Uses one of the available component themes.</td>
|
|
43
|
-
</tr>
|
|
44
|
-
<tr>
|
|
45
|
-
<td>name: string</td>
|
|
46
|
-
<td></td>
|
|
47
|
-
<td>Name attribute of the input element.</td>
|
|
48
|
-
</tr>
|
|
49
|
-
<tr>
|
|
50
|
-
<td>disabled: boolean</td>
|
|
51
|
-
<td><code>false</code></td>
|
|
52
|
-
<td>If true, the component will be disabled.</td>
|
|
53
|
-
</tr>
|
|
54
|
-
<tr>
|
|
55
|
-
<td>required: boolean</td>
|
|
56
|
-
<td><code>false</code></td>
|
|
57
|
-
<td>If true, a red asterisk will appear before the label to indicate to the user that the field is required.</td>
|
|
58
|
-
</tr>
|
|
59
|
-
<tr>
|
|
60
|
-
<td>disableRipple: boolean</td>
|
|
61
|
-
<td><code>false</code></td>
|
|
62
|
-
<td>If true, the ripple effect will be disabled.</td>
|
|
63
|
-
</tr>
|
|
64
|
-
<tr>
|
|
65
|
-
<td>onChange: function</td>
|
|
66
|
-
<td></td>
|
|
67
|
-
<td>This function will be called when the user clicks the radio. The event object will be passed as a parameter.<br>
|
|
68
|
-
Current state can be accessed via event.target.checked</td>
|
|
69
|
-
</tr>
|
|
70
|
-
</table>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24" fill="white"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"/></svg>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24" fill="white"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"/></svg>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24" fill="white"><path d="M0 0h24v24H0z" fill="none"/><path d="M12 5.83L15.17 9l1.41-1.41L12 3 7.41 7.59 8.83 9 12 5.83zm0 12.34L8.83 15l-1.41 1.41L12 21l4.59-4.59L15.17 15 12 18.17z"/></svg>
|