@dxc-technology/halstack-react 3.4.1 → 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/{dist/BackgroundColorContext.js → BackgroundColorContext.js} +0 -0
- package/{dist/ThemeContext.js → ThemeContext.js} +74 -64
- package/{dist/select/Select.js → V3Select/V3Select.js} +127 -163
- package/V3Select/index.d.ts +27 -0
- package/{dist/textarea/Textarea.js → V3Textarea/V3Textarea.js} +4 -4
- package/V3Textarea/index.d.ts +27 -0
- package/{dist/accordion → accordion}/Accordion.js +0 -0
- package/accordion/index.d.ts +28 -0
- package/{dist/accordion-group → accordion-group}/AccordionGroup.js +0 -0
- package/accordion-group/index.d.ts +16 -0
- package/{dist/alert → alert}/Alert.js +6 -6
- package/alert/index.d.ts +51 -0
- package/{dist/badge → badge}/Badge.js +0 -0
- package/{dist/box → box}/Box.js +0 -0
- package/box/index.d.ts +25 -0
- package/{dist/button → button}/Button.js +3 -3
- package/button/Button.stories.js +27 -0
- package/button/index.d.ts +24 -0
- package/{dist/card → card}/Card.js +0 -0
- package/card/index.d.ts +22 -0
- package/{dist/checkbox → checkbox}/Checkbox.js +4 -5
- package/checkbox/index.d.ts +24 -0
- package/{dist/chip → chip}/Chip.js +0 -0
- 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/{dist/common → common}/utils.js +0 -0
- package/{dist/common → common}/variables.js +344 -138
- package/{dist/date → date}/Date.js +4 -6
- package/date/index.d.ts +27 -0
- package/{dist/new-date/NewDate.js → date-input/DateInput.js} +69 -72
- package/date-input/index.d.ts +95 -0
- package/{dist/dialog → dialog}/Dialog.js +0 -0
- package/dialog/index.d.ts +18 -0
- package/{dist/dropdown → dropdown}/Dropdown.js +0 -0
- 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 +44 -18
- package/footer/Icons.js +77 -0
- package/footer/index.d.ts +25 -0
- package/{dist/header → header}/Header.js +122 -55
- package/header/Icons.js +59 -0
- package/header/index.d.ts +25 -0
- package/{dist/heading → heading}/Heading.js +12 -0
- package/heading/index.d.ts +17 -0
- package/input-text/Icons.js +22 -0
- package/{dist/input-text → input-text}/InputText.js +7 -9
- package/input-text/index.d.ts +36 -0
- package/{dist/layout → layout}/ApplicationLayout.js +5 -9
- package/layout/Icons.js +55 -0
- package/{dist/link → link}/Link.js +4 -8
- package/link/index.d.ts +23 -0
- package/main.d.ts +40 -0
- package/{dist/main.js → main.js} +37 -29
- package/{dist/number/Number.js → number-input/NumberInput.js} +9 -11
- package/{dist/number/NumberContext.js → number-input/NumberInputContext.js} +2 -2
- package/number-input/index.d.ts +113 -0
- package/package.json +21 -16
- package/paginator/Icons.js +66 -0
- package/{dist/paginator → paginator}/Paginator.js +53 -37
- package/paginator/index.d.ts +20 -0
- package/{dist/password/Password.js → password-input/PasswordInput.js} +17 -14
- package/password-input/index.d.ts +94 -0
- package/{dist/progress-bar → progress-bar}/ProgressBar.js +1 -1
- package/progress-bar/index.d.ts +18 -0
- package/{dist/radio → radio}/Radio.js +0 -0
- package/radio/index.d.ts +23 -0
- package/{dist/resultsetTable → resultsetTable}/ResultsetTable.js +1 -1
- 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 +6 -4
- package/sidenav/index.d.ts +13 -0
- package/{dist/slider → slider}/Slider.js +104 -19
- package/slider/index.d.ts +29 -0
- package/{dist/spinner → spinner}/Spinner.js +0 -0
- package/spinner/index.d.ts +17 -0
- package/{dist/switch → switch}/Switch.js +0 -0
- package/switch/index.d.ts +24 -0
- package/{dist/table → table}/Table.js +0 -0
- package/table/index.d.ts +13 -0
- package/{dist/tabs → tabs}/Tabs.js +0 -0
- package/tabs/index.d.ts +19 -0
- package/{dist/tag → tag}/Tag.js +26 -32
- package/tag/index.d.ts +24 -0
- package/{dist/new-input-text/NewInputText.js → text-input/TextInput.js} +343 -312
- package/text-input/index.d.ts +135 -0
- package/{dist/new-textarea/NewTextarea.js → textarea/Textarea.js} +68 -45
- package/textarea/index.d.ts +117 -0
- package/{dist/toggle → toggle}/Toggle.js +0 -0
- package/toggle/index.d.ts +21 -0
- package/{dist/toggle-group → toggle-group}/ToggleGroup.js +132 -28
- package/toggle-group/index.d.ts +21 -0
- package/{dist/upload → upload}/Upload.js +0 -0
- package/{dist/upload → upload}/buttons-upload/ButtonsUpload.js +7 -11
- package/upload/buttons-upload/Icons.js +40 -0
- package/{dist/upload → upload}/dragAndDropArea/DragAndDropArea.js +14 -14
- package/upload/dragAndDropArea/Icons.js +39 -0
- package/{dist/upload → upload}/file-upload/FileToUpload.js +26 -21
- package/upload/file-upload/Icons.js +66 -0
- package/{dist/upload → upload}/files-upload/FilesToUpload.js +0 -0
- package/upload/index.d.ts +15 -0
- package/upload/transaction/Icons.js +160 -0
- package/{dist/upload → upload}/transaction/Transaction.js +11 -38
- package/{dist/upload → upload}/transactions/Transactions.js +0 -0
- package/{dist/useTheme.js → useTheme.js} +0 -0
- package/wizard/Icons.js +65 -0
- package/{dist/wizard → wizard}/Wizard.js +3 -9
- package/wizard/index.d.ts +18 -0
- package/README.md +0 -66
- package/babel.config.js +0 -8
- 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/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.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.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/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.stories.js +0 -235
- package/dist/select/readme.md +0 -72
- package/dist/slider/Slider.stories.js +0 -241
- package/dist/slider/readme.md +0 -64
- 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/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/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 -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 -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/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
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
type SVG = string | (HTMLElement & SVGElement);
|
|
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 OptionGroup = {
|
|
11
|
+
/**
|
|
12
|
+
* Label of the group to be shown in the select's listbox.
|
|
13
|
+
*/
|
|
14
|
+
label: string;
|
|
15
|
+
/**
|
|
16
|
+
* List of the grouped options.
|
|
17
|
+
*/
|
|
18
|
+
options: Option[];
|
|
19
|
+
};
|
|
20
|
+
type Option = {
|
|
21
|
+
/**
|
|
22
|
+
* Element used as the icon that will be placed before the option label.
|
|
23
|
+
* It can be a url of an image or an inline SVG. If the url option
|
|
24
|
+
* is the chosen one, take into account that the component's
|
|
25
|
+
* color styling tokens will not be applied to the image.
|
|
26
|
+
*/
|
|
27
|
+
icon?: SVG;
|
|
28
|
+
/**
|
|
29
|
+
* Label of the option to be shown in the select's listbox.
|
|
30
|
+
*/
|
|
31
|
+
label: string;
|
|
32
|
+
/**
|
|
33
|
+
* Value of the option. It should be unique and
|
|
34
|
+
* not an empty string, which is reserved to the empty option added
|
|
35
|
+
* by optional prop.
|
|
36
|
+
*/
|
|
37
|
+
value: string;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
type Props = {
|
|
41
|
+
/**
|
|
42
|
+
* Text to be placed above the select.
|
|
43
|
+
*/
|
|
44
|
+
label?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Name attribute of the input element. This attribute will allow users
|
|
47
|
+
* to find the component's value during the submit event. In this event,
|
|
48
|
+
* the component's value will always be a regular string, for both single
|
|
49
|
+
* and multiple selection modes, been in the first one a single option
|
|
50
|
+
* value and in the multiple variant more than one option value,
|
|
51
|
+
* separated by commas.
|
|
52
|
+
*/
|
|
53
|
+
name?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Value of the select. If undefined, the component will be uncontrolled
|
|
56
|
+
* and the value will be managed internally by the component.
|
|
57
|
+
*/
|
|
58
|
+
value?: string | string[];
|
|
59
|
+
/**
|
|
60
|
+
* An array of objects representing the selectable options.
|
|
61
|
+
*/
|
|
62
|
+
options?: Option[] | OptionGroup[];
|
|
63
|
+
/**
|
|
64
|
+
* Helper text to be placed above the select.
|
|
65
|
+
*/
|
|
66
|
+
helperText?: string;
|
|
67
|
+
/**
|
|
68
|
+
* Text to be put as placeholder of the select.
|
|
69
|
+
*/
|
|
70
|
+
placeholder?: string;
|
|
71
|
+
/**
|
|
72
|
+
* If true, the component will be disabled.
|
|
73
|
+
*/
|
|
74
|
+
disabled?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* If true, the select will be optional, showing '(Optional)'
|
|
77
|
+
* next to the label and adding a default first option with empty value, been
|
|
78
|
+
* the placeholder (if defined) its label. Otherwise, the field will be
|
|
79
|
+
* considered required and an error will be passed as a parameter to the
|
|
80
|
+
* OnBlur and onChange functions if an option wasn't selected.
|
|
81
|
+
*/
|
|
82
|
+
optional?: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* If true, enables search functionality.
|
|
85
|
+
*/
|
|
86
|
+
searchable?: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* If true, the select component will support multiple selected options.
|
|
89
|
+
* In that case, value will be an array of strings with each selected
|
|
90
|
+
* option value.
|
|
91
|
+
*/
|
|
92
|
+
multiple?: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* This function will be called when the user selects an option.
|
|
95
|
+
* An object including the current value and the error (if the value entered is not valid)
|
|
96
|
+
* will be passed to this function. If there is no error, error will be null.
|
|
97
|
+
*/
|
|
98
|
+
onChange?: (value: string | string[]) => void;
|
|
99
|
+
/**
|
|
100
|
+
* This function will be called when the select loses the focus. An
|
|
101
|
+
* object including the value (or values) and the error (if the value
|
|
102
|
+
* selected is not valid) will be passed to this function. If there is no error,
|
|
103
|
+
* error will be null.
|
|
104
|
+
*/
|
|
105
|
+
onBlur?: (val: { value: string | string[]; error: string }) => void;
|
|
106
|
+
/**
|
|
107
|
+
* If it is defined, the component will change its appearance, showing
|
|
108
|
+
* the error below the select component. If it is not defined, the error
|
|
109
|
+
* messages will be managed internally, but never displayed on its own.
|
|
110
|
+
*/
|
|
111
|
+
error?: string;
|
|
112
|
+
/**
|
|
113
|
+
* Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
|
|
114
|
+
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
|
|
115
|
+
*/
|
|
116
|
+
margin?: Space | Margin;
|
|
117
|
+
/**
|
|
118
|
+
* Size of the component ('small' | 'medium' | 'large' | 'fillParent').
|
|
119
|
+
*/
|
|
120
|
+
size?: "small" | "medium" | "large" | "fillParent";
|
|
121
|
+
/**
|
|
122
|
+
* Value of the tabindex attribute.
|
|
123
|
+
*/
|
|
124
|
+
tabIndex?: number;
|
|
125
|
+
/**
|
|
126
|
+
* Reference to the component.
|
|
127
|
+
*/
|
|
128
|
+
ref?: React.RefObject<HTMLDivElement>;
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
export default function DxcSelect(props: Props): JSX.Element;
|
|
@@ -26,7 +26,7 @@ var _useTheme = _interopRequireDefault(require("../useTheme.js"));
|
|
|
26
26
|
var _BackgroundColorContext = require("../BackgroundColorContext.js");
|
|
27
27
|
|
|
28
28
|
function _templateObject4() {
|
|
29
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n letter-spacing: ", ";\n text-transform: ", ";\n text-decoration: ", ";\n margin: ", ";\n cursor: pointer;\n"]);
|
|
29
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n letter-spacing: ", ";\n text-transform: ", ";\n text-decoration: ", ";\n margin: ", ";\n cursor: pointer;\n\n :focus-visible {\n outline: 2px solid ", ";\n outline-offset: 1px;\n }\n"]);
|
|
30
30
|
|
|
31
31
|
_templateObject4 = function _templateObject4() {
|
|
32
32
|
return data;
|
|
@@ -36,7 +36,7 @@ function _templateObject4() {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
function _templateObject3() {
|
|
39
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n letter-spacing: ", ";\n text-transform: ", ";\n margin-
|
|
39
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n letter-spacing: ", ";\n text-transform: ", ";\n margin-bottom: 4px;\n"]);
|
|
40
40
|
|
|
41
41
|
_templateObject3 = function _templateObject3() {
|
|
42
42
|
return data;
|
|
@@ -46,7 +46,7 @@ function _templateObject3() {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
function _templateObject2() {
|
|
49
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n letter-spacing: ", ";\n text-transform: ", ";\n margin:
|
|
49
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n letter-spacing: ", ";\n text-transform: ", ";\n margin-bottom: 16px;\n"]);
|
|
50
50
|
|
|
51
51
|
_templateObject2 = function _templateObject2() {
|
|
52
52
|
return data;
|
|
@@ -56,7 +56,7 @@ function _templateObject2() {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
function _templateObject() {
|
|
59
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n background-color: ", ";\n max-width: 300px;\n width: ", ";\n padding: ", ";\n\n overflow-y: auto;\n overflow-x: hidden;\n ::-webkit-scrollbar {\n width: 2px;\n }\n ::-webkit-scrollbar-track {\n background-color: ", ";\n border-radius: 3px;\n }\n ::-webkit-scrollbar-thumb {\n background-color: ", ";\n border-radius: 3px;\n }\n
|
|
59
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n background-color: ", ";\n max-width: 300px;\n width: ", ";\n padding: ", ";\n\n overflow-y: auto;\n overflow-x: hidden;\n ::-webkit-scrollbar {\n width: 2px;\n }\n ::-webkit-scrollbar-track {\n background-color: ", ";\n border-radius: 3px;\n }\n ::-webkit-scrollbar-thumb {\n background-color: ", ";\n border-radius: 3px;\n }\n"]);
|
|
60
60
|
|
|
61
61
|
_templateObject = function _templateObject() {
|
|
62
62
|
return data;
|
|
@@ -160,6 +160,8 @@ var SideNavMenuLink = _styledComponents["default"].a(_templateObject4(), functio
|
|
|
160
160
|
return props.theme.linkTextDecoration;
|
|
161
161
|
}, function (props) {
|
|
162
162
|
return "".concat(props.theme.linkMarginTop, " ").concat(props.theme.linkMarginRight, " ").concat(props.theme.linkMarginBottom, " ").concat(props.theme.linkMarginLeft);
|
|
163
|
+
}, function (props) {
|
|
164
|
+
return props.theme.linkFocusColor;
|
|
163
165
|
});
|
|
164
166
|
|
|
165
167
|
DxcSidenav.propTypes = {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
2
|
+
type Padding = {
|
|
3
|
+
top?: Space;
|
|
4
|
+
bottom?: Space;
|
|
5
|
+
left?: Space;
|
|
6
|
+
right?: Space;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
type Props = {
|
|
10
|
+
padding?: Space | Padding;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default function DxcSidenav(props: Props): JSX.Element;
|
|
@@ -25,7 +25,7 @@ var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
|
25
25
|
|
|
26
26
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
27
27
|
|
|
28
|
-
var
|
|
28
|
+
var _TextInput = _interopRequireDefault(require("../text-input/TextInput"));
|
|
29
29
|
|
|
30
30
|
var _variables = require("../common/variables.js");
|
|
31
31
|
|
|
@@ -35,9 +35,39 @@ var _useTheme = _interopRequireDefault(require("../useTheme.js"));
|
|
|
35
35
|
|
|
36
36
|
var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext.js"));
|
|
37
37
|
|
|
38
|
-
function
|
|
38
|
+
function _templateObject7() {
|
|
39
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n margin-left: ", ";\n label + .MuiInput-formControl {\n margin-top: 2px;\n }\n max-width: 70px;\n"]);
|
|
40
|
+
|
|
41
|
+
_templateObject7 = function _templateObject7() {
|
|
42
|
+
return data;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
return data;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function _templateObject6() {
|
|
39
49
|
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n letter-spacing: ", ";\n margin-left: ", ";\n"]);
|
|
40
50
|
|
|
51
|
+
_templateObject6 = function _templateObject6() {
|
|
52
|
+
return data;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
return data;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function _templateObject5() {
|
|
59
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n letter-spacing: ", ";\n margin-right: ", ";\n"]);
|
|
60
|
+
|
|
61
|
+
_templateObject5 = function _templateObject5() {
|
|
62
|
+
return data;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
return data;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function _templateObject4() {
|
|
69
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n height: 48px;\n align-items: center;\n\n .MultiSlider-root {\n display: flex;\n align-items: center;\n }\n .MuiSlider-container {\n padding: 30px 24px;\n }\n .MuiSlider-root.Mui-disabled {\n color: ", ";\n cursor: not-allowed;\n }\n .Mui-disabled {\n & .MuiSlider-thumb {\n height: ", ";\n width: ", ";\n background-color: ", ";\n top: ", ";\n }\n & .MuiSlider-track {\n background-color: ", ";\n }\n & .MuiSlider-rail {\n background-color: ", ";\n }\n & > .MuiSlider-mark.MuiSlider-markActive {\n background-color: ", " !important;\n }\n & > .MuiSlider-mark {\n background-color: ", ";\n height: ", ";\n width: ", ";\n border-radius: 18px;\n top: ", ";\n }\n }\n .MuiSlider-thumb {\n height: ", ";\n width: ", ";\n background-color: ", ";\n top: ", ";\n border-radius: 9999px;\n\n :hover,\n &.Mui-focusVisible {\n box-shadow: none;\n }\n &.MuiSlider-active {\n box-shadow: none;\n }\n :focus {\n outline: ", "\n auto 1px;\n outline-offset: 2px;\n background-color: ", ";\n }\n :hover {\n background-color: ", ";\n transform: scale(", ");\n transform-origin: center;\n height: ", ";\n width: ", ";\n top: ", ";\n }\n :active {\n background-color: ", ";\n transform: scale(", ");\n transform-origin: center;\n }\n }\n .MuiSlider-track {\n background-color: ", ";\n height: ", ";\n top: ", ";\n border-radius: 9999px;\n }\n .MuiSlider-track.MuiSlider-trackAfter {\n background-color: ", ";\n }\n .MuiSlider-rail {\n background-color: ", ";\n height: ", ";\n top: ", ";\n }\n .MuiSlider-mark.MuiSlider-markActive {\n background-color: ", ";\n }\n .MuiSlider-mark {\n background-color: ", ";\n height: ", ";\n width: ", ";\n border-radius: 18px;\n top: ", ";\n }\n"]);
|
|
70
|
+
|
|
41
71
|
_templateObject4 = function _templateObject4() {
|
|
42
72
|
return data;
|
|
43
73
|
};
|
|
@@ -46,7 +76,7 @@ function _templateObject4() {
|
|
|
46
76
|
}
|
|
47
77
|
|
|
48
78
|
function _templateObject3() {
|
|
49
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
79
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n"]);
|
|
50
80
|
|
|
51
81
|
_templateObject3 = function _templateObject3() {
|
|
52
82
|
return data;
|
|
@@ -56,7 +86,7 @@ function _templateObject3() {
|
|
|
56
86
|
}
|
|
57
87
|
|
|
58
88
|
function _templateObject2() {
|
|
59
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
89
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n"]);
|
|
60
90
|
|
|
61
91
|
_templateObject2 = function _templateObject2() {
|
|
62
92
|
return data;
|
|
@@ -66,7 +96,7 @@ function _templateObject2() {
|
|
|
66
96
|
}
|
|
67
97
|
|
|
68
98
|
function _templateObject() {
|
|
69
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
99
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n width: ", ";\n"]);
|
|
70
100
|
|
|
71
101
|
_templateObject = function _templateObject() {
|
|
72
102
|
return data;
|
|
@@ -76,7 +106,9 @@ function _templateObject() {
|
|
|
76
106
|
}
|
|
77
107
|
|
|
78
108
|
var DxcSlider = function DxcSlider(_ref) {
|
|
79
|
-
var
|
|
109
|
+
var label = _ref.label,
|
|
110
|
+
helperText = _ref.helperText,
|
|
111
|
+
_ref$minValue = _ref.minValue,
|
|
80
112
|
minValue = _ref$minValue === void 0 ? 0 : _ref$minValue,
|
|
81
113
|
_ref$maxValue = _ref.maxValue,
|
|
82
114
|
maxValue = _ref$maxValue === void 0 ? 100 : _ref$maxValue,
|
|
@@ -128,20 +160,31 @@ var DxcSlider = function DxcSlider(_ref) {
|
|
|
128
160
|
};
|
|
129
161
|
|
|
130
162
|
var handlerInputChange = function handlerInputChange(event) {
|
|
163
|
+
var intValue = parseInt(event.value, 10);
|
|
164
|
+
|
|
131
165
|
if (value == null) {
|
|
132
|
-
|
|
166
|
+
if (!Number.isNaN(intValue)) {
|
|
167
|
+
setInnerValue(intValue > maxValue ? maxValue : intValue);
|
|
168
|
+
} else {
|
|
169
|
+
setInnerValue("");
|
|
170
|
+
}
|
|
133
171
|
}
|
|
134
172
|
|
|
135
173
|
if (typeof onChange === "function") {
|
|
136
|
-
|
|
174
|
+
if (!Number.isNaN(intValue)) {
|
|
175
|
+
onChange(intValue > maxValue ? maxValue : intValue);
|
|
176
|
+
} else {
|
|
177
|
+
onChange("");
|
|
178
|
+
}
|
|
137
179
|
}
|
|
138
180
|
};
|
|
139
181
|
|
|
140
182
|
return _react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
141
183
|
theme: colorsTheme.slider
|
|
142
|
-
}, _react["default"].createElement(
|
|
184
|
+
}, _react["default"].createElement(Container, {
|
|
143
185
|
margin: margin,
|
|
144
|
-
size: size
|
|
186
|
+
size: size
|
|
187
|
+
}, _react["default"].createElement(Label, null, label), _react["default"].createElement(HelperText, null, helperText), _react["default"].createElement(SliderContainer, {
|
|
145
188
|
backgroundType: backgroundType
|
|
146
189
|
}, showLimitsValues && _react["default"].createElement(MinLabelContainer, {
|
|
147
190
|
backgroundType: backgroundType,
|
|
@@ -161,13 +204,13 @@ var DxcSlider = function DxcSlider(_ref) {
|
|
|
161
204
|
backgroundType: backgroundType,
|
|
162
205
|
disabled: disabled,
|
|
163
206
|
step: step
|
|
164
|
-
}, maxLabel), showInput && _react["default"].createElement(StyledTextInput, null, _react["default"].createElement(
|
|
207
|
+
}, maxLabel), showInput && _react["default"].createElement(StyledTextInput, null, _react["default"].createElement(_TextInput["default"], {
|
|
165
208
|
name: name,
|
|
166
209
|
value: value != null && value >= 0 && value || innerValue,
|
|
167
210
|
disabled: disabled,
|
|
168
211
|
onChange: handlerInputChange,
|
|
169
|
-
size: "
|
|
170
|
-
}))));
|
|
212
|
+
size: "fillParent"
|
|
213
|
+
})))));
|
|
171
214
|
};
|
|
172
215
|
|
|
173
216
|
var sizes = {
|
|
@@ -180,9 +223,7 @@ var calculateWidth = function calculateWidth(margin, size) {
|
|
|
180
223
|
return size === "fillParent" ? "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")") : sizes[size];
|
|
181
224
|
};
|
|
182
225
|
|
|
183
|
-
var
|
|
184
|
-
|
|
185
|
-
var SliderContainer = _styledComponents["default"].div(_templateObject2(), function (props) {
|
|
226
|
+
var Container = _styledComponents["default"].div(_templateObject(), function (props) {
|
|
186
227
|
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
187
228
|
}, function (props) {
|
|
188
229
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
|
|
@@ -194,7 +235,37 @@ var SliderContainer = _styledComponents["default"].div(_templateObject2(), funct
|
|
|
194
235
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
195
236
|
}, function (props) {
|
|
196
237
|
return calculateWidth(props.margin, props.size);
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
var Label = _styledComponents["default"].label(_templateObject2(), function (props) {
|
|
241
|
+
return props.theme.labelFontColor;
|
|
242
|
+
}, function (props) {
|
|
243
|
+
return props.theme.labelFontFamily;
|
|
244
|
+
}, function (props) {
|
|
245
|
+
return props.theme.labelFontSize;
|
|
246
|
+
}, function (props) {
|
|
247
|
+
return props.theme.labelFontStyle;
|
|
248
|
+
}, function (props) {
|
|
249
|
+
return props.theme.labelFontWeight;
|
|
250
|
+
}, function (props) {
|
|
251
|
+
return props.theme.labelLineHeight;
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
var HelperText = _styledComponents["default"].span(_templateObject3(), function (props) {
|
|
255
|
+
return props.theme.helperTextFontColor;
|
|
197
256
|
}, function (props) {
|
|
257
|
+
return props.theme.helperTextFontFamily;
|
|
258
|
+
}, function (props) {
|
|
259
|
+
return props.theme.helperTextFontSize;
|
|
260
|
+
}, function (props) {
|
|
261
|
+
return props.theme.helperTextFontstyle;
|
|
262
|
+
}, function (props) {
|
|
263
|
+
return props.theme.helperTextFontWeight;
|
|
264
|
+
}, function (props) {
|
|
265
|
+
return props.theme.helperTextLineHeight;
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
var SliderContainer = _styledComponents["default"].div(_templateObject4(), function (props) {
|
|
198
269
|
return props.backgroundType === "dark" ? props.theme.disabledThumbBackgroundColorOnDark : props.theme.disabledThumbBackgroundColor;
|
|
199
270
|
}, function (props) {
|
|
200
271
|
return props.theme.thumbHeight;
|
|
@@ -234,6 +305,12 @@ var SliderContainer = _styledComponents["default"].div(_templateObject2(), funct
|
|
|
234
305
|
return props.backgroundType === "dark" ? props.theme.hoverThumbBackgroundColorOnDark : props.theme.hoverThumbBackgroundColor;
|
|
235
306
|
}, function (props) {
|
|
236
307
|
return props.theme.hoverThumbScale;
|
|
308
|
+
}, function (props) {
|
|
309
|
+
return props.theme.hoverThumbHeight;
|
|
310
|
+
}, function (props) {
|
|
311
|
+
return props.theme.hoverThumbWidth;
|
|
312
|
+
}, function (props) {
|
|
313
|
+
return props.theme.hoverThumbVerticalPosition;
|
|
237
314
|
}, function (props) {
|
|
238
315
|
return props.backgroundType === "dark" ? props.theme.activeThumbBackgroundColorOnDark : props.theme.activeThumbBackgroundColor;
|
|
239
316
|
}, function (props) {
|
|
@@ -264,7 +341,7 @@ var SliderContainer = _styledComponents["default"].div(_templateObject2(), funct
|
|
|
264
341
|
return props.theme.tickVerticalPosition;
|
|
265
342
|
});
|
|
266
343
|
|
|
267
|
-
var MinLabelContainer = _styledComponents["default"].span(
|
|
344
|
+
var MinLabelContainer = _styledComponents["default"].span(_templateObject5(), function (props) {
|
|
268
345
|
return props.theme.fontFamily;
|
|
269
346
|
}, function (props) {
|
|
270
347
|
return props.theme.fontSize;
|
|
@@ -276,9 +353,11 @@ var MinLabelContainer = _styledComponents["default"].span(_templateObject3(), fu
|
|
|
276
353
|
return props.disabled ? props.theme.disabledFontColor : props.backgroundType === "dark" ? props.theme.fontColorOnDark : props.theme.fontColor;
|
|
277
354
|
}, function (props) {
|
|
278
355
|
return props.theme.fontLetterSpacing;
|
|
356
|
+
}, function (props) {
|
|
357
|
+
return props.theme.floorLabelMarginRight;
|
|
279
358
|
});
|
|
280
359
|
|
|
281
|
-
var MaxLabelContainer = _styledComponents["default"].span(
|
|
360
|
+
var MaxLabelContainer = _styledComponents["default"].span(_templateObject6(), function (props) {
|
|
282
361
|
return props.theme.fontFamily;
|
|
283
362
|
}, function (props) {
|
|
284
363
|
return props.theme.fontSize;
|
|
@@ -291,10 +370,16 @@ var MaxLabelContainer = _styledComponents["default"].span(_templateObject4(), fu
|
|
|
291
370
|
}, function (props) {
|
|
292
371
|
return props.theme.fontLetterSpacing;
|
|
293
372
|
}, function (props) {
|
|
294
|
-
return props.step === 1 ?
|
|
373
|
+
return props.step === 1 ? props.theme.ceilLabelMarginLeft : "1.25rem";
|
|
374
|
+
});
|
|
375
|
+
|
|
376
|
+
var StyledTextInput = _styledComponents["default"].div(_templateObject7(), function (props) {
|
|
377
|
+
return props.theme.inputMarginLeft;
|
|
295
378
|
});
|
|
296
379
|
|
|
297
380
|
DxcSlider.propTypes = {
|
|
381
|
+
label: _propTypes["default"].string,
|
|
382
|
+
helperText: _propTypes["default"].string,
|
|
298
383
|
size: _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(sizes))),
|
|
299
384
|
minValue: _propTypes["default"].number,
|
|
300
385
|
maxValue: _propTypes["default"].number,
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
type Size = "small" | "medium" | "large" | "fillParent";
|
|
2
|
+
type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
3
|
+
type Margin = {
|
|
4
|
+
top?: Space;
|
|
5
|
+
bottom?: Space;
|
|
6
|
+
left?: Space;
|
|
7
|
+
right?: Space;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
type Props = {
|
|
11
|
+
label?: string;
|
|
12
|
+
helperText?: string;
|
|
13
|
+
minValue?: number;
|
|
14
|
+
maxValue?: number;
|
|
15
|
+
step?: number;
|
|
16
|
+
value?: number;
|
|
17
|
+
showLimitsValues?: boolean;
|
|
18
|
+
showInput?: boolean;
|
|
19
|
+
name?: string;
|
|
20
|
+
onChange?: void;
|
|
21
|
+
onDragEnd?: void;
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
marks?: boolean;
|
|
24
|
+
labelFormatCallback?: void;
|
|
25
|
+
margin?: Space | Margin;
|
|
26
|
+
size?: Size;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export default function DxcSlider(props: Props): JSX.Element;
|
|
File without changes
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
2
|
+
type Margin = {
|
|
3
|
+
top?: Space;
|
|
4
|
+
bottom?: Space;
|
|
5
|
+
left?: Space;
|
|
6
|
+
right?: Space;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
type Props = {
|
|
10
|
+
label?: string;
|
|
11
|
+
value?: number;
|
|
12
|
+
showValue?: boolean;
|
|
13
|
+
mode?: "large" | "small" | "overlay";
|
|
14
|
+
margin?: Space | Margin;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default function DxcSpinner(props: Props): JSX.Element;
|
|
File without changes
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
type Size = "small" | "medium" | "large" | "fillParent" | "fitContent";
|
|
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
|
+
checked?: boolean;
|
|
12
|
+
value?: any;
|
|
13
|
+
label?: string;
|
|
14
|
+
labelPosition?: "before" | "after";
|
|
15
|
+
name?: string,
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
onChange?: void;
|
|
18
|
+
required?: boolean;
|
|
19
|
+
margin?: Space | Margin;
|
|
20
|
+
size?: Size;
|
|
21
|
+
tabIndex?: number;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default function DxcSwitch(props: Props): JSX.Element;
|
|
File without changes
|
package/table/index.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
2
|
+
type Margin = {
|
|
3
|
+
top?: Space;
|
|
4
|
+
bottom?: Space;
|
|
5
|
+
left?: Space;
|
|
6
|
+
right?: Space;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
type Props = {
|
|
10
|
+
margin?: Space | Margin;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default function DxcTable(props: Props): JSX.Element;
|
|
File without changes
|
package/tabs/index.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
|
|
2
|
+
type Margin = {
|
|
3
|
+
top?: Space;
|
|
4
|
+
bottom?: Space;
|
|
5
|
+
left?: Space;
|
|
6
|
+
right?: Space;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
type Props = {
|
|
10
|
+
activeTabIndex?: number;
|
|
11
|
+
tabs?: any;
|
|
12
|
+
onTabClick?: void;
|
|
13
|
+
onTabHover?: void;
|
|
14
|
+
iconPosition?: "top" | "left";
|
|
15
|
+
margin?: Space | Margin;
|
|
16
|
+
tabIndex?: number;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export default function DxcTabs(props: Props): JSX.Element;
|