farm-react 1.0.5 → 1.0.7

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 (135) hide show
  1. package/README.md +79 -4
  2. package/dist/cjs/assets/data/header.d.ts +6 -0
  3. package/dist/cjs/assets/data/header.js +17 -0
  4. package/dist/cjs/assets/data/header.js.map +1 -0
  5. package/dist/cjs/assets/data/home.d.ts +0 -0
  6. package/dist/cjs/assets/data/home.js +2 -0
  7. package/dist/cjs/assets/data/home.js.map +1 -0
  8. package/dist/cjs/assets/data/icons.d.ts +0 -0
  9. package/dist/cjs/assets/data/icons.js +2 -0
  10. package/dist/cjs/assets/data/icons.js.map +1 -0
  11. package/dist/cjs/components/Accordion.d.ts +33 -0
  12. package/dist/cjs/components/Accordion.js +20 -0
  13. package/dist/cjs/components/Accordion.js.map +1 -0
  14. package/dist/cjs/components/Button.d.ts +2 -0
  15. package/dist/cjs/components/Button.js +8 -0
  16. package/dist/cjs/components/Button.js.map +1 -0
  17. package/dist/cjs/components/Label.d.ts +14 -0
  18. package/dist/cjs/components/Label.js +21 -0
  19. package/dist/cjs/components/Label.js.map +1 -0
  20. package/dist/cjs/components/Layout/Footer.d.ts +3 -0
  21. package/dist/cjs/components/Layout/Footer.js +11 -0
  22. package/dist/cjs/components/Layout/Footer.js.map +1 -0
  23. package/dist/cjs/components/Layout/Header.d.ts +2 -0
  24. package/dist/cjs/components/Layout/Header.js +17 -0
  25. package/dist/cjs/components/Layout/Header.js.map +1 -0
  26. package/dist/cjs/components/Layout/Sidebar.d.ts +2 -0
  27. package/dist/cjs/components/Layout/Sidebar.js +9 -0
  28. package/dist/cjs/components/Layout/Sidebar.js.map +1 -0
  29. package/dist/cjs/components/RatingDisplay.d.ts +27 -0
  30. package/dist/cjs/components/RatingDisplay.js +39 -0
  31. package/dist/cjs/components/RatingDisplay.js.map +1 -0
  32. package/dist/cjs/components/TextInput.d.ts +9 -0
  33. package/dist/cjs/components/TextInput.js +21 -0
  34. package/dist/cjs/components/TextInput.js.map +1 -0
  35. package/dist/cjs/constants/app.d.ts +1 -0
  36. package/dist/cjs/constants/app.js +5 -0
  37. package/dist/cjs/constants/app.js.map +1 -0
  38. package/dist/cjs/constants/images.d.ts +0 -0
  39. package/dist/cjs/constants/images.js +2 -0
  40. package/dist/cjs/constants/images.js.map +1 -0
  41. package/dist/cjs/constants/routes.d.ts +0 -0
  42. package/dist/cjs/constants/routes.js +2 -0
  43. package/dist/cjs/constants/routes.js.map +1 -0
  44. package/dist/cjs/container/index.d.ts +0 -0
  45. package/dist/cjs/container/index.js +2 -0
  46. package/dist/cjs/container/index.js.map +1 -0
  47. package/dist/cjs/helpers/app.d.ts +81 -0
  48. package/dist/cjs/helpers/app.js +151 -0
  49. package/dist/cjs/helpers/app.js.map +1 -0
  50. package/dist/cjs/helpers/index.d.ts +0 -0
  51. package/dist/cjs/helpers/index.js +2 -0
  52. package/dist/cjs/helpers/index.js.map +1 -0
  53. package/dist/cjs/hooks/index.d.ts +0 -0
  54. package/dist/cjs/hooks/index.js +2 -0
  55. package/dist/cjs/hooks/index.js.map +1 -0
  56. package/dist/cjs/index.d.ts +5 -2
  57. package/dist/cjs/index.js +9 -3
  58. package/dist/cjs/index.js.map +1 -1
  59. package/dist/cjs/strings/en.d.ts +4 -0
  60. package/dist/cjs/strings/en.js +9 -0
  61. package/dist/cjs/strings/en.js.map +1 -0
  62. package/dist/cjs/strings/index.d.ts +0 -0
  63. package/dist/cjs/strings/index.js +2 -0
  64. package/dist/cjs/strings/index.js.map +1 -0
  65. package/dist/esm/assets/data/header.d.ts +6 -0
  66. package/dist/esm/assets/data/header.js +14 -0
  67. package/dist/esm/assets/data/header.js.map +1 -0
  68. package/dist/esm/assets/data/home.d.ts +0 -0
  69. package/dist/esm/assets/data/home.js +2 -0
  70. package/dist/esm/assets/data/home.js.map +1 -0
  71. package/dist/esm/assets/data/icons.d.ts +0 -0
  72. package/dist/esm/assets/data/icons.js +2 -0
  73. package/dist/esm/assets/data/icons.js.map +1 -0
  74. package/dist/esm/components/Accordion.d.ts +33 -0
  75. package/dist/esm/components/Accordion.js +18 -0
  76. package/dist/esm/components/Accordion.js.map +1 -0
  77. package/dist/esm/components/Button.d.ts +2 -0
  78. package/dist/esm/components/Button.js +5 -0
  79. package/dist/esm/components/Button.js.map +1 -0
  80. package/dist/esm/components/Label.d.ts +14 -0
  81. package/dist/esm/components/Label.js +18 -0
  82. package/dist/esm/components/Label.js.map +1 -0
  83. package/dist/esm/components/Layout/Footer.d.ts +3 -0
  84. package/dist/esm/components/Layout/Footer.js +9 -0
  85. package/dist/esm/components/Layout/Footer.js.map +1 -0
  86. package/dist/esm/components/Layout/Header.d.ts +2 -0
  87. package/dist/esm/components/Layout/Header.js +14 -0
  88. package/dist/esm/components/Layout/Header.js.map +1 -0
  89. package/dist/esm/components/Layout/Sidebar.d.ts +2 -0
  90. package/dist/esm/components/Layout/Sidebar.js +7 -0
  91. package/dist/esm/components/Layout/Sidebar.js.map +1 -0
  92. package/dist/esm/components/RatingDisplay.d.ts +27 -0
  93. package/dist/esm/components/RatingDisplay.js +37 -0
  94. package/dist/esm/components/RatingDisplay.js.map +1 -0
  95. package/dist/esm/components/TextInput.d.ts +9 -0
  96. package/dist/esm/components/TextInput.js +18 -0
  97. package/dist/esm/components/TextInput.js.map +1 -0
  98. package/dist/esm/constants/app.d.ts +1 -0
  99. package/dist/esm/constants/app.js +2 -0
  100. package/dist/esm/constants/app.js.map +1 -0
  101. package/dist/esm/constants/images.d.ts +0 -0
  102. package/dist/esm/constants/images.js +2 -0
  103. package/dist/esm/constants/images.js.map +1 -0
  104. package/dist/esm/constants/routes.d.ts +0 -0
  105. package/dist/esm/constants/routes.js +2 -0
  106. package/dist/esm/constants/routes.js.map +1 -0
  107. package/dist/esm/container/index.d.ts +0 -0
  108. package/dist/esm/container/index.js +2 -0
  109. package/dist/esm/container/index.js.map +1 -0
  110. package/dist/esm/helpers/app.d.ts +81 -0
  111. package/dist/esm/helpers/app.js +136 -0
  112. package/dist/esm/helpers/app.js.map +1 -0
  113. package/dist/esm/helpers/index.d.ts +0 -0
  114. package/dist/esm/helpers/index.js +2 -0
  115. package/dist/esm/helpers/index.js.map +1 -0
  116. package/dist/esm/hooks/index.d.ts +0 -0
  117. package/dist/esm/hooks/index.js +2 -0
  118. package/dist/esm/hooks/index.js.map +1 -0
  119. package/dist/esm/index.d.ts +5 -2
  120. package/dist/esm/index.js +5 -2
  121. package/dist/esm/index.js.map +1 -1
  122. package/dist/esm/strings/en.d.ts +4 -0
  123. package/dist/esm/strings/en.js +6 -0
  124. package/dist/esm/strings/en.js.map +1 -0
  125. package/dist/esm/strings/index.d.ts +0 -0
  126. package/dist/esm/strings/index.js +2 -0
  127. package/dist/esm/strings/index.js.map +1 -0
  128. package/dist/package.json +13 -0
  129. package/package.json +62 -53
  130. package/dist/cjs/components/app.d.ts +0 -6
  131. package/dist/cjs/components/app.js +0 -22
  132. package/dist/cjs/components/app.js.map +0 -1
  133. package/dist/esm/components/app.d.ts +0 -6
  134. package/dist/esm/components/app.js +0 -19
  135. package/dist/esm/components/app.js.map +0 -1
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/container/index.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,81 @@
1
+ /**
2
+ * Safely returns the provided object or an empty object as fallback.
3
+ * @param value - The object to check.
4
+ * @returns The original object if defined, otherwise an empty object of type T.
5
+ */
6
+ export declare function destructObj<T extends object>(value?: T): T;
7
+ /**
8
+ * Checks if the given value is an empty string (after trimming).
9
+ * @param value - The string to check.
10
+ * @returns true if the value is not a valid string or is empty after trimming, false otherwise.
11
+ */
12
+ export declare function isEmptyString(value?: string | null): boolean;
13
+ /**
14
+ * Checks if the given value is a non-empty string.
15
+ * @param value - The string to check.
16
+ * @returns true if the value is a string with at least one character, false otherwise.
17
+ */
18
+ export declare function isStringNotEmpty(value?: string | null): boolean;
19
+ /**
20
+ * Checks if the given value is a non-empty array.
21
+ * @param value - The array to check.
22
+ * @returns true if the value is an array with at least one element, false otherwise.
23
+ */
24
+ export declare function isArrayNotEmpty<T>(value?: T[] | null): boolean;
25
+ /**
26
+ * Checks if the given value is an empty array.
27
+ * @param value - The array to check.
28
+ * @returns true if the value is an array with no elements, false otherwise.
29
+ */
30
+ export declare function isArrayEmpty<T>(value?: T[] | null): boolean;
31
+ /**
32
+ * Safely returns the length of the given array.
33
+ * @param value - The array to check.
34
+ * @returns The number of elements in the array, or 0 if the array is null/undefined.
35
+ */
36
+ export declare function getArrayLength<T>(value?: T[] | null): number;
37
+ /**
38
+ * Safely checks if the given array includes a specific value.
39
+ * @param array - The array to check.
40
+ * @param item - The item to search for.
41
+ * @returns true if the array includes the item, false otherwise.
42
+ */
43
+ export declare function isArrayIncludes<T>(array: T[] | null | undefined, item: T): boolean;
44
+ /**
45
+ * Checks if the given value is an empty object.
46
+ * @param value - The object to check.
47
+ * @returns true if the value is an object with no own enumerable keys, false otherwise.
48
+ */
49
+ export declare function isObjEmpty(value?: object | null): boolean;
50
+ /**
51
+ * Checks if the given value is a non-empty plain object.
52
+ * @param value - The object to check.
53
+ * @returns true if the value is a plain object with at least one own key, false otherwise.
54
+ */
55
+ export declare function isObjNotEmpty(value?: object | null): boolean;
56
+ /**
57
+ * Checks if the given value is empty.
58
+ * Supports: string, array, object.
59
+ * @param value - The value to check.
60
+ * @returns true if the value is empty, false otherwise.
61
+ */
62
+ export declare function isEmpty(value: any): boolean;
63
+ /**
64
+ * Generates an array of dates between two dates (inclusive).
65
+ * @param start - The start date.
66
+ * @param end - The end date.
67
+ * @returns An array of Date objects from start to end.
68
+ */
69
+ export declare function getDates(start: Date, end: Date): Date[];
70
+ /**
71
+ * Formats a given date into a string.
72
+ * @param date - The date to format.
73
+ * @param format - The format string (default: "YYYY-MM-DD").
74
+ * Supported tokens: YYYY, MM, DD, HH, mm, ss
75
+ * @returns The formatted date string.
76
+ */
77
+ export declare function getFormattedDate(date: Date, format?: string): string;
78
+ /**
79
+ * Returns the current logged-in user from localStorage.
80
+ */
81
+ export declare function getCurrentUser(): any | null;
@@ -0,0 +1,136 @@
1
+ /**
2
+ * Safely returns the provided object or an empty object as fallback.
3
+ * @param value - The object to check.
4
+ * @returns The original object if defined, otherwise an empty object of type T.
5
+ */
6
+ export function destructObj(value) {
7
+ return (value !== null && value !== void 0 ? value : {});
8
+ }
9
+ /**
10
+ * Checks if the given value is an empty string (after trimming).
11
+ * @param value - The string to check.
12
+ * @returns true if the value is not a valid string or is empty after trimming, false otherwise.
13
+ */
14
+ export function isEmptyString(value) {
15
+ return !(typeof value === 'string' && value.trim().length > 0);
16
+ }
17
+ /**
18
+ * Checks if the given value is a non-empty string.
19
+ * @param value - The string to check.
20
+ * @returns true if the value is a string with at least one character, false otherwise.
21
+ */
22
+ export function isStringNotEmpty(value) {
23
+ return typeof value === 'string' && value.trim().length > 0;
24
+ }
25
+ /**
26
+ * Checks if the given value is a non-empty array.
27
+ * @param value - The array to check.
28
+ * @returns true if the value is an array with at least one element, false otherwise.
29
+ */
30
+ export function isArrayNotEmpty(value) {
31
+ return Array.isArray(value) && value.length > 0;
32
+ }
33
+ /**
34
+ * Checks if the given value is an empty array.
35
+ * @param value - The array to check.
36
+ * @returns true if the value is an array with no elements, false otherwise.
37
+ */
38
+ export function isArrayEmpty(value) {
39
+ return Array.isArray(value) && value.length === 0;
40
+ }
41
+ /**
42
+ * Safely returns the length of the given array.
43
+ * @param value - The array to check.
44
+ * @returns The number of elements in the array, or 0 if the array is null/undefined.
45
+ */
46
+ export function getArrayLength(value) {
47
+ return Array.isArray(value) ? value.length : 0;
48
+ }
49
+ /**
50
+ * Safely checks if the given array includes a specific value.
51
+ * @param array - The array to check.
52
+ * @param item - The item to search for.
53
+ * @returns true if the array includes the item, false otherwise.
54
+ */
55
+ export function isArrayIncludes(array, item) {
56
+ return Array.isArray(array) && array.includes(item);
57
+ }
58
+ /**
59
+ * Checks if the given value is an empty object.
60
+ * @param value - The object to check.
61
+ * @returns true if the value is an object with no own enumerable keys, false otherwise.
62
+ */
63
+ export function isObjEmpty(value) {
64
+ return !!value && Object.keys(value).length === 0 && value.constructor === Object;
65
+ }
66
+ /**
67
+ * Checks if the given value is a non-empty plain object.
68
+ * @param value - The object to check.
69
+ * @returns true if the value is a plain object with at least one own key, false otherwise.
70
+ */
71
+ export function isObjNotEmpty(value) {
72
+ return !!value && value.constructor === Object && Object.keys(value).length > 0;
73
+ }
74
+ /**
75
+ * Checks if the given value is empty.
76
+ * Supports: string, array, object.
77
+ * @param value - The value to check.
78
+ * @returns true if the value is empty, false otherwise.
79
+ */
80
+ export function isEmpty(value) {
81
+ if (value == null)
82
+ return true; // null or undefined
83
+ if (typeof value === 'string') {
84
+ return value.trim().length === 0;
85
+ }
86
+ if (Array.isArray(value)) {
87
+ return value.length === 0;
88
+ }
89
+ if (typeof value === 'object') {
90
+ return Object.keys(value).length === 0 && value.constructor === Object;
91
+ }
92
+ return false; // for numbers, booleans, functions, etc.
93
+ }
94
+ /**
95
+ * Generates an array of dates between two dates (inclusive).
96
+ * @param start - The start date.
97
+ * @param end - The end date.
98
+ * @returns An array of Date objects from start to end.
99
+ */
100
+ export function getDates(start, end) {
101
+ var dates = [];
102
+ var current = new Date(start);
103
+ while (current <= end) {
104
+ dates.push(new Date(current)); // push a copy
105
+ current.setDate(current.getDate() + 1); // move to next day
106
+ }
107
+ return dates;
108
+ }
109
+ /**
110
+ * Formats a given date into a string.
111
+ * @param date - The date to format.
112
+ * @param format - The format string (default: "YYYY-MM-DD").
113
+ * Supported tokens: YYYY, MM, DD, HH, mm, ss
114
+ * @returns The formatted date string.
115
+ */
116
+ export function getFormattedDate(date, format) {
117
+ if (format === void 0) { format = 'YYYY-MM-DD'; }
118
+ var pad = function (n) { return n.toString().padStart(2, '0'); };
119
+ var map = {
120
+ YYYY: date.getFullYear().toString(),
121
+ MM: pad(date.getMonth() + 1),
122
+ DD: pad(date.getDate()),
123
+ HH: pad(date.getHours()),
124
+ mm: pad(date.getMinutes()),
125
+ ss: pad(date.getSeconds()),
126
+ };
127
+ return format.replace(/YYYY|MM|DD|HH|mm|ss/g, function (match) { return map[match]; });
128
+ }
129
+ /**
130
+ * Returns the current logged-in user from localStorage.
131
+ */
132
+ export function getCurrentUser() {
133
+ var user = localStorage.getItem('currentUser');
134
+ return user ? JSON.parse(user) : null;
135
+ }
136
+ //# sourceMappingURL=app.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app.js","sourceRoot":"","sources":["../../../src/helpers/app.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAmB,KAAS;IACrD,OAAO,CAAC,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE,CAAM,CAAA;AAC3B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,KAAqB;IACjD,OAAO,CAAC,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;AAChE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAqB;IACpD,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAA;AAC7D,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAI,KAAkB;IACnD,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAA;AACjD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAI,KAAkB;IAChD,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,CAAA;AACnD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAI,KAAkB;IAClD,O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C,EAAV,CAAU,CAAC,CAAA;AACtE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc;IAC5B,IAAM,IAAI,GAAG,YAAY,CAAC,OAAO,CAAC,aAAa,CAAC,CAAA;IAChD,OAAO,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;AACvC,CAAC"}
File without changes
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/helpers/index.ts"],"names":[],"mappings":""}
File without changes
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":""}
@@ -1,2 +1,5 @@
1
- import MyCounter from './components/app';
2
- export { MyCounter };
1
+ import Accordion from './components/Accordion';
2
+ import Button from './components/Button';
3
+ import TextInput from './components/TextInput';
4
+ import Label from './components/Label';
5
+ export { Accordion, Label, Button, TextInput };
package/dist/esm/index.js CHANGED
@@ -1,3 +1,6 @@
1
- import MyCounter from './components/app';
2
- export { MyCounter };
1
+ import Accordion from './components/Accordion';
2
+ import Button from './components/Button';
3
+ import TextInput from './components/TextInput';
4
+ import Label from './components/Label';
5
+ export { Accordion, Label, Button, TextInput };
3
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,kBAAkB,CAAA;AAExC,OAAO,EAAE,SAAS,EAAE,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,wBAAwB,CAAA;AAC9C,OAAO,MAAM,MAAM,qBAAqB,CAAA;AACxC,OAAO,SAAS,MAAM,wBAAwB,CAAA;AAC9C,OAAO,KAAK,MAAM,oBAAoB,CAAA;AAEtC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,CAAA"}
@@ -0,0 +1,4 @@
1
+ export declare const String: {
2
+ name: string;
3
+ save: string;
4
+ };
@@ -0,0 +1,6 @@
1
+ // this string file use for creating a custom string
2
+ export var String = {
3
+ name: 'Farm React',
4
+ save: 'save',
5
+ };
6
+ //# sourceMappingURL=en.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"en.js","sourceRoot":"","sources":["../../../src/strings/en.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,MAAM,CAAC,IAAM,MAAM,GAAG;IACpB,IAAI,EAAE,YAAY;IAClB,IAAI,EAAE,MAAM;CACb,CAAA"}
File without changes
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/strings/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "farm-react",
3
+ "version": "1.0.7",
4
+ "description": "",
5
+ "main": "cjs/index.js",
6
+ "module": "esm/index.js",
7
+ "types": "esm/index.d.ts",
8
+ "peerDependencies": {
9
+ "react": ">=18"
10
+ },
11
+ "author": "Nikhil Kumar",
12
+ "license": "ISC"
13
+ }
package/package.json CHANGED
@@ -1,53 +1,62 @@
1
- {
2
- "name": "farm-react",
3
- "version": "1.0.5",
4
- "description": "",
5
- "main": "dist/cjs/index.js",
6
- "module": "dist/esm/index.js",
7
- "types": "dist/esm/index.d.ts",
8
- "scripts": {
9
- "prepare": "npm run build",
10
- "prepublishOnly": "npm run test && npm run prettier && npm run lint",
11
- "build": "npm run build:esm && npm run build:cjs",
12
- "build:esm": "tsc",
13
- "build:cjs": "tsc --module commonjs --outDir dist/cjs",
14
- "test": "jest --config jestconfig.json",
15
- "lint": "eslint \"{**/*,*}.{js,ts,jsx,tsx}\"",
16
- "prettier": "prettier --write \"{src,tests,example/src}/**/*.{js,ts,jsx,tsx}\""
17
- },
18
- "peerDependencies": {
19
- "react": ">=16"
20
- },
21
- "author": "",
22
- "license": "ISC",
23
- "files": [
24
- "dist",
25
- "LICENSE",
26
- "README.md"
27
- ],
28
- "keywords": [
29
- "react",
30
- "typescript",
31
- "awesome-project"
32
- ],
33
- "devDependencies": {
34
- "@testing-library/react": "^16.0.0",
35
- "@types/jest": "^29.5.12",
36
- "@types/react": "^18.3.3",
37
- "@typescript-eslint/eslint-plugin": "^7.15.0",
38
- "@typescript-eslint/parser": "^7.15.0",
39
- "eslint": "^8.57.0",
40
- "eslint-config-prettier": "^9.1.0",
41
- "eslint-plugin-prettier": "^5.1.3",
42
- "eslint-plugin-react": "^7.34.3",
43
- "eslint-plugin-react-hooks": "^4.6.2",
44
- "jest": "^29.7.0",
45
- "jest-canvas-mock": "^2.5.2",
46
- "jest-environment-jsdom": "^29.7.0",
47
- "prettier": "^3.3.2",
48
- "react": "^18.3.1",
49
- "react-dom": "^18.3.1",
50
- "ts-jest": "^29.1.5",
51
- "typescript": "^5.5.3"
52
- }
53
- }
1
+ {
2
+ "name": "farm-react",
3
+ "version": "1.0.7",
4
+ "description": "",
5
+ "main": "dist/cjs/index.js",
6
+ "module": "dist/esm/index.js",
7
+ "types": "dist/esm/index.d.ts",
8
+ "scripts": {
9
+ "prepare": "npm run build",
10
+ "prepublishOnly": "npm run test && npm run prettier && npm run lint",
11
+ "build": "npm run build:esm && npm run build:cjs && npm run build:package-json",
12
+ "build:package-json": "node -e \"const fs=require('fs');const pkg=require('./package.json');const distPkg={name:pkg.name,version:pkg.version,description:pkg.description,main:'cjs/index.js',module:'esm/index.js',types:'esm/index.d.ts',peerDependencies:pkg.peerDependencies,author:pkg.author,license:pkg.license};fs.writeFileSync('dist/package.json',JSON.stringify(distPkg,null,2));\"",
13
+ "build:esm": "tsc",
14
+ "build:cjs": "tsc --module commonjs --outDir dist/cjs",
15
+ "test": "jest --config jestconfig.json",
16
+ "lint": "eslint \"src/**/*.{js,ts,jsx,tsx}\"",
17
+ "prettier": "prettier --write \"{src,tests,example/src}/**/*.{js,ts,jsx,tsx}\""
18
+ },
19
+ "type": "module",
20
+ "peerDependencies": {
21
+ "react": ">=18"
22
+ },
23
+ "author": "Nikhil Kumar",
24
+ "license": "ISC",
25
+ "files": [
26
+ "dist",
27
+ "LICENSE",
28
+ "README.md"
29
+ ],
30
+ "keywords": [
31
+ "react",
32
+ "typescript",
33
+ "awesome-project"
34
+ ],
35
+ "devDependencies": {
36
+ "@testing-library/react": "^16.0.0",
37
+ "@types/jest": "^29.5.12",
38
+ "@types/react": "^18.3.3",
39
+ "@typescript-eslint/eslint-plugin": "^7.15.0",
40
+ "@typescript-eslint/parser": "^7.15.0",
41
+ "eslint-config-prettier": "^9.1.0",
42
+ "eslint-plugin-prettier": "^5.1.3",
43
+ "eslint-plugin-react": "^7.34.3",
44
+ "eslint-plugin-react-hooks": "^4.6.2",
45
+ "jest": "^29.7.0",
46
+ "jest-canvas-mock": "^2.5.2",
47
+ "jest-environment-jsdom": "^29.7.0",
48
+ "prettier": "^3.3.2",
49
+ "react": "^18.3.1",
50
+ "react-dom": "^18.3.1",
51
+ "sass-embedded": "^1.90.0",
52
+ "ts-jest": "^29.1.5",
53
+ "typescript": "^5.5.3"
54
+ },
55
+ "dependencies": {
56
+ "bootstrap-icons": "^1.13.1",
57
+ "clsx": "^2.1.1",
58
+ "eslint": "^9.34.0",
59
+ "react-bootstrap": "^2.10.10",
60
+ "react-router": "^7.8.2"
61
+ }
62
+ }
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- type props = {
3
- value?: number;
4
- };
5
- declare const MyCounter: ({ value }: props) => React.JSX.Element;
6
- export default MyCounter;
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var tslib_1 = require("tslib");
4
- var react_1 = tslib_1.__importStar(require("react"));
5
- var MyCounter = function (_a) {
6
- var _b = _a.value, value = _b === void 0 ? 0 : _b;
7
- var _c = (0, react_1.useState)(value), counter = _c[0], setCounter = _c[1];
8
- var onMinus = function () {
9
- setCounter(function (val) { return val - 1; });
10
- };
11
- var onPlus = function () {
12
- setCounter(function (prev) { return prev + 1; });
13
- };
14
- return (react_1.default.createElement("div", null,
15
- react_1.default.createElement("h1", null,
16
- "Counter: ",
17
- counter),
18
- react_1.default.createElement("button", { onClick: onMinus }, "-"),
19
- react_1.default.createElement("button", { onClick: onPlus }, "+")));
20
- };
21
- exports.default = MyCounter;
22
- //# sourceMappingURL=app.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"app.js","sourceRoot":"","sources":["../../../src/components/app.tsx"],"names":[],"mappings":";;;AAAA,qDAAuC;AAMvC,IAAM,SAAS,GAAG,UAAC,EAAoB;QAAlB,aAAS,EAAT,KAAK,mBAAG,CAAC,KAAA;IACtB,IAAA,KAAwB,IAAA,gBAAQ,EAAC,KAAK,CAAC,EAAtC,OAAO,QAAA,EAAE,UAAU,QAAmB,CAAA;IAE7C,IAAM,OAAO,GAAG;QACd,UAAU,CAAC,UAAC,GAAG,IAAK,OAAA,GAAG,GAAG,CAAC,EAAP,CAAO,CAAC,CAAA;IAC9B,CAAC,CAAA;IACD,IAAM,MAAM,GAAG;QACb,UAAU,CAAC,UAAC,IAAI,IAAK,OAAA,IAAI,GAAG,CAAC,EAAR,CAAQ,CAAC,CAAA;IAChC,CAAC,CAAA;IAED,OAAO,CACL;QACE;;YAAc,OAAO,CAAM;QAC3B,0CAAQ,OAAO,EAAE,OAAO,QAAY;QACpC,0CAAQ,OAAO,EAAE,MAAM,QAAY,CAC/B,CACP,CAAA;AACH,CAAC,CAAA;AAED,kBAAe,SAAS,CAAA"}
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- type props = {
3
- value?: number;
4
- };
5
- declare const MyCounter: ({ value }: props) => React.JSX.Element;
6
- export default MyCounter;
@@ -1,19 +0,0 @@
1
- import React, { useState } from 'react';
2
- var MyCounter = function (_a) {
3
- var _b = _a.value, value = _b === void 0 ? 0 : _b;
4
- var _c = useState(value), counter = _c[0], setCounter = _c[1];
5
- var onMinus = function () {
6
- setCounter(function (val) { return val - 1; });
7
- };
8
- var onPlus = function () {
9
- setCounter(function (prev) { return prev + 1; });
10
- };
11
- return (React.createElement("div", null,
12
- React.createElement("h1", null,
13
- "Counter: ",
14
- counter),
15
- React.createElement("button", { onClick: onMinus }, "-"),
16
- React.createElement("button", { onClick: onPlus }, "+")));
17
- };
18
- export default MyCounter;
19
- //# sourceMappingURL=app.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"app.js","sourceRoot":"","sources":["../../../src/components/app.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAMvC,IAAM,SAAS,GAAG,UAAC,EAAoB;QAAlB,aAAS,EAAT,KAAK,mBAAG,CAAC,KAAA;IACtB,IAAA,KAAwB,QAAQ,CAAC,KAAK,CAAC,EAAtC,OAAO,QAAA,EAAE,UAAU,QAAmB,CAAA;IAE7C,IAAM,OAAO,GAAG;QACd,UAAU,CAAC,UAAC,GAAG,IAAK,OAAA,GAAG,GAAG,CAAC,EAAP,CAAO,CAAC,CAAA;IAC9B,CAAC,CAAA;IACD,IAAM,MAAM,GAAG;QACb,UAAU,CAAC,UAAC,IAAI,IAAK,OAAA,IAAI,GAAG,CAAC,EAAR,CAAQ,CAAC,CAAA;IAChC,CAAC,CAAA;IAED,OAAO,CACL;QACE;;YAAc,OAAO,CAAM;QAC3B,gCAAQ,OAAO,EAAE,OAAO,QAAY;QACpC,gCAAQ,OAAO,EAAE,MAAM,QAAY,CAC/B,CACP,CAAA;AACH,CAAC,CAAA;AAED,eAAe,SAAS,CAAA"}