@dxc-technology/halstack-react 0.0.0-9bd9511 → 0.0.0-9c04360

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 (333) hide show
  1. package/README.md +46 -0
  2. package/dist/index.d.mts +4032 -0
  3. package/dist/index.d.ts +4032 -0
  4. package/dist/index.js +15089 -0
  5. package/dist/index.mjs +15000 -0
  6. package/package.json +85 -67
  7. package/BackgroundColorContext.d.ts +0 -10
  8. package/BackgroundColorContext.js +0 -37
  9. package/HalstackContext.d.ts +0 -13
  10. package/HalstackContext.js +0 -318
  11. package/accordion/Accordion.d.ts +0 -4
  12. package/accordion/Accordion.js +0 -203
  13. package/accordion/Accordion.stories.tsx +0 -395
  14. package/accordion/Accordion.test.js +0 -56
  15. package/accordion/types.d.ts +0 -69
  16. package/accordion/types.js +0 -5
  17. package/accordion-group/AccordionGroup.d.ts +0 -7
  18. package/accordion-group/AccordionGroup.js +0 -121
  19. package/accordion-group/AccordionGroup.stories.tsx +0 -251
  20. package/accordion-group/AccordionGroup.test.js +0 -108
  21. package/accordion-group/types.d.ts +0 -79
  22. package/accordion-group/types.js +0 -5
  23. package/alert/Alert.d.ts +0 -4
  24. package/alert/Alert.js +0 -262
  25. package/alert/Alert.stories.tsx +0 -198
  26. package/alert/Alert.test.js +0 -75
  27. package/alert/types.d.ts +0 -49
  28. package/alert/types.js +0 -5
  29. package/badge/Badge.d.ts +0 -4
  30. package/badge/Badge.js +0 -49
  31. package/badge/types.d.ts +0 -5
  32. package/badge/types.js +0 -5
  33. package/bleed/Bleed.d.ts +0 -3
  34. package/bleed/Bleed.js +0 -43
  35. package/bleed/Bleed.stories.tsx +0 -341
  36. package/bleed/types.d.ts +0 -37
  37. package/bleed/types.js +0 -5
  38. package/box/Box.d.ts +0 -4
  39. package/box/Box.js +0 -97
  40. package/box/Box.stories.tsx +0 -147
  41. package/box/Box.test.js +0 -13
  42. package/box/types.d.ts +0 -44
  43. package/box/types.js +0 -5
  44. package/bulleted-list/BulletedList.d.ts +0 -7
  45. package/bulleted-list/BulletedList.js +0 -98
  46. package/bulleted-list/BulletedList.stories.tsx +0 -200
  47. package/bulleted-list/types.d.ts +0 -11
  48. package/bulleted-list/types.js +0 -5
  49. package/button/Button.d.ts +0 -4
  50. package/button/Button.js +0 -132
  51. package/button/Button.stories.tsx +0 -425
  52. package/button/Button.test.js +0 -26
  53. package/button/types.d.ts +0 -53
  54. package/button/types.js +0 -5
  55. package/card/Card.d.ts +0 -4
  56. package/card/Card.js +0 -138
  57. package/card/Card.stories.tsx +0 -201
  58. package/card/Card.test.js +0 -39
  59. package/card/ice-cream.jpg +0 -0
  60. package/card/types.d.ts +0 -68
  61. package/card/types.js +0 -5
  62. package/checkbox/Checkbox.d.ts +0 -4
  63. package/checkbox/Checkbox.js +0 -206
  64. package/checkbox/Checkbox.stories.tsx +0 -260
  65. package/checkbox/Checkbox.test.js +0 -128
  66. package/checkbox/types.d.ts +0 -68
  67. package/checkbox/types.js +0 -5
  68. package/chip/Chip.d.ts +0 -4
  69. package/chip/Chip.js +0 -137
  70. package/chip/Chip.stories.tsx +0 -206
  71. package/chip/Chip.test.js +0 -42
  72. package/chip/types.d.ts +0 -45
  73. package/chip/types.js +0 -5
  74. package/common/OpenSans.css +0 -81
  75. package/common/fonts/OpenSans-Bold.ttf +0 -0
  76. package/common/fonts/OpenSans-BoldItalic.ttf +0 -0
  77. package/common/fonts/OpenSans-ExtraBold.ttf +0 -0
  78. package/common/fonts/OpenSans-ExtraBoldItalic.ttf +0 -0
  79. package/common/fonts/OpenSans-Italic.ttf +0 -0
  80. package/common/fonts/OpenSans-Light.ttf +0 -0
  81. package/common/fonts/OpenSans-LightItalic.ttf +0 -0
  82. package/common/fonts/OpenSans-Regular.ttf +0 -0
  83. package/common/fonts/OpenSans-SemiBold.ttf +0 -0
  84. package/common/fonts/OpenSans-SemiBoldItalic.ttf +0 -0
  85. package/common/utils.js +0 -17
  86. package/common/variables.d.ts +0 -1431
  87. package/common/variables.js +0 -1538
  88. package/date-input/Calendar.d.ts +0 -4
  89. package/date-input/Calendar.js +0 -215
  90. package/date-input/DateInput.d.ts +0 -4
  91. package/date-input/DateInput.js +0 -222
  92. package/date-input/DateInput.stories.tsx +0 -304
  93. package/date-input/DateInput.test.js +0 -648
  94. package/date-input/DatePicker.d.ts +0 -4
  95. package/date-input/DatePicker.js +0 -116
  96. package/date-input/Icons.d.ts +0 -6
  97. package/date-input/Icons.js +0 -63
  98. package/date-input/YearPicker.d.ts +0 -4
  99. package/date-input/YearPicker.js +0 -101
  100. package/date-input/types.d.ts +0 -158
  101. package/date-input/types.js +0 -5
  102. package/dialog/Dialog.d.ts +0 -4
  103. package/dialog/Dialog.js +0 -134
  104. package/dialog/Dialog.stories.tsx +0 -289
  105. package/dialog/Dialog.test.js +0 -56
  106. package/dialog/types.d.ts +0 -44
  107. package/dialog/types.js +0 -5
  108. package/dropdown/Dropdown.d.ts +0 -4
  109. package/dropdown/Dropdown.js +0 -334
  110. package/dropdown/Dropdown.stories.tsx +0 -438
  111. package/dropdown/Dropdown.test.js +0 -479
  112. package/dropdown/DropdownMenu.d.ts +0 -4
  113. package/dropdown/DropdownMenu.js +0 -60
  114. package/dropdown/DropdownMenuItem.d.ts +0 -4
  115. package/dropdown/DropdownMenuItem.js +0 -70
  116. package/dropdown/types.d.ts +0 -100
  117. package/dropdown/types.js +0 -5
  118. package/file-input/FileInput.d.ts +0 -4
  119. package/file-input/FileInput.js +0 -463
  120. package/file-input/FileInput.stories.tsx +0 -618
  121. package/file-input/FileInput.test.js +0 -445
  122. package/file-input/FileItem.d.ts +0 -4
  123. package/file-input/FileItem.js +0 -135
  124. package/file-input/types.d.ts +0 -129
  125. package/file-input/types.js +0 -5
  126. package/flex/Flex.d.ts +0 -4
  127. package/flex/Flex.js +0 -57
  128. package/flex/Flex.stories.tsx +0 -103
  129. package/flex/types.d.ts +0 -32
  130. package/flex/types.js +0 -5
  131. package/footer/Footer.d.ts +0 -4
  132. package/footer/Footer.js +0 -153
  133. package/footer/Footer.stories.tsx +0 -228
  134. package/footer/Footer.test.js +0 -92
  135. package/footer/Icons.d.ts +0 -2
  136. package/footer/Icons.js +0 -73
  137. package/footer/types.d.ts +0 -66
  138. package/footer/types.js +0 -5
  139. package/header/Header.d.ts +0 -7
  140. package/header/Header.js +0 -259
  141. package/header/Header.stories.tsx +0 -315
  142. package/header/Header.test.js +0 -66
  143. package/header/Icons.d.ts +0 -2
  144. package/header/Icons.js +0 -30
  145. package/header/types.d.ts +0 -48
  146. package/header/types.js +0 -5
  147. package/heading/Heading.d.ts +0 -4
  148. package/heading/Heading.js +0 -138
  149. package/heading/Heading.stories.tsx +0 -54
  150. package/heading/Heading.test.js +0 -169
  151. package/heading/types.d.ts +0 -33
  152. package/heading/types.js +0 -5
  153. package/inset/Inset.d.ts +0 -3
  154. package/inset/Inset.js +0 -43
  155. package/inset/Inset.stories.tsx +0 -229
  156. package/inset/types.d.ts +0 -37
  157. package/inset/types.js +0 -5
  158. package/layout/ApplicationLayout.d.ts +0 -20
  159. package/layout/ApplicationLayout.js +0 -132
  160. package/layout/ApplicationLayout.stories.tsx +0 -162
  161. package/layout/Icons.d.ts +0 -5
  162. package/layout/Icons.js +0 -56
  163. package/layout/SidenavContext.d.ts +0 -5
  164. package/layout/SidenavContext.js +0 -15
  165. package/layout/types.d.ts +0 -42
  166. package/layout/types.js +0 -5
  167. package/link/Link.d.ts +0 -4
  168. package/link/Link.js +0 -116
  169. package/link/Link.stories.tsx +0 -253
  170. package/link/Link.test.js +0 -65
  171. package/link/types.d.ts +0 -54
  172. package/link/types.js +0 -5
  173. package/main.d.ts +0 -44
  174. package/main.js +0 -322
  175. package/nav-tabs/NavTabs.d.ts +0 -8
  176. package/nav-tabs/NavTabs.js +0 -95
  177. package/nav-tabs/NavTabs.stories.tsx +0 -260
  178. package/nav-tabs/NavTabs.test.js +0 -75
  179. package/nav-tabs/Tab.d.ts +0 -4
  180. package/nav-tabs/Tab.js +0 -120
  181. package/nav-tabs/types.d.ts +0 -53
  182. package/nav-tabs/types.js +0 -5
  183. package/number-input/NumberInput.d.ts +0 -4
  184. package/number-input/NumberInput.js +0 -66
  185. package/number-input/NumberInput.stories.tsx +0 -115
  186. package/number-input/NumberInput.test.js +0 -406
  187. package/number-input/NumberInputContext.d.ts +0 -4
  188. package/number-input/NumberInputContext.js +0 -14
  189. package/number-input/numberInputContextTypes.d.ts +0 -19
  190. package/number-input/numberInputContextTypes.js +0 -5
  191. package/number-input/types.d.ts +0 -124
  192. package/number-input/types.js +0 -5
  193. package/paginator/Icons.d.ts +0 -5
  194. package/paginator/Icons.js +0 -44
  195. package/paginator/Paginator.d.ts +0 -4
  196. package/paginator/Paginator.js +0 -141
  197. package/paginator/Paginator.stories.tsx +0 -87
  198. package/paginator/Paginator.test.js +0 -266
  199. package/paginator/types.d.ts +0 -38
  200. package/paginator/types.js +0 -5
  201. package/paragraph/Paragraph.d.ts +0 -6
  202. package/paragraph/Paragraph.js +0 -28
  203. package/paragraph/Paragraph.stories.tsx +0 -44
  204. package/password-input/PasswordInput.d.ts +0 -4
  205. package/password-input/PasswordInput.js +0 -137
  206. package/password-input/PasswordInput.stories.tsx +0 -131
  207. package/password-input/PasswordInput.test.js +0 -138
  208. package/password-input/types.d.ts +0 -110
  209. package/password-input/types.js +0 -5
  210. package/progress-bar/ProgressBar.d.ts +0 -4
  211. package/progress-bar/ProgressBar.js +0 -151
  212. package/progress-bar/ProgressBar.stories.jsx +0 -93
  213. package/progress-bar/ProgressBar.test.js +0 -93
  214. package/progress-bar/types.d.ts +0 -36
  215. package/progress-bar/types.js +0 -5
  216. package/quick-nav/QuickNav.d.ts +0 -4
  217. package/quick-nav/QuickNav.js +0 -95
  218. package/quick-nav/QuickNav.stories.tsx +0 -356
  219. package/quick-nav/types.d.ts +0 -21
  220. package/quick-nav/types.js +0 -5
  221. package/radio-group/Radio.d.ts +0 -4
  222. package/radio-group/Radio.js +0 -125
  223. package/radio-group/RadioGroup.d.ts +0 -4
  224. package/radio-group/RadioGroup.js +0 -238
  225. package/radio-group/RadioGroup.stories.tsx +0 -214
  226. package/radio-group/RadioGroup.test.js +0 -620
  227. package/radio-group/types.d.ts +0 -114
  228. package/radio-group/types.js +0 -5
  229. package/resultsetTable/Icons.d.ts +0 -7
  230. package/resultsetTable/Icons.js +0 -48
  231. package/resultsetTable/ResultsetTable.d.ts +0 -4
  232. package/resultsetTable/ResultsetTable.js +0 -160
  233. package/resultsetTable/ResultsetTable.stories.tsx +0 -300
  234. package/resultsetTable/ResultsetTable.test.js +0 -292
  235. package/resultsetTable/types.d.ts +0 -67
  236. package/resultsetTable/types.js +0 -5
  237. package/select/Icons.d.ts +0 -10
  238. package/select/Icons.js +0 -90
  239. package/select/Listbox.d.ts +0 -4
  240. package/select/Listbox.js +0 -144
  241. package/select/Option.d.ts +0 -4
  242. package/select/Option.js +0 -81
  243. package/select/Select.d.ts +0 -4
  244. package/select/Select.js +0 -579
  245. package/select/Select.stories.tsx +0 -971
  246. package/select/Select.test.js +0 -1845
  247. package/select/types.d.ts +0 -210
  248. package/select/types.js +0 -5
  249. package/sidenav/Sidenav.d.ts +0 -10
  250. package/sidenav/Sidenav.js +0 -226
  251. package/sidenav/Sidenav.stories.tsx +0 -282
  252. package/sidenav/Sidenav.test.js +0 -37
  253. package/sidenav/types.d.ts +0 -73
  254. package/sidenav/types.js +0 -5
  255. package/slider/Slider.d.ts +0 -4
  256. package/slider/Slider.js +0 -296
  257. package/slider/Slider.stories.tsx +0 -240
  258. package/slider/Slider.test.js +0 -222
  259. package/slider/types.d.ts +0 -86
  260. package/slider/types.js +0 -5
  261. package/spinner/Spinner.d.ts +0 -4
  262. package/spinner/Spinner.js +0 -221
  263. package/spinner/Spinner.stories.jsx +0 -129
  264. package/spinner/Spinner.test.js +0 -55
  265. package/spinner/types.d.ts +0 -32
  266. package/spinner/types.js +0 -5
  267. package/switch/Switch.d.ts +0 -4
  268. package/switch/Switch.js +0 -220
  269. package/switch/Switch.stories.tsx +0 -171
  270. package/switch/Switch.test.js +0 -180
  271. package/switch/types.d.ts +0 -66
  272. package/switch/types.js +0 -5
  273. package/table/Table.d.ts +0 -4
  274. package/table/Table.js +0 -100
  275. package/table/Table.stories.jsx +0 -356
  276. package/table/Table.test.js +0 -21
  277. package/table/types.d.ts +0 -21
  278. package/table/types.js +0 -5
  279. package/tabs/Tab.d.ts +0 -4
  280. package/tabs/Tab.js +0 -115
  281. package/tabs/Tabs.d.ts +0 -4
  282. package/tabs/Tabs.js +0 -392
  283. package/tabs/Tabs.stories.tsx +0 -226
  284. package/tabs/Tabs.test.js +0 -295
  285. package/tabs/types.d.ts +0 -92
  286. package/tabs/types.js +0 -5
  287. package/tag/Tag.d.ts +0 -4
  288. package/tag/Tag.js +0 -154
  289. package/tag/Tag.stories.tsx +0 -155
  290. package/tag/Tag.test.js +0 -49
  291. package/tag/types.d.ts +0 -69
  292. package/tag/types.js +0 -5
  293. package/text-input/Icons.d.ts +0 -8
  294. package/text-input/Icons.js +0 -57
  295. package/text-input/Suggestion.d.ts +0 -4
  296. package/text-input/Suggestion.js +0 -68
  297. package/text-input/Suggestions.d.ts +0 -4
  298. package/text-input/Suggestions.js +0 -109
  299. package/text-input/TextInput.d.ts +0 -4
  300. package/text-input/TextInput.js +0 -588
  301. package/text-input/TextInput.stories.tsx +0 -569
  302. package/text-input/TextInput.test.js +0 -1404
  303. package/text-input/types.d.ts +0 -197
  304. package/text-input/types.js +0 -5
  305. package/textarea/Textarea.d.ts +0 -4
  306. package/textarea/Textarea.js +0 -241
  307. package/textarea/Textarea.stories.jsx +0 -216
  308. package/textarea/Textarea.test.js +0 -360
  309. package/textarea/types.d.ts +0 -137
  310. package/textarea/types.js +0 -5
  311. package/toggle-group/ToggleGroup.d.ts +0 -4
  312. package/toggle-group/ToggleGroup.js +0 -180
  313. package/toggle-group/ToggleGroup.stories.tsx +0 -215
  314. package/toggle-group/ToggleGroup.test.js +0 -124
  315. package/toggle-group/types.d.ts +0 -105
  316. package/toggle-group/types.js +0 -5
  317. package/translatedLabelsType.d.ts +0 -82
  318. package/translatedLabelsType.js +0 -5
  319. package/typography/Typography.d.ts +0 -4
  320. package/typography/Typography.js +0 -119
  321. package/typography/Typography.stories.tsx +0 -198
  322. package/typography/types.d.ts +0 -18
  323. package/typography/types.js +0 -5
  324. package/useTheme.d.ts +0 -2
  325. package/useTheme.js +0 -16
  326. package/useTranslatedLabels.d.ts +0 -3
  327. package/useTranslatedLabels.js +0 -15
  328. package/wizard/Wizard.d.ts +0 -4
  329. package/wizard/Wizard.js +0 -251
  330. package/wizard/Wizard.stories.tsx +0 -253
  331. package/wizard/Wizard.test.js +0 -114
  332. package/wizard/types.d.ts +0 -65
  333. package/wizard/types.js +0 -5
@@ -1,116 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- var _typeof = require("@babel/runtime/helpers/typeof");
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports["default"] = void 0;
9
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
10
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
- var _dayjs = _interopRequireDefault(require("dayjs"));
12
- var _react = _interopRequireWildcard(require("react"));
13
- var _styledComponents = _interopRequireDefault(require("styled-components"));
14
- var _Calendar = _interopRequireDefault(require("./Calendar"));
15
- var _YearPicker = _interopRequireDefault(require("./YearPicker"));
16
- var _useTranslatedLabels = _interopRequireDefault(require("../useTranslatedLabels"));
17
- var _Icons = require("./Icons");
18
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
19
- 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); }
20
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
21
- var today = (0, _dayjs["default"])();
22
- var DxcDatePicker = function DxcDatePicker(_ref) {
23
- var date = _ref.date,
24
- onDateSelect = _ref.onDateSelect,
25
- id = _ref.id;
26
- var _useState = (0, _react.useState)(date !== null && date !== void 0 && date.isValid() ? date : (0, _dayjs["default"])()),
27
- _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
28
- innerDate = _useState2[0],
29
- setInnerDate = _useState2[1];
30
- var _useState3 = (0, _react.useState)("calendar"),
31
- _useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
32
- content = _useState4[0],
33
- setContent = _useState4[1];
34
- var selectedDate = date !== null && date !== void 0 && date.isValid() ? date : null;
35
- var translatedLabels = (0, _useTranslatedLabels["default"])();
36
- var handleDateSelect = function handleDateSelect(date) {
37
- setInnerDate(date);
38
- onDateSelect(date);
39
- };
40
- var handleOnYearSelect = function handleOnYearSelect(year) {
41
- setInnerDate(innerDate.set("year", year));
42
- setContent("calendar");
43
- };
44
- var handleMonthChange = function handleMonthChange(date) {
45
- setInnerDate(date);
46
- };
47
- return /*#__PURE__*/_react["default"].createElement(DatePicker, {
48
- id: id
49
- }, /*#__PURE__*/_react["default"].createElement(PickerHeader, null, /*#__PURE__*/_react["default"].createElement(HeaderButton, {
50
- "aria-label": translatedLabels.calendar.previousMonthTitle,
51
- title: translatedLabels.calendar.previousMonthTitle,
52
- onClick: function onClick() {
53
- return handleMonthChange(innerDate.set("month", innerDate.get("month") - 1));
54
- }
55
- }, _Icons.leftCaret), /*#__PURE__*/_react["default"].createElement(HeaderYearTrigger, {
56
- "aria-live": "polite",
57
- onClick: function onClick() {
58
- return setContent(function (content) {
59
- return content === "yearPicker" ? "calendar" : "yearPicker";
60
- });
61
- }
62
- }, /*#__PURE__*/_react["default"].createElement(HeaderYearTriggerLabel, null, translatedLabels.calendar.months[innerDate.get("month")], " ", innerDate.format("YYYY")), content === "yearPicker" ? _Icons.upCaret : _Icons.downCaret), /*#__PURE__*/_react["default"].createElement(HeaderButton, {
63
- "aria-label": translatedLabels.calendar.nextMonthTitle,
64
- title: translatedLabels.calendar.nextMonthTitle,
65
- onClick: function onClick() {
66
- return handleMonthChange(innerDate.set("month", innerDate.get("month") + 1));
67
- }
68
- }, _Icons.rightCaret)), content === "calendar" && /*#__PURE__*/_react["default"].createElement(_Calendar["default"], {
69
- innerDate: innerDate,
70
- selectedDate: selectedDate,
71
- onInnerDateChange: setInnerDate,
72
- onDaySelect: handleDateSelect,
73
- today: today
74
- }), content === "yearPicker" && /*#__PURE__*/_react["default"].createElement(_YearPicker["default"], {
75
- selectedDate: selectedDate,
76
- onYearSelect: handleOnYearSelect,
77
- today: today
78
- }));
79
- };
80
- var DatePicker = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n padding-top: 16px;\n background-color: ", ";\n box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);\n border: ", ";\n border-radius: 4px;\n width: fit-content;\n font-family: ", ";\n font-size: ", ";\n color: ", ";\n font-weight: ", ";\n"])), function (props) {
81
- return props.theme.dateInput.pickerBackgroundColor;
82
- }, function (props) {
83
- return "".concat(props.theme.dateInput.pickerBorderWidth, " ").concat(props.theme.dateInput.pickerBorderStyle, "\n ").concat(props.theme.dateInput.pickerBorderColor);
84
- }, function (props) {
85
- return props.theme.dateInput.pickerFontFamily;
86
- }, function (props) {
87
- return props.theme.dateInput.pickerFontSize;
88
- }, function (props) {
89
- return props.theme.dateInput.pickerFontColor;
90
- }, function (props) {
91
- return props.theme.dateInput.pickerFontWeight;
92
- });
93
- var PickerHeader = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n box-sizing: border-box;\n display: flex;\n gap: 8px;\n align-items: center;\n justify-content: space-between;\n padding: 0px 16px;\n"])));
94
- var HeaderButton = _styledComponents["default"].button(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n padding: 0px;\n color: ", ";\n background-color: ", ";\n border-radius: 4px;\n border: none;\n cursor: pointer;\n\n &:hover {\n color: ", ";\n background-color: ", ";\n }\n &:focus {\n outline: ", ";\n }\n &:active {\n color: ", ";\n background-color: ", ";\n }\n svg {\n width: 24px;\n height: 24px;\n }\n"])), function (props) {
95
- return props.theme.dateInput.pickerHeaderFontColor;
96
- }, function (props) {
97
- return props.theme.dateInput.pickerHeaderBackgroundColor;
98
- }, function (props) {
99
- return props.theme.dateInput.pickerHeaderHoverFontColor;
100
- }, function (props) {
101
- return props.theme.dateInput.pickerHeaderHoverBackgroundColor;
102
- }, function (props) {
103
- return "".concat(props.theme.dateInput.pickerFocusColor, " solid\n ").concat(props.theme.dateInput.pickerFocusWidth);
104
- }, function (props) {
105
- return props.theme.dateInput.pickerHeaderActiveFontColor;
106
- }, function (props) {
107
- return props.theme.dateInput.pickerHeaderActiveBackgroundColor;
108
- });
109
- var HeaderYearTrigger = (0, _styledComponents["default"])(HeaderButton)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n gap: 8px;\n height: 40px;\n width: 172px;\n"])));
110
- var HeaderYearTriggerLabel = _styledComponents["default"].span(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: center;\n justify-content: center;\n font-family: ", ";\n font-size: ", ";\n"])), function (props) {
111
- return props.theme.dateInput.pickerFontFamily;
112
- }, function (props) {
113
- return props.theme.dateInput.pickerHeaderFontSize;
114
- });
115
- var _default = /*#__PURE__*/_react["default"].memo(DxcDatePicker);
116
- exports["default"] = _default;
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const calendarIcon: JSX.Element;
3
- export declare const leftCaret: JSX.Element;
4
- export declare const rightCaret: JSX.Element;
5
- export declare const downCaret: JSX.Element;
6
- export declare const upCaret: JSX.Element;
@@ -1,63 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.upCaret = exports.rightCaret = exports.leftCaret = exports.downCaret = exports.calendarIcon = void 0;
8
- var _react = _interopRequireDefault(require("react"));
9
- var calendarIcon = /*#__PURE__*/_react["default"].createElement("svg", {
10
- xmlns: "http://www.w3.org/2000/svg",
11
- height: "24",
12
- viewBox: "0 0 24 24",
13
- width: "24",
14
- fill: "currentColor"
15
- }, /*#__PURE__*/_react["default"].createElement("path", {
16
- d: "M0 0h24v24H0z",
17
- fill: "none"
18
- }), /*#__PURE__*/_react["default"].createElement("path", {
19
- d: "M20 3h-1V1h-2v2H7V1H5v2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 18H4V8h16v13z"
20
- }));
21
- exports.calendarIcon = calendarIcon;
22
- var leftCaret = /*#__PURE__*/_react["default"].createElement("svg", {
23
- fill: "currentColor",
24
- focusable: "false",
25
- viewBox: "0 0 24 24"
26
- }, /*#__PURE__*/_react["default"].createElement("path", {
27
- d: "M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"
28
- }), /*#__PURE__*/_react["default"].createElement("path", {
29
- fill: "none",
30
- d: "M0 0h24v24H0V0z"
31
- }));
32
- exports.leftCaret = leftCaret;
33
- var rightCaret = /*#__PURE__*/_react["default"].createElement("svg", {
34
- fill: "currentColor",
35
- focusable: "false",
36
- viewBox: "0 0 24 24"
37
- }, /*#__PURE__*/_react["default"].createElement("path", {
38
- d: "M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"
39
- }), /*#__PURE__*/_react["default"].createElement("path", {
40
- fill: "none",
41
- d: "M0 0h24v24H0V0z"
42
- }));
43
- exports.rightCaret = rightCaret;
44
- var downCaret = /*#__PURE__*/_react["default"].createElement("svg", {
45
- xmlns: "http://www.w3.org/2000/svg",
46
- width: "24",
47
- height: "24",
48
- viewBox: "0 0 24 24"
49
- }, /*#__PURE__*/_react["default"].createElement("path", {
50
- d: "M7.5 10L12.5 15L17.5 10H7.5Z",
51
- fill: "currentColor"
52
- }));
53
- exports.downCaret = downCaret;
54
- var upCaret = /*#__PURE__*/_react["default"].createElement("svg", {
55
- xmlns: "http://www.w3.org/2000/svg",
56
- height: "24",
57
- width: "24",
58
- viewBox: "0 0 24 24"
59
- }, /*#__PURE__*/_react["default"].createElement("path", {
60
- d: "m7 14 5-5 5 5Z",
61
- fill: "currentColor"
62
- }));
63
- exports.upCaret = upCaret;
@@ -1,4 +0,0 @@
1
- import React from "react";
2
- import { YearPickerPropsType } from "./types";
3
- declare const _default: React.MemoExoticComponent<({ onYearSelect, selectedDate, today }: YearPickerPropsType) => JSX.Element>;
4
- export default _default;
@@ -1,101 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- var _typeof = require("@babel/runtime/helpers/typeof");
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports["default"] = void 0;
9
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
10
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
- var _dayjs = _interopRequireDefault(require("dayjs"));
12
- var _react = _interopRequireWildcard(require("react"));
13
- var _styledComponents = _interopRequireDefault(require("styled-components"));
14
- var _templateObject, _templateObject2;
15
- 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); }
16
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
17
- var getYearsArray = function getYearsArray() {
18
- var yearList = [];
19
- for (var i = 1899; i <= 2100; i++) {
20
- yearList.push(i);
21
- }
22
- return yearList;
23
- };
24
- var yearList = getYearsArray();
25
- var YearPicker = function YearPicker(_ref) {
26
- var onYearSelect = _ref.onYearSelect,
27
- selectedDate = _ref.selectedDate,
28
- today = _ref.today;
29
- var _useState = (0, _react.useState)(selectedDate ? selectedDate.get("year") : (0, _dayjs["default"])().get("year")),
30
- _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
31
- yearToFocus = _useState2[0],
32
- setYearToFocus = _useState2[1];
33
- (0, _react.useEffect)(function () {
34
- var _yearToFocusEl$scroll;
35
- var yearToFocusEl = document.getElementById("year_".concat(yearToFocus));
36
- yearToFocusEl === null || yearToFocusEl === void 0 ? void 0 : (_yearToFocusEl$scroll = yearToFocusEl.scrollIntoView) === null || _yearToFocusEl$scroll === void 0 ? void 0 : _yearToFocusEl$scroll.call(yearToFocusEl, {
37
- block: "nearest",
38
- inline: "start"
39
- });
40
- yearToFocusEl === null || yearToFocusEl === void 0 ? void 0 : yearToFocusEl.focus();
41
- }, [yearToFocus]);
42
- var handleDayKeyboardEvent = function handleDayKeyboardEvent(event) {
43
- switch (event.key) {
44
- case "ArrowUp":
45
- setYearToFocus(function (prev) {
46
- return prev > 1899 ? prev - 1 : prev;
47
- });
48
- break;
49
- case "ArrowDown":
50
- setYearToFocus(function (prev) {
51
- return prev < 2100 ? prev + 1 : prev;
52
- });
53
- break;
54
- }
55
- };
56
- return /*#__PURE__*/_react["default"].createElement(YearPickerContainer, null, yearList.map(function (year) {
57
- return /*#__PURE__*/_react["default"].createElement(YearPickerButton, {
58
- "aria-label": year,
59
- key: year,
60
- selected: (selectedDate === null || selectedDate === void 0 ? void 0 : selectedDate.get("year")) === year,
61
- "aria-selected": (selectedDate === null || selectedDate === void 0 ? void 0 : selectedDate.get("year")) === year,
62
- tabIndex: yearToFocus === year ? 0 : -1,
63
- isCurrentYear: today.get("year") === year,
64
- onKeyDown: function onKeyDown(event) {
65
- return handleDayKeyboardEvent(event);
66
- },
67
- id: "year_".concat(year),
68
- onClick: function onClick() {
69
- onYearSelect(year);
70
- }
71
- }, year);
72
- }));
73
- };
74
- var YearPickerContainer = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n gap: 4px;\n align-items: center;\n overflow-y: scroll;\n width: 292px;\n height: 312px;\n padding: 2px 8px 8px 8px;\n"])));
75
- var YearPickerButton = _styledComponents["default"].button(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: center;\n justify-content: center;\n width: 80px;\n min-height: 40px;\n line-height: 21px;\n background-color: transparent;\n border: none;\n border-radius: 50px;\n cursor: pointer;\n font-family: ", ";\n font-size: ", ";\n color: ", ";\n font-weight: ", ";\n\n ", "\n\n &:hover, &:focus, &:active {\n font-size: ", ";\n line-height: 36px;\n }\n &:hover {\n color: ", ";\n background-color: ", ";\n }\n &:focus {\n color: ", ";\n outline: ", ";\n }\n &:active {\n color: ", ";\n background-color: ", " !important;\n }\n"])), function (props) {
76
- return props.theme.dateInput.pickerFontFamily;
77
- }, function (props) {
78
- return props.theme.dateInput.pickerFontSize;
79
- }, function (props) {
80
- return props.theme.dateInput.pickerFontColor;
81
- }, function (props) {
82
- return props.theme.dateInput.pickerFontWeight;
83
- }, function (props) {
84
- return props.selected ? "font-size: ".concat(props.theme.dateInput.pickerInteractedYearFontSize, ";\n line-height: 36px;\n color: ").concat(props.theme.dateInput.pickerSelectedFontColor, " !important;\n background-color: ").concat(props.theme.dateInput.pickerSelectedBackgroundColor, " !important;") : props.isCurrentYear ? "border: 1px solid ".concat(props.theme.dateInput.pickerCurrentDateBorderColor, "; \n color: ").concat(props.theme.dateInput.pickerCurrentYearFontColor, ";") : "";
85
- }, function (props) {
86
- return props.theme.dateInput.pickerInteractedYearFontSize;
87
- }, function (props) {
88
- return props.theme.dateInput.pickerHoverFontColor;
89
- }, function (props) {
90
- return props.theme.dateInput.pickerHoverBackgroundColor;
91
- }, function (props) {
92
- return props.theme.dateInput.pickerHoverFontColor;
93
- }, function (props) {
94
- return "".concat(props.theme.dateInput.pickerFocusColor, " solid\n ").concat(props.theme.dateInput.pickerFocusWidth);
95
- }, function (props) {
96
- return props.theme.dateInput.pickerActiveFontColor;
97
- }, function (props) {
98
- return props.theme.dateInput.pickerActiveBackgroundColor;
99
- });
100
- var _default = /*#__PURE__*/_react["default"].memo(YearPicker);
101
- exports["default"] = _default;
@@ -1,158 +0,0 @@
1
- import { Dayjs } from "dayjs";
2
- type Space = "xxsmall" | "xsmall" | "small" | "medium" | "large" | "xlarge" | "xxlarge";
3
- type Margin = {
4
- top?: Space;
5
- bottom?: Space;
6
- left?: Space;
7
- right?: Space;
8
- };
9
- type Props = {
10
- /**
11
- * Text to be placed above the date.
12
- */
13
- label?: string;
14
- /**
15
- * Name attribute of the input element.
16
- */
17
- name?: string;
18
- /**
19
- * Initial value of the input element, only when it is uncontrolled.
20
- */
21
- defaultValue?: string;
22
- /**
23
- * Value of the input element. If undefined, the component will be uncontrolled and the value will be managed internally by the component.
24
- */
25
- value?: string;
26
- /**
27
- * The format in which the date value will be displayed. User must use this format when editing the value or it will be considered as an invalid date.
28
- */
29
- format?: string;
30
- /**
31
- * Helper text to be placed above the date.
32
- */
33
- helperText?: string;
34
- /**
35
- * If true, the date format will appear as placeholder in the field.
36
- */
37
- placeholder?: boolean;
38
- /**
39
- * If true, the date input will have an action to clear the entered value.
40
- */
41
- clearable?: boolean;
42
- /**
43
- * If true, the component will be disabled.
44
- */
45
- disabled?: boolean;
46
- /**
47
- * If true, the date will be optional, showing '(Optional)'
48
- * next to the label. Otherwise, the field will be considered required and an error will be
49
- * passed as a parameter to the OnBlur and onChange functions when it has
50
- * not been filled.
51
- */
52
- optional?: boolean;
53
- /**
54
- * This function will be called when the user types within the input
55
- * element of the component. An object including the string value, the
56
- * error and the date value will be passed to this function.
57
- * If the string value is a valid date, error will
58
- * be undefined. Also, if the string value is not a valid date, date will be undefined.
59
- */
60
- onChange?: (val: {
61
- value: string;
62
- error?: string;
63
- date?: Date;
64
- }) => void;
65
- /**
66
- * This function will be called when the input element loses the focus.
67
- * An object including the string value, the error and the date value
68
- * will be passed to this function. If the string value is a valid date, error will
69
- * be undefined. Also, if the string value is not a valid date, date will be undefined.
70
- */
71
- onBlur?: (val: {
72
- value: string;
73
- error?: string;
74
- date?: Date;
75
- }) => void;
76
- /**
77
- * If it is a defined value and also a truthy string, the component will
78
- * change its appearance, showing the error below the date input
79
- * component. If the defined value is an empty string, it will reserve a
80
- * space below the component for a future error, but it would not change
81
- * its look. In case of being undefined or null, both the appearance and
82
- * the space for the error message would not be modified.
83
- */
84
- error?: string;
85
- /**
86
- * HTML autocomplete attribute. Lets the user specify if any permission the user agent has to provide automated assistance in filling out the input value.
87
- * Its value must be one of all the possible values of the HTML autocomplete attribute: 'on', 'off', 'email', 'username', 'new-password', ...
88
- */
89
- autocomplete?: string;
90
- /**
91
- * Size of the margin to be applied to the component ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
92
- * You can pass an object with 'top', 'bottom', 'left' and 'right' properties in order to specify different margin sizes.
93
- */
94
- margin?: Space | Margin;
95
- /**
96
- * Size of the component.
97
- */
98
- size?: "medium" | "large" | "fillParent";
99
- /**
100
- * Value of the tabindex attribute.
101
- */
102
- tabIndex?: number;
103
- };
104
- export type DatePickerPropsType = {
105
- /**
106
- * Initial selected date value. If invalid the actual date will be used instead.
107
- */
108
- date: Dayjs;
109
- /**
110
- * Function called when a date is selected.
111
- */
112
- onDateSelect: (date: Dayjs) => void;
113
- /**
114
- * Id assigned to the date picker.
115
- */
116
- id: string;
117
- };
118
- export type CalendarPropsType = {
119
- /**
120
- * Initial selected date value. If invalid the actual date will be used instead.
121
- */
122
- selectedDate: Dayjs;
123
- /**
124
- * Date showed by the calendar.
125
- */
126
- innerDate: Dayjs;
127
- /**
128
- * Function called when the date showned needs to be updated
129
- */
130
- onInnerDateChange: (date: Dayjs) => void;
131
- /**
132
- * Function called when a date is selected.
133
- */
134
- onDaySelect: (date: Dayjs) => void;
135
- /**
136
- * Current date
137
- */
138
- today: Dayjs;
139
- };
140
- export type YearPickerPropsType = {
141
- /**
142
- * Initial selected date value. If invalid the actual date will be used instead.
143
- */
144
- selectedDate: Dayjs;
145
- /**
146
- * Function called when a year is selected.
147
- */
148
- onYearSelect: (year: number) => void;
149
- /**
150
- * Current date
151
- */
152
- today: Dayjs;
153
- };
154
- /**
155
- * Reference to the component.
156
- */
157
- export type RefType = HTMLDivElement;
158
- export default Props;
@@ -1,5 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
@@ -1,4 +0,0 @@
1
- /// <reference types="react" />
2
- import DialogPropsType from "./types";
3
- declare const DxcDialog: ({ isCloseVisible, onCloseClick, children, overlay, onBackgroundClick, padding, tabIndex, }: DialogPropsType) => JSX.Element;
4
- export default DxcDialog;
package/dialog/Dialog.js DELETED
@@ -1,134 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- var _typeof3 = require("@babel/runtime/helpers/typeof");
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports["default"] = void 0;
9
- var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
10
- var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
11
- var _react = _interopRequireWildcard(require("react"));
12
- var _styledComponents = _interopRequireWildcard(require("styled-components"));
13
- var _variables = require("../common/variables");
14
- var _useTheme = _interopRequireDefault(require("../useTheme"));
15
- var _BackgroundColorContext = require("../BackgroundColorContext");
16
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
17
- 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); }
18
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
19
- var DxcDialog = function DxcDialog(_ref) {
20
- var _ref$isCloseVisible = _ref.isCloseVisible,
21
- isCloseVisible = _ref$isCloseVisible === void 0 ? true : _ref$isCloseVisible,
22
- onCloseClick = _ref.onCloseClick,
23
- children = _ref.children,
24
- _ref$overlay = _ref.overlay,
25
- overlay = _ref$overlay === void 0 ? true : _ref$overlay,
26
- onBackgroundClick = _ref.onBackgroundClick,
27
- _ref$padding = _ref.padding,
28
- padding = _ref$padding === void 0 ? "small" : _ref$padding,
29
- _ref$tabIndex = _ref.tabIndex,
30
- tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
31
- var colorsTheme = (0, _useTheme["default"])();
32
- var handleClose = function handleClose() {
33
- onCloseClick === null || onCloseClick === void 0 ? void 0 : onCloseClick();
34
- };
35
- var handleOverlayClick = function handleOverlayClick() {
36
- onBackgroundClick === null || onBackgroundClick === void 0 ? void 0 : onBackgroundClick();
37
- };
38
- var handleOnKeyDown = function handleOnKeyDown(event) {
39
- if (event.key === "Escape") {
40
- event.preventDefault();
41
- handleClose();
42
- }
43
- };
44
- (0, _react.useEffect)(function () {
45
- if (isCloseVisible) {
46
- window.addEventListener("keydown", handleOnKeyDown);
47
- }
48
- return function () {
49
- window.removeEventListener("keydown", handleOnKeyDown);
50
- };
51
- }, [isCloseVisible]);
52
- return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
53
- theme: colorsTheme["dialog"]
54
- }, /*#__PURE__*/_react["default"].createElement(BodyStyle, null), /*#__PURE__*/_react["default"].createElement(DialogContainer, {
55
- role: "presentation"
56
- }, overlay && /*#__PURE__*/_react["default"].createElement(Overlay, {
57
- onClick: handleOverlayClick
58
- }), /*#__PURE__*/_react["default"].createElement(Dialog, {
59
- role: "dialog",
60
- "aria-modal": overlay,
61
- isCloseVisible: isCloseVisible
62
- }, /*#__PURE__*/_react["default"].createElement(Children, {
63
- padding: padding
64
- }, /*#__PURE__*/_react["default"].createElement(_BackgroundColorContext.BackgroundColorProvider, {
65
- color: colorsTheme["dialog"].backgroundColor
66
- }, children)), isCloseVisible && /*#__PURE__*/_react["default"].createElement(CloseIconContainer, {
67
- onClick: handleClose,
68
- tabIndex: tabIndex
69
- }, /*#__PURE__*/_react["default"].createElement(CloseIcon, {
70
- xmlns: "http://www.w3.org/2000/svg",
71
- width: "24",
72
- height: "24",
73
- viewBox: "0 0 24 24",
74
- fill: "currentColor"
75
- }, /*#__PURE__*/_react["default"].createElement("path", {
76
- d: "M0 0h24v24H0V0z",
77
- fill: "none"
78
- }), /*#__PURE__*/_react["default"].createElement("path", {
79
- 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 12 19 6.41z"
80
- }))))));
81
- };
82
- var BodyStyle = (0, _styledComponents.createGlobalStyle)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n body {\n overflow: hidden;\n }\n"])));
83
- var DialogContainer = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n align-items: center;\n justify-content: center;\n position: fixed;\n inset: 0px;\n height: 100%;\n z-index: 1300;\n"])));
84
- var Overlay = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n position: fixed;\n inset: 0px;\n height: 100%;\n background-color: ", ";\n"])), function (props) {
85
- return props.theme.overlayColor;
86
- });
87
- var Dialog = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n justify-content: space-between;\n z-index: 1300;\n background-color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-weight: ", ";\n ", "\n box-sizing: border-box;\n box-shadow: ", ";\n border-radius: 4px;\n position: relative;\n\n @media (min-width: ", "rem) {\n max-width: 80%;\n min-width: 800px;\n }\n\n @media (max-width: ", "rem) {\n //mobile phones\n max-width: 92%;\n min-width: 92%;\n }\n"])), function (props) {
88
- return props.theme.backgroundColor;
89
- }, function (props) {
90
- return props.theme.fontFamily;
91
- }, function (props) {
92
- return props.theme.fontSize;
93
- }, function (props) {
94
- return props.theme.fontWeight;
95
- }, function (props) {
96
- return props.isCloseVisible && "min-height: 72px; padding-top: 24px;";
97
- }, function (props) {
98
- return "".concat(props.theme.boxShadowOffsetX, " ").concat(props.theme.boxShadowOffsetY, " ").concat(props.theme.boxShadowBlur, " ").concat(props.theme.boxShadowColor);
99
- }, _variables.responsiveSizes.medium, _variables.responsiveSizes.medium);
100
- var Children = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n width: 100%;\n padding: ", ";\n padding-top: ", ";\n padding-right: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n"])), function (props) {
101
- return props.padding && (0, _typeof2["default"])(props.padding) !== "object" ? _variables.spaces[props.padding] : _variables.spaces["small"];
102
- }, function (props) {
103
- return props.padding && (0, _typeof2["default"])(props.padding) === "object" && props.padding.top ? _variables.spaces[props.padding.top] : "";
104
- }, function (props) {
105
- return props.padding && (0, _typeof2["default"])(props.padding) === "object" && props.padding.right ? _variables.spaces[props.padding.right] : "";
106
- }, function (props) {
107
- return props.padding && (0, _typeof2["default"])(props.padding) === "object" && props.padding.bottom ? _variables.spaces[props.padding.bottom] : "";
108
- }, function (props) {
109
- return props.padding && (0, _typeof2["default"])(props.padding) === "object" && props.padding.left ? _variables.spaces[props.padding.left] : "";
110
- });
111
- var CloseIconContainer = _styledComponents["default"].button(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n cursor: pointer;\n padding: 0;\n margin: 0;\n background: none;\n border: none;\n position: absolute;\n top: 20px;\n right: 20px;\n color: ", ";\n width: ", ";\n height: ", ";\n"])), function (props) {
112
- return props.theme.closeIconColor;
113
- }, function (props) {
114
- return props.theme.closeIconWidth;
115
- }, function (props) {
116
- return props.theme.closeIconHeight;
117
- });
118
- var CloseIcon = _styledComponents["default"].svg(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n background-color: ", ";\n width: ", ";\n height: ", ";\n border-radius: ", ";\n border-width: ", ";\n border-style: ", ";\n border-color: ", ";\n"])), function (props) {
119
- return props.theme.closeIconBackgroundColor;
120
- }, function (props) {
121
- return props.theme.closeIconWidth;
122
- }, function (props) {
123
- return props.theme.closeIconHeight;
124
- }, function (props) {
125
- return props.theme.closeIconBorderRadius;
126
- }, function (props) {
127
- return props.theme.closeIconBorderThickness;
128
- }, function (props) {
129
- return props.theme.closeIconBorderStyle;
130
- }, function (props) {
131
- return props.theme.closeIconBorderColor;
132
- });
133
- var _default = DxcDialog;
134
- exports["default"] = _default;