@dxc-technology/halstack-react 0.0.0-c9b5c13 → 0.0.0-ca55cbe

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 (243) hide show
  1. package/BackgroundColorContext.d.ts +2 -2
  2. package/BackgroundColorContext.js +1 -1
  3. package/HalstackContext.d.ts +1329 -5
  4. package/HalstackContext.js +117 -77
  5. package/accordion/Accordion.js +118 -110
  6. package/accordion/Accordion.stories.tsx +104 -16
  7. package/accordion/Accordion.test.js +10 -11
  8. package/accordion/types.d.ts +2 -1
  9. package/accordion-group/AccordionGroup.js +4 -23
  10. package/accordion-group/AccordionGroup.stories.tsx +27 -1
  11. package/accordion-group/AccordionGroup.test.js +21 -46
  12. package/accordion-group/types.d.ts +8 -1
  13. package/alert/Alert.js +4 -6
  14. package/alert/Alert.stories.tsx +28 -0
  15. package/alert/Alert.test.js +1 -1
  16. package/bleed/Bleed.js +1 -34
  17. package/bleed/Bleed.stories.tsx +95 -95
  18. package/bleed/types.d.ts +1 -1
  19. package/box/Box.js +4 -6
  20. package/box/Box.stories.tsx +15 -0
  21. package/box/Box.test.js +1 -1
  22. package/box/types.d.ts +1 -0
  23. package/bulleted-list/BulletedList.d.ts +7 -0
  24. package/bulleted-list/BulletedList.js +125 -0
  25. package/bulleted-list/BulletedList.stories.tsx +206 -0
  26. package/bulleted-list/types.d.ts +11 -0
  27. package/button/Button.js +52 -73
  28. package/button/Button.stories.tsx +159 -8
  29. package/button/Button.test.js +1 -1
  30. package/button/types.d.ts +5 -5
  31. package/card/Card.js +12 -13
  32. package/card/Card.stories.tsx +12 -13
  33. package/card/Card.test.js +1 -1
  34. package/card/types.d.ts +1 -0
  35. package/checkbox/Checkbox.d.ts +2 -2
  36. package/checkbox/Checkbox.js +94 -101
  37. package/checkbox/Checkbox.stories.tsx +131 -59
  38. package/checkbox/Checkbox.test.js +94 -17
  39. package/checkbox/types.d.ts +4 -0
  40. package/chip/Chip.js +18 -26
  41. package/chip/Chip.stories.tsx +96 -9
  42. package/chip/Chip.test.js +3 -5
  43. package/chip/types.d.ts +1 -1
  44. package/common/OpenSans.css +68 -80
  45. package/common/coreTokens.d.ts +146 -0
  46. package/common/coreTokens.js +167 -0
  47. package/common/utils.d.ts +1 -0
  48. package/common/utils.js +4 -4
  49. package/common/variables.d.ts +1482 -0
  50. package/common/variables.js +1009 -1118
  51. package/date-input/Calendar.d.ts +4 -0
  52. package/date-input/Calendar.js +258 -0
  53. package/date-input/DateInput.js +134 -237
  54. package/date-input/DateInput.stories.tsx +199 -33
  55. package/date-input/DateInput.test.js +494 -138
  56. package/date-input/DatePicker.d.ts +4 -0
  57. package/date-input/DatePicker.js +146 -0
  58. package/date-input/Icons.d.ts +6 -0
  59. package/date-input/Icons.js +75 -0
  60. package/date-input/YearPicker.d.ts +4 -0
  61. package/date-input/YearPicker.js +126 -0
  62. package/date-input/types.d.ts +51 -0
  63. package/dialog/Dialog.js +80 -69
  64. package/dialog/Dialog.stories.tsx +230 -123
  65. package/dialog/Dialog.test.js +334 -5
  66. package/dialog/types.d.ts +1 -0
  67. package/dropdown/Dropdown.d.ts +1 -1
  68. package/dropdown/Dropdown.js +246 -249
  69. package/dropdown/Dropdown.stories.tsx +245 -56
  70. package/dropdown/Dropdown.test.js +507 -110
  71. package/dropdown/DropdownMenu.d.ts +4 -0
  72. package/dropdown/DropdownMenu.js +74 -0
  73. package/dropdown/DropdownMenuItem.d.ts +4 -0
  74. package/dropdown/DropdownMenuItem.js +79 -0
  75. package/dropdown/types.d.ts +23 -3
  76. package/file-input/FileInput.d.ts +2 -2
  77. package/file-input/FileInput.js +174 -220
  78. package/file-input/FileInput.stories.tsx +122 -11
  79. package/file-input/FileInput.test.js +14 -14
  80. package/file-input/FileItem.d.ts +4 -14
  81. package/file-input/FileItem.js +39 -63
  82. package/file-input/types.d.ts +17 -0
  83. package/flex/Flex.d.ts +4 -0
  84. package/flex/Flex.js +71 -0
  85. package/flex/Flex.stories.tsx +112 -0
  86. package/flex/types.d.ts +97 -0
  87. package/footer/Footer.js +6 -8
  88. package/footer/Footer.stories.tsx +99 -1
  89. package/footer/Footer.test.js +14 -26
  90. package/footer/Icons.js +1 -1
  91. package/footer/types.d.ts +2 -1
  92. package/grid/Grid.d.ts +7 -0
  93. package/grid/Grid.js +91 -0
  94. package/grid/Grid.stories.tsx +219 -0
  95. package/grid/types.d.ts +115 -0
  96. package/header/Header.d.ts +3 -2
  97. package/header/Header.js +89 -89
  98. package/header/Header.stories.tsx +152 -9
  99. package/header/Header.test.js +2 -2
  100. package/header/Icons.js +2 -2
  101. package/header/types.d.ts +1 -0
  102. package/heading/Heading.js +1 -1
  103. package/heading/Heading.test.js +1 -1
  104. package/inset/Inset.js +1 -34
  105. package/inset/Inset.stories.tsx +37 -36
  106. package/inset/types.d.ts +1 -1
  107. package/layout/ApplicationLayout.d.ts +15 -6
  108. package/layout/ApplicationLayout.js +38 -66
  109. package/layout/ApplicationLayout.stories.tsx +80 -44
  110. package/layout/types.d.ts +18 -29
  111. package/link/Link.js +4 -4
  112. package/link/Link.stories.tsx +73 -6
  113. package/link/Link.test.js +2 -4
  114. package/link/types.d.ts +3 -3
  115. package/main.d.ts +7 -9
  116. package/main.js +33 -49
  117. package/{tabs-nav → nav-tabs}/NavTabs.js +6 -6
  118. package/{tabs-nav → nav-tabs}/NavTabs.stories.tsx +96 -6
  119. package/{tabs-nav → nav-tabs}/NavTabs.test.js +1 -1
  120. package/{tabs-nav → nav-tabs}/Tab.js +40 -22
  121. package/{tabs-nav → nav-tabs}/types.d.ts +1 -1
  122. package/number-input/NumberInput.test.js +44 -8
  123. package/package.json +17 -21
  124. package/paginator/Icons.d.ts +5 -0
  125. package/paginator/Icons.js +16 -28
  126. package/paginator/Paginator.js +7 -15
  127. package/paginator/Paginator.stories.tsx +24 -0
  128. package/paginator/Paginator.test.js +78 -39
  129. package/paragraph/Paragraph.d.ts +5 -0
  130. package/paragraph/Paragraph.js +38 -0
  131. package/paragraph/Paragraph.stories.tsx +44 -0
  132. package/password-input/PasswordInput.test.js +14 -13
  133. package/progress-bar/ProgressBar.js +60 -54
  134. package/progress-bar/ProgressBar.stories.jsx +38 -3
  135. package/progress-bar/ProgressBar.test.js +68 -23
  136. package/quick-nav/QuickNav.js +25 -20
  137. package/quick-nav/QuickNav.stories.tsx +145 -26
  138. package/radio-group/Radio.d.ts +1 -1
  139. package/radio-group/Radio.js +43 -28
  140. package/radio-group/RadioGroup.js +23 -22
  141. package/radio-group/RadioGroup.stories.tsx +132 -18
  142. package/radio-group/RadioGroup.test.js +124 -97
  143. package/radio-group/types.d.ts +2 -2
  144. package/resultsetTable/Icons.d.ts +7 -0
  145. package/resultsetTable/Icons.js +51 -0
  146. package/resultsetTable/ResultsetTable.js +49 -108
  147. package/resultsetTable/ResultsetTable.stories.tsx +50 -25
  148. package/resultsetTable/ResultsetTable.test.js +61 -42
  149. package/resultsetTable/types.d.ts +1 -1
  150. package/select/Listbox.d.ts +1 -1
  151. package/select/Listbox.js +33 -16
  152. package/select/Option.js +11 -24
  153. package/select/Select.js +92 -71
  154. package/select/Select.stories.tsx +513 -136
  155. package/select/Select.test.js +413 -305
  156. package/select/types.d.ts +3 -6
  157. package/sidenav/Icons.d.ts +7 -0
  158. package/sidenav/Icons.js +51 -0
  159. package/sidenav/Sidenav.d.ts +6 -5
  160. package/sidenav/Sidenav.js +139 -48
  161. package/sidenav/Sidenav.stories.tsx +251 -151
  162. package/sidenav/Sidenav.test.js +25 -37
  163. package/sidenav/types.d.ts +52 -26
  164. package/slider/Slider.d.ts +2 -2
  165. package/slider/Slider.js +121 -97
  166. package/slider/Slider.stories.tsx +64 -1
  167. package/slider/Slider.test.js +122 -22
  168. package/slider/types.d.ts +4 -0
  169. package/spinner/Spinner.js +17 -23
  170. package/spinner/Spinner.stories.jsx +53 -27
  171. package/spinner/Spinner.test.js +1 -1
  172. package/switch/Switch.d.ts +2 -2
  173. package/switch/Switch.js +137 -70
  174. package/switch/Switch.stories.tsx +41 -30
  175. package/switch/Switch.test.js +145 -18
  176. package/switch/types.d.ts +4 -0
  177. package/table/Table.js +3 -3
  178. package/table/Table.stories.jsx +80 -1
  179. package/table/Table.test.js +2 -2
  180. package/tabs/Tab.d.ts +4 -0
  181. package/tabs/Tab.js +132 -0
  182. package/tabs/Tabs.js +358 -108
  183. package/tabs/Tabs.stories.tsx +119 -5
  184. package/tabs/Tabs.test.js +220 -10
  185. package/tabs/types.d.ts +13 -3
  186. package/tag/Tag.js +8 -10
  187. package/tag/Tag.stories.tsx +14 -1
  188. package/tag/Tag.test.js +1 -1
  189. package/tag/types.d.ts +1 -1
  190. package/text-input/Icons.d.ts +8 -0
  191. package/text-input/Icons.js +60 -0
  192. package/text-input/Suggestion.js +40 -11
  193. package/text-input/Suggestions.d.ts +4 -0
  194. package/text-input/Suggestions.js +134 -0
  195. package/text-input/TextInput.js +198 -295
  196. package/text-input/TextInput.stories.tsx +280 -185
  197. package/text-input/TextInput.test.js +736 -725
  198. package/text-input/types.d.ts +22 -3
  199. package/textarea/Textarea.js +3 -4
  200. package/textarea/Textarea.stories.jsx +60 -1
  201. package/textarea/Textarea.test.js +2 -4
  202. package/toggle-group/ToggleGroup.js +7 -4
  203. package/toggle-group/ToggleGroup.stories.tsx +42 -0
  204. package/toggle-group/ToggleGroup.test.js +1 -1
  205. package/toggle-group/types.d.ts +2 -2
  206. package/typography/Typography.d.ts +4 -0
  207. package/typography/Typography.js +32 -0
  208. package/typography/Typography.stories.tsx +198 -0
  209. package/typography/types.d.ts +18 -0
  210. package/typography/types.js +5 -0
  211. package/useTheme.d.ts +1234 -1
  212. package/useTheme.js +1 -1
  213. package/useTranslatedLabels.d.ts +84 -1
  214. package/utils/BaseTypography.d.ts +21 -0
  215. package/utils/BaseTypography.js +108 -0
  216. package/utils/FocusLock.d.ts +13 -0
  217. package/utils/FocusLock.js +139 -0
  218. package/wizard/Wizard.js +10 -17
  219. package/wizard/Wizard.stories.tsx +40 -1
  220. package/wizard/Wizard.test.js +1 -1
  221. package/wizard/types.d.ts +3 -3
  222. package/common/RequiredComponent.js +0 -32
  223. package/list/List.d.ts +0 -4
  224. package/list/List.js +0 -47
  225. package/list/List.stories.tsx +0 -95
  226. package/list/types.d.ts +0 -7
  227. package/row/Row.d.ts +0 -3
  228. package/row/Row.js +0 -127
  229. package/row/Row.stories.tsx +0 -237
  230. package/row/types.d.ts +0 -28
  231. package/stack/Stack.d.ts +0 -3
  232. package/stack/Stack.js +0 -97
  233. package/stack/Stack.stories.tsx +0 -164
  234. package/stack/types.d.ts +0 -24
  235. package/text/Text.d.ts +0 -7
  236. package/text/Text.js +0 -30
  237. package/text/Text.stories.tsx +0 -19
  238. /package/{list → bulleted-list}/types.js +0 -0
  239. /package/{row → flex}/types.js +0 -0
  240. /package/{stack → grid}/types.js +0 -0
  241. /package/{tabs-nav → nav-tabs}/NavTabs.d.ts +0 -0
  242. /package/{tabs-nav → nav-tabs}/Tab.d.ts +0 -0
  243. /package/{tabs-nav → nav-tabs}/types.js +0 -0
@@ -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,19 @@
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
- };
17
2
  export declare type AppLayoutMainPropsType = {
18
3
  /**
19
4
  * Everything between the tags will be displayed as the content of the main part of the application.
20
5
  */
21
6
  children: React.ReactNode;
22
7
  };
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
8
  export declare type AppLayoutSidenavPropsType = {
31
9
  /**
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.
10
+ * The area inside the sidenav. This area can be used to render the content inside the sidenav.
34
11
  */
35
- padding?: Space | Padding;
12
+ children: React.ReactNode;
36
13
  /**
37
- * The area inside the sidenav. This area can be used to render custom content.
14
+ * The area assigned to render the sidenav title. It is highly recommended to use the sidenav title.
38
15
  */
39
- children: React.ReactNode;
16
+ title?: React.ReactNode;
40
17
  };
41
18
  declare type AppLayoutPropsType = {
42
19
  /**
@@ -45,8 +22,20 @@ declare type AppLayoutPropsType = {
45
22
  */
46
23
  visibilityToggleLabel?: string;
47
24
  /**
48
- * The area inside the sidenav. This area can be used to render custom content.
25
+ * Header content.
26
+ */
27
+ header?: React.ReactNode;
28
+ /**
29
+ * Sidenav content
30
+ */
31
+ sidenav?: React.ReactNode;
32
+ /**
33
+ * Footer content
34
+ */
35
+ footer?: React.ReactNode;
36
+ /**
37
+ * Use the DxcApplicationLayout.Main provided to render main content.
49
38
  */
50
- children: React.ReactElement<ChildrenType> | React.ReactElement<ChildrenType>[];
39
+ children: React.ReactElement<AppLayoutMainPropsType>;
51
40
  };
52
41
  export default AppLayoutPropsType;
package/link/Link.js CHANGED
@@ -21,7 +21,7 @@ var _react = _interopRequireWildcard(require("react"));
21
21
 
22
22
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
23
23
 
24
- var _variables = require("../common/variables.js");
24
+ var _variables = require("../common/variables");
25
25
 
26
26
  var _useTheme = _interopRequireDefault(require("../useTheme"));
27
27
 
@@ -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 margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\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 color: ", ";\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] : "";
@@ -105,7 +105,7 @@ var StyledLink = _styledComponents["default"].div(_templateObject || (_templateO
105
105
  }, function (props) {
106
106
  return props.disabled && "cursor: default;";
107
107
  }, function (props) {
108
- return props.inheritColor ? "inherit" : !props.disabled ? props.theme.fontColor : props.theme.disabledColor;
108
+ return props.inheritColor ? "inherit" : !props.disabled ? props.theme.fontColor : props.theme.disabledFontColor;
109
109
  }, function (props) {
110
110
  return props.disabled ? "pointer-events: none;" : "";
111
111
  }, function (props) {
@@ -2,6 +2,7 @@ import React from "react";
2
2
  import DxcLink from "./Link";
3
3
  import Title from "../../.storybook/components/Title";
4
4
  import ExampleContainer from "../../.storybook/components/ExampleContainer";
5
+ import { HalstackProvider } from "../HalstackContext";
5
6
 
6
7
  export default {
7
8
  title: "Link",
@@ -9,7 +10,7 @@ export default {
9
10
  };
10
11
 
11
12
  const icon = (
12
- <svg viewBox="0 0 24 24" enable-background="new 0 0 24 24" fill="currentColor">
13
+ <svg viewBox="0 0 24 24" enableBackground="new 0 0 24 24" fill="currentColor">
13
14
  <g id="Bounding_Box">
14
15
  <rect fill="none" width="24" height="24" />
15
16
  </g>
@@ -19,6 +20,12 @@ const icon = (
19
20
  </svg>
20
21
  );
21
22
 
23
+ const opinionatedTheme = {
24
+ link: {
25
+ baseColor: "#5f249f",
26
+ },
27
+ };
28
+
22
29
  export const Chromatic = () => (
23
30
  <>
24
31
  <Title title="With anchor" theme="light" level={2} />
@@ -68,11 +75,18 @@ export const Chromatic = () => (
68
75
  </ExampleContainer>
69
76
  <ExampleContainer pseudoState="pseudo-hover">
70
77
  <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.
78
+ Lorem{" "}
79
+ <DxcLink href="https://www.google.com" icon={icon}>
80
+ Test
81
+ </DxcLink>{" "}
82
+ ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna
83
+ aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
84
+ consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
85
+ Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit{" "}
86
+ <DxcLink href="https://www.google.com" icon={icon} iconPosition="after">
87
+ Test
88
+ </DxcLink>{" "}
89
+ anim id est laborum.
76
90
  </ExampleContainer>
77
91
  <ExampleContainer pseudoState="pseudo-focus">
78
92
  <Title title="Long text with focus" theme="light" level={4} />
@@ -182,5 +196,58 @@ export const Chromatic = () => (
182
196
  Test
183
197
  </DxcLink>
184
198
  </ExampleContainer>
199
+ <Title title="Opinionated theme" theme="light" level={2} />
200
+ <ExampleContainer>
201
+ <Title title="Disabled" theme="light" level={4} />
202
+ <HalstackProvider theme={opinionatedTheme}>
203
+ <DxcLink disabled>Test</DxcLink>
204
+ </HalstackProvider>
205
+ </ExampleContainer>
206
+ <ExampleContainer>
207
+ <Title title="Icon before" theme="light" level={4} />
208
+ <HalstackProvider theme={opinionatedTheme}>
209
+ <DxcLink href="https://www.google.com" icon={icon} iconPosition="before">
210
+ Test
211
+ </DxcLink>
212
+ </HalstackProvider>
213
+ </ExampleContainer>
214
+ <ExampleContainer>
215
+ <Title title="Disabled" theme="light" level={4} />
216
+ <HalstackProvider theme={opinionatedTheme}>
217
+ <DxcLink disabled>Test</DxcLink>
218
+ </HalstackProvider>
219
+ </ExampleContainer>
220
+ <ExampleContainer>
221
+ <Title title="Icon after" theme="light" level={4} />{" "}
222
+ <HalstackProvider theme={opinionatedTheme}>
223
+ <DxcLink onClick={() => {}} icon={icon} iconPosition="after">
224
+ Test
225
+ </DxcLink>
226
+ </HalstackProvider>
227
+ </ExampleContainer>
228
+ <ExampleContainer pseudoState="pseudo-hover">
229
+ <Title title="With link hovered" theme="light" level={4} />
230
+ <HalstackProvider theme={opinionatedTheme}>
231
+ <DxcLink onClick={() => {}}>Test</DxcLink>
232
+ </HalstackProvider>
233
+ </ExampleContainer>
234
+ <ExampleContainer pseudoState="pseudo-focus">
235
+ <Title title="With link focused" theme="light" level={4} />
236
+ <HalstackProvider theme={opinionatedTheme}>
237
+ <DxcLink onClick={() => {}}>Test</DxcLink>
238
+ </HalstackProvider>
239
+ </ExampleContainer>
240
+ <ExampleContainer pseudoState="pseudo-active">
241
+ <Title title="With link active" theme="light" level={4} />
242
+ <HalstackProvider theme={opinionatedTheme}>
243
+ <DxcLink onClick={() => {}}>Test</DxcLink>
244
+ </HalstackProvider>
245
+ </ExampleContainer>
246
+ <ExampleContainer pseudoState="pseudo-visited">
247
+ <HalstackProvider theme={opinionatedTheme}>
248
+ <Title title="With link visited" theme="light" level={4} />
249
+ <DxcLink href="https://www.google.com">Test</DxcLink>
250
+ </HalstackProvider>
251
+ </ExampleContainer>
185
252
  </>
186
253
  );
package/link/Link.test.js CHANGED
@@ -6,7 +6,7 @@ var _react = _interopRequireDefault(require("react"));
6
6
 
7
7
  var _react2 = require("@testing-library/react");
8
8
 
9
- var _Link = _interopRequireDefault(require("./Link"));
9
+ var _Link = _interopRequireDefault(require("./Link.tsx"));
10
10
 
11
11
  describe("Link component tests", function () {
12
12
  test("Link renders with correct text", function () {
@@ -33,9 +33,7 @@ describe("Link component tests", function () {
33
33
  expect(getByText("Link").hasAttribute("href")).toBeFalsy();
34
34
 
35
35
  var _render4 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Link["default"], {
36
- onClick: function onClick() {
37
- return console.log("Andorra");
38
- },
36
+ onClick: function onClick() {},
39
37
  disabled: true
40
38
  }, "LinkButton")),
41
39
  getByTextLinkButton = _render4.getByText;
package/link/types.d.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  /// <reference types="react" />
2
- export declare type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
3
- export declare type Margin = {
2
+ declare type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
3
+ declare type Margin = {
4
4
  top?: Space;
5
5
  bottom?: Space;
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,15 +30,16 @@ 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
- import DxcNavTabs from "./tabs-nav/NavTabs";
37
+ import DxcNavTabs from "./nav-tabs/NavTabs";
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";
42
+ import DxcGrid from "./grid/Grid";
45
43
  import HalstackContext, { HalstackProvider, HalstackLanguageContext } from "./HalstackContext";
46
44
  import { BackgroundColorProvider } from "./BackgroundColorContext";
47
- 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, };
45
+ 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, DxcGrid, };
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,16 @@ 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"];
115
+ return _Flex["default"];
110
116
  }
111
117
  });
112
- Object.defineProperty(exports, "DxcHeader", {
118
+ Object.defineProperty(exports, "DxcGrid", {
113
119
  enumerable: true,
114
120
  get: function get() {
115
- return _Header["default"];
121
+ return _Grid["default"];
116
122
  }
117
123
  });
118
124
  Object.defineProperty(exports, "DxcHeading", {
@@ -133,12 +139,6 @@ Object.defineProperty(exports, "DxcLink", {
133
139
  return _Link["default"];
134
140
  }
135
141
  });
136
- Object.defineProperty(exports, "DxcList", {
137
- enumerable: true,
138
- get: function get() {
139
- return _List["default"];
140
- }
141
- });
142
142
  Object.defineProperty(exports, "DxcNavTabs", {
143
143
  enumerable: true,
144
144
  get: function get() {
@@ -157,6 +157,12 @@ Object.defineProperty(exports, "DxcPaginator", {
157
157
  return _Paginator["default"];
158
158
  }
159
159
  });
160
+ Object.defineProperty(exports, "DxcParagraph", {
161
+ enumerable: true,
162
+ get: function get() {
163
+ return _Paragraph["default"];
164
+ }
165
+ });
160
166
  Object.defineProperty(exports, "DxcPasswordInput", {
161
167
  enumerable: true,
162
168
  get: function get() {
@@ -187,24 +193,12 @@ Object.defineProperty(exports, "DxcResultsetTable", {
187
193
  return _ResultsetTable["default"];
188
194
  }
189
195
  });
190
- Object.defineProperty(exports, "DxcRow", {
191
- enumerable: true,
192
- get: function get() {
193
- return _Row["default"];
194
- }
195
- });
196
196
  Object.defineProperty(exports, "DxcSelect", {
197
197
  enumerable: true,
198
198
  get: function get() {
199
199
  return _Select["default"];
200
200
  }
201
201
  });
202
- Object.defineProperty(exports, "DxcSidenav", {
203
- enumerable: true,
204
- get: function get() {
205
- return _Sidenav["default"];
206
- }
207
- });
208
202
  Object.defineProperty(exports, "DxcSlider", {
209
203
  enumerable: true,
210
204
  get: function get() {
@@ -217,12 +211,6 @@ Object.defineProperty(exports, "DxcSpinner", {
217
211
  return _Spinner["default"];
218
212
  }
219
213
  });
220
- Object.defineProperty(exports, "DxcStack", {
221
- enumerable: true,
222
- get: function get() {
223
- return _Stack["default"];
224
- }
225
- });
226
214
  Object.defineProperty(exports, "DxcSwitch", {
227
215
  enumerable: true,
228
216
  get: function get() {
@@ -247,12 +235,6 @@ Object.defineProperty(exports, "DxcTag", {
247
235
  return _Tag["default"];
248
236
  }
249
237
  });
250
- Object.defineProperty(exports, "DxcText", {
251
- enumerable: true,
252
- get: function get() {
253
- return _Text["default"];
254
- }
255
- });
256
238
  Object.defineProperty(exports, "DxcTextInput", {
257
239
  enumerable: true,
258
240
  get: function get() {
@@ -271,6 +253,12 @@ Object.defineProperty(exports, "DxcToggleGroup", {
271
253
  return _ToggleGroup["default"];
272
254
  }
273
255
  });
256
+ Object.defineProperty(exports, "DxcTypography", {
257
+ enumerable: true,
258
+ get: function get() {
259
+ return _Typography["default"];
260
+ }
261
+ });
274
262
  Object.defineProperty(exports, "DxcWizard", {
275
263
  enumerable: true,
276
264
  get: function get() {
@@ -310,10 +298,6 @@ var _Dialog = _interopRequireDefault(require("./dialog/Dialog"));
310
298
 
311
299
  var _Dropdown = _interopRequireDefault(require("./dropdown/Dropdown"));
312
300
 
313
- var _Footer = _interopRequireDefault(require("./footer/Footer"));
314
-
315
- var _Header = _interopRequireDefault(require("./header/Header"));
316
-
317
301
  var _Slider = _interopRequireDefault(require("./slider/Slider"));
318
302
 
319
303
  var _Switch = _interopRequireDefault(require("./switch/Switch"));
@@ -332,8 +316,6 @@ var _Tag = _interopRequireDefault(require("./tag/Tag"));
332
316
 
333
317
  var _Paginator = _interopRequireDefault(require("./paginator/Paginator"));
334
318
 
335
- var _Sidenav = _interopRequireDefault(require("./sidenav/Sidenav"));
336
-
337
319
  var _Wizard = _interopRequireDefault(require("./wizard/Wizard"));
338
320
 
339
321
  var _Link = _interopRequireDefault(require("./link/Link"));
@@ -366,14 +348,6 @@ var _Select = _interopRequireDefault(require("./select/Select"));
366
348
 
367
349
  var _FileInput = _interopRequireDefault(require("./file-input/FileInput"));
368
350
 
369
- var _Stack = _interopRequireDefault(require("./stack/Stack"));
370
-
371
- var _Row = _interopRequireDefault(require("./row/Row"));
372
-
373
- var _Text = _interopRequireDefault(require("./text/Text"));
374
-
375
- var _List = _interopRequireDefault(require("./list/List"));
376
-
377
351
  var _RadioGroup = _interopRequireDefault(require("./radio-group/RadioGroup"));
378
352
 
379
353
  var _Bleed = _interopRequireDefault(require("./bleed/Bleed"));
@@ -382,7 +356,17 @@ var _Inset = _interopRequireDefault(require("./inset/Inset"));
382
356
 
383
357
  var _QuickNav = _interopRequireDefault(require("./quick-nav/QuickNav"));
384
358
 
385
- var _NavTabs = _interopRequireDefault(require("./tabs-nav/NavTabs"));
359
+ var _NavTabs = _interopRequireDefault(require("./nav-tabs/NavTabs"));
360
+
361
+ var _Flex = _interopRequireDefault(require("./flex/Flex"));
362
+
363
+ var _Typography = _interopRequireDefault(require("./typography/Typography"));
364
+
365
+ var _Paragraph = _interopRequireDefault(require("./paragraph/Paragraph"));
366
+
367
+ var _BulletedList = _interopRequireDefault(require("./bulleted-list/BulletedList"));
368
+
369
+ var _Grid = _interopRequireDefault(require("./grid/Grid"));
386
370
 
387
371
  var _HalstackContext = _interopRequireWildcard(require("./HalstackContext"));
388
372