@abcagency/hc-ui-components 1.1.1 → 1.2.0

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 (234) hide show
  1. package/.editorconfig +12 -0
  2. package/.eslintrc +144 -0
  3. package/.prettierignore +3 -0
  4. package/dist/_virtual/_rollupPluginBabelHelpers.js +516 -0
  5. package/dist/_virtual/_rollupPluginBabelHelpers.js.map +1 -0
  6. package/dist/apis/hcApi.js +189 -0
  7. package/dist/apis/hcApi.js.map +1 -0
  8. package/dist/clientToken.js +10 -0
  9. package/dist/clientToken.js.map +1 -0
  10. package/dist/components/HireControlMap.js +129 -0
  11. package/dist/components/HireControlMap.js.map +1 -0
  12. package/dist/components/modules/accordions/MapAccordionItem.js +76 -0
  13. package/dist/components/modules/accordions/MapAccordionItem.js.map +1 -0
  14. package/dist/components/modules/accordions/default.js +108 -0
  15. package/dist/components/modules/accordions/default.js.map +1 -0
  16. package/dist/components/modules/accordions/filterItem.js +50 -0
  17. package/dist/components/modules/accordions/filterItem.js.map +1 -0
  18. package/dist/components/modules/accordions/filters.js +46 -0
  19. package/dist/components/modules/accordions/filters.js.map +1 -0
  20. package/dist/components/modules/buttons/button-group-apply.js +84 -0
  21. package/dist/components/modules/buttons/button-group-apply.js.map +1 -0
  22. package/dist/components/modules/buttons/commute-pill.js +18 -0
  23. package/dist/components/modules/buttons/commute-pill.js.map +1 -0
  24. package/dist/components/modules/buttons/default.js +145 -0
  25. package/dist/components/modules/buttons/default.js.map +1 -0
  26. package/dist/components/modules/buttons/items-pill.js +23 -0
  27. package/dist/components/modules/buttons/items-pill.js.map +1 -0
  28. package/dist/components/modules/buttons/pill-wrapper.js +20 -0
  29. package/dist/components/modules/buttons/pill-wrapper.js.map +1 -0
  30. package/dist/components/modules/buttons/show-all-button.js +39 -0
  31. package/dist/components/modules/buttons/show-all-button.js.map +1 -0
  32. package/dist/components/modules/cards/default.js +102 -0
  33. package/dist/components/modules/cards/default.js.map +1 -0
  34. package/dist/components/modules/cards/filter.js +38 -0
  35. package/dist/components/modules/cards/filter.js.map +1 -0
  36. package/dist/components/modules/dialogs/apply-dialog.js +46 -0
  37. package/dist/components/modules/dialogs/apply-dialog.js.map +1 -0
  38. package/dist/components/modules/filter/commute.js +184 -0
  39. package/dist/components/modules/filter/commute.js.map +1 -0
  40. package/dist/components/modules/filter/index.js +79 -0
  41. package/dist/components/modules/filter/index.js.map +1 -0
  42. package/dist/components/modules/filter/item.js +71 -0
  43. package/dist/components/modules/filter/item.js.map +1 -0
  44. package/dist/components/modules/filter/location.js +68 -0
  45. package/dist/components/modules/filter/location.js.map +1 -0
  46. package/dist/components/modules/filter/points-of-interest.js +38 -0
  47. package/dist/components/modules/filter/points-of-interest.js.map +1 -0
  48. package/dist/components/modules/filter/radio-item.js +46 -0
  49. package/dist/components/modules/filter/radio-item.js.map +1 -0
  50. package/dist/components/modules/filter/search.js +83 -0
  51. package/dist/components/modules/filter/search.js.map +1 -0
  52. package/dist/components/modules/filter/sort.js +93 -0
  53. package/dist/components/modules/filter/sort.js.map +1 -0
  54. package/dist/components/modules/grid.js +39 -0
  55. package/dist/components/modules/grid.js.map +1 -0
  56. package/dist/components/modules/icon.js +23 -0
  57. package/dist/components/modules/icon.js.map +1 -0
  58. package/dist/components/modules/jobListing/listing-details.js +69 -0
  59. package/dist/components/modules/jobListing/listing-details.js.map +1 -0
  60. package/dist/components/modules/maps/info-window-card.js +14 -0
  61. package/dist/components/modules/maps/info-window-card.js.map +1 -0
  62. package/dist/components/modules/maps/info-window-content.js +39 -0
  63. package/dist/components/modules/maps/info-window-content.js.map +1 -0
  64. package/dist/components/modules/maps/list/field-mapper.js +88 -0
  65. package/dist/components/modules/maps/list/field-mapper.js.map +1 -0
  66. package/dist/components/modules/maps/list/header-item.js +59 -0
  67. package/dist/components/modules/maps/list/header-item.js.map +1 -0
  68. package/dist/components/modules/maps/list/header.js +37 -0
  69. package/dist/components/modules/maps/list/header.js.map +1 -0
  70. package/dist/components/modules/maps/list/index.js +93 -0
  71. package/dist/components/modules/maps/list/index.js.map +1 -0
  72. package/dist/components/modules/maps/list/item-expand-card/index.js +16 -0
  73. package/dist/components/modules/maps/list/item-expand-card/index.js.map +1 -0
  74. package/dist/components/modules/maps/list/item-expand-card/recruiter-contact-nav.js +38 -0
  75. package/dist/components/modules/maps/list/item-expand-card/recruiter-contact-nav.js.map +1 -0
  76. package/dist/components/modules/maps/list/item-expand-card/recruiter-details.js +40 -0
  77. package/dist/components/modules/maps/list/item-expand-card/recruiter-details.js.map +1 -0
  78. package/dist/components/modules/maps/list/item-expand-card/recruiter-headshot.js +20 -0
  79. package/dist/components/modules/maps/list/item-expand-card/recruiter-headshot.js.map +1 -0
  80. package/dist/components/modules/maps/list/list-item/index.js +98 -0
  81. package/dist/components/modules/maps/list/list-item/index.js.map +1 -0
  82. package/dist/components/modules/maps/map-list.js +57 -0
  83. package/dist/components/modules/maps/map-list.js.map +1 -0
  84. package/dist/components/modules/maps/map-marker.js +85 -0
  85. package/dist/components/modules/maps/map-marker.js.map +1 -0
  86. package/dist/components/modules/maps/map.js +201 -0
  87. package/dist/components/modules/maps/map.js.map +1 -0
  88. package/dist/components/modules/maps/place-marker.js +37 -0
  89. package/dist/components/modules/maps/place-marker.js.map +1 -0
  90. package/dist/components/modules/maps/tabs.js +84 -0
  91. package/dist/components/modules/maps/tabs.js.map +1 -0
  92. package/dist/constants/placeTypes.js +11 -0
  93. package/dist/constants/placeTypes.js.map +1 -0
  94. package/dist/contexts/mapContext.js +133 -0
  95. package/dist/contexts/mapContext.js.map +1 -0
  96. package/dist/contexts/mapListContext.js +278 -0
  97. package/dist/contexts/mapListContext.js.map +1 -0
  98. package/dist/contexts/placesContext.js +152 -0
  99. package/dist/contexts/placesContext.js.map +1 -0
  100. package/dist/hooks/useList.js +119 -0
  101. package/dist/hooks/useList.js.map +1 -0
  102. package/dist/index.js +2 -4536
  103. package/dist/index.js.map +1 -0
  104. package/dist/services/_virtual/_rollupPluginBabelHelpers.js +372 -0
  105. package/dist/services/_virtual/_rollupPluginBabelHelpers.js.map +1 -0
  106. package/dist/services/apis/hcApi.js +189 -0
  107. package/dist/services/apis/hcApi.js.map +1 -0
  108. package/dist/services/clientToken.js +7 -0
  109. package/dist/services/clientToken.js.map +1 -0
  110. package/dist/services/configService.js +33 -0
  111. package/dist/services/configService.js.map +1 -0
  112. package/dist/services/googlePlacesNearbyService.js +61 -0
  113. package/dist/services/googlePlacesNearbyService.js.map +1 -0
  114. package/dist/services/listingAggregatorService.js +56 -0
  115. package/dist/services/listingAggregatorService.js.map +1 -0
  116. package/dist/services/listingEntityService.js +36 -0
  117. package/dist/services/listingEntityService.js.map +1 -0
  118. package/dist/services/listingService.js +60 -112
  119. package/dist/services/listingService.js.map +1 -0
  120. package/dist/services/recruiterService.js +36 -0
  121. package/dist/services/recruiterService.js.map +1 -0
  122. package/dist/services/styles/index.css +3 -0
  123. package/dist/styles/index.css +3 -0
  124. package/dist/util/filterUtil.js +213 -0
  125. package/dist/util/filterUtil.js.map +1 -0
  126. package/dist/util/loading.js +16 -0
  127. package/dist/util/loading.js.map +1 -0
  128. package/dist/util/localStorageUtil.js +32 -0
  129. package/dist/util/localStorageUtil.js.map +1 -0
  130. package/dist/util/mapIconUtil.js +73 -0
  131. package/dist/util/mapIconUtil.js.map +1 -0
  132. package/dist/util/mapUtil.js +76 -0
  133. package/dist/util/mapUtil.js.map +1 -0
  134. package/dist/util/sortUtil.js +33 -0
  135. package/dist/util/sortUtil.js.map +1 -0
  136. package/dist/util/stringUtils.js +9 -0
  137. package/dist/util/stringUtils.js.map +1 -0
  138. package/jsconfig.json +7 -0
  139. package/package.json +51 -38
  140. package/postcss.config.js +13 -15
  141. package/{src/tailwind/preset.default.js → preset.default.js} +15 -15
  142. package/rollup.config.mjs +87 -0
  143. package/src/apis/hcApi.js +93 -87
  144. package/src/clientToken.js +9 -9
  145. package/src/components/HireControlMap.js +120 -0
  146. package/src/components/modules/accordions/MapAccordionItem.js +72 -69
  147. package/src/components/modules/accordions/default.js +171 -173
  148. package/src/components/modules/accordions/filterItem.js +53 -53
  149. package/src/components/modules/accordions/filters.js +47 -44
  150. package/src/components/modules/buttons/button-group-apply.js +113 -85
  151. package/src/components/modules/buttons/commute-pill.js +22 -21
  152. package/src/components/modules/buttons/default.js +196 -196
  153. package/src/components/modules/buttons/items-pill.js +32 -31
  154. package/src/components/modules/buttons/pill-wrapper.js +27 -26
  155. package/src/components/modules/buttons/show-all-button.js +20 -20
  156. package/src/components/modules/cards/default.js +167 -168
  157. package/src/components/modules/cards/filter.js +56 -55
  158. package/src/components/modules/dialogs/apply-dialog.js +48 -47
  159. package/src/components/modules/filter/commute.js +148 -151
  160. package/src/components/modules/filter/index.js +87 -86
  161. package/src/components/modules/filter/item.js +76 -77
  162. package/src/components/modules/filter/location.js +71 -69
  163. package/src/components/modules/filter/points-of-interest.js +44 -43
  164. package/src/components/modules/filter/radio-item.js +53 -51
  165. package/src/components/modules/filter/search.js +92 -91
  166. package/src/components/modules/filter/sort.js +83 -83
  167. package/src/components/modules/grid.js +55 -56
  168. package/src/components/modules/icon.js +33 -33
  169. package/src/components/modules/jobListing/listing-details.js +94 -88
  170. package/src/components/modules/maps/info-window-card.js +17 -17
  171. package/src/components/modules/maps/info-window-content.js +58 -60
  172. package/src/components/modules/maps/list/field-mapper.js +112 -111
  173. package/src/components/modules/maps/list/header-item.js +91 -90
  174. package/src/components/modules/maps/list/header.js +47 -46
  175. package/src/components/modules/maps/list/index.js +107 -104
  176. package/src/components/modules/maps/list/item-expand-card/index.js +22 -21
  177. package/src/components/modules/maps/list/item-expand-card/recruiter-contact-nav.js +50 -48
  178. package/src/components/modules/maps/list/item-expand-card/recruiter-details.js +68 -67
  179. package/src/components/modules/maps/list/item-expand-card/recruiter-headshot.js +22 -22
  180. package/src/components/modules/maps/list/list-item/index.js +134 -133
  181. package/src/components/modules/maps/map-list.js +74 -73
  182. package/src/components/modules/maps/map-marker.js +86 -84
  183. package/src/components/modules/maps/map.js +229 -226
  184. package/src/components/modules/maps/place-marker.js +1 -1
  185. package/src/components/modules/maps/tabs.js +81 -79
  186. package/src/constants/placeTypes.js +8 -8
  187. package/src/contexts/mapContext.js +20 -19
  188. package/src/contexts/mapListContext.js +20 -15
  189. package/src/contexts/placesContext.js +4 -0
  190. package/src/hooks/useList.js +12 -10
  191. package/src/index.js +3 -103
  192. package/src/services/configService.js +16 -16
  193. package/src/services/googlePlacesNearbyService.js +33 -33
  194. package/src/services/listingAggregatorService.js +5 -4
  195. package/src/services/listingEntityService.js +2 -1
  196. package/src/services/listingService.js +27 -28
  197. package/src/services/recruiterService.js +17 -17
  198. package/src/styles/{globals.css → index.css} +23 -23
  199. package/src/util/arrayUtil.js +3 -3
  200. package/src/util/fieldMapper.js +22 -19
  201. package/src/util/filterUtil.js +19 -19
  202. package/src/util/loading.js +17 -17
  203. package/src/util/localStorageUtil.js +26 -26
  204. package/src/util/mapIconUtil.js +3 -3
  205. package/src/util/sortUtil.js +32 -32
  206. package/src/util/stringUtils.js +6 -6
  207. package/{src/tailwind/tailwind.config.js → tailwind.config.js} +126 -127
  208. package/dist/globals.css +0 -3
  209. package/dist/output.css +0 -784
  210. package/dist/services/globals.css +0 -3
  211. package/rollup.config.js +0 -68
  212. package/src/components/layout/footer.js +0 -34
  213. package/src/components/layout/header.js +0 -23
  214. package/src/components/layout/layout.js +0 -36
  215. package/src/components/modules/animations/slidein.js +0 -41
  216. package/src/components/modules/navigation/nav-link.js +0 -65
  217. package/src/components/modules/navigation/navbar.js +0 -106
  218. package/src/components/modules/navigation/skip-link.js +0 -21
  219. package/src/components/modules/navigation/social.js +0 -29
  220. package/src/components/modules/sections/default.js +0 -59
  221. package/src/components/modules/sections/sectionContext.js +0 -4
  222. package/src/hooks/useClickOutside.js +0 -16
  223. package/src/hooks/useEventListener.js +0 -25
  224. package/src/hooks/useEventTracker.js +0 -19
  225. package/src/hooks/useRefScrollProgress.js +0 -24
  226. package/src/hooks/useScript.js +0 -63
  227. package/src/hooks/useScrollDirection.js +0 -39
  228. package/src/hooks/useSectionTracker.js +0 -95
  229. package/src/hooks/useUserAgent.js +0 -43
  230. package/src/hooks/useWindowSize.js +0 -28
  231. package/src/index.css +0 -25
  232. package/src/styles/fonts.js +0 -0
  233. package/src/util/page-head.js +0 -62
  234. package/src/util/provider.js +0 -12
@@ -1,196 +1,196 @@
1
- import { forwardRef } from 'react';
2
- import { Link, useLocation, useNavigate } from 'react-router-dom';
3
- import { twMerge } from 'tailwind-merge';
4
- import Icon from '~/components/modules/icon';
5
- import React from 'react'
6
- const linkDefaultClasses = "normal-case text-inherit !font-[inherit] [font-weight:inherit] !p-0 rounded-none";
7
- const underlineClasses = "!underline decoration-1 underline-offset-2 hover:!no-underline focus:!no-underline";
8
-
9
- const ButtonVariant = {
10
- none: '',
11
- primary: 'hc-bg-primary hc-border hc-border-primary hc-text-white hover:hc-bg-opacity-70 focus:hc-bg-opacity-70',
12
- secondary: 'hc-bg-secondary hc-border hc-border-secondary hc-text-white hover:hc-bg-opacity-70 focus:hc-bg-opacity-70',
13
- outline: 'hc-bg-transparent hc-border hc-border-primary hc-text-primary hover:hc-bg-primaryDark hover:hc-border-primaryDark hover:hc-text-white focus:hc-bg-primaryDark focus:hc-border-primaryDark hc-focus:hc-text-white',
14
- link: `${linkDefaultClasses} hc-text-primary hover:hc-text-uiText focus:hc-text-uiText`,
15
- icon: 'hc-opacity-100 hover:hc-opacity-70 focus:hc-opacity-70'
16
- };
17
-
18
- const ButtonSize = {
19
- none: '',
20
- default: 'hc-py-2 hc-px-6 hc-text-base',
21
- sq: 'hc-p-2.5',
22
- sqsm: 'hc-p-1',
23
- xs: 'hc-py-1.5 hc-px-3 hc-text-xs',
24
- sm: 'hc-py-1.5 hc-px-4 hc-text-sm',
25
- lg: 'hc-py-4 hc-px-10 hc-text-lg'
26
- };
27
-
28
- const ButtonDefaults = {
29
- style: 'hc-group hc-font-medium hc-uppercase hc-text-center hc-rounded hc-transition',
30
- size: ButtonSize.default,
31
- variant: ButtonVariant.primary,
32
- block: 'block w-full'
33
- };
34
-
35
- const linkVariants = variant => variant === 'link';
36
-
37
- const buttonClasses = (variant, size, isBlock, hasUnderline, className) => twMerge(
38
- isBlock ? ButtonDefaults.block : linkVariants(variant) ? 'hc-inline' : 'hc-inline-block',
39
- ButtonDefaults.style,
40
- variant ? ButtonVariant[variant] : ButtonDefaults.variant,
41
- size ? ButtonSize[size] : ButtonDefaults.size,
42
- hasUnderline ? underlineClasses : '',
43
- className ?? ''
44
- );
45
-
46
- const Button = ({
47
- children
48
- }) => {
49
- return (
50
- { children }
51
- );
52
- };
53
-
54
- export const Anchor = ({
55
- children,
56
- href,
57
- className,
58
- size,
59
- variant,
60
- isBlock,
61
- hasUnderline,
62
- target = '_blank',
63
- ...rest
64
- }) => {
65
- return (
66
- <a
67
- href={href}
68
- target={target}
69
- className={buttonClasses(variant, size, isBlock, hasUnderline, className)}
70
- onClick={href === '#' ? e => {
71
- e.preventDefault();
72
- } : null}
73
- {...rest}
74
- >
75
- {children}
76
- </a>
77
- );
78
- };
79
-
80
- export const AnchorLink = ({
81
- children,
82
- href,
83
- className,
84
- activeClassName,
85
- partiallyActive = false,
86
- size,
87
- variant,
88
- isBlock,
89
- hasUnderline,
90
- ...rest
91
- }) => {
92
- const router = useRouter();
93
-
94
- return (
95
- <Link
96
- href={href}
97
- className={`
98
- ${buttonClasses(variant, size, isBlock, hasUnderline, className)}
99
- ${(activeClassName && router.pathname === href) || (router.pathname.startsWith(href) && partiallyActive) ? activeClassName : ''}
100
- `}
101
- {...rest}
102
- >
103
- {children}
104
- </Link>
105
- );
106
- };
107
-
108
- export const ScrollAnchor = forwardRef((props, ref) => {
109
- const {
110
- children,
111
- href,
112
- className,
113
- size,
114
- variant,
115
- isBlock,
116
- hasUnderline,
117
- ...rest
118
- } = props;
119
-
120
- return (
121
- <Link
122
- ref={ref}
123
- href={`#${href}`}
124
- scroll={false}
125
- className={buttonClasses(variant, size, isBlock, hasUnderline, className)}
126
- {...rest}
127
- >
128
- {children}
129
- </Link>
130
- );
131
- });
132
-
133
- export const Btn = forwardRef((props, ref) => {
134
- const {
135
- children,
136
- type = 'button',
137
- className,
138
- size,
139
- variant,
140
- isBlock,
141
- hasUnderline,
142
- ...rest
143
- } = props;
144
- return (
145
- <button
146
- ref={ref}
147
- type={type}
148
- className={buttonClasses(variant, size, isBlock, hasUnderline, className)}
149
- {...rest}
150
- >
151
- {children}
152
- </button>
153
- );
154
- });
155
-
156
- export const ButtonBody = ({
157
- children,
158
- className
159
- }) => {
160
- return (
161
- <span
162
- className={twMerge(
163
- 'hc-inline-flex hc-w-full hc-items-center hc-justify-between hc-gap-1.5',
164
- className ?? ''
165
- )}
166
- >
167
- {children}
168
- </span>
169
- );
170
- };
171
-
172
- export const ButtonIcon = ({
173
- icon,
174
- size = 'hc-size-4',
175
- className
176
- }) => {
177
- return (
178
- <Icon
179
-
180
- icon={icon}
181
- size={size}
182
- className={className ?? ''}
183
- />
184
- );
185
- };
186
-
187
- Button.Anchor = Anchor;
188
- Button.Link = AnchorLink;
189
- Button.Scroll = ScrollAnchor;
190
- Button.Btn = Btn;
191
- Button.Body = ButtonBody;
192
- Button.Icon = ButtonIcon;
193
-
194
- Btn.displayName = 'Button:Button';
195
- ScrollAnchor.displayName = 'Button:ScrollAnchor';
196
- export default Button;
1
+ import React from 'react'
2
+ import { forwardRef } from 'react';
3
+ import { Link } from 'react-router-dom';
4
+ import { twMerge } from 'tailwind-merge';
5
+
6
+ import Icon from '~/components/modules/icon';
7
+
8
+ const linkDefaultClasses = "hc-normal-case hc-text-inherit !hc-font-[inherit] hc-[font-weight:inherit] !hc-p-0 hc-rounded-none";
9
+ const underlineClasses = "!underline decoration-1 underline-offset-2 hover:!no-underline focus:!no-underline";
10
+
11
+ const ButtonVariant = {
12
+ none: '',
13
+ primary: 'hc-bg-primary hc-border hc-border-primary hc-text-white hover:hc-bg-opacity-70 focus:hc-bg-opacity-70',
14
+ secondary: 'hc-bg-secondary hc-border hc-border-secondary hc-text-white hover:hc-bg-opacity-70 focus:hc-bg-opacity-70',
15
+ outline: 'hc-bg-transparent hc-border hc-border-primary hc-text-primary hover:hc-bg-primaryDark hover:hc-border-primaryDark hover:hc-text-white focus:hc-bg-primaryDark focus:hc-border-primaryDark focus:hc-text-white',
16
+ link: `${linkDefaultClasses} hc-text-primary hover:hc-text-uiText focus:hc-text-uiText`,
17
+ icon: 'hc-opacity-100 hover:hc-opacity-70 focus:hc-opacity-70'
18
+ };
19
+
20
+ const ButtonSize = {
21
+ none: '',
22
+ default: 'hc-py-2 hc-px-6 hc-text-base',
23
+ sq: 'hc-p-2.5',
24
+ sqsm: 'hc-p-1',
25
+ xs: 'hc-py-1.5 hc-px-3 hc-text-xs',
26
+ sm: 'hc-py-1.5 hc-px-4 hc-text-sm',
27
+ lg: 'hc-py-4 hc-px-10 hc-text-lg'
28
+ };
29
+
30
+ const ButtonDefaults = {
31
+ style: 'hc-group hc-font-medium hc-uppercase hc-text-center hc-rounded hc-transition',
32
+ size: ButtonSize.default,
33
+ variant: ButtonVariant.primary,
34
+ block: 'hc-block hc-w-full'
35
+ };
36
+
37
+ const linkVariants = variant => variant === 'link';
38
+
39
+ const buttonClasses = (variant, size, isBlock, hasUnderline, className) => twMerge(
40
+ isBlock ? ButtonDefaults.block : linkVariants(variant) ? 'hc-inline' : 'hc-inline-block',
41
+ ButtonDefaults.style,
42
+ variant ? ButtonVariant[variant] : ButtonDefaults.variant,
43
+ size ? ButtonSize[size] : ButtonDefaults.size,
44
+ hasUnderline ? underlineClasses : '',
45
+ className ?? ''
46
+ );
47
+
48
+ const Button = ({
49
+ children
50
+ }) => {
51
+ return (
52
+ { children }
53
+ );
54
+ };
55
+
56
+ export const Anchor = ({
57
+ children,
58
+ href,
59
+ className,
60
+ size,
61
+ variant,
62
+ isBlock,
63
+ hasUnderline,
64
+ target = '_blank',
65
+ ...rest
66
+ }) => {
67
+ return (
68
+ <a
69
+ href={href}
70
+ target={target}
71
+ className={buttonClasses(variant, size, isBlock, hasUnderline, className)}
72
+ onClick={href === '#' ? e => {
73
+ e.preventDefault();
74
+ } : null}
75
+ {...rest}
76
+ >
77
+ {children}
78
+ </a>
79
+ );
80
+ };
81
+
82
+ export const AnchorLink = ({
83
+ children,
84
+ Link,
85
+ href,
86
+ className,
87
+ activeClassName,
88
+ partiallyActive = false,
89
+ size,
90
+ variant,
91
+ isBlock,
92
+ hasUnderline,
93
+ ...rest
94
+ }) => {
95
+ return (
96
+ <Link
97
+ href={href}
98
+ className={`
99
+ ${buttonClasses(variant, size, isBlock, hasUnderline, className)}
100
+ `}
101
+ {...rest}
102
+ >
103
+ {children}
104
+ </Link>
105
+ );
106
+ };
107
+
108
+ export const ScrollAnchor = forwardRef((props, ref) => {
109
+ const {
110
+ children,
111
+ href,
112
+ className,
113
+ size,
114
+ variant,
115
+ isBlock,
116
+ hasUnderline,
117
+ ...rest
118
+ } = props;
119
+
120
+ return (
121
+ <Link
122
+ ref={ref}
123
+ href={`#${href}`}
124
+ scroll={false}
125
+ className={buttonClasses(variant, size, isBlock, hasUnderline, className)}
126
+ {...rest}
127
+ >
128
+ {children}
129
+ </Link>
130
+ );
131
+ });
132
+
133
+ export const Btn = forwardRef((props, ref) => {
134
+ const {
135
+ children,
136
+ type = 'button',
137
+ className,
138
+ size,
139
+ variant,
140
+ isBlock,
141
+ hasUnderline,
142
+ ...rest
143
+ } = props;
144
+ return (
145
+ <button
146
+ ref={ref}
147
+ type={type}
148
+ className={buttonClasses(variant, size, isBlock, hasUnderline, className)}
149
+ {...rest}
150
+ >
151
+ {children}
152
+ </button>
153
+ );
154
+ });
155
+
156
+ export const ButtonBody = ({
157
+ children,
158
+ className
159
+ }) => {
160
+ return (
161
+ <span
162
+ className={twMerge(
163
+ 'hc-inline-flex hc-w-full hc-items-center hc-justify-between hc-gap-1.5',
164
+ className ?? ''
165
+ )}
166
+ >
167
+ {children}
168
+ </span>
169
+ );
170
+ };
171
+
172
+ export const ButtonIcon = ({
173
+ icon,
174
+ size = 'hc-size-4',
175
+ className
176
+ }) => {
177
+ return (
178
+ <Icon
179
+
180
+ icon={icon}
181
+ size={size}
182
+ className={className ?? ''}
183
+ />
184
+ );
185
+ };
186
+
187
+ Button.Anchor = Anchor;
188
+ Button.Link = AnchorLink;
189
+ Button.Scroll = ScrollAnchor;
190
+ Button.Btn = Btn;
191
+ Button.Body = ButtonBody;
192
+ Button.Icon = ButtonIcon;
193
+
194
+ Btn.displayName = 'Button:Button';
195
+ ScrollAnchor.displayName = 'Button:ScrollAnchor';
196
+ export default Button;
@@ -1,31 +1,32 @@
1
- import { forwardRef } from 'react';
2
- import React from 'react'
3
- import Button from '~/components/modules/buttons/default';
4
-
5
- export const ButtonItemsPill = forwardRef((
6
- {
7
- className,
8
- activeItemsCount,
9
- ...props
10
- },
11
- ref
12
- ) => {
13
- return (
14
- <Button.Btn
15
- ref={ref}
16
- size="none"
17
- variant="none"
18
- className="hc-relative hc-z-[2] hc-group hc-inline-flex hc-items-center hc-gap-px hc-ml-auto hc-mr-1.5 hc-pl-1.5 hc-pr-1 hc-py-0.5 hc-rounded hc-bg-primary/10 hc-text-xs hc-font-bold hc-text-primary hc-ring-1 hc-ring-inset hc-ring-primary/20"
19
- {...props}
20
- >
21
- {activeItemsCount > 9 ? '9+' : activeItemsCount}
22
- <Button.Icon
23
- icon="uil:times"
24
- size="hc-size-3.5"
25
- />
26
- </Button.Btn>
27
- );
28
- });
29
-
30
- ButtonItemsPill.displayName = 'ButtonItemsPill';
31
- export default ButtonItemsPill;
1
+ import React from 'react'
2
+ import { forwardRef } from 'react';
3
+
4
+ import Button from '~/components/modules/buttons/default';
5
+
6
+ export const ButtonItemsPill = forwardRef((
7
+ {
8
+ className,
9
+ activeItemsCount,
10
+ ...props
11
+ },
12
+ ref
13
+ ) => {
14
+ return (
15
+ <Button.Btn
16
+ ref={ref}
17
+ size="none"
18
+ variant="none"
19
+ className="hc-relative hc-z-[2] hc-group hc-inline-flex hc-items-center hc-gap-px hc-ml-auto hc-mr-1.5 hc-pl-1.5 hc-pr-1 hc-py-0.5 hc-rounded hc-bg-primary/10 hc-text-xs hc-font-bold hc-text-primary hc-ring-1 hc-ring-inset hc-ring-primary/20"
20
+ {...props}
21
+ >
22
+ {activeItemsCount > 9 ? '9+' : activeItemsCount}
23
+ <Button.Icon
24
+ icon="uil:times"
25
+ size="hc-size-3.5"
26
+ />
27
+ </Button.Btn>
28
+ );
29
+ });
30
+
31
+ ButtonItemsPill.displayName = 'ButtonItemsPill';
32
+ export default ButtonItemsPill;
@@ -1,26 +1,27 @@
1
- import { forwardRef } from 'react';
2
- import Button from '~/components/modules/buttons/default';
3
- import React from 'react'
4
- export const PillWrapper = forwardRef((
5
- {
6
- className,
7
- children,
8
- ...props
9
- },
10
- ref
11
- ) => {
12
- return (
13
- <Button.Btn
14
- ref={ref}
15
- size="none"
16
- variant="none"
17
- className={`hc-relative hc-group hc-inline-flex hc-items-center hc-gap-px hc-ml-auto hc-mr-1.5 hc-pl-1.5 hc-pr-1 hc-py-0.5 hc-rounded hc-bg-primary/10 hc-text-xs hc-font-bold hc-text-primary hc-ring-1 hc-ring-inset hc-ring-primary/20 ${className}`}
18
- {...props}
19
- >
20
- {children}
21
- </Button.Btn>
22
- );
23
- });
24
-
25
- PillWrapper.displayName = 'PillWrapper';
26
- export default PillWrapper;
1
+ import React, { forwardRef } from 'react';
2
+
3
+ import Button from '~/components/modules/buttons/default';
4
+
5
+ export const PillWrapper = forwardRef((
6
+ {
7
+ className,
8
+ children,
9
+ ...props
10
+ },
11
+ ref
12
+ ) => {
13
+ return (
14
+ <Button.Btn
15
+ ref={ref}
16
+ size="none"
17
+ variant="none"
18
+ className={`hc-relative hc-group hc-inline-flex hc-items-center hc-gap-px hc-ml-auto hc-mr-1.5 hc-pl-1.5 hc-pr-1 hc-py-0.5 hc-rounded hc-bg-primary/10 hc-text-xs hc-font-bold hc-text-primary hc-ring-1 hc-ring-inset hc-ring-primary/20 ${className}`}
19
+ {...props}
20
+ >
21
+ {children}
22
+ </Button.Btn>
23
+ );
24
+ });
25
+
26
+ PillWrapper.displayName = 'PillWrapper';
27
+ export default PillWrapper;
@@ -1,20 +1,20 @@
1
- import React from 'react';
2
-
3
- const ShowAllButton = ({ mapInteracted, markerConfigs, setMapInteracted, fitBounds, mapRef, pinIconUrl, setSelectedFilters, setQuery, listingCount }) => {
4
- if (!mapInteracted || !markerConfigs) {
5
- return null;
6
- }
7
-
8
- return (
9
- <button
10
- style={{ fontFamily: 'Roboto, Arial, sans-serif', fontSize: '14px', fontWeight: '500' }}
11
- className="hc-absolute hc-bottom-10 hc-left-2.5 hc-z-10 hc-flex hc-items-center hc-justify-center hc-pl-2 hc-pb-1 hc-pt-1.5 hc-pr-3 hc-bg-white hc-text-black hc-border-none hc-rounded-full hc-shadow hc-cursor-pointer hc-text-sm hc-font-medium"
12
- onClick={() => { setMapInteracted(false); fitBounds(mapRef.current, true); if (listingCount < 2) { setSelectedFilters({}); setQuery(null); }; }}
13
- >
14
- <img src={pinIconUrl} alt="Pin Icon" className="hc-size-5" />
15
- Show All
16
- </button>
17
- );
18
- };
19
-
20
- export default ShowAllButton;
1
+ import React from 'react';
2
+
3
+ const ShowAllButton = ({ mapInteracted, markerConfigs, setMapInteracted, fitBounds, mapRef, pinIconUrl, setSelectedFilters, setQuery, listingCount }) => {
4
+ if (!mapInteracted || !markerConfigs) {
5
+ return null;
6
+ }
7
+
8
+ return (
9
+ <button
10
+ style={{ fontFamily: 'Roboto, Arial, sans-serif', fontSize: '14px', fontWeight: '500' }}
11
+ className="hc-absolute hc-bottom-10 hc-left-2.5 hc-z-10 hc-flex hc-items-center hc-justify-center hc-pl-2 hc-pb-1 hc-pt-1.5 hc-pr-3 hc-bg-white hc-text-black hc-border-none hc-rounded-full hc-shadow hc-cursor-pointer hc-text-sm hc-font-medium"
12
+ onClick={() => { setMapInteracted(false); fitBounds(mapRef.current, true); if (listingCount < 2) { setSelectedFilters({}); setQuery(null); }; }}
13
+ >
14
+ <img src={pinIconUrl} alt="Pin Icon" className="hc-size-5" />
15
+ Show All
16
+ </button>
17
+ );
18
+ };
19
+
20
+ export default ShowAllButton;