@abcagency/hc-ui-components 1.9.15 → 1.9.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.
@@ -1,5 +1,6 @@
1
1
  import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../../_virtual/_rollupPluginBabelHelpers.js';
2
2
  import React, { forwardRef } from 'react';
3
+ import { twMerge } from 'tailwind-merge';
3
4
  import Button from './default.js';
4
5
 
5
6
  var _excluded = ["className", "children"];
@@ -11,7 +12,7 @@ var PillWrapper = /*#__PURE__*/forwardRef(function (_ref, ref) {
11
12
  ref: ref,
12
13
  size: "none",
13
14
  variant: "none",
14
- 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 ".concat(className)
15
+ className: twMerge('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)
15
16
  }, props), children);
16
17
  });
17
18
  PillWrapper.displayName = 'PillWrapper';
@@ -1 +1 @@
1
- {"version":3,"file":"pill-wrapper.js","sources":["../../../../src/components/modules/buttons/pill-wrapper.js"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport Button from '~/components/modules/buttons/default';\n\nexport const PillWrapper = forwardRef((\n\t{\n\t\tclassName,\n\t\tchildren,\n\t\t...props\n\t},\n\tref\n) => {\n\treturn (\n\t\t<Button.Btn\n\t\t\tref={ref}\n\t\t\tsize=\"none\"\n\t\t\tvariant=\"none\"\n\t\t\tclassName={`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}`}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t</Button.Btn>\n\t);\n});\n\nPillWrapper.displayName = 'PillWrapper';\nexport default PillWrapper;\n"],"names":["PillWrapper","forwardRef","_ref","ref","className","children","props","_objectWithoutProperties","_excluded","React","createElement","Button","Btn","_extends","size","variant","concat","displayName"],"mappings":";;;;;AAIO,IAAMA,WAAW,gBAAGC,UAAU,CAAC,UAAAC,IAAA,EAMrCC,GAAG,EACC;AAAA,EAAA,IALHC,SAAS,GAAAF,IAAA,CAATE,SAAS;IACTC,QAAQ,GAAAH,IAAA,CAARG,QAAQ;AACLC,IAAAA,KAAK,GAAAC,wBAAA,CAAAL,IAAA,EAAAM,SAAA,CAAA,CAAA;EAIT,oBACCC,KAAA,CAAAC,aAAA,CAACC,MAAM,CAACC,GAAG,EAAAC,QAAA,CAAA;AACVV,IAAAA,GAAG,EAAEA,GAAI;AACTW,IAAAA,IAAI,EAAC,MAAM;AACXC,IAAAA,OAAO,EAAC,MAAM;IACdX,SAAS,EAAA,gOAAA,CAAAY,MAAA,CAAmOZ,SAAS,CAAA;GACjPE,EAAAA,KAAK,CAERD,EAAAA,QACU,CAAC,CAAA;AAEf,CAAC,EAAC;AAEFL,WAAW,CAACiB,WAAW,GAAG,aAAa;;;;"}
1
+ {"version":3,"file":"pill-wrapper.js","sources":["../../../../src/components/modules/buttons/pill-wrapper.js"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { twMerge } from 'tailwind-merge';\n\nimport Button from '~/components/modules/buttons/default';\n\nexport const PillWrapper = forwardRef((\n\t{\n\t\tclassName,\n\t\tchildren,\n\t\t...props\n\t},\n\tref\n) => {\n\treturn (\n\t\t<Button.Btn\n\t\t\tref={ref}\n\t\t\tsize=\"none\"\n\t\t\tvariant=\"none\"\n\t\t\tclassName={twMerge('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)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t</Button.Btn>\n\t);\n});\n\nPillWrapper.displayName = 'PillWrapper';\nexport default PillWrapper;\n"],"names":["PillWrapper","forwardRef","_ref","ref","className","children","props","_objectWithoutProperties","_excluded","React","createElement","Button","Btn","_extends","size","variant","twMerge","displayName"],"mappings":";;;;;;AAKO,IAAMA,WAAW,gBAAGC,UAAU,CAAC,UAAAC,IAAA,EAMrCC,GAAG,EACC;AAAA,EAAA,IALHC,SAAS,GAAAF,IAAA,CAATE,SAAS;IACTC,QAAQ,GAAAH,IAAA,CAARG,QAAQ;AACLC,IAAAA,KAAK,GAAAC,wBAAA,CAAAL,IAAA,EAAAM,SAAA,CAAA,CAAA;EAIT,oBACCC,KAAA,CAAAC,aAAA,CAACC,MAAM,CAACC,GAAG,EAAAC,QAAA,CAAA;AACVV,IAAAA,GAAG,EAAEA,GAAI;AACTW,IAAAA,IAAI,EAAC,MAAM;AACXC,IAAAA,OAAO,EAAC,MAAM;AACdX,IAAAA,SAAS,EAAEY,OAAO,CAAC,+NAA+N,EAAEZ,SAAS,CAAA;GACzPE,EAAAA,KAAK,CAERD,EAAAA,QACU,CAAC,CAAA;AAEf,CAAC,EAAC;AAEFL,WAAW,CAACiB,WAAW,GAAG,aAAa;;;;"}
@@ -1,40 +1,19 @@
1
- import { slicedToArray as _slicedToArray } from '../../../_virtual/_rollupPluginBabelHelpers.js';
2
1
  import React from 'react';
3
2
  import Grid from '../grid.js';
4
- import { PillWrapper } from '../buttons/pill-wrapper.js';
5
3
  import { capitalize } from '../../../util/stringUtils.js';
6
4
  import { getFieldValue } from '../../../util/filterUtil.js';
5
+ import 'tailwind-merge';
7
6
 
8
7
  var FieldMapperDesktop = function FieldMapperDesktop(_ref) {
9
8
  var item = _ref.item,
10
- fieldsShown = _ref.fieldsShown,
11
- specialFeatures = _ref.specialFeatures;
9
+ fieldsShown = _ref.fieldsShown;
10
+ _ref.specialFeatures;
11
+ var specialFeaturePills = _ref.specialFeaturePills;
12
12
  // Check both fields and customFields for field presence
13
13
  var orderedFields = fieldsShown.filter(function (field) {
14
14
  var value = getFieldValue(item, field);
15
15
  return value !== undefined && value !== null;
16
16
  });
17
- var specialFeaturePills = function specialFeaturePills(field) {
18
- return field === 'title' && specialFeatures && Object.entries(specialFeatures).map(function (_ref2) {
19
- var _ref3 = _slicedToArray(_ref2, 2),
20
- featureKey = _ref3[0],
21
- featureLabel = _ref3[1];
22
- var value = getFieldValue(item, featureKey);
23
- // Handle boolean fields (value == 1 or "true")
24
- if (value == 1 || value === 1 || value === '1' || value === 'true' || value === 'True' || value === true) {
25
- return /*#__PURE__*/React.createElement(PillWrapper, {
26
- key: featureKey
27
- }, featureLabel);
28
- }
29
- // Handle multi-value custom fields - show the value if it's not empty/false
30
- if (value && value !== '' && value !== 'false' && value !== 'False' && value !== '0' && value !== 0) {
31
- return /*#__PURE__*/React.createElement(PillWrapper, {
32
- key: featureKey
33
- }, featureLabel, ": ", value);
34
- }
35
- return null;
36
- });
37
- };
38
17
  return /*#__PURE__*/React.createElement(React.Fragment, null, orderedFields.map(function (field, index) {
39
18
  var value = getFieldValue(item, field);
40
19
  return /*#__PURE__*/React.createElement(Grid.Item, {
@@ -1 +1 @@
1
- {"version":3,"file":"field-mapper-desktop.js","sources":["../../../../src/components/modules/list/field-mapper-desktop.jsx"],"sourcesContent":["import React from 'react';\nimport Grid from '~/components/modules/grid';\nimport PillWrapper from '~/components/modules/buttons/pill-wrapper';\nimport { capitalize } from '~/util/stringUtils';\nimport { getFieldValue } from '~/util/filterUtil';\n\nconst FieldMapperDesktop = ({\n\titem,\n\tfieldsShown,\n\tspecialFeatures\n}) => {\n\t// Check both fields and customFields for field presence\n\tconst orderedFields = fieldsShown.filter(field => {\n\t\tconst value = getFieldValue(item, field);\n\t\treturn value !== undefined && value !== null;\n\t});\n\n\tconst specialFeaturePills = field => {\n\t\treturn field === 'title' && specialFeatures &&\n Object.entries(specialFeatures).map(([featureKey, featureLabel]) => {\n \tconst value = getFieldValue(item, featureKey);\n \t// Handle boolean fields (value == 1 or \"true\")\n \tif (value == 1 || value === 1 || value === '1' || value === 'true' || value === 'True' || value === true) {\n \t\treturn <PillWrapper key={featureKey}>{featureLabel}</PillWrapper>;\n \t}\n \t// Handle multi-value custom fields - show the value if it's not empty/false\n \tif (value && value !== '' && value !== 'false' && value !== 'False' && value !== '0' && value !== 0) {\n \t\treturn <PillWrapper key={featureKey}>{featureLabel}: {value}</PillWrapper>;\n \t}\n \treturn null;\n });\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t{orderedFields.map((field, index) => {\n\t\t\t\tlet value = getFieldValue(item, field);\n\t\t\t\treturn (\n\t\t\t\t\t<Grid.Item\n\t\t\t\t\t\tkey={field}\n\t\t\t\t\t\tclassName={`\n hc-hidden md:hc-block hc-px-2\n ${index === 0 ? \"hc-pl-7\" : \"\"}\n ${field.toLowerCase() === \"title\" ? \"hc-col-span-4 hc-text-balance hc-font-semibold\" : (field.toLowerCase() === \"state\" || field.toLowerCase() == \"favorite\") ? \"hc-col-span-1\" : \"hc-col-span-2\"}\n `}\n\t\t\t\t\t>\n\t\t\t\t\t\t<span className=\"hc-sr-only\">{capitalize(field)}</span>\n\t\t\t\t\t\t{value}\n\t\t\t\t\t\t<br />\n\t\t\t\t\t\t{specialFeaturePills(field)}\n\t\t\t\t\t</Grid.Item>\n\t\t\t\t);\n\t\t\t})}\n\t\t</>\n\t);\n};\n\nexport default FieldMapperDesktop;"],"names":["FieldMapperDesktop","_ref","item","fieldsShown","specialFeatures","orderedFields","filter","field","value","getFieldValue","undefined","specialFeaturePills","Object","entries","map","_ref2","_ref3","_slicedToArray","featureKey","featureLabel","React","createElement","PillWrapper","key","Fragment","index","Grid","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C,EACLV,mBAAmB,CAACJ,KAAK,CAChB,CAAC,CAAA;AAEd,GAAC,CACA,CAAC,CAAA;AAEL;;;;"}
1
+ {"version":3,"file":"field-mapper-desktop.js","sources":["../../../../src/components/modules/list/field-mapper-desktop.jsx"],"sourcesContent":["import React from 'react';\nimport Grid from '~/components/modules/grid';\nimport PillWrapper from '~/components/modules/buttons/pill-wrapper';\nimport { capitalize } from '~/util/stringUtils';\nimport { getFieldValue } from '~/util/filterUtil';\nimport { twMerge } from 'tailwind-merge';\n\nconst FieldMapperDesktop = ({\n\titem,\n\tfieldsShown,\n\tspecialFeatures,\n\tspecialFeaturePills\n}) => {\n\t// Check both fields and customFields for field presence\n\tconst orderedFields = fieldsShown.filter(field => {\n\t\tconst value = getFieldValue(item, field);\n\t\treturn value !== undefined && value !== null;\n\t});\n\n\tconst specialFeaturePillsRender = field => {\n\t\tif (field !== 'title' || !specialFeatures || !specialFeaturePills) return null;\n\t\t\n\t\treturn Object.entries(specialFeatures).map(([featureKey, featureLabel]) => {\n\t\t\t// Only show pill if it's configured in specialFeaturePills\n\t\t\tif (!specialFeaturePills[featureKey]) return null;\n\t\t\t\n\t\t\tconst value = getFieldValue(item, featureKey);\n\t\t\tconst customClassName = specialFeaturePills[featureKey]?.className || '';\n\t\t\t\n\t\t\t// Handle boolean fields (value == 1 or \"true\")\n\t\t\tif (value == 1 || value === 1 || value === '1' || value === 'true' || value === 'True' || value === true) {\n\t\t\t\treturn <PillWrapper key={featureKey} className={customClassName}>{featureLabel}</PillWrapper>;\n\t\t\t}\n\t\t\t// Handle multi-value custom fields - show the value if it's not empty/false\n\t\t\tif (value && value !== '' && value !== 'false' && value !== 'False' && value !== '0' && value !== 0) {\n\t\t\t\treturn <PillWrapper key={featureKey} className={customClassName}>{featureLabel}: {value}</PillWrapper>;\n\t\t\t}\n\t\t\treturn null;\n\t\t});\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t{orderedFields.map((field, index) => {\n\t\t\t\tlet value = getFieldValue(item, field);\n\t\t\t\treturn (\n\t\t\t\t\t<Grid.Item\n\t\t\t\t\t\tkey={field}\n\t\t\t\t\t\tclassName={`\n hc-hidden md:hc-block hc-px-2\n ${index === 0 ? \"hc-pl-7\" : \"\"}\n ${field.toLowerCase() === \"title\" ? \"hc-col-span-4 hc-text-balance hc-font-semibold\" : (field.toLowerCase() === \"state\" || field.toLowerCase() == \"favorite\") ? \"hc-col-span-1\" : \"hc-col-span-2\"}\n `}\n\t\t\t\t\t>\n\t\t\t\t\t\t<span className=\"hc-sr-only\">{capitalize(field)}</span>\n\t\t\t\t\t\t{value}\n\t\t\t\t\t\t<br />\n\t\t\t\t\t\t{specialFeaturePills(field)}\n\t\t\t\t\t</Grid.Item>\n\t\t\t\t);\n\t\t\t})}\n\t\t</>\n\t);\n};\n\nexport default FieldMapperDesktop;"],"names":["FieldMapperDesktop","_ref","item","fieldsShown","specialFeatures","specialFeaturePills","orderedFields","filter","field","value","getFieldValue","undefined","React","createElement","Fragment","map","index","Grid","Item","key","className","concat","toLowerCase","capitalize"],"mappings":";;;;;;AAOA,IAAMA,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAAC,IAAA,EAKlB;AAAA,EAAA,IAJLC,IAAI,GAAAD,IAAA,CAAJC,IAAI,CAAA;IACJC,WAAW,GAAAF,IAAA,CAAXE,WAAW,CAAA;IACIF,IAAA,CAAfG,eAAe,CAAA;QACfC,mBAAmB,GAAAJ,IAAA,CAAnBI,oBAAmB;AAEnB;EACA,IAAMC,aAAa,GAAGH,WAAW,CAACI,MAAM,CAAC,UAAAC,KAAK,EAAI;AACjD,IAAA,IAAMC,KAAK,GAAGC,aAAa,CAACR,IAAI,EAAEM,KAAK,CAAC,CAAA;AACxC,IAAA,OAAOC,KAAK,KAAKE,SAAS,IAAIF,KAAK,KAAK,IAAI,CAAA;AAC7C,GAAC,CAAC,CAAA;AAwBF,EAAA,oBACCG,KAAA,CAAAC,aAAA,CAAAD,KAAA,CAAAE,QAAA,EAAA,IAAA,EACER,aAAa,CAACS,GAAG,CAAC,UAACP,KAAK,EAAEQ,KAAK,EAAK;AACpC,IAAA,IAAIP,KAAK,GAAGC,aAAa,CAACR,IAAI,EAAEM,KAAK,CAAC,CAAA;AACtC,IAAA,oBACCI,KAAA,CAAAC,aAAA,CAACI,IAAI,CAACC,IAAI,EAAA;AACTC,MAAAA,GAAG,EAAEX,KAAM;AACXY,MAAAA,SAAS,kEAAAC,MAAA,CAECL,KAAK,KAAK,CAAC,GAAG,SAAS,GAAG,EAAE,EAAA,kBAAA,CAAA,CAAAK,MAAA,CAC5Bb,KAAK,CAACc,WAAW,EAAE,KAAK,OAAO,GAAG,gDAAgD,GAAId,KAAK,CAACc,WAAW,EAAE,KAAK,OAAO,IAAId,KAAK,CAACc,WAAW,EAAE,IAAI,UAAU,GAAI,eAAe,GAAG,eAAe,EAAA,gBAAA,CAAA;KAGzMV,eAAAA,KAAA,CAAAC,aAAA,CAAA,MAAA,EAAA;AAAMO,MAAAA,SAAS,EAAC,YAAA;AAAY,KAAA,EAAEG,UAAU,CAACf,KAAK,CAAQ,CAAC,EACtDC,KAAK,eACNG,KAAA,CAAAC,aAAA,WAAK,CAAC,EACLR,mBAAmB,CAACG,KAAK,CAChB,CAAC,CAAA;AAEd,GAAC,CACA,CAAC,CAAA;AAEL;;;;"}
@@ -4,31 +4,41 @@ import Grid from '../grid.js';
4
4
  import IconContained from '../icon.js';
5
5
  import { PillWrapper } from '../buttons/pill-wrapper.js';
6
6
  import { getFieldValue } from '../../../util/filterUtil.js';
7
+ import 'tailwind-merge';
7
8
 
8
9
  var FieldMapperMobile = function FieldMapperMobile(_ref) {
9
10
  var item = _ref.item,
10
11
  fieldsShown = _ref.fieldsShown,
11
12
  specialFeatures = _ref.specialFeatures,
13
+ specialFeaturePills = _ref.specialFeaturePills,
12
14
  handleFavouriteClick = _ref.handleFavouriteClick,
13
15
  isFavorite = _ref.isFavorite,
14
16
  _ref$includeFavorite = _ref.includeFavorite,
15
17
  includeFavorite = _ref$includeFavorite === void 0 ? true : _ref$includeFavorite;
16
- var specialFeaturePills = function specialFeaturePills(field) {
17
- return field === 'title' && specialFeatures && Object.entries(specialFeatures).map(function (_ref2) {
18
+ var specialFeaturePillsRender = function specialFeaturePillsRender(field) {
19
+ if (!specialFeatures || !specialFeaturePills) return null;
20
+ return Object.entries(specialFeatures).map(function (_ref2) {
21
+ var _specialFeaturePills$;
18
22
  var _ref3 = _slicedToArray(_ref2, 2),
19
23
  featureKey = _ref3[0],
20
24
  featureLabel = _ref3[1];
25
+ // Only show pill if it's configured in specialFeaturePills
26
+ if (!specialFeaturePills[featureKey]) return null;
21
27
  var value = getFieldValue(item, featureKey);
28
+ var customClassName = ((_specialFeaturePills$ = specialFeaturePills[featureKey]) === null || _specialFeaturePills$ === void 0 ? void 0 : _specialFeaturePills$.className) || '';
29
+
22
30
  // Handle boolean fields (value == 1 or "true")
23
31
  if (value == 1 || value === 1 || value === '1' || value === 'true' || value === 'True' || value === true) {
24
32
  return /*#__PURE__*/React.createElement(PillWrapper, {
25
- key: featureKey
33
+ key: featureKey,
34
+ className: customClassName
26
35
  }, featureLabel);
27
36
  }
28
37
  // Handle multi-value custom fields - show the value if it's not empty/false
29
38
  if (value && value !== '' && value !== 'false' && value !== 'False' && value !== '0' && value !== 0) {
30
39
  return /*#__PURE__*/React.createElement(PillWrapper, {
31
- key: featureKey
40
+ key: featureKey,
41
+ className: customClassName
32
42
  }, featureLabel, ": ", value);
33
43
  }
34
44
  return null;
@@ -54,7 +64,7 @@ var FieldMapperMobile = function FieldMapperMobile(_ref) {
54
64
  }
55
65
  })))), specialFeatures && /*#__PURE__*/React.createElement("div", {
56
66
  className: "hc-pb-4"
57
- }, specialFeaturePills("title"), " ")), /*#__PURE__*/React.createElement("ul", {
67
+ }, specialFeaturePillsRender(), " "), /*#__PURE__*/React.createElement("ul", {
58
68
  className: "hc-space-y-2 hc-text-xs"
59
69
  }, [{
60
70
  field: "category",
@@ -95,7 +105,7 @@ var FieldMapperMobile = function FieldMapperMobile(_ref) {
95
105
  }), /*#__PURE__*/React.createElement("span", {
96
106
  className: "hc-sr-only"
97
107
  }, listItem.name), getFieldValue(item, listItem.field));
98
- })));
108
+ }))));
99
109
  };
100
110
 
101
111
  export { FieldMapperMobile as default };
@@ -1 +1 @@
1
- {"version":3,"file":"field-mapper-mobile.js","sources":["../../../../src/components/modules/list/field-mapper-mobile.jsx"],"sourcesContent":["import React from 'react';\nimport Grid from '~/components/modules/grid';\nimport Icon from '~/components/modules/icon';\nimport PillWrapper from '~/components/modules/buttons/pill-wrapper';\nimport { getFieldValue } from '~/util/filterUtil';\n\nconst FieldMapperMobile = ({\n\titem,\n\tfieldsShown,\n\tspecialFeatures,\n\thandleFavouriteClick,\n\tisFavorite,\n\tincludeFavorite = true\n}) => {\n\tconst specialFeaturePills = field => {\n\t\treturn field === 'title' && specialFeatures &&\n Object.entries(specialFeatures).map(([featureKey, featureLabel]) => {\n \tconst value = getFieldValue(item, featureKey);\n \t// Handle boolean fields (value == 1 or \"true\")\n \tif (value == 1 || value === 1 || value === '1' || value === 'true' || value === 'True' || value === true) {\n \t\treturn <PillWrapper key={featureKey}>{featureLabel}</PillWrapper>;\n \t}\n \t// Handle multi-value custom fields - show the value if it's not empty/false\n \tif (value && value !== '' && value !== 'false' && value !== 'False' && value !== '0' && value !== 0) {\n \t\treturn <PillWrapper key={featureKey}>{featureLabel}: {value}</PillWrapper>;\n \t}\n \treturn null;\n });\n\t};\n\n\treturn (\n\t\t<Grid.Item className=\"md:hc-hidden\">\n\t\t\t{fieldsShown.includes(\"title\") &&\n <>\n \t<div className=\"hc-flex hc-items-start\">\n \t\t<div className=\"hc-flex hc-justify-between hc-items-center hc-min-w-[100%]\">\n \t\t\t<h3 className=\"hc-font-bold hc-mb-3 hc-flex-1\">{getFieldValue(item, \"title\")}</h3>\n \t\t\t{includeFavorite && <div className=\"hc-flex hc-justify-end hc-pb-2\">\n \t\t\t\t<Icon\n \t\t\t\t\ticon={isFavorite ? \"mdi:heart\" : \"mdi:heart-outline\"}\n \t\t\t\t\tsize=\"hc-size-3.5\"\n \t\t\t\t\ticonClasses={isFavorite ? \"hc-text-primary\" : \"\"}\n \t\t\t\t\tclassName={`hc-transition-opacity hc-duration-300 hc-cursor-pointer\n ${isFavorite ? \"hc-opacity-100\" : \"hc-text-uiText/60 group-hover:hc-opacity-100\"}\n `}\n \t\t\t\t\tonClick={e => handleFavouriteClick(e, item)}\n \t\t\t\t/>\n \t\t\t</div>\n \t\t\t}\n \t\t</div>\n \t</div>\n \t{specialFeatures && <div className='hc-pb-4'>{specialFeaturePills(\"title\", true)} </div>}\n </>\n\t\t\t}\n\n\t\t\t<ul className=\"hc-space-y-2 hc-text-xs\">\n\t\t\t\t{[\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: \"category\",\n\t\t\t\t\t\tname: \"category\",\n\t\t\t\t\t\ticon: \"icon-park-solid:tree-list\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: \"subCategory\",\n\t\t\t\t\t\tname: \"subCategory\",\n\t\t\t\t\t\ticon: \"icon-park-solid:tree-list\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: \"schedule\",\n\t\t\t\t\t\tname: \"Schedule\",\n\t\t\t\t\t\ticon: \"gravity-ui:clock-fill\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: \"city\",\n\t\t\t\t\t\tname: \"Location\",\n\t\t\t\t\t\ticon: \"fluent:location-16-filled\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: \"state\",\n\t\t\t\t\t\tname: \"Location\",\n\t\t\t\t\t\ticon: \"fluent:location-16-filled\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: \"cityState\",\n\t\t\t\t\t\tname: \"Location\",\n\t\t\t\t\t\ticon: \"fluent:location-16-filled\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: \"travelTime\",\n\t\t\t\t\t\tname: \"Commute\",\n\t\t\t\t\t\ticon: \"ri:pin-distance-fill\"\n\t\t\t\t\t}\n\t\t\t\t].map(listItem => (\n\t\t\t\t\t(fieldsShown.includes(listItem.field) && getFieldValue(item, listItem.field)) &&\n <li\n \tkey={listItem.field}\n \tclassName=\"hc-flex hc-gap-2\"\n >\n \t<Icon\n \t\ticon={listItem.icon}\n \t\tsize=\"hc-size-3.5\"\n \t\tclassName=\"hc-text-uiAccent/30\"\n \t/>\n \t<span className=\"hc-sr-only\">{listItem.name}</span>\n \t{getFieldValue(item, listItem.field)}\n </li>\n\t\t\t\t))}\n\t\t\t</ul>\n\t\t</Grid.Item>\n\t);\n};\n\nexport default FieldMapperMobile;"],"names":["FieldMapperMobile","_ref","item","fieldsShown","specialFeatures","handleFavouriteClick","isFavorite","_ref$includeFavorite","includeFavorite","specialFeaturePills","field","Object","entries","map","_ref2","_ref3","_slicedToArray","featureKey","featureLabel","value","getFieldValue","React","createElement","PillWrapper","key","Grid","Item","className","includes","Fragment","Icon","icon","size","iconClasses","concat","onClick","e","name","listItem"],"mappings":";;;;;;;AAMA,IAAMA,iBAAiB,GAAG,SAApBA,iBAAiBA,CAAAC,IAAA,EAOjB;AAAA,EAAA,IANLC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IACJC,WAAW,GAAAF,IAAA,CAAXE,WAAW;IACXC,eAAe,GAAAH,IAAA,CAAfG,eAAe;IACfC,oBAAoB,GAAAJ,IAAA,CAApBI,oBAAoB;IACpBC,UAAU,GAAAL,IAAA,CAAVK,UAAU;IAAAC,oBAAA,GAAAN,IAAA,CACVO,eAAe;AAAfA,IAAAA,eAAe,GAAAD,oBAAA,KAAG,KAAA,CAAA,GAAA,IAAI,GAAAA,oBAAA,CAAA;AAEtB,EAAA,IAAME,mBAAmB,GAAG,SAAtBA,mBAAmBA,CAAGC,KAAK,EAAI;AACpC,IAAA,OAAOA,KAAK,KAAK,OAAO,IAAIN,eAAe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FN,KAAA,CAAAC,aAAA,CAAA,MAAA,EAAA;AAAMK,MAAAA,SAAS,EAAC,YAAA;AAAY,KAAA,EAAEW,QAAQ,CAACD,IAAW,CAAC,EAClDjB,aAAa,CAAClB,IAAI,EAAEoC,QAAQ,CAAC5B,KAAK,CAChC,CAAC,CAAA;GACV,CACE,CACM,CAAC,CAAA;AAEd;;;;"}
1
+ {"version":3,"file":"field-mapper-mobile.js","sources":["../../../../src/components/modules/list/field-mapper-mobile.jsx"],"sourcesContent":["import React from 'react';\nimport Grid from '~/components/modules/grid';\nimport Icon from '~/components/modules/icon';\nimport PillWrapper from '~/components/modules/buttons/pill-wrapper';\nimport { getFieldValue } from '~/util/filterUtil';\nimport { twMerge } from 'tailwind-merge';\n\nconst FieldMapperMobile = ({\n\titem,\n\tfieldsShown,\n\tspecialFeatures,\n\tspecialFeaturePills,\n\thandleFavouriteClick,\n\tisFavorite,\n\tincludeFavorite = true\n}) => {\n\tconst specialFeaturePillsRender = field => {\n\t\tif (field !== 'title' || !specialFeatures || !specialFeaturePills) return null;\n\t\t\n\t\treturn Object.entries(specialFeatures).map(([featureKey, featureLabel]) => {\n\t\t\t// Only show pill if it's configured in specialFeaturePills\n\t\t\tif (!specialFeaturePills[featureKey]) return null;\n\t\t\t\n\t\t\tconst value = getFieldValue(item, featureKey);\n\t\t\tconst customClassName = specialFeaturePills[featureKey]?.className || '';\n\t\t\t\n\t\t\t// Handle boolean fields (value == 1 or \"true\")\n\t\t\tif (value == 1 || value === 1 || value === '1' || value === 'true' || value === 'True' || value === true) {\n\t\t\t\treturn <PillWrapper key={featureKey} className={customClassName}>{featureLabel}</PillWrapper>;\n\t\t\t}\n\t\t\t// Handle multi-value custom fields - show the value if it's not empty/false\n\t\t\tif (value && value !== '' && value !== 'false' && value !== 'False' && value !== '0' && value !== 0) {\n\t\t\t\treturn <PillWrapper key={featureKey} className={customClassName}>{featureLabel}: {value}</PillWrapper>;\n\t\t\t}\n\t\t\treturn null;\n\t\t});\n\t};\n\n\treturn (\n\t\t<Grid.Item className=\"md:hc-hidden\">\n\t\t\t{fieldsShown.includes(\"title\") &&\n <>\n \t<div className=\"hc-flex hc-items-start\">\n \t\t<div className=\"hc-flex hc-justify-between hc-items-center hc-min-w-[100%]\">\n \t\t\t<h3 className=\"hc-font-bold hc-mb-3 hc-flex-1\">{getFieldValue(item, \"title\")}</h3>\n \t\t\t{includeFavorite && <div className=\"hc-flex hc-justify-end hc-pb-2\">\n \t\t\t\t<Icon\n \t\t\t\t\ticon={isFavorite ? \"mdi:heart\" : \"mdi:heart-outline\"}\n \t\t\t\t\tsize=\"hc-size-3.5\"\n \t\t\t\t\ticonClasses={isFavorite ? \"hc-text-primary\" : \"\"}\n \t\t\t\t\tclassName={`hc-transition-opacity hc-duration-300 hc-cursor-pointer\n ${isFavorite ? \"hc-opacity-100\" : \"hc-text-uiText/60 group-hover:hc-opacity-100\"}\n `}\n \t\t\t\t\tonClick={e => handleFavouriteClick(e, item)}\n \t\t\t\t/>\n \t\t\t</div>\n \t\t\t}\n \t\t</div>\n \t</div>\n\t\t\t{specialFeatures && <div className='hc-pb-4'>{specialFeaturePillsRender(\"title\")} </div>}\n\n\t\t\t<ul className=\"hc-space-y-2 hc-text-xs\">\n\t\t\t\t{[\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: \"category\",\n\t\t\t\t\t\tname: \"category\",\n\t\t\t\t\t\ticon: \"icon-park-solid:tree-list\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: \"subCategory\",\n\t\t\t\t\t\tname: \"subCategory\",\n\t\t\t\t\t\ticon: \"icon-park-solid:tree-list\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: \"schedule\",\n\t\t\t\t\t\tname: \"Schedule\",\n\t\t\t\t\t\ticon: \"gravity-ui:clock-fill\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: \"city\",\n\t\t\t\t\t\tname: \"Location\",\n\t\t\t\t\t\ticon: \"fluent:location-16-filled\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: \"state\",\n\t\t\t\t\t\tname: \"Location\",\n\t\t\t\t\t\ticon: \"fluent:location-16-filled\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: \"cityState\",\n\t\t\t\t\t\tname: \"Location\",\n\t\t\t\t\t\ticon: \"fluent:location-16-filled\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tfield: \"travelTime\",\n\t\t\t\t\t\tname: \"Commute\",\n\t\t\t\t\t\ticon: \"ri:pin-distance-fill\"\n\t\t\t\t\t}\n\t\t\t\t].map(listItem => (\n\t\t\t\t\t(fieldsShown.includes(listItem.field) && getFieldValue(item, listItem.field)) &&\n <li\n \tkey={listItem.field}\n \tclassName=\"hc-flex hc-gap-2\"\n >\n \t<Icon\n \t\ticon={listItem.icon}\n \t\tsize=\"hc-size-3.5\"\n \t\tclassName=\"hc-text-uiAccent/30\"\n \t/>\n \t<span className=\"hc-sr-only\">{listItem.name}</span>\n \t{getFieldValue(item, listItem.field)}\n </li>\n\t\t\t\t))}\n\t\t\t</ul>\n </>\n\t\t\t}\n\t\t</Grid.Item>\n\t);\n};\n\nexport default FieldMapperMobile;"],"names":["FieldMapperMobile","_ref","item","fieldsShown","specialFeatures","specialFeaturePills","handleFavouriteClick","isFavorite","_ref$includeFavorite","includeFavorite","specialFeaturePillsRender","field","Object","entries","map","_ref2","_specialFeaturePills$","_ref3","_slicedToArray","featureKey","featureLabel","value","getFieldValue","customClassName","className","React","createElement","PillWrapper","key","Grid","Item","includes","Fragment","Icon","icon","size","iconClasses","concat","onClick","e","name","listItem"],"mappings":";;;;;;;;AAOA,IAAMA,iBAAiB,GAAG,SAApBA,iBAAiBA,CAAAC,IAAA,EAQjB;AAAA,EAAA,IAPLC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IACJC,WAAW,GAAAF,IAAA,CAAXE,W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,KAAK,EAAE,OAAO;AACd6B,IAAAA,IAAI,EAAE,UAAU;AAChBN,IAAAA,IAAI,EAAE,2BAAA;AACP,GAAC,EACD;AACCvB,IAAAA,KAAK,EAAE,WAAW;AAClB6B,IAAAA,IAAI,EAAE,UAAU;AAChBN,IAAAA,IAAI,EAAE,2BAAA;AACP,GAAC,EACD;AACCvB,IAAAA,KAAK,EAAE,YAAY;AACnB6B,IAAAA,IAAI,EAAE,SAAS;AACfN,IAAAA,IAAI,EAAE,sBAAA;AACP,GAAC,CACD,CAACpB,GAAG,CAAC,UAAA2B,QAAQ,EAAA;IAAA,OACZtC,WAAW,CAAC4B,QAAQ,CAACU,QAAQ,CAAC9B,KAAK,CAAC,IAAIW,aAAa,CAACpB,IAAI,EAAEuC,QAAQ,CAAC9B,KAAK,CAAC,iBACvEc,KAAA,CAAAC,aAAA,CAAA,IAAA,EAAA;MACCE,GAAG,EAAEa,QAAQ,CAAC9B,KAAM;AACpBa,MAAAA,SAAS,EAAC,kBAAA;AAAkB,KAAA,eAE5BC,KAAA,CAAAC,aAAA,CAACO,aAAI,EAAA;MACJC,IAAI,EAAEO,QAAQ,CAACP,IAAK;AACpBC,MAAAA,IAAI,EAAC,aAAa;AAClBX,MAAAA,SAAS,EAAC,qBAAA;AAAqB,KAC/B,CAAC,eACFC,KAAA,CAAAC,aAAA,CAAA,MAAA,EAAA;AAAMF,MAAAA,SAAS,EAAC,YAAA;AAAY,KAAA,EAAEiB,QAAQ,CAACD,IAAW,CAAC,EAClDlB,aAAa,CAACpB,IAAI,EAAEuC,QAAQ,CAAC9B,KAAK,CAChC,CAAC,CAAA;GACV,CACE,CACG,CAEG,CAAC,CAAA;AAEd;;;;"}
@@ -141,6 +141,7 @@ var ListItem = /*#__PURE__*/forwardRef(function (_ref, _ref2) {
141
141
  item: item,
142
142
  fieldsShown: fieldsShown,
143
143
  specialFeatures: specialFeatures,
144
+ specialFeaturePills: siteConfig === null || siteConfig === void 0 ? void 0 : siteConfig.specialFeaturePills,
144
145
  isFavorite: isFavorite,
145
146
  includeFavorite: includeFavorite,
146
147
  handleFavouriteClick: handleFavouriteClick
@@ -148,6 +149,7 @@ var ListItem = /*#__PURE__*/forwardRef(function (_ref, _ref2) {
148
149
  item: item,
149
150
  fieldsShown: fieldsShown,
150
151
  specialFeatures: specialFeatures,
152
+ specialFeaturePills: siteConfig === null || siteConfig === void 0 ? void 0 : siteConfig.specialFeaturePills,
151
153
  isFavorite: isFavorite,
152
154
  includeFavorite: includeFavorite,
153
155
  handleFavouriteClick: handleFavouriteClick
@@ -1 +1 @@
1
- {"version":3,"file":"list-item.js","sources":["../../../../../src/components/modules/list/list-item/list-item.jsx"],"sourcesContent":["import React, { forwardRef, useState, useEffect, useRef } from 'react';\nimport Grid from '~/components/modules/grid';\nimport Icon from '~/components/modules/icon';\nimport FieldMapper from '~/components/modules/list/field-mapper-desktop';\nimport FieldMapperMobile from '~/components/modules/list/field-mapper-mobile';\nconst ListItem = forwardRef(\n\t(\n\t\t{\n\t\t\tisActive,\n\t\t\tbodyClassName,\n\t\t\tclassName,\n\t\t\titem,\n\t\t\tfieldsShown,\n\t\t\tspecialFeatures,\n\t\t\tonItemSelected,\n\t\t\tshowMap,\n\t\t\tsetMobileTab,\n\t\t\thandleSettingFavorites,\n\t\t\tfavorites,\n\t\t\tincludeFavorite = true,\n\t\t\tsiteConfig,\n\t\t\tgoogleMapsApiKey,\n\t\t\tindex,\n\t\t\t...props\n\t\t},\n\t\tref\n\t) => {\n\t\tconst mapPinColor = !showMap ? null : siteConfig.colors.primary.replace(\"#\", \"\");\n\t\t\n\t\t// Generate static map URL for mobile\n\t\tconst staticMapUrl = showMap && item.mapDetails?.latitude && item.mapDetails?.longitude\n\t\t\t? `https://maps.googleapis.com/maps/api/staticmap?scale=2&center=${item.mapDetails.latitude},${item.mapDetails.longitude}&zoom=10&size=240x180&maptype=roadmap&markers=color:0x${mapPinColor}%7Clabel:•%7C${item.mapDetails.latitude},${item.mapDetails.longitude}&key=${googleMapsApiKey}`\n\t\t\t: null;\n\n\t\t// Mobile detection for bandwidth optimization\n\t\tconst [isMobile, setIsMobile] = useState(false);\n\n\t\t// Individual item loading based on scroll position\n\t\tconst [isMapLoaded, setIsMapLoaded] = useState(false);\n\t\tconst itemRef = useRef(null);\n\n\t\tuseEffect(() => {\n\t\tif (typeof window === 'undefined') return;\n\t\t\n\t\tconst checkIsMobile = () => {\n\t\t\tsetIsMobile(window.innerWidth < 768); // md breakpoint in Tailwind\n\t\t};\n\n\t\tcheckIsMobile();\n\t\twindow.addEventListener('resize', checkIsMobile);\n\n\t\treturn () => window.removeEventListener('resize', checkIsMobile);\n\t}, []);\n\n\t// Load individual map when item comes into view\n\tuseEffect(() => {\n\t\tif (typeof window === 'undefined') return;\n\t\tif (!isMobile || !showMap || !itemRef.current || isMapLoaded) return;\n\n\t\tconst checkIfInView = () => {\n\t\t\tif (!itemRef.current || isMapLoaded) return;\n\n\t\t\tconst rect = itemRef.current.getBoundingClientRect();\n\t\t\tconst windowHeight = window.innerHeight;\n\n\t\t\t// Load only when item is actually visible or very close to viewport\n\t\t\t// Much more conservative - only load what's immediately needed\n\t\t\tconst isInView = rect.top < windowHeight && rect.bottom > 0;\n\n\t\t\tif (isInView) {\n\t\t\t\tsetIsMapLoaded(true);\n\t\t\t}\n\t\t};\n\n\t\t// Check immediately\n\t\tcheckIfInView();\n\n\t\t// Only check on scroll, not continuously\n\t\tlet scrollTimeout;\n\t\tconst handleScroll = () => {\n\t\t\tclearTimeout(scrollTimeout);\n\t\t\tscrollTimeout = setTimeout(checkIfInView, 300); // Much less frequent\n\t\t};\n\n\t\twindow.addEventListener('scroll', handleScroll, { passive: true });\n\n\t\treturn () => {\n\t\t\twindow.removeEventListener('scroll', handleScroll);\n\t\t\tclearTimeout(scrollTimeout);\n\t\t};\n\t}, [isMobile, showMap, isMapLoaded]);\n\n\tconst handleClick = () => {\n\t\tif (onItemSelected) {\n\t\t\tonItemSelected(item);\n\t\t}\n\t};\n\tlet isFavorite = favorites.includes(item.id);\n\n\tconst handleFavouriteClick = (event, item) => {\n\t\tif(!includeFavorite)return;\n\t\tevent.stopPropagation();\n\t\tlet updatedFavorites;\n\t\tif (isFavorite) {\n\t\t\tupdatedFavorites = favorites.filter(fav => fav !== item.id);\n\t\t} else {\n\t\t\tupdatedFavorites = [...favorites, item.id];\n\t\t}\n\t\tisFavorite = !isFavorite;\n\t\thandleSettingFavorites(updatedFavorites);\n\t};\n\t\treturn (\n\t\t\t<button\n\t\t\t\tref={(el) => {\n\t\t\t\t\t// Forward the ref to the parent component\n\t\t\t\t\tif (ref) {\n\t\t\t\t\t\tif (typeof ref === 'function') {\n\t\t\t\t\t\t\tref(el);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tref.current = el;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Also store our own ref for scroll detection\n\t\t\t\t\titemRef.current = el;\n\t\t\t\t}}\n\t\t\t\tonClick={() => { handleClick(); }}\n\t\t\t\tclassName={`\n\t\t\t\thc-group hc-relative hc-flex md:hc-flex-col hc-w-full hc-text-left hc-bg-clip-border hc-border hc-border-transparent hc-break-words hc-overflow-hidden hc-cursor-pointer hc-transition-colors hover:hc-bg-uiAccent/5 focus:hover:hc-bg-uiAccent/5\n\t\t\t\t${isActive ? \"hc-bg-uiAccent/5 hc-border-secondary hc-border\" : \"hc-text-uiText hc-bg-white\"}\n\t\t\t\t${className ?? \"\"}\n\t\t\t\t`}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{/* This Grid is displayed as block on mobile and grid on desktop */}\n\t\t\t\t<Grid\n\t\t\t\t\tcolumns=\"hc-pl-2 hc-md-pl-0 hc-grid-flow-col hc-auto-cols-fr\"\n\t\t\t\t\tgap=\"hc-gap-0\"\n\t\t\t\t\tclassName={`\n hc-block md:hc-grid hc-py-2 hc-w-full hc-grow hc-leading-tight hc-text-sm md:hc-text-xs lg:hc-text-sm\n ${bodyClassName ?? \"\"}\n `}\n\t\t\t\t>\n\t\t\t\t\t{/* DESKTOP ONLY: This expand icon is hidden on mobile (hc-hidden) and visible on desktop (md:hc-block) */}\n\t\t\t\t\t<Grid.Item className=\"hc-hidden md:hc-block md:hc-absolute md:hc-left-1.5 hc-top-1.5\">\n\t\t\t\t\t\t<span className=\"hc-sr-only\">Expand row</span>\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\ticon=\"fluent-emoji-high-contrast:plus\"\n\t\t\t\t\t\t\tsize=\"hc-size-2.5\"\n\t\t\t\t\t\t\tclassName={`\n hc-opacity-0 hc-text-uiText/60 hc-transition group-hover:hc-opacity-100 group-active:hc-opacity-100\n ${isActive ? \"hc-opacity-100 hc-rotate-45\" : \"\"}\n `}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</Grid.Item>\n\t\t\t\t\t<FieldMapper\n\t\t\t\t\t\titem={item}\n\t\t\t\t\t\tfieldsShown={fieldsShown}\n\t\t\t\t\t\tspecialFeatures={specialFeatures}\n\t\t\t\t\t\tisFavorite={isFavorite}\n\t\t\t\t\t\tincludeFavorite={includeFavorite}\n\t\t\t\t\t\thandleFavouriteClick={handleFavouriteClick}\n\t\t\t\t\t/>\n\t\t\t\t\t<FieldMapperMobile\n\t\t\t\t\t\titem={item}\n\t\t\t\t\t\tfieldsShown={fieldsShown}\n\t\t\t\t\t\tspecialFeatures={specialFeatures}\n\t\t\t\t\t\tisFavorite={isFavorite}\n\t\t\t\t\t\tincludeFavorite={includeFavorite}\n\t\t\t\t\t\thandleFavouriteClick={handleFavouriteClick}\n\t\t\t\t\t/>\n\t\t\t\t\t{includeFavorite &&\n\t\t\t\t\t/* DESKTOP ONLY: This favorites icon is hidden on mobile (hc-hidden) and visible on desktop (md:hc-block) */\n\t\t\t\t\t<Grid.Item\n\t\t\t\t\t\tkey={\"favorites\"}\n\t\t\t\t\t\tclassName=\"hc-hidden md:hc-block hc-col-span-1 hc-px-2\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\ticon={isFavorite ? \"mdi:heart\" : \"mdi:heart-outline\"}\n\t\t\t\t\t\t\tsize=\"hc-size-3.5\"\n\t\t\t\t\t\t\ticonClasses={isFavorite ? \"hc-text-primary\" : \"\"}\n\t\t\t\t\t\t\ttitle={!isFavorite ? 'Add job to favorites' : 'Remove job from favorites'}\n\t\t\t\t\t\t\tclassName=\"hc-pr-2 hc-transition-opacity hc-duration-300 hc-cursor-pointer hc-opacity-100\"\n\t\t\t\t\t\t\tonClick={e => {handleFavouriteClick(e, item);}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</Grid.Item>\n\t\t\t\t\t}\n\t\t\t\t</Grid>\n\t\t\t\t{/* MOBILE ONLY: This map section is visible on mobile and hidden on desktop (md:hc-hidden) */}\n\t\t\t\t{showMap && staticMapUrl && (\n\t\t\t\t\t<div \n\t\t\t\t\t\tonClick={() => { setMobileTab(\"mapTab\"); handleClick(); }} \n\t\t\t\t\t\tclassName=\"md:hc-hidden hc-w-2/5 sm:hc-w-1/3 hc-p-1.5 hc-my-1 hc-bg-uiAccent/5 hc-border hc-border-uiAccent/10 hc-rounded-sm\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<img\n\t\t\t\t\t\t\tsrc={staticMapUrl}\n\t\t\t\t\t\t\talt={`Map of location for ${item.fields.position}`}\n\t\t\t\t\t\t\tclassName=\"hc-w-full hc-h-full hc-object-cover\"\n\t\t\t\t\t\t\tloading=\"lazy\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</button>\n\t\t);\n\t}\n);\n\nListItem.displayName = \"ListItem\";\n\nexport default React.memo(ListItem, (prevProps, nextProps) => {\n\treturn (\n\t\tprevProps.isActive === nextProps.isActive &&\n\t\tprevProps.favorites === nextProps.favorites &&\n prevProps.item.id === nextProps.item.id &&\n\tprevProps.item.fields.travelTime === nextProps.item.fields.travelTime &&\n prevProps.fieldsShown === nextProps.fieldsShown &&\n prevProps.bodyClassName === nextProps.bodyClassName &&\n prevProps.className === nextProps.className\n\t);\n});"],"names":["ListItem","forwardRef","_ref","ref","_item$mapDetails","_item$mapDetails2","isActive","bodyClassName","className","item","fieldsShown","specialFeatures","onItemSelected","showMap","setMobileTab","handleSettingFavorites","favorites","_ref$includeFavorite","includeFavorite","siteConfig","googleMapsApiKey","index","props","_objectWithoutProperties","_excluded","mapPinColor","colors","primary","replace","staticMapUrl","mapDetails","latitude","longitude","concat","_useState","useState","_useState2","_slicedToArray","isMobile","setIsMobile","_useState3","_useState4","isMapLoaded","setIsMapLoaded","itemRef","useRef","useEffect","window","checkIsMobile","innerWidth","addEventListener","removeEventListener","current","checkIfInView","rect","getBoundingClientRect","windowHeight","innerHeight","isInView","top","bottom","scrollTimeout","handleScroll","clearTimeout","setTimeout","passive","handleClick","isFavorite","includes","id","handleFavouriteClick","event","stopPropagation","updatedFavorites","filter","fav","_toConsumableArray","React","createElement","_extends","el","onClick","Grid","columns","gap","Item","Icon","icon","size","FieldMapper","FieldMapperMobile","key","iconClasses","title","e","src","alt","fields","position","loading","displayName","memo","prevProps","nextProps","travelTime"],"mappings":";;;;;;;;AAKA,IAAMA,QAAQ,gBAAGC,UAAU,CAC1B,UAAAC,IAAA,EAmBCC,KAAG,EACC;EAAA,IAAAC,gBAAA,EAAAC,iBAAA,CAAA;AAAA,EAAA,IAlBHC,QAAQ,GAAAJ,IAAA,CAARI,QAAQ,CAAA;IACRC,aAAa,GAAAL,IAAA,CAAbK,aAAa,CAAA;IACbC,SAAS,GAAAN,IAAA,CAATM,SAAS,CAAA;IACTC,IAAI,GAAAP,IAAA,CAAJO,IAAI,CAAA;IACJC,WAAW,GAAAR,IAAA,CAAXQ,WAAW,CAAA;IACXC,eAAe,GAAAT,IAAA,CAAfS,eAAe,CAAA;IACfC,cAAc,GAAAV,IAAA,CAAdU,cAAc,CAAA;IACdC,OAAO,GAAAX,IAAA,CAAPW,OAAO,CAAA;IACPC,YAAY,GAAAZ,IAAA,CAAZY,YAAY,CAAA;IACZC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CAACwF,MAAM,CAACC,QAAQ,CAAG;AACnD1F,IAAAA,SAAS,EAAC,qCAAqC;AAC/C2F,IAAAA,OAAO,EAAC,MAAA;GACR,CACG,CAEC,CAAC,CAAA;AAEX,CACD,CAAC,CAAA;AAEDnG,QAAQ,CAACoG,WAAW,GAAG,UAAU,CAAA;AAEjC,iBAAevB,aAAAA,KAAK,CAACwB,IAAI,CAACrG,QAAQ,EAAE,UAACsG,SAAS,EAAEC,SAAS,EAAK;AAC7D,EAAA,OACCD,SAAS,CAAChG,QAAQ,KAAKiG,SAAS,CAACjG,QAAQ,IACzCgG,SAAS,CAACtF,SAAS,KAAKuF,SAAS,CAACvF,SAAS,IACzCsF,SAAS,CAAC7F,IAAI,CAAC4D,EAAE,KAAKkC,SAAS,CAAC9F,IAAI,CAAC4D,EAAE,IAC1CiC,SAAS,CAAC7F,IAAI,CAACwF,MAAM,CAACO,UAAU,KAAKD,SAAS,CAAC9F,IAAI,CAACwF,MAAM,CAACO,UAAU,IAClEF,SAAS,CAAC5F,WAAW,KAAK6F,SAAS,CAAC7F,WAAW,IAC/C4F,SAAS,CAAC/F,aAAa,KAAKgG,SAAS,CAAChG,aAAa,IACnD+F,SAAS,CAAC9F,SAAS,KAAK+F,SAAS,CAAC/F,SAAS,CAAA;AAE/C,CAAC,CAAC;;;;"}
1
+ {"version":3,"file":"list-item.js","sources":["../../../../../src/components/modules/list/list-item/list-item.jsx"],"sourcesContent":["import React, { forwardRef, useState, useEffect, useRef } from 'react';\nimport Grid from '~/components/modules/grid';\nimport Icon from '~/components/modules/icon';\nimport FieldMapper from '~/components/modules/list/field-mapper-desktop';\nimport FieldMapperMobile from '~/components/modules/list/field-mapper-mobile';\nconst ListItem = forwardRef(\n\t(\n\t\t{\n\t\t\tisActive,\n\t\t\tbodyClassName,\n\t\t\tclassName,\n\t\t\titem,\n\t\t\tfieldsShown,\n\t\t\tspecialFeatures,\n\t\t\tonItemSelected,\n\t\t\tshowMap,\n\t\t\tsetMobileTab,\n\t\t\thandleSettingFavorites,\n\t\t\tfavorites,\n\t\t\tincludeFavorite = true,\n\t\t\tsiteConfig,\n\t\t\tgoogleMapsApiKey,\n\t\t\tindex,\n\t\t\t...props\n\t\t},\n\t\tref\n\t) => {\n\t\tconst mapPinColor = !showMap ? null : siteConfig.colors.primary.replace(\"#\", \"\");\n\t\t\n\t\t// Generate static map URL for mobile\n\t\tconst staticMapUrl = showMap && item.mapDetails?.latitude && item.mapDetails?.longitude\n\t\t\t? `https://maps.googleapis.com/maps/api/staticmap?scale=2&center=${item.mapDetails.latitude},${item.mapDetails.longitude}&zoom=10&size=240x180&maptype=roadmap&markers=color:0x${mapPinColor}%7Clabel:•%7C${item.mapDetails.latitude},${item.mapDetails.longitude}&key=${googleMapsApiKey}`\n\t\t\t: null;\n\n\t\t// Mobile detection for bandwidth optimization\n\t\tconst [isMobile, setIsMobile] = useState(false);\n\n\t\t// Individual item loading based on scroll position\n\t\tconst [isMapLoaded, setIsMapLoaded] = useState(false);\n\t\tconst itemRef = useRef(null);\n\n\t\tuseEffect(() => {\n\t\tif (typeof window === 'undefined') return;\n\t\t\n\t\tconst checkIsMobile = () => {\n\t\t\tsetIsMobile(window.innerWidth < 768); // md breakpoint in Tailwind\n\t\t};\n\n\t\tcheckIsMobile();\n\t\twindow.addEventListener('resize', checkIsMobile);\n\n\t\treturn () => window.removeEventListener('resize', checkIsMobile);\n\t}, []);\n\n\t// Load individual map when item comes into view\n\tuseEffect(() => {\n\t\tif (typeof window === 'undefined') return;\n\t\tif (!isMobile || !showMap || !itemRef.current || isMapLoaded) return;\n\n\t\tconst checkIfInView = () => {\n\t\t\tif (!itemRef.current || isMapLoaded) return;\n\n\t\t\tconst rect = itemRef.current.getBoundingClientRect();\n\t\t\tconst windowHeight = window.innerHeight;\n\n\t\t\t// Load only when item is actually visible or very close to viewport\n\t\t\t// Much more conservative - only load what's immediately needed\n\t\t\tconst isInView = rect.top < windowHeight && rect.bottom > 0;\n\n\t\t\tif (isInView) {\n\t\t\t\tsetIsMapLoaded(true);\n\t\t\t}\n\t\t};\n\n\t\t// Check immediately\n\t\tcheckIfInView();\n\n\t\t// Only check on scroll, not continuously\n\t\tlet scrollTimeout;\n\t\tconst handleScroll = () => {\n\t\t\tclearTimeout(scrollTimeout);\n\t\t\tscrollTimeout = setTimeout(checkIfInView, 300); // Much less frequent\n\t\t};\n\n\t\twindow.addEventListener('scroll', handleScroll, { passive: true });\n\n\t\treturn () => {\n\t\t\twindow.removeEventListener('scroll', handleScroll);\n\t\t\tclearTimeout(scrollTimeout);\n\t\t};\n\t}, [isMobile, showMap, isMapLoaded]);\n\n\tconst handleClick = () => {\n\t\tif (onItemSelected) {\n\t\t\tonItemSelected(item);\n\t\t}\n\t};\n\tlet isFavorite = favorites.includes(item.id);\n\n\tconst handleFavouriteClick = (event, item) => {\n\t\tif(!includeFavorite)return;\n\t\tevent.stopPropagation();\n\t\tlet updatedFavorites;\n\t\tif (isFavorite) {\n\t\t\tupdatedFavorites = favorites.filter(fav => fav !== item.id);\n\t\t} else {\n\t\t\tupdatedFavorites = [...favorites, item.id];\n\t\t}\n\t\tisFavorite = !isFavorite;\n\t\thandleSettingFavorites(updatedFavorites);\n\t};\n\t\treturn (\n\t\t\t<button\n\t\t\t\tref={(el) => {\n\t\t\t\t\t// Forward the ref to the parent component\n\t\t\t\t\tif (ref) {\n\t\t\t\t\t\tif (typeof ref === 'function') {\n\t\t\t\t\t\t\tref(el);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tref.current = el;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Also store our own ref for scroll detection\n\t\t\t\t\titemRef.current = el;\n\t\t\t\t}}\n\t\t\t\tonClick={() => { handleClick(); }}\n\t\t\t\tclassName={`\n\t\t\t\thc-group hc-relative hc-flex md:hc-flex-col hc-w-full hc-text-left hc-bg-clip-border hc-border hc-border-transparent hc-break-words hc-overflow-hidden hc-cursor-pointer hc-transition-colors hover:hc-bg-uiAccent/5 focus:hover:hc-bg-uiAccent/5\n\t\t\t\t${isActive ? \"hc-bg-uiAccent/5 hc-border-secondary hc-border\" : \"hc-text-uiText hc-bg-white\"}\n\t\t\t\t${className ?? \"\"}\n\t\t\t\t`}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{/* This Grid is displayed as block on mobile and grid on desktop */}\n\t\t\t\t<Grid\n\t\t\t\t\tcolumns=\"hc-pl-2 hc-md-pl-0 hc-grid-flow-col hc-auto-cols-fr\"\n\t\t\t\t\tgap=\"hc-gap-0\"\n\t\t\t\t\tclassName={`\n hc-block md:hc-grid hc-py-2 hc-w-full hc-grow hc-leading-tight hc-text-sm md:hc-text-xs lg:hc-text-sm\n ${bodyClassName ?? \"\"}\n `}\n\t\t\t\t>\n\t\t\t\t\t{/* DESKTOP ONLY: This expand icon is hidden on mobile (hc-hidden) and visible on desktop (md:hc-block) */}\n\t\t\t\t\t<Grid.Item className=\"hc-hidden md:hc-block md:hc-absolute md:hc-left-1.5 hc-top-1.5\">\n\t\t\t\t\t\t<span className=\"hc-sr-only\">Expand row</span>\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\ticon=\"fluent-emoji-high-contrast:plus\"\n\t\t\t\t\t\t\tsize=\"hc-size-2.5\"\n\t\t\t\t\t\t\tclassName={`\n hc-opacity-0 hc-text-uiText/60 hc-transition group-hover:hc-opacity-100 group-active:hc-opacity-100\n ${isActive ? \"hc-opacity-100 hc-rotate-45\" : \"\"}\n `}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</Grid.Item>\n\t\t\t\t\t<FieldMapper\n\t\t\t\t\t\titem={item}\n\t\t\t\t\t\tfieldsShown={fieldsShown}\n\t\t\t\t\t\tspecialFeatures={specialFeatures}\t\t\t\t\tspecialFeaturePills={siteConfig?.specialFeaturePills}\t\t\t\t\t\tisFavorite={isFavorite}\n\t\t\t\t\t\tincludeFavorite={includeFavorite}\n\t\t\t\t\t\thandleFavouriteClick={handleFavouriteClick}\n\t\t\t\t\t/>\n\t\t\t\t\t<FieldMapperMobile\n\t\t\t\t\t\titem={item}\n\t\t\t\t\t\tfieldsShown={fieldsShown}\n\t\t\t\t\t\tspecialFeatures={specialFeatures}\t\t\t\t\tspecialFeaturePills={siteConfig?.specialFeaturePills}\t\t\t\t\t\tisFavorite={isFavorite}\n\t\t\t\t\t\tincludeFavorite={includeFavorite}\n\t\t\t\t\t\thandleFavouriteClick={handleFavouriteClick}\n\t\t\t\t\t/>\n\t\t\t\t\t{includeFavorite &&\n\t\t\t\t\t/* DESKTOP ONLY: This favorites icon is hidden on mobile (hc-hidden) and visible on desktop (md:hc-block) */\n\t\t\t\t\t<Grid.Item\n\t\t\t\t\t\tkey={\"favorites\"}\n\t\t\t\t\t\tclassName=\"hc-hidden md:hc-block hc-col-span-1 hc-px-2\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\ticon={isFavorite ? \"mdi:heart\" : \"mdi:heart-outline\"}\n\t\t\t\t\t\t\tsize=\"hc-size-3.5\"\n\t\t\t\t\t\t\ticonClasses={isFavorite ? \"hc-text-primary\" : \"\"}\n\t\t\t\t\t\t\ttitle={!isFavorite ? 'Add job to favorites' : 'Remove job from favorites'}\n\t\t\t\t\t\t\tclassName=\"hc-pr-2 hc-transition-opacity hc-duration-300 hc-cursor-pointer hc-opacity-100\"\n\t\t\t\t\t\t\tonClick={e => {handleFavouriteClick(e, item);}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</Grid.Item>\n\t\t\t\t\t}\n\t\t\t\t</Grid>\n\t\t\t\t{/* MOBILE ONLY: This map section is visible on mobile and hidden on desktop (md:hc-hidden) */}\n\t\t\t\t{showMap && staticMapUrl && (\n\t\t\t\t\t<div \n\t\t\t\t\t\tonClick={() => { setMobileTab(\"mapTab\"); handleClick(); }} \n\t\t\t\t\t\tclassName=\"md:hc-hidden hc-w-2/5 sm:hc-w-1/3 hc-p-1.5 hc-my-1 hc-bg-uiAccent/5 hc-border hc-border-uiAccent/10 hc-rounded-sm\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<img\n\t\t\t\t\t\t\tsrc={staticMapUrl}\n\t\t\t\t\t\t\talt={`Map of location for ${item.fields.position}`}\n\t\t\t\t\t\t\tclassName=\"hc-w-full hc-h-full hc-object-cover\"\n\t\t\t\t\t\t\tloading=\"lazy\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</button>\n\t\t);\n\t}\n);\n\nListItem.displayName = \"ListItem\";\n\nexport default React.memo(ListItem, (prevProps, nextProps) => {\n\treturn (\n\t\tprevProps.isActive === nextProps.isActive &&\n\t\tprevProps.favorites === nextProps.favorites &&\n prevProps.item.id === nextProps.item.id &&\n\tprevProps.item.fields.travelTime === nextProps.item.fields.travelTime &&\n prevProps.fieldsShown === nextProps.fieldsShown &&\n prevProps.bodyClassName === nextProps.bodyClassName &&\n prevProps.className === nextProps.className\n\t);\n});"],"names":["ListItem","forwardRef","_ref","ref","_item$mapDetails","_item$mapDetails2","isActive","bodyClassName","className","item","fieldsShown","specialFeatures","onItemSelected","showMap","setMobileTab","handleSettingFavorites","favorites","_ref$includeFavorite","includeFavorite","siteConfig","googleMapsApiKey","index","props","_objectWithoutProperties","_excluded","mapPinColor","colors","primary","replace","staticMapUrl","mapDetails","latitude","longitude","concat","_useState","useState","_useState2","_slicedToArray","isMobile","setIsMobile","_useState3","_useState4","isMapLoaded","setIsMapLoaded","itemRef","useRef","useEffect","window","checkIsMobile","innerWidth","addEventListener","removeEventListener","current","checkIfInView","rect","getBoundingClientRect","windowHeight","innerHeight","isInView","top","bottom","scrollTimeout","handleScroll","clearTimeout","setTimeout","passive","handleClick","isFavorite","includes","id","handleFavouriteClick","event","stopPropagation","updatedFavorites","filter","fav","_toConsumableArray","React","createElement","_extends","el","onClick","Grid","columns","gap","Item","Icon","icon","size","FieldMapper","specialFeaturePills","FieldMapperMobile","key","iconClasses","title","e","src","alt","fields","position","loading","displayName","memo","prevProps","nextProps","travelTime"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,SAAS,CAACxF,SAAS,IACzCuF,SAAS,CAAC9F,IAAI,CAAC4D,EAAE,KAAKmC,SAAS,CAAC/F,IAAI,CAAC4D,EAAE,IAC1CkC,SAAS,CAAC9F,IAAI,CAACyF,MAAM,CAACO,UAAU,KAAKD,SAAS,CAAC/F,IAAI,CAACyF,MAAM,CAACO,UAAU,IAClEF,SAAS,CAAC7F,WAAW,KAAK8F,SAAS,CAAC9F,WAAW,IAC/C6F,SAAS,CAAChG,aAAa,KAAKiG,SAAS,CAACjG,aAAa,IACnDgG,SAAS,CAAC/F,SAAS,KAAKgG,SAAS,CAAChG,SAAS,CAAA;AAE/C,CAAC,CAAC;;;;"}
@@ -1,7 +1,8 @@
1
1
  export default FieldMapperDesktop;
2
- declare function FieldMapperDesktop({ item, fieldsShown, specialFeatures }: {
2
+ declare function FieldMapperDesktop({ item, fieldsShown, specialFeatures, specialFeaturePills }: {
3
3
  item: any;
4
4
  fieldsShown: any;
5
5
  specialFeatures: any;
6
+ specialFeaturePills: any;
6
7
  }): React.JSX.Element;
7
8
  import React from "react";
@@ -1,8 +1,9 @@
1
1
  export default FieldMapperMobile;
2
- declare function FieldMapperMobile({ item, fieldsShown, specialFeatures, handleFavouriteClick, isFavorite, includeFavorite }: {
2
+ declare function FieldMapperMobile({ item, fieldsShown, specialFeatures, specialFeaturePills, handleFavouriteClick, isFavorite, includeFavorite }: {
3
3
  item: any;
4
4
  fieldsShown: any;
5
5
  specialFeatures: any;
6
+ specialFeaturePills: any;
6
7
  handleFavouriteClick: any;
7
8
  isFavorite: any;
8
9
  includeFavorite?: boolean | undefined;
@@ -20,6 +20,9 @@ export type MapConfig = {
20
20
  locationFiltersShown: string[];
21
21
  fieldNames: Record<string, string>;
22
22
  specialFeatures: Record<string, string>;
23
+ specialFeaturePills?: Record<string, {
24
+ className?: string;
25
+ }>;
23
26
  searchConfig: SearchConfig;
24
27
  internalApplyLink: string;
25
28
  useApplyDialog: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abcagency/hc-ui-components",
3
- "version": "1.9.15",
3
+ "version": "1.9.16",
4
4
  "description": "UI Components for HireControl",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1,4 +1,5 @@
1
1
  import React, { forwardRef } from 'react';
2
+ import { twMerge } from 'tailwind-merge';
2
3
 
3
4
  import Button from '~/components/modules/buttons/default';
4
5
 
@@ -15,7 +16,7 @@ export const PillWrapper = forwardRef((
15
16
  ref={ref}
16
17
  size="none"
17
18
  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
+ className={twMerge('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
20
  {...props}
20
21
  >
21
22
  {children}
@@ -3,11 +3,13 @@ import Grid from '~/components/modules/grid';
3
3
  import PillWrapper from '~/components/modules/buttons/pill-wrapper';
4
4
  import { capitalize } from '~/util/stringUtils';
5
5
  import { getFieldValue } from '~/util/filterUtil';
6
+ import { twMerge } from 'tailwind-merge';
6
7
 
7
8
  const FieldMapperDesktop = ({
8
9
  item,
9
10
  fieldsShown,
10
- specialFeatures
11
+ specialFeatures,
12
+ specialFeaturePills
11
13
  }) => {
12
14
  // Check both fields and customFields for field presence
13
15
  const orderedFields = fieldsShown.filter(field => {
@@ -15,20 +17,26 @@ const FieldMapperDesktop = ({
15
17
  return value !== undefined && value !== null;
16
18
  });
17
19
 
18
- const specialFeaturePills = field => {
19
- return field === 'title' && specialFeatures &&
20
- Object.entries(specialFeatures).map(([featureKey, featureLabel]) => {
21
- const value = getFieldValue(item, featureKey);
22
- // Handle boolean fields (value == 1 or "true")
23
- if (value == 1 || value === 1 || value === '1' || value === 'true' || value === 'True' || value === true) {
24
- return <PillWrapper key={featureKey}>{featureLabel}</PillWrapper>;
25
- }
26
- // Handle multi-value custom fields - show the value if it's not empty/false
27
- if (value && value !== '' && value !== 'false' && value !== 'False' && value !== '0' && value !== 0) {
28
- return <PillWrapper key={featureKey}>{featureLabel}: {value}</PillWrapper>;
29
- }
30
- return null;
31
- });
20
+ const specialFeaturePillsRender = field => {
21
+ if (field !== 'title' || !specialFeatures || !specialFeaturePills) return null;
22
+
23
+ return Object.entries(specialFeatures).map(([featureKey, featureLabel]) => {
24
+ // Only show pill if it's configured in specialFeaturePills
25
+ if (!specialFeaturePills[featureKey]) return null;
26
+
27
+ const value = getFieldValue(item, featureKey);
28
+ const customClassName = specialFeaturePills[featureKey]?.className || '';
29
+
30
+ // Handle boolean fields (value == 1 or "true")
31
+ if (value == 1 || value === 1 || value === '1' || value === 'true' || value === 'True' || value === true) {
32
+ return <PillWrapper key={featureKey} className={customClassName}>{featureLabel}</PillWrapper>;
33
+ }
34
+ // Handle multi-value custom fields - show the value if it's not empty/false
35
+ if (value && value !== '' && value !== 'false' && value !== 'False' && value !== '0' && value !== 0) {
36
+ return <PillWrapper key={featureKey} className={customClassName}>{featureLabel}: {value}</PillWrapper>;
37
+ }
38
+ return null;
39
+ });
32
40
  };
33
41
 
34
42
  return (
@@ -3,29 +3,37 @@ import Grid from '~/components/modules/grid';
3
3
  import Icon from '~/components/modules/icon';
4
4
  import PillWrapper from '~/components/modules/buttons/pill-wrapper';
5
5
  import { getFieldValue } from '~/util/filterUtil';
6
+ import { twMerge } from 'tailwind-merge';
6
7
 
7
8
  const FieldMapperMobile = ({
8
9
  item,
9
10
  fieldsShown,
10
11
  specialFeatures,
12
+ specialFeaturePills,
11
13
  handleFavouriteClick,
12
14
  isFavorite,
13
15
  includeFavorite = true
14
16
  }) => {
15
- const specialFeaturePills = field => {
16
- return field === 'title' && specialFeatures &&
17
- Object.entries(specialFeatures).map(([featureKey, featureLabel]) => {
18
- const value = getFieldValue(item, featureKey);
19
- // Handle boolean fields (value == 1 or "true")
20
- if (value == 1 || value === 1 || value === '1' || value === 'true' || value === 'True' || value === true) {
21
- return <PillWrapper key={featureKey}>{featureLabel}</PillWrapper>;
22
- }
23
- // Handle multi-value custom fields - show the value if it's not empty/false
24
- if (value && value !== '' && value !== 'false' && value !== 'False' && value !== '0' && value !== 0) {
25
- return <PillWrapper key={featureKey}>{featureLabel}: {value}</PillWrapper>;
26
- }
27
- return null;
28
- });
17
+ const specialFeaturePillsRender = field => {
18
+ if (field !== 'title' || !specialFeatures || !specialFeaturePills) return null;
19
+
20
+ return Object.entries(specialFeatures).map(([featureKey, featureLabel]) => {
21
+ // Only show pill if it's configured in specialFeaturePills
22
+ if (!specialFeaturePills[featureKey]) return null;
23
+
24
+ const value = getFieldValue(item, featureKey);
25
+ const customClassName = specialFeaturePills[featureKey]?.className || '';
26
+
27
+ // Handle boolean fields (value == 1 or "true")
28
+ if (value == 1 || value === 1 || value === '1' || value === 'true' || value === 'True' || value === true) {
29
+ return <PillWrapper key={featureKey} className={customClassName}>{featureLabel}</PillWrapper>;
30
+ }
31
+ // Handle multi-value custom fields - show the value if it's not empty/false
32
+ if (value && value !== '' && value !== 'false' && value !== 'False' && value !== '0' && value !== 0) {
33
+ return <PillWrapper key={featureKey} className={customClassName}>{featureLabel}: {value}</PillWrapper>;
34
+ }
35
+ return null;
36
+ });
29
37
  };
30
38
 
31
39
  return (
@@ -49,9 +57,7 @@ const FieldMapperMobile = ({
49
57
  }
50
58
  </div>
51
59
  </div>
52
- {specialFeatures && <div className='hc-pb-4'>{specialFeaturePills("title", true)} </div>}
53
- </>
54
- }
60
+ {specialFeatures && <div className='hc-pb-4'>{specialFeaturePillsRender("title")} </div>}
55
61
 
56
62
  <ul className="hc-space-y-2 hc-text-xs">
57
63
  {[
@@ -106,6 +112,8 @@ const FieldMapperMobile = ({
106
112
  </li>
107
113
  ))}
108
114
  </ul>
115
+ </>
116
+ }
109
117
  </Grid.Item>
110
118
  );
111
119
  };
@@ -155,16 +155,14 @@ const ListItem = forwardRef(
155
155
  <FieldMapper
156
156
  item={item}
157
157
  fieldsShown={fieldsShown}
158
- specialFeatures={specialFeatures}
159
- isFavorite={isFavorite}
158
+ specialFeatures={specialFeatures} specialFeaturePills={siteConfig?.specialFeaturePills} isFavorite={isFavorite}
160
159
  includeFavorite={includeFavorite}
161
160
  handleFavouriteClick={handleFavouriteClick}
162
161
  />
163
162
  <FieldMapperMobile
164
163
  item={item}
165
164
  fieldsShown={fieldsShown}
166
- specialFeatures={specialFeatures}
167
- isFavorite={isFavorite}
165
+ specialFeatures={specialFeatures} specialFeaturePills={siteConfig?.specialFeaturePills} isFavorite={isFavorite}
168
166
  includeFavorite={includeFavorite}
169
167
  handleFavouriteClick={handleFavouriteClick}
170
168
  />
@@ -21,6 +21,7 @@ export type MapConfig = {
21
21
  locationFiltersShown: string[];
22
22
  fieldNames: Record<string, string>;
23
23
  specialFeatures: Record<string, string>;
24
+ specialFeaturePills?: Record<string, { className?: string }>;
24
25
  searchConfig: SearchConfig;
25
26
  internalApplyLink: string;
26
27
  useApplyDialog: boolean;