zaman-backoffice 1.0.2 → 1.0.4

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 (196) hide show
  1. package/dist/components/CalendarItem/CalendarItem.styled.d.ts +10 -0
  2. package/dist/components/CalendarItem/CalendarItem.types.d.ts +7 -0
  3. package/dist/components/CalendarItem/index.d.ts +1 -0
  4. package/dist/components/CalendarWrapper/CalendarWrapper.styled.d.ts +5 -0
  5. package/dist/components/CalendarWrapper/index.d.ts +1 -0
  6. package/dist/components/FloatingElement/FloatingElement.d.ts +4 -0
  7. package/dist/components/FloatingElement/FloatingElement.styled.d.ts +4 -0
  8. package/dist/components/FloatingElement/FloatingElement.types.d.ts +7 -0
  9. package/dist/components/FloatingElement/index.d.ts +1 -0
  10. package/dist/components/Header/Header.d.ts +3 -0
  11. package/dist/components/Header/Header.styled.d.ts +12 -0
  12. package/dist/components/Header/Header.types.d.ts +6 -0
  13. package/dist/components/Header/index.d.ts +1 -0
  14. package/dist/components/IconButton/IconButton.d.ts +2 -0
  15. package/dist/components/IconButton/IconButton.styled.d.ts +4 -0
  16. package/dist/components/IconButton/index.d.ts +1 -0
  17. package/dist/components/Icons/ChevronLeft/index.d.ts +2 -0
  18. package/dist/components/Icons/ChevronRight/index.d.ts +2 -0
  19. package/dist/components/Modal/Modal.d.ts +3 -0
  20. package/dist/components/Modal/Modal.styled.d.ts +4 -0
  21. package/dist/components/Modal/index.d.ts +1 -0
  22. package/dist/components/Modal/types.d.ts +6 -0
  23. package/dist/components/MonthPicker/Month.styled.d.ts +4 -0
  24. package/dist/components/MonthPicker/MonthPicker.d.ts +3 -0
  25. package/dist/components/MonthPicker/MonthPicker.types.d.ts +4 -0
  26. package/dist/components/MonthPicker/index.d.ts +1 -0
  27. package/dist/components/RenderCalendar/RenderCalendar.d.ts +3 -0
  28. package/dist/components/RenderCalendar/RenderCalendar.types.d.ts +9 -0
  29. package/dist/components/RenderCalendar/index.d.ts +1 -0
  30. package/dist/components/YearPicker/YearPicker.d.ts +3 -0
  31. package/dist/components/YearPicker/YearPicker.styled.d.ts +4 -0
  32. package/dist/components/YearPicker/YearPicker.types.d.ts +4 -0
  33. package/dist/components/YearPicker/index.d.ts +1 -0
  34. package/dist/constants.d.ts +5 -0
  35. package/dist/hooks/useCalendarHandlers.d.ts +19 -0
  36. package/dist/hooks/useClickOutside.d.ts +3 -0
  37. package/dist/hooks/useSlideCalendar.d.ts +12 -0
  38. package/dist/hooks/useTimePicker.d.ts +19 -0
  39. package/dist/index.cjs.js +303 -0
  40. package/dist/index.d.ts +4 -0
  41. package/dist/index.js +303 -0
  42. package/dist/packages/Calendar/Calendar.d.ts +4 -0
  43. package/dist/packages/Calendar/Calendar.styled.d.ts +20 -0
  44. package/dist/packages/Calendar/Calendar.types.d.ts +19 -0
  45. package/dist/packages/Calendar/index.d.ts +2 -0
  46. package/dist/packages/CalendarProvider/CalendarProvider.d.ts +3 -0
  47. package/dist/packages/CalendarProvider/CalendarProvider.types.d.ts +5 -0
  48. package/{src/packages/CalendarProvider/index.ts → dist/packages/CalendarProvider/index.d.ts} +2 -2
  49. package/dist/packages/DatePicker/DatePicker.d.ts +3 -0
  50. package/dist/packages/DatePicker/DatePicker.types.d.ts +15 -0
  51. package/dist/packages/DatePicker/index.d.ts +2 -0
  52. package/dist/packages/TimePicker/TimePicker.d.ts +3 -0
  53. package/dist/packages/TimePicker/TimePicker.styled.d.ts +37 -0
  54. package/dist/packages/TimePicker/TimePicker.types.d.ts +14 -0
  55. package/dist/packages/TimePicker/components/Numbers/Numbers.d.ts +3 -0
  56. package/dist/packages/TimePicker/components/Numbers/Numbers.styled.d.ts +9 -0
  57. package/dist/packages/TimePicker/components/Numbers/Numbers.types.d.ts +13 -0
  58. package/dist/packages/TimePicker/components/Numbers/index.d.ts +1 -0
  59. package/dist/packages/TimePicker/index.d.ts +2 -0
  60. package/dist/style/animation.d.ts +2 -0
  61. package/dist/style/classNames.d.ts +7 -0
  62. package/dist/style/colorPallete.d.ts +1 -0
  63. package/dist/style/colors.d.ts +5 -0
  64. package/dist/style/hexToHSL.d.ts +6 -0
  65. package/dist/style/radius.d.ts +7 -0
  66. package/dist/types.d.ts +41 -0
  67. package/dist/utils/dateHelper/dateHelper.d.ts +15 -0
  68. package/dist/utils/dateHelper/index.d.ts +1 -0
  69. package/dist/utils/dateTimeFormat/dateTimeFormat.d.ts +13 -0
  70. package/dist/utils/dateTimeFormat/index.d.ts +1 -0
  71. package/dist/utils/format/format.d.ts +4 -0
  72. package/dist/utils/format/format.types.d.ts +10 -0
  73. package/dist/utils/format/index.d.ts +1 -0
  74. package/dist/utils/index.d.ts +3 -0
  75. package/dist/utils/locale.d.ts +6 -0
  76. package/dist/utils/locales/en.d.ts +3 -0
  77. package/dist/utils/locales/fa.d.ts +3 -0
  78. package/dist/utils/locales/index.d.ts +3 -0
  79. package/dist/utils/locales/locales.types.d.ts +12 -0
  80. package/dist/utils/month/index.d.ts +1 -0
  81. package/dist/utils/month/month.d.ts +5 -0
  82. package/dist/utils/month/month.types.d.ts +10 -0
  83. package/dist/utils/timePicker.d.ts +36 -0
  84. package/package.json +1 -1
  85. package/.eslintrc.cjs +0 -26
  86. package/.husky/commit-msg +0 -4
  87. package/.husky/pre-commit +0 -4
  88. package/.idea/git_toolbox_blame.xml +0 -6
  89. package/.idea/git_toolbox_prj.xml +0 -15
  90. package/.idea/inspectionProfiles/Project_Default.xml +0 -6
  91. package/.idea/material_theme_project_new.xml +0 -12
  92. package/.idea/modules.xml +0 -8
  93. package/.idea/vcs.xml +0 -6
  94. package/.idea/zaman-backoffice2.iml +0 -12
  95. package/.prettierrc +0 -9
  96. package/.travis.yml +0 -10
  97. package/client/index.html +0 -12
  98. package/client/main.tsx +0 -84
  99. package/client/style.css +0 -62
  100. package/cypress/fixtures/example.json +0 -5
  101. package/cypress/support/commands.ts +0 -38
  102. package/cypress/support/component-index.html +0 -12
  103. package/cypress/support/component.ts +0 -39
  104. package/cypress/videos/Calendar/CalendarComponent.cy.tsx.mp4 +0 -0
  105. package/cypress/videos/DatePicker/DatePicker.cy.tsx.mp4 +0 -0
  106. package/cypress.config.ts +0 -10
  107. package/help/banner.png +0 -0
  108. package/jest.config.ts +0 -47
  109. package/src/components/CalendarItem/CalendarItem.styled.tsx +0 -96
  110. package/src/components/CalendarItem/CalendarItem.types.ts +0 -7
  111. package/src/components/CalendarItem/index.ts +0 -1
  112. package/src/components/CalendarWrapper/CalendarWrapper.styled.tsx +0 -19
  113. package/src/components/CalendarWrapper/index.ts +0 -1
  114. package/src/components/FloatingElement/FloatingElement.styled.tsx +0 -8
  115. package/src/components/FloatingElement/FloatingElement.tsx +0 -83
  116. package/src/components/FloatingElement/FloatingElement.types.ts +0 -8
  117. package/src/components/FloatingElement/index.tsx +0 -1
  118. package/src/components/Header/Header.styled.tsx +0 -40
  119. package/src/components/Header/Header.tsx +0 -46
  120. package/src/components/Header/Header.types.ts +0 -6
  121. package/src/components/Header/index.ts +0 -1
  122. package/src/components/IconButton/IconButton.styled.tsx +0 -22
  123. package/src/components/IconButton/IconButton.tsx +0 -3
  124. package/src/components/IconButton/index.tsx +0 -1
  125. package/src/components/Icons/ChevronLeft/index.tsx +0 -22
  126. package/src/components/Icons/ChevronRight/index.tsx +0 -22
  127. package/src/components/Modal/Modal.styled.tsx +0 -23
  128. package/src/components/Modal/Modal.tsx +0 -29
  129. package/src/components/Modal/index.tsx +0 -1
  130. package/src/components/Modal/types.ts +0 -7
  131. package/src/components/MonthPicker/Month.styled.tsx +0 -11
  132. package/src/components/MonthPicker/MonthPicker.tsx +0 -35
  133. package/src/components/MonthPicker/MonthPicker.types.ts +0 -4
  134. package/src/components/MonthPicker/index.ts +0 -1
  135. package/src/components/RenderCalendar/RenderCalendar.tsx +0 -31
  136. package/src/components/RenderCalendar/RenderCalendar.types.ts +0 -10
  137. package/src/components/RenderCalendar/index.ts +0 -1
  138. package/src/components/YearPicker/YearPicker.styled.tsx +0 -14
  139. package/src/components/YearPicker/YearPicker.tsx +0 -49
  140. package/src/components/YearPicker/YearPicker.types.ts +0 -4
  141. package/src/components/YearPicker/index.ts +0 -1
  142. package/src/constants.ts +0 -6
  143. package/src/hooks/__tests__/useClickOutside.test.tsx +0 -32
  144. package/src/hooks/useCalendarHandlers.tsx +0 -113
  145. package/src/hooks/useClickOutside.tsx +0 -23
  146. package/src/hooks/useSlideCalendar.tsx +0 -95
  147. package/src/hooks/useTimePicker.tsx +0 -95
  148. package/src/index.tsx +0 -4
  149. package/src/packages/Calendar/Calendar.styled.tsx +0 -42
  150. package/src/packages/Calendar/Calendar.tsx +0 -159
  151. package/src/packages/Calendar/Calendar.types.ts +0 -31
  152. package/src/packages/Calendar/CalendarComponent.cy.tsx +0 -69
  153. package/src/packages/Calendar/index.ts +0 -2
  154. package/src/packages/CalendarProvider/CalendarProvider.tsx +0 -30
  155. package/src/packages/CalendarProvider/CalendarProvider.types.ts +0 -6
  156. package/src/packages/DatePicker/DatePicker.cy.tsx +0 -54
  157. package/src/packages/DatePicker/DatePicker.tsx +0 -127
  158. package/src/packages/DatePicker/DatePicker.types.ts +0 -26
  159. package/src/packages/DatePicker/index.ts +0 -2
  160. package/src/packages/TimePicker/TimePicker.styled.tsx +0 -77
  161. package/src/packages/TimePicker/TimePicker.tsx +0 -121
  162. package/src/packages/TimePicker/TimePicker.types.ts +0 -16
  163. package/src/packages/TimePicker/components/Numbers/Numbers.styled.tsx +0 -36
  164. package/src/packages/TimePicker/components/Numbers/Numbers.tsx +0 -58
  165. package/src/packages/TimePicker/components/Numbers/Numbers.types.ts +0 -14
  166. package/src/packages/TimePicker/components/Numbers/index.ts +0 -1
  167. package/src/packages/TimePicker/index.ts +0 -2
  168. package/src/style/animation.ts +0 -23
  169. package/src/style/classNames.ts +0 -8
  170. package/src/style/colorPallete.ts +0 -16
  171. package/src/style/colors.ts +0 -15
  172. package/src/style/hexToHSL.ts +0 -52
  173. package/src/style/radius.ts +0 -28
  174. package/src/types.ts +0 -75
  175. package/src/utils/dateHelper/dateHelper.ts +0 -67
  176. package/src/utils/dateHelper/index.ts +0 -1
  177. package/src/utils/dateTimeFormat/dateTimeFormat.ts +0 -43
  178. package/src/utils/dateTimeFormat/index.ts +0 -1
  179. package/src/utils/format/format.test.ts +0 -37
  180. package/src/utils/format/format.ts +0 -56
  181. package/src/utils/format/format.types.ts +0 -11
  182. package/src/utils/format/index.ts +0 -1
  183. package/src/utils/index.ts +0 -21
  184. package/src/utils/locale.ts +0 -13
  185. package/src/utils/locales/en.ts +0 -89
  186. package/src/utils/locales/fa.ts +0 -89
  187. package/src/utils/locales/index.ts +0 -10
  188. package/src/utils/locales/locales.types.ts +0 -11
  189. package/src/utils/month/index.ts +0 -1
  190. package/src/utils/month/month.ts +0 -54
  191. package/src/utils/month/month.types.ts +0 -11
  192. package/src/utils/timePicker.ts +0 -107
  193. package/src/utils/type.ts +0 -0
  194. package/tsconfig.json +0 -22
  195. package/tsconfig.test.json +0 -7
  196. package/vite.config.ts +0 -7
@@ -0,0 +1,15 @@
1
+ export declare const sameMonth: (date: Date, date2: Date) => boolean;
2
+ export declare const sameDay: (date?: Date, date2?: Date) => boolean;
3
+ export declare const getYears: (date: Date, from?: number, to?: number) => number[];
4
+ export declare const selectMonth: (date: Date, selectedMonth: number) => Date;
5
+ export declare const selectYear: (date: Date, selectedYear: number) => Date;
6
+ export declare const isInBetween: (day: Date, from?: Date | null, to?: Date | null) => boolean;
7
+ declare const _default: {
8
+ sameMonth: (date: Date, date2: Date) => boolean;
9
+ sameDay: (date?: Date | undefined, date2?: Date | undefined) => boolean;
10
+ getYears: (date: Date, from?: number, to?: number) => number[];
11
+ selectMonth: (date: Date, selectedMonth: number) => Date;
12
+ selectYear: (date: Date, selectedYear: number) => Date;
13
+ isInBetween: (day: Date, from?: Date | null | undefined, to?: Date | null | undefined) => boolean;
14
+ };
15
+ export default _default;
@@ -0,0 +1 @@
1
+ export { default } from './dateHelper';
@@ -0,0 +1,13 @@
1
+ export declare const getDateFormat: (date: Date, options: Intl.DateTimeFormatOptions, numberingSystem?: string) => string;
2
+ export declare const getDayOfMonth: (date: Date) => number;
3
+ export declare const getDayString: (date: Date, numberingSystem?: string) => string;
4
+ export declare const getYear: (date: Date, numberingSystem?: string) => string;
5
+ export declare const getYear2Digit: (date: Date, numberingSystem?: string) => string;
6
+ export declare const getMonthName: (date: Date, numberingSystem?: string) => string;
7
+ export declare const getMonth: (date: Date, numberingSystem?: string) => string;
8
+ declare const _default: {
9
+ getDayOfMonth: (date: Date) => number;
10
+ getMonth: (date: Date, numberingSystem?: string | undefined) => string;
11
+ getMonthName: (date: Date, numberingSystem?: string | undefined) => string;
12
+ };
13
+ export default _default;
@@ -0,0 +1 @@
1
+ export { default } from './dateTimeFormat';
@@ -0,0 +1,4 @@
1
+ import { type formatFunctions, type Formats } from './format.types';
2
+ export declare const formats: Record<Formats, formatFunctions>;
3
+ export declare const formatDate: (date: Date, format: string, numberingSystem?: string) => string;
4
+ export default formatDate;
@@ -0,0 +1,10 @@
1
+ export type formatFunctions = (date: Date, numberingSystem?: string) => string;
2
+ export declare enum Formats {
3
+ M = "M",
4
+ MM = "MM",
5
+ MMMM = "MMMM",
6
+ YY = "YY",
7
+ YYYY = "YYYY",
8
+ DD = "DD",
9
+ D = "D"
10
+ }
@@ -0,0 +1 @@
1
+ export { default } from './format';
@@ -0,0 +1,3 @@
1
+ export declare const isRtl: () => boolean;
2
+ export declare const localizeNumber: (n: string | number) => string | number;
3
+ export declare const weekDayNames: string[];
@@ -0,0 +1,6 @@
1
+ declare const localeCache: {
2
+ localeDefault: string;
3
+ setLocale(locale?: string): void;
4
+ readonly locale: string;
5
+ };
6
+ export default localeCache;
@@ -0,0 +1,3 @@
1
+ import type { LocalesTypes } from './locales.types';
2
+ export declare const en: LocalesTypes;
3
+ export default en;
@@ -0,0 +1,3 @@
1
+ import type { LocalesTypes } from './locales.types';
2
+ export declare const fa: LocalesTypes;
3
+ export default fa;
@@ -0,0 +1,3 @@
1
+ import type { LocalesTypes } from './locales.types';
2
+ declare const locales: Record<string, LocalesTypes>;
3
+ export default locales;
@@ -0,0 +1,12 @@
1
+ interface localesNames {
2
+ key: number;
3
+ name: string;
4
+ }
5
+ export interface LocalesTypes {
6
+ shortWeekDays: localesNames[];
7
+ months: localesNames[];
8
+ format: string;
9
+ am: string;
10
+ pm: string;
11
+ }
12
+ export {};
@@ -0,0 +1 @@
1
+ export { default } from './month';
@@ -0,0 +1,5 @@
1
+ import 'dayjs/locale/fa';
2
+ import type { DaysInMonth } from './month.types';
3
+ import { type DatePickerValue } from '../../types';
4
+ declare const getDays: (date: DatePickerValue | undefined) => DaysInMonth;
5
+ export default getDays;
@@ -0,0 +1,10 @@
1
+ export interface WeekDays {
2
+ date: Date;
3
+ disabled: boolean;
4
+ }
5
+ export interface DaysInMonth {
6
+ id: number;
7
+ monthName: string;
8
+ middleOfMonth: Date;
9
+ weeks: WeekDays[][];
10
+ }
@@ -0,0 +1,36 @@
1
+ import type React from 'react';
2
+ /**
3
+ * numberPosition functions
4
+ * These functions find position X-axis and Y-axis from half of the clock width
5
+ * Its start from 30 deg and each time this degree increase as much as 30 deg
6
+ */
7
+ export declare function numberPositionX(idx: number, width?: number, padding?: number): number;
8
+ export declare function numberPositionY(idx: number, width?: number, padding?: number): number;
9
+ export declare const center: {
10
+ x: number;
11
+ y: number;
12
+ };
13
+ export declare const radianToDeg: (rad: number) => number;
14
+ export declare const calculateOffset: (elem: unknown) => {
15
+ offsetX: number;
16
+ offsetY: number;
17
+ };
18
+ export declare const getValue: (deg: number, delta: number, steps: number) => number;
19
+ /**
20
+ * calculate the value from where the mouse clicked or tapped
21
+ * step1: calculate deg from the center of the circle not (0, 0)
22
+ * step1-1: calculate deg with atan2 but instead of using atan2 in this way (y, x) -
23
+ * I used atan2(x, y) because atan2(y, x) get an angel from (0, 0) not the center of the circle
24
+ * step-2: decrease atan2 by Math.PI because- * this function returns two degrees that one of them is valid and another isn't. like 90 deg and -90deg and -90deg should be 270
25
+ * step3: delta: determine the distance of each place that is clicked by the user. calculating the distance between the center of the circle
26
+ * step4: make value by division deg into the hour or minutes angles. in the hour is 30 deg and in minutes is 6 deg
27
+ */
28
+ interface IGetAngelValues {
29
+ value: number;
30
+ delta: number;
31
+ }
32
+ export declare const getAngelValues: (e: React.MouseEvent | React.TouchEvent, steps?: number) => IGetAngelValues;
33
+ export declare const hours: number[];
34
+ export declare const hours24: number[];
35
+ export declare const minutes: number[];
36
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zaman-backoffice",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "thanks to the zaman team. just needed to add the ability to have a controlled input value",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/.eslintrc.cjs DELETED
@@ -1,26 +0,0 @@
1
- module.exports = {
2
- env: {
3
- browser: true,
4
- es2021: true
5
- },
6
- extends: [
7
- 'plugin:react/recommended',
8
- 'standard-with-typescript',
9
- 'plugin:prettier/recommended'
10
- ],
11
- overrides: [],
12
- parserOptions: {
13
- ecmaVersion: 'latest',
14
- sourceType: 'module',
15
- project: './tsconfig.json'
16
- },
17
- plugins: ['react', 'prettier'],
18
- rules: {
19
- '@typescript-eslint/ban-ts-comment': [
20
- 'error',
21
- { 'ts-ignore': 'allow-with-description' }
22
- ],
23
- '@typescript-eslint/explicit-function-return-type': 'off',
24
- '@typescript-eslint/no-confusing-void-expression': 'off'
25
- }
26
- }
package/.husky/commit-msg DELETED
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env sh
2
- . "$(dirname -- "$0")/_/husky.sh"
3
-
4
- yarn commitlint --edit
package/.husky/pre-commit DELETED
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env sh
2
- . "$(dirname -- "$0")/_/husky.sh"
3
-
4
- yarn test:e2e
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="GitToolBoxBlameSettings">
4
- <option name="version" value="2" />
5
- </component>
6
- </project>
@@ -1,15 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="GitToolBoxProjectSettings">
4
- <option name="commitMessageIssueKeyValidationOverride">
5
- <BoolValueOverride>
6
- <option name="enabled" value="true" />
7
- </BoolValueOverride>
8
- </option>
9
- <option name="commitMessageValidationEnabledOverride">
10
- <BoolValueOverride>
11
- <option name="enabled" value="true" />
12
- </BoolValueOverride>
13
- </option>
14
- </component>
15
- </project>
@@ -1,6 +0,0 @@
1
- <component name="InspectionProjectProfileManager">
2
- <profile version="1.0">
3
- <option name="myName" value="Project Default" />
4
- <inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
5
- </profile>
6
- </component>
@@ -1,12 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="MaterialThemeProjectNewConfig">
4
- <option name="metadata">
5
- <MTProjectMetadataState>
6
- <option name="migrated" value="true" />
7
- <option name="pristineConfig" value="false" />
8
- <option name="userId" value="21014733:192000173b2:-7ffe" />
9
- </MTProjectMetadataState>
10
- </option>
11
- </component>
12
- </project>
package/.idea/modules.xml DELETED
@@ -1,8 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectModuleManager">
4
- <modules>
5
- <module fileurl="file://$PROJECT_DIR$/.idea/zaman-backoffice2.iml" filepath="$PROJECT_DIR$/.idea/zaman-backoffice2.iml" />
6
- </modules>
7
- </component>
8
- </project>
package/.idea/vcs.xml DELETED
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="VcsDirectoryMappings">
4
- <mapping directory="" vcs="Git" />
5
- </component>
6
- </project>
@@ -1,12 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <module type="WEB_MODULE" version="4">
3
- <component name="NewModuleRootManager">
4
- <content url="file://$MODULE_DIR$">
5
- <excludeFolder url="file://$MODULE_DIR$/.tmp" />
6
- <excludeFolder url="file://$MODULE_DIR$/temp" />
7
- <excludeFolder url="file://$MODULE_DIR$/tmp" />
8
- </content>
9
- <orderEntry type="inheritedJdk" />
10
- <orderEntry type="sourceFolder" forTests="false" />
11
- </component>
12
- </module>
package/.prettierrc DELETED
@@ -1,9 +0,0 @@
1
- {
2
- "printWidth": 80,
3
- "tabWidth": 2,
4
- "useTabs": false,
5
- "semi": false,
6
- "jsxSingleQuote": false,
7
- "singleQuote": true,
8
- "trailingComma": "none"
9
- }
package/.travis.yml DELETED
@@ -1,10 +0,0 @@
1
- language: node_js
2
- node_js:
3
- - "11.10.1"
4
- cache:
5
- directories:
6
- - node_modules
7
- script:
8
- - npm test
9
- - npm run build
10
- - npm run lint
package/client/index.html DELETED
@@ -1,12 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en" dir="rtl">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
- <title>Vite + React + TS | React Jalali DatePicker</title>
7
- </head>
8
- <body>
9
- <div id="root"></div>
10
- <script type="module" src="./main.tsx"></script>
11
- </body>
12
- </html>
package/client/main.tsx DELETED
@@ -1,84 +0,0 @@
1
- import React, { useState } from 'react'
2
- import { Calendar, CalendarProvider, DatePicker } from '../src'
3
- import { createRoot } from 'react-dom/client'
4
- import './style.css'
5
- import TimePicker from '../src/packages/TimePicker'
6
- const container = document.getElementById('root')
7
- const root = createRoot(container as HTMLElement)
8
-
9
- const App = () => {
10
- const [view, setView] = useState<string>('cal')
11
- const [calendarValue, setCalendarValue] = useState(new Date())
12
-
13
- return (
14
- <section className="wrapper">
15
- <div className="tab">
16
- <div
17
- className={`tabItem tabItem${view === 'cal' ? '--selected' : ''}`}
18
- onClick={() => setView('cal')}
19
- >
20
- Calendar
21
- </div>
22
- <div
23
- className={`tabItem tabItem${view === 'day' ? '--selected' : ''}`}
24
- onClick={() => setView('day')}
25
- >
26
- Date picker
27
- </div>
28
- <div
29
- className={`tabItem tabItem${view === 'time' ? '--selected' : ''}`}
30
- onClick={() => setView('time')}
31
- >
32
- Time picker
33
- </div>
34
- </div>
35
- {view === 'cal' ? (
36
- <div className="libWrapper">
37
- <CalendarProvider locale="fa" round="x2">
38
- <Calendar
39
- defaultValue={calendarValue}
40
- onChange={({ value }) => setCalendarValue(value)}
41
- weekends={[6]}
42
- />
43
- </CalendarProvider>
44
- <CalendarProvider locale="fa" round="x4" accentColor="#6374ae">
45
- <Calendar
46
- defaultValue={new Date()}
47
- onChange={({ from, to }) => console.log(from, '---', to)}
48
- weekends={[6]}
49
- from={new Date()}
50
- to={new Date().setDate(new Date().getDate() + 3)}
51
- range
52
- />
53
- </CalendarProvider>
54
- </div>
55
- ) : null}
56
- {view === 'day' ? (
57
- <div className="libWrapper">
58
- <DatePicker
59
- round="x4"
60
- position="center"
61
- onChange={(e) => console.log(e)}
62
- />
63
- <DatePicker
64
- round="x2"
65
- accentColor="#6374ae"
66
- range
67
- from={new Date()}
68
- to={new Date().setDate(new Date().getDate() + 3)}
69
- onChange={(e) => console.log(e)}
70
- />
71
- </div>
72
- ) : null}
73
- {view === 'time' ? (
74
- <div className="libWrapper">
75
- <TimePicker
76
- accentColor="#6374ae"
77
- onChange={(py) => console.log(py)}
78
- />
79
- </div>
80
- ) : null}
81
- </section>
82
- )
83
- }
84
- root.render(<App />)
package/client/style.css DELETED
@@ -1,62 +0,0 @@
1
- @import url("https://fonts.googleapis.com/css?family=Vazirmatn");
2
-
3
- * {
4
- box-sizing: border-box;
5
- }
6
- body {
7
- font-family: Vazirmatn, sans-serif;
8
- text-align: center;
9
- margin-top: 4rem;
10
- }
11
- input {
12
- font-family: Vazirmatn, sans-serif;
13
- text-align: center;
14
- width: 280px;
15
- outline: 0;
16
- border-radius: 8px;
17
- height: 45px;
18
- border: 1px solid #dedede;
19
- }
20
- .wrapper {
21
- display: flex;
22
- flex-direction: column;
23
- align-items: center;
24
- justify-content: center;
25
- gap: 12px;
26
- }
27
-
28
- .tab {
29
- flex-direction: column;
30
- display: flex;
31
- justify-content: center;
32
- border-radius: 8px;
33
- background-color: #f5f5f5;
34
- gap: 16px;
35
- padding: 8px;
36
- }
37
- .tabItem {
38
- cursor: pointer;
39
- padding: 4px 8px;
40
- border-radius: 8px;
41
- transition: all 0.2s ease;
42
- }
43
- .tabItem:hover {
44
- color: #3f5152;
45
- }
46
- .tabItem--selected {
47
- background-color: #ffffff;
48
- }
49
-
50
- .libWrapper {
51
- display: flex;
52
- justify-content: center;
53
- flex-direction: column;
54
- gap: 14px;
55
- }
56
-
57
- @media only screen and (min-width: 600px) {
58
- .tab,
59
- .libWrapper {
60
- flex-direction: row;
61
- }
62
- }
@@ -1,5 +0,0 @@
1
- {
2
- "name": "Using fixtures to represent data",
3
- "email": "hello@cypress.io",
4
- "body": "Fixtures are a great way to mock data for responses to routes"
5
- }
@@ -1,38 +0,0 @@
1
- import '@testing-library/cypress/add-commands'
2
- /// <reference types="cypress" />
3
- // ***********************************************
4
- // This example commands.ts shows you how to
5
- // create various custom commands and overwrite
6
- // existing commands.
7
- //
8
- // For more comprehensive examples of custom
9
- // commands please read more here:
10
- // https://on.cypress.io/custom-commands
11
- // ***********************************************
12
- //
13
- //
14
- // -- This is a parent command --
15
- // Cypress.Commands.add('login', (email, password) => { ... })
16
- //
17
- //
18
- // -- This is a child command --
19
- // Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
20
- //
21
- //
22
- // -- This is a dual command --
23
- // Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
24
- //
25
- //
26
- // -- This will overwrite an existing command --
27
- // Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
28
- //
29
- // declare global {
30
- // namespace Cypress {
31
- // interface Chainable {
32
- // login(email: string, password: string): Chainable<void>
33
- // drag(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
34
- // dismiss(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
35
- // visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element>
36
- // }
37
- // }
38
- // }
@@ -1,12 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8">
5
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
- <meta name="viewport" content="width=device-width,initial-scale=1.0">
7
- <title>Components App</title>
8
- </head>
9
- <body>
10
- <div data-cy-root></div>
11
- </body>
12
- </html>
@@ -1,39 +0,0 @@
1
- // ***********************************************************
2
- // This example support/component.ts is processed and
3
- // loaded automatically before your test files.
4
- //
5
- // This is a great place to put global configuration and
6
- // behavior that modifies Cypress.
7
- //
8
- // You can change the location of this file or turn off
9
- // automatically serving support files with the
10
- // 'supportFile' configuration option.
11
- //
12
- // You can read more here:
13
- // https://on.cypress.io/configuration
14
- // ***********************************************************
15
-
16
- // Import commands.js using ES2015 syntax:
17
- import './commands'
18
-
19
- // Alternatively you can use CommonJS syntax:
20
- // require('./commands')
21
-
22
- import { mount } from 'cypress/react18'
23
-
24
- // Augment the Cypress namespace to include type definitions for
25
- // your custom command.
26
- // Alternatively, can be defined in cypress/support/component.d.ts
27
- // with a <reference path="./component" /> at the top of your spec.
28
- declare global {
29
- namespace Cypress {
30
- interface Chainable {
31
- mount: typeof mount
32
- }
33
- }
34
- }
35
-
36
- Cypress.Commands.add('mount', mount)
37
-
38
- // Example use:
39
- // cy.mount(<MyComponent />)
package/cypress.config.ts DELETED
@@ -1,10 +0,0 @@
1
- import { defineConfig } from 'cypress'
2
-
3
- export default defineConfig({
4
- component: {
5
- devServer: {
6
- framework: 'react',
7
- bundler: 'vite'
8
- }
9
- }
10
- })
package/help/banner.png DELETED
Binary file
package/jest.config.ts DELETED
@@ -1,47 +0,0 @@
1
- export default {
2
- // Stop running tests after `n` failures
3
- // bail: 4,
4
-
5
- // Automatically clear mock calls, instances, contexts and results before every test
6
- clearMocks: true,
7
-
8
- // An array of file extensions your modules use
9
- moduleFileExtensions: [
10
- 'ts',
11
- 'tsx',
12
- 'js',
13
- 'mjs',
14
- 'cjs',
15
- 'jsx',
16
- 'ts',
17
- 'tsx',
18
- 'json',
19
- 'node'
20
- ],
21
-
22
- // A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
23
- // moduleNameMapper: {},
24
-
25
- // A list of paths to directories that Jest should use to search for files in
26
- roots: ['<rootDir>/src'],
27
-
28
- // The test environment that will be used for testing
29
- testEnvironment: 'jsdom',
30
-
31
- // The regexp pattern or array of patterns that Jest uses to detect test files
32
- testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$',
33
-
34
- // A map from regular expressions to paths to transformers
35
- transform: {
36
- '^.+\\.(tsx|ts)?$': 'ts-jest'
37
- },
38
-
39
- // Whether to use watchman for file crawling
40
- watchman: true,
41
-
42
- globals: {
43
- 'ts-jest': {
44
- tsConfig: 'tsconfig.test.json'
45
- }
46
- }
47
- }