@js-smart/react-kit 5.12.0-beta.4 → 5.13.0-beta.1

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 (140) hide show
  1. package/index.cjs +74 -0
  2. package/{react-kit/src/index.ts → index.d.ts} +9 -16
  3. package/index.js +75 -0
  4. package/index.mjs +6326 -0
  5. package/lib/components/CenteredCircularProgress.d.ts +7 -0
  6. package/lib/components/ConfirmationDialog.d.ts +11 -0
  7. package/lib/components/DismissibleAlert.d.ts +17 -0
  8. package/lib/components/NextLink.d.ts +17 -0
  9. package/lib/components/OpenInNewIconLink.d.ts +17 -0
  10. package/lib/components/ReactIf.d.ts +36 -0
  11. package/lib/components/buttons/CancelButton.d.ts +28 -0
  12. package/lib/components/buttons/DeleteButton.d.ts +16 -0
  13. package/lib/components/buttons/EditIconButton.d.ts +8 -0
  14. package/lib/components/buttons/ExcelButton.d.ts +26 -0
  15. package/lib/components/buttons/GoBackButton.d.ts +10 -0
  16. package/lib/components/buttons/HistoryButton.d.ts +28 -0
  17. package/lib/components/buttons/LoadingSuccessButton.d.ts +28 -0
  18. package/lib/components/buttons/ManageButton.d.ts +14 -0
  19. package/lib/components/buttons/SuccessButton.d.ts +28 -0
  20. package/lib/components/snack-bar/AppSnackBar.d.ts +6 -0
  21. package/lib/components/snack-bar/QuerySnackBar.d.ts +18 -0
  22. package/lib/components/table/TablePaginationActions.d.ts +9 -0
  23. package/lib/components/tabs/TabPanel.d.ts +12 -0
  24. package/lib/config/fetch/FetchClient.d.ts +58 -0
  25. package/lib/config/fetch/FetchClientTypes.d.ts +39 -0
  26. package/lib/config/fetch/FetchInterceptor.d.ts +21 -0
  27. package/lib/constants/AppConstants.d.ts +15 -0
  28. package/lib/constants/HttpConstants.d.ts +13 -0
  29. package/lib/types/ProgressState.d.ts +7 -0
  30. package/lib/utils/BooleanUtils.d.ts +7 -0
  31. package/{react-kit/src/lib/utils/CssUtils.ts → lib/utils/CssUtils.d.ts} +1 -3
  32. package/lib/utils/DateUtils.d.ts +22 -0
  33. package/lib/utils/NumberUtils.d.ts +7 -0
  34. package/lib/utils/ProgressStateUtils.d.ts +38 -0
  35. package/lib/utils/StringUtils.d.ts +7 -0
  36. package/lib/utils/UrlUtils.d.ts +11 -0
  37. package/lib/utils/fetchClient.d.ts +12 -0
  38. package/package.json +31 -86
  39. package/.editorconfig +0 -13
  40. package/.eslintignore +0 -1
  41. package/.eslintrc.json +0 -41
  42. package/.github/copilot-instructions.md +0 -11
  43. package/.github/workflows/build.yml +0 -45
  44. package/.github/workflows/release.yml +0 -65
  45. package/.prettierignore +0 -5
  46. package/.prettierrc +0 -9
  47. package/.vscode/extensions.json +0 -7
  48. package/CHANGELOG.md +0 -24
  49. package/CODE_OF_CONDUCT.md +0 -128
  50. package/FUNDING.yml +0 -1
  51. package/LICENSE +0 -21
  52. package/README.md +0 -1
  53. package/apps/react-kit-demo/.eslintrc.json +0 -22
  54. package/apps/react-kit-demo/index.html +0 -16
  55. package/apps/react-kit-demo/project.json +0 -9
  56. package/apps/react-kit-demo/public/favicon.ico +0 -0
  57. package/apps/react-kit-demo/src/app/Home.tsx +0 -17
  58. package/apps/react-kit-demo/src/app/all-books/AllBooks.tsx +0 -68
  59. package/apps/react-kit-demo/src/app/app.module.scss +0 -1
  60. package/apps/react-kit-demo/src/app/app.tsx +0 -29
  61. package/apps/react-kit-demo/src/app/buttons/ButtonsDemo.tsx +0 -58
  62. package/apps/react-kit-demo/src/app/dialog/DialogDemo.tsx +0 -23
  63. package/apps/react-kit-demo/src/app/links/LinksDemo.tsx +0 -20
  64. package/apps/react-kit-demo/src/app/progress-bar/CenterCircularProgressDemo.tsx +0 -10
  65. package/apps/react-kit-demo/src/app/react-if/ReactIfDemo.tsx +0 -44
  66. package/apps/react-kit-demo/src/app/snack-bar/SnackBarDemo.tsx +0 -35
  67. package/apps/react-kit-demo/src/assets/.gitkeep +0 -0
  68. package/apps/react-kit-demo/src/constants/ApiConstants.ts +0 -7
  69. package/apps/react-kit-demo/src/constants/DialogMode.ts +0 -2
  70. package/apps/react-kit-demo/src/constants/HttpConstants.ts +0 -18
  71. package/apps/react-kit-demo/src/constants/StateConstants.ts +0 -2
  72. package/apps/react-kit-demo/src/main.tsx +0 -17
  73. package/apps/react-kit-demo/src/routes/Routes.tsx +0 -55
  74. package/apps/react-kit-demo/src/services/BookService.ts +0 -21
  75. package/apps/react-kit-demo/src/styles.scss +0 -36
  76. package/apps/react-kit-demo/src/theme.ts +0 -46
  77. package/apps/react-kit-demo/src/types/Book.ts +0 -8
  78. package/apps/react-kit-demo/src/utils/CssUtils.ts +0 -13
  79. package/apps/react-kit-demo/tsconfig.app.json +0 -18
  80. package/apps/react-kit-demo/tsconfig.json +0 -21
  81. package/apps/react-kit-demo/tsconfig.spec.json +0 -28
  82. package/apps/react-kit-demo/vite.config.ts +0 -50
  83. package/nx.json +0 -52
  84. package/react-kit/.babelrc +0 -12
  85. package/react-kit/.eslintrc.json +0 -18
  86. package/react-kit/README.md +0 -7
  87. package/react-kit/package-lock.json +0 -1330
  88. package/react-kit/package.json +0 -45
  89. package/react-kit/project.json +0 -10
  90. package/react-kit/src/lib/components/CenteredCircularProgress.tsx +0 -15
  91. package/react-kit/src/lib/components/ConfirmationDialog.tsx +0 -28
  92. package/react-kit/src/lib/components/DismissibleAlert.tsx +0 -60
  93. package/react-kit/src/lib/components/NextLink.tsx +0 -26
  94. package/react-kit/src/lib/components/OpenInNewIconLink.tsx +0 -42
  95. package/react-kit/src/lib/components/ReactIf.tsx +0 -53
  96. package/react-kit/src/lib/components/buttons/CancelButton.tsx +0 -45
  97. package/react-kit/src/lib/components/buttons/DeleteButton.tsx +0 -35
  98. package/react-kit/src/lib/components/buttons/EditIconButton.tsx +0 -23
  99. package/react-kit/src/lib/components/buttons/ExcelButton.tsx +0 -43
  100. package/react-kit/src/lib/components/buttons/GoBackButton.tsx +0 -22
  101. package/react-kit/src/lib/components/buttons/HistoryButton.tsx +0 -45
  102. package/react-kit/src/lib/components/buttons/LoadingSuccessButton.tsx +0 -53
  103. package/react-kit/src/lib/components/buttons/ManageButton.tsx +0 -31
  104. package/react-kit/src/lib/components/buttons/SuccessButton.tsx +0 -44
  105. package/react-kit/src/lib/components/snack-bar/AppSnackBar.tsx +0 -46
  106. package/react-kit/src/lib/components/snack-bar/QuerySnackBar.tsx +0 -62
  107. package/react-kit/src/lib/components/table/TablePaginationActions.tsx +0 -58
  108. package/react-kit/src/lib/components/tabs/TabPanel.tsx +0 -26
  109. package/react-kit/src/lib/constants/AppConstants.ts +0 -17
  110. package/react-kit/src/lib/types/ProgressState.ts +0 -7
  111. package/react-kit/src/lib/utils/BooleanUtils.ts +0 -13
  112. package/react-kit/src/lib/utils/DateUtils.ts +0 -43
  113. package/react-kit/src/lib/utils/NumberUtils.ts +0 -12
  114. package/react-kit/src/lib/utils/ProgressStateUtils.ts +0 -68
  115. package/react-kit/src/lib/utils/StringUtils.ts +0 -14
  116. package/react-kit/src/lib/utils/UrlUtils.ts +0 -19
  117. package/react-kit/src/lib/utils/fetchClient.ts +0 -64
  118. package/react-kit/src/tests/buttons/CancelButton.test.tsx +0 -69
  119. package/react-kit/src/tests/buttons/DeleteButton.test.tsx +0 -63
  120. package/react-kit/src/tests/buttons/EditIconButton.test.tsx +0 -34
  121. package/react-kit/src/tests/buttons/HistoryButton.test.tsx +0 -46
  122. package/react-kit/src/tests/buttons/LoadingSuccessButton.test.tsx +0 -53
  123. package/react-kit/src/tests/buttons/ManageButton.test.tsx +0 -49
  124. package/react-kit/src/tests/buttons/SuccessButton.test.tsx +0 -46
  125. package/react-kit/src/tests/snack-bar/AppSnackBar.test.tsx +0 -54
  126. package/react-kit/src/tests/utils/BooleanUtils.test.ts +0 -35
  127. package/react-kit/src/tests/utils/CssUtils.test.ts +0 -17
  128. package/react-kit/src/tests/utils/DateUtils.test.ts +0 -46
  129. package/react-kit/src/tests/utils/NumberUtils.test.ts +0 -19
  130. package/react-kit/src/tests/utils/ProgressStateUtils.test.ts +0 -131
  131. package/react-kit/src/tests/utils/StringUtils.test.ts +0 -33
  132. package/react-kit/src/tests/utils/UrlUtils.test.ts +0 -19
  133. package/react-kit/tsconfig.json +0 -21
  134. package/react-kit/tsconfig.lib.json +0 -18
  135. package/react-kit/tsconfig.spec.json +0 -27
  136. package/react-kit/vite.config.ts +0 -72
  137. package/release.sh +0 -28
  138. package/tsconfig.base.json +0 -22
  139. package/vitest.workspace.js +0 -3
  140. package/vitest.workspace.ts +0 -1
@@ -1,49 +0,0 @@
1
- import React from 'react';
2
- import { fireEvent, render, screen } from '@testing-library/react';
3
- import '@testing-library/jest-dom';
4
- import { ManageButton } from '../../lib/components/buttons/ManageButton';
5
- import jest from 'jest-mock';
6
-
7
- describe('ManageButton', () => {
8
- const mockOnClick = jest.fn();
9
-
10
- beforeEach(() => {
11
- mockOnClick.mockClear();
12
- });
13
-
14
- it('renders with the correct default properties', () => {
15
- render(<ManageButton onClick={mockOnClick} />);
16
- const button = screen.getByRole('button', { name: 'Manage' });
17
- expect(button).toBeInTheDocument();
18
- expect(button).toHaveClass('MuiButton-containedPrimary');
19
- expect(button).toHaveClass('MuiButton-sizeLarge');
20
- });
21
-
22
- it('calls onClick when clicked', () => {
23
- render(<ManageButton onClick={mockOnClick} />);
24
- fireEvent.click(screen.getByRole('button', { name: 'Manage' }));
25
- expect(mockOnClick).toHaveBeenCalledTimes(1);
26
- });
27
-
28
- it('renders with custom properties', () => {
29
- render(
30
- <ManageButton
31
- onClick={mockOnClick}
32
- name="custom-name"
33
- dataCy="custom-data-cy"
34
- variant="outlined"
35
- color="secondary"
36
- size="small"
37
- startIcon={<span data-testid="custom-icon" />}>
38
- Custom Manage
39
- </ManageButton>
40
- );
41
- const button = screen.getByRole('button', { name: 'Custom Manage' });
42
- expect(button).toBeInTheDocument();
43
- expect(button).toHaveClass('MuiButton-outlinedSecondary');
44
- expect(button).toHaveClass('MuiButton-sizeSmall');
45
- expect(button).toHaveAttribute('name', 'custom-name');
46
- expect(button).toHaveAttribute('data-cy', 'custom-data-cy');
47
- expect(screen.getByTestId('custom-icon')).toBeInTheDocument();
48
- });
49
- });
@@ -1,46 +0,0 @@
1
- import React from 'react';
2
- import { fireEvent, render, screen } from '@testing-library/react';
3
- import '@testing-library/jest-dom';
4
- import { SuccessButton } from '../../lib/components/buttons/SuccessButton';
5
- import jest from 'jest-mock';
6
-
7
- describe('SuccessButton', () => {
8
- const mockOnClick = jest.fn();
9
-
10
- beforeEach(() => {
11
- mockOnClick.mockClear();
12
- });
13
-
14
- it('renders with the correct default properties', () => {
15
- render(<SuccessButton onClick={mockOnClick}>Success</SuccessButton>);
16
- const button = screen.getByRole('button', { name: 'Success' });
17
- expect(button).toBeInTheDocument();
18
- expect(button).toHaveClass('MuiButton-containedSuccess');
19
- });
20
-
21
- it('calls onClick when clicked', () => {
22
- render(<SuccessButton onClick={mockOnClick}>Success</SuccessButton>);
23
- fireEvent.click(screen.getByRole('button', { name: 'Success' }));
24
- expect(mockOnClick).toHaveBeenCalledTimes(1);
25
- });
26
-
27
- it('renders with custom properties', () => {
28
- render(
29
- <SuccessButton
30
- onClick={mockOnClick}
31
- name="custom-name"
32
- dataCy="custom-data-cy"
33
- variant="outlined"
34
- color="secondary"
35
- startIcon={<span data-testid="custom-icon" />}>
36
- Custom Success
37
- </SuccessButton>
38
- );
39
- const button = screen.getByRole('button', { name: 'Custom Success' });
40
- expect(button).toBeInTheDocument();
41
- expect(button).toHaveClass('MuiButton-outlinedSecondary');
42
- expect(button).toHaveAttribute('name', 'custom-name');
43
- expect(button).toHaveAttribute('data-cy', 'custom-data-cy');
44
- expect(screen.getByTestId('custom-icon')).toBeInTheDocument();
45
- });
46
- });
@@ -1,54 +0,0 @@
1
- import React from 'react';
2
- import { render, screen } from '@testing-library/react';
3
- import '@testing-library/jest-dom';
4
- import { AppSnackBar } from '../../lib/components/snack-bar/AppSnackBar';
5
- import { ProgressState } from '../../lib/types/ProgressState';
6
-
7
- describe('AppSnackBar', () => {
8
- const successState: ProgressState = {
9
- isSuccess: true,
10
- isError: false,
11
- message: 'Success!',
12
- isLoading: false,
13
- isComplete: false,
14
- };
15
- const errorState: ProgressState = {
16
- isSuccess: false,
17
- isError: true,
18
- message: 'Error!',
19
- isLoading: false,
20
- isComplete: false,
21
- };
22
-
23
- it('renders success alert when progressState is success', () => {
24
- render(<AppSnackBar open={true} progressState={successState} />);
25
- const alert = screen.getByRole('alert');
26
- expect(alert).toBeInTheDocument();
27
- expect(alert).toHaveTextContent('Success!');
28
- expect(alert).toHaveClass('MuiAlert-filledSuccess');
29
- });
30
-
31
- it('renders error alert when progressState is error', () => {
32
- render(<AppSnackBar open={true} progressState={errorState} />);
33
- const alert = screen.getByRole('alert');
34
- expect(alert).toBeInTheDocument();
35
- expect(alert).toHaveTextContent('Error!');
36
- expect(alert).toHaveClass('MuiAlert-filledError');
37
- });
38
- /*
39
- it('closes the snackbar when the close button is clicked', () => {
40
- render(<AppSnackBar open={true} progressState={successState} />);
41
- const closeButton = screen.getByRole('button', { name: /close/i });
42
- fireEvent.click(closeButton);
43
- expect(screen.queryByRole('alert')).not.toBeInTheDocument();
44
- });
45
-
46
- it('auto hides the snackbar after the specified duration', () => {
47
- jest.useFakeTimers();
48
- render(<AppSnackBar open={true} progressState={successState} autoHideDuration={1000} />);
49
- expect(screen.getByRole('alert')).toBeInTheDocument();
50
- jest.advanceTimersByTime(1000);
51
- expect(screen.queryByRole('alert')).not.toBeInTheDocument();
52
- jest.useRealTimers();
53
- });*/
54
- });
@@ -1,35 +0,0 @@
1
- import { parseBoolean } from '../../lib/utils/BooleanUtils';
2
-
3
- describe('parseBoolean', () => {
4
- it('should return true for boolean true', () => {
5
- expect(parseBoolean(true)).toBe(true);
6
- });
7
-
8
- it('should return false for boolean false', () => {
9
- expect(parseBoolean(false)).toBe(false);
10
- });
11
-
12
- it('should return true for string "true"', () => {
13
- expect(parseBoolean('true')).toBe(true);
14
- });
15
-
16
- it('should return false for string "false"', () => {
17
- expect(parseBoolean('false')).toBe(false);
18
- });
19
-
20
- it('should return false for null', () => {
21
- expect(parseBoolean(null)).toBe(false);
22
- });
23
-
24
- it('should return false for undefined', () => {
25
- expect(parseBoolean(undefined)).toBe(false);
26
- });
27
-
28
- it('should return false for an empty string', () => {
29
- expect(parseBoolean('')).toBe(false);
30
- });
31
-
32
- it('should return false for any other string', () => {
33
- expect(parseBoolean('random')).toBe(false);
34
- });
35
- });
@@ -1,17 +0,0 @@
1
- import { getCssVariable } from '../../lib/utils/CssUtils';
2
-
3
- describe('getCssVariable', () => {
4
- beforeAll(() => {
5
- document.documentElement.style.setProperty('--test-variable', 'test-value');
6
- });
7
-
8
- it('should return the value of the CSS variable', () => {
9
- const value = getCssVariable('--test-variable');
10
- expect(value).toBe('test-value');
11
- });
12
-
13
- it('should return an empty string for a non-existent variable', () => {
14
- const value = getCssVariable('--non-existent-variable');
15
- expect(value).toBe('');
16
- });
17
- });
@@ -1,46 +0,0 @@
1
- import { convertToIsoDate, formatDate, setCookieExpirationDate } from '../../lib/utils/DateUtils';
2
- import { format, parseISO } from 'date-fns';
3
- import { SystemConfig } from '../../lib/constants/AppConstants';
4
- import '@testing-library/jest-dom';
5
-
6
- describe('DateUtils', () => {
7
- describe('setCookieExpirationDate', () => {
8
- it('should set cookie expiration date to 24 hours from now', () => {
9
- const now = new Date();
10
- const expectedDate = new Date(now.getTime() + SystemConfig.SYSTEM_COOKIE_TIMEOUT_MILLI_SECONDS);
11
-
12
- const result = setCookieExpirationDate();
13
-
14
- expect(result).toEqual(expectedDate);
15
- });
16
- });
17
-
18
- describe('convertToIsoDate', () => {
19
- it('should convert current date time to ISO date format', () => {
20
- const currentDateTime = '2023-10-01T12:00:00Z';
21
- const formattedDate = format(new Date(currentDateTime), SystemConfig.ISO_DATE_FORMAT);
22
-
23
- const result = convertToIsoDate(currentDateTime);
24
-
25
- expect(result).toBe(formattedDate);
26
- });
27
- });
28
-
29
- describe('formatDate', () => {
30
- it('should return an empty string if date is undefined', () => {
31
- const result = formatDate(undefined, 'yyyy-MM-dd');
32
- expect(result).toBe('');
33
- });
34
-
35
- it('should format the date to the new format', () => {
36
- const date = '2023-10-01T12:00:00Z';
37
- const newFormat = 'yyyy-MM-dd';
38
- const parsedDate = parseISO(date);
39
- const formattedDate = format(parsedDate, newFormat);
40
-
41
- const result = formatDate(date, newFormat);
42
-
43
- expect(result).toBe(formattedDate);
44
- });
45
- });
46
- });
@@ -1,19 +0,0 @@
1
- import { parseNumber } from '../../lib/utils/NumberUtils';
2
-
3
- describe('parseNumber', () => {
4
- it('should return a number when a valid string is provided', () => {
5
- expect(parseNumber('123')).toBe(123);
6
- });
7
-
8
- it('should return NaN when an invalid string is provided', () => {
9
- expect(parseNumber('abc')).toBeNaN();
10
- });
11
-
12
- it('should return undefined when null is provided', () => {
13
- expect(parseNumber(null)).toBeUndefined();
14
- });
15
-
16
- it('should return undefined when undefined is provided', () => {
17
- expect(parseNumber(undefined)).toBeUndefined();
18
- });
19
- });
@@ -1,131 +0,0 @@
1
- import { initializeState, markError, markLoading, markSuccess } from '../../lib/utils/ProgressStateUtils';
2
- import { ProgressState } from '../../lib/types/ProgressState';
3
-
4
- describe('ProgressStateUtils', () => {
5
- describe('initializeState', () => {
6
- it('should initialize the state correctly', () => {
7
- const expectedState: ProgressState = {
8
- isLoading: false,
9
- isSuccess: false,
10
- isError: false,
11
- isComplete: false,
12
- message: '',
13
- };
14
-
15
- const result = initializeState();
16
-
17
- expect(result).toEqual(expectedState);
18
- });
19
- });
20
-
21
- describe('markLoading', () => {
22
- it('should update the state to loading', () => {
23
- const initialState: ProgressState = {
24
- isLoading: false,
25
- isSuccess: false,
26
- isError: false,
27
- isComplete: false,
28
- message: '',
29
- };
30
-
31
- const expectedState: ProgressState = {
32
- ...initialState,
33
- isLoading: true,
34
- };
35
-
36
- const result = markLoading(initialState);
37
-
38
- expect(result).toEqual(expectedState);
39
- });
40
- });
41
-
42
- describe('markSuccess', () => {
43
- it('should update the state to success with a message', () => {
44
- const initialState: ProgressState = {
45
- isLoading: false,
46
- isSuccess: false,
47
- isError: false,
48
- isComplete: false,
49
- message: '',
50
- };
51
-
52
- const message = 'Operation successful';
53
- const expectedState: ProgressState = {
54
- ...initialState,
55
- isSuccess: true,
56
- isComplete: true,
57
- message,
58
- };
59
-
60
- const result = markSuccess(initialState, message);
61
-
62
- expect(result).toEqual(expectedState);
63
- });
64
-
65
- it('should update the state to success without a message', () => {
66
- const initialState: ProgressState = {
67
- isLoading: false,
68
- isSuccess: false,
69
- isError: false,
70
- isComplete: false,
71
- message: '',
72
- };
73
-
74
- const expectedState: ProgressState = {
75
- ...initialState,
76
- isSuccess: true,
77
- isComplete: true,
78
- message: '',
79
- };
80
-
81
- const result = markSuccess(initialState);
82
-
83
- expect(result).toEqual(expectedState);
84
- });
85
- });
86
-
87
- describe('markError', () => {
88
- it('should update the state to error with a message', () => {
89
- const initialState: ProgressState = {
90
- isLoading: false,
91
- isSuccess: false,
92
- isError: false,
93
- isComplete: false,
94
- message: '',
95
- };
96
-
97
- const message = 'Operation failed';
98
- const expectedState: ProgressState = {
99
- ...initialState,
100
- isError: true,
101
- isComplete: true,
102
- message,
103
- };
104
-
105
- const result = markError(initialState, message);
106
-
107
- expect(result).toEqual(expectedState);
108
- });
109
-
110
- it('should update the state to error without a message', () => {
111
- const initialState: ProgressState = {
112
- isLoading: false,
113
- isSuccess: false,
114
- isError: false,
115
- isComplete: false,
116
- message: '',
117
- };
118
-
119
- const expectedState: ProgressState = {
120
- ...initialState,
121
- isError: true,
122
- isComplete: true,
123
- message: '',
124
- };
125
-
126
- const result = markError(initialState);
127
-
128
- expect(result).toEqual(expectedState);
129
- });
130
- });
131
- });
@@ -1,33 +0,0 @@
1
- import { isBlankOrEmpty } from '../../lib/utils/StringUtils';
2
-
3
- describe('isBlankOrEmpty', () => {
4
- it('should return true for null', () => {
5
- expect(isBlankOrEmpty(null)).toBe(true);
6
- });
7
-
8
- it('should return true for undefined', () => {
9
- expect(isBlankOrEmpty(undefined)).toBe(true);
10
- });
11
-
12
- it('should return true for an empty string', () => {
13
- expect(isBlankOrEmpty('')).toBe(true);
14
- });
15
-
16
- it('should return true for a string with only spaces', () => {
17
- expect(isBlankOrEmpty(' ')).toBe(true);
18
- });
19
-
20
- it('should return false for a non-empty string', () => {
21
- expect(isBlankOrEmpty('hello')).toBe(false);
22
- });
23
-
24
- it('should return false for a string with non-space characters', () => {
25
- expect(isBlankOrEmpty(' hello ')).toBe(false);
26
- });
27
-
28
- it('should return false for non-string values', () => {
29
- expect(isBlankOrEmpty(123)).toBe(false);
30
- expect(isBlankOrEmpty({})).toBe(false);
31
- expect(isBlankOrEmpty([])).toBe(false);
32
- });
33
- });
@@ -1,19 +0,0 @@
1
- import { isEncoded } from '../../lib/utils/UrlUtils';
2
-
3
- describe('isEncoded', () => {
4
- it('should return true for an encoded URL', () => {
5
- expect(isEncoded('https%3A%2F%2Fexample.com')).toBe(true);
6
- });
7
-
8
- it('should return false for a non-encoded URL', () => {
9
- expect(isEncoded('https://example.com')).toBe(false);
10
- });
11
-
12
- it('should return false for an improperly encoded URL', () => {
13
- expect(isEncoded('%E0%A4%A')).toBe(false);
14
- });
15
-
16
- it('should return false for an empty string', () => {
17
- expect(isEncoded('')).toBe(false);
18
- });
19
- });
@@ -1,21 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "jsx": "react-jsx",
4
- "allowJs": false,
5
- "esModuleInterop": false,
6
- "allowSyntheticDefaultImports": true,
7
- "strict": true,
8
- "types": ["vite/client", "vitest"]
9
- },
10
- "files": [],
11
- "include": [],
12
- "references": [
13
- {
14
- "path": "./tsconfig.lib.json"
15
- },
16
- {
17
- "path": "./tsconfig.spec.json"
18
- }
19
- ],
20
- "extends": "../tsconfig.base.json"
21
- }
@@ -1,18 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "compilerOptions": {
4
- "outDir": "../dist/out-tsc",
5
- "types": ["node", "@nx/react/typings/cssmodule.d.ts", "@nx/react/typings/image.d.ts", "vite/client"]
6
- },
7
- "exclude": [
8
- "**/*.spec.ts",
9
- "**/*.test.ts",
10
- "**/*.spec.tsx",
11
- "**/*.test.tsx",
12
- "**/*.spec.js",
13
- "**/*.test.js",
14
- "**/*.spec.jsx",
15
- "**/*.test.jsx"
16
- ],
17
- "include": ["src/**/*.js", "src/**/*.jsx", "src/**/*.ts", "src/**/*.tsx"]
18
- }
@@ -1,27 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "compilerOptions": {
4
- "outDir": "../dist/out-tsc",
5
- "types": [
6
- "vitest/globals",
7
- "vitest/importMeta",
8
- "vite/client",
9
- "node",
10
- "vitest",
11
- "@testing-library/jest-dom"
12
- ]
13
- },
14
- "include": [
15
- "vite.config.ts",
16
- "vitest.config.ts",
17
- "src/**/*.test.ts",
18
- "src/**/*.spec.ts",
19
- "src/**/*.test.tsx",
20
- "src/**/*.spec.tsx",
21
- "src/**/*.test.js",
22
- "src/**/*.spec.js",
23
- "src/**/*.test.jsx",
24
- "src/**/*.spec.jsx",
25
- "src/**/*.d.ts"
26
- ]
27
- }
@@ -1,72 +0,0 @@
1
- /// <reference types='vitest' />
2
- import { defineConfig } from 'vite';
3
- import react from '@vitejs/plugin-react';
4
- import dts from 'vite-plugin-dts';
5
- import * as path from 'path';
6
- import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
7
-
8
- export default defineConfig({
9
- root: __dirname,
10
- cacheDir: '../node_modules/.vite/react-kit',
11
-
12
- plugins: [
13
- react(),
14
- nxViteTsPaths(),
15
- dts({
16
- entryRoot: 'src',
17
- tsconfigPath: path.join(__dirname, 'tsconfig.lib.json'),
18
- }),
19
- ],
20
-
21
- // Uncomment this if you are using workers.
22
- // worker: {
23
- // plugins: [ nxViteTsPaths() ],
24
- // },
25
-
26
- // Configuration for building your library.
27
- // See: https://vitejs.dev/guide/build.html#library-mode
28
- build: {
29
- outDir: '../dist/react-kit',
30
- reportCompressedSize: true,
31
- commonjsOptions: {
32
- transformMixedEsModules: true,
33
- },
34
- lib: {
35
- // Could also be a dictionary or array of multiple entry points.
36
- entry: 'src/index.ts',
37
- name: 'react-kit',
38
- fileName: 'index',
39
- // Change this to the formats you want to support.
40
- // Don't forget to update your package.json as well.
41
- formats: ['es', 'cjs'],
42
- },
43
- rollupOptions: {
44
- // External packages that should not be bundled into your library.
45
- external: [
46
- 'react',
47
- 'react-dom',
48
- '@mui/material',
49
- '@emotion/react',
50
- '@emotion/styled',
51
- '@mui/icons-material',
52
- 'date-fns',
53
- 'react-router-dom',
54
- 'react/jsx-runtime',
55
- ],
56
- },
57
- },
58
- test: {
59
- globals: true,
60
- cache: {
61
- dir: '../node_modules/.vitest/react-kit',
62
- },
63
- environment: 'jsdom',
64
- include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
65
-
66
- reporters: ['default'],
67
- coverage: {
68
- reportsDirectory: '../coverage/react-kit',
69
- provider: 'v8',
70
- },
71
- },
72
- });
package/release.sh DELETED
@@ -1,28 +0,0 @@
1
- #!/bin/bash
2
-
3
- # Get the first argument
4
- next_version=$1
5
-
6
- # Path to the package.json file
7
- PACKAGE_JSON_FILE="react-kit/package.json"
8
- PACKAGE_JSON_FILE2="package.json"
9
-
10
- # Update the version in package.json
11
- jq --arg v "$next_version" '.version = $v' "$PACKAGE_JSON_FILE" > "tmp.json" && mv "tmp.json" "$PACKAGE_JSON_FILE"
12
- jq --arg v "$next_version" '.version = $v' "$PACKAGE_JSON_FILE2" > "tmp2.json" && mv "tmp2.json" "$PACKAGE_JSON_FILE2"
13
-
14
- # Build the commit message
15
- commit_message="chore: bump version to $next_version"
16
-
17
- # Set the git user
18
- git config user.name "Pavan Kumar Jadda"
19
- git config user.email 17564080+pavankjadda@users.noreply.github.com
20
- git config user.signingkey "$2"
21
- git config commit.gpgsign true
22
-
23
- # Make the git commit with the message
24
- git add .
25
- git commit -m "$commit_message"
26
-
27
- # Push the commit
28
- git push
@@ -1,22 +0,0 @@
1
- {
2
- "compileOnSave": false,
3
- "compilerOptions": {
4
- "rootDir": ".",
5
- "sourceMap": true,
6
- "declaration": false,
7
- "moduleResolution": "node",
8
- "emitDecoratorMetadata": true,
9
- "experimentalDecorators": true,
10
- "importHelpers": true,
11
- "target": "es2022",
12
- "module": "esnext",
13
- "lib": ["es2022", "dom"],
14
- "skipLibCheck": true,
15
- "skipDefaultLibCheck": true,
16
- "baseUrl": ".",
17
- "paths": {
18
- "@react-kit/*": ["react-kit/src/index.ts"]
19
- }
20
- },
21
- "exclude": ["node_modules", "tmp"]
22
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = ['**/*/vite.config.ts', '**/*/vitest.config.ts'];
@@ -1 +0,0 @@
1
- export default ['**/*/vite.config.ts', '**/*/vitest.config.ts'];