@dxc-technology/halstack-react 0.0.0-bd364ae → 0.0.0-bd47c58

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 (265) hide show
  1. package/BackgroundColorContext.d.ts +2 -2
  2. package/BackgroundColorContext.js +1 -1
  3. package/HalstackContext.d.ts +1337 -5
  4. package/HalstackContext.js +117 -77
  5. package/README.md +47 -0
  6. package/accordion/Accordion.d.ts +1 -1
  7. package/accordion/Accordion.js +110 -114
  8. package/accordion/Accordion.stories.tsx +105 -115
  9. package/accordion/Accordion.test.js +10 -11
  10. package/accordion/types.d.ts +1 -12
  11. package/accordion-group/AccordionGroup.d.ts +4 -3
  12. package/accordion-group/AccordionGroup.js +25 -65
  13. package/accordion-group/AccordionGroup.stories.tsx +93 -66
  14. package/accordion-group/AccordionGroup.test.js +27 -62
  15. package/accordion-group/AccordionGroupAccordion.d.ts +4 -0
  16. package/accordion-group/AccordionGroupAccordion.js +43 -0
  17. package/accordion-group/types.d.ts +7 -12
  18. package/alert/Alert.js +5 -9
  19. package/alert/Alert.stories.tsx +28 -0
  20. package/alert/Alert.test.js +1 -1
  21. package/bleed/Bleed.stories.tsx +64 -63
  22. package/box/Box.d.ts +1 -1
  23. package/box/Box.js +8 -27
  24. package/box/Box.stories.tsx +38 -51
  25. package/box/Box.test.js +1 -1
  26. package/box/types.d.ts +0 -11
  27. package/bulleted-list/BulletedList.d.ts +7 -0
  28. package/bulleted-list/BulletedList.js +125 -0
  29. package/bulleted-list/BulletedList.stories.tsx +206 -0
  30. package/bulleted-list/types.d.ts +38 -0
  31. package/button/Button.d.ts +1 -1
  32. package/button/Button.js +42 -72
  33. package/button/Button.stories.tsx +159 -8
  34. package/button/Button.test.js +12 -1
  35. package/button/types.d.ts +9 -5
  36. package/card/Card.d.ts +1 -1
  37. package/card/Card.js +27 -45
  38. package/card/Card.stories.tsx +12 -42
  39. package/card/Card.test.js +1 -1
  40. package/card/types.d.ts +1 -6
  41. package/checkbox/Checkbox.d.ts +2 -2
  42. package/checkbox/Checkbox.js +94 -101
  43. package/checkbox/Checkbox.stories.tsx +131 -59
  44. package/checkbox/Checkbox.test.js +94 -17
  45. package/checkbox/types.d.ts +4 -0
  46. package/chip/Chip.js +28 -49
  47. package/chip/Chip.stories.tsx +121 -26
  48. package/chip/Chip.test.js +3 -5
  49. package/chip/types.d.ts +1 -1
  50. package/common/OpenSans.css +68 -80
  51. package/common/coreTokens.d.ts +146 -0
  52. package/common/coreTokens.js +167 -0
  53. package/common/utils.d.ts +1 -0
  54. package/common/utils.js +4 -4
  55. package/common/variables.d.ts +1490 -0
  56. package/common/variables.js +1016 -1117
  57. package/date-input/Calendar.d.ts +4 -0
  58. package/date-input/Calendar.js +258 -0
  59. package/date-input/DateInput.js +134 -237
  60. package/date-input/DateInput.stories.tsx +199 -33
  61. package/date-input/DateInput.test.js +494 -138
  62. package/date-input/DatePicker.d.ts +4 -0
  63. package/date-input/DatePicker.js +146 -0
  64. package/date-input/Icons.d.ts +6 -0
  65. package/date-input/Icons.js +75 -0
  66. package/date-input/YearPicker.d.ts +4 -0
  67. package/date-input/YearPicker.js +126 -0
  68. package/date-input/types.d.ts +51 -0
  69. package/dialog/Dialog.d.ts +1 -1
  70. package/dialog/Dialog.js +72 -79
  71. package/dialog/Dialog.stories.tsx +154 -171
  72. package/dialog/Dialog.test.js +334 -5
  73. package/dialog/types.d.ts +0 -12
  74. package/dropdown/Dropdown.d.ts +1 -1
  75. package/dropdown/Dropdown.js +246 -249
  76. package/dropdown/Dropdown.stories.tsx +245 -56
  77. package/dropdown/Dropdown.test.js +507 -110
  78. package/dropdown/DropdownMenu.d.ts +4 -0
  79. package/dropdown/DropdownMenu.js +74 -0
  80. package/dropdown/DropdownMenuItem.d.ts +4 -0
  81. package/dropdown/DropdownMenuItem.js +79 -0
  82. package/dropdown/types.d.ts +23 -3
  83. package/file-input/FileInput.d.ts +2 -2
  84. package/file-input/FileInput.js +174 -220
  85. package/file-input/FileInput.stories.tsx +122 -11
  86. package/file-input/FileInput.test.js +14 -14
  87. package/file-input/FileItem.d.ts +4 -14
  88. package/file-input/FileItem.js +39 -63
  89. package/file-input/types.d.ts +18 -1
  90. package/flex/Flex.d.ts +4 -0
  91. package/flex/Flex.js +71 -0
  92. package/flex/Flex.stories.tsx +112 -0
  93. package/flex/types.d.ts +97 -0
  94. package/footer/Footer.d.ts +1 -1
  95. package/footer/Footer.js +44 -64
  96. package/footer/Footer.stories.tsx +37 -16
  97. package/footer/Footer.test.js +16 -26
  98. package/footer/Icons.js +1 -1
  99. package/footer/types.d.ts +11 -12
  100. package/grid/Grid.d.ts +7 -0
  101. package/grid/Grid.js +91 -0
  102. package/grid/Grid.stories.tsx +219 -0
  103. package/grid/types.d.ts +115 -0
  104. package/header/Header.d.ts +4 -3
  105. package/header/Header.js +83 -110
  106. package/header/Header.stories.tsx +118 -39
  107. package/header/Header.test.js +2 -2
  108. package/header/Icons.js +2 -2
  109. package/header/types.d.ts +0 -13
  110. package/heading/Heading.js +1 -1
  111. package/heading/Heading.test.js +1 -1
  112. package/image/Image.d.ts +4 -0
  113. package/image/Image.js +85 -0
  114. package/image/Image.stories.tsx +127 -0
  115. package/image/types.d.ts +72 -0
  116. package/inset/Inset.stories.tsx +5 -4
  117. package/layout/ApplicationLayout.d.ts +15 -6
  118. package/layout/ApplicationLayout.js +44 -69
  119. package/layout/ApplicationLayout.stories.tsx +80 -44
  120. package/layout/types.d.ts +18 -29
  121. package/link/Link.js +4 -4
  122. package/link/Link.stories.tsx +73 -6
  123. package/link/Link.test.js +2 -4
  124. package/link/types.d.ts +3 -3
  125. package/main.d.ts +8 -9
  126. package/main.js +41 -49
  127. package/{tabs-nav → nav-tabs}/NavTabs.d.ts +2 -2
  128. package/{tabs-nav → nav-tabs}/NavTabs.js +13 -16
  129. package/{tabs-nav → nav-tabs}/NavTabs.stories.tsx +110 -6
  130. package/{tabs-nav → nav-tabs}/NavTabs.test.js +1 -1
  131. package/{tabs-nav → nav-tabs}/Tab.js +51 -37
  132. package/{tabs-nav → nav-tabs}/types.d.ts +9 -10
  133. package/number-input/NumberInput.d.ts +7 -0
  134. package/number-input/NumberInput.js +6 -4
  135. package/number-input/NumberInput.test.js +317 -98
  136. package/package.json +18 -22
  137. package/paginator/Icons.d.ts +5 -0
  138. package/paginator/Icons.js +16 -28
  139. package/paginator/Paginator.js +8 -16
  140. package/paginator/Paginator.stories.tsx +24 -0
  141. package/paginator/Paginator.test.js +91 -39
  142. package/paragraph/Paragraph.d.ts +5 -0
  143. package/paragraph/Paragraph.js +38 -0
  144. package/paragraph/Paragraph.stories.tsx +44 -0
  145. package/password-input/Icons.d.ts +6 -0
  146. package/password-input/Icons.js +39 -0
  147. package/password-input/PasswordInput.js +35 -82
  148. package/password-input/PasswordInput.stories.tsx +1 -0
  149. package/password-input/PasswordInput.test.js +34 -40
  150. package/progress-bar/ProgressBar.js +60 -54
  151. package/progress-bar/ProgressBar.stories.jsx +38 -3
  152. package/progress-bar/ProgressBar.test.js +68 -23
  153. package/quick-nav/QuickNav.js +23 -18
  154. package/quick-nav/QuickNav.stories.tsx +145 -26
  155. package/radio-group/Radio.d.ts +1 -1
  156. package/radio-group/Radio.js +46 -31
  157. package/radio-group/RadioGroup.js +31 -32
  158. package/radio-group/RadioGroup.stories.tsx +132 -18
  159. package/radio-group/RadioGroup.test.js +124 -97
  160. package/radio-group/types.d.ts +2 -2
  161. package/resultsetTable/Icons.d.ts +7 -0
  162. package/resultsetTable/Icons.js +51 -0
  163. package/resultsetTable/ResultsetTable.js +49 -108
  164. package/resultsetTable/ResultsetTable.stories.tsx +50 -25
  165. package/resultsetTable/ResultsetTable.test.js +61 -42
  166. package/resultsetTable/types.d.ts +1 -1
  167. package/select/Listbox.d.ts +1 -1
  168. package/select/Listbox.js +33 -16
  169. package/select/Option.js +11 -24
  170. package/select/Select.js +92 -71
  171. package/select/Select.stories.tsx +513 -136
  172. package/select/Select.test.js +413 -305
  173. package/select/types.d.ts +3 -6
  174. package/sidenav/Icons.d.ts +7 -0
  175. package/sidenav/Icons.js +51 -0
  176. package/sidenav/Sidenav.d.ts +6 -5
  177. package/sidenav/Sidenav.js +139 -48
  178. package/sidenav/Sidenav.stories.tsx +251 -151
  179. package/sidenav/Sidenav.test.js +25 -37
  180. package/sidenav/types.d.ts +52 -26
  181. package/slider/Slider.d.ts +2 -2
  182. package/slider/Slider.js +121 -97
  183. package/slider/Slider.stories.tsx +64 -1
  184. package/slider/Slider.test.js +122 -22
  185. package/slider/types.d.ts +4 -0
  186. package/spinner/Spinner.js +17 -23
  187. package/spinner/Spinner.stories.jsx +53 -27
  188. package/spinner/Spinner.test.js +1 -1
  189. package/switch/Switch.d.ts +2 -2
  190. package/switch/Switch.js +137 -70
  191. package/switch/Switch.stories.tsx +41 -30
  192. package/switch/Switch.test.js +145 -18
  193. package/switch/types.d.ts +4 -0
  194. package/table/Table.js +3 -3
  195. package/table/Table.stories.jsx +80 -1
  196. package/table/Table.test.js +2 -2
  197. package/tabs/Tab.d.ts +4 -0
  198. package/tabs/Tab.js +132 -0
  199. package/tabs/Tabs.js +358 -108
  200. package/tabs/Tabs.stories.tsx +119 -5
  201. package/tabs/Tabs.test.js +220 -10
  202. package/tabs/types.d.ts +13 -3
  203. package/tag/Tag.js +8 -10
  204. package/tag/Tag.stories.tsx +14 -1
  205. package/tag/Tag.test.js +1 -1
  206. package/tag/types.d.ts +1 -1
  207. package/text-input/Icons.d.ts +8 -0
  208. package/text-input/Icons.js +60 -0
  209. package/text-input/Suggestion.js +40 -11
  210. package/text-input/Suggestions.d.ts +4 -0
  211. package/text-input/Suggestions.js +134 -0
  212. package/text-input/TextInput.js +235 -348
  213. package/text-input/TextInput.stories.tsx +280 -185
  214. package/text-input/TextInput.test.js +736 -725
  215. package/text-input/types.d.ts +22 -3
  216. package/textarea/Textarea.js +3 -4
  217. package/textarea/Textarea.stories.jsx +60 -1
  218. package/textarea/Textarea.test.js +2 -4
  219. package/toggle-group/ToggleGroup.d.ts +2 -2
  220. package/toggle-group/ToggleGroup.js +85 -59
  221. package/toggle-group/ToggleGroup.stories.tsx +45 -0
  222. package/toggle-group/ToggleGroup.test.js +38 -24
  223. package/toggle-group/types.d.ts +23 -14
  224. package/typography/Typography.d.ts +4 -0
  225. package/typography/Typography.js +32 -0
  226. package/typography/Typography.stories.tsx +198 -0
  227. package/typography/types.d.ts +18 -0
  228. package/typography/types.js +5 -0
  229. package/useTheme.d.ts +1242 -1
  230. package/useTheme.js +1 -1
  231. package/useTranslatedLabels.d.ts +84 -1
  232. package/utils/BaseTypography.d.ts +21 -0
  233. package/utils/BaseTypography.js +108 -0
  234. package/utils/FocusLock.d.ts +13 -0
  235. package/utils/FocusLock.js +138 -0
  236. package/wizard/Wizard.js +10 -17
  237. package/wizard/Wizard.stories.tsx +40 -1
  238. package/wizard/Wizard.test.js +1 -1
  239. package/wizard/types.d.ts +3 -3
  240. package/card/ice-cream.jpg +0 -0
  241. package/common/RequiredComponent.js +0 -32
  242. package/list/List.d.ts +0 -4
  243. package/list/List.js +0 -47
  244. package/list/List.stories.tsx +0 -95
  245. package/list/types.d.ts +0 -7
  246. package/number-input/NumberInputContext.d.ts +0 -4
  247. package/number-input/NumberInputContext.js +0 -19
  248. package/number-input/numberInputContextTypes.d.ts +0 -19
  249. package/row/Row.d.ts +0 -3
  250. package/row/Row.js +0 -127
  251. package/row/Row.stories.tsx +0 -237
  252. package/row/types.d.ts +0 -28
  253. package/stack/Stack.d.ts +0 -3
  254. package/stack/Stack.js +0 -97
  255. package/stack/Stack.stories.tsx +0 -164
  256. package/stack/types.d.ts +0 -24
  257. package/text/Text.d.ts +0 -7
  258. package/text/Text.js +0 -30
  259. package/text/Text.stories.tsx +0 -19
  260. /package/{list → bulleted-list}/types.js +0 -0
  261. /package/{row → flex}/types.js +0 -0
  262. /package/{stack → grid}/types.js +0 -0
  263. /package/{tabs-nav → image}/types.js +0 -0
  264. /package/{tabs-nav → nav-tabs}/Tab.d.ts +0 -0
  265. /package/{number-input/numberInputContextTypes.js → 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,17 @@ 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";
43
+ import DxcImage from "./image/Image";
45
44
  import HalstackContext, { HalstackProvider, HalstackLanguageContext } from "./HalstackContext";
46
45
  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, };
46
+ 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, DxcImage, };
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", {
@@ -121,22 +127,22 @@ Object.defineProperty(exports, "DxcHeading", {
121
127
  return _Heading["default"];
122
128
  }
123
129
  });
124
- Object.defineProperty(exports, "DxcInset", {
130
+ Object.defineProperty(exports, "DxcImage", {
125
131
  enumerable: true,
126
132
  get: function get() {
127
- return _Inset["default"];
133
+ return _Image["default"];
128
134
  }
129
135
  });
130
- Object.defineProperty(exports, "DxcLink", {
136
+ Object.defineProperty(exports, "DxcInset", {
131
137
  enumerable: true,
132
138
  get: function get() {
133
- return _Link["default"];
139
+ return _Inset["default"];
134
140
  }
135
141
  });
136
- Object.defineProperty(exports, "DxcList", {
142
+ Object.defineProperty(exports, "DxcLink", {
137
143
  enumerable: true,
138
144
  get: function get() {
139
- return _List["default"];
145
+ return _Link["default"];
140
146
  }
141
147
  });
142
148
  Object.defineProperty(exports, "DxcNavTabs", {
@@ -157,6 +163,12 @@ Object.defineProperty(exports, "DxcPaginator", {
157
163
  return _Paginator["default"];
158
164
  }
159
165
  });
166
+ Object.defineProperty(exports, "DxcParagraph", {
167
+ enumerable: true,
168
+ get: function get() {
169
+ return _Paragraph["default"];
170
+ }
171
+ });
160
172
  Object.defineProperty(exports, "DxcPasswordInput", {
161
173
  enumerable: true,
162
174
  get: function get() {
@@ -187,24 +199,12 @@ Object.defineProperty(exports, "DxcResultsetTable", {
187
199
  return _ResultsetTable["default"];
188
200
  }
189
201
  });
190
- Object.defineProperty(exports, "DxcRow", {
191
- enumerable: true,
192
- get: function get() {
193
- return _Row["default"];
194
- }
195
- });
196
202
  Object.defineProperty(exports, "DxcSelect", {
197
203
  enumerable: true,
198
204
  get: function get() {
199
205
  return _Select["default"];
200
206
  }
201
207
  });
202
- Object.defineProperty(exports, "DxcSidenav", {
203
- enumerable: true,
204
- get: function get() {
205
- return _Sidenav["default"];
206
- }
207
- });
208
208
  Object.defineProperty(exports, "DxcSlider", {
209
209
  enumerable: true,
210
210
  get: function get() {
@@ -217,12 +217,6 @@ Object.defineProperty(exports, "DxcSpinner", {
217
217
  return _Spinner["default"];
218
218
  }
219
219
  });
220
- Object.defineProperty(exports, "DxcStack", {
221
- enumerable: true,
222
- get: function get() {
223
- return _Stack["default"];
224
- }
225
- });
226
220
  Object.defineProperty(exports, "DxcSwitch", {
227
221
  enumerable: true,
228
222
  get: function get() {
@@ -247,12 +241,6 @@ Object.defineProperty(exports, "DxcTag", {
247
241
  return _Tag["default"];
248
242
  }
249
243
  });
250
- Object.defineProperty(exports, "DxcText", {
251
- enumerable: true,
252
- get: function get() {
253
- return _Text["default"];
254
- }
255
- });
256
244
  Object.defineProperty(exports, "DxcTextInput", {
257
245
  enumerable: true,
258
246
  get: function get() {
@@ -271,6 +259,12 @@ Object.defineProperty(exports, "DxcToggleGroup", {
271
259
  return _ToggleGroup["default"];
272
260
  }
273
261
  });
262
+ Object.defineProperty(exports, "DxcTypography", {
263
+ enumerable: true,
264
+ get: function get() {
265
+ return _Typography["default"];
266
+ }
267
+ });
274
268
  Object.defineProperty(exports, "DxcWizard", {
275
269
  enumerable: true,
276
270
  get: function get() {
@@ -310,10 +304,6 @@ var _Dialog = _interopRequireDefault(require("./dialog/Dialog"));
310
304
 
311
305
  var _Dropdown = _interopRequireDefault(require("./dropdown/Dropdown"));
312
306
 
313
- var _Footer = _interopRequireDefault(require("./footer/Footer"));
314
-
315
- var _Header = _interopRequireDefault(require("./header/Header"));
316
-
317
307
  var _Slider = _interopRequireDefault(require("./slider/Slider"));
318
308
 
319
309
  var _Switch = _interopRequireDefault(require("./switch/Switch"));
@@ -332,8 +322,6 @@ var _Tag = _interopRequireDefault(require("./tag/Tag"));
332
322
 
333
323
  var _Paginator = _interopRequireDefault(require("./paginator/Paginator"));
334
324
 
335
- var _Sidenav = _interopRequireDefault(require("./sidenav/Sidenav"));
336
-
337
325
  var _Wizard = _interopRequireDefault(require("./wizard/Wizard"));
338
326
 
339
327
  var _Link = _interopRequireDefault(require("./link/Link"));
@@ -366,14 +354,6 @@ var _Select = _interopRequireDefault(require("./select/Select"));
366
354
 
367
355
  var _FileInput = _interopRequireDefault(require("./file-input/FileInput"));
368
356
 
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
357
  var _RadioGroup = _interopRequireDefault(require("./radio-group/RadioGroup"));
378
358
 
379
359
  var _Bleed = _interopRequireDefault(require("./bleed/Bleed"));
@@ -382,7 +362,19 @@ var _Inset = _interopRequireDefault(require("./inset/Inset"));
382
362
 
383
363
  var _QuickNav = _interopRequireDefault(require("./quick-nav/QuickNav"));
384
364
 
385
- var _NavTabs = _interopRequireDefault(require("./tabs-nav/NavTabs"));
365
+ var _NavTabs = _interopRequireDefault(require("./nav-tabs/NavTabs"));
366
+
367
+ var _Flex = _interopRequireDefault(require("./flex/Flex"));
368
+
369
+ var _Typography = _interopRequireDefault(require("./typography/Typography"));
370
+
371
+ var _Paragraph = _interopRequireDefault(require("./paragraph/Paragraph"));
372
+
373
+ var _BulletedList = _interopRequireDefault(require("./bulleted-list/BulletedList"));
374
+
375
+ var _Grid = _interopRequireDefault(require("./grid/Grid"));
376
+
377
+ var _Image = _interopRequireDefault(require("./image/Image"));
386
378
 
387
379
  var _HalstackContext = _interopRequireWildcard(require("./HalstackContext"));
388
380