@next-degree/pickle-shared-js 0.6.48 → 0.7.51
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_latest-DFxfjA2x.d.cts +4369 -0
- package/dist/company_service_latest-DFxfjA2x.d.ts +4369 -0
- package/dist/company_service_sanity--Aw-Y3Us.d.cts +7611 -0
- package/dist/company_service_sanity-B5FBDl-4.d.ts +7611 -0
- package/dist/components/buttons/BackButton.cjs +5 -1
- package/dist/components/buttons/BackButton.cjs.map +1 -1
- package/dist/components/buttons/BackButton.js +5 -1
- package/dist/components/buttons/BackButton.js.map +1 -1
- package/dist/components/company/CompanyTake.cjs +4 -2
- package/dist/components/company/CompanyTake.cjs.map +1 -1
- package/dist/components/company/CompanyTake.js +4 -2
- package/dist/components/company/CompanyTake.js.map +1 -1
- package/dist/components/jobPost/JobDescription.cjs +18 -7
- package/dist/components/jobPost/JobDescription.cjs.map +1 -1
- package/dist/components/jobPost/JobDescription.js +18 -7
- package/dist/components/jobPost/JobDescription.js.map +1 -1
- package/dist/components/jobPost/JobHeader.cjs +43 -37
- package/dist/components/jobPost/JobHeader.cjs.map +1 -1
- package/dist/components/jobPost/JobHeader.js +42 -36
- package/dist/components/jobPost/JobHeader.js.map +1 -1
- package/dist/components/jobPost/JobPost.cjs +105 -90
- 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 +105 -90
- package/dist/components/jobPost/JobPost.js.map +1 -1
- package/dist/components/primitives/avatar.cjs.map +1 -1
- package/dist/components/primitives/avatar.js.map +1 -1
- package/dist/components/primitives/command.cjs +6 -4
- package/dist/components/primitives/command.cjs.map +1 -1
- package/dist/components/primitives/command.d.cts +7 -7
- package/dist/components/primitives/command.d.ts +7 -7
- package/dist/components/primitives/command.js +6 -4
- package/dist/components/primitives/command.js.map +1 -1
- package/dist/components/primitives/dialog.cjs +4 -4
- package/dist/components/primitives/dialog.cjs.map +1 -1
- package/dist/components/primitives/dialog.js +6 -4
- package/dist/components/primitives/dialog.js.map +1 -1
- package/dist/components/primitives/input-otp.cjs +2 -2
- package/dist/components/primitives/input-otp.cjs.map +1 -1
- package/dist/components/primitives/input-otp.js +2 -2
- package/dist/components/primitives/input-otp.js.map +1 -1
- package/dist/components/primitives/popover.cjs +1 -1
- package/dist/components/primitives/popover.cjs.map +1 -1
- package/dist/components/primitives/popover.d.cts +1 -1
- package/dist/components/primitives/popover.d.ts +1 -1
- package/dist/components/primitives/popover.js +1 -1
- package/dist/components/primitives/popover.js.map +1 -1
- package/dist/components/primitives/separator.cjs.map +1 -1
- package/dist/components/primitives/separator.js.map +1 -1
- package/dist/components/primitives/tooltip.cjs.map +1 -1
- package/dist/components/primitives/tooltip.js.map +1 -1
- package/dist/components/ui/Avatar.cjs +2 -2
- package/dist/components/ui/Avatar.cjs.map +1 -1
- package/dist/components/ui/Avatar.js +4 -2
- package/dist/components/ui/Avatar.js.map +1 -1
- package/dist/components/ui/Badge.cjs.map +1 -1
- package/dist/components/ui/Badge.js.map +1 -1
- package/dist/components/ui/Button.cjs +3 -3
- package/dist/components/ui/Button.cjs.map +1 -1
- package/dist/components/ui/Button.d.cts +33 -0
- package/dist/components/ui/Button.d.ts +33 -0
- package/dist/components/ui/Button.js +5 -3
- package/dist/components/ui/Button.js.map +1 -1
- package/dist/components/ui/Checkbox.cjs.map +1 -1
- package/dist/components/ui/Checkbox.js.map +1 -1
- package/dist/components/ui/Combobox.cjs +111 -103
- package/dist/components/ui/Combobox.cjs.map +1 -1
- package/dist/components/ui/Combobox.d.cts +1 -1
- package/dist/components/ui/Combobox.d.ts +1 -1
- package/dist/components/ui/Combobox.js +108 -100
- package/dist/components/ui/Combobox.js.map +1 -1
- package/dist/components/ui/Counter.cjs +3 -1
- package/dist/components/ui/Counter.cjs.map +1 -1
- package/dist/components/ui/Counter.js +3 -1
- package/dist/components/ui/Counter.js.map +1 -1
- package/dist/components/ui/DatePicker.cjs +318 -0
- package/dist/components/ui/DatePicker.cjs.map +1 -0
- package/dist/components/ui/DatePicker.d.cts +16 -0
- package/dist/components/ui/DatePicker.d.ts +16 -0
- package/dist/components/ui/DatePicker.js +284 -0
- package/dist/components/ui/DatePicker.js.map +1 -0
- package/dist/components/ui/ErrorMessage.cjs.map +1 -1
- package/dist/components/ui/ErrorMessage.js.map +1 -1
- package/dist/components/ui/Icon.cjs.map +1 -1
- package/dist/components/ui/Icon.js.map +1 -1
- package/dist/components/ui/Input.cjs +3 -1
- package/dist/components/ui/Input.cjs.map +1 -1
- package/dist/components/ui/Input.d.cts +29 -0
- package/dist/components/ui/Input.d.ts +29 -0
- package/dist/components/ui/Input.js +3 -1
- package/dist/components/ui/Input.js.map +1 -1
- package/dist/components/ui/InputOtp.cjs +62 -58
- package/dist/components/ui/InputOtp.cjs.map +1 -1
- package/dist/components/ui/InputOtp.js +62 -58
- package/dist/components/ui/InputOtp.js.map +1 -1
- package/dist/components/ui/Label.cjs +5 -3
- package/dist/components/ui/Label.cjs.map +1 -1
- package/dist/components/ui/Label.js +7 -3
- package/dist/components/ui/Label.js.map +1 -1
- package/dist/components/ui/ListItem.cjs +7 -7
- package/dist/components/ui/ListItem.cjs.map +1 -1
- package/dist/components/ui/ListItem.js +10 -8
- package/dist/components/ui/ListItem.js.map +1 -1
- package/dist/components/ui/MapComponent.cjs.map +1 -1
- package/dist/components/ui/MapComponent.js +1 -1
- package/dist/components/ui/MapComponent.js.map +1 -1
- package/dist/components/ui/PlacesQueryInput.cjs +21 -13
- package/dist/components/ui/PlacesQueryInput.cjs.map +1 -1
- package/dist/components/ui/PlacesQueryInput.js +23 -13
- package/dist/components/ui/PlacesQueryInput.js.map +1 -1
- package/dist/components/ui/ReadMore.cjs +18 -7
- package/dist/components/ui/ReadMore.cjs.map +1 -1
- package/dist/components/ui/ReadMore.js +18 -7
- package/dist/components/ui/ReadMore.js.map +1 -1
- package/dist/components/ui/Select.cjs +68 -70
- package/dist/components/ui/Select.cjs.map +1 -1
- package/dist/components/ui/Select.js +66 -68
- package/dist/components/ui/Select.js.map +1 -1
- package/dist/components/ui/StepTabs.cjs +92 -0
- package/dist/components/ui/StepTabs.cjs.map +1 -0
- package/dist/components/ui/StepTabs.d.cts +13 -0
- package/dist/components/ui/StepTabs.d.ts +13 -0
- package/dist/components/ui/StepTabs.js +58 -0
- package/dist/components/ui/StepTabs.js.map +1 -0
- package/dist/components/ui/buttonShadcn.cjs +94 -0
- package/dist/components/ui/buttonShadcn.cjs.map +1 -0
- package/dist/components/ui/buttonShadcn.d.cts +14 -0
- package/dist/components/ui/buttonShadcn.d.ts +14 -0
- package/dist/components/ui/buttonShadcn.js +58 -0
- package/dist/components/ui/buttonShadcn.js.map +1 -0
- package/dist/components/ui/calendar.cjs +152 -0
- package/dist/components/ui/calendar.cjs.map +1 -0
- package/dist/components/ui/calendar.d.cts +11 -0
- package/dist/components/ui/calendar.d.ts +11 -0
- package/dist/components/ui/calendar.js +118 -0
- package/dist/components/ui/calendar.js.map +1 -0
- package/dist/{displayText-mYUVo6Ek.d.cts → displayText-CQRZ2fOT.d.cts} +2 -2
- package/dist/{displayText-DDf9iWyg.d.ts → displayText-LlsLfkTS.d.ts} +2 -2
- package/dist/hooks/useDisplayText.cjs.map +1 -1
- package/dist/hooks/useDisplayText.d.cts +3 -3
- package/dist/hooks/useDisplayText.d.ts +3 -3
- package/dist/hooks/useDisplayText.js.map +1 -1
- package/dist/index.cjs +763 -738
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -13
- package/dist/index.d.ts +13 -13
- package/dist/index.js +772 -747
- package/dist/index.js.map +1 -1
- package/dist/job_posting_service_latest-B5tqLSgo.d.cts +4247 -0
- package/dist/job_posting_service_latest-B5tqLSgo.d.ts +4247 -0
- package/dist/{job_posting_service_latest-Dn5s8beY.d.cts → job_posting_service_latest-CKITrYyz.d.cts} +230 -230
- package/dist/{job_posting_service_latest-Dn5s8beY.d.ts → job_posting_service_latest-CKITrYyz.d.ts} +230 -230
- package/dist/job_posting_service_sanity-CeX9tlpb.d.ts +8093 -0
- package/dist/job_posting_service_sanity-D5Znr6Ba.d.cts +8093 -0
- package/dist/lib/google.cjs.map +1 -1
- package/dist/lib/google.js.map +1 -1
- package/dist/lib/locations.cjs.map +1 -1
- package/dist/lib/locations.d.cts +2 -2
- package/dist/lib/locations.d.ts +2 -2
- package/dist/lib/locations.js.map +1 -1
- package/dist/lib/mappings.cjs.map +1 -1
- package/dist/lib/mappings.d.cts +3 -3
- package/dist/lib/mappings.d.ts +3 -3
- package/dist/lib/mappings.js.map +1 -1
- package/dist/lib/salaryRange.cjs.map +1 -1
- package/dist/lib/salaryRange.d.cts +1 -1
- package/dist/lib/salaryRange.d.ts +1 -1
- package/dist/lib/salaryRange.js.map +1 -1
- package/dist/lib/utils.cjs.map +1 -1
- package/dist/lib/utils.js.map +1 -1
- package/dist/services/displayText.cjs.map +1 -1
- package/dist/services/displayText.d.cts +3 -3
- package/dist/services/displayText.d.ts +3 -3
- package/dist/services/displayText.js.map +1 -1
- package/dist/shared_pickle_output_latest-Bwfg5B4p.d.cts +350 -0
- package/dist/shared_pickle_output_latest-Bwfg5B4p.d.ts +350 -0
- package/dist/styles/globals.css +371 -6
- package/dist/styles/globals.css.map +1 -1
- package/dist/types/data/company_service_latest.cjs.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/company_service_latest.js.map +1 -1
- package/dist/types/data/job_posting_service_latest.cjs +3 -1
- package/dist/types/data/job_posting_service_latest.cjs.map +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/job_posting_service_latest.js +3 -1
- package/dist/types/data/job_posting_service_latest.js.map +1 -1
- package/dist/types/data/shared_pickle_output_latest.cjs.map +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/data/shared_pickle_output_latest.js.map +1 -1
- package/dist/types/index.cjs +505 -0
- package/dist/types/index.cjs.map +1 -0
- package/dist/types/index.d.cts +10 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/index.js +479 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/latest/company_service_latest.cjs +251 -0
- package/dist/types/latest/company_service_latest.cjs.map +1 -0
- package/dist/types/latest/company_service_latest.d.cts +2 -0
- package/dist/types/latest/company_service_latest.d.ts +2 -0
- package/dist/types/latest/company_service_latest.js +210 -0
- package/dist/types/latest/company_service_latest.js.map +1 -0
- package/dist/types/latest/custom/company_service_sanity.cjs +325 -0
- package/dist/types/latest/custom/company_service_sanity.cjs.map +1 -0
- package/dist/types/latest/custom/company_service_sanity.d.cts +4 -0
- package/dist/types/latest/custom/company_service_sanity.d.ts +4 -0
- package/dist/types/latest/custom/company_service_sanity.js +288 -0
- package/dist/types/latest/custom/company_service_sanity.js.map +1 -0
- package/dist/types/latest/custom/custom_sanity_models.cjs +43 -0
- package/dist/types/latest/custom/custom_sanity_models.cjs.map +1 -0
- package/dist/types/latest/custom/custom_sanity_models.d.cts +30 -0
- package/dist/types/latest/custom/custom_sanity_models.d.ts +30 -0
- package/dist/types/latest/custom/custom_sanity_models.js +17 -0
- package/dist/types/latest/custom/custom_sanity_models.js.map +1 -0
- package/dist/types/latest/custom/job_posting_service_sanity.cjs +376 -0
- package/dist/types/latest/custom/job_posting_service_sanity.cjs.map +1 -0
- package/dist/types/latest/custom/job_posting_service_sanity.d.cts +5 -0
- package/dist/types/latest/custom/job_posting_service_sanity.d.ts +5 -0
- package/dist/types/latest/custom/job_posting_service_sanity.js +331 -0
- package/dist/types/latest/custom/job_posting_service_sanity.js.map +1 -0
- package/dist/types/latest/job_posting_service_latest.cjs +293 -0
- package/dist/types/latest/job_posting_service_latest.cjs.map +1 -0
- package/dist/types/latest/job_posting_service_latest.d.cts +2 -0
- package/dist/types/latest/job_posting_service_latest.d.ts +2 -0
- package/dist/types/latest/job_posting_service_latest.js +257 -0
- package/dist/types/latest/job_posting_service_latest.js.map +1 -0
- package/dist/types/latest/shared_pickle_output_latest.cjs +109 -0
- package/dist/types/latest/shared_pickle_output_latest.cjs.map +1 -0
- package/dist/types/latest/shared_pickle_output_latest.d.cts +2 -0
- package/dist/types/latest/shared_pickle_output_latest.d.ts +2 -0
- package/dist/types/latest/shared_pickle_output_latest.js +75 -0
- package/dist/types/latest/shared_pickle_output_latest.js.map +1 -0
- package/package.json +28 -6
- package/dist/{company_service_latest-DelYl1hO.d.cts → company_service_latest-8IMr2hMZ.d.cts} +244 -244
- package/dist/{company_service_latest-DelYl1hO.d.ts → company_service_latest-8IMr2hMZ.d.ts} +244 -244
- package/dist/{shared_pickle_output_latest-DbAgINuf.d.cts → shared_pickle_output_latest-Cwf2EMdH.d.cts} +17 -17
- package/dist/{shared_pickle_output_latest-DbAgINuf.d.ts → shared_pickle_output_latest-Cwf2EMdH.d.ts} +17 -17
package/dist/index.js
CHANGED
|
@@ -4,14 +4,11 @@ var __export = (target, all) => {
|
|
|
4
4
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
5
5
|
};
|
|
6
6
|
|
|
7
|
-
// src/components/ui/
|
|
8
|
-
import * as
|
|
9
|
-
import {
|
|
7
|
+
// src/components/ui/Checkbox.tsx
|
|
8
|
+
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
9
|
+
import { Check, Minus } from "lucide-react";
|
|
10
10
|
import {
|
|
11
|
-
forwardRef
|
|
12
|
-
useEffect,
|
|
13
|
-
useRef,
|
|
14
|
-
useState
|
|
11
|
+
forwardRef
|
|
15
12
|
} from "react";
|
|
16
13
|
|
|
17
14
|
// src/lib/utils.ts
|
|
@@ -21,273 +18,9 @@ function cn(...inputs) {
|
|
|
21
18
|
return twMerge(clsx(inputs));
|
|
22
19
|
}
|
|
23
20
|
|
|
24
|
-
// src/components/ui/ErrorMessage.tsx
|
|
25
|
-
import { jsx } from "react/jsx-runtime";
|
|
26
|
-
function ErrorMessage({ message, className, ...props }) {
|
|
27
|
-
if (!message) return null;
|
|
28
|
-
return /* @__PURE__ */ jsx("p", { className: cn("px-1 text-xs text-red-600", className), ...props, children: message });
|
|
29
|
-
}
|
|
30
|
-
var ErrorMessage_default = ErrorMessage;
|
|
31
|
-
|
|
32
|
-
// src/components/primitives/tooltip.tsx
|
|
33
|
-
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
34
|
-
import * as React from "react";
|
|
35
|
-
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
36
|
-
var TooltipProvider = TooltipPrimitive.Provider;
|
|
37
|
-
var Tooltip = TooltipPrimitive.Root;
|
|
38
|
-
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
39
|
-
var TooltipContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx2(
|
|
40
|
-
TooltipPrimitive.Content,
|
|
41
|
-
{
|
|
42
|
-
ref,
|
|
43
|
-
sideOffset,
|
|
44
|
-
className: cn(
|
|
45
|
-
"z-50 overflow-hidden rounded-md border border-neutral-200 bg-white px-3 py-1.5 text-sm text-neutral-950 shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-50",
|
|
46
|
-
className
|
|
47
|
-
),
|
|
48
|
-
...props
|
|
49
|
-
}
|
|
50
|
-
));
|
|
51
|
-
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
52
|
-
|
|
53
|
-
// src/components/ui/Label.tsx
|
|
54
|
-
import { InfoIcon } from "lucide-react";
|
|
55
|
-
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
56
|
-
function Label({ text, required, description, className, ...props }) {
|
|
57
|
-
if (!text) return null;
|
|
58
|
-
return /* @__PURE__ */ jsxs("div", { className: "flex w-full flex-row gap-1", children: [
|
|
59
|
-
/* @__PURE__ */ jsxs(
|
|
60
|
-
"label",
|
|
61
|
-
{
|
|
62
|
-
className: cn(
|
|
63
|
-
"text-xs text-grey-80 peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
64
|
-
className
|
|
65
|
-
),
|
|
66
|
-
...props,
|
|
67
|
-
children: [
|
|
68
|
-
text,
|
|
69
|
-
required && /* @__PURE__ */ jsx3("span", { className: "text-red-600", children: "\xA0*" })
|
|
70
|
-
]
|
|
71
|
-
}
|
|
72
|
-
),
|
|
73
|
-
!!description && /* @__PURE__ */ jsx3(TooltipProvider, { children: /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
74
|
-
/* @__PURE__ */ jsx3(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx3(InfoIcon, { className: "h-4 w-4" }) }),
|
|
75
|
-
/* @__PURE__ */ jsx3(TooltipContent, { className: "max-w-48", children: description })
|
|
76
|
-
] }) })
|
|
77
|
-
] });
|
|
78
|
-
}
|
|
79
|
-
var Label_default = Label;
|
|
80
|
-
|
|
81
|
-
// src/components/ui/Chip.tsx
|
|
82
|
-
import { cva } from "cva";
|
|
83
|
-
import { twMerge as twMerge2 } from "tailwind-merge";
|
|
84
|
-
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
85
|
-
var Chip = ({ className, variant, size, ...props }) => /* @__PURE__ */ jsx4("div", { className: twMerge2(chipVariants({ variant, size, className })), ...props });
|
|
86
|
-
var chipVariants = cva(["flex", "items-center", "rounded-3xl", "border", "w-fit"], {
|
|
87
|
-
variants: {
|
|
88
|
-
variant: {
|
|
89
|
-
neutral: ["text-grey-80", "border-grey-10"],
|
|
90
|
-
primary: ["text-purple-100", "border-purple-20"],
|
|
91
|
-
danger: ["text-pumpkin-100", "border-pumpkin-20"],
|
|
92
|
-
onboarding: ["text-green-100", "bg-green-10", "cursor-pointer"],
|
|
93
|
-
onboardingSelected: ["text-white", "bg-green-90", "cursor-pointer"]
|
|
94
|
-
},
|
|
95
|
-
size: {
|
|
96
|
-
small: ["text-sm", "leading-5", "px-2", "py-1", "gap-1.5"],
|
|
97
|
-
medium: ["text-base", "leading-6", "px-3", "py-2", "gap-2"]
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
defaultVariants: {
|
|
101
|
-
variant: "neutral",
|
|
102
|
-
size: "medium"
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
var Chip_default = Chip;
|
|
106
|
-
|
|
107
|
-
// src/components/primitives/separator.tsx
|
|
108
|
-
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
109
|
-
import * as React2 from "react";
|
|
110
|
-
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
111
|
-
var Separator = React2.forwardRef(({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ jsx5(
|
|
112
|
-
SeparatorPrimitive.Root,
|
|
113
|
-
{
|
|
114
|
-
ref,
|
|
115
|
-
decorative,
|
|
116
|
-
orientation,
|
|
117
|
-
className: cn(
|
|
118
|
-
"shrink-0 bg-grey-10",
|
|
119
|
-
orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
|
|
120
|
-
className
|
|
121
|
-
),
|
|
122
|
-
...props
|
|
123
|
-
}
|
|
124
|
-
));
|
|
125
|
-
Separator.displayName = SeparatorPrimitive.Root.displayName;
|
|
126
|
-
|
|
127
|
-
// src/components/ui/Select.tsx
|
|
128
|
-
import { jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
129
|
-
var Select = forwardRef3(
|
|
130
|
-
({ label, options, placeholder, multiselect, description, classNames, error, id, ...props }, ref) => {
|
|
131
|
-
const { value, defaultValue, dir, className, onChange, ...rest } = props;
|
|
132
|
-
const [selected, setSelected] = useState([]);
|
|
133
|
-
const [open, setOpen] = useState(false);
|
|
134
|
-
const containerRef = useRef(null);
|
|
135
|
-
useEffect(() => {
|
|
136
|
-
if (!value) return setSelected([]);
|
|
137
|
-
setSelected(Array.isArray(value) ? value : [value]);
|
|
138
|
-
}, [value]);
|
|
139
|
-
const toggleOpen = () => setOpen((prev) => !prev);
|
|
140
|
-
const closeOnEscape = (event) => event.key === "Escape" && setOpen(false);
|
|
141
|
-
const setValueOnEnter = (event, value2) => event.key === "Enter" && handleChange(value2);
|
|
142
|
-
const chipLabels = selected?.map((s) => options?.find(({ value: value2 }) => value2 === s)).filter(Boolean);
|
|
143
|
-
function handleLabels() {
|
|
144
|
-
if (multiselect) {
|
|
145
|
-
return selected.map((o) => options?.find((option) => option.value === o)?.title).join(", ");
|
|
146
|
-
}
|
|
147
|
-
return options?.find((option) => option.value === selected.join())?.title;
|
|
148
|
-
}
|
|
149
|
-
function handleOnOpenChange(isOpen) {
|
|
150
|
-
if (!multiselect || isOpen) setOpen(isOpen);
|
|
151
|
-
}
|
|
152
|
-
function handleChange(newValue) {
|
|
153
|
-
let newSelected = [];
|
|
154
|
-
setSelected((prev) => {
|
|
155
|
-
newSelected = prev.includes(newValue) ? prev.filter((item) => item !== newValue) : [...prev, newValue];
|
|
156
|
-
return multiselect ? newSelected : [newValue];
|
|
157
|
-
});
|
|
158
|
-
onChange?.(multiselect ? newSelected : newValue);
|
|
159
|
-
}
|
|
160
|
-
return /* @__PURE__ */ jsxs2(
|
|
161
|
-
"div",
|
|
162
|
-
{
|
|
163
|
-
className: cn("flex w-full flex-col gap-1", className),
|
|
164
|
-
ref: containerRef,
|
|
165
|
-
"data-testid": `${(label ?? id)?.toLowerCase()}-select-element`,
|
|
166
|
-
children: [
|
|
167
|
-
/* @__PURE__ */ jsx6(
|
|
168
|
-
Label_default,
|
|
169
|
-
{
|
|
170
|
-
text: label,
|
|
171
|
-
htmlFor: props.name,
|
|
172
|
-
required: props.required,
|
|
173
|
-
description,
|
|
174
|
-
className: classNames?.label
|
|
175
|
-
}
|
|
176
|
-
),
|
|
177
|
-
/* @__PURE__ */ jsxs2(
|
|
178
|
-
SelectPrimitive.Root,
|
|
179
|
-
{
|
|
180
|
-
open,
|
|
181
|
-
value: selected.join(","),
|
|
182
|
-
onOpenChange: handleOnOpenChange,
|
|
183
|
-
onValueChange: multiselect ? void 0 : handleChange,
|
|
184
|
-
defaultValue: typeof defaultValue === "string" ? defaultValue : void 0,
|
|
185
|
-
dir: dir === "rtl" ? "rtl" : "ltr",
|
|
186
|
-
...rest,
|
|
187
|
-
children: [
|
|
188
|
-
/* @__PURE__ */ jsxs2(
|
|
189
|
-
SelectPrimitive.Trigger,
|
|
190
|
-
{
|
|
191
|
-
ref,
|
|
192
|
-
className: cn(
|
|
193
|
-
"group flex h-11 w-full flex-row items-center justify-between gap-3 rounded-lg border px-4 py-3 text-sm font-normal focus:outline-purple-100 disabled:bg-grey-5 data-[placeholder]:text-grey-50 data-[placeholder]:disabled:text-grey-40",
|
|
194
|
-
classNames?.trigger
|
|
195
|
-
),
|
|
196
|
-
children: [
|
|
197
|
-
/* @__PURE__ */ jsx6("span", { className: "truncate", children: /* @__PURE__ */ jsx6(
|
|
198
|
-
SelectPrimitive.Value,
|
|
199
|
-
{
|
|
200
|
-
placeholder: placeholder ?? "Select an option",
|
|
201
|
-
"aria-label": handleLabels(),
|
|
202
|
-
children: handleLabels()
|
|
203
|
-
}
|
|
204
|
-
) }),
|
|
205
|
-
/* @__PURE__ */ jsx6(
|
|
206
|
-
ChevronDownIcon,
|
|
207
|
-
{
|
|
208
|
-
className: "transform text-black group-data-[state=open]:rotate-180",
|
|
209
|
-
size: "16"
|
|
210
|
-
}
|
|
211
|
-
)
|
|
212
|
-
]
|
|
213
|
-
}
|
|
214
|
-
),
|
|
215
|
-
/* @__PURE__ */ jsx6(SelectPrimitive.Portal, { container: containerRef.current, children: /* @__PURE__ */ jsx6(
|
|
216
|
-
SelectPrimitive.Content,
|
|
217
|
-
{
|
|
218
|
-
hideWhenDetached: true,
|
|
219
|
-
className: "z-10 max-h-[var(--radix-select-content-available-height)] w-[var(--radix-select-trigger-width)] overflow-hidden rounded-md bg-white py-2 shadow-lg",
|
|
220
|
-
position: "popper",
|
|
221
|
-
sideOffset: 4,
|
|
222
|
-
onPointerDownOutside: toggleOpen,
|
|
223
|
-
onKeyDown: closeOnEscape,
|
|
224
|
-
children: /* @__PURE__ */ jsxs2(SelectPrimitive.Viewport, { children: [
|
|
225
|
-
multiselect && !!chipLabels?.length && /* @__PURE__ */ jsx6(
|
|
226
|
-
SelectPrimitive.Group,
|
|
227
|
-
{
|
|
228
|
-
className: "mb-2 flex flex-row flex-wrap gap-1 px-2",
|
|
229
|
-
"data-testid": "selected-labels",
|
|
230
|
-
children: chipLabels?.map(
|
|
231
|
-
(chip) => chip && /* @__PURE__ */ jsxs2(Chip_default, { size: "small", variant: "primary", children: [
|
|
232
|
-
/* @__PURE__ */ jsx6("span", { children: chip.title }),
|
|
233
|
-
/* @__PURE__ */ jsx6(
|
|
234
|
-
X,
|
|
235
|
-
{
|
|
236
|
-
size: 18,
|
|
237
|
-
"data-testid": `chip-remove-${chip.value}`,
|
|
238
|
-
className: "cursor-pointer",
|
|
239
|
-
onClick: () => handleChange(chip.value)
|
|
240
|
-
}
|
|
241
|
-
)
|
|
242
|
-
] }, chip.title)
|
|
243
|
-
)
|
|
244
|
-
}
|
|
245
|
-
),
|
|
246
|
-
/* @__PURE__ */ jsx6(Separator, {}),
|
|
247
|
-
options?.map(({ id: id2, title, value: value2 }) => /* @__PURE__ */ jsxs2(
|
|
248
|
-
SelectPrimitive.Item,
|
|
249
|
-
{
|
|
250
|
-
value: value2,
|
|
251
|
-
className: "group relative cursor-pointer px-4 py-2 text-left text-sm hover:bg-purple-50 focus:bg-purple-50 focus:outline-none data-[state=checked]:bg-purple-50 data-[state=checked]:pr-10 data-[state=checked]:text-purple-100",
|
|
252
|
-
"data-state": selected.includes(value2) ? "checked" : "unchecked",
|
|
253
|
-
onKeyDown: (e) => setValueOnEnter(e, value2),
|
|
254
|
-
onClick: () => handleChange(value2),
|
|
255
|
-
children: [
|
|
256
|
-
/* @__PURE__ */ jsx6(SelectPrimitive.ItemText, { children: title }),
|
|
257
|
-
/* @__PURE__ */ jsx6(
|
|
258
|
-
CheckIcon,
|
|
259
|
-
{
|
|
260
|
-
className: "absolute inset-y-0 right-3 my-auto hidden w-6 text-purple-100 group-data-[state=checked]:block",
|
|
261
|
-
size: 16
|
|
262
|
-
}
|
|
263
|
-
)
|
|
264
|
-
]
|
|
265
|
-
},
|
|
266
|
-
id2
|
|
267
|
-
))
|
|
268
|
-
] })
|
|
269
|
-
}
|
|
270
|
-
) })
|
|
271
|
-
]
|
|
272
|
-
}
|
|
273
|
-
),
|
|
274
|
-
/* @__PURE__ */ jsx6(ErrorMessage_default, { message: error })
|
|
275
|
-
]
|
|
276
|
-
}
|
|
277
|
-
);
|
|
278
|
-
}
|
|
279
|
-
);
|
|
280
|
-
Select.displayName = "Select";
|
|
281
|
-
var Select_default = Select;
|
|
282
|
-
|
|
283
21
|
// src/components/ui/Checkbox.tsx
|
|
284
|
-
import
|
|
285
|
-
|
|
286
|
-
import {
|
|
287
|
-
forwardRef as forwardRef4
|
|
288
|
-
} from "react";
|
|
289
|
-
import { jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
290
|
-
var CheckboxToggle = forwardRef4(({ className, ...props }, ref) => /* @__PURE__ */ jsx7(
|
|
22
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
23
|
+
var CheckboxToggle = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
291
24
|
CheckboxPrimitive.Root,
|
|
292
25
|
{
|
|
293
26
|
ref,
|
|
@@ -317,95 +50,131 @@ var CheckboxToggle = forwardRef4(({ className, ...props }, ref) => /* @__PURE__
|
|
|
317
50
|
className
|
|
318
51
|
),
|
|
319
52
|
...props,
|
|
320
|
-
children: /* @__PURE__ */
|
|
321
|
-
/* @__PURE__ */
|
|
322
|
-
/* @__PURE__ */
|
|
53
|
+
children: /* @__PURE__ */ jsxs(CheckboxPrimitive.Indicator, { className: "flex items-center justify-center text-current", children: [
|
|
54
|
+
/* @__PURE__ */ jsx(Check, { className: "hidden h-4 w-4 group-data-[state=checked]:block" }),
|
|
55
|
+
/* @__PURE__ */ jsx(Minus, { className: "hidden h-4 w-4 group-data-[state=indeterminate]:block" })
|
|
323
56
|
] })
|
|
324
57
|
}
|
|
325
58
|
));
|
|
326
59
|
CheckboxToggle.displayName = CheckboxPrimitive.Root.displayName;
|
|
327
|
-
var Checkbox =
|
|
60
|
+
var Checkbox = forwardRef(
|
|
328
61
|
({ classNames, children, ...props }, ref) => {
|
|
329
62
|
const { disabled } = props;
|
|
330
63
|
const id = props.id ?? `${props.name ?? props.value?.toString()}-checkbox`;
|
|
331
64
|
const labelClassName = disabled ? "text-grey-40 pointer-events-none" : "";
|
|
332
|
-
return /* @__PURE__ */
|
|
333
|
-
/* @__PURE__ */
|
|
334
|
-
/* @__PURE__ */
|
|
65
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex space-x-2", classNames?.wrapper), children: [
|
|
66
|
+
/* @__PURE__ */ jsx(CheckboxToggle, { id, disabled, ref, ...props }),
|
|
67
|
+
/* @__PURE__ */ jsx("label", { htmlFor: id, className: cn(labelClassName, classNames?.label), children })
|
|
335
68
|
] });
|
|
336
69
|
}
|
|
337
70
|
);
|
|
338
71
|
Checkbox.displayName = "Checkbox";
|
|
339
72
|
var Checkbox_default = Checkbox;
|
|
340
73
|
|
|
341
|
-
// src/components/ui/
|
|
342
|
-
import {
|
|
343
|
-
import {
|
|
344
|
-
import { jsx as
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
return /* @__PURE__ */ jsx8(IconComponent, { size: 14 });
|
|
359
|
-
}
|
|
360
|
-
return null;
|
|
361
|
-
};
|
|
362
|
-
const optionIcon = icon ? getIconIfValid(icon) : void 0;
|
|
363
|
-
return /* @__PURE__ */ jsxs4(
|
|
364
|
-
"li",
|
|
365
|
-
{
|
|
366
|
-
className: cn(
|
|
367
|
-
"group relative flex w-72 cursor-pointer flex-row items-center text-left text-sm",
|
|
368
|
-
className
|
|
369
|
-
),
|
|
370
|
-
...props,
|
|
371
|
-
"data-state": isSelected ? "checked" : "unchecked",
|
|
372
|
-
children: [
|
|
373
|
-
optionIcon && /* @__PURE__ */ jsx8("span", { className: "mr-2", children: optionIcon }),
|
|
374
|
-
hasCheckbox && /* @__PURE__ */ jsx8(Checkbox_default, { id: value, checked: isSelected, onClick: (e) => e.preventDefault() }),
|
|
375
|
-
/* @__PURE__ */ jsxs4("div", { children: [
|
|
376
|
-
/* @__PURE__ */ jsx8("p", { children: title }),
|
|
377
|
-
/* @__PURE__ */ jsx8("p", { className: "text-xs text-grey-80", children: description })
|
|
378
|
-
] }),
|
|
379
|
-
/* @__PURE__ */ jsx8(
|
|
380
|
-
CheckIcon2,
|
|
381
|
-
{
|
|
382
|
-
className: "absolute inset-y-0 right-0 my-auto hidden w-6 text-green-100 group-data-[state=checked]:block",
|
|
383
|
-
size: 16
|
|
384
|
-
}
|
|
385
|
-
)
|
|
386
|
-
]
|
|
74
|
+
// src/components/ui/Chip.tsx
|
|
75
|
+
import { cva } from "cva";
|
|
76
|
+
import { twMerge as twMerge2 } from "tailwind-merge";
|
|
77
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
78
|
+
var Chip = ({ className, variant, size, ...props }) => /* @__PURE__ */ jsx2("div", { className: twMerge2(chipVariants({ variant, size, className })), ...props });
|
|
79
|
+
var chipVariants = cva(["flex", "items-center", "rounded-3xl", "border", "w-fit"], {
|
|
80
|
+
variants: {
|
|
81
|
+
variant: {
|
|
82
|
+
neutral: ["text-grey-80", "border-grey-10"],
|
|
83
|
+
primary: ["text-purple-100", "border-purple-20"],
|
|
84
|
+
danger: ["text-pumpkin-100", "border-pumpkin-20"],
|
|
85
|
+
onboarding: ["text-green-100", "bg-green-10", "cursor-pointer"],
|
|
86
|
+
onboardingSelected: ["text-white", "bg-green-90", "cursor-pointer"]
|
|
87
|
+
},
|
|
88
|
+
size: {
|
|
89
|
+
small: ["text-sm", "leading-5", "px-2", "py-1", "gap-1.5"],
|
|
90
|
+
medium: ["text-base", "leading-6", "px-3", "py-2", "gap-2"]
|
|
387
91
|
}
|
|
388
|
-
|
|
92
|
+
},
|
|
93
|
+
defaultVariants: {
|
|
94
|
+
variant: "neutral",
|
|
95
|
+
size: "medium"
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
var Chip_default = Chip;
|
|
99
|
+
|
|
100
|
+
// src/components/ui/Input.tsx
|
|
101
|
+
import { cva as cva2 } from "cva";
|
|
102
|
+
import { icons, X } from "lucide-react";
|
|
103
|
+
import { forwardRef as forwardRef3 } from "react";
|
|
104
|
+
|
|
105
|
+
// src/components/ui/ErrorMessage.tsx
|
|
106
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
107
|
+
function ErrorMessage({ message, className, ...props }) {
|
|
108
|
+
if (!message) return null;
|
|
109
|
+
return /* @__PURE__ */ jsx3("p", { className: cn("px-1 text-xs text-red-600", className), ...props, children: message });
|
|
110
|
+
}
|
|
111
|
+
var ErrorMessage_default = ErrorMessage;
|
|
112
|
+
|
|
113
|
+
// src/components/ui/Label.tsx
|
|
114
|
+
import { InfoIcon } from "lucide-react";
|
|
115
|
+
|
|
116
|
+
// src/components/primitives/tooltip.tsx
|
|
117
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
118
|
+
import * as React from "react";
|
|
119
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
120
|
+
var TooltipProvider = TooltipPrimitive.Provider;
|
|
121
|
+
var Tooltip = TooltipPrimitive.Root;
|
|
122
|
+
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
123
|
+
var TooltipContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx4(
|
|
124
|
+
TooltipPrimitive.Content,
|
|
125
|
+
{
|
|
126
|
+
ref,
|
|
127
|
+
sideOffset,
|
|
128
|
+
className: cn(
|
|
129
|
+
"z-50 overflow-hidden rounded-md border border-neutral-200 bg-white px-3 py-1.5 text-sm text-neutral-950 shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-50",
|
|
130
|
+
className
|
|
131
|
+
),
|
|
132
|
+
...props
|
|
133
|
+
}
|
|
134
|
+
));
|
|
135
|
+
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
136
|
+
|
|
137
|
+
// src/components/ui/Label.tsx
|
|
138
|
+
import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
139
|
+
function Label({ text, required, description, className, ...props }) {
|
|
140
|
+
if (!text) return null;
|
|
141
|
+
return /* @__PURE__ */ jsxs2("div", { className: "flex w-full flex-row gap-1", children: [
|
|
142
|
+
/* @__PURE__ */ jsxs2(
|
|
143
|
+
"label",
|
|
144
|
+
{
|
|
145
|
+
className: cn(
|
|
146
|
+
"text-xs text-grey-80 peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
147
|
+
className
|
|
148
|
+
),
|
|
149
|
+
...props,
|
|
150
|
+
children: [
|
|
151
|
+
text,
|
|
152
|
+
required && /* @__PURE__ */ jsx5("span", { className: "text-red-600", children: "\xA0*" })
|
|
153
|
+
]
|
|
154
|
+
}
|
|
155
|
+
),
|
|
156
|
+
!!description && /* @__PURE__ */ jsx5(TooltipProvider, { children: /* @__PURE__ */ jsxs2(Tooltip, { children: [
|
|
157
|
+
/* @__PURE__ */ jsx5(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx5(InfoIcon, { className: "h-4 w-4" }) }),
|
|
158
|
+
/* @__PURE__ */ jsx5(TooltipContent, { className: "max-w-48", children: description })
|
|
159
|
+
] }) })
|
|
160
|
+
] });
|
|
389
161
|
}
|
|
390
|
-
var
|
|
162
|
+
var Label_default = Label;
|
|
391
163
|
|
|
392
164
|
// src/components/ui/Input.tsx
|
|
393
|
-
import {
|
|
394
|
-
|
|
395
|
-
import { forwardRef as forwardRef5 } from "react";
|
|
396
|
-
import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
397
|
-
var Input = forwardRef5(
|
|
165
|
+
import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
166
|
+
var Input = forwardRef3(
|
|
398
167
|
({ label, error, description, theme, icon, onClear, value, onChange, classNames, ...props }, ref) => {
|
|
399
168
|
const handleClear = () => {
|
|
400
169
|
onChange?.({ target: { value: "" } });
|
|
401
170
|
onClear?.();
|
|
402
171
|
};
|
|
403
|
-
const IconComponent = icon &&
|
|
172
|
+
const IconComponent = icon && icons[icon];
|
|
404
173
|
const placeholder = props.placeholder ?? (icon === "Search" ? "Search..." : "");
|
|
405
174
|
const hasIcon = !!icon;
|
|
406
175
|
const iconColor = theme === "dark" ? "text-white" : "text-grey-80";
|
|
407
|
-
return /* @__PURE__ */
|
|
408
|
-
label && /* @__PURE__ */
|
|
176
|
+
return /* @__PURE__ */ jsxs3("div", { className: "group flex w-full flex-col gap-1", "data-testid": `input-wrapper-${props.id}`, children: [
|
|
177
|
+
label && /* @__PURE__ */ jsx6(
|
|
409
178
|
Label_default,
|
|
410
179
|
{
|
|
411
180
|
text: label,
|
|
@@ -415,14 +184,14 @@ var Input = forwardRef5(
|
|
|
415
184
|
className: classNames?.label
|
|
416
185
|
}
|
|
417
186
|
),
|
|
418
|
-
/* @__PURE__ */
|
|
419
|
-
IconComponent && /* @__PURE__ */
|
|
187
|
+
/* @__PURE__ */ jsxs3("div", { className: "relative flex flex-row items-center", children: [
|
|
188
|
+
IconComponent && /* @__PURE__ */ jsx6(
|
|
420
189
|
IconComponent,
|
|
421
190
|
{
|
|
422
191
|
className: `absolute left-3 h-4 w-4 ${iconColor} opacity-50 group-hover:opacity-100`
|
|
423
192
|
}
|
|
424
193
|
),
|
|
425
|
-
/* @__PURE__ */
|
|
194
|
+
/* @__PURE__ */ jsx6(
|
|
426
195
|
"input",
|
|
427
196
|
{
|
|
428
197
|
className: cn(inputVariants({ theme, hasIcon })),
|
|
@@ -434,8 +203,8 @@ var Input = forwardRef5(
|
|
|
434
203
|
...props
|
|
435
204
|
}
|
|
436
205
|
),
|
|
437
|
-
hasIcon && value && /* @__PURE__ */
|
|
438
|
-
|
|
206
|
+
hasIcon && value && /* @__PURE__ */ jsx6(
|
|
207
|
+
X,
|
|
439
208
|
{
|
|
440
209
|
className: `absolute right-3 h-4 w-4 cursor-pointer ${iconColor}`,
|
|
441
210
|
onClick: handleClear,
|
|
@@ -443,7 +212,7 @@ var Input = forwardRef5(
|
|
|
443
212
|
}
|
|
444
213
|
)
|
|
445
214
|
] }),
|
|
446
|
-
/* @__PURE__ */
|
|
215
|
+
/* @__PURE__ */ jsx6(ErrorMessage_default, { message: error })
|
|
447
216
|
] });
|
|
448
217
|
}
|
|
449
218
|
);
|
|
@@ -498,9 +267,60 @@ var inputVariants = cva2(
|
|
|
498
267
|
);
|
|
499
268
|
var Input_default = Input;
|
|
500
269
|
|
|
270
|
+
// src/components/ui/ListItem.tsx
|
|
271
|
+
import { CheckIcon } from "lucide-react";
|
|
272
|
+
import { icons as icons2 } from "lucide-react";
|
|
273
|
+
import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
274
|
+
function ListItem({
|
|
275
|
+
icon,
|
|
276
|
+
hasCheckbox,
|
|
277
|
+
isSelected,
|
|
278
|
+
className,
|
|
279
|
+
title,
|
|
280
|
+
value,
|
|
281
|
+
description,
|
|
282
|
+
...props
|
|
283
|
+
}) {
|
|
284
|
+
const getIconIfValid = (icon2) => {
|
|
285
|
+
if (icon2 in icons2) {
|
|
286
|
+
const IconComponent = icons2[icon2];
|
|
287
|
+
return /* @__PURE__ */ jsx7(IconComponent, { size: 14 });
|
|
288
|
+
}
|
|
289
|
+
return null;
|
|
290
|
+
};
|
|
291
|
+
const optionIcon = icon ? getIconIfValid(icon) : void 0;
|
|
292
|
+
return /* @__PURE__ */ jsxs4(
|
|
293
|
+
"li",
|
|
294
|
+
{
|
|
295
|
+
className: cn(
|
|
296
|
+
"group relative flex w-72 cursor-pointer flex-row items-center text-left text-sm",
|
|
297
|
+
className
|
|
298
|
+
),
|
|
299
|
+
...props,
|
|
300
|
+
"data-state": isSelected ? "checked" : "unchecked",
|
|
301
|
+
children: [
|
|
302
|
+
optionIcon && /* @__PURE__ */ jsx7("span", { className: "mr-2", children: optionIcon }),
|
|
303
|
+
hasCheckbox && /* @__PURE__ */ jsx7(Checkbox_default, { id: value, checked: isSelected, onClick: (e) => e.preventDefault() }),
|
|
304
|
+
/* @__PURE__ */ jsxs4("div", { children: [
|
|
305
|
+
/* @__PURE__ */ jsx7("p", { children: title }),
|
|
306
|
+
/* @__PURE__ */ jsx7("p", { className: "text-xs text-grey-80", children: description })
|
|
307
|
+
] }),
|
|
308
|
+
/* @__PURE__ */ jsx7(
|
|
309
|
+
CheckIcon,
|
|
310
|
+
{
|
|
311
|
+
className: "absolute inset-y-0 right-0 my-auto hidden w-6 text-green-100 group-data-[state=checked]:block",
|
|
312
|
+
size: 16
|
|
313
|
+
}
|
|
314
|
+
)
|
|
315
|
+
]
|
|
316
|
+
}
|
|
317
|
+
);
|
|
318
|
+
}
|
|
319
|
+
var ListItem_default = ListItem;
|
|
320
|
+
|
|
501
321
|
// src/components/ui/MapComponent.tsx
|
|
502
|
-
import { APIProvider, Map,
|
|
503
|
-
import { jsx as
|
|
322
|
+
import { AdvancedMarker, APIProvider, Map, Pin } from "@vis.gl/react-google-maps";
|
|
323
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
504
324
|
function MapComponent({
|
|
505
325
|
apiKey,
|
|
506
326
|
mapId,
|
|
@@ -510,7 +330,7 @@ function MapComponent({
|
|
|
510
330
|
}) {
|
|
511
331
|
const defaultPosition = { lat: 40.715021, lng: -74.00459 };
|
|
512
332
|
const defaultZoom = 11;
|
|
513
|
-
return /* @__PURE__ */
|
|
333
|
+
return /* @__PURE__ */ jsx8(APIProvider, { apiKey, children: /* @__PURE__ */ jsx8("div", { className: cn("h-screen max-w-full", className), children: /* @__PURE__ */ jsx8(
|
|
514
334
|
Map,
|
|
515
335
|
{
|
|
516
336
|
defaultZoom: position ? zoom : defaultZoom,
|
|
@@ -519,24 +339,28 @@ function MapComponent({
|
|
|
519
339
|
keyboardShortcuts: false,
|
|
520
340
|
disableDefaultUI: true,
|
|
521
341
|
zoomControl: true,
|
|
522
|
-
children: position && /* @__PURE__ */
|
|
342
|
+
children: position && /* @__PURE__ */ jsx8(AdvancedMarker, { position, children: /* @__PURE__ */ jsx8(Pin, { background: "#0B5441", borderColor: "#EBFDF1", glyphColor: "#D4F500" }) })
|
|
523
343
|
}
|
|
524
344
|
) }) });
|
|
525
345
|
}
|
|
526
346
|
var MapComponent_default = MapComponent;
|
|
527
347
|
|
|
348
|
+
// src/components/ui/PlacesQueryInput.tsx
|
|
349
|
+
import { CircleX, LoaderCircle } from "lucide-react";
|
|
350
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
351
|
+
|
|
528
352
|
// src/components/primitives/command.tsx
|
|
529
353
|
import { Command as CommandPrimitive } from "cmdk";
|
|
530
354
|
import { Search } from "lucide-react";
|
|
531
|
-
import * as
|
|
355
|
+
import * as React3 from "react";
|
|
532
356
|
|
|
533
357
|
// src/components/primitives/dialog.tsx
|
|
534
358
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
535
|
-
import { X as
|
|
536
|
-
import * as
|
|
537
|
-
import { jsx as
|
|
359
|
+
import { X as X2 } from "lucide-react";
|
|
360
|
+
import * as React2 from "react";
|
|
361
|
+
import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
538
362
|
var DialogPortal = DialogPrimitive.Portal;
|
|
539
|
-
var DialogOverlay =
|
|
363
|
+
var DialogOverlay = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
540
364
|
DialogPrimitive.Overlay,
|
|
541
365
|
{
|
|
542
366
|
ref,
|
|
@@ -548,31 +372,31 @@ var DialogOverlay = React3.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
548
372
|
}
|
|
549
373
|
));
|
|
550
374
|
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
551
|
-
var DialogContent =
|
|
552
|
-
/* @__PURE__ */
|
|
553
|
-
/* @__PURE__ */
|
|
375
|
+
var DialogContent = React2.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs5(DialogPortal, { children: [
|
|
376
|
+
/* @__PURE__ */ jsx9(DialogOverlay, {}),
|
|
377
|
+
/* @__PURE__ */ jsxs5(
|
|
554
378
|
DialogPrimitive.Content,
|
|
555
379
|
{
|
|
556
380
|
ref,
|
|
557
381
|
className: cn(
|
|
558
|
-
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-neutral-200 bg-white p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]
|
|
382
|
+
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-neutral-200 bg-white p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] dark:border-neutral-800 dark:bg-neutral-950 sm:rounded-lg",
|
|
559
383
|
className
|
|
560
384
|
),
|
|
561
385
|
...props,
|
|
562
386
|
children: [
|
|
563
387
|
children,
|
|
564
|
-
/* @__PURE__ */
|
|
565
|
-
/* @__PURE__ */
|
|
566
|
-
/* @__PURE__ */
|
|
388
|
+
/* @__PURE__ */ jsxs5(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-white transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-neutral-950 focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-neutral-100 data-[state=open]:text-neutral-500 dark:ring-offset-neutral-950 dark:focus:ring-neutral-300 dark:data-[state=open]:bg-neutral-800 dark:data-[state=open]:text-neutral-400", children: [
|
|
389
|
+
/* @__PURE__ */ jsx9(X2, { className: "h-4 w-4" }),
|
|
390
|
+
/* @__PURE__ */ jsx9("span", { className: "sr-only", children: "Close" })
|
|
567
391
|
] })
|
|
568
392
|
]
|
|
569
393
|
}
|
|
570
394
|
)
|
|
571
395
|
] }));
|
|
572
396
|
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
573
|
-
var DialogHeader = ({ className, ...props }) => /* @__PURE__ */
|
|
397
|
+
var DialogHeader = ({ className, ...props }) => /* @__PURE__ */ jsx9("div", { className: cn("flex flex-col space-y-1.5 text-center sm:text-left", className), ...props });
|
|
574
398
|
DialogHeader.displayName = "DialogHeader";
|
|
575
|
-
var DialogFooter = ({ className, ...props }) => /* @__PURE__ */
|
|
399
|
+
var DialogFooter = ({ className, ...props }) => /* @__PURE__ */ jsx9(
|
|
576
400
|
"div",
|
|
577
401
|
{
|
|
578
402
|
className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className),
|
|
@@ -580,7 +404,7 @@ var DialogFooter = ({ className, ...props }) => /* @__PURE__ */ jsx11(
|
|
|
580
404
|
}
|
|
581
405
|
);
|
|
582
406
|
DialogFooter.displayName = "DialogFooter";
|
|
583
|
-
var DialogTitle =
|
|
407
|
+
var DialogTitle = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
584
408
|
DialogPrimitive.Title,
|
|
585
409
|
{
|
|
586
410
|
ref,
|
|
@@ -589,7 +413,7 @@ var DialogTitle = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
589
413
|
}
|
|
590
414
|
));
|
|
591
415
|
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
592
|
-
var DialogDescription =
|
|
416
|
+
var DialogDescription = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
593
417
|
DialogPrimitive.Description,
|
|
594
418
|
{
|
|
595
419
|
ref,
|
|
@@ -600,8 +424,8 @@ var DialogDescription = React3.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
600
424
|
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
601
425
|
|
|
602
426
|
// src/components/primitives/command.tsx
|
|
603
|
-
import { jsx as
|
|
604
|
-
var Command =
|
|
427
|
+
import { jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
428
|
+
var Command = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx10(
|
|
605
429
|
CommandPrimitive,
|
|
606
430
|
{
|
|
607
431
|
ref,
|
|
@@ -613,9 +437,9 @@ var Command = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
613
437
|
}
|
|
614
438
|
));
|
|
615
439
|
Command.displayName = CommandPrimitive.displayName;
|
|
616
|
-
var CommandInput =
|
|
617
|
-
/* @__PURE__ */
|
|
618
|
-
/* @__PURE__ */
|
|
440
|
+
var CommandInput = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs6("div", { className: "m-1 flex items-center rounded-xl border px-3", "cmdk-input-wrapper": "", children: [
|
|
441
|
+
/* @__PURE__ */ jsx10(Search, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
|
|
442
|
+
/* @__PURE__ */ jsx10(
|
|
619
443
|
CommandPrimitive.Input,
|
|
620
444
|
{
|
|
621
445
|
ref,
|
|
@@ -628,7 +452,7 @@ var CommandInput = React4.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
628
452
|
)
|
|
629
453
|
] }));
|
|
630
454
|
CommandInput.displayName = CommandPrimitive.Input.displayName;
|
|
631
|
-
var CommandList =
|
|
455
|
+
var CommandList = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx10(
|
|
632
456
|
CommandPrimitive.List,
|
|
633
457
|
{
|
|
634
458
|
ref,
|
|
@@ -637,9 +461,9 @@ var CommandList = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
637
461
|
}
|
|
638
462
|
));
|
|
639
463
|
CommandList.displayName = CommandPrimitive.List.displayName;
|
|
640
|
-
var CommandEmpty =
|
|
464
|
+
var CommandEmpty = React3.forwardRef((props, ref) => /* @__PURE__ */ jsx10(CommandPrimitive.Empty, { ref, className: "py-6 text-center text-sm", ...props }));
|
|
641
465
|
CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
|
|
642
|
-
var CommandGroup =
|
|
466
|
+
var CommandGroup = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx10(
|
|
643
467
|
CommandPrimitive.Group,
|
|
644
468
|
{
|
|
645
469
|
ref,
|
|
@@ -651,7 +475,7 @@ var CommandGroup = React4.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
651
475
|
}
|
|
652
476
|
));
|
|
653
477
|
CommandGroup.displayName = CommandPrimitive.Group.displayName;
|
|
654
|
-
var CommandSeparator =
|
|
478
|
+
var CommandSeparator = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx10(
|
|
655
479
|
CommandPrimitive.Separator,
|
|
656
480
|
{
|
|
657
481
|
ref,
|
|
@@ -660,7 +484,7 @@ var CommandSeparator = React4.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
660
484
|
}
|
|
661
485
|
));
|
|
662
486
|
CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
|
|
663
|
-
var CommandItem =
|
|
487
|
+
var CommandItem = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx10(
|
|
664
488
|
CommandPrimitive.Item,
|
|
665
489
|
{
|
|
666
490
|
ref,
|
|
@@ -673,7 +497,7 @@ var CommandItem = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
673
497
|
));
|
|
674
498
|
CommandItem.displayName = CommandPrimitive.Item.displayName;
|
|
675
499
|
var CommandShortcut = ({ className, ...props }) => {
|
|
676
|
-
return /* @__PURE__ */
|
|
500
|
+
return /* @__PURE__ */ jsx10(
|
|
677
501
|
"span",
|
|
678
502
|
{
|
|
679
503
|
className: cn("ml-auto text-xs tracking-widest text-neutral-500", className),
|
|
@@ -734,33 +558,37 @@ var geocode = async (address, key) => {
|
|
|
734
558
|
};
|
|
735
559
|
|
|
736
560
|
// src/components/ui/PlacesQueryInput.tsx
|
|
737
|
-
import {
|
|
738
|
-
import { useState as useState2, useCallback, useRef as useRef2, useEffect as useEffect2 } from "react";
|
|
739
|
-
import { jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
561
|
+
import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
740
562
|
function PlacesQueryInput({
|
|
741
563
|
apiKey,
|
|
742
564
|
selected,
|
|
743
565
|
onSelect,
|
|
744
566
|
className
|
|
745
567
|
}) {
|
|
746
|
-
const [predictions, setPredictions] =
|
|
747
|
-
const [input, setInput] =
|
|
748
|
-
const [isLoadingPredictions, setIsLoadingPredictions] =
|
|
749
|
-
const [shouldOpenUpward, setShouldOpenUpward] =
|
|
750
|
-
const timeoutRef =
|
|
751
|
-
const inputRef =
|
|
568
|
+
const [predictions, setPredictions] = useState(null);
|
|
569
|
+
const [input, setInput] = useState(selected?.description ?? "");
|
|
570
|
+
const [isLoadingPredictions, setIsLoadingPredictions] = useState(false);
|
|
571
|
+
const [shouldOpenUpward, setShouldOpenUpward] = useState(false);
|
|
572
|
+
const timeoutRef = useRef(null);
|
|
573
|
+
const inputRef = useRef(null);
|
|
752
574
|
const debouncedAutocomplete = useCallback((value) => {
|
|
753
575
|
if (timeoutRef.current) {
|
|
754
576
|
clearTimeout(timeoutRef.current);
|
|
755
577
|
}
|
|
756
578
|
timeoutRef.current = setTimeout(async () => {
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
579
|
+
try {
|
|
580
|
+
if (value.length > 2) {
|
|
581
|
+
setIsLoadingPredictions(true);
|
|
582
|
+
const fetchedPredictions = await autocomplete(value, apiKey);
|
|
583
|
+
setIsLoadingPredictions(false);
|
|
584
|
+
setPredictions(fetchedPredictions ?? []);
|
|
585
|
+
} else {
|
|
586
|
+
setPredictions(null);
|
|
587
|
+
}
|
|
588
|
+
} catch (error) {
|
|
589
|
+
setIsLoadingPredictions(false);
|
|
590
|
+
setPredictions([]);
|
|
591
|
+
console.error("Autocomplete error:", error);
|
|
764
592
|
}
|
|
765
593
|
}, 300);
|
|
766
594
|
}, []);
|
|
@@ -779,7 +607,7 @@ function PlacesQueryInput({
|
|
|
779
607
|
setInput("");
|
|
780
608
|
};
|
|
781
609
|
const handleBlur = () => setTimeout(() => setPredictions(null), 200);
|
|
782
|
-
|
|
610
|
+
useEffect(() => {
|
|
783
611
|
const checkDropdownPosition = () => {
|
|
784
612
|
if (inputRef.current) {
|
|
785
613
|
const rect = inputRef.current.getBoundingClientRect();
|
|
@@ -791,9 +619,9 @@ function PlacesQueryInput({
|
|
|
791
619
|
window.addEventListener("resize", checkDropdownPosition);
|
|
792
620
|
return () => window.removeEventListener("resize", checkDropdownPosition);
|
|
793
621
|
}, []);
|
|
794
|
-
return /* @__PURE__ */
|
|
795
|
-
/* @__PURE__ */
|
|
796
|
-
/* @__PURE__ */
|
|
622
|
+
return /* @__PURE__ */ jsx11("div", { className: cn("relative w-full", className), ref: inputRef, onBlur: handleBlur, children: /* @__PURE__ */ jsxs7(Command, { children: [
|
|
623
|
+
/* @__PURE__ */ jsxs7("div", { className: "relative w-full", children: [
|
|
624
|
+
/* @__PURE__ */ jsx11(
|
|
797
625
|
CommandInput,
|
|
798
626
|
{
|
|
799
627
|
placeholder: "Type an address to search...",
|
|
@@ -802,18 +630,18 @@ function PlacesQueryInput({
|
|
|
802
630
|
className: "truncate pr-8"
|
|
803
631
|
}
|
|
804
632
|
),
|
|
805
|
-
isLoadingPredictions && /* @__PURE__ */
|
|
806
|
-
input && /* @__PURE__ */
|
|
633
|
+
isLoadingPredictions && /* @__PURE__ */ jsx11(LoaderCircle, { className: "absolute inset-y-0 right-2 my-auto flex h-8 w-8 animate-spin items-center justify-center rounded-full text-green-100" }),
|
|
634
|
+
input && /* @__PURE__ */ jsx11(
|
|
807
635
|
"button",
|
|
808
636
|
{
|
|
809
637
|
type: "button",
|
|
810
638
|
className: "absolute inset-y-0 right-2 my-auto flex h-8 w-8 cursor-pointer items-center justify-center rounded-full hover:bg-pickle-20",
|
|
811
639
|
onClick: handleClear,
|
|
812
|
-
children: /* @__PURE__ */
|
|
640
|
+
children: /* @__PURE__ */ jsx11(CircleX, { className: "h-4 w-4 text-green-100" })
|
|
813
641
|
}
|
|
814
642
|
)
|
|
815
643
|
] }),
|
|
816
|
-
predictions && /* @__PURE__ */
|
|
644
|
+
predictions && /* @__PURE__ */ jsxs7(
|
|
817
645
|
CommandList,
|
|
818
646
|
{
|
|
819
647
|
className: cn(
|
|
@@ -821,8 +649,8 @@ function PlacesQueryInput({
|
|
|
821
649
|
shouldOpenUpward ? "bottom-full" : "top-full"
|
|
822
650
|
),
|
|
823
651
|
children: [
|
|
824
|
-
/* @__PURE__ */
|
|
825
|
-
/* @__PURE__ */
|
|
652
|
+
/* @__PURE__ */ jsx11(CommandEmpty, { children: "No results" }),
|
|
653
|
+
/* @__PURE__ */ jsx11(CommandGroup, { children: predictions.map((prediction) => /* @__PURE__ */ jsx11(
|
|
826
654
|
CommandItem,
|
|
827
655
|
{
|
|
828
656
|
onSelect: () => handleSelect(prediction),
|
|
@@ -836,17 +664,284 @@ function PlacesQueryInput({
|
|
|
836
664
|
)
|
|
837
665
|
] }) });
|
|
838
666
|
}
|
|
839
|
-
var PlacesQueryInput_default = PlacesQueryInput;
|
|
667
|
+
var PlacesQueryInput_default = PlacesQueryInput;
|
|
668
|
+
|
|
669
|
+
// src/components/ui/Select.tsx
|
|
670
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
671
|
+
import { CheckIcon as CheckIcon2, ChevronDownIcon, X as X3 } from "lucide-react";
|
|
672
|
+
import {
|
|
673
|
+
forwardRef as forwardRef7,
|
|
674
|
+
useEffect as useEffect2,
|
|
675
|
+
useRef as useRef2,
|
|
676
|
+
useState as useState2
|
|
677
|
+
} from "react";
|
|
678
|
+
|
|
679
|
+
// src/components/primitives/separator.tsx
|
|
680
|
+
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
681
|
+
import * as React4 from "react";
|
|
682
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
683
|
+
var Separator = React4.forwardRef(({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ jsx12(
|
|
684
|
+
SeparatorPrimitive.Root,
|
|
685
|
+
{
|
|
686
|
+
ref,
|
|
687
|
+
decorative,
|
|
688
|
+
orientation,
|
|
689
|
+
className: cn(
|
|
690
|
+
"shrink-0 bg-grey-10",
|
|
691
|
+
orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
|
|
692
|
+
className
|
|
693
|
+
),
|
|
694
|
+
...props
|
|
695
|
+
}
|
|
696
|
+
));
|
|
697
|
+
Separator.displayName = SeparatorPrimitive.Root.displayName;
|
|
698
|
+
|
|
699
|
+
// src/components/ui/Select.tsx
|
|
700
|
+
import { jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
701
|
+
var Select = forwardRef7(
|
|
702
|
+
({ label, options, placeholder, multiselect, description, classNames, error, id, ...props }, ref) => {
|
|
703
|
+
const { value, defaultValue, dir, className, onChange, ...rest } = props;
|
|
704
|
+
const [selected, setSelected] = useState2([]);
|
|
705
|
+
const [open, setOpen] = useState2(false);
|
|
706
|
+
const containerRef = useRef2(null);
|
|
707
|
+
useEffect2(() => {
|
|
708
|
+
if (!value) return setSelected([]);
|
|
709
|
+
setSelected(Array.isArray(value) ? value : [value]);
|
|
710
|
+
}, [value]);
|
|
711
|
+
const toggleOpen = () => setOpen((prev) => !prev);
|
|
712
|
+
const closeOnEscape = (event) => event.key === "Escape" && setOpen(false);
|
|
713
|
+
const handleOnOpenChange = (isOpen) => (!multiselect || isOpen) && setOpen(isOpen);
|
|
714
|
+
const setValueOnEnter = (event, value2) => event.key === "Enter" && handleChange(value2);
|
|
715
|
+
const getLabel = () => selected.map((o) => options?.find((option) => option.value === o)?.title).join(", ");
|
|
716
|
+
const chipLabels = selected?.map((s) => options?.find(({ value: value2 }) => value2 === s)).filter(Boolean);
|
|
717
|
+
function handleChange(newValue) {
|
|
718
|
+
if (newValue === "" && !multiselect) return;
|
|
719
|
+
let newSelected = [];
|
|
720
|
+
setSelected((prev) => {
|
|
721
|
+
newSelected = prev.includes(newValue) ? prev.filter((item) => item !== newValue) : [...prev, newValue];
|
|
722
|
+
return multiselect ? newSelected : [newValue];
|
|
723
|
+
});
|
|
724
|
+
onChange?.(multiselect ? newSelected : newValue);
|
|
725
|
+
}
|
|
726
|
+
return /* @__PURE__ */ jsxs8(
|
|
727
|
+
"div",
|
|
728
|
+
{
|
|
729
|
+
className: cn("flex w-full flex-col gap-1", className),
|
|
730
|
+
ref: containerRef,
|
|
731
|
+
"data-testid": `${(label ?? id)?.toLowerCase()}-select-element`,
|
|
732
|
+
children: [
|
|
733
|
+
/* @__PURE__ */ jsx13(
|
|
734
|
+
Label_default,
|
|
735
|
+
{
|
|
736
|
+
text: label,
|
|
737
|
+
htmlFor: props.name,
|
|
738
|
+
required: props.required,
|
|
739
|
+
description,
|
|
740
|
+
className: classNames?.label
|
|
741
|
+
}
|
|
742
|
+
),
|
|
743
|
+
/* @__PURE__ */ jsxs8(
|
|
744
|
+
SelectPrimitive.Root,
|
|
745
|
+
{
|
|
746
|
+
open,
|
|
747
|
+
value: selected.join(","),
|
|
748
|
+
onOpenChange: handleOnOpenChange,
|
|
749
|
+
onValueChange: multiselect ? void 0 : handleChange,
|
|
750
|
+
defaultValue: typeof defaultValue === "string" ? defaultValue : void 0,
|
|
751
|
+
dir: dir === "rtl" ? "rtl" : "ltr",
|
|
752
|
+
...rest,
|
|
753
|
+
children: [
|
|
754
|
+
/* @__PURE__ */ jsxs8(
|
|
755
|
+
SelectPrimitive.Trigger,
|
|
756
|
+
{
|
|
757
|
+
ref,
|
|
758
|
+
className: cn(
|
|
759
|
+
"group flex h-11 w-full flex-row items-center justify-between gap-3 rounded-lg border px-4 py-3 text-sm font-normal focus:outline-purple-100 disabled:bg-grey-5 data-[placeholder]:text-grey-50 data-[placeholder]:disabled:text-grey-40",
|
|
760
|
+
classNames?.trigger
|
|
761
|
+
),
|
|
762
|
+
children: [
|
|
763
|
+
/* @__PURE__ */ jsx13("span", { className: "truncate", children: /* @__PURE__ */ jsx13(
|
|
764
|
+
SelectPrimitive.Value,
|
|
765
|
+
{
|
|
766
|
+
placeholder: placeholder ?? "Select an option",
|
|
767
|
+
"aria-label": getLabel(),
|
|
768
|
+
children: getLabel()
|
|
769
|
+
}
|
|
770
|
+
) }),
|
|
771
|
+
/* @__PURE__ */ jsx13(
|
|
772
|
+
ChevronDownIcon,
|
|
773
|
+
{
|
|
774
|
+
className: "transform text-black group-data-[state=open]:rotate-180",
|
|
775
|
+
size: "16"
|
|
776
|
+
}
|
|
777
|
+
)
|
|
778
|
+
]
|
|
779
|
+
}
|
|
780
|
+
),
|
|
781
|
+
/* @__PURE__ */ jsx13(SelectPrimitive.Portal, { container: containerRef.current, children: /* @__PURE__ */ jsx13(
|
|
782
|
+
SelectPrimitive.Content,
|
|
783
|
+
{
|
|
784
|
+
hideWhenDetached: true,
|
|
785
|
+
className: "z-10 max-h-[var(--radix-select-content-available-height)] w-[var(--radix-select-trigger-width)] overflow-hidden rounded-md bg-white py-2 shadow-lg",
|
|
786
|
+
position: "popper",
|
|
787
|
+
sideOffset: 4,
|
|
788
|
+
onPointerDownOutside: toggleOpen,
|
|
789
|
+
onKeyDown: closeOnEscape,
|
|
790
|
+
children: /* @__PURE__ */ jsxs8(SelectPrimitive.Viewport, { children: [
|
|
791
|
+
multiselect && !!chipLabels?.length && /* @__PURE__ */ jsx13(
|
|
792
|
+
SelectPrimitive.Group,
|
|
793
|
+
{
|
|
794
|
+
className: "mb-2 flex flex-row flex-wrap gap-1 px-2",
|
|
795
|
+
"data-testid": "selected-labels",
|
|
796
|
+
children: chipLabels?.map(
|
|
797
|
+
(chip) => chip && /* @__PURE__ */ jsxs8(Chip_default, { size: "small", variant: "primary", children: [
|
|
798
|
+
/* @__PURE__ */ jsx13("span", { children: chip.title }),
|
|
799
|
+
/* @__PURE__ */ jsx13(
|
|
800
|
+
X3,
|
|
801
|
+
{
|
|
802
|
+
size: 18,
|
|
803
|
+
"data-testid": `chip-remove-${chip.value}`,
|
|
804
|
+
className: "cursor-pointer",
|
|
805
|
+
onClick: () => handleChange(chip.value)
|
|
806
|
+
}
|
|
807
|
+
)
|
|
808
|
+
] }, chip.title)
|
|
809
|
+
)
|
|
810
|
+
}
|
|
811
|
+
),
|
|
812
|
+
/* @__PURE__ */ jsx13(Separator, {}),
|
|
813
|
+
options?.map(({ id: id2, title, value: value2 }) => /* @__PURE__ */ jsxs8(
|
|
814
|
+
SelectPrimitive.Item,
|
|
815
|
+
{
|
|
816
|
+
value: value2,
|
|
817
|
+
className: "group relative cursor-pointer px-4 py-2 text-left text-sm hover:bg-purple-50 focus:bg-purple-50 focus:outline-none data-[state=checked]:bg-purple-50 data-[state=checked]:pr-10 data-[state=checked]:text-purple-100",
|
|
818
|
+
"data-state": selected.includes(value2) ? "checked" : "unchecked",
|
|
819
|
+
onKeyDown: (e) => setValueOnEnter(e, value2),
|
|
820
|
+
onClick: () => handleChange(value2),
|
|
821
|
+
children: [
|
|
822
|
+
/* @__PURE__ */ jsx13(SelectPrimitive.ItemText, { children: title }),
|
|
823
|
+
/* @__PURE__ */ jsx13(
|
|
824
|
+
CheckIcon2,
|
|
825
|
+
{
|
|
826
|
+
className: "absolute inset-y-0 right-3 my-auto hidden w-6 text-purple-100 group-data-[state=checked]:block",
|
|
827
|
+
size: 16
|
|
828
|
+
}
|
|
829
|
+
)
|
|
830
|
+
]
|
|
831
|
+
},
|
|
832
|
+
id2
|
|
833
|
+
))
|
|
834
|
+
] })
|
|
835
|
+
}
|
|
836
|
+
) })
|
|
837
|
+
]
|
|
838
|
+
}
|
|
839
|
+
),
|
|
840
|
+
/* @__PURE__ */ jsx13(ErrorMessage_default, { message: error })
|
|
841
|
+
]
|
|
842
|
+
}
|
|
843
|
+
);
|
|
844
|
+
}
|
|
845
|
+
);
|
|
846
|
+
Select.displayName = "Select";
|
|
847
|
+
var Select_default = Select;
|
|
848
|
+
|
|
849
|
+
// src/components/ui/Avatar.tsx
|
|
850
|
+
import { cva as cva3 } from "cva";
|
|
851
|
+
import Link from "next/link";
|
|
852
|
+
|
|
853
|
+
// src/components/primitives/avatar.tsx
|
|
854
|
+
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
855
|
+
import * as React5 from "react";
|
|
856
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
857
|
+
var AvatarBase = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx14(
|
|
858
|
+
AvatarPrimitive.Root,
|
|
859
|
+
{
|
|
860
|
+
ref,
|
|
861
|
+
className: cn("relative flex shrink-0 overflow-hidden rounded-full", className),
|
|
862
|
+
...props
|
|
863
|
+
}
|
|
864
|
+
));
|
|
865
|
+
AvatarBase.displayName = AvatarPrimitive.Root.displayName;
|
|
866
|
+
var AvatarImage = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx14(
|
|
867
|
+
AvatarPrimitive.Image,
|
|
868
|
+
{
|
|
869
|
+
ref,
|
|
870
|
+
className: cn("aspect-square h-full w-full", className),
|
|
871
|
+
"data-testid": "job-card-avatar",
|
|
872
|
+
...props
|
|
873
|
+
}
|
|
874
|
+
));
|
|
875
|
+
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
876
|
+
var AvatarFallback = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx14(
|
|
877
|
+
AvatarPrimitive.Fallback,
|
|
878
|
+
{
|
|
879
|
+
ref,
|
|
880
|
+
className: cn(
|
|
881
|
+
"flex h-full w-full items-center justify-center rounded-full bg-pumpkin-100 py-2 text-sm font-bold capitalize leading-normal text-white md:text-lg",
|
|
882
|
+
className
|
|
883
|
+
),
|
|
884
|
+
...props
|
|
885
|
+
}
|
|
886
|
+
));
|
|
887
|
+
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
|
|
888
|
+
|
|
889
|
+
// src/components/ui/Avatar.tsx
|
|
890
|
+
import { jsx as jsx15, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
891
|
+
function Avatar({ size, src, href, name, ...linkProps }) {
|
|
892
|
+
const fallbackShort = name?.slice(0, 2);
|
|
893
|
+
const fallbackWords = name?.split(" ").map((n) => n[0]).join("").slice(0, 2);
|
|
894
|
+
const fallback = fallbackWords && fallbackWords.length > 1 ? fallbackWords : fallbackShort;
|
|
895
|
+
const renderAvatar = () => /* @__PURE__ */ jsxs9(AvatarBase, { className: avatarVariants({ size }), children: [
|
|
896
|
+
/* @__PURE__ */ jsx15(AvatarImage, { src, alt: name }),
|
|
897
|
+
/* @__PURE__ */ jsx15(AvatarFallback, { children: fallback?.toUpperCase() })
|
|
898
|
+
] });
|
|
899
|
+
if (href) {
|
|
900
|
+
return /* @__PURE__ */ jsx15(Link, { href, ...linkProps, children: renderAvatar() });
|
|
901
|
+
}
|
|
902
|
+
return renderAvatar();
|
|
903
|
+
}
|
|
904
|
+
var avatarVariants = cva3("ring ring-white ring-2", {
|
|
905
|
+
variants: {
|
|
906
|
+
size: {
|
|
907
|
+
large: "h-16 w-16",
|
|
908
|
+
medium: "h-10 w-10",
|
|
909
|
+
small: "h-8 w-8"
|
|
910
|
+
}
|
|
911
|
+
},
|
|
912
|
+
defaultVariants: {
|
|
913
|
+
size: "medium"
|
|
914
|
+
}
|
|
915
|
+
});
|
|
916
|
+
|
|
917
|
+
// src/components/ui/Badge.tsx
|
|
918
|
+
import { cva as cva4 } from "cva";
|
|
919
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
920
|
+
var badgeVariants = cva4("rounded-full px-2 py-0.5 text-xs font-semibold", {
|
|
921
|
+
variants: {
|
|
922
|
+
variant: {
|
|
923
|
+
green: "bg-green-90 text-white",
|
|
924
|
+
pickle: "bg-pickle-100 text-black",
|
|
925
|
+
purple: "bg-purple-100 text-white"
|
|
926
|
+
}
|
|
927
|
+
},
|
|
928
|
+
defaultVariants: {
|
|
929
|
+
variant: "green"
|
|
930
|
+
}
|
|
931
|
+
});
|
|
932
|
+
function Badge({ className, variant, ...props }) {
|
|
933
|
+
return /* @__PURE__ */ jsx16("div", { className: cn(badgeVariants({ variant }), className), ...props });
|
|
934
|
+
}
|
|
840
935
|
|
|
841
936
|
// src/components/ui/Button.tsx
|
|
842
937
|
import { Slot } from "@radix-ui/react-slot";
|
|
843
|
-
import { cva as
|
|
844
|
-
import { forwardRef as
|
|
845
|
-
import { jsx as
|
|
846
|
-
var Button =
|
|
938
|
+
import { cva as cva5 } from "cva";
|
|
939
|
+
import { forwardRef as forwardRef9 } from "react";
|
|
940
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
941
|
+
var Button = forwardRef9(
|
|
847
942
|
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
848
943
|
const Component = asChild ? Slot : "button";
|
|
849
|
-
return /* @__PURE__ */
|
|
944
|
+
return /* @__PURE__ */ jsx17(
|
|
850
945
|
Component,
|
|
851
946
|
{
|
|
852
947
|
className: cn(buttonVariants({ variant, size, className })),
|
|
@@ -857,7 +952,7 @@ var Button = forwardRef8(
|
|
|
857
952
|
}
|
|
858
953
|
);
|
|
859
954
|
Button.displayName = "Button";
|
|
860
|
-
var buttonVariants =
|
|
955
|
+
var buttonVariants = cva5(
|
|
861
956
|
[
|
|
862
957
|
"flex",
|
|
863
958
|
"items-center",
|
|
@@ -948,17 +1043,17 @@ var buttonVariants = cva3(
|
|
|
948
1043
|
);
|
|
949
1044
|
|
|
950
1045
|
// src/components/ui/Combobox.tsx
|
|
951
|
-
import {
|
|
1046
|
+
import { cva as cva6 } from "cva";
|
|
952
1047
|
import { ChevronDownIcon as ChevronDownIcon2, CircleX as CircleX2, icons as icons3 } from "lucide-react";
|
|
953
|
-
import {
|
|
1048
|
+
import { forwardRef as forwardRef11, useEffect as useEffect3, useState as useState3 } from "react";
|
|
954
1049
|
|
|
955
1050
|
// src/components/primitives/popover.tsx
|
|
956
|
-
import * as React6 from "react";
|
|
957
1051
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
958
|
-
import
|
|
1052
|
+
import * as React7 from "react";
|
|
1053
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
959
1054
|
var Popover = PopoverPrimitive.Root;
|
|
960
1055
|
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
961
|
-
var PopoverContent =
|
|
1056
|
+
var PopoverContent = React7.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx18(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx18(
|
|
962
1057
|
PopoverPrimitive.Content,
|
|
963
1058
|
{
|
|
964
1059
|
ref,
|
|
@@ -973,28 +1068,9 @@ var PopoverContent = React6.forwardRef(({ className, align = "center", sideOffse
|
|
|
973
1068
|
) }));
|
|
974
1069
|
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
975
1070
|
|
|
976
|
-
// src/components/ui/Badge.tsx
|
|
977
|
-
import { cva as cva4 } from "cva";
|
|
978
|
-
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
979
|
-
var badgeVariants = cva4("rounded-full px-2 py-0.5 text-xs font-semibold", {
|
|
980
|
-
variants: {
|
|
981
|
-
variant: {
|
|
982
|
-
green: "bg-green-90 text-white",
|
|
983
|
-
pickle: "bg-pickle-100 text-black",
|
|
984
|
-
purple: "bg-purple-100 text-white"
|
|
985
|
-
}
|
|
986
|
-
},
|
|
987
|
-
defaultVariants: {
|
|
988
|
-
variant: "green"
|
|
989
|
-
}
|
|
990
|
-
});
|
|
991
|
-
function Badge({ className, variant, ...props }) {
|
|
992
|
-
return /* @__PURE__ */ jsx16("div", { className: cn(badgeVariants({ variant }), className), ...props });
|
|
993
|
-
}
|
|
994
|
-
|
|
995
1071
|
// src/components/ui/Combobox.tsx
|
|
996
|
-
import { jsx as
|
|
997
|
-
var Combobox =
|
|
1072
|
+
import { jsx as jsx19, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1073
|
+
var Combobox = forwardRef11((props, ref) => {
|
|
998
1074
|
const {
|
|
999
1075
|
id,
|
|
1000
1076
|
name,
|
|
@@ -1044,14 +1120,18 @@ var Combobox = forwardRef10((props, ref) => {
|
|
|
1044
1120
|
};
|
|
1045
1121
|
const handleClear = () => {
|
|
1046
1122
|
setSelected([]);
|
|
1047
|
-
|
|
1123
|
+
if (multiselect) {
|
|
1124
|
+
handleChange?.([]);
|
|
1125
|
+
} else {
|
|
1126
|
+
handleChange?.("");
|
|
1127
|
+
}
|
|
1048
1128
|
};
|
|
1049
1129
|
const handleDisplayValue = () => {
|
|
1050
1130
|
const defaultLabel = !isEmpty ? selected.map((s) => s.title).join(", ") : placeholder;
|
|
1051
1131
|
return isDefault ? defaultLabel : label;
|
|
1052
1132
|
};
|
|
1053
|
-
return /* @__PURE__ */
|
|
1054
|
-
isDefault && /* @__PURE__ */
|
|
1133
|
+
return /* @__PURE__ */ jsxs10("div", { className: cn("flex flex-col gap-1", className), children: [
|
|
1134
|
+
isDefault && /* @__PURE__ */ jsx19(
|
|
1055
1135
|
Label_default,
|
|
1056
1136
|
{
|
|
1057
1137
|
text: label,
|
|
@@ -1061,15 +1141,15 @@ var Combobox = forwardRef10((props, ref) => {
|
|
|
1061
1141
|
className: classNames?.label
|
|
1062
1142
|
}
|
|
1063
1143
|
),
|
|
1064
|
-
/* @__PURE__ */
|
|
1065
|
-
/* @__PURE__ */
|
|
1066
|
-
/* @__PURE__ */
|
|
1144
|
+
/* @__PURE__ */ jsxs10("div", { className: "relative flex", children: [
|
|
1145
|
+
/* @__PURE__ */ jsxs10(Popover, { open, onOpenChange: setOpen, children: [
|
|
1146
|
+
/* @__PURE__ */ jsx19(
|
|
1067
1147
|
PopoverTrigger,
|
|
1068
1148
|
{
|
|
1069
1149
|
asChild: true,
|
|
1070
1150
|
disabled: options.length === 0,
|
|
1071
1151
|
"data-testid": `${id ?? name}-combobox-trigger`,
|
|
1072
|
-
children: /* @__PURE__ */
|
|
1152
|
+
children: /* @__PURE__ */ jsxs10(
|
|
1073
1153
|
"div",
|
|
1074
1154
|
{
|
|
1075
1155
|
ref,
|
|
@@ -1080,9 +1160,9 @@ var Combobox = forwardRef10((props, ref) => {
|
|
|
1080
1160
|
),
|
|
1081
1161
|
"aria-expanded": open,
|
|
1082
1162
|
children: [
|
|
1083
|
-
isDefault && IconComponent && /* @__PURE__ */
|
|
1084
|
-
isChip && !isEmpty && /* @__PURE__ */
|
|
1085
|
-
/* @__PURE__ */
|
|
1163
|
+
isDefault && IconComponent && /* @__PURE__ */ jsx19(IconComponent, { className: "h-4 w-4 shrink-0" }),
|
|
1164
|
+
isChip && !isEmpty && /* @__PURE__ */ jsx19(Badge, { variant: "purple", children: selected.length }),
|
|
1165
|
+
/* @__PURE__ */ jsx19(
|
|
1086
1166
|
"span",
|
|
1087
1167
|
{
|
|
1088
1168
|
className: cn(
|
|
@@ -1092,7 +1172,7 @@ var Combobox = forwardRef10((props, ref) => {
|
|
|
1092
1172
|
children: handleDisplayValue()
|
|
1093
1173
|
}
|
|
1094
1174
|
),
|
|
1095
|
-
showChevron && /* @__PURE__ */
|
|
1175
|
+
showChevron && /* @__PURE__ */ jsx19(
|
|
1096
1176
|
ChevronDownIcon2,
|
|
1097
1177
|
{
|
|
1098
1178
|
className: "shrink-0 transform group-data-[state=open]:rotate-180",
|
|
@@ -1104,7 +1184,7 @@ var Combobox = forwardRef10((props, ref) => {
|
|
|
1104
1184
|
)
|
|
1105
1185
|
}
|
|
1106
1186
|
),
|
|
1107
|
-
/* @__PURE__ */
|
|
1187
|
+
/* @__PURE__ */ jsx19(
|
|
1108
1188
|
PopoverContent,
|
|
1109
1189
|
{
|
|
1110
1190
|
className: cn(
|
|
@@ -1115,16 +1195,16 @@ var Combobox = forwardRef10((props, ref) => {
|
|
|
1115
1195
|
collisionPadding: 8,
|
|
1116
1196
|
sideOffset: 4,
|
|
1117
1197
|
align: "start",
|
|
1118
|
-
children: /* @__PURE__ */
|
|
1119
|
-
!hideSearchBox && /* @__PURE__ */
|
|
1120
|
-
/* @__PURE__ */
|
|
1121
|
-
/* @__PURE__ */
|
|
1122
|
-
/* @__PURE__ */
|
|
1198
|
+
children: /* @__PURE__ */ jsxs10(Command, { children: [
|
|
1199
|
+
!hideSearchBox && /* @__PURE__ */ jsx19(CommandInput, { placeholder: "Search..." }),
|
|
1200
|
+
/* @__PURE__ */ jsxs10(CommandList, { children: [
|
|
1201
|
+
/* @__PURE__ */ jsx19(CommandEmpty, { children: "No results" }),
|
|
1202
|
+
/* @__PURE__ */ jsx19(CommandGroup, { children: options.map(({ id: id2, ...option }) => /* @__PURE__ */ jsx19(
|
|
1123
1203
|
CommandItem,
|
|
1124
1204
|
{
|
|
1125
1205
|
value: option.title,
|
|
1126
1206
|
onSelect: () => handleSelect(option.value),
|
|
1127
|
-
children: /* @__PURE__ */
|
|
1207
|
+
children: /* @__PURE__ */ jsx19(
|
|
1128
1208
|
ListItem_default,
|
|
1129
1209
|
{
|
|
1130
1210
|
className: cn(classNames?.items, "truncate py-1"),
|
|
@@ -1137,26 +1217,26 @@ var Combobox = forwardRef10((props, ref) => {
|
|
|
1137
1217
|
id2
|
|
1138
1218
|
)) })
|
|
1139
1219
|
] }),
|
|
1140
|
-
!!footer && /* @__PURE__ */
|
|
1220
|
+
!!footer && /* @__PURE__ */ jsx19(Separator, {}),
|
|
1141
1221
|
footer && footer({ close })
|
|
1142
1222
|
] })
|
|
1143
1223
|
}
|
|
1144
1224
|
)
|
|
1145
1225
|
] }),
|
|
1146
|
-
isDefault && !isEmpty && /* @__PURE__ */
|
|
1226
|
+
isDefault && !isEmpty && /* @__PURE__ */ jsx19(
|
|
1147
1227
|
"button",
|
|
1148
1228
|
{
|
|
1149
1229
|
type: "button",
|
|
1150
1230
|
className: "absolute inset-y-0 right-1 my-auto flex h-8 w-8 cursor-pointer items-center justify-center rounded-full hover:bg-pickle-20",
|
|
1151
1231
|
onClick: handleClear,
|
|
1152
|
-
children: /* @__PURE__ */
|
|
1232
|
+
children: /* @__PURE__ */ jsx19(CircleX2, { className: "h-4 w-4 text-green-100" })
|
|
1153
1233
|
}
|
|
1154
1234
|
)
|
|
1155
1235
|
] })
|
|
1156
1236
|
] });
|
|
1157
1237
|
});
|
|
1158
1238
|
Combobox.displayName = "Combobox";
|
|
1159
|
-
var triggerVariants =
|
|
1239
|
+
var triggerVariants = cva6(
|
|
1160
1240
|
"group relative cursor-pointer text-green-100 flex flex-row items-center justify-between gap-2 border border-grey-20 focus:outline-green-80 disabled:bg-grey-5",
|
|
1161
1241
|
{
|
|
1162
1242
|
variants: {
|
|
@@ -1183,11 +1263,11 @@ var triggerVariants = cva5(
|
|
|
1183
1263
|
);
|
|
1184
1264
|
|
|
1185
1265
|
// src/components/ui/Counter.tsx
|
|
1186
|
-
import { cva as
|
|
1266
|
+
import { cva as cva7 } from "cva";
|
|
1187
1267
|
import { Minus as Minus2, Plus } from "lucide-react";
|
|
1188
|
-
import { forwardRef as
|
|
1189
|
-
import { jsx as
|
|
1190
|
-
var Counter =
|
|
1268
|
+
import { forwardRef as forwardRef12, useEffect as useEffect4, useState as useState4 } from "react";
|
|
1269
|
+
import { jsx as jsx20, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1270
|
+
var Counter = forwardRef12(
|
|
1191
1271
|
({ label, error, min, max, step = 1, description, theme, value, classNames, onChange, ...props }, ref) => {
|
|
1192
1272
|
const [count, setCount] = useState4(0);
|
|
1193
1273
|
useEffect4(() => {
|
|
@@ -1221,13 +1301,13 @@ var Counter = forwardRef11(
|
|
|
1221
1301
|
onChange?.(newValue);
|
|
1222
1302
|
setCount(newValue);
|
|
1223
1303
|
};
|
|
1224
|
-
return /* @__PURE__ */
|
|
1304
|
+
return /* @__PURE__ */ jsxs11(
|
|
1225
1305
|
"div",
|
|
1226
1306
|
{
|
|
1227
1307
|
className: cn("flex w-auto flex-col gap-1", classNames?.root),
|
|
1228
1308
|
"data-testid": `counter-wrapper-${props.id}`,
|
|
1229
1309
|
children: [
|
|
1230
|
-
label && /* @__PURE__ */
|
|
1310
|
+
label && /* @__PURE__ */ jsx20(
|
|
1231
1311
|
Label_default,
|
|
1232
1312
|
{
|
|
1233
1313
|
text: label,
|
|
@@ -1237,17 +1317,17 @@ var Counter = forwardRef11(
|
|
|
1237
1317
|
className: classNames?.label
|
|
1238
1318
|
}
|
|
1239
1319
|
),
|
|
1240
|
-
/* @__PURE__ */
|
|
1241
|
-
/* @__PURE__ */
|
|
1320
|
+
/* @__PURE__ */ jsxs11("div", { className: "relative flex w-[122px] flex-row items-center", children: [
|
|
1321
|
+
/* @__PURE__ */ jsx20(
|
|
1242
1322
|
"button",
|
|
1243
1323
|
{
|
|
1244
1324
|
type: "button",
|
|
1245
1325
|
className: "absolute inset-y-0 left-1 my-auto flex h-8 w-8 cursor-pointer items-center justify-center rounded-full hover:bg-pickle-20",
|
|
1246
1326
|
onClick: decrement,
|
|
1247
|
-
children: /* @__PURE__ */
|
|
1327
|
+
children: /* @__PURE__ */ jsx20(Minus2, { className: "h-4 w-4 text-green-100" })
|
|
1248
1328
|
}
|
|
1249
1329
|
),
|
|
1250
|
-
/* @__PURE__ */
|
|
1330
|
+
/* @__PURE__ */ jsx20(
|
|
1251
1331
|
"input",
|
|
1252
1332
|
{
|
|
1253
1333
|
className: cn(counterVariants({ theme }), classNames?.input),
|
|
@@ -1258,24 +1338,24 @@ var Counter = forwardRef11(
|
|
|
1258
1338
|
...props
|
|
1259
1339
|
}
|
|
1260
1340
|
),
|
|
1261
|
-
/* @__PURE__ */
|
|
1341
|
+
/* @__PURE__ */ jsx20(
|
|
1262
1342
|
"button",
|
|
1263
1343
|
{
|
|
1264
1344
|
type: "button",
|
|
1265
1345
|
className: "absolute inset-y-0 right-1 my-auto flex h-8 w-8 cursor-pointer items-center justify-center rounded-full hover:bg-pickle-20",
|
|
1266
1346
|
onClick: increment,
|
|
1267
|
-
children: /* @__PURE__ */
|
|
1347
|
+
children: /* @__PURE__ */ jsx20(Plus, { className: "h-4 w-4 text-green-100" })
|
|
1268
1348
|
}
|
|
1269
1349
|
)
|
|
1270
1350
|
] }),
|
|
1271
|
-
/* @__PURE__ */
|
|
1351
|
+
/* @__PURE__ */ jsx20(ErrorMessage_default, { message: error })
|
|
1272
1352
|
]
|
|
1273
1353
|
}
|
|
1274
1354
|
);
|
|
1275
1355
|
}
|
|
1276
1356
|
);
|
|
1277
1357
|
Counter.displayName = "Counter";
|
|
1278
|
-
var counterVariants =
|
|
1358
|
+
var counterVariants = cva7(
|
|
1279
1359
|
[
|
|
1280
1360
|
"border-input",
|
|
1281
1361
|
"placeholder:text-muted-foreground",
|
|
@@ -1325,167 +1405,16 @@ var counterVariants = cva6(
|
|
|
1325
1405
|
}
|
|
1326
1406
|
);
|
|
1327
1407
|
|
|
1328
|
-
// src/components/ui/InputOtp.tsx
|
|
1329
|
-
import { forwardRef as forwardRef13 } from "react";
|
|
1330
|
-
|
|
1331
|
-
// src/components/primitives/input-otp.tsx
|
|
1332
|
-
import * as React7 from "react";
|
|
1333
|
-
import { OTPInput, OTPInputContext } from "input-otp";
|
|
1334
|
-
import { Dot } from "lucide-react";
|
|
1335
|
-
import { jsx as jsx19, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1336
|
-
var InputOTP = React7.forwardRef(({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ jsx19(
|
|
1337
|
-
OTPInput,
|
|
1338
|
-
{
|
|
1339
|
-
ref,
|
|
1340
|
-
containerClassName: cn(
|
|
1341
|
-
"flex items-center gap-2 has-[:disabled]:opacity-50",
|
|
1342
|
-
containerClassName
|
|
1343
|
-
),
|
|
1344
|
-
className: cn("disabled:cursor-not-allowed", className),
|
|
1345
|
-
...props
|
|
1346
|
-
}
|
|
1347
|
-
));
|
|
1348
|
-
InputOTP.displayName = "InputOTP";
|
|
1349
|
-
var InputOTPGroup = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx19("div", { ref, className: cn("flex items-center", className), ...props }));
|
|
1350
|
-
InputOTPGroup.displayName = "InputOTPGroup";
|
|
1351
|
-
var InputOTPSlot = React7.forwardRef(({ index, error, className, ...props }, ref) => {
|
|
1352
|
-
const inputOTPContext = React7.useContext(OTPInputContext);
|
|
1353
|
-
const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index];
|
|
1354
|
-
return /* @__PURE__ */ jsxs11(
|
|
1355
|
-
"div",
|
|
1356
|
-
{
|
|
1357
|
-
ref,
|
|
1358
|
-
className: cn(
|
|
1359
|
-
"relative flex h-10 w-10 items-center justify-center border-y border-r border-neutral-200 text-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md dark:border-neutral-800",
|
|
1360
|
-
isActive && "z-10 ring-2 ring-purple-100 ring-offset-white dark:ring-purple-20 dark:ring-offset-purple-100",
|
|
1361
|
-
error && "border-red-500 dark:border-red-400",
|
|
1362
|
-
className
|
|
1363
|
-
),
|
|
1364
|
-
...props,
|
|
1365
|
-
children: [
|
|
1366
|
-
char,
|
|
1367
|
-
hasFakeCaret && /* @__PURE__ */ jsx19("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsx19("div", { className: "animate-caret-blink h-4 w-px bg-neutral-950 duration-1000 dark:bg-neutral-50" }) })
|
|
1368
|
-
]
|
|
1369
|
-
}
|
|
1370
|
-
);
|
|
1371
|
-
});
|
|
1372
|
-
InputOTPSlot.displayName = "InputOTPSlot";
|
|
1373
|
-
var InputOTPSeparator = React7.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx19("div", { ref, role: "separator", ...props, children: /* @__PURE__ */ jsx19(Dot, {}) }));
|
|
1374
|
-
InputOTPSeparator.displayName = "InputOTPSeparator";
|
|
1375
|
-
|
|
1376
|
-
// src/components/ui/InputOtp.tsx
|
|
1377
|
-
import { jsx as jsx20, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1378
|
-
var InputOtp = forwardRef13(
|
|
1379
|
-
({ digits, label, description, error, ...props }, ref) => {
|
|
1380
|
-
return /* @__PURE__ */ jsxs12(
|
|
1381
|
-
"div",
|
|
1382
|
-
{
|
|
1383
|
-
className: "group flex w-full flex-col gap-1",
|
|
1384
|
-
"data-testid": `input-otp-wrapper-${props.id}`,
|
|
1385
|
-
children: [
|
|
1386
|
-
label && /* @__PURE__ */ jsx20(
|
|
1387
|
-
Label_default,
|
|
1388
|
-
{
|
|
1389
|
-
text: label,
|
|
1390
|
-
htmlFor: props.name,
|
|
1391
|
-
required: props.required,
|
|
1392
|
-
description
|
|
1393
|
-
}
|
|
1394
|
-
),
|
|
1395
|
-
/* @__PURE__ */ jsx20("div", { className: "relative flex flex-row items-center", children: /* @__PURE__ */ jsx20(
|
|
1396
|
-
InputOTP,
|
|
1397
|
-
{
|
|
1398
|
-
ref,
|
|
1399
|
-
maxLength: digits,
|
|
1400
|
-
"data-testid": `input-otp-element-${props.id}`,
|
|
1401
|
-
...props,
|
|
1402
|
-
children: [...Array(digits)].map((_, index) => /* @__PURE__ */ jsx20(InputOTPGroup, { children: /* @__PURE__ */ jsx20(InputOTPSlot, { index, error: Boolean(error) }) }, index))
|
|
1403
|
-
}
|
|
1404
|
-
) }),
|
|
1405
|
-
/* @__PURE__ */ jsx20(ErrorMessage_default, { message: error })
|
|
1406
|
-
]
|
|
1407
|
-
}
|
|
1408
|
-
);
|
|
1409
|
-
}
|
|
1410
|
-
);
|
|
1411
|
-
InputOtp.displayName = "Input";
|
|
1412
|
-
|
|
1413
|
-
// src/components/primitives/avatar.tsx
|
|
1414
|
-
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
1415
|
-
import * as React8 from "react";
|
|
1416
|
-
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
1417
|
-
var AvatarBase = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx21(
|
|
1418
|
-
AvatarPrimitive.Root,
|
|
1419
|
-
{
|
|
1420
|
-
ref,
|
|
1421
|
-
className: cn("relative flex shrink-0 overflow-hidden rounded-full", className),
|
|
1422
|
-
...props
|
|
1423
|
-
}
|
|
1424
|
-
));
|
|
1425
|
-
AvatarBase.displayName = AvatarPrimitive.Root.displayName;
|
|
1426
|
-
var AvatarImage = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx21(
|
|
1427
|
-
AvatarPrimitive.Image,
|
|
1428
|
-
{
|
|
1429
|
-
ref,
|
|
1430
|
-
className: cn("aspect-square h-full w-full", className),
|
|
1431
|
-
"data-testid": "job-card-avatar",
|
|
1432
|
-
...props
|
|
1433
|
-
}
|
|
1434
|
-
));
|
|
1435
|
-
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
1436
|
-
var AvatarFallback = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx21(
|
|
1437
|
-
AvatarPrimitive.Fallback,
|
|
1438
|
-
{
|
|
1439
|
-
ref,
|
|
1440
|
-
className: cn(
|
|
1441
|
-
"flex h-full w-full items-center justify-center rounded-full bg-pumpkin-100 py-2 text-sm font-bold capitalize leading-normal text-white md:text-lg",
|
|
1442
|
-
className
|
|
1443
|
-
),
|
|
1444
|
-
...props
|
|
1445
|
-
}
|
|
1446
|
-
));
|
|
1447
|
-
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
|
|
1448
|
-
|
|
1449
|
-
// src/components/ui/Avatar.tsx
|
|
1450
|
-
import { cva as cva7 } from "cva";
|
|
1451
|
-
import Link from "next/link";
|
|
1452
|
-
import { jsx as jsx22, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1453
|
-
function Avatar({ size, src, href, name, ...linkProps }) {
|
|
1454
|
-
const fallbackShort = name?.slice(0, 2);
|
|
1455
|
-
const fallbackWords = name?.split(" ").map((n) => n[0]).join("").slice(0, 2);
|
|
1456
|
-
const fallback = fallbackWords && fallbackWords.length > 1 ? fallbackWords : fallbackShort;
|
|
1457
|
-
const renderAvatar = () => /* @__PURE__ */ jsxs13(AvatarBase, { className: avatarVariants({ size }), children: [
|
|
1458
|
-
/* @__PURE__ */ jsx22(AvatarImage, { src, alt: name }),
|
|
1459
|
-
/* @__PURE__ */ jsx22(AvatarFallback, { children: fallback?.toUpperCase() })
|
|
1460
|
-
] });
|
|
1461
|
-
if (href) {
|
|
1462
|
-
return /* @__PURE__ */ jsx22(Link, { href, ...linkProps, children: renderAvatar() });
|
|
1463
|
-
}
|
|
1464
|
-
return renderAvatar();
|
|
1465
|
-
}
|
|
1466
|
-
var avatarVariants = cva7("ring ring-white ring-2", {
|
|
1467
|
-
variants: {
|
|
1468
|
-
size: {
|
|
1469
|
-
large: "h-16 w-16",
|
|
1470
|
-
medium: "h-10 w-10",
|
|
1471
|
-
small: "h-8 w-8"
|
|
1472
|
-
}
|
|
1473
|
-
},
|
|
1474
|
-
defaultVariants: {
|
|
1475
|
-
size: "medium"
|
|
1476
|
-
}
|
|
1477
|
-
});
|
|
1478
|
-
|
|
1479
1408
|
// src/components/ui/Icon.tsx
|
|
1480
1409
|
import { Slot as Slot2 } from "@radix-ui/react-slot";
|
|
1481
1410
|
import { cva as cva8 } from "cva";
|
|
1482
|
-
import { forwardRef as
|
|
1411
|
+
import { forwardRef as forwardRef13 } from "react";
|
|
1483
1412
|
import { twMerge as twMerge3 } from "tailwind-merge";
|
|
1484
|
-
import { jsx as
|
|
1485
|
-
var Icon =
|
|
1413
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
1414
|
+
var Icon = forwardRef13(
|
|
1486
1415
|
({ variant, size, active = false, readonly = false, className, ...props }, ref) => {
|
|
1487
1416
|
const Component = readonly ? Slot2 : "button";
|
|
1488
|
-
return /* @__PURE__ */
|
|
1417
|
+
return /* @__PURE__ */ jsx21(
|
|
1489
1418
|
Component,
|
|
1490
1419
|
{
|
|
1491
1420
|
className: cn(
|
|
@@ -1545,13 +1474,98 @@ var iconVariants = cva8(
|
|
|
1545
1474
|
medium: ["h-12", "w-12", "p-4"],
|
|
1546
1475
|
large: ["h-14", "w-14", "p-4"]
|
|
1547
1476
|
}
|
|
1548
|
-
},
|
|
1549
|
-
defaultVariants: {
|
|
1550
|
-
variant: "filled",
|
|
1551
|
-
size: "medium"
|
|
1552
|
-
}
|
|
1477
|
+
},
|
|
1478
|
+
defaultVariants: {
|
|
1479
|
+
variant: "filled",
|
|
1480
|
+
size: "medium"
|
|
1481
|
+
}
|
|
1482
|
+
}
|
|
1483
|
+
);
|
|
1484
|
+
|
|
1485
|
+
// src/components/ui/InputOtp.tsx
|
|
1486
|
+
import { forwardRef as forwardRef15 } from "react";
|
|
1487
|
+
|
|
1488
|
+
// src/components/primitives/input-otp.tsx
|
|
1489
|
+
import { OTPInput, OTPInputContext } from "input-otp";
|
|
1490
|
+
import { Dot } from "lucide-react";
|
|
1491
|
+
import * as React8 from "react";
|
|
1492
|
+
import { jsx as jsx22, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1493
|
+
var InputOTP = React8.forwardRef(({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ jsx22(
|
|
1494
|
+
OTPInput,
|
|
1495
|
+
{
|
|
1496
|
+
ref,
|
|
1497
|
+
containerClassName: cn(
|
|
1498
|
+
"flex items-center gap-2 has-[:disabled]:opacity-50",
|
|
1499
|
+
containerClassName
|
|
1500
|
+
),
|
|
1501
|
+
className: cn("disabled:cursor-not-allowed", className),
|
|
1502
|
+
...props
|
|
1503
|
+
}
|
|
1504
|
+
));
|
|
1505
|
+
InputOTP.displayName = "InputOTP";
|
|
1506
|
+
var InputOTPGroup = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx22("div", { ref, className: cn("flex items-center", className), ...props }));
|
|
1507
|
+
InputOTPGroup.displayName = "InputOTPGroup";
|
|
1508
|
+
var InputOTPSlot = React8.forwardRef(({ index, error, className, ...props }, ref) => {
|
|
1509
|
+
const inputOTPContext = React8.useContext(OTPInputContext);
|
|
1510
|
+
const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index];
|
|
1511
|
+
return /* @__PURE__ */ jsxs12(
|
|
1512
|
+
"div",
|
|
1513
|
+
{
|
|
1514
|
+
ref,
|
|
1515
|
+
className: cn(
|
|
1516
|
+
"relative flex h-10 w-10 items-center justify-center border-y border-r border-neutral-200 text-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md dark:border-neutral-800",
|
|
1517
|
+
isActive && "z-10 ring-2 ring-purple-100 ring-offset-white dark:ring-purple-20 dark:ring-offset-purple-100",
|
|
1518
|
+
error && "border-red-500 dark:border-red-400",
|
|
1519
|
+
className
|
|
1520
|
+
),
|
|
1521
|
+
...props,
|
|
1522
|
+
children: [
|
|
1523
|
+
char,
|
|
1524
|
+
hasFakeCaret && /* @__PURE__ */ jsx22("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsx22("div", { className: "h-4 w-px animate-caret-blink bg-neutral-950 duration-1000 dark:bg-neutral-50" }) })
|
|
1525
|
+
]
|
|
1526
|
+
}
|
|
1527
|
+
);
|
|
1528
|
+
});
|
|
1529
|
+
InputOTPSlot.displayName = "InputOTPSlot";
|
|
1530
|
+
var InputOTPSeparator = React8.forwardRef(({ ...props }, ref) => /* @__PURE__ */ jsx22("div", { ref, role: "separator", ...props, children: /* @__PURE__ */ jsx22(Dot, {}) }));
|
|
1531
|
+
InputOTPSeparator.displayName = "InputOTPSeparator";
|
|
1532
|
+
|
|
1533
|
+
// src/components/ui/InputOtp.tsx
|
|
1534
|
+
import { jsx as jsx23, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1535
|
+
var InputOtp = forwardRef15(
|
|
1536
|
+
({ digits, label, description, error, ...props }, ref) => {
|
|
1537
|
+
return /* @__PURE__ */ jsxs13(
|
|
1538
|
+
"div",
|
|
1539
|
+
{
|
|
1540
|
+
className: "group flex w-full flex-col gap-1",
|
|
1541
|
+
"data-testid": `input-otp-wrapper-${props.id}`,
|
|
1542
|
+
children: [
|
|
1543
|
+
label && /* @__PURE__ */ jsx23(
|
|
1544
|
+
Label_default,
|
|
1545
|
+
{
|
|
1546
|
+
text: label,
|
|
1547
|
+
htmlFor: props.name,
|
|
1548
|
+
required: props.required,
|
|
1549
|
+
description
|
|
1550
|
+
}
|
|
1551
|
+
),
|
|
1552
|
+
/* @__PURE__ */ jsx23("div", { className: "relative flex flex-row items-center", children: /* @__PURE__ */ jsx23(
|
|
1553
|
+
InputOTP,
|
|
1554
|
+
{
|
|
1555
|
+
ref,
|
|
1556
|
+
maxLength: digits,
|
|
1557
|
+
"data-testid": `input-otp-element-${props.id}`,
|
|
1558
|
+
...props,
|
|
1559
|
+
children: [...Array(digits)].map((_, index) => /* @__PURE__ */ jsx23(InputOTPGroup, { children: /* @__PURE__ */ jsx23(InputOTPSlot, { index, error: Boolean(error) }) }, index))
|
|
1560
|
+
}
|
|
1561
|
+
) }),
|
|
1562
|
+
/* @__PURE__ */ jsx23(ErrorMessage_default, { message: error })
|
|
1563
|
+
]
|
|
1564
|
+
}
|
|
1565
|
+
);
|
|
1553
1566
|
}
|
|
1554
1567
|
);
|
|
1568
|
+
InputOtp.displayName = "Input";
|
|
1555
1569
|
|
|
1556
1570
|
// src/components/ui/LinkButton.tsx
|
|
1557
1571
|
import Link2 from "next/link";
|
|
@@ -1606,10 +1620,19 @@ function ReadMore({ text, ...props }) {
|
|
|
1606
1620
|
const snippet = createReadMoreText(text, maxWords, isExpanded);
|
|
1607
1621
|
return /* @__PURE__ */ jsxs14("div", { ...props, children: [
|
|
1608
1622
|
/* @__PURE__ */ jsx25("div", { "data-testid": "read-more-text", className: "prose lg:prose-lg", children: /* @__PURE__ */ jsx25(Markdown, { children: snippet }) }),
|
|
1609
|
-
/* @__PURE__ */ jsx25(
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1623
|
+
/* @__PURE__ */ jsx25(
|
|
1624
|
+
Button,
|
|
1625
|
+
{
|
|
1626
|
+
type: "button",
|
|
1627
|
+
className: "mt-2 flex items-center justify-center",
|
|
1628
|
+
variant: "link",
|
|
1629
|
+
onClick: toggleText,
|
|
1630
|
+
children: /* @__PURE__ */ jsxs14("p", { className: "text-sm font-bold underline underline-offset-2", children: [
|
|
1631
|
+
"Read ",
|
|
1632
|
+
isExpanded ? "less" : "more"
|
|
1633
|
+
] })
|
|
1634
|
+
}
|
|
1635
|
+
)
|
|
1613
1636
|
] });
|
|
1614
1637
|
}
|
|
1615
1638
|
|
|
@@ -1748,7 +1771,11 @@ function BackButton({ acceptedRoutes, fallbackHref, className, ...props }) {
|
|
|
1748
1771
|
const isAcceptedRoute = (r) => !!acceptedRoutes?.find((route) => new RegExp("^" + route + "$", "i").test(r));
|
|
1749
1772
|
const goBack = () => {
|
|
1750
1773
|
const previous = history[history.length - 2];
|
|
1751
|
-
history.length > 1 && isAcceptedRoute(previous)
|
|
1774
|
+
if (history.length > 1 && isAcceptedRoute(previous)) {
|
|
1775
|
+
router.back();
|
|
1776
|
+
} else {
|
|
1777
|
+
router.push(fallbackHref ?? "/");
|
|
1778
|
+
}
|
|
1752
1779
|
};
|
|
1753
1780
|
return /* @__PURE__ */ jsx31(
|
|
1754
1781
|
Icon,
|
|
@@ -1957,102 +1984,6 @@ function JobHeader({
|
|
|
1957
1984
|
// src/components/jobPost/JobPost.tsx
|
|
1958
1985
|
import * as DateFns from "date-fns";
|
|
1959
1986
|
|
|
1960
|
-
// src/types/data/shared_pickle_output_latest.ts
|
|
1961
|
-
var shared_pickle_output_latest_exports = {};
|
|
1962
|
-
__export(shared_pickle_output_latest_exports, {
|
|
1963
|
-
CurrencyEnum: () => CurrencyEnum,
|
|
1964
|
-
DetailLevelEnum: () => DetailLevelEnum,
|
|
1965
|
-
TypeEnum: () => TypeEnum,
|
|
1966
|
-
UnitTextEnum: () => UnitTextEnum,
|
|
1967
|
-
imageAssetSchema: () => imageAssetSchema,
|
|
1968
|
-
imageSchema: () => imageSchema,
|
|
1969
|
-
monetaryAmountSchema: () => monetaryAmountSchema,
|
|
1970
|
-
placeSchema: () => placeSchema,
|
|
1971
|
-
postalAddressSchema: () => postalAddressSchema,
|
|
1972
|
-
quantitativeValueSchema: () => quantitativeValueSchema
|
|
1973
|
-
});
|
|
1974
|
-
import { z } from "zod";
|
|
1975
|
-
var TypeEnum = z.enum(["IMAGE"]);
|
|
1976
|
-
var DetailLevelEnum = z.enum(["COUNTRY", "GEO", "LOCALITY", "POSTAL_CODE", "REGION"]);
|
|
1977
|
-
var UnitTextEnum = z.enum(["DAY", "HOUR", "MONTH", "PER_ACTIVITY", "WEEK", "YEAR"]);
|
|
1978
|
-
var CurrencyEnum = z.enum(["EUR", "GBP", "USD"]);
|
|
1979
|
-
var postalAddressSchema = z.object({
|
|
1980
|
-
version: z.literal("1.0.0").default("1.0.0"),
|
|
1981
|
-
type: z.string().describe("Document type used for schema"),
|
|
1982
|
-
addressCountry: z.string().describe("The physical country as defined in ISO 3166 Alpha-2"),
|
|
1983
|
-
addressRegion: z.optional(z.string()).describe("The region in which the locality is, and which is in the country."),
|
|
1984
|
-
addressLocality: z.optional(z.string()).describe("The locality in which the street address is, and which is in the region. In the US this would be city."),
|
|
1985
|
-
streetAddress: z.optional(z.string()).describe("The street name of the address within the locality."),
|
|
1986
|
-
streetNumber: z.optional(z.string()).describe("The house of building number within the street."),
|
|
1987
|
-
postalCode: z.optional(z.string()).describe("The postal code"),
|
|
1988
|
-
description: z.optional(z.string()).describe("A descriptive string containing the full address.")
|
|
1989
|
-
});
|
|
1990
|
-
var placeSchema = z.object({
|
|
1991
|
-
version: z.literal("1.0.0").default("1.0.0"),
|
|
1992
|
-
detailLevel: z.optional(DetailLevelEnum),
|
|
1993
|
-
latitude: z.optional(z.number()).describe("The latitude of a location."),
|
|
1994
|
-
longitude: z.optional(z.number()).describe("The longitude of a location."),
|
|
1995
|
-
address: z.optional(postalAddressSchema).describe("The physical place of the location")
|
|
1996
|
-
});
|
|
1997
|
-
var quantitativeValueSchema = z.object({
|
|
1998
|
-
version: z.literal("1.0.0").default("1.0.0"),
|
|
1999
|
-
type: z.string().describe("Document type used for schema"),
|
|
2000
|
-
value: z.optional(z.number()).describe("The single value for some quantity e.g 5000, if a range is needed use minValue and maxValue. Typically used for a single salary."),
|
|
2001
|
-
minValue: z.optional(z.number()).describe("The single minium value in a range for a quantitative_value, requires a maximum value."),
|
|
2002
|
-
maxValue: z.optional(z.number()).describe("The maximum value in a range for a quantitative_value, requires a minimum value."),
|
|
2003
|
-
unitText: UnitTextEnum
|
|
2004
|
-
});
|
|
2005
|
-
var monetaryAmountSchema = z.object({
|
|
2006
|
-
version: z.literal("1.0.0").default("1.0.0"),
|
|
2007
|
-
type: z.string().describe("Document type used for schema"),
|
|
2008
|
-
singleValue: z.optional(z.number()).describe("The annualized single value for some quantity e.g 5000, if a range is needed use minValue and maxValue. Deprecated - use value.value instead."),
|
|
2009
|
-
minValue: z.optional(z.number()).describe("The annualized single minium value in a range for a quantitative_value. Deprecated use value.minValue"),
|
|
2010
|
-
maxValue: z.optional(z.number()).describe("The annualized maximum value in a range for a quantitative_value. Deprecated use value.maxValue"),
|
|
2011
|
-
value: z.optional(quantitativeValueSchema).describe("The quantitative_value for a given salary"),
|
|
2012
|
-
currency: z.optional(CurrencyEnum)
|
|
2013
|
-
});
|
|
2014
|
-
var imageAssetSchema = z.object({
|
|
2015
|
-
version: z.literal("1.0.0").default("1.0.0"),
|
|
2016
|
-
altText: z.optional(z.string()).describe("The alt text for the image"),
|
|
2017
|
-
assetId: z.optional(z.string()).describe("The asset ID for the image"),
|
|
2018
|
-
description: z.optional(z.string()).describe("The description for the image"),
|
|
2019
|
-
extension: z.optional(z.string()).describe("The extension for the image"),
|
|
2020
|
-
label: z.optional(z.string()).describe("The label for the image"),
|
|
2021
|
-
mimeType: z.optional(z.string()).describe("The mime type for the image"),
|
|
2022
|
-
originalFilename: z.optional(z.string()).describe("The original filename for the image"),
|
|
2023
|
-
path: z.optional(z.string()).describe("The path for the image"),
|
|
2024
|
-
sha1Hash: z.optional(z.string()).describe("The SHA1 hash for the image"),
|
|
2025
|
-
size: z.optional(z.number()).describe("The size for the image"),
|
|
2026
|
-
title: z.optional(z.string()).describe("The title for the image"),
|
|
2027
|
-
uploadId: z.optional(z.string()).describe("The upload ID for the image"),
|
|
2028
|
-
url: z.optional(z.string()).describe("The URL for the image")
|
|
2029
|
-
});
|
|
2030
|
-
var imageSchema = z.object({
|
|
2031
|
-
version: z.literal("1.0.0").default("1.0.0"),
|
|
2032
|
-
type: z.string().describe("Document type used for schema"),
|
|
2033
|
-
asset: z.optional(imageAssetSchema).describe("The asset for the image")
|
|
2034
|
-
});
|
|
2035
|
-
|
|
2036
|
-
// src/lib/salaryRange.ts
|
|
2037
|
-
function salaryRange(salary) {
|
|
2038
|
-
if (!salary) return null;
|
|
2039
|
-
const min = salary.minValue;
|
|
2040
|
-
const max = salary.maxValue;
|
|
2041
|
-
const single = salary.singleValue;
|
|
2042
|
-
const signs = {
|
|
2043
|
-
[CurrencyEnum.Values.USD]: "$",
|
|
2044
|
-
[CurrencyEnum.Values.GBP]: "\xA3",
|
|
2045
|
-
[CurrencyEnum.Values.EUR]: "\u20AC"
|
|
2046
|
-
};
|
|
2047
|
-
const sign = signs[salary.currency ?? CurrencyEnum.Values.USD];
|
|
2048
|
-
if (min == null && max == null && single == null) return null;
|
|
2049
|
-
if (single != null) return sign + single.toLocaleString();
|
|
2050
|
-
if (min === max) return sign + min?.toLocaleString();
|
|
2051
|
-
if (min != null && max != null)
|
|
2052
|
-
return sign + min?.toLocaleString() + " - " + sign + max?.toLocaleString();
|
|
2053
|
-
return null;
|
|
2054
|
-
}
|
|
2055
|
-
|
|
2056
1987
|
// src/hooks/useDisplayText.ts
|
|
2057
1988
|
import { useEffect as useEffect7, useMemo as useMemo2, useState as useState7 } from "react";
|
|
2058
1989
|
|
|
@@ -2542,6 +2473,102 @@ function formattedJobLocation(job) {
|
|
|
2542
2473
|
return [address, remote].filter(Boolean).join(" | ");
|
|
2543
2474
|
}
|
|
2544
2475
|
|
|
2476
|
+
// src/types/data/shared_pickle_output_latest.ts
|
|
2477
|
+
var shared_pickle_output_latest_exports = {};
|
|
2478
|
+
__export(shared_pickle_output_latest_exports, {
|
|
2479
|
+
CurrencyEnum: () => CurrencyEnum,
|
|
2480
|
+
DetailLevelEnum: () => DetailLevelEnum,
|
|
2481
|
+
TypeEnum: () => TypeEnum,
|
|
2482
|
+
UnitTextEnum: () => UnitTextEnum,
|
|
2483
|
+
imageAssetSchema: () => imageAssetSchema,
|
|
2484
|
+
imageSchema: () => imageSchema,
|
|
2485
|
+
monetaryAmountSchema: () => monetaryAmountSchema,
|
|
2486
|
+
placeSchema: () => placeSchema,
|
|
2487
|
+
postalAddressSchema: () => postalAddressSchema,
|
|
2488
|
+
quantitativeValueSchema: () => quantitativeValueSchema
|
|
2489
|
+
});
|
|
2490
|
+
import { z } from "zod";
|
|
2491
|
+
var TypeEnum = z.enum(["IMAGE"]);
|
|
2492
|
+
var DetailLevelEnum = z.enum(["COUNTRY", "GEO", "LOCALITY", "POSTAL_CODE", "REGION"]);
|
|
2493
|
+
var UnitTextEnum = z.enum(["DAY", "HOUR", "MONTH", "PER_ACTIVITY", "WEEK", "YEAR"]);
|
|
2494
|
+
var CurrencyEnum = z.enum(["EUR", "GBP", "USD"]);
|
|
2495
|
+
var postalAddressSchema = z.object({
|
|
2496
|
+
version: z.literal("1.0.0").default("1.0.0"),
|
|
2497
|
+
type: z.string().describe("Document type used for schema"),
|
|
2498
|
+
addressCountry: z.string().describe("The physical country as defined in ISO 3166 Alpha-2"),
|
|
2499
|
+
addressRegion: z.optional(z.string()).describe("The region in which the locality is, and which is in the country."),
|
|
2500
|
+
addressLocality: z.optional(z.string()).describe("The locality in which the street address is, and which is in the region. In the US this would be city."),
|
|
2501
|
+
streetAddress: z.optional(z.string()).describe("The street name of the address within the locality."),
|
|
2502
|
+
streetNumber: z.optional(z.string()).describe("The house of building number within the street."),
|
|
2503
|
+
postalCode: z.optional(z.string()).describe("The postal code"),
|
|
2504
|
+
description: z.optional(z.string()).describe("A descriptive string containing the full address.")
|
|
2505
|
+
});
|
|
2506
|
+
var placeSchema = z.object({
|
|
2507
|
+
version: z.literal("1.0.0").default("1.0.0"),
|
|
2508
|
+
detailLevel: z.optional(DetailLevelEnum),
|
|
2509
|
+
latitude: z.optional(z.number()).describe("The latitude of a location."),
|
|
2510
|
+
longitude: z.optional(z.number()).describe("The longitude of a location."),
|
|
2511
|
+
address: z.optional(postalAddressSchema).describe("The physical place of the location")
|
|
2512
|
+
});
|
|
2513
|
+
var quantitativeValueSchema = z.object({
|
|
2514
|
+
version: z.literal("1.0.0").default("1.0.0"),
|
|
2515
|
+
type: z.string().describe("Document type used for schema"),
|
|
2516
|
+
value: z.optional(z.number()).describe("The single value for some quantity e.g 5000, if a range is needed use minValue and maxValue. Typically used for a single salary."),
|
|
2517
|
+
minValue: z.optional(z.number()).describe("The single minium value in a range for a quantitative_value, requires a maximum value."),
|
|
2518
|
+
maxValue: z.optional(z.number()).describe("The maximum value in a range for a quantitative_value, requires a minimum value."),
|
|
2519
|
+
unitText: UnitTextEnum
|
|
2520
|
+
});
|
|
2521
|
+
var monetaryAmountSchema = z.object({
|
|
2522
|
+
version: z.literal("1.0.0").default("1.0.0"),
|
|
2523
|
+
type: z.string().describe("Document type used for schema"),
|
|
2524
|
+
singleValue: z.optional(z.number()).describe("The annualized single value for some quantity e.g 5000, if a range is needed use minValue and maxValue. Deprecated - use value.value instead."),
|
|
2525
|
+
minValue: z.optional(z.number()).describe("The annualized single minium value in a range for a quantitative_value. Deprecated use value.minValue"),
|
|
2526
|
+
maxValue: z.optional(z.number()).describe("The annualized maximum value in a range for a quantitative_value. Deprecated use value.maxValue"),
|
|
2527
|
+
value: z.optional(quantitativeValueSchema).describe("The quantitative_value for a given salary"),
|
|
2528
|
+
currency: z.optional(CurrencyEnum)
|
|
2529
|
+
});
|
|
2530
|
+
var imageAssetSchema = z.object({
|
|
2531
|
+
version: z.literal("1.0.0").default("1.0.0"),
|
|
2532
|
+
altText: z.optional(z.string()).describe("The alt text for the image"),
|
|
2533
|
+
assetId: z.optional(z.string()).describe("The asset ID for the image"),
|
|
2534
|
+
description: z.optional(z.string()).describe("The description for the image"),
|
|
2535
|
+
extension: z.optional(z.string()).describe("The extension for the image"),
|
|
2536
|
+
label: z.optional(z.string()).describe("The label for the image"),
|
|
2537
|
+
mimeType: z.optional(z.string()).describe("The mime type for the image"),
|
|
2538
|
+
originalFilename: z.optional(z.string()).describe("The original filename for the image"),
|
|
2539
|
+
path: z.optional(z.string()).describe("The path for the image"),
|
|
2540
|
+
sha1Hash: z.optional(z.string()).describe("The SHA1 hash for the image"),
|
|
2541
|
+
size: z.optional(z.number()).describe("The size for the image"),
|
|
2542
|
+
title: z.optional(z.string()).describe("The title for the image"),
|
|
2543
|
+
uploadId: z.optional(z.string()).describe("The upload ID for the image"),
|
|
2544
|
+
url: z.optional(z.string()).describe("The URL for the image")
|
|
2545
|
+
});
|
|
2546
|
+
var imageSchema = z.object({
|
|
2547
|
+
version: z.literal("1.0.0").default("1.0.0"),
|
|
2548
|
+
type: z.string().describe("Document type used for schema"),
|
|
2549
|
+
asset: z.optional(imageAssetSchema).describe("The asset for the image")
|
|
2550
|
+
});
|
|
2551
|
+
|
|
2552
|
+
// src/lib/salaryRange.ts
|
|
2553
|
+
function salaryRange(salary) {
|
|
2554
|
+
if (!salary) return null;
|
|
2555
|
+
const min = salary.minValue;
|
|
2556
|
+
const max = salary.maxValue;
|
|
2557
|
+
const single = salary.singleValue;
|
|
2558
|
+
const signs = {
|
|
2559
|
+
[CurrencyEnum.Values.USD]: "$",
|
|
2560
|
+
[CurrencyEnum.Values.GBP]: "\xA3",
|
|
2561
|
+
[CurrencyEnum.Values.EUR]: "\u20AC"
|
|
2562
|
+
};
|
|
2563
|
+
const sign = signs[salary.currency ?? CurrencyEnum.Values.USD];
|
|
2564
|
+
if (min == null && max == null && single == null) return null;
|
|
2565
|
+
if (single != null) return sign + single.toLocaleString();
|
|
2566
|
+
if (min === max) return sign + min?.toLocaleString();
|
|
2567
|
+
if (min != null && max != null)
|
|
2568
|
+
return sign + min?.toLocaleString() + " - " + sign + max?.toLocaleString();
|
|
2569
|
+
return null;
|
|
2570
|
+
}
|
|
2571
|
+
|
|
2545
2572
|
// src/components/jobPost/JobPost.tsx
|
|
2546
2573
|
import { jsx as jsx33, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2547
2574
|
function JobPost({
|
|
@@ -2640,24 +2667,6 @@ function JobPost({
|
|
|
2640
2667
|
);
|
|
2641
2668
|
}
|
|
2642
2669
|
|
|
2643
|
-
// src/types/data/job_posting_service_latest.ts
|
|
2644
|
-
var job_posting_service_latest_exports = {};
|
|
2645
|
-
__export(job_posting_service_latest_exports, {
|
|
2646
|
-
BestFitEnum: () => BestFitEnum,
|
|
2647
|
-
ClinicalLicenseEnum: () => ClinicalLicenseEnum,
|
|
2648
|
-
ClinicalSettingEnum: () => ClinicalSettingEnum,
|
|
2649
|
-
ClinicalSpecialtyEnum: () => ClinicalSpecialtyEnum,
|
|
2650
|
-
EmploymentLevelEnum: () => EmploymentLevelEnum,
|
|
2651
|
-
EmploymentTypeEnum: () => EmploymentTypeEnum,
|
|
2652
|
-
JobFunctionEnum: () => JobFunctionEnum,
|
|
2653
|
-
JobLocationTypeEnum: () => JobLocationTypeEnum,
|
|
2654
|
-
PublishStatusEnum: () => PublishStatusEnum2,
|
|
2655
|
-
ShiftEnum: () => ShiftEnum,
|
|
2656
|
-
TypeEnum: () => TypeEnum3,
|
|
2657
|
-
jobPostSchema: () => jobPostSchema
|
|
2658
|
-
});
|
|
2659
|
-
import { z as z3 } from "zod";
|
|
2660
|
-
|
|
2661
2670
|
// src/types/data/company_service_latest.ts
|
|
2662
2671
|
var company_service_latest_exports = {};
|
|
2663
2672
|
__export(company_service_latest_exports, {
|
|
@@ -2805,6 +2814,22 @@ var officeSchema = z2.object({
|
|
|
2805
2814
|
});
|
|
2806
2815
|
|
|
2807
2816
|
// src/types/data/job_posting_service_latest.ts
|
|
2817
|
+
var job_posting_service_latest_exports = {};
|
|
2818
|
+
__export(job_posting_service_latest_exports, {
|
|
2819
|
+
BestFitEnum: () => BestFitEnum,
|
|
2820
|
+
ClinicalLicenseEnum: () => ClinicalLicenseEnum,
|
|
2821
|
+
ClinicalSettingEnum: () => ClinicalSettingEnum,
|
|
2822
|
+
ClinicalSpecialtyEnum: () => ClinicalSpecialtyEnum,
|
|
2823
|
+
EmploymentLevelEnum: () => EmploymentLevelEnum,
|
|
2824
|
+
EmploymentTypeEnum: () => EmploymentTypeEnum,
|
|
2825
|
+
JobFunctionEnum: () => JobFunctionEnum,
|
|
2826
|
+
JobLocationTypeEnum: () => JobLocationTypeEnum,
|
|
2827
|
+
PublishStatusEnum: () => PublishStatusEnum2,
|
|
2828
|
+
ShiftEnum: () => ShiftEnum,
|
|
2829
|
+
TypeEnum: () => TypeEnum3,
|
|
2830
|
+
jobPostSchema: () => jobPostSchema
|
|
2831
|
+
});
|
|
2832
|
+
import { z as z3 } from "zod";
|
|
2808
2833
|
var TypeEnum3 = z3.enum(["JOB_POST"]);
|
|
2809
2834
|
var JobLocationTypeEnum = z3.enum(["FLOAT", "HYBRID", "ONSITE", "REMOTE"]);
|
|
2810
2835
|
var EmploymentTypeEnum = z3.enum(["CONTRACT", "FULL_TIME", "INTERNSHIP", "OTHER", "PART_TIME", "PER_DIEM", "TEMPORARY"]);
|