@abcagency/hc-ui-components 1.3.14 → 1.3.16

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 (166) hide show
  1. package/dist/_virtual/_rollupPluginBabelHelpers.js +1 -1
  2. package/dist/apis/hcApi.js +1 -1
  3. package/dist/apis/hcApi.js.map +1 -1
  4. package/dist/clientToken.js.map +1 -1
  5. package/dist/components/HireControlMap.js +15 -5
  6. package/dist/components/HireControlMap.js.map +1 -1
  7. package/dist/components/modules/accordions/MapAccordionItem.js +11 -1
  8. package/dist/components/modules/accordions/MapAccordionItem.js.map +1 -1
  9. package/dist/components/modules/accordions/default.js.map +1 -1
  10. package/dist/components/modules/accordions/filterItem.js +2 -1
  11. package/dist/components/modules/accordions/filterItem.js.map +1 -1
  12. package/dist/components/modules/accordions/filters.js +0 -3
  13. package/dist/components/modules/accordions/filters.js.map +1 -1
  14. package/dist/components/modules/buttons/button-group-apply.js +36 -15
  15. package/dist/components/modules/buttons/button-group-apply.js.map +1 -1
  16. package/dist/components/modules/buttons/commute-pill.js.map +1 -1
  17. package/dist/components/modules/buttons/default.js.map +1 -1
  18. package/dist/components/modules/buttons/items-pill.js.map +1 -1
  19. package/dist/components/modules/buttons/pill-wrapper.js.map +1 -1
  20. package/dist/components/modules/buttons/show-all-button.js.map +1 -1
  21. package/dist/components/modules/cards/default.js.map +1 -1
  22. package/dist/components/modules/cards/filter.js.map +1 -1
  23. package/dist/components/modules/dialogs/apply-dialog.js.map +1 -1
  24. package/dist/components/modules/filter/commute.js +22 -6
  25. package/dist/components/modules/filter/commute.js.map +1 -1
  26. package/dist/components/modules/filter/index.js +7 -0
  27. package/dist/components/modules/filter/index.js.map +1 -1
  28. package/dist/components/modules/filter/item.js +16 -1
  29. package/dist/components/modules/filter/item.js.map +1 -1
  30. package/dist/components/modules/filter/location.js +1 -1
  31. package/dist/components/modules/filter/location.js.map +1 -1
  32. package/dist/components/modules/filter/points-of-interest.js.map +1 -1
  33. package/dist/components/modules/filter/radio-item.js +7 -0
  34. package/dist/components/modules/filter/radio-item.js.map +1 -1
  35. package/dist/components/modules/filter/search.js.map +1 -1
  36. package/dist/components/modules/filter/sort.js.map +1 -1
  37. package/dist/components/modules/grid.js.map +1 -1
  38. package/dist/components/modules/icon.js.map +1 -1
  39. package/dist/components/modules/jobListing/listing-details.js +6 -0
  40. package/dist/components/modules/jobListing/listing-details.js.map +1 -1
  41. package/dist/components/modules/maps/info-window-card.js.map +1 -1
  42. package/dist/components/modules/maps/info-window-content.js +20 -0
  43. package/dist/components/modules/maps/info-window-content.js.map +1 -1
  44. package/dist/components/modules/maps/list/field-mapper.js.map +1 -1
  45. package/dist/components/modules/maps/list/header-item.js.map +1 -1
  46. package/dist/components/modules/maps/list/header.js.map +1 -1
  47. package/dist/components/modules/maps/list/index.js +21 -12
  48. package/dist/components/modules/maps/list/index.js.map +1 -1
  49. package/dist/components/modules/maps/list/item-expand-card/index.js.map +1 -1
  50. package/dist/components/modules/maps/list/item-expand-card/recruiter-contact-nav.js.map +1 -1
  51. package/dist/components/modules/maps/list/item-expand-card/recruiter-details.js.map +1 -1
  52. package/dist/components/modules/maps/list/item-expand-card/recruiter-headshot.js.map +1 -1
  53. package/dist/components/modules/maps/list/list-item/index.js +12 -2
  54. package/dist/components/modules/maps/list/list-item/index.js.map +1 -1
  55. package/dist/components/modules/maps/map-list.js.map +1 -1
  56. package/dist/components/modules/maps/map-marker.js +10 -0
  57. package/dist/components/modules/maps/map-marker.js.map +1 -1
  58. package/dist/components/modules/maps/map.js.map +1 -1
  59. package/dist/components/modules/maps/place-marker.js.map +1 -1
  60. package/dist/components/modules/maps/tabs.js.map +1 -1
  61. package/dist/constants/eventTypes.js +16 -0
  62. package/dist/constants/eventTypes.js.map +1 -0
  63. package/dist/constants/placeTypes.js.map +1 -1
  64. package/dist/contexts/mapContext.js +9 -27
  65. package/dist/contexts/mapContext.js.map +1 -1
  66. package/dist/contexts/mapListContext.js +57 -38
  67. package/dist/contexts/mapListContext.js.map +1 -1
  68. package/dist/contexts/placesContext.js.map +1 -1
  69. package/dist/contexts/trackEventContext.js +20 -0
  70. package/dist/contexts/trackEventContext.js.map +1 -0
  71. package/dist/hooks/useList.js +1 -13
  72. package/dist/hooks/useList.js.map +1 -1
  73. package/dist/services/apis/hcApi.js +1 -1
  74. package/dist/services/apis/hcApi.js.map +1 -1
  75. package/dist/services/clientToken.js.map +1 -1
  76. package/dist/services/configService.js.map +1 -1
  77. package/dist/services/googlePlacesNearbyService.js.map +1 -1
  78. package/dist/services/listingAggregatorService.js +43 -16
  79. package/dist/services/listingAggregatorService.js.map +1 -1
  80. package/dist/services/listingEntityService.js.map +1 -1
  81. package/dist/services/listingService.js.map +1 -1
  82. package/dist/services/recruiterService.js.map +1 -1
  83. package/dist/util/filterUtil.js.map +1 -1
  84. package/dist/util/loading.js.map +1 -1
  85. package/dist/util/localStorageUtil.js.map +1 -1
  86. package/dist/util/mapIconUtil.js.map +1 -1
  87. package/dist/util/mapUtil.js.map +1 -1
  88. package/dist/util/sortUtil.js.map +1 -1
  89. package/dist/util/stringUtils.js.map +1 -1
  90. package/jsconfig.json +7 -7
  91. package/package.json +60 -60
  92. package/postcss.config.js +13 -13
  93. package/preset.default.js +15 -15
  94. package/rollup.config.mjs +88 -87
  95. package/src/apis/hcApi.js +93 -93
  96. package/src/clientToken.js +9 -9
  97. package/src/components/HireControlMap.js +129 -124
  98. package/src/components/modules/accordions/MapAccordionItem.js +74 -72
  99. package/src/components/modules/accordions/default.js +171 -171
  100. package/src/components/modules/accordions/filterItem.js +55 -53
  101. package/src/components/modules/accordions/filters.js +47 -47
  102. package/src/components/modules/buttons/button-group-apply.js +123 -116
  103. package/src/components/modules/buttons/commute-pill.js +22 -22
  104. package/src/components/modules/buttons/default.js +194 -194
  105. package/src/components/modules/buttons/items-pill.js +35 -35
  106. package/src/components/modules/buttons/pill-wrapper.js +27 -27
  107. package/src/components/modules/buttons/show-all-button.js +20 -20
  108. package/src/components/modules/cards/default.js +167 -167
  109. package/src/components/modules/cards/filter.js +56 -56
  110. package/src/components/modules/dialogs/apply-dialog.js +48 -48
  111. package/src/components/modules/filter/commute.js +154 -149
  112. package/src/components/modules/filter/index.js +89 -87
  113. package/src/components/modules/filter/item.js +87 -76
  114. package/src/components/modules/filter/location.js +71 -71
  115. package/src/components/modules/filter/points-of-interest.js +44 -44
  116. package/src/components/modules/filter/radio-item.js +57 -53
  117. package/src/components/modules/filter/search.js +92 -92
  118. package/src/components/modules/filter/sort.js +83 -83
  119. package/src/components/modules/grid.js +54 -54
  120. package/src/components/modules/icon.js +33 -33
  121. package/src/components/modules/jobListing/listing-details.js +99 -95
  122. package/src/components/modules/maps/info-window-card.js +17 -17
  123. package/src/components/modules/maps/info-window-content.js +81 -74
  124. package/src/components/modules/maps/list/field-mapper.js +112 -112
  125. package/src/components/modules/maps/list/header-item.js +91 -91
  126. package/src/components/modules/maps/list/header.js +47 -47
  127. package/src/components/modules/maps/list/index.js +112 -107
  128. package/src/components/modules/maps/list/item-expand-card/index.js +22 -22
  129. package/src/components/modules/maps/list/item-expand-card/recruiter-contact-nav.js +50 -50
  130. package/src/components/modules/maps/list/item-expand-card/recruiter-details.js +68 -68
  131. package/src/components/modules/maps/list/item-expand-card/recruiter-headshot.js +22 -22
  132. package/src/components/modules/maps/list/list-item/index.js +135 -133
  133. package/src/components/modules/maps/map-list.js +74 -74
  134. package/src/components/modules/maps/map-marker.js +88 -86
  135. package/src/components/modules/maps/map.js +230 -230
  136. package/src/components/modules/maps/place-marker.js +41 -41
  137. package/src/components/modules/maps/tabs.js +81 -81
  138. package/src/constants/eventTypes.js +13 -0
  139. package/src/constants/placeTypes.js +8 -8
  140. package/src/contexts/mapContext.js +101 -115
  141. package/src/contexts/mapListContext.js +242 -222
  142. package/src/contexts/placesContext.js +102 -102
  143. package/src/contexts/trackEventContext.js +14 -0
  144. package/src/hooks/useList.js +89 -100
  145. package/src/index.js +3 -3
  146. package/src/services/configService.js +16 -16
  147. package/src/services/googlePlacesNearbyService.js +33 -33
  148. package/src/services/listingAggregatorService.js +50 -45
  149. package/src/services/listingEntityService.js +15 -15
  150. package/src/services/listingService.js +26 -26
  151. package/src/services/recruiterService.js +17 -17
  152. package/src/styles/index.css +23 -23
  153. package/src/util/arrayUtil.js +3 -3
  154. package/src/util/fieldMapper.js +22 -22
  155. package/src/util/filterUtil.js +195 -195
  156. package/src/util/loading.js +17 -17
  157. package/src/util/localStorageUtil.js +26 -26
  158. package/src/util/mapIconUtil.js +180 -180
  159. package/src/util/mapUtil.js +91 -91
  160. package/src/util/sortUtil.js +32 -32
  161. package/src/util/stringUtils.js +6 -6
  162. package/src/util/urlFilterUtil.js +90 -90
  163. package/tailwind.config.js +126 -126
  164. package/.editorconfig +0 -12
  165. package/.eslintrc +0 -105
  166. package/.prettierignore +0 -3
package/preset.default.js CHANGED
@@ -1,15 +1,15 @@
1
-
2
- module.exports = {
3
- theme: {
4
- extend: {
5
- colors: {
6
- "uiText": "#141414",
7
- "uiAccent": "#0f172a",
8
- "primary": "#002575",
9
- "primaryDark": "#001f5f",
10
- "secondary": "#ff612b",
11
- "secondaryDark": "#bf900d"
12
- }
13
- }
14
- }
15
- };
1
+
2
+ module.exports = {
3
+ theme: {
4
+ extend: {
5
+ colors: {
6
+ "uiText": "#141414",
7
+ "uiAccent": "#0f172a",
8
+ "primary": "#002575",
9
+ "primaryDark": "#001f5f",
10
+ "secondary": "#ff612b",
11
+ "secondaryDark": "#bf900d"
12
+ }
13
+ }
14
+ }
15
+ };
package/rollup.config.mjs CHANGED
@@ -1,87 +1,88 @@
1
- import babel from '@rollup/plugin-babel';
2
- import { nodeResolve as resolve } from '@rollup/plugin-node-resolve';
3
- import external from 'rollup-plugin-peer-deps-external';
4
- import alias from '@rollup/plugin-alias';
5
- import path from 'path';
6
- import commonjs from '@rollup/plugin-commonjs';
7
- import replace from '@rollup/plugin-replace';
8
- import dotenv from 'dotenv';
9
- import postcss from 'rollup-plugin-postcss';
10
- import { fileURLToPath } from 'url';
11
- import tailwindcss from 'tailwindcss';
12
- import autoprefixer from 'autoprefixer';
13
-
14
- // Load environment variables from .env file
15
- dotenv.config();
16
-
17
- // Convert file URL to file path
18
- const __filename = fileURLToPath(import.meta.url);
19
- const __dirname = path.dirname(__filename);
20
-
21
- // Resolve the project root directory
22
- const projectRootDir = path.resolve(__dirname);
23
-
24
- const plugins = [
25
- external(),
26
- resolve(),
27
- postcss({
28
- extensions: ['.css'],
29
- extract: 'styles/index.css',
30
- minimize: true,
31
- plugins: [
32
- tailwindcss,
33
- autoprefixer,
34
- ],
35
- }),
36
- replace({
37
- preventAssignment: true,
38
- 'process.env.GOOGLE_MAPS_API_KEY': JSON.stringify(process.env.GOOGLE_MAPS_API_KEY),
39
- 'process.env.GOOGLE_MAPS_API_URL': JSON.stringify(process.env.GOOGLE_MAPS_API_URL),
40
- 'process.env.HC_API_BASE_URL': JSON.stringify(process.env.HC_API_BASE_URL),
41
- }),
42
- alias({
43
- entries: [{ find: '~', replacement: path.resolve(projectRootDir, 'src') }],
44
- }),
45
- babel({
46
- babelHelpers: 'bundled',
47
- exclude: 'node_modules/**',
48
- presets: ['@babel/preset-env', '@babel/preset-react'],
49
- }),
50
- commonjs(),
51
- ];
52
-
53
- const externalDependencies = [
54
- 'react', 'react-dom', 'react-router-dom', 'form-data',
55
- 'react/jsx-runtime', 'tailwind-merge'
56
- ];
57
-
58
- export default [
59
- {
60
- input: 'src/index.js',
61
- output: {
62
- dir: 'dist',
63
- format: 'es',
64
- exports: 'named',
65
- sourcemap: true,
66
- preserveModules: true,
67
- preserveModulesRoot: 'src',
68
- },
69
- plugins,
70
- external: externalDependencies,
71
- treeshake: true,
72
- },
73
- {
74
- input: 'src/services/listingService.js',
75
- output: {
76
- dir: 'dist/services',
77
- format: 'es',
78
- exports: 'named',
79
- sourcemap: true,
80
- preserveModules: true,
81
- preserveModulesRoot: 'src/services',
82
- },
83
- plugins,
84
- external: externalDependencies,
85
- treeshake: true,
86
- },
87
- ];
1
+ import babel from '@rollup/plugin-babel';
2
+ import { nodeResolve as resolve } from '@rollup/plugin-node-resolve';
3
+ import external from 'rollup-plugin-peer-deps-external';
4
+ import alias from '@rollup/plugin-alias';
5
+ import path from 'path';
6
+ import commonjs from '@rollup/plugin-commonjs';
7
+ import replace from '@rollup/plugin-replace';
8
+ import dotenv from 'dotenv';
9
+ import postcss from 'rollup-plugin-postcss';
10
+ import { fileURLToPath } from 'url';
11
+ import tailwindcss from 'tailwindcss';
12
+ import autoprefixer from 'autoprefixer';
13
+
14
+ // Convert file URL to file path
15
+ const __filename = fileURLToPath(import.meta.url);
16
+ const __dirname = path.dirname(__filename);
17
+
18
+ // Load environment variables from .env file
19
+ dotenv.config({ path: path.resolve(__dirname, '.env') });
20
+ console.log('GOOGLE_MAPS_API_KEY:', process.env.GOOGLE_MAPS_API_KEY);
21
+
22
+ // Resolve the project root directory
23
+ const projectRootDir = path.resolve(__dirname);
24
+
25
+ const plugins = [
26
+ external(),
27
+ resolve(),
28
+ postcss({
29
+ extensions: ['.css'],
30
+ extract: 'styles/index.css',
31
+ minimize: true,
32
+ plugins: [
33
+ tailwindcss(path.resolve(__dirname, 'tailwind.config.js')),
34
+ autoprefixer
35
+ ]
36
+ }),
37
+ replace({
38
+ preventAssignment: true,
39
+ 'process.env.GOOGLE_MAPS_API_KEY': JSON.stringify(process.env.GOOGLE_MAPS_API_KEY),
40
+ 'process.env.GOOGLE_MAPS_API_URL': JSON.stringify(process.env.GOOGLE_MAPS_API_URL),
41
+ 'process.env.HC_API_BASE_URL': JSON.stringify(process.env.HC_API_BASE_URL)
42
+ }),
43
+ alias({
44
+ entries: [{ find: '~', replacement: path.resolve(projectRootDir, 'src') }]
45
+ }),
46
+ babel({
47
+ babelHelpers: 'bundled',
48
+ exclude: 'node_modules/**',
49
+ presets: ['@babel/preset-env', '@babel/preset-react']
50
+ }),
51
+ commonjs()
52
+ ];
53
+
54
+ const externalDependencies = [
55
+ 'react', 'react-dom', 'react-router-dom', 'form-data',
56
+ 'react/jsx-runtime', 'tailwind-merge'
57
+ ];
58
+
59
+ export default [
60
+ {
61
+ input: path.resolve(__dirname, 'src/index.js'),
62
+ output: {
63
+ dir: path.resolve(__dirname, 'dist'),
64
+ format: 'es',
65
+ exports: 'named',
66
+ sourcemap: true,
67
+ preserveModules: true,
68
+ preserveModulesRoot: 'src'
69
+ },
70
+ plugins,
71
+ external: externalDependencies,
72
+ treeshake: true
73
+ },
74
+ {
75
+ input: path.resolve(__dirname, 'src/services/listingService.js'),
76
+ output: {
77
+ dir: path.resolve(__dirname, 'dist/services'),
78
+ format: 'es',
79
+ exports: 'named',
80
+ sourcemap: true,
81
+ preserveModules: true,
82
+ preserveModulesRoot: 'src/services'
83
+ },
84
+ plugins,
85
+ external: externalDependencies,
86
+ treeshake: true
87
+ }
88
+ ];
package/src/apis/hcApi.js CHANGED
@@ -1,93 +1,93 @@
1
- import { getClientAuthKey } from '~/clientToken.js';
2
- const baseURL = process.env.HC_API_BASE_URL;
3
-
4
- const memoryStorage = {
5
- authToken: null,
6
- tokenExpiration: null
7
- };
8
-
9
- function setStorage(key, value) {
10
- try {
11
- sessionStorage.setItem(key, value);
12
- } catch (error) {
13
- memoryStorage[key] = value;
14
- }
15
- }
16
-
17
- function getStorage(key) {
18
- try {
19
- return sessionStorage.getItem(key) || memoryStorage[key];
20
- } catch (error) {
21
- return memoryStorage[key];
22
- }
23
- }
24
-
25
- const login = async () => {
26
- const clientAuthKey = getClientAuthKey();
27
-
28
- try {
29
- const response = await fetch(`${baseURL}/auth/login`, {
30
- method: 'POST',
31
- headers: {
32
- 'Content-Type': 'application/json'
33
- },
34
- body: JSON.stringify({
35
- clientAuthKey: clientAuthKey
36
- })
37
- });
38
-
39
- const data = await response.json();
40
-
41
- if (data.token && data.expiration) {
42
- setStorage('authToken', data.token);
43
- setStorage('tokenExpiration', data.expiration);
44
- return { token: data.token, expiration: data.expiration };
45
- }
46
- } catch (error) {
47
- console.error('Login failed:', error);
48
- throw error;
49
- }
50
- };
51
-
52
- const fetchWithAuth = async (url, options = {}) => {
53
- let token = getStorage('authToken');
54
-
55
- const expirationDateTime = getStorage('tokenExpiration');
56
- const currentTime = new Date();
57
-
58
- if (!token || !expirationDateTime || new Date(expirationDateTime) <= currentTime) {
59
- const authResponse = await login();
60
- token = authResponse.token;
61
- }
62
-
63
- const headers = new Headers(options.headers || {});
64
- headers.append('Authorization', `Bearer ${token}`);
65
-
66
- const finalOptions = {
67
- ...options,
68
- headers
69
- };
70
-
71
- const response = await fetch(`${baseURL}${url}`, finalOptions);
72
-
73
- if (!response.ok) throw new Error('Network response was not ok.');
74
-
75
- return response;
76
- };
77
-
78
- export default {
79
- get: async url => {
80
- const response = await fetchWithAuth(url);
81
- return await response.json();
82
- },
83
- post: async (url, data) => {
84
- const response = await fetchWithAuth(url, {
85
- method: 'POST',
86
- headers: {
87
- 'Content-Type': 'application/json'
88
- },
89
- body: JSON.stringify(data)
90
- });
91
- return await response.json();
92
- }
93
- };
1
+ import { getClientAuthKey } from '~/clientToken.js';
2
+ const baseURL = process.env.HC_API_BASE_URL;
3
+
4
+ const memoryStorage = {
5
+ authToken: null,
6
+ tokenExpiration: null
7
+ };
8
+
9
+ function setStorage(key, value) {
10
+ try {
11
+ sessionStorage.setItem(key, value);
12
+ } catch (error) {
13
+ memoryStorage[key] = value;
14
+ }
15
+ }
16
+
17
+ function getStorage(key) {
18
+ try {
19
+ return sessionStorage.getItem(key) || memoryStorage[key];
20
+ } catch (error) {
21
+ return memoryStorage[key];
22
+ }
23
+ }
24
+
25
+ const login = async () => {
26
+ const clientAuthKey = getClientAuthKey();
27
+
28
+ try {
29
+ const response = await fetch(`${baseURL}/auth/login`, {
30
+ method: 'POST',
31
+ headers: {
32
+ 'Content-Type': 'application/json'
33
+ },
34
+ body: JSON.stringify({
35
+ clientAuthKey: clientAuthKey
36
+ })
37
+ });
38
+
39
+ const data = await response.json();
40
+
41
+ if (data.token && data.expiration) {
42
+ setStorage('authToken', data.token);
43
+ setStorage('tokenExpiration', data.expiration);
44
+ return { token: data.token, expiration: data.expiration };
45
+ }
46
+ } catch (error) {
47
+ console.error('Login failed:', error);
48
+ throw error;
49
+ }
50
+ };
51
+
52
+ const fetchWithAuth = async (url, options = {}) => {
53
+ let token = getStorage('authToken');
54
+
55
+ const expirationDateTime = getStorage('tokenExpiration');
56
+ const currentTime = new Date();
57
+
58
+ if (!token || !expirationDateTime || new Date(expirationDateTime) <= currentTime) {
59
+ const authResponse = await login();
60
+ token = authResponse.token;
61
+ }
62
+
63
+ const headers = new Headers(options.headers || {});
64
+ headers.append('Authorization', `Bearer ${token}`);
65
+
66
+ const finalOptions = {
67
+ ...options,
68
+ headers
69
+ };
70
+
71
+ const response = await fetch(`${baseURL}${url}`, finalOptions);
72
+
73
+ if (!response.ok) throw new Error('Network response was not ok.');
74
+
75
+ return response;
76
+ };
77
+
78
+ export default {
79
+ get: async url => {
80
+ const response = await fetchWithAuth(url);
81
+ return await response.json();
82
+ },
83
+ post: async (url, data) => {
84
+ const response = await fetchWithAuth(url, {
85
+ method: 'POST',
86
+ headers: {
87
+ 'Content-Type': 'application/json'
88
+ },
89
+ body: JSON.stringify(data)
90
+ });
91
+ return await response.json();
92
+ }
93
+ };
@@ -1,9 +1,9 @@
1
- let clientAuthKey = null;
2
-
3
- export const setClientAuthKey = key => {
4
- clientAuthKey = key;
5
- };
6
-
7
- export const getClientAuthKey = () => {
8
- return clientAuthKey;
9
- };
1
+ let clientAuthKey = null;
2
+
3
+ export const setClientAuthKey = key => {
4
+ clientAuthKey = key;
5
+ };
6
+
7
+ export const getClientAuthKey = () => {
8
+ return clientAuthKey;
9
+ };