@dxc-technology/halstack-react 0.0.0-0af2013 → 0.0.0-0bb6041

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 (267) hide show
  1. package/BackgroundColorContext.d.ts +2 -2
  2. package/BackgroundColorContext.js +1 -1
  3. package/HalstackContext.d.ts +1331 -5
  4. package/HalstackContext.js +179 -87
  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.d.ts +4 -3
  10. package/accordion-group/AccordionGroup.js +25 -65
  11. package/accordion-group/AccordionGroup.stories.tsx +27 -1
  12. package/accordion-group/AccordionGroup.test.js +21 -46
  13. package/accordion-group/AccordionGroupAccordion.d.ts +4 -0
  14. package/accordion-group/AccordionGroupAccordion.js +43 -0
  15. package/accordion-group/types.d.ts +8 -1
  16. package/alert/Alert.js +9 -10
  17. package/alert/Alert.stories.tsx +28 -0
  18. package/alert/Alert.test.js +1 -1
  19. package/badge/Badge.d.ts +1 -1
  20. package/badge/Badge.js +5 -3
  21. package/badge/types.d.ts +1 -0
  22. package/bleed/Bleed.js +1 -34
  23. package/bleed/Bleed.stories.tsx +95 -95
  24. package/bleed/types.d.ts +1 -1
  25. package/box/Box.js +25 -37
  26. package/box/Box.stories.tsx +15 -0
  27. package/box/Box.test.js +1 -1
  28. package/box/types.d.ts +1 -0
  29. package/bulleted-list/BulletedList.d.ts +7 -0
  30. package/bulleted-list/BulletedList.js +125 -0
  31. package/bulleted-list/BulletedList.stories.tsx +206 -0
  32. package/bulleted-list/types.d.ts +38 -0
  33. package/button/Button.js +52 -73
  34. package/button/Button.stories.tsx +159 -8
  35. package/button/Button.test.js +1 -1
  36. package/button/types.d.ts +5 -5
  37. package/card/Card.js +41 -44
  38. package/card/Card.stories.tsx +12 -13
  39. package/card/Card.test.js +1 -1
  40. package/card/types.d.ts +1 -0
  41. package/checkbox/Checkbox.d.ts +2 -2
  42. package/checkbox/Checkbox.js +97 -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 +1482 -0
  56. package/common/variables.js +1095 -1106
  57. package/date-input/Calendar.d.ts +4 -0
  58. package/date-input/Calendar.js +258 -0
  59. package/date-input/DateInput.js +136 -236
  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.js +80 -69
  70. package/dialog/Dialog.stories.tsx +230 -123
  71. package/dialog/Dialog.test.js +334 -5
  72. package/dialog/types.d.ts +1 -0
  73. package/dropdown/Dropdown.d.ts +1 -1
  74. package/dropdown/Dropdown.js +246 -249
  75. package/dropdown/Dropdown.stories.tsx +245 -56
  76. package/dropdown/Dropdown.test.js +507 -110
  77. package/dropdown/DropdownMenu.d.ts +4 -0
  78. package/dropdown/DropdownMenu.js +74 -0
  79. package/dropdown/DropdownMenuItem.d.ts +4 -0
  80. package/dropdown/DropdownMenuItem.js +79 -0
  81. package/dropdown/types.d.ts +23 -3
  82. package/file-input/FileInput.d.ts +2 -2
  83. package/file-input/FileInput.js +180 -223
  84. package/file-input/FileInput.stories.tsx +122 -11
  85. package/file-input/FileInput.test.js +14 -14
  86. package/file-input/FileItem.d.ts +4 -14
  87. package/file-input/FileItem.js +44 -66
  88. package/file-input/types.d.ts +17 -0
  89. package/flex/Flex.d.ts +4 -0
  90. package/flex/Flex.js +71 -0
  91. package/flex/Flex.stories.tsx +112 -0
  92. package/flex/types.d.ts +97 -0
  93. package/footer/Footer.js +12 -12
  94. package/footer/Footer.stories.tsx +99 -1
  95. package/footer/Footer.test.js +14 -26
  96. package/footer/Icons.js +1 -1
  97. package/footer/types.d.ts +2 -1
  98. package/grid/Grid.d.ts +7 -0
  99. package/grid/Grid.js +91 -0
  100. package/grid/Grid.stories.tsx +219 -0
  101. package/grid/types.d.ts +115 -0
  102. package/header/Header.d.ts +3 -2
  103. package/header/Header.js +95 -92
  104. package/header/Header.stories.tsx +152 -9
  105. package/header/Header.test.js +2 -2
  106. package/header/Icons.js +2 -2
  107. package/header/types.d.ts +1 -0
  108. package/heading/Heading.js +1 -1
  109. package/heading/Heading.test.js +1 -1
  110. package/inset/Inset.js +1 -34
  111. package/inset/Inset.stories.tsx +37 -36
  112. package/inset/types.d.ts +1 -1
  113. package/layout/ApplicationLayout.d.ts +16 -6
  114. package/layout/ApplicationLayout.js +71 -118
  115. package/layout/ApplicationLayout.stories.tsx +84 -93
  116. package/layout/Icons.d.ts +5 -0
  117. package/layout/Icons.js +13 -2
  118. package/layout/SidenavContext.d.ts +5 -0
  119. package/layout/SidenavContext.js +19 -0
  120. package/layout/types.d.ts +19 -35
  121. package/link/Link.d.ts +2 -2
  122. package/link/Link.js +26 -52
  123. package/link/Link.stories.tsx +73 -6
  124. package/link/Link.test.js +2 -4
  125. package/link/types.d.ts +5 -6
  126. package/main.d.ts +8 -10
  127. package/main.js +42 -52
  128. package/nav-tabs/NavTabs.d.ts +8 -0
  129. package/nav-tabs/NavTabs.js +122 -0
  130. package/nav-tabs/NavTabs.stories.tsx +274 -0
  131. package/nav-tabs/NavTabs.test.js +82 -0
  132. package/nav-tabs/Tab.d.ts +4 -0
  133. package/nav-tabs/Tab.js +146 -0
  134. package/nav-tabs/types.d.ts +52 -0
  135. package/number-input/NumberInput.test.js +44 -8
  136. package/number-input/types.d.ts +1 -1
  137. package/package.json +17 -21
  138. package/paginator/Icons.d.ts +5 -0
  139. package/paginator/Icons.js +16 -28
  140. package/paginator/Paginator.js +20 -49
  141. package/paginator/Paginator.stories.tsx +24 -0
  142. package/paginator/Paginator.test.js +91 -39
  143. package/paragraph/Paragraph.d.ts +5 -0
  144. package/paragraph/Paragraph.js +38 -0
  145. package/paragraph/Paragraph.stories.tsx +44 -0
  146. package/password-input/PasswordInput.js +7 -4
  147. package/password-input/PasswordInput.test.js +15 -15
  148. package/password-input/types.d.ts +1 -1
  149. package/progress-bar/ProgressBar.js +61 -55
  150. package/progress-bar/ProgressBar.stories.jsx +47 -12
  151. package/progress-bar/ProgressBar.test.js +68 -23
  152. package/quick-nav/QuickNav.js +75 -22
  153. package/quick-nav/QuickNav.stories.tsx +145 -26
  154. package/quick-nav/types.d.ts +1 -1
  155. package/radio-group/Radio.d.ts +1 -1
  156. package/radio-group/Radio.js +46 -31
  157. package/radio-group/RadioGroup.js +37 -36
  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 +37 -16
  169. package/select/Option.js +11 -24
  170. package/select/Select.js +127 -116
  171. package/select/Select.stories.tsx +522 -133
  172. package/select/Select.test.js +474 -303
  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 +146 -44
  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 +18 -24
  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 +140 -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.d.ts +4 -0
  210. package/text-input/Suggestion.js +84 -0
  211. package/text-input/Suggestions.d.ts +4 -0
  212. package/text-input/Suggestions.js +134 -0
  213. package/text-input/TextInput.js +219 -342
  214. package/text-input/TextInput.stories.tsx +280 -185
  215. package/text-input/TextInput.test.js +737 -726
  216. package/text-input/types.d.ts +33 -2
  217. package/textarea/Textarea.js +13 -23
  218. package/textarea/Textarea.stories.jsx +60 -1
  219. package/textarea/Textarea.test.js +2 -4
  220. package/textarea/types.d.ts +1 -1
  221. package/toggle-group/ToggleGroup.d.ts +2 -2
  222. package/toggle-group/ToggleGroup.js +7 -4
  223. package/toggle-group/ToggleGroup.stories.tsx +42 -0
  224. package/toggle-group/ToggleGroup.test.js +1 -1
  225. package/toggle-group/types.d.ts +2 -2
  226. package/typography/Typography.d.ts +4 -0
  227. package/typography/Typography.js +32 -0
  228. package/typography/Typography.stories.tsx +198 -0
  229. package/typography/types.d.ts +18 -0
  230. package/typography/types.js +5 -0
  231. package/useTheme.d.ts +1234 -1
  232. package/useTheme.js +1 -1
  233. package/useTranslatedLabels.d.ts +85 -0
  234. package/useTranslatedLabels.js +20 -0
  235. package/utils/BaseTypography.d.ts +21 -0
  236. package/utils/BaseTypography.js +108 -0
  237. package/utils/FocusLock.d.ts +13 -0
  238. package/utils/FocusLock.js +138 -0
  239. package/wizard/Wizard.js +37 -42
  240. package/wizard/Wizard.stories.tsx +40 -1
  241. package/wizard/Wizard.test.js +1 -1
  242. package/wizard/types.d.ts +3 -3
  243. package/common/RequiredComponent.js +0 -32
  244. package/list/List.d.ts +0 -4
  245. package/list/List.js +0 -47
  246. package/list/List.stories.tsx +0 -95
  247. package/list/types.d.ts +0 -7
  248. package/radio/Radio.d.ts +0 -4
  249. package/radio/Radio.js +0 -173
  250. package/radio/Radio.stories.tsx +0 -192
  251. package/radio/Radio.test.js +0 -71
  252. package/radio/types.d.ts +0 -54
  253. package/row/Row.d.ts +0 -3
  254. package/row/Row.js +0 -127
  255. package/row/Row.stories.tsx +0 -237
  256. package/row/types.d.ts +0 -28
  257. package/stack/Stack.d.ts +0 -3
  258. package/stack/Stack.js +0 -97
  259. package/stack/Stack.stories.tsx +0 -164
  260. package/stack/types.d.ts +0 -24
  261. package/text/Text.d.ts +0 -7
  262. package/text/Text.js +0 -30
  263. package/text/Text.stories.tsx +0 -19
  264. /package/{list → bulleted-list}/types.js +0 -0
  265. /package/{radio → flex}/types.js +0 -0
  266. /package/{row → grid}/types.js +0 -0
  267. /package/{stack → nav-tabs}/types.js +0 -0
@@ -1,9 +1,11 @@
1
1
  import React from "react";
2
- import DxcButton from "./Button";
3
2
  import { BackgroundColorProvider } from "../BackgroundColorContext";
3
+ import DxcButton from "./Button";
4
+ import DxcFlex from "./../flex/Flex";
4
5
  import Title from "../../.storybook/components/Title";
5
6
  import ExampleContainer from "../../.storybook/components/ExampleContainer";
6
7
  import DarkContainer from "../../.storybook/components/DarkSection";
8
+ import { HalstackProvider } from "../HalstackContext";
7
9
 
8
10
  export default {
9
11
  title: "Button",
@@ -11,11 +13,50 @@ export default {
11
13
  };
12
14
 
13
15
  const iconSVG = (
14
- <svg viewBox="0 0 24 24" fill="currentColor">
16
+ <svg width="24px" height="24px" viewBox="0 0 24 24" fill="currentColor">
15
17
  <path d="M0 0h24v24H0z" fill="none" />
16
18
  <path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z" />
17
19
  </svg>
18
20
  );
21
+
22
+ const facebookIcon = (
23
+ <svg
24
+ version="1.1"
25
+ id="Capa_1"
26
+ x="0px"
27
+ y="0px"
28
+ width="438.536px"
29
+ height="438.536px"
30
+ viewBox="0 0 438.536 438.536"
31
+ fill="currentColor"
32
+ >
33
+ <g>
34
+ <path
35
+ d="M414.41,24.123C398.333,8.042,378.963,0,356.315,0H82.228C59.58,0,40.21,8.042,24.126,24.123
36
+ C8.045,40.207,0.003,59.576,0.003,82.225v274.084c0,22.647,8.042,42.018,24.123,58.102c16.084,16.084,35.454,24.126,58.102,24.126
37
+ h274.084c22.648,0,42.018-8.042,58.095-24.126c16.084-16.084,24.126-35.454,24.126-58.102V82.225
38
+ C438.532,59.576,430.49,40.204,414.41,24.123z M373.155,225.548h-49.963V406.84h-74.802V225.548H210.99V163.02h37.401v-37.402
39
+ c0-26.838,6.283-47.107,18.843-60.813c12.559-13.706,33.304-20.555,62.242-20.555h49.963v62.526h-31.401
40
+ c-10.663,0-17.467,1.853-20.417,5.568c-2.949,3.711-4.428,10.23-4.428,19.558v31.119h56.534L373.155,225.548z"
41
+ />
42
+ </g>
43
+ </svg>
44
+ );
45
+
46
+ const smallIcon = (
47
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" height="20" width="20" fill="currentColor">
48
+ <path d="m7.646 18.333-.313-2.625q-.208-.125-.458-.27-.25-.146-.458-.271l-2.438 1.021-2.354-4.063 2.083-1.583V9.458L1.625 7.875l2.354-4.063 2.438 1.021q.208-.125.458-.27.25-.146.458-.271l.313-2.625h4.708l.313 2.625q.208.125.458.271.25.145.458.27l2.438-1.021 2.354 4.063-2.063 1.583v1.084l2.063 1.583-2.354 4.063-2.438-1.021q-.208.125-.458.271-.25.145-.458.27l-.313 2.625ZM10 12.979q1.229 0 2.104-.875T12.979 10q0-1.229-.875-2.104T10 7.021q-1.229 0-2.104.875T7.021 10q0 1.229.875 2.104t2.104.875Zm0-1.75q-.5 0-.865-.364-.364-.365-.364-.865t.364-.865q.365-.364.865-.364t.865.364q.364.365.364.865t-.364.865q-.365.364-.865.364ZM10.021 10Zm-.854 6.583h1.666l.25-2.166q.605-.167 1.167-.5.562-.334 1.021-.792l2.021.854.833-1.375-1.771-1.354q.104-.292.146-.604.042-.313.042-.646 0-.292-.042-.594t-.125-.635l1.771-1.375-.834-1.375-2.02.875q-.48-.479-1.032-.802-.552-.323-1.156-.49l-.271-2.187H9.167l-.271 2.187q-.604.167-1.156.49-.552.323-1.011.781l-2.021-.854-.833 1.375 1.75 1.354q-.083.333-.125.646-.042.312-.042.604t.042.594q.042.302.125.635l-1.75 1.375.833 1.375 2.021-.854q.459.458 1.011.781.552.323 1.156.49Z" />
49
+ </svg>
50
+ );
51
+
52
+ const opinionatedTheme = {
53
+ button: {
54
+ baseColor: "#5f249f",
55
+ primaryFontColor: "#ffffff",
56
+ secondaryHoverFontColor: "#ffffff",
57
+ },
58
+ };
59
+
19
60
  export const Chromatic = () => (
20
61
  <>
21
62
  <Title title="Primary" theme="light" level={2} />
@@ -37,7 +78,7 @@ export const Chromatic = () => (
37
78
  </ExampleContainer>
38
79
  <ExampleContainer>
39
80
  <Title title="Disabled" theme="light" level={4} />
40
- <DxcButton label="Primary disabled" disabled />
81
+ <DxcButton label="Primary disabled" disabled icon={iconSVG} />
41
82
  </ExampleContainer>
42
83
  <ExampleContainer>
43
84
  <Title title="With left icon" theme="light" level={4} />
@@ -51,6 +92,18 @@ export const Chromatic = () => (
51
92
  <Title title="Only icon" theme="light" level={4} />
52
93
  <DxcButton icon={iconSVG} />
53
94
  </ExampleContainer>
95
+ <ExampleContainer>
96
+ <Title title="Big icon (SVG)" theme="light" level={4} />
97
+ <DxcButton icon={facebookIcon} />
98
+ </ExampleContainer>
99
+ <ExampleContainer>
100
+ <Title title="Big icon (image)" theme="light" level={4} />
101
+ <DxcButton icon="https://www.freepnglogos.com/uploads/facebook-logo-design-1.png" />
102
+ </ExampleContainer>
103
+ <ExampleContainer>
104
+ <Title title="Small icon" theme="light" level={4} />
105
+ <DxcButton icon={smallIcon} />
106
+ </ExampleContainer>
54
107
  <Title title="Secondary" theme="light" level={2} />
55
108
  <ExampleContainer>
56
109
  <Title title="Enabled" theme="light" level={4} />
@@ -70,12 +123,19 @@ export const Chromatic = () => (
70
123
  </ExampleContainer>
71
124
  <ExampleContainer>
72
125
  <Title title="Disabled" theme="light" level={4} />
73
- <DxcButton mode="secondary" disabled label="Secondary disabled" />
126
+ <DxcButton mode="secondary" disabled label="Secondary disabled" icon={iconSVG} />
74
127
  </ExampleContainer>
75
128
  <ExampleContainer>
76
129
  <Title title="With icon" theme="light" level={4} />
77
130
  <DxcButton mode="secondary" label="Secondary" icon={iconSVG} />
78
131
  </ExampleContainer>
132
+ <ExampleContainer>
133
+ <Title title="Only icon (image)" theme="light" level={4} />
134
+ <DxcButton
135
+ mode="secondary"
136
+ icon="https://www.freepnglogos.com/uploads/facebook-logo-design-1.png"
137
+ />
138
+ </ExampleContainer>
79
139
  <Title title="Text" theme="light" level={2} />
80
140
  <ExampleContainer>
81
141
  <Title title="Enabled" theme="light" level={4} />
@@ -95,12 +155,19 @@ export const Chromatic = () => (
95
155
  </ExampleContainer>
96
156
  <ExampleContainer>
97
157
  <Title title="Disabled" theme="light" level={4} />
98
- <DxcButton mode="text" label="Text disabled" disabled />
158
+ <DxcButton mode="text" label="Text disabled" disabled icon={iconSVG} />
99
159
  </ExampleContainer>
100
160
  <ExampleContainer>
101
161
  <Title title="With icon" theme="light" level={4} />
102
162
  <DxcButton label="Text" mode="text" icon={iconSVG} />
103
163
  </ExampleContainer>
164
+ <ExampleContainer>
165
+ <Title title="Only icon (image)" theme="light" level={4} />
166
+ <DxcButton
167
+ mode="text"
168
+ icon="https://developer.apple.com/design/human-interface-guidelines/foundations/app-icons/images/icon-and-image-large-icon-settings_2x.png"
169
+ />
170
+ </ExampleContainer>
104
171
  <BackgroundColorProvider color="#333333">
105
172
  <DarkContainer>
106
173
  <Title title="Primary" theme="dark" level={2} />
@@ -122,7 +189,7 @@ export const Chromatic = () => (
122
189
  </ExampleContainer>
123
190
  <ExampleContainer>
124
191
  <Title title="Disabled" theme="dark" level={4} />
125
- <DxcButton label="Primary disabled" disabled />
192
+ <DxcButton label="Primary disabled" disabled icon={iconSVG} />
126
193
  </ExampleContainer>
127
194
  <ExampleContainer>
128
195
  <Title title="With icon" theme="dark" level={4} />
@@ -147,7 +214,7 @@ export const Chromatic = () => (
147
214
  </ExampleContainer>
148
215
  <ExampleContainer>
149
216
  <Title title="Disabled" theme="dark" level={4} />
150
- <DxcButton mode="secondary" disabled label="Secondary disabled" />
217
+ <DxcButton mode="secondary" disabled label="Secondary disabled" icon={iconSVG} />
151
218
  </ExampleContainer>
152
219
  <ExampleContainer>
153
220
  <Title title="With icon" theme="dark" level={4} />
@@ -172,7 +239,7 @@ export const Chromatic = () => (
172
239
  </ExampleContainer>
173
240
  <ExampleContainer>
174
241
  <Title title="Disabled" theme="dark" level={4} />
175
- <DxcButton mode="text" label="Text disabled" disabled />
242
+ <DxcButton mode="text" label="Text disabled" disabled icon={iconSVG} />
176
243
  </ExampleContainer>
177
244
  <ExampleContainer>
178
245
  <Title title="With icon" theme="dark" level={4} />
@@ -270,5 +337,89 @@ export const Chromatic = () => (
270
337
  <Title title="Xxlarge margin" theme="light" level={4} />
271
338
  <DxcButton label="Xxlarge margin" margin="xxlarge" />
272
339
  </ExampleContainer>
340
+ <Title title="Inside a flex" theme="light" level={2} />
341
+ <ExampleContainer>
342
+ <DxcFlex direction="column" gap="1rem">
343
+ <DxcButton label="Button" />
344
+ <DxcButton label="Button" />
345
+ <DxcButton label="Button" />
346
+ </DxcFlex>
347
+ </ExampleContainer>
348
+ <Title title="Opinionated theme" theme="light" level={2} />
349
+ <Title title="Primary" theme="light" level={3} />
350
+ <ExampleContainer>
351
+ <Title title="Enabled" theme="light" level={4} />
352
+ <HalstackProvider theme={opinionatedTheme}>
353
+ <DxcButton label="Primary" icon={iconSVG} />
354
+ </HalstackProvider>
355
+ </ExampleContainer>
356
+ <ExampleContainer pseudoState="pseudo-hover">
357
+ <Title title="Hovered" theme="light" level={4} />
358
+ <DxcButton label="Primary hovered" icon={iconSVG} />
359
+ </ExampleContainer>
360
+ <ExampleContainer pseudoState="pseudo-focus">
361
+ <Title title="Focused" theme="light" level={4} />
362
+ <DxcButton label="Primary focused" icon={iconSVG} />
363
+ </ExampleContainer>
364
+ <ExampleContainer pseudoState="pseudo-active">
365
+ <Title title="Actived" theme="light" level={4} />
366
+ <DxcButton label="Primary actived" icon={iconSVG} />
367
+ </ExampleContainer>
368
+ <ExampleContainer>
369
+ <Title title="Disabled" theme="light" level={4} />
370
+ <HalstackProvider theme={opinionatedTheme}>
371
+ <DxcButton label="Primary" icon={iconSVG} disabled />
372
+ </HalstackProvider>
373
+ </ExampleContainer>
374
+ <Title title="Secondary" theme="light" level={3} />
375
+ <ExampleContainer>
376
+ <Title title="Enabled" theme="light" level={4} />
377
+ <HalstackProvider theme={opinionatedTheme}>
378
+ <DxcButton mode="secondary" label="Secondary" icon={iconSVG} />
379
+ </HalstackProvider>
380
+ </ExampleContainer>
381
+ <ExampleContainer pseudoState="pseudo-hover">
382
+ <Title title="Hovered" theme="light" level={4} />
383
+ <DxcButton mode="secondary" label="Secondary hovered" icon={iconSVG} />
384
+ </ExampleContainer>
385
+ <ExampleContainer pseudoState="pseudo-focus">
386
+ <Title title="Focused" theme="light" level={4} />
387
+ <DxcButton mode="secondary" label="Secondary focused" icon={iconSVG} />
388
+ </ExampleContainer>
389
+ <ExampleContainer pseudoState="pseudo-active">
390
+ <Title title="Actived" theme="light" level={4} />
391
+ <DxcButton mode="secondary" label="Secondary actived" icon={iconSVG} />
392
+ </ExampleContainer>
393
+ <ExampleContainer>
394
+ <Title title="Disabled" theme="light" level={4} />
395
+ <HalstackProvider theme={opinionatedTheme}>
396
+ <DxcButton mode="secondary" label="Secondary" icon={iconSVG} disabled />
397
+ </HalstackProvider>
398
+ </ExampleContainer>
399
+ <Title title="Text" theme="light" level={3} />
400
+ <ExampleContainer>
401
+ <Title title="Enabled" theme="light" level={4} />
402
+ <HalstackProvider theme={opinionatedTheme}>
403
+ <DxcButton mode="text" label="Text" icon={iconSVG} />
404
+ </HalstackProvider>
405
+ </ExampleContainer>
406
+ <ExampleContainer pseudoState="pseudo-hover">
407
+ <Title title="Hovered" theme="light" level={4} />
408
+ <DxcButton mode="text" label="Text hovered" icon={iconSVG} />
409
+ </ExampleContainer>
410
+ <ExampleContainer pseudoState="pseudo-focus">
411
+ <Title title="Focused" theme="light" level={4} />
412
+ <DxcButton mode="text" label="Text focused" icon={iconSVG} />
413
+ </ExampleContainer>
414
+ <ExampleContainer pseudoState="pseudo-active">
415
+ <Title title="Actived" theme="light" level={4} />
416
+ <DxcButton mode="text" label="Text actived" icon={iconSVG} />
417
+ </ExampleContainer>
418
+ <ExampleContainer>
419
+ <Title title="Disabled" theme="light" level={4} />
420
+ <HalstackProvider theme={opinionatedTheme}>
421
+ <DxcButton mode="text" label="Text disabled" icon={iconSVG} disabled />
422
+ </HalstackProvider>
423
+ </ExampleContainer>
273
424
  </>
274
425
  );
@@ -6,7 +6,7 @@ var _react = _interopRequireDefault(require("react"));
6
6
 
7
7
  var _react2 = require("@testing-library/react");
8
8
 
9
- var _Button = _interopRequireDefault(require("./Button"));
9
+ var _Button = _interopRequireDefault(require("./Button.tsx"));
10
10
 
11
11
  describe("Button component tests", function () {
12
12
  test("Button renders with correct text", function () {
package/button/types.d.ts CHANGED
@@ -6,14 +6,14 @@ 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
  declare type Props = {
11
11
  /**
12
- * Text to be placed next to the button.
12
+ * Text to be placed in the button.
13
13
  */
14
14
  label?: string;
15
15
  /**
16
- * Uses one of the available button modes.
16
+ * The available button modes.
17
17
  */
18
18
  mode?: "primary" | "secondary" | "text";
19
19
  /**
@@ -25,11 +25,11 @@ declare type Props = {
25
25
  */
26
26
  iconPosition?: "before" | "after";
27
27
  /**
28
- * This prop corresponds to the 'type' prop of the button in html.
28
+ * 'type' html prop of the button.
29
29
  */
30
30
  type?: "button" | "reset" | "submit";
31
31
  /**
32
- * Element or path used as the icon that will be placed next to the button label.
32
+ * Element or path used as the icon that will be placed next to the label.
33
33
  */
34
34
  icon?: string | SVG;
35
35
  /**
package/card/Card.js CHANGED
@@ -19,13 +19,13 @@ var _react = _interopRequireWildcard(require("react"));
19
19
 
20
20
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
21
21
 
22
- var _variables = require("../common/variables.js");
22
+ var _variables = require("../common/variables");
23
23
 
24
24
  var _useTheme = _interopRequireDefault(require("../useTheme"));
25
25
 
26
26
  var _Box = _interopRequireDefault(require("../box/Box"));
27
27
 
28
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
28
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
29
29
 
30
30
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
31
31
 
@@ -60,21 +60,10 @@ var DxcCard = function DxcCard(_ref) {
60
60
  imageBgColor: imageBgColor
61
61
  }, /*#__PURE__*/_react["default"].createElement(TagImage, {
62
62
  imagePadding: imagePadding,
63
- cover: imageCover,
63
+ imageCover: imageCover,
64
64
  src: imageSrc
65
65
  }));
66
66
 
67
- var tagContent = /*#__PURE__*/_react["default"].createElement(_Box["default"], {
68
- shadowDepth: !outlined ? 0 : isHovered && (onClick || linkHref) ? 2 : 1
69
- }, /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
70
- theme: colorsTheme.card
71
- }, /*#__PURE__*/_react["default"].createElement(CardContainer, {
72
- hasAction: onClick || linkHref,
73
- imagePosition: imagePosition
74
- }, imageSrc && imagePosition === "before" && imageComponent, /*#__PURE__*/_react["default"].createElement(CardContent, {
75
- contentPadding: contentPadding
76
- }, children), imageSrc && imagePosition === "after" && imageComponent)));
77
-
78
67
  return /*#__PURE__*/_react["default"].createElement(StyledDxcCard, {
79
68
  margin: margin,
80
69
  onMouseEnter: function onMouseEnter() {
@@ -84,15 +73,22 @@ var DxcCard = function DxcCard(_ref) {
84
73
  return changeIsHovered(false);
85
74
  },
86
75
  onClick: onClick,
87
- hasAction: onClick,
88
- tabIndex: typeof onClick === "function" && !linkHref ? tabIndex : -1
89
- }, linkHref && /*#__PURE__*/_react["default"].createElement(StyledLink, {
90
- tabIndex: tabIndex,
76
+ hasAction: onClick || linkHref,
77
+ tabIndex: onClick || linkHref ? tabIndex : -1,
78
+ as: linkHref && "a",
91
79
  href: linkHref
92
- }, tagContent) || tagContent);
80
+ }, /*#__PURE__*/_react["default"].createElement(_Box["default"], {
81
+ shadowDepth: !outlined ? 0 : isHovered && (onClick || linkHref) ? 2 : 1
82
+ }, /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
83
+ theme: colorsTheme.card
84
+ }, /*#__PURE__*/_react["default"].createElement(CardContainer, {
85
+ hasAction: onClick || linkHref
86
+ }, imageSrc && imagePosition === "before" && imageComponent, /*#__PURE__*/_react["default"].createElement(CardContent, {
87
+ contentPadding: contentPadding
88
+ }, children), imageSrc && imagePosition === "after" && imageComponent))));
93
89
  };
94
90
 
95
- var StyledDxcCard = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n cursor: ", ";\n outline: ", ";\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n\n :focus {\n outline: #0095ff auto 1px;\n }\n"])), function (_ref2) {
91
+ var StyledDxcCard = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n cursor: ", ";\n outline: ", ";\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n text-decoration: none;\n ", "\n"])), function (_ref2) {
96
92
  var hasAction = _ref2.hasAction;
97
93
  return hasAction && "pointer" || "unset";
98
94
  }, function (_ref3) {
@@ -103,59 +99,60 @@ var StyledDxcCard = _styledComponents["default"].div(_templateObject || (_templa
103
99
  return margin && (0, _typeof2["default"])(margin) !== "object" ? _variables.spaces[margin] : "0px";
104
100
  }, function (_ref5) {
105
101
  var margin = _ref5.margin;
106
- return margin && margin.top ? _variables.spaces[margin.top] : "";
102
+ return margin && (0, _typeof2["default"])(margin) === "object" && margin.top ? _variables.spaces[margin.top] : "";
107
103
  }, function (_ref6) {
108
104
  var margin = _ref6.margin;
109
- return margin && margin.right ? _variables.spaces[margin.right] : "";
105
+ return margin && (0, _typeof2["default"])(margin) === "object" && margin.right ? _variables.spaces[margin.right] : "";
110
106
  }, function (_ref7) {
111
107
  var margin = _ref7.margin;
112
- return margin && margin.bottom ? _variables.spaces[margin.bottom] : "";
108
+ return margin && (0, _typeof2["default"])(margin) === "object" && margin.bottom ? _variables.spaces[margin.bottom] : "";
113
109
  }, function (_ref8) {
114
110
  var margin = _ref8.margin;
115
- return margin && margin.left ? _variables.spaces[margin.left] : "";
111
+ return margin && (0, _typeof2["default"])(margin) === "object" && margin.left ? _variables.spaces[margin.left] : "";
112
+ }, function (_ref9) {
113
+ var hasAction = _ref9.hasAction;
114
+ return hasAction && ":focus {\n outline: #0095ff auto 1px;\n }";
116
115
  });
117
116
 
118
117
  var CardContainer = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n height: ", ";\n width: ", ";\n &:hover {\n border-color: ", ";\n }\n"])), function (props) {
119
118
  return props.theme.height;
120
119
  }, function (props) {
121
120
  return props.theme.width;
122
- }, function (_ref9) {
123
- var hasAction = _ref9.hasAction;
121
+ }, function (_ref10) {
122
+ var hasAction = _ref10.hasAction;
124
123
  return hasAction ? "" : "unset";
125
124
  });
126
125
 
127
- var StyledLink = _styledComponents["default"].a(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n cursor: pointer;\n text-decoration: none;\n\n :focus {\n outline-color: #0095ff;\n }\n"])));
128
-
129
- var TagImage = _styledComponents["default"].img(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n height: ", ";\n width: ", ";\n object-fit: ", ";\n"])), function (_ref10) {
130
- var imagePadding = _ref10.imagePadding;
131
- return !imagePadding ? "100%" : "calc(100% - ".concat(_variables.spaces[imagePadding], " - ").concat(_variables.spaces[imagePadding], ")");
132
- }, function (_ref11) {
126
+ var TagImage = _styledComponents["default"].img(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n height: ", ";\n width: ", ";\n object-fit: ", ";\n"])), function (_ref11) {
133
127
  var imagePadding = _ref11.imagePadding;
134
- return !imagePadding ? "100%" : "calc(100% - ".concat(_variables.spaces[imagePadding], " - ").concat(_variables.spaces[imagePadding], ")");
128
+ return !imagePadding ? "100%" : (0, _typeof2["default"])(imagePadding) !== "object" && "calc(100% - ".concat(_variables.spaces[imagePadding], " - ").concat(_variables.spaces[imagePadding], ")");
135
129
  }, function (_ref12) {
136
- var cover = _ref12.cover;
137
- return cover ? "cover" : "contain";
130
+ var imagePadding = _ref12.imagePadding;
131
+ return !imagePadding ? "100%" : (0, _typeof2["default"])(imagePadding) !== "object" && "calc(100% - ".concat(_variables.spaces[imagePadding], " - ").concat(_variables.spaces[imagePadding], ")");
132
+ }, function (_ref13) {
133
+ var imageCover = _ref13.imageCover;
134
+ return imageCover ? "cover" : "contain";
138
135
  });
139
136
 
140
- var ImageContainer = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n width: 35%;\n height: 100%;\n flex-shrink: 0;\n background: ", ";\n justify-content: center;\n align-items: center;\n display: inline-flex;\n"])), function (_ref13) {
141
- var imageBgColor = _ref13.imageBgColor;
137
+ var ImageContainer = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n width: 35%;\n height: 100%;\n flex-shrink: 0;\n background: ", ";\n justify-content: center;\n align-items: center;\n display: inline-flex;\n"])), function (_ref14) {
138
+ var imageBgColor = _ref14.imageBgColor;
142
139
  return imageBgColor;
143
140
  });
144
141
 
145
- var CardContent = _styledComponents["default"].div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n flex-grow: 1;\n padding: ", ";\n padding-top: ", ";\n padding-right: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n overflow: hidden;\n"])), function (_ref14) {
146
- var contentPadding = _ref14.contentPadding;
147
- return contentPadding && (0, _typeof2["default"])(contentPadding) !== "object" ? _variables.spaces[contentPadding] : "0px";
148
- }, function (_ref15) {
142
+ var CardContent = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n flex-grow: 1;\n padding: ", ";\n padding-top: ", ";\n padding-right: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n overflow: hidden;\n"])), function (_ref15) {
149
143
  var contentPadding = _ref15.contentPadding;
150
- return contentPadding && (0, _typeof2["default"])(contentPadding) === "object" && contentPadding.top ? _variables.spaces[contentPadding.top] : "";
144
+ return contentPadding && (0, _typeof2["default"])(contentPadding) !== "object" ? _variables.spaces[contentPadding] : "0px";
151
145
  }, function (_ref16) {
152
146
  var contentPadding = _ref16.contentPadding;
153
- return contentPadding && (0, _typeof2["default"])(contentPadding) === "object" && contentPadding.right ? _variables.spaces[contentPadding.right] : "";
147
+ return contentPadding && (0, _typeof2["default"])(contentPadding) === "object" && contentPadding.top ? _variables.spaces[contentPadding.top] : "";
154
148
  }, function (_ref17) {
155
149
  var contentPadding = _ref17.contentPadding;
156
- return contentPadding && (0, _typeof2["default"])(contentPadding) === "object" && contentPadding.bottom ? _variables.spaces[contentPadding.bottom] : "";
150
+ return contentPadding && (0, _typeof2["default"])(contentPadding) === "object" && contentPadding.right ? _variables.spaces[contentPadding.right] : "";
157
151
  }, function (_ref18) {
158
152
  var contentPadding = _ref18.contentPadding;
153
+ return contentPadding && (0, _typeof2["default"])(contentPadding) === "object" && contentPadding.bottom ? _variables.spaces[contentPadding.bottom] : "";
154
+ }, function (_ref19) {
155
+ var contentPadding = _ref19.contentPadding;
159
156
  return contentPadding && (0, _typeof2["default"])(contentPadding) === "object" && contentPadding.left ? _variables.spaces[contentPadding.left] : "";
160
157
  });
161
158
 
@@ -2,7 +2,6 @@ import React from "react";
2
2
  import Title from "../../.storybook/components/Title";
3
3
  import ExampleContainer from "../../.storybook/components/ExampleContainer";
4
4
  import DxcCard from "./Card";
5
- import imagePath from "./ice-cream.jpg";
6
5
  import { userEvent, within } from "@storybook/testing-library";
7
6
 
8
7
  export default {
@@ -38,72 +37,72 @@ const Card = () => (
38
37
  </ExampleContainer>
39
38
  <Title title="Default with image" theme="light" level={4} />
40
39
  <ExampleContainer>
41
- <DxcCard imageSrc={imagePath}>Default</DxcCard>
40
+ <DxcCard imageSrc="https://picsum.photos/id/1022/200/300">Default</DxcCard>
42
41
  </ExampleContainer>
43
42
  <Title title="Default image with background color" theme="light" level={4} />
44
43
  <ExampleContainer>
45
- <DxcCard imageSrc={imagePath} imageBgColor="yellow">
44
+ <DxcCard imageSrc="https://picsum.photos/id/1022/200/300" imageBgColor="yellow">
46
45
  Background color
47
46
  </DxcCard>
48
47
  </ExampleContainer>
49
48
  <Title title="Default image with position after" theme="light" level={4} />
50
49
  <ExampleContainer>
51
- <DxcCard imageSrc={imagePath} imagePosition="after">
50
+ <DxcCard imageSrc="https://picsum.photos/id/1022/200/300" imagePosition="after">
52
51
  Position after
53
52
  </DxcCard>
54
53
  </ExampleContainer>
55
54
  <Title title="Image cover" theme="light" level={4} />
56
55
  <ExampleContainer>
57
- <DxcCard imageSrc={imagePath} imageCover>
56
+ <DxcCard imageSrc="https://picsum.photos/id/1022/200/300" imageCover>
58
57
  Image cover
59
58
  </DxcCard>
60
59
  </ExampleContainer>
61
60
  <Title title="Image cover with position after" theme="light" level={4} />
62
61
  <ExampleContainer>
63
- <DxcCard imageSrc={imagePath} imageCover imagePosition="after">
62
+ <DxcCard imageSrc="https://picsum.photos/id/1022/200/300" imageCover imagePosition="after">
64
63
  Image cover with position after
65
64
  </DxcCard>
66
65
  </ExampleContainer>
67
66
  <Title title="Image padding" theme="light" level={2} />
68
67
  <ExampleContainer>
69
68
  <Title title="Xxsmall" theme="light" level={4} />
70
- <DxcCard imageSrc={imagePath} imagePadding="xxsmall" imageCover>
69
+ <DxcCard imageSrc="https://picsum.photos/id/1022/200/300" imagePadding="xxsmall" imageCover>
71
70
  Xxsmall
72
71
  </DxcCard>
73
72
  </ExampleContainer>
74
73
  <ExampleContainer>
75
74
  <Title title="Xsmall" theme="light" level={4} />
76
- <DxcCard imageSrc={imagePath} imagePadding="xsmall" imageCover>
75
+ <DxcCard imageSrc="https://picsum.photos/id/1022/200/300" imagePadding="xsmall" imageCover>
77
76
  Xsmall
78
77
  </DxcCard>
79
78
  </ExampleContainer>
80
79
  <ExampleContainer>
81
80
  <Title title="Small" theme="light" level={4} />
82
- <DxcCard imageSrc={imagePath} imagePadding="small" imageCover>
81
+ <DxcCard imageSrc="https://picsum.photos/id/1022/200/300" imagePadding="small" imageCover>
83
82
  Small
84
83
  </DxcCard>
85
84
  </ExampleContainer>
86
85
  <ExampleContainer>
87
86
  <Title title="Medium" theme="light" level={4} />
88
- <DxcCard imageSrc={imagePath} imagePadding="medium" imageCover>
87
+ <DxcCard imageSrc="https://picsum.photos/id/1022/200/300" imagePadding="medium" imageCover>
89
88
  Medium
90
89
  </DxcCard>
91
90
  </ExampleContainer>
92
91
  <ExampleContainer>
93
92
  <Title title="Large" theme="light" level={4} />
94
- <DxcCard imageSrc={imagePath} imagePadding="large" imageCover>
93
+ <DxcCard imageSrc="https://picsum.photos/id/1022/200/300" imagePadding="large" imageCover>
95
94
  Large
96
95
  </DxcCard>
97
96
  </ExampleContainer>
98
97
  <ExampleContainer>
99
98
  <Title title="Xlarge" theme="light" level={4} />
100
- <DxcCard imageSrc={imagePath} imagePadding="xlarge" imageCover>
99
+ <DxcCard imageSrc="https://picsum.photos/id/1022/200/300" imagePadding="xlarge" imageCover>
101
100
  Xlarge
102
101
  </DxcCard>
103
102
  </ExampleContainer>
104
103
  <ExampleContainer>
105
104
  <Title title="Xxlarge" theme="light" level={4} />
106
- <DxcCard imageSrc={imagePath} imagePadding="xxlarge" imageCover>
105
+ <DxcCard imageSrc="https://picsum.photos/id/1022/200/300" imagePadding="xxlarge" imageCover>
107
106
  Xxlarge
108
107
  </DxcCard>
109
108
  </ExampleContainer>
package/card/Card.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 _Card = _interopRequireDefault(require("./Card"));
9
+ var _Card = _interopRequireDefault(require("./Card.tsx"));
10
10
 
11
11
  describe("Card component tests", function () {
12
12
  test("Card renders with correct content", function () {
package/card/types.d.ts CHANGED
@@ -47,6 +47,7 @@ declare type Props = {
47
47
  */
48
48
  margin?: Space | Size;
49
49
  /**
50
+ * @deprecated This prop will be removed shortly, consider using the Inset component for this purpose.
50
51
  * Size of the padding to be applied to the content area ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
51
52
  * You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different padding sizes.
52
53
  */
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from "react";
2
2
  import CheckboxPropsType from "./types";
3
- declare const DxcCheckbox: ({ checked, defaultChecked, value, label, labelPosition, name, disabled, optional, onChange, margin, size, tabIndex, }: CheckboxPropsType) => JSX.Element;
3
+ declare const DxcCheckbox: React.ForwardRefExoticComponent<CheckboxPropsType & React.RefAttributes<HTMLDivElement>>;
4
4
  export default DxcCheckbox;