@telus-uds/components-web 2.43.0 → 3.0.0

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 (315) hide show
  1. package/.eslintrc.cjs +26 -0
  2. package/CHANGELOG.md +21 -2
  3. package/babel.config.cjs +4 -0
  4. package/jest.config.cjs +29 -0
  5. package/lib/Badge/Badge.js +21 -29
  6. package/lib/Badge/index.js +2 -10
  7. package/lib/BlockQuote/BlockQuote.js +31 -39
  8. package/lib/BlockQuote/index.js +2 -10
  9. package/lib/Breadcrumbs/Breadcrumbs.js +39 -49
  10. package/lib/Breadcrumbs/Item/Item.js +26 -34
  11. package/lib/Breadcrumbs/index.js +1 -13
  12. package/lib/Callout/Callout.js +19 -27
  13. package/lib/Callout/index.js +2 -10
  14. package/lib/Card/Card.js +44 -54
  15. package/lib/Card/CardContent.js +17 -25
  16. package/lib/Card/CardFooter.js +16 -24
  17. package/lib/Card/index.js +2 -10
  18. package/lib/Countdown/Countdown.js +34 -42
  19. package/lib/Countdown/Segment.js +26 -34
  20. package/lib/Countdown/constants.js +4 -14
  21. package/lib/Countdown/dictionary.js +2 -9
  22. package/lib/Countdown/index.js +2 -10
  23. package/lib/Countdown/types.js +18 -28
  24. package/lib/Countdown/useCountdown.js +4 -11
  25. package/lib/DatePicker/CalendarContainer.js +6 -12
  26. package/lib/DatePicker/DatePicker.js +105 -101
  27. package/lib/DatePicker/dictionary.js +1 -8
  28. package/lib/DatePicker/index.js +2 -10
  29. package/lib/DatePicker/reactDatesCss.js +3 -10
  30. package/lib/Disclaimer/Disclaimer.js +15 -23
  31. package/lib/Disclaimer/index.js +1 -13
  32. package/lib/ExpandCollapseMini/ExpandCollapseMini.js +16 -24
  33. package/lib/ExpandCollapseMini/ExpandCollapseMiniControl.js +17 -26
  34. package/lib/ExpandCollapseMini/index.js +2 -10
  35. package/lib/Footnote/Footnote.js +85 -95
  36. package/lib/Footnote/FootnoteLink.js +25 -33
  37. package/lib/Footnote/dictionary.js +2 -9
  38. package/lib/Footnote/index.js +4 -12
  39. package/lib/IconButton/IconButton.js +12 -20
  40. package/lib/IconButton/index.js +2 -10
  41. package/lib/Image/Image.js +17 -25
  42. package/lib/Image/index.js +6 -18
  43. package/lib/Image/server.js +4 -12
  44. package/lib/List/List.js +2 -9
  45. package/lib/List/ListItem.js +10 -18
  46. package/lib/List/index.js +4 -12
  47. package/lib/NavigationBar/NavigationBar.js +51 -59
  48. package/lib/NavigationBar/NavigationItem.js +19 -27
  49. package/lib/NavigationBar/NavigationSubMenu.js +34 -40
  50. package/lib/NavigationBar/collapseItems.js +1 -11
  51. package/lib/NavigationBar/index.js +4 -12
  52. package/lib/NavigationBar/resolveItemSelection.js +1 -8
  53. package/lib/OptimizeImage/OptimizeImage.js +26 -34
  54. package/lib/OptimizeImage/index.js +2 -10
  55. package/lib/OptimizeImage/utils/getFallbackUrl.js +3 -10
  56. package/lib/OptimizeImage/utils/getImageUrls.js +9 -16
  57. package/lib/OptimizeImage/utils/getOptimizedUrl.js +3 -10
  58. package/lib/OptimizeImage/utils/hasWebpSupport.js +1 -7
  59. package/lib/OptimizeImage/utils/index.js +5 -34
  60. package/lib/OptimizeImage/utils/isSvgUrl.js +1 -7
  61. package/lib/OrderedList/Item.js +28 -36
  62. package/lib/OrderedList/ItemBase.js +8 -16
  63. package/lib/OrderedList/OrderedList.js +22 -30
  64. package/lib/OrderedList/OrderedListBase.js +12 -20
  65. package/lib/OrderedList/constants.js +1 -8
  66. package/lib/OrderedList/index.js +4 -12
  67. package/lib/Paragraph/Paragraph.js +22 -30
  68. package/lib/Paragraph/index.js +2 -10
  69. package/lib/PreviewCard/AuthorDate.js +17 -21
  70. package/lib/PreviewCard/PreviewCard.js +40 -49
  71. package/lib/PreviewCard/index.js +2 -10
  72. package/lib/PriceLockup/PriceLockup.js +56 -64
  73. package/lib/PriceLockup/index.js +2 -10
  74. package/lib/PriceLockup/tokens.js +2 -9
  75. package/lib/Progress/ProgressBar.js +17 -24
  76. package/lib/Progress/index.js +4 -12
  77. package/lib/QuantitySelector/QuantitySelector.js +55 -63
  78. package/lib/QuantitySelector/SideButton.js +15 -23
  79. package/lib/QuantitySelector/dictionary.js +2 -9
  80. package/lib/QuantitySelector/index.js +2 -10
  81. package/lib/QuantitySelector/styles.js +4 -13
  82. package/lib/ResponsiveImage/ResponsiveImage.js +29 -37
  83. package/lib/ResponsiveImage/index.js +2 -10
  84. package/lib/Ribbon/Ribbon.js +22 -30
  85. package/lib/Ribbon/index.js +2 -10
  86. package/lib/SkeletonProvider/SkeletonImage.js +14 -22
  87. package/lib/SkeletonProvider/SkeletonProvider.js +17 -25
  88. package/lib/SkeletonProvider/SkeletonTypography.js +14 -22
  89. package/lib/SkeletonProvider/index.js +2 -10
  90. package/lib/Span/Span.js +23 -31
  91. package/lib/Span/index.js +2 -10
  92. package/lib/Spinner/Spinner.js +43 -51
  93. package/lib/Spinner/SpinnerContent.js +21 -29
  94. package/lib/Spinner/constants.js +4 -14
  95. package/lib/Spinner/index.js +2 -10
  96. package/lib/StoryCard/StoryCard.js +40 -49
  97. package/lib/StoryCard/index.js +2 -10
  98. package/lib/Table/Body.js +7 -15
  99. package/lib/Table/Cell.js +28 -38
  100. package/lib/Table/Header.js +11 -19
  101. package/lib/Table/Row.js +8 -16
  102. package/lib/Table/SubHeading.js +10 -18
  103. package/lib/Table/Table.js +26 -35
  104. package/lib/Table/index.js +12 -20
  105. package/lib/TermsAndConditions/ExpandCollapse.js +22 -30
  106. package/lib/TermsAndConditions/TermsAndConditions.js +52 -60
  107. package/lib/TermsAndConditions/dictionary.js +2 -9
  108. package/lib/TermsAndConditions/index.js +1 -13
  109. package/lib/Testimonial/Testimonial.js +37 -45
  110. package/lib/Testimonial/index.js +2 -10
  111. package/lib/Toast/Toast.js +32 -42
  112. package/lib/Toast/index.js +2 -10
  113. package/lib/Video/ControlBar/ControlBar.js +73 -81
  114. package/lib/Video/ControlBar/Controls/VideoButton/VideoButton.js +16 -24
  115. package/lib/Video/ControlBar/Controls/VideoMenu/VideoMenu.js +27 -35
  116. package/lib/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.js +27 -36
  117. package/lib/Video/ControlBar/Controls/VolumeSlider/VolumeSlider.js +30 -38
  118. package/lib/Video/MiddleControlButton/MiddleControlButton.js +16 -24
  119. package/lib/Video/Video.js +74 -83
  120. package/lib/Video/index.js +2 -10
  121. package/lib/Video/videoText.js +1 -8
  122. package/lib/VideoPicker/VideoPicker.js +43 -53
  123. package/lib/VideoPicker/VideoPickerPlayer.js +17 -25
  124. package/lib/VideoPicker/VideoPickerThumbnail.js +38 -46
  125. package/lib/VideoPicker/VideoSlider.js +17 -26
  126. package/lib/VideoPicker/index.js +2 -10
  127. package/lib/VideoPicker/videoPropType.js +9 -18
  128. package/lib/WaffleGrid/WaffleGrid.js +33 -43
  129. package/lib/WaffleGrid/index.js +2 -10
  130. package/lib/WebVideo/WebVideo.js +42 -52
  131. package/lib/WebVideo/index.js +2 -10
  132. package/lib/WebVideo/utils/index.js +3 -11
  133. package/lib/baseExports.js +18 -431
  134. package/lib/index.js +38 -323
  135. package/lib/server.js +4 -12
  136. package/lib/shared/ConditionalWrapper/ConditionalWrapper.js +9 -17
  137. package/lib/shared/ConditionalWrapper/index.js +2 -10
  138. package/lib/shared/FullBleedContent/FullBleedContent.js +21 -29
  139. package/lib/shared/FullBleedContent/getFullBleedBorderRadius.js +1 -8
  140. package/lib/shared/FullBleedContent/index.js +4 -24
  141. package/lib/shared/FullBleedContent/useFullBleedContentProps.js +4 -11
  142. package/lib/shared/VideoSplash/SplashButton/SplashButton.js +19 -27
  143. package/lib/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.js +27 -35
  144. package/lib/shared/VideoSplash/VideoSplash.js +24 -32
  145. package/lib/shared/VideoSplash/helpers.js +5 -14
  146. package/lib/utils/index.js +10 -75
  147. package/lib/utils/isElementFocusable.js +1 -8
  148. package/lib/utils/logger.js +6 -15
  149. package/lib/utils/media.js +5 -11
  150. package/lib/utils/renderStructuredContent.js +8 -15
  151. package/lib/utils/ssr.js +5 -12
  152. package/lib/utils/theming/get-theme-from-server.js +2 -10
  153. package/lib/utils/theming/with-client-theme.js +9 -17
  154. package/lib/utils/theming/with-server-theme.js +11 -19
  155. package/lib/utils/transforms.js +3 -11
  156. package/lib/utils/useOverlaidPosition.js +15 -23
  157. package/lib/utils/useTypographyTheme.js +6 -13
  158. package/package.json +18 -20
  159. package/src/Card/Card.jsx +2 -2
  160. package/src/DatePicker/DatePicker.jsx +17 -4
  161. package/src/PreviewCard/AuthorDate.jsx +5 -3
  162. package/src/utils/logger.js +2 -2
  163. package/lib-module/Badge/Badge.js +0 -121
  164. package/lib-module/Badge/index.js +0 -2
  165. package/lib-module/BlockQuote/BlockQuote.js +0 -204
  166. package/lib-module/BlockQuote/index.js +0 -2
  167. package/lib-module/Breadcrumbs/Breadcrumbs.js +0 -250
  168. package/lib-module/Breadcrumbs/Item/Item.js +0 -175
  169. package/lib-module/Breadcrumbs/index.js +0 -1
  170. package/lib-module/Callout/Callout.js +0 -135
  171. package/lib-module/Callout/index.js +0 -2
  172. package/lib-module/Card/Card.js +0 -251
  173. package/lib-module/Card/CardContent.js +0 -90
  174. package/lib-module/Card/CardFooter.js +0 -78
  175. package/lib-module/Card/index.js +0 -2
  176. package/lib-module/Countdown/Countdown.js +0 -169
  177. package/lib-module/Countdown/Segment.js +0 -96
  178. package/lib-module/Countdown/constants.js +0 -4
  179. package/lib-module/Countdown/dictionary.js +0 -22
  180. package/lib-module/Countdown/index.js +0 -2
  181. package/lib-module/Countdown/types.js +0 -24
  182. package/lib-module/Countdown/useCountdown.js +0 -26
  183. package/lib-module/DatePicker/CalendarContainer.js +0 -208
  184. package/lib-module/DatePicker/DatePicker.js +0 -506
  185. package/lib-module/DatePicker/dictionary.js +0 -119
  186. package/lib-module/DatePicker/index.js +0 -2
  187. package/lib-module/DatePicker/reactDatesCss.js +0 -3
  188. package/lib-module/Disclaimer/Disclaimer.js +0 -54
  189. package/lib-module/Disclaimer/index.js +0 -1
  190. package/lib-module/ExpandCollapseMini/ExpandCollapseMini.js +0 -73
  191. package/lib-module/ExpandCollapseMini/ExpandCollapseMiniControl.js +0 -117
  192. package/lib-module/ExpandCollapseMini/index.js +0 -2
  193. package/lib-module/Footnote/Footnote.js +0 -632
  194. package/lib-module/Footnote/FootnoteLink.js +0 -118
  195. package/lib-module/Footnote/dictionary.js +0 -12
  196. package/lib-module/Footnote/index.js +0 -4
  197. package/lib-module/IconButton/IconButton.js +0 -55
  198. package/lib-module/IconButton/index.js +0 -2
  199. package/lib-module/Image/Image.js +0 -83
  200. package/lib-module/Image/index.js +0 -9
  201. package/lib-module/Image/server.js +0 -4
  202. package/lib-module/List/List.js +0 -2
  203. package/lib-module/List/ListItem.js +0 -28
  204. package/lib-module/List/index.js +0 -4
  205. package/lib-module/NavigationBar/NavigationBar.js +0 -224
  206. package/lib-module/NavigationBar/NavigationItem.js +0 -87
  207. package/lib-module/NavigationBar/NavigationSubMenu.js +0 -162
  208. package/lib-module/NavigationBar/collapseItems.js +0 -41
  209. package/lib-module/NavigationBar/index.js +0 -4
  210. package/lib-module/NavigationBar/resolveItemSelection.js +0 -16
  211. package/lib-module/OptimizeImage/OptimizeImage.js +0 -92
  212. package/lib-module/OptimizeImage/index.js +0 -2
  213. package/lib-module/OptimizeImage/utils/getFallbackUrl.js +0 -7
  214. package/lib-module/OptimizeImage/utils/getImageUrls.js +0 -12
  215. package/lib-module/OptimizeImage/utils/getOptimizedUrl.js +0 -17
  216. package/lib-module/OptimizeImage/utils/hasWebpSupport.js +0 -28
  217. package/lib-module/OptimizeImage/utils/index.js +0 -5
  218. package/lib-module/OptimizeImage/utils/isSvgUrl.js +0 -3
  219. package/lib-module/OrderedList/Item.js +0 -145
  220. package/lib-module/OrderedList/ItemBase.js +0 -27
  221. package/lib-module/OrderedList/OrderedList.js +0 -86
  222. package/lib-module/OrderedList/OrderedListBase.js +0 -45
  223. package/lib-module/OrderedList/constants.js +0 -2
  224. package/lib-module/OrderedList/index.js +0 -4
  225. package/lib-module/Paragraph/Paragraph.js +0 -90
  226. package/lib-module/Paragraph/index.js +0 -2
  227. package/lib-module/PreviewCard/AuthorDate.js +0 -57
  228. package/lib-module/PreviewCard/PreviewCard.js +0 -209
  229. package/lib-module/PreviewCard/index.js +0 -2
  230. package/lib-module/PriceLockup/PriceLockup.js +0 -335
  231. package/lib-module/PriceLockup/index.js +0 -2
  232. package/lib-module/PriceLockup/tokens.js +0 -55
  233. package/lib-module/Progress/ProgressBar.js +0 -83
  234. package/lib-module/Progress/index.js +0 -4
  235. package/lib-module/QuantitySelector/QuantitySelector.js +0 -261
  236. package/lib-module/QuantitySelector/SideButton.js +0 -70
  237. package/lib-module/QuantitySelector/dictionary.js +0 -26
  238. package/lib-module/QuantitySelector/index.js +0 -2
  239. package/lib-module/QuantitySelector/styles.js +0 -9
  240. package/lib-module/ResponsiveImage/ResponsiveImage.js +0 -95
  241. package/lib-module/ResponsiveImage/index.js +0 -2
  242. package/lib-module/Ribbon/Ribbon.js +0 -216
  243. package/lib-module/Ribbon/index.js +0 -2
  244. package/lib-module/SkeletonProvider/SkeletonImage.js +0 -39
  245. package/lib-module/SkeletonProvider/SkeletonProvider.js +0 -57
  246. package/lib-module/SkeletonProvider/SkeletonTypography.js +0 -38
  247. package/lib-module/SkeletonProvider/index.js +0 -2
  248. package/lib-module/Span/Span.js +0 -72
  249. package/lib-module/Span/index.js +0 -2
  250. package/lib-module/Spinner/Spinner.js +0 -215
  251. package/lib-module/Spinner/SpinnerContent.js +0 -94
  252. package/lib-module/Spinner/constants.js +0 -4
  253. package/lib-module/Spinner/index.js +0 -2
  254. package/lib-module/StoryCard/StoryCard.js +0 -212
  255. package/lib-module/StoryCard/index.js +0 -2
  256. package/lib-module/Table/Body.js +0 -17
  257. package/lib-module/Table/Cell.js +0 -176
  258. package/lib-module/Table/Header.js +0 -25
  259. package/lib-module/Table/Row.js +0 -19
  260. package/lib-module/Table/SubHeading.js +0 -23
  261. package/lib-module/Table/Table.js +0 -114
  262. package/lib-module/Table/index.js +0 -12
  263. package/lib-module/TermsAndConditions/ExpandCollapse.js +0 -153
  264. package/lib-module/TermsAndConditions/TermsAndConditions.js +0 -277
  265. package/lib-module/TermsAndConditions/dictionary.js +0 -16
  266. package/lib-module/TermsAndConditions/index.js +0 -1
  267. package/lib-module/Testimonial/Testimonial.js +0 -234
  268. package/lib-module/Testimonial/index.js +0 -2
  269. package/lib-module/Toast/Toast.js +0 -158
  270. package/lib-module/Toast/index.js +0 -2
  271. package/lib-module/Video/ControlBar/ControlBar.js +0 -288
  272. package/lib-module/Video/ControlBar/Controls/VideoButton/VideoButton.js +0 -70
  273. package/lib-module/Video/ControlBar/Controls/VideoMenu/VideoMenu.js +0 -163
  274. package/lib-module/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.js +0 -203
  275. package/lib-module/Video/ControlBar/Controls/VolumeSlider/VolumeSlider.js +0 -191
  276. package/lib-module/Video/MiddleControlButton/MiddleControlButton.js +0 -71
  277. package/lib-module/Video/Video.js +0 -959
  278. package/lib-module/Video/index.js +0 -2
  279. package/lib-module/Video/videoText.js +0 -55
  280. package/lib-module/VideoPicker/VideoPicker.js +0 -190
  281. package/lib-module/VideoPicker/VideoPickerPlayer.js +0 -48
  282. package/lib-module/VideoPicker/VideoPickerThumbnail.js +0 -218
  283. package/lib-module/VideoPicker/VideoSlider.js +0 -82
  284. package/lib-module/VideoPicker/index.js +0 -2
  285. package/lib-module/VideoPicker/videoPropType.js +0 -10
  286. package/lib-module/WaffleGrid/WaffleGrid.js +0 -157
  287. package/lib-module/WaffleGrid/index.js +0 -2
  288. package/lib-module/WebVideo/WebVideo.js +0 -191
  289. package/lib-module/WebVideo/index.js +0 -2
  290. package/lib-module/WebVideo/utils/index.js +0 -50
  291. package/lib-module/baseExports.js +0 -19
  292. package/lib-module/index.js +0 -40
  293. package/lib-module/server.js +0 -5
  294. package/lib-module/shared/ConditionalWrapper/ConditionalWrapper.js +0 -22
  295. package/lib-module/shared/ConditionalWrapper/index.js +0 -2
  296. package/lib-module/shared/FullBleedContent/FullBleedContent.js +0 -101
  297. package/lib-module/shared/FullBleedContent/getFullBleedBorderRadius.js +0 -55
  298. package/lib-module/shared/FullBleedContent/index.js +0 -4
  299. package/lib-module/shared/FullBleedContent/useFullBleedContentProps.js +0 -55
  300. package/lib-module/shared/VideoSplash/SplashButton/SplashButton.js +0 -84
  301. package/lib-module/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.js +0 -223
  302. package/lib-module/shared/VideoSplash/VideoSplash.js +0 -65
  303. package/lib-module/shared/VideoSplash/helpers.js +0 -23
  304. package/lib-module/utils/index.js +0 -10
  305. package/lib-module/utils/isElementFocusable.js +0 -8
  306. package/lib-module/utils/logger.js +0 -18
  307. package/lib-module/utils/media.js +0 -39
  308. package/lib-module/utils/renderStructuredContent.js +0 -66
  309. package/lib-module/utils/ssr.js +0 -37
  310. package/lib-module/utils/theming/get-theme-from-server.js +0 -16
  311. package/lib-module/utils/theming/with-client-theme.js +0 -24
  312. package/lib-module/utils/theming/with-server-theme.js +0 -26
  313. package/lib-module/utils/transforms.js +0 -4
  314. package/lib-module/utils/useOverlaidPosition.js +0 -216
  315. package/lib-module/utils/useTypographyTheme.js +0 -24
@@ -1,506 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import styled from 'styled-components';
4
- import momentPropTypes from 'react-moment-proptypes';
5
- import 'react-dates/initialize';
6
- import SingleDatePicker from 'react-dates/lib/components/SingleDatePicker';
7
- import DayPickerSingleDateController from 'react-dates/lib/components/DayPickerSingleDateController';
8
- import { IconButton, TextInput, Portal, selectSystemProps, useCopy, useViewport, useThemeTokens, applyTextStyles, getTokensPropType, useSafeLayoutEffect } from '@telus-uds/components-base';
9
- import moment from 'moment';
10
- import { isUndefined, throttle } from 'lodash';
11
- import CalendarContainer from './CalendarContainer';
12
- import dictionary from './dictionary';
13
- import { htmlAttrs } from '../utils';
14
- import { jsx as _jsx } from "react/jsx-runtime";
15
- import { jsxs as _jsxs } from "react/jsx-runtime";
16
- import { Fragment as _Fragment } from "react/jsx-runtime";
17
- const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
18
- const dateFormat = 'DD / MM / YYYY';
19
- const dateFormatWithoutSpaces = 'DD/MM/YYYY';
20
- const getResponsiveDaySize = function () {
21
- let inline = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
22
- let viewport = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'md';
23
- if (viewport === 'xs') {
24
- return inline ? undefined : 36;
25
- }
26
- return inline ? 60 : 44;
27
- };
28
- const getResponsiveCircleSize = function () {
29
- let inline = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
30
- let viewport = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'md';
31
- if (viewport === 'xs') {
32
- return 26;
33
- }
34
- return inline ? 44 : 26;
35
- };
36
- const MonthCenterContainer = /*#__PURE__*/styled.div.withConfig({
37
- displayName: "DatePicker__MonthCenterContainer",
38
- componentId: "components-web__sc-mz8fi3-0"
39
- })({
40
- display: 'flex',
41
- justifyContent: 'center'
42
- });
43
- const DateInputWrapper = /*#__PURE__*/styled.div.withConfig({
44
- displayName: "DatePicker__DateInputWrapper",
45
- componentId: "components-web__sc-mz8fi3-1"
46
- })({
47
- display: 'flex',
48
- flexDirection: 'column'
49
- });
50
- const PortalPositionedContainer = /*#__PURE__*/styled.div.withConfig({
51
- displayName: "DatePicker__PortalPositionedContainer",
52
- componentId: "components-web__sc-mz8fi3-2"
53
- })({
54
- position: 'absolute',
55
- left: _ref => {
56
- let {
57
- left
58
- } = _ref;
59
- return `${left}px`;
60
- },
61
- top: _ref2 => {
62
- let {
63
- top
64
- } = _ref2;
65
- return `${top}px`;
66
- }
67
- });
68
- const validDatePattern = /^([0-2][0-9]|3[0-1])(\/)(0[1-9]|1[0-2])\2(\d{4})$/;
69
-
70
- /**
71
- * Use DatePicker to select a date on a calendar.
72
- *
73
- * ## Usage Criteria
74
- *
75
- * - Use DatePicker to select a date on a calendar
76
- * - Available in 2 formats: Overlay and Inline
77
- *
78
- * ### Overlay DatePicker
79
- * - Use Overlay to display in a modal container
80
- * - Use Overlay whenever possible as it is the most accessible solution; the input form field is type-accessible and optimized for mobile customers
81
- * - Includes an input form field to allow manual key-in of dates
82
- * - Opens the modal when the input form field receives focus
83
- * - Width expands 100% until max-width of 340px
84
- *
85
- * ### Inline DatePicker
86
- * - Use Inline to display the DatePicker in a larger vieweable area; allows the customer to quickly and easily date availability
87
- * - Does not include an input form field
88
- * - Optimized for keyboard interaction and tablet touch
89
- * - Recommended for viewports greater than or equal to 576px
90
- */
91
- const DatePicker = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
92
- var _dictionary$copy;
93
- let {
94
- copy = 'en',
95
- id,
96
- date,
97
- feedback,
98
- inline = false,
99
- isDayDisabled,
100
- label,
101
- onDateChange = () => {},
102
- hint,
103
- hintPosition = 'inline',
104
- tooltip,
105
- tokens,
106
- variant = {},
107
- validation,
108
- disabled = false,
109
- prevTestID = '',
110
- nextTestID = '',
111
- placeholder = 'DD / MM / YYYY',
112
- ...rest
113
- } = _ref3;
114
- const [inputDate, setInputDate] = React.useState(date instanceof moment ? date : undefined);
115
- const [inputText, setInputText] = React.useState(date instanceof moment ? date.format(dateFormat) : '');
116
- const textInputRef = React.useRef();
117
- const prevButtonRef = React.useRef();
118
- const [datePickerPosition, setDatePickerPosition] = React.useState({
119
- left: 0,
120
- top: 0
121
- });
122
- const datePickerRef = React.useRef(null);
123
- useSafeLayoutEffect(() => {
124
- const updateDatePickerPosition = () => {
125
- if (inline || !(textInputRef !== null && textInputRef !== void 0 && textInputRef.current)) return;
126
- const {
127
- left,
128
- top
129
- } = textInputRef.current.getBoundingClientRect();
130
- const inputTop = top + window.scrollY;
131
- const inputLeft = left + window.scrollX;
132
- setDatePickerPosition({
133
- top: inputTop + textInputRef.current.offsetHeight,
134
- left: inputLeft
135
- });
136
- };
137
- const throttledUpdate = throttle(updateDatePickerPosition, 100, {
138
- leading: false
139
- });
140
-
141
- // Initial call to set the position
142
- updateDatePickerPosition();
143
-
144
- // Register event listeners
145
- window.addEventListener('resize', throttledUpdate);
146
- window.addEventListener('scroll', updateDatePickerPosition, {
147
- capture: true
148
- });
149
- return () => {
150
- window.removeEventListener('resize', throttledUpdate);
151
- window.removeEventListener('scroll', updateDatePickerPosition, {
152
- capture: true
153
- });
154
- };
155
- }, []);
156
- const [isFocused, setIsFocused] = React.useState(false);
157
- const [isClickedInside, setIsClickedInside] = React.useState(false);
158
- const getCopy = useCopy({
159
- dictionary,
160
- copy
161
- });
162
- React.useEffect(() => {
163
- /**
164
- * `date` could be passed as `null` to reset the value so explicitly
165
- * checking for not being `undefined`
166
- */
167
- if (!isUndefined(date) && !moment(date).isSame(inputDate)) {
168
- setInputDate(date);
169
- setInputText(date instanceof moment ? date.format(dateFormat) : '');
170
- }
171
- }, [date, inputDate]);
172
- React.useEffect(() => {
173
- let timeoutId;
174
- if (prevButtonRef.current && isFocused) {
175
- timeoutId = setTimeout(() => prevButtonRef.current.focus(), 100);
176
- }
177
- return () => clearTimeout(timeoutId);
178
- }, [isFocused]);
179
- React.useEffect(() => {
180
- if (inputText !== '' && inputDate !== undefined) {
181
- var _textInputRef$current;
182
- textInputRef === null || textInputRef === void 0 ? void 0 : (_textInputRef$current = textInputRef.current) === null || _textInputRef$current === void 0 ? void 0 : _textInputRef$current.focus();
183
- }
184
- }, [inputDate, inputText]);
185
- const onFocusChange = _ref4 => {
186
- let {
187
- focused
188
- } = _ref4;
189
- if (!isClickedInside) {
190
- setIsFocused(focused);
191
- }
192
- setIsClickedInside(false);
193
- };
194
- const handleFocus = event => {
195
- if (event.target.tagName === 'INPUT' && !disabled && inputDate === undefined && inputText === '') {
196
- setIsFocused(true);
197
- }
198
- };
199
- const handleMouseDown = event => {
200
- if (!disabled) {
201
- if (event.target.tagName === 'INPUT') {
202
- setIsClickedInside(true);
203
- setIsFocused(true);
204
- } else if (event.target.tagName === 'path') {
205
- // needed to handle the case where the user clicks on the tooltip icon
206
- setIsClickedInside(true);
207
- event.stopPropagation();
208
- } else {
209
- event.stopPropagation();
210
- }
211
- }
212
- };
213
- const onChange = value => {
214
- setInputDate(value);
215
- setInputText(value.format(dateFormat));
216
- setIsFocused(false);
217
- if (onDateChange) onDateChange(value);
218
- };
219
- const onChangeInput = value => {
220
- if (value === '' || moment(value.replace(/\s/g, ''), dateFormatWithoutSpaces, true).isValid()) {
221
- if (value === '') {
222
- setInputDate(undefined); // Set inputDate to undefined if input is empty
223
- onDateChange === null || onDateChange === void 0 ? void 0 : onDateChange(undefined);
224
- } else {
225
- setInputDate(moment(value, dateFormat));
226
- onDateChange === null || onDateChange === void 0 ? void 0 : onDateChange(moment(value, dateFormat));
227
- }
228
- setInputText(value === '' ? '' : moment(value, dateFormatWithoutSpaces).format(dateFormat));
229
- } else {
230
- setInputText(value);
231
- }
232
- };
233
- const handleOnKeyPress = event => {
234
- if (event.key === 'Backspace' && inputText === '') {
235
- setInputDate(undefined);
236
- onDateChange === null || onDateChange === void 0 ? void 0 : onDateChange(undefined);
237
- }
238
- };
239
- const handleValidation = inputValidation => {
240
- if (validDatePattern.test(inputText.replace(/\s+/g, '')) === false && inputText !== '') {
241
- return 'error';
242
- }
243
- if (inputValidation === 'error' || inputValidation === 'success') {
244
- return inputValidation;
245
- }
246
- return inputValidation;
247
- };
248
- const viewport = useViewport();
249
- const daySize = getResponsiveDaySize(inline, viewport);
250
- const circleSize = getResponsiveCircleSize(inline, viewport);
251
- const HiddenInputFieldContainer = /*#__PURE__*/styled.div.withConfig({
252
- displayName: "DatePicker__HiddenInputFieldContainer",
253
- componentId: "components-web__sc-mz8fi3-3"
254
- })(["height:", ";width:", ";overflow:hidden;"], props => props.height, props => props.width);
255
- const {
256
- hiddenInputFieldContainerHeight,
257
- hiddenInputFieldContainerWidth,
258
- previousIcon,
259
- nextIcon,
260
- ...remainingTokens
261
- } = useThemeTokens('DatePicker', tokens, {
262
- ...variant,
263
- inline
264
- }, {
265
- viewport
266
- });
267
- const defaultFontTokens = applyTextStyles({
268
- fontName: remainingTokens.calendarDayDefaultFontName,
269
- fontWeight: remainingTokens.calendarDayDefaultFontWeight
270
- });
271
- const calendarMonthFontTokens = applyTextStyles({
272
- fontName: remainingTokens.calendarMonthCaptionFontName,
273
- fontWeight: remainingTokens.calendarMonthCaptionFontWeight
274
- });
275
- const calendarWeekFontTokens = applyTextStyles({
276
- fontName: remainingTokens.dayPickerWeekHeaderFontName,
277
- fontWeight: remainingTokens.dayPickerWeekHeaderFontWeight
278
- });
279
- const renderPrevButton = _ref5 => {
280
- let {
281
- onClick
282
- } = _ref5;
283
- return /*#__PURE__*/_jsx(IconButton, {
284
- onPress: () => {
285
- onClick();
286
- },
287
- icon: previousIcon,
288
- variant: {
289
- size: 'small'
290
- },
291
- testID: prevTestID,
292
- ref: prevButtonRef
293
- });
294
- };
295
- const renderNextButton = _ref6 => {
296
- let {
297
- onClick
298
- } = _ref6;
299
- return /*#__PURE__*/_jsx(IconButton, {
300
- onPress: () => {
301
- onClick();
302
- },
303
- icon: nextIcon,
304
- variant: {
305
- size: 'small'
306
- },
307
- testID: nextTestID
308
- });
309
- };
310
- return /*#__PURE__*/_jsx(_Fragment, {
311
- children: inline ? /*#__PURE__*/_jsxs(_Fragment, {
312
- children: [/*#__PURE__*/_jsx(HiddenInputFieldContainer, {
313
- height: hiddenInputFieldContainerHeight,
314
- width: hiddenInputFieldContainerWidth,
315
- children: /*#__PURE__*/_jsx("input", {
316
- ref: ref,
317
- id: id,
318
- type: "text",
319
- value: inputText,
320
- readOnly: true
321
- })
322
- }), /*#__PURE__*/_jsx(CalendarContainer, {
323
- ...selectProps(rest),
324
- daySize: daySize,
325
- validation: validation,
326
- remainingTokens: remainingTokens,
327
- calendarDayDefaultHeight: circleSize,
328
- calendarDayDefaultWidth: circleSize,
329
- calendarMonthFontTokens: calendarMonthFontTokens,
330
- calendarWeekFontTokens: calendarWeekFontTokens,
331
- defaultFontTokens: defaultFontTokens,
332
- children: /*#__PURE__*/_jsx(DayPickerSingleDateController, {
333
- date: inputDate,
334
- onDateChange: onChange,
335
- focused: inputDate ?? isFocused,
336
- onFocusChange: onFocusChange,
337
- numberOfMonths: 1,
338
- hideKeyboardShortcutsPanel: true,
339
- keepOpenOnDateSelect: false,
340
- daySize: daySize,
341
- renderNavPrevButton: renderPrevButton,
342
- renderNavNextButton: renderNextButton,
343
- isOutsideRange: isDayDisabled,
344
- phrases: getCopy(),
345
- renderMonthElement: _ref7 => {
346
- let {
347
- month
348
- } = _ref7;
349
- return /*#__PURE__*/_jsx(MonthCenterContainer, {
350
- children: /*#__PURE__*/_jsxs("div", {
351
- children: [dictionary[copy] ? dictionary[copy].months[month.month()] : month.format('MMMM'), ' ', month.year()]
352
- })
353
- });
354
- },
355
- renderWeekHeaderElement: day => /*#__PURE__*/_jsx("div", {
356
- children: dictionary[copy] ? dictionary[copy].weekDays[day] : day
357
- })
358
- })
359
- })]
360
- }) : /*#__PURE__*/_jsx(DateInputWrapper, {
361
- onMouseDown: handleMouseDown,
362
- onFocus: handleFocus,
363
- children: /*#__PURE__*/_jsx(TextInput, {
364
- copy: copy,
365
- feedback: feedback,
366
- hint: hint,
367
- placeholder: placeholder,
368
- onChange: onChangeInput,
369
- onKeyPress: handleOnKeyPress,
370
- tooltip: tooltip,
371
- hintPosition: hintPosition,
372
- label: label ?? ((_dictionary$copy = dictionary[copy]) === null || _dictionary$copy === void 0 ? void 0 : _dictionary$copy.roleDescription),
373
- value: inputText,
374
- validation: handleValidation(validation),
375
- inactive: disabled,
376
- ref: textInputRef,
377
- children: /*#__PURE__*/_jsx(Portal, {
378
- children: /*#__PURE__*/_jsx(PortalPositionedContainer, {
379
- top: datePickerPosition.top,
380
- left: datePickerPosition.left,
381
- ref: datePickerRef,
382
- children: /*#__PURE__*/_jsx(CalendarContainer, {
383
- ...selectProps(rest),
384
- daySize: daySize,
385
- validation: validation,
386
- remainingTokens: remainingTokens,
387
- calendarDayDefaultHeight: circleSize,
388
- calendarDayDefaultWidth: circleSize,
389
- calendarMonthFontTokens: calendarMonthFontTokens,
390
- calendarWeekFontTokens: calendarWeekFontTokens,
391
- defaultFontTokens: defaultFontTokens,
392
- children: /*#__PURE__*/_jsx(SingleDatePicker, {
393
- date: inputDate,
394
- disabled: disabled,
395
- onDateChange: onChange,
396
- focused: isFocused,
397
- onFocusChange: onFocusChange,
398
- numberOfMonths: 1,
399
- hideKeyboardShortcutsPanel: true,
400
- keepOpenOnDateSelect: true,
401
- daySize: daySize,
402
- ref: ref,
403
- renderNavPrevButton: renderPrevButton,
404
- isOutsideRange: isDayDisabled,
405
- phrases: getCopy(),
406
- id: id,
407
- renderNavNextButton: renderNextButton,
408
- renderMonthElement: _ref8 => {
409
- let {
410
- month
411
- } = _ref8;
412
- return /*#__PURE__*/_jsx(MonthCenterContainer, {
413
- children: /*#__PURE__*/_jsxs("div", {
414
- children: [dictionary[copy] ? dictionary[copy].months[month.month()] : month.format('MMMM'), ' ', month.year()]
415
- })
416
- });
417
- },
418
- renderWeekHeaderElement: day => /*#__PURE__*/_jsx("div", {
419
- children: dictionary[copy] ? dictionary[copy].weekDays[day] : day
420
- })
421
- })
422
- })
423
- })
424
- })
425
- })
426
- })
427
- });
428
- });
429
- DatePicker.displayName = 'DatePicker';
430
- DatePicker.propTypes = {
431
- ...selectedSystemPropTypes,
432
- tokens: getTokensPropType('DatePicker'),
433
- /**
434
- * A unique identifier.
435
- */
436
- id: PropTypes.string.isRequired,
437
- /**
438
- * Whether the English or French copy will be used (e.g. for accessibility labels).
439
- */
440
- copy: PropTypes.oneOf(['en', 'fr']),
441
- /**
442
- * A Moment instance representing the currently selected date, i.e. `moment()`
443
- */
444
- date: momentPropTypes.momentObj,
445
- /**
446
- * A detailed description of validation error/success or additional instructions.
447
- * Visual variant is determined based on the `validation` prop.
448
- */
449
- feedback: PropTypes.string,
450
- /**
451
- * Event triggered every time a new date is clicked on
452
- * @param {Moment} date The new date that was selected
453
- */
454
- onDateChange: PropTypes.func,
455
- /**
456
- * A function determining whether a given date should be disabled
457
- * @param {Moment} date The date to optionally disable
458
- * @returns {bool}
459
- */
460
- isDayDisabled: PropTypes.func,
461
- /**
462
- * The field label to be displayed above the calendar
463
- */
464
- label: PropTypes.string,
465
- /**
466
- * A flag determining if the calendar picker is standalone or an input with overlay
467
- */
468
- inline: PropTypes.bool,
469
- /**
470
- * A short description of the expected input.
471
- */
472
- hint: PropTypes.string,
473
- /**
474
- * Position of the hint relative to label. Use `below` to display a larger hint below the label.
475
- */
476
- hintPosition: PropTypes.oneOf(['inline', 'below']),
477
- /**
478
- * Content of an optional `Tooltip`. If set, a tooltip button will be shown next to the label.
479
- */
480
- tooltip: PropTypes.string,
481
- /**
482
- * Use to visually mark an input as valid or invalid.
483
- */
484
- validation: PropTypes.oneOf(['error', 'success']),
485
- /**
486
- * Disable the input which will not open the calendar picker
487
- */
488
- disabled: PropTypes.bool,
489
- /**
490
- * A unique identifier for the previous icon button located on the datepicker.
491
- * This is for automation testing purposes.
492
- * Will be added as a `data-testid-prev` attribute for example.
493
- */
494
- prevTestID: PropTypes.string,
495
- /**
496
- * A unique identifier for the next icon button located on the datepicker.
497
- * This is for automation testing purposes.
498
- * Will be added as a `data-testid-next` attribute for example.
499
- */
500
- nextTestID: PropTypes.string,
501
- /**
502
- * Optional placeholder for the date input. If not set the default value will be `DD / MM / YYYY`
503
- */
504
- placeholder: PropTypes.string
505
- };
506
- export default DatePicker;
@@ -1,119 +0,0 @@
1
- // from https://github.com/airbnb/react-dates/blob/master/src/defaultPhrases.js
2
- const calendarLabel = 'Calendrier';
3
- const roleDescription = 'Sélecteur de date';
4
- const closeDatePicker = 'Fermer ';
5
- const clearDate = 'Supprimer la date';
6
- const jumpToPrevMonth = 'Reculer pour passer au mois précédent.';
7
- const jumpToNextMonth = 'Avancer pour passer au mois suivant.';
8
- const keyboardShortcuts = 'Raccourcis clavier ';
9
- const showKeyboardShortcutsPanel = 'Ouvrir le panneau de raccourcis clavier.';
10
- const hideKeyboardShortcutsPanel = 'Fermez le panneau de raccourcis.';
11
- const openThisPanel = 'Ouvrir le panneau. ';
12
- const enterKey = 'Touche Entrée ';
13
- const leftArrowRightArrow = 'Touches de direction droite et gauche';
14
- const upArrowDownArrow = 'Touches de direction haut et bas';
15
- const pageUpPageDown = 'Touches Page précédente et Page suivante';
16
- const homeEnd = 'Touches Accueil et Fin';
17
- const escape = 'Touche Échap.';
18
- const questionMark = `Point d'interrogation`;
19
- const selectFocusedDate = 'Sélectionner la date mise au point.';
20
- const moveFocusByOneDay = `Reculer (à gauche) et avancer (à droite) d'un jour.`;
21
- const moveFocusByOneWeek = `Reculer (vers le haut) et avancer (vers le bas) d'une semaine.`;
22
- const moveFocusByOneMonth = 'Changer de mois.';
23
- const moveFocustoStartAndEndOfWeek = 'Aller au premier ou au dernier jour de la semaine.';
24
- const returnFocusToInput = 'Revenir au champ de saisie de la date.';
25
- const keyboardForwardNavigationInstructions = `Naviguer vers l'avant pour interagir avec le calendrier et sélectionner une date. Appuyer sur la touche Point d'interrogation pour obtenir les raccourcis clavier permettant de modifier les dates.`;
26
- const keyboardBackwardNavigationInstructions = `Naviguer en arrière pour interagir avec le calendrier et sélectionner une date. Appuyer sur la touche Point d'interrogation pour obtenir les raccourcis clavier permettant de modifier les dates.`;
27
- const months = ['Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Julliet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre'];
28
- const weekDays = {
29
- Su: 'Dim',
30
- Mo: 'Lun',
31
- Tu: 'Mar',
32
- We: 'Mer',
33
- Th: 'Jeu',
34
- Fr: 'Ven',
35
- Sa: 'Sam'
36
- };
37
- const chooseAvailableStartDate = _ref => {
38
- let {
39
- date
40
- } = _ref;
41
- return `Choisir ${date}. Disponible.`;
42
- };
43
- const chooseAvailableEndDate = _ref2 => {
44
- let {
45
- date
46
- } = _ref2;
47
- return `Non disponible. ${date}`;
48
- };
49
- const chooseAvailableDate = _ref3 => {
50
- let {
51
- date
52
- } = _ref3;
53
- return date;
54
- };
55
- const dateIsUnavailable = _ref4 => {
56
- let {
57
- date
58
- } = _ref4;
59
- return `Not available. ${date}`;
60
- };
61
- const dateIsSelected = _ref5 => {
62
- let {
63
- date
64
- } = _ref5;
65
- return `Choisie. ${date}`;
66
- };
67
- const dateIsSelectedAsStartDate = _ref6 => {
68
- let {
69
- date
70
- } = _ref6;
71
- return `Choisie comme date de début. ${date}`;
72
- };
73
- const dateIsSelectedAsEndDate = _ref7 => {
74
- let {
75
- date
76
- } = _ref7;
77
- return `Choisie comme date de fin. ${date}`;
78
- };
79
- const dictionary = {
80
- en: undefined,
81
- // uses react-dates defaults
82
- fr: {
83
- calendarLabel,
84
- roleDescription,
85
- jumpToPrevMonth,
86
- jumpToNextMonth,
87
- keyboardShortcuts,
88
- showKeyboardShortcutsPanel,
89
- hideKeyboardShortcutsPanel,
90
- openThisPanel,
91
- enterKey,
92
- leftArrowRightArrow,
93
- upArrowDownArrow,
94
- pageUpPageDown,
95
- homeEnd,
96
- escape,
97
- questionMark,
98
- selectFocusedDate,
99
- moveFocusByOneDay,
100
- moveFocusByOneWeek,
101
- moveFocusByOneMonth,
102
- moveFocustoStartAndEndOfWeek,
103
- returnFocusToInput,
104
- months,
105
- weekDays,
106
- chooseAvailableStartDate,
107
- chooseAvailableEndDate,
108
- chooseAvailableDate,
109
- dateIsUnavailable,
110
- dateIsSelected,
111
- dateIsSelectedAsStartDate,
112
- dateIsSelectedAsEndDate,
113
- closeDatePicker,
114
- clearDate,
115
- keyboardForwardNavigationInstructions,
116
- keyboardBackwardNavigationInstructions
117
- }
118
- };
119
- export default dictionary;
@@ -1,2 +0,0 @@
1
- import DatePicker from './DatePicker';
2
- export default DatePicker;
@@ -1,3 +0,0 @@
1
- import { css } from 'styled-components';
2
- const defaultReactDatesCss = /*#__PURE__*/css([".PresetDateRangePicker_panel{padding:0 22px 11px;}.PresetDateRangePicker_button{position:relative;height:100%;text-align:center;background:0 0;border:2px solid #00a699;color:#00a699;padding:4px 12px;margin-right:8px;font:inherit;font-weight:700;line-height:normal;overflow:visible;-moz-box-sizing:border-box;box-sizing:border-box;cursor:pointer;}.PresetDateRangePicker_button:active{outline:0;}.PresetDateRangePicker_button__selected{color:#fff;background:#00a699;}.SingleDatePickerInput{display:inline-block;background-color:#fff;position:absolute;top:-55px;}.SingleDatePickerInput__disabled{background-color:#f2f2f2;}.SingleDatePickerInput__block{display:block;}.SingleDatePickerInput__showClearDate{padding-right:30px;}.SingleDatePickerInput_clearDate{background:0 0;border:0;color:inherit;font:inherit;line-height:normal;overflow:visible;cursor:pointer;padding:10px;margin:0 10px 0 5px;position:absolute;right:0;top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);}.SingleDatePickerInput_clearDate__default:focus,.SingleDatePickerInput_clearDate__default:hover{background:#dbdbdb;border-radius:50%;}.SingleDatePickerInput_clearDate__small{padding:6px;}.SingleDatePickerInput_clearDate__hide{visibility:hidden;}.SingleDatePickerInput_clearDate_svg{fill:#82888a;height:12px;width:15px;vertical-align:middle;}.SingleDatePickerInput_clearDate_svg__small{height:9px;}.SingleDatePickerInput_calendarIcon{background:0 0;border:0;color:inherit;font:inherit;line-height:normal;overflow:visible;cursor:pointer;display:inline-block;vertical-align:middle;padding:10px;margin:0 5px 0 10px;}.SingleDatePickerInput_calendarIcon_svg{fill:#82888a;height:15px;width:14px;vertical-align:middle;}.SingleDatePicker{position:relative;display:inline-block;}.SingleDatePicker__block{display:block;}.SingleDatePicker_picker{z-index:1;background-color:#fff;position:absolute;}.SingleDatePicker_picker__rtl{direction:rtl;}.SingleDatePicker_picker__directionLeft{left:0;}.SingleDatePicker_picker__directionRight{right:0;}.SingleDatePicker_picker__portal{background-color:rgba(0,0,0,0.3);position:fixed;top:0;left:0;height:100%;width:100%;}.SingleDatePicker_picker__fullScreenPortal{background-color:#fff;}.SingleDatePicker_closeButton{background:0 0;border:0;color:inherit;font:inherit;line-height:normal;overflow:visible;cursor:pointer;position:absolute;top:0;right:0;padding:15px;z-index:2;}.SingleDatePicker_closeButton:focus,.SingleDatePicker_closeButton:hover{color:darken(#cacccd,10%);text-decoration:none;}.SingleDatePicker_closeButton_svg{height:15px;width:15px;fill:#cacccd;}.DayPickerKeyboardShortcuts_buttonReset{background:0 0;border:0;border-radius:0;color:inherit;font:inherit;line-height:normal;overflow:visible;padding:0;cursor:pointer;font-size:14px;}.DayPickerKeyboardShortcuts_buttonReset:active{outline:0;}.DayPickerKeyboardShortcuts_show{width:33px;height:26px;position:absolute;z-index:2;}.DayPickerKeyboardShortcuts_show::before{content:'';display:block;position:absolute;}.DayPickerKeyboardShortcuts_show__bottomRight{bottom:0;right:0;}.DayPickerKeyboardShortcuts_show__bottomRight::before{border-top:26px solid transparent;border-right:33px solid #00a699;bottom:0;right:0;}.DayPickerKeyboardShortcuts_show__bottomRight:hover::before{border-right:33px solid #008489;}.DayPickerKeyboardShortcuts_show__topRight{top:0;right:0;}.DayPickerKeyboardShortcuts_show__topRight::before{border-bottom:26px solid transparent;border-right:33px solid #00a699;top:0;right:0;}.DayPickerKeyboardShortcuts_show__topRight:hover::before{border-right:33px solid #008489;}.DayPickerKeyboardShortcuts_show__topLeft{top:0;left:0;}.DayPickerKeyboardShortcuts_show__topLeft::before{border-bottom:26px solid transparent;border-left:33px solid #00a699;top:0;left:0;}.DayPickerKeyboardShortcuts_show__topLeft:hover::before{border-left:33px solid #008489;}.DayPickerKeyboardShortcuts_showSpan{color:#fff;position:absolute;}.DayPickerKeyboardShortcuts_showSpan__bottomRight{bottom:0;right:5px;}.DayPickerKeyboardShortcuts_showSpan__topRight{top:1px;right:5px;}.DayPickerKeyboardShortcuts_showSpan__topLeft{top:1px;left:5px;}.DayPickerKeyboardShortcuts_panel{overflow:auto;background:#fff;border:1px solid #dbdbdb;border-radius:2px;position:absolute;top:0;bottom:0;right:0;left:0;z-index:2;padding:22px;margin:33px;text-align:left;}.DayPickerKeyboardShortcuts_title{font-size:16px;font-weight:700;margin:0;}.DayPickerKeyboardShortcuts_list{list-style:none;padding:0;font-size:14px;}.DayPickerKeyboardShortcuts_close{position:absolute;right:22px;top:22px;z-index:2;}.DayPickerKeyboardShortcuts_close:active{outline:0;}.DayPickerKeyboardShortcuts_closeSvg{height:15px;width:15px;fill:#cacccd;}.DayPickerKeyboardShortcuts_closeSvg:focus,.DayPickerKeyboardShortcuts_closeSvg:hover{fill:#82888a;}.CalendarDay{-moz-box-sizing:border-box;box-sizing:border-box;cursor:pointer;font-size:14px;text-align:center;}.CalendarDay:active{outline:0;}.CalendarDay__defaultCursor{cursor:default;}.CalendarDay__default{border:1px solid #e4e7e7;color:#484848;background:#fff;}.CalendarDay__default:hover{background:#e4e7e7;border:1px solid #e4e7e7;color:inherit;}.CalendarDay__hovered_offset{background:#f4f5f5;border:1px double #e4e7e7;color:inherit;}.CalendarDay__outside{border:0;background:#fff;color:#484848;}.CalendarDay__outside:hover{border:0;}.CalendarDay__blocked_minimum_nights{background:#fff;border:1px solid #eceeee;color:#cacccd;}.CalendarDay__blocked_minimum_nights:active,.CalendarDay__blocked_minimum_nights:hover{background:#fff;color:#cacccd;}.CalendarDay__highlighted_calendar{background:#ffe8bc;color:#484848;}.CalendarDay__highlighted_calendar:active,.CalendarDay__highlighted_calendar:hover{background:#ffce71;color:#484848;}.CalendarDay__selected_span{background:#66e2da;border:1px double #33dacd;color:#fff;}.CalendarDay__selected_span:active,.CalendarDay__selected_span:hover{background:#33dacd;border:1px double #33dacd;color:#fff;}.CalendarDay__selected,.CalendarDay__selected:active,.CalendarDay__selected:hover{background:#00a699;border:1px double #00a699;color:#fff;}.CalendarDay__hovered_span,.CalendarDay__hovered_span:hover{background:#b2f1ec;border:1px double #80e8e0;color:#007a87;}.CalendarDay__hovered_span:active{background:#80e8e0;border:1px double #80e8e0;color:#007a87;}.CalendarDay__blocked_calendar,.CalendarDay__blocked_calendar:active,.CalendarDay__blocked_calendar:hover{background:#cacccd;border:1px solid #cacccd;color:#82888a;}.CalendarDay__blocked_out_of_range,.CalendarDay__blocked_out_of_range:active,.CalendarDay__blocked_out_of_range:hover{background:#fff;border:1px solid #e4e7e7;color:#cacccd;}.CalendarDay__hovered_start_first_possible_end{background:#eceeee;border:1px double #eceeee;}.CalendarDay__hovered_start_blocked_min_nights{background:#eceeee;border:1px double #e4e7e7;}.CalendarMonth{background:#fff;text-align:center;vertical-align:top;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}.CalendarMonth_table{border-collapse:collapse;border-spacing:0;}.CalendarMonth_verticalSpacing{border-collapse:separate;}.CalendarMonth_caption{color:#484848;font-size:18px;text-align:center;padding-top:22px;padding-bottom:37px;caption-side:initial;}.CalendarMonth_caption__verticalScrollable{padding-top:12px;padding-bottom:7px;}.CalendarMonthGrid{background:#fff;text-align:left;z-index:0;}.CalendarMonthGrid__animating{z-index:1;}.CalendarMonthGrid__horizontal{position:absolute;left:9px;}.CalendarMonthGrid__vertical,.CalendarMonthGrid__vertical_scrollable{margin:0 auto;}.CalendarMonthGrid_month__horizontal{display:inline-block;vertical-align:top;min-height:100%;}.CalendarMonthGrid_month__hideForAnimation{position:absolute;z-index:-1;opacity:0;pointer-events:none;}.CalendarMonthGrid_month__hidden{visibility:hidden;}.DayPickerNavigation{position:relative;z-index:2;}.DayPickerNavigation__horizontal{height:0;}.DayPickerNavigation__verticalScrollable_prevNav{z-index:1;}.DayPickerNavigation__verticalDefault{position:absolute;width:100%;height:52px;bottom:0;left:0;}.DayPickerNavigation__verticalScrollableDefault{position:relative;}.DayPickerNavigation__bottom{height:auto;}.DayPickerNavigation__bottomDefault{-webkit-box-pack:justify;-ms-flex-pack:justify;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:space-between;justify-content:space-between;}.DayPickerNavigation_button{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border:0;padding:0;margin:0;}.DayPickerNavigation_button__default{border:1px solid #e4e7e7;background-color:#fff;color:#757575;}.DayPickerNavigation_button__default:focus,.DayPickerNavigation_button__default:hover{border:1px solid #c4c4c4;}.DayPickerNavigation_button__default:active{background:#f2f2f2;}.DayPickerNavigation_button__disabled{cursor:default;border:1px solid #f2f2f2;}.DayPickerNavigation_button__disabled:focus,.DayPickerNavigation_button__disabled:hover{border:1px solid #f2f2f2;}.DayPickerNavigation_button__disabled:active{background:0 0;}.DayPickerNavigation_button__horizontalDefault{position:absolute;top:18px;line-height:0.78;border-radius:3px;padding:6px 9px;}.DayPickerNavigation_bottomButton__horizontalDefault{position:static;margin:-10px 22px 30px;}.DayPickerNavigation_leftButton__horizontalDefault{left:22px;}.DayPickerNavigation_rightButton__horizontalDefault{right:22px;}.DayPickerNavigation_button__verticalDefault{padding:5px;background:#fff;box-shadow:0 0 5px 2px rgba(0,0,0,0.1);position:relative;display:inline-block;text-align:center;height:100%;width:50%;}.DayPickerNavigation_nextButton__verticalDefault{border-left:0;}.DayPickerNavigation_nextButton__verticalScrollableDefault,.DayPickerNavigation_prevButton__verticalScrollableDefault{width:100%;}.DayPickerNavigation_svg__horizontal{height:19px;width:19px;fill:#82888a;display:block;}.DayPickerNavigation_svg__vertical{height:42px;width:42px;fill:#484848;}.DayPickerNavigation_svg__disabled{fill:#f2f2f2;}.DayPicker{background:#fff;position:relative;text-align:left;}.DayPicker__horizontal{background:#fff;}.DayPicker__verticalScrollable{height:100%;}.DayPicker__hidden{visibility:hidden;}.DayPicker__withBorder{box-shadow:0 2px 6px rgba(0,0,0,0.05),0 0 0 1px rgba(0,0,0,0.07);border-radius:3px;}.DayPicker_portal__horizontal{box-shadow:none;position:absolute;left:50%;top:50%;}.DayPicker_portal__vertical{position:initial;}.DayPicker_focusRegion{outline:0;}.DayPicker_calendarInfo__horizontal,.DayPicker_wrapper__horizontal{display:inline-block;vertical-align:top;}.DayPicker_weekHeaders{position:relative;}.DayPicker_weekHeaders__horizontal{margin-left:9px;}.DayPicker_weekHeader{color:#757575;position:absolute;top:62px;z-index:2;text-align:left;}.DayPicker_weekHeader__vertical{left:50%;}.DayPicker_weekHeader__verticalScrollable{top:0;display:table-row;border-bottom:1px solid #dbdbdb;background:#fff;margin-left:0;left:0;width:100%;text-align:center;}.DayPicker_weekHeader_ul{list-style:none;margin:1px 0;padding-left:0;padding-right:0;font-size:14px;}.DayPicker_weekHeader_li{display:inline-block;text-align:center;}.DayPicker_transitionContainer{position:relative;overflow:hidden;border-radius:3px;}.DayPicker_transitionContainer__horizontal{-webkit-transition:height 0.2s ease-in-out;-moz-transition:height 0.2s ease-in-out;transition:height 0.2s ease-in-out;}.DayPicker_transitionContainer__vertical{width:100%;}.DayPicker_transitionContainer__verticalScrollable{padding-top:20px;height:100%;position:absolute;top:0;bottom:0;right:0;left:0;overflow-y:scroll;}.DateInput_input{display:none;}.DateInput_screenReaderMessage{border:0;clip:rect(0,0,0,0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;}.DateInput_fang{position:absolute;top:55px;width:20px;height:10px;left:22px;z-index:2;}.DateInput_fangShape{fill:#fff;}.DateInput_fangStroke{stroke:#dbdbdb;fill:transparent;}.DateRangePickerInput{background-color:#fff;display:inline-block;}.DateRangePickerInput__disabled{background:#f2f2f2;}.DateRangePickerInput__withBorder{border-radius:2px;border:1px solid #dbdbdb;}.DateRangePickerInput__rtl{direction:rtl;}.DateRangePickerInput__block{display:block;}.DateRangePickerInput__showClearDates{padding-right:30px;}.DateRangePickerInput_arrow{display:inline-block;vertical-align:middle;color:#484848;}.DateRangePickerInput_arrow_svg{vertical-align:middle;fill:#484848;height:24px;width:24px;}.DateRangePickerInput_clearDates{background:0 0;border:0;color:inherit;font:inherit;line-height:normal;overflow:visible;cursor:pointer;padding:10px;margin:0 10px 0 5px;position:absolute;right:0;top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);}.DateRangePickerInput_clearDates__small{padding:6px;}.DateRangePickerInput_clearDates_default:focus,.DateRangePickerInput_clearDates_default:hover{background:#dbdbdb;border-radius:50%;}.DateRangePickerInput_clearDates__hide{visibility:hidden;}.DateRangePickerInput_clearDates_svg{fill:#82888a;height:12px;width:15px;vertical-align:middle;}.DateRangePickerInput_clearDates_svg__small{height:9px;}.DateRangePickerInput_calendarIcon{background:0 0;border:0;color:inherit;font:inherit;line-height:normal;overflow:visible;cursor:pointer;display:inline-block;vertical-align:middle;padding:10px;margin:0 5px 0 10px;}.DateRangePickerInput_calendarIcon_svg{fill:#82888a;height:15px;width:14px;vertical-align:middle;}.DateRangePicker{position:relative;display:inline-block;}.DateRangePicker__block{display:block;}.DateRangePicker_picker{z-index:1;background-color:#fff;position:absolute;}.DateRangePicker_picker__rtl{direction:rtl;}.DateRangePicker_picker__directionLeft{left:0;}.DateRangePicker_picker__directionRight{right:0;}.DateRangePicker_picker__portal{background-color:rgba(0,0,0,0.3);position:fixed;top:0;left:0;height:100%;width:100%;}.DateRangePicker_picker__fullScreenPortal{background-color:#fff;}.DateRangePicker_closeButton{background:0 0;border:0;color:inherit;font:inherit;line-height:normal;overflow:visible;cursor:pointer;position:absolute;top:0;right:0;padding:15px;z-index:2;}.DateRangePicker_closeButton:focus,.DateRangePicker_closeButton:hover{color:darken(#cacccd,10%);text-decoration:none;}.DateRangePicker_closeButton_svg{height:15px;width:15px;fill:#cacccd;}"]);
3
- export default defaultReactDatesCss;