@dxc-technology/halstack-react 0.0.0-beebecd → 0.0.0-c060fff

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.
Files changed (231) hide show
  1. package/{dist/BackgroundColorContext.js → BackgroundColorContext.js} +0 -0
  2. package/{dist/ThemeContext.js → ThemeContext.js} +40 -38
  3. package/{dist/select/Select.js → V3Select/V3Select.js} +5 -5
  4. package/V3Select/index.d.ts +27 -0
  5. package/{dist/textarea/Textarea.js → V3Textarea/V3Textarea.js} +4 -4
  6. package/V3Textarea/index.d.ts +27 -0
  7. package/{dist/accordion → accordion}/Accordion.js +0 -0
  8. package/accordion/index.d.ts +28 -0
  9. package/{dist/accordion-group → accordion-group}/AccordionGroup.js +0 -0
  10. package/accordion-group/index.d.ts +16 -0
  11. package/{dist/alert → alert}/Alert.js +1 -1
  12. package/{dist/alert → alert}/index.d.ts +0 -0
  13. package/{dist/badge → badge}/Badge.js +0 -0
  14. package/{dist/box → box}/Box.js +0 -0
  15. package/box/index.d.ts +25 -0
  16. package/{dist/button → button}/Button.js +3 -3
  17. package/button/Button.stories.js +27 -0
  18. package/button/index.d.ts +24 -0
  19. package/{dist/card → card}/Card.js +0 -0
  20. package/card/index.d.ts +22 -0
  21. package/{dist/checkbox → checkbox}/Checkbox.js +4 -5
  22. package/checkbox/index.d.ts +24 -0
  23. package/{dist/chip → chip}/Chip.js +0 -0
  24. package/chip/index.d.ts +22 -0
  25. package/{dist/common → common}/OpenSans.css +0 -0
  26. package/{dist/common → common}/RequiredComponent.js +0 -0
  27. package/{dist/common → common}/fonts/OpenSans-Bold.ttf +0 -0
  28. package/{dist/common → common}/fonts/OpenSans-BoldItalic.ttf +0 -0
  29. package/{dist/common → common}/fonts/OpenSans-ExtraBold.ttf +0 -0
  30. package/{dist/common → common}/fonts/OpenSans-ExtraBoldItalic.ttf +0 -0
  31. package/{dist/common → common}/fonts/OpenSans-Italic.ttf +0 -0
  32. package/{dist/common → common}/fonts/OpenSans-Light.ttf +0 -0
  33. package/{dist/common → common}/fonts/OpenSans-LightItalic.ttf +0 -0
  34. package/{dist/common → common}/fonts/OpenSans-Regular.ttf +0 -0
  35. package/{dist/common → common}/fonts/OpenSans-SemiBold.ttf +0 -0
  36. package/{dist/common → common}/fonts/OpenSans-SemiBoldItalic.ttf +0 -0
  37. package/{dist/common → common}/utils.js +0 -0
  38. package/{dist/common → common}/variables.js +133 -128
  39. package/{dist/date → date}/Date.js +0 -0
  40. package/date/index.d.ts +27 -0
  41. package/{dist/date-input → date-input}/DateInput.js +0 -0
  42. package/{dist/date-input → date-input}/index.d.ts +0 -0
  43. package/{dist/dialog → dialog}/Dialog.js +0 -0
  44. package/dialog/index.d.ts +18 -0
  45. package/{dist/dropdown → dropdown}/Dropdown.js +0 -0
  46. package/dropdown/index.d.ts +26 -0
  47. package/{dist/file-input → file-input}/FileInput.js +2 -2
  48. package/{dist/file-input → file-input}/FileItem.js +8 -1
  49. package/{dist/file-input → file-input}/index.d.ts +1 -1
  50. package/{dist/footer → footer}/Footer.js +44 -18
  51. package/footer/Icons.js +77 -0
  52. package/footer/index.d.ts +25 -0
  53. package/{dist/header → header}/Header.js +122 -55
  54. package/header/Icons.js +59 -0
  55. package/header/index.d.ts +25 -0
  56. package/{dist/heading → heading}/Heading.js +12 -0
  57. package/heading/index.d.ts +17 -0
  58. package/input-text/Icons.js +22 -0
  59. package/{dist/input-text → input-text}/InputText.js +7 -9
  60. package/input-text/index.d.ts +36 -0
  61. package/{dist/layout → layout}/ApplicationLayout.js +4 -8
  62. package/layout/Icons.js +55 -0
  63. package/{dist/link → link}/Link.js +0 -0
  64. package/link/index.d.ts +23 -0
  65. package/main.d.ts +40 -0
  66. package/{dist/main.js → main.js} +13 -21
  67. package/{dist/number-input → number-input}/NumberInput.js +0 -0
  68. package/{dist/number-input → number-input}/NumberInputContext.js +0 -0
  69. package/{dist/number-input → number-input}/index.d.ts +0 -0
  70. package/package.json +21 -17
  71. package/paginator/Icons.js +66 -0
  72. package/{dist/paginator → paginator}/Paginator.js +53 -37
  73. package/paginator/index.d.ts +20 -0
  74. package/{dist/password-input → password-input}/PasswordInput.js +6 -1
  75. package/{dist/password-input → password-input}/index.d.ts +0 -0
  76. package/{dist/progress-bar → progress-bar}/ProgressBar.js +0 -0
  77. package/progress-bar/index.d.ts +18 -0
  78. package/{dist/radio → radio}/Radio.js +0 -0
  79. package/radio/index.d.ts +23 -0
  80. package/{dist/resultsetTable → resultsetTable}/ResultsetTable.js +0 -0
  81. package/resultsetTable/index.d.ts +19 -0
  82. package/select/Select.js +1137 -0
  83. package/select/index.d.ts +131 -0
  84. package/{dist/sidenav → sidenav}/Sidenav.js +0 -0
  85. package/sidenav/index.d.ts +13 -0
  86. package/{dist/slider → slider}/Slider.js +16 -6
  87. package/slider/index.d.ts +29 -0
  88. package/{dist/spinner → spinner}/Spinner.js +0 -0
  89. package/spinner/index.d.ts +17 -0
  90. package/{dist/switch → switch}/Switch.js +0 -0
  91. package/switch/index.d.ts +24 -0
  92. package/{dist/table → table}/Table.js +0 -0
  93. package/table/index.d.ts +13 -0
  94. package/{dist/tabs → tabs}/Tabs.js +0 -0
  95. package/tabs/index.d.ts +19 -0
  96. package/{dist/tag → tag}/Tag.js +0 -0
  97. package/tag/index.d.ts +24 -0
  98. package/{dist/text-input → text-input}/TextInput.js +10 -7
  99. package/{dist/text-input → text-input}/index.d.ts +0 -0
  100. package/{dist/new-textarea/NewTextarea.js → textarea/Textarea.js} +6 -6
  101. package/{dist/new-textarea → textarea}/index.d.ts +1 -1
  102. package/{dist/toggle → toggle}/Toggle.js +0 -0
  103. package/toggle/index.d.ts +21 -0
  104. package/{dist/toggle-group → toggle-group}/ToggleGroup.js +0 -0
  105. package/toggle-group/index.d.ts +21 -0
  106. package/{dist/upload → upload}/Upload.js +0 -0
  107. package/{dist/upload → upload}/buttons-upload/ButtonsUpload.js +7 -11
  108. package/upload/buttons-upload/Icons.js +40 -0
  109. package/{dist/upload → upload}/dragAndDropArea/DragAndDropArea.js +14 -14
  110. package/upload/dragAndDropArea/Icons.js +39 -0
  111. package/{dist/upload → upload}/file-upload/FileToUpload.js +26 -21
  112. package/upload/file-upload/Icons.js +66 -0
  113. package/{dist/upload → upload}/files-upload/FilesToUpload.js +0 -0
  114. package/upload/index.d.ts +15 -0
  115. package/upload/transaction/Icons.js +160 -0
  116. package/{dist/upload → upload}/transaction/Transaction.js +11 -38
  117. package/{dist/upload → upload}/transactions/Transactions.js +0 -0
  118. package/{dist/useTheme.js → useTheme.js} +0 -0
  119. package/wizard/Icons.js +65 -0
  120. package/{dist/wizard → wizard}/Wizard.js +3 -9
  121. package/wizard/index.d.ts +18 -0
  122. package/README.md +0 -66
  123. package/babel.config.js +0 -8
  124. package/dist/checkbox/Checkbox.stories.js +0 -144
  125. package/dist/checkbox/readme.md +0 -116
  126. package/dist/date/Date.stories.js +0 -205
  127. package/dist/date/readme.md +0 -73
  128. package/dist/footer/dxc_logo.svg +0 -15
  129. package/dist/footer/readme.md +0 -41
  130. package/dist/header/Header.stories.js +0 -176
  131. package/dist/header/close_icon.svg +0 -1
  132. package/dist/header/dxc_logo_black.svg +0 -8
  133. package/dist/header/hamb_menu_black.svg +0 -1
  134. package/dist/header/hamb_menu_white.svg +0 -1
  135. package/dist/header/readme.md +0 -33
  136. package/dist/input-text/error.svg +0 -1
  137. package/dist/input-text/readme.md +0 -91
  138. package/dist/layout/facebook.svg +0 -45
  139. package/dist/layout/linkedin.svg +0 -50
  140. package/dist/layout/twitter.svg +0 -53
  141. package/dist/link/readme.md +0 -51
  142. package/dist/main.d.ts +0 -8
  143. package/dist/new-select/NewSelect.js +0 -836
  144. package/dist/new-select/index.d.ts +0 -53
  145. package/dist/paginator/images/next.svg +0 -3
  146. package/dist/paginator/images/nextPage.svg +0 -3
  147. package/dist/paginator/images/previous.svg +0 -3
  148. package/dist/paginator/images/previousPage.svg +0 -3
  149. package/dist/paginator/readme.md +0 -50
  150. package/dist/progress-bar/ProgressBar.stories.js +0 -280
  151. package/dist/progress-bar/readme.md +0 -63
  152. package/dist/radio/Radio.stories.js +0 -166
  153. package/dist/radio/readme.md +0 -70
  154. package/dist/resultsetTable/arrow_downward-24px_wht.svg +0 -1
  155. package/dist/resultsetTable/arrow_upward-24px_wht.svg +0 -1
  156. package/dist/resultsetTable/unfold_more-24px_wht.svg +0 -1
  157. package/dist/slider/readme.md +0 -64
  158. package/dist/spinner/Spinner.stories.js +0 -183
  159. package/dist/spinner/readme.md +0 -65
  160. package/dist/switch/Switch.stories.js +0 -134
  161. package/dist/switch/readme.md +0 -133
  162. package/dist/tabs/Tabs.stories.js +0 -130
  163. package/dist/tabs/readme.md +0 -78
  164. package/dist/tabs-for-sections/TabsForSections.js +0 -92
  165. package/dist/tabs-for-sections/readme.md +0 -78
  166. package/dist/toggle/Toggle.stories.js +0 -297
  167. package/dist/toggle/readme.md +0 -80
  168. package/dist/upload/Upload.stories.js +0 -72
  169. package/dist/upload/buttons-upload/drag-drop-icon.svg +0 -4
  170. package/dist/upload/buttons-upload/upload-button.svg +0 -1
  171. package/dist/upload/dragAndDropArea/upload_drop.svg +0 -4
  172. package/dist/upload/dragAndDropArea/upload_file.svg +0 -4
  173. package/dist/upload/file-upload/audio-icon.svg +0 -4
  174. package/dist/upload/file-upload/close.svg +0 -4
  175. package/dist/upload/file-upload/file-icon.svg +0 -4
  176. package/dist/upload/file-upload/video-icon.svg +0 -4
  177. package/dist/upload/readme.md +0 -37
  178. package/dist/upload/transaction/audio-icon-err.svg +0 -4
  179. package/dist/upload/transaction/audio-icon.svg +0 -4
  180. package/dist/upload/transaction/error-icon.svg +0 -4
  181. package/dist/upload/transaction/file-icon-err.svg +0 -4
  182. package/dist/upload/transaction/file-icon.svg +0 -4
  183. package/dist/upload/transaction/image-icon-err.svg +0 -4
  184. package/dist/upload/transaction/image-icon.svg +0 -4
  185. package/dist/upload/transaction/success-icon.svg +0 -4
  186. package/dist/upload/transaction/video-icon-err.svg +0 -4
  187. package/dist/upload/transaction/video-icon.svg +0 -4
  188. package/dist/wizard/invalid_icon.svg +0 -5
  189. package/dist/wizard/valid_icon.svg +0 -5
  190. package/dist/wizard/validation-wrong.svg +0 -6
  191. package/test/Accordion.test.js +0 -33
  192. package/test/AccordionGroup.test.js +0 -125
  193. package/test/Alert.test.js +0 -53
  194. package/test/Box.test.js +0 -10
  195. package/test/Button.test.js +0 -18
  196. package/test/Card.test.js +0 -30
  197. package/test/Checkbox.test.js +0 -45
  198. package/test/Chip.test.js +0 -25
  199. package/test/Date.test.js +0 -393
  200. package/test/DateInput.test.js +0 -242
  201. package/test/Dialog.test.js +0 -23
  202. package/test/Dropdown.test.js +0 -145
  203. package/test/FileInput.test.js +0 -201
  204. package/test/Footer.test.js +0 -99
  205. package/test/Header.test.js +0 -39
  206. package/test/Heading.test.js +0 -35
  207. package/test/InputText.test.js +0 -248
  208. package/test/Link.test.js +0 -43
  209. package/test/NewTextarea.test.js +0 -195
  210. package/test/NumberInput.test.js +0 -259
  211. package/test/Paginator.test.js +0 -177
  212. package/test/PasswordInput.test.js +0 -83
  213. package/test/ProgressBar.test.js +0 -35
  214. package/test/Radio.test.js +0 -37
  215. package/test/ResultsetTable.test.js +0 -329
  216. package/test/Select.test.js +0 -212
  217. package/test/Sidenav.test.js +0 -45
  218. package/test/Slider.test.js +0 -82
  219. package/test/Spinner.test.js +0 -32
  220. package/test/Switch.test.js +0 -45
  221. package/test/Table.test.js +0 -36
  222. package/test/Tabs.test.js +0 -109
  223. package/test/TabsForSections.test.js +0 -34
  224. package/test/Tag.test.js +0 -32
  225. package/test/TextArea.test.js +0 -52
  226. package/test/TextInput.test.js +0 -732
  227. package/test/ToggleGroup.test.js +0 -85
  228. package/test/Upload.test.js +0 -60
  229. package/test/Wizard.test.js +0 -130
  230. package/test/mocks/pngMock.js +0 -1
  231. 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;
File without changes
@@ -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 _InputText = _interopRequireDefault(require("../input-text/InputText"));
28
+ var _TextInput = _interopRequireDefault(require("../text-input/TextInput"));
29
29
 
30
30
  var _variables = require("../common/variables.js");
31
31
 
@@ -36,7 +36,7 @@ var _useTheme = _interopRequireDefault(require("../useTheme.js"));
36
36
  var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext.js"));
37
37
 
38
38
  function _templateObject7() {
39
- var data = (0, _taggedTemplateLiteral2["default"])(["\n margin-left: ", ";\n label + .MuiInput-formControl {\n margin-top: 2px;\n }\n"]);
39
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n margin-left: ", ";\n label + .MuiInput-formControl {\n margin-top: 2px;\n }\n max-width: 70px;\n"]);
40
40
 
41
41
  _templateObject7 = function _templateObject7() {
42
42
  return data;
@@ -160,12 +160,22 @@ var DxcSlider = function DxcSlider(_ref) {
160
160
  };
161
161
 
162
162
  var handlerInputChange = function handlerInputChange(event) {
163
+ var intValue = parseInt(event.value, 10);
164
+
163
165
  if (value == null) {
164
- setInnerValue(event > maxValue ? maxValue : event);
166
+ if (!Number.isNaN(intValue)) {
167
+ setInnerValue(intValue > maxValue ? maxValue : intValue);
168
+ } else {
169
+ setInnerValue("");
170
+ }
165
171
  }
166
172
 
167
173
  if (typeof onChange === "function") {
168
- onChange(event > maxValue ? maxValue : event);
174
+ if (!Number.isNaN(intValue)) {
175
+ onChange(intValue > maxValue ? maxValue : intValue);
176
+ } else {
177
+ onChange("");
178
+ }
169
179
  }
170
180
  };
171
181
 
@@ -194,12 +204,12 @@ var DxcSlider = function DxcSlider(_ref) {
194
204
  backgroundType: backgroundType,
195
205
  disabled: disabled,
196
206
  step: step
197
- }, maxLabel), showInput && _react["default"].createElement(StyledTextInput, null, _react["default"].createElement(_InputText["default"], {
207
+ }, maxLabel), showInput && _react["default"].createElement(StyledTextInput, null, _react["default"].createElement(_TextInput["default"], {
198
208
  name: name,
199
209
  value: value != null && value >= 0 && value || innerValue,
200
210
  disabled: disabled,
201
211
  onChange: handlerInputChange,
202
- size: "small"
212
+ size: "fillParent"
203
213
  })))));
204
214
  };
205
215
 
@@ -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
@@ -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
@@ -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;
File without changes
package/tag/index.d.ts ADDED
@@ -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
+ icon?: any;
12
+ iconSrc?: string;
13
+ label?: string;
14
+ linkHref?: string;
15
+ onClick?: void,
16
+ iconBgColor?: string;
17
+ labelPosition?: "before" | "after";
18
+ newWindow?: boolean;
19
+ margin?: Space | Margin;
20
+ size?: Size;
21
+ tabIndex?: number;
22
+ };
23
+
24
+ export default function DxcTag(props: Props): JSX.Element;
@@ -126,7 +126,7 @@ function _templateObject9() {
126
126
  }
127
127
 
128
128
  function _templateObject8() {
129
- var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n height: 24px;\n width: 24px;\n font-size: 1rem;\n font-family: ", ";\n border: 1px solid transparent;\n border-radius: 4px;\n padding: 3px;\n margin-left: calc(1rem * 0.25);\n ", "\n\n box-shadow: 0 0 0 2px transparent;\n background-color: ", ";\n\n color: ", ";\n\n ", "\n\n svg {\n line-height: 18px;\n }\n"]);
129
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n height: 24px;\n width: 24px;\n font-size: 1rem;\n font-family: ", ";\n border: 1px solid transparent;\n border-radius: 2px;\n padding: 3px;\n margin-left: calc(1rem * 0.25);\n ", "\n\n box-shadow: 0 0 0 2px transparent;\n background-color: ", ";\n\n color: ", ";\n\n ", "\n\n svg {\n line-height: 18px;\n }\n"]);
130
130
 
131
131
  _templateObject8 = function _templateObject8() {
132
132
  return data;
@@ -243,6 +243,8 @@ var patternMatch = function patternMatch(pattern, value) {
243
243
  };
244
244
 
245
245
  var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
246
+ var _action$title;
247
+
246
248
  var _ref$label = _ref.label,
247
249
  label = _ref$label === void 0 ? "" : _ref$label,
248
250
  _ref$name = _ref.name,
@@ -649,11 +651,11 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
649
651
  var noMatchedWords = suggestion.replace(regEx, "");
650
652
  return _react["default"].createElement(Suggestion, {
651
653
  id: "suggestion-".concat(index),
652
- onMouseDown: function onMouseDown() {
653
- changeIsActiveSuggestion(true);
654
+ onMouseDown: function onMouseDown(event) {
655
+ event.button === 0 && changeIsActiveSuggestion(true);
654
656
  },
655
- onMouseUp: function onMouseUp() {
656
- if (isActiveSuggestion) {
657
+ onMouseUp: function onMouseUp(event) {
658
+ if (event.button === 0 && isActiveSuggestion) {
657
659
  changeValue(suggestion);
658
660
  changeIsActiveSuggestion(false);
659
661
  closeSuggestions();
@@ -713,7 +715,7 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
713
715
  tabIndex: tabIndex,
714
716
  role: isTextInputType() && hasInputSuggestions() ? "combobox" : "textbox",
715
717
  "aria-autocomplete": isTextInputType() && hasInputSuggestions() ? "list" : undefined,
716
- "aria-controls": isTextInputType() && hasInputSuggestions() ? inputId : undefined,
718
+ "aria-controls": isTextInputType() && hasInputSuggestions() ? autosuggestId : undefined,
717
719
  "aria-expanded": isTextInputType() && hasInputSuggestions() ? isOpen ? "true" : "false" : undefined,
718
720
  "aria-activedescendant": isTextInputType() && hasInputSuggestions() && isOpen && visualFocusedSuggIndex !== -1 ? "suggestion-".concat(visualFocusedSuggIndex) : undefined,
719
721
  "aria-invalid": error ? "true" : "false",
@@ -745,6 +747,7 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
745
747
  ref: actionRef,
746
748
  disabled: disabled,
747
749
  onClick: action.onClick,
750
+ title: (_action$title = action.title) !== null && _action$title !== void 0 ? _action$title : action.title,
748
751
  backgroundType: backgroundType,
749
752
  tabIndex: tabIndex
750
753
  }, typeof action.icon === "string" ? _react["default"].createElement(ActionIcon, {
@@ -874,7 +877,7 @@ var Action = _styledComponents["default"].button(_templateObject8(), function (p
874
877
  }, function (props) {
875
878
  return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledActionIconColorOnDark : props.theme.disabledActionIconColor : props.backgroundType === "dark" ? props.theme.actionIconColorOnDark : props.theme.actionIconColor;
876
879
  }, function (props) {
877
- return !props.disabled && "\n &:hover {\n background-color: ".concat(props.backgroundType === "dark" ? props.theme.hoverActionBackgroundColorOnDark : props.theme.hoverActionBackgroundColor, ";\n color: ").concat(props.backgroundType === "dark" ? props.theme.hoverActionIconColorOnDark : props.theme.hoverActionIconColor, ";\n }\n &:focus {\n outline: none;\n box-shadow: 0 0 0 2px ").concat(props.backgroundType === "dark" ? props.theme.focusActionBorderColorOnDark : props.theme.focusActionBorderColor, ";\n color: ").concat(props.backgroundType === "dark" ? props.theme.focusActionIconColorOnDark : props.theme.focusActionIconColor, ";\n }\n &:focus-visible {\n outline: none;\n box-shadow: 0 0 0 2px ").concat(props.backgroundType === "dark" ? props.theme.focusActionBorderColorOnDark : props.theme.focusActionBorderColor, ";\n color: ").concat(props.backgroundType === "dark" ? props.theme.focusActionIconColorOnDark : props.theme.focusActionIconColor, ";\n }\n &:active {\n background-color: ").concat(props.backgroundType === "dark" ? props.theme.activeActionBackgroundColorOnDark : props.theme.activeActionBackgroundColor, ";\n color: ").concat(props.backgroundType === "dark" ? props.theme.activeActionIconColorOnDark : props.theme.activeActionIconColor, ";\n }\n ");
880
+ return !props.disabled && "\n &:focus {\n outline: none;\n box-shadow: 0 0 0 2px ".concat(props.backgroundType === "dark" ? props.theme.focusActionBorderColorOnDark : props.theme.focusActionBorderColor, ";\n color: ").concat(props.backgroundType === "dark" ? props.theme.focusActionIconColorOnDark : props.theme.focusActionIconColor, ";\n }\n &:focus-visible {\n outline: none;\n box-shadow: 0 0 0 2px ").concat(props.backgroundType === "dark" ? props.theme.focusActionBorderColorOnDark : props.theme.focusActionBorderColor, ";\n color: ").concat(props.backgroundType === "dark" ? props.theme.focusActionIconColorOnDark : props.theme.focusActionIconColor, ";\n }\n &:hover {\n background-color: ").concat(props.backgroundType === "dark" ? props.theme.hoverActionBackgroundColorOnDark : props.theme.hoverActionBackgroundColor, ";\n color: ").concat(props.backgroundType === "dark" ? props.theme.hoverActionIconColorOnDark : props.theme.hoverActionIconColor, ";\n }\n &:active {\n background-color: ").concat(props.backgroundType === "dark" ? props.theme.activeActionBackgroundColorOnDark : props.theme.activeActionBackgroundColor, ";\n color: ").concat(props.backgroundType === "dark" ? props.theme.activeActionIconColorOnDark : props.theme.activeActionIconColor, ";\n }\n ");
878
881
  });
879
882
 
880
883
  var Prefix = _styledComponents["default"].span(_templateObject9(), function (props) {
File without changes
@@ -109,7 +109,7 @@ var patternMatch = function patternMatch(pattern, value) {
109
109
  return new RegExp(pattern).test(value);
110
110
  };
111
111
 
112
- var DxcNewTextarea = _react["default"].forwardRef(function (_ref, ref) {
112
+ var DxcTextarea = _react["default"].forwardRef(function (_ref, ref) {
113
113
  var _ref$label = _ref.label,
114
114
  label = _ref$label === void 0 ? "" : _ref$label,
115
115
  _ref$name = _ref.name,
@@ -210,8 +210,8 @@ var DxcNewTextarea = _react["default"].forwardRef(function (_ref, ref) {
210
210
  }
211
211
  }, [value, verticalGrow, rows, innerValue]);
212
212
  return _react["default"].createElement(_styledComponents.ThemeProvider, {
213
- theme: colorsTheme.newTextarea
214
- }, _react["default"].createElement(DxcTextarea, {
213
+ theme: colorsTheme.textarea
214
+ }, _react["default"].createElement(TextareaContainer, {
215
215
  margin: margin,
216
216
  size: size,
217
217
  ref: ref
@@ -259,7 +259,7 @@ var calculateWidth = function calculateWidth(margin, size) {
259
259
  return size === "fillParent" ? "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")") : sizes[size];
260
260
  };
261
261
 
262
- var DxcTextarea = _styledComponents["default"].div(_templateObject(), function (props) {
262
+ var TextareaContainer = _styledComponents["default"].div(_templateObject(), function (props) {
263
263
  return calculateWidth(props.margin, props.size);
264
264
  }, function (props) {
265
265
  return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
@@ -337,7 +337,7 @@ var Error = _styledComponents["default"].span(_templateObject6(), function (prop
337
337
  return props.theme.fontFamily;
338
338
  });
339
339
 
340
- DxcNewTextarea.propTypes = {
340
+ DxcTextarea.propTypes = {
341
341
  label: _propTypes["default"].string,
342
342
  name: _propTypes["default"].string,
343
343
  value: _propTypes["default"].string,
@@ -365,5 +365,5 @@ DxcNewTextarea.propTypes = {
365
365
  size: _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(sizes))),
366
366
  tabIndex: _propTypes["default"].number
367
367
  };
368
- var _default = DxcNewTextarea;
368
+ var _default = DxcTextarea;
369
369
  exports["default"] = _default;
@@ -114,4 +114,4 @@ type Props = {
114
114
  ref?: React.RefObject<HTMLDivElement>;
115
115
  };
116
116
 
117
- export default function DxcNewTextarea(props: Props): JSX.Element;
117
+ export default function DxcTextarea(props: Props): JSX.Element;
File without changes
@@ -0,0 +1,21 @@
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
+ helperText?: string;
12
+ value?: any;
13
+ onChange?: void;
14
+ disabled?: boolean,
15
+ options?: any;
16
+ multiple?: boolean;
17
+ margin?: Space | Margin;
18
+ tabIndex?: number;
19
+ };
20
+
21
+ export default function DxcToggle(props: Props): JSX.Element;
@@ -0,0 +1,21 @@
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
+ helperText?: string;
12
+ value?: any;
13
+ onChange?: void;
14
+ disabled?: boolean;
15
+ options?: any;
16
+ multiple?: boolean;
17
+ margin?: Space | Margin;
18
+ tabIndex?: number;
19
+ };
20
+
21
+ export default function DxcToggleGroup(props: Props): JSX.Element;
File without changes
@@ -19,16 +19,14 @@ var _styledComponents = _interopRequireWildcard(require("styled-components"));
19
19
 
20
20
  var _Button = _interopRequireDefault(require("../../button/Button"));
21
21
 
22
- var _uploadButton = _interopRequireDefault(require("./upload-button.svg"));
23
-
24
- var _dragDropIcon = _interopRequireDefault(require("./drag-drop-icon.svg"));
22
+ var _Icons = require("./Icons");
25
23
 
26
24
  var _useTheme = _interopRequireDefault(require("../../useTheme.js"));
27
25
 
28
26
  var _BackgroundColorContext = require("../../BackgroundColorContext.js");
29
27
 
30
28
  function _templateObject3() {
31
- var data = (0, _taggedTemplateLiteral2["default"])(["\n background-color: ", ";\n mask: url(", ") no-repeat center;\n mask-size: ", ";\n height: ", ";\n width: ", ";\n margin-right: 5px;\n"]);
29
+ var data = (0, _taggedTemplateLiteral2["default"])(["\n height: ", ";\n width: ", ";\n margin-right: 5px;\n & svg {\n fill: ", ";\n }\n"]);
32
30
 
33
31
  _templateObject3 = function _templateObject3() {
34
32
  return data;
@@ -81,7 +79,7 @@ var DxcButtonsUpload = function DxcButtonsUpload(_ref) {
81
79
  theme: colorsTheme.upload
82
80
  }, _react["default"].createElement(_BackgroundColorContext.BackgroundColorProvider, {
83
81
  color: colorsTheme.upload.backgroundColor
84
- }, _react["default"].createElement(DXCButtonsUpload, null, _react["default"].createElement(DragAndDropLabel, null, _react["default"].createElement(DragAndDropIcon, null), "Drag and Drop area"), _react["default"].createElement(_Button["default"], {
82
+ }, _react["default"].createElement(DXCButtonsUpload, null, _react["default"].createElement(DragAndDropLabel, null, _react["default"].createElement(DragAndDropIconContainer, null, _Icons.dragAndDropIcon), "Drag and Drop area"), _react["default"].createElement(_Button["default"], {
85
83
  margin: {
86
84
  right: "small"
87
85
  },
@@ -99,7 +97,7 @@ var DxcButtonsUpload = function DxcButtonsUpload(_ref) {
99
97
  }), _react["default"].createElement(_Button["default"], {
100
98
  label: "UPLOAD",
101
99
  iconPosition: "after",
102
- iconSrc: _uploadButton["default"],
100
+ icon: _Icons.uploadIcon,
103
101
  onClick: onUpload
104
102
  }))));
105
103
  };
@@ -125,14 +123,12 @@ var DragAndDropLabel = _styledComponents["default"].div(_templateObject2(), func
125
123
  return props.theme.dragAndDropAreaTextFontColor;
126
124
  });
127
125
 
128
- var DragAndDropIcon = _styledComponents["default"].div(_templateObject3(), function (props) {
129
- return props.theme.dragAndDropAreaIconColor;
130
- }, _dragDropIcon["default"], function (props) {
131
- return "".concat(props.theme.dragAndDropAreaIconSize, " ").concat(props.theme.dragAndDropAreaIconSize);
132
- }, function (props) {
126
+ var DragAndDropIconContainer = _styledComponents["default"].div(_templateObject3(), function (props) {
133
127
  return props.theme.dragAndDropAreaIconSize;
134
128
  }, function (props) {
135
129
  return props.theme.dragAndDropAreaIconSize;
130
+ }, function (props) {
131
+ return props.theme.dragAndDropAreaIconColor;
136
132
  });
137
133
 
138
134
  var _default = DxcButtonsUpload;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.dragAndDropIcon = exports.uploadIcon = void 0;
9
+
10
+ var _react = _interopRequireDefault(require("react"));
11
+
12
+ var uploadIcon = _react["default"].createElement("svg", {
13
+ xmlns: "http://www.w3.org/2000/svg",
14
+ width: "24",
15
+ height: "24",
16
+ viewBox: "0 0 24 24",
17
+ fill: "#FFFFFF"
18
+ }, _react["default"].createElement("path", {
19
+ d: "M0 0h24v24H0z",
20
+ fill: "none"
21
+ }), _react["default"].createElement("path", {
22
+ d: "M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z"
23
+ }));
24
+
25
+ exports.uploadIcon = uploadIcon;
26
+
27
+ var dragAndDropIcon = _react["default"].createElement("svg", {
28
+ xmlns: "http://www.w3.org/2000/svg",
29
+ width: "24",
30
+ height: "24",
31
+ viewBox: "0 0 24 24",
32
+ fill: "#666666"
33
+ }, _react["default"].createElement("path", {
34
+ fill: "none",
35
+ d: "M0 0h24v24H0V0z"
36
+ }), _react["default"].createElement("path", {
37
+ d: "M3 13h2v-2H3v2zm0 4h2v-2H3v2zm2 4v-2H3c0 1.1.89 2 2 2zM3 9h2V7H3v2zm12 12h2v-2h-2v2zm4-18H9c-1.11 0-2 .9-2 2v10c0 1.1.89 2 2 2h10c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 12H9V5h10v10zm-8 6h2v-2h-2v2zm-4 0h2v-2H7v2z"
38
+ }));
39
+
40
+ exports.dragAndDropIcon = dragAndDropIcon;