@dxc-technology/halstack-react 0.0.0-ebf4fe2 → 0.0.0-ec06b53

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 (179) hide show
  1. package/HalstackContext.js +7 -8
  2. package/accordion/Accordion.js +122 -103
  3. package/accordion/Accordion.stories.tsx +2 -3
  4. package/accordion/Accordion.test.js +9 -10
  5. package/accordion/types.d.ts +5 -4
  6. package/accordion-group/AccordionGroup.js +1 -21
  7. package/accordion-group/AccordionGroup.stories.tsx +27 -1
  8. package/accordion-group/AccordionGroup.test.js +20 -45
  9. package/accordion-group/types.d.ts +10 -3
  10. package/alert/Alert.js +1 -1
  11. package/bleed/Bleed.stories.tsx +63 -63
  12. package/box/Box.js +1 -1
  13. package/box/types.d.ts +1 -0
  14. package/bulleted-list/BulletedList.d.ts +7 -0
  15. package/bulleted-list/BulletedList.js +123 -0
  16. package/bulleted-list/BulletedList.stories.tsx +200 -0
  17. package/bulleted-list/types.d.ts +11 -0
  18. package/{inline → bulleted-list}/types.js +0 -0
  19. package/button/Button.js +43 -61
  20. package/button/Button.stories.tsx +9 -0
  21. package/button/types.d.ts +7 -7
  22. package/card/types.d.ts +1 -0
  23. package/checkbox/Checkbox.d.ts +2 -2
  24. package/checkbox/Checkbox.js +92 -99
  25. package/checkbox/Checkbox.stories.tsx +79 -59
  26. package/checkbox/Checkbox.test.js +93 -16
  27. package/checkbox/types.d.ts +6 -2
  28. package/chip/types.d.ts +1 -1
  29. package/common/variables.js +75 -33
  30. package/date-input/Calendar.d.ts +4 -0
  31. package/date-input/Calendar.js +258 -0
  32. package/date-input/DateInput.js +77 -222
  33. package/date-input/DateInput.stories.tsx +30 -17
  34. package/date-input/DateInput.test.js +411 -138
  35. package/date-input/DatePicker.d.ts +4 -0
  36. package/date-input/DatePicker.js +160 -0
  37. package/date-input/YearPicker.d.ts +4 -0
  38. package/date-input/YearPicker.js +115 -0
  39. package/date-input/types.d.ts +53 -0
  40. package/dialog/Dialog.js +52 -28
  41. package/dialog/Dialog.stories.tsx +57 -2
  42. package/dialog/Dialog.test.js +34 -4
  43. package/dialog/types.d.ts +3 -2
  44. package/dropdown/Dropdown.d.ts +1 -1
  45. package/dropdown/Dropdown.js +247 -247
  46. package/dropdown/Dropdown.stories.tsx +126 -63
  47. package/dropdown/Dropdown.test.js +504 -108
  48. package/dropdown/DropdownMenu.d.ts +4 -0
  49. package/dropdown/DropdownMenu.js +80 -0
  50. package/dropdown/DropdownMenuItem.d.ts +4 -0
  51. package/dropdown/DropdownMenuItem.js +92 -0
  52. package/dropdown/types.d.ts +25 -5
  53. package/file-input/FileInput.d.ts +2 -2
  54. package/file-input/FileInput.js +177 -219
  55. package/file-input/FileInput.stories.tsx +38 -10
  56. package/file-input/FileInput.test.js +53 -12
  57. package/file-input/FileItem.d.ts +4 -14
  58. package/file-input/FileItem.js +38 -63
  59. package/file-input/types.d.ts +17 -0
  60. package/flex/Flex.d.ts +4 -0
  61. package/flex/Flex.js +69 -0
  62. package/flex/Flex.stories.tsx +103 -0
  63. package/flex/types.d.ts +32 -0
  64. package/{list → flex}/types.js +0 -0
  65. package/footer/Footer.stories.tsx +8 -1
  66. package/footer/types.d.ts +2 -1
  67. package/header/Header.js +74 -72
  68. package/header/Header.stories.tsx +4 -4
  69. package/header/Icons.js +2 -2
  70. package/header/types.d.ts +3 -2
  71. package/inset/Inset.stories.tsx +4 -4
  72. package/layout/ApplicationLayout.d.ts +15 -6
  73. package/layout/ApplicationLayout.js +36 -64
  74. package/layout/ApplicationLayout.stories.tsx +80 -44
  75. package/layout/types.d.ts +17 -27
  76. package/link/Link.js +2 -2
  77. package/link/Link.stories.tsx +13 -6
  78. package/link/types.d.ts +1 -1
  79. package/main.d.ts +5 -9
  80. package/main.js +27 -59
  81. package/number-input/NumberInput.test.js +43 -7
  82. package/package.json +16 -20
  83. package/paginator/Paginator.js +2 -2
  84. package/paginator/Paginator.test.js +1 -1
  85. package/paragraph/Paragraph.d.ts +6 -0
  86. package/paragraph/Paragraph.js +38 -0
  87. package/paragraph/Paragraph.stories.tsx +44 -0
  88. package/password-input/PasswordInput.test.js +13 -12
  89. package/progress-bar/ProgressBar.d.ts +2 -2
  90. package/progress-bar/ProgressBar.js +56 -50
  91. package/progress-bar/ProgressBar.stories.jsx +3 -1
  92. package/progress-bar/ProgressBar.test.js +67 -22
  93. package/progress-bar/types.d.ts +3 -4
  94. package/quick-nav/QuickNav.js +18 -17
  95. package/quick-nav/QuickNav.stories.tsx +131 -26
  96. package/radio-group/Radio.d.ts +1 -1
  97. package/radio-group/Radio.js +43 -28
  98. package/radio-group/RadioGroup.js +23 -22
  99. package/radio-group/RadioGroup.stories.tsx +1 -0
  100. package/radio-group/RadioGroup.test.js +123 -96
  101. package/radio-group/types.d.ts +2 -2
  102. package/resultsetTable/Icons.d.ts +7 -0
  103. package/resultsetTable/Icons.js +51 -0
  104. package/resultsetTable/ResultsetTable.js +48 -107
  105. package/resultsetTable/ResultsetTable.stories.tsx +50 -25
  106. package/resultsetTable/ResultsetTable.test.js +23 -41
  107. package/resultsetTable/types.d.ts +2 -2
  108. package/select/Listbox.d.ts +1 -1
  109. package/select/Listbox.js +25 -2
  110. package/select/Select.js +17 -32
  111. package/select/Select.stories.tsx +6 -5
  112. package/select/Select.test.js +321 -250
  113. package/select/types.d.ts +2 -4
  114. package/sidenav/Sidenav.d.ts +6 -5
  115. package/sidenav/Sidenav.js +176 -55
  116. package/sidenav/Sidenav.stories.tsx +154 -156
  117. package/sidenav/Sidenav.test.js +25 -37
  118. package/sidenav/types.d.ts +50 -27
  119. package/slider/Slider.d.ts +2 -2
  120. package/slider/Slider.js +120 -95
  121. package/slider/Slider.stories.tsx +7 -1
  122. package/slider/Slider.test.js +121 -21
  123. package/slider/types.d.ts +6 -2
  124. package/switch/Switch.d.ts +2 -2
  125. package/switch/Switch.js +135 -68
  126. package/switch/Switch.stories.tsx +8 -30
  127. package/switch/Switch.test.js +144 -17
  128. package/switch/types.d.ts +6 -2
  129. package/table/Table.js +1 -1
  130. package/table/Table.test.js +1 -1
  131. package/tabs/Tab.d.ts +4 -0
  132. package/tabs/Tab.js +135 -0
  133. package/tabs/Tabs.js +360 -104
  134. package/tabs/Tabs.stories.tsx +74 -0
  135. package/tabs/Tabs.test.js +217 -6
  136. package/tabs/types.d.ts +15 -5
  137. package/tabs-nav/NavTabs.js +5 -5
  138. package/tabs-nav/Tab.js +3 -5
  139. package/tabs-nav/types.d.ts +1 -1
  140. package/tag/Tag.js +1 -1
  141. package/tag/types.d.ts +1 -1
  142. package/text-input/Icons.d.ts +8 -0
  143. package/text-input/Icons.js +60 -0
  144. package/text-input/Suggestion.js +7 -5
  145. package/text-input/Suggestions.d.ts +4 -0
  146. package/text-input/Suggestions.js +134 -0
  147. package/text-input/TextInput.js +189 -282
  148. package/text-input/TextInput.stories.tsx +189 -182
  149. package/text-input/TextInput.test.js +639 -727
  150. package/text-input/types.d.ts +22 -3
  151. package/toggle-group/types.d.ts +1 -1
  152. package/typography/Typography.d.ts +4 -0
  153. package/typography/Typography.js +131 -0
  154. package/typography/Typography.stories.tsx +198 -0
  155. package/typography/types.d.ts +18 -0
  156. package/{row → typography}/types.js +0 -0
  157. package/wizard/Wizard.js +9 -16
  158. package/wizard/Wizard.stories.tsx +20 -1
  159. package/wizard/types.d.ts +5 -4
  160. package/inline/Inline.d.ts +0 -4
  161. package/inline/Inline.js +0 -60
  162. package/inline/Inline.stories.tsx +0 -305
  163. package/inline/types.d.ts +0 -36
  164. package/list/List.d.ts +0 -4
  165. package/list/List.js +0 -47
  166. package/list/List.stories.tsx +0 -89
  167. package/list/types.d.ts +0 -7
  168. package/row/Row.d.ts +0 -3
  169. package/row/Row.js +0 -127
  170. package/row/Row.stories.tsx +0 -237
  171. package/row/types.d.ts +0 -28
  172. package/stack/Stack.d.ts +0 -4
  173. package/stack/Stack.js +0 -52
  174. package/stack/Stack.stories.tsx +0 -225
  175. package/stack/types.d.ts +0 -28
  176. package/stack/types.js +0 -5
  177. package/text/Text.d.ts +0 -7
  178. package/text/Text.js +0 -30
  179. package/text/Text.stories.tsx +0 -19
@@ -1,6 +1,5 @@
1
1
  import React from "react";
2
2
  import DxcApplicationLayout from "./ApplicationLayout";
3
- import DxcSidenav from "../sidenav/Sidenav";
4
3
  import Title from "../../.storybook/components/Title";
5
4
  import { INITIAL_VIEWPORTS } from "@storybook/addon-viewport";
6
5
 
@@ -30,15 +29,25 @@ export const DefaultApplicationLayout = () => (
30
29
 
31
30
  export const ApplicationLayoutWithDefaultSidenav = () => (
32
31
  <>
33
- <DxcApplicationLayout>
34
- <DxcApplicationLayout.SideNav>
35
- <DxcSidenav.Title>Application layout with sidenav</DxcSidenav.Title>
36
- <p>SideNav Content</p>
37
- <p>SideNav Content</p>
38
- <p>SideNav Content</p>
39
- <p>SideNav Content</p>
40
- <p>SideNav Content</p>
41
- </DxcApplicationLayout.SideNav>
32
+ <DxcApplicationLayout
33
+ sidenav={
34
+ <DxcApplicationLayout.SideNav
35
+ title={
36
+ <DxcApplicationLayout.SideNav.Title>
37
+ Application layout with push sidenav
38
+ </DxcApplicationLayout.SideNav.Title>
39
+ }
40
+ >
41
+ <DxcApplicationLayout.SideNav.Section>
42
+ <p>SideNav Content</p>
43
+ <p>SideNav Content</p>
44
+ <p>SideNav Content</p>
45
+ <p>SideNav Content</p>
46
+ <p>SideNav Content</p>
47
+ </DxcApplicationLayout.SideNav.Section>
48
+ </DxcApplicationLayout.SideNav>
49
+ }
50
+ >
42
51
  <DxcApplicationLayout.Main>
43
52
  <p>Main Content</p>
44
53
  <p>Main Content</p>
@@ -51,15 +60,26 @@ export const ApplicationLayoutWithDefaultSidenav = () => (
51
60
 
52
61
  export const ApplicationLayoutWithResponsiveSidenav = () => (
53
62
  <>
54
- <DxcApplicationLayout visibilityToggleLabel="Example">
55
- <DxcApplicationLayout.SideNav>
56
- <DxcSidenav.Title>Application layout with push sidenav</DxcSidenav.Title>
57
- <p>SideNav Content</p>
58
- <p>SideNav Content</p>
59
- <p>SideNav Content</p>
60
- <p>SideNav Content</p>
61
- <p>SideNav Content</p>
62
- </DxcApplicationLayout.SideNav>
63
+ <DxcApplicationLayout
64
+ visibilityToggleLabel="Example"
65
+ sidenav={
66
+ <DxcApplicationLayout.SideNav
67
+ title={
68
+ <DxcApplicationLayout.SideNav.Title>
69
+ Application layout with push sidenav
70
+ </DxcApplicationLayout.SideNav.Title>
71
+ }
72
+ >
73
+ <DxcApplicationLayout.SideNav.Section>
74
+ <p>SideNav Content</p>
75
+ <p>SideNav Content</p>
76
+ <p>SideNav Content</p>
77
+ <p>SideNav Content</p>
78
+ <p>SideNav Content</p>
79
+ </DxcApplicationLayout.SideNav.Section>
80
+ </DxcApplicationLayout.SideNav>
81
+ }
82
+ >
63
83
  <DxcApplicationLayout.Main>
64
84
  <p>Main Content</p>
65
85
  <p>Main Content</p>
@@ -74,23 +94,31 @@ ApplicationLayoutWithResponsiveSidenav.parameters = {
74
94
  viewport: {
75
95
  defaultViewport: "pixel",
76
96
  },
97
+ chromatic: { viewports: [540] },
77
98
  };
78
99
 
79
100
  export const ApplicationLayoutWithCustomHeader = () => (
80
101
  <>
81
- <DxcApplicationLayout>
82
- <DxcApplicationLayout.Header>
83
- {" "}
84
- <p>Custom Header</p>{" "}
85
- </DxcApplicationLayout.Header>
86
- <DxcApplicationLayout.SideNav>
87
- <DxcSidenav.Title>Application layout with custom header</DxcSidenav.Title>
88
- <p>SideNav Content</p>
89
- <p>SideNav Content</p>
90
- <p>SideNav Content</p>
91
- <p>SideNav Content</p>
92
- <p>SideNav Content</p>
93
- </DxcApplicationLayout.SideNav>
102
+ <DxcApplicationLayout
103
+ header={<p>Custom Header</p>}
104
+ sidenav={
105
+ <DxcApplicationLayout.SideNav
106
+ title={
107
+ <DxcApplicationLayout.SideNav.Title>
108
+ Application layout with push sidenav
109
+ </DxcApplicationLayout.SideNav.Title>
110
+ }
111
+ >
112
+ <DxcApplicationLayout.SideNav.Section>
113
+ <p>SideNav Content</p>
114
+ <p>SideNav Content</p>
115
+ <p>SideNav Content</p>
116
+ <p>SideNav Content</p>
117
+ <p>SideNav Content</p>
118
+ </DxcApplicationLayout.SideNav.Section>
119
+ </DxcApplicationLayout.SideNav>
120
+ }
121
+ >
94
122
  <DxcApplicationLayout.Main>
95
123
  <p>Main Content</p>
96
124
  <p>Main Content</p>
@@ -103,24 +131,32 @@ export const ApplicationLayoutWithCustomHeader = () => (
103
131
 
104
132
  export const ApplicationLayoutWithCustomFooter = () => (
105
133
  <>
106
- <DxcApplicationLayout>
107
- <DxcApplicationLayout.SideNav>
108
- <DxcSidenav.Title>Application layout with custom footer</DxcSidenav.Title>
109
- <p>SideNav Content</p>
110
- <p>SideNav Content</p>
111
- <p>SideNav Content</p>
112
- <p>SideNav Content</p>
113
- <p>SideNav Content</p>
114
- </DxcApplicationLayout.SideNav>
134
+ <DxcApplicationLayout
135
+ footer={<p>Custom Footer</p>}
136
+ sidenav={
137
+ <DxcApplicationLayout.SideNav
138
+ title={
139
+ <DxcApplicationLayout.SideNav.Title>
140
+ Application layout with push sidenav
141
+ </DxcApplicationLayout.SideNav.Title>
142
+ }
143
+ >
144
+ <DxcApplicationLayout.SideNav.Section>
145
+ <p>SideNav Content</p>
146
+ <p>SideNav Content</p>
147
+ <p>SideNav Content</p>
148
+ <p>SideNav Content</p>
149
+ <p>SideNav Content</p>
150
+ </DxcApplicationLayout.SideNav.Section>
151
+ </DxcApplicationLayout.SideNav>
152
+ }
153
+ >
115
154
  <DxcApplicationLayout.Main>
116
155
  <p>Main Content</p>
117
156
  <p>Main Content</p>
118
157
  <p>Main Content</p>
119
158
  <p>Main Content</p>
120
159
  </DxcApplicationLayout.Main>
121
- <DxcApplicationLayout.Footer>
122
- <p>Custom Footer</p>
123
- </DxcApplicationLayout.Footer>
124
160
  </DxcApplicationLayout>
125
161
  </>
126
162
  );
package/layout/types.d.ts CHANGED
@@ -1,42 +1,20 @@
1
1
  /// <reference types="react" />
2
- declare type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
3
- declare type Padding = {
4
- top?: Space;
5
- bottom?: Space;
6
- left?: Space;
7
- right?: Space;
8
- };
9
- declare type ChildrenType = AppLayoutHeaderPropsType | AppLayoutMainPropsType | AppLayoutFooterPropsType | AppLayoutSidenavPropsType;
10
- export declare type AppLayoutHeaderPropsType = {
11
- /**
12
- * Everything between this tags will be displayed as a header, at the top of the screen.
13
- * This is optional and if it is not specified, the DxcHeader will be shown by default.
14
- */
15
- children?: React.ReactNode;
16
- };
2
+ declare type ChildrenType = AppLayoutMainPropsType | AppLayoutSidenavPropsType;
17
3
  export declare type AppLayoutMainPropsType = {
18
4
  /**
19
5
  * Everything between the tags will be displayed as the content of the main part of the application.
20
6
  */
21
7
  children: React.ReactNode;
22
8
  };
23
- export declare type AppLayoutFooterPropsType = {
24
- /**
25
- * Everything between the tags will be displayed as a footer, at the bottom of the screen.
26
- * This is optional and if it is not specified, the DxcFooter will be shown by default.
27
- */
28
- children?: React.ReactNode;
29
- };
30
9
  export declare type AppLayoutSidenavPropsType = {
31
10
  /**
32
- * Size of the padding to be applied to the custom area ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
33
- * You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different padding sizes.
11
+ * The area inside the sidenav. This area can be used to render the content inside the sidenav.
34
12
  */
35
- padding?: Space | Padding;
13
+ children: React.ReactNode;
36
14
  /**
37
- * The area inside the sidenav. This area can be used to render custom content.
15
+ * The area assigned to render the sidenav title. It is highly recommended to use the sidenav title.
38
16
  */
39
- children: React.ReactNode;
17
+ title?: React.ReactNode;
40
18
  };
41
19
  declare type AppLayoutPropsType = {
42
20
  /**
@@ -44,6 +22,18 @@ declare type AppLayoutPropsType = {
44
22
  * visibility of the sidenav.
45
23
  */
46
24
  visibilityToggleLabel?: string;
25
+ /**
26
+ * Header content.
27
+ */
28
+ header?: React.ReactNode;
29
+ /**
30
+ * Sidenav content
31
+ */
32
+ sidenav?: React.ReactNode;
33
+ /**
34
+ * Footer content
35
+ */
36
+ footer?: React.ReactNode;
47
37
  /**
48
38
  * The area inside the sidenav. This area can be used to render custom content.
49
39
  */
package/link/Link.js CHANGED
@@ -68,7 +68,7 @@ var DxcLink = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
68
68
  }, /*#__PURE__*/_react["default"].createElement(StyledLink, (0, _extends2["default"])({
69
69
  as: href ? "a" : "button",
70
70
  tabIndex: tabIndex,
71
- onClick: !disabled && onClick,
71
+ onClick: !disabled ? onClick : undefined,
72
72
  href: !disabled && href ? href : undefined,
73
73
  target: href ? newWindow ? "_blank" : "_self" : undefined,
74
74
  disabled: disabled,
@@ -82,7 +82,7 @@ var DxcLink = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
82
82
  })));
83
83
  });
84
84
 
85
- var StyledLink = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n\n background: none;\n border: none;\n padding: 0;\n cursor: pointer;\n font-size: ", ";\n font-weight: ", ";\n font-style: ", ";\n font-family: ", ";\n text-decoration-color: transparent;\n width: fit-content;\n\n ", "\n ", "\n color: ", ";\n ", "\n\n &:visited {\n color: ", ";\n &:hover {\n ", "\n }\n }\n &:hover {\n ", "\n }\n &:focus {\n border-radius: 2px;\n outline: 2px solid ", ";\n ", "\n }\n &:active {\n ", "\n }\n"])), function (props) {
85
+ var StyledLink = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n align-items: baseline;\n\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n\n background: none;\n border: none;\n padding: 0;\n cursor: pointer;\n font-size: ", ";\n font-weight: ", ";\n font-style: ", ";\n font-family: ", ";\n text-decoration-color: transparent;\n width: fit-content;\n\n ", "\n ", "\n color: ", ";\n ", "\n\n &:visited {\n color: ", ";\n &:hover {\n ", "\n }\n }\n &:hover {\n ", "\n }\n &:focus {\n border-radius: 2px;\n outline: 2px solid ", ";\n ", "\n }\n &:active {\n ", "\n }\n"])), function (props) {
86
86
  return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
87
87
  }, function (props) {
88
88
  return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
@@ -9,7 +9,7 @@ export default {
9
9
  };
10
10
 
11
11
  const icon = (
12
- <svg viewBox="0 0 24 24" enable-background="new 0 0 24 24" fill="currentColor">
12
+ <svg viewBox="0 0 24 24" enableBackground="new 0 0 24 24" fill="currentColor">
13
13
  <g id="Bounding_Box">
14
14
  <rect fill="none" width="24" height="24" />
15
15
  </g>
@@ -68,11 +68,18 @@ export const Chromatic = () => (
68
68
  </ExampleContainer>
69
69
  <ExampleContainer pseudoState="pseudo-hover">
70
70
  <Title title="Long text with hover" theme="light" level={4} />
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.
71
+ Lorem{" "}
72
+ <DxcLink href="https://www.google.com" icon={icon}>
73
+ Test
74
+ </DxcLink>{" "}
75
+ ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna
76
+ aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
77
+ consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
78
+ Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit{" "}
79
+ <DxcLink href="https://www.google.com" icon={icon} iconPosition="after">
80
+ Test
81
+ </DxcLink>{" "}
82
+ anim id est laborum.
76
83
  </ExampleContainer>
77
84
  <ExampleContainer pseudoState="pseudo-focus">
78
85
  <Title title="Long text with focus" theme="light" level={4} />
package/link/types.d.ts CHANGED
@@ -6,7 +6,7 @@ export declare type Margin = {
6
6
  left?: Space;
7
7
  right?: Space;
8
8
  };
9
- declare type SVG = React.SVGProps<SVGSVGElement>;
9
+ declare type SVG = React.ReactNode & React.SVGProps<SVGSVGElement>;
10
10
  export declare type LinkProps = {
11
11
  /**
12
12
  * If true, the color is inherited from parent.
package/main.d.ts CHANGED
@@ -5,8 +5,6 @@ import DxcCard from "./card/Card";
5
5
  import DxcCheckbox from "./checkbox/Checkbox";
6
6
  import DxcDialog from "./dialog/Dialog";
7
7
  import DxcDropdown from "./dropdown/Dropdown";
8
- import DxcFooter from "./footer/Footer";
9
- import DxcHeader from "./header/Header";
10
8
  import DxcSlider from "./slider/Slider";
11
9
  import DxcSwitch from "./switch/Switch";
12
10
  import DxcTabs from "./tabs/Tabs";
@@ -16,7 +14,6 @@ import DxcTable from "./table/Table";
16
14
  import DxcBox from "./box/Box";
17
15
  import DxcTag from "./tag/Tag";
18
16
  import DxcPaginator from "./paginator/Paginator";
19
- import DxcSidenav from "./sidenav/Sidenav";
20
17
  import DxcWizard from "./wizard/Wizard";
21
18
  import DxcLink from "./link/Link";
22
19
  import DxcHeading from "./heading/Heading";
@@ -33,16 +30,15 @@ import DxcNumberInput from "./number-input/NumberInput";
33
30
  import DxcTextarea from "./textarea/Textarea";
34
31
  import DxcSelect from "./select/Select";
35
32
  import DxcFileInput from "./file-input/FileInput";
36
- import DxcStack from "./stack/Stack";
37
- import DxcRow from "./row/Row";
38
- import DxcText from "./text/Text";
39
- import DxcList from "./list/List";
40
33
  import DxcRadioGroup from "./radio-group/RadioGroup";
41
34
  import DxcBleed from "./bleed/Bleed";
42
35
  import DxcInset from "./inset/Inset";
43
36
  import DxcQuickNav from "./quick-nav/QuickNav";
44
37
  import DxcNavTabs from "./tabs-nav/NavTabs";
45
- import DxcInline from "./inline/Inline";
38
+ import DxcFlex from "./flex/Flex";
39
+ import DxcTypography from "./typography/Typography";
40
+ import DxcParagraph from "./paragraph/Paragraph";
41
+ import DxcBulletedList from "./bulleted-list/BulletedList";
46
42
  import HalstackContext, { HalstackProvider, HalstackLanguageContext } from "./HalstackContext";
47
43
  import { BackgroundColorProvider } from "./BackgroundColorContext";
48
- export { DxcAlert, DxcButton, DxcFooter, DxcCheckbox, DxcTextInput, DxcDropdown, DxcSwitch, DxcSlider, 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, DxcNavTabs, DxcInline, };
44
+ export { DxcAlert, DxcButton, DxcCheckbox, DxcTextInput, DxcDropdown, DxcSwitch, DxcSlider, DxcTable, DxcTabs, DxcToggleGroup, DxcDialog, DxcCard, DxcProgressBar, DxcAccordion, DxcSpinner, DxcBox, DxcTag, DxcPaginator, DxcWizard, DxcLink, DxcHeading, DxcResultsetTable, DxcChip, DxcApplicationLayout, HalstackContext, HalstackLanguageContext, HalstackProvider, BackgroundColorProvider, DxcAccordionGroup, DxcBadge, DxcPasswordInput, DxcDateInput, DxcNumberInput, DxcTextarea, DxcSelect, DxcFileInput, DxcRadioGroup, DxcBleed, DxcInset, DxcQuickNav, DxcNavTabs, DxcFlex, DxcTypography, DxcParagraph, DxcBulletedList, };
package/main.js CHANGED
@@ -55,6 +55,12 @@ Object.defineProperty(exports, "DxcBox", {
55
55
  return _Box["default"];
56
56
  }
57
57
  });
58
+ Object.defineProperty(exports, "DxcBulletedList", {
59
+ enumerable: true,
60
+ get: function get() {
61
+ return _BulletedList["default"];
62
+ }
63
+ });
58
64
  Object.defineProperty(exports, "DxcButton", {
59
65
  enumerable: true,
60
66
  get: function get() {
@@ -103,16 +109,10 @@ Object.defineProperty(exports, "DxcFileInput", {
103
109
  return _FileInput["default"];
104
110
  }
105
111
  });
106
- Object.defineProperty(exports, "DxcFooter", {
112
+ Object.defineProperty(exports, "DxcFlex", {
107
113
  enumerable: true,
108
114
  get: function get() {
109
- return _Footer["default"];
110
- }
111
- });
112
- Object.defineProperty(exports, "DxcHeader", {
113
- enumerable: true,
114
- get: function get() {
115
- return _Header["default"];
115
+ return _Flex["default"];
116
116
  }
117
117
  });
118
118
  Object.defineProperty(exports, "DxcHeading", {
@@ -121,12 +121,6 @@ Object.defineProperty(exports, "DxcHeading", {
121
121
  return _Heading["default"];
122
122
  }
123
123
  });
124
- Object.defineProperty(exports, "DxcInline", {
125
- enumerable: true,
126
- get: function get() {
127
- return _Inline["default"];
128
- }
129
- });
130
124
  Object.defineProperty(exports, "DxcInset", {
131
125
  enumerable: true,
132
126
  get: function get() {
@@ -139,12 +133,6 @@ Object.defineProperty(exports, "DxcLink", {
139
133
  return _Link["default"];
140
134
  }
141
135
  });
142
- Object.defineProperty(exports, "DxcList", {
143
- enumerable: true,
144
- get: function get() {
145
- return _List["default"];
146
- }
147
- });
148
136
  Object.defineProperty(exports, "DxcNavTabs", {
149
137
  enumerable: true,
150
138
  get: function get() {
@@ -163,6 +151,12 @@ Object.defineProperty(exports, "DxcPaginator", {
163
151
  return _Paginator["default"];
164
152
  }
165
153
  });
154
+ Object.defineProperty(exports, "DxcParagraph", {
155
+ enumerable: true,
156
+ get: function get() {
157
+ return _Paragraph["default"];
158
+ }
159
+ });
166
160
  Object.defineProperty(exports, "DxcPasswordInput", {
167
161
  enumerable: true,
168
162
  get: function get() {
@@ -193,24 +187,12 @@ Object.defineProperty(exports, "DxcResultsetTable", {
193
187
  return _ResultsetTable["default"];
194
188
  }
195
189
  });
196
- Object.defineProperty(exports, "DxcRow", {
197
- enumerable: true,
198
- get: function get() {
199
- return _Row["default"];
200
- }
201
- });
202
190
  Object.defineProperty(exports, "DxcSelect", {
203
191
  enumerable: true,
204
192
  get: function get() {
205
193
  return _Select["default"];
206
194
  }
207
195
  });
208
- Object.defineProperty(exports, "DxcSidenav", {
209
- enumerable: true,
210
- get: function get() {
211
- return _Sidenav["default"];
212
- }
213
- });
214
196
  Object.defineProperty(exports, "DxcSlider", {
215
197
  enumerable: true,
216
198
  get: function get() {
@@ -223,12 +205,6 @@ Object.defineProperty(exports, "DxcSpinner", {
223
205
  return _Spinner["default"];
224
206
  }
225
207
  });
226
- Object.defineProperty(exports, "DxcStack", {
227
- enumerable: true,
228
- get: function get() {
229
- return _Stack["default"];
230
- }
231
- });
232
208
  Object.defineProperty(exports, "DxcSwitch", {
233
209
  enumerable: true,
234
210
  get: function get() {
@@ -253,12 +229,6 @@ Object.defineProperty(exports, "DxcTag", {
253
229
  return _Tag["default"];
254
230
  }
255
231
  });
256
- Object.defineProperty(exports, "DxcText", {
257
- enumerable: true,
258
- get: function get() {
259
- return _Text["default"];
260
- }
261
- });
262
232
  Object.defineProperty(exports, "DxcTextInput", {
263
233
  enumerable: true,
264
234
  get: function get() {
@@ -277,6 +247,12 @@ Object.defineProperty(exports, "DxcToggleGroup", {
277
247
  return _ToggleGroup["default"];
278
248
  }
279
249
  });
250
+ Object.defineProperty(exports, "DxcTypography", {
251
+ enumerable: true,
252
+ get: function get() {
253
+ return _Typography["default"];
254
+ }
255
+ });
280
256
  Object.defineProperty(exports, "DxcWizard", {
281
257
  enumerable: true,
282
258
  get: function get() {
@@ -316,10 +292,6 @@ var _Dialog = _interopRequireDefault(require("./dialog/Dialog"));
316
292
 
317
293
  var _Dropdown = _interopRequireDefault(require("./dropdown/Dropdown"));
318
294
 
319
- var _Footer = _interopRequireDefault(require("./footer/Footer"));
320
-
321
- var _Header = _interopRequireDefault(require("./header/Header"));
322
-
323
295
  var _Slider = _interopRequireDefault(require("./slider/Slider"));
324
296
 
325
297
  var _Switch = _interopRequireDefault(require("./switch/Switch"));
@@ -338,8 +310,6 @@ var _Tag = _interopRequireDefault(require("./tag/Tag"));
338
310
 
339
311
  var _Paginator = _interopRequireDefault(require("./paginator/Paginator"));
340
312
 
341
- var _Sidenav = _interopRequireDefault(require("./sidenav/Sidenav"));
342
-
343
313
  var _Wizard = _interopRequireDefault(require("./wizard/Wizard"));
344
314
 
345
315
  var _Link = _interopRequireDefault(require("./link/Link"));
@@ -372,14 +342,6 @@ var _Select = _interopRequireDefault(require("./select/Select"));
372
342
 
373
343
  var _FileInput = _interopRequireDefault(require("./file-input/FileInput"));
374
344
 
375
- var _Stack = _interopRequireDefault(require("./stack/Stack"));
376
-
377
- var _Row = _interopRequireDefault(require("./row/Row"));
378
-
379
- var _Text = _interopRequireDefault(require("./text/Text"));
380
-
381
- var _List = _interopRequireDefault(require("./list/List"));
382
-
383
345
  var _RadioGroup = _interopRequireDefault(require("./radio-group/RadioGroup"));
384
346
 
385
347
  var _Bleed = _interopRequireDefault(require("./bleed/Bleed"));
@@ -390,7 +352,13 @@ var _QuickNav = _interopRequireDefault(require("./quick-nav/QuickNav"));
390
352
 
391
353
  var _NavTabs = _interopRequireDefault(require("./tabs-nav/NavTabs"));
392
354
 
393
- var _Inline = _interopRequireDefault(require("./inline/Inline"));
355
+ var _Flex = _interopRequireDefault(require("./flex/Flex"));
356
+
357
+ var _Typography = _interopRequireDefault(require("./typography/Typography"));
358
+
359
+ var _Paragraph = _interopRequireDefault(require("./paragraph/Paragraph"));
360
+
361
+ var _BulletedList = _interopRequireDefault(require("./bulleted-list/BulletedList"));
394
362
 
395
363
  var _HalstackContext = _interopRequireWildcard(require("./HalstackContext"));
396
364
 
@@ -83,7 +83,7 @@ describe("Number input component tests", function () {
83
83
  })),
84
84
  getByRole = _render8.getByRole;
85
85
 
86
- var input = getByRole("textbox");
86
+ var input = getByRole("spinbutton");
87
87
 
88
88
  _userEvent["default"].type(input, "1");
89
89
 
@@ -366,12 +366,7 @@ describe("Number input component tests", function () {
366
366
  expect(number.value).toBe("10");
367
367
  });
368
368
  test("Increment and decrement the value with min, max and step", function () {
369
- var onBlur = jest.fn(function (_ref3) {
370
- var value = _ref3.value,
371
- error = _ref3.error;
372
- expect(value).toBe("1");
373
- expect(error).toBe("Value must be greater than or equal to 5.");
374
- });
369
+ var onBlur = jest.fn();
375
370
 
376
371
  var _render20 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_NumberInput["default"], {
377
372
  label: "Number input label",
@@ -389,6 +384,10 @@ describe("Number input component tests", function () {
389
384
 
390
385
  _react2.fireEvent.blur(number);
391
386
 
387
+ expect(onBlur).toHaveBeenCalledWith({
388
+ value: "1",
389
+ error: "Value must be greater than or equal to 5."
390
+ });
392
391
  var increment = getAllByRole("button")[1];
393
392
 
394
393
  _userEvent["default"].click(increment);
@@ -503,4 +502,41 @@ describe("Number input component tests", function () {
503
502
  var increment = getAllByRole("button")[1];
504
503
  expect(increment.getAttribute("aria-label")).toBe("Increment value");
505
504
  });
505
+ test("Number input submits correct values in a form", function () {
506
+ var handlerOnSubmit = jest.fn(function (e) {
507
+ e.preventDefault();
508
+ var formData = new FormData(e.target);
509
+ var formProps = Object.fromEntries(formData);
510
+ expect(formProps).toStrictEqual({
511
+ data: "0"
512
+ });
513
+ });
514
+
515
+ var _render23 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement("form", {
516
+ onSubmit: handlerOnSubmit
517
+ }, /*#__PURE__*/_react["default"].createElement(_NumberInput["default"], {
518
+ label: "Number input label",
519
+ name: "data"
520
+ }), /*#__PURE__*/_react["default"].createElement("button", {
521
+ type: "submit"
522
+ }, "Submit"))),
523
+ getByText = _render23.getByText,
524
+ getAllByRole = _render23.getAllByRole;
525
+
526
+ var less = getAllByRole("button")[0];
527
+ var more = getAllByRole("button")[1];
528
+ var submit = getByText("Submit");
529
+
530
+ _userEvent["default"].click(more);
531
+
532
+ expect(handlerOnSubmit).not.toHaveBeenCalled();
533
+
534
+ _userEvent["default"].click(less);
535
+
536
+ expect(handlerOnSubmit).not.toHaveBeenCalled();
537
+
538
+ _userEvent["default"].click(submit);
539
+
540
+ expect(handlerOnSubmit).toHaveBeenCalled();
541
+ });
506
542
  });