@popsure/dirty-swan 0.26.10 → 0.26.11

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 (230) hide show
  1. package/package.json +2 -1
  2. package/src/App.tsx +50 -0
  3. package/src/bin/index.ts +71 -0
  4. package/src/bin/tsconfig.json +13 -0
  5. package/src/bin/util/index.test.ts +85 -0
  6. package/src/bin/util/index.ts +132 -0
  7. package/src/bin/util/test/data.json +13 -0
  8. package/src/colors.scss +1 -0
  9. package/src/font-weight.scss +1 -0
  10. package/src/grid.scss +1 -0
  11. package/src/index.tsx +37 -0
  12. package/src/intro.stories.mdx +41 -0
  13. package/src/lib/components/autocompleteAddress/demo.tsx +38 -0
  14. package/src/lib/components/autocompleteAddress/index.stories.mdx +44 -0
  15. package/src/lib/components/autocompleteAddress/index.tsx +316 -0
  16. package/src/lib/components/autocompleteAddress/mapStyle.ts +187 -0
  17. package/src/lib/components/autocompleteAddress/style.module.scss +82 -0
  18. package/src/lib/components/autocompleteAddress/util/index.test.ts +51 -0
  19. package/src/lib/components/autocompleteAddress/util/index.ts +55 -0
  20. package/src/lib/components/button/icons/index.ts +14 -0
  21. package/src/lib/components/button/icons/send-purple.svg +4 -0
  22. package/src/lib/components/button/icons/send-white.svg +4 -0
  23. package/src/lib/components/button/index.stories.mdx +121 -0
  24. package/src/lib/components/button/index.tsx +64 -0
  25. package/src/lib/components/button/styles.module.scss +5 -0
  26. package/src/lib/components/cards/a.stories.mdx +44 -0
  27. package/src/lib/components/cards/cardButton/index.stories.mdx +47 -0
  28. package/src/lib/components/cards/cardButton/index.tsx +61 -0
  29. package/src/lib/components/cards/cardButton/style.module.scss +33 -0
  30. package/src/lib/components/cards/cardWithLeftIcon/index.stories.mdx +103 -0
  31. package/src/lib/components/cards/cardWithLeftIcon/index.tsx +87 -0
  32. package/src/lib/components/cards/cardWithLeftIcon/style.module.scss +23 -0
  33. package/src/lib/components/cards/cardWithTopIcon/index.stories.mdx +105 -0
  34. package/src/lib/components/cards/cardWithTopIcon/index.tsx +60 -0
  35. package/src/lib/components/cards/cardWithTopIcon/style.module.scss +10 -0
  36. package/src/lib/components/cards/cardWithTopLeftIcon/index.stories.mdx +101 -0
  37. package/src/lib/components/cards/cardWithTopLeftIcon/index.tsx +72 -0
  38. package/src/lib/components/cards/cardWithTopLeftIcon/style.module.scss +21 -0
  39. package/src/lib/components/cards/icons/arrow-right.svg +4 -0
  40. package/src/lib/components/cards/icons/chevron-right.svg +3 -0
  41. package/src/lib/components/cards/icons/feather-logo.svg +10 -0
  42. package/src/lib/components/cards/icons/index.ts +36 -0
  43. package/src/lib/components/cards/icons/info.svg +12 -0
  44. package/src/lib/components/cards/index.test.ts +37 -0
  45. package/src/lib/components/cards/index.tsx +57 -0
  46. package/src/lib/components/cards/infoCard/index.stories.mdx +61 -0
  47. package/src/lib/components/cards/infoCard/index.tsx +47 -0
  48. package/src/lib/components/cards/infoCard/style.module.scss +53 -0
  49. package/src/lib/components/chip/icons/remove-button-highlighted.svg +4 -0
  50. package/src/lib/components/chip/icons/remove-button.svg +4 -0
  51. package/src/lib/components/chip/index.stories.mdx +101 -0
  52. package/src/lib/components/chip/index.tsx +38 -0
  53. package/src/lib/components/chip/style.module.scss +54 -0
  54. package/src/lib/components/comparisonTable/components/Chevron.tsx +19 -0
  55. package/src/lib/components/comparisonTable/components/Row/index.tsx +68 -0
  56. package/src/lib/components/comparisonTable/components/Row/style.module.scss +114 -0
  57. package/src/lib/components/comparisonTable/components/TableArrows/Arrow.tsx +19 -0
  58. package/src/lib/components/comparisonTable/components/TableArrows/index.tsx +52 -0
  59. package/src/lib/components/comparisonTable/components/TableArrows/style.module.scss +53 -0
  60. package/src/lib/components/comparisonTable/components/TableInfoButton/index.tsx +37 -0
  61. package/src/lib/components/comparisonTable/components/TableInfoButton/style.module.scss +30 -0
  62. package/src/lib/components/comparisonTable/components/TableRating/StarIcon.tsx +13 -0
  63. package/src/lib/components/comparisonTable/components/TableRating/ZapIcon.tsx +17 -0
  64. package/src/lib/components/comparisonTable/components/TableRating/index.tsx +45 -0
  65. package/src/lib/components/comparisonTable/components/TableRating/style.module.scss +13 -0
  66. package/src/lib/components/comparisonTable/components/TableRowHeader/index.tsx +35 -0
  67. package/src/lib/components/comparisonTable/components/TableRowHeader/style.module.scss +3 -0
  68. package/src/lib/components/comparisonTable/components/TableTrueFalse.tsx +40 -0
  69. package/src/lib/components/comparisonTable/hooks/useActiveTableArrows.ts +63 -0
  70. package/src/lib/components/comparisonTable/index.stories.mdx +254 -0
  71. package/src/lib/components/comparisonTable/index.tsx +211 -0
  72. package/src/lib/components/comparisonTable/style.module.scss +104 -0
  73. package/src/lib/components/dateSelector/datepicker.scss +406 -0
  74. package/src/lib/components/dateSelector/icons/calendar.svg +6 -0
  75. package/src/lib/components/dateSelector/icons/chevron-left.svg +3 -0
  76. package/src/lib/components/dateSelector/icons/chevron-right.svg +3 -0
  77. package/src/lib/components/dateSelector/index.stories.mdx +62 -0
  78. package/src/lib/components/dateSelector/index.test.ts +33 -0
  79. package/src/lib/components/dateSelector/index.tsx +247 -0
  80. package/src/lib/components/dateSelector/style.module.scss +77 -0
  81. package/src/lib/components/downloadButton/icons/check.svg +3 -0
  82. package/src/lib/components/downloadButton/icons/download.svg +5 -0
  83. package/src/lib/components/downloadButton/index.stories.mdx +59 -0
  84. package/src/lib/components/downloadButton/index.tsx +67 -0
  85. package/src/lib/components/downloadButton/style.module.scss +19 -0
  86. package/src/lib/components/downloadRing/icons/check-outside-circle.tsx +26 -0
  87. package/src/lib/components/downloadRing/icons/download-cloud.tsx +18 -0
  88. package/src/lib/components/downloadRing/icons/style.module.scss +7 -0
  89. package/src/lib/components/downloadRing/index.stories.mdx +35 -0
  90. package/src/lib/components/downloadRing/index.tsx +79 -0
  91. package/src/lib/components/downloadRing/style.module.scss +66 -0
  92. package/src/lib/components/dropzone/images/error.tsx +18 -0
  93. package/src/lib/components/dropzone/images/file.tsx +26 -0
  94. package/src/lib/components/dropzone/images/style.module.scss +7 -0
  95. package/src/lib/components/dropzone/images/upload-complete.tsx +24 -0
  96. package/src/lib/components/dropzone/images/upload.tsx +18 -0
  97. package/src/lib/components/dropzone/index.stories.mdx +44 -0
  98. package/src/lib/components/dropzone/index.tsx +152 -0
  99. package/src/lib/components/dropzone/style.module.scss +90 -0
  100. package/src/lib/components/input/a.stories.mdx +28 -0
  101. package/src/lib/components/input/autoSuggestInput/index.stories.mdx +137 -0
  102. package/src/lib/components/input/autoSuggestInput/index.tsx +81 -0
  103. package/src/lib/components/input/autoSuggestInput/style.module.scss +71 -0
  104. package/src/lib/components/input/autoSuggestMultiSelect/index.stories.mdx +115 -0
  105. package/src/lib/components/input/autoSuggestMultiSelect/index.tsx +75 -0
  106. package/src/lib/components/input/autoSuggestMultiSelect/style.module.scss +4 -0
  107. package/src/lib/components/input/currency/format/index.test.ts +49 -0
  108. package/src/lib/components/input/currency/format/index.ts +15 -0
  109. package/src/lib/components/input/currency/index.stories.mdx +25 -0
  110. package/src/lib/components/input/currency/index.test.tsx +56 -0
  111. package/src/lib/components/input/currency/index.tsx +53 -0
  112. package/src/lib/components/input/iban/formatIban/index.test.ts +11 -0
  113. package/src/lib/components/input/iban/formatIban/index.ts +22 -0
  114. package/src/lib/components/input/iban/index.stories.mdx +21 -0
  115. package/src/lib/components/input/iban/index.tsx +20 -0
  116. package/src/lib/components/input/index.stories.mdx +62 -0
  117. package/src/lib/components/input/index.tsx +51 -0
  118. package/src/lib/components/input/style.module.scss +94 -0
  119. package/src/lib/components/modal/bottomModal/img/close.svg +4 -0
  120. package/src/lib/components/modal/bottomModal/index.tsx +68 -0
  121. package/src/lib/components/modal/bottomModal/style.module.scss +104 -0
  122. package/src/lib/components/modal/bottomOrRegularModal/index.tsx +43 -0
  123. package/src/lib/components/modal/bottomOrRegularModal/style.module.scss +16 -0
  124. package/src/lib/components/modal/hooks/useOnClose.ts +51 -0
  125. package/src/lib/components/modal/index.stories.mdx +316 -0
  126. package/src/lib/components/modal/index.ts +14 -0
  127. package/src/lib/components/modal/regularModal/img/close.svg +4 -0
  128. package/src/lib/components/modal/regularModal/index.tsx +55 -0
  129. package/src/lib/components/modal/regularModal/style.module.scss +106 -0
  130. package/src/lib/components/multiDropzone/UploadFileCell/index.tsx +138 -0
  131. package/src/lib/components/multiDropzone/UploadFileCell/style.module.scss +101 -0
  132. package/src/lib/components/multiDropzone/icons/bmp-complete.svg +10 -0
  133. package/src/lib/components/multiDropzone/icons/bmp.svg +10 -0
  134. package/src/lib/components/multiDropzone/icons/doc-complete.svg +11 -0
  135. package/src/lib/components/multiDropzone/icons/doc.svg +11 -0
  136. package/src/lib/components/multiDropzone/icons/docx-complete.svg +12 -0
  137. package/src/lib/components/multiDropzone/icons/docx.svg +12 -0
  138. package/src/lib/components/multiDropzone/icons/eye.svg +4 -0
  139. package/src/lib/components/multiDropzone/icons/generic-complete.svg +4 -0
  140. package/src/lib/components/multiDropzone/icons/generic-error.svg +7 -0
  141. package/src/lib/components/multiDropzone/icons/generic.svg +4 -0
  142. package/src/lib/components/multiDropzone/icons/heic-complete.svg +11 -0
  143. package/src/lib/components/multiDropzone/icons/heic.svg +11 -0
  144. package/src/lib/components/multiDropzone/icons/index.ts +51 -0
  145. package/src/lib/components/multiDropzone/icons/jpeg-complete.svg +11 -0
  146. package/src/lib/components/multiDropzone/icons/jpeg.svg +11 -0
  147. package/src/lib/components/multiDropzone/icons/jpg-complete.svg +10 -0
  148. package/src/lib/components/multiDropzone/icons/jpg.svg +10 -0
  149. package/src/lib/components/multiDropzone/icons/pdf-complete.svg +8 -0
  150. package/src/lib/components/multiDropzone/icons/pdf.svg +8 -0
  151. package/src/lib/components/multiDropzone/icons/png-complete.svg +10 -0
  152. package/src/lib/components/multiDropzone/icons/png.svg +10 -0
  153. package/src/lib/components/multiDropzone/icons/trash.svg +6 -0
  154. package/src/lib/components/multiDropzone/icons/upload.svg +5 -0
  155. package/src/lib/components/multiDropzone/index.stories.mdx +91 -0
  156. package/src/lib/components/multiDropzone/index.tsx +99 -0
  157. package/src/lib/components/multiDropzone/style.module.scss +32 -0
  158. package/src/lib/components/segmentedControl/index.stories.mdx +47 -0
  159. package/src/lib/components/segmentedControl/index.tsx +105 -0
  160. package/src/lib/components/segmentedControl/style.module.scss +36 -0
  161. package/src/lib/components/signaturePad/img/reset.svg +4 -0
  162. package/src/lib/components/signaturePad/img/sign.svg +3 -0
  163. package/src/lib/components/signaturePad/index.stories.mdx +17 -0
  164. package/src/lib/components/signaturePad/index.tsx +96 -0
  165. package/src/lib/components/signaturePad/style.module.scss +90 -0
  166. package/src/lib/index.tsx +71 -0
  167. package/src/lib/models/autoSuggestInput/index.ts +4 -0
  168. package/src/lib/models/download.ts +1 -0
  169. package/src/lib/models/downloadRing/index.ts +6 -0
  170. package/src/lib/scss/index.scss +22 -0
  171. package/src/lib/scss/private/_reset.scss +149 -0
  172. package/src/lib/scss/private/base/_colors.scss +19 -0
  173. package/src/lib/scss/private/base/_cursors.scss +31 -0
  174. package/src/lib/scss/private/base/_display.scss +35 -0
  175. package/src/lib/scss/private/base/_grid.scss +52 -0
  176. package/src/lib/scss/private/base/_index.scss +9 -0
  177. package/src/lib/scss/private/base/_shadows.scss +2 -0
  178. package/src/lib/scss/private/base/_spacing.scss +89 -0
  179. package/src/lib/scss/private/base/_typography.scss +128 -0
  180. package/src/lib/scss/private/base/_width_and_height.scss +25 -0
  181. package/src/lib/scss/private/base/cursors.stories.mdx +18 -0
  182. package/src/lib/scss/private/base/demo.tsx +119 -0
  183. package/src/lib/scss/private/base/display.stories.mdx +19 -0
  184. package/src/lib/scss/private/base/flex/_flex.scss +63 -0
  185. package/src/lib/scss/private/base/flex/flex.stories.mdx +139 -0
  186. package/src/lib/scss/private/base/flex/style.module.scss +24 -0
  187. package/src/lib/scss/private/base/spacing.stories.mdx +173 -0
  188. package/src/lib/scss/private/base/style.module.scss +42 -0
  189. package/src/lib/scss/private/base/typography.stories.mdx +71 -0
  190. package/src/lib/scss/private/base/width_and_height.stories.mdx +172 -0
  191. package/src/lib/scss/private/components/_badge.scss +41 -0
  192. package/src/lib/scss/private/components/_buttons.scss +193 -0
  193. package/src/lib/scss/private/components/_cards.scss +32 -0
  194. package/src/lib/scss/private/components/_index.scss +6 -0
  195. package/src/lib/scss/private/components/_input.scss +241 -0
  196. package/src/lib/scss/private/components/_notices.scss +39 -0
  197. package/src/lib/scss/private/components/_spinner.scss +60 -0
  198. package/src/lib/scss/private/components/assets/checkmark.svg +3 -0
  199. package/src/lib/scss/private/components/assets/icon-form-dropdown.svg +3 -0
  200. package/src/lib/scss/private/components/badge.stories.mdx +37 -0
  201. package/src/lib/scss/private/components/button.stories.mdx +107 -0
  202. package/src/lib/scss/private/components/cards.stories.mdx +35 -0
  203. package/src/lib/scss/private/components/checkbox.stories.mdx +47 -0
  204. package/src/lib/scss/private/components/input.stories.mdx +33 -0
  205. package/src/lib/scss/private/components/notices.stories.mdx +37 -0
  206. package/src/lib/scss/private/components/radio.stories.mdx +47 -0
  207. package/src/lib/scss/private/components/select.stories.mdx +17 -0
  208. package/src/lib/scss/private/components/spinner.stories.mdx +25 -0
  209. package/src/lib/scss/public/colors/_index.scss +2 -0
  210. package/src/lib/scss/public/colors/default.scss +125 -0
  211. package/src/lib/scss/public/colors/overrides.scss +0 -0
  212. package/src/lib/scss/public/colors.stories.mdx +27 -0
  213. package/src/lib/scss/public/demo.tsx +285 -0
  214. package/src/lib/scss/public/font/_index.scss +2 -0
  215. package/src/lib/scss/public/font/default.scss +3 -0
  216. package/src/lib/scss/public/font/overrides.scss +0 -0
  217. package/src/lib/scss/public/font-weight.scss +9 -0
  218. package/src/lib/scss/public/font-weight.stories.mdx +32 -0
  219. package/src/lib/scss/public/grid.scss +21 -0
  220. package/src/lib/scss/public/grid.stories.mdx +41 -0
  221. package/src/lib/scss/third-party/_google_places.scss +62 -0
  222. package/src/lib/scss/third-party/_index.scss +1 -0
  223. package/src/lib/scss/utils/_index.scss +3 -0
  224. package/src/lib/util/calendarDate/index.test.ts +32 -0
  225. package/src/lib/util/calendarDate/index.ts +30 -0
  226. package/src/lib/util/zeroFill.test.ts +15 -0
  227. package/src/lib/util/zeroFill.ts +7 -0
  228. package/src/react-app-env.d.ts +1 -0
  229. package/src/setupTests.js +8 -0
  230. package/src/theme.stories.mdx +54 -0
@@ -0,0 +1,104 @@
1
+ @use "../../scss/public/grid" as *;
2
+ @use "../../scss/public/colors" as *;
3
+
4
+ .container {
5
+ width: 100%;
6
+ overflow-x: auto;
7
+ -webkit-overflow-scrolling: touch;
8
+ scroll-snap-type: x mandatory;
9
+
10
+ @include p-size-tablet {
11
+ scroll-snap-type: unset;
12
+ }
13
+ }
14
+
15
+ .overflow-container {
16
+ width: max-content;
17
+ min-width: 100%;
18
+ }
19
+
20
+ .group-container {
21
+ display: flex;
22
+ flex-flow: column;
23
+ width: max-content;
24
+ margin: auto;
25
+ min-width: calc(56rem + 48px);
26
+ }
27
+
28
+ .group-title {
29
+ width: 100%;
30
+
31
+ background-color: $ds-grey-100;
32
+ border-radius: 8px;
33
+
34
+ margin-top: 48px;
35
+
36
+ & > h4 {
37
+ padding: 24px;
38
+ display: inline-block;
39
+ }
40
+
41
+ @include p-size-tablet {
42
+ margin-top: 72px;
43
+ }
44
+ }
45
+
46
+ .sticky {
47
+ position: sticky;
48
+ justify-content: flex-start;
49
+ z-index: 1;
50
+
51
+ top: 0;
52
+ left: 0;
53
+
54
+ @include p-size-tablet {
55
+ border-right: 1px solid $ds-grey-100;
56
+ }
57
+ }
58
+
59
+ .header {
60
+ position: sticky;
61
+ top: 0;
62
+ z-index: 2;
63
+ background-color: white;
64
+
65
+ .container {
66
+ -ms-overflow-style: none; /* IE and Edge */
67
+ scrollbar-width: none; /* Firefox */
68
+
69
+ &::-webkit-scrollbar {
70
+ display: none;
71
+ }
72
+ }
73
+ }
74
+
75
+ .show-details-container {
76
+ width: 100%;
77
+ max-width: calc(100vw - 24px);
78
+
79
+ padding-left: 16px;
80
+
81
+ border: none;
82
+ }
83
+
84
+ .show-details-button {
85
+ font-family: inherit;
86
+ background-color: $ds-grey-100;
87
+
88
+ border: none;
89
+ border-radius: 8px;
90
+
91
+ height: 64px;
92
+
93
+ justify-content: center;
94
+ align-items: center;
95
+
96
+ svg {
97
+ margin-left: 8px;
98
+ }
99
+ }
100
+
101
+ .icon-inverted {
102
+ transform: rotate(180deg);
103
+ transition: all 0.25s ease;
104
+ }
@@ -0,0 +1,406 @@
1
+ @use '../../scss/public/grid' as *;
2
+ @use '../../scss/public/colors' as *;
3
+
4
+ .DayPickerInput {
5
+ cursor: pointer;
6
+ position: relative;
7
+ background-color: white;
8
+ display: flex;
9
+ align-items: center;
10
+ height: 40px;
11
+ min-width: 180px;
12
+ padding-left: 8px;
13
+ line-height: 40px;
14
+ border-radius: 4px;
15
+ text-align: left;
16
+ border: 1px solid $ds-grey-500;
17
+ }
18
+
19
+ .DayPickerInput input {
20
+ cursor: pointer;
21
+ border: none;
22
+ background-color: transparent;
23
+ height: 100%;
24
+ color: $ds-grey-700;
25
+ font-size: 16px;
26
+ }
27
+
28
+ .DayPickerInput::before {
29
+ content: '';
30
+ display: inline-block;
31
+ position: absolute;
32
+ right: 8px;
33
+ top: 50%;
34
+ transform: translateY(-50%);
35
+ border-left: 9px solid transparent;
36
+ border-right: 9px solid transparent;
37
+ border-top: 12px solid $ds-grey-500;
38
+ }
39
+
40
+ .DayPickerInput:hover::before {
41
+ border-top: 12px solid $ds-grey-700;
42
+ }
43
+
44
+ .DayPickerInput:hover {
45
+ border-color: $ds-grey-700;
46
+ }
47
+
48
+ .DayPicker {
49
+ position: absolute;
50
+ left: -9px;
51
+ top: 8px;
52
+ z-index: 100;
53
+ border-radius: 4px;
54
+ box-shadow: 0 1px 4px 1px rgba(0, 0, 0, 0.08);
55
+ background-color: white;
56
+ display: inline-block;
57
+ font-size: 1rem;
58
+ }
59
+
60
+ .DayPicker-wrapper {
61
+ position: relative;
62
+
63
+ flex-direction: row;
64
+ padding-bottom: 1em;
65
+
66
+ user-select: none;
67
+ }
68
+
69
+ .DayPicker-Months {
70
+ display: flex;
71
+ flex-wrap: wrap;
72
+ justify-content: center;
73
+ }
74
+
75
+ .DayPicker-Month {
76
+ display: table;
77
+ margin: 0 1em;
78
+ margin-top: 1em;
79
+ border-spacing: 0;
80
+ border-collapse: collapse;
81
+
82
+ user-select: none;
83
+
84
+ font: 16px;
85
+ }
86
+
87
+ .DayPicker-NavButton {
88
+ position: absolute;
89
+ top: 1em;
90
+ right: 1.5em;
91
+ left: auto;
92
+ display: inline-block;
93
+ margin-top: 2px;
94
+ width: 1.25em;
95
+ height: 1.25em;
96
+ background-position: center;
97
+ background-size: 50%;
98
+ background-repeat: no-repeat;
99
+ color: #8b9898;
100
+ cursor: pointer;
101
+ }
102
+
103
+ .DayPicker-NavButton:hover {
104
+ opacity: 0.8;
105
+ }
106
+
107
+ .DayPicker-NavButton--prev {
108
+ margin-right: 1.5em;
109
+ background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAwCAYAAAB5R9gVAAAABGdBTUEAALGPC/xhBQAAAVVJREFUWAnN2G0KgjAYwPHpGfRkaZeqvgQaK+hY3SUHrk1YzNLay/OiEFp92I+/Mp2F2Mh2lLISWnflFjzH263RQjzMZ19wgs73ez0o1WmtW+dgA01VxrE3p6l2GLsnBy1VYQOtVSEH/atCCgqpQgKKqYIOiq2CBkqtggLKqQIKgqgCBjpJ2Y5CdJ+zrT9A7HHSTA1dxUdHgzCqJIEwq0SDsKsEg6iqBIEoq/wEcVRZBXFV+QJxV5mBtlDFB5VjYTaGZ2sf4R9PM7U9ZU+lLuaetPP/5Die3ToO1+u+MKtHs06qODB2zBnI/jBd4MPQm1VkY79Tb18gB+C62FdBFsZR6yeIo1YQiLJWMIiqVjQIu1YSCLNWFgijVjYIuhYYCKoWKAiiFgoopxYaKLUWOii2FgkophYp6F3r42W5A9s9OcgNvva8xQaysKXlFytoqdYmQH6tF3toSUo0INq9AAAAAElFTkSuQmCC');
110
+ }
111
+
112
+ .DayPicker-NavButton--next {
113
+ background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAwCAYAAAB5R9gVAAAABGdBTUEAALGPC/xhBQAAAXRJREFUWAnN119ugjAcwPHWzJ1gnmxzB/BBE0n24m4xfNkTaOL7wOtsl3AXMMb+Vjaa1BG00N8fSEibPpAP3xAKKs2yjzTPH9RAjhEo9WzPr/Vm8zgE0+gXATAxxuxtqeJ9t5tIwv5AtQAApsfT6TPdbp+kUBcgVwvO51KqVhMkXKsVJFXrOkigVhCIs1Y4iKlWZxB1rX4gwlpRIIpa8SDkWmggrFq4IIRaJKCYWnSgnrXIQV1r8YD+1Vrn+bReagysIFfLABRt31v8oBu1xEBttfRbltmfjgEcWh9snUS2kNdBK6WN1vrOWxObWsz+fjxevsxmB1GQDfINWiev83nhaoiB/CoOU438oPrhXS0WpQ9xc1ZQWxWHqUYe0I0qrKCQKjygDlXIQV2r0IF6ViEBxVTBBSFUQQNhVYkHIVeJAtkNsbQ7c1LtzP6FsObhb2rCKv7NBIGoq4SDmKoEgTirXAcJVGkFSVVpgoSrXICGUMUH/QBZNSUy5XWUhwAAAABJRU5ErkJggg==');
114
+ }
115
+
116
+ .DayPicker-NavButton--interactionDisabled {
117
+ visibility: hidden;
118
+ }
119
+
120
+ .DayPicker-Caption {
121
+ display: table-caption;
122
+ margin-bottom: 0.5em;
123
+ padding: 0 0.5em;
124
+ text-align: left;
125
+ }
126
+
127
+ .DayPicker-Caption > div {
128
+ font-weight: 500;
129
+ font-size: 1.15em;
130
+ }
131
+
132
+ .DayPicker-Weekdays {
133
+ display: table-header-group;
134
+ margin-top: 1em;
135
+ }
136
+
137
+ .DayPicker-WeekdaysRow {
138
+ display: table-row;
139
+ }
140
+
141
+ .DayPicker-Weekday {
142
+ display: table-cell;
143
+ padding: 0.5em;
144
+ color: #8b9898;
145
+ text-align: center;
146
+ font-size: 0.875em;
147
+ }
148
+
149
+ .DayPicker-Weekday abbr[title] {
150
+ border-bottom: none;
151
+ text-decoration: none;
152
+ }
153
+
154
+ .DayPicker-Body {
155
+ display: table-row-group;
156
+ }
157
+
158
+ .DayPicker-Week {
159
+ display: table-row;
160
+ }
161
+
162
+ .DayPicker-Day {
163
+ display: table-cell;
164
+ padding: 0.5em;
165
+ border-radius: 50%;
166
+ vertical-align: middle;
167
+ text-align: center;
168
+ cursor: pointer;
169
+
170
+ font: normal 16px Lato;
171
+ }
172
+
173
+ .DayPicker-WeekNumber {
174
+ display: table-cell;
175
+ padding: 0.5em;
176
+ min-width: 1em;
177
+ border-right: 1px solid #eaecec;
178
+ color: #8b9898;
179
+ vertical-align: middle;
180
+ text-align: right;
181
+ font-size: 0.75em;
182
+ cursor: pointer;
183
+ }
184
+
185
+ .DayPicker--interactionDisabled .DayPicker-Day {
186
+ cursor: default;
187
+ }
188
+
189
+ .DayPicker-Footer {
190
+ padding-top: 0.5em;
191
+ }
192
+
193
+ .DayPicker-TodayButton {
194
+ border: none;
195
+ background-color: transparent;
196
+ background-image: none;
197
+ box-shadow: none;
198
+ color: #4a90e2;
199
+ font-size: 0.875em;
200
+ cursor: pointer;
201
+ }
202
+
203
+ .DayPicker-Day--sunday {
204
+ background-color: #f7f8f8;
205
+ }
206
+
207
+ .DayPicker-Day--sunday:not(.DayPicker-Day--today) {
208
+ color: #dce0e0;
209
+ }
210
+
211
+ .DayPicker-Day--selected:not(.DayPicker-Day--disabled):not(.DayPicker-Day--outside) {
212
+ position: relative;
213
+
214
+ background-color: $ds-purple-500;
215
+ color: #f0f8ff;
216
+ }
217
+
218
+ .DayPicker-Day--selected:not(.DayPicker-Day--disabled):not(.DayPicker-Day--outside):hover {
219
+ background-color: $ds-purple-700;
220
+ }
221
+
222
+ .DayPicker:not(.DayPicker--interactionDisabled)
223
+ .DayPicker-Day:not(.DayPicker-Day--disabled):not(.DayPicker-Day--selected):not(.DayPicker-Day--outside):hover {
224
+ background-color: $ds-purple-100;
225
+ }
226
+
227
+ .DayPickerInput {
228
+ display: inline-block;
229
+ }
230
+
231
+ .DayPickerInput-OverlayWrapper {
232
+ position: relative;
233
+ }
234
+
235
+ .DayPickerInput-Overlay {
236
+ position: absolute;
237
+ left: 0;
238
+ z-index: 1;
239
+
240
+ background: white;
241
+ box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
242
+ }
243
+
244
+ .DayPicker {
245
+ position: absolute;
246
+ left: 40px;
247
+ top: -112px;
248
+ z-index: 100;
249
+ background-color: white;
250
+ border: 1px solid #d2d2d8;
251
+ box-shadow: 0px 0px 32px rgba(210, 210, 216, 0.25);
252
+ border-radius: 16px;
253
+ display: inline-block;
254
+ color: $ds-grey-900;
255
+
256
+ @include p-size-mobile {
257
+ position: fixed;
258
+ top: 50%;
259
+ left: 50%;
260
+ transform: translate(-50%, -50%);
261
+ }
262
+ }
263
+
264
+ .DayPicker-wrapper {
265
+ padding: 8px 24px 24px 24px;
266
+ }
267
+
268
+ .DayPicker-NavBar {
269
+ display: flex;
270
+ justify-content: space-between;
271
+ width: 100%;
272
+ position: absolute;
273
+ left: 0;
274
+ }
275
+
276
+ .DayPicker-NavButton {
277
+ position: unset;
278
+ margin-top: 0;
279
+ width: 48px;
280
+ height: 48px;
281
+ }
282
+
283
+ .DayPicker-NavButton:hover {
284
+ opacity: 1;
285
+ border-radius: 50%;
286
+ background-color: $ds-purple-100;
287
+ }
288
+
289
+ .DayPicker-NavButton--prev {
290
+ background-image: url('./icons/chevron-left.svg');
291
+ margin-left: 16px;
292
+ }
293
+
294
+ .DayPicker-NavButton--next {
295
+ background-image: url('./icons/chevron-right.svg');
296
+ margin-right: 16px;
297
+ }
298
+
299
+ .DayPicker-Months {
300
+ display: flex;
301
+ flex-wrap: wrap;
302
+ justify-content: center;
303
+ margin-top: 14px;
304
+ }
305
+
306
+ .DayPicker-Month {
307
+ display: table;
308
+ margin: 0;
309
+ border-spacing: 0;
310
+ border-collapse: collapse;
311
+
312
+ user-select: none;
313
+
314
+ font: 16px;
315
+ }
316
+
317
+ .DayPicker-Caption {
318
+ margin: 0 0 24px 0;
319
+ padding: unset;
320
+ text-align: center;
321
+ }
322
+
323
+ .DayPicker-Weekdays {
324
+ display: table-header-group;
325
+ }
326
+
327
+ .DayPicker-WeekdaysRow {
328
+ display: table-row;
329
+ }
330
+
331
+ .DayPicker-Weekday {
332
+ display: table-cell;
333
+ padding: 0.5em;
334
+ color: #8b9898;
335
+ text-align: center;
336
+ font-size: 0.875em;
337
+ }
338
+
339
+ .DayPicker-Weekday abbr[title] {
340
+ border-bottom: none;
341
+ text-decoration: none;
342
+ }
343
+
344
+ .DayPicker-Body {
345
+ display: table-row-group;
346
+ }
347
+
348
+ .DayPicker-Week {
349
+ display: table-row;
350
+ }
351
+
352
+ .DayPicker-Day {
353
+ display: table-cell;
354
+ padding: 0.5em;
355
+ border-radius: 50%;
356
+ vertical-align: middle;
357
+ text-align: center;
358
+ cursor: pointer;
359
+
360
+ font: normal 16px Lato;
361
+ }
362
+
363
+ .DayPicker-WeekNumber {
364
+ display: table-cell;
365
+ padding: 0.5em;
366
+ min-width: 1em;
367
+ border-right: 1px solid #eaecec;
368
+ color: #8b9898;
369
+ vertical-align: middle;
370
+ text-align: right;
371
+ font-size: 0.75em;
372
+ cursor: pointer;
373
+ }
374
+
375
+ .DayPicker--interactionDisabled .DayPicker-Day {
376
+ cursor: default;
377
+ }
378
+
379
+ .DayPicker-Footer {
380
+ padding-top: 0.5em;
381
+ }
382
+
383
+ .DayPicker-TodayButton {
384
+ border: none;
385
+ background-color: transparent;
386
+ background-image: none;
387
+ box-shadow: none;
388
+ color: #4a90e2;
389
+ font-size: 0.875em;
390
+ cursor: pointer;
391
+ }
392
+
393
+ .DayPicker-Day--outside {
394
+ color: $ds-grey-300;
395
+ cursor: pointer;
396
+
397
+ &:hover {
398
+ background: $ds-primary-100;
399
+ }
400
+ }
401
+
402
+ .DayPicker-Day--disabled {
403
+ color: $ds-grey-300;
404
+ background-color: transparent;
405
+ pointer-events: none;
406
+ }
@@ -0,0 +1,6 @@
1
+ <svg width="24" height="25" viewBox="0 0 24 25" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M19 4.46118H5C3.89543 4.46118 3 5.35661 3 6.46118V20.4612C3 21.5658 3.89543 22.4612 5 22.4612H19C20.1046 22.4612 21 21.5658 21 20.4612V6.46118C21 5.35661 20.1046 4.46118 19 4.46118Z" stroke="#8E8CEE" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
3
+ <path d="M16 2.46118V6.46118" stroke="#8E8CEE" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
4
+ <path d="M8 2.46118V6.46118" stroke="#8E8CEE" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
5
+ <path d="M3 10.4612H21" stroke="#8E8CEE" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
6
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="24" height="25" viewBox="0 0 24 25" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M15 18.1406L9 12.1406L15 6.14062" stroke="#26262E" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="25" height="25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M9.04504 18.1406L15.045 12.1406L9.04504 6.14062" stroke="#26262E" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
3
+ </svg>
@@ -0,0 +1,62 @@
1
+ import { useState } from 'react';
2
+ import { Meta, Preview } from '@storybook/addon-docs/blocks';
3
+
4
+ import DateSelector from '.';
5
+
6
+ <Meta title="JSX/Date selector" component={DateSelector} />
7
+
8
+ # Date selector
9
+
10
+ Date selector are user interface elements which allow user to select a date in the `YYYY-MM-DD` format.
11
+
12
+ <Preview>
13
+ <iframe
14
+ width="100%"
15
+ height="450"
16
+ src="https://www.figma.com/embed?embed_host=share&url=https%3A%2F%2Fwww.figma.com%2Ffile%2FMKs4cbojdVOBKUxv7okb93%2FDirty-Swan-Design-System%3Fnode-id%3D293%253A169"
17
+ allowFullScreen
18
+ ></iframe>
19
+ </Preview>
20
+
21
+ ## Default example
22
+
23
+ ### Without calendar
24
+
25
+ export const DateSelectorWithoutCalendarStory = () => {
26
+ const [date, setDate] = useState('');
27
+ return (
28
+ <>
29
+ <DateSelector
30
+ value={date}
31
+ className="mt24"
32
+ yearBoundaries={{ min: 2020, max: 2022 }}
33
+ onChange={(date) => {
34
+ setDate(date);
35
+ }}
36
+ />
37
+ </>
38
+ );
39
+ };
40
+
41
+ <DateSelectorWithoutCalendarStory />
42
+
43
+ ### With calendar
44
+
45
+ export const DateSelectorWithCalendarStory = () => {
46
+ const [date, setDate] = useState('');
47
+ return (
48
+ <div style={{ paddingBottom: '120px' }}>
49
+ <DateSelector
50
+ value={date}
51
+ className="mt24"
52
+ yearBoundaries={{ min: 2020, max: 2022 }}
53
+ onChange={(date) => {
54
+ setDate(date);
55
+ }}
56
+ displayCalendar={true}
57
+ />
58
+ </div>
59
+ );
60
+ };
61
+
62
+ <DateSelectorWithCalendarStory />
@@ -0,0 +1,33 @@
1
+ import { fillArray, daysInMonthOfYear } from '.';
2
+
3
+ describe('fillArray tests', () => {
4
+ it('Should fill array from 1 to 10 ascending', () => {
5
+ const expectedOutput = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
6
+
7
+ expect(fillArray(1, 10)).toEqual(expectedOutput);
8
+ });
9
+
10
+ it('Should fill array from 10 to 5 descending', () => {
11
+ const expectedOutput = [10, 9, 8, 7, 6, 5];
12
+
13
+ expect(fillArray(10, 5)).toEqual(expectedOutput);
14
+ });
15
+ });
16
+
17
+ describe('Days for month in year', () => {
18
+ it('Should return 28 for February 2019', () => {
19
+ expect(daysInMonthOfYear({ month: 2, year: 2019 })).toEqual(28);
20
+ });
21
+
22
+ it('Should return 31 for January 2019', () => {
23
+ expect(daysInMonthOfYear({ month: 1, year: 2019 })).toEqual(31);
24
+ });
25
+
26
+ it('Should return 29 for February 2016', () => {
27
+ expect(daysInMonthOfYear({ month: 2, year: 2016 })).toEqual(29);
28
+ });
29
+
30
+ it('Should return 31 for October 2016', () => {
31
+ expect(daysInMonthOfYear({ month: 10, year: 2016 })).toEqual(31);
32
+ });
33
+ });