@next-degree/pickle-shared-js 0.11.0 → 0.12.2
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.
- package/dist/{company_service_sanity-CGNCrk8e.d.cts → company_service_sanity-2J1ZuUnu.d.cts} +384 -384
- package/dist/{company_service_sanity-CAyYirw5.d.ts → company_service_sanity-KaAGfnNV.d.ts} +384 -384
- package/dist/components/jobCard/JobLocation.cjs +97 -14
- package/dist/components/jobCard/JobLocation.cjs.map +1 -1
- package/dist/components/jobCard/JobLocation.d.cts +8 -6
- package/dist/components/jobCard/JobLocation.d.ts +8 -6
- package/dist/components/jobCard/JobLocation.js +93 -14
- package/dist/components/jobCard/JobLocation.js.map +1 -1
- package/dist/components/jobPost/JobDescription.cjs +3 -1
- package/dist/components/jobPost/JobDescription.cjs.map +1 -1
- package/dist/components/jobPost/JobDescription.js +3 -1
- package/dist/components/jobPost/JobDescription.js.map +1 -1
- package/dist/components/jobPost/JobHeader.cjs +1 -0
- package/dist/components/jobPost/JobHeader.cjs.map +1 -1
- package/dist/components/jobPost/JobHeader.js +1 -0
- package/dist/components/jobPost/JobHeader.js.map +1 -1
- package/dist/components/jobPost/JobPost.cjs +26 -18
- package/dist/components/jobPost/JobPost.cjs.map +1 -1
- package/dist/components/jobPost/JobPost.d.cts +1 -1
- package/dist/components/jobPost/JobPost.d.ts +1 -1
- package/dist/components/jobPost/JobPost.js +26 -18
- package/dist/components/jobPost/JobPost.js.map +1 -1
- package/dist/components/primitives/command.d.cts +3 -3
- package/dist/components/primitives/command.d.ts +3 -3
- package/dist/components/primitives/input-otp.d.cts +2 -2
- package/dist/components/primitives/input-otp.d.ts +2 -2
- package/dist/components/ui/Chip.cjs +1 -0
- package/dist/components/ui/Chip.cjs.map +1 -1
- package/dist/components/ui/Chip.d.cts +1 -1
- package/dist/components/ui/Chip.d.ts +1 -1
- package/dist/components/ui/Chip.js +1 -0
- package/dist/components/ui/Chip.js.map +1 -1
- package/dist/components/ui/Combobox.cjs +28 -19
- package/dist/components/ui/Combobox.cjs.map +1 -1
- package/dist/components/ui/Combobox.js +29 -20
- package/dist/components/ui/Combobox.js.map +1 -1
- package/dist/components/ui/DismissibleBanner.cjs +85 -0
- package/dist/components/ui/DismissibleBanner.cjs.map +1 -0
- package/dist/components/ui/DismissibleBanner.d.cts +11 -0
- package/dist/components/ui/DismissibleBanner.d.ts +11 -0
- package/dist/components/ui/DismissibleBanner.js +60 -0
- package/dist/components/ui/DismissibleBanner.js.map +1 -0
- package/dist/components/ui/ReadMore.cjs +3 -1
- package/dist/components/ui/ReadMore.cjs.map +1 -1
- package/dist/components/ui/ReadMore.js +3 -1
- package/dist/components/ui/ReadMore.js.map +1 -1
- package/dist/components/ui/Select.cjs +1 -0
- package/dist/components/ui/Select.cjs.map +1 -1
- package/dist/components/ui/Select.js +1 -0
- package/dist/components/ui/Select.js.map +1 -1
- package/dist/{displayText-DHKm6_JF.d.cts → displayText-DW0qiJqh.d.cts} +2 -2
- package/dist/{displayText-D8MYOaYK.d.ts → displayText-DahwdHdi.d.ts} +2 -2
- package/dist/hooks/useDisplayText.d.cts +3 -3
- package/dist/hooks/useDisplayText.d.ts +3 -3
- package/dist/index.cjs +1260 -1131
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -5
- package/dist/index.d.ts +10 -5
- package/dist/index.js +1198 -1072
- package/dist/index.js.map +1 -1
- package/dist/{job_posting_service_latest-DaKYQh30.d.cts → job_posting_service_latest-C_TEBzCf.d.cts} +289 -289
- package/dist/{job_posting_service_latest-DaKYQh30.d.ts → job_posting_service_latest-C_TEBzCf.d.ts} +289 -289
- package/dist/{job_posting_service_latest-C8PT9mxn.d.cts → job_posting_service_latest-DdgK8Nnz.d.cts} +290 -290
- package/dist/{job_posting_service_latest-C8PT9mxn.d.ts → job_posting_service_latest-DdgK8Nnz.d.ts} +290 -290
- package/dist/{job_posting_service_sanity-nyUCPROx.d.ts → job_posting_service_sanity-BKo9TBDT.d.ts} +630 -630
- package/dist/{job_posting_service_sanity-BK7jdr2W.d.cts → job_posting_service_sanity-BNq-Am9N.d.cts} +630 -630
- package/dist/lib/locations.cjs +32 -7
- package/dist/lib/locations.cjs.map +1 -1
- package/dist/lib/locations.d.cts +8 -5
- package/dist/lib/locations.d.ts +8 -5
- package/dist/lib/locations.js +30 -6
- package/dist/lib/locations.js.map +1 -1
- package/dist/lib/mappings.d.cts +3 -3
- package/dist/lib/mappings.d.ts +3 -3
- package/dist/lib/salaryRange.cjs +14 -12
- package/dist/lib/salaryRange.cjs.map +1 -1
- package/dist/lib/salaryRange.d.cts +2 -2
- package/dist/lib/salaryRange.d.ts +2 -2
- package/dist/lib/salaryRange.js +14 -12
- package/dist/lib/salaryRange.js.map +1 -1
- package/dist/services/displayText.d.cts +3 -3
- package/dist/services/displayText.d.ts +3 -3
- package/dist/styles/globals.css +3 -7
- package/dist/styles/globals.css.map +1 -1
- package/dist/types/data/company_service_latest.d.cts +1 -1
- package/dist/types/data/company_service_latest.d.ts +1 -1
- package/dist/types/data/job_posting_service_latest.d.cts +1 -1
- package/dist/types/data/job_posting_service_latest.d.ts +1 -1
- package/dist/types/data/shared_pickle_output_latest.d.cts +1 -1
- package/dist/types/data/shared_pickle_output_latest.d.ts +1 -1
- package/dist/types/index.d.cts +5 -5
- package/dist/types/index.d.ts +5 -5
- package/dist/types/latest/company_service_latest.d.cts +1 -1
- package/dist/types/latest/company_service_latest.d.ts +1 -1
- package/dist/types/latest/custom/company_service_sanity.d.cts +3 -3
- package/dist/types/latest/custom/company_service_sanity.d.ts +3 -3
- package/dist/types/latest/custom/job_posting_service_sanity.d.cts +3 -3
- package/dist/types/latest/custom/job_posting_service_sanity.d.ts +3 -3
- package/dist/types/latest/job_posting_service_latest.d.cts +1 -1
- package/dist/types/latest/job_posting_service_latest.d.ts +1 -1
- package/dist/types/latest/shared_pickle_output_latest.d.cts +1 -1
- package/dist/types/latest/shared_pickle_output_latest.d.ts +1 -1
- package/package.json +4 -3
- package/dist/{company_service_latest-o6X0atwz.d.cts → company_service_latest-C7Moeufo.d.cts} +228 -228
- package/dist/{company_service_latest-o6X0atwz.d.ts → company_service_latest-C7Moeufo.d.ts} +228 -228
- package/dist/{company_service_latest-DpBsftTD.d.cts → company_service_latest-CITz7F53.d.cts} +228 -228
- package/dist/{company_service_latest-DpBsftTD.d.ts → company_service_latest-CITz7F53.d.ts} +228 -228
- package/dist/{shared_pickle_output_latest-BjRRmT8R.d.cts → shared_pickle_output_latest-CXBCG04N.d.cts} +15 -15
- package/dist/{shared_pickle_output_latest-BjRRmT8R.d.ts → shared_pickle_output_latest-CXBCG04N.d.ts} +15 -15
- package/dist/{shared_pickle_output_latest-BVF7Zh2H.d.cts → shared_pickle_output_latest-CtvHTPeX.d.cts} +15 -15
- package/dist/{shared_pickle_output_latest-BVF7Zh2H.d.ts → shared_pickle_output_latest-CtvHTPeX.d.ts} +15 -15
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { J as JobPostModel } from '../../job_posting_service_latest-
|
|
3
|
+
import { J as JobPostModel } from '../../job_posting_service_latest-C_TEBzCf.cjs';
|
|
4
4
|
import 'zod';
|
|
5
5
|
|
|
6
6
|
type JobPostProps = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { J as JobPostModel } from '../../job_posting_service_latest-
|
|
3
|
+
import { J as JobPostModel } from '../../job_posting_service_latest-C_TEBzCf.js';
|
|
4
4
|
import 'zod';
|
|
5
5
|
|
|
6
6
|
type JobPostProps = {
|
|
@@ -310,6 +310,7 @@ import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
|
310
310
|
function ReadMore({ text, ...props }) {
|
|
311
311
|
const [isExpanded, setIsExpanded] = useState(false);
|
|
312
312
|
const [maxWords, setMaxWords] = useState(160);
|
|
313
|
+
const isOverMaxWords = text.split(" ").length > maxWords;
|
|
313
314
|
useEffect(() => {
|
|
314
315
|
const updateMaxWords = () => {
|
|
315
316
|
const windowWidth = window.innerWidth;
|
|
@@ -324,6 +325,7 @@ function ReadMore({ text, ...props }) {
|
|
|
324
325
|
return () => window.removeEventListener("resize", updateMaxWords);
|
|
325
326
|
}, []);
|
|
326
327
|
function createReadMoreText(text2, maxWords2, isExpanded2) {
|
|
328
|
+
if (!isOverMaxWords) return text2;
|
|
327
329
|
const words = text2.split(" ");
|
|
328
330
|
const snippet2 = isExpanded2 ? text2 : words.slice(0, maxWords2).join(" ");
|
|
329
331
|
const readMoreText = isExpanded2 ? "" : "...";
|
|
@@ -333,7 +335,7 @@ function ReadMore({ text, ...props }) {
|
|
|
333
335
|
const snippet = createReadMoreText(text, maxWords, isExpanded);
|
|
334
336
|
return /* @__PURE__ */ jsxs5("div", { ...props, children: [
|
|
335
337
|
/* @__PURE__ */ jsx8("div", { "data-testid": "read-more-text", className: "prose lg:prose-lg", children: /* @__PURE__ */ jsx8(Markdown, { children: snippet }) }),
|
|
336
|
-
/* @__PURE__ */ jsx8(
|
|
338
|
+
isOverMaxWords && /* @__PURE__ */ jsx8(
|
|
337
339
|
Button,
|
|
338
340
|
{
|
|
339
341
|
type: "button",
|
|
@@ -498,6 +500,7 @@ var chipVariants = cva4(["flex", "items-center", "rounded-3xl", "border", "w-fit
|
|
|
498
500
|
neutral: ["text-grey-80", "border-grey-10"],
|
|
499
501
|
primary: ["text-purple-100", "border-purple-20"],
|
|
500
502
|
danger: ["text-pumpkin-100", "border-pumpkin-20"],
|
|
503
|
+
jobLocation: ["text-grey-80", "border-grey-10", "bg-grey-5"],
|
|
501
504
|
onboarding: ["text-green-100", "bg-green-10", "cursor-pointer"],
|
|
502
505
|
onboardingSelected: ["text-white", "bg-green-90", "cursor-pointer"]
|
|
503
506
|
},
|
|
@@ -1178,12 +1181,15 @@ var useDisplayText = (scope, value) => {
|
|
|
1178
1181
|
};
|
|
1179
1182
|
|
|
1180
1183
|
// src/lib/locations.ts
|
|
1181
|
-
function formattedAddress(address) {
|
|
1184
|
+
function formattedAddress(address, isRemote = false) {
|
|
1185
|
+
if (!address) return null;
|
|
1182
1186
|
const { addressLocality, addressRegion, addressCountry } = address;
|
|
1183
|
-
|
|
1184
|
-
if (
|
|
1185
|
-
|
|
1186
|
-
if (addressCountry) return addressCountry
|
|
1187
|
+
const remoteMessage = isRemote ? " | Remote" : "";
|
|
1188
|
+
if (addressLocality && addressRegion)
|
|
1189
|
+
return `${addressLocality}, ${addressRegion + remoteMessage}`;
|
|
1190
|
+
if (addressRegion && addressCountry) return `${addressRegion}, ${addressCountry + remoteMessage}`;
|
|
1191
|
+
if (addressRegion) return `${addressRegion + remoteMessage}`;
|
|
1192
|
+
if (addressCountry) return `${addressCountry + remoteMessage}`;
|
|
1187
1193
|
return null;
|
|
1188
1194
|
}
|
|
1189
1195
|
function formattedJobLocation(job) {
|
|
@@ -1586,7 +1592,7 @@ var jobPostSchema2 = jobPostSchema.extend({
|
|
|
1586
1592
|
|
|
1587
1593
|
// src/lib/salaryRange.ts
|
|
1588
1594
|
var CurrencyEnum2 = shared_pickle_output_latest_exports.CurrencyEnum;
|
|
1589
|
-
function salaryRange(salary) {
|
|
1595
|
+
function salaryRange(salary, showUnitText = true) {
|
|
1590
1596
|
if (!salary) return null;
|
|
1591
1597
|
let min = salary.minValue;
|
|
1592
1598
|
let max = salary.maxValue;
|
|
@@ -1605,17 +1611,19 @@ function salaryRange(salary) {
|
|
|
1605
1611
|
single = value.value;
|
|
1606
1612
|
unitText = value.unitText;
|
|
1607
1613
|
}
|
|
1608
|
-
if (unitText === "YEAR") unitText = "per year";
|
|
1609
|
-
if (unitText === "MONTH") unitText = "per month";
|
|
1610
|
-
if (unitText === "WEEK") unitText = "per week";
|
|
1611
|
-
if (unitText === "DAY") unitText = "per day";
|
|
1612
|
-
if (unitText === "PER_ACTIVITY") unitText = "per activity";
|
|
1613
|
-
if (unitText === "HOUR") unitText = "per hour";
|
|
1614
|
-
if (
|
|
1615
|
-
|
|
1616
|
-
if (min
|
|
1617
|
-
if (
|
|
1618
|
-
|
|
1614
|
+
if (unitText === "YEAR") unitText = " per year";
|
|
1615
|
+
if (unitText === "MONTH") unitText = " per month";
|
|
1616
|
+
if (unitText === "WEEK") unitText = " per week";
|
|
1617
|
+
if (unitText === "DAY") unitText = " per day";
|
|
1618
|
+
if (unitText === "PER_ACTIVITY") unitText = " per activity";
|
|
1619
|
+
if (unitText === "HOUR") unitText = " per hour";
|
|
1620
|
+
if (showUnitText === false) unitText = "";
|
|
1621
|
+
const isValid = (v) => v != null && v >= 0;
|
|
1622
|
+
if (!isValid(min) && !isValid(max) && !isValid(single)) return null;
|
|
1623
|
+
if (isValid(single)) return sign + single.toLocaleString() + unitText;
|
|
1624
|
+
if (min === max) return sign + min?.toLocaleString() + unitText;
|
|
1625
|
+
if (isValid(min) && isValid(max))
|
|
1626
|
+
return sign + min?.toLocaleString() + " - " + sign + max?.toLocaleString() + unitText;
|
|
1619
1627
|
return null;
|
|
1620
1628
|
}
|
|
1621
1629
|
|