@dxc-technology/halstack-react 0.0.0-d4fec82 → 0.0.0-d618bea

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 (191) hide show
  1. package/BackgroundColorContext.d.ts +10 -0
  2. package/BackgroundColorContext.js +1 -3
  3. package/ThemeContext.d.ts +15 -0
  4. package/ThemeContext.js +5 -8
  5. package/V3Select/V3Select.js +2 -2
  6. package/V3Textarea/V3Textarea.js +2 -2
  7. package/accordion/Accordion.js +2 -2
  8. package/accordion-group/AccordionGroup.js +2 -2
  9. package/accordion-group/AccordionGroup.stories.tsx +225 -0
  10. package/alert/Alert.js +2 -2
  11. package/alert/Alert.stories.tsx +170 -0
  12. package/alert/types.d.ts +1 -1
  13. package/badge/Badge.js +1 -1
  14. package/box/Box.d.ts +4 -0
  15. package/box/Box.js +6 -32
  16. package/box/{Box.stories.jsx → Box.stories.tsx} +0 -0
  17. package/box/types.d.ts +43 -0
  18. package/box/types.js +5 -0
  19. package/button/Button.d.ts +1 -1
  20. package/button/Button.js +9 -12
  21. package/button/Button.stories.tsx +217 -234
  22. package/button/types.d.ts +11 -11
  23. package/card/Card.js +5 -6
  24. package/card/Card.stories.tsx +201 -0
  25. package/card/ice-cream.jpg +0 -0
  26. package/card/types.d.ts +4 -6
  27. package/checkbox/Checkbox.js +2 -2
  28. package/checkbox/Checkbox.stories.tsx +192 -0
  29. package/checkbox/types.d.ts +1 -1
  30. package/chip/Chip.d.ts +4 -0
  31. package/chip/Chip.js +1 -23
  32. package/chip/Chip.stories.tsx +121 -0
  33. package/chip/types.d.ts +53 -0
  34. package/chip/types.js +5 -0
  35. package/common/variables.js +44 -37
  36. package/date/Date.js +1 -1
  37. package/date-input/DateInput.js +4 -7
  38. package/date-input/DateInput.stories.tsx +138 -0
  39. package/dialog/Dialog.d.ts +4 -0
  40. package/dialog/Dialog.js +6 -25
  41. package/dialog/Dialog.stories.tsx +212 -0
  42. package/dialog/types.d.ts +43 -0
  43. package/dialog/types.js +5 -0
  44. package/dropdown/Dropdown.js +1 -1
  45. package/dropdown/types.d.ts +1 -1
  46. package/file-input/FileInput.d.ts +4 -0
  47. package/file-input/FileInput.js +65 -76
  48. package/file-input/FileItem.d.ts +14 -0
  49. package/file-input/FileItem.js +12 -21
  50. package/file-input/types.d.ts +112 -0
  51. package/file-input/types.js +5 -0
  52. package/footer/Footer.d.ts +1 -1
  53. package/footer/Footer.js +8 -8
  54. package/footer/Footer.stories.tsx +151 -0
  55. package/footer/types.d.ts +22 -18
  56. package/header/Header.d.ts +7 -0
  57. package/header/Header.js +28 -30
  58. package/header/Header.stories.tsx +162 -0
  59. package/header/Icons.js +2 -27
  60. package/header/types.d.ts +47 -0
  61. package/header/types.js +5 -0
  62. package/heading/Heading.d.ts +4 -0
  63. package/heading/Heading.js +7 -24
  64. package/heading/Heading.stories.tsx +53 -0
  65. package/heading/types.d.ts +33 -0
  66. package/heading/types.js +5 -0
  67. package/input-text/InputText.js +2 -2
  68. package/layout/ApplicationLayout.d.ts +10 -0
  69. package/layout/ApplicationLayout.js +8 -18
  70. package/layout/ApplicationLayout.stories.tsx +171 -0
  71. package/layout/types.d.ts +57 -0
  72. package/layout/types.js +5 -0
  73. package/link/Link.d.ts +3 -0
  74. package/link/Link.js +4 -26
  75. package/link/Link.stories.tsx +146 -0
  76. package/link/types.d.ts +74 -0
  77. package/link/types.js +5 -0
  78. package/list/List.d.ts +7 -0
  79. package/list/List.js +37 -0
  80. package/list/List.stories.tsx +70 -0
  81. package/main.d.ts +7 -3
  82. package/main.js +34 -2
  83. package/number-input/NumberInput.d.ts +4 -0
  84. package/number-input/NumberInput.js +5 -50
  85. package/number-input/{NumberInput.stories.jsx → NumberInput.stories.tsx} +0 -0
  86. package/number-input/NumberInputContext.d.ts +4 -0
  87. package/number-input/NumberInputContext.js +5 -2
  88. package/number-input/numberInputContextTypes.d.ts +19 -0
  89. package/number-input/numberInputContextTypes.js +5 -0
  90. package/number-input/types.d.ts +117 -0
  91. package/number-input/types.js +5 -0
  92. package/package.json +1 -1
  93. package/paginator/Paginator.js +2 -8
  94. package/paginator/Paginator.stories.tsx +63 -0
  95. package/password-input/PasswordInput.d.ts +4 -0
  96. package/password-input/PasswordInput.js +19 -55
  97. package/password-input/{PasswordInput.stories.jsx → PasswordInput.stories.tsx} +1 -1
  98. package/password-input/types.d.ts +107 -0
  99. package/password-input/types.js +5 -0
  100. package/progress-bar/ProgressBar.js +3 -3
  101. package/progress-bar/ProgressBar.stories.jsx +58 -0
  102. package/radio/Radio.js +2 -2
  103. package/radio/Radio.stories.tsx +192 -0
  104. package/radio/types.d.ts +2 -2
  105. package/resultsetTable/ResultsetTable.d.ts +4 -0
  106. package/resultsetTable/ResultsetTable.js +4 -27
  107. package/resultsetTable/types.d.ts +67 -0
  108. package/resultsetTable/types.js +5 -0
  109. package/row/Row.d.ts +11 -0
  110. package/row/Row.js +124 -0
  111. package/row/Row.stories.tsx +223 -0
  112. package/select/Select.js +15 -17
  113. package/select/Select.stories.tsx +572 -0
  114. package/sidenav/Sidenav.d.ts +9 -0
  115. package/sidenav/Sidenav.js +6 -15
  116. package/sidenav/Sidenav.stories.tsx +165 -0
  117. package/sidenav/types.d.ts +50 -0
  118. package/sidenav/types.js +5 -0
  119. package/slider/Slider.d.ts +1 -1
  120. package/slider/Slider.js +43 -32
  121. package/slider/Slider.stories.tsx +177 -0
  122. package/slider/types.d.ts +2 -7
  123. package/spinner/Spinner.d.ts +4 -0
  124. package/spinner/Spinner.js +8 -25
  125. package/spinner/Spinner.stories.jsx +102 -0
  126. package/spinner/types.d.ts +32 -0
  127. package/spinner/types.js +5 -0
  128. package/stack/Stack.d.ts +10 -0
  129. package/stack/Stack.js +94 -0
  130. package/stack/Stack.stories.tsx +150 -0
  131. package/switch/Switch.js +4 -4
  132. package/switch/Switch.stories.tsx +160 -0
  133. package/table/Table.d.ts +4 -0
  134. package/table/Table.js +3 -3
  135. package/table/Table.stories.jsx +276 -0
  136. package/table/types.d.ts +21 -0
  137. package/table/types.js +5 -0
  138. package/tabs/Tabs.js +4 -2
  139. package/tabs/Tabs.stories.tsx +121 -0
  140. package/tabs/types.d.ts +3 -4
  141. package/tag/Tag.d.ts +4 -0
  142. package/tag/Tag.js +21 -36
  143. package/tag/Tag.stories.tsx +145 -0
  144. package/tag/types.d.ts +60 -0
  145. package/tag/types.js +5 -0
  146. package/text/Text.d.ts +7 -0
  147. package/text/Text.js +30 -0
  148. package/text/Text.stories.tsx +19 -0
  149. package/text-input/TextInput.d.ts +4 -0
  150. package/text-input/TextInput.js +42 -81
  151. package/text-input/TextInput.stories.tsx +456 -0
  152. package/text-input/types.d.ts +159 -0
  153. package/text-input/types.js +5 -0
  154. package/textarea/Textarea.js +29 -32
  155. package/textarea/index.d.ts +18 -8
  156. package/toggle/Toggle.js +1 -1
  157. package/toggle-group/ToggleGroup.d.ts +4 -0
  158. package/toggle-group/ToggleGroup.js +8 -34
  159. package/toggle-group/ToggleGroup.stories.tsx +178 -0
  160. package/toggle-group/types.d.ts +84 -0
  161. package/toggle-group/types.js +5 -0
  162. package/upload/buttons-upload/ButtonsUpload.js +2 -2
  163. package/upload/dragAndDropArea/DragAndDropArea.js +2 -2
  164. package/upload/file-upload/FileToUpload.js +1 -1
  165. package/upload/files-upload/FilesToUpload.js +1 -1
  166. package/upload/transaction/Transaction.js +2 -2
  167. package/upload/transactions/Transactions.js +1 -1
  168. package/useTheme.d.ts +2 -0
  169. package/useTheme.js +1 -1
  170. package/wizard/Wizard.d.ts +4 -0
  171. package/wizard/Wizard.js +13 -53
  172. package/wizard/Wizard.stories.jsx +224 -0
  173. package/wizard/types.d.ts +64 -0
  174. package/wizard/types.js +5 -0
  175. package/box/index.d.ts +0 -25
  176. package/chip/index.d.ts +0 -22
  177. package/dialog/index.d.ts +0 -18
  178. package/file-input/index.d.ts +0 -81
  179. package/header/index.d.ts +0 -25
  180. package/heading/index.d.ts +0 -17
  181. package/link/index.d.ts +0 -23
  182. package/number-input/index.d.ts +0 -113
  183. package/password-input/index.d.ts +0 -94
  184. package/resultsetTable/index.d.ts +0 -19
  185. package/sidenav/index.d.ts +0 -13
  186. package/spinner/index.d.ts +0 -17
  187. package/table/index.d.ts +0 -13
  188. package/tag/index.d.ts +0 -24
  189. package/text-input/index.d.ts +0 -135
  190. package/toggle-group/index.d.ts +0 -21
  191. package/wizard/index.d.ts +0 -18
@@ -0,0 +1,146 @@
1
+ import React from "react";
2
+ import DxcLink from "./Link";
3
+ import Title from "../../.storybook/components/Title";
4
+ import ExampleContainer from "../../.storybook/components/ExampleContainer";
5
+
6
+ export default {
7
+ title: "Link",
8
+ component: DxcLink,
9
+ };
10
+
11
+ const icon = (
12
+ <svg viewBox="0 0 24 24" enable-background="new 0 0 24 24" fill="currentColor">
13
+ <g id="Bounding_Box">
14
+ <rect fill="none" width="24" height="24" />
15
+ </g>
16
+ <g id="Master">
17
+ <path d="M19,9.3V4h-3v2.6L12,3L2,12h3v8h5v-6h4v6h5v-8h3L19,9.3z M10,10c0-1.1,0.9-2,2-2s2,0.9,2,2H10z" />
18
+ </g>
19
+ </svg>
20
+ );
21
+
22
+ export const Chromatic = () => (
23
+ <>
24
+ <Title title="With anchor" theme="light" level={2} />
25
+ <ExampleContainer>
26
+ <Title title="Disabled" theme="light" level={4} />
27
+ <DxcLink text="Test" disabled></DxcLink>
28
+ <Title title="Icon before" theme="light" level={4} />
29
+ <DxcLink text="Test" href="https://www.google.com" icon={icon} iconPosition="before"></DxcLink>
30
+ <Title title="Icon after" theme="light" level={4} />
31
+ <DxcLink text="Test" href="https://www.youtube.com/" icon={icon} iconPosition="after"></DxcLink>
32
+ </ExampleContainer>
33
+ <ExampleContainer pseudoState="pseudo-hover">
34
+ <Title title="With link hovered" theme="light" level={4} />
35
+ <DxcLink text="Test" href="https://www.dxc.com"></DxcLink>
36
+ </ExampleContainer>
37
+ <ExampleContainer pseudoState="pseudo-focus">
38
+ <Title title="With link focused" theme="light" level={4} />
39
+ <DxcLink text="Test" href="https://www.dxc.com"></DxcLink>
40
+ </ExampleContainer>
41
+ <ExampleContainer pseudoState="pseudo-active">
42
+ <Title title="With link active" theme="light" level={4} />
43
+ <DxcLink text="Test" href="https://www.dxc.com"></DxcLink>
44
+ </ExampleContainer>
45
+ <ExampleContainer pseudoState="pseudo-visited">
46
+ <Title title="With link visited" theme="light" level={4} />
47
+ <DxcLink text="Test" href="https://www.amazon.com"></DxcLink>
48
+ </ExampleContainer>
49
+ <ExampleContainer>
50
+ <Title title="Inherit color" theme="light" level={4} />
51
+ This is a <DxcLink text="Test" inheritColor={true}></DxcLink>.
52
+ </ExampleContainer>
53
+ <ExampleContainer pseudoState="pseudo-focus">
54
+ <Title title="With brackets and focus" theme="light" level={4} />
55
+ This is a (<DxcLink text="Test" inheritColor={true}></DxcLink>).
56
+ </ExampleContainer>
57
+ <ExampleContainer pseudoState="pseudo-hover">
58
+ <Title title="Long text with hover" theme="light" level={4} />
59
+ Lorem <DxcLink text="Test" href="https://www.google.com"></DxcLink> ipsum dolor sit amet, consectetur adipiscing
60
+ elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
61
+ exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
62
+ voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt
63
+ in culpa qui officia deserunt mollit anim id est laborum.
64
+ </ExampleContainer>
65
+ <ExampleContainer pseudoState="pseudo-focus">
66
+ <Title title="Long text with focus" theme="light" level={4} />
67
+ Lorem <DxcLink text="Test" href="https://www.google.com"></DxcLink> ipsum dolor sit amet, consectetur adipiscing
68
+ elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
69
+ exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
70
+ voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt
71
+ in culpa qui officia deserunt mollit anim id est laborum.
72
+ </ExampleContainer>
73
+ <Title title="With button" theme="light" level={2} />
74
+ <ExampleContainer>
75
+ <Title title="Disabled" theme="light" level={4} />
76
+ <DxcLink text="Test" onClick={() => {}} disabled></DxcLink>
77
+ <Title title="Icon before" theme="light" level={4} />
78
+ <DxcLink text="Test" onClick={() => {}} href="https://www.google.com" icon={icon} iconPosition="before"></DxcLink>
79
+ <Title title="Icon after" theme="light" level={4} />
80
+ <DxcLink
81
+ text="Test"
82
+ onClick={() => {}}
83
+ href="https://www.youtube.com/"
84
+ icon={icon}
85
+ iconPosition="after"
86
+ ></DxcLink>
87
+ </ExampleContainer>
88
+ <ExampleContainer pseudoState="pseudo-hover">
89
+ <Title title="With link hovered" theme="light" level={4} />
90
+ <DxcLink text="Test" onClick={() => {}} href="https://www.dxc.com"></DxcLink>
91
+ </ExampleContainer>
92
+ <ExampleContainer pseudoState="pseudo-focus">
93
+ <Title title="With link focused" theme="light" level={4} />
94
+ <DxcLink text="Test" onClick={() => {}} href="https://www.dxc.com"></DxcLink>
95
+ </ExampleContainer>
96
+ <ExampleContainer pseudoState="pseudo-active">
97
+ <Title title="With link active" theme="light" level={4} />
98
+ <DxcLink text="Test" onClick={() => {}} href="https://www.dxc.com"></DxcLink>
99
+ </ExampleContainer>
100
+ <ExampleContainer pseudoState="pseudo-visited">
101
+ <Title title="With link visited" theme="light" level={4} />
102
+ <DxcLink text="Test" onClick={() => {}} href="https://www.amazon.com"></DxcLink>
103
+ </ExampleContainer>
104
+ <ExampleContainer>
105
+ <Title title="Inherit color" theme="light" level={4} />
106
+ This is a <DxcLink text="Test" onClick={() => {}} inheritColor={true}></DxcLink>.
107
+ </ExampleContainer>
108
+ <ExampleContainer pseudoState="pseudo-focus">
109
+ <Title title="With brackets and focus" theme="light" level={4} />
110
+ This is a (<DxcLink text="Test" onClick={() => {}} inheritColor={true}></DxcLink>).
111
+ </ExampleContainer>
112
+ <ExampleContainer pseudoState="pseudo-hover">
113
+ <Title title="Long text with hover" theme="light" level={4} />
114
+ Lorem <DxcLink text="Test" onClick={() => {}} href="https://www.google.com"></DxcLink> ipsum dolor sit amet,
115
+ consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
116
+ veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor
117
+ in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
118
+ non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
119
+ </ExampleContainer>
120
+ <ExampleContainer pseudoState="pseudo-focus">
121
+ <Title title="Long text with focus" theme="light" level={4} />
122
+ Lorem <DxcLink text="Test" onClick={() => {}} href="https://www.google.com"></DxcLink> ipsum dolor sit amet,
123
+ consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
124
+ veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor
125
+ in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
126
+ non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
127
+ </ExampleContainer>
128
+ <Title title="Margins" theme="light" level={2} />
129
+ <ExampleContainer>
130
+ <Title title="Xxsmall margin" theme="light" level={4} />
131
+ <DxcLink text="Test" margin="xxsmall" href="https://www.facebook.com/"></DxcLink>
132
+ <Title title="Xsmall margin" theme="light" level={4} />
133
+ <DxcLink text="Test" margin="xsmall" href="https://www.linkedin.com/"></DxcLink>
134
+ <Title title="Small margin" theme="light" level={4} />
135
+ <DxcLink text="Test" margin="small" href="https://www.linkedin.com/"></DxcLink>
136
+ <Title title="Medium margin" theme="light" level={4} />
137
+ <DxcLink text="Test" margin="medium" href="https://www.linkedin.com/"></DxcLink>
138
+ <Title title="Large margin" theme="light" level={4} />
139
+ <DxcLink text="Test" margin="large" href="https://www.linkedin.com/"></DxcLink>
140
+ <Title title="Xlarge margin" theme="light" level={4} />
141
+ <DxcLink text="Test" margin="xlarge" href="https://www.linkedin.com/"></DxcLink>
142
+ <Title title="Xxlarge margin" theme="light" level={4} />
143
+ <DxcLink text="Test" margin="xxlarge" href="https://www.linkedin.com/"></DxcLink>
144
+ </ExampleContainer>
145
+ </>
146
+ );
@@ -0,0 +1,74 @@
1
+ /// <reference types="react" />
2
+ declare type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
3
+ declare type Margin = {
4
+ top?: Space;
5
+ bottom?: Space;
6
+ left?: Space;
7
+ right?: Space;
8
+ };
9
+ declare type LinkCommonProps = {
10
+ /**
11
+ * If true, the color is inherited from parent.
12
+ */
13
+ inheritColor?: boolean;
14
+ /**
15
+ * If true, the link is disabled.
16
+ */
17
+ disabled?: boolean;
18
+ /**
19
+ * @Deprecated Source of the icon.
20
+ */
21
+ iconSrc?: string;
22
+ /**
23
+ * Indicates the position of the icon in the component.
24
+ */
25
+ iconPosition?: "before" | "after";
26
+ /**
27
+ * Page to be opened when the user clicks on the link.
28
+ */
29
+ href?: string;
30
+ /**
31
+ * If true, the page is opened in a new browser tab.
32
+ */
33
+ newWindow?: boolean;
34
+ /**
35
+ * If defined, the link will be displayed as a button. This
36
+ * function will be called when the user clicks the link.
37
+ */
38
+ onClick?: () => void;
39
+ /**
40
+ * Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
41
+ * You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
42
+ */
43
+ margin?: Space | Margin;
44
+ /**
45
+ * Value of the tabindex.
46
+ */
47
+ tabIndex?: number;
48
+ };
49
+ export declare type LinkTextProps = LinkCommonProps & {
50
+ /**
51
+ * Link text.
52
+ */
53
+ text: string;
54
+ /**
55
+ * Element used as the icon that will be placed next to the link text.
56
+ */
57
+ icon?: SVG;
58
+ };
59
+ export declare type LinkIconProps = LinkCommonProps & {
60
+ /**
61
+ * Link text.
62
+ */
63
+ text?: string;
64
+ /**
65
+ * Element used as the icon that will be placed next to the link text.
66
+ */
67
+ icon: SVG;
68
+ };
69
+ declare type Overload = {
70
+ (props: LinkTextProps): JSX.Element;
71
+ (props: LinkIconProps): JSX.Element;
72
+ };
73
+ declare type SVG = React.SVGProps<SVGSVGElement> | React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
74
+ export default Overload;
package/link/types.js ADDED
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
package/list/List.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ declare type ListProps = {
3
+ children: React.ReactNode;
4
+ gutter?: "none" | "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge" | "xxxlarge";
5
+ };
6
+ declare function List({ children, gutter }: ListProps): JSX.Element;
7
+ export default List;
package/list/List.js ADDED
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = void 0;
9
+
10
+ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
11
+
12
+ var _react = _interopRequireDefault(require("react"));
13
+
14
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
15
+
16
+ var _Stack = _interopRequireDefault(require("../stack/Stack"));
17
+
18
+ var _templateObject, _templateObject2;
19
+
20
+ function List(_ref) {
21
+ var children = _ref.children,
22
+ _ref$gutter = _ref.gutter,
23
+ gutter = _ref$gutter === void 0 ? "xsmall" : _ref$gutter;
24
+ return /*#__PURE__*/_react["default"].createElement(_Stack["default"], {
25
+ as: "ul",
26
+ gutter: gutter
27
+ }, _react["default"].Children.map(children, function (child) {
28
+ return /*#__PURE__*/_react["default"].createElement(ListItem, null, /*#__PURE__*/_react["default"].createElement(Bullet, null), child);
29
+ }));
30
+ }
31
+
32
+ var Bullet = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n background-color: black;\n width: 4px;\n height: 4px;\n border-radius: 50%;\n flex-shrink: 0;\n margin-top: 9px;\n margin-right: 10px;\n"])));
33
+
34
+ var ListItem = _styledComponents["default"].li(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n margin: 0px;\n padding: 0px;\n list-style: none;\n display: flex;\n"])));
35
+
36
+ var _default = List;
37
+ exports["default"] = _default;
@@ -0,0 +1,70 @@
1
+ import React from "react";
2
+ import styled from "styled-components";
3
+ import Title from "../../.storybook/components/Title";
4
+ import DxcList from "./List";
5
+ import DxcText from "../text/Text";
6
+
7
+ export default {
8
+ title: "List",
9
+ component: DxcList,
10
+ };
11
+
12
+ export const Chromatic = () => (
13
+ <>
14
+ <Title title="Default list" theme="light" level={4} />
15
+ <DxcList>
16
+ <DxcText>Text 1.</DxcText>
17
+ <DxcText>Text 2.</DxcText>
18
+ </DxcList>
19
+ <Title title="Multiple lines" theme="light" level={4} />
20
+ <Container>
21
+ <DxcList>
22
+ <DxcText>
23
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore
24
+ magna aliqua.
25
+ </DxcText>
26
+ <DxcText>Text 2.</DxcText>
27
+ </DxcList>
28
+ </Container>
29
+ <Title title="gutter = xxsmall" theme="light" level={4} />
30
+ <DxcList gutter="xxsmall">
31
+ <DxcText>Text 1.</DxcText>
32
+ <DxcText>Text 2.</DxcText>
33
+ </DxcList>
34
+ <Title title="gutter = xsmall" theme="light" level={4} />
35
+ <DxcList gutter="xsmall">
36
+ <DxcText>Text 1.</DxcText>
37
+ <DxcText>Text 2.</DxcText>
38
+ </DxcList>
39
+ <Title title="gutter = small" theme="light" level={4} />
40
+ <DxcList gutter="small">
41
+ <DxcText>Text 1.</DxcText>
42
+ <DxcText>Text 2.</DxcText>
43
+ </DxcList>
44
+ <Title title="gutter = medium" theme="light" level={4} />
45
+ <DxcList gutter="medium">
46
+ <DxcText>Text 1.</DxcText>
47
+ <DxcText>Text 2.</DxcText>
48
+ </DxcList>
49
+ <Title title="gutter = large" theme="light" level={4} />
50
+ <DxcList gutter="large">
51
+ <DxcText>Text 1.</DxcText>
52
+ <DxcText>Text 2.</DxcText>
53
+ </DxcList>
54
+ <Title title="gutter = xlarge" theme="light" level={4} />
55
+ <DxcList gutter="xlarge">
56
+ <DxcText>Text 1.</DxcText>
57
+ <DxcText>Text 2.</DxcText>
58
+ </DxcList>
59
+ <Title title="gutter = xxlarge" theme="light" level={4} />
60
+ <DxcList gutter="xxlarge">
61
+ <DxcText>Text 1.</DxcText>
62
+ <DxcText>Text 2.</DxcText>
63
+ </DxcList>
64
+
65
+ </>
66
+ );
67
+
68
+ const Container = styled.div`
69
+ width: 400px;
70
+ `;
package/main.d.ts CHANGED
@@ -39,6 +39,10 @@ import DxcNumberInput from "./number-input/NumberInput";
39
39
  import DxcTextarea from "./textarea/Textarea";
40
40
  import DxcSelect from "./select/Select";
41
41
  import DxcFileInput from "./file-input/FileInput";
42
- import ThemeContext, { ThemeProvider } from "./ThemeContext.js";
43
- import { BackgroundColorProvider } from "./BackgroundColorContext.js";
44
- export { DxcAlert, DxcButton, DxcFooter, DxcCheckbox, V3DxcSelect, DxcInput, DxcTextInput, DxcDropdown, DxcSwitch, DxcSlider, DxcRadio, DxcDate, DxcHeader, DxcTable, DxcTabs, DxcToggleGroup, DxcDialog, DxcCard, DxcProgressBar, DxcAccordion, DxcSpinner, DxcUpload, DxcBox, DxcTag, DxcPaginator, DxcSidenav, DxcWizard, DxcLink, DxcHeading, V3DxcTextarea, DxcResultsetTable, DxcChip, DxcApplicationLayout, ThemeContext, ThemeProvider, BackgroundColorProvider, DxcAccordionGroup, DxcBadge, DxcPasswordInput, DxcDateInput, DxcNumberInput, DxcTextarea, DxcSelect, DxcFileInput, };
42
+ import DxcStack from "./stack/Stack";
43
+ import DxcRow from "./row/Row";
44
+ import DxcText from "./text/Text";
45
+ import DxcList from "./list/List";
46
+ import ThemeContext, { ThemeProvider } from "./ThemeContext";
47
+ import { BackgroundColorProvider } from "./BackgroundColorContext";
48
+ export { DxcAlert, DxcButton, DxcFooter, DxcCheckbox, V3DxcSelect, DxcInput, DxcTextInput, DxcDropdown, DxcSwitch, DxcSlider, DxcRadio, DxcDate, DxcHeader, DxcTable, DxcTabs, DxcToggleGroup, DxcDialog, DxcCard, DxcProgressBar, DxcAccordion, DxcSpinner, DxcUpload, DxcBox, DxcTag, DxcPaginator, DxcSidenav, DxcWizard, DxcLink, DxcHeading, V3DxcTextarea, DxcResultsetTable, DxcChip, DxcApplicationLayout, ThemeContext, ThemeProvider, BackgroundColorProvider, DxcAccordionGroup, DxcBadge, DxcPasswordInput, DxcDateInput, DxcNumberInput, DxcTextarea, DxcSelect, DxcFileInput, DxcStack, DxcRow, DxcText, DxcList, };
package/main.js CHANGED
@@ -133,6 +133,12 @@ Object.defineProperty(exports, "DxcLink", {
133
133
  return _Link["default"];
134
134
  }
135
135
  });
136
+ Object.defineProperty(exports, "DxcList", {
137
+ enumerable: true,
138
+ get: function get() {
139
+ return _List["default"];
140
+ }
141
+ });
136
142
  Object.defineProperty(exports, "DxcNumberInput", {
137
143
  enumerable: true,
138
144
  get: function get() {
@@ -169,6 +175,12 @@ Object.defineProperty(exports, "DxcResultsetTable", {
169
175
  return _ResultsetTable["default"];
170
176
  }
171
177
  });
178
+ Object.defineProperty(exports, "DxcRow", {
179
+ enumerable: true,
180
+ get: function get() {
181
+ return _Row["default"];
182
+ }
183
+ });
172
184
  Object.defineProperty(exports, "DxcSelect", {
173
185
  enumerable: true,
174
186
  get: function get() {
@@ -193,6 +205,12 @@ Object.defineProperty(exports, "DxcSpinner", {
193
205
  return _Spinner["default"];
194
206
  }
195
207
  });
208
+ Object.defineProperty(exports, "DxcStack", {
209
+ enumerable: true,
210
+ get: function get() {
211
+ return _Stack["default"];
212
+ }
213
+ });
196
214
  Object.defineProperty(exports, "DxcSwitch", {
197
215
  enumerable: true,
198
216
  get: function get() {
@@ -217,6 +235,12 @@ Object.defineProperty(exports, "DxcTag", {
217
235
  return _Tag["default"];
218
236
  }
219
237
  });
238
+ Object.defineProperty(exports, "DxcText", {
239
+ enumerable: true,
240
+ get: function get() {
241
+ return _Text["default"];
242
+ }
243
+ });
220
244
  Object.defineProperty(exports, "DxcTextInput", {
221
245
  enumerable: true,
222
246
  get: function get() {
@@ -354,9 +378,17 @@ var _Select = _interopRequireDefault(require("./select/Select"));
354
378
 
355
379
  var _FileInput = _interopRequireDefault(require("./file-input/FileInput"));
356
380
 
357
- var _ThemeContext = _interopRequireWildcard(require("./ThemeContext.js"));
381
+ var _Stack = _interopRequireDefault(require("./stack/Stack"));
382
+
383
+ var _Row = _interopRequireDefault(require("./row/Row"));
384
+
385
+ var _Text = _interopRequireDefault(require("./text/Text"));
386
+
387
+ var _List = _interopRequireDefault(require("./list/List"));
388
+
389
+ var _ThemeContext = _interopRequireWildcard(require("./ThemeContext"));
358
390
 
359
- var _BackgroundColorContext = require("./BackgroundColorContext.js");
391
+ var _BackgroundColorContext = require("./BackgroundColorContext");
360
392
 
361
393
  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); }
362
394
 
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import NumberInputPropsType from "./types";
3
+ declare const DxcNumberInput: React.ForwardRefExoticComponent<NumberInputPropsType & React.RefAttributes<HTMLDivElement>>;
4
+ export default DxcNumberInput;
@@ -7,32 +7,24 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports["default"] = void 0;
9
9
 
10
- var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
11
-
12
10
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
13
11
 
14
12
  var _react = _interopRequireDefault(require("react"));
15
13
 
16
- var _propTypes = _interopRequireDefault(require("prop-types"));
17
-
18
14
  var _styledComponents = _interopRequireDefault(require("styled-components"));
19
15
 
20
16
  var _TextInput = _interopRequireDefault(require("../text-input/TextInput"));
21
17
 
22
18
  var _NumberInputContext = _interopRequireDefault(require("./NumberInputContext"));
23
19
 
24
- var _variables = require("../common/variables.js");
25
-
26
20
  var _templateObject;
27
21
 
28
22
  var DxcNumberInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
29
- var _ref$label = _ref.label,
30
- label = _ref$label === void 0 ? "" : _ref$label,
23
+ var label = _ref.label,
31
24
  _ref$name = _ref.name,
32
25
  name = _ref$name === void 0 ? "" : _ref$name,
33
26
  value = _ref.value,
34
- _ref$helperText = _ref.helperText,
35
- helperText = _ref$helperText === void 0 ? "" : _ref$helperText,
27
+ helperText = _ref.helperText,
36
28
  _ref$placeholder = _ref.placeholder,
37
29
  placeholder = _ref$placeholder === void 0 ? "" : _ref$placeholder,
38
30
  _ref$disabled = _ref.disabled,
@@ -45,11 +37,11 @@ var DxcNumberInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, r
45
37
  suffix = _ref$suffix === void 0 ? "" : _ref$suffix,
46
38
  min = _ref.min,
47
39
  max = _ref.max,
48
- step = _ref.step,
40
+ _ref$step = _ref.step,
41
+ step = _ref$step === void 0 ? 1 : _ref$step,
49
42
  onChange = _ref.onChange,
50
43
  onBlur = _ref.onBlur,
51
- _ref$error = _ref.error,
52
- error = _ref$error === void 0 ? "" : _ref$error,
44
+ error = _ref.error,
53
45
  _ref$autocomplete = _ref.autocomplete,
54
46
  autocomplete = _ref$autocomplete === void 0 ? "off" : _ref$autocomplete,
55
47
  margin = _ref.margin,
@@ -85,44 +77,7 @@ var DxcNumberInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, r
85
77
  })));
86
78
  });
87
79
 
88
- var sizes = {
89
- small: "240px",
90
- medium: "360px",
91
- large: "480px",
92
- fillParent: "100%"
93
- };
94
-
95
80
  var NumberInputContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n // Chrome, Safari, Edge, Opera\n input::-webkit-outer-spin-button,\n input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n\n // Firefox\n input[type=\"number\"] {\n -moz-appearance: textfield;\n }\n"])));
96
81
 
97
- DxcNumberInput.propTypes = {
98
- label: _propTypes["default"].string,
99
- name: _propTypes["default"].string,
100
- value: _propTypes["default"].string,
101
- helperText: _propTypes["default"].string,
102
- placeholder: _propTypes["default"].string,
103
- error: _propTypes["default"].string,
104
- disabled: _propTypes["default"].bool,
105
- optional: _propTypes["default"].bool,
106
- prefix: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].shape({
107
- type: _propTypes["default"].oneOf(["svg"])
108
- })]),
109
- suffix: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].shape({
110
- type: _propTypes["default"].oneOf(["svg"])
111
- })]),
112
- min: _propTypes["default"].number,
113
- max: _propTypes["default"].number,
114
- step: _propTypes["default"].number,
115
- onChange: _propTypes["default"].func,
116
- onBlur: _propTypes["default"].func,
117
- autocomplete: _propTypes["default"].string,
118
- margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
119
- top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
120
- bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
121
- left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
122
- right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
123
- }), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
124
- size: _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(sizes))),
125
- tabIndex: _propTypes["default"].number
126
- };
127
82
  var _default = DxcNumberInput;
128
83
  exports["default"] = _default;
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import NumberInputContextPropsType from "./numberInputContextTypes";
3
+ declare const NumberInputContext: React.Context<NumberInputContextPropsType>;
4
+ export default NumberInputContext;
@@ -9,8 +9,11 @@ exports["default"] = void 0;
9
9
 
10
10
  var _react = _interopRequireDefault(require("react"));
11
11
 
12
- /* eslint-disable prefer-template */
13
- var NumberInputContext = /*#__PURE__*/_react["default"].createContext();
12
+ var defaultState = {
13
+ stepNumber: 1
14
+ };
15
+
16
+ var NumberInputContext = /*#__PURE__*/_react["default"].createContext(defaultState);
14
17
 
15
18
  var _default = NumberInputContext;
16
19
  exports["default"] = _default;
@@ -0,0 +1,19 @@
1
+ declare type Props = {
2
+ /**
3
+ * Type of the input.
4
+ */
5
+ typeNumber?: string;
6
+ /**
7
+ * Minimum value allowed by the number input.
8
+ */
9
+ minNumber?: number;
10
+ /**
11
+ * Maximum value allowed by the number input.
12
+ */
13
+ maxNumber?: number;
14
+ /**
15
+ * The step interval to use when using the up and down arrows to adjust the value.
16
+ */
17
+ stepNumber?: number;
18
+ };
19
+ export default Props;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });