@dxc-technology/halstack-react 0.0.0-c25d3b6 → 0.0.0-c2834c3

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 (104) hide show
  1. package/HalstackContext.d.ts +12 -0
  2. package/HalstackContext.js +298 -0
  3. package/accordion/Accordion.d.ts +1 -1
  4. package/accordion/Accordion.js +7 -28
  5. package/accordion/Accordion.stories.tsx +11 -11
  6. package/accordion/Accordion.test.js +19 -4
  7. package/accordion/types.d.ts +4 -0
  8. package/accordion-group/AccordionGroup.d.ts +1 -1
  9. package/accordion-group/AccordionGroup.js +13 -15
  10. package/accordion-group/AccordionGroup.stories.tsx +1 -1
  11. package/accordion-group/AccordionGroup.test.js +24 -6
  12. package/accordion-group/types.d.ts +4 -0
  13. package/alert/Alert.js +4 -1
  14. package/button/Button.js +14 -11
  15. package/card/Card.js +27 -28
  16. package/checkbox/Checkbox.d.ts +1 -1
  17. package/checkbox/Checkbox.js +43 -39
  18. package/checkbox/Checkbox.stories.tsx +124 -128
  19. package/checkbox/Checkbox.test.js +13 -0
  20. package/checkbox/types.d.ts +7 -3
  21. package/common/variables.js +181 -70
  22. package/date-input/DateInput.js +38 -20
  23. package/date-input/DateInput.test.js +9 -22
  24. package/date-input/types.d.ts +12 -9
  25. package/dialog/Dialog.js +4 -32
  26. package/dropdown/Dropdown.js +13 -17
  27. package/file-input/FileInput.js +9 -6
  28. package/file-input/FileItem.js +7 -5
  29. package/footer/Footer.js +15 -88
  30. package/header/Header.js +27 -48
  31. package/header/Header.stories.tsx +46 -36
  32. package/header/Header.test.js +18 -2
  33. package/inset/types.d.ts +24 -0
  34. package/layout/ApplicationLayout.js +5 -18
  35. package/link/Link.d.ts +3 -2
  36. package/link/Link.js +65 -56
  37. package/link/Link.stories.tsx +87 -52
  38. package/link/Link.test.js +7 -15
  39. package/link/types.d.ts +8 -23
  40. package/main.d.ts +3 -2
  41. package/main.js +19 -5
  42. package/number-input/NumberInput.test.js +2 -4
  43. package/number-input/types.d.ts +13 -10
  44. package/package.json +6 -5
  45. package/paginator/Paginator.js +17 -38
  46. package/password-input/PasswordInput.js +7 -4
  47. package/password-input/PasswordInput.test.js +3 -6
  48. package/password-input/types.d.ts +14 -11
  49. package/quick-nav/QuickNav.d.ts +4 -0
  50. package/quick-nav/QuickNav.js +116 -0
  51. package/quick-nav/QuickNav.stories.tsx +237 -0
  52. package/quick-nav/types.d.ts +21 -0
  53. package/quick-nav/types.js +5 -0
  54. package/radio/Radio.js +10 -11
  55. package/radio-group/Radio.js +1 -1
  56. package/radio-group/RadioGroup.js +8 -6
  57. package/row/types.d.ts +18 -0
  58. package/select/Listbox.d.ts +4 -0
  59. package/select/Listbox.js +152 -0
  60. package/select/Option.js +1 -1
  61. package/select/Select.js +53 -139
  62. package/select/Select.stories.tsx +14 -2
  63. package/select/Select.test.js +83 -42
  64. package/select/types.d.ts +33 -11
  65. package/slider/Slider.d.ts +1 -1
  66. package/slider/Slider.js +2 -1
  67. package/slider/Slider.stories.tsx +8 -8
  68. package/slider/Slider.test.js +31 -10
  69. package/slider/types.d.ts +4 -0
  70. package/spinner/Spinner.js +1 -1
  71. package/switch/Switch.d.ts +1 -1
  72. package/switch/Switch.js +35 -19
  73. package/switch/Switch.stories.tsx +14 -14
  74. package/switch/Switch.test.js +25 -0
  75. package/switch/types.d.ts +6 -2
  76. package/tabs/Tabs.d.ts +1 -1
  77. package/tabs/Tabs.js +9 -11
  78. package/tabs/Tabs.stories.tsx +0 -8
  79. package/tabs/Tabs.test.js +26 -9
  80. package/tabs/types.d.ts +4 -0
  81. package/tag/Tag.js +5 -8
  82. package/text-input/Suggestion.d.ts +4 -0
  83. package/text-input/Suggestion.js +55 -0
  84. package/text-input/TextInput.js +48 -76
  85. package/text-input/TextInput.test.js +22 -35
  86. package/text-input/types.d.ts +27 -12
  87. package/textarea/Textarea.js +12 -23
  88. package/textarea/Textarea.test.js +10 -20
  89. package/textarea/types.d.ts +14 -11
  90. package/toggle-group/ToggleGroup.d.ts +1 -1
  91. package/toggle-group/ToggleGroup.js +5 -4
  92. package/toggle-group/ToggleGroup.stories.tsx +4 -4
  93. package/toggle-group/ToggleGroup.test.js +35 -4
  94. package/toggle-group/types.d.ts +8 -0
  95. package/useTheme.js +2 -2
  96. package/useTranslatedLabels.d.ts +2 -0
  97. package/useTranslatedLabels.js +20 -0
  98. package/wizard/Wizard.d.ts +1 -1
  99. package/wizard/Wizard.js +55 -44
  100. package/wizard/Wizard.stories.tsx +13 -23
  101. package/wizard/Wizard.test.js +36 -23
  102. package/wizard/types.d.ts +6 -2
  103. package/ThemeContext.d.ts +0 -10
  104. package/ThemeContext.js +0 -243
@@ -24,128 +24,163 @@ export const Chromatic = () => (
24
24
  <Title title="With anchor" theme="light" level={2} />
25
25
  <ExampleContainer>
26
26
  <Title title="Disabled" theme="light" level={4} />
27
- <DxcLink text="Test" disabled></DxcLink>
27
+ <DxcLink disabled>Test</DxcLink>
28
28
  <Title title="Icon before" theme="light" level={4} />
29
- <DxcLink text="Test" href="https://www.google.com" icon={icon} iconPosition="before"></DxcLink>
29
+ <DxcLink href="https://www.google.com" icon={icon} iconPosition="before">
30
+ Test
31
+ </DxcLink>
30
32
  <Title title="Icon after" theme="light" level={4} />
31
33
  <DxcLink
32
- text="Test"
33
34
  href="https://www.youtube.com/"
34
35
  icon="https://iconape.com/wp-content/files/yd/367773/svg/logo-linkedin-logo-icon-png-svg.png"
35
36
  iconPosition="after"
36
- ></DxcLink>
37
+ >
38
+ Test
39
+ </DxcLink>
37
40
  </ExampleContainer>
38
41
  <ExampleContainer pseudoState="pseudo-hover">
39
42
  <Title title="With link hovered" theme="light" level={4} />
40
- <DxcLink text="Test" href="https://www.dxc.com"></DxcLink>
43
+ <DxcLink href="https://www.dxc.com">Test</DxcLink>
41
44
  </ExampleContainer>
42
45
  <ExampleContainer pseudoState="pseudo-focus">
43
46
  <Title title="With link focused" theme="light" level={4} />
44
- <DxcLink text="Test" href="https://www.dxc.com"></DxcLink>
47
+ <DxcLink href="https://www.dxc.com">Test</DxcLink>
45
48
  </ExampleContainer>
46
49
  <ExampleContainer pseudoState="pseudo-active">
47
50
  <Title title="With link active" theme="light" level={4} />
48
- <DxcLink text="Test" href="https://www.dxc.com"></DxcLink>
51
+ <DxcLink href="https://www.dxc.com">Test</DxcLink>
49
52
  </ExampleContainer>
50
53
  <ExampleContainer pseudoState="pseudo-visited">
51
54
  <Title title="With link visited" theme="light" level={4} />
52
- <DxcLink text="Test" href="https://www.amazon.com"></DxcLink>
55
+ <DxcLink href="https://www.amazon.com">Test</DxcLink>
53
56
  </ExampleContainer>
54
57
  <ExampleContainer>
55
58
  <Title title="Inherit color" theme="light" level={4} />
56
- This is a <DxcLink text="Test" inheritColor={true}></DxcLink>.
59
+ This is a <DxcLink inheritColor>Test</DxcLink>.
57
60
  </ExampleContainer>
58
61
  <ExampleContainer pseudoState="pseudo-focus">
59
62
  <Title title="With brackets and focus" theme="light" level={4} />
60
- This is a (<DxcLink text="Test" inheritColor={true}></DxcLink>).
63
+ This is a (
64
+ <DxcLink inheritColor href="https://www.google.com">
65
+ Test
66
+ </DxcLink>
67
+ ).
61
68
  </ExampleContainer>
62
69
  <ExampleContainer pseudoState="pseudo-hover">
63
70
  <Title title="Long text with hover" theme="light" level={4} />
64
- Lorem <DxcLink text="Test" href="https://www.google.com"></DxcLink> ipsum dolor sit amet, consectetur adipiscing
65
- elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
66
- exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
67
- voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt
68
- in culpa qui officia deserunt mollit anim id est laborum.
71
+ Lorem <DxcLink href="https://www.google.com">Test</DxcLink> ipsum dolor sit amet, consectetur adipiscing elit, sed
72
+ do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
73
+ ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit
74
+ esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui
75
+ officia deserunt mollit anim id est laborum.
69
76
  </ExampleContainer>
70
77
  <ExampleContainer pseudoState="pseudo-focus">
71
78
  <Title title="Long text with focus" theme="light" level={4} />
72
- Lorem <DxcLink text="Test" href="https://www.google.com"></DxcLink> ipsum dolor sit amet, consectetur adipiscing
73
- elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
74
- exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
75
- voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt
76
- in culpa qui officia deserunt mollit anim id est laborum.
79
+ Lorem <DxcLink href="https://www.google.com">Test</DxcLink> ipsum dolor sit amet, consectetur adipiscing elit, sed
80
+ do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
81
+ ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit
82
+ esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui
83
+ officia deserunt mollit anim id est laborum.
77
84
  </ExampleContainer>
78
85
  <Title title="With button" theme="light" level={2} />
79
86
  <ExampleContainer>
80
87
  <Title title="Disabled" theme="light" level={4} />
81
- <DxcLink text="Test" onClick={() => {}} disabled></DxcLink>
88
+ <DxcLink onClick={() => {}} disabled>
89
+ Test
90
+ </DxcLink>
82
91
  <Title title="Icon before" theme="light" level={4} />
83
- <DxcLink text="Test" onClick={() => {}} href="https://www.google.com" icon={icon} iconPosition="before"></DxcLink>
92
+ <DxcLink onClick={() => {}} icon={icon} iconPosition="before">
93
+ Test
94
+ </DxcLink>
84
95
  <Title title="Icon after" theme="light" level={4} />
85
- <DxcLink
86
- text="Test"
87
- onClick={() => {}}
88
- href="https://www.youtube.com/"
89
- icon={icon}
90
- iconPosition="after"
91
- ></DxcLink>
96
+ <DxcLink onClick={() => {}} icon={icon} iconPosition="after">
97
+ Test
98
+ </DxcLink>
92
99
  </ExampleContainer>
93
100
  <ExampleContainer pseudoState="pseudo-hover">
94
101
  <Title title="With link hovered" theme="light" level={4} />
95
- <DxcLink text="Test" onClick={() => {}} href="https://www.dxc.com"></DxcLink>
102
+ <DxcLink onClick={() => {}}>Test</DxcLink>
96
103
  </ExampleContainer>
97
104
  <ExampleContainer pseudoState="pseudo-focus">
98
105
  <Title title="With link focused" theme="light" level={4} />
99
- <DxcLink text="Test" onClick={() => {}} href="https://www.dxc.com"></DxcLink>
106
+ <DxcLink onClick={() => {}}>Test</DxcLink>
100
107
  </ExampleContainer>
101
108
  <ExampleContainer pseudoState="pseudo-active">
102
109
  <Title title="With link active" theme="light" level={4} />
103
- <DxcLink text="Test" onClick={() => {}} href="https://www.dxc.com"></DxcLink>
110
+ <DxcLink onClick={() => {}}>Test</DxcLink>
104
111
  </ExampleContainer>
105
112
  <ExampleContainer pseudoState="pseudo-visited">
106
113
  <Title title="With link visited" theme="light" level={4} />
107
- <DxcLink text="Test" onClick={() => {}} href="https://www.amazon.com"></DxcLink>
114
+ <DxcLink onClick={() => {}}>Test</DxcLink>
108
115
  </ExampleContainer>
109
116
  <ExampleContainer>
110
117
  <Title title="Inherit color" theme="light" level={4} />
111
- This is a <DxcLink text="Test" onClick={() => {}} inheritColor={true}></DxcLink>.
118
+ This is a{" "}
119
+ <DxcLink onClick={() => {}} inheritColor>
120
+ Test
121
+ </DxcLink>
122
+ .
112
123
  </ExampleContainer>
113
124
  <ExampleContainer pseudoState="pseudo-focus">
114
125
  <Title title="With brackets and focus" theme="light" level={4} />
115
- This is a (<DxcLink text="Test" onClick={() => {}} inheritColor={true}></DxcLink>).
126
+ This is a (
127
+ <DxcLink onClick={() => {}} inheritColor>
128
+ Test
129
+ </DxcLink>
130
+ ).
116
131
  </ExampleContainer>
117
132
  <ExampleContainer pseudoState="pseudo-hover">
118
133
  <Title title="Long text with hover" theme="light" level={4} />
119
- Lorem <DxcLink text="Test" onClick={() => {}} href="https://www.google.com"></DxcLink> ipsum dolor sit amet,
120
- consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
121
- veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor
122
- in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
123
- non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
134
+ Lorem{" "}
135
+ <DxcLink onClick={() => {}} href="https://www.google.com">
136
+ Test
137
+ </DxcLink>{" "}
138
+ ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna
139
+ aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
140
+ consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
141
+ Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
124
142
  </ExampleContainer>
125
143
  <ExampleContainer pseudoState="pseudo-focus">
126
144
  <Title title="Long text with focus" theme="light" level={4} />
127
- Lorem <DxcLink text="Test" onClick={() => {}} href="https://www.google.com"></DxcLink> ipsum dolor sit amet,
128
- consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
129
- veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor
130
- in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
131
- non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
145
+ Lorem{" "}
146
+ <DxcLink onClick={() => {}} href="https://www.google.com">
147
+ Test
148
+ </DxcLink>{" "}
149
+ ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna
150
+ aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
151
+ consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
152
+ Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
132
153
  </ExampleContainer>
133
154
  <Title title="Margins" theme="light" level={2} />
134
155
  <ExampleContainer>
135
156
  <Title title="Xxsmall margin" theme="light" level={4} />
136
- <DxcLink text="Test" margin="xxsmall" href="https://www.facebook.com/"></DxcLink>
157
+ <DxcLink margin="xxsmall" href="https://www.facebook.com/">
158
+ Test
159
+ </DxcLink>
137
160
  <Title title="Xsmall margin" theme="light" level={4} />
138
- <DxcLink text="Test" margin="xsmall" href="https://www.linkedin.com/"></DxcLink>
161
+ <DxcLink margin="xsmall" href="https://www.linkedin.com/">
162
+ Test
163
+ </DxcLink>
139
164
  <Title title="Small margin" theme="light" level={4} />
140
- <DxcLink text="Test" margin="small" href="https://www.linkedin.com/"></DxcLink>
165
+ <DxcLink margin="small" href="https://www.linkedin.com/">
166
+ Test
167
+ </DxcLink>
141
168
  <Title title="Medium margin" theme="light" level={4} />
142
- <DxcLink text="Test" margin="medium" href="https://www.linkedin.com/"></DxcLink>
169
+ <DxcLink margin="medium" href="https://www.linkedin.com/">
170
+ Test
171
+ </DxcLink>
143
172
  <Title title="Large margin" theme="light" level={4} />
144
- <DxcLink text="Test" margin="large" href="https://www.linkedin.com/"></DxcLink>
173
+ <DxcLink margin="large" href="https://www.linkedin.com/">
174
+ Test
175
+ </DxcLink>
145
176
  <Title title="Xlarge margin" theme="light" level={4} />
146
- <DxcLink text="Test" margin="xlarge" href="https://www.linkedin.com/"></DxcLink>
177
+ <DxcLink margin="xlarge" href="https://www.linkedin.com/">
178
+ Test
179
+ </DxcLink>
147
180
  <Title title="Xxlarge margin" theme="light" level={4} />
148
- <DxcLink text="Test" margin="xxlarge" href="https://www.linkedin.com/"></DxcLink>
181
+ <DxcLink margin="xxlarge" href="https://www.linkedin.com/">
182
+ Test
183
+ </DxcLink>
149
184
  </ExampleContainer>
150
185
  </>
151
186
  );
package/link/Link.test.js CHANGED
@@ -10,49 +10,43 @@ var _Link = _interopRequireDefault(require("./Link"));
10
10
 
11
11
  describe("Link component tests", function () {
12
12
  test("Link renders with correct text", function () {
13
- var _render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Link["default"], {
14
- text: "Link"
15
- })),
13
+ var _render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Link["default"], null, "Link")),
16
14
  getByText = _render.getByText;
17
15
 
18
16
  expect(getByText("Link")).toBeTruthy();
19
17
  });
20
18
  test("Link renders with correct href", function () {
21
19
  var _render2 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Link["default"], {
22
- text: "Link",
23
20
  href: "/testPage"
24
- })),
21
+ }, "Link")),
25
22
  getByRole = _render2.getByRole;
26
23
 
27
24
  expect(getByRole("link").getAttribute("href")).toEqual("/testPage");
28
25
  });
29
26
  test("Link renders with correct disabled state", function () {
30
27
  var _render3 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Link["default"], {
31
- text: "Link",
32
28
  href: "/testPage",
33
29
  disabled: true
34
- })),
30
+ }, "Link")),
35
31
  getByText = _render3.getByText;
36
32
 
37
33
  expect(getByText("Link").hasAttribute("href")).toBeFalsy();
38
34
 
39
35
  var _render4 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Link["default"], {
40
- text: "LinkButton",
41
36
  onClick: function onClick() {
42
37
  return console.log("Andorra");
43
38
  },
44
39
  disabled: true
45
- })),
40
+ }, "LinkButton")),
46
41
  getByTextLinkButton = _render4.getByText;
47
42
 
48
43
  expect(getByTextLinkButton("LinkButton").hasAttribute("onclick")).toBeFalsy();
49
44
  });
50
45
  test("Link open new tab", function () {
51
46
  var _render5 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Link["default"], {
52
- text: "Link",
53
47
  href: "/testPage",
54
48
  newWindow: true
55
- })),
49
+ }, "Link")),
56
50
  getByRole = _render5.getByRole;
57
51
 
58
52
  expect(getByRole("link").getAttribute("target")).toEqual("_blank");
@@ -61,9 +55,8 @@ describe("Link component tests", function () {
61
55
  var onClick = jest.fn();
62
56
 
63
57
  var _render6 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Link["default"], {
64
- text: "Link",
65
58
  onClick: onClick
66
- })),
59
+ }, "Link")),
67
60
  getByText = _render6.getByText;
68
61
 
69
62
  var link = getByText("Link");
@@ -76,10 +69,9 @@ describe("Link component tests", function () {
76
69
  var onClick = jest.fn();
77
70
 
78
71
  var _render7 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Link["default"], {
79
- text: "Link",
80
72
  onClick: onClick,
81
73
  disabled: true
82
- })),
74
+ }, "Link")),
83
75
  getByText = _render7.getByText;
84
76
 
85
77
  var link = getByText("Link");
package/link/types.d.ts CHANGED
@@ -1,12 +1,13 @@
1
1
  /// <reference types="react" />
2
- declare type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
3
- declare type Margin = {
2
+ export declare type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
3
+ export declare type Margin = {
4
4
  top?: Space;
5
5
  bottom?: Space;
6
6
  left?: Space;
7
7
  right?: Space;
8
8
  };
9
- declare type LinkCommonProps = {
9
+ declare type SVG = React.SVGProps<SVGSVGElement>;
10
+ export declare type LinkProps = {
10
11
  /**
11
12
  * If true, the color is inherited from parent.
12
13
  */
@@ -41,30 +42,14 @@ declare type LinkCommonProps = {
41
42
  * Value of the tabindex.
42
43
  */
43
44
  tabIndex?: number;
44
- };
45
- export declare type LinkTextProps = LinkCommonProps & {
46
45
  /**
47
- * Link text.
46
+ * Content of the link. To use the component with other libraries (such as React Router or Next.js Link) pass the custom link as a child.
47
+ * The component will apply the styles to the custom link.
48
48
  */
49
- text: string;
49
+ children?: React.ReactNode;
50
50
  /**
51
51
  * Element or path used as the icon that will be placed next to the link text.
52
52
  */
53
53
  icon?: string | SVG;
54
54
  };
55
- export declare type LinkIconProps = LinkCommonProps & {
56
- /**
57
- * Link text.
58
- */
59
- text?: string;
60
- /**
61
- * Element or path used as the icon that will be placed next to the link text.
62
- */
63
- icon: string | SVG;
64
- };
65
- declare type Overload = {
66
- (props: LinkTextProps): JSX.Element;
67
- (props: LinkIconProps): JSX.Element;
68
- };
69
- declare type SVG = React.SVGProps<SVGSVGElement>;
70
- export default Overload;
55
+ export {};
package/main.d.ts CHANGED
@@ -41,6 +41,7 @@ import DxcList from "./list/List";
41
41
  import DxcRadioGroup from "./radio-group/RadioGroup";
42
42
  import DxcBleed from "./bleed/Bleed";
43
43
  import DxcInset from "./inset/Inset";
44
- import ThemeContext, { ThemeProvider } from "./ThemeContext";
44
+ import DxcQuickNav from "./quick-nav/QuickNav";
45
+ import HalstackContext, { HalstackProvider, HalstackLanguageContext } from "./HalstackContext";
45
46
  import { BackgroundColorProvider } from "./BackgroundColorContext";
46
- export { DxcAlert, DxcButton, DxcFooter, DxcCheckbox, DxcTextInput, DxcDropdown, DxcSwitch, DxcSlider, DxcRadio, DxcHeader, DxcTable, DxcTabs, DxcToggleGroup, DxcDialog, DxcCard, DxcProgressBar, DxcAccordion, DxcSpinner, DxcBox, DxcTag, DxcPaginator, DxcSidenav, DxcWizard, DxcLink, DxcHeading, DxcResultsetTable, DxcChip, DxcApplicationLayout, ThemeContext, ThemeProvider, BackgroundColorProvider, DxcAccordionGroup, DxcBadge, DxcPasswordInput, DxcDateInput, DxcNumberInput, DxcTextarea, DxcSelect, DxcFileInput, DxcStack, DxcRow, DxcText, DxcList, DxcRadioGroup, DxcBleed, DxcInset };
47
+ export { DxcAlert, DxcButton, DxcFooter, DxcCheckbox, DxcTextInput, DxcDropdown, DxcSwitch, DxcSlider, DxcRadio, DxcHeader, DxcTable, DxcTabs, DxcToggleGroup, DxcDialog, DxcCard, DxcProgressBar, DxcAccordion, DxcSpinner, DxcBox, DxcTag, DxcPaginator, DxcSidenav, DxcWizard, DxcLink, DxcHeading, DxcResultsetTable, DxcChip, DxcApplicationLayout, HalstackContext, HalstackLanguageContext, HalstackProvider, BackgroundColorProvider, DxcAccordionGroup, DxcBadge, DxcPasswordInput, DxcDateInput, DxcNumberInput, DxcTextarea, DxcSelect, DxcFileInput, DxcStack, DxcRow, DxcText, DxcList, DxcRadioGroup, DxcBleed, DxcInset, DxcQuickNav, };
package/main.js CHANGED
@@ -163,6 +163,12 @@ Object.defineProperty(exports, "DxcProgressBar", {
163
163
  return _ProgressBar["default"];
164
164
  }
165
165
  });
166
+ Object.defineProperty(exports, "DxcQuickNav", {
167
+ enumerable: true,
168
+ get: function get() {
169
+ return _QuickNav["default"];
170
+ }
171
+ });
166
172
  Object.defineProperty(exports, "DxcRadio", {
167
173
  enumerable: true,
168
174
  get: function get() {
@@ -271,16 +277,22 @@ Object.defineProperty(exports, "DxcWizard", {
271
277
  return _Wizard["default"];
272
278
  }
273
279
  });
274
- Object.defineProperty(exports, "ThemeContext", {
280
+ Object.defineProperty(exports, "HalstackContext", {
275
281
  enumerable: true,
276
282
  get: function get() {
277
- return _ThemeContext["default"];
283
+ return _HalstackContext["default"];
278
284
  }
279
285
  });
280
- Object.defineProperty(exports, "ThemeProvider", {
286
+ Object.defineProperty(exports, "HalstackLanguageContext", {
281
287
  enumerable: true,
282
288
  get: function get() {
283
- return _ThemeContext.ThemeProvider;
289
+ return _HalstackContext.HalstackLanguageContext;
290
+ }
291
+ });
292
+ Object.defineProperty(exports, "HalstackProvider", {
293
+ enumerable: true,
294
+ get: function get() {
295
+ return _HalstackContext.HalstackProvider;
284
296
  }
285
297
  });
286
298
 
@@ -370,7 +382,9 @@ var _Bleed = _interopRequireDefault(require("./bleed/Bleed"));
370
382
 
371
383
  var _Inset = _interopRequireDefault(require("./inset/Inset"));
372
384
 
373
- var _ThemeContext = _interopRequireWildcard(require("./ThemeContext"));
385
+ var _QuickNav = _interopRequireDefault(require("./quick-nav/QuickNav"));
386
+
387
+ var _HalstackContext = _interopRequireWildcard(require("./HalstackContext"));
374
388
 
375
389
  var _BackgroundColorContext = require("./BackgroundColorContext");
376
390
 
@@ -135,16 +135,14 @@ describe("Number input component tests", function () {
135
135
  _userEvent["default"].type(number, "t");
136
136
 
137
137
  expect(onChange).not.toHaveBeenCalledWith({
138
- value: "t",
139
- error: null
138
+ value: "t"
140
139
  });
141
140
  expect(number.value).toBe("");
142
141
 
143
142
  _userEvent["default"].type(number, "1");
144
143
 
145
144
  expect(onChange).toHaveBeenCalledWith({
146
- value: "1",
147
- error: null
145
+ value: "1"
148
146
  });
149
147
  expect(number.value).toBe("1");
150
148
  });
@@ -54,7 +54,7 @@ declare type Props = {
54
54
  * lower than min, the onBlur and onChange functions will be called with
55
55
  * the current value and an internal error informing that the current
56
56
  * value is not correct. If a valid state is reached, the error parameter
57
- * will be null in both events.
57
+ * will not be defined in both events.
58
58
  */
59
59
  min?: number;
60
60
  /**
@@ -62,7 +62,7 @@ declare type Props = {
62
62
  * surpasses max, the onBlur and onChange functions will be called with
63
63
  * the current value and an internal error informing that the current
64
64
  * value is not correct. If a valid state is reached, the error parameter
65
- * will be null in both events.
65
+ * will not be defined in both events.
66
66
  */
67
67
  max?: number;
68
68
  /**
@@ -73,26 +73,29 @@ declare type Props = {
73
73
  * This function will be called when the user types within the input
74
74
  * element of the component. An object including the current value and
75
75
  * the error (if the value entered is not valid) will be passed to this
76
- * function. If there is no error, error will be null.
76
+ * function. If there is no error, error will not be defined.
77
77
  */
78
78
  onChange?: (val: {
79
79
  value: string;
80
- error: string | null;
80
+ error?: string;
81
81
  }) => void;
82
82
  /**
83
83
  * This function will be called when the input element loses the focus.
84
84
  * An object including the input value and the error (if the value
85
85
  * entered is not valid) will be passed to this function. If there is no error,
86
- * error will be null.
86
+ * error will not be defined.
87
87
  */
88
88
  onBlur?: (val: {
89
89
  value: string;
90
- error: string | null;
90
+ error?: string;
91
91
  }) => void;
92
92
  /**
93
- * If it is defined, the component will change its appearance, showing
94
- * the error below the input component. If it is not defined, the error
95
- * messages will be managed internally, but never displayed on its own.
93
+ * If it is a defined value and also a truthy string, the component will
94
+ * change its appearance, showing the error below the input component. If
95
+ * the defined value is an empty string, it will reserve a space below
96
+ * the component for a future error, but it would not change its look. In
97
+ * case of being undefined or null, both the appearance and the space for
98
+ * the error message would not be modified.
96
99
  */
97
100
  error?: string;
98
101
  /**
@@ -106,7 +109,7 @@ declare type Props = {
106
109
  */
107
110
  margin?: Space | Margin;
108
111
  /**
109
- * Size of the component ('small' | 'medium' | 'large' | 'fillParent').
112
+ * Size of the component.
110
113
  */
111
114
  size?: "small" | "medium" | "large" | "fillParent";
112
115
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxc-technology/halstack-react",
3
- "version": "0.0.0-c25d3b6",
3
+ "version": "0.0.0-c2834c3",
4
4
  "description": "DXC Halstack React components library",
5
5
  "repository": "dxc-technology/halstack-react",
6
6
  "homepage": "http://developer.dxc.com/tools/react",
@@ -18,7 +18,7 @@
18
18
  "styled-components": "^5.0.1"
19
19
  },
20
20
  "dependencies": {
21
- "@date-io/date-fns": "^1.3.9",
21
+ "@date-io/dayjs": "^1.3.9",
22
22
  "@material-ui/core": "4.11.1",
23
23
  "@material-ui/icons": "4.4.3",
24
24
  "@material-ui/lab": "4.0.0-alpha.17",
@@ -27,17 +27,17 @@
27
27
  "@types/styled-components": "^5.1.24",
28
28
  "@types/uuid": "^8.3.4",
29
29
  "color": "^3.1.3",
30
- "date-fns": "^2.0.0-beta.4",
31
- "moment": "2.24.0",
30
+ "dayjs": "^1.11.1",
32
31
  "prop-types": "^15.7.2",
33
32
  "rgb-hex": "^3.0.0",
33
+ "slugify": "^1.6.5",
34
34
  "uuid": "^8.3.2"
35
35
  },
36
36
  "scripts": {
37
37
  "test": "jest",
38
38
  "test:watch": "npm test -- --watch --coverage",
39
39
  "build": "babel src --extensions .js,.jsx,.ts,.tsx --out-dir ../dist --copy-files --verbose && node ../scripts/build/copy-package.js && tsc ",
40
- "build:watch": "babel src --watch --out-dir ../dist --copy-files --verbose",
40
+ "build:watch": "babel src --watch --extensions .js,.jsx,.ts,.tsx --out-dir ../dist --copy-files --verbose",
41
41
  "storybook": "start-storybook -p 6006",
42
42
  "build-storybook": "build-storybook"
43
43
  },
@@ -57,6 +57,7 @@
57
57
  "@storybook/testing-library": "0.0.7",
58
58
  "@testing-library/react": "^11.2.5",
59
59
  "@testing-library/user-event": "^12.6.3",
60
+ "@types/react": "16.9.5",
60
61
  "babel-jest": "^24.8.0",
61
62
  "babel-loader": "^8.0.6",
62
63
  "chromatic": "^6.3.3",