@next-degree/pickle-shared-js 0.4.31 → 0.5.31
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/app/layout.css +12 -0
- package/dist/app/layout.css.map +1 -1
- package/dist/app/page.cjs +99 -9
- package/dist/app/page.cjs.map +1 -1
- package/dist/app/page.js +98 -8
- package/dist/app/page.js.map +1 -1
- package/dist/components/demos/MapComponentDemo.cjs +129 -0
- package/dist/components/demos/MapComponentDemo.cjs.map +1 -0
- package/dist/components/demos/MapComponentDemo.d.cts +5 -0
- package/dist/components/demos/MapComponentDemo.d.ts +5 -0
- package/dist/components/demos/MapComponentDemo.js +107 -0
- package/dist/components/demos/MapComponentDemo.js.map +1 -0
- package/dist/components/demos/PlacesQueryInputDemo.cjs.map +1 -1
- package/dist/components/demos/PlacesQueryInputDemo.js.map +1 -1
- package/dist/components/demos/index.cjs +97 -7
- package/dist/components/demos/index.cjs.map +1 -1
- package/dist/components/demos/index.js +96 -6
- package/dist/components/demos/index.js.map +1 -1
- package/dist/components/primitives/command.d.cts +1 -1
- package/dist/components/primitives/command.d.ts +1 -1
- package/dist/components/ui/MapComponent.cjs +54 -0
- package/dist/components/ui/MapComponent.cjs.map +1 -0
- package/dist/components/ui/MapComponent.d.cts +15 -0
- package/dist/components/ui/MapComponent.d.ts +15 -0
- package/dist/components/ui/MapComponent.js +34 -0
- package/dist/components/ui/MapComponent.js.map +1 -0
- package/dist/components/ui/PlacesQueryInput.cjs.map +1 -1
- package/dist/components/ui/PlacesQueryInput.js.map +1 -1
- package/dist/index.cjs +132 -72
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +115 -57
- package/dist/index.js.map +1 -1
- package/dist/lib/google.cjs +44 -2
- package/dist/lib/google.cjs.map +1 -1
- package/dist/lib/google.d.cts +22 -1
- package/dist/lib/google.d.ts +22 -1
- package/dist/lib/google.js +40 -1
- package/dist/lib/google.js.map +1 -1
- package/dist/styles/globals.css +12 -0
- package/dist/styles/globals.css.map +1 -1
- package/package.json +2 -1
package/dist/index.cjs
CHANGED
|
@@ -39,9 +39,11 @@ __export(index_exports, {
|
|
|
39
39
|
Input: () => Input_default,
|
|
40
40
|
Label: () => Label_default,
|
|
41
41
|
ListItem: () => ListItem_default,
|
|
42
|
+
MapComponent: () => MapComponent_default,
|
|
42
43
|
PlacesQueryInput: () => PlacesQueryInput_default,
|
|
43
44
|
Select: () => Select_default,
|
|
44
|
-
cn: () => cn
|
|
45
|
+
cn: () => cn,
|
|
46
|
+
fetchLocation: () => fetchLocation
|
|
45
47
|
});
|
|
46
48
|
module.exports = __toCommonJS(index_exports);
|
|
47
49
|
|
|
@@ -532,6 +534,26 @@ var inputVariants = (0, import_cva2.cva)(
|
|
|
532
534
|
);
|
|
533
535
|
var Input_default = Input;
|
|
534
536
|
|
|
537
|
+
// src/components/ui/MapComponent.tsx
|
|
538
|
+
var import_react_google_maps = require("@vis.gl/react-google-maps");
|
|
539
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
540
|
+
function MapComponent({ apiKey, mapId, position, className, zoom = 15 }) {
|
|
541
|
+
const defaultPosition = { lat: 40.715021, lng: -74.00459 };
|
|
542
|
+
const defaultZoom = 11;
|
|
543
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_google_maps.APIProvider, { apiKey, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: cn("h-screen max-w-full", className), children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
544
|
+
import_react_google_maps.Map,
|
|
545
|
+
{
|
|
546
|
+
zoom: position ? zoom : defaultZoom,
|
|
547
|
+
center: position || defaultPosition,
|
|
548
|
+
mapId,
|
|
549
|
+
keyboardShortcuts: false,
|
|
550
|
+
disableDefaultUI: true,
|
|
551
|
+
children: position && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_google_maps.AdvancedMarker, { position, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_google_maps.Pin, { background: "#0B5441", borderColor: "#EBFDF1", glyphColor: "#D4F500" }) })
|
|
552
|
+
}
|
|
553
|
+
) }) });
|
|
554
|
+
}
|
|
555
|
+
var MapComponent_default = MapComponent;
|
|
556
|
+
|
|
535
557
|
// src/components/primitives/command.tsx
|
|
536
558
|
var import_cmdk = require("cmdk");
|
|
537
559
|
var import_lucide_react8 = require("lucide-react");
|
|
@@ -541,9 +563,9 @@ var React4 = __toESM(require("react"), 1);
|
|
|
541
563
|
var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"), 1);
|
|
542
564
|
var import_lucide_react7 = require("lucide-react");
|
|
543
565
|
var React3 = __toESM(require("react"), 1);
|
|
544
|
-
var
|
|
566
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
545
567
|
var DialogPortal = DialogPrimitive.Portal;
|
|
546
|
-
var DialogOverlay = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
568
|
+
var DialogOverlay = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
547
569
|
DialogPrimitive.Overlay,
|
|
548
570
|
{
|
|
549
571
|
ref,
|
|
@@ -555,9 +577,9 @@ var DialogOverlay = React3.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
555
577
|
}
|
|
556
578
|
));
|
|
557
579
|
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
558
|
-
var DialogContent = React3.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
559
|
-
/* @__PURE__ */ (0,
|
|
560
|
-
/* @__PURE__ */ (0,
|
|
580
|
+
var DialogContent = React3.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(DialogPortal, { children: [
|
|
581
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(DialogOverlay, {}),
|
|
582
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
561
583
|
DialogPrimitive.Content,
|
|
562
584
|
{
|
|
563
585
|
ref,
|
|
@@ -568,18 +590,18 @@ var DialogContent = React3.forwardRef(({ className, children, ...props }, ref) =
|
|
|
568
590
|
...props,
|
|
569
591
|
children: [
|
|
570
592
|
children,
|
|
571
|
-
/* @__PURE__ */ (0,
|
|
572
|
-
/* @__PURE__ */ (0,
|
|
573
|
-
/* @__PURE__ */ (0,
|
|
593
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(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: [
|
|
594
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react7.X, { className: "h-4 w-4" }),
|
|
595
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "sr-only", children: "Close" })
|
|
574
596
|
] })
|
|
575
597
|
]
|
|
576
598
|
}
|
|
577
599
|
)
|
|
578
600
|
] }));
|
|
579
601
|
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
580
|
-
var DialogHeader = ({ className, ...props }) => /* @__PURE__ */ (0,
|
|
602
|
+
var DialogHeader = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: cn("flex flex-col space-y-1.5 text-center sm:text-left", className), ...props });
|
|
581
603
|
DialogHeader.displayName = "DialogHeader";
|
|
582
|
-
var DialogFooter = ({ className, ...props }) => /* @__PURE__ */ (0,
|
|
604
|
+
var DialogFooter = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
583
605
|
"div",
|
|
584
606
|
{
|
|
585
607
|
className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className),
|
|
@@ -587,7 +609,7 @@ var DialogFooter = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_r
|
|
|
587
609
|
}
|
|
588
610
|
);
|
|
589
611
|
DialogFooter.displayName = "DialogFooter";
|
|
590
|
-
var DialogTitle = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
612
|
+
var DialogTitle = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
591
613
|
DialogPrimitive.Title,
|
|
592
614
|
{
|
|
593
615
|
ref,
|
|
@@ -596,7 +618,7 @@ var DialogTitle = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
596
618
|
}
|
|
597
619
|
));
|
|
598
620
|
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
599
|
-
var DialogDescription = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
621
|
+
var DialogDescription = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
600
622
|
DialogPrimitive.Description,
|
|
601
623
|
{
|
|
602
624
|
ref,
|
|
@@ -607,8 +629,8 @@ var DialogDescription = React3.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
607
629
|
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
608
630
|
|
|
609
631
|
// src/components/primitives/command.tsx
|
|
610
|
-
var
|
|
611
|
-
var Command = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
632
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
633
|
+
var Command = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
612
634
|
import_cmdk.Command,
|
|
613
635
|
{
|
|
614
636
|
ref,
|
|
@@ -620,9 +642,9 @@ var Command = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
620
642
|
}
|
|
621
643
|
));
|
|
622
644
|
Command.displayName = import_cmdk.Command.displayName;
|
|
623
|
-
var CommandInput = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
624
|
-
/* @__PURE__ */ (0,
|
|
625
|
-
/* @__PURE__ */ (0,
|
|
645
|
+
var CommandInput = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "m-1 flex items-center rounded-xl border px-3", "cmdk-input-wrapper": "", children: [
|
|
646
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react8.Search, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
|
|
647
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
626
648
|
import_cmdk.Command.Input,
|
|
627
649
|
{
|
|
628
650
|
ref,
|
|
@@ -635,7 +657,7 @@ var CommandInput = React4.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
635
657
|
)
|
|
636
658
|
] }));
|
|
637
659
|
CommandInput.displayName = import_cmdk.Command.Input.displayName;
|
|
638
|
-
var CommandList = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
660
|
+
var CommandList = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
639
661
|
import_cmdk.Command.List,
|
|
640
662
|
{
|
|
641
663
|
ref,
|
|
@@ -644,9 +666,9 @@ var CommandList = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
644
666
|
}
|
|
645
667
|
));
|
|
646
668
|
CommandList.displayName = import_cmdk.Command.List.displayName;
|
|
647
|
-
var CommandEmpty = React4.forwardRef((props, ref) => /* @__PURE__ */ (0,
|
|
669
|
+
var CommandEmpty = React4.forwardRef((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_cmdk.Command.Empty, { ref, className: "py-6 text-center text-sm", ...props }));
|
|
648
670
|
CommandEmpty.displayName = import_cmdk.Command.Empty.displayName;
|
|
649
|
-
var CommandGroup = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
671
|
+
var CommandGroup = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
650
672
|
import_cmdk.Command.Group,
|
|
651
673
|
{
|
|
652
674
|
ref,
|
|
@@ -658,7 +680,7 @@ var CommandGroup = React4.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
658
680
|
}
|
|
659
681
|
));
|
|
660
682
|
CommandGroup.displayName = import_cmdk.Command.Group.displayName;
|
|
661
|
-
var CommandSeparator = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
683
|
+
var CommandSeparator = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
662
684
|
import_cmdk.Command.Separator,
|
|
663
685
|
{
|
|
664
686
|
ref,
|
|
@@ -667,7 +689,7 @@ var CommandSeparator = React4.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
667
689
|
}
|
|
668
690
|
));
|
|
669
691
|
CommandSeparator.displayName = import_cmdk.Command.Separator.displayName;
|
|
670
|
-
var CommandItem = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
692
|
+
var CommandItem = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
671
693
|
import_cmdk.Command.Item,
|
|
672
694
|
{
|
|
673
695
|
ref,
|
|
@@ -680,7 +702,7 @@ var CommandItem = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
680
702
|
));
|
|
681
703
|
CommandItem.displayName = import_cmdk.Command.Item.displayName;
|
|
682
704
|
var CommandShortcut = ({ className, ...props }) => {
|
|
683
|
-
return /* @__PURE__ */ (0,
|
|
705
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
684
706
|
"span",
|
|
685
707
|
{
|
|
686
708
|
className: cn("ml-auto text-xs tracking-widest text-neutral-500", className),
|
|
@@ -703,11 +725,47 @@ var autocomplete = async (input, key) => {
|
|
|
703
725
|
console.error(error);
|
|
704
726
|
}
|
|
705
727
|
};
|
|
728
|
+
var fetchLocation = async (place, key) => {
|
|
729
|
+
try {
|
|
730
|
+
if (place.place_id) {
|
|
731
|
+
const placeDetails = await getPlaceDetails(place.place_id, key);
|
|
732
|
+
if (placeDetails) return placeDetails;
|
|
733
|
+
}
|
|
734
|
+
if (place.address) {
|
|
735
|
+
const result = await geocode(place.address, key);
|
|
736
|
+
const firstAddress = result?.[0];
|
|
737
|
+
return firstAddress;
|
|
738
|
+
}
|
|
739
|
+
return void 0;
|
|
740
|
+
} catch (error) {
|
|
741
|
+
console.error("Error fetching location:", error);
|
|
742
|
+
}
|
|
743
|
+
};
|
|
744
|
+
var getPlaceDetails = async (place_id, key) => {
|
|
745
|
+
try {
|
|
746
|
+
const response = await client.placeDetails({
|
|
747
|
+
params: { place_id, key }
|
|
748
|
+
});
|
|
749
|
+
return response.data.result;
|
|
750
|
+
} catch (error) {
|
|
751
|
+
console.error(error);
|
|
752
|
+
}
|
|
753
|
+
};
|
|
754
|
+
var geocode = async (address, key) => {
|
|
755
|
+
try {
|
|
756
|
+
const response = await client.geocode({
|
|
757
|
+
params: { address, key }
|
|
758
|
+
});
|
|
759
|
+
return response.data.results;
|
|
760
|
+
} catch (error) {
|
|
761
|
+
console.error(error);
|
|
762
|
+
}
|
|
763
|
+
};
|
|
706
764
|
|
|
707
765
|
// src/components/ui/PlacesQueryInput.tsx
|
|
708
766
|
var import_lucide_react9 = require("lucide-react");
|
|
709
767
|
var import_react4 = require("react");
|
|
710
|
-
var
|
|
768
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
711
769
|
function PlacesQueryInput({
|
|
712
770
|
apiKey,
|
|
713
771
|
selected,
|
|
@@ -762,9 +820,9 @@ function PlacesQueryInput({
|
|
|
762
820
|
window.addEventListener("resize", checkDropdownPosition);
|
|
763
821
|
return () => window.removeEventListener("resize", checkDropdownPosition);
|
|
764
822
|
}, []);
|
|
765
|
-
return /* @__PURE__ */ (0,
|
|
766
|
-
/* @__PURE__ */ (0,
|
|
767
|
-
/* @__PURE__ */ (0,
|
|
823
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: cn("relative w-full", className), ref: inputRef, onBlur: handleBlur, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Command, { children: [
|
|
824
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "relative w-full", children: [
|
|
825
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
768
826
|
CommandInput,
|
|
769
827
|
{
|
|
770
828
|
placeholder: "Type an address to search...",
|
|
@@ -773,18 +831,18 @@ function PlacesQueryInput({
|
|
|
773
831
|
className: "truncate pr-8"
|
|
774
832
|
}
|
|
775
833
|
),
|
|
776
|
-
isLoadingPredictions && /* @__PURE__ */ (0,
|
|
777
|
-
input && /* @__PURE__ */ (0,
|
|
834
|
+
isLoadingPredictions && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react9.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" }),
|
|
835
|
+
input && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
778
836
|
"button",
|
|
779
837
|
{
|
|
780
838
|
type: "button",
|
|
781
839
|
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",
|
|
782
840
|
onClick: handleClear,
|
|
783
|
-
children: /* @__PURE__ */ (0,
|
|
841
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react9.CircleX, { className: "h-4 w-4 text-green-100" })
|
|
784
842
|
}
|
|
785
843
|
)
|
|
786
844
|
] }),
|
|
787
|
-
predictions && /* @__PURE__ */ (0,
|
|
845
|
+
predictions && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
788
846
|
CommandList,
|
|
789
847
|
{
|
|
790
848
|
className: cn(
|
|
@@ -792,8 +850,8 @@ function PlacesQueryInput({
|
|
|
792
850
|
shouldOpenUpward ? "bottom-full" : "top-full"
|
|
793
851
|
),
|
|
794
852
|
children: [
|
|
795
|
-
/* @__PURE__ */ (0,
|
|
796
|
-
/* @__PURE__ */ (0,
|
|
853
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(CommandEmpty, { children: "No results" }),
|
|
854
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(CommandGroup, { children: predictions.map((prediction) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
797
855
|
CommandItem,
|
|
798
856
|
{
|
|
799
857
|
onSelect: () => handleSelect(prediction),
|
|
@@ -813,11 +871,11 @@ var PlacesQueryInput_default = PlacesQueryInput;
|
|
|
813
871
|
var import_react_slot = require("@radix-ui/react-slot");
|
|
814
872
|
var import_cva3 = require("cva");
|
|
815
873
|
var import_react5 = require("react");
|
|
816
|
-
var
|
|
874
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
817
875
|
var Button = (0, import_react5.forwardRef)(
|
|
818
876
|
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
819
877
|
const Component = asChild ? import_react_slot.Slot : "button";
|
|
820
|
-
return /* @__PURE__ */ (0,
|
|
878
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
821
879
|
Component,
|
|
822
880
|
{
|
|
823
881
|
className: cn(buttonVariants({ variant, size, className })),
|
|
@@ -926,10 +984,10 @@ var import_cva5 = require("cva");
|
|
|
926
984
|
// src/components/primitives/popover.tsx
|
|
927
985
|
var React6 = __toESM(require("react"), 1);
|
|
928
986
|
var PopoverPrimitive = __toESM(require("@radix-ui/react-popover"), 1);
|
|
929
|
-
var
|
|
987
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
930
988
|
var Popover = PopoverPrimitive.Root;
|
|
931
989
|
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
932
|
-
var PopoverContent = React6.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ (0,
|
|
990
|
+
var PopoverContent = React6.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(PopoverPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
933
991
|
PopoverPrimitive.Content,
|
|
934
992
|
{
|
|
935
993
|
ref,
|
|
@@ -946,7 +1004,7 @@ PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
|
946
1004
|
|
|
947
1005
|
// src/components/ui/Badge.tsx
|
|
948
1006
|
var import_cva4 = require("cva");
|
|
949
|
-
var
|
|
1007
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
950
1008
|
var badgeVariants = (0, import_cva4.cva)("rounded-full px-2 py-0.5 text-xs font-semibold", {
|
|
951
1009
|
variants: {
|
|
952
1010
|
variant: {
|
|
@@ -960,11 +1018,11 @@ var badgeVariants = (0, import_cva4.cva)("rounded-full px-2 py-0.5 text-xs font-
|
|
|
960
1018
|
}
|
|
961
1019
|
});
|
|
962
1020
|
function Badge({ className, variant, ...props }) {
|
|
963
|
-
return /* @__PURE__ */ (0,
|
|
1021
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: cn(badgeVariants({ variant }), className), ...props });
|
|
964
1022
|
}
|
|
965
1023
|
|
|
966
1024
|
// src/components/ui/Combobox.tsx
|
|
967
|
-
var
|
|
1025
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
968
1026
|
var Combobox = (0, import_react6.forwardRef)((props, ref) => {
|
|
969
1027
|
const {
|
|
970
1028
|
id,
|
|
@@ -1021,8 +1079,8 @@ var Combobox = (0, import_react6.forwardRef)((props, ref) => {
|
|
|
1021
1079
|
const defaultLabel = !isEmpty ? selected.map((s) => s.title).join(", ") : placeholder;
|
|
1022
1080
|
return isDefault ? defaultLabel : label;
|
|
1023
1081
|
};
|
|
1024
|
-
return /* @__PURE__ */ (0,
|
|
1025
|
-
isDefault && /* @__PURE__ */ (0,
|
|
1082
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: cn("flex flex-col gap-1", className), children: [
|
|
1083
|
+
isDefault && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1026
1084
|
Label_default,
|
|
1027
1085
|
{
|
|
1028
1086
|
text: label,
|
|
@@ -1032,15 +1090,15 @@ var Combobox = (0, import_react6.forwardRef)((props, ref) => {
|
|
|
1032
1090
|
className: classNames?.label
|
|
1033
1091
|
}
|
|
1034
1092
|
),
|
|
1035
|
-
/* @__PURE__ */ (0,
|
|
1036
|
-
/* @__PURE__ */ (0,
|
|
1037
|
-
/* @__PURE__ */ (0,
|
|
1093
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "relative flex", children: [
|
|
1094
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Popover, { open, onOpenChange: setOpen, children: [
|
|
1095
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1038
1096
|
PopoverTrigger,
|
|
1039
1097
|
{
|
|
1040
1098
|
asChild: true,
|
|
1041
1099
|
disabled: options.length === 0,
|
|
1042
1100
|
"data-testid": `${id ?? name}-combobox-trigger`,
|
|
1043
|
-
children: /* @__PURE__ */ (0,
|
|
1101
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1044
1102
|
"div",
|
|
1045
1103
|
{
|
|
1046
1104
|
ref,
|
|
@@ -1051,9 +1109,9 @@ var Combobox = (0, import_react6.forwardRef)((props, ref) => {
|
|
|
1051
1109
|
),
|
|
1052
1110
|
"aria-expanded": open,
|
|
1053
1111
|
children: [
|
|
1054
|
-
isDefault && IconComponent && /* @__PURE__ */ (0,
|
|
1055
|
-
isChip && !isEmpty && /* @__PURE__ */ (0,
|
|
1056
|
-
/* @__PURE__ */ (0,
|
|
1112
|
+
isDefault && IconComponent && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(IconComponent, { className: "h-4 w-4 shrink-0" }),
|
|
1113
|
+
isChip && !isEmpty && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Badge, { variant: "purple", children: selected.length }),
|
|
1114
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1057
1115
|
"span",
|
|
1058
1116
|
{
|
|
1059
1117
|
className: cn(
|
|
@@ -1063,7 +1121,7 @@ var Combobox = (0, import_react6.forwardRef)((props, ref) => {
|
|
|
1063
1121
|
children: handleDisplayValue()
|
|
1064
1122
|
}
|
|
1065
1123
|
),
|
|
1066
|
-
showChevron && /* @__PURE__ */ (0,
|
|
1124
|
+
showChevron && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1067
1125
|
import_lucide_react10.ChevronDownIcon,
|
|
1068
1126
|
{
|
|
1069
1127
|
className: "shrink-0 transform group-data-[state=open]:rotate-180",
|
|
@@ -1075,7 +1133,7 @@ var Combobox = (0, import_react6.forwardRef)((props, ref) => {
|
|
|
1075
1133
|
)
|
|
1076
1134
|
}
|
|
1077
1135
|
),
|
|
1078
|
-
/* @__PURE__ */ (0,
|
|
1136
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1079
1137
|
PopoverContent,
|
|
1080
1138
|
{
|
|
1081
1139
|
className: cn(
|
|
@@ -1086,16 +1144,16 @@ var Combobox = (0, import_react6.forwardRef)((props, ref) => {
|
|
|
1086
1144
|
collisionPadding: 8,
|
|
1087
1145
|
sideOffset: 4,
|
|
1088
1146
|
align: "start",
|
|
1089
|
-
children: /* @__PURE__ */ (0,
|
|
1090
|
-
!hideSearchBox && /* @__PURE__ */ (0,
|
|
1091
|
-
/* @__PURE__ */ (0,
|
|
1092
|
-
/* @__PURE__ */ (0,
|
|
1093
|
-
/* @__PURE__ */ (0,
|
|
1147
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Command, { children: [
|
|
1148
|
+
!hideSearchBox && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(CommandInput, { placeholder: "Search..." }),
|
|
1149
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(CommandList, { children: [
|
|
1150
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(CommandEmpty, { children: "No results" }),
|
|
1151
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(CommandGroup, { children: options.map(({ id: id2, ...option }) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1094
1152
|
CommandItem,
|
|
1095
1153
|
{
|
|
1096
1154
|
value: option.title,
|
|
1097
1155
|
onSelect: () => handleSelect(option.value),
|
|
1098
|
-
children: /* @__PURE__ */ (0,
|
|
1156
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1099
1157
|
ListItem_default,
|
|
1100
1158
|
{
|
|
1101
1159
|
className: cn(classNames?.items, "truncate py-1"),
|
|
@@ -1108,19 +1166,19 @@ var Combobox = (0, import_react6.forwardRef)((props, ref) => {
|
|
|
1108
1166
|
id2
|
|
1109
1167
|
)) })
|
|
1110
1168
|
] }),
|
|
1111
|
-
!!footer && /* @__PURE__ */ (0,
|
|
1169
|
+
!!footer && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Separator, {}),
|
|
1112
1170
|
footer && footer({ close })
|
|
1113
1171
|
] })
|
|
1114
1172
|
}
|
|
1115
1173
|
)
|
|
1116
1174
|
] }),
|
|
1117
|
-
isDefault && !isEmpty && /* @__PURE__ */ (0,
|
|
1175
|
+
isDefault && !isEmpty && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1118
1176
|
"button",
|
|
1119
1177
|
{
|
|
1120
1178
|
type: "button",
|
|
1121
1179
|
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",
|
|
1122
1180
|
onClick: handleClear,
|
|
1123
|
-
children: /* @__PURE__ */ (0,
|
|
1181
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react10.CircleX, { className: "h-4 w-4 text-green-100" })
|
|
1124
1182
|
}
|
|
1125
1183
|
)
|
|
1126
1184
|
] })
|
|
@@ -1157,7 +1215,7 @@ var triggerVariants = (0, import_cva5.cva)(
|
|
|
1157
1215
|
var import_cva6 = require("cva");
|
|
1158
1216
|
var import_lucide_react11 = require("lucide-react");
|
|
1159
1217
|
var import_react7 = require("react");
|
|
1160
|
-
var
|
|
1218
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1161
1219
|
var Counter = (0, import_react7.forwardRef)(
|
|
1162
1220
|
({ label, error, min, max, step = 1, description, theme, value, classNames, onChange, ...props }, ref) => {
|
|
1163
1221
|
const [count, setCount] = (0, import_react7.useState)(0);
|
|
@@ -1192,13 +1250,13 @@ var Counter = (0, import_react7.forwardRef)(
|
|
|
1192
1250
|
onChange?.(newValue);
|
|
1193
1251
|
setCount(newValue);
|
|
1194
1252
|
};
|
|
1195
|
-
return /* @__PURE__ */ (0,
|
|
1253
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
1196
1254
|
"div",
|
|
1197
1255
|
{
|
|
1198
1256
|
className: cn("flex w-auto flex-col gap-1", classNames?.root),
|
|
1199
1257
|
"data-testid": `counter-wrapper-${props.id}`,
|
|
1200
1258
|
children: [
|
|
1201
|
-
label && /* @__PURE__ */ (0,
|
|
1259
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1202
1260
|
Label_default,
|
|
1203
1261
|
{
|
|
1204
1262
|
text: label,
|
|
@@ -1208,17 +1266,17 @@ var Counter = (0, import_react7.forwardRef)(
|
|
|
1208
1266
|
className: classNames?.label
|
|
1209
1267
|
}
|
|
1210
1268
|
),
|
|
1211
|
-
/* @__PURE__ */ (0,
|
|
1212
|
-
/* @__PURE__ */ (0,
|
|
1269
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "relative flex w-[122px] flex-row items-center", children: [
|
|
1270
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1213
1271
|
"button",
|
|
1214
1272
|
{
|
|
1215
1273
|
type: "button",
|
|
1216
1274
|
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",
|
|
1217
1275
|
onClick: decrement,
|
|
1218
|
-
children: /* @__PURE__ */ (0,
|
|
1276
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react11.Minus, { className: "h-4 w-4 text-green-100" })
|
|
1219
1277
|
}
|
|
1220
1278
|
),
|
|
1221
|
-
/* @__PURE__ */ (0,
|
|
1279
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1222
1280
|
"input",
|
|
1223
1281
|
{
|
|
1224
1282
|
className: cn(counterVariants({ theme }), classNames?.input),
|
|
@@ -1229,17 +1287,17 @@ var Counter = (0, import_react7.forwardRef)(
|
|
|
1229
1287
|
...props
|
|
1230
1288
|
}
|
|
1231
1289
|
),
|
|
1232
|
-
/* @__PURE__ */ (0,
|
|
1290
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1233
1291
|
"button",
|
|
1234
1292
|
{
|
|
1235
1293
|
type: "button",
|
|
1236
1294
|
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",
|
|
1237
1295
|
onClick: increment,
|
|
1238
|
-
children: /* @__PURE__ */ (0,
|
|
1296
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react11.Plus, { className: "h-4 w-4 text-green-100" })
|
|
1239
1297
|
}
|
|
1240
1298
|
)
|
|
1241
1299
|
] }),
|
|
1242
|
-
/* @__PURE__ */ (0,
|
|
1300
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ErrorMessage_default, { message: error })
|
|
1243
1301
|
]
|
|
1244
1302
|
}
|
|
1245
1303
|
);
|
|
@@ -1306,8 +1364,10 @@ var counterVariants = (0, import_cva6.cva)(
|
|
|
1306
1364
|
Input,
|
|
1307
1365
|
Label,
|
|
1308
1366
|
ListItem,
|
|
1367
|
+
MapComponent,
|
|
1309
1368
|
PlacesQueryInput,
|
|
1310
1369
|
Select,
|
|
1311
|
-
cn
|
|
1370
|
+
cn,
|
|
1371
|
+
fetchLocation
|
|
1312
1372
|
});
|
|
1313
1373
|
//# sourceMappingURL=index.cjs.map
|