@dxc-technology/halstack-react 0.0.0-bfa479f → 0.0.0-c060fff

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 (264) hide show
  1. package/{dist/BackgroundColorContext.js → BackgroundColorContext.js} +0 -0
  2. package/ThemeContext.js +250 -0
  3. package/V3Select/V3Select.js +549 -0
  4. package/V3Select/index.d.ts +27 -0
  5. package/V3Textarea/V3Textarea.js +264 -0
  6. package/V3Textarea/index.d.ts +27 -0
  7. package/{dist/accordion → accordion}/Accordion.js +119 -50
  8. package/accordion/index.d.ts +28 -0
  9. package/{dist/accordion-group → accordion-group}/AccordionGroup.js +33 -1
  10. package/accordion-group/index.d.ts +16 -0
  11. package/alert/Alert.js +403 -0
  12. package/alert/index.d.ts +51 -0
  13. package/badge/Badge.js +63 -0
  14. package/{dist/box → box}/Box.js +27 -18
  15. package/box/index.d.ts +25 -0
  16. package/button/Button.js +238 -0
  17. package/button/Button.stories.js +27 -0
  18. package/button/index.d.ts +24 -0
  19. package/{dist/card → card}/Card.js +15 -8
  20. package/card/index.d.ts +22 -0
  21. package/{dist/checkbox → checkbox}/Checkbox.js +89 -23
  22. package/checkbox/index.d.ts +24 -0
  23. package/{dist/chip → chip}/Chip.js +63 -21
  24. package/chip/index.d.ts +22 -0
  25. package/{dist/common → common}/OpenSans.css +0 -0
  26. package/{dist/common → common}/RequiredComponent.js +0 -0
  27. package/{dist/common → common}/fonts/OpenSans-Bold.ttf +0 -0
  28. package/{dist/common → common}/fonts/OpenSans-BoldItalic.ttf +0 -0
  29. package/{dist/common → common}/fonts/OpenSans-ExtraBold.ttf +0 -0
  30. package/{dist/common → common}/fonts/OpenSans-ExtraBoldItalic.ttf +0 -0
  31. package/{dist/common → common}/fonts/OpenSans-Italic.ttf +0 -0
  32. package/{dist/common → common}/fonts/OpenSans-Light.ttf +0 -0
  33. package/{dist/common → common}/fonts/OpenSans-LightItalic.ttf +0 -0
  34. package/{dist/common → common}/fonts/OpenSans-Regular.ttf +0 -0
  35. package/{dist/common → common}/fonts/OpenSans-SemiBold.ttf +0 -0
  36. package/{dist/common → common}/fonts/OpenSans-SemiBoldItalic.ttf +0 -0
  37. package/{dist/common → common}/utils.js +0 -0
  38. package/common/variables.js +1574 -0
  39. package/{dist/date → date}/Date.js +60 -38
  40. package/date/index.d.ts +27 -0
  41. package/date-input/DateInput.js +400 -0
  42. package/date-input/index.d.ts +95 -0
  43. package/{dist/dialog → dialog}/Dialog.js +44 -29
  44. package/dialog/index.d.ts +18 -0
  45. package/{dist/dropdown → dropdown}/Dropdown.js +162 -74
  46. package/dropdown/index.d.ts +26 -0
  47. package/file-input/FileInput.js +644 -0
  48. package/file-input/FileItem.js +287 -0
  49. package/file-input/index.d.ts +81 -0
  50. package/{dist/footer → footer}/Footer.js +96 -42
  51. package/footer/Icons.js +77 -0
  52. package/footer/index.d.ts +25 -0
  53. package/{dist/header → header}/Header.js +157 -72
  54. package/header/Icons.js +59 -0
  55. package/header/index.d.ts +25 -0
  56. package/heading/Heading.js +230 -0
  57. package/heading/index.d.ts +17 -0
  58. package/input-text/Icons.js +22 -0
  59. package/{dist/input-text → input-text}/InputText.js +159 -63
  60. package/input-text/index.d.ts +36 -0
  61. package/{dist/layout → layout}/ApplicationLayout.js +7 -11
  62. package/layout/Icons.js +55 -0
  63. package/{dist/link → link}/Link.js +76 -39
  64. package/link/index.d.ts +23 -0
  65. package/main.d.ts +40 -0
  66. package/{dist/main.js → main.js} +63 -15
  67. package/number-input/NumberInput.js +136 -0
  68. package/number-input/NumberInputContext.js +16 -0
  69. package/number-input/index.d.ts +113 -0
  70. package/package.json +25 -19
  71. package/paginator/Icons.js +66 -0
  72. package/{dist/paginator → paginator}/Paginator.js +86 -42
  73. package/paginator/index.d.ts +20 -0
  74. package/password-input/PasswordInput.js +203 -0
  75. package/password-input/index.d.ts +94 -0
  76. package/{dist/progress-bar → progress-bar}/ProgressBar.js +88 -38
  77. package/progress-bar/index.d.ts +18 -0
  78. package/{dist/radio → radio}/Radio.js +28 -9
  79. package/radio/index.d.ts +23 -0
  80. package/{dist/resultsetTable → resultsetTable}/ResultsetTable.js +64 -38
  81. package/resultsetTable/index.d.ts +19 -0
  82. package/select/Select.js +1137 -0
  83. package/select/index.d.ts +131 -0
  84. package/{dist/sidenav → sidenav}/Sidenav.js +47 -23
  85. package/sidenav/index.d.ts +13 -0
  86. package/slider/Slider.js +404 -0
  87. package/slider/index.d.ts +29 -0
  88. package/spinner/Spinner.js +381 -0
  89. package/spinner/index.d.ts +17 -0
  90. package/{dist/switch → switch}/Switch.js +42 -14
  91. package/switch/index.d.ts +24 -0
  92. package/{dist/table → table}/Table.js +45 -11
  93. package/table/index.d.ts +13 -0
  94. package/{dist/tabs → tabs}/Tabs.js +37 -19
  95. package/tabs/index.d.ts +19 -0
  96. package/{dist/tag → tag}/Tag.js +50 -36
  97. package/tag/index.d.ts +24 -0
  98. package/text-input/TextInput.js +974 -0
  99. package/text-input/index.d.ts +135 -0
  100. package/textarea/Textarea.js +369 -0
  101. package/textarea/index.d.ts +117 -0
  102. package/{dist/toggle → toggle}/Toggle.js +0 -0
  103. package/toggle/index.d.ts +21 -0
  104. package/toggle-group/ToggleGroup.js +327 -0
  105. package/toggle-group/index.d.ts +21 -0
  106. package/{dist/upload → upload}/Upload.js +1 -5
  107. package/{dist/upload → upload}/buttons-upload/ButtonsUpload.js +28 -16
  108. package/upload/buttons-upload/Icons.js +40 -0
  109. package/{dist/upload → upload}/dragAndDropArea/DragAndDropArea.js +61 -25
  110. package/upload/dragAndDropArea/Icons.js +39 -0
  111. package/{dist/upload → upload}/file-upload/FileToUpload.js +52 -25
  112. package/upload/file-upload/Icons.js +66 -0
  113. package/{dist/upload → upload}/files-upload/FilesToUpload.js +3 -3
  114. package/upload/index.d.ts +15 -0
  115. package/upload/transaction/Icons.js +160 -0
  116. package/{dist/upload → upload}/transaction/Transaction.js +37 -41
  117. package/{dist/upload → upload}/transactions/Transactions.js +24 -8
  118. package/{dist/useTheme.js → useTheme.js} +0 -0
  119. package/wizard/Icons.js +65 -0
  120. package/{dist/wizard → wizard}/Wizard.js +106 -56
  121. package/wizard/index.d.ts +18 -0
  122. package/README.md +0 -66
  123. package/babel.config.js +0 -8
  124. package/dist/ThemeContext.js +0 -216
  125. package/dist/accordion/Accordion.stories.js +0 -207
  126. package/dist/accordion/readme.md +0 -96
  127. package/dist/accordion-group/AccordionGroup.stories.js +0 -207
  128. package/dist/accordion-group/readme.md +0 -70
  129. package/dist/alert/Alert.js +0 -318
  130. package/dist/alert/Alert.stories.js +0 -158
  131. package/dist/alert/close.svg +0 -4
  132. package/dist/alert/error.svg +0 -4
  133. package/dist/alert/info.svg +0 -4
  134. package/dist/alert/readme.md +0 -43
  135. package/dist/alert/success.svg +0 -4
  136. package/dist/alert/warning.svg +0 -4
  137. package/dist/badge/Badge.js +0 -40
  138. package/dist/button/Button.js +0 -219
  139. package/dist/button/Button.stories.js +0 -224
  140. package/dist/button/readme.md +0 -93
  141. package/dist/checkbox/Checkbox.stories.js +0 -144
  142. package/dist/checkbox/readme.md +0 -116
  143. package/dist/common/variables.js +0 -521
  144. package/dist/date/Date.stories.js +0 -205
  145. package/dist/date/calendar.svg +0 -1
  146. package/dist/date/calendar_dark.svg +0 -1
  147. package/dist/date/readme.md +0 -73
  148. package/dist/dialog/Dialog.stories.js +0 -217
  149. package/dist/dialog/readme.md +0 -32
  150. package/dist/dropdown/Dropdown.stories.js +0 -249
  151. package/dist/dropdown/baseline-arrow_drop_down.svg +0 -1
  152. package/dist/dropdown/baseline-arrow_drop_down_wh.svg +0 -4
  153. package/dist/dropdown/baseline-arrow_drop_up.svg +0 -1
  154. package/dist/dropdown/baseline-arrow_drop_up_wh.svg +0 -4
  155. package/dist/dropdown/readme.md +0 -69
  156. package/dist/footer/Footer.stories.js +0 -94
  157. package/dist/footer/dxc_logo_wht.png +0 -0
  158. package/dist/footer/readme.md +0 -41
  159. package/dist/header/Header.stories.js +0 -176
  160. package/dist/header/close_icon.svg +0 -1
  161. package/dist/header/dxc_logo_black.png +0 -0
  162. package/dist/header/dxc_logo_blk_rgb.svg +0 -6
  163. package/dist/header/dxc_logo_white.png +0 -0
  164. package/dist/header/hamb_menu_black.svg +0 -1
  165. package/dist/header/hamb_menu_white.svg +0 -1
  166. package/dist/header/readme.md +0 -33
  167. package/dist/heading/Heading.js +0 -163
  168. package/dist/input-text/InputText.stories.js +0 -209
  169. package/dist/input-text/error.svg +0 -1
  170. package/dist/input-text/readme.md +0 -91
  171. package/dist/layout/facebook.svg +0 -45
  172. package/dist/layout/linkedin.svg +0 -50
  173. package/dist/layout/twitter.svg +0 -53
  174. package/dist/link/readme.md +0 -51
  175. package/dist/paginator/images/next.svg +0 -3
  176. package/dist/paginator/images/nextPage.svg +0 -3
  177. package/dist/paginator/images/previous.svg +0 -3
  178. package/dist/paginator/images/previousPage.svg +0 -3
  179. package/dist/paginator/readme.md +0 -50
  180. package/dist/progress-bar/ProgressBar.stories.js +0 -280
  181. package/dist/progress-bar/readme.md +0 -63
  182. package/dist/radio/Radio.stories.js +0 -166
  183. package/dist/radio/readme.md +0 -70
  184. package/dist/resultsetTable/arrow_downward-24px_wht.svg +0 -1
  185. package/dist/resultsetTable/arrow_upward-24px_wht.svg +0 -1
  186. package/dist/resultsetTable/unfold_more-24px_wht.svg +0 -1
  187. package/dist/select/Select.js +0 -490
  188. package/dist/select/Select.stories.js +0 -235
  189. package/dist/select/readme.md +0 -72
  190. package/dist/slider/Slider.js +0 -267
  191. package/dist/slider/Slider.stories.js +0 -241
  192. package/dist/slider/readme.md +0 -64
  193. package/dist/spinner/Spinner.js +0 -198
  194. package/dist/spinner/Spinner.stories.js +0 -183
  195. package/dist/spinner/readme.md +0 -65
  196. package/dist/switch/Switch.stories.js +0 -134
  197. package/dist/switch/readme.md +0 -133
  198. package/dist/tabs/Tabs.stories.js +0 -130
  199. package/dist/tabs/readme.md +0 -78
  200. package/dist/tabs-for-sections/TabsForSections.js +0 -92
  201. package/dist/tabs-for-sections/readme.md +0 -78
  202. package/dist/textarea/Textarea.js +0 -238
  203. package/dist/toggle/Toggle.stories.js +0 -297
  204. package/dist/toggle/readme.md +0 -80
  205. package/dist/toggle-group/ToggleGroup.js +0 -223
  206. package/dist/toggle-group/readme.md +0 -82
  207. package/dist/upload/Upload.stories.js +0 -72
  208. package/dist/upload/buttons-upload/drag-drop-icon.svg +0 -4
  209. package/dist/upload/buttons-upload/upload-button.svg +0 -1
  210. package/dist/upload/dragAndDropArea/upload_drop.svg +0 -4
  211. package/dist/upload/dragAndDropArea/upload_file.svg +0 -4
  212. package/dist/upload/file-upload/audio-icon.svg +0 -4
  213. package/dist/upload/file-upload/close.svg +0 -4
  214. package/dist/upload/file-upload/file-icon.svg +0 -4
  215. package/dist/upload/file-upload/video-icon.svg +0 -4
  216. package/dist/upload/readme.md +0 -37
  217. package/dist/upload/transaction/audio-icon-err.svg +0 -4
  218. package/dist/upload/transaction/audio-icon.svg +0 -4
  219. package/dist/upload/transaction/error-icon.svg +0 -4
  220. package/dist/upload/transaction/file-icon-err.svg +0 -4
  221. package/dist/upload/transaction/file-icon.svg +0 -4
  222. package/dist/upload/transaction/image-icon-err.svg +0 -4
  223. package/dist/upload/transaction/image-icon.svg +0 -4
  224. package/dist/upload/transaction/success-icon.svg +0 -4
  225. package/dist/upload/transaction/video-icon-err.svg +0 -4
  226. package/dist/upload/transaction/video-icon.svg +0 -4
  227. package/dist/wizard/invalid_icon.svg +0 -6
  228. package/dist/wizard/valid_icon.svg +0 -6
  229. package/dist/wizard/validation-wrong.svg +0 -6
  230. package/test/Accordion.test.js +0 -33
  231. package/test/AccordionGroup.test.js +0 -125
  232. package/test/Alert.test.js +0 -53
  233. package/test/Box.test.js +0 -10
  234. package/test/Button.test.js +0 -18
  235. package/test/Card.test.js +0 -30
  236. package/test/Checkbox.test.js +0 -45
  237. package/test/Chip.test.js +0 -25
  238. package/test/Date.test.js +0 -393
  239. package/test/Dialog.test.js +0 -23
  240. package/test/Dropdown.test.js +0 -130
  241. package/test/Footer.test.js +0 -99
  242. package/test/Header.test.js +0 -39
  243. package/test/Heading.test.js +0 -35
  244. package/test/InputText.test.js +0 -240
  245. package/test/Link.test.js +0 -42
  246. package/test/Paginator.test.js +0 -177
  247. package/test/ProgressBar.test.js +0 -35
  248. package/test/Radio.test.js +0 -37
  249. package/test/ResultsetTable.test.js +0 -330
  250. package/test/Select.test.js +0 -192
  251. package/test/Sidenav.test.js +0 -45
  252. package/test/Slider.test.js +0 -82
  253. package/test/Spinner.test.js +0 -27
  254. package/test/Switch.test.js +0 -45
  255. package/test/Table.test.js +0 -36
  256. package/test/Tabs.test.js +0 -109
  257. package/test/TabsForSections.test.js +0 -34
  258. package/test/Tag.test.js +0 -32
  259. package/test/TextArea.test.js +0 -52
  260. package/test/ToggleGroup.test.js +0 -81
  261. package/test/Upload.test.js +0 -60
  262. package/test/Wizard.test.js +0 -130
  263. package/test/mocks/pngMock.js +0 -1
  264. package/test/mocks/svgMock.js +0 -1
@@ -1,158 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
6
-
7
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
8
-
9
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
10
-
11
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
12
-
13
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
14
-
15
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
16
-
17
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
18
-
19
- var _react = _interopRequireDefault(require("react"));
20
-
21
- var _react2 = require("@storybook/react");
22
-
23
- var _addonActions = require("@storybook/addon-actions");
24
-
25
- var _addonKnobs = require("@storybook/addon-knobs");
26
-
27
- var _readme = _interopRequireDefault(require("./readme.md"));
28
-
29
- var _Alert = _interopRequireDefault(require("./Alert"));
30
-
31
- var _Button = _interopRequireDefault(require("../button/Button"));
32
-
33
- var _propTypes = require("prop-types");
34
-
35
- (0, _react2.storiesOf)("Form Components|Alert", module).add("Types", function () {
36
- var ControlledStory =
37
- /*#__PURE__*/
38
- function (_React$Component) {
39
- (0, _inherits2["default"])(ControlledStory, _React$Component);
40
-
41
- function ControlledStory(props) {
42
- var _this;
43
-
44
- (0, _classCallCheck2["default"])(this, ControlledStory);
45
- _this = (0, _possibleConstructorReturn2["default"])(this, (0, _getPrototypeOf2["default"])(ControlledStory).call(this, props));
46
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "setVisibleInfoAlert", function () {
47
- _this.setState({
48
- isVisibleInfoAlert: !_this.state.isVisibleInfoAlert
49
- });
50
- });
51
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "setVisibleWarningAlert", function () {
52
- _this.setState({
53
- isVisibleWarningAlert: !_this.state.isVisibleWarningAlert
54
- });
55
- });
56
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "setVisibleSuccessAlert", function () {
57
- _this.setState({
58
- isVisibleSuccessAlert: !_this.state.isVisibleSuccessAlert
59
- });
60
- });
61
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "setVisibleErrorAlert", function () {
62
- _this.setState({
63
- isVisibleErrorAlert: !_this.state.isVisibleErrorAlert
64
- });
65
- });
66
- (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "setVisibleModalAlert", function () {
67
- _this.setState({
68
- isVisibleModalAlert: !_this.state.isVisibleModalAlert
69
- });
70
- });
71
- _this.state = {
72
- isVisibleInfoAlert: true,
73
- isVisibleWarningAlert: true,
74
- isVisibleSuccessAlert: true,
75
- isVisibleErrorAlert: true,
76
- isVisibleModalAlert: false
77
- };
78
- return _this;
79
- }
80
-
81
- (0, _createClass2["default"])(ControlledStory, [{
82
- key: "render",
83
- value: function render() {
84
- return _react["default"].createElement("div", null, _react["default"].createElement("div", {
85
- style: {
86
- display: "flex",
87
- flexDirection: "column",
88
- position: "static"
89
- }
90
- }, this.state.isVisibleInfoAlert && _react["default"].createElement(_Alert["default"], {
91
- type: "info",
92
- mode: "inline",
93
- inlineText: " Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo lobortis eget."
94
- }), this.state.isVisibleWarningAlert && _react["default"].createElement(_Alert["default"], {
95
- type: "warning",
96
- mode: "inline",
97
- inlineText: " Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo lobortis eget.",
98
- onClose: this.setVisibleWarningAlert
99
- }), this.state.isVisibleSuccessAlert && _react["default"].createElement(_Alert["default"], {
100
- type: "confirm",
101
- mode: "inline",
102
- inlineText: " Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo lobortis eget."
103
- }, _react["default"].createElement("div", null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo lobortis eget.")), this.state.isVisibleErrorAlert && _react["default"].createElement(_Alert["default"], {
104
- type: "error",
105
- mode: "inline",
106
- inlineText: " Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo lobortis eget.",
107
- onClose: this.setVisibleErrorAlert
108
- }, _react["default"].createElement("div", null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo lobortis eget."))), _react["default"].createElement("div", {
109
- style: {
110
- marginLeft: "33px"
111
- }
112
- }, _react["default"].createElement(_Button["default"], {
113
- mode: "basic",
114
- theme: "light",
115
- label: "Overlay Alert",
116
- onClick: this.setVisibleModalAlert
117
- })), this.state.isVisibleModalAlert && _react["default"].createElement(_Alert["default"], {
118
- type: "info",
119
- mode: "modal",
120
- inlineText: " Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo lobortis eget.",
121
- onClose: this.setVisibleModalAlert
122
- }, _react["default"].createElement("div", null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo lobortis eget.")));
123
- }
124
- }]);
125
- return ControlledStory;
126
- }(_react["default"].Component);
127
-
128
- return _react["default"].createElement(ControlledStory, null);
129
- }, {
130
- notes: {
131
- markdown: _readme["default"]
132
- }
133
- });
134
-
135
- var knobProps = function knobProps() {
136
- return {
137
- type: (0, _addonKnobs.select)("type", {
138
- info: "info",
139
- confirm: "confirm",
140
- warning: "warning",
141
- error: "error"
142
- }, "info"),
143
- mode: (0, _addonKnobs.select)("mode", {
144
- inline: "inline",
145
- modal: "modal"
146
- }, "inline"),
147
- inlineText: (0, _addonKnobs.text)("inlineText", "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo lobortis eget.")
148
- };
149
- };
150
-
151
- (0, _react2.storiesOf)("Form Components|Alert", module).add("Knobs example", function () {
152
- var props = knobProps();
153
- return _react["default"].createElement("div", null, _react["default"].createElement(_Alert["default"], props, _react["default"].createElement("div", null, "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo lobortis eget.")));
154
- }, {
155
- notes: {
156
- markdown: _readme["default"]
157
- }
158
- });
@@ -1,4 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24">
2
- <path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/>
3
- <path d="M0 0h24v24H0z" fill="none"/>
4
- </svg>
@@ -1,4 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="23" height="23" viewBox="0 0 24 24">
2
- <path d="M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z" fill="#EE2222"/>
3
- <path d="M0 0h24v24H0z" fill="none"/>
4
- </svg>
@@ -1,4 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="23" height="23" viewBox="0 0 24 24" fill="#4A90E2">
2
- <path d="M0 0h24v24H0z" fill="none"/>
3
- <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"/>
4
- </svg>
@@ -1,43 +0,0 @@
1
- # DXC Alert Component
2
-
3
- ## Props
4
-
5
- <table>
6
- <tr style="background-color: grey">
7
- <td>Name</td>
8
- <td>Default</td>
9
- <td>Description</td>
10
- </tr>
11
- <tr>
12
- <td>type: 'info' | 'confirm' | 'warning' | 'error'</td>
13
- <td><code>'info'</code></td>
14
- <td>Uses on of the available alert types.</td>
15
- </tr>
16
- <tr>
17
- <td>mode: 'inline' | 'modal'</td>
18
- <td><code>'inline'</code></td>
19
- <td>Uses on of the available alert modes:
20
- <ul>
21
- <li>
22
- <strong>inline:</strong> if onClose function is received, close button should be visible and the function should be executed whe its clicked.
23
- There is no overlay layer.
24
- Position should be decided by the user.
25
- </li>
26
- <li>
27
- <strong>modal:</strong> In this mode it will be always an overlay layer behind the alert.
28
- If onClose function is received it will be called if the X button is clicked or if the user clicks outside of the component. The alert should be displayed in the middle of the screen.
29
- </li>
30
- </ul>
31
- </td>
32
- </tr>
33
- <tr>
34
- <td>inlineText: string</td>
35
- <td></td>
36
- <td>Text to display after icon and alert type and before content.</td>
37
- </tr>
38
- <tr>
39
- <td>onClose: function</td>
40
- <td></td>
41
- <td>This function will be called when the user clicks the close button. If there is no function we should close the alert by default.</td>
42
- </tr>
43
- </table>
@@ -1,4 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="23" height="23" viewBox="0 0 24 24" fill="#7ED321">
2
- <path d="M0 0h24v24H0z" fill="none"/>
3
- <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/>
4
- </svg>
@@ -1,4 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="23" height="23" viewBox="0 0 24 24" fill="#FFD806">
2
- <path d="M0 0h24v24H0z" fill="none"/>
3
- <path d="M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"/>
4
- </svg>
@@ -1,40 +0,0 @@
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
- function _templateObject() {
17
- var data = (0, _taggedTemplateLiteral2["default"])(["\n background-color: #d0011b;\n border-radius: 10px;\n width: ", ";\n height: ", ";\n display: flex;\n padding-bottom: 1px;\n padding-right: 1px;\n flex-wrap: wrap;\n box-sizing: border-box;\n align-items: center;\n font-size: 0.75rem;\n font-weight: 500;\n line-height: 1;\n align-content: center;\n flex-direction: row;\n justify-content: center;\n color: #ffffff;\n font-size: 10px;\n"]);
18
-
19
- _templateObject = function _templateObject() {
20
- return data;
21
- };
22
-
23
- return data;
24
- }
25
-
26
- var DxcBadge = function DxcBadge(_ref) {
27
- var notificationText = _ref.notificationText;
28
- return _react["default"].createElement(StyledDxcBadge, {
29
- notificationText: notificationText
30
- }, _react["default"].createElement("span", null, notificationText));
31
- };
32
-
33
- var StyledDxcBadge = _styledComponents["default"].div(_templateObject(), function (props) {
34
- return props.notificationText === true ? "16px" : "23px";
35
- }, function (props) {
36
- return props.notificationText === true ? "16px" : "17px";
37
- });
38
-
39
- var _default = DxcBadge;
40
- exports["default"] = _default;
@@ -1,219 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
4
-
5
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
6
-
7
- Object.defineProperty(exports, "__esModule", {
8
- value: true
9
- });
10
- exports["default"] = void 0;
11
-
12
- var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
13
-
14
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
15
-
16
- var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
17
-
18
- var _react = _interopRequireDefault(require("react"));
19
-
20
- var _core = require("@material-ui/core");
21
-
22
- var _propTypes = _interopRequireDefault(require("prop-types"));
23
-
24
- var _styledComponents = _interopRequireWildcard(require("styled-components"));
25
-
26
- var _variables = require("../common/variables.js");
27
-
28
- var _utils = require("../common/utils.js");
29
-
30
- var _useTheme = _interopRequireDefault(require("../useTheme.js"));
31
-
32
- function _templateObject4() {
33
- var data = (0, _taggedTemplateLiteral2["default"])(["\n font-size: ", ";\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n\n display: inline-block;\n width: ", ";\n cursor: ", ";\n\n .MuiButtonBase-root {\n .MuiButton-label {\n display: flex;\n flex-direction: ", ";\n align-items: center;\n }\n letter-spacing: ", ";\n box-shadow: none;\n font-size: ", ";\n font-weight: ", ";\n min-width: ", ";\n border-radius: 4px;\n width: 100%;\n min-height: 43px;\n font-family: ", ";\n &:focus {\n outline: ", " auto 1px;\n }\n transition: color 0.16s ease-in-out, background-color 0.16s ease-in-out;\n transition: color 0.16s ease-in-out, border-color 0.16s ease-in-out;\n &:hover {\n transition: color 0.16s ease-in-out, background-color 0.16s ease-in-out;\n transition: color 0.16s ease-in-out, border-color 0.16s ease-in-out;\n }\n ", "\n }\n"]);
34
-
35
- _templateObject4 = function _templateObject4() {
36
- return data;
37
- };
38
-
39
- return data;
40
- }
41
-
42
- function _templateObject3() {
43
- var data = (0, _taggedTemplateLiteral2["default"])(["\n max-height: 20px;\n max-width: 20px;\n margin-left: ", ";\n margin-right: ", ";\n"]);
44
-
45
- _templateObject3 = function _templateObject3() {
46
- return data;
47
- };
48
-
49
- return data;
50
- }
51
-
52
- function _templateObject2() {
53
- var data = (0, _taggedTemplateLiteral2["default"])(["\n max-height: 20px;\n max-width: 20px;\n margin-left: ", ";\n margin-right: ", ";\n overflow: hidden;\n\n img,\n svg {\n height: 100%;\n width: 100%;\n }\n"]);
54
-
55
- _templateObject2 = function _templateObject2() {
56
- return data;
57
- };
58
-
59
- return data;
60
- }
61
-
62
- function _templateObject() {
63
- var data = (0, _taggedTemplateLiteral2["default"])(["\n line-height: ", ";\n font-size: ", ";\n text-overflow: ellipsis;\n overflow: hidden;\n"]);
64
-
65
- _templateObject = function _templateObject() {
66
- return data;
67
- };
68
-
69
- return data;
70
- }
71
-
72
- var DxcButton = function DxcButton(_ref) {
73
- var _ref$label = _ref.label,
74
- label = _ref$label === void 0 ? "" : _ref$label,
75
- _ref$mode = _ref.mode,
76
- mode = _ref$mode === void 0 ? "primary" : _ref$mode,
77
- _ref$disabled = _ref.disabled,
78
- disabled = _ref$disabled === void 0 ? false : _ref$disabled,
79
- _ref$iconPosition = _ref.iconPosition,
80
- iconPosition = _ref$iconPosition === void 0 ? "before" : _ref$iconPosition,
81
- _ref$type = _ref.type,
82
- type = _ref$type === void 0 ? "button" : _ref$type,
83
- _ref$iconSrc = _ref.iconSrc,
84
- iconSrc = _ref$iconSrc === void 0 ? "" : _ref$iconSrc,
85
- icon = _ref.icon,
86
- _ref$onClick = _ref.onClick,
87
- _onClick = _ref$onClick === void 0 ? "" : _ref$onClick,
88
- margin = _ref.margin,
89
- size = _ref.size,
90
- _ref$tabIndex = _ref.tabIndex,
91
- tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
92
-
93
- var colorsTheme = (0, _useTheme["default"])();
94
- return _react["default"].createElement(_styledComponents.ThemeProvider, {
95
- theme: colorsTheme.button
96
- }, _react["default"].createElement(DxCButton, {
97
- type: type,
98
- margin: margin,
99
- mode: mode !== "primary" && mode !== "secondary" && mode !== "text" ? "primary" : mode,
100
- disabled: disabled,
101
- iconPosition: iconPosition,
102
- size: size
103
- }, _react["default"].createElement(_core.Button, {
104
- disabled: disabled,
105
- type: type,
106
- disableRipple: true,
107
- "aria-disabled": disabled ? true : false,
108
- tabIndex: disabled ? -1 : tabIndex,
109
- onClick: function onClick() {
110
- if (_onClick) {
111
- _onClick();
112
- }
113
- }
114
- }, _react["default"].createElement(LabelContainer, null, label), icon ? _react["default"].createElement(IconContainer, {
115
- label: label,
116
- iconPosition: iconPosition
117
- }, (0, _typeof2["default"])(icon) === "object" ? icon : _react["default"].createElement(icon)) : iconSrc && _react["default"].createElement(ButtonIcon, {
118
- label: label,
119
- iconPosition: iconPosition,
120
- src: iconSrc
121
- }))));
122
- };
123
-
124
- var sizes = {
125
- small: "42px",
126
- medium: "120px",
127
- large: "240px",
128
- fillParent: "100%",
129
- fitContent: "unset"
130
- };
131
-
132
- var calculateWidth = function calculateWidth(margin, size) {
133
- if (size === "fillParent") {
134
- return "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")");
135
- }
136
-
137
- return sizes[size];
138
- };
139
-
140
- var LabelContainer = _styledComponents["default"].span(_templateObject(), function (props) {
141
- return props.theme.fontLineHeight;
142
- }, function (props) {
143
- return props.theme.fontSize;
144
- });
145
-
146
- var IconContainer = _styledComponents["default"].div(_templateObject2(), function (props) {
147
- return props.iconPosition === "after" && props.label !== "" && "10px" || "0px";
148
- }, function (props) {
149
- return props.iconPosition === "before" && props.label !== "" && "10px" || "0px";
150
- });
151
-
152
- var ButtonIcon = _styledComponents["default"].img(_templateObject3(), function (props) {
153
- return props.iconPosition === "after" && props.label !== "" && "10px" || "0px";
154
- }, function (props) {
155
- return props.iconPosition === "before" && props.label !== "" && "10px" || "0px";
156
- });
157
-
158
- var DxCButton = _styledComponents["default"].div(_templateObject4(), function (props) {
159
- return props.theme.fontSizeBase;
160
- }, function (props) {
161
- return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
162
- }, function (props) {
163
- return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
164
- }, function (props) {
165
- return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.right ? _variables.spaces[props.margin.right] : "";
166
- }, function (props) {
167
- return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.bottom ? _variables.spaces[props.margin.bottom] : "";
168
- }, function (props) {
169
- return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
170
- }, function (props) {
171
- return calculateWidth(props.margin, props.size);
172
- }, function (props) {
173
- return props.disabled && "not-allowed" || "pointer";
174
- }, function (props) {
175
- return props.iconPosition === "after" && "row" || "row-reverse";
176
- }, function (props) {
177
- return props.theme.fontLetterSpacingWide01;
178
- }, function (props) {
179
- return props.theme.fontSize;
180
- }, function (props) {
181
- return props.theme.fontWeight;
182
- }, function (props) {
183
- return props.size === "small" && "calc(100% - 22px)" || "unset";
184
- }, function (props) {
185
- return props.theme.fontFamily;
186
- }, function (props) {
187
- return props.theme.focusColor;
188
- }, function (props) {
189
- var mode = props.mode;
190
-
191
- if (mode === "primary") {
192
- return "\n background-color: ".concat(props.disabled && props.theme.disabledPrimaryBackgroundColor || props.theme.primaryBackgroundColor, ";\n color: ").concat(props.disabled && props.theme.disabledPrimaryFontColor || props.theme.primaryFontColor, " !important;\n padding: ").concat(props.size === "small" && "11px" || "12px 30px", ";\n &:hover{\n background-color: ").concat(props.theme.primaryHoverBackgroundColor, ";\n color: ").concat(props.theme.primaryHoverFontColor, " !important; \n }\n &:active {\n background-color: ").concat(props.theme.primaryActiveBackgroundColor, " !important;\n color: ").concat(props.theme.primaryHoverFontColor, " !important;\n }\n &:focus {\n background-color: ").concat(props.theme.primaryBackgroundColor, ";\n color: ").concat(props.theme.primaryHoverFontColor, " !important;\n }\n &:disabled{ \n cursor: not-allowed;\n }\n .MuiButton-label {\n z-index: 5\n }\n ");
193
- } else if (mode === "secondary") {
194
- return "\n background-color: ".concat(props.theme.secondaryBackgroundColor, ";\n padding: ").concat(props.size === "small" && "9px" || "10px 28px", ";\n color: ").concat(props.disabled && props.theme.disabledSecondaryFontColor || props.theme.secondaryFontColor, " !important;\n border: 2px solid;\n border-color: ").concat(props.disabled && props.theme.disabledSecondaryOutlinedColor || props.theme.secondaryOutlinedColor, ";\n &:hover{\n border-color: ").concat(props.theme.hoverOutlinedColor, ";\n background-color: ").concat(props.theme.secondaryHoverBackgroundColor, ";\n color: ").concat(props.theme.secondaryHoverFontColor, " !important; \n }\n &:active {\n background-color: ").concat(props.theme.secondaryActiveBackgroundColor, " !important;\n color: ").concat(props.theme.secondaryHoverFontColor, " !important;\n }\n &:focus {\n background-color: ").concat(props.theme.secondaryBackgroundColor, ";\n color: ").concat(props.theme.secondaryHoverFontColor, " !important; \n }\n &:disabled{\n cursor: not-allowed;\n }\n .MuiButton-label {\n z-index: 5\n }\n\n ");
195
- } else if (mode === "text") {
196
- return "\n background-color: ".concat(props.theme.textBackgroundColor, ";\n color: ").concat(props.disabled && props.theme.disabledTextFontColor || props.theme.textFontColor, " !important;\n padding: ").concat(props.size === "small" && "11px" || "12px 30px", ";\n &:hover{\n background-color: ").concat(props.theme.textHoverBackgroundColor, ";\n color: ").concat(props.theme.textHoverFontColor, " !important;\n }\n &:active {\n background-color: ").concat(props.theme.textActiveBackgroundColor, " !important;\n color: ").concat(props.theme.textHoverFontColor, " !important;\n }\n &:focus {\n background-color: ").concat(props.theme.textBackgroundColor, ";\n color: ").concat(props.theme.textFontColor, " !important; \n }\n &:disabled{\n cursor:not-allowed;\n }\n ");
197
- }
198
- });
199
-
200
- DxcButton.propTypes = {
201
- size: _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(sizes))),
202
- margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
203
- top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
204
- bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
205
- left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
206
- right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
207
- }), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
208
- label: _propTypes["default"].string,
209
- mode: _propTypes["default"].oneOf(["primary", "secondary", "text"]),
210
- disabled: _propTypes["default"].bool,
211
- iconPosition: _propTypes["default"].oneOf(["after", "before"]),
212
- onClick: _propTypes["default"].func,
213
- iconSrc: _propTypes["default"].string,
214
- icon: _propTypes["default"].oneOfType([_propTypes["default"].element, _propTypes["default"].func]),
215
- type: _propTypes["default"].oneOf(["button", "reset", "submit"]),
216
- tabIndex: _propTypes["default"].number
217
- };
218
- var _default = DxcButton;
219
- exports["default"] = _default;