@dxc-technology/halstack-react 0.0.0-1819a7a → 0.0.0-1853afe

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 (84) hide show
  1. package/BackgroundColorContext.js +0 -1
  2. package/accordion/Accordion.d.ts +1 -1
  3. package/accordion/Accordion.js +9 -20
  4. package/accordion/Accordion.stories.tsx +9 -2
  5. package/accordion/types.d.ts +3 -7
  6. package/accordion-group/types.d.ts +3 -7
  7. package/bleed/Bleed.d.ts +3 -0
  8. package/bleed/Bleed.js +84 -0
  9. package/bleed/Bleed.stories.tsx +342 -0
  10. package/bleed/types.d.ts +13 -0
  11. package/bleed/types.js +5 -0
  12. package/button/Button.d.ts +1 -1
  13. package/button/Button.js +7 -15
  14. package/button/Button.stories.tsx +6 -8
  15. package/button/types.d.ts +3 -7
  16. package/card/Card.stories.tsx +1 -1
  17. package/checkbox/types.d.ts +1 -1
  18. package/chip/Chip.d.ts +1 -1
  19. package/chip/Chip.js +14 -52
  20. package/chip/Chip.stories.tsx +6 -8
  21. package/chip/types.d.ts +5 -13
  22. package/common/variables.js +38 -1
  23. package/date-input/DateInput.js +6 -6
  24. package/dialog/Dialog.js +2 -1
  25. package/dropdown/Dropdown.stories.tsx +247 -0
  26. package/file-input/FileInput.js +102 -33
  27. package/file-input/FileInput.stories.tsx +507 -0
  28. package/footer/Footer.js +18 -20
  29. package/heading/Heading.stories.tsx +3 -2
  30. package/inset/Inset.d.ts +3 -0
  31. package/inset/Inset.js +84 -0
  32. package/inset/Inset.stories.tsx +229 -0
  33. package/inset/types.d.ts +13 -0
  34. package/inset/types.js +5 -0
  35. package/layout/ApplicationLayout.js +1 -1
  36. package/list/List.d.ts +3 -6
  37. package/list/List.js +17 -7
  38. package/list/List.stories.tsx +25 -0
  39. package/list/types.d.ts +7 -0
  40. package/list/types.js +5 -0
  41. package/package.json +4 -2
  42. package/password-input/PasswordInput.stories.tsx +3 -3
  43. package/progress-bar/ProgressBar.js +2 -2
  44. package/radio-group/Radio.d.ts +4 -0
  45. package/radio-group/Radio.js +140 -0
  46. package/radio-group/RadioGroup.d.ts +4 -0
  47. package/radio-group/RadioGroup.js +273 -0
  48. package/radio-group/RadioGroup.stories.tsx +79 -0
  49. package/radio-group/RadioGroup.test.js +248 -0
  50. package/radio-group/types.d.ts +36 -0
  51. package/radio-group/types.js +5 -0
  52. package/resultsetTable/ResultsetTable.js +1 -1
  53. package/resultsetTable/ResultsetTable.stories.tsx +7 -8
  54. package/row/Row.d.ts +3 -11
  55. package/row/Row.js +12 -9
  56. package/row/Row.stories.tsx +20 -6
  57. package/row/types.d.ts +10 -0
  58. package/row/types.js +5 -0
  59. package/select/Select.d.ts +4 -0
  60. package/select/Select.js +5 -5
  61. package/select/types.d.ts +170 -0
  62. package/select/types.js +5 -0
  63. package/sidenav/Sidenav.stories.tsx +18 -1
  64. package/spinner/Spinner.stories.jsx +1 -0
  65. package/stack/Stack.d.ts +3 -10
  66. package/stack/Stack.js +12 -9
  67. package/stack/Stack.stories.tsx +20 -6
  68. package/stack/types.d.ts +9 -0
  69. package/stack/types.js +5 -0
  70. package/switch/Switch.stories.tsx +1 -1
  71. package/table/Table.stories.jsx +2 -1
  72. package/tabs/Tabs.js +7 -7
  73. package/tabs/Tabs.stories.tsx +7 -8
  74. package/tabs/types.d.ts +23 -15
  75. package/tag/Tag.stories.tsx +1 -1
  76. package/text/Text.js +1 -1
  77. package/text-input/TextInput.js +12 -4
  78. package/text-input/TextInput.stories.tsx +4 -4
  79. package/text-input/types.d.ts +1 -1
  80. package/textarea/Textarea.stories.jsx +4 -3
  81. package/toggle-group/ToggleGroup.js +10 -13
  82. package/toggle-group/ToggleGroup.stories.tsx +23 -28
  83. package/toggle-group/types.d.ts +38 -25
  84. package/select/index.d.ts +0 -131
@@ -143,7 +143,24 @@ export const Chromatic = () => (
143
143
  gravida enim. Donec rhoncus aliquam nisl, ac cursus enim bibendum vitae. Nunc sit amet elit ornare,
144
144
  malesuada urna eu, fringilla mauris. Vivamus bibendum turpis est, id elementum purus euismod sit amet. Etiam
145
145
  sit amet maximus augue. Vivamus erat sapien, ultricies fringilla tellus id, condimentum blandit justo.
146
- Praesent quis nunc dignissim, pharetra neque molestie, molestie lectus.
146
+ Praesent quis nunc dignissim, pharetra neque molestie, molestie lectus. Lorem ipsum dolor sit amet,
147
+ consectetur adipiscing elit. Morbi egestas luctus porttitor. Donec massa magna, placerat sit amet felis
148
+ eget, venenatis fringilla ipsum. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec congue
149
+ laoreet orci, nec elementum dolor consequat quis. Curabitur rhoncus justo sed dapibus tincidunt. Vestibulum
150
+ cursus ut risus sit amet congue. Nunc luctus, urna ullamcorper facilisis Jia Le, risus eros aliquam erat, ut
151
+ efficitur ante neque id odio. Nam orci leo, dignissim sit amet dolor ut, congue gravida enim. Donec rhoncus
152
+ aliquam nisl, ac cursus enim bibendum vitae. Nunc sit amet elit ornare, malesuada urna eu, fringilla mauris.
153
+ Vivamus bibendum turpis est, id elementum purus euismod sit amet. Etiam sit amet maximus augue. Vivamus erat
154
+ sapien, ultricies fringilla tellus id, condimentum blandit justo. Praesent quis nunc dignissim, pharetra
155
+ neque molestie, molestie lectus.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi egestas
156
+ luctus porttitor. Donec massa magna, placerat sit amet felis eget, venenatis fringilla ipsum. Lorem ipsum
157
+ dolor sit amet, consectetur adipiscing elit. Donec congue laoreet orci, nec elementum dolor consequat quis.
158
+ Curabitur rhoncus justo sed dapibus tincidunt. Vestibulum cursus ut risus sit amet congue. Nunc luctus, urna
159
+ ullamcorper facilisis Jia Le, risus eros aliquam erat, ut efficitur ante neque id odio. Nam orci leo,
160
+ dignissim sit amet dolor ut, congue gravida enim. Donec rhoncus aliquam nisl, ac cursus enim bibendum vitae.
161
+ Nunc sit amet elit ornare, malesuada urna eu, fringilla mauris. Vivamus bibendum turpis est, id elementum
162
+ purus euismod sit amet. Etiam sit amet maximus augue. Vivamus erat sapien, ultricies fringilla tellus id,
163
+ condimentum blandit justo. Praesent quis nunc dignissim, pharetra neque molestie, molestie lectus.
147
164
  </p>
148
165
  </DxcSidenav>
149
166
  </StyledContainer>
@@ -62,6 +62,7 @@ export const Chromatic = () => (
62
62
  <DxcSpinner margin="xlarge" mode="small" value="75"></DxcSpinner>
63
63
  <Title title="Xxlarge margin" theme="light" level={4} />
64
64
  <DxcSpinner margin="xxlarge" mode="small" value="75"></DxcSpinner>
65
+ <hr />
65
66
  </ExampleContainer>
66
67
  </>
67
68
  );
package/stack/Stack.d.ts CHANGED
@@ -1,10 +1,3 @@
1
- import React from "react";
2
- declare type StackProps = {
3
- gutter?: "none" | "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge" | "xxxlarge";
4
- divider?: boolean;
5
- align?: "start" | "center" | "end" | "baseline" | "stretch";
6
- as?: React.ElementType;
7
- children: React.ReactNode;
8
- };
9
- export default function Stack({ gutter, divider, align, as, children }: StackProps): JSX.Element;
10
- export {};
1
+ /// <reference types="react" />
2
+ import StackPropsType from "./types";
3
+ export default function Stack({ gutter, divider, align, as, children }: StackPropsType): JSX.Element;
package/stack/Stack.js CHANGED
@@ -34,7 +34,7 @@ function Stack(_ref) {
34
34
 
35
35
  var Divider = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n height: 1px;\n background-color: #999999;\n"])));
36
36
 
37
- var StyledStack = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n align-items: ", "};\n gap: ", ";\n margin: 0;\n padding: 0;\n"])), function (_ref2) {
37
+ var StyledStack = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n align-items: ", ";\n gap: ", ";\n margin: 0;\n padding: 0;\n"])), function (_ref2) {
38
38
  var align = _ref2.align;
39
39
 
40
40
  switch (align) {
@@ -64,30 +64,33 @@ var StyledStack = _styledComponents["default"].div(_templateObject2 || (_templat
64
64
  case "none":
65
65
  return "0";
66
66
 
67
- case "xxsmall":
67
+ case "xxxsmall":
68
68
  return "calc(0.125rem / ".concat(divider ? 2 : 1, ")");
69
69
 
70
- case "xsmall":
70
+ case "xxsmall":
71
71
  return "calc(0.25rem / ".concat(divider ? 2 : 1, ")");
72
72
 
73
- case "small":
73
+ case "xsmall":
74
74
  return "calc(0.5rem / ".concat(divider ? 2 : 1, ")");
75
75
 
76
- case "medium":
76
+ case "small":
77
77
  return "calc(1rem / ".concat(divider ? 2 : 1, ")");
78
78
 
79
- case "large":
79
+ case "medium":
80
80
  return "calc(1.5rem / ".concat(divider ? 2 : 1, ")");
81
81
 
82
- case "xlarge":
82
+ case "large":
83
83
  return "calc(2rem / ".concat(divider ? 2 : 1, ")");
84
84
 
85
- case "xxlarge":
85
+ case "xlarge":
86
86
  return "calc(3rem / ".concat(divider ? 2 : 1, ")");
87
87
 
88
- case "xxxlarge":
88
+ case "xxlarge":
89
89
  return "calc(4rem / ".concat(divider ? 2 : 1, ")");
90
90
 
91
+ case "xxxlarge":
92
+ return "calc(5rem / ".concat(divider ? 2 : 1, ")");
93
+
91
94
  default:
92
95
  return "0";
93
96
  }
@@ -58,6 +58,14 @@ export const Chromatic = () => (
58
58
  <Placeholder paddingLeft={60}></Placeholder>
59
59
  </DxcStack>
60
60
  </Container>
61
+ <Title title="gutter = xxxsmall" theme="light" level={4} />
62
+ <Container>
63
+ <DxcStack gutter="xxxsmall">
64
+ <Placeholder></Placeholder>
65
+ <Placeholder></Placeholder>
66
+ <Placeholder></Placeholder>
67
+ </DxcStack>
68
+ </Container>
61
69
  <Title title="gutter = xxsmall" theme="light" level={4} />
62
70
  <Container>
63
71
  <DxcStack gutter="xxsmall">
@@ -114,6 +122,14 @@ export const Chromatic = () => (
114
122
  <Placeholder></Placeholder>
115
123
  </DxcStack>
116
124
  </Container>
125
+ <Title title="gutter = xxxlarge" theme="light" level={4} />
126
+ <Container>
127
+ <DxcStack gutter="xxxlarge">
128
+ <Placeholder></Placeholder>
129
+ <Placeholder></Placeholder>
130
+ <Placeholder></Placeholder>
131
+ </DxcStack>
132
+ </Container>
117
133
  <Title title="gutter = xxlarge && divider" theme="light" level={4} />
118
134
  <Container>
119
135
  <DxcStack gutter="xxlarge" divider>
@@ -134,17 +150,15 @@ export const Chromatic = () => (
134
150
  );
135
151
 
136
152
  const Container = styled.div`
137
- background: #d0d0d0;
153
+ background: #f2eafa;
138
154
  padding: 10px;
139
- border-radius: 10px;
140
155
  `;
141
156
 
142
157
  const Placeholder = styled.div`
143
- min-height: 80px;
158
+ min-height: 40px;
144
159
  min-width: 120px;
145
- border: 1px solid #fabada;
146
- background-color: #fff7fb;
147
- border-radius: 5px;
160
+ border: 1px solid #a46ede;
161
+ background-color: #e5d5f6;
148
162
  padding-left: ${({ paddingLeft }) => `${paddingLeft ?? 0}px`};
149
163
  padding-right: ${({ paddingRight }) => `${paddingRight ?? 0}px`};
150
164
  `;
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ declare type Props = {
3
+ gutter?: "none" | "xxxsmall" | "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge" | "xxxlarge";
4
+ divider?: boolean;
5
+ align?: "start" | "center" | "end" | "baseline" | "stretch";
6
+ as?: React.ElementType;
7
+ children: React.ReactNode;
8
+ };
9
+ export default Props;
package/stack/types.js ADDED
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -72,7 +72,7 @@ export const Chromatic = () => (
72
72
  <Title title="Margins" theme="light" level={2} />
73
73
  <ExampleContainer>
74
74
  <Title title="Xxsmall margin" theme="light" level={4} />
75
- <DxcSwitch label="Xxsmmall" margin="xxsmall" />
75
+ <DxcSwitch label="Xxsmall" margin="xxsmall" />
76
76
  </ExampleContainer>
77
77
  <ExampleContainer>
78
78
  <Title title="Xsmall margin" theme="light" level={4} />
@@ -271,6 +271,7 @@ export const Chromatic = () => (
271
271
  <td>Cell 9</td>
272
272
  </tr>
273
273
  </DxcTable>
274
+ <hr />
274
275
  </ExampleContainer>
275
276
  </>
276
- );
277
+ );
package/tabs/Tabs.js CHANGED
@@ -9,10 +9,10 @@ Object.defineProperty(exports, "__esModule", {
9
9
  });
10
10
  exports["default"] = void 0;
11
11
 
12
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
13
-
14
12
  var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
15
13
 
14
+ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
15
+
16
16
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
17
17
 
18
18
  var _react = _interopRequireDefault(require("react"));
@@ -70,12 +70,12 @@ var DxcTabs = function DxcTabs(_ref) {
70
70
  }, /*#__PURE__*/_react["default"].createElement(TabLabelContainer, {
71
71
  hasLabelAndIcon: hasLabelAndIcon,
72
72
  iconPosition: iconPosition
73
- }, tab.icon ? /*#__PURE__*/_react["default"].createElement(TabIconContainer, {
73
+ }, tab.icon && /*#__PURE__*/_react["default"].createElement(TabIconContainer, {
74
74
  hasLabelAndIcon: hasLabelAndIcon,
75
75
  iconPosition: iconPosition
76
- }, (0, _typeof2["default"])(tab.icon) === "object" ? tab.icon : /*#__PURE__*/_react["default"].createElement(tab.icon)) : tab.iconSrc && /*#__PURE__*/_react["default"].createElement(TabIcon, {
77
- src: tab.iconSrc
78
- }), /*#__PURE__*/_react["default"].createElement(LabelTextContainer, null, tab.label))), tab.notificationNumber && tab.notificationNumber !== false && /*#__PURE__*/_react["default"].createElement(BadgeContainer, {
76
+ }, typeof tab.icon === "string" ? /*#__PURE__*/_react["default"].createElement(TabIcon, {
77
+ src: tab.icon
78
+ }) : tab.icon), /*#__PURE__*/_react["default"].createElement(LabelTextContainer, null, tab.label))), tab.notificationNumber && tab.notificationNumber !== false && /*#__PURE__*/_react["default"].createElement(BadgeContainer, {
79
79
  hasLabelAndIcon: hasLabelAndIcon,
80
80
  iconPosition: iconPosition
81
81
  }, /*#__PURE__*/_react["default"].createElement(_Badge["default"], {
@@ -201,7 +201,7 @@ var DxCTabs = _styledComponents["default"].div(_templateObject7 || (_templateObj
201
201
  return props.theme.scrollButtonsWidth;
202
202
  });
203
203
 
204
- var TabIcon = _styledComponents["default"].img(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n max-height: 22px;\n max-width: 22px;\n"])));
204
+ var TabIcon = _styledComponents["default"].img(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])([""])));
205
205
 
206
206
  var TabIconContainer = _styledComponents["default"].div(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["\n max-height: 22px;\n max-width: 22px;\n margin-bottom: ", ";\n margin-right: ", ";\n overflow: hidden;\n display: flex;\n align-items: center;\n img,\n svg {\n height: 100%;\n width: 100%;\n }\n"])), function (props) {
207
207
  return props.hasLabelAndIcon && props.iconPosition === "top" && "8px" || "";
@@ -9,14 +9,12 @@ export default {
9
9
  component: DxcTabs,
10
10
  };
11
11
 
12
- const iconSVG = () => {
13
- return (
14
- <svg viewBox="0 0 24 24" fill="currentColor">
15
- <path d="M0 0h24v24H0z" fill="none" />
16
- <path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z" />
17
- </svg>
18
- );
19
- };
12
+ const iconSVG = (
13
+ <svg viewBox="0 0 24 24" fill="currentColor">
14
+ <path d="M0 0h24v24H0z" fill="none" />
15
+ <path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z" />
16
+ </svg>
17
+ );
20
18
 
21
19
  const tabs: any = [
22
20
  {
@@ -116,6 +114,7 @@ export const Chromatic = () => (
116
114
  <ExampleContainer>
117
115
  <Title title="Xxlarge margin" theme="light" level={4} />
118
116
  <DxcTabs tabs={tabs} margin="xxlarge" />
117
+ <hr />
119
118
  </ExampleContainer>
120
119
  </>
121
120
  );
package/tabs/types.d.ts CHANGED
@@ -6,20 +6,8 @@ declare type Margin = {
6
6
  left?: Space;
7
7
  right?: Space;
8
8
  };
9
- declare type SVG = React.SVGProps<SVGSVGElement> | React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
10
- declare type Tab = {
11
- /**
12
- * Tab label.
13
- */
14
- label?: string;
15
- /**
16
- * Element used as the icon that will be displayed in the tab.
17
- */
18
- icon?: SVG;
19
- /**
20
- * @deprecated URL of the icon to be displayed in the tab.
21
- */
22
- iconSrc?: string;
9
+ declare type SVG = React.SVGProps<SVGSVGElement>;
10
+ declare type TabCommonProps = {
23
11
  /**
24
12
  * Whether the tab is disabled or not.
25
13
  */
@@ -33,11 +21,31 @@ declare type Tab = {
33
21
  */
34
22
  notificationNumber?: boolean | number;
35
23
  };
24
+ declare type TabLabelProps = TabCommonProps & {
25
+ /**
26
+ * Tab label.
27
+ */
28
+ label: string;
29
+ /**
30
+ * Element or path used as the icon that will be displayed in the tab.
31
+ */
32
+ icon?: string | SVG;
33
+ };
34
+ declare type TabIconProps = TabCommonProps & {
35
+ /**
36
+ * Tab label.
37
+ */
38
+ label?: string;
39
+ /**
40
+ * Element or path used as the icon that will be displayed in the tab.
41
+ */
42
+ icon: string | SVG;
43
+ };
36
44
  declare type Props = {
37
45
  /**
38
46
  * An array of objects representing the tabs.
39
47
  */
40
- tabs: Tab[];
48
+ tabs: (TabLabelProps | TabIconProps)[];
41
49
  /**
42
50
  * Whether the icon should appear above or to the left of the label.
43
51
  */
@@ -132,7 +132,7 @@ export const Chromatic = () => (
132
132
  );
133
133
 
134
134
  const LinkTag = () => (
135
- <ExampleContainer>
135
+ <ExampleContainer expanded>
136
136
  <Title title="Hover link tag" theme="light" level={4} />
137
137
  <DxcTag label="Tag" icon={icon} linkHref="https://www.dxc.com" />
138
138
  </ExampleContainer>
package/text/Text.js CHANGED
@@ -24,7 +24,7 @@ function Text(_ref) {
24
24
  }, children);
25
25
  }
26
26
 
27
- var StyledText = _styledComponents["default"].span(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n margin: 0px;\n font-family: Open Sans, sans-serif;\n"])));
27
+ var StyledText = _styledComponents["default"].span(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n margin: 0px;\n font-family: Open Sans, sans-serif;\n line-height: 1.5em;\n"])));
28
28
 
29
29
  var _default = Text;
30
30
  exports["default"] = _default;
@@ -548,7 +548,9 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref
548
548
  backgroundType: backgroundType,
549
549
  "aria-label": "Error"
550
550
  }, textInputIcons.error), !disabled && clearable && (value !== null && value !== void 0 ? value : innerValue).length > 0 && /*#__PURE__*/_react["default"].createElement(Action, {
551
- onClick: handleClearActionOnClick,
551
+ onClick: function onClick() {
552
+ return handleClearActionOnClick();
553
+ },
552
554
  onMouseDown: function onMouseDown(event) {
553
555
  event.stopPropagation();
554
556
  },
@@ -559,7 +561,9 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref
559
561
  }, textInputIcons.clear), (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.typeNumber) === "number" ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(Action, {
560
562
  ref: actionRef,
561
563
  disabled: disabled,
562
- onClick: handleDecrementActionOnClick,
564
+ onClick: function onClick() {
565
+ return handleDecrementActionOnClick();
566
+ },
563
567
  onMouseDown: function onMouseDown(event) {
564
568
  event.stopPropagation();
565
569
  },
@@ -570,7 +574,9 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref
570
574
  }, textInputIcons.decrement), /*#__PURE__*/_react["default"].createElement(Action, {
571
575
  ref: actionRef,
572
576
  disabled: disabled,
573
- onClick: handleIncrementActionOnClick,
577
+ onClick: function onClick() {
578
+ return handleIncrementActionOnClick();
579
+ },
574
580
  onMouseDown: function onMouseDown(event) {
575
581
  event.stopPropagation();
576
582
  },
@@ -581,7 +587,9 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref
581
587
  }, textInputIcons.increment)) : action && /*#__PURE__*/_react["default"].createElement(Action, {
582
588
  ref: actionRef,
583
589
  disabled: disabled,
584
- onClick: action.onClick,
590
+ onClick: function onClick() {
591
+ return action.onClick();
592
+ },
585
593
  onMouseDown: function onMouseDown(event) {
586
594
  event.stopPropagation();
587
595
  },
@@ -262,14 +262,14 @@ export const Chromatic = () => (
262
262
  );
263
263
 
264
264
  const FocusedActionTextInput = () => (
265
- <ExampleContainer>
265
+ <ExampleContainer expanded>
266
266
  <Title title="Focused action" theme="light" level={4} />
267
267
  <DxcTextInput label="Text input" action={action} clearable />
268
268
  </ExampleContainer>
269
269
  );
270
270
 
271
271
  const ActivedActionTextInput = () => (
272
- <ExampleContainer pseudoState="pseudo-active">
272
+ <ExampleContainer pseudoState="pseudo-active" expanded>
273
273
  <Title title="Actived action" theme="light" level={4} />
274
274
  <DxcTextInput label="Text input" action={action} clearable />
275
275
  </ExampleContainer>
@@ -306,7 +306,7 @@ const ActivedOptionAutosuggest = () => (
306
306
  const FocusedActionTextInputOnDark = () => (
307
307
  <BackgroundColorProvider color="#333333">
308
308
  <DarkContainer>
309
- <ExampleContainer>
309
+ <ExampleContainer expanded>
310
310
  <Title title="Focused action" theme="dark" level={4} />
311
311
  <DxcTextInput label="Text input" action={action} clearable />
312
312
  </ExampleContainer>
@@ -317,7 +317,7 @@ const FocusedActionTextInputOnDark = () => (
317
317
  const ActivedActionTextInputOnDark = () => (
318
318
  <BackgroundColorProvider color="#333333">
319
319
  <DarkContainer>
320
- <ExampleContainer pseudoState="pseudo-active">
320
+ <ExampleContainer pseudoState="pseudo-active" expanded>
321
321
  <Title title="Actived action" theme="dark" level={4} />
322
322
  <DxcTextInput label="Text input" action={action} clearable />
323
323
  </ExampleContainer>
@@ -11,7 +11,7 @@ declare type Action = {
11
11
  /**
12
12
  * This function will be called when the user clicks the action.
13
13
  */
14
- onClick: (event: React.MouseEvent<HTMLButtonElement>) => void;
14
+ onClick: () => void;
15
15
  /**
16
16
  * Icon to be shown in the action.
17
17
  */
@@ -105,15 +105,15 @@ export const Chromatic = () => (
105
105
  <Title title="Margins" theme="light" level={2} />
106
106
  <ExampleContainer>
107
107
  <Title title="Xxsmall margin" theme="light" level={4} />
108
- <DxcTextarea label="Xxsmmall" margin="xxsmall" />
108
+ <DxcTextarea label="Xxsmall" margin="xxsmall" />
109
109
  </ExampleContainer>
110
110
  <ExampleContainer>
111
111
  <Title title="Xsmall margin" theme="light" level={4} />
112
- <DxcTextarea label="xsmmall" margin="xsmall" />
112
+ <DxcTextarea label="xsmall" margin="xsmall" />
113
113
  </ExampleContainer>
114
114
  <ExampleContainer>
115
115
  <Title title="Small margin" theme="light" level={4} />
116
- <DxcTextarea label="smmall" margin="small" />
116
+ <DxcTextarea label="small" margin="small" />
117
117
  </ExampleContainer>
118
118
  <ExampleContainer>
119
119
  <Title title="Medium margin" theme="light" level={4} />
@@ -130,6 +130,7 @@ export const Chromatic = () => (
130
130
  <ExampleContainer>
131
131
  <Title title="Xxlarge margin" theme="light" level={4} />
132
132
  <DxcTextarea label="Xxlarge" margin="xxlarge" />
133
+ <hr />
133
134
  </ExampleContainer>
134
135
  </>
135
136
  );
@@ -9,10 +9,10 @@ Object.defineProperty(exports, "__esModule", {
9
9
  });
10
10
  exports["default"] = void 0;
11
11
 
12
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
13
-
14
12
  var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
15
13
 
14
+ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
15
+
16
16
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
17
17
 
18
18
  var _react = _interopRequireWildcard(require("react"));
@@ -46,7 +46,7 @@ var DxcToggleGroup = function DxcToggleGroup(_ref) {
46
46
  tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
47
47
  var colorsTheme = (0, _useTheme["default"])();
48
48
 
49
- var _useState = (0, _react.useState)(multiple ? [] : ""),
49
+ var _useState = (0, _react.useState)(multiple ? [] : -1),
50
50
  _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
51
51
  selectedValue = _useState2[0],
52
52
  setSelectedValue = _useState2[1];
@@ -108,16 +108,16 @@ var DxcToggleGroup = function DxcToggleGroup(_ref) {
108
108
  role: multiple ? "group" : "radiogroup"
109
109
  }, options.map(function (option, i) {
110
110
  return /*#__PURE__*/_react["default"].createElement(ToggleContainer, {
111
- selected: multiple ? value ? value.includes(option.value) : selectedValue.includes(option.value) : value ? option.value === value : option.value === selectedValue,
111
+ selected: multiple && Array.isArray(value) ? value ? value.includes(option.value) : Array.isArray(selectedValue) && selectedValue.includes(option.value) : value ? option.value === value : option.value === selectedValue,
112
112
  role: multiple ? "switch" : "radio",
113
- "aria-checked": multiple ? value ? value.includes(option.value) : selectedValue.includes(option.value) : value ? option.value === value : option.value === selectedValue,
113
+ "aria-checked": multiple && Array.isArray(value) ? value ? value.includes(option.value) : Array.isArray(selectedValue) && selectedValue.includes(option.value) : value ? option.value === value : option.value === selectedValue,
114
114
  tabIndex: !disabled ? tabIndex : -1,
115
115
  onClick: function onClick() {
116
116
  return !disabled && handleToggleChange(option.value);
117
117
  },
118
118
  isFirst: i === 0,
119
119
  isLast: i === options.length - 1,
120
- isIcon: option.iconSrc || option.icon,
120
+ isIcon: option.icon,
121
121
  optionLabel: option.label,
122
122
  disabled: disabled,
123
123
  onKeyPress: function onKeyPress(event) {
@@ -126,10 +126,9 @@ var DxcToggleGroup = function DxcToggleGroup(_ref) {
126
126
  key: "toggle-".concat(i, "-").concat(option.label)
127
127
  }, /*#__PURE__*/_react["default"].createElement(OptionContent, null, option.icon && /*#__PURE__*/_react["default"].createElement(IconContainer, {
128
128
  optionLabel: option.label
129
- }, (0, _typeof2["default"])(option.icon) === "object" ? option.icon : /*#__PURE__*/_react["default"].createElement(option.icon)), option.iconSrc && /*#__PURE__*/_react["default"].createElement(Icon, {
130
- src: option.iconSrc,
131
- optionLabel: option.label
132
- }), option.label && /*#__PURE__*/_react["default"].createElement(LabelContainer, null, option.label)));
129
+ }, typeof option.icon === "string" ? /*#__PURE__*/_react["default"].createElement(Icon, {
130
+ src: option.icon
131
+ }) : option.icon), option.label && /*#__PURE__*/_react["default"].createElement(LabelContainer, null, option.label)));
133
132
  }))));
134
133
  };
135
134
 
@@ -205,9 +204,7 @@ var LabelContainer = _styledComponents["default"].span(_templateObject6 || (_tem
205
204
 
206
205
  var OptionContent = _styledComponents["default"].div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: row;\n align-items: center;\n"])));
207
206
 
208
- var Icon = _styledComponents["default"].img(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n height: 24px;\n width: 24px;\n margin-right: ", ";\n"])), function (props) {
209
- return props.optionLabel && props.theme.iconMarginRight;
210
- });
207
+ var Icon = _styledComponents["default"].img(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])([""])));
211
208
 
212
209
  var IconContainer = _styledComponents["default"].div(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["\n margin-right: ", ";\n height: 24px;\n width: 24px;\n overflow: hidden;\n display: flex;\n img,\n svg {\n height: 100%;\n width: 100%;\n }\n"])), function (props) {
213
210
  return props.optionLabel && props.theme.iconMarginRight;
@@ -9,36 +9,31 @@ export default {
9
9
  component: DxcToggleGroup,
10
10
  };
11
11
 
12
- const ethernetSVG = () => {
13
- return (
14
- <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
15
- <path d="M0 0h24v24H0V0z" fill="none" />
16
- <path d="M7.77 6.76L6.23 5.48.82 12l5.41 6.52 1.54-1.28L3.42 12l4.35-5.24zM7 13h2v-2H7v2zm10-2h-2v2h2v-2zm-6 2h2v-2h-2v2zm6.77-7.52l-1.54 1.28L20.58 12l-4.35 5.24 1.54 1.28L23.18 12l-5.41-6.52z" />
17
- </svg>
18
- );
19
- };
20
- const gMobileSVG = () => {
21
- return (
22
- <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
23
- <g>
24
- <path d="M0,0h24v24H0V0z" fill="none" />
25
- </g>
12
+ const ethernetSVG = (
13
+ <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
14
+ <path d="M0 0h24v24H0V0z" fill="none" />
15
+ <path d="M7.77 6.76L6.23 5.48.82 12l5.41 6.52 1.54-1.28L3.42 12l4.35-5.24zM7 13h2v-2H7v2zm10-2h-2v2h2v-2zm-6 2h2v-2h-2v2zm6.77-7.52l-1.54 1.28L20.58 12l-4.35 5.24 1.54 1.28L23.18 12l-5.41-6.52z" />
16
+ </svg>
17
+ );
18
+ const gMobileSVG = (
19
+ <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
20
+ <g>
21
+ <path d="M0,0h24v24H0V0z" fill="none" />
22
+ </g>
23
+ <g>
26
24
  <g>
27
- <g>
28
- <path d="M3,7v2h5v2H4v2h4v2H3v2h5c1.1,0,2-0.9,2-2v-1.5c0-0.83-0.67-1.5-1.5-1.5c0.83,0,1.5-0.67,1.5-1.5V9c0-1.1-0.9-2-2-2H3z M21,11v4c0,1.1-0.9,2-2,2h-5c-1.1,0-2-0.9-2-2V9c0-1.1,0.9-2,2-2h5c1.1,0,2,0.9,2,2h-7v6h5v-2h-2.5v-2H21z" />
29
- </g>
25
+ <path d="M3,7v2h5v2H4v2h4v2H3v2h5c1.1,0,2-0.9,2-2v-1.5c0-0.83-0.67-1.5-1.5-1.5c0.83,0,1.5-0.67,1.5-1.5V9c0-1.1-0.9-2-2-2H3z M21,11v4c0,1.1-0.9,2-2,2h-5c-1.1,0-2-0.9-2-2V9c0-1.1,0.9-2,2-2h5c1.1,0,2,0.9,2,2h-7v6h5v-2h-2.5v-2H21z" />
30
26
  </g>
31
- </svg>
32
- );
33
- };
34
- const wifiSVG = () => {
35
- return (
36
- <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
37
- <path d="M0 0h24v24H0V0zm0 0h24v24H0V0z" fill="none" />
38
- <path d="M1 9l2 2c4.97-4.97 13.03-4.97 18 0l2-2C16.93 2.93 7.08 2.93 1 9zm8 8l3 3 3-3c-1.65-1.66-4.34-1.66-6 0zm-4-4l2 2c2.76-2.76 7.24-2.76 10 0l2-2C15.14 9.14 8.87 9.14 5 13z" />
39
- </svg>
40
- );
41
- };
27
+ </g>
28
+ </svg>
29
+ );
30
+ const wifiSVG = (
31
+ <svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor">
32
+ <path d="M0 0h24v24H0V0zm0 0h24v24H0V0z" fill="none" />
33
+ <path d="M1 9l2 2c4.97-4.97 13.03-4.97 18 0l2-2C16.93 2.93 7.08 2.93 1 9zm8 8l3 3 3-3c-1.65-1.66-4.34-1.66-6 0zm-4-4l2 2c2.76-2.76 7.24-2.76 10 0l2-2C15.14 9.14 8.87 9.14 5 13z" />
34
+ </svg>
35
+ );
36
+
42
37
  const options = [
43
38
  {
44
39
  value: 1,