@chekinapp/ui 0.0.92 → 0.0.93
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/index.cjs +1112 -611
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +133 -12
- package/dist/index.d.ts +133 -12
- package/dist/index.js +1096 -588
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -1707,6 +1707,25 @@ function toCssSize(size) {
|
|
|
1707
1707
|
return size;
|
|
1708
1708
|
}
|
|
1709
1709
|
}
|
|
1710
|
+
function getCanvasBlob(canvas) {
|
|
1711
|
+
return new Promise((resolve) => {
|
|
1712
|
+
canvas.toBlob((blob) => {
|
|
1713
|
+
resolve(blob);
|
|
1714
|
+
});
|
|
1715
|
+
});
|
|
1716
|
+
}
|
|
1717
|
+
function toBase64(file) {
|
|
1718
|
+
return new Promise((resolve, reject) => {
|
|
1719
|
+
const reader = new FileReader();
|
|
1720
|
+
reader.readAsDataURL(file);
|
|
1721
|
+
reader.onload = () => resolve(String(reader.result));
|
|
1722
|
+
reader.onerror = () => reject(new Error("Failed to read file as base64"));
|
|
1723
|
+
});
|
|
1724
|
+
}
|
|
1725
|
+
function getFileSizeMB(file) {
|
|
1726
|
+
if (!file) return;
|
|
1727
|
+
return file.size / Math.pow(1024, 2);
|
|
1728
|
+
}
|
|
1710
1729
|
|
|
1711
1730
|
// src/tooltip/Tooltip.tsx
|
|
1712
1731
|
import { jsx as jsx25, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
@@ -2643,7 +2662,7 @@ function useCombinedRef(...refs) {
|
|
|
2643
2662
|
import { useEffect as useEffect6, useState as useState6 } from "react";
|
|
2644
2663
|
var MOBILE_BREAKPOINT = 768;
|
|
2645
2664
|
function useIsMobile({ breakpoint = MOBILE_BREAKPOINT } = {}) {
|
|
2646
|
-
const [
|
|
2665
|
+
const [isMobile3, setIsMobile] = useState6(void 0);
|
|
2647
2666
|
useEffect6(() => {
|
|
2648
2667
|
const mediaQuery = window.matchMedia(`(max-width: ${breakpoint - 1}px)`);
|
|
2649
2668
|
const onChange = () => {
|
|
@@ -2655,7 +2674,7 @@ function useIsMobile({ breakpoint = MOBILE_BREAKPOINT } = {}) {
|
|
|
2655
2674
|
mediaQuery.removeEventListener("change", onChange);
|
|
2656
2675
|
};
|
|
2657
2676
|
}, [breakpoint]);
|
|
2658
|
-
return !!
|
|
2677
|
+
return !!isMobile3;
|
|
2659
2678
|
}
|
|
2660
2679
|
|
|
2661
2680
|
// src/hooks/use-is-mounted.ts
|
|
@@ -5600,7 +5619,23 @@ var translation_default2 = {
|
|
|
5600
5619
|
past_dates: "Date cannot be before {{minDate}}",
|
|
5601
5620
|
future_dates: "Date cannot be after {{maxDate}}",
|
|
5602
5621
|
signature_placeholder_text: "Sign inside this box.<br/> Use your finger.<br/> Tap to start.",
|
|
5622
|
+
open_devices_camera: "Open device's camera",
|
|
5623
|
+
place_document_inside_frame: "Place your document inside the frame",
|
|
5624
|
+
close_other_application_that_may_be_using_your_camera: "Close other applications that may be using your camera",
|
|
5625
|
+
if_you_use_external_camera_disconnect_and_reconnect: "If you use an external camera, disconnect and reconnect it",
|
|
5626
|
+
close_the_browser_re_open_it: "Close the browser and reopen it",
|
|
5603
5627
|
camera_permissions_denied: "The camera doesn't open? Make sure to allow the browser permission to use the camera.",
|
|
5628
|
+
camera_errors: {
|
|
5629
|
+
experiencing_camera_issues: "Experiencing camera issues?",
|
|
5630
|
+
chekin_cant_use_your_camera: "Chekin can't use your camera",
|
|
5631
|
+
please_try_a_different_browser: "Your camera doesn't work in this browser. Please, try to open the link in a different browser.",
|
|
5632
|
+
permissions_denied: "Permission denied",
|
|
5633
|
+
camera_permissions_denied: "The camera doesn't open? Make sure to allow the browser permission to use the camera.",
|
|
5634
|
+
no_camera_device_found: "No camera device found. Please connect a camera.",
|
|
5635
|
+
constraints_camera_error: "Constraints cannot be satisfied by available devices.",
|
|
5636
|
+
safari_camera_error: "Safari could not satisfy the camera requirements",
|
|
5637
|
+
try_chrome_or_firefox: "Please try Chrome or Firefox"
|
|
5638
|
+
},
|
|
5604
5639
|
clear: "Clear",
|
|
5605
5640
|
show_less: "Show less",
|
|
5606
5641
|
show_more: "Show more"
|
|
@@ -8210,7 +8245,7 @@ var SidebarProvider = React28.forwardRef(
|
|
|
8210
8245
|
stateName = SIDEBAR_COOKIE_NAME_DEFAULT,
|
|
8211
8246
|
...props
|
|
8212
8247
|
}, ref) => {
|
|
8213
|
-
const
|
|
8248
|
+
const isMobile3 = useIsMobile({ breakpoint: 641 });
|
|
8214
8249
|
const [openMobile, setOpenMobile] = React28.useState(false);
|
|
8215
8250
|
const [_open, _setOpen] = React28.useState(defaultOpen);
|
|
8216
8251
|
const open = openProp ?? _open;
|
|
@@ -8227,8 +8262,8 @@ var SidebarProvider = React28.forwardRef(
|
|
|
8227
8262
|
[setOpenProp, open, stateName]
|
|
8228
8263
|
);
|
|
8229
8264
|
const toggleSidebar = React28.useCallback(() => {
|
|
8230
|
-
return
|
|
8231
|
-
}, [
|
|
8265
|
+
return isMobile3 ? setOpenMobile((value) => !value) : setOpen((value) => !value);
|
|
8266
|
+
}, [isMobile3, setOpen]);
|
|
8232
8267
|
React28.useEffect(() => {
|
|
8233
8268
|
const handleKeyDown = (event) => {
|
|
8234
8269
|
if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
|
|
@@ -8245,12 +8280,12 @@ var SidebarProvider = React28.forwardRef(
|
|
|
8245
8280
|
state,
|
|
8246
8281
|
open,
|
|
8247
8282
|
setOpen,
|
|
8248
|
-
isMobile:
|
|
8283
|
+
isMobile: isMobile3,
|
|
8249
8284
|
openMobile,
|
|
8250
8285
|
setOpenMobile,
|
|
8251
8286
|
toggleSidebar
|
|
8252
8287
|
}),
|
|
8253
|
-
[state, open, setOpen,
|
|
8288
|
+
[state, open, setOpen, isMobile3, openMobile, setOpenMobile, toggleSidebar]
|
|
8254
8289
|
);
|
|
8255
8290
|
return /* @__PURE__ */ jsx105(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx105(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsx105(
|
|
8256
8291
|
"div",
|
|
@@ -8277,7 +8312,7 @@ var Sidebar = React28.forwardRef(
|
|
|
8277
8312
|
children,
|
|
8278
8313
|
...props
|
|
8279
8314
|
}, ref) => {
|
|
8280
|
-
const { isMobile:
|
|
8315
|
+
const { isMobile: isMobile3, state, openMobile, setOpenMobile } = useSidebar();
|
|
8281
8316
|
if (collapsible === "none") {
|
|
8282
8317
|
return /* @__PURE__ */ jsx105(
|
|
8283
8318
|
"div",
|
|
@@ -8292,7 +8327,7 @@ var Sidebar = React28.forwardRef(
|
|
|
8292
8327
|
}
|
|
8293
8328
|
);
|
|
8294
8329
|
}
|
|
8295
|
-
if (
|
|
8330
|
+
if (isMobile3) {
|
|
8296
8331
|
return /* @__PURE__ */ jsx105(Sheet, { open: openMobile, onOpenChange: setOpenMobile, ...props, children: /* @__PURE__ */ jsxs64(
|
|
8297
8332
|
SheetContent,
|
|
8298
8333
|
{
|
|
@@ -8363,7 +8398,7 @@ var Sidebar = React28.forwardRef(
|
|
|
8363
8398
|
);
|
|
8364
8399
|
Sidebar.displayName = "Sidebar";
|
|
8365
8400
|
var SidebarTrigger = React28.forwardRef(({ className, onClick, icon, ...props }, ref) => {
|
|
8366
|
-
const { toggleSidebar, open, isMobile:
|
|
8401
|
+
const { toggleSidebar, open, isMobile: isMobile3, openMobile } = useSidebar();
|
|
8367
8402
|
return /* @__PURE__ */ jsxs64(
|
|
8368
8403
|
Button,
|
|
8369
8404
|
{
|
|
@@ -8382,7 +8417,7 @@ var SidebarTrigger = React28.forwardRef(({ className, onClick, icon, ...props },
|
|
|
8382
8417
|
},
|
|
8383
8418
|
...props,
|
|
8384
8419
|
children: [
|
|
8385
|
-
icon || (
|
|
8420
|
+
icon || (isMobile3 ? openMobile : open) ? icon || /* @__PURE__ */ jsx105(ArrowLeftFromLineIcon, {}) : /* @__PURE__ */ jsx105(ArrowRightFromLineIcon, {}),
|
|
8386
8421
|
/* @__PURE__ */ jsx105("span", { className: "sr-only", children: "Toggle Sidebar" })
|
|
8387
8422
|
]
|
|
8388
8423
|
}
|
|
@@ -8602,7 +8637,7 @@ var SidebarMenuButton = React28.forwardRef(
|
|
|
8602
8637
|
...props
|
|
8603
8638
|
}, ref) => {
|
|
8604
8639
|
const Comp = asChild ? Slot4 : "button";
|
|
8605
|
-
const { isMobile:
|
|
8640
|
+
const { isMobile: isMobile3, state } = useSidebar();
|
|
8606
8641
|
const button = /* @__PURE__ */ jsx105(
|
|
8607
8642
|
Comp,
|
|
8608
8643
|
{
|
|
@@ -8626,7 +8661,7 @@ var SidebarMenuButton = React28.forwardRef(
|
|
|
8626
8661
|
{
|
|
8627
8662
|
side: "right",
|
|
8628
8663
|
align: "center",
|
|
8629
|
-
hidden: state !== "collapsed" ||
|
|
8664
|
+
hidden: state !== "collapsed" || isMobile3,
|
|
8630
8665
|
className: "capitalize",
|
|
8631
8666
|
variant: "dark",
|
|
8632
8667
|
...tooltipProps
|
|
@@ -8655,8 +8690,8 @@ var SidebarMenuAction = React28.forwardRef(({ className, asChild = false, showOn
|
|
|
8655
8690
|
SidebarMenuAction.displayName = "SidebarMenuAction";
|
|
8656
8691
|
var SidebarMenuBadge = React28.forwardRef(
|
|
8657
8692
|
({ className, ...props }, ref) => {
|
|
8658
|
-
const { open, isMobile:
|
|
8659
|
-
const isOpen =
|
|
8693
|
+
const { open, isMobile: isMobile3, openMobile } = useSidebar();
|
|
8694
|
+
const isOpen = isMobile3 ? openMobile : open;
|
|
8660
8695
|
return /* @__PURE__ */ jsx105(
|
|
8661
8696
|
"div",
|
|
8662
8697
|
{
|
|
@@ -10733,147 +10768,619 @@ function VideoPlayer({
|
|
|
10733
10768
|
}
|
|
10734
10769
|
|
|
10735
10770
|
// src/webcam/Webcam.tsx
|
|
10736
|
-
import {
|
|
10737
|
-
|
|
10738
|
-
|
|
10771
|
+
import {
|
|
10772
|
+
forwardRef as forwardRef54,
|
|
10773
|
+
memo as memo7,
|
|
10774
|
+
useCallback as useCallback27,
|
|
10775
|
+
useImperativeHandle,
|
|
10776
|
+
useMemo as useMemo7,
|
|
10777
|
+
useRef as useRef25,
|
|
10778
|
+
useState as useState35
|
|
10779
|
+
} from "react";
|
|
10780
|
+
import { isFirefox, isMobile as isMobile2 } from "react-device-detect";
|
|
10739
10781
|
import ReactWebcam from "react-webcam";
|
|
10740
10782
|
|
|
10741
|
-
// src/
|
|
10742
|
-
|
|
10743
|
-
|
|
10783
|
+
// src/lib/compression.ts
|
|
10784
|
+
var IDENTITY_VERIFICATION_PHOTOS_MAX_SIZE_MB = 6;
|
|
10785
|
+
var IDENTITY_VERIFICATION_PHOTOS_QUALITY = 0.8;
|
|
10786
|
+
async function compressFile(file, { convertSize }) {
|
|
10787
|
+
const { default: Compressor } = await import("compressorjs");
|
|
10788
|
+
return new Promise((resolve, reject) => {
|
|
10789
|
+
new Compressor(file, {
|
|
10790
|
+
convertSize: convertSize ? convertSize * 1e6 : void 0,
|
|
10791
|
+
quality: 1,
|
|
10792
|
+
success: (result) => resolve(result),
|
|
10793
|
+
error: reject
|
|
10794
|
+
});
|
|
10795
|
+
});
|
|
10796
|
+
}
|
|
10797
|
+
async function compressImage(image) {
|
|
10798
|
+
const { default: Compressor } = await import("compressorjs");
|
|
10799
|
+
const parsedImage = new File([image], image.name, { type: image.type });
|
|
10800
|
+
return new Promise((resolve, reject) => {
|
|
10801
|
+
new Compressor(parsedImage, {
|
|
10802
|
+
convertSize: IDENTITY_VERIFICATION_PHOTOS_MAX_SIZE_MB * 1e6,
|
|
10803
|
+
quality: IDENTITY_VERIFICATION_PHOTOS_QUALITY,
|
|
10804
|
+
success: (compressedResult) => {
|
|
10805
|
+
toBase64(compressedResult).then((result) => {
|
|
10806
|
+
console.log(
|
|
10807
|
+
"Before: ",
|
|
10808
|
+
getFileSizeMB(image)?.toFixed(2),
|
|
10809
|
+
"MB",
|
|
10810
|
+
"After: ",
|
|
10811
|
+
getFileSizeMB(compressedResult)?.toFixed(2),
|
|
10812
|
+
"MB"
|
|
10813
|
+
);
|
|
10814
|
+
resolve(result);
|
|
10815
|
+
}, reject);
|
|
10816
|
+
},
|
|
10817
|
+
error: (error) => {
|
|
10818
|
+
if (error.message.includes("Failed to load the image")) {
|
|
10819
|
+
reject(new Error("Unable to process the selected image. Please try a different image."));
|
|
10820
|
+
return;
|
|
10821
|
+
}
|
|
10822
|
+
reject(error);
|
|
10823
|
+
}
|
|
10824
|
+
});
|
|
10825
|
+
});
|
|
10744
10826
|
}
|
|
10745
10827
|
|
|
10746
|
-
// src/webcam/
|
|
10747
|
-
import {
|
|
10748
|
-
|
|
10749
|
-
|
|
10750
|
-
|
|
10751
|
-
|
|
10752
|
-
|
|
10753
|
-
height: { ideal: 2160 }
|
|
10754
|
-
}
|
|
10755
|
-
};
|
|
10828
|
+
// src/webcam/useErrorHandler.ts
|
|
10829
|
+
import { useCallback as useCallback26 } from "react";
|
|
10830
|
+
import { useTranslation as useTranslation23 } from "react-i18next";
|
|
10831
|
+
import { isSafari as isSafari2 } from "react-device-detect";
|
|
10832
|
+
|
|
10833
|
+
// src/webcam/utils.ts
|
|
10834
|
+
import { isMobile, isSafari, isTablet } from "react-device-detect";
|
|
10756
10835
|
var isMobileOrTablet = () => isMobile || isTablet;
|
|
10757
|
-
|
|
10836
|
+
var getLivenessOptimizedConstraints = (deviceId, additional) => {
|
|
10837
|
+
const additionalConstraints = typeof additional === "object" && additional !== null ? additional : {};
|
|
10838
|
+
const baseConstraints = {
|
|
10839
|
+
deviceId: deviceId ? { exact: deviceId } : void 0,
|
|
10840
|
+
facingMode: { ideal: "user" },
|
|
10841
|
+
width: { min: 320, ideal: 800 },
|
|
10842
|
+
height: { min: 240, ideal: 600 },
|
|
10843
|
+
frameRate: { ideal: 24 },
|
|
10844
|
+
resizeMode: "crop-and-scale",
|
|
10845
|
+
aspectRatio: { ideal: 1.333 },
|
|
10846
|
+
...additionalConstraints
|
|
10847
|
+
};
|
|
10758
10848
|
if (isMobileOrTablet()) {
|
|
10759
10849
|
return {
|
|
10760
|
-
|
|
10761
|
-
|
|
10762
|
-
|
|
10763
|
-
|
|
10764
|
-
}
|
|
10850
|
+
...baseConstraints,
|
|
10851
|
+
width: { min: 320, ideal: 640 },
|
|
10852
|
+
height: { min: 240, ideal: 480 },
|
|
10853
|
+
aspectRatio: { ideal: 1 },
|
|
10854
|
+
facingMode: { ideal: "environment" },
|
|
10855
|
+
...additionalConstraints
|
|
10765
10856
|
};
|
|
10766
10857
|
}
|
|
10858
|
+
return baseConstraints;
|
|
10859
|
+
};
|
|
10860
|
+
function getReducedVideoConstraints({
|
|
10861
|
+
deviceId,
|
|
10862
|
+
facingMode,
|
|
10863
|
+
additional
|
|
10864
|
+
}) {
|
|
10865
|
+
const additionalConstraints = typeof additional === "object" ? additional : {};
|
|
10767
10866
|
return {
|
|
10768
|
-
|
|
10867
|
+
deviceId: deviceId ? { exact: deviceId } : void 0,
|
|
10868
|
+
facingMode: { ideal: facingMode || "user" },
|
|
10869
|
+
width: { min: 320, ideal: 640 },
|
|
10870
|
+
height: { min: 240, ideal: 480 },
|
|
10871
|
+
...additionalConstraints
|
|
10769
10872
|
};
|
|
10770
10873
|
}
|
|
10771
|
-
|
|
10772
|
-
|
|
10773
|
-
|
|
10774
|
-
|
|
10775
|
-
|
|
10776
|
-
|
|
10777
|
-
|
|
10778
|
-
|
|
10779
|
-
|
|
10780
|
-
|
|
10781
|
-
|
|
10782
|
-
|
|
10783
|
-
|
|
10784
|
-
|
|
10785
|
-
|
|
10786
|
-
|
|
10787
|
-
|
|
10788
|
-
|
|
10789
|
-
|
|
10874
|
+
function getMobileOrDesktopVideoConstraints({
|
|
10875
|
+
deviceId,
|
|
10876
|
+
facingMode,
|
|
10877
|
+
additional,
|
|
10878
|
+
optimizedForLiveness = false
|
|
10879
|
+
}) {
|
|
10880
|
+
const additionalConstraints = typeof additional === "object" ? additional : {};
|
|
10881
|
+
if (optimizedForLiveness) {
|
|
10882
|
+
return getLivenessOptimizedConstraints(deviceId, additionalConstraints);
|
|
10883
|
+
}
|
|
10884
|
+
const initialConstraints = {
|
|
10885
|
+
deviceId: deviceId ? { exact: deviceId } : void 0,
|
|
10886
|
+
facingMode: { ideal: facingMode || "user" },
|
|
10887
|
+
width: isSafari ? { min: 320, ideal: 1920 } : { min: 320, ideal: 4096, max: 4096 },
|
|
10888
|
+
height: isSafari ? { min: 240, ideal: 1080 } : { min: 240, ideal: 2160, max: 2160 },
|
|
10889
|
+
frameRate: { ideal: 30 },
|
|
10890
|
+
resizeMode: "none",
|
|
10891
|
+
aspectRatio: { ideal: 1.777 },
|
|
10892
|
+
...additionalConstraints
|
|
10893
|
+
};
|
|
10894
|
+
if (isMobileOrTablet()) {
|
|
10895
|
+
return {
|
|
10896
|
+
...initialConstraints,
|
|
10897
|
+
aspectRatio: { ideal: 1 },
|
|
10898
|
+
facingMode: { ideal: "environment" },
|
|
10899
|
+
...additionalConstraints
|
|
10900
|
+
};
|
|
10901
|
+
}
|
|
10902
|
+
if (isSafari && !isMobile) {
|
|
10903
|
+
return {
|
|
10904
|
+
deviceId: deviceId ? { ideal: deviceId } : void 0,
|
|
10905
|
+
width: { min: 320, ideal: 1920 },
|
|
10906
|
+
height: { min: 240, ideal: 1080 },
|
|
10907
|
+
...additionalConstraints
|
|
10908
|
+
};
|
|
10909
|
+
}
|
|
10910
|
+
return initialConstraints;
|
|
10911
|
+
}
|
|
10912
|
+
function isDOMException(error) {
|
|
10913
|
+
return error instanceof DOMException && Boolean(error?.name);
|
|
10914
|
+
}
|
|
10915
|
+
function getPhotoCanvas({
|
|
10916
|
+
player,
|
|
10917
|
+
container,
|
|
10918
|
+
scanArea,
|
|
10919
|
+
canvas,
|
|
10920
|
+
cropToScanArea
|
|
10921
|
+
}) {
|
|
10922
|
+
if (!canvas) return;
|
|
10923
|
+
const playerWidth = player?.videoWidth ?? 1280;
|
|
10924
|
+
const playerHeight = player?.videoHeight ?? 720;
|
|
10925
|
+
const playerAR = playerWidth / playerHeight;
|
|
10926
|
+
const canvasWidth = container?.offsetWidth ?? 1280;
|
|
10927
|
+
const canvasHeight = container?.offsetHeight ?? 1280;
|
|
10928
|
+
const canvasAR = canvasWidth / canvasHeight;
|
|
10929
|
+
let sourceX;
|
|
10930
|
+
let sourceY;
|
|
10931
|
+
let sourceWidth;
|
|
10932
|
+
let sourceHeight;
|
|
10933
|
+
if (playerAR > canvasAR) {
|
|
10934
|
+
sourceHeight = playerHeight;
|
|
10935
|
+
sourceWidth = playerHeight * canvasAR;
|
|
10936
|
+
sourceX = (playerWidth - sourceWidth) / 2;
|
|
10937
|
+
sourceY = 0;
|
|
10938
|
+
} else {
|
|
10939
|
+
sourceWidth = playerWidth;
|
|
10940
|
+
sourceHeight = playerWidth / canvasAR;
|
|
10941
|
+
sourceX = 0;
|
|
10942
|
+
sourceY = (playerHeight - sourceHeight) / 2;
|
|
10943
|
+
}
|
|
10944
|
+
if (cropToScanArea && scanArea && player) {
|
|
10945
|
+
const scanAreaRect = scanArea.getBoundingClientRect();
|
|
10946
|
+
const scaleY = playerHeight / player.clientHeight;
|
|
10947
|
+
const offsetX = (playerWidth - player.clientWidth * scaleY) / 2;
|
|
10948
|
+
const offsetY = (playerHeight - player.clientHeight * scaleY) / 2;
|
|
10949
|
+
const cropX = offsetX + (player.clientWidth - scanAreaRect.width) / 2 * scaleY;
|
|
10950
|
+
const cropY = offsetY + (player.clientHeight - scanAreaRect.height) / 2 * scaleY;
|
|
10951
|
+
const cropWidth = scanAreaRect.width * scaleY;
|
|
10952
|
+
const cropHeight = scanAreaRect.height * scaleY;
|
|
10953
|
+
canvas.width = cropWidth;
|
|
10954
|
+
canvas.height = cropHeight;
|
|
10955
|
+
const context2 = canvas.getContext("2d");
|
|
10956
|
+
if (context2) {
|
|
10957
|
+
context2.drawImage(
|
|
10958
|
+
player,
|
|
10959
|
+
cropX,
|
|
10960
|
+
cropY,
|
|
10961
|
+
cropWidth,
|
|
10962
|
+
cropHeight,
|
|
10963
|
+
0,
|
|
10964
|
+
0,
|
|
10965
|
+
cropWidth,
|
|
10966
|
+
cropHeight
|
|
10967
|
+
);
|
|
10968
|
+
}
|
|
10969
|
+
return canvas;
|
|
10970
|
+
}
|
|
10971
|
+
canvas.width = sourceWidth;
|
|
10972
|
+
canvas.height = sourceHeight;
|
|
10973
|
+
const context = canvas.getContext("2d");
|
|
10974
|
+
if (context && player) {
|
|
10975
|
+
context.drawImage(
|
|
10976
|
+
player,
|
|
10977
|
+
sourceX,
|
|
10978
|
+
sourceY,
|
|
10979
|
+
sourceWidth,
|
|
10980
|
+
sourceHeight,
|
|
10981
|
+
0,
|
|
10982
|
+
0,
|
|
10983
|
+
sourceWidth,
|
|
10984
|
+
sourceHeight
|
|
10790
10985
|
);
|
|
10791
|
-
|
|
10792
|
-
|
|
10793
|
-
|
|
10794
|
-
|
|
10795
|
-
|
|
10796
|
-
|
|
10797
|
-
|
|
10798
|
-
|
|
10799
|
-
|
|
10800
|
-
|
|
10801
|
-
|
|
10802
|
-
|
|
10803
|
-
|
|
10804
|
-
if (
|
|
10805
|
-
|
|
10806
|
-
|
|
10807
|
-
|
|
10808
|
-
|
|
10809
|
-
|
|
10810
|
-
|
|
10811
|
-
|
|
10812
|
-
|
|
10813
|
-
|
|
10814
|
-
|
|
10815
|
-
|
|
10816
|
-
|
|
10817
|
-
|
|
10818
|
-
|
|
10986
|
+
}
|
|
10987
|
+
return canvas;
|
|
10988
|
+
}
|
|
10989
|
+
|
|
10990
|
+
// src/webcam/useErrorHandler.ts
|
|
10991
|
+
var GET_USER_MEDIA_ERROR = "getUserMedia is not implemented in this browser";
|
|
10992
|
+
function useErrorHandler({ onError }) {
|
|
10993
|
+
const { t } = useTranslation23();
|
|
10994
|
+
const handleError = useEvent(onError);
|
|
10995
|
+
const handleUserMediaError = useCallback26(
|
|
10996
|
+
(error) => {
|
|
10997
|
+
console.error(error);
|
|
10998
|
+
let errorText = "";
|
|
10999
|
+
if (error?.message === GET_USER_MEDIA_ERROR) {
|
|
11000
|
+
errorText = t("camera_errors.chekin_cant_use_your_camera");
|
|
11001
|
+
handleError({
|
|
11002
|
+
title: errorText,
|
|
11003
|
+
message: t("camera_errors.please_try_a_different_browser")
|
|
11004
|
+
});
|
|
11005
|
+
} else if (isDOMException(error)) {
|
|
11006
|
+
switch (error.name) {
|
|
11007
|
+
case "PermissionDeniedError":
|
|
11008
|
+
case "NotAllowedError":
|
|
11009
|
+
errorText = `${t("camera_errors.permissions_denied")}. ${t(
|
|
11010
|
+
"camera_errors.camera_permissions_denied"
|
|
11011
|
+
)}`;
|
|
11012
|
+
toast2.error(errorText);
|
|
11013
|
+
break;
|
|
11014
|
+
case "NotFoundError":
|
|
11015
|
+
errorText = t("camera_errors.no_camera_device_found");
|
|
11016
|
+
toast2.error(errorText);
|
|
11017
|
+
break;
|
|
11018
|
+
case "NotReadableError":
|
|
11019
|
+
case "AbortError":
|
|
11020
|
+
errorText = t("camera_errors.chekin_cant_use_your_camera");
|
|
11021
|
+
handleError({
|
|
11022
|
+
title: errorText,
|
|
11023
|
+
message: `${t("close_other_application_that_may_be_using_your_camera")}.
|
|
11024
|
+
${t("if_you_use_external_camera_disconnect_and_reconnect")}.
|
|
11025
|
+
${t("close_the_browser_re_open_it")}.`
|
|
11026
|
+
});
|
|
11027
|
+
break;
|
|
11028
|
+
case "OverconstrainedError":
|
|
11029
|
+
errorText = t("camera_errors.constraints_camera_error");
|
|
11030
|
+
if (isSafari2) {
|
|
11031
|
+
handleError({
|
|
11032
|
+
title: errorText,
|
|
11033
|
+
message: `${t("camera_errors.safari_camera_error")}. ${t(
|
|
11034
|
+
"camera_errors.try_chrome_or_firefox"
|
|
11035
|
+
)}.`
|
|
11036
|
+
});
|
|
11037
|
+
} else {
|
|
11038
|
+
toast2.error(errorText);
|
|
10819
11039
|
}
|
|
10820
|
-
|
|
10821
|
-
|
|
10822
|
-
|
|
10823
|
-
|
|
11040
|
+
break;
|
|
11041
|
+
default:
|
|
11042
|
+
errorText = t("camera_errors.chekin_cant_use_your_camera");
|
|
11043
|
+
handleError({
|
|
11044
|
+
title: errorText,
|
|
11045
|
+
message: `${t("camera_errors.please_try_a_different_browser")} ${error}`
|
|
11046
|
+
});
|
|
10824
11047
|
}
|
|
11048
|
+
} else {
|
|
11049
|
+
errorText = t("camera_errors.chekin_cant_use_your_camera");
|
|
11050
|
+
handleError({
|
|
11051
|
+
title: errorText,
|
|
11052
|
+
message: `${t("camera_errors.please_try_a_different_browser")} ${error}`
|
|
11053
|
+
});
|
|
10825
11054
|
}
|
|
10826
|
-
},
|
|
10827
|
-
|
|
10828
|
-
|
|
10829
|
-
|
|
10830
|
-
|
|
10831
|
-
|
|
10832
|
-
|
|
11055
|
+
},
|
|
11056
|
+
[handleError, t]
|
|
11057
|
+
);
|
|
11058
|
+
return { handleUserMediaError };
|
|
11059
|
+
}
|
|
11060
|
+
|
|
11061
|
+
// src/webcam/Webcam.tsx
|
|
11062
|
+
import { Fragment as Fragment13, jsx as jsx136, jsxs as jsxs84 } from "react/jsx-runtime";
|
|
11063
|
+
var SCREENSHOT_FORMAT = "image/jpeg";
|
|
11064
|
+
var mirroredTransformStyle = { transform: "rotateY(180deg)" };
|
|
11065
|
+
var Webcam = memo7(
|
|
11066
|
+
forwardRef54(
|
|
11067
|
+
({
|
|
11068
|
+
onUserMedia,
|
|
11069
|
+
onDisabled,
|
|
11070
|
+
imageSmoothing,
|
|
11071
|
+
videoConstraints,
|
|
11072
|
+
additionalConstraints,
|
|
11073
|
+
hideScanArea,
|
|
11074
|
+
roundedScanArea,
|
|
11075
|
+
cropToScanArea,
|
|
11076
|
+
className,
|
|
11077
|
+
mirrored,
|
|
11078
|
+
children,
|
|
11079
|
+
isLoading,
|
|
11080
|
+
placeholderImage,
|
|
11081
|
+
screenshotMaxSize,
|
|
11082
|
+
minScreenshotH,
|
|
11083
|
+
minScreenshotW,
|
|
11084
|
+
videoSourceDeviceId,
|
|
11085
|
+
screenshotQuality = 1,
|
|
11086
|
+
compression,
|
|
11087
|
+
onError,
|
|
11088
|
+
...props
|
|
11089
|
+
}, ref) => {
|
|
11090
|
+
const [minScreenshotHeight, setMinScreenshotHeight] = useState35();
|
|
11091
|
+
const [minScreenshotWidth, setMinScreenshotWidth] = useState35();
|
|
11092
|
+
const [useReducedConstraints, setUseReducedConstraints] = useState35(false);
|
|
11093
|
+
const [numberOfCameras, setNumberOfCameras] = useState35(0);
|
|
11094
|
+
const constraints = useMemo7(() => {
|
|
11095
|
+
if (videoConstraints) {
|
|
11096
|
+
return videoConstraints;
|
|
10833
11097
|
}
|
|
10834
|
-
|
|
10835
|
-
|
|
10836
|
-
|
|
10837
|
-
|
|
10838
|
-
|
|
10839
|
-
|
|
11098
|
+
if (useReducedConstraints) {
|
|
11099
|
+
return getReducedVideoConstraints({
|
|
11100
|
+
deviceId: videoSourceDeviceId,
|
|
11101
|
+
additional: additionalConstraints
|
|
11102
|
+
});
|
|
11103
|
+
}
|
|
11104
|
+
return getMobileOrDesktopVideoConstraints({
|
|
11105
|
+
deviceId: videoSourceDeviceId,
|
|
11106
|
+
additional: additionalConstraints
|
|
11107
|
+
});
|
|
11108
|
+
}, [
|
|
11109
|
+
additionalConstraints,
|
|
11110
|
+
useReducedConstraints,
|
|
11111
|
+
videoConstraints,
|
|
11112
|
+
videoSourceDeviceId
|
|
11113
|
+
]);
|
|
11114
|
+
const isMirroredInCSS = mirrored === void 0 && !isMobileOrTablet();
|
|
11115
|
+
const webcamRef = useRef25(null);
|
|
11116
|
+
const scanAreaRef = useRef25(null);
|
|
11117
|
+
const canvasRef = useRef25(null);
|
|
11118
|
+
const containerRef = useRef25(null);
|
|
11119
|
+
const { handleUserMediaError } = useErrorHandler({
|
|
11120
|
+
onError: (errorDetails) => {
|
|
11121
|
+
onDisabled?.(true);
|
|
11122
|
+
onError(errorDetails);
|
|
11123
|
+
}
|
|
11124
|
+
});
|
|
11125
|
+
const handleUserMediaErrorWithFallback = useCallback27(
|
|
11126
|
+
(error) => {
|
|
11127
|
+
if (error instanceof DOMException && error.name === "OverconstrainedError" && !useReducedConstraints && !videoConstraints) {
|
|
11128
|
+
console.warn("Camera constraints failed, trying reduced constraints:", error);
|
|
11129
|
+
setUseReducedConstraints(true);
|
|
11130
|
+
return;
|
|
11131
|
+
}
|
|
11132
|
+
handleUserMediaError(error);
|
|
11133
|
+
},
|
|
11134
|
+
[handleUserMediaError, useReducedConstraints, videoConstraints]
|
|
11135
|
+
);
|
|
11136
|
+
const compressImage2 = async (canvas) => {
|
|
11137
|
+
if (!canvas) return;
|
|
11138
|
+
const blobImage = await getCanvasBlob(canvas);
|
|
11139
|
+
if (!blobImage) return;
|
|
11140
|
+
const compressedFile = await compressFile(blobImage, {
|
|
11141
|
+
convertSize: screenshotMaxSize
|
|
11142
|
+
});
|
|
11143
|
+
console.log(
|
|
11144
|
+
"Before: ",
|
|
11145
|
+
getFileSizeMB(blobImage)?.toFixed(2),
|
|
11146
|
+
"MB",
|
|
11147
|
+
"After: ",
|
|
11148
|
+
getFileSizeMB(compressedFile)?.toFixed(2),
|
|
11149
|
+
"MB"
|
|
11150
|
+
);
|
|
11151
|
+
return toBase64(compressedFile);
|
|
11152
|
+
};
|
|
11153
|
+
const handleTakePhoto = () => {
|
|
11154
|
+
const takenPhotoCanvas = getPhotoCanvas({
|
|
11155
|
+
player: webcamRef.current?.video,
|
|
11156
|
+
container: containerRef.current,
|
|
11157
|
+
canvas: canvasRef.current,
|
|
11158
|
+
scanArea: scanAreaRef.current,
|
|
11159
|
+
cropToScanArea
|
|
11160
|
+
});
|
|
11161
|
+
if (!takenPhotoCanvas) return;
|
|
11162
|
+
if (compression) return compressImage2(takenPhotoCanvas);
|
|
11163
|
+
return Promise.resolve(
|
|
11164
|
+
takenPhotoCanvas.toDataURL(SCREENSHOT_FORMAT, screenshotQuality)
|
|
11165
|
+
);
|
|
11166
|
+
};
|
|
11167
|
+
useImperativeHandle(
|
|
11168
|
+
ref,
|
|
11169
|
+
() => ({
|
|
11170
|
+
takePhoto: handleTakePhoto,
|
|
11171
|
+
numberOfCameras,
|
|
11172
|
+
...webcamRef.current
|
|
11173
|
+
})
|
|
11174
|
+
);
|
|
11175
|
+
const handleUserMediaSuccess = useCallback27(
|
|
11176
|
+
(stream) => {
|
|
11177
|
+
if (!isMobile2) {
|
|
11178
|
+
const track = stream.getVideoTracks()[0];
|
|
11179
|
+
const capabilities = !isFirefox && track?.getCapabilities();
|
|
11180
|
+
if (capabilities) {
|
|
11181
|
+
setMinScreenshotHeight(capabilities.height?.max);
|
|
11182
|
+
setMinScreenshotWidth(capabilities.width?.max);
|
|
11183
|
+
}
|
|
11184
|
+
} else {
|
|
11185
|
+
setMinScreenshotWidth(minScreenshotW);
|
|
11186
|
+
setMinScreenshotHeight(minScreenshotH);
|
|
11187
|
+
}
|
|
11188
|
+
navigator.mediaDevices.enumerateDevices().then((devices) => {
|
|
11189
|
+
setNumberOfCameras(
|
|
11190
|
+
devices.filter((device) => device.kind === "videoinput").length
|
|
11191
|
+
);
|
|
11192
|
+
}).catch((error) => {
|
|
11193
|
+
console.warn("Failed to enumerate devices:", error);
|
|
11194
|
+
setNumberOfCameras(1);
|
|
11195
|
+
});
|
|
11196
|
+
onUserMedia?.();
|
|
11197
|
+
},
|
|
11198
|
+
[minScreenshotH, minScreenshotW, onUserMedia]
|
|
11199
|
+
);
|
|
11200
|
+
return /* @__PURE__ */ jsxs84(
|
|
10840
11201
|
"div",
|
|
10841
11202
|
{
|
|
11203
|
+
ref: containerRef,
|
|
10842
11204
|
className: cn(
|
|
10843
|
-
|
|
10844
|
-
|
|
10845
|
-
|
|
11205
|
+
className,
|
|
11206
|
+
"webcam relative z-[1] mx-auto flex h-[222px] w-[332px] items-center justify-center overflow-hidden rounded-[6px] text-center",
|
|
11207
|
+
"kiosko:h-[620px] kiosko:max-h-[620px] kiosko:w-[890px] kiosko:max-w-[890px]"
|
|
10846
11208
|
),
|
|
10847
|
-
|
|
10848
|
-
|
|
11209
|
+
style: isMirroredInCSS ? mirroredTransformStyle : void 0,
|
|
11210
|
+
children: [
|
|
11211
|
+
!hideScanArea && /* @__PURE__ */ jsxs84(
|
|
11212
|
+
"div",
|
|
11213
|
+
{
|
|
11214
|
+
ref: scanAreaRef,
|
|
11215
|
+
className: cn(
|
|
11216
|
+
"webcam__scan-area absolute inset-0 z-[2] m-auto flex w-[calc(100%-32px)] items-center justify-center shadow-[0_0_0_9999em_rgb(0_0_0_/_60%)]",
|
|
11217
|
+
"h-[200px] rounded-[15px] min-[479px]:h-[calc(100%-32px)]",
|
|
11218
|
+
roundedScanArea && "h-[197px] w-[165px] rounded-[45%] border-[3px] border-white shadow-[0_0_8px_#fff,inset_0_0_0_#fff,0_0_0_9999em_rgb(0_0_0_/_60%)]",
|
|
11219
|
+
"kiosko:h-[calc(100%-170px)] kiosko:w-[345px]"
|
|
11220
|
+
),
|
|
11221
|
+
style: isMirroredInCSS ? mirroredTransformStyle : void 0,
|
|
11222
|
+
children: [
|
|
11223
|
+
!roundedScanArea && /* @__PURE__ */ jsxs84(Fragment13, { children: [
|
|
11224
|
+
/* @__PURE__ */ jsx136("div", { className: "absolute left-[-2px] top-[-2px] h-[45px] w-[45px] rounded-tl-[15px] border-[4px] border-b-0 border-r-0 border-white" }),
|
|
11225
|
+
/* @__PURE__ */ jsx136("div", { className: "absolute right-[-2px] top-[-2px] h-[45px] w-[45px] rounded-tr-[15px] border-[4px] border-b-0 border-l-0 border-white" }),
|
|
11226
|
+
/* @__PURE__ */ jsx136("div", { className: "absolute bottom-[-2px] right-[-2px] h-[45px] w-[45px] rounded-br-[15px] border-[4px] border-l-0 border-t-0 border-white" }),
|
|
11227
|
+
/* @__PURE__ */ jsx136("div", { className: "absolute bottom-[-2px] left-[-2px] h-[45px] w-[45px] rounded-bl-[15px] border-[4px] border-r-0 border-t-0 border-white" })
|
|
11228
|
+
] }),
|
|
11229
|
+
placeholderImage
|
|
11230
|
+
]
|
|
11231
|
+
}
|
|
11232
|
+
),
|
|
11233
|
+
/* @__PURE__ */ jsx136("canvas", { ref: canvasRef, className: "hidden" }),
|
|
11234
|
+
isLoading ? /* @__PURE__ */ jsx136("div", { className: "absolute inset-0 z-10 flex items-center justify-center bg-black/50", children: /* @__PURE__ */ jsx136("div", { className: "h-10 w-10 animate-spin rounded-full border-4 border-white/30 border-t-white" }) }) : /* @__PURE__ */ jsx136(
|
|
11235
|
+
ReactWebcam,
|
|
11236
|
+
{
|
|
11237
|
+
ref: webcamRef,
|
|
11238
|
+
mirrored: !!mirrored,
|
|
11239
|
+
width: props.width,
|
|
11240
|
+
height: props.height,
|
|
11241
|
+
videoConstraints: constraints,
|
|
11242
|
+
imageSmoothing: !!imageSmoothing,
|
|
11243
|
+
screenshotFormat: SCREENSHOT_FORMAT,
|
|
11244
|
+
onUserMedia: handleUserMediaSuccess,
|
|
11245
|
+
screenshotQuality,
|
|
11246
|
+
onUserMediaError: handleUserMediaErrorWithFallback,
|
|
11247
|
+
minScreenshotWidth,
|
|
11248
|
+
minScreenshotHeight,
|
|
11249
|
+
className: "webcam__video z-[1] h-full w-full bg-[#e2e2e2] object-cover",
|
|
11250
|
+
audio: false,
|
|
11251
|
+
disablePictureInPicture: false,
|
|
11252
|
+
forceScreenshotSourceSize: false
|
|
11253
|
+
}
|
|
11254
|
+
),
|
|
11255
|
+
children
|
|
11256
|
+
]
|
|
11257
|
+
}
|
|
11258
|
+
);
|
|
11259
|
+
}
|
|
11260
|
+
)
|
|
11261
|
+
);
|
|
11262
|
+
Webcam.displayName = "Webcam";
|
|
11263
|
+
|
|
11264
|
+
// src/mobile-webcam/MobileWebcam.tsx
|
|
11265
|
+
import { Camera, ChevronLeft as ChevronLeft4 } from "lucide-react";
|
|
11266
|
+
import { forwardRef as forwardRef55, useCallback as useCallback29 } from "react";
|
|
11267
|
+
import { createPortal } from "react-dom";
|
|
11268
|
+
import { useTranslation as useTranslation25 } from "react-i18next";
|
|
11269
|
+
|
|
11270
|
+
// src/mobile-webcam/DeviceCamera/DeviceCamera.tsx
|
|
11271
|
+
import { useCallback as useCallback28 } from "react";
|
|
11272
|
+
import { useTranslation as useTranslation24 } from "react-i18next";
|
|
11273
|
+
import { jsx as jsx137, jsxs as jsxs85 } from "react/jsx-runtime";
|
|
11274
|
+
function DeviceCamera({ onChange, facingMode, className }) {
|
|
11275
|
+
const { t } = useTranslation24();
|
|
11276
|
+
const handleNativeScreenshot = useCallback28(
|
|
11277
|
+
(event) => {
|
|
11278
|
+
const file = event.target.files?.[0];
|
|
11279
|
+
onChange(file ? compressImage(file) : void 0);
|
|
11280
|
+
},
|
|
11281
|
+
[onChange]
|
|
11282
|
+
);
|
|
11283
|
+
return /* @__PURE__ */ jsxs85(
|
|
11284
|
+
"div",
|
|
11285
|
+
{
|
|
11286
|
+
className: cn(
|
|
11287
|
+
"mobile-webcam-device-camera flex flex-col items-center gap-3 rounded-xl bg-[#1c1b1f] p-4 text-sm text-white",
|
|
11288
|
+
className
|
|
11289
|
+
),
|
|
11290
|
+
children: [
|
|
11291
|
+
/* @__PURE__ */ jsx137("div", { children: t("camera_errors.experiencing_camera_issues") }),
|
|
11292
|
+
/* @__PURE__ */ jsxs85("label", { className: "text-[16px] font-semibold uppercase leading-6 text-[var(--text-button-color)]", children: [
|
|
11293
|
+
t("open_devices_camera"),
|
|
11294
|
+
/* @__PURE__ */ jsx137(
|
|
11295
|
+
"input",
|
|
10849
11296
|
{
|
|
10850
|
-
|
|
10851
|
-
|
|
10852
|
-
|
|
10853
|
-
|
|
10854
|
-
|
|
10855
|
-
imageSmoothing,
|
|
10856
|
-
mirrored,
|
|
10857
|
-
screenshotQuality,
|
|
10858
|
-
videoConstraints: constraints,
|
|
10859
|
-
screenshotFormat: SCREENSHOT_FORMAT,
|
|
10860
|
-
minScreenshotHeight,
|
|
10861
|
-
minScreenshotWidth
|
|
11297
|
+
className: "sr-only",
|
|
11298
|
+
type: "file",
|
|
11299
|
+
accept: "image/*",
|
|
11300
|
+
capture: facingMode || "environment",
|
|
11301
|
+
onChange: handleNativeScreenshot
|
|
10862
11302
|
}
|
|
10863
11303
|
)
|
|
10864
|
-
}
|
|
10865
|
-
|
|
10866
|
-
|
|
10867
|
-
|
|
11304
|
+
] })
|
|
11305
|
+
]
|
|
11306
|
+
}
|
|
11307
|
+
);
|
|
11308
|
+
}
|
|
11309
|
+
|
|
11310
|
+
// src/mobile-webcam/MobileWebcam.tsx
|
|
11311
|
+
import { jsx as jsx138, jsxs as jsxs86 } from "react/jsx-runtime";
|
|
11312
|
+
var webcamClasses = "fixed left-0 top-0 z-[6] h-full w-full rounded-none";
|
|
11313
|
+
var scanAreaClasses = String.raw`[&_.webcam\_\_scan-area]:h-full [&_.webcam\_\_scan-area]:max-h-[209px] landscape:[&_.webcam\_\_scan-area]:h-[80%] landscape:[&_.webcam\_\_scan-area]:max-h-full md:[&_.webcam\_\_scan-area]:h-auto md:[&_.webcam\_\_scan-area]:max-h-none md:[&_.webcam\_\_scan-area]:aspect-[2/1]`;
|
|
11314
|
+
var roundedWebcamClasses = String.raw`[&_.webcam\_\_scan-area]:top-[-60px] [&_.webcam\_\_scan-area]:h-full [&_.webcam\_\_scan-area]:w-full [&_.webcam\_\_scan-area]:max-h-[55%] [&_.webcam\_\_scan-area]:max-w-[80%] max-[375px]:[&_.webcam\_\_scan-area]:max-h-[369px] max-[375px]:[&_.webcam\_\_scan-area]:max-w-[261px] max-[320px]:[&_.webcam\_\_scan-area]:max-h-[318px] max-[320px]:[&_.webcam\_\_scan-area]:max-w-[220px] landscape:[&_.webcam\_\_scan-area]:h-full landscape:[&_.webcam\_\_scan-area]:w-full landscape:[&_.webcam\_\_scan-area]:max-h-[90%] landscape:[&_.webcam\_\_scan-area]:max-w-[261px] md:[&_.webcam\_\_scan-area]:aspect-square`;
|
|
11315
|
+
function getAndMapFacingMode(constraints) {
|
|
11316
|
+
if (typeof constraints === "boolean" || !constraints) return;
|
|
11317
|
+
if (constraints.facingMode === "user") return "user";
|
|
11318
|
+
if (constraints.facingMode === "environment") return "environment";
|
|
11319
|
+
}
|
|
11320
|
+
var MobileWebcam = forwardRef55(
|
|
11321
|
+
({ onScreenshot, onBack, title, text, disabled, className, ...props }, ref) => {
|
|
11322
|
+
const rootElement = getDocument()?.body;
|
|
11323
|
+
const { t } = useTranslation25();
|
|
11324
|
+
const handleNativeScreenshot = useCallback29(
|
|
11325
|
+
(photo) => onScreenshot({ isNative: true, photo }),
|
|
11326
|
+
[onScreenshot]
|
|
11327
|
+
);
|
|
11328
|
+
return createPortal(
|
|
11329
|
+
/* @__PURE__ */ jsxs86("div", { className: "mobile-camera flex justify-center", children: [
|
|
11330
|
+
/* @__PURE__ */ jsx138(
|
|
11331
|
+
"button",
|
|
11332
|
+
{
|
|
11333
|
+
type: "button",
|
|
11334
|
+
onClick: onBack,
|
|
11335
|
+
className: "mobile-camera__back-btn fixed left-7 top-9 z-[7] flex border-0 bg-transparent p-0 landscape:left-[50px] landscape:top-[70px]",
|
|
11336
|
+
children: /* @__PURE__ */ jsx138(ChevronLeft4, { size: 32, strokeWidth: 3, className: "text-white" })
|
|
11337
|
+
}
|
|
11338
|
+
),
|
|
11339
|
+
title && /* @__PURE__ */ jsx138("div", { className: "mobile-camera__title fixed left-1/2 top-8 z-[7] -translate-x-1/2 whitespace-nowrap text-[18px] font-bold text-white landscape:top-[5px]", children: title }),
|
|
11340
|
+
text ? /* @__PURE__ */ jsx138("p", { className: "mobile-camera__subtitle fixed top-[76px] z-[7] mx-auto my-0 px-6 text-center text-white landscape:hidden [@media(min-height:838px)]:top-28", children: text }) : /* @__PURE__ */ jsx138("p", { className: "mobile-camera__helper fixed top-[88px] z-[7] mx-auto my-0 px-6 text-center text-xs text-white landscape:hidden [@media(min-height:700px)]:[font-size:inherit]", children: t("place_document_inside_frame") }),
|
|
11341
|
+
/* @__PURE__ */ jsx138(
|
|
11342
|
+
Webcam,
|
|
11343
|
+
{
|
|
11344
|
+
ref,
|
|
11345
|
+
...props,
|
|
11346
|
+
className: cn(
|
|
11347
|
+
className,
|
|
11348
|
+
webcamClasses,
|
|
11349
|
+
props.roundedScanArea ? roundedWebcamClasses : scanAreaClasses
|
|
11350
|
+
)
|
|
11351
|
+
}
|
|
11352
|
+
),
|
|
11353
|
+
/* @__PURE__ */ jsxs86("div", { className: "fixed bottom-5 z-[7] flex w-[calc(100%-32px)] flex-col justify-between gap-5 self-center landscape:inset-y-0 landscape:right-10 landscape:my-auto landscape:h-auto landscape:w-auto landscape:justify-normal landscape:[&_.mobile-webcam-device-camera]:hidden", children: [
|
|
11354
|
+
/* @__PURE__ */ jsx138(
|
|
11355
|
+
"button",
|
|
11356
|
+
{
|
|
11357
|
+
type: "button",
|
|
11358
|
+
disabled,
|
|
11359
|
+
onClick: () => onScreenshot({ isNative: false }),
|
|
11360
|
+
className: "mobile-camera__take-btn relative flex h-[75px] w-[75px] items-center justify-center self-center rounded-full border-0 bg-white p-[10px] shadow-[0_0_10px_#ffffff] hover:opacity-80 disabled:cursor-default disabled:opacity-60 disabled:hover:opacity-60",
|
|
11361
|
+
children: /* @__PURE__ */ jsx138(Camera, { size: 26, className: "text-[var(--primary)]" })
|
|
11362
|
+
}
|
|
11363
|
+
),
|
|
11364
|
+
/* @__PURE__ */ jsx138(
|
|
11365
|
+
DeviceCamera,
|
|
11366
|
+
{
|
|
11367
|
+
onChange: handleNativeScreenshot,
|
|
11368
|
+
facingMode: getAndMapFacingMode(props.additionalConstraints)
|
|
11369
|
+
}
|
|
11370
|
+
)
|
|
11371
|
+
] })
|
|
11372
|
+
] }),
|
|
11373
|
+
rootElement
|
|
11374
|
+
);
|
|
10868
11375
|
}
|
|
10869
11376
|
);
|
|
10870
|
-
|
|
11377
|
+
MobileWebcam.displayName = "MobileWebcam";
|
|
10871
11378
|
|
|
10872
11379
|
// src/wide-button/WideButton.tsx
|
|
10873
|
-
import { forwardRef as
|
|
10874
|
-
import { jsx as
|
|
10875
|
-
var WideButton =
|
|
10876
|
-
({ className, disabled, ...props }, ref) => /* @__PURE__ */
|
|
11380
|
+
import { forwardRef as forwardRef56 } from "react";
|
|
11381
|
+
import { jsx as jsx139 } from "react/jsx-runtime";
|
|
11382
|
+
var WideButton = forwardRef56(
|
|
11383
|
+
({ className, disabled, ...props }, ref) => /* @__PURE__ */ jsx139(
|
|
10877
11384
|
Button,
|
|
10878
11385
|
{
|
|
10879
11386
|
ref,
|
|
@@ -10895,22 +11402,22 @@ WideButton.displayName = "WideButton";
|
|
|
10895
11402
|
import * as React42 from "react";
|
|
10896
11403
|
import * as DialogPrimitive2 from "@radix-ui/react-dialog";
|
|
10897
11404
|
import Draggable from "react-draggable";
|
|
10898
|
-
import { jsx as
|
|
11405
|
+
import { jsx as jsx140, jsxs as jsxs87 } from "react/jsx-runtime";
|
|
10899
11406
|
var DRAWER_CLOSE_THRESHOLD = 72;
|
|
10900
11407
|
var DRAWER_MIN_OVERLAY_OPACITY = 0.1;
|
|
10901
11408
|
function Drawer({ ...props }) {
|
|
10902
|
-
return /* @__PURE__ */
|
|
11409
|
+
return /* @__PURE__ */ jsx140(DialogPrimitive2.Root, { "data-slot": "drawer", ...props });
|
|
10903
11410
|
}
|
|
10904
11411
|
function DrawerTrigger({ ...props }) {
|
|
10905
|
-
return /* @__PURE__ */
|
|
11412
|
+
return /* @__PURE__ */ jsx140(DialogPrimitive2.Trigger, { "data-slot": "drawer-trigger", ...props });
|
|
10906
11413
|
}
|
|
10907
11414
|
function DrawerPortal({ ...props }) {
|
|
10908
|
-
return /* @__PURE__ */
|
|
11415
|
+
return /* @__PURE__ */ jsx140(DialogPrimitive2.Portal, { "data-slot": "drawer-portal", ...props });
|
|
10909
11416
|
}
|
|
10910
11417
|
function DrawerClose({ ...props }) {
|
|
10911
|
-
return /* @__PURE__ */
|
|
11418
|
+
return /* @__PURE__ */ jsx140(DialogPrimitive2.Close, { "data-slot": "drawer-close", ...props });
|
|
10912
11419
|
}
|
|
10913
|
-
var DrawerOverlay = React42.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
11420
|
+
var DrawerOverlay = React42.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx140(
|
|
10914
11421
|
DialogPrimitive2.Overlay,
|
|
10915
11422
|
{
|
|
10916
11423
|
ref,
|
|
@@ -10960,14 +11467,14 @@ var DrawerContent = React42.forwardRef(
|
|
|
10960
11467
|
},
|
|
10961
11468
|
[onClose]
|
|
10962
11469
|
);
|
|
10963
|
-
return /* @__PURE__ */
|
|
10964
|
-
lockScroll ? /* @__PURE__ */
|
|
11470
|
+
return /* @__PURE__ */ jsxs87(DrawerPortal, { container: finalContainer, children: [
|
|
11471
|
+
lockScroll ? /* @__PURE__ */ jsx140(
|
|
10965
11472
|
DrawerOverlay,
|
|
10966
11473
|
{
|
|
10967
11474
|
style: { opacity: overlayOpacity },
|
|
10968
11475
|
onClick: closeOnOverlayClick ? onClose : void 0
|
|
10969
11476
|
}
|
|
10970
|
-
) : /* @__PURE__ */
|
|
11477
|
+
) : /* @__PURE__ */ jsx140(
|
|
10971
11478
|
"div",
|
|
10972
11479
|
{
|
|
10973
11480
|
className: cn(DrawerOverlayClasses),
|
|
@@ -10975,7 +11482,7 @@ var DrawerContent = React42.forwardRef(
|
|
|
10975
11482
|
onClick: closeOnOverlayClick ? onClose : void 0
|
|
10976
11483
|
}
|
|
10977
11484
|
),
|
|
10978
|
-
/* @__PURE__ */
|
|
11485
|
+
/* @__PURE__ */ jsx140(
|
|
10979
11486
|
DialogPrimitive2.Content,
|
|
10980
11487
|
{
|
|
10981
11488
|
asChild: true,
|
|
@@ -10991,7 +11498,7 @@ var DrawerContent = React42.forwardRef(
|
|
|
10991
11498
|
}
|
|
10992
11499
|
},
|
|
10993
11500
|
...props,
|
|
10994
|
-
children: /* @__PURE__ */
|
|
11501
|
+
children: /* @__PURE__ */ jsx140("div", { className: "fixed inset-x-0 bottom-0 top-auto z-50 outline-none", children: /* @__PURE__ */ jsx140(
|
|
10995
11502
|
Draggable,
|
|
10996
11503
|
{
|
|
10997
11504
|
axis: "y",
|
|
@@ -11002,7 +11509,7 @@ var DrawerContent = React42.forwardRef(
|
|
|
11002
11509
|
onDrag: handleDrag,
|
|
11003
11510
|
onStop: handleStop,
|
|
11004
11511
|
position: { x: 0, y: dragOffsetY },
|
|
11005
|
-
children: /* @__PURE__ */
|
|
11512
|
+
children: /* @__PURE__ */ jsxs87(
|
|
11006
11513
|
"div",
|
|
11007
11514
|
{
|
|
11008
11515
|
ref: nodeRef,
|
|
@@ -11011,7 +11518,7 @@ var DrawerContent = React42.forwardRef(
|
|
|
11011
11518
|
className
|
|
11012
11519
|
),
|
|
11013
11520
|
children: [
|
|
11014
|
-
showHandle && /* @__PURE__ */
|
|
11521
|
+
showHandle && /* @__PURE__ */ jsx140(
|
|
11015
11522
|
"div",
|
|
11016
11523
|
{
|
|
11017
11524
|
"data-drawer-handle": true,
|
|
@@ -11019,10 +11526,10 @@ var DrawerContent = React42.forwardRef(
|
|
|
11019
11526
|
"mx-auto flex h-8 w-24 touch-none items-center justify-center",
|
|
11020
11527
|
disableDrag ? "cursor-default" : "cursor-grab active:cursor-grabbing"
|
|
11021
11528
|
),
|
|
11022
|
-
children: /* @__PURE__ */
|
|
11529
|
+
children: /* @__PURE__ */ jsx140("span", { className: "block h-1.5 w-12 rounded-full bg-[#D9D7D3]" })
|
|
11023
11530
|
}
|
|
11024
11531
|
),
|
|
11025
|
-
/* @__PURE__ */
|
|
11532
|
+
/* @__PURE__ */ jsx140("div", { className: "min-h-0 flex-1 overflow-y-auto", children })
|
|
11026
11533
|
]
|
|
11027
11534
|
}
|
|
11028
11535
|
)
|
|
@@ -11034,7 +11541,7 @@ var DrawerContent = React42.forwardRef(
|
|
|
11034
11541
|
}
|
|
11035
11542
|
);
|
|
11036
11543
|
DrawerContent.displayName = DialogPrimitive2.Content.displayName;
|
|
11037
|
-
var DrawerHeader = ({ className, ...props }) => /* @__PURE__ */
|
|
11544
|
+
var DrawerHeader = ({ className, ...props }) => /* @__PURE__ */ jsx140(
|
|
11038
11545
|
"div",
|
|
11039
11546
|
{
|
|
11040
11547
|
className: cn("flex flex-col gap-2 px-5 pt-2 text-center", className),
|
|
@@ -11042,9 +11549,9 @@ var DrawerHeader = ({ className, ...props }) => /* @__PURE__ */ jsx138(
|
|
|
11042
11549
|
}
|
|
11043
11550
|
);
|
|
11044
11551
|
DrawerHeader.displayName = "DrawerHeader";
|
|
11045
|
-
var DrawerFooter = ({ className, ...props }) => /* @__PURE__ */
|
|
11552
|
+
var DrawerFooter = ({ className, ...props }) => /* @__PURE__ */ jsx140("div", { className: cn("flex flex-col gap-2 p-5", className), ...props });
|
|
11046
11553
|
DrawerFooter.displayName = "DrawerFooter";
|
|
11047
|
-
var DrawerTitle = React42.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
11554
|
+
var DrawerTitle = React42.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx140(
|
|
11048
11555
|
DialogPrimitive2.Title,
|
|
11049
11556
|
{
|
|
11050
11557
|
ref,
|
|
@@ -11054,7 +11561,7 @@ var DrawerTitle = React42.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
11054
11561
|
}
|
|
11055
11562
|
));
|
|
11056
11563
|
DrawerTitle.displayName = DialogPrimitive2.Title.displayName;
|
|
11057
|
-
var DrawerDescription = React42.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
11564
|
+
var DrawerDescription = React42.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx140(
|
|
11058
11565
|
DialogPrimitive2.Description,
|
|
11059
11566
|
{
|
|
11060
11567
|
ref,
|
|
@@ -11081,7 +11588,7 @@ var DEVICE = {
|
|
|
11081
11588
|
};
|
|
11082
11589
|
|
|
11083
11590
|
// src/responsive-sheet/ResponsiveSheet.tsx
|
|
11084
|
-
import { jsx as
|
|
11591
|
+
import { jsx as jsx141, jsxs as jsxs88 } from "react/jsx-runtime";
|
|
11085
11592
|
function ResponsiveSheet({
|
|
11086
11593
|
open,
|
|
11087
11594
|
onClose,
|
|
@@ -11100,8 +11607,8 @@ function ResponsiveSheet({
|
|
|
11100
11607
|
closeOnEscape = true,
|
|
11101
11608
|
disableDrag = false
|
|
11102
11609
|
}) {
|
|
11103
|
-
const { isMatch:
|
|
11104
|
-
const isMobileMode =
|
|
11610
|
+
const { isMatch: isMobile3 } = useScreenResize(DEVICE.tablet);
|
|
11611
|
+
const isMobileMode = isMobile3 && isMobileModalModeAvailable();
|
|
11105
11612
|
const handleOpenChange = (nextOpen) => {
|
|
11106
11613
|
if (!nextOpen) {
|
|
11107
11614
|
onClose();
|
|
@@ -11117,7 +11624,7 @@ function ResponsiveSheet({
|
|
|
11117
11624
|
event.preventDefault();
|
|
11118
11625
|
}
|
|
11119
11626
|
};
|
|
11120
|
-
const content = /* @__PURE__ */
|
|
11627
|
+
const content = /* @__PURE__ */ jsxs88(
|
|
11121
11628
|
"div",
|
|
11122
11629
|
{
|
|
11123
11630
|
className: cn(
|
|
@@ -11125,7 +11632,7 @@ function ResponsiveSheet({
|
|
|
11125
11632
|
contentClassName
|
|
11126
11633
|
),
|
|
11127
11634
|
children: [
|
|
11128
|
-
title ? /* @__PURE__ */
|
|
11635
|
+
title ? /* @__PURE__ */ jsx141(
|
|
11129
11636
|
"div",
|
|
11130
11637
|
{
|
|
11131
11638
|
"aria-hidden": "true",
|
|
@@ -11136,7 +11643,7 @@ function ResponsiveSheet({
|
|
|
11136
11643
|
children: title
|
|
11137
11644
|
}
|
|
11138
11645
|
) : null,
|
|
11139
|
-
description ? /* @__PURE__ */
|
|
11646
|
+
description ? /* @__PURE__ */ jsx141(
|
|
11140
11647
|
"p",
|
|
11141
11648
|
{
|
|
11142
11649
|
"aria-hidden": "true",
|
|
@@ -11152,7 +11659,7 @@ function ResponsiveSheet({
|
|
|
11152
11659
|
}
|
|
11153
11660
|
);
|
|
11154
11661
|
if (isMobileMode) {
|
|
11155
|
-
return /* @__PURE__ */
|
|
11662
|
+
return /* @__PURE__ */ jsx141(Drawer, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxs88(
|
|
11156
11663
|
DrawerContent,
|
|
11157
11664
|
{
|
|
11158
11665
|
onClose,
|
|
@@ -11163,14 +11670,14 @@ function ResponsiveSheet({
|
|
|
11163
11670
|
onEscapeKeyDown: handleEscapeKeyDown,
|
|
11164
11671
|
className: cn(className, drawerClassName),
|
|
11165
11672
|
children: [
|
|
11166
|
-
title ? /* @__PURE__ */
|
|
11167
|
-
description ? /* @__PURE__ */
|
|
11673
|
+
title ? /* @__PURE__ */ jsx141(DrawerTitle, { className: "sr-only", children: title }) : null,
|
|
11674
|
+
description ? /* @__PURE__ */ jsx141(DrawerDescription, { className: "sr-only", children: description }) : null,
|
|
11168
11675
|
content
|
|
11169
11676
|
]
|
|
11170
11677
|
}
|
|
11171
11678
|
) });
|
|
11172
11679
|
}
|
|
11173
|
-
return /* @__PURE__ */
|
|
11680
|
+
return /* @__PURE__ */ jsx141(Dialog, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxs88(
|
|
11174
11681
|
DialogContent,
|
|
11175
11682
|
{
|
|
11176
11683
|
showCloseButton,
|
|
@@ -11180,8 +11687,8 @@ function ResponsiveSheet({
|
|
|
11180
11687
|
className: cn("max-w-[560px] border-0 p-0 shadow-xl", className, dialogClassName),
|
|
11181
11688
|
lockScroll: false,
|
|
11182
11689
|
children: [
|
|
11183
|
-
title ? /* @__PURE__ */
|
|
11184
|
-
description ? /* @__PURE__ */
|
|
11690
|
+
title ? /* @__PURE__ */ jsx141(DialogTitle, { className: "sr-only", children: title }) : null,
|
|
11691
|
+
description ? /* @__PURE__ */ jsx141(DialogDescription, { className: "sr-only", children: description }) : null,
|
|
11185
11692
|
content
|
|
11186
11693
|
]
|
|
11187
11694
|
}
|
|
@@ -11190,7 +11697,7 @@ function ResponsiveSheet({
|
|
|
11190
11697
|
|
|
11191
11698
|
// src/responsive-dropdown/ResponsiveDropdown.tsx
|
|
11192
11699
|
import * as React43 from "react";
|
|
11193
|
-
import { Fragment as Fragment14, jsx as
|
|
11700
|
+
import { Fragment as Fragment14, jsx as jsx142, jsxs as jsxs89 } from "react/jsx-runtime";
|
|
11194
11701
|
function ResponsiveDropdown({
|
|
11195
11702
|
trigger,
|
|
11196
11703
|
options,
|
|
@@ -11203,8 +11710,8 @@ function ResponsiveDropdown({
|
|
|
11203
11710
|
dropdownClassName,
|
|
11204
11711
|
drawerClassName
|
|
11205
11712
|
}) {
|
|
11206
|
-
const { isMatch:
|
|
11207
|
-
const isMobileMode =
|
|
11713
|
+
const { isMatch: isMobile3 } = useScreenResize(DEVICE.mobileXL);
|
|
11714
|
+
const isMobileMode = isMobile3 && isMobileModalModeAvailable();
|
|
11208
11715
|
const [open, setOpen] = React43.useState(false);
|
|
11209
11716
|
const visibleOptions = options?.filter((option) => !option.hidden) ?? [];
|
|
11210
11717
|
const renderTrigger = (isOpen) => typeof trigger === "function" ? trigger(isOpen) : trigger;
|
|
@@ -11222,8 +11729,8 @@ function ResponsiveDropdown({
|
|
|
11222
11729
|
setOpen(false);
|
|
11223
11730
|
};
|
|
11224
11731
|
if (isMobileMode) {
|
|
11225
|
-
return /* @__PURE__ */
|
|
11226
|
-
/* @__PURE__ */
|
|
11732
|
+
return /* @__PURE__ */ jsxs89(Fragment14, { children: [
|
|
11733
|
+
/* @__PURE__ */ jsx142(
|
|
11227
11734
|
"div",
|
|
11228
11735
|
{
|
|
11229
11736
|
className: "responsive-dropdown__mobile-trigger",
|
|
@@ -11231,16 +11738,16 @@ function ResponsiveDropdown({
|
|
|
11231
11738
|
children: renderTrigger(open)
|
|
11232
11739
|
}
|
|
11233
11740
|
),
|
|
11234
|
-
/* @__PURE__ */
|
|
11741
|
+
/* @__PURE__ */ jsx142(Drawer, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxs89(
|
|
11235
11742
|
DrawerContent,
|
|
11236
11743
|
{
|
|
11237
11744
|
onClose: () => setOpen(false),
|
|
11238
11745
|
lockScroll: false,
|
|
11239
11746
|
className: cn("px-0 pb-2", className, drawerClassName),
|
|
11240
11747
|
children: [
|
|
11241
|
-
title ? /* @__PURE__ */
|
|
11242
|
-
/* @__PURE__ */
|
|
11243
|
-
visibleOptions.map((option) => /* @__PURE__ */
|
|
11748
|
+
title ? /* @__PURE__ */ jsx142(DrawerTitle, { className: "sr-only", children: title }) : null,
|
|
11749
|
+
/* @__PURE__ */ jsxs89("div", { className: "flex flex-col", children: [
|
|
11750
|
+
visibleOptions.map((option) => /* @__PURE__ */ jsx142(
|
|
11244
11751
|
"div",
|
|
11245
11752
|
{
|
|
11246
11753
|
role: "button",
|
|
@@ -11262,16 +11769,16 @@ function ResponsiveDropdown({
|
|
|
11262
11769
|
) })
|
|
11263
11770
|
] });
|
|
11264
11771
|
}
|
|
11265
|
-
return /* @__PURE__ */
|
|
11266
|
-
/* @__PURE__ */
|
|
11267
|
-
/* @__PURE__ */
|
|
11772
|
+
return /* @__PURE__ */ jsxs89(DropdownMenu, { open, onOpenChange: handleOpenChange, children: [
|
|
11773
|
+
/* @__PURE__ */ jsx142(DropdownMenuTrigger, { asChild: true, disabled, children: renderTrigger(open) }),
|
|
11774
|
+
/* @__PURE__ */ jsxs89(
|
|
11268
11775
|
DropdownMenuContent,
|
|
11269
11776
|
{
|
|
11270
11777
|
side,
|
|
11271
11778
|
align,
|
|
11272
11779
|
className: cn("min-w-[295px]", className, dropdownClassName),
|
|
11273
11780
|
children: [
|
|
11274
|
-
visibleOptions.map((option) => /* @__PURE__ */
|
|
11781
|
+
visibleOptions.map((option) => /* @__PURE__ */ jsx142(
|
|
11275
11782
|
DropdownMenuItem,
|
|
11276
11783
|
{
|
|
11277
11784
|
disabled: option.disabled,
|
|
@@ -11290,10 +11797,10 @@ function ResponsiveDropdown({
|
|
|
11290
11797
|
// src/dashboard/input/Input.tsx
|
|
11291
11798
|
import * as React44 from "react";
|
|
11292
11799
|
import { Eye, Minus as Minus4, Plus as Plus3, X as X9 } from "lucide-react";
|
|
11293
|
-
import { useTranslation as
|
|
11800
|
+
import { useTranslation as useTranslation26 } from "react-i18next";
|
|
11294
11801
|
|
|
11295
11802
|
// src/dashboard/_fieldset/Fieldset.tsx
|
|
11296
|
-
import { Fragment as Fragment15, jsx as
|
|
11803
|
+
import { Fragment as Fragment15, jsx as jsx143, jsxs as jsxs90 } from "react/jsx-runtime";
|
|
11297
11804
|
function Fieldset({
|
|
11298
11805
|
isActivated,
|
|
11299
11806
|
isFocused,
|
|
@@ -11313,8 +11820,8 @@ function Fieldset({
|
|
|
11313
11820
|
}) {
|
|
11314
11821
|
const showLegendText = Boolean(legend || typeof label === "string");
|
|
11315
11822
|
const raised = !isEmpty || isFocused;
|
|
11316
|
-
return /* @__PURE__ */
|
|
11317
|
-
/* @__PURE__ */
|
|
11823
|
+
return /* @__PURE__ */ jsxs90(Fragment15, { children: [
|
|
11824
|
+
/* @__PURE__ */ jsxs90(
|
|
11318
11825
|
"div",
|
|
11319
11826
|
{
|
|
11320
11827
|
onClick,
|
|
@@ -11330,7 +11837,7 @@ function Fieldset({
|
|
|
11330
11837
|
labelClassName
|
|
11331
11838
|
),
|
|
11332
11839
|
children: [
|
|
11333
|
-
/* @__PURE__ */
|
|
11840
|
+
/* @__PURE__ */ jsx143(
|
|
11334
11841
|
"label",
|
|
11335
11842
|
{
|
|
11336
11843
|
id: labelId,
|
|
@@ -11342,7 +11849,7 @@ function Fieldset({
|
|
|
11342
11849
|
children: label
|
|
11343
11850
|
}
|
|
11344
11851
|
),
|
|
11345
|
-
tooltip && /* @__PURE__ */
|
|
11852
|
+
tooltip && /* @__PURE__ */ jsx143("span", { className: "ml-1 inline-flex", children: /* @__PURE__ */ jsx143(
|
|
11346
11853
|
HelpTooltip,
|
|
11347
11854
|
{
|
|
11348
11855
|
content: tooltip,
|
|
@@ -11353,7 +11860,7 @@ function Fieldset({
|
|
|
11353
11860
|
]
|
|
11354
11861
|
}
|
|
11355
11862
|
),
|
|
11356
|
-
/* @__PURE__ */
|
|
11863
|
+
/* @__PURE__ */ jsx143(
|
|
11357
11864
|
"fieldset",
|
|
11358
11865
|
{
|
|
11359
11866
|
"aria-hidden": "true",
|
|
@@ -11365,7 +11872,7 @@ function Fieldset({
|
|
|
11365
11872
|
invalid && "border-[var(--error-message-color)]",
|
|
11366
11873
|
className
|
|
11367
11874
|
),
|
|
11368
|
-
children: /* @__PURE__ */
|
|
11875
|
+
children: /* @__PURE__ */ jsxs90(
|
|
11369
11876
|
"legend",
|
|
11370
11877
|
{
|
|
11371
11878
|
className: cn(
|
|
@@ -11375,8 +11882,8 @@ function Fieldset({
|
|
|
11375
11882
|
!label && "w-0"
|
|
11376
11883
|
),
|
|
11377
11884
|
children: [
|
|
11378
|
-
showLegendText && /* @__PURE__ */
|
|
11379
|
-
tooltip && /* @__PURE__ */
|
|
11885
|
+
showLegendText && /* @__PURE__ */ jsx143("span", { className: "visible inline-block pr-[6px] text-[14px] font-medium opacity-0", children: legend || label }),
|
|
11886
|
+
tooltip && /* @__PURE__ */ jsx143("span", { className: "visible inline-block w-[20px] opacity-0", children: /* @__PURE__ */ jsx143("span", { className: "inline-block h-4 w-4" }) })
|
|
11380
11887
|
]
|
|
11381
11888
|
}
|
|
11382
11889
|
)
|
|
@@ -11386,7 +11893,7 @@ function Fieldset({
|
|
|
11386
11893
|
}
|
|
11387
11894
|
|
|
11388
11895
|
// src/dashboard/input/Input.tsx
|
|
11389
|
-
import { jsx as
|
|
11896
|
+
import { jsx as jsx144, jsxs as jsxs91 } from "react/jsx-runtime";
|
|
11390
11897
|
var checkIfEmpty = ({
|
|
11391
11898
|
empty,
|
|
11392
11899
|
defaultValue,
|
|
@@ -11437,7 +11944,7 @@ var DashboardInput = React44.forwardRef(
|
|
|
11437
11944
|
const generatedId = React44.useId();
|
|
11438
11945
|
const inputId = id ?? name ?? generatedId;
|
|
11439
11946
|
const errorId = `${inputId}-error`;
|
|
11440
|
-
const { t } =
|
|
11947
|
+
const { t } = useTranslation26();
|
|
11441
11948
|
const isEmpty = checkIfEmpty({ empty, value, defaultValue });
|
|
11442
11949
|
const [inputType, setInputType] = React44.useState(type);
|
|
11443
11950
|
const [isPasswordRevealed, setIsPasswordRevealed] = React44.useState(false);
|
|
@@ -11477,7 +11984,7 @@ var DashboardInput = React44.forwardRef(
|
|
|
11477
11984
|
};
|
|
11478
11985
|
const showRightPaddingForReset = Boolean(onReset);
|
|
11479
11986
|
const showRightPaddingForReveal = isPasswordReveal;
|
|
11480
|
-
return /* @__PURE__ */
|
|
11987
|
+
return /* @__PURE__ */ jsxs91(
|
|
11481
11988
|
"div",
|
|
11482
11989
|
{
|
|
11483
11990
|
className: cn(
|
|
@@ -11488,7 +11995,7 @@ var DashboardInput = React44.forwardRef(
|
|
|
11488
11995
|
className
|
|
11489
11996
|
),
|
|
11490
11997
|
children: [
|
|
11491
|
-
topLabel && /* @__PURE__ */
|
|
11998
|
+
topLabel && /* @__PURE__ */ jsx144(
|
|
11492
11999
|
"label",
|
|
11493
12000
|
{
|
|
11494
12001
|
htmlFor: inputId,
|
|
@@ -11496,7 +12003,7 @@ var DashboardInput = React44.forwardRef(
|
|
|
11496
12003
|
children: topLabel
|
|
11497
12004
|
}
|
|
11498
12005
|
),
|
|
11499
|
-
/* @__PURE__ */
|
|
12006
|
+
/* @__PURE__ */ jsxs91(
|
|
11500
12007
|
"div",
|
|
11501
12008
|
{
|
|
11502
12009
|
className: cn(
|
|
@@ -11505,8 +12012,8 @@ var DashboardInput = React44.forwardRef(
|
|
|
11505
12012
|
fieldClassName
|
|
11506
12013
|
),
|
|
11507
12014
|
children: [
|
|
11508
|
-
/* @__PURE__ */
|
|
11509
|
-
/* @__PURE__ */
|
|
12015
|
+
/* @__PURE__ */ jsxs91("div", { className: cn("relative w-full cursor-text", contentClassName), children: [
|
|
12016
|
+
/* @__PURE__ */ jsx144(
|
|
11510
12017
|
Fieldset,
|
|
11511
12018
|
{
|
|
11512
12019
|
isFocused: isFocused && !readOnly,
|
|
@@ -11527,8 +12034,8 @@ var DashboardInput = React44.forwardRef(
|
|
|
11527
12034
|
})
|
|
11528
12035
|
}
|
|
11529
12036
|
),
|
|
11530
|
-
leftIcon && /* @__PURE__ */
|
|
11531
|
-
/* @__PURE__ */
|
|
12037
|
+
leftIcon && /* @__PURE__ */ jsx144("span", { className: "pointer-events-none absolute left-0 top-0 flex h-full max-w-10 items-center justify-center text-[var(--chekin-color-gray-2)]", children: /* @__PURE__ */ jsx144("span", { className: "flex h-full w-10 items-center justify-center", children: leftIcon }) }),
|
|
12038
|
+
/* @__PURE__ */ jsx144(
|
|
11532
12039
|
"input",
|
|
11533
12040
|
{
|
|
11534
12041
|
...props,
|
|
@@ -11565,9 +12072,9 @@ var DashboardInput = React44.forwardRef(
|
|
|
11565
12072
|
)
|
|
11566
12073
|
}
|
|
11567
12074
|
),
|
|
11568
|
-
sign && /* @__PURE__ */
|
|
11569
|
-
trailingAdornment && /* @__PURE__ */
|
|
11570
|
-
onReset && !isEmpty && /* @__PURE__ */
|
|
12075
|
+
sign && /* @__PURE__ */ jsx144("span", { className: "pointer-events-none absolute right-[14px] top-0 flex h-full items-center text-[18px] font-medium leading-6 text-[var(--chekin-color-brand-navy)]", children: sign }),
|
|
12076
|
+
trailingAdornment && /* @__PURE__ */ jsx144("span", { className: "pointer-events-none absolute right-[14px] top-0 flex h-full items-center", children: trailingAdornment }),
|
|
12077
|
+
onReset && !isEmpty && /* @__PURE__ */ jsx144(
|
|
11571
12078
|
"button",
|
|
11572
12079
|
{
|
|
11573
12080
|
type: "button",
|
|
@@ -11575,17 +12082,17 @@ var DashboardInput = React44.forwardRef(
|
|
|
11575
12082
|
disabled,
|
|
11576
12083
|
className: "absolute right-0 top-0 flex h-full w-10 items-center justify-center border-0 bg-transparent p-0 text-[#9696b9] hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-50",
|
|
11577
12084
|
"aria-label": "Reset",
|
|
11578
|
-
children: /* @__PURE__ */
|
|
12085
|
+
children: /* @__PURE__ */ jsx144(X9, { size: 14 })
|
|
11579
12086
|
}
|
|
11580
12087
|
),
|
|
11581
|
-
isPasswordReveal && /* @__PURE__ */
|
|
12088
|
+
isPasswordReveal && /* @__PURE__ */ jsx144(
|
|
11582
12089
|
"button",
|
|
11583
12090
|
{
|
|
11584
12091
|
type: "button",
|
|
11585
12092
|
onClick: togglePasswordReveal,
|
|
11586
12093
|
className: "absolute right-[14px] top-[18px] flex h-[13px] w-[21px] cursor-pointer items-center justify-center border-0 bg-transparent p-0 hover:opacity-85",
|
|
11587
12094
|
"aria-label": isPasswordRevealed ? "Hide password" : "Show password",
|
|
11588
|
-
children: /* @__PURE__ */
|
|
12095
|
+
children: /* @__PURE__ */ jsx144(
|
|
11589
12096
|
Eye,
|
|
11590
12097
|
{
|
|
11591
12098
|
size: 20,
|
|
@@ -11597,32 +12104,32 @@ var DashboardInput = React44.forwardRef(
|
|
|
11597
12104
|
}
|
|
11598
12105
|
)
|
|
11599
12106
|
] }),
|
|
11600
|
-
type === "number" && showNumberButtons && /* @__PURE__ */
|
|
11601
|
-
/* @__PURE__ */
|
|
12107
|
+
type === "number" && showNumberButtons && /* @__PURE__ */ jsxs91("div", { className: "absolute right-[18px] top-[13px] inline-flex items-center text-right", children: [
|
|
12108
|
+
/* @__PURE__ */ jsx144(
|
|
11602
12109
|
"button",
|
|
11603
12110
|
{
|
|
11604
12111
|
type: "button",
|
|
11605
12112
|
onClick: onDecrement,
|
|
11606
12113
|
className: "mr-2 inline-flex h-[23px] w-8 cursor-pointer items-center justify-center rounded-[3px] border-0 bg-[var(--chekin-color-brand-blue)] p-0 text-[20px] font-bold text-white outline-none hover:opacity-90 active:opacity-100",
|
|
11607
12114
|
"aria-label": "Decrement",
|
|
11608
|
-
children: /* @__PURE__ */
|
|
12115
|
+
children: /* @__PURE__ */ jsx144(Minus4, { size: 16, strokeWidth: 3, "aria-hidden": true })
|
|
11609
12116
|
}
|
|
11610
12117
|
),
|
|
11611
|
-
/* @__PURE__ */
|
|
12118
|
+
/* @__PURE__ */ jsx144(
|
|
11612
12119
|
"button",
|
|
11613
12120
|
{
|
|
11614
12121
|
type: "button",
|
|
11615
12122
|
onClick: onIncrement,
|
|
11616
12123
|
className: "inline-flex h-[23px] w-8 cursor-pointer items-center justify-center rounded-[3px] border-0 bg-[var(--chekin-color-brand-blue)] p-0 text-[20px] font-bold text-white outline-none hover:opacity-90 active:opacity-100",
|
|
11617
12124
|
"aria-label": "Increment",
|
|
11618
|
-
children: /* @__PURE__ */
|
|
12125
|
+
children: /* @__PURE__ */ jsx144(Plus3, { size: 16, strokeWidth: 3, "aria-hidden": true })
|
|
11619
12126
|
}
|
|
11620
12127
|
)
|
|
11621
12128
|
] })
|
|
11622
12129
|
]
|
|
11623
12130
|
}
|
|
11624
12131
|
),
|
|
11625
|
-
!errorMessage && optional && /* @__PURE__ */
|
|
12132
|
+
!errorMessage && optional && /* @__PURE__ */ jsx144(
|
|
11626
12133
|
"span",
|
|
11627
12134
|
{
|
|
11628
12135
|
"data-testid": `${name}-optional`,
|
|
@@ -11630,8 +12137,8 @@ var DashboardInput = React44.forwardRef(
|
|
|
11630
12137
|
children: typeof optional === "string" ? optional : t("optional")
|
|
11631
12138
|
}
|
|
11632
12139
|
),
|
|
11633
|
-
!errorMessage && helperText && /* @__PURE__ */
|
|
11634
|
-
errorMessage && renderErrorMessage && /* @__PURE__ */
|
|
12140
|
+
!errorMessage && helperText && /* @__PURE__ */ jsx144("span", { className: "mt-[1px] block text-[12px] font-normal text-[var(--chekin-color-gray-1)]", children: helperText }),
|
|
12141
|
+
errorMessage && renderErrorMessage && /* @__PURE__ */ jsx144(
|
|
11635
12142
|
FieldErrorMessage,
|
|
11636
12143
|
{
|
|
11637
12144
|
id: errorId,
|
|
@@ -11650,11 +12157,11 @@ DashboardInput.displayName = "DashboardInput";
|
|
|
11650
12157
|
|
|
11651
12158
|
// src/dashboard/select/Select.tsx
|
|
11652
12159
|
import * as React48 from "react";
|
|
11653
|
-
import { useTranslation as
|
|
12160
|
+
import { useTranslation as useTranslation30 } from "react-i18next";
|
|
11654
12161
|
|
|
11655
12162
|
// src/dashboard/_select-internals/SelectFieldShell.tsx
|
|
11656
|
-
import { useTranslation as
|
|
11657
|
-
import { jsx as
|
|
12163
|
+
import { useTranslation as useTranslation27 } from "react-i18next";
|
|
12164
|
+
import { jsx as jsx145, jsxs as jsxs92 } from "react/jsx-runtime";
|
|
11658
12165
|
function SelectFieldShell({
|
|
11659
12166
|
containerRef,
|
|
11660
12167
|
className,
|
|
@@ -11673,9 +12180,9 @@ function SelectFieldShell({
|
|
|
11673
12180
|
onBlur,
|
|
11674
12181
|
children
|
|
11675
12182
|
}) {
|
|
11676
|
-
const { t } =
|
|
12183
|
+
const { t } = useTranslation27();
|
|
11677
12184
|
const wrapperWidth = toCssSize(width);
|
|
11678
|
-
return /* @__PURE__ */
|
|
12185
|
+
return /* @__PURE__ */ jsxs92(
|
|
11679
12186
|
"div",
|
|
11680
12187
|
{
|
|
11681
12188
|
ref: containerRef,
|
|
@@ -11688,9 +12195,9 @@ function SelectFieldShell({
|
|
|
11688
12195
|
),
|
|
11689
12196
|
style: wrapperWidth ? { width: wrapperWidth } : void 0,
|
|
11690
12197
|
children: [
|
|
11691
|
-
name && /* @__PURE__ */
|
|
11692
|
-
/* @__PURE__ */
|
|
11693
|
-
topLabel && /* @__PURE__ */
|
|
12198
|
+
name && /* @__PURE__ */ jsx145("input", { type: "hidden", name, value: hiddenValue ?? "" }),
|
|
12199
|
+
/* @__PURE__ */ jsxs92("div", { className: "relative min-h-[68px] w-full", children: [
|
|
12200
|
+
topLabel && /* @__PURE__ */ jsx145(
|
|
11694
12201
|
"label",
|
|
11695
12202
|
{
|
|
11696
12203
|
htmlFor: triggerId,
|
|
@@ -11698,10 +12205,10 @@ function SelectFieldShell({
|
|
|
11698
12205
|
children: topLabel
|
|
11699
12206
|
}
|
|
11700
12207
|
),
|
|
11701
|
-
/* @__PURE__ */
|
|
11702
|
-
!errorMessage && optional && /* @__PURE__ */
|
|
11703
|
-
!errorMessage && helperText && /* @__PURE__ */
|
|
11704
|
-
errorMessage && !hideErrorMessage && /* @__PURE__ */
|
|
12208
|
+
/* @__PURE__ */ jsx145("div", { className: "relative w-full", children }),
|
|
12209
|
+
!errorMessage && optional && /* @__PURE__ */ jsx145("span", { className: "mt-[1px] block text-left text-[14px] font-medium text-[var(--chekin-color-gray-1)]", children: typeof optional === "string" ? optional : t("optional") }),
|
|
12210
|
+
!errorMessage && helperText && /* @__PURE__ */ jsx145("span", { className: "mt-[1px] block text-[12px] font-normal text-[var(--chekin-color-gray-1)]", children: helperText }),
|
|
12211
|
+
errorMessage && !hideErrorMessage && /* @__PURE__ */ jsx145(
|
|
11705
12212
|
FieldErrorMessage,
|
|
11706
12213
|
{
|
|
11707
12214
|
id: errorId,
|
|
@@ -11716,7 +12223,7 @@ function SelectFieldShell({
|
|
|
11716
12223
|
}
|
|
11717
12224
|
|
|
11718
12225
|
// src/dashboard/_select-internals/SelectMenu.tsx
|
|
11719
|
-
import { useTranslation as
|
|
12226
|
+
import { useTranslation as useTranslation28 } from "react-i18next";
|
|
11720
12227
|
|
|
11721
12228
|
// src/dashboard/_select-internals/utils.ts
|
|
11722
12229
|
function getOptionIndex(options, option) {
|
|
@@ -11747,7 +12254,7 @@ function isOptionSelected(option, selectedValue, selectedValues) {
|
|
|
11747
12254
|
}
|
|
11748
12255
|
|
|
11749
12256
|
// src/dashboard/_select-internals/SelectMenu.tsx
|
|
11750
|
-
import { jsx as
|
|
12257
|
+
import { jsx as jsx146, jsxs as jsxs93 } from "react/jsx-runtime";
|
|
11751
12258
|
function SelectMenu({
|
|
11752
12259
|
id,
|
|
11753
12260
|
options,
|
|
@@ -11769,10 +12276,10 @@ function SelectMenu({
|
|
|
11769
12276
|
emptyContent,
|
|
11770
12277
|
footer
|
|
11771
12278
|
}) {
|
|
11772
|
-
const { t } =
|
|
12279
|
+
const { t } = useTranslation28();
|
|
11773
12280
|
const emptyMessage = noOptionsMessage?.() ?? t("no_options");
|
|
11774
12281
|
const hasOptions = options.length > 0;
|
|
11775
|
-
return /* @__PURE__ */
|
|
12282
|
+
return /* @__PURE__ */ jsxs93(
|
|
11776
12283
|
"div",
|
|
11777
12284
|
{
|
|
11778
12285
|
id,
|
|
@@ -11789,13 +12296,13 @@ function SelectMenu({
|
|
|
11789
12296
|
menuClassName
|
|
11790
12297
|
),
|
|
11791
12298
|
children: [
|
|
11792
|
-
!hasOptions && (emptyContent ?? /* @__PURE__ */
|
|
12299
|
+
!hasOptions && (emptyContent ?? /* @__PURE__ */ jsx146("div", { className: "mt-[10px] text-left text-[16px] text-[var(--chekin-color-brand-navy)]", children: emptyMessage })),
|
|
11793
12300
|
options.map((option, index) => {
|
|
11794
12301
|
const isSelected = isOptionSelected(option, selectedValue, selectedValues);
|
|
11795
12302
|
const isHighlighted = index === highlightedIndex;
|
|
11796
12303
|
const optionKey = `${String(option.value)}-${index}`;
|
|
11797
12304
|
const isOptionDisabled = Boolean(disabled || option.isDisabled);
|
|
11798
|
-
return /* @__PURE__ */
|
|
12305
|
+
return /* @__PURE__ */ jsxs93(
|
|
11799
12306
|
"button",
|
|
11800
12307
|
{
|
|
11801
12308
|
id: getOptionId2(index),
|
|
@@ -11818,8 +12325,8 @@ function SelectMenu({
|
|
|
11818
12325
|
isOptionDisabled && "cursor-default opacity-30"
|
|
11819
12326
|
),
|
|
11820
12327
|
children: [
|
|
11821
|
-
/* @__PURE__ */
|
|
11822
|
-
option.description && /* @__PURE__ */
|
|
12328
|
+
/* @__PURE__ */ jsx146("span", { className: "block break-words", children: option.label }),
|
|
12329
|
+
option.description && /* @__PURE__ */ jsx146("span", { className: "ml-2 mt-[3px] shrink-0 text-[12px] font-bold italic text-[#777e91]", children: option.description })
|
|
11823
12330
|
]
|
|
11824
12331
|
},
|
|
11825
12332
|
optionKey
|
|
@@ -11832,11 +12339,11 @@ function SelectMenu({
|
|
|
11832
12339
|
}
|
|
11833
12340
|
|
|
11834
12341
|
// src/dashboard/_select-internals/SelectMenuPanel.tsx
|
|
11835
|
-
import { useTranslation as
|
|
11836
|
-
import { jsx as
|
|
12342
|
+
import { useTranslation as useTranslation29 } from "react-i18next";
|
|
12343
|
+
import { jsx as jsx147, jsxs as jsxs94 } from "react/jsx-runtime";
|
|
11837
12344
|
function SelectMenuPanel({
|
|
11838
12345
|
isOpen,
|
|
11839
|
-
isMobile:
|
|
12346
|
+
isMobile: isMobile3,
|
|
11840
12347
|
onClose,
|
|
11841
12348
|
title,
|
|
11842
12349
|
description,
|
|
@@ -11845,29 +12352,29 @@ function SelectMenuPanel({
|
|
|
11845
12352
|
drawerContentClassName,
|
|
11846
12353
|
children
|
|
11847
12354
|
}) {
|
|
11848
|
-
const { t } =
|
|
12355
|
+
const { t } = useTranslation29();
|
|
11849
12356
|
if (!isOpen) return null;
|
|
11850
|
-
if (
|
|
12357
|
+
if (isMobile3) {
|
|
11851
12358
|
const fallbackTitle = t("select_option");
|
|
11852
12359
|
const titleText = typeof title === "string" || typeof title === "number" ? String(title) : fallbackTitle;
|
|
11853
12360
|
const descriptionText = typeof description === "string" || typeof description === "number" ? String(description) : titleText;
|
|
11854
|
-
return /* @__PURE__ */
|
|
12361
|
+
return /* @__PURE__ */ jsx147(
|
|
11855
12362
|
Drawer,
|
|
11856
12363
|
{
|
|
11857
12364
|
open: isOpen,
|
|
11858
12365
|
onOpenChange: (next) => {
|
|
11859
12366
|
if (!next) onClose();
|
|
11860
12367
|
},
|
|
11861
|
-
children: /* @__PURE__ */
|
|
12368
|
+
children: /* @__PURE__ */ jsxs94(
|
|
11862
12369
|
DrawerContent,
|
|
11863
12370
|
{
|
|
11864
12371
|
onClose,
|
|
11865
12372
|
lockScroll: false,
|
|
11866
12373
|
className: cn("max-h-[calc(100vh-1rem)]", drawerClassName),
|
|
11867
12374
|
children: [
|
|
11868
|
-
/* @__PURE__ */
|
|
11869
|
-
/* @__PURE__ */
|
|
11870
|
-
/* @__PURE__ */
|
|
12375
|
+
/* @__PURE__ */ jsx147(DrawerTitle, { className: "sr-only", children: titleText }),
|
|
12376
|
+
/* @__PURE__ */ jsx147(DrawerDescription, { className: "sr-only", children: descriptionText }),
|
|
12377
|
+
/* @__PURE__ */ jsx147(
|
|
11871
12378
|
"div",
|
|
11872
12379
|
{
|
|
11873
12380
|
className: cn(
|
|
@@ -11883,7 +12390,7 @@ function SelectMenuPanel({
|
|
|
11883
12390
|
}
|
|
11884
12391
|
);
|
|
11885
12392
|
}
|
|
11886
|
-
return /* @__PURE__ */
|
|
12393
|
+
return /* @__PURE__ */ jsx147(
|
|
11887
12394
|
"div",
|
|
11888
12395
|
{
|
|
11889
12396
|
className: cn(
|
|
@@ -11896,7 +12403,7 @@ function SelectMenuPanel({
|
|
|
11896
12403
|
}
|
|
11897
12404
|
|
|
11898
12405
|
// src/dashboard/_select-internals/SelectSearchInput.tsx
|
|
11899
|
-
import { jsx as
|
|
12406
|
+
import { jsx as jsx148 } from "react/jsx-runtime";
|
|
11900
12407
|
function SelectSearchInput({
|
|
11901
12408
|
inputRef,
|
|
11902
12409
|
value,
|
|
@@ -11906,7 +12413,7 @@ function SelectSearchInput({
|
|
|
11906
12413
|
onChange,
|
|
11907
12414
|
onKeyDown
|
|
11908
12415
|
}) {
|
|
11909
|
-
return /* @__PURE__ */
|
|
12416
|
+
return /* @__PURE__ */ jsx148("div", { className: "border-b border-[#f2f4f8] px-4 pb-2 pt-3", children: /* @__PURE__ */ jsx148(
|
|
11910
12417
|
"input",
|
|
11911
12418
|
{
|
|
11912
12419
|
ref: inputRef,
|
|
@@ -11925,7 +12432,7 @@ function SelectSearchInput({
|
|
|
11925
12432
|
|
|
11926
12433
|
// src/dashboard/_select-internals/SelectTrigger.tsx
|
|
11927
12434
|
import { ChevronDown as ChevronDown2 } from "lucide-react";
|
|
11928
|
-
import { jsx as
|
|
12435
|
+
import { jsx as jsx149, jsxs as jsxs95 } from "react/jsx-runtime";
|
|
11929
12436
|
function SelectTrigger({
|
|
11930
12437
|
triggerRef,
|
|
11931
12438
|
triggerId,
|
|
@@ -11946,7 +12453,7 @@ function SelectTrigger({
|
|
|
11946
12453
|
onBlur
|
|
11947
12454
|
}) {
|
|
11948
12455
|
const isEmpty = !hasValue;
|
|
11949
|
-
return /* @__PURE__ */
|
|
12456
|
+
return /* @__PURE__ */ jsxs95(
|
|
11950
12457
|
"button",
|
|
11951
12458
|
{
|
|
11952
12459
|
id: triggerId,
|
|
@@ -11970,10 +12477,10 @@ function SelectTrigger({
|
|
|
11970
12477
|
loading && "cursor-progress"
|
|
11971
12478
|
),
|
|
11972
12479
|
children: [
|
|
11973
|
-
/* @__PURE__ */
|
|
11974
|
-
/* @__PURE__ */
|
|
11975
|
-
loading && /* @__PURE__ */
|
|
11976
|
-
/* @__PURE__ */
|
|
12480
|
+
/* @__PURE__ */ jsx149("span", { id: valueId, className: "block min-w-0 flex-1 truncate text-left", children: valueLabel ?? (isOpen ? placeholder : null) }),
|
|
12481
|
+
/* @__PURE__ */ jsxs95("span", { className: "pointer-events-none flex items-center gap-2 text-[var(--chekin-color-gray-2)]", children: [
|
|
12482
|
+
loading && /* @__PURE__ */ jsx149(ThreeDotsLoader, { height: 18, width: 18 }),
|
|
12483
|
+
/* @__PURE__ */ jsx149(
|
|
11977
12484
|
ChevronDown2,
|
|
11978
12485
|
{
|
|
11979
12486
|
size: 16,
|
|
@@ -12028,7 +12535,7 @@ function useSelectIds({
|
|
|
12028
12535
|
import * as React46 from "react";
|
|
12029
12536
|
function useSelectMenuState({
|
|
12030
12537
|
isBlocked,
|
|
12031
|
-
isMobile:
|
|
12538
|
+
isMobile: isMobile3,
|
|
12032
12539
|
onOutsideClick
|
|
12033
12540
|
}) {
|
|
12034
12541
|
const containerRef = React46.useRef(null);
|
|
@@ -12049,7 +12556,7 @@ function useSelectMenuState({
|
|
|
12049
12556
|
setIsOpen(false);
|
|
12050
12557
|
onOutsideClick?.();
|
|
12051
12558
|
},
|
|
12052
|
-
isDisabled: !isOpen ||
|
|
12559
|
+
isDisabled: !isOpen || isMobile3
|
|
12053
12560
|
});
|
|
12054
12561
|
React46.useEffect(() => {
|
|
12055
12562
|
if (isBlocked) setIsOpen(false);
|
|
@@ -12074,7 +12581,7 @@ function useSelectSearch({
|
|
|
12074
12581
|
}
|
|
12075
12582
|
|
|
12076
12583
|
// src/dashboard/select/Select.tsx
|
|
12077
|
-
import { jsx as
|
|
12584
|
+
import { jsx as jsx150, jsxs as jsxs96 } from "react/jsx-runtime";
|
|
12078
12585
|
function DashboardSelectInternal({
|
|
12079
12586
|
options = [],
|
|
12080
12587
|
value,
|
|
@@ -12108,8 +12615,8 @@ function DashboardSelectInternal({
|
|
|
12108
12615
|
const listRef = React48.useRef(null);
|
|
12109
12616
|
const optionRefs = React48.useRef([]);
|
|
12110
12617
|
const [highlightedIndex, setHighlightedIndex] = React48.useState(-1);
|
|
12111
|
-
const
|
|
12112
|
-
const { t } =
|
|
12618
|
+
const isMobile3 = useIsMobile();
|
|
12619
|
+
const { t } = useTranslation30();
|
|
12113
12620
|
const resolvedSearchPlaceholder = searchPlaceholder ?? t("search_placeholder");
|
|
12114
12621
|
const hasValue = Boolean(value);
|
|
12115
12622
|
const isBlocked = Boolean(disabled) || Boolean(loading);
|
|
@@ -12119,7 +12626,7 @@ function DashboardSelectInternal({
|
|
|
12119
12626
|
const valueLabel = value ? getValueLabel?.(value) ?? String(value.label) : void 0;
|
|
12120
12627
|
const { containerRef, isOpen, closeMenu, toggleMenu, setIsOpen } = useSelectMenuState({
|
|
12121
12628
|
isBlocked,
|
|
12122
|
-
isMobile:
|
|
12629
|
+
isMobile: isMobile3
|
|
12123
12630
|
});
|
|
12124
12631
|
const { triggerId, labelId, valueId, listboxId, describedErrorId, errorId, getOptionId: getOptionId2 } = useSelectIds({ name, hasValue, error, hideErrorMessage });
|
|
12125
12632
|
const { searchValue, setSearchValue, filteredOptions } = useSelectSearch({
|
|
@@ -12198,7 +12705,7 @@ function DashboardSelectInternal({
|
|
|
12198
12705
|
setIsOpen(false);
|
|
12199
12706
|
}
|
|
12200
12707
|
};
|
|
12201
|
-
return /* @__PURE__ */
|
|
12708
|
+
return /* @__PURE__ */ jsxs96(
|
|
12202
12709
|
SelectFieldShell,
|
|
12203
12710
|
{
|
|
12204
12711
|
containerRef,
|
|
@@ -12216,7 +12723,7 @@ function DashboardSelectInternal({
|
|
|
12216
12723
|
name,
|
|
12217
12724
|
hiddenValue: value ? String(value.value) : "",
|
|
12218
12725
|
children: [
|
|
12219
|
-
/* @__PURE__ */
|
|
12726
|
+
/* @__PURE__ */ jsx150(
|
|
12220
12727
|
SelectTrigger,
|
|
12221
12728
|
{
|
|
12222
12729
|
triggerRef,
|
|
@@ -12238,7 +12745,7 @@ function DashboardSelectInternal({
|
|
|
12238
12745
|
onBlur
|
|
12239
12746
|
}
|
|
12240
12747
|
),
|
|
12241
|
-
/* @__PURE__ */
|
|
12748
|
+
/* @__PURE__ */ jsx150(
|
|
12242
12749
|
Fieldset,
|
|
12243
12750
|
{
|
|
12244
12751
|
isFocused: isOpen,
|
|
@@ -12255,17 +12762,17 @@ function DashboardSelectInternal({
|
|
|
12255
12762
|
onClick: !isBlocked ? toggleMenu : void 0
|
|
12256
12763
|
}
|
|
12257
12764
|
),
|
|
12258
|
-
/* @__PURE__ */
|
|
12765
|
+
/* @__PURE__ */ jsxs96(
|
|
12259
12766
|
SelectMenuPanel,
|
|
12260
12767
|
{
|
|
12261
12768
|
isOpen,
|
|
12262
|
-
isMobile:
|
|
12769
|
+
isMobile: isMobile3,
|
|
12263
12770
|
onClose: closeMenu,
|
|
12264
12771
|
title: typeof label === "string" ? label : void 0,
|
|
12265
12772
|
className: dropdownClassName,
|
|
12266
12773
|
drawerClassName,
|
|
12267
12774
|
children: [
|
|
12268
|
-
searchable && /* @__PURE__ */
|
|
12775
|
+
searchable && /* @__PURE__ */ jsx150(
|
|
12269
12776
|
SelectSearchInput,
|
|
12270
12777
|
{
|
|
12271
12778
|
inputRef: searchInputRef,
|
|
@@ -12277,7 +12784,7 @@ function DashboardSelectInternal({
|
|
|
12277
12784
|
onKeyDown: handleSearchKeyDown
|
|
12278
12785
|
}
|
|
12279
12786
|
),
|
|
12280
|
-
/* @__PURE__ */
|
|
12787
|
+
/* @__PURE__ */ jsx150(
|
|
12281
12788
|
SelectMenu,
|
|
12282
12789
|
{
|
|
12283
12790
|
id: listboxId,
|
|
@@ -12312,22 +12819,22 @@ var DashboardSelect = React48.forwardRef(
|
|
|
12312
12819
|
// src/dashboard/multi-select/MultiSelect.tsx
|
|
12313
12820
|
import * as React49 from "react";
|
|
12314
12821
|
import { SquareX as SquareX3 } from "lucide-react";
|
|
12315
|
-
import { useTranslation as
|
|
12822
|
+
import { useTranslation as useTranslation32 } from "react-i18next";
|
|
12316
12823
|
|
|
12317
12824
|
// src/dashboard/multi-select/MultiSelectChip.tsx
|
|
12318
12825
|
import { SquareX as SquareX2 } from "lucide-react";
|
|
12319
|
-
import { useTranslation as
|
|
12320
|
-
import { jsx as
|
|
12826
|
+
import { useTranslation as useTranslation31 } from "react-i18next";
|
|
12827
|
+
import { jsx as jsx151, jsxs as jsxs97 } from "react/jsx-runtime";
|
|
12321
12828
|
function MultiSelectChip({
|
|
12322
12829
|
option,
|
|
12323
12830
|
readOnly,
|
|
12324
12831
|
onRemove
|
|
12325
12832
|
}) {
|
|
12326
|
-
const { t } =
|
|
12833
|
+
const { t } = useTranslation31();
|
|
12327
12834
|
const labelText = typeof option.label === "string" ? option.label : String(option.value);
|
|
12328
|
-
return /* @__PURE__ */
|
|
12329
|
-
/* @__PURE__ */
|
|
12330
|
-
!readOnly && /* @__PURE__ */
|
|
12835
|
+
return /* @__PURE__ */ jsxs97("span", { className: "inline-flex items-center gap-2 rounded-[4px] border border-[#acacd5] bg-[#f0f0f8] py-[2px] pl-[10px] pr-1 text-[12px] font-medium text-[var(--chekin-color-brand-navy)]", children: [
|
|
12836
|
+
/* @__PURE__ */ jsx151("span", { className: "whitespace-nowrap", children: option.label }),
|
|
12837
|
+
!readOnly && /* @__PURE__ */ jsx151(
|
|
12331
12838
|
"button",
|
|
12332
12839
|
{
|
|
12333
12840
|
type: "button",
|
|
@@ -12337,14 +12844,14 @@ function MultiSelectChip({
|
|
|
12337
12844
|
},
|
|
12338
12845
|
className: "flex h-[15px] w-[15px] items-center justify-center rounded-[3px] border-0 bg-transparent p-0 text-[#9696b9] hover:shadow-[0_3px_3px_#0f477734]",
|
|
12339
12846
|
"aria-label": t("remove_item", { label: labelText }),
|
|
12340
|
-
children: /* @__PURE__ */
|
|
12847
|
+
children: /* @__PURE__ */ jsx151(SquareX2, { size: 15, fill: "#9696b9", color: "#f8f8f8", strokeWidth: 1.8 })
|
|
12341
12848
|
}
|
|
12342
12849
|
)
|
|
12343
12850
|
] });
|
|
12344
12851
|
}
|
|
12345
12852
|
|
|
12346
12853
|
// src/dashboard/multi-select/MultiSelect.tsx
|
|
12347
|
-
import { jsx as
|
|
12854
|
+
import { jsx as jsx152, jsxs as jsxs98 } from "react/jsx-runtime";
|
|
12348
12855
|
var isValueSelected = (selected, option) => selected.some((item) => item.value === option.value);
|
|
12349
12856
|
function DashboardMultiSelectInternal({
|
|
12350
12857
|
options = [],
|
|
@@ -12384,8 +12891,8 @@ function DashboardMultiSelectInternal({
|
|
|
12384
12891
|
const optionRefs = React49.useRef([]);
|
|
12385
12892
|
const [isFocused, setIsFocused] = React49.useState(false);
|
|
12386
12893
|
const [highlightedIndex, setHighlightedIndex] = React49.useState(-1);
|
|
12387
|
-
const
|
|
12388
|
-
const { t } =
|
|
12894
|
+
const isMobile3 = useIsMobile();
|
|
12895
|
+
const { t } = useTranslation32();
|
|
12389
12896
|
const selectedValues = React49.useMemo(() => value ?? [], [value]);
|
|
12390
12897
|
const hasValue = selectedValues.length > 0;
|
|
12391
12898
|
const isEmpty = !hasValue;
|
|
@@ -12395,7 +12902,7 @@ function DashboardMultiSelectInternal({
|
|
|
12395
12902
|
const errorMessage = typeof error === "string" ? error : void 0;
|
|
12396
12903
|
const { containerRef, isOpen, closeMenu, setIsOpen } = useSelectMenuState({
|
|
12397
12904
|
isBlocked,
|
|
12398
|
-
isMobile:
|
|
12905
|
+
isMobile: isMobile3,
|
|
12399
12906
|
onOutsideClick: () => setIsFocused(false)
|
|
12400
12907
|
});
|
|
12401
12908
|
const { triggerId, labelId, valueId, listboxId, describedErrorId, errorId, getOptionId: getOptionId2 } = useSelectIds({ name, hasValue, error, hideErrorMessage });
|
|
@@ -12437,12 +12944,12 @@ function DashboardMultiSelectInternal({
|
|
|
12437
12944
|
});
|
|
12438
12945
|
}, [isOpen, filteredOptions]);
|
|
12439
12946
|
React49.useEffect(() => {
|
|
12440
|
-
if (!isOpen || !
|
|
12947
|
+
if (!isOpen || !isMobile3) return;
|
|
12441
12948
|
const frame = window.requestAnimationFrame(
|
|
12442
12949
|
() => mobileSearchInputRef.current?.focus()
|
|
12443
12950
|
);
|
|
12444
12951
|
return () => window.cancelAnimationFrame(frame);
|
|
12445
|
-
}, [isOpen,
|
|
12952
|
+
}, [isOpen, isMobile3]);
|
|
12446
12953
|
const openMenu = () => {
|
|
12447
12954
|
if (isBlocked) return;
|
|
12448
12955
|
setIsOpen(true);
|
|
@@ -12539,7 +13046,7 @@ function DashboardMultiSelectInternal({
|
|
|
12539
13046
|
setIsFocused(false);
|
|
12540
13047
|
onBlur?.(event);
|
|
12541
13048
|
};
|
|
12542
|
-
return /* @__PURE__ */
|
|
13049
|
+
return /* @__PURE__ */ jsxs98(
|
|
12543
13050
|
SelectFieldShell,
|
|
12544
13051
|
{
|
|
12545
13052
|
containerRef,
|
|
@@ -12558,7 +13065,7 @@ function DashboardMultiSelectInternal({
|
|
|
12558
13065
|
hiddenValue: selectedValues.map((item) => String(item.value)).join(","),
|
|
12559
13066
|
onBlur: handleInputBlur,
|
|
12560
13067
|
children: [
|
|
12561
|
-
/* @__PURE__ */
|
|
13068
|
+
/* @__PURE__ */ jsxs98(
|
|
12562
13069
|
"div",
|
|
12563
13070
|
{
|
|
12564
13071
|
id: triggerId,
|
|
@@ -12581,7 +13088,7 @@ function DashboardMultiSelectInternal({
|
|
|
12581
13088
|
),
|
|
12582
13089
|
children: [
|
|
12583
13090
|
selectedValues.map(
|
|
12584
|
-
(option) => renderChip ? /* @__PURE__ */
|
|
13091
|
+
(option) => renderChip ? /* @__PURE__ */ jsx152(React49.Fragment, { children: renderChip(option, () => removeOption(option)) }, String(option.value)) : /* @__PURE__ */ jsx152(
|
|
12585
13092
|
MultiSelectChip,
|
|
12586
13093
|
{
|
|
12587
13094
|
option,
|
|
@@ -12591,7 +13098,7 @@ function DashboardMultiSelectInternal({
|
|
|
12591
13098
|
String(option.value)
|
|
12592
13099
|
)
|
|
12593
13100
|
),
|
|
12594
|
-
/* @__PURE__ */
|
|
13101
|
+
/* @__PURE__ */ jsx152(
|
|
12595
13102
|
"input",
|
|
12596
13103
|
{
|
|
12597
13104
|
ref: inputRef,
|
|
@@ -12620,9 +13127,9 @@ function DashboardMultiSelectInternal({
|
|
|
12620
13127
|
"aria-activedescendant": isOpen && highlightedIndex >= 0 ? getOptionId2(highlightedIndex) : void 0
|
|
12621
13128
|
}
|
|
12622
13129
|
),
|
|
12623
|
-
/* @__PURE__ */
|
|
12624
|
-
loading && /* @__PURE__ */
|
|
12625
|
-
hasValue && !readOnly && /* @__PURE__ */
|
|
13130
|
+
/* @__PURE__ */ jsxs98("span", { className: "ml-auto flex items-center gap-2 pl-2 text-[var(--chekin-color-gray-2)]", children: [
|
|
13131
|
+
loading && /* @__PURE__ */ jsx152(ThreeDotsLoader, { height: 18, width: 18 }),
|
|
13132
|
+
hasValue && !readOnly && /* @__PURE__ */ jsx152(
|
|
12626
13133
|
"button",
|
|
12627
13134
|
{
|
|
12628
13135
|
type: "button",
|
|
@@ -12632,10 +13139,10 @@ function DashboardMultiSelectInternal({
|
|
|
12632
13139
|
},
|
|
12633
13140
|
className: "flex h-5 w-5 items-center justify-center rounded-[3px] border-0 bg-transparent p-0 text-[#9696b9] hover:shadow-[0_3px_3px_#0f477734]",
|
|
12634
13141
|
"aria-label": t("clear_all"),
|
|
12635
|
-
children: /* @__PURE__ */
|
|
13142
|
+
children: /* @__PURE__ */ jsx152(SquareX3, { size: 15, fill: "#9696b9", color: "#f8f8f8", strokeWidth: 1.8 })
|
|
12636
13143
|
}
|
|
12637
13144
|
),
|
|
12638
|
-
/* @__PURE__ */
|
|
13145
|
+
/* @__PURE__ */ jsx152(
|
|
12639
13146
|
RotateArrow,
|
|
12640
13147
|
{
|
|
12641
13148
|
shouldRotate: isOpen,
|
|
@@ -12648,7 +13155,7 @@ function DashboardMultiSelectInternal({
|
|
|
12648
13155
|
]
|
|
12649
13156
|
}
|
|
12650
13157
|
),
|
|
12651
|
-
/* @__PURE__ */
|
|
13158
|
+
/* @__PURE__ */ jsx152(
|
|
12652
13159
|
Fieldset,
|
|
12653
13160
|
{
|
|
12654
13161
|
isFocused: isFocused || isOpen,
|
|
@@ -12666,11 +13173,11 @@ function DashboardMultiSelectInternal({
|
|
|
12666
13173
|
onClick: handleContainerClick
|
|
12667
13174
|
}
|
|
12668
13175
|
),
|
|
12669
|
-
/* @__PURE__ */
|
|
13176
|
+
/* @__PURE__ */ jsxs98(
|
|
12670
13177
|
SelectMenuPanel,
|
|
12671
13178
|
{
|
|
12672
13179
|
isOpen,
|
|
12673
|
-
isMobile:
|
|
13180
|
+
isMobile: isMobile3,
|
|
12674
13181
|
onClose: () => {
|
|
12675
13182
|
closeMenu();
|
|
12676
13183
|
setIsFocused(false);
|
|
@@ -12679,7 +13186,7 @@ function DashboardMultiSelectInternal({
|
|
|
12679
13186
|
className: dropdownClassName,
|
|
12680
13187
|
drawerClassName,
|
|
12681
13188
|
children: [
|
|
12682
|
-
|
|
13189
|
+
isMobile3 && /* @__PURE__ */ jsx152("div", { className: "border-b border-[#f2f4f8] px-4 pb-2 pt-3", children: /* @__PURE__ */ jsx152(
|
|
12683
13190
|
"input",
|
|
12684
13191
|
{
|
|
12685
13192
|
ref: mobileSearchInputRef,
|
|
@@ -12694,7 +13201,7 @@ function DashboardMultiSelectInternal({
|
|
|
12694
13201
|
className: "m-0 box-border h-9 w-full rounded-md border border-[var(--chekin-color-gray-3)] bg-white px-3 text-[16px] font-medium text-[var(--chekin-color-brand-navy)] outline-none transition-colors placeholder:text-[var(--chekin-color-gray-1)] focus:border-[var(--chekin-color-brand-blue)]"
|
|
12695
13202
|
}
|
|
12696
13203
|
) }),
|
|
12697
|
-
/* @__PURE__ */
|
|
13204
|
+
/* @__PURE__ */ jsx152(
|
|
12698
13205
|
SelectMenu,
|
|
12699
13206
|
{
|
|
12700
13207
|
id: listboxId,
|
|
@@ -12716,7 +13223,7 @@ function DashboardMultiSelectInternal({
|
|
|
12716
13223
|
isMulti: true
|
|
12717
13224
|
}
|
|
12718
13225
|
),
|
|
12719
|
-
canCreateNewOption && /* @__PURE__ */
|
|
13226
|
+
canCreateNewOption && /* @__PURE__ */ jsx152(
|
|
12720
13227
|
"button",
|
|
12721
13228
|
{
|
|
12722
13229
|
type: "button",
|
|
@@ -12738,20 +13245,20 @@ var DashboardMultiSelect = React49.forwardRef(
|
|
|
12738
13245
|
|
|
12739
13246
|
// src/dashboard/creatable-multi-select/CreatableMultiSelect.tsx
|
|
12740
13247
|
import * as React50 from "react";
|
|
12741
|
-
import { jsx as
|
|
13248
|
+
import { jsx as jsx153 } from "react/jsx-runtime";
|
|
12742
13249
|
var DashboardCreatableMultiSelect = React50.forwardRef(
|
|
12743
13250
|
function DashboardCreatableMultiSelect2(props, ref) {
|
|
12744
|
-
return /* @__PURE__ */
|
|
13251
|
+
return /* @__PURE__ */ jsx153(DashboardMultiSelect, { ref, ...props, isCreatable: true });
|
|
12745
13252
|
}
|
|
12746
13253
|
);
|
|
12747
13254
|
|
|
12748
13255
|
// src/dashboard/infinite-scroll-select/InfiniteScrollSelect.tsx
|
|
12749
13256
|
import * as React51 from "react";
|
|
12750
13257
|
import { useVirtualizer as useVirtualizer2 } from "@tanstack/react-virtual";
|
|
12751
|
-
import { useTranslation as
|
|
13258
|
+
import { useTranslation as useTranslation33 } from "react-i18next";
|
|
12752
13259
|
|
|
12753
13260
|
// src/dashboard/infinite-scroll-select/InfiniteScrollList.tsx
|
|
12754
|
-
import { jsx as
|
|
13261
|
+
import { jsx as jsx154, jsxs as jsxs99 } from "react/jsx-runtime";
|
|
12755
13262
|
function InfiniteScrollList({
|
|
12756
13263
|
scrollRef,
|
|
12757
13264
|
listboxId,
|
|
@@ -12772,13 +13279,13 @@ function InfiniteScrollList({
|
|
|
12772
13279
|
onHighlight
|
|
12773
13280
|
}) {
|
|
12774
13281
|
const virtualItems = virtualizer.getVirtualItems();
|
|
12775
|
-
return /* @__PURE__ */
|
|
13282
|
+
return /* @__PURE__ */ jsx154(
|
|
12776
13283
|
"div",
|
|
12777
13284
|
{
|
|
12778
13285
|
ref: scrollRef,
|
|
12779
13286
|
className: cn("overflow-y-auto", menuClassName),
|
|
12780
13287
|
style: { height: `${height}px` },
|
|
12781
|
-
children: /* @__PURE__ */
|
|
13288
|
+
children: /* @__PURE__ */ jsx154(
|
|
12782
13289
|
"div",
|
|
12783
13290
|
{
|
|
12784
13291
|
id: listboxId,
|
|
@@ -12795,7 +13302,7 @@ function InfiniteScrollList({
|
|
|
12795
13302
|
const isSelected = !isLoaderRow && option ? option.value === value?.value : false;
|
|
12796
13303
|
const isHighlighted = virtualItem.index === highlightedIndex;
|
|
12797
13304
|
const isOptionDisabled = Boolean(isBlocked || option?.isDisabled);
|
|
12798
|
-
return /* @__PURE__ */
|
|
13305
|
+
return /* @__PURE__ */ jsx154(
|
|
12799
13306
|
"div",
|
|
12800
13307
|
{
|
|
12801
13308
|
"data-index": virtualItem.index,
|
|
@@ -12804,10 +13311,10 @@ function InfiniteScrollList({
|
|
|
12804
13311
|
height: `${virtualItem.size}px`,
|
|
12805
13312
|
transform: `translateY(${virtualItem.start}px)`
|
|
12806
13313
|
},
|
|
12807
|
-
children: isLoaderRow ? /* @__PURE__ */
|
|
12808
|
-
/* @__PURE__ */
|
|
12809
|
-
/* @__PURE__ */
|
|
12810
|
-
] }) : /* @__PURE__ */
|
|
13314
|
+
children: isLoaderRow ? /* @__PURE__ */ jsxs99("div", { className: "flex h-full items-center justify-center gap-2 px-4 text-[14px] font-medium text-[var(--chekin-color-gray-1)]", children: [
|
|
13315
|
+
/* @__PURE__ */ jsx154(ThreeDotsLoader, { height: 36, width: 36 }),
|
|
13316
|
+
/* @__PURE__ */ jsx154("span", { children: loadingMoreText })
|
|
13317
|
+
] }) : /* @__PURE__ */ jsxs99(
|
|
12811
13318
|
"button",
|
|
12812
13319
|
{
|
|
12813
13320
|
id: getOptionId2(virtualItem.index),
|
|
@@ -12826,8 +13333,8 @@ function InfiniteScrollList({
|
|
|
12826
13333
|
isOptionDisabled && "cursor-default opacity-30"
|
|
12827
13334
|
),
|
|
12828
13335
|
children: [
|
|
12829
|
-
/* @__PURE__ */
|
|
12830
|
-
option?.description && /* @__PURE__ */
|
|
13336
|
+
/* @__PURE__ */ jsx154("span", { className: "block break-words", children: option?.label }),
|
|
13337
|
+
option?.description && /* @__PURE__ */ jsx154("span", { className: "ml-2 mt-[3px] shrink-0 text-[12px] font-bold italic text-[#777e91]", children: option.description })
|
|
12831
13338
|
]
|
|
12832
13339
|
}
|
|
12833
13340
|
)
|
|
@@ -12842,7 +13349,7 @@ function InfiniteScrollList({
|
|
|
12842
13349
|
}
|
|
12843
13350
|
|
|
12844
13351
|
// src/dashboard/infinite-scroll-select/InfiniteScrollSelect.tsx
|
|
12845
|
-
import { jsx as
|
|
13352
|
+
import { jsx as jsx155, jsxs as jsxs100 } from "react/jsx-runtime";
|
|
12846
13353
|
var DEFAULT_ITEM_HEIGHT = 60;
|
|
12847
13354
|
var DEFAULT_LIST_HEIGHT = 322;
|
|
12848
13355
|
var DEFAULT_OVERSCAN = 5;
|
|
@@ -12890,8 +13397,8 @@ function DashboardInfiniteScrollSelectInternal({
|
|
|
12890
13397
|
const previousHighlightedIndexRef = React51.useRef(-1);
|
|
12891
13398
|
const lastLoadMoreOptionsLengthRef = React51.useRef(null);
|
|
12892
13399
|
const [highlightedIndex, setHighlightedIndex] = React51.useState(-1);
|
|
12893
|
-
const
|
|
12894
|
-
const { t } =
|
|
13400
|
+
const isMobile3 = useIsMobile();
|
|
13401
|
+
const { t } = useTranslation33();
|
|
12895
13402
|
const resolvedSearchPlaceholder = searchPlaceholder ?? t("search_placeholder");
|
|
12896
13403
|
const resolvedLoadingMoreText = loadingMoreText ?? t("loading_more");
|
|
12897
13404
|
const hasValue = Boolean(value);
|
|
@@ -12902,7 +13409,7 @@ function DashboardInfiniteScrollSelectInternal({
|
|
|
12902
13409
|
const valueLabel = value ? getValueLabel?.(value) ?? String(value.label) : void 0;
|
|
12903
13410
|
const { containerRef, isOpen, closeMenu, toggleMenu, setIsOpen } = useSelectMenuState({
|
|
12904
13411
|
isBlocked,
|
|
12905
|
-
isMobile:
|
|
13412
|
+
isMobile: isMobile3
|
|
12906
13413
|
});
|
|
12907
13414
|
const { triggerId, labelId, valueId, listboxId, describedErrorId, errorId, getOptionId: getOptionId2 } = useSelectIds({ name, hasValue, error, hideErrorMessage });
|
|
12908
13415
|
const { searchValue, setSearchValue, filteredOptions } = useSelectSearch({
|
|
@@ -13015,7 +13522,7 @@ function DashboardInfiniteScrollSelectInternal({
|
|
|
13015
13522
|
const totalSize = virtualizer.getTotalSize();
|
|
13016
13523
|
const measuredListHeight = Math.min(listHeight, Math.max(totalSize, itemHeight));
|
|
13017
13524
|
const activeOptionId = highlightedIndex >= 0 ? getOptionId2(highlightedIndex) : void 0;
|
|
13018
|
-
return /* @__PURE__ */
|
|
13525
|
+
return /* @__PURE__ */ jsxs100(
|
|
13019
13526
|
SelectFieldShell,
|
|
13020
13527
|
{
|
|
13021
13528
|
containerRef,
|
|
@@ -13033,7 +13540,7 @@ function DashboardInfiniteScrollSelectInternal({
|
|
|
13033
13540
|
name,
|
|
13034
13541
|
hiddenValue: value ? String(value.value) : "",
|
|
13035
13542
|
children: [
|
|
13036
|
-
/* @__PURE__ */
|
|
13543
|
+
/* @__PURE__ */ jsx155(
|
|
13037
13544
|
SelectTrigger,
|
|
13038
13545
|
{
|
|
13039
13546
|
triggerRef,
|
|
@@ -13055,7 +13562,7 @@ function DashboardInfiniteScrollSelectInternal({
|
|
|
13055
13562
|
onBlur
|
|
13056
13563
|
}
|
|
13057
13564
|
),
|
|
13058
|
-
/* @__PURE__ */
|
|
13565
|
+
/* @__PURE__ */ jsx155(
|
|
13059
13566
|
Fieldset,
|
|
13060
13567
|
{
|
|
13061
13568
|
isFocused: isOpen,
|
|
@@ -13072,17 +13579,17 @@ function DashboardInfiniteScrollSelectInternal({
|
|
|
13072
13579
|
onClick: !isBlocked ? toggleMenu : void 0
|
|
13073
13580
|
}
|
|
13074
13581
|
),
|
|
13075
|
-
/* @__PURE__ */
|
|
13582
|
+
/* @__PURE__ */ jsxs100(
|
|
13076
13583
|
SelectMenuPanel,
|
|
13077
13584
|
{
|
|
13078
13585
|
isOpen,
|
|
13079
|
-
isMobile:
|
|
13586
|
+
isMobile: isMobile3,
|
|
13080
13587
|
onClose: closeMenu,
|
|
13081
13588
|
title: typeof label === "string" ? label : void 0,
|
|
13082
13589
|
className: dropdownClassName,
|
|
13083
13590
|
drawerClassName,
|
|
13084
13591
|
children: [
|
|
13085
|
-
searchable && /* @__PURE__ */
|
|
13592
|
+
searchable && /* @__PURE__ */ jsx155(
|
|
13086
13593
|
SelectSearchInput,
|
|
13087
13594
|
{
|
|
13088
13595
|
inputRef: searchInputRef,
|
|
@@ -13094,10 +13601,10 @@ function DashboardInfiniteScrollSelectInternal({
|
|
|
13094
13601
|
onKeyDown: handleSearchKeyDown
|
|
13095
13602
|
}
|
|
13096
13603
|
),
|
|
13097
|
-
filteredOptions.length === 0 && isLoadingMore ? /* @__PURE__ */
|
|
13098
|
-
/* @__PURE__ */
|
|
13099
|
-
/* @__PURE__ */
|
|
13100
|
-
] }) : filteredOptions.length === 0 ? /* @__PURE__ */
|
|
13604
|
+
filteredOptions.length === 0 && isLoadingMore ? /* @__PURE__ */ jsxs100("div", { className: "flex items-center justify-center gap-2 px-4 py-[20px] text-[14px] font-medium text-[var(--chekin-color-gray-1)]", children: [
|
|
13605
|
+
/* @__PURE__ */ jsx155(ThreeDotsLoader, { height: 18, width: 18 }),
|
|
13606
|
+
/* @__PURE__ */ jsx155("span", { children: resolvedLoadingMoreText })
|
|
13607
|
+
] }) : filteredOptions.length === 0 ? /* @__PURE__ */ jsx155("div", { className: "px-4 py-[20px] text-left text-[16px] text-[var(--chekin-color-brand-navy)]", children: emptyMessage ?? t("no_options") }) : /* @__PURE__ */ jsx155(
|
|
13101
13608
|
InfiniteScrollList,
|
|
13102
13609
|
{
|
|
13103
13610
|
scrollRef,
|
|
@@ -13132,8 +13639,8 @@ var DashboardInfiniteScrollSelect = React51.forwardRef(
|
|
|
13132
13639
|
|
|
13133
13640
|
// src/dashboard/textarea/Textarea.tsx
|
|
13134
13641
|
import * as React52 from "react";
|
|
13135
|
-
import { useTranslation as
|
|
13136
|
-
import { jsx as
|
|
13642
|
+
import { useTranslation as useTranslation34 } from "react-i18next";
|
|
13643
|
+
import { jsx as jsx156, jsxs as jsxs101 } from "react/jsx-runtime";
|
|
13137
13644
|
var LINE_HEIGHT = 20;
|
|
13138
13645
|
var VERTICAL_PADDING = 32;
|
|
13139
13646
|
function getEmptyState(empty, value, defaultValue) {
|
|
@@ -13169,7 +13676,7 @@ var DashboardTextarea = React52.forwardRef(
|
|
|
13169
13676
|
const combinedRef = useCombinedRef(ref, innerRef);
|
|
13170
13677
|
const reactId = React52.useId();
|
|
13171
13678
|
const textareaId = id ?? name ?? `dash-textarea-${reactId}`;
|
|
13172
|
-
const { t } =
|
|
13679
|
+
const { t } = useTranslation34();
|
|
13173
13680
|
const isInvalid = Boolean(invalid || error);
|
|
13174
13681
|
const isEmpty = getEmptyState(empty, value, defaultValue);
|
|
13175
13682
|
const isBlocked = Boolean(disabled);
|
|
@@ -13190,7 +13697,7 @@ var DashboardTextarea = React52.forwardRef(
|
|
|
13190
13697
|
resize();
|
|
13191
13698
|
onInput?.(event);
|
|
13192
13699
|
};
|
|
13193
|
-
return /* @__PURE__ */
|
|
13700
|
+
return /* @__PURE__ */ jsxs101(
|
|
13194
13701
|
"div",
|
|
13195
13702
|
{
|
|
13196
13703
|
className: cn(
|
|
@@ -13200,18 +13707,18 @@ var DashboardTextarea = React52.forwardRef(
|
|
|
13200
13707
|
className
|
|
13201
13708
|
),
|
|
13202
13709
|
children: [
|
|
13203
|
-
label && /* @__PURE__ */
|
|
13710
|
+
label && /* @__PURE__ */ jsxs101(
|
|
13204
13711
|
"label",
|
|
13205
13712
|
{
|
|
13206
13713
|
htmlFor: textareaId,
|
|
13207
13714
|
className: "mb-2 flex select-none items-center text-[16px] font-medium text-[var(--chekin-color-brand-navy)]",
|
|
13208
13715
|
children: [
|
|
13209
13716
|
label,
|
|
13210
|
-
tooltip && /* @__PURE__ */
|
|
13717
|
+
tooltip && /* @__PURE__ */ jsx156("span", { className: "ml-1 inline-flex", children: /* @__PURE__ */ jsx156(HelpTooltip, { content: tooltip, size: 16 }) })
|
|
13211
13718
|
]
|
|
13212
13719
|
}
|
|
13213
13720
|
),
|
|
13214
|
-
/* @__PURE__ */
|
|
13721
|
+
/* @__PURE__ */ jsx156(
|
|
13215
13722
|
"textarea",
|
|
13216
13723
|
{
|
|
13217
13724
|
ref: combinedRef,
|
|
@@ -13240,7 +13747,7 @@ var DashboardTextarea = React52.forwardRef(
|
|
|
13240
13747
|
...textareaProps
|
|
13241
13748
|
}
|
|
13242
13749
|
),
|
|
13243
|
-
error && /* @__PURE__ */
|
|
13750
|
+
error && /* @__PURE__ */ jsx156(
|
|
13244
13751
|
FieldErrorMessage,
|
|
13245
13752
|
{
|
|
13246
13753
|
id: `${textareaId}-error`,
|
|
@@ -13248,8 +13755,8 @@ var DashboardTextarea = React52.forwardRef(
|
|
|
13248
13755
|
className: "mt-[1px] text-[14px]"
|
|
13249
13756
|
}
|
|
13250
13757
|
),
|
|
13251
|
-
!error && optional && /* @__PURE__ */
|
|
13252
|
-
!error && helperText && /* @__PURE__ */
|
|
13758
|
+
!error && optional && /* @__PURE__ */ jsx156("span", { className: "mt-[1px] block text-left text-[14px] font-medium text-[var(--chekin-color-gray-1)]", children: typeof optional === "string" ? optional : t("optional") }),
|
|
13759
|
+
!error && helperText && /* @__PURE__ */ jsx156("span", { className: "mt-[1px] block text-[12px] font-normal text-[var(--chekin-color-gray-1)]", children: helperText })
|
|
13253
13760
|
]
|
|
13254
13761
|
}
|
|
13255
13762
|
);
|
|
@@ -13259,7 +13766,7 @@ var DashboardTextarea = React52.forwardRef(
|
|
|
13259
13766
|
// src/dashboard/datepicker/Datepicker.tsx
|
|
13260
13767
|
import * as React54 from "react";
|
|
13261
13768
|
import { ChevronDown as ChevronDown3 } from "lucide-react";
|
|
13262
|
-
import { useTranslation as
|
|
13769
|
+
import { useTranslation as useTranslation35 } from "react-i18next";
|
|
13263
13770
|
|
|
13264
13771
|
// src/airbnb-fields/datepicker/useDatePickerWheel.ts
|
|
13265
13772
|
import * as React53 from "react";
|
|
@@ -13683,7 +14190,7 @@ function useDatePickerWheel({
|
|
|
13683
14190
|
}
|
|
13684
14191
|
|
|
13685
14192
|
// src/airbnb-fields/datepicker/DatePickerWheelColumn.tsx
|
|
13686
|
-
import { jsx as
|
|
14193
|
+
import { jsx as jsx157, jsxs as jsxs102 } from "react/jsx-runtime";
|
|
13687
14194
|
var spacerHeight = DATE_PICKER_OPTION_HEIGHT * DATE_PICKER_WHEEL_BUFFER_OPTIONS;
|
|
13688
14195
|
function AirbnbDatePickerWheelColumn({
|
|
13689
14196
|
id,
|
|
@@ -13697,7 +14204,7 @@ function AirbnbDatePickerWheelColumn({
|
|
|
13697
14204
|
onOptionSelect,
|
|
13698
14205
|
column
|
|
13699
14206
|
}) {
|
|
13700
|
-
return /* @__PURE__ */
|
|
14207
|
+
return /* @__PURE__ */ jsx157("div", { className: "relative z-10 min-w-0", children: /* @__PURE__ */ jsxs102(
|
|
13701
14208
|
"div",
|
|
13702
14209
|
{
|
|
13703
14210
|
id,
|
|
@@ -13714,14 +14221,14 @@ function AirbnbDatePickerWheelColumn({
|
|
|
13714
14221
|
WebkitOverflowScrolling: "touch"
|
|
13715
14222
|
},
|
|
13716
14223
|
children: [
|
|
13717
|
-
/* @__PURE__ */
|
|
14224
|
+
/* @__PURE__ */ jsx157("div", { style: { height: `${spacerHeight}px` } }),
|
|
13718
14225
|
items.map((item, index) => {
|
|
13719
14226
|
const { style } = getWheelOptionStyles(
|
|
13720
14227
|
index,
|
|
13721
14228
|
scrollTop,
|
|
13722
14229
|
DATE_PICKER_OPTION_HEIGHT
|
|
13723
14230
|
);
|
|
13724
|
-
return /* @__PURE__ */
|
|
14231
|
+
return /* @__PURE__ */ jsx157(
|
|
13725
14232
|
"button",
|
|
13726
14233
|
{
|
|
13727
14234
|
id: `${id}-option-${index}`,
|
|
@@ -13737,14 +14244,14 @@ function AirbnbDatePickerWheelColumn({
|
|
|
13737
14244
|
`${column}-${item}-${index}`
|
|
13738
14245
|
);
|
|
13739
14246
|
}),
|
|
13740
|
-
/* @__PURE__ */
|
|
14247
|
+
/* @__PURE__ */ jsx157("div", { style: { height: `${spacerHeight}px` } })
|
|
13741
14248
|
]
|
|
13742
14249
|
}
|
|
13743
14250
|
) });
|
|
13744
14251
|
}
|
|
13745
14252
|
|
|
13746
14253
|
// src/airbnb-fields/datepicker/DatePickerContent.tsx
|
|
13747
|
-
import { jsx as
|
|
14254
|
+
import { jsx as jsx158, jsxs as jsxs103 } from "react/jsx-runtime";
|
|
13748
14255
|
function AirbnbDatePickerBody({
|
|
13749
14256
|
baseId,
|
|
13750
14257
|
label,
|
|
@@ -13766,19 +14273,19 @@ function AirbnbDatePickerBody({
|
|
|
13766
14273
|
onOptionSelect,
|
|
13767
14274
|
onDone
|
|
13768
14275
|
}) {
|
|
13769
|
-
return /* @__PURE__ */
|
|
13770
|
-
/* @__PURE__ */
|
|
13771
|
-
/* @__PURE__ */
|
|
13772
|
-
/* @__PURE__ */
|
|
13773
|
-
/* @__PURE__ */
|
|
14276
|
+
return /* @__PURE__ */ jsxs103("div", { className: "px-6 pb-4 pt-1 bg-white", children: [
|
|
14277
|
+
/* @__PURE__ */ jsxs103("div", { className: "relative overflow-hidden rounded-[24px]", children: [
|
|
14278
|
+
/* @__PURE__ */ jsx158("div", { className: "pointer-events-none absolute inset-x-0 top-0 z-20 h-16 bg-gradient-to-b from-white via-white/80 to-transparent" }),
|
|
14279
|
+
/* @__PURE__ */ jsx158("div", { className: "pointer-events-none absolute inset-x-0 bottom-0 z-20 h-16 bg-gradient-to-t from-white via-white/80 to-transparent" }),
|
|
14280
|
+
/* @__PURE__ */ jsx158(
|
|
13774
14281
|
"div",
|
|
13775
14282
|
{
|
|
13776
14283
|
"aria-hidden": true,
|
|
13777
14284
|
className: "pointer-events-none absolute inset-x-0 top-1/2 z-0 h-8 -translate-y-1/2 rounded-[12px] bg-black/[0.04]"
|
|
13778
14285
|
}
|
|
13779
14286
|
),
|
|
13780
|
-
/* @__PURE__ */
|
|
13781
|
-
/* @__PURE__ */
|
|
14287
|
+
/* @__PURE__ */ jsxs103("div", { className: "relative grid grid-cols-[1.35fr_0.7fr_1fr] gap-1", children: [
|
|
14288
|
+
/* @__PURE__ */ jsx158(
|
|
13782
14289
|
AirbnbDatePickerWheelColumn,
|
|
13783
14290
|
{
|
|
13784
14291
|
id: `${baseId}-month`,
|
|
@@ -13793,7 +14300,7 @@ function AirbnbDatePickerBody({
|
|
|
13793
14300
|
onOptionSelect
|
|
13794
14301
|
}
|
|
13795
14302
|
),
|
|
13796
|
-
/* @__PURE__ */
|
|
14303
|
+
/* @__PURE__ */ jsx158(
|
|
13797
14304
|
AirbnbDatePickerWheelColumn,
|
|
13798
14305
|
{
|
|
13799
14306
|
id: `${baseId}-day`,
|
|
@@ -13808,7 +14315,7 @@ function AirbnbDatePickerBody({
|
|
|
13808
14315
|
onOptionSelect
|
|
13809
14316
|
}
|
|
13810
14317
|
),
|
|
13811
|
-
/* @__PURE__ */
|
|
14318
|
+
/* @__PURE__ */ jsx158(
|
|
13812
14319
|
AirbnbDatePickerWheelColumn,
|
|
13813
14320
|
{
|
|
13814
14321
|
id: `${baseId}-year`,
|
|
@@ -13825,13 +14332,13 @@ function AirbnbDatePickerBody({
|
|
|
13825
14332
|
)
|
|
13826
14333
|
] })
|
|
13827
14334
|
] }),
|
|
13828
|
-
/* @__PURE__ */
|
|
14335
|
+
/* @__PURE__ */ jsx158(Button, { type: "button", onClick: onDone, className: "mt-4 h-12 mb-8 w-full", children: doneLabel })
|
|
13829
14336
|
] });
|
|
13830
14337
|
}
|
|
13831
14338
|
function AirbnbDatePickerContent({
|
|
13832
14339
|
baseId,
|
|
13833
14340
|
open,
|
|
13834
|
-
isMobile:
|
|
14341
|
+
isMobile: isMobile3,
|
|
13835
14342
|
label,
|
|
13836
14343
|
title,
|
|
13837
14344
|
doneLabel,
|
|
@@ -13853,7 +14360,7 @@ function AirbnbDatePickerContent({
|
|
|
13853
14360
|
onColumnKeyDown,
|
|
13854
14361
|
onOptionSelect
|
|
13855
14362
|
}) {
|
|
13856
|
-
const body = /* @__PURE__ */
|
|
14363
|
+
const body = /* @__PURE__ */ jsx158(
|
|
13857
14364
|
AirbnbDatePickerBody,
|
|
13858
14365
|
{
|
|
13859
14366
|
baseId,
|
|
@@ -13877,28 +14384,28 @@ function AirbnbDatePickerContent({
|
|
|
13877
14384
|
onDone
|
|
13878
14385
|
}
|
|
13879
14386
|
);
|
|
13880
|
-
if (
|
|
13881
|
-
return /* @__PURE__ */
|
|
14387
|
+
if (isMobile3) {
|
|
14388
|
+
return /* @__PURE__ */ jsx158(Drawer, { open, onOpenChange, children: /* @__PURE__ */ jsxs103(
|
|
13882
14389
|
DrawerContent,
|
|
13883
14390
|
{
|
|
13884
14391
|
onClose: () => onOpenChange(false),
|
|
13885
14392
|
className: "rounded-none rounded-t-[32px] border-0 p-0",
|
|
13886
14393
|
children: [
|
|
13887
|
-
/* @__PURE__ */
|
|
13888
|
-
/* @__PURE__ */
|
|
14394
|
+
/* @__PURE__ */ jsx158(DrawerTitle, { className: "sr-only", children: title }),
|
|
14395
|
+
/* @__PURE__ */ jsx158(DrawerDescription, { className: "sr-only", children: label }),
|
|
13889
14396
|
body
|
|
13890
14397
|
]
|
|
13891
14398
|
}
|
|
13892
14399
|
) });
|
|
13893
14400
|
}
|
|
13894
|
-
return /* @__PURE__ */
|
|
14401
|
+
return /* @__PURE__ */ jsx158(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs103(
|
|
13895
14402
|
DialogContent,
|
|
13896
14403
|
{
|
|
13897
14404
|
className: "max-w-[520px] rounded-[28px] border-0 p-0 shadow-xl",
|
|
13898
14405
|
showCloseButton: false,
|
|
13899
14406
|
children: [
|
|
13900
|
-
/* @__PURE__ */
|
|
13901
|
-
/* @__PURE__ */
|
|
14407
|
+
/* @__PURE__ */ jsx158(DialogTitle, { className: "sr-only", children: title }),
|
|
14408
|
+
/* @__PURE__ */ jsx158(DialogDescription, { className: "sr-only", children: label }),
|
|
13902
14409
|
body
|
|
13903
14410
|
]
|
|
13904
14411
|
}
|
|
@@ -13906,7 +14413,7 @@ function AirbnbDatePickerContent({
|
|
|
13906
14413
|
}
|
|
13907
14414
|
|
|
13908
14415
|
// src/dashboard/datepicker/Datepicker.tsx
|
|
13909
|
-
import { jsx as
|
|
14416
|
+
import { jsx as jsx159, jsxs as jsxs104 } from "react/jsx-runtime";
|
|
13910
14417
|
var MONTHS_IN_YEAR2 = 12;
|
|
13911
14418
|
function getMonthLabels2(locale) {
|
|
13912
14419
|
const formatter = new Intl.DateTimeFormat(locale, { month: "long" });
|
|
@@ -13983,7 +14490,7 @@ var DashboardDatepicker = React54.forwardRef(
|
|
|
13983
14490
|
const yearId = `${baseId}-year`;
|
|
13984
14491
|
const labelId = `${baseId}-label`;
|
|
13985
14492
|
const errorId = `${baseId}-error`;
|
|
13986
|
-
const { t } =
|
|
14493
|
+
const { t } = useTranslation35();
|
|
13987
14494
|
const resolvedMonthLabels = React54.useMemo(
|
|
13988
14495
|
() => monthLabels ?? getMonthLabels2(locale),
|
|
13989
14496
|
[locale, monthLabels]
|
|
@@ -14006,7 +14513,7 @@ var DashboardDatepicker = React54.forwardRef(
|
|
|
14006
14513
|
const [focusedField, setFocusedField] = React54.useState(null);
|
|
14007
14514
|
const [monthInputValue, setMonthInputValue] = React54.useState("");
|
|
14008
14515
|
const [monthHighlightIndex, setMonthHighlightIndex] = React54.useState(-1);
|
|
14009
|
-
const
|
|
14516
|
+
const isMobile3 = useIsMobile();
|
|
14010
14517
|
React54.useImperativeHandle(ref, () => dayInputRef.current, []);
|
|
14011
14518
|
React54.useEffect(() => {
|
|
14012
14519
|
if (!isControlled) return;
|
|
@@ -14056,7 +14563,7 @@ var DashboardDatepicker = React54.forwardRef(
|
|
|
14056
14563
|
useOutsideClick({
|
|
14057
14564
|
elementRef: containerRef,
|
|
14058
14565
|
onOutsideClick: () => setIsMonthOpen(false),
|
|
14059
|
-
isDisabled: !isMonthOpen ||
|
|
14566
|
+
isDisabled: !isMonthOpen || isMobile3
|
|
14060
14567
|
});
|
|
14061
14568
|
const emitChange = React54.useCallback(
|
|
14062
14569
|
(nextDay, nextMonth, nextYear) => {
|
|
@@ -14165,7 +14672,7 @@ var DashboardDatepicker = React54.forwardRef(
|
|
|
14165
14672
|
setIsWheelOpen(false);
|
|
14166
14673
|
mobileTriggerRef.current?.focus();
|
|
14167
14674
|
}, []);
|
|
14168
|
-
const showCoverage = isEmpty && !isFocused && !
|
|
14675
|
+
const showCoverage = isEmpty && !isFocused && !isMobile3;
|
|
14169
14676
|
const wheel = useDatePickerWheel({
|
|
14170
14677
|
isOpen: isWheelOpen,
|
|
14171
14678
|
value: currentDate,
|
|
@@ -14189,7 +14696,7 @@ var DashboardDatepicker = React54.forwardRef(
|
|
|
14189
14696
|
const triggerText = currentDate ? (formatValue ?? defaultFormatValue)(currentDate) : void 0;
|
|
14190
14697
|
const monthListboxId = `${monthId}-listbox`;
|
|
14191
14698
|
const getMonthOptionId = (index) => `${monthId}-option-${index}`;
|
|
14192
|
-
const monthPanelContent = filteredMonths.length === 0 ? /* @__PURE__ */
|
|
14699
|
+
const monthPanelContent = filteredMonths.length === 0 ? /* @__PURE__ */ jsx159("div", { className: "px-4 py-3 text-left text-[14px] font-medium text-[var(--chekin-color-gray-1)]", children: t("no_options") }) : /* @__PURE__ */ jsx159(
|
|
14193
14700
|
"ul",
|
|
14194
14701
|
{
|
|
14195
14702
|
ref: monthListRef,
|
|
@@ -14200,7 +14707,7 @@ var DashboardDatepicker = React54.forwardRef(
|
|
|
14200
14707
|
children: filteredMonths.map((option, position) => {
|
|
14201
14708
|
const isSelected = option.index === monthIndex;
|
|
14202
14709
|
const isHighlighted = position === monthHighlightIndex;
|
|
14203
|
-
return /* @__PURE__ */
|
|
14710
|
+
return /* @__PURE__ */ jsx159("li", { role: "presentation", children: /* @__PURE__ */ jsx159(
|
|
14204
14711
|
"button",
|
|
14205
14712
|
{
|
|
14206
14713
|
id: getMonthOptionId(option.index),
|
|
@@ -14227,7 +14734,7 @@ var DashboardDatepicker = React54.forwardRef(
|
|
|
14227
14734
|
isBlocked && "cursor-not-allowed",
|
|
14228
14735
|
loading && "cursor-progress"
|
|
14229
14736
|
);
|
|
14230
|
-
return /* @__PURE__ */
|
|
14737
|
+
return /* @__PURE__ */ jsx159(
|
|
14231
14738
|
"div",
|
|
14232
14739
|
{
|
|
14233
14740
|
ref: containerRef,
|
|
@@ -14238,9 +14745,9 @@ var DashboardDatepicker = React54.forwardRef(
|
|
|
14238
14745
|
className
|
|
14239
14746
|
),
|
|
14240
14747
|
style: wrapperWidth ? { width: wrapperWidth } : void 0,
|
|
14241
|
-
children: /* @__PURE__ */
|
|
14242
|
-
/* @__PURE__ */
|
|
14243
|
-
|
|
14748
|
+
children: /* @__PURE__ */ jsxs104("div", { className: "relative min-h-[68px] w-full", children: [
|
|
14749
|
+
/* @__PURE__ */ jsxs104("div", { className: "relative w-full", children: [
|
|
14750
|
+
isMobile3 ? /* @__PURE__ */ jsxs104(
|
|
14244
14751
|
"button",
|
|
14245
14752
|
{
|
|
14246
14753
|
ref: mobileTriggerRef,
|
|
@@ -14259,10 +14766,10 @@ var DashboardDatepicker = React54.forwardRef(
|
|
|
14259
14766
|
(isBlocked || readOnly) && "cursor-not-allowed"
|
|
14260
14767
|
),
|
|
14261
14768
|
children: [
|
|
14262
|
-
/* @__PURE__ */
|
|
14263
|
-
/* @__PURE__ */
|
|
14264
|
-
loading && /* @__PURE__ */
|
|
14265
|
-
/* @__PURE__ */
|
|
14769
|
+
/* @__PURE__ */ jsx159("span", { className: "block min-w-0 flex-1 truncate text-left", children: triggerText ?? (isWheelOpen ? mobilePlaceholder : null) }),
|
|
14770
|
+
/* @__PURE__ */ jsxs104("span", { className: "pointer-events-none flex items-center gap-2 text-[var(--chekin-color-gray-2)]", children: [
|
|
14771
|
+
loading && /* @__PURE__ */ jsx159(ThreeDotsLoader, { height: 18, width: 18 }),
|
|
14772
|
+
/* @__PURE__ */ jsx159(
|
|
14266
14773
|
ChevronDown3,
|
|
14267
14774
|
{
|
|
14268
14775
|
size: 16,
|
|
@@ -14275,14 +14782,14 @@ var DashboardDatepicker = React54.forwardRef(
|
|
|
14275
14782
|
] })
|
|
14276
14783
|
]
|
|
14277
14784
|
}
|
|
14278
|
-
) : /* @__PURE__ */
|
|
14785
|
+
) : /* @__PURE__ */ jsxs104(
|
|
14279
14786
|
"div",
|
|
14280
14787
|
{
|
|
14281
14788
|
className: cn(
|
|
14282
14789
|
"relative box-border grid h-12 w-full grid-cols-[minmax(0,1fr)_minmax(96px,140px)_minmax(0,1fr)] items-center rounded-[6px] text-[16px] font-medium text-[var(--chekin-color-brand-navy)]"
|
|
14283
14790
|
),
|
|
14284
14791
|
children: [
|
|
14285
|
-
/* @__PURE__ */
|
|
14792
|
+
/* @__PURE__ */ jsx159("div", { className: "flex h-full min-w-0 items-center px-2 sm:px-4", children: /* @__PURE__ */ jsx159(
|
|
14286
14793
|
"input",
|
|
14287
14794
|
{
|
|
14288
14795
|
ref: dayInputRef,
|
|
@@ -14304,8 +14811,8 @@ var DashboardDatepicker = React54.forwardRef(
|
|
|
14304
14811
|
className: subInputClass
|
|
14305
14812
|
}
|
|
14306
14813
|
) }),
|
|
14307
|
-
/* @__PURE__ */
|
|
14308
|
-
/* @__PURE__ */
|
|
14814
|
+
/* @__PURE__ */ jsxs104("div", { className: "relative flex h-full min-w-0 items-center gap-1 border-x border-[var(--chekin-color-gray-3)] px-2 sm:px-3", children: [
|
|
14815
|
+
/* @__PURE__ */ jsx159(
|
|
14309
14816
|
"input",
|
|
14310
14817
|
{
|
|
14311
14818
|
ref: monthInputRef,
|
|
@@ -14348,7 +14855,7 @@ var DashboardDatepicker = React54.forwardRef(
|
|
|
14348
14855
|
)
|
|
14349
14856
|
}
|
|
14350
14857
|
),
|
|
14351
|
-
/* @__PURE__ */
|
|
14858
|
+
/* @__PURE__ */ jsx159(
|
|
14352
14859
|
ChevronDown3,
|
|
14353
14860
|
{
|
|
14354
14861
|
size: 14,
|
|
@@ -14365,8 +14872,8 @@ var DashboardDatepicker = React54.forwardRef(
|
|
|
14365
14872
|
}
|
|
14366
14873
|
)
|
|
14367
14874
|
] }),
|
|
14368
|
-
/* @__PURE__ */
|
|
14369
|
-
/* @__PURE__ */
|
|
14875
|
+
/* @__PURE__ */ jsxs104("div", { className: "flex h-full min-w-0 items-center px-2 sm:px-4", children: [
|
|
14876
|
+
/* @__PURE__ */ jsx159(
|
|
14370
14877
|
"input",
|
|
14371
14878
|
{
|
|
14372
14879
|
ref: yearInputRef,
|
|
@@ -14388,7 +14895,7 @@ var DashboardDatepicker = React54.forwardRef(
|
|
|
14388
14895
|
className: subInputClass
|
|
14389
14896
|
}
|
|
14390
14897
|
),
|
|
14391
|
-
loading && /* @__PURE__ */
|
|
14898
|
+
loading && /* @__PURE__ */ jsx159(
|
|
14392
14899
|
ThreeDotsLoader,
|
|
14393
14900
|
{
|
|
14394
14901
|
height: 18,
|
|
@@ -14400,7 +14907,7 @@ var DashboardDatepicker = React54.forwardRef(
|
|
|
14400
14907
|
]
|
|
14401
14908
|
}
|
|
14402
14909
|
),
|
|
14403
|
-
showCoverage && /* @__PURE__ */
|
|
14910
|
+
showCoverage && /* @__PURE__ */ jsx159(
|
|
14404
14911
|
"div",
|
|
14405
14912
|
{
|
|
14406
14913
|
className: "absolute inset-0 cursor-text rounded-[6px] bg-[var(--chekin-color-surface-input-empty)]",
|
|
@@ -14408,7 +14915,7 @@ var DashboardDatepicker = React54.forwardRef(
|
|
|
14408
14915
|
"aria-hidden": "true"
|
|
14409
14916
|
}
|
|
14410
14917
|
),
|
|
14411
|
-
/* @__PURE__ */
|
|
14918
|
+
/* @__PURE__ */ jsx159(
|
|
14412
14919
|
Fieldset,
|
|
14413
14920
|
{
|
|
14414
14921
|
isFocused,
|
|
@@ -14423,12 +14930,12 @@ var DashboardDatepicker = React54.forwardRef(
|
|
|
14423
14930
|
legend: label,
|
|
14424
14931
|
label,
|
|
14425
14932
|
tooltip,
|
|
14426
|
-
onClick:
|
|
14933
|
+
onClick: isMobile3 ? openWheel : showCoverage ? focusDayInput : void 0
|
|
14427
14934
|
}
|
|
14428
14935
|
),
|
|
14429
|
-
isMonthOpen && !
|
|
14936
|
+
isMonthOpen && !isMobile3 && /* @__PURE__ */ jsx159("div", { className: "absolute left-0 right-0 top-full z-30 mx-auto mt-1 w-full max-w-[260px] overflow-hidden rounded-md bg-white shadow-[0_30px_30px_0_rgba(33,72,255,0.2)] sm:left-1/2 sm:right-auto sm:-translate-x-1/2", children: monthPanelContent })
|
|
14430
14937
|
] }),
|
|
14431
|
-
|
|
14938
|
+
isMobile3 && /* @__PURE__ */ jsx159(
|
|
14432
14939
|
AirbnbDatePickerContent,
|
|
14433
14940
|
{
|
|
14434
14941
|
baseId: wheelBaseId,
|
|
@@ -14456,9 +14963,9 @@ var DashboardDatepicker = React54.forwardRef(
|
|
|
14456
14963
|
onOptionSelect: wheel.handleOptionSelect
|
|
14457
14964
|
}
|
|
14458
14965
|
),
|
|
14459
|
-
!error && optional && /* @__PURE__ */
|
|
14460
|
-
!error && helperText && /* @__PURE__ */
|
|
14461
|
-
error && !hideErrorMessage && /* @__PURE__ */
|
|
14966
|
+
!error && optional && /* @__PURE__ */ jsx159("span", { className: "mt-[1px] block text-left text-[14px] font-medium text-[var(--chekin-color-gray-1)]", children: typeof optional === "string" ? optional : t("optional") }),
|
|
14967
|
+
!error && helperText && /* @__PURE__ */ jsx159("span", { className: "mt-[1px] block text-[12px] font-normal text-[var(--chekin-color-gray-1)]", children: helperText }),
|
|
14968
|
+
error && !hideErrorMessage && /* @__PURE__ */ jsx159(
|
|
14462
14969
|
FieldErrorMessage,
|
|
14463
14970
|
{
|
|
14464
14971
|
id: errorId,
|
|
@@ -14474,7 +14981,7 @@ var DashboardDatepicker = React54.forwardRef(
|
|
|
14474
14981
|
|
|
14475
14982
|
// src/dashboard/date-range-picker/DateRangePicker.tsx
|
|
14476
14983
|
import * as React58 from "react";
|
|
14477
|
-
import { useTranslation as
|
|
14984
|
+
import { useTranslation as useTranslation36 } from "react-i18next";
|
|
14478
14985
|
|
|
14479
14986
|
// src/dashboard/date-range-picker/isDayBlocked.ts
|
|
14480
14987
|
import { differenceInDays, isAfter, isBefore, isSameDay } from "date-fns";
|
|
@@ -14685,7 +15192,7 @@ function resolveRangeSelection({
|
|
|
14685
15192
|
|
|
14686
15193
|
// src/dashboard/date-range-picker/components/DateRangeInputs.tsx
|
|
14687
15194
|
import { CalendarDays, SquareX as SquareX4 } from "lucide-react";
|
|
14688
|
-
import { jsx as
|
|
15195
|
+
import { jsx as jsx160, jsxs as jsxs105 } from "react/jsx-runtime";
|
|
14689
15196
|
var DEFAULT_PLACEHOLDER = "00-00-0000";
|
|
14690
15197
|
var inputBaseClass = "m-0 box-border h-full w-full min-w-0 border-0 bg-transparent text-[16px] font-medium leading-5 text-[var(--chekin-color-brand-navy)] outline-none placeholder:text-[var(--chekin-color-gray-1)]";
|
|
14691
15198
|
var iconButtonClass = "flex h-5 w-5 items-center justify-center rounded-[3px] border-0 bg-transparent p-0 text-[#9696b9] outline-none hover:shadow-[0_3px_3px_#0f477734] disabled:cursor-not-allowed";
|
|
@@ -14727,7 +15234,7 @@ function DateRangeInputs({
|
|
|
14727
15234
|
isBlocked && "cursor-not-allowed",
|
|
14728
15235
|
loading && "cursor-progress"
|
|
14729
15236
|
);
|
|
14730
|
-
return /* @__PURE__ */
|
|
15237
|
+
return /* @__PURE__ */ jsxs105(
|
|
14731
15238
|
"div",
|
|
14732
15239
|
{
|
|
14733
15240
|
className: cn(
|
|
@@ -14736,7 +15243,7 @@ function DateRangeInputs({
|
|
|
14736
15243
|
),
|
|
14737
15244
|
onClick: onRowClick,
|
|
14738
15245
|
children: [
|
|
14739
|
-
/* @__PURE__ */
|
|
15246
|
+
/* @__PURE__ */ jsx160(
|
|
14740
15247
|
"input",
|
|
14741
15248
|
{
|
|
14742
15249
|
ref: fromInputRef,
|
|
@@ -14760,7 +15267,7 @@ function DateRangeInputs({
|
|
|
14760
15267
|
)
|
|
14761
15268
|
}
|
|
14762
15269
|
),
|
|
14763
|
-
/* @__PURE__ */
|
|
15270
|
+
/* @__PURE__ */ jsx160(
|
|
14764
15271
|
"span",
|
|
14765
15272
|
{
|
|
14766
15273
|
"aria-hidden": "true",
|
|
@@ -14771,7 +15278,7 @@ function DateRangeInputs({
|
|
|
14771
15278
|
children: "\u2192"
|
|
14772
15279
|
}
|
|
14773
15280
|
),
|
|
14774
|
-
/* @__PURE__ */
|
|
15281
|
+
/* @__PURE__ */ jsx160(
|
|
14775
15282
|
"input",
|
|
14776
15283
|
{
|
|
14777
15284
|
ref: toInputRef,
|
|
@@ -14795,9 +15302,9 @@ function DateRangeInputs({
|
|
|
14795
15302
|
)
|
|
14796
15303
|
}
|
|
14797
15304
|
),
|
|
14798
|
-
/* @__PURE__ */
|
|
14799
|
-
loading && /* @__PURE__ */
|
|
14800
|
-
!readOnly && !hideClearDates && !isEmpty && /* @__PURE__ */
|
|
15305
|
+
/* @__PURE__ */ jsxs105("span", { className: "ml-auto flex shrink-0 items-center gap-2 pl-2 text-[var(--chekin-color-gray-2)]", children: [
|
|
15306
|
+
loading && /* @__PURE__ */ jsx160(ThreeDotsLoader, { height: 18, width: 18 }),
|
|
15307
|
+
!readOnly && !hideClearDates && !isEmpty && /* @__PURE__ */ jsx160(
|
|
14801
15308
|
"button",
|
|
14802
15309
|
{
|
|
14803
15310
|
type: "button",
|
|
@@ -14805,10 +15312,10 @@ function DateRangeInputs({
|
|
|
14805
15312
|
onClick: onReset,
|
|
14806
15313
|
className: iconButtonClass,
|
|
14807
15314
|
"aria-label": clearLabel,
|
|
14808
|
-
children: /* @__PURE__ */
|
|
15315
|
+
children: /* @__PURE__ */ jsx160(SquareX4, { size: 16, fill: "#9696b9", color: "#f8f8f8", strokeWidth: 1.8 })
|
|
14809
15316
|
}
|
|
14810
15317
|
),
|
|
14811
|
-
!readOnly && !hideCalendarIcon && /* @__PURE__ */
|
|
15318
|
+
!readOnly && !hideCalendarIcon && /* @__PURE__ */ jsx160(
|
|
14812
15319
|
"button",
|
|
14813
15320
|
{
|
|
14814
15321
|
type: "button",
|
|
@@ -14820,7 +15327,7 @@ function DateRangeInputs({
|
|
|
14820
15327
|
focusedInput !== null || isOpen ? "text-[var(--chekin-color-brand-blue)]" : "text-[var(--chekin-color-gray-2)]"
|
|
14821
15328
|
),
|
|
14822
15329
|
"aria-label": openCalendarLabel,
|
|
14823
|
-
children: /* @__PURE__ */
|
|
15330
|
+
children: /* @__PURE__ */ jsx160(CalendarDays, { size: 18 })
|
|
14824
15331
|
}
|
|
14825
15332
|
)
|
|
14826
15333
|
] })
|
|
@@ -14830,7 +15337,7 @@ function DateRangeInputs({
|
|
|
14830
15337
|
}
|
|
14831
15338
|
|
|
14832
15339
|
// src/dashboard/date-range-picker/components/DateRangeCalendar.tsx
|
|
14833
|
-
import { jsx as
|
|
15340
|
+
import { jsx as jsx161 } from "react/jsx-runtime";
|
|
14834
15341
|
function DateRangeCalendar({
|
|
14835
15342
|
value,
|
|
14836
15343
|
month,
|
|
@@ -14846,7 +15353,7 @@ function DateRangeCalendar({
|
|
|
14846
15353
|
components,
|
|
14847
15354
|
...dayPickerProps
|
|
14848
15355
|
}) {
|
|
14849
|
-
return /* @__PURE__ */
|
|
15356
|
+
return /* @__PURE__ */ jsx161(
|
|
14850
15357
|
Calendar,
|
|
14851
15358
|
{
|
|
14852
15359
|
mode: "range",
|
|
@@ -14869,10 +15376,10 @@ function DateRangeCalendar({
|
|
|
14869
15376
|
}
|
|
14870
15377
|
|
|
14871
15378
|
// src/dashboard/date-range-picker/components/DateRangePopover.tsx
|
|
14872
|
-
import { jsx as
|
|
15379
|
+
import { jsx as jsx162, jsxs as jsxs106 } from "react/jsx-runtime";
|
|
14873
15380
|
function DateRangePopover({
|
|
14874
15381
|
isOpen,
|
|
14875
|
-
isMobile:
|
|
15382
|
+
isMobile: isMobile3,
|
|
14876
15383
|
openDirection,
|
|
14877
15384
|
drawerTitle,
|
|
14878
15385
|
drawerDescription,
|
|
@@ -14880,31 +15387,31 @@ function DateRangePopover({
|
|
|
14880
15387
|
children
|
|
14881
15388
|
}) {
|
|
14882
15389
|
if (!isOpen) return null;
|
|
14883
|
-
if (
|
|
14884
|
-
return /* @__PURE__ */
|
|
15390
|
+
if (isMobile3) {
|
|
15391
|
+
return /* @__PURE__ */ jsx162(
|
|
14885
15392
|
Drawer,
|
|
14886
15393
|
{
|
|
14887
15394
|
open: isOpen,
|
|
14888
15395
|
onOpenChange: (next) => {
|
|
14889
15396
|
if (!next) onClose();
|
|
14890
15397
|
},
|
|
14891
|
-
children: /* @__PURE__ */
|
|
15398
|
+
children: /* @__PURE__ */ jsxs106(
|
|
14892
15399
|
DrawerContent,
|
|
14893
15400
|
{
|
|
14894
15401
|
onClose,
|
|
14895
15402
|
lockScroll: false,
|
|
14896
15403
|
className: "max-h-[calc(100vh-1rem)]",
|
|
14897
15404
|
children: [
|
|
14898
|
-
/* @__PURE__ */
|
|
14899
|
-
/* @__PURE__ */
|
|
14900
|
-
/* @__PURE__ */
|
|
15405
|
+
/* @__PURE__ */ jsx162(DrawerTitle, { className: "sr-only", children: drawerTitle }),
|
|
15406
|
+
/* @__PURE__ */ jsx162(DrawerDescription, { className: "sr-only", children: drawerDescription }),
|
|
15407
|
+
/* @__PURE__ */ jsx162("div", { className: "flex items-start justify-center overflow-x-auto px-2 pb-4 pt-1", children })
|
|
14901
15408
|
]
|
|
14902
15409
|
}
|
|
14903
15410
|
)
|
|
14904
15411
|
}
|
|
14905
15412
|
);
|
|
14906
15413
|
}
|
|
14907
|
-
return /* @__PURE__ */
|
|
15414
|
+
return /* @__PURE__ */ jsx162(
|
|
14908
15415
|
"div",
|
|
14909
15416
|
{
|
|
14910
15417
|
className: cn(
|
|
@@ -14917,7 +15424,7 @@ function DateRangePopover({
|
|
|
14917
15424
|
}
|
|
14918
15425
|
|
|
14919
15426
|
// src/dashboard/date-range-picker/DateRangePicker.tsx
|
|
14920
|
-
import { jsx as
|
|
15427
|
+
import { jsx as jsx163, jsxs as jsxs107 } from "react/jsx-runtime";
|
|
14921
15428
|
var DashboardDateRangePicker = React58.forwardRef(function DashboardDateRangePicker2({
|
|
14922
15429
|
label,
|
|
14923
15430
|
value: externalValue,
|
|
@@ -14990,8 +15497,8 @@ var DashboardDateRangePicker = React58.forwardRef(function DashboardDateRangePic
|
|
|
14990
15497
|
const [isOpen, setIsOpen] = React58.useState(false);
|
|
14991
15498
|
const [focusedInput, setFocusedInput] = React58.useState(null);
|
|
14992
15499
|
const [autoFocus, setAutoFocus] = React58.useState(false);
|
|
14993
|
-
const
|
|
14994
|
-
const { t } =
|
|
15500
|
+
const isMobile3 = useIsMobile();
|
|
15501
|
+
const { t } = useTranslation36();
|
|
14995
15502
|
const drawerTitle = label ?? t("select_dates");
|
|
14996
15503
|
const drawerDescription = label ?? t("pick_date_range");
|
|
14997
15504
|
const isEmpty = !value?.from && !value?.to;
|
|
@@ -14999,7 +15506,7 @@ var DashboardDateRangePicker = React58.forwardRef(function DashboardDateRangePic
|
|
|
14999
15506
|
const isInvalid = Boolean(invalid || error);
|
|
15000
15507
|
const isFocused = focusedInput !== null || isOpen;
|
|
15001
15508
|
const wrapperWidth = toCssSize(width);
|
|
15002
|
-
const monthsToShow = numberOfMonths ?? (
|
|
15509
|
+
const monthsToShow = numberOfMonths ?? (isMobile3 ? 1 : 2);
|
|
15003
15510
|
const closeCalendar = React58.useCallback(() => {
|
|
15004
15511
|
setIsOpen(false);
|
|
15005
15512
|
setFocusedInput(null);
|
|
@@ -15013,7 +15520,7 @@ var DashboardDateRangePicker = React58.forwardRef(function DashboardDateRangePic
|
|
|
15013
15520
|
useOutsideClick({
|
|
15014
15521
|
elementRef: containerRef,
|
|
15015
15522
|
onOutsideClick: closeCalendar,
|
|
15016
|
-
isDisabled: !isOpen ||
|
|
15523
|
+
isDisabled: !isOpen || isMobile3
|
|
15017
15524
|
});
|
|
15018
15525
|
const handlePickerChange = React58.useCallback(
|
|
15019
15526
|
(range, pickedDate) => {
|
|
@@ -15078,7 +15585,7 @@ var DashboardDateRangePicker = React58.forwardRef(function DashboardDateRangePic
|
|
|
15078
15585
|
syncMonthToValue
|
|
15079
15586
|
]
|
|
15080
15587
|
);
|
|
15081
|
-
return /* @__PURE__ */
|
|
15588
|
+
return /* @__PURE__ */ jsx163(
|
|
15082
15589
|
"div",
|
|
15083
15590
|
{
|
|
15084
15591
|
ref: containerRef,
|
|
@@ -15089,9 +15596,9 @@ var DashboardDateRangePicker = React58.forwardRef(function DashboardDateRangePic
|
|
|
15089
15596
|
className
|
|
15090
15597
|
),
|
|
15091
15598
|
style: wrapperWidth ? { width: wrapperWidth } : void 0,
|
|
15092
|
-
children: /* @__PURE__ */
|
|
15093
|
-
/* @__PURE__ */
|
|
15094
|
-
/* @__PURE__ */
|
|
15599
|
+
children: /* @__PURE__ */ jsxs107("div", { className: "relative min-h-[68px] w-full", children: [
|
|
15600
|
+
/* @__PURE__ */ jsxs107("div", { className: "relative w-full", children: [
|
|
15601
|
+
/* @__PURE__ */ jsx163(
|
|
15095
15602
|
DateRangeInputs,
|
|
15096
15603
|
{
|
|
15097
15604
|
fromId,
|
|
@@ -15142,7 +15649,7 @@ var DashboardDateRangePicker = React58.forwardRef(function DashboardDateRangePic
|
|
|
15142
15649
|
onToggleCalendar: toggleCalendar
|
|
15143
15650
|
}
|
|
15144
15651
|
),
|
|
15145
|
-
/* @__PURE__ */
|
|
15652
|
+
/* @__PURE__ */ jsx163(
|
|
15146
15653
|
Fieldset,
|
|
15147
15654
|
{
|
|
15148
15655
|
isFocused,
|
|
@@ -15159,16 +15666,16 @@ var DashboardDateRangePicker = React58.forwardRef(function DashboardDateRangePic
|
|
|
15159
15666
|
tooltip
|
|
15160
15667
|
}
|
|
15161
15668
|
),
|
|
15162
|
-
/* @__PURE__ */
|
|
15669
|
+
/* @__PURE__ */ jsx163(
|
|
15163
15670
|
DateRangePopover,
|
|
15164
15671
|
{
|
|
15165
|
-
isOpen: isOpen && !
|
|
15672
|
+
isOpen: isOpen && !isMobile3,
|
|
15166
15673
|
isMobile: false,
|
|
15167
15674
|
openDirection,
|
|
15168
15675
|
drawerTitle,
|
|
15169
15676
|
drawerDescription,
|
|
15170
15677
|
onClose: closeCalendar,
|
|
15171
|
-
children: /* @__PURE__ */
|
|
15678
|
+
children: /* @__PURE__ */ jsx163(
|
|
15172
15679
|
DateRangeCalendar,
|
|
15173
15680
|
{
|
|
15174
15681
|
value,
|
|
@@ -15189,16 +15696,16 @@ var DashboardDateRangePicker = React58.forwardRef(function DashboardDateRangePic
|
|
|
15189
15696
|
}
|
|
15190
15697
|
)
|
|
15191
15698
|
] }),
|
|
15192
|
-
/* @__PURE__ */
|
|
15699
|
+
/* @__PURE__ */ jsx163(
|
|
15193
15700
|
DateRangePopover,
|
|
15194
15701
|
{
|
|
15195
|
-
isOpen: isOpen &&
|
|
15702
|
+
isOpen: isOpen && isMobile3,
|
|
15196
15703
|
isMobile: true,
|
|
15197
15704
|
openDirection,
|
|
15198
15705
|
drawerTitle,
|
|
15199
15706
|
drawerDescription,
|
|
15200
15707
|
onClose: closeCalendar,
|
|
15201
|
-
children: /* @__PURE__ */
|
|
15708
|
+
children: /* @__PURE__ */ jsx163(
|
|
15202
15709
|
DateRangeCalendar,
|
|
15203
15710
|
{
|
|
15204
15711
|
value,
|
|
@@ -15218,9 +15725,9 @@ var DashboardDateRangePicker = React58.forwardRef(function DashboardDateRangePic
|
|
|
15218
15725
|
)
|
|
15219
15726
|
}
|
|
15220
15727
|
),
|
|
15221
|
-
!error && optional && /* @__PURE__ */
|
|
15222
|
-
!error && helperText && /* @__PURE__ */
|
|
15223
|
-
error && !hideErrorMessage && /* @__PURE__ */
|
|
15728
|
+
!error && optional && /* @__PURE__ */ jsx163("span", { className: "mt-[1px] block text-left text-[14px] font-medium text-[var(--chekin-color-gray-1)]", children: typeof optional === "string" ? optional : t("optional") }),
|
|
15729
|
+
!error && helperText && /* @__PURE__ */ jsx163("span", { className: "mt-[1px] block text-[12px] font-normal text-[var(--chekin-color-gray-1)]", children: helperText }),
|
|
15730
|
+
error && !hideErrorMessage && /* @__PURE__ */ jsx163(
|
|
15224
15731
|
FieldErrorMessage,
|
|
15225
15732
|
{
|
|
15226
15733
|
id: errorId,
|
|
@@ -15235,7 +15742,7 @@ var DashboardDateRangePicker = React58.forwardRef(function DashboardDateRangePic
|
|
|
15235
15742
|
|
|
15236
15743
|
// src/dashboard/date-range-picker/useValidateDates.ts
|
|
15237
15744
|
import * as React59 from "react";
|
|
15238
|
-
import { useTranslation as
|
|
15745
|
+
import { useTranslation as useTranslation37 } from "react-i18next";
|
|
15239
15746
|
import { differenceInDays as differenceInDays2, isAfter as isAfter2, isBefore as isBefore3 } from "date-fns";
|
|
15240
15747
|
import {
|
|
15241
15748
|
dateMatchModifiers,
|
|
@@ -15257,7 +15764,7 @@ function useValidateDates({
|
|
|
15257
15764
|
onSuccess,
|
|
15258
15765
|
displayFormat
|
|
15259
15766
|
}) {
|
|
15260
|
-
const { t } =
|
|
15767
|
+
const { t } = useTranslation37();
|
|
15261
15768
|
const handleError = useEvent(onError);
|
|
15262
15769
|
const handleSuccess = useEvent(onSuccess);
|
|
15263
15770
|
const errorFormatter = React59.useMemo(
|
|
@@ -15316,7 +15823,7 @@ function useValidateDates({
|
|
|
15316
15823
|
// src/dashboard/time-picker/TimePicker.tsx
|
|
15317
15824
|
import * as React60 from "react";
|
|
15318
15825
|
import { addDays, addHours, addMinutes, format, parse as parse2 } from "date-fns";
|
|
15319
|
-
import { jsx as
|
|
15826
|
+
import { jsx as jsx164 } from "react/jsx-runtime";
|
|
15320
15827
|
var SHORT_TIME_FORMAT = "HH:mm";
|
|
15321
15828
|
function parseTime(value) {
|
|
15322
15829
|
return parse2(value, SHORT_TIME_FORMAT, /* @__PURE__ */ new Date());
|
|
@@ -15365,15 +15872,15 @@ var DashboardTimePicker = React60.forwardRef(
|
|
|
15365
15872
|
const settings = timeSettings ?? FORMAT_SETTINGS[formatName];
|
|
15366
15873
|
return buildOptions(settings);
|
|
15367
15874
|
}, [formatName, options, timeSettings]);
|
|
15368
|
-
return /* @__PURE__ */
|
|
15875
|
+
return /* @__PURE__ */ jsx164(DashboardSelect, { ref, ...selectProps, options: resolvedOptions });
|
|
15369
15876
|
}
|
|
15370
15877
|
);
|
|
15371
15878
|
|
|
15372
15879
|
// src/dashboard/file-input/FileInput.tsx
|
|
15373
15880
|
import * as React61 from "react";
|
|
15374
15881
|
import { Download, Paperclip, SquareX as SquareX5 } from "lucide-react";
|
|
15375
|
-
import { useTranslation as
|
|
15376
|
-
import { jsx as
|
|
15882
|
+
import { useTranslation as useTranslation38 } from "react-i18next";
|
|
15883
|
+
import { jsx as jsx165, jsxs as jsxs108 } from "react/jsx-runtime";
|
|
15377
15884
|
function defaultDownload(url) {
|
|
15378
15885
|
window.open(url, "_blank", "noopener,noreferrer");
|
|
15379
15886
|
}
|
|
@@ -15402,7 +15909,7 @@ var DashboardFileInput = React61.forwardRef(
|
|
|
15402
15909
|
}, ref) {
|
|
15403
15910
|
const internalRef = React61.useRef(null);
|
|
15404
15911
|
const inputRef = useCombinedRef(ref, internalRef);
|
|
15405
|
-
const { t } =
|
|
15912
|
+
const { t } = useTranslation38();
|
|
15406
15913
|
const resolvedLabel = label ?? t("upload_file");
|
|
15407
15914
|
const resolvedDownloadLabel = downloadLabel ?? t("download_attachment");
|
|
15408
15915
|
const reactId = React61.useId();
|
|
@@ -15431,7 +15938,7 @@ var DashboardFileInput = React61.forwardRef(
|
|
|
15431
15938
|
event.stopPropagation();
|
|
15432
15939
|
if (isUrl) onDownload(value);
|
|
15433
15940
|
};
|
|
15434
|
-
return /* @__PURE__ */
|
|
15941
|
+
return /* @__PURE__ */ jsxs108(
|
|
15435
15942
|
"label",
|
|
15436
15943
|
{
|
|
15437
15944
|
htmlFor: inputId,
|
|
@@ -15444,7 +15951,7 @@ var DashboardFileInput = React61.forwardRef(
|
|
|
15444
15951
|
),
|
|
15445
15952
|
style: wrapperWidth ? { width: wrapperWidth } : void 0,
|
|
15446
15953
|
children: [
|
|
15447
|
-
/* @__PURE__ */
|
|
15954
|
+
/* @__PURE__ */ jsx165(
|
|
15448
15955
|
"input",
|
|
15449
15956
|
{
|
|
15450
15957
|
ref: inputRef,
|
|
@@ -15460,9 +15967,9 @@ var DashboardFileInput = React61.forwardRef(
|
|
|
15460
15967
|
"aria-invalid": isInvalid
|
|
15461
15968
|
}
|
|
15462
15969
|
),
|
|
15463
|
-
/* @__PURE__ */
|
|
15464
|
-
/* @__PURE__ */
|
|
15465
|
-
/* @__PURE__ */
|
|
15970
|
+
/* @__PURE__ */ jsxs108("div", { className: "relative min-h-[68px] w-full", children: [
|
|
15971
|
+
/* @__PURE__ */ jsxs108("div", { className: "relative w-full", children: [
|
|
15972
|
+
/* @__PURE__ */ jsxs108(
|
|
15466
15973
|
"div",
|
|
15467
15974
|
{
|
|
15468
15975
|
className: cn(
|
|
@@ -15470,25 +15977,25 @@ var DashboardFileInput = React61.forwardRef(
|
|
|
15470
15977
|
isEmpty && "bg-[var(--chekin-color-surface-input-empty)]"
|
|
15471
15978
|
),
|
|
15472
15979
|
children: [
|
|
15473
|
-
hasFileChip ? /* @__PURE__ */
|
|
15980
|
+
hasFileChip ? /* @__PURE__ */ jsxs108(
|
|
15474
15981
|
"div",
|
|
15475
15982
|
{
|
|
15476
15983
|
className: "inline-flex h-6 max-w-[85%] items-center rounded-[4px] border border-[#acacd5] bg-[#f0f0f8] pl-[10px] pr-1",
|
|
15477
15984
|
onClick: (event) => event.preventDefault(),
|
|
15478
15985
|
children: [
|
|
15479
|
-
isUrl ? /* @__PURE__ */
|
|
15986
|
+
isUrl ? /* @__PURE__ */ jsxs108(
|
|
15480
15987
|
"button",
|
|
15481
15988
|
{
|
|
15482
15989
|
type: "button",
|
|
15483
15990
|
onClick: handleDownload,
|
|
15484
15991
|
className: "inline-flex items-center gap-[7px] truncate border-0 bg-transparent p-0 text-[14px] font-medium text-[var(--chekin-color-brand-navy)] outline-none",
|
|
15485
15992
|
children: [
|
|
15486
|
-
/* @__PURE__ */
|
|
15487
|
-
/* @__PURE__ */
|
|
15993
|
+
/* @__PURE__ */ jsx165("span", { className: "truncate", children: resolvedDownloadLabel }),
|
|
15994
|
+
/* @__PURE__ */ jsx165(Download, { size: 15 })
|
|
15488
15995
|
]
|
|
15489
15996
|
}
|
|
15490
|
-
) : /* @__PURE__ */
|
|
15491
|
-
/* @__PURE__ */
|
|
15997
|
+
) : /* @__PURE__ */ jsx165("span", { className: "truncate text-[14px] font-medium text-[var(--chekin-color-brand-navy)]", children: value.name }),
|
|
15998
|
+
/* @__PURE__ */ jsx165(
|
|
15492
15999
|
"button",
|
|
15493
16000
|
{
|
|
15494
16001
|
type: "button",
|
|
@@ -15496,20 +16003,20 @@ var DashboardFileInput = React61.forwardRef(
|
|
|
15496
16003
|
onClick: handleClear,
|
|
15497
16004
|
className: "ml-2 flex h-[15px] w-[15px] items-center justify-center rounded-[3px] border-0 bg-transparent p-0 text-[#9696b9] outline-none hover:shadow-[0_3px_3px_#0f477734]",
|
|
15498
16005
|
"aria-label": t("remove_file"),
|
|
15499
|
-
children: /* @__PURE__ */
|
|
16006
|
+
children: /* @__PURE__ */ jsx165(SquareX5, { size: 15, fill: "#9696b9", color: "#f8f8f8", strokeWidth: 1.8 })
|
|
15500
16007
|
}
|
|
15501
16008
|
)
|
|
15502
16009
|
]
|
|
15503
16010
|
}
|
|
15504
|
-
) : /* @__PURE__ */
|
|
15505
|
-
/* @__PURE__ */
|
|
15506
|
-
loading && /* @__PURE__ */
|
|
15507
|
-
/* @__PURE__ */
|
|
16011
|
+
) : /* @__PURE__ */ jsx165("span", { className: "block min-w-0 flex-1 truncate text-left text-[var(--chekin-color-gray-1)]", children: placeholder ?? "" }),
|
|
16012
|
+
/* @__PURE__ */ jsxs108("span", { className: "ml-auto flex items-center gap-2 text-[var(--chekin-color-gray-2)]", children: [
|
|
16013
|
+
loading && /* @__PURE__ */ jsx165(ThreeDotsLoader, { height: 18, width: 18 }),
|
|
16014
|
+
/* @__PURE__ */ jsx165(Paperclip, { size: 20 })
|
|
15508
16015
|
] })
|
|
15509
16016
|
]
|
|
15510
16017
|
}
|
|
15511
16018
|
),
|
|
15512
|
-
/* @__PURE__ */
|
|
16019
|
+
/* @__PURE__ */ jsx165(
|
|
15513
16020
|
Fieldset,
|
|
15514
16021
|
{
|
|
15515
16022
|
isFocused: false,
|
|
@@ -15527,9 +16034,9 @@ var DashboardFileInput = React61.forwardRef(
|
|
|
15527
16034
|
}
|
|
15528
16035
|
)
|
|
15529
16036
|
] }),
|
|
15530
|
-
!error && optional && /* @__PURE__ */
|
|
15531
|
-
!error && helperText && /* @__PURE__ */
|
|
15532
|
-
error && !hideErrorMessage && /* @__PURE__ */
|
|
16037
|
+
!error && optional && /* @__PURE__ */ jsx165("span", { className: "mt-[1px] block text-left text-[14px] font-medium text-[var(--chekin-color-gray-1)]", children: typeof optional === "string" ? optional : t("optional") }),
|
|
16038
|
+
!error && helperText && /* @__PURE__ */ jsx165("span", { className: "mt-[1px] block text-[12px] font-normal text-[var(--chekin-color-gray-1)]", children: helperText }),
|
|
16039
|
+
error && !hideErrorMessage && /* @__PURE__ */ jsx165(
|
|
15533
16040
|
FieldErrorMessage,
|
|
15534
16041
|
{
|
|
15535
16042
|
id: errorId,
|
|
@@ -15546,7 +16053,7 @@ var DashboardFileInput = React61.forwardRef(
|
|
|
15546
16053
|
|
|
15547
16054
|
// src/dashboard/select-icons-box/SelectIconsBox.tsx
|
|
15548
16055
|
import * as React62 from "react";
|
|
15549
|
-
import { jsx as
|
|
16056
|
+
import { jsx as jsx166, jsxs as jsxs109 } from "react/jsx-runtime";
|
|
15550
16057
|
function DashboardSelectIconsBox({
|
|
15551
16058
|
children,
|
|
15552
16059
|
icons,
|
|
@@ -15582,7 +16089,7 @@ function DashboardSelectIconsBox({
|
|
|
15582
16089
|
onSelect(iconName);
|
|
15583
16090
|
setOpen(false);
|
|
15584
16091
|
};
|
|
15585
|
-
return /* @__PURE__ */
|
|
16092
|
+
return /* @__PURE__ */ jsxs109(
|
|
15586
16093
|
"div",
|
|
15587
16094
|
{
|
|
15588
16095
|
ref: containerRef,
|
|
@@ -15590,7 +16097,7 @@ function DashboardSelectIconsBox({
|
|
|
15590
16097
|
className: cn("relative inline-block", className),
|
|
15591
16098
|
children: [
|
|
15592
16099
|
children,
|
|
15593
|
-
isOpen && /* @__PURE__ */
|
|
16100
|
+
isOpen && /* @__PURE__ */ jsx166(
|
|
15594
16101
|
"div",
|
|
15595
16102
|
{
|
|
15596
16103
|
className: cn(
|
|
@@ -15601,7 +16108,7 @@ function DashboardSelectIconsBox({
|
|
|
15601
16108
|
boxClassName
|
|
15602
16109
|
),
|
|
15603
16110
|
style: { gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))` },
|
|
15604
|
-
children: icons.map((iconName) => /* @__PURE__ */
|
|
16111
|
+
children: icons.map((iconName) => /* @__PURE__ */ jsx166(
|
|
15605
16112
|
"button",
|
|
15606
16113
|
{
|
|
15607
16114
|
type: "button",
|
|
@@ -15682,14 +16189,14 @@ function getErrorMessage(error) {
|
|
|
15682
16189
|
|
|
15683
16190
|
// src/lib/toastResponseError.tsx
|
|
15684
16191
|
import i18next from "i18next";
|
|
15685
|
-
import { jsx as
|
|
16192
|
+
import { jsx as jsx167, jsxs as jsxs110 } from "react/jsx-runtime";
|
|
15686
16193
|
function addSupportEmailToMessage(message, prefixText) {
|
|
15687
16194
|
if (typeof message !== "string") {
|
|
15688
16195
|
return message;
|
|
15689
16196
|
}
|
|
15690
16197
|
const builtMessage = `${prefixText ? `${prefixText} ` : ""}${message}`;
|
|
15691
|
-
return /* @__PURE__ */
|
|
15692
|
-
/* @__PURE__ */
|
|
16198
|
+
return /* @__PURE__ */ jsxs110("div", { children: [
|
|
16199
|
+
/* @__PURE__ */ jsx167("div", { children: builtMessage }),
|
|
15693
16200
|
i18next.t("reach_us_at_email")
|
|
15694
16201
|
] });
|
|
15695
16202
|
}
|
|
@@ -15704,13 +16211,13 @@ function toastResponseError(error, options = {}) {
|
|
|
15704
16211
|
}
|
|
15705
16212
|
|
|
15706
16213
|
// src/legacy-fields/textarea/Textarea.tsx
|
|
15707
|
-
import { forwardRef as
|
|
15708
|
-
import { jsx as
|
|
15709
|
-
var LegacyTextarea =
|
|
16214
|
+
import { forwardRef as forwardRef68, useId as useId15 } from "react";
|
|
16215
|
+
import { jsx as jsx168, jsxs as jsxs111 } from "react/jsx-runtime";
|
|
16216
|
+
var LegacyTextarea = forwardRef68(
|
|
15710
16217
|
({ className, textareaClassName, label, disabled, name, invalid, ...textareaProps }, ref) => {
|
|
15711
16218
|
const inputId = useId15();
|
|
15712
|
-
return /* @__PURE__ */
|
|
15713
|
-
/* @__PURE__ */
|
|
16219
|
+
return /* @__PURE__ */ jsxs111("div", { className: cn("relative", className), children: [
|
|
16220
|
+
/* @__PURE__ */ jsx168(
|
|
15714
16221
|
"textarea",
|
|
15715
16222
|
{
|
|
15716
16223
|
ref,
|
|
@@ -15726,7 +16233,7 @@ var LegacyTextarea = forwardRef67(
|
|
|
15726
16233
|
...textareaProps
|
|
15727
16234
|
}
|
|
15728
16235
|
),
|
|
15729
|
-
label && /* @__PURE__ */
|
|
16236
|
+
label && /* @__PURE__ */ jsx168(
|
|
15730
16237
|
"label",
|
|
15731
16238
|
{
|
|
15732
16239
|
htmlFor: inputId,
|
|
@@ -15750,8 +16257,8 @@ import { Calendar as Calendar2 } from "lucide-react";
|
|
|
15750
16257
|
// src/airbnb-fields/field-trigger/FieldTrigger.tsx
|
|
15751
16258
|
import * as React63 from "react";
|
|
15752
16259
|
import { Loader2 as Loader24 } from "lucide-react";
|
|
15753
|
-
import { useTranslation as
|
|
15754
|
-
import { Fragment as Fragment17, jsx as
|
|
16260
|
+
import { useTranslation as useTranslation39 } from "react-i18next";
|
|
16261
|
+
import { Fragment as Fragment17, jsx as jsx169, jsxs as jsxs112 } from "react/jsx-runtime";
|
|
15755
16262
|
var AirbnbFieldTrigger = React63.forwardRef(
|
|
15756
16263
|
({
|
|
15757
16264
|
as = "button",
|
|
@@ -15783,20 +16290,20 @@ var AirbnbFieldTrigger = React63.forwardRef(
|
|
|
15783
16290
|
onKeyDown,
|
|
15784
16291
|
...props
|
|
15785
16292
|
}, ref) => {
|
|
15786
|
-
const { t } =
|
|
16293
|
+
const { t } = useTranslation39();
|
|
15787
16294
|
const hasValue = Boolean(valueText);
|
|
15788
16295
|
const isRaised = hasValue || forceFloatingLabel;
|
|
15789
16296
|
const optionalLabel = optional ? typeof optional === "string" ? optional : t("optional") : void 0;
|
|
15790
16297
|
const visibleLabelText = labelText ?? label;
|
|
15791
16298
|
const hasLabelMeta = Boolean(optionalLabel) || Boolean(tooltip);
|
|
15792
|
-
const resolvedLabelText = visibleLabelText && hasLabelMeta ? /* @__PURE__ */
|
|
15793
|
-
/* @__PURE__ */
|
|
15794
|
-
optionalLabel && /* @__PURE__ */
|
|
16299
|
+
const resolvedLabelText = visibleLabelText && hasLabelMeta ? /* @__PURE__ */ jsxs112("span", { className: "inline-flex max-w-full items-center gap-1.5 align-middle", children: [
|
|
16300
|
+
/* @__PURE__ */ jsx169("span", { className: "min-w-0 truncate", children: visibleLabelText }),
|
|
16301
|
+
optionalLabel && /* @__PURE__ */ jsxs112("span", { className: "shrink-0 text-[12px] relative top-[1px] font-normal leading-4 text-current opacity-70", children: [
|
|
15795
16302
|
"(",
|
|
15796
16303
|
optionalLabel,
|
|
15797
16304
|
")"
|
|
15798
16305
|
] }),
|
|
15799
|
-
tooltip && /* @__PURE__ */
|
|
16306
|
+
tooltip && /* @__PURE__ */ jsx169(
|
|
15800
16307
|
HelpTooltip,
|
|
15801
16308
|
{
|
|
15802
16309
|
content: tooltip,
|
|
@@ -15812,9 +16319,9 @@ var AirbnbFieldTrigger = React63.forwardRef(
|
|
|
15812
16319
|
const hasInvalidState = Boolean(error);
|
|
15813
16320
|
const errorMessage = typeof error === "string" ? error : void 0;
|
|
15814
16321
|
const isBlocked = Boolean(disabled) || Boolean(loading);
|
|
15815
|
-
const resolvedTrailingAdornment = loading || trailingAdornment ? /* @__PURE__ */
|
|
16322
|
+
const resolvedTrailingAdornment = loading || trailingAdornment ? /* @__PURE__ */ jsxs112("span", { className: "flex items-center gap-2", children: [
|
|
15816
16323
|
trailingAdornment,
|
|
15817
|
-
loading && /* @__PURE__ */
|
|
16324
|
+
loading && /* @__PURE__ */ jsx169(
|
|
15818
16325
|
Loader24,
|
|
15819
16326
|
{
|
|
15820
16327
|
"aria-hidden": "true",
|
|
@@ -15830,8 +16337,8 @@ var AirbnbFieldTrigger = React63.forwardRef(
|
|
|
15830
16337
|
disabled ? "cursor-not-allowed opacity-50" : loading ? "cursor-progress" : isAirbnbVariant ? "cursor-pointer" : "cursor-text",
|
|
15831
16338
|
className
|
|
15832
16339
|
);
|
|
15833
|
-
const sharedContent = /* @__PURE__ */
|
|
15834
|
-
/* @__PURE__ */
|
|
16340
|
+
const sharedContent = /* @__PURE__ */ jsxs112(Fragment17, { children: [
|
|
16341
|
+
/* @__PURE__ */ jsxs112(
|
|
15835
16342
|
"span",
|
|
15836
16343
|
{
|
|
15837
16344
|
className: cn(
|
|
@@ -15840,7 +16347,7 @@ var AirbnbFieldTrigger = React63.forwardRef(
|
|
|
15840
16347
|
contentClassName
|
|
15841
16348
|
),
|
|
15842
16349
|
children: [
|
|
15843
|
-
/* @__PURE__ */
|
|
16350
|
+
/* @__PURE__ */ jsx169(
|
|
15844
16351
|
"span",
|
|
15845
16352
|
{
|
|
15846
16353
|
id: labelId,
|
|
@@ -15853,7 +16360,7 @@ var AirbnbFieldTrigger = React63.forwardRef(
|
|
|
15853
16360
|
children: animatedLabel
|
|
15854
16361
|
}
|
|
15855
16362
|
),
|
|
15856
|
-
children ? children : hasValue ? /* @__PURE__ */
|
|
16363
|
+
children ? children : hasValue ? /* @__PURE__ */ jsx169(
|
|
15857
16364
|
"span",
|
|
15858
16365
|
{
|
|
15859
16366
|
id: valueId,
|
|
@@ -15864,11 +16371,11 @@ var AirbnbFieldTrigger = React63.forwardRef(
|
|
|
15864
16371
|
),
|
|
15865
16372
|
children: valueText
|
|
15866
16373
|
}
|
|
15867
|
-
) : /* @__PURE__ */
|
|
16374
|
+
) : /* @__PURE__ */ jsx169("span", { id: helperTextId, className: "sr-only", children: placeholder ?? label })
|
|
15868
16375
|
]
|
|
15869
16376
|
}
|
|
15870
16377
|
),
|
|
15871
|
-
resolvedTrailingAdornment && /* @__PURE__ */
|
|
16378
|
+
resolvedTrailingAdornment && /* @__PURE__ */ jsx169(
|
|
15872
16379
|
"span",
|
|
15873
16380
|
{
|
|
15874
16381
|
"aria-hidden": "true",
|
|
@@ -15880,9 +16387,9 @@ var AirbnbFieldTrigger = React63.forwardRef(
|
|
|
15880
16387
|
}
|
|
15881
16388
|
)
|
|
15882
16389
|
] });
|
|
15883
|
-
return /* @__PURE__ */
|
|
15884
|
-
topLabel && /* @__PURE__ */
|
|
15885
|
-
as === "button" ? /* @__PURE__ */
|
|
16390
|
+
return /* @__PURE__ */ jsxs112("div", { className: "w-full", children: [
|
|
16391
|
+
topLabel && /* @__PURE__ */ jsx169("p", { className: "mb-3 text-[16px] font-semibold leading-5 text-[#222222]", children: topLabel }),
|
|
16392
|
+
as === "button" ? /* @__PURE__ */ jsx169(
|
|
15886
16393
|
"button",
|
|
15887
16394
|
{
|
|
15888
16395
|
id,
|
|
@@ -15899,7 +16406,7 @@ var AirbnbFieldTrigger = React63.forwardRef(
|
|
|
15899
16406
|
...props,
|
|
15900
16407
|
children: sharedContent
|
|
15901
16408
|
}
|
|
15902
|
-
) : /* @__PURE__ */
|
|
16409
|
+
) : /* @__PURE__ */ jsx169(
|
|
15903
16410
|
"div",
|
|
15904
16411
|
{
|
|
15905
16412
|
id,
|
|
@@ -15916,14 +16423,14 @@ var AirbnbFieldTrigger = React63.forwardRef(
|
|
|
15916
16423
|
children: sharedContent
|
|
15917
16424
|
}
|
|
15918
16425
|
),
|
|
15919
|
-
errorMessage && !hideErrorMessage && /* @__PURE__ */
|
|
16426
|
+
errorMessage && !hideErrorMessage && /* @__PURE__ */ jsx169(FieldErrorMessage, { id: errorId, message: errorMessage })
|
|
15920
16427
|
] });
|
|
15921
16428
|
}
|
|
15922
16429
|
);
|
|
15923
16430
|
AirbnbFieldTrigger.displayName = "AirbnbFieldTrigger";
|
|
15924
16431
|
|
|
15925
16432
|
// src/airbnb-fields/datepicker/DatePicker.tsx
|
|
15926
|
-
import { jsx as
|
|
16433
|
+
import { jsx as jsx170, jsxs as jsxs113 } from "react/jsx-runtime";
|
|
15927
16434
|
var DEFAULT_MIN_DATE = new Date(1920, 0, 1);
|
|
15928
16435
|
var AirbnbDatePicker = React64.forwardRef(
|
|
15929
16436
|
({
|
|
@@ -15950,7 +16457,7 @@ var AirbnbDatePicker = React64.forwardRef(
|
|
|
15950
16457
|
doneLabel = "Done",
|
|
15951
16458
|
formatValue = formatDateValue
|
|
15952
16459
|
}, ref) => {
|
|
15953
|
-
const { isMatch:
|
|
16460
|
+
const { isMatch: isMobile3 } = useScreenResize(DEVICE.mobileXL);
|
|
15954
16461
|
const [isOpen, setIsOpen] = React64.useState(false);
|
|
15955
16462
|
const triggerId = React64.useId();
|
|
15956
16463
|
const pickerId = React64.useId();
|
|
@@ -16040,8 +16547,8 @@ var AirbnbDatePicker = React64.forwardRef(
|
|
|
16040
16547
|
setIsOpen(false);
|
|
16041
16548
|
}
|
|
16042
16549
|
}, [isBlocked]);
|
|
16043
|
-
return /* @__PURE__ */
|
|
16044
|
-
name && /* @__PURE__ */
|
|
16550
|
+
return /* @__PURE__ */ jsxs113("div", { className: cn("relative w-full max-w-[var(--max-field-width)]", className), children: [
|
|
16551
|
+
name && /* @__PURE__ */ jsx170(
|
|
16045
16552
|
"input",
|
|
16046
16553
|
{
|
|
16047
16554
|
type: "hidden",
|
|
@@ -16049,7 +16556,7 @@ var AirbnbDatePicker = React64.forwardRef(
|
|
|
16049
16556
|
value: resolvedValue ? formatDateInputValue(resolvedValue) : ""
|
|
16050
16557
|
}
|
|
16051
16558
|
),
|
|
16052
|
-
/* @__PURE__ */
|
|
16559
|
+
/* @__PURE__ */ jsx170(
|
|
16053
16560
|
AirbnbFieldTrigger,
|
|
16054
16561
|
{
|
|
16055
16562
|
id: triggerId,
|
|
@@ -16076,15 +16583,15 @@ var AirbnbDatePicker = React64.forwardRef(
|
|
|
16076
16583
|
onClick: handleTriggerClick,
|
|
16077
16584
|
onKeyDown: handleTriggerKeyDown,
|
|
16078
16585
|
onBlur,
|
|
16079
|
-
trailingAdornment: /* @__PURE__ */
|
|
16586
|
+
trailingAdornment: /* @__PURE__ */ jsx170(Calendar2, { className: "h-5 w-5 text-[#1F1F1B]", strokeWidth: 2 })
|
|
16080
16587
|
}
|
|
16081
16588
|
),
|
|
16082
|
-
/* @__PURE__ */
|
|
16589
|
+
/* @__PURE__ */ jsx170(
|
|
16083
16590
|
AirbnbDatePickerContent,
|
|
16084
16591
|
{
|
|
16085
16592
|
baseId: pickerId,
|
|
16086
16593
|
open: isOpen,
|
|
16087
|
-
isMobile:
|
|
16594
|
+
isMobile: isMobile3,
|
|
16088
16595
|
label,
|
|
16089
16596
|
title: mobileTitle ?? label,
|
|
16090
16597
|
doneLabel,
|
|
@@ -16114,7 +16621,7 @@ AirbnbDatePicker.displayName = "AirbnbDatePicker";
|
|
|
16114
16621
|
|
|
16115
16622
|
// src/airbnb-fields/input/Input.tsx
|
|
16116
16623
|
import * as React65 from "react";
|
|
16117
|
-
import { jsx as
|
|
16624
|
+
import { jsx as jsx171 } from "react/jsx-runtime";
|
|
16118
16625
|
var getInputValue = (value) => value != null ? String(value) : "";
|
|
16119
16626
|
var AirbnbInput = React65.forwardRef(
|
|
16120
16627
|
({
|
|
@@ -16197,7 +16704,7 @@ var AirbnbInput = React65.forwardRef(
|
|
|
16197
16704
|
setIsFocused(false);
|
|
16198
16705
|
onBlur?.(event);
|
|
16199
16706
|
};
|
|
16200
|
-
return /* @__PURE__ */
|
|
16707
|
+
return /* @__PURE__ */ jsx171("div", { className: cn("w-full max-w-[var(--max-field-width)]", wrapperClassName), children: /* @__PURE__ */ jsx171(
|
|
16201
16708
|
AirbnbFieldTrigger,
|
|
16202
16709
|
{
|
|
16203
16710
|
as: "div",
|
|
@@ -16229,7 +16736,7 @@ var AirbnbInput = React65.forwardRef(
|
|
|
16229
16736
|
forceFloatingLabel: shouldShowLabel,
|
|
16230
16737
|
forceLabelText: hasLabelMeta,
|
|
16231
16738
|
hideErrorMessage: !renderErrorMessage,
|
|
16232
|
-
children: /* @__PURE__ */
|
|
16739
|
+
children: /* @__PURE__ */ jsx171(
|
|
16233
16740
|
"input",
|
|
16234
16741
|
{
|
|
16235
16742
|
...props,
|
|
@@ -16272,7 +16779,7 @@ import { ChevronDown as ChevronDown5 } from "lucide-react";
|
|
|
16272
16779
|
import * as React70 from "react";
|
|
16273
16780
|
|
|
16274
16781
|
// src/airbnb-fields/select/SelectDesktopMenu.tsx
|
|
16275
|
-
import { jsx as
|
|
16782
|
+
import { jsx as jsx172, jsxs as jsxs114 } from "react/jsx-runtime";
|
|
16276
16783
|
function AirbnbSelectDesktopMenu({
|
|
16277
16784
|
id,
|
|
16278
16785
|
options,
|
|
@@ -16291,7 +16798,7 @@ function AirbnbSelectDesktopMenu({
|
|
|
16291
16798
|
noOptionsMessage
|
|
16292
16799
|
}) {
|
|
16293
16800
|
const emptyMessage = noOptionsMessage?.();
|
|
16294
|
-
return /* @__PURE__ */
|
|
16801
|
+
return /* @__PURE__ */ jsxs114(
|
|
16295
16802
|
"div",
|
|
16296
16803
|
{
|
|
16297
16804
|
id,
|
|
@@ -16304,12 +16811,12 @@ function AirbnbSelectDesktopMenu({
|
|
|
16304
16811
|
onKeyDown,
|
|
16305
16812
|
className: cn("max-h-[280px] overflow-y-auto p-2 outline-none", menuClassName),
|
|
16306
16813
|
children: [
|
|
16307
|
-
options.length === 0 && emptyMessage ? /* @__PURE__ */
|
|
16814
|
+
options.length === 0 && emptyMessage ? /* @__PURE__ */ jsx172("div", { className: "px-4 py-3 text-base leading-6 text-[#6C6C6C]", children: emptyMessage }) : null,
|
|
16308
16815
|
options.map((option, index) => {
|
|
16309
16816
|
const isSelected = selectedValue?.value === option.value;
|
|
16310
16817
|
const isHighlighted = index === highlightedIndex;
|
|
16311
16818
|
const optionKey = `${String(option.value)}-${index}`;
|
|
16312
|
-
return /* @__PURE__ */
|
|
16819
|
+
return /* @__PURE__ */ jsx172(
|
|
16313
16820
|
"button",
|
|
16314
16821
|
{
|
|
16315
16822
|
id: getOptionId2(index),
|
|
@@ -16341,7 +16848,7 @@ function AirbnbSelectDesktopMenu({
|
|
|
16341
16848
|
}
|
|
16342
16849
|
|
|
16343
16850
|
// src/airbnb-fields/select/SelectDesktopContent.tsx
|
|
16344
|
-
import { jsx as
|
|
16851
|
+
import { jsx as jsx173 } from "react/jsx-runtime";
|
|
16345
16852
|
function AirbnbSelectDesktopContent({
|
|
16346
16853
|
isOpen,
|
|
16347
16854
|
listboxId,
|
|
@@ -16362,14 +16869,14 @@ function AirbnbSelectDesktopContent({
|
|
|
16362
16869
|
noOptionsMessage
|
|
16363
16870
|
}) {
|
|
16364
16871
|
if (!isOpen) return null;
|
|
16365
|
-
return /* @__PURE__ */
|
|
16872
|
+
return /* @__PURE__ */ jsx173(
|
|
16366
16873
|
"div",
|
|
16367
16874
|
{
|
|
16368
16875
|
className: cn(
|
|
16369
16876
|
"absolute left-0 right-0 top-[calc(100%+8px)] z-20 overflow-hidden rounded-[20px] border border-[#DEDAD2] bg-white shadow-[0_14px_30px_rgba(18,18,18,0.08)]",
|
|
16370
16877
|
dropdownClassName
|
|
16371
16878
|
),
|
|
16372
|
-
children: /* @__PURE__ */
|
|
16879
|
+
children: /* @__PURE__ */ jsx173(
|
|
16373
16880
|
AirbnbSelectDesktopMenu,
|
|
16374
16881
|
{
|
|
16375
16882
|
id: listboxId,
|
|
@@ -16467,7 +16974,7 @@ function getMobileOptionStyles(index, scrollTop) {
|
|
|
16467
16974
|
}
|
|
16468
16975
|
|
|
16469
16976
|
// src/airbnb-fields/select/SelectMobileWheel.tsx
|
|
16470
|
-
import { jsx as
|
|
16977
|
+
import { jsx as jsx174, jsxs as jsxs115 } from "react/jsx-runtime";
|
|
16471
16978
|
function AirbnbSelectMobileWheel({
|
|
16472
16979
|
id,
|
|
16473
16980
|
options,
|
|
@@ -16486,7 +16993,7 @@ function AirbnbSelectMobileWheel({
|
|
|
16486
16993
|
}) {
|
|
16487
16994
|
const spacerHeight2 = getWheelSpacerHeight();
|
|
16488
16995
|
const emptyMessage = noOptionsMessage?.();
|
|
16489
|
-
return /* @__PURE__ */
|
|
16996
|
+
return /* @__PURE__ */ jsxs115(
|
|
16490
16997
|
"div",
|
|
16491
16998
|
{
|
|
16492
16999
|
id,
|
|
@@ -16498,10 +17005,10 @@ function AirbnbSelectMobileWheel({
|
|
|
16498
17005
|
onKeyDown,
|
|
16499
17006
|
className: cn("relative overflow-hidden outline-none", menuClassName),
|
|
16500
17007
|
children: [
|
|
16501
|
-
options.length === 0 && emptyMessage ? /* @__PURE__ */
|
|
16502
|
-
/* @__PURE__ */
|
|
16503
|
-
/* @__PURE__ */
|
|
16504
|
-
/* @__PURE__ */
|
|
17008
|
+
options.length === 0 && emptyMessage ? /* @__PURE__ */ jsx174("div", { className: "flex min-h-[160px] items-center justify-center px-4 text-center text-base leading-6 text-[#6C6C6C]", children: emptyMessage }) : null,
|
|
17009
|
+
/* @__PURE__ */ jsx174("div", { className: "pointer-events-none absolute inset-x-0 top-0 h-16 bg-gradient-to-b from-white via-white/80 to-transparent" }),
|
|
17010
|
+
/* @__PURE__ */ jsx174("div", { className: "pointer-events-none absolute inset-x-0 bottom-0 h-16 bg-gradient-to-t from-white via-white/80 to-transparent" }),
|
|
17011
|
+
/* @__PURE__ */ jsx174(
|
|
16505
17012
|
"div",
|
|
16506
17013
|
{
|
|
16507
17014
|
"aria-hidden": true,
|
|
@@ -16511,7 +17018,7 @@ function AirbnbSelectMobileWheel({
|
|
|
16511
17018
|
)
|
|
16512
17019
|
}
|
|
16513
17020
|
),
|
|
16514
|
-
/* @__PURE__ */
|
|
17021
|
+
/* @__PURE__ */ jsxs115(
|
|
16515
17022
|
"div",
|
|
16516
17023
|
{
|
|
16517
17024
|
ref: listRef,
|
|
@@ -16526,11 +17033,11 @@ function AirbnbSelectMobileWheel({
|
|
|
16526
17033
|
WebkitOverflowScrolling: "touch"
|
|
16527
17034
|
},
|
|
16528
17035
|
children: [
|
|
16529
|
-
/* @__PURE__ */
|
|
17036
|
+
/* @__PURE__ */ jsx174("div", { style: { height: `${spacerHeight2}px` } }),
|
|
16530
17037
|
options.map((option, index) => {
|
|
16531
17038
|
const { distance, style } = getMobileOptionStyles(index, scrollTop);
|
|
16532
17039
|
const optionKey = `${String(option.value)}-${index}`;
|
|
16533
|
-
return /* @__PURE__ */
|
|
17040
|
+
return /* @__PURE__ */ jsx174(
|
|
16534
17041
|
"button",
|
|
16535
17042
|
{
|
|
16536
17043
|
id: getOptionId2(index),
|
|
@@ -16551,7 +17058,7 @@ function AirbnbSelectMobileWheel({
|
|
|
16551
17058
|
optionKey
|
|
16552
17059
|
);
|
|
16553
17060
|
}),
|
|
16554
|
-
/* @__PURE__ */
|
|
17061
|
+
/* @__PURE__ */ jsx174("div", { style: { height: `${spacerHeight2}px` } })
|
|
16555
17062
|
]
|
|
16556
17063
|
}
|
|
16557
17064
|
)
|
|
@@ -16561,7 +17068,7 @@ function AirbnbSelectMobileWheel({
|
|
|
16561
17068
|
}
|
|
16562
17069
|
|
|
16563
17070
|
// src/airbnb-fields/select/SelectMobileContent.tsx
|
|
16564
|
-
import { jsx as
|
|
17071
|
+
import { jsx as jsx175, jsxs as jsxs116 } from "react/jsx-runtime";
|
|
16565
17072
|
function AirbnbSelectMobileContent({
|
|
16566
17073
|
open,
|
|
16567
17074
|
onOpenChange,
|
|
@@ -16585,11 +17092,11 @@ function AirbnbSelectMobileContent({
|
|
|
16585
17092
|
getOptionId: getOptionId2,
|
|
16586
17093
|
noOptionsMessage
|
|
16587
17094
|
}) {
|
|
16588
|
-
return /* @__PURE__ */
|
|
16589
|
-
/* @__PURE__ */
|
|
16590
|
-
/* @__PURE__ */
|
|
16591
|
-
/* @__PURE__ */
|
|
16592
|
-
/* @__PURE__ */
|
|
17095
|
+
return /* @__PURE__ */ jsx175(Drawer, { open, onOpenChange, children: /* @__PURE__ */ jsxs116(DrawerContent, { onClose, lockScroll: false, children: [
|
|
17096
|
+
/* @__PURE__ */ jsx175(DrawerTitle, { className: "sr-only", children: mobileTitle ?? label }),
|
|
17097
|
+
/* @__PURE__ */ jsx175(DrawerDescription, { className: "sr-only", children: label }),
|
|
17098
|
+
/* @__PURE__ */ jsxs116("div", { className: "px-6 pb-4 pt-1", children: [
|
|
17099
|
+
/* @__PURE__ */ jsx175(
|
|
16593
17100
|
AirbnbSelectMobileWheel,
|
|
16594
17101
|
{
|
|
16595
17102
|
id: listboxId,
|
|
@@ -16608,7 +17115,7 @@ function AirbnbSelectMobileContent({
|
|
|
16608
17115
|
noOptionsMessage
|
|
16609
17116
|
}
|
|
16610
17117
|
),
|
|
16611
|
-
/* @__PURE__ */
|
|
17118
|
+
/* @__PURE__ */ jsx175(Button, { type: "button", onClick: onDone, className: "mt-4 h-12 mb-8 w-full", children: doneLabel })
|
|
16612
17119
|
] })
|
|
16613
17120
|
] }) });
|
|
16614
17121
|
}
|
|
@@ -16616,7 +17123,7 @@ function AirbnbSelectMobileContent({
|
|
|
16616
17123
|
// src/airbnb-fields/select/SelectTrigger.tsx
|
|
16617
17124
|
import * as React66 from "react";
|
|
16618
17125
|
import { ChevronDown as ChevronDown4 } from "lucide-react";
|
|
16619
|
-
import { jsx as
|
|
17126
|
+
import { jsx as jsx176 } from "react/jsx-runtime";
|
|
16620
17127
|
var AirbnbSelectTrigger = React66.forwardRef(
|
|
16621
17128
|
({
|
|
16622
17129
|
id,
|
|
@@ -16642,7 +17149,7 @@ var AirbnbSelectTrigger = React66.forwardRef(
|
|
|
16642
17149
|
onKeyDown,
|
|
16643
17150
|
onBlur
|
|
16644
17151
|
}, ref) => {
|
|
16645
|
-
return /* @__PURE__ */
|
|
17152
|
+
return /* @__PURE__ */ jsx176(
|
|
16646
17153
|
AirbnbFieldTrigger,
|
|
16647
17154
|
{
|
|
16648
17155
|
id,
|
|
@@ -16671,7 +17178,7 @@ var AirbnbSelectTrigger = React66.forwardRef(
|
|
|
16671
17178
|
onClick,
|
|
16672
17179
|
onKeyDown,
|
|
16673
17180
|
onBlur,
|
|
16674
|
-
trailingAdornment: /* @__PURE__ */
|
|
17181
|
+
trailingAdornment: /* @__PURE__ */ jsx176(
|
|
16675
17182
|
ChevronDown4,
|
|
16676
17183
|
{
|
|
16677
17184
|
className: open ? "h-6 w-6 rotate-180 text-[#1F1F1B] transition-transform" : "h-6 w-6 text-[#1F1F1B] transition-transform"
|
|
@@ -16686,7 +17193,7 @@ AirbnbSelectTrigger.displayName = "AirbnbSelectTrigger";
|
|
|
16686
17193
|
// src/airbnb-fields/select/useDesktopSelect.ts
|
|
16687
17194
|
import * as React67 from "react";
|
|
16688
17195
|
function useDesktopSelect({
|
|
16689
|
-
isMobile:
|
|
17196
|
+
isMobile: isMobile3,
|
|
16690
17197
|
isOpen,
|
|
16691
17198
|
options,
|
|
16692
17199
|
value,
|
|
@@ -16699,7 +17206,7 @@ function useDesktopSelect({
|
|
|
16699
17206
|
const optionRefs = React67.useRef([]);
|
|
16700
17207
|
const selectedIndex = getOptionIndex2(options, value);
|
|
16701
17208
|
React67.useEffect(() => {
|
|
16702
|
-
if (!isOpen ||
|
|
17209
|
+
if (!isOpen || isMobile3) return;
|
|
16703
17210
|
setHighlightedIndex((currentIndex) => {
|
|
16704
17211
|
if (currentIndex >= 0) {
|
|
16705
17212
|
return currentIndex;
|
|
@@ -16712,13 +17219,13 @@ function useDesktopSelect({
|
|
|
16712
17219
|
return () => {
|
|
16713
17220
|
window.cancelAnimationFrame(frameId);
|
|
16714
17221
|
};
|
|
16715
|
-
}, [
|
|
17222
|
+
}, [isMobile3, isOpen, options, selectedIndex]);
|
|
16716
17223
|
React67.useEffect(() => {
|
|
16717
|
-
if (!isOpen ||
|
|
17224
|
+
if (!isOpen || isMobile3 || highlightedIndex < 0) return;
|
|
16718
17225
|
optionRefs.current[highlightedIndex]?.scrollIntoView({
|
|
16719
17226
|
block: "nearest"
|
|
16720
17227
|
});
|
|
16721
|
-
}, [highlightedIndex,
|
|
17228
|
+
}, [highlightedIndex, isMobile3, isOpen]);
|
|
16722
17229
|
React67.useEffect(() => {
|
|
16723
17230
|
if (isOpen) return;
|
|
16724
17231
|
setHighlightedIndex(-1);
|
|
@@ -16836,7 +17343,7 @@ function useDesktopSelect({
|
|
|
16836
17343
|
|
|
16837
17344
|
// src/airbnb-fields/select/useMobileSelectWheel.ts
|
|
16838
17345
|
import * as React68 from "react";
|
|
16839
|
-
function useMobileSelectWheel({ isMobile:
|
|
17346
|
+
function useMobileSelectWheel({ isMobile: isMobile3, isOpen, options, value, disabled }) {
|
|
16840
17347
|
const [pendingValue, setPendingValue] = React68.useState(
|
|
16841
17348
|
value ?? null
|
|
16842
17349
|
);
|
|
@@ -16891,14 +17398,14 @@ function useMobileSelectWheel({ isMobile: isMobile2, isOpen, options, value, dis
|
|
|
16891
17398
|
setPendingValue(value ?? null);
|
|
16892
17399
|
}, [value]);
|
|
16893
17400
|
React68.useLayoutEffect(() => {
|
|
16894
|
-
if (!
|
|
17401
|
+
if (!isMobile3 || !isOpen) return;
|
|
16895
17402
|
const frameId = window.requestAnimationFrame(() => {
|
|
16896
17403
|
syncScrollPosition(value ?? null, "instant");
|
|
16897
17404
|
});
|
|
16898
17405
|
return () => {
|
|
16899
17406
|
window.cancelAnimationFrame(frameId);
|
|
16900
17407
|
};
|
|
16901
|
-
}, [
|
|
17408
|
+
}, [isMobile3, isOpen, syncScrollPosition, value]);
|
|
16902
17409
|
const settleScroll = React68.useCallback(() => {
|
|
16903
17410
|
if (!mobileListRef.current) return;
|
|
16904
17411
|
const nextIndex = Math.round(mobileListRef.current.scrollTop / MOBILE_OPTION_HEIGHT);
|
|
@@ -17033,7 +17540,7 @@ function useSelectIds2({ name, hasValue, error, hideErrorMessage }) {
|
|
|
17033
17540
|
}
|
|
17034
17541
|
|
|
17035
17542
|
// src/airbnb-fields/select/Select.tsx
|
|
17036
|
-
import { jsx as
|
|
17543
|
+
import { jsx as jsx177, jsxs as jsxs117 } from "react/jsx-runtime";
|
|
17037
17544
|
var AirbnbSelect = React70.forwardRef(function AirbnbSelect2({
|
|
17038
17545
|
options = [],
|
|
17039
17546
|
value,
|
|
@@ -17060,7 +17567,7 @@ var AirbnbSelect = React70.forwardRef(function AirbnbSelect2({
|
|
|
17060
17567
|
name,
|
|
17061
17568
|
noOptionsMessage
|
|
17062
17569
|
}, ref) {
|
|
17063
|
-
const { isMatch:
|
|
17570
|
+
const { isMatch: isMobile3 } = useScreenResize(DEVICE.mobileXL);
|
|
17064
17571
|
const [isOpen, setIsOpen] = React70.useState(false);
|
|
17065
17572
|
const containerRef = React70.useRef(null);
|
|
17066
17573
|
const hasValue = Boolean(value);
|
|
@@ -17091,7 +17598,7 @@ var AirbnbSelect = React70.forwardRef(function AirbnbSelect2({
|
|
|
17091
17598
|
moveByStep,
|
|
17092
17599
|
moveToBoundary
|
|
17093
17600
|
} = useMobileSelectWheel({
|
|
17094
|
-
isMobile:
|
|
17601
|
+
isMobile: isMobile3,
|
|
17095
17602
|
isOpen,
|
|
17096
17603
|
options,
|
|
17097
17604
|
value,
|
|
@@ -17108,7 +17615,7 @@ var AirbnbSelect = React70.forwardRef(function AirbnbSelect2({
|
|
|
17108
17615
|
handleMenuKeyDown,
|
|
17109
17616
|
handleTriggerKeyDown
|
|
17110
17617
|
} = useDesktopSelect({
|
|
17111
|
-
isMobile:
|
|
17618
|
+
isMobile: isMobile3,
|
|
17112
17619
|
isOpen,
|
|
17113
17620
|
options,
|
|
17114
17621
|
value,
|
|
@@ -17121,7 +17628,7 @@ var AirbnbSelect = React70.forwardRef(function AirbnbSelect2({
|
|
|
17121
17628
|
useOutsideClick({
|
|
17122
17629
|
elementRef: containerRef,
|
|
17123
17630
|
onOutsideClick: () => setIsOpen(false),
|
|
17124
|
-
isDisabled: !isOpen ||
|
|
17631
|
+
isDisabled: !isOpen || isMobile3
|
|
17125
17632
|
});
|
|
17126
17633
|
React70.useEffect(() => {
|
|
17127
17634
|
if (isBlocked) {
|
|
@@ -17164,14 +17671,14 @@ var AirbnbSelect = React70.forwardRef(function AirbnbSelect2({
|
|
|
17164
17671
|
if (isBlocked) return;
|
|
17165
17672
|
setIsOpen((prev) => {
|
|
17166
17673
|
const nextOpen = !prev;
|
|
17167
|
-
if (
|
|
17674
|
+
if (isMobile3) {
|
|
17168
17675
|
syncPendingValue(value ?? null);
|
|
17169
17676
|
}
|
|
17170
17677
|
return nextOpen;
|
|
17171
17678
|
});
|
|
17172
|
-
}, [isBlocked,
|
|
17679
|
+
}, [isBlocked, isMobile3, syncPendingValue, value]);
|
|
17173
17680
|
const handleRootTriggerKeyDown = (event) => {
|
|
17174
|
-
if (
|
|
17681
|
+
if (isMobile3) {
|
|
17175
17682
|
if (isBlocked) return;
|
|
17176
17683
|
if (event.key === "ArrowDown" || event.key === "ArrowUp" || event.key === "Enter" || event.key === " ") {
|
|
17177
17684
|
event.preventDefault();
|
|
@@ -17213,13 +17720,13 @@ var AirbnbSelect = React70.forwardRef(function AirbnbSelect2({
|
|
|
17213
17720
|
handleMobileOpenChange(false);
|
|
17214
17721
|
}
|
|
17215
17722
|
};
|
|
17216
|
-
return /* @__PURE__ */
|
|
17723
|
+
return /* @__PURE__ */ jsxs117(
|
|
17217
17724
|
"div",
|
|
17218
17725
|
{
|
|
17219
17726
|
ref: containerRef,
|
|
17220
17727
|
className: cn("relative w-full max-w-[var(--max-field-width)]", className),
|
|
17221
17728
|
children: [
|
|
17222
|
-
name && /* @__PURE__ */
|
|
17729
|
+
name && /* @__PURE__ */ jsx177("input", { type: "hidden", name, value: value ? String(value.value) : "" }),
|
|
17223
17730
|
renderTrigger ? renderTrigger({
|
|
17224
17731
|
id: triggerId,
|
|
17225
17732
|
open: isOpen,
|
|
@@ -17241,7 +17748,7 @@ var AirbnbSelect = React70.forwardRef(function AirbnbSelect2({
|
|
|
17241
17748
|
onClick: handleTriggerClick,
|
|
17242
17749
|
onKeyDown: handleRootTriggerKeyDown,
|
|
17243
17750
|
onBlur
|
|
17244
|
-
}) : /* @__PURE__ */
|
|
17751
|
+
}) : /* @__PURE__ */ jsx177(
|
|
17245
17752
|
AirbnbSelectTrigger,
|
|
17246
17753
|
{
|
|
17247
17754
|
id: triggerId,
|
|
@@ -17269,7 +17776,7 @@ var AirbnbSelect = React70.forwardRef(function AirbnbSelect2({
|
|
|
17269
17776
|
onBlur
|
|
17270
17777
|
}
|
|
17271
17778
|
),
|
|
17272
|
-
|
|
17779
|
+
isMobile3 ? /* @__PURE__ */ jsx177(
|
|
17273
17780
|
AirbnbSelectMobileContent,
|
|
17274
17781
|
{
|
|
17275
17782
|
open: isOpen,
|
|
@@ -17294,7 +17801,7 @@ var AirbnbSelect = React70.forwardRef(function AirbnbSelect2({
|
|
|
17294
17801
|
getOptionId: getOptionId2,
|
|
17295
17802
|
noOptionsMessage
|
|
17296
17803
|
}
|
|
17297
|
-
) : /* @__PURE__ */
|
|
17804
|
+
) : /* @__PURE__ */ jsx177(
|
|
17298
17805
|
AirbnbSelectDesktopContent,
|
|
17299
17806
|
{
|
|
17300
17807
|
isOpen,
|
|
@@ -17328,7 +17835,7 @@ var AirbnbSelect = React70.forwardRef(function AirbnbSelect2({
|
|
|
17328
17835
|
});
|
|
17329
17836
|
|
|
17330
17837
|
// src/airbnb-fields/phone-field/PhoneField.tsx
|
|
17331
|
-
import { jsx as
|
|
17838
|
+
import { jsx as jsx178, jsxs as jsxs118 } from "react/jsx-runtime";
|
|
17332
17839
|
function formatPhoneCodeOptionLabel(option) {
|
|
17333
17840
|
const label = String(option.label);
|
|
17334
17841
|
const value = String(option.value);
|
|
@@ -17375,9 +17882,9 @@ var AirbnbPhoneField = React71.forwardRef(
|
|
|
17375
17882
|
const hasInvalidState = Boolean(error) || Boolean(invalid);
|
|
17376
17883
|
const isBlocked = Boolean(disabled) || Boolean(loading);
|
|
17377
17884
|
const isCodeBlocked = isBlocked || Boolean(codeReadOnly);
|
|
17378
|
-
return /* @__PURE__ */
|
|
17379
|
-
name && /* @__PURE__ */
|
|
17380
|
-
codeName && /* @__PURE__ */
|
|
17885
|
+
return /* @__PURE__ */ jsxs118("div", { className: cn("w-full max-w-[var(--max-field-width)]", className), children: [
|
|
17886
|
+
name && /* @__PURE__ */ jsx178("input", { type: "hidden", name, value: combinedValue, disabled }),
|
|
17887
|
+
codeName && /* @__PURE__ */ jsx178(
|
|
17381
17888
|
"input",
|
|
17382
17889
|
{
|
|
17383
17890
|
type: "hidden",
|
|
@@ -17386,7 +17893,7 @@ var AirbnbPhoneField = React71.forwardRef(
|
|
|
17386
17893
|
disabled
|
|
17387
17894
|
}
|
|
17388
17895
|
),
|
|
17389
|
-
numberName && /* @__PURE__ */
|
|
17896
|
+
numberName && /* @__PURE__ */ jsx178(
|
|
17390
17897
|
"input",
|
|
17391
17898
|
{
|
|
17392
17899
|
type: "hidden",
|
|
@@ -17395,7 +17902,7 @@ var AirbnbPhoneField = React71.forwardRef(
|
|
|
17395
17902
|
disabled
|
|
17396
17903
|
}
|
|
17397
17904
|
),
|
|
17398
|
-
topLabel && /* @__PURE__ */
|
|
17905
|
+
topLabel && /* @__PURE__ */ jsx178(
|
|
17399
17906
|
"label",
|
|
17400
17907
|
{
|
|
17401
17908
|
htmlFor: inputId,
|
|
@@ -17403,8 +17910,8 @@ var AirbnbPhoneField = React71.forwardRef(
|
|
|
17403
17910
|
children: topLabel
|
|
17404
17911
|
}
|
|
17405
17912
|
),
|
|
17406
|
-
/* @__PURE__ */
|
|
17407
|
-
/* @__PURE__ */
|
|
17913
|
+
/* @__PURE__ */ jsxs118("div", { className: "flex items-stretch", children: [
|
|
17914
|
+
/* @__PURE__ */ jsx178(
|
|
17408
17915
|
AirbnbSelect,
|
|
17409
17916
|
{
|
|
17410
17917
|
ref,
|
|
@@ -17435,7 +17942,7 @@ var AirbnbPhoneField = React71.forwardRef(
|
|
|
17435
17942
|
onClick,
|
|
17436
17943
|
onKeyDown,
|
|
17437
17944
|
valueLabel
|
|
17438
|
-
}) => /* @__PURE__ */
|
|
17945
|
+
}) => /* @__PURE__ */ jsxs118(
|
|
17439
17946
|
"button",
|
|
17440
17947
|
{
|
|
17441
17948
|
id,
|
|
@@ -17457,8 +17964,8 @@ var AirbnbPhoneField = React71.forwardRef(
|
|
|
17457
17964
|
triggerDisabled ? "cursor-not-allowed opacity-50" : triggerLoading ? "cursor-progress" : "cursor-pointer"
|
|
17458
17965
|
),
|
|
17459
17966
|
children: [
|
|
17460
|
-
/* @__PURE__ */
|
|
17461
|
-
/* @__PURE__ */
|
|
17967
|
+
/* @__PURE__ */ jsx178("span", { children: valueLabel ?? codePlaceholder }),
|
|
17968
|
+
/* @__PURE__ */ jsx178(
|
|
17462
17969
|
ChevronDown5,
|
|
17463
17970
|
{
|
|
17464
17971
|
className: cn("h-5 w-5 transition-transform", open ? "rotate-180" : ""),
|
|
@@ -17470,7 +17977,7 @@ var AirbnbPhoneField = React71.forwardRef(
|
|
|
17470
17977
|
)
|
|
17471
17978
|
}
|
|
17472
17979
|
),
|
|
17473
|
-
/* @__PURE__ */
|
|
17980
|
+
/* @__PURE__ */ jsx178(
|
|
17474
17981
|
AirbnbInput,
|
|
17475
17982
|
{
|
|
17476
17983
|
id: inputId,
|
|
@@ -17502,7 +18009,7 @@ var AirbnbPhoneField = React71.forwardRef(
|
|
|
17502
18009
|
}
|
|
17503
18010
|
)
|
|
17504
18011
|
] }),
|
|
17505
|
-
error && /* @__PURE__ */
|
|
18012
|
+
error && /* @__PURE__ */ jsx178(FieldErrorMessage, { message: error })
|
|
17506
18013
|
] });
|
|
17507
18014
|
}
|
|
17508
18015
|
);
|
|
@@ -17512,8 +18019,8 @@ AirbnbPhoneField.displayName = "AirbnbPhoneField";
|
|
|
17512
18019
|
import * as React72 from "react";
|
|
17513
18020
|
import { ChevronDown as ChevronDown6, Search as Search3 } from "lucide-react";
|
|
17514
18021
|
import { useVirtualizer as useVirtualizer3 } from "@tanstack/react-virtual";
|
|
17515
|
-
import { useCallback as
|
|
17516
|
-
import { jsx as
|
|
18022
|
+
import { useCallback as useCallback49 } from "react";
|
|
18023
|
+
import { jsx as jsx179, jsxs as jsxs119 } from "react/jsx-runtime";
|
|
17517
18024
|
var ROW_HEIGHT = 48;
|
|
17518
18025
|
var DESKTOP_LIST_HEIGHT = 280;
|
|
17519
18026
|
var MOBILE_LIST_HEIGHT = 420;
|
|
@@ -17553,7 +18060,7 @@ var AirbnbSearchableSelectInternal = ({
|
|
|
17553
18060
|
noOptionsMessage,
|
|
17554
18061
|
loadingMessage
|
|
17555
18062
|
}, ref) => {
|
|
17556
|
-
const { isMatch:
|
|
18063
|
+
const { isMatch: isMobile3 } = useScreenResize(DEVICE.mobileXL);
|
|
17557
18064
|
const reactId = React72.useId();
|
|
17558
18065
|
const [open, setOpen] = React72.useState(false);
|
|
17559
18066
|
const [internalSearchValue, setInternalSearchValue] = React72.useState("");
|
|
@@ -17588,10 +18095,10 @@ var AirbnbSearchableSelectInternal = ({
|
|
|
17588
18095
|
useOutsideClick({
|
|
17589
18096
|
elementRef: containerRef,
|
|
17590
18097
|
onOutsideClick: () => closeSelect(),
|
|
17591
|
-
isDisabled: !open ||
|
|
18098
|
+
isDisabled: !open || isMobile3
|
|
17592
18099
|
});
|
|
17593
18100
|
const handleOnOpenChange = useEvent(onOpenChange);
|
|
17594
|
-
const setSelectOpen =
|
|
18101
|
+
const setSelectOpen = useCallback49(
|
|
17595
18102
|
(nextOpen, options2) => {
|
|
17596
18103
|
setOpen(nextOpen);
|
|
17597
18104
|
handleOnOpenChange?.(nextOpen);
|
|
@@ -17682,7 +18189,7 @@ var AirbnbSearchableSelectInternal = ({
|
|
|
17682
18189
|
}
|
|
17683
18190
|
}
|
|
17684
18191
|
}
|
|
17685
|
-
const content = /* @__PURE__ */
|
|
18192
|
+
const content = /* @__PURE__ */ jsx179(
|
|
17686
18193
|
AirbnbSearchableSelectContent,
|
|
17687
18194
|
{
|
|
17688
18195
|
inputId: searchInputId,
|
|
@@ -17701,7 +18208,7 @@ var AirbnbSearchableSelectInternal = ({
|
|
|
17701
18208
|
menuClassName,
|
|
17702
18209
|
noOptionsMessage,
|
|
17703
18210
|
loadingMessage,
|
|
17704
|
-
height:
|
|
18211
|
+
height: isMobile3 ? MOBILE_LIST_HEIGHT : DESKTOP_LIST_HEIGHT,
|
|
17705
18212
|
idPrefix: reactId,
|
|
17706
18213
|
onSearchChange: handleSearchChange,
|
|
17707
18214
|
onSearchKeyDown: handleSearchKeyDown,
|
|
@@ -17710,9 +18217,9 @@ var AirbnbSearchableSelectInternal = ({
|
|
|
17710
18217
|
}
|
|
17711
18218
|
);
|
|
17712
18219
|
React72.useImperativeHandle(ref, () => triggerRef.current, []);
|
|
17713
|
-
return /* @__PURE__ */
|
|
17714
|
-
name && /* @__PURE__ */
|
|
17715
|
-
/* @__PURE__ */
|
|
18220
|
+
return /* @__PURE__ */ jsxs119("div", { ref: containerRef, className: cn("relative w-full max-w-[425px]", className), children: [
|
|
18221
|
+
name && /* @__PURE__ */ jsx179("input", { type: "hidden", name, value: value ? String(value.value) : "" }),
|
|
18222
|
+
/* @__PURE__ */ jsx179(
|
|
17716
18223
|
AirbnbFieldTrigger,
|
|
17717
18224
|
{
|
|
17718
18225
|
id: `${reactId}-trigger`,
|
|
@@ -17747,7 +18254,7 @@ var AirbnbSearchableSelectInternal = ({
|
|
|
17747
18254
|
},
|
|
17748
18255
|
onKeyDown: handleTriggerKeyDown,
|
|
17749
18256
|
onBlur,
|
|
17750
|
-
trailingAdornment: /* @__PURE__ */
|
|
18257
|
+
trailingAdornment: /* @__PURE__ */ jsx179(
|
|
17751
18258
|
ChevronDown6,
|
|
17752
18259
|
{
|
|
17753
18260
|
className: cn(
|
|
@@ -17758,7 +18265,7 @@ var AirbnbSearchableSelectInternal = ({
|
|
|
17758
18265
|
)
|
|
17759
18266
|
}
|
|
17760
18267
|
),
|
|
17761
|
-
|
|
18268
|
+
isMobile3 ? /* @__PURE__ */ jsx179(
|
|
17762
18269
|
Drawer,
|
|
17763
18270
|
{
|
|
17764
18271
|
open,
|
|
@@ -17770,13 +18277,13 @@ var AirbnbSearchableSelectInternal = ({
|
|
|
17770
18277
|
}
|
|
17771
18278
|
closeSelect();
|
|
17772
18279
|
},
|
|
17773
|
-
children: /* @__PURE__ */
|
|
17774
|
-
/* @__PURE__ */
|
|
17775
|
-
/* @__PURE__ */
|
|
17776
|
-
/* @__PURE__ */
|
|
18280
|
+
children: /* @__PURE__ */ jsxs119(DrawerContent, { onClose: closeSelect, lockScroll: false, children: [
|
|
18281
|
+
/* @__PURE__ */ jsx179(DrawerTitle, { className: "sr-only", children: mobileTitle ?? label }),
|
|
18282
|
+
/* @__PURE__ */ jsx179(DrawerDescription, { className: "sr-only", children: label }),
|
|
18283
|
+
/* @__PURE__ */ jsx179("div", { className: "px-5 pb-5 pt-1", children: content })
|
|
17777
18284
|
] })
|
|
17778
18285
|
}
|
|
17779
|
-
) : open ? /* @__PURE__ */
|
|
18286
|
+
) : open ? /* @__PURE__ */ jsx179(
|
|
17780
18287
|
"div",
|
|
17781
18288
|
{
|
|
17782
18289
|
className: cn(
|
|
@@ -17843,16 +18350,16 @@ function AirbnbSearchableSelectContent({
|
|
|
17843
18350
|
virtualizer.scrollToIndex(highlightedIndex, { align: "auto" });
|
|
17844
18351
|
}
|
|
17845
18352
|
}, [highlightedIndex, virtualizer]);
|
|
17846
|
-
return /* @__PURE__ */
|
|
17847
|
-
/* @__PURE__ */
|
|
17848
|
-
/* @__PURE__ */
|
|
18353
|
+
return /* @__PURE__ */ jsxs119("div", { className: "p-2", children: [
|
|
18354
|
+
/* @__PURE__ */ jsxs119("div", { className: "relative mb-2", children: [
|
|
18355
|
+
/* @__PURE__ */ jsx179(
|
|
17849
18356
|
Search3,
|
|
17850
18357
|
{
|
|
17851
18358
|
"aria-hidden": "true",
|
|
17852
18359
|
className: "absolute left-4 top-1/2 h-5 w-5 -translate-y-1/2 text-[#9696B9]"
|
|
17853
18360
|
}
|
|
17854
18361
|
),
|
|
17855
|
-
/* @__PURE__ */
|
|
18362
|
+
/* @__PURE__ */ jsx179(
|
|
17856
18363
|
"input",
|
|
17857
18364
|
{
|
|
17858
18365
|
id: inputId,
|
|
@@ -17871,7 +18378,7 @@ function AirbnbSearchableSelectContent({
|
|
|
17871
18378
|
}
|
|
17872
18379
|
)
|
|
17873
18380
|
] }),
|
|
17874
|
-
loading && options.length === 0 ? /* @__PURE__ */
|
|
18381
|
+
loading && options.length === 0 ? /* @__PURE__ */ jsx179("div", { className: "px-4 py-5 text-center text-base leading-6 text-[#6C6C6C]", children: loadingText }) : options.length === 0 ? /* @__PURE__ */ jsx179("div", { className: "px-4 py-5 text-center text-base leading-6 text-[#6C6C6C]", children: emptyMessage }) : /* @__PURE__ */ jsx179(
|
|
17875
18382
|
"div",
|
|
17876
18383
|
{
|
|
17877
18384
|
id: listboxId,
|
|
@@ -17880,7 +18387,7 @@ function AirbnbSearchableSelectContent({
|
|
|
17880
18387
|
"aria-labelledby": labelId,
|
|
17881
18388
|
className: cn("overflow-y-auto outline-none", menuClassName),
|
|
17882
18389
|
style: { height: Math.min(height, rowCount * ROW_HEIGHT) },
|
|
17883
|
-
children: /* @__PURE__ */
|
|
18390
|
+
children: /* @__PURE__ */ jsx179(
|
|
17884
18391
|
"div",
|
|
17885
18392
|
{
|
|
17886
18393
|
className: "relative w-full",
|
|
@@ -17888,7 +18395,7 @@ function AirbnbSearchableSelectContent({
|
|
|
17888
18395
|
children: virtualItems.map((virtualItem) => {
|
|
17889
18396
|
const option = options[virtualItem.index];
|
|
17890
18397
|
if (!option) {
|
|
17891
|
-
return /* @__PURE__ */
|
|
18398
|
+
return /* @__PURE__ */ jsx179(
|
|
17892
18399
|
"div",
|
|
17893
18400
|
{
|
|
17894
18401
|
className: "absolute left-0 top-0 flex w-full items-center px-4 text-base leading-6 text-[#6C6C6C]",
|
|
@@ -17903,7 +18410,7 @@ function AirbnbSearchableSelectContent({
|
|
|
17903
18410
|
}
|
|
17904
18411
|
const isSelected = value?.value === option.value;
|
|
17905
18412
|
const isHighlighted = virtualItem.index === highlightedIndex;
|
|
17906
|
-
return /* @__PURE__ */
|
|
18413
|
+
return /* @__PURE__ */ jsx179(
|
|
17907
18414
|
"button",
|
|
17908
18415
|
{
|
|
17909
18416
|
id: getOptionId(idPrefix, virtualItem.index),
|
|
@@ -17925,7 +18432,7 @@ function AirbnbSearchableSelectContent({
|
|
|
17925
18432
|
height: `${virtualItem.size}px`,
|
|
17926
18433
|
transform: `translateY(${virtualItem.start}px)`
|
|
17927
18434
|
},
|
|
17928
|
-
children: /* @__PURE__ */
|
|
18435
|
+
children: /* @__PURE__ */ jsx179("span", { className: "truncate text-center", children: String(option.label) })
|
|
17929
18436
|
},
|
|
17930
18437
|
`${String(option.value)}-${virtualItem.index}`
|
|
17931
18438
|
);
|
|
@@ -17955,15 +18462,15 @@ function getNextEnabledIndex(options, startIndex, step) {
|
|
|
17955
18462
|
|
|
17956
18463
|
// src/airbnb-fields/search-input/SearchInput.tsx
|
|
17957
18464
|
import * as React73 from "react";
|
|
17958
|
-
import { useTranslation as
|
|
18465
|
+
import { useTranslation as useTranslation40 } from "react-i18next";
|
|
17959
18466
|
import { Search as Search4, X as X10 } from "lucide-react";
|
|
17960
|
-
import { jsx as
|
|
18467
|
+
import { jsx as jsx180, jsxs as jsxs120 } from "react/jsx-runtime";
|
|
17961
18468
|
var AirbnbSearchInput = React73.forwardRef(({ onReset, placeholder, wrapperClassName, ...props }, ref) => {
|
|
17962
|
-
const { t } =
|
|
18469
|
+
const { t } = useTranslation40();
|
|
17963
18470
|
const placeholderText = placeholder || t("search_property") + "...";
|
|
17964
|
-
return /* @__PURE__ */
|
|
17965
|
-
/* @__PURE__ */
|
|
17966
|
-
/* @__PURE__ */
|
|
18471
|
+
return /* @__PURE__ */ jsxs120("div", { className: cn("input-wrapper relative", wrapperClassName), children: [
|
|
18472
|
+
/* @__PURE__ */ jsx180(Search4, { className: "absolute left-4 top-1/2 h-5 w-5 -translate-y-1/2 transform text-[#9696B9]" }),
|
|
18473
|
+
/* @__PURE__ */ jsx180(
|
|
17967
18474
|
"input",
|
|
17968
18475
|
{
|
|
17969
18476
|
...props,
|
|
@@ -17982,13 +18489,13 @@ var AirbnbSearchInput = React73.forwardRef(({ onReset, placeholder, wrapperClass
|
|
|
17982
18489
|
)
|
|
17983
18490
|
}
|
|
17984
18491
|
),
|
|
17985
|
-
onReset && /* @__PURE__ */
|
|
18492
|
+
onReset && /* @__PURE__ */ jsx180(
|
|
17986
18493
|
Button,
|
|
17987
18494
|
{
|
|
17988
18495
|
variant: "ghost",
|
|
17989
18496
|
onClick: onReset,
|
|
17990
18497
|
className: "absolute right-0 top-1/2 h-5 w-5 -translate-y-1/2 transform text-[#9696B9]",
|
|
17991
|
-
children: /* @__PURE__ */
|
|
18498
|
+
children: /* @__PURE__ */ jsx180(X10, { className: "h-5 w-5" })
|
|
17992
18499
|
}
|
|
17993
18500
|
)
|
|
17994
18501
|
] });
|
|
@@ -18168,6 +18675,7 @@ export {
|
|
|
18168
18675
|
LegacyTextarea,
|
|
18169
18676
|
Link,
|
|
18170
18677
|
LoadingBar,
|
|
18678
|
+
MobileWebcam,
|
|
18171
18679
|
Modal,
|
|
18172
18680
|
ModalButton,
|
|
18173
18681
|
ModalLoader,
|