@pezeshk-book/modules 0.2.5 → 0.2.6

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 (278) hide show
  1. package/.eslintrc.json +133 -0
  2. package/calendar/calendar.props.ts +25 -0
  3. package/calendar/calendar.tsx +183 -0
  4. package/calendar/config/chunk.ts +42 -0
  5. package/calendar/config/create-date-range.ts +14 -0
  6. package/calendar/config/days-in-month.en.ts +47 -0
  7. package/calendar/config/days-in-month.fa.ts +37 -0
  8. package/calendar/config/index.ts +16 -0
  9. package/calendar/config/months.ts +29 -0
  10. package/calendar/config/week-day.ts +19 -0
  11. package/calendar/icons/arrow-left-icon.tsx +14 -0
  12. package/calendar/icons/arrow-right-icon.tsx +14 -0
  13. package/calendar/icons/index.ts +7 -0
  14. package/calendar/index.ts +3 -0
  15. package/calendar/shared/formatDate.tsx +12 -0
  16. package/calendar/sub-components/day/day.props.ts +27 -0
  17. package/calendar/sub-components/day/day.tsx +31 -0
  18. package/calendar/sub-components/days/days.props.ts +51 -0
  19. package/calendar/sub-components/days/days.tsx +142 -0
  20. package/calendar/sub-components/days-head/days-head.props.ts +27 -0
  21. package/calendar/sub-components/days-head/days-head.tsx +122 -0
  22. package/countdown-timer/countdown.props.ts +18 -0
  23. package/countdown-timer/countdown.tsx +78 -0
  24. package/countdown-timer/index.ts +3 -0
  25. package/data-table/data-table.props.ts +7 -0
  26. package/data-table/data-table.tsx +15 -0
  27. package/data-table/default/default-data-table.props.ts +47 -0
  28. package/data-table/default/default-data-table.tsx +427 -0
  29. package/data-table/default/index.ts +3 -0
  30. package/data-table/hooks/use-window-dimensions.tsx +33 -0
  31. package/data-table/icons/add.tsx +10 -0
  32. package/data-table/icons/arrow-down.tsx +11 -0
  33. package/data-table/icons/index.ts +9 -0
  34. package/data-table/icons/sort.tsx +16 -0
  35. package/data-table/index.ts +3 -0
  36. package/data-table/simple/index.ts +3 -0
  37. package/data-table/simple/simple-data-table.props.ts +23 -0
  38. package/data-table/simple/simple-data-table.tsx +258 -0
  39. package/dist/calendar/calendar.js.map +1 -0
  40. package/dist/calendar/calendar.props.js.map +1 -0
  41. package/dist/calendar/config/chunk.js.map +1 -0
  42. package/dist/calendar/config/create-date-range.js.map +1 -0
  43. package/dist/calendar/config/days-in-month.en.js.map +1 -0
  44. package/dist/calendar/config/days-in-month.fa.js.map +1 -0
  45. package/dist/calendar/config/index.js.map +1 -0
  46. package/dist/calendar/config/months.js.map +1 -0
  47. package/dist/calendar/config/week-day.js.map +1 -0
  48. package/dist/calendar/icons/arrow-left-icon.js.map +1 -0
  49. package/dist/calendar/icons/arrow-right-icon.js.map +1 -0
  50. package/dist/calendar/icons/index.js.map +1 -0
  51. package/dist/calendar/index.js.map +1 -0
  52. package/dist/calendar/shared/formatDate.js.map +1 -0
  53. package/dist/{modules/calendar → calendar}/sub-components/day/day.js +1 -1
  54. package/dist/calendar/sub-components/day/day.js.map +1 -0
  55. package/dist/calendar/sub-components/day/day.props.js.map +1 -0
  56. package/dist/calendar/sub-components/days/days.js.map +1 -0
  57. package/dist/calendar/sub-components/days/days.props.js.map +1 -0
  58. package/dist/{modules/calendar → calendar}/sub-components/days-head/days-head.js +2 -2
  59. package/dist/calendar/sub-components/days-head/days-head.js.map +1 -0
  60. package/dist/calendar/sub-components/days-head/days-head.props.js.map +1 -0
  61. package/dist/countdown-timer/countdown.js.map +1 -0
  62. package/dist/countdown-timer/countdown.props.js.map +1 -0
  63. package/dist/countdown-timer/index.js.map +1 -0
  64. package/dist/data-table/data-table.js.map +1 -0
  65. package/dist/data-table/data-table.props.js.map +1 -0
  66. package/dist/data-table/default/default-data-table.js.map +1 -0
  67. package/dist/data-table/default/default-data-table.props.js.map +1 -0
  68. package/dist/data-table/default/index.js.map +1 -0
  69. package/dist/data-table/hooks/use-window-dimensions.js.map +1 -0
  70. package/dist/data-table/icons/add.js.map +1 -0
  71. package/dist/data-table/icons/arrow-down.js.map +1 -0
  72. package/dist/data-table/icons/index.js.map +1 -0
  73. package/dist/data-table/icons/sort.js.map +1 -0
  74. package/dist/data-table/index.js.map +1 -0
  75. package/dist/data-table/simple/index.js.map +1 -0
  76. package/dist/data-table/simple/simple-data-table.js.map +1 -0
  77. package/dist/data-table/simple/simple-data-table.props.js.map +1 -0
  78. package/dist/index.d.ts +5 -5
  79. package/dist/index.js +5 -5
  80. package/dist/index.js.map +1 -1
  81. package/dist/pagination/icons/arrow-Right.js.map +1 -0
  82. package/dist/pagination/icons/arrow-left.js.map +1 -0
  83. package/dist/pagination/icons/index.js.map +1 -0
  84. package/dist/pagination/index.js.map +1 -0
  85. package/dist/pagination/pagination.js.map +1 -0
  86. package/dist/pagination/pagination.props.js.map +1 -0
  87. package/dist/pagination/use-pagination.js.map +1 -0
  88. package/dist/slider/index.js.map +1 -0
  89. package/dist/{modules/slider → slider}/slider.js +1 -1
  90. package/dist/slider/slider.js.map +1 -0
  91. package/dist/slider/slider.props.js.map +1 -0
  92. package/dist/stories/calendar/calendar.d.ts +1 -1
  93. package/dist/stories/calendar/calendar.js +1 -1
  94. package/dist/stories/calendar/calendar.js.map +1 -1
  95. package/dist/stories/count-down/count-down.d.ts +1 -1
  96. package/dist/stories/count-down/count-down.js +1 -1
  97. package/dist/stories/count-down/count-down.js.map +1 -1
  98. package/dist/stories/data-table/default-data-table.d.ts +1 -1
  99. package/dist/stories/data-table/default-data-table.js +1 -1
  100. package/dist/stories/data-table/default-data-table.js.map +1 -1
  101. package/dist/stories/data-table/simple-data-table.d.ts +1 -1
  102. package/dist/stories/data-table/simple-data-table.js +1 -1
  103. package/dist/stories/data-table/simple-data-table.js.map +1 -1
  104. package/dist/stories/pagination/pagination.d.ts +1 -1
  105. package/dist/stories/pagination/pagination.js +1 -1
  106. package/dist/stories/pagination/pagination.js.map +1 -1
  107. package/dist/stories/slider/slider.d.ts +1 -1
  108. package/dist/stories/slider/slider.js +1 -1
  109. package/dist/stories/slider/slider.js.map +1 -1
  110. package/index.ts +13 -0
  111. package/package.json +5 -10
  112. package/pagination/icons/arrow-Right.tsx +22 -0
  113. package/pagination/icons/arrow-left.tsx +22 -0
  114. package/pagination/icons/index.ts +7 -0
  115. package/pagination/index.ts +3 -0
  116. package/pagination/pagination.props.ts +33 -0
  117. package/pagination/pagination.tsx +133 -0
  118. package/pagination/use-pagination.ts +49 -0
  119. package/react-app-env.d.ts +1 -0
  120. package/slider/index.ts +3 -0
  121. package/slider/slider.props.ts +39 -0
  122. package/slider/slider.tsx +290 -0
  123. package/stories/calendar/calendar.stories.tsx +25 -0
  124. package/stories/calendar/calendar.tsx +11 -0
  125. package/stories/count-down/count-down.stories.tsx +19 -0
  126. package/stories/count-down/count-down.tsx +11 -0
  127. package/stories/data-table/data-table-columns.tsx +70 -0
  128. package/stories/data-table/default-data-table.stories.tsx +22 -0
  129. package/stories/data-table/default-data-table.tsx +18 -0
  130. package/stories/data-table/dummy-data.ts +204 -0
  131. package/stories/data-table/simple-data-table.stories.tsx +22 -0
  132. package/stories/data-table/simple-data-table.tsx +18 -0
  133. package/stories/pagination/pagination.stories.tsx +35 -0
  134. package/stories/pagination/pagination.tsx +11 -0
  135. package/stories/slider/slider.stories.tsx +19 -0
  136. package/stories/slider/slider.tsx +45 -0
  137. package/stories/wrapper.tsx +11 -0
  138. package/styles.css +28 -0
  139. package/utils/class-names.ts +5 -0
  140. package/utils/persian-to-english-number.ts +4 -0
  141. package/dist/modules/calendar/calendar.js.map +0 -1
  142. package/dist/modules/calendar/calendar.props.js.map +0 -1
  143. package/dist/modules/calendar/config/chunk.js.map +0 -1
  144. package/dist/modules/calendar/config/create-date-range.js.map +0 -1
  145. package/dist/modules/calendar/config/days-in-month.en.js.map +0 -1
  146. package/dist/modules/calendar/config/days-in-month.fa.js.map +0 -1
  147. package/dist/modules/calendar/config/index.js.map +0 -1
  148. package/dist/modules/calendar/config/months.js.map +0 -1
  149. package/dist/modules/calendar/config/week-day.js.map +0 -1
  150. package/dist/modules/calendar/icons/arrow-left-icon.js.map +0 -1
  151. package/dist/modules/calendar/icons/arrow-right-icon.js.map +0 -1
  152. package/dist/modules/calendar/icons/index.js.map +0 -1
  153. package/dist/modules/calendar/index.js.map +0 -1
  154. package/dist/modules/calendar/shared/formatDate.js.map +0 -1
  155. package/dist/modules/calendar/sub-components/day/day.js.map +0 -1
  156. package/dist/modules/calendar/sub-components/day/day.props.js.map +0 -1
  157. package/dist/modules/calendar/sub-components/days/days.js.map +0 -1
  158. package/dist/modules/calendar/sub-components/days/days.props.js.map +0 -1
  159. package/dist/modules/calendar/sub-components/days-head/days-head.js.map +0 -1
  160. package/dist/modules/calendar/sub-components/days-head/days-head.props.js.map +0 -1
  161. package/dist/modules/countdown-timer/countdown.js.map +0 -1
  162. package/dist/modules/countdown-timer/countdown.props.js.map +0 -1
  163. package/dist/modules/countdown-timer/index.js.map +0 -1
  164. package/dist/modules/data-table/data-table.js.map +0 -1
  165. package/dist/modules/data-table/data-table.props.js.map +0 -1
  166. package/dist/modules/data-table/default/default-data-table.js.map +0 -1
  167. package/dist/modules/data-table/default/default-data-table.props.js.map +0 -1
  168. package/dist/modules/data-table/default/index.js.map +0 -1
  169. package/dist/modules/data-table/hooks/use-window-dimensions.js.map +0 -1
  170. package/dist/modules/data-table/icons/add.js.map +0 -1
  171. package/dist/modules/data-table/icons/arrow-down.js.map +0 -1
  172. package/dist/modules/data-table/icons/index.js.map +0 -1
  173. package/dist/modules/data-table/icons/sort.js.map +0 -1
  174. package/dist/modules/data-table/index.js.map +0 -1
  175. package/dist/modules/data-table/simple/index.js.map +0 -1
  176. package/dist/modules/data-table/simple/simple-data-table.js.map +0 -1
  177. package/dist/modules/data-table/simple/simple-data-table.props.js.map +0 -1
  178. package/dist/modules/pagination/icons/arrow-Right.js.map +0 -1
  179. package/dist/modules/pagination/icons/arrow-left.js.map +0 -1
  180. package/dist/modules/pagination/icons/index.js.map +0 -1
  181. package/dist/modules/pagination/index.js.map +0 -1
  182. package/dist/modules/pagination/pagination.js.map +0 -1
  183. package/dist/modules/pagination/pagination.props.js.map +0 -1
  184. package/dist/modules/pagination/use-pagination.js.map +0 -1
  185. package/dist/modules/slider/index.js.map +0 -1
  186. package/dist/modules/slider/slider.js.map +0 -1
  187. package/dist/modules/slider/slider.props.js.map +0 -1
  188. /package/dist/{modules/calendar → calendar}/calendar.d.ts +0 -0
  189. /package/dist/{modules/calendar → calendar}/calendar.js +0 -0
  190. /package/dist/{modules/calendar → calendar}/calendar.props.d.ts +0 -0
  191. /package/dist/{modules/calendar → calendar}/calendar.props.js +0 -0
  192. /package/dist/{modules/calendar → calendar}/config/chunk.d.ts +0 -0
  193. /package/dist/{modules/calendar → calendar}/config/chunk.js +0 -0
  194. /package/dist/{modules/calendar → calendar}/config/create-date-range.d.ts +0 -0
  195. /package/dist/{modules/calendar → calendar}/config/create-date-range.js +0 -0
  196. /package/dist/{modules/calendar → calendar}/config/days-in-month.en.d.ts +0 -0
  197. /package/dist/{modules/calendar → calendar}/config/days-in-month.en.js +0 -0
  198. /package/dist/{modules/calendar → calendar}/config/days-in-month.fa.d.ts +0 -0
  199. /package/dist/{modules/calendar → calendar}/config/days-in-month.fa.js +0 -0
  200. /package/dist/{modules/calendar → calendar}/config/index.d.ts +0 -0
  201. /package/dist/{modules/calendar → calendar}/config/index.js +0 -0
  202. /package/dist/{modules/calendar → calendar}/config/months.d.ts +0 -0
  203. /package/dist/{modules/calendar → calendar}/config/months.js +0 -0
  204. /package/dist/{modules/calendar → calendar}/config/week-day.d.ts +0 -0
  205. /package/dist/{modules/calendar → calendar}/config/week-day.js +0 -0
  206. /package/dist/{modules/calendar → calendar}/icons/arrow-left-icon.d.ts +0 -0
  207. /package/dist/{modules/calendar → calendar}/icons/arrow-left-icon.js +0 -0
  208. /package/dist/{modules/calendar → calendar}/icons/arrow-right-icon.d.ts +0 -0
  209. /package/dist/{modules/calendar → calendar}/icons/arrow-right-icon.js +0 -0
  210. /package/dist/{modules/calendar → calendar}/icons/index.d.ts +0 -0
  211. /package/dist/{modules/calendar → calendar}/icons/index.js +0 -0
  212. /package/dist/{modules/calendar → calendar}/index.d.ts +0 -0
  213. /package/dist/{modules/calendar → calendar}/index.js +0 -0
  214. /package/dist/{modules/calendar → calendar}/shared/formatDate.d.ts +0 -0
  215. /package/dist/{modules/calendar → calendar}/shared/formatDate.js +0 -0
  216. /package/dist/{modules/calendar → calendar}/sub-components/day/day.d.ts +0 -0
  217. /package/dist/{modules/calendar → calendar}/sub-components/day/day.props.d.ts +0 -0
  218. /package/dist/{modules/calendar → calendar}/sub-components/day/day.props.js +0 -0
  219. /package/dist/{modules/calendar → calendar}/sub-components/days/days.d.ts +0 -0
  220. /package/dist/{modules/calendar → calendar}/sub-components/days/days.js +0 -0
  221. /package/dist/{modules/calendar → calendar}/sub-components/days/days.props.d.ts +0 -0
  222. /package/dist/{modules/calendar → calendar}/sub-components/days/days.props.js +0 -0
  223. /package/dist/{modules/calendar → calendar}/sub-components/days-head/days-head.d.ts +0 -0
  224. /package/dist/{modules/calendar → calendar}/sub-components/days-head/days-head.props.d.ts +0 -0
  225. /package/dist/{modules/calendar → calendar}/sub-components/days-head/days-head.props.js +0 -0
  226. /package/dist/{modules/countdown-timer → countdown-timer}/countdown.d.ts +0 -0
  227. /package/dist/{modules/countdown-timer → countdown-timer}/countdown.js +0 -0
  228. /package/dist/{modules/countdown-timer → countdown-timer}/countdown.props.d.ts +0 -0
  229. /package/dist/{modules/countdown-timer → countdown-timer}/countdown.props.js +0 -0
  230. /package/dist/{modules/countdown-timer → countdown-timer}/index.d.ts +0 -0
  231. /package/dist/{modules/countdown-timer → countdown-timer}/index.js +0 -0
  232. /package/dist/{modules/data-table → data-table}/data-table.d.ts +0 -0
  233. /package/dist/{modules/data-table → data-table}/data-table.js +0 -0
  234. /package/dist/{modules/data-table → data-table}/data-table.props.d.ts +0 -0
  235. /package/dist/{modules/data-table → data-table}/data-table.props.js +0 -0
  236. /package/dist/{modules/data-table → data-table}/default/default-data-table.d.ts +0 -0
  237. /package/dist/{modules/data-table → data-table}/default/default-data-table.js +0 -0
  238. /package/dist/{modules/data-table → data-table}/default/default-data-table.props.d.ts +0 -0
  239. /package/dist/{modules/data-table → data-table}/default/default-data-table.props.js +0 -0
  240. /package/dist/{modules/data-table → data-table}/default/index.d.ts +0 -0
  241. /package/dist/{modules/data-table → data-table}/default/index.js +0 -0
  242. /package/dist/{modules/data-table → data-table}/hooks/use-window-dimensions.d.ts +0 -0
  243. /package/dist/{modules/data-table → data-table}/hooks/use-window-dimensions.js +0 -0
  244. /package/dist/{modules/data-table → data-table}/icons/add.d.ts +0 -0
  245. /package/dist/{modules/data-table → data-table}/icons/add.js +0 -0
  246. /package/dist/{modules/data-table → data-table}/icons/arrow-down.d.ts +0 -0
  247. /package/dist/{modules/data-table → data-table}/icons/arrow-down.js +0 -0
  248. /package/dist/{modules/data-table → data-table}/icons/index.d.ts +0 -0
  249. /package/dist/{modules/data-table → data-table}/icons/index.js +0 -0
  250. /package/dist/{modules/data-table → data-table}/icons/sort.d.ts +0 -0
  251. /package/dist/{modules/data-table → data-table}/icons/sort.js +0 -0
  252. /package/dist/{modules/data-table → data-table}/index.d.ts +0 -0
  253. /package/dist/{modules/data-table → data-table}/index.js +0 -0
  254. /package/dist/{modules/data-table → data-table}/simple/index.d.ts +0 -0
  255. /package/dist/{modules/data-table → data-table}/simple/index.js +0 -0
  256. /package/dist/{modules/data-table → data-table}/simple/simple-data-table.d.ts +0 -0
  257. /package/dist/{modules/data-table → data-table}/simple/simple-data-table.js +0 -0
  258. /package/dist/{modules/data-table → data-table}/simple/simple-data-table.props.d.ts +0 -0
  259. /package/dist/{modules/data-table → data-table}/simple/simple-data-table.props.js +0 -0
  260. /package/dist/{modules/pagination → pagination}/icons/arrow-Right.d.ts +0 -0
  261. /package/dist/{modules/pagination → pagination}/icons/arrow-Right.js +0 -0
  262. /package/dist/{modules/pagination → pagination}/icons/arrow-left.d.ts +0 -0
  263. /package/dist/{modules/pagination → pagination}/icons/arrow-left.js +0 -0
  264. /package/dist/{modules/pagination → pagination}/icons/index.d.ts +0 -0
  265. /package/dist/{modules/pagination → pagination}/icons/index.js +0 -0
  266. /package/dist/{modules/pagination → pagination}/index.d.ts +0 -0
  267. /package/dist/{modules/pagination → pagination}/index.js +0 -0
  268. /package/dist/{modules/pagination → pagination}/pagination.d.ts +0 -0
  269. /package/dist/{modules/pagination → pagination}/pagination.js +0 -0
  270. /package/dist/{modules/pagination → pagination}/pagination.props.d.ts +0 -0
  271. /package/dist/{modules/pagination → pagination}/pagination.props.js +0 -0
  272. /package/dist/{modules/pagination → pagination}/use-pagination.d.ts +0 -0
  273. /package/dist/{modules/pagination → pagination}/use-pagination.js +0 -0
  274. /package/dist/{modules/slider → slider}/index.d.ts +0 -0
  275. /package/dist/{modules/slider → slider}/index.js +0 -0
  276. /package/dist/{modules/slider → slider}/slider.d.ts +0 -0
  277. /package/dist/{modules/slider → slider}/slider.props.d.ts +0 -0
  278. /package/dist/{modules/slider → slider}/slider.props.js +0 -0
package/.eslintrc.json ADDED
@@ -0,0 +1,133 @@
1
+ {
2
+ "plugins": [
3
+ "react-hooks"
4
+ ],
5
+ "root": true,
6
+ "rules": {
7
+ "react-hooks/rules-of-hooks": "off",
8
+ "react-hooks/exhaustive-deps": "off",
9
+ "@next/next/no-img-element": "off",
10
+
11
+ "quotes": ["error", "single", { "avoidEscape": true, "allowTemplateLiterals": true }],
12
+ "object-curly-spacing": ["error", "always"],
13
+ "semi": ["error", "always", {"omitLastInOneLineClassBody": true}],
14
+ "semi-style": ["error", "last"],
15
+ "comma-dangle": ["error", "always-multiline"],
16
+ "arrow-spacing": ["error", { "before": true, "after": true }],
17
+ "block-spacing": ["error", "always"],
18
+ "brace-style": [2, "1tbs", { "allowSingleLine": true }],
19
+ "camelcase": ["error", { "properties": "never" }],
20
+ "comma-spacing": ["error", { "before": false, "after": true }],
21
+ "comma-style": ["error", "last"],
22
+ "constructor-super": "error",
23
+ "curly": ["error"],
24
+ "dot-location": ["error", "property"],
25
+
26
+
27
+ "eol-last": 2,
28
+ "eqeqeq": [2, "allow-null"],
29
+ "func-call-spacing": [2, "never"],
30
+ "handle-callback-err": [2, "^(err|error)$" ],
31
+ "indent": [2, 2, { "SwitchCase": 1 }],
32
+ "key-spacing": [2, { "beforeColon": false, "afterColon": true }],
33
+ "keyword-spacing": [2, { "before": true, "after": true }],
34
+ "new-cap": [2, { "newIsCap": true, "capIsNew": false }],
35
+ "new-parens": 2,
36
+ "no-array-constructor": 2,
37
+ "no-caller": 2,
38
+ "no-class-assign": 2,
39
+ "no-cond-assign": 2,
40
+ "no-const-assign": 2,
41
+ "no-constant-condition": [2, { "checkLoops": false }],
42
+ "no-control-regex": 2,
43
+ "no-debugger": 2,
44
+ "no-delete-var": 2,
45
+ "no-dupe-args": 2,
46
+ "no-dupe-class-members": 2,
47
+ "no-dupe-keys": 2,
48
+ "no-duplicate-case": 2,
49
+ "no-duplicate-imports": 2,
50
+ "no-empty-character-class": 2,
51
+ "no-empty-pattern": 2,
52
+ "no-eval": 2,
53
+ "no-ex-assign": 2,
54
+ "no-extend-native": 2,
55
+ "no-extra-bind": 2,
56
+ "no-extra-parens": [2, "functions"],
57
+ "no-fallthrough": 2,
58
+ "no-floating-decimal": 2,
59
+ "no-func-assign": 2,
60
+ "no-global-assign": 2,
61
+ "no-implied-eval": 2,
62
+ "no-inner-declarations": [2, "functions"],
63
+ "no-invalid-regexp": 2,
64
+ "no-irregular-whitespace": 2,
65
+ "no-iterator": 2,
66
+ "no-label-var": 2,
67
+ "no-labels": [2, { "allowLoop": false, "allowSwitch": false }],
68
+ "no-lone-blocks": 2,
69
+ "no-mixed-spaces-and-tabs": 2,
70
+ "no-multi-spaces": 2,
71
+ "no-multi-str": 2,
72
+ "no-multiple-empty-lines": [2, { "max": 1 }],
73
+ "no-native-reassign": 2,
74
+ "no-negated-in-lhs": 2,
75
+ "no-new": 2,
76
+ "no-new-func": 2,
77
+ "no-new-object": 2,
78
+ "no-new-require": 2,
79
+ "no-new-symbol": 2,
80
+ "no-new-wrappers": 2,
81
+ "no-obj-calls": 2,
82
+ "no-octal": 2,
83
+ "no-octal-escape": 2,
84
+ "no-path-concat": 2,
85
+ "no-proto": 2,
86
+ "no-redeclare": 2,
87
+ "no-regex-spaces": 2,
88
+ "no-return-assign": [2, "except-parens"],
89
+ "no-self-assign": 2,
90
+ "no-self-compare": 2,
91
+ "no-sequences": 2,
92
+ "no-shadow-restricted-names": 2,
93
+ "no-sparse-arrays": 2,
94
+ "no-tabs": 2,
95
+ "no-template-curly-in-string": 2,
96
+ "no-this-before-super": 2,
97
+ "no-throw-literal": 2,
98
+ "no-trailing-spaces": 2,
99
+ "no-unexpected-multiline": 2,
100
+ "no-unmodified-loop-condition": 2,
101
+ "no-unneeded-ternary": [2, { "defaultAssignment": false }],
102
+ "no-unreachable": 2,
103
+ "no-unsafe-finally": 2,
104
+ "no-unsafe-negation": 2,
105
+ "no-unused-vars": [2, { "vars": "all", "args": "none" }],
106
+ "no-useless-call": 2,
107
+ "no-useless-computed-key": 2,
108
+ "no-useless-constructor": 2,
109
+ "no-useless-escape": 2,
110
+ "no-useless-rename": 2,
111
+ "no-whitespace-before-property": 2,
112
+ "no-with": 2,
113
+ "object-property-newline": [2, { "allowMultiplePropertiesPerLine": true }],
114
+ "one-var": [2, { "initialized": "never" }],
115
+ "operator-linebreak": [2, "after", { "overrides": { "?": "before", ":": "before" } }],
116
+ "padded-blocks": [2, "never"],
117
+ "rest-spread-spacing": [2, "never"],
118
+ "semi-spacing": [2, { "before": false, "after": true }],
119
+ "space-before-blocks": [2, "always"],
120
+ "space-infix-ops": 2,
121
+ "space-unary-ops": [2, { "words": true, "nonwords": false }],
122
+ "template-curly-spacing": [2, "never"],
123
+ "unicode-bom": [2, "never"],
124
+ "use-isnan": 2,
125
+ "valid-typeof": 2,
126
+ "wrap-iife": [2, "any", { "functionPrototypeMethods": true }],
127
+ "yield-star-spacing": [2, "both"],
128
+ "yoda": [2, "never"]
129
+ },
130
+ "extends": [
131
+ "react-app"
132
+ ]
133
+ }
@@ -0,0 +1,25 @@
1
+ export interface CalendarProps {
2
+ dateFormat?: string
3
+
4
+ selectedDate?: string | Date;
5
+
6
+ disablePreviousMonths?: boolean;
7
+
8
+ disableSubsequentMonths?: boolean;
9
+
10
+ disablePreviousDays?: boolean;
11
+
12
+ disableSubsequentDays?: boolean;
13
+
14
+ onChange: (e: any) => void;
15
+
16
+ selected?: string | Date
17
+
18
+ type?: 'gregorian' | 'jalali'
19
+
20
+ holidays?: Array<string>
21
+
22
+ variant?: 'range' | 'simple'
23
+
24
+ size?: 'tiny' | 'small' | 'medium' | 'large' | 'huge'
25
+ }
@@ -0,0 +1,183 @@
1
+ import React, { useEffect, useState } from 'react';
2
+ import Days from './sub-components/days/days';
3
+ import { daysInMonthEn, daysInMonthFa, IDays } from './config';
4
+ import { CalendarProps } from './calendar.props';
5
+ import formatDate from './shared/formatDate';
6
+ import { Div } from '@pezeshk-book/ui-kit';
7
+ import DateObject from 'react-date-object';
8
+ import persian from 'react-date-object/calendars/persian';
9
+ import persianFa from 'react-date-object/locales/persian_fa';
10
+ import createDateRange from './config/create-date-range';
11
+
12
+ interface IState {
13
+ value: any
14
+ initialValue?: any
15
+ cloneDays: any
16
+ monthName: string
17
+ month: number | string
18
+ year: string
19
+ days: IDays[]
20
+ }
21
+
22
+ const Calender = (props: CalendarProps) => {
23
+ const {
24
+ dateFormat = 'YYYY-MM-DD',
25
+ selectedDate = new Date(),
26
+ disablePreviousMonths = false,
27
+ disableSubsequentMonths = false,
28
+ disablePreviousDays = false,
29
+ disableSubsequentDays = false,
30
+ selected,
31
+ onChange,
32
+ type = 'jalali',
33
+ holidays,
34
+ variant = 'simple',
35
+ size = 'medium',
36
+ } = props;
37
+
38
+ const date = new DateObject({ date: selectedDate });
39
+ const [datepicker, setDatepicker] = useState<IState>({
40
+ value: formatDate(selectedDate, dateFormat, type),
41
+ cloneDays: date,
42
+ monthName: '',
43
+ month: '',
44
+ year: '',
45
+ days: [],
46
+ });
47
+ const [dateRangePicker, setDateRangePicker] = useState<{start: any, end: any}>({
48
+ start: null,
49
+ end: null,
50
+ });
51
+ const [rangeDates, setRangeDates] = useState<Array<string>>([]);
52
+ const [holidayList, setHolidayList] = useState<Array<string>>();
53
+
54
+ useEffect(() => {
55
+ const { monthName, month, days, year } = type === 'gregorian' ? daysInMonthEn(datepicker.cloneDays, dateFormat) : daysInMonthFa(datepicker.cloneDays, dateFormat);
56
+ setDatepicker({
57
+ ...datepicker,
58
+ year: year,
59
+ monthName: monthName,
60
+ month: month,
61
+ days: days,
62
+ initialValue: null,
63
+ });
64
+ }, [type]);
65
+
66
+ useEffect(() => {
67
+ if (holidays && holidays.length) {
68
+ const holidaysFormatList = holidays.map((item) => new DateObject(item).format(dateFormat));
69
+ setHolidayList(holidaysFormatList);
70
+ }
71
+ }, [holidays, dateFormat]);
72
+
73
+ const changeMonths = (amount: number, changeType: 'inc' | 'select'): void => {
74
+ setDatepicker(prevState => {
75
+ const updatedCloneDays = changeType === 'inc' ? prevState.cloneDays.add(amount, 'month') : prevState.cloneDays.setMonth(amount);
76
+ const { monthName, month, days, year } = type === 'gregorian' ? daysInMonthEn(updatedCloneDays, dateFormat) : daysInMonthFa(updatedCloneDays, dateFormat);
77
+
78
+ return {
79
+ ...prevState,
80
+ year,
81
+ monthName,
82
+ month,
83
+ days,
84
+ cloneDays: updatedCloneDays,
85
+ };
86
+ });
87
+ };
88
+
89
+ const changeYear = (selectedYear: string): void => {
90
+ setDatepicker(prevState => {
91
+ const updatedCloneDays = prevState.cloneDays.setYear(parseInt(selectedYear));
92
+ const { monthName, month, days, year } = type === 'gregorian' ? daysInMonthEn(updatedCloneDays, dateFormat) : daysInMonthFa(updatedCloneDays, dateFormat);
93
+
94
+ return {
95
+ ...prevState,
96
+ year,
97
+ monthName,
98
+ month,
99
+ days,
100
+ cloneDays: updatedCloneDays,
101
+ };
102
+ });
103
+ };
104
+
105
+ const selectDay = (e: React.SyntheticEvent<EventTarget>) => {
106
+ const faDate = (e.target as HTMLHtmlElement).dataset.jalaliDate;
107
+ setDatepicker({
108
+ ...datepicker,
109
+ value: faDate,
110
+ });
111
+ };
112
+
113
+ const daysEventListeners = () => {
114
+ return {
115
+ onClick: selectDay,
116
+ };
117
+ };
118
+
119
+ const selectDateHandler = (day: any): void => {
120
+ const clickedDate = new DateObject({ date: day.gregorianDate, calendar: persian, locale: persianFa });
121
+ const jalaliDate = new DateObject({ date: day.jalaliDate, calendar: persian }).format(dateFormat);
122
+ const gregorianDate = new DateObject({ date: day.gregorianDate }).format(dateFormat);
123
+ onChange({ calendarDate: clickedDate, gregorianDate, jalaliDate });
124
+ };
125
+
126
+ const selectDateRangeHandler = ({ start, end } : {start: any, end: any}): void => {
127
+ setDateRangePicker({ start: start, end: end });
128
+
129
+ const clickedStartDate = new DateObject({ date: start?.gregorianDate, calendar: persian, locale: persianFa });
130
+ const jalaliStartDate = new DateObject({ date: start?.jalaliDate, calendar: persian }).format(dateFormat);
131
+ const gregorianStartDate = new DateObject({ date: start?.gregorianDate }).format(dateFormat);
132
+
133
+ const clickedEndDate = new DateObject({ date: end?.gregorianDate, calendar: persian, locale: persianFa });
134
+ const jalaliEndDate = new DateObject({ date: end?.jalaliDate, calendar: persian }).format(dateFormat);
135
+ const gregorianEndDate = new DateObject({ date: end?.gregorianDate }).format(dateFormat);
136
+
137
+ onChange({
138
+ start: start ? { calendarDate: clickedStartDate, gregorianStartDate, jalaliStartDate } : null,
139
+ end: end ? { calendarDate: clickedEndDate, gregorianEndDate, jalaliEndDate } : null,
140
+ });
141
+
142
+ if (start && end) {
143
+ const range = createDateRange({ startDate: start.gregorianDate, stopDate: end.gregorianDate });
144
+ setRangeDates(range);
145
+ } else {
146
+ setRangeDates([]);
147
+ }
148
+ };
149
+
150
+ return (
151
+ <Div dir={'rtl'} className={'items-center flex flex-col justify-center bg-white rounded py-4 !w-full'}>
152
+ <Days
153
+ days={datepicker.days}
154
+ monthName={datepicker.monthName}
155
+ year={datepicker.year}
156
+ selectedDay={datepicker.value}
157
+ disablePreviousMonths={disablePreviousMonths}
158
+ disableSubsequentMonths={disableSubsequentMonths}
159
+ disablePreviousDays={disablePreviousDays}
160
+ disableSubsequentDays={disableSubsequentDays}
161
+ daysEventListeners={daysEventListeners}
162
+ selectDateHandlers={selectDateHandler}
163
+ selectDateRangeHandlers={selectDateRangeHandler}
164
+ selected={new DateObject({ date: selected }).format(dateFormat)}
165
+ date={date}
166
+ increaseMonth={() => changeMonths(1, 'inc')}
167
+ decreaseMonth={() => changeMonths(-1, 'inc')}
168
+ changeMonth={(monthIndex : number) => changeMonths(monthIndex, 'select')}
169
+ isDatePicker={true}
170
+ dateFormat={dateFormat}
171
+ type={type}
172
+ holidays={holidayList}
173
+ variant={variant}
174
+ rangeDate={dateRangePicker}
175
+ rangeDates={rangeDates}
176
+ size={size}
177
+ changeYear={changeYear}
178
+ />
179
+ </Div>
180
+ );
181
+ };
182
+
183
+ export default Calender;
@@ -0,0 +1,42 @@
1
+ function slice(array: [], start: number, end: number) {
2
+ let length = array == null ? 0 : array.length;
3
+ if (!length) {
4
+ return [];
5
+ }
6
+ start = start == null ? 0 : start;
7
+ end = end === undefined ? length : end;
8
+
9
+ if (start < 0) {
10
+ start = -start > length ? 0 : length + start;
11
+ }
12
+ end = end > length ? length : end;
13
+ if (end < 0) {
14
+ end += length;
15
+ }
16
+ // @ts-ignore
17
+ length = start > end ? 0 : (end - start) >>> 0;
18
+ start >>>= 0;
19
+
20
+ let index = -1;
21
+ const result = new Array(length);
22
+ while (++index < length) {
23
+ result[index] = array[index + start];
24
+ }
25
+ return result;
26
+ }
27
+
28
+ export function chunk(array: any, size: any) {
29
+ size = Math.max(size, 0);
30
+ const length = array == null ? 0 : array.length;
31
+ if (!length || size < 1) {
32
+ return [];
33
+ }
34
+ let index = 0;
35
+ let resIndex = 0;
36
+ const result = new Array(Math.ceil(length / size));
37
+
38
+ while (index < length) {
39
+ result[resIndex++] = slice(array, index, (index += size));
40
+ }
41
+ return result;
42
+ }
@@ -0,0 +1,14 @@
1
+ import DateObject from 'react-date-object';
2
+
3
+ const createDateRange = ({ startDate, stopDate } : {startDate: string, stopDate: string}): Array<string> => {
4
+ const dateArray = [];
5
+ let start = new DateObject(startDate);
6
+ const end = new DateObject(stopDate);
7
+ while (start <= end) {
8
+ dateArray.push( new DateObject(start).format('YYYY-MM-DD') );
9
+ start = new DateObject(start).add(1, 'days');
10
+ }
11
+ return dateArray;
12
+ };
13
+
14
+ export default createDateRange;
@@ -0,0 +1,47 @@
1
+ import persian from 'react-date-object/calendars/persian';
2
+ import gregorianEn from 'react-date-object/locales/gregorian_en';
3
+ import DateObject from 'react-date-object';
4
+ import gregorian from 'react-date-object/calendars/gregorian';
5
+
6
+ export interface IDays {
7
+ day: number;
8
+ gregorianDate: string;
9
+ jalaliDate: string;
10
+ disabled: boolean;
11
+ }
12
+
13
+ export interface IDaysInMonth {
14
+ days: IDays[];
15
+ monthName: string;
16
+ month: number;
17
+ today?: string;
18
+ year: string
19
+ }
20
+
21
+ export const daysInMonthEn = (date: any, dateFormat: string): IDaysInMonth => {
22
+ date.calendar = gregorian;
23
+ date.locale = gregorianEn;
24
+ const monthName = date.month.name;
25
+ const { month, year } = date;
26
+ const firstDayWeekDay = new DateObject({ date: `${year} ${month} 1`, calendar: gregorian }).weekDay.number;
27
+ // Calculate the number of empty cells needed before the first day of the month
28
+ const emptyCellsCount = (firstDayWeekDay + 7) % 7;
29
+ const lastDayOfPreviousMonth = new DateObject({date: `${year} ${month - 1} 31`, calendar: gregorian});
30
+ // Calculate the empty days from the previous month
31
+ const emptyDays = [...Array(emptyCellsCount)].map((_, i) => lastDayOfPreviousMonth.month.length - emptyCellsCount + i + 1);
32
+ // Create an array of day objects for the current month
33
+ const currentMonthDays = Array.from({ length: date.month.length }, (_, i) => {
34
+ const dayNumber = i + 1;
35
+ const gregorianDate = new DateObject({ date: (`${year} ${month} ${dayNumber}`), calendar: gregorian }).format(dateFormat);
36
+ const jalaliDate = new DateObject({ date: (`${year} ${month} ${dayNumber}`), calendar: gregorian }).convert(persian).format(dateFormat);
37
+ return { day: dayNumber, gregorianDate, jalaliDate, disabled: false };
38
+ });
39
+ const allDays = [...emptyDays.map((day) => ({
40
+ day,
41
+ gregorianDate: new DateObject({date: (`${year} ${month} ${day}`), calendar: gregorian}).format(dateFormat),
42
+ jalaliDate: new DateObject({date: (`${year} ${month} ${day}`), calendar: gregorian}).convert(persian).format(dateFormat),
43
+ disabled: true
44
+ })), ...currentMonthDays];
45
+
46
+ return { monthName, month, days: allDays, year };
47
+ };
@@ -0,0 +1,37 @@
1
+ import persian from 'react-date-object/calendars/persian';
2
+ import persianFa from 'react-date-object/locales/persian_fa';
3
+ import DateObject from 'react-date-object';
4
+ import gregorian from 'react-date-object/calendars/gregorian';
5
+ import { IDaysInMonth } from './days-in-month.en';
6
+ export const daysInMonthFa = (date: any, dateFormat: string): IDaysInMonth => {
7
+ date.calendar = persian;
8
+ date.locale = persianFa;
9
+ const monthName = date.month.name;
10
+ const { month, year } = date;
11
+ const firstDayWeekDay = new DateObject({ date: `${year} ${month} 1`, calendar: persian }).weekDay.number;
12
+
13
+ // Calculate the number of empty cells needed before the first day of the month
14
+ const emptyCellsCount = (firstDayWeekDay + 6) % 7;
15
+
16
+ const lastDayOfPreviousMonth = new DateObject({ date: `${year} ${month - 1} 31`, calendar: persian });
17
+
18
+ // Calculate the empty days from the previous month
19
+ const emptyDays = [...Array(emptyCellsCount)].map((_, i) => lastDayOfPreviousMonth.month.length - emptyCellsCount + i + 1);
20
+
21
+ // Create an array of day objects for the current month
22
+ const currentMonthDays = Array.from({ length: date.month.length }, (_, i) => {
23
+ const dayNumber = i + 1;
24
+ const gregorianDate = new DateObject({ date: (`${year} ${month} ${dayNumber}`), calendar: persian }).convert(gregorian).format(dateFormat);
25
+ const jalaliDate = new DateObject({ date: (`${year} ${month} ${dayNumber}`), calendar: persian }).format(dateFormat);
26
+ return { day: dayNumber, gregorianDate, jalaliDate, disabled: false };
27
+ });
28
+
29
+ const allDays = [...emptyDays.map((day) => ({
30
+ day,
31
+ gregorianDate: new DateObject({ date: (`${year} ${month} ${day}`), calendar: persian }).convert(gregorian).format(dateFormat),
32
+ jalaliDate: new DateObject({ date: (`${year} ${month} ${day}`), calendar: persian }).format(dateFormat),
33
+ disabled: true,
34
+ })), ...currentMonthDays];
35
+
36
+ return { monthName, month, days: allDays, year };
37
+ };
@@ -0,0 +1,16 @@
1
+ import { fa, weekDayNames } from './week-day';
2
+ import { chunk } from './chunk';
3
+ import { daysInMonthEn, IDays, IDaysInMonth } from './days-in-month.en';
4
+ import { daysInMonthFa } from './days-in-month.fa';
5
+
6
+ export {
7
+ daysInMonthEn,
8
+ daysInMonthFa,
9
+ fa,
10
+ weekDayNames,
11
+ chunk,
12
+ };
13
+ export type {
14
+ IDaysInMonth,
15
+ IDays,
16
+ };
@@ -0,0 +1,29 @@
1
+ export const jalaliMonths = [
2
+ { name: 'فروردین', value: 1 },
3
+ { name: 'اردیبهشت', value: 2 },
4
+ { name: 'خرداد', value: 3 },
5
+ { name: 'تیر', value: 4 },
6
+ { name: 'مرداد', value: 5 },
7
+ { name: 'شهریور', value: 6 },
8
+ { name: 'مهر', value: 7 },
9
+ { name: 'آبان', value: 8 },
10
+ { name: 'آذر', value: 9 },
11
+ { name: 'دی', value: 10 },
12
+ { name: 'بهمن', value: 11 },
13
+ { name: 'اسفند', value: 12 },
14
+ ];
15
+
16
+ export const gregorianMonths = [
17
+ { name: 'Jan', value: 1 },
18
+ { name: 'Feb', value: 2 },
19
+ { name: 'Mar', value: 3 },
20
+ { name: 'Apr', value: 4 },
21
+ { name: 'May', value: 5 },
22
+ { name: 'Jun', value: 6 },
23
+ { name: 'Jul', value: 7 },
24
+ { name: 'Aug', value: 8 },
25
+ { name: 'Sep', value: 9 },
26
+ { name: 'Oct', value: 10 },
27
+ { name: 'Nov', value: 11 },
28
+ { name: 'Dec', value: 12 },
29
+ ];
@@ -0,0 +1,19 @@
1
+ export const fa = (n: any) => {
2
+ if (process.env.NODE_ENV === 'test') {
3
+ return n;
4
+ }
5
+ return Number(n).toLocaleString('fa', {
6
+ useGrouping: false,
7
+ });
8
+ };
9
+
10
+ export const weekDayNames = {
11
+ jalali: {
12
+ normal: ['شنبه', 'یکشنبه', 'دوشنبه', 'سه شنبه', 'چهارشنبه', 'پنجشنبه', 'جمعه'],
13
+ short: ['ش', 'ی', 'د', 'س', 'چ', 'پ', 'ج'],
14
+ },
15
+ gregorian: {
16
+ normal: ['Saturday', 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'],
17
+ short: ['Sat', 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri'],
18
+ },
19
+ };
@@ -0,0 +1,14 @@
1
+ const ArrowLeftIcon = () => {
2
+ return (
3
+ <svg xmlns="http://www.w3.org/2000/svg" width="6" height="12" viewBox="0 0 6 12">
4
+ <path
5
+ fill={'currentColor'}
6
+ transform="rotate(-90 6 6)"
7
+ data-name="Path 28691"
8
+ d="M5.29.253a1.121 1.121 0 0 1 1.419 0l5 4.28a.775.775 0 0 1 0 1.215 1.126 1.126 0 0 1-1.419 0L6 2.068l-4.287 3.68a1.126 1.126 0 0 1-1.419 0 .775.775 0 0 1 0-1.215z"
9
+ />
10
+ </svg>
11
+ );
12
+ };
13
+
14
+ export default ArrowLeftIcon;
@@ -0,0 +1,14 @@
1
+ const ArrowRightIcon = () => {
2
+ return (
3
+ <svg xmlns="http://www.w3.org/2000/svg" width="6" height="12" viewBox="0 0 6 12">
4
+ <path
5
+ fill={'currentColor'}
6
+ transform="rotate(-90 6 6)"
7
+ data-name="Path 28692"
8
+ d="M5.29 5.747a1.121 1.121 0 0 0 1.419 0l5-4.28a.775.775 0 0 0 0-1.215 1.126 1.126 0 0 0-1.419 0L6 3.932 1.713.252a1.126 1.126 0 0 0-1.419 0 .775.775 0 0 0 0 1.215z"
9
+ />
10
+ </svg>
11
+ );
12
+ };
13
+
14
+ export default ArrowRightIcon;
@@ -0,0 +1,7 @@
1
+ import ArrowLeftIcon from './arrow-left-icon';
2
+ import ArrowRightIcon from './arrow-right-icon';
3
+
4
+ export {
5
+ ArrowLeftIcon,
6
+ ArrowRightIcon,
7
+ };
@@ -0,0 +1,3 @@
1
+ import Calendar from './calendar';
2
+
3
+ export default Calendar;
@@ -0,0 +1,12 @@
1
+ import DateObject from 'react-date-object';
2
+ import persian from 'react-date-object/calendars/persian';
3
+ import gregorian from 'react-date-object/calendars/gregorian';
4
+
5
+ export default function formatDate(data: Date | number | string, format: string = 'YYYY-MM-DD', type: 'gregorian' | 'jalali') {
6
+ if (data) {
7
+ const date = new DateObject(data);
8
+ date.calendar = type === 'gregorian' ? gregorian : persian;
9
+ return date.format(format);
10
+ }
11
+ return null;
12
+ }
@@ -0,0 +1,27 @@
1
+ export interface DayProps {
2
+ isSelecting?: boolean;
3
+
4
+ selectedDay?: boolean;
5
+
6
+ selected: boolean;
7
+
8
+ handleDay: ((event: string) => void);
9
+
10
+ children: any;
11
+
12
+ disabledDay?: boolean;
13
+
14
+ holidays?: boolean;
15
+
16
+ passedDay?: boolean;
17
+
18
+ comingDay?: boolean;
19
+
20
+ isRange?: boolean
21
+
22
+ size?: 'tiny' | 'small' | 'medium' | 'large' | 'huge'
23
+
24
+ startRange?: boolean
25
+
26
+ endRange?: boolean
27
+ }
@@ -0,0 +1,31 @@
1
+ import { DayProps } from './day.props';
2
+ import classNames from '../../../utils/class-names';
3
+ import { Button, Div } from '@pezeshk-book/ui-kit';
4
+
5
+ export const Day = (props: DayProps) => {
6
+ const { children, disabledDay, holidays, passedDay, comingDay, selectedDay, selected, handleDay, isRange, startRange, endRange } = props;
7
+
8
+ if (!children) {
9
+ return <Div {...props}/>;
10
+ }
11
+
12
+ const color = passedDay ? 'control' : selected ? 'primary' : isRange ? 'slate' : selectedDay ? 'primary' : (disabledDay || holidays ? 'danger' : 'inherit');
13
+ const variant = selected ? 'filled' : (isRange ? 'outlined' : 'text');
14
+ return (
15
+ <Button
16
+ disabled={comingDay || passedDay}
17
+ variant={variant}
18
+ rounded={isRange ? 'none' : 'medium'}
19
+ size={'medium'}
20
+ shape={'square'}
21
+ color={color}
22
+ className={classNames(
23
+ isRange ? 'border-l-0 border-r-0 border-dashed' : '',
24
+ startRange && isRange ? 'rounded-r-lg rounded-l-none' : '',
25
+ endRange && isRange ? 'rounded-l-lg rounded-r-none' : '',
26
+ )}
27
+ onClick={handleDay}
28
+ {...props}
29
+ />
30
+ );
31
+ };