@phatvu/web-component-poc 1.0.4 → 1.0.6

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 (32) hide show
  1. package/dist/cjs/fast-button_4.cjs.entry.js +1 -1
  2. package/dist/cjs/job-card.cjs.entry.js +138 -0
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/web-component-poc.cjs.js +1 -1
  5. package/dist/collection/collection-manifest.json +1 -0
  6. package/dist/collection/components/button/button.js +2 -2
  7. package/dist/collection/components/job-card/job-card.css +247 -0
  8. package/dist/collection/components/job-card/job-card.js +435 -0
  9. package/dist/collection/components/jobs-item/jobs-item.js +5 -5
  10. package/dist/collection/components/jobs-list-only/jobs-list-only.js +6 -6
  11. package/dist/components/job-card.d.ts +11 -0
  12. package/dist/components/job-card.js +1 -0
  13. package/dist/components/jobs-list-only.js +1 -1
  14. package/dist/esm/fast-button_4.entry.js +1 -1
  15. package/dist/esm/job-card.entry.js +136 -0
  16. package/dist/esm/loader.js +1 -1
  17. package/dist/esm/web-component-poc.js +1 -1
  18. package/dist/types/components/job-card/job-card.d.ts +93 -0
  19. package/dist/types/components/jobs-item/jobs-item.d.ts +2 -2
  20. package/dist/types/components/jobs-list-only/jobs-list-only.d.ts +2 -2
  21. package/dist/types/components.d.ts +246 -7
  22. package/dist/types/mock/jobs-list-only.mock.d.ts +2 -2
  23. package/dist/types/types/jobs-list.d.ts +6 -2
  24. package/dist/web-component-poc/p-52c85341.entry.js +1 -0
  25. package/dist/web-component-poc/{p-df843533.entry.js → p-96761988.entry.js} +1 -1
  26. package/dist/web-component-poc/web-component-poc.esm.js +1 -1
  27. package/hydrate/index.js +181 -1
  28. package/hydrate/index.mjs +181 -1
  29. package/package.json +5 -1
  30. package/dist/web-component-poc/index-pJKMKO-T.js.map +0 -1
  31. package/dist/web-component-poc/index.esm.js.map +0 -1
  32. package/dist/web-component-poc/web-component-poc.esm.js.map +0 -1
@@ -0,0 +1,136 @@
1
+ import { r as registerInstance, h } from './index-Dk5CvWmb.js';
2
+
3
+ const jobCardCss = () => `.job-card{display:block;padding:16px;border:1px solid #e0e0e0;border-radius:8px;background-color:#fff;box-shadow:0 2px 4px rgba(0, 0, 0, 0.08);transition:box-shadow 0.2s ease, border-color 0.2s ease}.job-card:hover{box-shadow:0 4px 8px rgba(0, 0, 0, 0.12);border-color:#d0d0d0}.job-card__header{margin-bottom:12px}.job-card__title{margin:0;font-size:18px;font-weight:700;display:flex;align-items:center;flex-wrap:wrap;gap:8px}.job-card__title--link{text-decoration:none;color:#1f9755;transition:color 0.2s ease}.job-card__title--link:hover{text-decoration:underline;color:#1a7a43}.job-card__reference{font-size:0.875em;color:#666;background-color:#f5f5f5;padding:2px 6px;border-radius:3px}.job-card__reference--empty{display:none}.job-card__remote{background:#e8f5e9;color:#2e7d32;border-radius:100px;padding:4px 12px;text-transform:uppercase;font-size:11px;font-weight:700;line-height:1.5;white-space:nowrap}.job-card__remote--empty{display:none}.job-card__distance{display:inline-flex;align-items:center;gap:4px;margin-top:6px;font-size:13px;font-weight:500;color:#555}.job-card__distance--icon{display:inline-flex;align-items:center}.job-card__distance--icon svg{width:16px;height:16px;color:#1f9755}.job-card__content{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.job-card__info{flex:1;display:flex;flex-direction:column;gap:8px}.job-card__street,.job-card__brand,.job-card__employment-type{display:flex;align-items:center;flex-wrap:wrap;gap:4px 6px;font-size:14px}.job-card__street--empty,.job-card__brand--empty,.job-card__employment-type--empty{color:#999}.job-card__street--icon,.job-card__brand--icon,.job-card__employment-type--icon{display:inline-flex;align-items:center;flex-shrink:0}.job-card__street--icon svg,.job-card__brand--icon svg,.job-card__employment-type--icon svg{width:16px;height:16px;color:#666}.job-card__street--label,.job-card__brand--label,.job-card__employment-type--label{color:#333}.job-card__street--label__wrapper{display:flex;align-items:center;gap:6px}.job-card__street--more-locations__wrapper{display:flex;align-items:center;gap:2px;font-size:12px;margin-left:2px}.job-card__street--amount{font-weight:600;color:#1f9755}.job-card__street--more-locations{color:#999}.job-card__apply{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:10px 16px;background-color:#198754;color:#fff;border-radius:4px;text-decoration:none;font-weight:600;font-size:14px;transition:background-color 0.2s ease, transform 0.1s ease;white-space:nowrap;flex-shrink:0}.job-card__apply:hover{background-color:#1a6f47;transform:translateY(-1px)}.job-card__apply:active{transform:translateY(0)}.job-card__apply--icon{display:inline-flex;align-items:center}.job-card__apply--icon svg{width:14px;height:14px}@media (max-width: 768px){.job-card{padding:12px}.job-card__content{flex-direction:column;gap:10px}.job-card__apply{width:100%;justify-content:center}.job-card__title{font-size:16px}}@media (max-width: 480px){.job-card{padding:10px}.job-card__title{font-size:15px}.job-card__distance{font-size:12px}.job-card__street,.job-card__brand,.job-card__employment-type{font-size:13px}}`;
4
+
5
+ /**
6
+ * Helper function to get formatted location label from location object
7
+ */
8
+ function getLocationLabel(loc) {
9
+ if (loc.cityStateAbbr)
10
+ return loc.cityStateAbbr;
11
+ const parts = [loc.streetAddress, loc.city, loc.stateAbbr || loc.state, loc.countryAbbr || loc.country].filter(Boolean);
12
+ return parts.join(', ') || loc.locationText || '';
13
+ }
14
+ /**
15
+ * Helper function to get the first location from job locations
16
+ */
17
+ function getFirstLocation(job) {
18
+ const locs = job.locations;
19
+ if (!locs?.length)
20
+ return undefined;
21
+ return locs[0];
22
+ }
23
+ const JobCard = class {
24
+ constructor(hostRef) {
25
+ registerInstance(this, hostRef);
26
+ }
27
+ /**
28
+ * The job data object to display. Accepts either a Job object or a JSON string.
29
+ */
30
+ job;
31
+ /**
32
+ * Index of the job in a list (used for accessibility)
33
+ */
34
+ index = 0;
35
+ /**
36
+ * Text for the apply button
37
+ */
38
+ applyButtonText = 'Apply Now';
39
+ /**
40
+ * Whether to show the brand/company name
41
+ */
42
+ showBrand = true;
43
+ /**
44
+ * Whether to show the reference number
45
+ */
46
+ showReference = false;
47
+ /**
48
+ * Whether to show employment type
49
+ */
50
+ showEmploymentType = true;
51
+ /**
52
+ * Text shown for multiple locations
53
+ */
54
+ multiLocationText = 'More locations';
55
+ /**
56
+ * Text shown for remote jobs
57
+ */
58
+ remoteLocationText = 'Remote';
59
+ /**
60
+ * Whether to show distances in kilometers instead of miles
61
+ */
62
+ enableKilometers = false;
63
+ /**
64
+ * Whether to show commute time
65
+ */
66
+ showCommuteTime = false;
67
+ /**
68
+ * Format string for street address (not used in base web component)
69
+ */
70
+ streetFormat = '{street}, {city_state_abbr}';
71
+ /** Extra CSS class on the root inner element (avoid prop name "className", reserved on HTMLElement). */
72
+ rootClass = '';
73
+ /**
74
+ * Custom extra fields configuration
75
+ */
76
+ extraFieldsConfig = [];
77
+ /**
78
+ * Format distance with unit
79
+ */
80
+ formatDistance(distance) {
81
+ const value = this.enableKilometers ? distance * 1.60934 : distance;
82
+ const unit = this.enableKilometers ? 'Km' : 'Miles';
83
+ const str = `${value.toFixed(1)} ${unit}`.replace('.0', '');
84
+ return str;
85
+ }
86
+ /**
87
+ * Is Empty utility
88
+ */
89
+ isEmpty(value) {
90
+ if (value === null || value === undefined || value === '') {
91
+ return true;
92
+ }
93
+ if (Array.isArray(value) && value.length === 0) {
94
+ return true;
95
+ }
96
+ return false;
97
+ }
98
+ /**
99
+ * Parse job data from prop - handles both object and JSON string
100
+ */
101
+ getJobData() {
102
+ if (!this.job)
103
+ return null;
104
+ if (typeof this.job === 'string') {
105
+ try {
106
+ return JSON.parse(this.job);
107
+ }
108
+ catch {
109
+ console.warn('job-card: Failed to parse job JSON string');
110
+ return null;
111
+ }
112
+ }
113
+ return this.job;
114
+ }
115
+ render() {
116
+ const job = this.getJobData();
117
+ if (!job)
118
+ return null;
119
+ const firstLoc = getFirstLocation(job);
120
+ const locationLabel = firstLoc ? getLocationLabel(firstLoc) : '';
121
+ const distance = firstLoc?.distance ?? 0;
122
+ const distanceLabel = distance > 0 ? this.formatDistance(distance) : '';
123
+ const applyHref = job.applyURL ||
124
+ (job.originalURL ? `${typeof window !== 'undefined' ? window.location.origin : ''}${job.originalURL}` : '#');
125
+ const applyLabel = `${this.applyButtonText}, ${job.title || ''}`;
126
+ const locs = job.locations ?? [];
127
+ const hasMultipleLocations = locs.length > 1;
128
+ return (h("div", { class: `job-card ${this.rootClass}`.trim() }, h("div", { class: "job-card__header" }, h("h3", { class: "job-card__title" }, h("a", { class: "job-card__title--link", href: applyHref, target: "_blank", rel: "noopener noreferrer" }, job.title || ''), this.showReference && (h("span", { class: `job-card__reference ${job.reference ? '' : 'job-card__reference--empty'}` }, job.reference || '')), job.isRemote && (h("span", { class: this.remoteLocationText ? 'job-card__remote' : 'job-card__remote job-card__remote--empty' }, this.remoteLocationText))), distanceLabel && (h("div", { class: "job-card__distance" }, h("span", { class: "job-card__distance--icon" }, h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "1.5" }, h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", d: "M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18z" }), h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", d: "M12 8v4l2 2" }))), h("span", { class: "job-card__distance--label" }, distanceLabel)))), h("div", { class: "job-card__content" }, h("div", { class: "job-card__info" }, h("div", { class: locs.length ? 'job-card__street' : 'job-card__street job-card__street--empty' }, h("div", { class: "job-card__street--label__wrapper" }, h("span", { class: "job-card__street--icon" }, h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "1.5" }, h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", d: "M15 10.5a3 3 0 1 1-6 0 3 3 0 0 1 6 0z" }), h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", d: "M19.5 10.5c0 7.142-7.5 11.25-7.5 11.25S4.5 17.642 4.5 10.5a7.5 7.5 0 1 1 15 0z" }))), h("span", { class: "job-card__street--label" }, locationLabel || '—')), hasMultipleLocations && (h("div", { class: "job-card__street--more-locations__wrapper" }, h("span", { class: "job-card__street--amount" }, "+", locs.length - 1), h("span", { class: "job-card__street--more-locations" }, this.multiLocationText)))), this.showBrand && (h("div", { class: job.brandName ? 'job-card__brand' : 'job-card__brand job-card__brand--empty' }, h("span", { class: "job-card__brand--icon" }, h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "1.5" }, h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", d: "M2.25 21h19.5m-18-18v18m10.5-18v18m6-13.5V21M6.75 6.75h.75m-.75 3h.75m-.75 3h.75m3-6h.75m-.75 3h.75m-.75 3h.75M6.75 21v-3.375c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21M3 3h12m-.75 4.5H21m-3.75 3.75h.008v.008h-.008v-.008zm0 3h.008v.008h-.008v-.008zm0 3h.008v.008h-.008v-.008z" }))), h("span", { class: "job-card__brand--label" }, job.brandName || '—'))), this.showEmploymentType && (h("div", { class: job.employmentType?.length
129
+ ? 'job-card__employment-type'
130
+ : 'job-card__employment-type job-card__employment-type--empty' }, h("span", { class: "job-card__employment-type--icon" }, h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "1.5" }, h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", d: "M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0z" }))), job.employmentType?.length ? (job.employmentType?.map((type) => (h("span", { key: type, class: "job-card__employment-type--label" }, type)))) : (h("span", { class: "job-card__employment-type--label" }, "\u2014")))), (job.jobCardExtraFields ?? []).length > 0 &&
131
+ job.jobCardExtraFields?.map((field, idx) => (h("div", { key: idx, class: !this.isEmpty(field.value) ? `${field.classname}` : `${field.classname}--empty` }, Array.isArray(field.value) ? (field.value.map((item, itemIdx) => (h("span", { key: itemIdx, class: `${field.classname}--label` }, item)))) : (h("span", { class: `${field.classname}--label` }, field.value)))))), h("a", { class: "job-card__apply", href: applyHref, target: "_blank", rel: "noopener noreferrer", "aria-label": applyLabel }, h("span", { class: "job-card__apply--label" }, this.applyButtonText), h("span", { class: "job-card__apply--icon" }, h("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" }, h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", d: "M13.5 4.5 21 12m0 0-7.5 7.5M21 12H3" })))))));
132
+ }
133
+ };
134
+ JobCard.style = jobCardCss();
135
+
136
+ export { JobCard as job_card };
@@ -5,7 +5,7 @@ import { g as globalScripts } from './app-globals-DQuL1Twl.js';
5
5
  const defineCustomElements = async (win, options) => {
6
6
  if (typeof window === 'undefined') return undefined;
7
7
  await globalScripts();
8
- return bootstrapLazy([["fast-button_4",[[512,"jobs-list-only",{"mockData":[4,"mock-data"],"jobs":[1],"loading":[4],"totalJob":[2,"total-job"],"noResultsLine1":[1,"no-results-line-1"],"noResultsLine2":[1,"no-results-line-2"],"applyButtonText":[1,"apply-button-text"],"showBrand":[4,"show-brand"],"showReference":[4,"show-reference"],"showEmploymentType":[4,"show-employment-type"],"streetFormat":[1,"street-format"],"multiLocationText":[1,"multi-location-text"],"remoteLocationText":[1,"remote-location-text"],"enableKilometers":[4,"enable-kilometers"],"rootClass":[1,"root-class"],"showSuggestions":[4,"show-suggestions"],"clearResultSuggestionsTitleText":[1,"clear-result-suggestions-title-text"],"clearResultSuggestionsLine1":[1,"clear-result-suggestions-line-1"],"clearResultSuggestionsLine2":[1,"clear-result-suggestions-line-2"],"clearResultSuggestionsLine3":[1,"clear-result-suggestions-line-3"],"clearResultSuggestionsLine4":[1,"clear-result-suggestions-line-4"]}],[772,"fast-button",{"variant":[1],"type":[1],"disabled":[4]}],[772,"fast-carousel",{"items":[1],"loop":[4],"class":[1],"controlClass":[1,"control-class"],"slideClass":[1,"slide-class"],"itemClass":[1,"item-class"],"scrollPrev":[64],"scrollNext":[64],"goToSlide":[64],"getEmbla":[64]}],[512,"jobs-item",{"job":[16],"index":[2],"applyButtonText":[1,"apply-button-text"],"showBrand":[4,"show-brand"],"showReference":[4,"show-reference"],"showEmploymentType":[4,"show-employment-type"],"multiLocationText":[1,"multi-location-text"],"remoteLocationText":[1,"remote-location-text"],"enableKilometers":[4,"enable-kilometers"]}]]]], options);
8
+ return bootstrapLazy([["job-card",[[512,"job-card",{"job":[1],"index":[2],"applyButtonText":[1,"apply-button-text"],"showBrand":[4,"show-brand"],"showReference":[4,"show-reference"],"showEmploymentType":[4,"show-employment-type"],"multiLocationText":[1,"multi-location-text"],"remoteLocationText":[1,"remote-location-text"],"enableKilometers":[4,"enable-kilometers"],"showCommuteTime":[4,"show-commute-time"],"streetFormat":[1,"street-format"],"rootClass":[1,"root-class"],"extraFieldsConfig":[16]}]]],["fast-button_4",[[512,"jobs-list-only",{"mockData":[4,"mock-data"],"jobs":[1],"loading":[4],"totalJob":[2,"total-job"],"noResultsLine1":[1,"no-results-line-1"],"noResultsLine2":[1,"no-results-line-2"],"applyButtonText":[1,"apply-button-text"],"showBrand":[4,"show-brand"],"showReference":[4,"show-reference"],"showEmploymentType":[4,"show-employment-type"],"streetFormat":[1,"street-format"],"multiLocationText":[1,"multi-location-text"],"remoteLocationText":[1,"remote-location-text"],"enableKilometers":[4,"enable-kilometers"],"rootClass":[1,"root-class"],"showSuggestions":[4,"show-suggestions"],"clearResultSuggestionsTitleText":[1,"clear-result-suggestions-title-text"],"clearResultSuggestionsLine1":[1,"clear-result-suggestions-line-1"],"clearResultSuggestionsLine2":[1,"clear-result-suggestions-line-2"],"clearResultSuggestionsLine3":[1,"clear-result-suggestions-line-3"],"clearResultSuggestionsLine4":[1,"clear-result-suggestions-line-4"]}],[772,"fast-button",{"variant":[1],"type":[1],"disabled":[4]}],[772,"fast-carousel",{"items":[1],"loop":[4],"class":[1],"controlClass":[1,"control-class"],"slideClass":[1,"slide-class"],"itemClass":[1,"item-class"],"scrollPrev":[64],"scrollNext":[64],"goToSlide":[64],"getEmbla":[64]}],[512,"jobs-item",{"job":[16],"index":[2],"applyButtonText":[1,"apply-button-text"],"showBrand":[4,"show-brand"],"showReference":[4,"show-reference"],"showEmploymentType":[4,"show-employment-type"],"multiLocationText":[1,"multi-location-text"],"remoteLocationText":[1,"remote-location-text"],"enableKilometers":[4,"enable-kilometers"]}]]]], options);
9
9
  };
10
10
 
11
11
  export { defineCustomElements };
@@ -17,5 +17,5 @@ var patchBrowser = () => {
17
17
 
18
18
  patchBrowser().then(async (options) => {
19
19
  await globalScripts();
20
- return bootstrapLazy([["fast-button_4",[[512,"jobs-list-only",{"mockData":[4,"mock-data"],"jobs":[1],"loading":[4],"totalJob":[2,"total-job"],"noResultsLine1":[1,"no-results-line-1"],"noResultsLine2":[1,"no-results-line-2"],"applyButtonText":[1,"apply-button-text"],"showBrand":[4,"show-brand"],"showReference":[4,"show-reference"],"showEmploymentType":[4,"show-employment-type"],"streetFormat":[1,"street-format"],"multiLocationText":[1,"multi-location-text"],"remoteLocationText":[1,"remote-location-text"],"enableKilometers":[4,"enable-kilometers"],"rootClass":[1,"root-class"],"showSuggestions":[4,"show-suggestions"],"clearResultSuggestionsTitleText":[1,"clear-result-suggestions-title-text"],"clearResultSuggestionsLine1":[1,"clear-result-suggestions-line-1"],"clearResultSuggestionsLine2":[1,"clear-result-suggestions-line-2"],"clearResultSuggestionsLine3":[1,"clear-result-suggestions-line-3"],"clearResultSuggestionsLine4":[1,"clear-result-suggestions-line-4"]}],[772,"fast-button",{"variant":[1],"type":[1],"disabled":[4]}],[772,"fast-carousel",{"items":[1],"loop":[4],"class":[1],"controlClass":[1,"control-class"],"slideClass":[1,"slide-class"],"itemClass":[1,"item-class"],"scrollPrev":[64],"scrollNext":[64],"goToSlide":[64],"getEmbla":[64]}],[512,"jobs-item",{"job":[16],"index":[2],"applyButtonText":[1,"apply-button-text"],"showBrand":[4,"show-brand"],"showReference":[4,"show-reference"],"showEmploymentType":[4,"show-employment-type"],"multiLocationText":[1,"multi-location-text"],"remoteLocationText":[1,"remote-location-text"],"enableKilometers":[4,"enable-kilometers"]}]]]], options);
20
+ return bootstrapLazy([["job-card",[[512,"job-card",{"job":[1],"index":[2],"applyButtonText":[1,"apply-button-text"],"showBrand":[4,"show-brand"],"showReference":[4,"show-reference"],"showEmploymentType":[4,"show-employment-type"],"multiLocationText":[1,"multi-location-text"],"remoteLocationText":[1,"remote-location-text"],"enableKilometers":[4,"enable-kilometers"],"showCommuteTime":[4,"show-commute-time"],"streetFormat":[1,"street-format"],"rootClass":[1,"root-class"],"extraFieldsConfig":[16]}]]],["fast-button_4",[[512,"jobs-list-only",{"mockData":[4,"mock-data"],"jobs":[1],"loading":[4],"totalJob":[2,"total-job"],"noResultsLine1":[1,"no-results-line-1"],"noResultsLine2":[1,"no-results-line-2"],"applyButtonText":[1,"apply-button-text"],"showBrand":[4,"show-brand"],"showReference":[4,"show-reference"],"showEmploymentType":[4,"show-employment-type"],"streetFormat":[1,"street-format"],"multiLocationText":[1,"multi-location-text"],"remoteLocationText":[1,"remote-location-text"],"enableKilometers":[4,"enable-kilometers"],"rootClass":[1,"root-class"],"showSuggestions":[4,"show-suggestions"],"clearResultSuggestionsTitleText":[1,"clear-result-suggestions-title-text"],"clearResultSuggestionsLine1":[1,"clear-result-suggestions-line-1"],"clearResultSuggestionsLine2":[1,"clear-result-suggestions-line-2"],"clearResultSuggestionsLine3":[1,"clear-result-suggestions-line-3"],"clearResultSuggestionsLine4":[1,"clear-result-suggestions-line-4"]}],[772,"fast-button",{"variant":[1],"type":[1],"disabled":[4]}],[772,"fast-carousel",{"items":[1],"loop":[4],"class":[1],"controlClass":[1,"control-class"],"slideClass":[1,"slide-class"],"itemClass":[1,"item-class"],"scrollPrev":[64],"scrollNext":[64],"goToSlide":[64],"getEmbla":[64]}],[512,"jobs-item",{"job":[16],"index":[2],"applyButtonText":[1,"apply-button-text"],"showBrand":[4,"show-brand"],"showReference":[4,"show-reference"],"showEmploymentType":[4,"show-employment-type"],"multiLocationText":[1,"multi-location-text"],"remoteLocationText":[1,"remote-location-text"],"enableKilometers":[4,"enable-kilometers"]}]]]], options);
21
21
  });
@@ -0,0 +1,93 @@
1
+ import type { Job } from '../../types/jobs-list';
2
+ /**
3
+ * JobCard Component
4
+ *
5
+ * A reusable card component for displaying job information based on the React JobItem component.
6
+ * Features include:
7
+ * - Job title with apply link
8
+ * - Location with distance
9
+ * - Brand/company name
10
+ * - Employment type
11
+ * - Reference number (optional)
12
+ * - Remote indicator (optional)
13
+ * - Multi-location support
14
+ * - Custom extra fields
15
+ *
16
+ * @example
17
+ * ```html
18
+ * <job-card
19
+ * .job={jobData}
20
+ * applyButtonText="Apply"
21
+ * showBrand="true"
22
+ * showEmploymentType="true"
23
+ * ></job-card>
24
+ * ```
25
+ */
26
+ export declare class JobCard {
27
+ /**
28
+ * The job data object to display. Accepts either a Job object or a JSON string.
29
+ */
30
+ job: Job | string;
31
+ /**
32
+ * Index of the job in a list (used for accessibility)
33
+ */
34
+ index: number;
35
+ /**
36
+ * Text for the apply button
37
+ */
38
+ applyButtonText: string;
39
+ /**
40
+ * Whether to show the brand/company name
41
+ */
42
+ showBrand: boolean;
43
+ /**
44
+ * Whether to show the reference number
45
+ */
46
+ showReference: boolean;
47
+ /**
48
+ * Whether to show employment type
49
+ */
50
+ showEmploymentType: boolean;
51
+ /**
52
+ * Text shown for multiple locations
53
+ */
54
+ multiLocationText: string;
55
+ /**
56
+ * Text shown for remote jobs
57
+ */
58
+ remoteLocationText: string;
59
+ /**
60
+ * Whether to show distances in kilometers instead of miles
61
+ */
62
+ enableKilometers: boolean;
63
+ /**
64
+ * Whether to show commute time
65
+ */
66
+ showCommuteTime: boolean;
67
+ /**
68
+ * Format string for street address (not used in base web component)
69
+ */
70
+ streetFormat: string;
71
+ /** Extra CSS class on the root inner element (avoid prop name "className", reserved on HTMLElement). */
72
+ rootClass: string;
73
+ /**
74
+ * Custom extra fields configuration
75
+ */
76
+ extraFieldsConfig: Array<{
77
+ name: string;
78
+ value: string;
79
+ }>;
80
+ /**
81
+ * Format distance with unit
82
+ */
83
+ private formatDistance;
84
+ /**
85
+ * Is Empty utility
86
+ */
87
+ private isEmpty;
88
+ /**
89
+ * Parse job data from prop - handles both object and JSON string
90
+ */
91
+ private getJobData;
92
+ render(): any;
93
+ }
@@ -1,6 +1,6 @@
1
- import type { JobSummary } from '../../types/jobs-list';
1
+ import type { Job } from '../../types/jobs-list';
2
2
  export declare class JobsItem {
3
- job: JobSummary;
3
+ job: Job;
4
4
  index: number;
5
5
  applyButtonText: string;
6
6
  showBrand: boolean;
@@ -1,11 +1,11 @@
1
- import type { JobSummary } from '../../types/jobs-list';
1
+ import type { Job } from '../../types/jobs-list';
2
2
  export declare class JobsListOnly {
3
3
  /**
4
4
  * When "true", use built-in mock data (for local/dev/docs). Otherwise use `jobs` from API/parent.
5
5
  */
6
6
  mockData: boolean;
7
7
  /** List of jobs to display. Pass as JSON string from attribute or as array via property (e.g. from React). Ignored when mock-data="true". */
8
- jobs: JobSummary[] | string;
8
+ jobs: Job[] | string;
9
9
  /** Show loading spinner. Ignored when mock-data="true" (mock shows data immediately). */
10
10
  loading: boolean;
11
11
  /** Total job count (for screen readers / schema). */
@@ -6,9 +6,9 @@
6
6
  */
7
7
  import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
8
8
  import { ButtonType, ButtonVariant } from "./components/button/button";
9
- import { JobSummary } from "./types/jobs-list";
9
+ import { Job } from "./types/jobs-list";
10
10
  export { ButtonType, ButtonVariant } from "./components/button/button";
11
- export { JobSummary } from "./types/jobs-list";
11
+ export { Job } from "./types/jobs-list";
12
12
  export namespace Components {
13
13
  interface FastButton {
14
14
  /**
@@ -70,6 +70,93 @@ export namespace Components {
70
70
  */
71
71
  "slideClass": string;
72
72
  }
73
+ /**
74
+ * JobCard Component
75
+ * A reusable card component for displaying job information based on the React JobItem component.
76
+ * Features include:
77
+ * - Job title with apply link
78
+ * - Location with distance
79
+ * - Brand/company name
80
+ * - Employment type
81
+ * - Reference number (optional)
82
+ * - Remote indicator (optional)
83
+ * - Multi-location support
84
+ * - Custom extra fields
85
+ * @example ```html
86
+ * <job-card
87
+ * .job={jobData}
88
+ * applyButtonText="Apply"
89
+ * showBrand="true"
90
+ * showEmploymentType="true"
91
+ * ></job-card>
92
+ * ```
93
+ */
94
+ interface JobCard {
95
+ /**
96
+ * Text for the apply button
97
+ * @default 'Apply Now'
98
+ */
99
+ "applyButtonText": string;
100
+ /**
101
+ * Whether to show distances in kilometers instead of miles
102
+ * @default false
103
+ */
104
+ "enableKilometers": boolean;
105
+ /**
106
+ * Custom extra fields configuration
107
+ * @default []
108
+ */
109
+ "extraFieldsConfig": Array<{ name: string; value: string }>;
110
+ /**
111
+ * Index of the job in a list (used for accessibility)
112
+ * @default 0
113
+ */
114
+ "index": number;
115
+ /**
116
+ * The job data object to display. Accepts either a Job object or a JSON string.
117
+ */
118
+ "job": Job | string;
119
+ /**
120
+ * Text shown for multiple locations
121
+ * @default 'More locations'
122
+ */
123
+ "multiLocationText": string;
124
+ /**
125
+ * Text shown for remote jobs
126
+ * @default 'Remote'
127
+ */
128
+ "remoteLocationText": string;
129
+ /**
130
+ * Extra CSS class on the root inner element (avoid prop name "className", reserved on HTMLElement).
131
+ * @default ''
132
+ */
133
+ "rootClass": string;
134
+ /**
135
+ * Whether to show the brand/company name
136
+ * @default true
137
+ */
138
+ "showBrand": boolean;
139
+ /**
140
+ * Whether to show commute time
141
+ * @default false
142
+ */
143
+ "showCommuteTime": boolean;
144
+ /**
145
+ * Whether to show employment type
146
+ * @default true
147
+ */
148
+ "showEmploymentType": boolean;
149
+ /**
150
+ * Whether to show the reference number
151
+ * @default false
152
+ */
153
+ "showReference": boolean;
154
+ /**
155
+ * Format string for street address (not used in base web component)
156
+ * @default '{street}, {city_state_abbr}'
157
+ */
158
+ "streetFormat": string;
159
+ }
73
160
  interface JobsItem {
74
161
  /**
75
162
  * @default 'Apply Now'
@@ -83,7 +170,7 @@ export namespace Components {
83
170
  * @default 0
84
171
  */
85
172
  "index": number;
86
- "job": JobSummary;
173
+ "job": Job;
87
174
  /**
88
175
  * @default 'More locations'
89
176
  */
@@ -138,7 +225,7 @@ export namespace Components {
138
225
  * List of jobs to display. Pass as JSON string from attribute or as array via property (e.g. from React). Ignored when mock-data="true".
139
226
  * @default []
140
227
  */
141
- "jobs": JobSummary[] | string;
228
+ "jobs": Job[] | string;
142
229
  /**
143
230
  * Show loading spinner. Ignored when mock-data="true" (mock shows data immediately).
144
231
  * @default false
@@ -225,6 +312,33 @@ declare global {
225
312
  prototype: HTMLFastCarouselElement;
226
313
  new (): HTMLFastCarouselElement;
227
314
  };
315
+ /**
316
+ * JobCard Component
317
+ * A reusable card component for displaying job information based on the React JobItem component.
318
+ * Features include:
319
+ * - Job title with apply link
320
+ * - Location with distance
321
+ * - Brand/company name
322
+ * - Employment type
323
+ * - Reference number (optional)
324
+ * - Remote indicator (optional)
325
+ * - Multi-location support
326
+ * - Custom extra fields
327
+ * @example ```html
328
+ * <job-card
329
+ * .job={jobData}
330
+ * applyButtonText="Apply"
331
+ * showBrand="true"
332
+ * showEmploymentType="true"
333
+ * ></job-card>
334
+ * ```
335
+ */
336
+ interface HTMLJobCardElement extends Components.JobCard, HTMLStencilElement {
337
+ }
338
+ var HTMLJobCardElement: {
339
+ prototype: HTMLJobCardElement;
340
+ new (): HTMLJobCardElement;
341
+ };
228
342
  interface HTMLJobsItemElement extends Components.JobsItem, HTMLStencilElement {
229
343
  }
230
344
  var HTMLJobsItemElement: {
@@ -240,6 +354,7 @@ declare global {
240
354
  interface HTMLElementTagNameMap {
241
355
  "fast-button": HTMLFastButtonElement;
242
356
  "fast-carousel": HTMLFastCarouselElement;
357
+ "job-card": HTMLJobCardElement;
243
358
  "jobs-item": HTMLJobsItemElement;
244
359
  "jobs-list-only": HTMLJobsListOnlyElement;
245
360
  }
@@ -293,6 +408,93 @@ declare namespace LocalJSX {
293
408
  */
294
409
  "slideClass"?: string;
295
410
  }
411
+ /**
412
+ * JobCard Component
413
+ * A reusable card component for displaying job information based on the React JobItem component.
414
+ * Features include:
415
+ * - Job title with apply link
416
+ * - Location with distance
417
+ * - Brand/company name
418
+ * - Employment type
419
+ * - Reference number (optional)
420
+ * - Remote indicator (optional)
421
+ * - Multi-location support
422
+ * - Custom extra fields
423
+ * @example ```html
424
+ * <job-card
425
+ * .job={jobData}
426
+ * applyButtonText="Apply"
427
+ * showBrand="true"
428
+ * showEmploymentType="true"
429
+ * ></job-card>
430
+ * ```
431
+ */
432
+ interface JobCard {
433
+ /**
434
+ * Text for the apply button
435
+ * @default 'Apply Now'
436
+ */
437
+ "applyButtonText"?: string;
438
+ /**
439
+ * Whether to show distances in kilometers instead of miles
440
+ * @default false
441
+ */
442
+ "enableKilometers"?: boolean;
443
+ /**
444
+ * Custom extra fields configuration
445
+ * @default []
446
+ */
447
+ "extraFieldsConfig"?: Array<{ name: string; value: string }>;
448
+ /**
449
+ * Index of the job in a list (used for accessibility)
450
+ * @default 0
451
+ */
452
+ "index"?: number;
453
+ /**
454
+ * The job data object to display. Accepts either a Job object or a JSON string.
455
+ */
456
+ "job"?: Job | string;
457
+ /**
458
+ * Text shown for multiple locations
459
+ * @default 'More locations'
460
+ */
461
+ "multiLocationText"?: string;
462
+ /**
463
+ * Text shown for remote jobs
464
+ * @default 'Remote'
465
+ */
466
+ "remoteLocationText"?: string;
467
+ /**
468
+ * Extra CSS class on the root inner element (avoid prop name "className", reserved on HTMLElement).
469
+ * @default ''
470
+ */
471
+ "rootClass"?: string;
472
+ /**
473
+ * Whether to show the brand/company name
474
+ * @default true
475
+ */
476
+ "showBrand"?: boolean;
477
+ /**
478
+ * Whether to show commute time
479
+ * @default false
480
+ */
481
+ "showCommuteTime"?: boolean;
482
+ /**
483
+ * Whether to show employment type
484
+ * @default true
485
+ */
486
+ "showEmploymentType"?: boolean;
487
+ /**
488
+ * Whether to show the reference number
489
+ * @default false
490
+ */
491
+ "showReference"?: boolean;
492
+ /**
493
+ * Format string for street address (not used in base web component)
494
+ * @default '{street}, {city_state_abbr}'
495
+ */
496
+ "streetFormat"?: string;
497
+ }
296
498
  interface JobsItem {
297
499
  /**
298
500
  * @default 'Apply Now'
@@ -306,7 +508,7 @@ declare namespace LocalJSX {
306
508
  * @default 0
307
509
  */
308
510
  "index"?: number;
309
- "job"?: JobSummary;
511
+ "job"?: Job;
310
512
  /**
311
513
  * @default 'More locations'
312
514
  */
@@ -361,7 +563,7 @@ declare namespace LocalJSX {
361
563
  * List of jobs to display. Pass as JSON string from attribute or as array via property (e.g. from React). Ignored when mock-data="true".
362
564
  * @default []
363
565
  */
364
- "jobs"?: JobSummary[] | string;
566
+ "jobs"?: Job[] | string;
365
567
  /**
366
568
  * Show loading spinner. Ignored when mock-data="true" (mock shows data immediately).
367
569
  * @default false
@@ -433,6 +635,20 @@ declare namespace LocalJSX {
433
635
  "slideClass": string;
434
636
  "itemClass": string;
435
637
  }
638
+ interface JobCardAttributes {
639
+ "job": Job | string;
640
+ "index": number;
641
+ "applyButtonText": string;
642
+ "showBrand": boolean;
643
+ "showReference": boolean;
644
+ "showEmploymentType": boolean;
645
+ "multiLocationText": string;
646
+ "remoteLocationText": string;
647
+ "enableKilometers": boolean;
648
+ "showCommuteTime": boolean;
649
+ "streetFormat": string;
650
+ "rootClass": string;
651
+ }
436
652
  interface JobsItemAttributes {
437
653
  "index": number;
438
654
  "applyButtonText": string;
@@ -445,7 +661,7 @@ declare namespace LocalJSX {
445
661
  }
446
662
  interface JobsListOnlyAttributes {
447
663
  "mockData": boolean;
448
- "jobs": JobSummary[] | string;
664
+ "jobs": Job[] | string;
449
665
  "loading": boolean;
450
666
  "totalJob": number;
451
667
  "noResultsLine1": string;
@@ -470,6 +686,7 @@ declare namespace LocalJSX {
470
686
  interface IntrinsicElements {
471
687
  "fast-button": Omit<FastButton, keyof FastButtonAttributes> & { [K in keyof FastButton & keyof FastButtonAttributes]?: FastButton[K] } & { [K in keyof FastButton & keyof FastButtonAttributes as `attr:${K}`]?: FastButtonAttributes[K] } & { [K in keyof FastButton & keyof FastButtonAttributes as `prop:${K}`]?: FastButton[K] };
472
688
  "fast-carousel": Omit<FastCarousel, keyof FastCarouselAttributes> & { [K in keyof FastCarousel & keyof FastCarouselAttributes]?: FastCarousel[K] } & { [K in keyof FastCarousel & keyof FastCarouselAttributes as `attr:${K}`]?: FastCarouselAttributes[K] } & { [K in keyof FastCarousel & keyof FastCarouselAttributes as `prop:${K}`]?: FastCarousel[K] };
689
+ "job-card": Omit<JobCard, keyof JobCardAttributes> & { [K in keyof JobCard & keyof JobCardAttributes]?: JobCard[K] } & { [K in keyof JobCard & keyof JobCardAttributes as `attr:${K}`]?: JobCardAttributes[K] } & { [K in keyof JobCard & keyof JobCardAttributes as `prop:${K}`]?: JobCard[K] };
473
690
  "jobs-item": Omit<JobsItem, keyof JobsItemAttributes> & { [K in keyof JobsItem & keyof JobsItemAttributes]?: JobsItem[K] } & { [K in keyof JobsItem & keyof JobsItemAttributes as `attr:${K}`]?: JobsItemAttributes[K] } & { [K in keyof JobsItem & keyof JobsItemAttributes as `prop:${K}`]?: JobsItem[K] };
474
691
  "jobs-list-only": Omit<JobsListOnly, keyof JobsListOnlyAttributes> & { [K in keyof JobsListOnly & keyof JobsListOnlyAttributes]?: JobsListOnly[K] } & { [K in keyof JobsListOnly & keyof JobsListOnlyAttributes as `attr:${K}`]?: JobsListOnlyAttributes[K] } & { [K in keyof JobsListOnly & keyof JobsListOnlyAttributes as `prop:${K}`]?: JobsListOnly[K] };
475
692
  }
@@ -480,6 +697,28 @@ declare module "@stencil/core" {
480
697
  interface IntrinsicElements {
481
698
  "fast-button": LocalJSX.IntrinsicElements["fast-button"] & JSXBase.HTMLAttributes<HTMLFastButtonElement>;
482
699
  "fast-carousel": LocalJSX.IntrinsicElements["fast-carousel"] & JSXBase.HTMLAttributes<HTMLFastCarouselElement>;
700
+ /**
701
+ * JobCard Component
702
+ * A reusable card component for displaying job information based on the React JobItem component.
703
+ * Features include:
704
+ * - Job title with apply link
705
+ * - Location with distance
706
+ * - Brand/company name
707
+ * - Employment type
708
+ * - Reference number (optional)
709
+ * - Remote indicator (optional)
710
+ * - Multi-location support
711
+ * - Custom extra fields
712
+ * @example ```html
713
+ * <job-card
714
+ * .job={jobData}
715
+ * applyButtonText="Apply"
716
+ * showBrand="true"
717
+ * showEmploymentType="true"
718
+ * ></job-card>
719
+ * ```
720
+ */
721
+ "job-card": LocalJSX.IntrinsicElements["job-card"] & JSXBase.HTMLAttributes<HTMLJobCardElement>;
483
722
  "jobs-item": LocalJSX.IntrinsicElements["jobs-item"] & JSXBase.HTMLAttributes<HTMLJobsItemElement>;
484
723
  "jobs-list-only": LocalJSX.IntrinsicElements["jobs-list-only"] & JSXBase.HTMLAttributes<HTMLJobsListOnlyElement>;
485
724
  }
@@ -1,7 +1,7 @@
1
- import type { JobSummary } from '../types/jobs-list';
1
+ import type { Job } from '../types/jobs-list';
2
2
  /**
3
3
  * Mock jobs for local development and docs.
4
4
  * Use in www or static HTML: jobs='...' (JSON.stringify(mockJobs)).
5
5
  */
6
- export declare const mockJobsListOnly: JobSummary[];
6
+ export declare const mockJobsListOnly: Job[];
7
7
  export declare function getMockJobsJson(): string;