@chekinapp/ui 0.0.92 → 0.0.94
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 +1122 -611
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +140 -12
- package/dist/index.d.ts +140 -12
- package/dist/index.js +1103 -588
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
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,623 @@ 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(
|
|
10820
|
+
new Error(
|
|
10821
|
+
"Unable to process the selected image. Please try a different image."
|
|
10822
|
+
)
|
|
10823
|
+
);
|
|
10824
|
+
return;
|
|
10825
|
+
}
|
|
10826
|
+
reject(error);
|
|
10827
|
+
}
|
|
10828
|
+
});
|
|
10829
|
+
});
|
|
10744
10830
|
}
|
|
10745
10831
|
|
|
10746
|
-
// src/webcam/
|
|
10747
|
-
import {
|
|
10748
|
-
|
|
10749
|
-
|
|
10750
|
-
|
|
10751
|
-
|
|
10752
|
-
|
|
10753
|
-
height: { ideal: 2160 }
|
|
10754
|
-
}
|
|
10755
|
-
};
|
|
10832
|
+
// src/webcam/useErrorHandler.ts
|
|
10833
|
+
import { useCallback as useCallback26 } from "react";
|
|
10834
|
+
import { useTranslation as useTranslation23 } from "react-i18next";
|
|
10835
|
+
import { isSafari as isSafari2 } from "react-device-detect";
|
|
10836
|
+
|
|
10837
|
+
// src/webcam/utils.ts
|
|
10838
|
+
import { isMobile, isSafari, isTablet } from "react-device-detect";
|
|
10756
10839
|
var isMobileOrTablet = () => isMobile || isTablet;
|
|
10757
|
-
|
|
10840
|
+
var getLivenessOptimizedConstraints = (deviceId, additional) => {
|
|
10841
|
+
const additionalConstraints = typeof additional === "object" && additional !== null ? additional : {};
|
|
10842
|
+
const baseConstraints = {
|
|
10843
|
+
deviceId: deviceId ? { exact: deviceId } : void 0,
|
|
10844
|
+
facingMode: { ideal: "user" },
|
|
10845
|
+
width: { min: 320, ideal: 800 },
|
|
10846
|
+
height: { min: 240, ideal: 600 },
|
|
10847
|
+
frameRate: { ideal: 24 },
|
|
10848
|
+
resizeMode: "crop-and-scale",
|
|
10849
|
+
aspectRatio: { ideal: 1.333 },
|
|
10850
|
+
...additionalConstraints
|
|
10851
|
+
};
|
|
10758
10852
|
if (isMobileOrTablet()) {
|
|
10759
10853
|
return {
|
|
10760
|
-
|
|
10761
|
-
|
|
10762
|
-
|
|
10763
|
-
|
|
10764
|
-
}
|
|
10854
|
+
...baseConstraints,
|
|
10855
|
+
width: { min: 320, ideal: 640 },
|
|
10856
|
+
height: { min: 240, ideal: 480 },
|
|
10857
|
+
aspectRatio: { ideal: 1 },
|
|
10858
|
+
facingMode: { ideal: "environment" },
|
|
10859
|
+
...additionalConstraints
|
|
10765
10860
|
};
|
|
10766
10861
|
}
|
|
10862
|
+
return baseConstraints;
|
|
10863
|
+
};
|
|
10864
|
+
function getReducedVideoConstraints({
|
|
10865
|
+
deviceId,
|
|
10866
|
+
facingMode,
|
|
10867
|
+
additional
|
|
10868
|
+
}) {
|
|
10869
|
+
const additionalConstraints = typeof additional === "object" ? additional : {};
|
|
10767
10870
|
return {
|
|
10768
|
-
|
|
10871
|
+
deviceId: deviceId ? { exact: deviceId } : void 0,
|
|
10872
|
+
facingMode: { ideal: facingMode || "user" },
|
|
10873
|
+
width: { min: 320, ideal: 640 },
|
|
10874
|
+
height: { min: 240, ideal: 480 },
|
|
10875
|
+
...additionalConstraints
|
|
10769
10876
|
};
|
|
10770
10877
|
}
|
|
10771
|
-
|
|
10772
|
-
|
|
10773
|
-
|
|
10774
|
-
|
|
10775
|
-
|
|
10776
|
-
|
|
10777
|
-
|
|
10778
|
-
|
|
10779
|
-
|
|
10780
|
-
|
|
10781
|
-
|
|
10782
|
-
|
|
10783
|
-
|
|
10784
|
-
|
|
10785
|
-
|
|
10786
|
-
|
|
10787
|
-
|
|
10788
|
-
|
|
10789
|
-
|
|
10878
|
+
function getMobileOrDesktopVideoConstraints({
|
|
10879
|
+
deviceId,
|
|
10880
|
+
facingMode,
|
|
10881
|
+
additional,
|
|
10882
|
+
optimizedForLiveness = false
|
|
10883
|
+
}) {
|
|
10884
|
+
const additionalConstraints = typeof additional === "object" ? additional : {};
|
|
10885
|
+
if (optimizedForLiveness) {
|
|
10886
|
+
return getLivenessOptimizedConstraints(deviceId, additionalConstraints);
|
|
10887
|
+
}
|
|
10888
|
+
const initialConstraints = {
|
|
10889
|
+
deviceId: deviceId ? { exact: deviceId } : void 0,
|
|
10890
|
+
facingMode: { ideal: facingMode || "user" },
|
|
10891
|
+
width: isSafari ? { min: 320, ideal: 1920 } : { min: 320, ideal: 4096, max: 4096 },
|
|
10892
|
+
height: isSafari ? { min: 240, ideal: 1080 } : { min: 240, ideal: 2160, max: 2160 },
|
|
10893
|
+
frameRate: { ideal: 30 },
|
|
10894
|
+
resizeMode: "none",
|
|
10895
|
+
aspectRatio: { ideal: 1.777 },
|
|
10896
|
+
...additionalConstraints
|
|
10897
|
+
};
|
|
10898
|
+
if (isMobileOrTablet()) {
|
|
10899
|
+
return {
|
|
10900
|
+
...initialConstraints,
|
|
10901
|
+
aspectRatio: { ideal: 1 },
|
|
10902
|
+
facingMode: { ideal: "environment" },
|
|
10903
|
+
...additionalConstraints
|
|
10904
|
+
};
|
|
10905
|
+
}
|
|
10906
|
+
if (isSafari && !isMobile) {
|
|
10907
|
+
return {
|
|
10908
|
+
deviceId: deviceId ? { ideal: deviceId } : void 0,
|
|
10909
|
+
width: { min: 320, ideal: 1920 },
|
|
10910
|
+
height: { min: 240, ideal: 1080 },
|
|
10911
|
+
...additionalConstraints
|
|
10912
|
+
};
|
|
10913
|
+
}
|
|
10914
|
+
return initialConstraints;
|
|
10915
|
+
}
|
|
10916
|
+
function isDOMException(error) {
|
|
10917
|
+
return error instanceof DOMException && Boolean(error?.name);
|
|
10918
|
+
}
|
|
10919
|
+
function getPhotoCanvas({
|
|
10920
|
+
player,
|
|
10921
|
+
container,
|
|
10922
|
+
scanArea,
|
|
10923
|
+
canvas,
|
|
10924
|
+
cropToScanArea
|
|
10925
|
+
}) {
|
|
10926
|
+
if (!canvas) return;
|
|
10927
|
+
const playerWidth = player?.videoWidth ?? 1280;
|
|
10928
|
+
const playerHeight = player?.videoHeight ?? 720;
|
|
10929
|
+
const playerAR = playerWidth / playerHeight;
|
|
10930
|
+
const canvasWidth = container?.offsetWidth ?? 1280;
|
|
10931
|
+
const canvasHeight = container?.offsetHeight ?? 1280;
|
|
10932
|
+
const canvasAR = canvasWidth / canvasHeight;
|
|
10933
|
+
let sourceX;
|
|
10934
|
+
let sourceY;
|
|
10935
|
+
let sourceWidth;
|
|
10936
|
+
let sourceHeight;
|
|
10937
|
+
if (playerAR > canvasAR) {
|
|
10938
|
+
sourceHeight = playerHeight;
|
|
10939
|
+
sourceWidth = playerHeight * canvasAR;
|
|
10940
|
+
sourceX = (playerWidth - sourceWidth) / 2;
|
|
10941
|
+
sourceY = 0;
|
|
10942
|
+
} else {
|
|
10943
|
+
sourceWidth = playerWidth;
|
|
10944
|
+
sourceHeight = playerWidth / canvasAR;
|
|
10945
|
+
sourceX = 0;
|
|
10946
|
+
sourceY = (playerHeight - sourceHeight) / 2;
|
|
10947
|
+
}
|
|
10948
|
+
if (cropToScanArea && scanArea && player) {
|
|
10949
|
+
const scanAreaRect = scanArea.getBoundingClientRect();
|
|
10950
|
+
const scaleY = playerHeight / player.clientHeight;
|
|
10951
|
+
const offsetX = (playerWidth - player.clientWidth * scaleY) / 2;
|
|
10952
|
+
const offsetY = (playerHeight - player.clientHeight * scaleY) / 2;
|
|
10953
|
+
const cropX = offsetX + (player.clientWidth - scanAreaRect.width) / 2 * scaleY;
|
|
10954
|
+
const cropY = offsetY + (player.clientHeight - scanAreaRect.height) / 2 * scaleY;
|
|
10955
|
+
const cropWidth = scanAreaRect.width * scaleY;
|
|
10956
|
+
const cropHeight = scanAreaRect.height * scaleY;
|
|
10957
|
+
canvas.width = cropWidth;
|
|
10958
|
+
canvas.height = cropHeight;
|
|
10959
|
+
const context2 = canvas.getContext("2d");
|
|
10960
|
+
if (context2) {
|
|
10961
|
+
context2.drawImage(
|
|
10962
|
+
player,
|
|
10963
|
+
cropX,
|
|
10964
|
+
cropY,
|
|
10965
|
+
cropWidth,
|
|
10966
|
+
cropHeight,
|
|
10967
|
+
0,
|
|
10968
|
+
0,
|
|
10969
|
+
cropWidth,
|
|
10970
|
+
cropHeight
|
|
10971
|
+
);
|
|
10972
|
+
}
|
|
10973
|
+
return canvas;
|
|
10974
|
+
}
|
|
10975
|
+
canvas.width = sourceWidth;
|
|
10976
|
+
canvas.height = sourceHeight;
|
|
10977
|
+
const context = canvas.getContext("2d");
|
|
10978
|
+
if (context && player) {
|
|
10979
|
+
context.drawImage(
|
|
10980
|
+
player,
|
|
10981
|
+
sourceX,
|
|
10982
|
+
sourceY,
|
|
10983
|
+
sourceWidth,
|
|
10984
|
+
sourceHeight,
|
|
10985
|
+
0,
|
|
10986
|
+
0,
|
|
10987
|
+
sourceWidth,
|
|
10988
|
+
sourceHeight
|
|
10790
10989
|
);
|
|
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
|
-
|
|
10990
|
+
}
|
|
10991
|
+
return canvas;
|
|
10992
|
+
}
|
|
10993
|
+
|
|
10994
|
+
// src/webcam/useErrorHandler.ts
|
|
10995
|
+
var GET_USER_MEDIA_ERROR = "getUserMedia is not implemented in this browser";
|
|
10996
|
+
function useErrorHandler({ onError }) {
|
|
10997
|
+
const { t } = useTranslation23();
|
|
10998
|
+
const handleError = useEvent(onError);
|
|
10999
|
+
const handleUserMediaError = useCallback26(
|
|
11000
|
+
(error) => {
|
|
11001
|
+
console.error(error);
|
|
11002
|
+
let errorText = "";
|
|
11003
|
+
if (error?.message === GET_USER_MEDIA_ERROR) {
|
|
11004
|
+
errorText = t("camera_errors.chekin_cant_use_your_camera");
|
|
11005
|
+
handleError({
|
|
11006
|
+
title: errorText,
|
|
11007
|
+
message: t("camera_errors.please_try_a_different_browser")
|
|
11008
|
+
});
|
|
11009
|
+
} else if (isDOMException(error)) {
|
|
11010
|
+
switch (error.name) {
|
|
11011
|
+
case "PermissionDeniedError":
|
|
11012
|
+
case "NotAllowedError":
|
|
11013
|
+
errorText = `${t("camera_errors.permissions_denied")}. ${t(
|
|
11014
|
+
"camera_errors.camera_permissions_denied"
|
|
11015
|
+
)}`;
|
|
11016
|
+
toast2.error(errorText);
|
|
11017
|
+
break;
|
|
11018
|
+
case "NotFoundError":
|
|
11019
|
+
errorText = t("camera_errors.no_camera_device_found");
|
|
11020
|
+
toast2.error(errorText);
|
|
11021
|
+
break;
|
|
11022
|
+
case "NotReadableError":
|
|
11023
|
+
case "AbortError":
|
|
11024
|
+
errorText = t("camera_errors.chekin_cant_use_your_camera");
|
|
11025
|
+
handleError({
|
|
11026
|
+
title: errorText,
|
|
11027
|
+
message: `${t("close_other_application_that_may_be_using_your_camera")}.
|
|
11028
|
+
${t("if_you_use_external_camera_disconnect_and_reconnect")}.
|
|
11029
|
+
${t("close_the_browser_re_open_it")}.`
|
|
11030
|
+
});
|
|
11031
|
+
break;
|
|
11032
|
+
case "OverconstrainedError":
|
|
11033
|
+
errorText = t("camera_errors.constraints_camera_error");
|
|
11034
|
+
if (isSafari2) {
|
|
11035
|
+
handleError({
|
|
11036
|
+
title: errorText,
|
|
11037
|
+
message: `${t("camera_errors.safari_camera_error")}. ${t(
|
|
11038
|
+
"camera_errors.try_chrome_or_firefox"
|
|
11039
|
+
)}.`
|
|
11040
|
+
});
|
|
11041
|
+
} else {
|
|
11042
|
+
toast2.error(errorText);
|
|
10819
11043
|
}
|
|
10820
|
-
|
|
10821
|
-
|
|
10822
|
-
|
|
10823
|
-
|
|
11044
|
+
break;
|
|
11045
|
+
default:
|
|
11046
|
+
errorText = t("camera_errors.chekin_cant_use_your_camera");
|
|
11047
|
+
handleError({
|
|
11048
|
+
title: errorText,
|
|
11049
|
+
message: `${t("camera_errors.please_try_a_different_browser")} ${error}`
|
|
11050
|
+
});
|
|
10824
11051
|
}
|
|
11052
|
+
} else {
|
|
11053
|
+
errorText = t("camera_errors.chekin_cant_use_your_camera");
|
|
11054
|
+
handleError({
|
|
11055
|
+
title: errorText,
|
|
11056
|
+
message: `${t("camera_errors.please_try_a_different_browser")} ${error}`
|
|
11057
|
+
});
|
|
10825
11058
|
}
|
|
10826
|
-
},
|
|
10827
|
-
|
|
10828
|
-
|
|
10829
|
-
|
|
10830
|
-
|
|
10831
|
-
|
|
10832
|
-
|
|
11059
|
+
},
|
|
11060
|
+
[handleError, t]
|
|
11061
|
+
);
|
|
11062
|
+
return { handleUserMediaError };
|
|
11063
|
+
}
|
|
11064
|
+
|
|
11065
|
+
// src/webcam/Webcam.tsx
|
|
11066
|
+
import { Fragment as Fragment13, jsx as jsx136, jsxs as jsxs84 } from "react/jsx-runtime";
|
|
11067
|
+
var SCREENSHOT_FORMAT = "image/jpeg";
|
|
11068
|
+
var mirroredTransformStyle = { transform: "rotateY(180deg)" };
|
|
11069
|
+
var Webcam = memo7(
|
|
11070
|
+
forwardRef54(
|
|
11071
|
+
({
|
|
11072
|
+
onUserMedia,
|
|
11073
|
+
onDisabled,
|
|
11074
|
+
imageSmoothing,
|
|
11075
|
+
videoConstraints,
|
|
11076
|
+
additionalConstraints,
|
|
11077
|
+
hideScanArea,
|
|
11078
|
+
roundedScanArea,
|
|
11079
|
+
cropToScanArea,
|
|
11080
|
+
className,
|
|
11081
|
+
mirrored,
|
|
11082
|
+
children,
|
|
11083
|
+
isLoading,
|
|
11084
|
+
placeholderImage,
|
|
11085
|
+
screenshotMaxSize,
|
|
11086
|
+
minScreenshotH,
|
|
11087
|
+
minScreenshotW,
|
|
11088
|
+
videoSourceDeviceId,
|
|
11089
|
+
screenshotQuality = 1,
|
|
11090
|
+
compression,
|
|
11091
|
+
onError,
|
|
11092
|
+
...props
|
|
11093
|
+
}, ref) => {
|
|
11094
|
+
const [minScreenshotHeight, setMinScreenshotHeight] = useState35();
|
|
11095
|
+
const [minScreenshotWidth, setMinScreenshotWidth] = useState35();
|
|
11096
|
+
const [useReducedConstraints, setUseReducedConstraints] = useState35(false);
|
|
11097
|
+
const [numberOfCameras, setNumberOfCameras] = useState35(0);
|
|
11098
|
+
const constraints = useMemo7(() => {
|
|
11099
|
+
if (videoConstraints) {
|
|
11100
|
+
return videoConstraints;
|
|
10833
11101
|
}
|
|
10834
|
-
|
|
10835
|
-
|
|
10836
|
-
|
|
10837
|
-
|
|
10838
|
-
|
|
10839
|
-
|
|
11102
|
+
if (useReducedConstraints) {
|
|
11103
|
+
return getReducedVideoConstraints({
|
|
11104
|
+
deviceId: videoSourceDeviceId,
|
|
11105
|
+
additional: additionalConstraints
|
|
11106
|
+
});
|
|
11107
|
+
}
|
|
11108
|
+
return getMobileOrDesktopVideoConstraints({
|
|
11109
|
+
deviceId: videoSourceDeviceId,
|
|
11110
|
+
additional: additionalConstraints
|
|
11111
|
+
});
|
|
11112
|
+
}, [
|
|
11113
|
+
additionalConstraints,
|
|
11114
|
+
useReducedConstraints,
|
|
11115
|
+
videoConstraints,
|
|
11116
|
+
videoSourceDeviceId
|
|
11117
|
+
]);
|
|
11118
|
+
const isMirroredInCSS = mirrored === void 0 && !isMobileOrTablet();
|
|
11119
|
+
const webcamRef = useRef25(null);
|
|
11120
|
+
const scanAreaRef = useRef25(null);
|
|
11121
|
+
const canvasRef = useRef25(null);
|
|
11122
|
+
const containerRef = useRef25(null);
|
|
11123
|
+
const { handleUserMediaError } = useErrorHandler({
|
|
11124
|
+
onError: (errorDetails) => {
|
|
11125
|
+
onDisabled?.(true);
|
|
11126
|
+
onError(errorDetails);
|
|
11127
|
+
}
|
|
11128
|
+
});
|
|
11129
|
+
const handleUserMediaErrorWithFallback = useCallback27(
|
|
11130
|
+
(error) => {
|
|
11131
|
+
if (error instanceof DOMException && error.name === "OverconstrainedError" && !useReducedConstraints && !videoConstraints) {
|
|
11132
|
+
console.warn("Camera constraints failed, trying reduced constraints:", error);
|
|
11133
|
+
setUseReducedConstraints(true);
|
|
11134
|
+
return;
|
|
11135
|
+
}
|
|
11136
|
+
handleUserMediaError(error);
|
|
11137
|
+
},
|
|
11138
|
+
[handleUserMediaError, useReducedConstraints, videoConstraints]
|
|
11139
|
+
);
|
|
11140
|
+
const compressImage2 = async (canvas) => {
|
|
11141
|
+
if (!canvas) return;
|
|
11142
|
+
const blobImage = await getCanvasBlob(canvas);
|
|
11143
|
+
if (!blobImage) return;
|
|
11144
|
+
const compressedFile = await compressFile(blobImage, {
|
|
11145
|
+
convertSize: screenshotMaxSize
|
|
11146
|
+
});
|
|
11147
|
+
console.log(
|
|
11148
|
+
"Before: ",
|
|
11149
|
+
getFileSizeMB(blobImage)?.toFixed(2),
|
|
11150
|
+
"MB",
|
|
11151
|
+
"After: ",
|
|
11152
|
+
getFileSizeMB(compressedFile)?.toFixed(2),
|
|
11153
|
+
"MB"
|
|
11154
|
+
);
|
|
11155
|
+
return toBase64(compressedFile);
|
|
11156
|
+
};
|
|
11157
|
+
const handleTakePhoto = () => {
|
|
11158
|
+
const takenPhotoCanvas = getPhotoCanvas({
|
|
11159
|
+
player: webcamRef.current?.video,
|
|
11160
|
+
container: containerRef.current,
|
|
11161
|
+
canvas: canvasRef.current,
|
|
11162
|
+
scanArea: scanAreaRef.current,
|
|
11163
|
+
cropToScanArea
|
|
11164
|
+
});
|
|
11165
|
+
if (!takenPhotoCanvas) return;
|
|
11166
|
+
if (compression) return compressImage2(takenPhotoCanvas);
|
|
11167
|
+
return Promise.resolve(
|
|
11168
|
+
takenPhotoCanvas.toDataURL(SCREENSHOT_FORMAT, screenshotQuality)
|
|
11169
|
+
);
|
|
11170
|
+
};
|
|
11171
|
+
useImperativeHandle(
|
|
11172
|
+
ref,
|
|
11173
|
+
() => ({
|
|
11174
|
+
takePhoto: handleTakePhoto,
|
|
11175
|
+
numberOfCameras,
|
|
11176
|
+
...webcamRef.current
|
|
11177
|
+
})
|
|
11178
|
+
);
|
|
11179
|
+
const handleUserMediaSuccess = useCallback27(
|
|
11180
|
+
(stream) => {
|
|
11181
|
+
if (!isMobile2) {
|
|
11182
|
+
const track = stream.getVideoTracks()[0];
|
|
11183
|
+
const capabilities = !isFirefox && track?.getCapabilities();
|
|
11184
|
+
if (capabilities) {
|
|
11185
|
+
setMinScreenshotHeight(capabilities.height?.max);
|
|
11186
|
+
setMinScreenshotWidth(capabilities.width?.max);
|
|
11187
|
+
}
|
|
11188
|
+
} else {
|
|
11189
|
+
setMinScreenshotWidth(minScreenshotW);
|
|
11190
|
+
setMinScreenshotHeight(minScreenshotH);
|
|
11191
|
+
}
|
|
11192
|
+
navigator.mediaDevices.enumerateDevices().then((devices) => {
|
|
11193
|
+
setNumberOfCameras(
|
|
11194
|
+
devices.filter((device) => device.kind === "videoinput").length
|
|
11195
|
+
);
|
|
11196
|
+
}).catch((error) => {
|
|
11197
|
+
console.warn("Failed to enumerate devices:", error);
|
|
11198
|
+
setNumberOfCameras(1);
|
|
11199
|
+
});
|
|
11200
|
+
onUserMedia?.();
|
|
11201
|
+
},
|
|
11202
|
+
[minScreenshotH, minScreenshotW, onUserMedia]
|
|
11203
|
+
);
|
|
11204
|
+
return /* @__PURE__ */ jsxs84(
|
|
10840
11205
|
"div",
|
|
10841
11206
|
{
|
|
11207
|
+
ref: containerRef,
|
|
10842
11208
|
className: cn(
|
|
10843
|
-
|
|
10844
|
-
|
|
10845
|
-
|
|
11209
|
+
className,
|
|
11210
|
+
"webcam relative z-[1] mx-auto flex h-[222px] w-[332px] items-center justify-center overflow-hidden rounded-[6px] text-center",
|
|
11211
|
+
"kiosko:h-[620px] kiosko:max-h-[620px] kiosko:w-[890px] kiosko:max-w-[890px]"
|
|
10846
11212
|
),
|
|
10847
|
-
|
|
10848
|
-
|
|
11213
|
+
style: isMirroredInCSS ? mirroredTransformStyle : void 0,
|
|
11214
|
+
children: [
|
|
11215
|
+
!hideScanArea && /* @__PURE__ */ jsxs84(
|
|
11216
|
+
"div",
|
|
11217
|
+
{
|
|
11218
|
+
ref: scanAreaRef,
|
|
11219
|
+
className: cn(
|
|
11220
|
+
"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%)]",
|
|
11221
|
+
"h-[200px] rounded-[15px] min-[479px]:h-[calc(100%-32px)]",
|
|
11222
|
+
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%)]",
|
|
11223
|
+
"kiosko:h-[calc(100%-170px)] kiosko:w-[345px]"
|
|
11224
|
+
),
|
|
11225
|
+
style: isMirroredInCSS ? mirroredTransformStyle : void 0,
|
|
11226
|
+
children: [
|
|
11227
|
+
!roundedScanArea && /* @__PURE__ */ jsxs84(Fragment13, { children: [
|
|
11228
|
+
/* @__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" }),
|
|
11229
|
+
/* @__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" }),
|
|
11230
|
+
/* @__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" }),
|
|
11231
|
+
/* @__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" })
|
|
11232
|
+
] }),
|
|
11233
|
+
placeholderImage
|
|
11234
|
+
]
|
|
11235
|
+
}
|
|
11236
|
+
),
|
|
11237
|
+
/* @__PURE__ */ jsx136("canvas", { ref: canvasRef, className: "hidden" }),
|
|
11238
|
+
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(
|
|
11239
|
+
ReactWebcam,
|
|
11240
|
+
{
|
|
11241
|
+
ref: webcamRef,
|
|
11242
|
+
mirrored: !!mirrored,
|
|
11243
|
+
width: props.width,
|
|
11244
|
+
height: props.height,
|
|
11245
|
+
videoConstraints: constraints,
|
|
11246
|
+
imageSmoothing: !!imageSmoothing,
|
|
11247
|
+
screenshotFormat: SCREENSHOT_FORMAT,
|
|
11248
|
+
onUserMedia: handleUserMediaSuccess,
|
|
11249
|
+
screenshotQuality,
|
|
11250
|
+
onUserMediaError: handleUserMediaErrorWithFallback,
|
|
11251
|
+
minScreenshotWidth,
|
|
11252
|
+
minScreenshotHeight,
|
|
11253
|
+
className: "webcam__video z-[1] h-full w-full bg-[#e2e2e2] object-cover",
|
|
11254
|
+
audio: false,
|
|
11255
|
+
disablePictureInPicture: false,
|
|
11256
|
+
forceScreenshotSourceSize: false
|
|
11257
|
+
}
|
|
11258
|
+
),
|
|
11259
|
+
children
|
|
11260
|
+
]
|
|
11261
|
+
}
|
|
11262
|
+
);
|
|
11263
|
+
}
|
|
11264
|
+
)
|
|
11265
|
+
);
|
|
11266
|
+
Webcam.displayName = "Webcam";
|
|
11267
|
+
|
|
11268
|
+
// src/mobile-webcam/MobileWebcam.tsx
|
|
11269
|
+
import { Camera, ChevronLeft as ChevronLeft4 } from "lucide-react";
|
|
11270
|
+
import { forwardRef as forwardRef55, useCallback as useCallback29 } from "react";
|
|
11271
|
+
import { createPortal } from "react-dom";
|
|
11272
|
+
import { useTranslation as useTranslation25 } from "react-i18next";
|
|
11273
|
+
|
|
11274
|
+
// src/mobile-webcam/DeviceCamera/DeviceCamera.tsx
|
|
11275
|
+
import { useCallback as useCallback28 } from "react";
|
|
11276
|
+
import { useTranslation as useTranslation24 } from "react-i18next";
|
|
11277
|
+
import { jsx as jsx137, jsxs as jsxs85 } from "react/jsx-runtime";
|
|
11278
|
+
function DeviceCamera({ onChange, facingMode, className }) {
|
|
11279
|
+
const { t } = useTranslation24();
|
|
11280
|
+
const handleNativeScreenshot = useCallback28(
|
|
11281
|
+
(event) => {
|
|
11282
|
+
const file = event.target.files?.[0];
|
|
11283
|
+
onChange(file ? compressImage(file) : void 0);
|
|
11284
|
+
},
|
|
11285
|
+
[onChange]
|
|
11286
|
+
);
|
|
11287
|
+
return /* @__PURE__ */ jsxs85(
|
|
11288
|
+
"div",
|
|
11289
|
+
{
|
|
11290
|
+
className: cn(
|
|
11291
|
+
"mobile-webcam-device-camera flex flex-col items-center gap-3 rounded-xl bg-[#1c1b1f] p-4 text-sm text-white",
|
|
11292
|
+
className
|
|
11293
|
+
),
|
|
11294
|
+
children: [
|
|
11295
|
+
/* @__PURE__ */ jsx137("div", { children: t("camera_errors.experiencing_camera_issues") }),
|
|
11296
|
+
/* @__PURE__ */ jsxs85("label", { className: "text-[16px] font-semibold uppercase leading-6 text-[var(--text-button-color)]", children: [
|
|
11297
|
+
t("open_devices_camera"),
|
|
11298
|
+
/* @__PURE__ */ jsx137(
|
|
11299
|
+
"input",
|
|
10849
11300
|
{
|
|
10850
|
-
|
|
10851
|
-
|
|
10852
|
-
|
|
10853
|
-
|
|
10854
|
-
|
|
10855
|
-
imageSmoothing,
|
|
10856
|
-
mirrored,
|
|
10857
|
-
screenshotQuality,
|
|
10858
|
-
videoConstraints: constraints,
|
|
10859
|
-
screenshotFormat: SCREENSHOT_FORMAT,
|
|
10860
|
-
minScreenshotHeight,
|
|
10861
|
-
minScreenshotWidth
|
|
11301
|
+
className: "sr-only",
|
|
11302
|
+
type: "file",
|
|
11303
|
+
accept: "image/*",
|
|
11304
|
+
capture: facingMode || "environment",
|
|
11305
|
+
onChange: handleNativeScreenshot
|
|
10862
11306
|
}
|
|
10863
11307
|
)
|
|
10864
|
-
}
|
|
10865
|
-
|
|
10866
|
-
|
|
10867
|
-
|
|
11308
|
+
] })
|
|
11309
|
+
]
|
|
11310
|
+
}
|
|
11311
|
+
);
|
|
11312
|
+
}
|
|
11313
|
+
|
|
11314
|
+
// src/mobile-webcam/MobileWebcam.tsx
|
|
11315
|
+
import { jsx as jsx138, jsxs as jsxs86 } from "react/jsx-runtime";
|
|
11316
|
+
var webcamClasses = "fixed left-0 top-0 z-[6] h-full w-full rounded-none";
|
|
11317
|
+
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]`;
|
|
11318
|
+
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`;
|
|
11319
|
+
function getAndMapFacingMode(constraints) {
|
|
11320
|
+
if (typeof constraints === "boolean" || !constraints) return;
|
|
11321
|
+
if (constraints.facingMode === "user") return "user";
|
|
11322
|
+
if (constraints.facingMode === "environment") return "environment";
|
|
11323
|
+
}
|
|
11324
|
+
var MobileWebcam = forwardRef55(
|
|
11325
|
+
({ onScreenshot, onBack, title, text, disabled, className, ...props }, ref) => {
|
|
11326
|
+
const rootElement = getDocument()?.body;
|
|
11327
|
+
const { t } = useTranslation25();
|
|
11328
|
+
const handleNativeScreenshot = useCallback29(
|
|
11329
|
+
(photo) => onScreenshot({ isNative: true, photo }),
|
|
11330
|
+
[onScreenshot]
|
|
11331
|
+
);
|
|
11332
|
+
return createPortal(
|
|
11333
|
+
/* @__PURE__ */ jsxs86("div", { className: "mobile-camera flex justify-center", children: [
|
|
11334
|
+
/* @__PURE__ */ jsx138(
|
|
11335
|
+
"button",
|
|
11336
|
+
{
|
|
11337
|
+
type: "button",
|
|
11338
|
+
onClick: onBack,
|
|
11339
|
+
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]",
|
|
11340
|
+
children: /* @__PURE__ */ jsx138(ChevronLeft4, { size: 32, strokeWidth: 3, className: "text-white" })
|
|
11341
|
+
}
|
|
11342
|
+
),
|
|
11343
|
+
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 }),
|
|
11344
|
+
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") }),
|
|
11345
|
+
/* @__PURE__ */ jsx138(
|
|
11346
|
+
Webcam,
|
|
11347
|
+
{
|
|
11348
|
+
ref,
|
|
11349
|
+
...props,
|
|
11350
|
+
className: cn(
|
|
11351
|
+
className,
|
|
11352
|
+
webcamClasses,
|
|
11353
|
+
props.roundedScanArea ? roundedWebcamClasses : scanAreaClasses
|
|
11354
|
+
)
|
|
11355
|
+
}
|
|
11356
|
+
),
|
|
11357
|
+
/* @__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: [
|
|
11358
|
+
/* @__PURE__ */ jsx138(
|
|
11359
|
+
"button",
|
|
11360
|
+
{
|
|
11361
|
+
type: "button",
|
|
11362
|
+
disabled,
|
|
11363
|
+
onClick: () => onScreenshot({ isNative: false }),
|
|
11364
|
+
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",
|
|
11365
|
+
children: /* @__PURE__ */ jsx138(Camera, { size: 26, className: "text-[var(--primary)]" })
|
|
11366
|
+
}
|
|
11367
|
+
),
|
|
11368
|
+
/* @__PURE__ */ jsx138(
|
|
11369
|
+
DeviceCamera,
|
|
11370
|
+
{
|
|
11371
|
+
onChange: handleNativeScreenshot,
|
|
11372
|
+
facingMode: getAndMapFacingMode(props.additionalConstraints)
|
|
11373
|
+
}
|
|
11374
|
+
)
|
|
11375
|
+
] })
|
|
11376
|
+
] }),
|
|
11377
|
+
rootElement
|
|
11378
|
+
);
|
|
10868
11379
|
}
|
|
10869
11380
|
);
|
|
10870
|
-
|
|
11381
|
+
MobileWebcam.displayName = "MobileWebcam";
|
|
10871
11382
|
|
|
10872
11383
|
// src/wide-button/WideButton.tsx
|
|
10873
|
-
import { forwardRef as
|
|
10874
|
-
import { jsx as
|
|
10875
|
-
var WideButton =
|
|
10876
|
-
({ className, disabled, ...props }, ref) => /* @__PURE__ */
|
|
11384
|
+
import { forwardRef as forwardRef56 } from "react";
|
|
11385
|
+
import { jsx as jsx139 } from "react/jsx-runtime";
|
|
11386
|
+
var WideButton = forwardRef56(
|
|
11387
|
+
({ className, disabled, ...props }, ref) => /* @__PURE__ */ jsx139(
|
|
10877
11388
|
Button,
|
|
10878
11389
|
{
|
|
10879
11390
|
ref,
|
|
@@ -10895,22 +11406,22 @@ WideButton.displayName = "WideButton";
|
|
|
10895
11406
|
import * as React42 from "react";
|
|
10896
11407
|
import * as DialogPrimitive2 from "@radix-ui/react-dialog";
|
|
10897
11408
|
import Draggable from "react-draggable";
|
|
10898
|
-
import { jsx as
|
|
11409
|
+
import { jsx as jsx140, jsxs as jsxs87 } from "react/jsx-runtime";
|
|
10899
11410
|
var DRAWER_CLOSE_THRESHOLD = 72;
|
|
10900
11411
|
var DRAWER_MIN_OVERLAY_OPACITY = 0.1;
|
|
10901
11412
|
function Drawer({ ...props }) {
|
|
10902
|
-
return /* @__PURE__ */
|
|
11413
|
+
return /* @__PURE__ */ jsx140(DialogPrimitive2.Root, { "data-slot": "drawer", ...props });
|
|
10903
11414
|
}
|
|
10904
11415
|
function DrawerTrigger({ ...props }) {
|
|
10905
|
-
return /* @__PURE__ */
|
|
11416
|
+
return /* @__PURE__ */ jsx140(DialogPrimitive2.Trigger, { "data-slot": "drawer-trigger", ...props });
|
|
10906
11417
|
}
|
|
10907
11418
|
function DrawerPortal({ ...props }) {
|
|
10908
|
-
return /* @__PURE__ */
|
|
11419
|
+
return /* @__PURE__ */ jsx140(DialogPrimitive2.Portal, { "data-slot": "drawer-portal", ...props });
|
|
10909
11420
|
}
|
|
10910
11421
|
function DrawerClose({ ...props }) {
|
|
10911
|
-
return /* @__PURE__ */
|
|
11422
|
+
return /* @__PURE__ */ jsx140(DialogPrimitive2.Close, { "data-slot": "drawer-close", ...props });
|
|
10912
11423
|
}
|
|
10913
|
-
var DrawerOverlay = React42.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
11424
|
+
var DrawerOverlay = React42.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx140(
|
|
10914
11425
|
DialogPrimitive2.Overlay,
|
|
10915
11426
|
{
|
|
10916
11427
|
ref,
|
|
@@ -10960,14 +11471,14 @@ var DrawerContent = React42.forwardRef(
|
|
|
10960
11471
|
},
|
|
10961
11472
|
[onClose]
|
|
10962
11473
|
);
|
|
10963
|
-
return /* @__PURE__ */
|
|
10964
|
-
lockScroll ? /* @__PURE__ */
|
|
11474
|
+
return /* @__PURE__ */ jsxs87(DrawerPortal, { container: finalContainer, children: [
|
|
11475
|
+
lockScroll ? /* @__PURE__ */ jsx140(
|
|
10965
11476
|
DrawerOverlay,
|
|
10966
11477
|
{
|
|
10967
11478
|
style: { opacity: overlayOpacity },
|
|
10968
11479
|
onClick: closeOnOverlayClick ? onClose : void 0
|
|
10969
11480
|
}
|
|
10970
|
-
) : /* @__PURE__ */
|
|
11481
|
+
) : /* @__PURE__ */ jsx140(
|
|
10971
11482
|
"div",
|
|
10972
11483
|
{
|
|
10973
11484
|
className: cn(DrawerOverlayClasses),
|
|
@@ -10975,7 +11486,7 @@ var DrawerContent = React42.forwardRef(
|
|
|
10975
11486
|
onClick: closeOnOverlayClick ? onClose : void 0
|
|
10976
11487
|
}
|
|
10977
11488
|
),
|
|
10978
|
-
/* @__PURE__ */
|
|
11489
|
+
/* @__PURE__ */ jsx140(
|
|
10979
11490
|
DialogPrimitive2.Content,
|
|
10980
11491
|
{
|
|
10981
11492
|
asChild: true,
|
|
@@ -10991,7 +11502,7 @@ var DrawerContent = React42.forwardRef(
|
|
|
10991
11502
|
}
|
|
10992
11503
|
},
|
|
10993
11504
|
...props,
|
|
10994
|
-
children: /* @__PURE__ */
|
|
11505
|
+
children: /* @__PURE__ */ jsx140("div", { className: "fixed inset-x-0 bottom-0 top-auto z-50 outline-none", children: /* @__PURE__ */ jsx140(
|
|
10995
11506
|
Draggable,
|
|
10996
11507
|
{
|
|
10997
11508
|
axis: "y",
|
|
@@ -11002,7 +11513,7 @@ var DrawerContent = React42.forwardRef(
|
|
|
11002
11513
|
onDrag: handleDrag,
|
|
11003
11514
|
onStop: handleStop,
|
|
11004
11515
|
position: { x: 0, y: dragOffsetY },
|
|
11005
|
-
children: /* @__PURE__ */
|
|
11516
|
+
children: /* @__PURE__ */ jsxs87(
|
|
11006
11517
|
"div",
|
|
11007
11518
|
{
|
|
11008
11519
|
ref: nodeRef,
|
|
@@ -11011,7 +11522,7 @@ var DrawerContent = React42.forwardRef(
|
|
|
11011
11522
|
className
|
|
11012
11523
|
),
|
|
11013
11524
|
children: [
|
|
11014
|
-
showHandle && /* @__PURE__ */
|
|
11525
|
+
showHandle && /* @__PURE__ */ jsx140(
|
|
11015
11526
|
"div",
|
|
11016
11527
|
{
|
|
11017
11528
|
"data-drawer-handle": true,
|
|
@@ -11019,10 +11530,10 @@ var DrawerContent = React42.forwardRef(
|
|
|
11019
11530
|
"mx-auto flex h-8 w-24 touch-none items-center justify-center",
|
|
11020
11531
|
disableDrag ? "cursor-default" : "cursor-grab active:cursor-grabbing"
|
|
11021
11532
|
),
|
|
11022
|
-
children: /* @__PURE__ */
|
|
11533
|
+
children: /* @__PURE__ */ jsx140("span", { className: "block h-1.5 w-12 rounded-full bg-[#D9D7D3]" })
|
|
11023
11534
|
}
|
|
11024
11535
|
),
|
|
11025
|
-
/* @__PURE__ */
|
|
11536
|
+
/* @__PURE__ */ jsx140("div", { className: "min-h-0 flex-1 overflow-y-auto", children })
|
|
11026
11537
|
]
|
|
11027
11538
|
}
|
|
11028
11539
|
)
|
|
@@ -11034,7 +11545,7 @@ var DrawerContent = React42.forwardRef(
|
|
|
11034
11545
|
}
|
|
11035
11546
|
);
|
|
11036
11547
|
DrawerContent.displayName = DialogPrimitive2.Content.displayName;
|
|
11037
|
-
var DrawerHeader = ({ className, ...props }) => /* @__PURE__ */
|
|
11548
|
+
var DrawerHeader = ({ className, ...props }) => /* @__PURE__ */ jsx140(
|
|
11038
11549
|
"div",
|
|
11039
11550
|
{
|
|
11040
11551
|
className: cn("flex flex-col gap-2 px-5 pt-2 text-center", className),
|
|
@@ -11042,9 +11553,9 @@ var DrawerHeader = ({ className, ...props }) => /* @__PURE__ */ jsx138(
|
|
|
11042
11553
|
}
|
|
11043
11554
|
);
|
|
11044
11555
|
DrawerHeader.displayName = "DrawerHeader";
|
|
11045
|
-
var DrawerFooter = ({ className, ...props }) => /* @__PURE__ */
|
|
11556
|
+
var DrawerFooter = ({ className, ...props }) => /* @__PURE__ */ jsx140("div", { className: cn("flex flex-col gap-2 p-5", className), ...props });
|
|
11046
11557
|
DrawerFooter.displayName = "DrawerFooter";
|
|
11047
|
-
var DrawerTitle = React42.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
11558
|
+
var DrawerTitle = React42.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx140(
|
|
11048
11559
|
DialogPrimitive2.Title,
|
|
11049
11560
|
{
|
|
11050
11561
|
ref,
|
|
@@ -11054,7 +11565,7 @@ var DrawerTitle = React42.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
11054
11565
|
}
|
|
11055
11566
|
));
|
|
11056
11567
|
DrawerTitle.displayName = DialogPrimitive2.Title.displayName;
|
|
11057
|
-
var DrawerDescription = React42.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
11568
|
+
var DrawerDescription = React42.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx140(
|
|
11058
11569
|
DialogPrimitive2.Description,
|
|
11059
11570
|
{
|
|
11060
11571
|
ref,
|
|
@@ -11081,7 +11592,7 @@ var DEVICE = {
|
|
|
11081
11592
|
};
|
|
11082
11593
|
|
|
11083
11594
|
// src/responsive-sheet/ResponsiveSheet.tsx
|
|
11084
|
-
import { jsx as
|
|
11595
|
+
import { jsx as jsx141, jsxs as jsxs88 } from "react/jsx-runtime";
|
|
11085
11596
|
function ResponsiveSheet({
|
|
11086
11597
|
open,
|
|
11087
11598
|
onClose,
|
|
@@ -11100,8 +11611,8 @@ function ResponsiveSheet({
|
|
|
11100
11611
|
closeOnEscape = true,
|
|
11101
11612
|
disableDrag = false
|
|
11102
11613
|
}) {
|
|
11103
|
-
const { isMatch:
|
|
11104
|
-
const isMobileMode =
|
|
11614
|
+
const { isMatch: isMobile3 } = useScreenResize(DEVICE.tablet);
|
|
11615
|
+
const isMobileMode = isMobile3 && isMobileModalModeAvailable();
|
|
11105
11616
|
const handleOpenChange = (nextOpen) => {
|
|
11106
11617
|
if (!nextOpen) {
|
|
11107
11618
|
onClose();
|
|
@@ -11117,7 +11628,7 @@ function ResponsiveSheet({
|
|
|
11117
11628
|
event.preventDefault();
|
|
11118
11629
|
}
|
|
11119
11630
|
};
|
|
11120
|
-
const content = /* @__PURE__ */
|
|
11631
|
+
const content = /* @__PURE__ */ jsxs88(
|
|
11121
11632
|
"div",
|
|
11122
11633
|
{
|
|
11123
11634
|
className: cn(
|
|
@@ -11125,7 +11636,7 @@ function ResponsiveSheet({
|
|
|
11125
11636
|
contentClassName
|
|
11126
11637
|
),
|
|
11127
11638
|
children: [
|
|
11128
|
-
title ? /* @__PURE__ */
|
|
11639
|
+
title ? /* @__PURE__ */ jsx141(
|
|
11129
11640
|
"div",
|
|
11130
11641
|
{
|
|
11131
11642
|
"aria-hidden": "true",
|
|
@@ -11136,7 +11647,7 @@ function ResponsiveSheet({
|
|
|
11136
11647
|
children: title
|
|
11137
11648
|
}
|
|
11138
11649
|
) : null,
|
|
11139
|
-
description ? /* @__PURE__ */
|
|
11650
|
+
description ? /* @__PURE__ */ jsx141(
|
|
11140
11651
|
"p",
|
|
11141
11652
|
{
|
|
11142
11653
|
"aria-hidden": "true",
|
|
@@ -11152,7 +11663,7 @@ function ResponsiveSheet({
|
|
|
11152
11663
|
}
|
|
11153
11664
|
);
|
|
11154
11665
|
if (isMobileMode) {
|
|
11155
|
-
return /* @__PURE__ */
|
|
11666
|
+
return /* @__PURE__ */ jsx141(Drawer, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxs88(
|
|
11156
11667
|
DrawerContent,
|
|
11157
11668
|
{
|
|
11158
11669
|
onClose,
|
|
@@ -11163,14 +11674,14 @@ function ResponsiveSheet({
|
|
|
11163
11674
|
onEscapeKeyDown: handleEscapeKeyDown,
|
|
11164
11675
|
className: cn(className, drawerClassName),
|
|
11165
11676
|
children: [
|
|
11166
|
-
title ? /* @__PURE__ */
|
|
11167
|
-
description ? /* @__PURE__ */
|
|
11677
|
+
title ? /* @__PURE__ */ jsx141(DrawerTitle, { className: "sr-only", children: title }) : null,
|
|
11678
|
+
description ? /* @__PURE__ */ jsx141(DrawerDescription, { className: "sr-only", children: description }) : null,
|
|
11168
11679
|
content
|
|
11169
11680
|
]
|
|
11170
11681
|
}
|
|
11171
11682
|
) });
|
|
11172
11683
|
}
|
|
11173
|
-
return /* @__PURE__ */
|
|
11684
|
+
return /* @__PURE__ */ jsx141(Dialog, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxs88(
|
|
11174
11685
|
DialogContent,
|
|
11175
11686
|
{
|
|
11176
11687
|
showCloseButton,
|
|
@@ -11180,8 +11691,8 @@ function ResponsiveSheet({
|
|
|
11180
11691
|
className: cn("max-w-[560px] border-0 p-0 shadow-xl", className, dialogClassName),
|
|
11181
11692
|
lockScroll: false,
|
|
11182
11693
|
children: [
|
|
11183
|
-
title ? /* @__PURE__ */
|
|
11184
|
-
description ? /* @__PURE__ */
|
|
11694
|
+
title ? /* @__PURE__ */ jsx141(DialogTitle, { className: "sr-only", children: title }) : null,
|
|
11695
|
+
description ? /* @__PURE__ */ jsx141(DialogDescription, { className: "sr-only", children: description }) : null,
|
|
11185
11696
|
content
|
|
11186
11697
|
]
|
|
11187
11698
|
}
|
|
@@ -11190,7 +11701,7 @@ function ResponsiveSheet({
|
|
|
11190
11701
|
|
|
11191
11702
|
// src/responsive-dropdown/ResponsiveDropdown.tsx
|
|
11192
11703
|
import * as React43 from "react";
|
|
11193
|
-
import { Fragment as Fragment14, jsx as
|
|
11704
|
+
import { Fragment as Fragment14, jsx as jsx142, jsxs as jsxs89 } from "react/jsx-runtime";
|
|
11194
11705
|
function ResponsiveDropdown({
|
|
11195
11706
|
trigger,
|
|
11196
11707
|
options,
|
|
@@ -11203,8 +11714,8 @@ function ResponsiveDropdown({
|
|
|
11203
11714
|
dropdownClassName,
|
|
11204
11715
|
drawerClassName
|
|
11205
11716
|
}) {
|
|
11206
|
-
const { isMatch:
|
|
11207
|
-
const isMobileMode =
|
|
11717
|
+
const { isMatch: isMobile3 } = useScreenResize(DEVICE.mobileXL);
|
|
11718
|
+
const isMobileMode = isMobile3 && isMobileModalModeAvailable();
|
|
11208
11719
|
const [open, setOpen] = React43.useState(false);
|
|
11209
11720
|
const visibleOptions = options?.filter((option) => !option.hidden) ?? [];
|
|
11210
11721
|
const renderTrigger = (isOpen) => typeof trigger === "function" ? trigger(isOpen) : trigger;
|
|
@@ -11222,8 +11733,8 @@ function ResponsiveDropdown({
|
|
|
11222
11733
|
setOpen(false);
|
|
11223
11734
|
};
|
|
11224
11735
|
if (isMobileMode) {
|
|
11225
|
-
return /* @__PURE__ */
|
|
11226
|
-
/* @__PURE__ */
|
|
11736
|
+
return /* @__PURE__ */ jsxs89(Fragment14, { children: [
|
|
11737
|
+
/* @__PURE__ */ jsx142(
|
|
11227
11738
|
"div",
|
|
11228
11739
|
{
|
|
11229
11740
|
className: "responsive-dropdown__mobile-trigger",
|
|
@@ -11231,16 +11742,16 @@ function ResponsiveDropdown({
|
|
|
11231
11742
|
children: renderTrigger(open)
|
|
11232
11743
|
}
|
|
11233
11744
|
),
|
|
11234
|
-
/* @__PURE__ */
|
|
11745
|
+
/* @__PURE__ */ jsx142(Drawer, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxs89(
|
|
11235
11746
|
DrawerContent,
|
|
11236
11747
|
{
|
|
11237
11748
|
onClose: () => setOpen(false),
|
|
11238
11749
|
lockScroll: false,
|
|
11239
11750
|
className: cn("px-0 pb-2", className, drawerClassName),
|
|
11240
11751
|
children: [
|
|
11241
|
-
title ? /* @__PURE__ */
|
|
11242
|
-
/* @__PURE__ */
|
|
11243
|
-
visibleOptions.map((option) => /* @__PURE__ */
|
|
11752
|
+
title ? /* @__PURE__ */ jsx142(DrawerTitle, { className: "sr-only", children: title }) : null,
|
|
11753
|
+
/* @__PURE__ */ jsxs89("div", { className: "flex flex-col", children: [
|
|
11754
|
+
visibleOptions.map((option) => /* @__PURE__ */ jsx142(
|
|
11244
11755
|
"div",
|
|
11245
11756
|
{
|
|
11246
11757
|
role: "button",
|
|
@@ -11262,16 +11773,16 @@ function ResponsiveDropdown({
|
|
|
11262
11773
|
) })
|
|
11263
11774
|
] });
|
|
11264
11775
|
}
|
|
11265
|
-
return /* @__PURE__ */
|
|
11266
|
-
/* @__PURE__ */
|
|
11267
|
-
/* @__PURE__ */
|
|
11776
|
+
return /* @__PURE__ */ jsxs89(DropdownMenu, { open, onOpenChange: handleOpenChange, children: [
|
|
11777
|
+
/* @__PURE__ */ jsx142(DropdownMenuTrigger, { asChild: true, disabled, children: renderTrigger(open) }),
|
|
11778
|
+
/* @__PURE__ */ jsxs89(
|
|
11268
11779
|
DropdownMenuContent,
|
|
11269
11780
|
{
|
|
11270
11781
|
side,
|
|
11271
11782
|
align,
|
|
11272
11783
|
className: cn("min-w-[295px]", className, dropdownClassName),
|
|
11273
11784
|
children: [
|
|
11274
|
-
visibleOptions.map((option) => /* @__PURE__ */
|
|
11785
|
+
visibleOptions.map((option) => /* @__PURE__ */ jsx142(
|
|
11275
11786
|
DropdownMenuItem,
|
|
11276
11787
|
{
|
|
11277
11788
|
disabled: option.disabled,
|
|
@@ -11290,10 +11801,10 @@ function ResponsiveDropdown({
|
|
|
11290
11801
|
// src/dashboard/input/Input.tsx
|
|
11291
11802
|
import * as React44 from "react";
|
|
11292
11803
|
import { Eye, Minus as Minus4, Plus as Plus3, X as X9 } from "lucide-react";
|
|
11293
|
-
import { useTranslation as
|
|
11804
|
+
import { useTranslation as useTranslation26 } from "react-i18next";
|
|
11294
11805
|
|
|
11295
11806
|
// src/dashboard/_fieldset/Fieldset.tsx
|
|
11296
|
-
import { Fragment as Fragment15, jsx as
|
|
11807
|
+
import { Fragment as Fragment15, jsx as jsx143, jsxs as jsxs90 } from "react/jsx-runtime";
|
|
11297
11808
|
function Fieldset({
|
|
11298
11809
|
isActivated,
|
|
11299
11810
|
isFocused,
|
|
@@ -11313,8 +11824,8 @@ function Fieldset({
|
|
|
11313
11824
|
}) {
|
|
11314
11825
|
const showLegendText = Boolean(legend || typeof label === "string");
|
|
11315
11826
|
const raised = !isEmpty || isFocused;
|
|
11316
|
-
return /* @__PURE__ */
|
|
11317
|
-
/* @__PURE__ */
|
|
11827
|
+
return /* @__PURE__ */ jsxs90(Fragment15, { children: [
|
|
11828
|
+
/* @__PURE__ */ jsxs90(
|
|
11318
11829
|
"div",
|
|
11319
11830
|
{
|
|
11320
11831
|
onClick,
|
|
@@ -11330,7 +11841,7 @@ function Fieldset({
|
|
|
11330
11841
|
labelClassName
|
|
11331
11842
|
),
|
|
11332
11843
|
children: [
|
|
11333
|
-
/* @__PURE__ */
|
|
11844
|
+
/* @__PURE__ */ jsx143(
|
|
11334
11845
|
"label",
|
|
11335
11846
|
{
|
|
11336
11847
|
id: labelId,
|
|
@@ -11342,7 +11853,7 @@ function Fieldset({
|
|
|
11342
11853
|
children: label
|
|
11343
11854
|
}
|
|
11344
11855
|
),
|
|
11345
|
-
tooltip && /* @__PURE__ */
|
|
11856
|
+
tooltip && /* @__PURE__ */ jsx143("span", { className: "ml-1 inline-flex", children: /* @__PURE__ */ jsx143(
|
|
11346
11857
|
HelpTooltip,
|
|
11347
11858
|
{
|
|
11348
11859
|
content: tooltip,
|
|
@@ -11353,7 +11864,7 @@ function Fieldset({
|
|
|
11353
11864
|
]
|
|
11354
11865
|
}
|
|
11355
11866
|
),
|
|
11356
|
-
/* @__PURE__ */
|
|
11867
|
+
/* @__PURE__ */ jsx143(
|
|
11357
11868
|
"fieldset",
|
|
11358
11869
|
{
|
|
11359
11870
|
"aria-hidden": "true",
|
|
@@ -11365,7 +11876,7 @@ function Fieldset({
|
|
|
11365
11876
|
invalid && "border-[var(--error-message-color)]",
|
|
11366
11877
|
className
|
|
11367
11878
|
),
|
|
11368
|
-
children: /* @__PURE__ */
|
|
11879
|
+
children: /* @__PURE__ */ jsxs90(
|
|
11369
11880
|
"legend",
|
|
11370
11881
|
{
|
|
11371
11882
|
className: cn(
|
|
@@ -11375,8 +11886,8 @@ function Fieldset({
|
|
|
11375
11886
|
!label && "w-0"
|
|
11376
11887
|
),
|
|
11377
11888
|
children: [
|
|
11378
|
-
showLegendText && /* @__PURE__ */
|
|
11379
|
-
tooltip && /* @__PURE__ */
|
|
11889
|
+
showLegendText && /* @__PURE__ */ jsx143("span", { className: "visible inline-block pr-[6px] text-[14px] font-medium opacity-0", children: legend || label }),
|
|
11890
|
+
tooltip && /* @__PURE__ */ jsx143("span", { className: "visible inline-block w-[20px] opacity-0", children: /* @__PURE__ */ jsx143("span", { className: "inline-block h-4 w-4" }) })
|
|
11380
11891
|
]
|
|
11381
11892
|
}
|
|
11382
11893
|
)
|
|
@@ -11386,7 +11897,7 @@ function Fieldset({
|
|
|
11386
11897
|
}
|
|
11387
11898
|
|
|
11388
11899
|
// src/dashboard/input/Input.tsx
|
|
11389
|
-
import { jsx as
|
|
11900
|
+
import { jsx as jsx144, jsxs as jsxs91 } from "react/jsx-runtime";
|
|
11390
11901
|
var checkIfEmpty = ({
|
|
11391
11902
|
empty,
|
|
11392
11903
|
defaultValue,
|
|
@@ -11437,7 +11948,7 @@ var DashboardInput = React44.forwardRef(
|
|
|
11437
11948
|
const generatedId = React44.useId();
|
|
11438
11949
|
const inputId = id ?? name ?? generatedId;
|
|
11439
11950
|
const errorId = `${inputId}-error`;
|
|
11440
|
-
const { t } =
|
|
11951
|
+
const { t } = useTranslation26();
|
|
11441
11952
|
const isEmpty = checkIfEmpty({ empty, value, defaultValue });
|
|
11442
11953
|
const [inputType, setInputType] = React44.useState(type);
|
|
11443
11954
|
const [isPasswordRevealed, setIsPasswordRevealed] = React44.useState(false);
|
|
@@ -11477,7 +11988,7 @@ var DashboardInput = React44.forwardRef(
|
|
|
11477
11988
|
};
|
|
11478
11989
|
const showRightPaddingForReset = Boolean(onReset);
|
|
11479
11990
|
const showRightPaddingForReveal = isPasswordReveal;
|
|
11480
|
-
return /* @__PURE__ */
|
|
11991
|
+
return /* @__PURE__ */ jsxs91(
|
|
11481
11992
|
"div",
|
|
11482
11993
|
{
|
|
11483
11994
|
className: cn(
|
|
@@ -11488,7 +11999,7 @@ var DashboardInput = React44.forwardRef(
|
|
|
11488
11999
|
className
|
|
11489
12000
|
),
|
|
11490
12001
|
children: [
|
|
11491
|
-
topLabel && /* @__PURE__ */
|
|
12002
|
+
topLabel && /* @__PURE__ */ jsx144(
|
|
11492
12003
|
"label",
|
|
11493
12004
|
{
|
|
11494
12005
|
htmlFor: inputId,
|
|
@@ -11496,7 +12007,7 @@ var DashboardInput = React44.forwardRef(
|
|
|
11496
12007
|
children: topLabel
|
|
11497
12008
|
}
|
|
11498
12009
|
),
|
|
11499
|
-
/* @__PURE__ */
|
|
12010
|
+
/* @__PURE__ */ jsxs91(
|
|
11500
12011
|
"div",
|
|
11501
12012
|
{
|
|
11502
12013
|
className: cn(
|
|
@@ -11505,8 +12016,8 @@ var DashboardInput = React44.forwardRef(
|
|
|
11505
12016
|
fieldClassName
|
|
11506
12017
|
),
|
|
11507
12018
|
children: [
|
|
11508
|
-
/* @__PURE__ */
|
|
11509
|
-
/* @__PURE__ */
|
|
12019
|
+
/* @__PURE__ */ jsxs91("div", { className: cn("relative w-full cursor-text", contentClassName), children: [
|
|
12020
|
+
/* @__PURE__ */ jsx144(
|
|
11510
12021
|
Fieldset,
|
|
11511
12022
|
{
|
|
11512
12023
|
isFocused: isFocused && !readOnly,
|
|
@@ -11527,8 +12038,8 @@ var DashboardInput = React44.forwardRef(
|
|
|
11527
12038
|
})
|
|
11528
12039
|
}
|
|
11529
12040
|
),
|
|
11530
|
-
leftIcon && /* @__PURE__ */
|
|
11531
|
-
/* @__PURE__ */
|
|
12041
|
+
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 }) }),
|
|
12042
|
+
/* @__PURE__ */ jsx144(
|
|
11532
12043
|
"input",
|
|
11533
12044
|
{
|
|
11534
12045
|
...props,
|
|
@@ -11565,9 +12076,9 @@ var DashboardInput = React44.forwardRef(
|
|
|
11565
12076
|
)
|
|
11566
12077
|
}
|
|
11567
12078
|
),
|
|
11568
|
-
sign && /* @__PURE__ */
|
|
11569
|
-
trailingAdornment && /* @__PURE__ */
|
|
11570
|
-
onReset && !isEmpty && /* @__PURE__ */
|
|
12079
|
+
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 }),
|
|
12080
|
+
trailingAdornment && /* @__PURE__ */ jsx144("span", { className: "pointer-events-none absolute right-[14px] top-0 flex h-full items-center", children: trailingAdornment }),
|
|
12081
|
+
onReset && !isEmpty && /* @__PURE__ */ jsx144(
|
|
11571
12082
|
"button",
|
|
11572
12083
|
{
|
|
11573
12084
|
type: "button",
|
|
@@ -11575,17 +12086,17 @@ var DashboardInput = React44.forwardRef(
|
|
|
11575
12086
|
disabled,
|
|
11576
12087
|
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
12088
|
"aria-label": "Reset",
|
|
11578
|
-
children: /* @__PURE__ */
|
|
12089
|
+
children: /* @__PURE__ */ jsx144(X9, { size: 14 })
|
|
11579
12090
|
}
|
|
11580
12091
|
),
|
|
11581
|
-
isPasswordReveal && /* @__PURE__ */
|
|
12092
|
+
isPasswordReveal && /* @__PURE__ */ jsx144(
|
|
11582
12093
|
"button",
|
|
11583
12094
|
{
|
|
11584
12095
|
type: "button",
|
|
11585
12096
|
onClick: togglePasswordReveal,
|
|
11586
12097
|
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
12098
|
"aria-label": isPasswordRevealed ? "Hide password" : "Show password",
|
|
11588
|
-
children: /* @__PURE__ */
|
|
12099
|
+
children: /* @__PURE__ */ jsx144(
|
|
11589
12100
|
Eye,
|
|
11590
12101
|
{
|
|
11591
12102
|
size: 20,
|
|
@@ -11597,32 +12108,32 @@ var DashboardInput = React44.forwardRef(
|
|
|
11597
12108
|
}
|
|
11598
12109
|
)
|
|
11599
12110
|
] }),
|
|
11600
|
-
type === "number" && showNumberButtons && /* @__PURE__ */
|
|
11601
|
-
/* @__PURE__ */
|
|
12111
|
+
type === "number" && showNumberButtons && /* @__PURE__ */ jsxs91("div", { className: "absolute right-[18px] top-[13px] inline-flex items-center text-right", children: [
|
|
12112
|
+
/* @__PURE__ */ jsx144(
|
|
11602
12113
|
"button",
|
|
11603
12114
|
{
|
|
11604
12115
|
type: "button",
|
|
11605
12116
|
onClick: onDecrement,
|
|
11606
12117
|
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
12118
|
"aria-label": "Decrement",
|
|
11608
|
-
children: /* @__PURE__ */
|
|
12119
|
+
children: /* @__PURE__ */ jsx144(Minus4, { size: 16, strokeWidth: 3, "aria-hidden": true })
|
|
11609
12120
|
}
|
|
11610
12121
|
),
|
|
11611
|
-
/* @__PURE__ */
|
|
12122
|
+
/* @__PURE__ */ jsx144(
|
|
11612
12123
|
"button",
|
|
11613
12124
|
{
|
|
11614
12125
|
type: "button",
|
|
11615
12126
|
onClick: onIncrement,
|
|
11616
12127
|
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
12128
|
"aria-label": "Increment",
|
|
11618
|
-
children: /* @__PURE__ */
|
|
12129
|
+
children: /* @__PURE__ */ jsx144(Plus3, { size: 16, strokeWidth: 3, "aria-hidden": true })
|
|
11619
12130
|
}
|
|
11620
12131
|
)
|
|
11621
12132
|
] })
|
|
11622
12133
|
]
|
|
11623
12134
|
}
|
|
11624
12135
|
),
|
|
11625
|
-
!errorMessage && optional && /* @__PURE__ */
|
|
12136
|
+
!errorMessage && optional && /* @__PURE__ */ jsx144(
|
|
11626
12137
|
"span",
|
|
11627
12138
|
{
|
|
11628
12139
|
"data-testid": `${name}-optional`,
|
|
@@ -11630,8 +12141,8 @@ var DashboardInput = React44.forwardRef(
|
|
|
11630
12141
|
children: typeof optional === "string" ? optional : t("optional")
|
|
11631
12142
|
}
|
|
11632
12143
|
),
|
|
11633
|
-
!errorMessage && helperText && /* @__PURE__ */
|
|
11634
|
-
errorMessage && renderErrorMessage && /* @__PURE__ */
|
|
12144
|
+
!errorMessage && helperText && /* @__PURE__ */ jsx144("span", { className: "mt-[1px] block text-[12px] font-normal text-[var(--chekin-color-gray-1)]", children: helperText }),
|
|
12145
|
+
errorMessage && renderErrorMessage && /* @__PURE__ */ jsx144(
|
|
11635
12146
|
FieldErrorMessage,
|
|
11636
12147
|
{
|
|
11637
12148
|
id: errorId,
|
|
@@ -11650,11 +12161,11 @@ DashboardInput.displayName = "DashboardInput";
|
|
|
11650
12161
|
|
|
11651
12162
|
// src/dashboard/select/Select.tsx
|
|
11652
12163
|
import * as React48 from "react";
|
|
11653
|
-
import { useTranslation as
|
|
12164
|
+
import { useTranslation as useTranslation30 } from "react-i18next";
|
|
11654
12165
|
|
|
11655
12166
|
// src/dashboard/_select-internals/SelectFieldShell.tsx
|
|
11656
|
-
import { useTranslation as
|
|
11657
|
-
import { jsx as
|
|
12167
|
+
import { useTranslation as useTranslation27 } from "react-i18next";
|
|
12168
|
+
import { jsx as jsx145, jsxs as jsxs92 } from "react/jsx-runtime";
|
|
11658
12169
|
function SelectFieldShell({
|
|
11659
12170
|
containerRef,
|
|
11660
12171
|
className,
|
|
@@ -11673,9 +12184,9 @@ function SelectFieldShell({
|
|
|
11673
12184
|
onBlur,
|
|
11674
12185
|
children
|
|
11675
12186
|
}) {
|
|
11676
|
-
const { t } =
|
|
12187
|
+
const { t } = useTranslation27();
|
|
11677
12188
|
const wrapperWidth = toCssSize(width);
|
|
11678
|
-
return /* @__PURE__ */
|
|
12189
|
+
return /* @__PURE__ */ jsxs92(
|
|
11679
12190
|
"div",
|
|
11680
12191
|
{
|
|
11681
12192
|
ref: containerRef,
|
|
@@ -11688,9 +12199,9 @@ function SelectFieldShell({
|
|
|
11688
12199
|
),
|
|
11689
12200
|
style: wrapperWidth ? { width: wrapperWidth } : void 0,
|
|
11690
12201
|
children: [
|
|
11691
|
-
name && /* @__PURE__ */
|
|
11692
|
-
/* @__PURE__ */
|
|
11693
|
-
topLabel && /* @__PURE__ */
|
|
12202
|
+
name && /* @__PURE__ */ jsx145("input", { type: "hidden", name, value: hiddenValue ?? "" }),
|
|
12203
|
+
/* @__PURE__ */ jsxs92("div", { className: "relative min-h-[68px] w-full", children: [
|
|
12204
|
+
topLabel && /* @__PURE__ */ jsx145(
|
|
11694
12205
|
"label",
|
|
11695
12206
|
{
|
|
11696
12207
|
htmlFor: triggerId,
|
|
@@ -11698,10 +12209,10 @@ function SelectFieldShell({
|
|
|
11698
12209
|
children: topLabel
|
|
11699
12210
|
}
|
|
11700
12211
|
),
|
|
11701
|
-
/* @__PURE__ */
|
|
11702
|
-
!errorMessage && optional && /* @__PURE__ */
|
|
11703
|
-
!errorMessage && helperText && /* @__PURE__ */
|
|
11704
|
-
errorMessage && !hideErrorMessage && /* @__PURE__ */
|
|
12212
|
+
/* @__PURE__ */ jsx145("div", { className: "relative w-full", children }),
|
|
12213
|
+
!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") }),
|
|
12214
|
+
!errorMessage && helperText && /* @__PURE__ */ jsx145("span", { className: "mt-[1px] block text-[12px] font-normal text-[var(--chekin-color-gray-1)]", children: helperText }),
|
|
12215
|
+
errorMessage && !hideErrorMessage && /* @__PURE__ */ jsx145(
|
|
11705
12216
|
FieldErrorMessage,
|
|
11706
12217
|
{
|
|
11707
12218
|
id: errorId,
|
|
@@ -11716,7 +12227,7 @@ function SelectFieldShell({
|
|
|
11716
12227
|
}
|
|
11717
12228
|
|
|
11718
12229
|
// src/dashboard/_select-internals/SelectMenu.tsx
|
|
11719
|
-
import { useTranslation as
|
|
12230
|
+
import { useTranslation as useTranslation28 } from "react-i18next";
|
|
11720
12231
|
|
|
11721
12232
|
// src/dashboard/_select-internals/utils.ts
|
|
11722
12233
|
function getOptionIndex(options, option) {
|
|
@@ -11747,7 +12258,7 @@ function isOptionSelected(option, selectedValue, selectedValues) {
|
|
|
11747
12258
|
}
|
|
11748
12259
|
|
|
11749
12260
|
// src/dashboard/_select-internals/SelectMenu.tsx
|
|
11750
|
-
import { jsx as
|
|
12261
|
+
import { jsx as jsx146, jsxs as jsxs93 } from "react/jsx-runtime";
|
|
11751
12262
|
function SelectMenu({
|
|
11752
12263
|
id,
|
|
11753
12264
|
options,
|
|
@@ -11769,10 +12280,10 @@ function SelectMenu({
|
|
|
11769
12280
|
emptyContent,
|
|
11770
12281
|
footer
|
|
11771
12282
|
}) {
|
|
11772
|
-
const { t } =
|
|
12283
|
+
const { t } = useTranslation28();
|
|
11773
12284
|
const emptyMessage = noOptionsMessage?.() ?? t("no_options");
|
|
11774
12285
|
const hasOptions = options.length > 0;
|
|
11775
|
-
return /* @__PURE__ */
|
|
12286
|
+
return /* @__PURE__ */ jsxs93(
|
|
11776
12287
|
"div",
|
|
11777
12288
|
{
|
|
11778
12289
|
id,
|
|
@@ -11789,13 +12300,13 @@ function SelectMenu({
|
|
|
11789
12300
|
menuClassName
|
|
11790
12301
|
),
|
|
11791
12302
|
children: [
|
|
11792
|
-
!hasOptions && (emptyContent ?? /* @__PURE__ */
|
|
12303
|
+
!hasOptions && (emptyContent ?? /* @__PURE__ */ jsx146("div", { className: "mt-[10px] text-left text-[16px] text-[var(--chekin-color-brand-navy)]", children: emptyMessage })),
|
|
11793
12304
|
options.map((option, index) => {
|
|
11794
12305
|
const isSelected = isOptionSelected(option, selectedValue, selectedValues);
|
|
11795
12306
|
const isHighlighted = index === highlightedIndex;
|
|
11796
12307
|
const optionKey = `${String(option.value)}-${index}`;
|
|
11797
12308
|
const isOptionDisabled = Boolean(disabled || option.isDisabled);
|
|
11798
|
-
return /* @__PURE__ */
|
|
12309
|
+
return /* @__PURE__ */ jsxs93(
|
|
11799
12310
|
"button",
|
|
11800
12311
|
{
|
|
11801
12312
|
id: getOptionId2(index),
|
|
@@ -11818,8 +12329,8 @@ function SelectMenu({
|
|
|
11818
12329
|
isOptionDisabled && "cursor-default opacity-30"
|
|
11819
12330
|
),
|
|
11820
12331
|
children: [
|
|
11821
|
-
/* @__PURE__ */
|
|
11822
|
-
option.description && /* @__PURE__ */
|
|
12332
|
+
/* @__PURE__ */ jsx146("span", { className: "block break-words", children: option.label }),
|
|
12333
|
+
option.description && /* @__PURE__ */ jsx146("span", { className: "ml-2 mt-[3px] shrink-0 text-[12px] font-bold italic text-[#777e91]", children: option.description })
|
|
11823
12334
|
]
|
|
11824
12335
|
},
|
|
11825
12336
|
optionKey
|
|
@@ -11832,11 +12343,11 @@ function SelectMenu({
|
|
|
11832
12343
|
}
|
|
11833
12344
|
|
|
11834
12345
|
// src/dashboard/_select-internals/SelectMenuPanel.tsx
|
|
11835
|
-
import { useTranslation as
|
|
11836
|
-
import { jsx as
|
|
12346
|
+
import { useTranslation as useTranslation29 } from "react-i18next";
|
|
12347
|
+
import { jsx as jsx147, jsxs as jsxs94 } from "react/jsx-runtime";
|
|
11837
12348
|
function SelectMenuPanel({
|
|
11838
12349
|
isOpen,
|
|
11839
|
-
isMobile:
|
|
12350
|
+
isMobile: isMobile3,
|
|
11840
12351
|
onClose,
|
|
11841
12352
|
title,
|
|
11842
12353
|
description,
|
|
@@ -11845,29 +12356,29 @@ function SelectMenuPanel({
|
|
|
11845
12356
|
drawerContentClassName,
|
|
11846
12357
|
children
|
|
11847
12358
|
}) {
|
|
11848
|
-
const { t } =
|
|
12359
|
+
const { t } = useTranslation29();
|
|
11849
12360
|
if (!isOpen) return null;
|
|
11850
|
-
if (
|
|
12361
|
+
if (isMobile3) {
|
|
11851
12362
|
const fallbackTitle = t("select_option");
|
|
11852
12363
|
const titleText = typeof title === "string" || typeof title === "number" ? String(title) : fallbackTitle;
|
|
11853
12364
|
const descriptionText = typeof description === "string" || typeof description === "number" ? String(description) : titleText;
|
|
11854
|
-
return /* @__PURE__ */
|
|
12365
|
+
return /* @__PURE__ */ jsx147(
|
|
11855
12366
|
Drawer,
|
|
11856
12367
|
{
|
|
11857
12368
|
open: isOpen,
|
|
11858
12369
|
onOpenChange: (next) => {
|
|
11859
12370
|
if (!next) onClose();
|
|
11860
12371
|
},
|
|
11861
|
-
children: /* @__PURE__ */
|
|
12372
|
+
children: /* @__PURE__ */ jsxs94(
|
|
11862
12373
|
DrawerContent,
|
|
11863
12374
|
{
|
|
11864
12375
|
onClose,
|
|
11865
12376
|
lockScroll: false,
|
|
11866
12377
|
className: cn("max-h-[calc(100vh-1rem)]", drawerClassName),
|
|
11867
12378
|
children: [
|
|
11868
|
-
/* @__PURE__ */
|
|
11869
|
-
/* @__PURE__ */
|
|
11870
|
-
/* @__PURE__ */
|
|
12379
|
+
/* @__PURE__ */ jsx147(DrawerTitle, { className: "sr-only", children: titleText }),
|
|
12380
|
+
/* @__PURE__ */ jsx147(DrawerDescription, { className: "sr-only", children: descriptionText }),
|
|
12381
|
+
/* @__PURE__ */ jsx147(
|
|
11871
12382
|
"div",
|
|
11872
12383
|
{
|
|
11873
12384
|
className: cn(
|
|
@@ -11883,7 +12394,7 @@ function SelectMenuPanel({
|
|
|
11883
12394
|
}
|
|
11884
12395
|
);
|
|
11885
12396
|
}
|
|
11886
|
-
return /* @__PURE__ */
|
|
12397
|
+
return /* @__PURE__ */ jsx147(
|
|
11887
12398
|
"div",
|
|
11888
12399
|
{
|
|
11889
12400
|
className: cn(
|
|
@@ -11896,7 +12407,7 @@ function SelectMenuPanel({
|
|
|
11896
12407
|
}
|
|
11897
12408
|
|
|
11898
12409
|
// src/dashboard/_select-internals/SelectSearchInput.tsx
|
|
11899
|
-
import { jsx as
|
|
12410
|
+
import { jsx as jsx148 } from "react/jsx-runtime";
|
|
11900
12411
|
function SelectSearchInput({
|
|
11901
12412
|
inputRef,
|
|
11902
12413
|
value,
|
|
@@ -11906,7 +12417,7 @@ function SelectSearchInput({
|
|
|
11906
12417
|
onChange,
|
|
11907
12418
|
onKeyDown
|
|
11908
12419
|
}) {
|
|
11909
|
-
return /* @__PURE__ */
|
|
12420
|
+
return /* @__PURE__ */ jsx148("div", { className: "border-b border-[#f2f4f8] px-4 pb-2 pt-3", children: /* @__PURE__ */ jsx148(
|
|
11910
12421
|
"input",
|
|
11911
12422
|
{
|
|
11912
12423
|
ref: inputRef,
|
|
@@ -11925,7 +12436,7 @@ function SelectSearchInput({
|
|
|
11925
12436
|
|
|
11926
12437
|
// src/dashboard/_select-internals/SelectTrigger.tsx
|
|
11927
12438
|
import { ChevronDown as ChevronDown2 } from "lucide-react";
|
|
11928
|
-
import { jsx as
|
|
12439
|
+
import { jsx as jsx149, jsxs as jsxs95 } from "react/jsx-runtime";
|
|
11929
12440
|
function SelectTrigger({
|
|
11930
12441
|
triggerRef,
|
|
11931
12442
|
triggerId,
|
|
@@ -11946,7 +12457,7 @@ function SelectTrigger({
|
|
|
11946
12457
|
onBlur
|
|
11947
12458
|
}) {
|
|
11948
12459
|
const isEmpty = !hasValue;
|
|
11949
|
-
return /* @__PURE__ */
|
|
12460
|
+
return /* @__PURE__ */ jsxs95(
|
|
11950
12461
|
"button",
|
|
11951
12462
|
{
|
|
11952
12463
|
id: triggerId,
|
|
@@ -11970,10 +12481,10 @@ function SelectTrigger({
|
|
|
11970
12481
|
loading && "cursor-progress"
|
|
11971
12482
|
),
|
|
11972
12483
|
children: [
|
|
11973
|
-
/* @__PURE__ */
|
|
11974
|
-
/* @__PURE__ */
|
|
11975
|
-
loading && /* @__PURE__ */
|
|
11976
|
-
/* @__PURE__ */
|
|
12484
|
+
/* @__PURE__ */ jsx149("span", { id: valueId, className: "block min-w-0 flex-1 truncate text-left", children: valueLabel ?? (isOpen ? placeholder : null) }),
|
|
12485
|
+
/* @__PURE__ */ jsxs95("span", { className: "pointer-events-none flex items-center gap-2 text-[var(--chekin-color-gray-2)]", children: [
|
|
12486
|
+
loading && /* @__PURE__ */ jsx149(ThreeDotsLoader, { height: 18, width: 18 }),
|
|
12487
|
+
/* @__PURE__ */ jsx149(
|
|
11977
12488
|
ChevronDown2,
|
|
11978
12489
|
{
|
|
11979
12490
|
size: 16,
|
|
@@ -12028,7 +12539,7 @@ function useSelectIds({
|
|
|
12028
12539
|
import * as React46 from "react";
|
|
12029
12540
|
function useSelectMenuState({
|
|
12030
12541
|
isBlocked,
|
|
12031
|
-
isMobile:
|
|
12542
|
+
isMobile: isMobile3,
|
|
12032
12543
|
onOutsideClick
|
|
12033
12544
|
}) {
|
|
12034
12545
|
const containerRef = React46.useRef(null);
|
|
@@ -12049,7 +12560,7 @@ function useSelectMenuState({
|
|
|
12049
12560
|
setIsOpen(false);
|
|
12050
12561
|
onOutsideClick?.();
|
|
12051
12562
|
},
|
|
12052
|
-
isDisabled: !isOpen ||
|
|
12563
|
+
isDisabled: !isOpen || isMobile3
|
|
12053
12564
|
});
|
|
12054
12565
|
React46.useEffect(() => {
|
|
12055
12566
|
if (isBlocked) setIsOpen(false);
|
|
@@ -12074,7 +12585,7 @@ function useSelectSearch({
|
|
|
12074
12585
|
}
|
|
12075
12586
|
|
|
12076
12587
|
// src/dashboard/select/Select.tsx
|
|
12077
|
-
import { jsx as
|
|
12588
|
+
import { jsx as jsx150, jsxs as jsxs96 } from "react/jsx-runtime";
|
|
12078
12589
|
function DashboardSelectInternal({
|
|
12079
12590
|
options = [],
|
|
12080
12591
|
value,
|
|
@@ -12108,8 +12619,8 @@ function DashboardSelectInternal({
|
|
|
12108
12619
|
const listRef = React48.useRef(null);
|
|
12109
12620
|
const optionRefs = React48.useRef([]);
|
|
12110
12621
|
const [highlightedIndex, setHighlightedIndex] = React48.useState(-1);
|
|
12111
|
-
const
|
|
12112
|
-
const { t } =
|
|
12622
|
+
const isMobile3 = useIsMobile();
|
|
12623
|
+
const { t } = useTranslation30();
|
|
12113
12624
|
const resolvedSearchPlaceholder = searchPlaceholder ?? t("search_placeholder");
|
|
12114
12625
|
const hasValue = Boolean(value);
|
|
12115
12626
|
const isBlocked = Boolean(disabled) || Boolean(loading);
|
|
@@ -12119,7 +12630,7 @@ function DashboardSelectInternal({
|
|
|
12119
12630
|
const valueLabel = value ? getValueLabel?.(value) ?? String(value.label) : void 0;
|
|
12120
12631
|
const { containerRef, isOpen, closeMenu, toggleMenu, setIsOpen } = useSelectMenuState({
|
|
12121
12632
|
isBlocked,
|
|
12122
|
-
isMobile:
|
|
12633
|
+
isMobile: isMobile3
|
|
12123
12634
|
});
|
|
12124
12635
|
const { triggerId, labelId, valueId, listboxId, describedErrorId, errorId, getOptionId: getOptionId2 } = useSelectIds({ name, hasValue, error, hideErrorMessage });
|
|
12125
12636
|
const { searchValue, setSearchValue, filteredOptions } = useSelectSearch({
|
|
@@ -12198,7 +12709,7 @@ function DashboardSelectInternal({
|
|
|
12198
12709
|
setIsOpen(false);
|
|
12199
12710
|
}
|
|
12200
12711
|
};
|
|
12201
|
-
return /* @__PURE__ */
|
|
12712
|
+
return /* @__PURE__ */ jsxs96(
|
|
12202
12713
|
SelectFieldShell,
|
|
12203
12714
|
{
|
|
12204
12715
|
containerRef,
|
|
@@ -12216,7 +12727,7 @@ function DashboardSelectInternal({
|
|
|
12216
12727
|
name,
|
|
12217
12728
|
hiddenValue: value ? String(value.value) : "",
|
|
12218
12729
|
children: [
|
|
12219
|
-
/* @__PURE__ */
|
|
12730
|
+
/* @__PURE__ */ jsx150(
|
|
12220
12731
|
SelectTrigger,
|
|
12221
12732
|
{
|
|
12222
12733
|
triggerRef,
|
|
@@ -12238,7 +12749,7 @@ function DashboardSelectInternal({
|
|
|
12238
12749
|
onBlur
|
|
12239
12750
|
}
|
|
12240
12751
|
),
|
|
12241
|
-
/* @__PURE__ */
|
|
12752
|
+
/* @__PURE__ */ jsx150(
|
|
12242
12753
|
Fieldset,
|
|
12243
12754
|
{
|
|
12244
12755
|
isFocused: isOpen,
|
|
@@ -12255,17 +12766,17 @@ function DashboardSelectInternal({
|
|
|
12255
12766
|
onClick: !isBlocked ? toggleMenu : void 0
|
|
12256
12767
|
}
|
|
12257
12768
|
),
|
|
12258
|
-
/* @__PURE__ */
|
|
12769
|
+
/* @__PURE__ */ jsxs96(
|
|
12259
12770
|
SelectMenuPanel,
|
|
12260
12771
|
{
|
|
12261
12772
|
isOpen,
|
|
12262
|
-
isMobile:
|
|
12773
|
+
isMobile: isMobile3,
|
|
12263
12774
|
onClose: closeMenu,
|
|
12264
12775
|
title: typeof label === "string" ? label : void 0,
|
|
12265
12776
|
className: dropdownClassName,
|
|
12266
12777
|
drawerClassName,
|
|
12267
12778
|
children: [
|
|
12268
|
-
searchable && /* @__PURE__ */
|
|
12779
|
+
searchable && /* @__PURE__ */ jsx150(
|
|
12269
12780
|
SelectSearchInput,
|
|
12270
12781
|
{
|
|
12271
12782
|
inputRef: searchInputRef,
|
|
@@ -12277,7 +12788,7 @@ function DashboardSelectInternal({
|
|
|
12277
12788
|
onKeyDown: handleSearchKeyDown
|
|
12278
12789
|
}
|
|
12279
12790
|
),
|
|
12280
|
-
/* @__PURE__ */
|
|
12791
|
+
/* @__PURE__ */ jsx150(
|
|
12281
12792
|
SelectMenu,
|
|
12282
12793
|
{
|
|
12283
12794
|
id: listboxId,
|
|
@@ -12312,22 +12823,22 @@ var DashboardSelect = React48.forwardRef(
|
|
|
12312
12823
|
// src/dashboard/multi-select/MultiSelect.tsx
|
|
12313
12824
|
import * as React49 from "react";
|
|
12314
12825
|
import { SquareX as SquareX3 } from "lucide-react";
|
|
12315
|
-
import { useTranslation as
|
|
12826
|
+
import { useTranslation as useTranslation32 } from "react-i18next";
|
|
12316
12827
|
|
|
12317
12828
|
// src/dashboard/multi-select/MultiSelectChip.tsx
|
|
12318
12829
|
import { SquareX as SquareX2 } from "lucide-react";
|
|
12319
|
-
import { useTranslation as
|
|
12320
|
-
import { jsx as
|
|
12830
|
+
import { useTranslation as useTranslation31 } from "react-i18next";
|
|
12831
|
+
import { jsx as jsx151, jsxs as jsxs97 } from "react/jsx-runtime";
|
|
12321
12832
|
function MultiSelectChip({
|
|
12322
12833
|
option,
|
|
12323
12834
|
readOnly,
|
|
12324
12835
|
onRemove
|
|
12325
12836
|
}) {
|
|
12326
|
-
const { t } =
|
|
12837
|
+
const { t } = useTranslation31();
|
|
12327
12838
|
const labelText = typeof option.label === "string" ? option.label : String(option.value);
|
|
12328
|
-
return /* @__PURE__ */
|
|
12329
|
-
/* @__PURE__ */
|
|
12330
|
-
!readOnly && /* @__PURE__ */
|
|
12839
|
+
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: [
|
|
12840
|
+
/* @__PURE__ */ jsx151("span", { className: "whitespace-nowrap", children: option.label }),
|
|
12841
|
+
!readOnly && /* @__PURE__ */ jsx151(
|
|
12331
12842
|
"button",
|
|
12332
12843
|
{
|
|
12333
12844
|
type: "button",
|
|
@@ -12337,14 +12848,14 @@ function MultiSelectChip({
|
|
|
12337
12848
|
},
|
|
12338
12849
|
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
12850
|
"aria-label": t("remove_item", { label: labelText }),
|
|
12340
|
-
children: /* @__PURE__ */
|
|
12851
|
+
children: /* @__PURE__ */ jsx151(SquareX2, { size: 15, fill: "#9696b9", color: "#f8f8f8", strokeWidth: 1.8 })
|
|
12341
12852
|
}
|
|
12342
12853
|
)
|
|
12343
12854
|
] });
|
|
12344
12855
|
}
|
|
12345
12856
|
|
|
12346
12857
|
// src/dashboard/multi-select/MultiSelect.tsx
|
|
12347
|
-
import { jsx as
|
|
12858
|
+
import { jsx as jsx152, jsxs as jsxs98 } from "react/jsx-runtime";
|
|
12348
12859
|
var isValueSelected = (selected, option) => selected.some((item) => item.value === option.value);
|
|
12349
12860
|
function DashboardMultiSelectInternal({
|
|
12350
12861
|
options = [],
|
|
@@ -12384,8 +12895,8 @@ function DashboardMultiSelectInternal({
|
|
|
12384
12895
|
const optionRefs = React49.useRef([]);
|
|
12385
12896
|
const [isFocused, setIsFocused] = React49.useState(false);
|
|
12386
12897
|
const [highlightedIndex, setHighlightedIndex] = React49.useState(-1);
|
|
12387
|
-
const
|
|
12388
|
-
const { t } =
|
|
12898
|
+
const isMobile3 = useIsMobile();
|
|
12899
|
+
const { t } = useTranslation32();
|
|
12389
12900
|
const selectedValues = React49.useMemo(() => value ?? [], [value]);
|
|
12390
12901
|
const hasValue = selectedValues.length > 0;
|
|
12391
12902
|
const isEmpty = !hasValue;
|
|
@@ -12395,7 +12906,7 @@ function DashboardMultiSelectInternal({
|
|
|
12395
12906
|
const errorMessage = typeof error === "string" ? error : void 0;
|
|
12396
12907
|
const { containerRef, isOpen, closeMenu, setIsOpen } = useSelectMenuState({
|
|
12397
12908
|
isBlocked,
|
|
12398
|
-
isMobile:
|
|
12909
|
+
isMobile: isMobile3,
|
|
12399
12910
|
onOutsideClick: () => setIsFocused(false)
|
|
12400
12911
|
});
|
|
12401
12912
|
const { triggerId, labelId, valueId, listboxId, describedErrorId, errorId, getOptionId: getOptionId2 } = useSelectIds({ name, hasValue, error, hideErrorMessage });
|
|
@@ -12437,12 +12948,12 @@ function DashboardMultiSelectInternal({
|
|
|
12437
12948
|
});
|
|
12438
12949
|
}, [isOpen, filteredOptions]);
|
|
12439
12950
|
React49.useEffect(() => {
|
|
12440
|
-
if (!isOpen || !
|
|
12951
|
+
if (!isOpen || !isMobile3) return;
|
|
12441
12952
|
const frame = window.requestAnimationFrame(
|
|
12442
12953
|
() => mobileSearchInputRef.current?.focus()
|
|
12443
12954
|
);
|
|
12444
12955
|
return () => window.cancelAnimationFrame(frame);
|
|
12445
|
-
}, [isOpen,
|
|
12956
|
+
}, [isOpen, isMobile3]);
|
|
12446
12957
|
const openMenu = () => {
|
|
12447
12958
|
if (isBlocked) return;
|
|
12448
12959
|
setIsOpen(true);
|
|
@@ -12539,7 +13050,7 @@ function DashboardMultiSelectInternal({
|
|
|
12539
13050
|
setIsFocused(false);
|
|
12540
13051
|
onBlur?.(event);
|
|
12541
13052
|
};
|
|
12542
|
-
return /* @__PURE__ */
|
|
13053
|
+
return /* @__PURE__ */ jsxs98(
|
|
12543
13054
|
SelectFieldShell,
|
|
12544
13055
|
{
|
|
12545
13056
|
containerRef,
|
|
@@ -12558,7 +13069,7 @@ function DashboardMultiSelectInternal({
|
|
|
12558
13069
|
hiddenValue: selectedValues.map((item) => String(item.value)).join(","),
|
|
12559
13070
|
onBlur: handleInputBlur,
|
|
12560
13071
|
children: [
|
|
12561
|
-
/* @__PURE__ */
|
|
13072
|
+
/* @__PURE__ */ jsxs98(
|
|
12562
13073
|
"div",
|
|
12563
13074
|
{
|
|
12564
13075
|
id: triggerId,
|
|
@@ -12581,7 +13092,7 @@ function DashboardMultiSelectInternal({
|
|
|
12581
13092
|
),
|
|
12582
13093
|
children: [
|
|
12583
13094
|
selectedValues.map(
|
|
12584
|
-
(option) => renderChip ? /* @__PURE__ */
|
|
13095
|
+
(option) => renderChip ? /* @__PURE__ */ jsx152(React49.Fragment, { children: renderChip(option, () => removeOption(option)) }, String(option.value)) : /* @__PURE__ */ jsx152(
|
|
12585
13096
|
MultiSelectChip,
|
|
12586
13097
|
{
|
|
12587
13098
|
option,
|
|
@@ -12591,7 +13102,7 @@ function DashboardMultiSelectInternal({
|
|
|
12591
13102
|
String(option.value)
|
|
12592
13103
|
)
|
|
12593
13104
|
),
|
|
12594
|
-
/* @__PURE__ */
|
|
13105
|
+
/* @__PURE__ */ jsx152(
|
|
12595
13106
|
"input",
|
|
12596
13107
|
{
|
|
12597
13108
|
ref: inputRef,
|
|
@@ -12620,9 +13131,9 @@ function DashboardMultiSelectInternal({
|
|
|
12620
13131
|
"aria-activedescendant": isOpen && highlightedIndex >= 0 ? getOptionId2(highlightedIndex) : void 0
|
|
12621
13132
|
}
|
|
12622
13133
|
),
|
|
12623
|
-
/* @__PURE__ */
|
|
12624
|
-
loading && /* @__PURE__ */
|
|
12625
|
-
hasValue && !readOnly && /* @__PURE__ */
|
|
13134
|
+
/* @__PURE__ */ jsxs98("span", { className: "ml-auto flex items-center gap-2 pl-2 text-[var(--chekin-color-gray-2)]", children: [
|
|
13135
|
+
loading && /* @__PURE__ */ jsx152(ThreeDotsLoader, { height: 18, width: 18 }),
|
|
13136
|
+
hasValue && !readOnly && /* @__PURE__ */ jsx152(
|
|
12626
13137
|
"button",
|
|
12627
13138
|
{
|
|
12628
13139
|
type: "button",
|
|
@@ -12632,10 +13143,10 @@ function DashboardMultiSelectInternal({
|
|
|
12632
13143
|
},
|
|
12633
13144
|
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
13145
|
"aria-label": t("clear_all"),
|
|
12635
|
-
children: /* @__PURE__ */
|
|
13146
|
+
children: /* @__PURE__ */ jsx152(SquareX3, { size: 15, fill: "#9696b9", color: "#f8f8f8", strokeWidth: 1.8 })
|
|
12636
13147
|
}
|
|
12637
13148
|
),
|
|
12638
|
-
/* @__PURE__ */
|
|
13149
|
+
/* @__PURE__ */ jsx152(
|
|
12639
13150
|
RotateArrow,
|
|
12640
13151
|
{
|
|
12641
13152
|
shouldRotate: isOpen,
|
|
@@ -12648,7 +13159,7 @@ function DashboardMultiSelectInternal({
|
|
|
12648
13159
|
]
|
|
12649
13160
|
}
|
|
12650
13161
|
),
|
|
12651
|
-
/* @__PURE__ */
|
|
13162
|
+
/* @__PURE__ */ jsx152(
|
|
12652
13163
|
Fieldset,
|
|
12653
13164
|
{
|
|
12654
13165
|
isFocused: isFocused || isOpen,
|
|
@@ -12666,11 +13177,11 @@ function DashboardMultiSelectInternal({
|
|
|
12666
13177
|
onClick: handleContainerClick
|
|
12667
13178
|
}
|
|
12668
13179
|
),
|
|
12669
|
-
/* @__PURE__ */
|
|
13180
|
+
/* @__PURE__ */ jsxs98(
|
|
12670
13181
|
SelectMenuPanel,
|
|
12671
13182
|
{
|
|
12672
13183
|
isOpen,
|
|
12673
|
-
isMobile:
|
|
13184
|
+
isMobile: isMobile3,
|
|
12674
13185
|
onClose: () => {
|
|
12675
13186
|
closeMenu();
|
|
12676
13187
|
setIsFocused(false);
|
|
@@ -12679,7 +13190,7 @@ function DashboardMultiSelectInternal({
|
|
|
12679
13190
|
className: dropdownClassName,
|
|
12680
13191
|
drawerClassName,
|
|
12681
13192
|
children: [
|
|
12682
|
-
|
|
13193
|
+
isMobile3 && /* @__PURE__ */ jsx152("div", { className: "border-b border-[#f2f4f8] px-4 pb-2 pt-3", children: /* @__PURE__ */ jsx152(
|
|
12683
13194
|
"input",
|
|
12684
13195
|
{
|
|
12685
13196
|
ref: mobileSearchInputRef,
|
|
@@ -12694,7 +13205,7 @@ function DashboardMultiSelectInternal({
|
|
|
12694
13205
|
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
13206
|
}
|
|
12696
13207
|
) }),
|
|
12697
|
-
/* @__PURE__ */
|
|
13208
|
+
/* @__PURE__ */ jsx152(
|
|
12698
13209
|
SelectMenu,
|
|
12699
13210
|
{
|
|
12700
13211
|
id: listboxId,
|
|
@@ -12716,7 +13227,7 @@ function DashboardMultiSelectInternal({
|
|
|
12716
13227
|
isMulti: true
|
|
12717
13228
|
}
|
|
12718
13229
|
),
|
|
12719
|
-
canCreateNewOption && /* @__PURE__ */
|
|
13230
|
+
canCreateNewOption && /* @__PURE__ */ jsx152(
|
|
12720
13231
|
"button",
|
|
12721
13232
|
{
|
|
12722
13233
|
type: "button",
|
|
@@ -12738,20 +13249,20 @@ var DashboardMultiSelect = React49.forwardRef(
|
|
|
12738
13249
|
|
|
12739
13250
|
// src/dashboard/creatable-multi-select/CreatableMultiSelect.tsx
|
|
12740
13251
|
import * as React50 from "react";
|
|
12741
|
-
import { jsx as
|
|
13252
|
+
import { jsx as jsx153 } from "react/jsx-runtime";
|
|
12742
13253
|
var DashboardCreatableMultiSelect = React50.forwardRef(
|
|
12743
13254
|
function DashboardCreatableMultiSelect2(props, ref) {
|
|
12744
|
-
return /* @__PURE__ */
|
|
13255
|
+
return /* @__PURE__ */ jsx153(DashboardMultiSelect, { ref, ...props, isCreatable: true });
|
|
12745
13256
|
}
|
|
12746
13257
|
);
|
|
12747
13258
|
|
|
12748
13259
|
// src/dashboard/infinite-scroll-select/InfiniteScrollSelect.tsx
|
|
12749
13260
|
import * as React51 from "react";
|
|
12750
13261
|
import { useVirtualizer as useVirtualizer2 } from "@tanstack/react-virtual";
|
|
12751
|
-
import { useTranslation as
|
|
13262
|
+
import { useTranslation as useTranslation33 } from "react-i18next";
|
|
12752
13263
|
|
|
12753
13264
|
// src/dashboard/infinite-scroll-select/InfiniteScrollList.tsx
|
|
12754
|
-
import { jsx as
|
|
13265
|
+
import { jsx as jsx154, jsxs as jsxs99 } from "react/jsx-runtime";
|
|
12755
13266
|
function InfiniteScrollList({
|
|
12756
13267
|
scrollRef,
|
|
12757
13268
|
listboxId,
|
|
@@ -12772,13 +13283,13 @@ function InfiniteScrollList({
|
|
|
12772
13283
|
onHighlight
|
|
12773
13284
|
}) {
|
|
12774
13285
|
const virtualItems = virtualizer.getVirtualItems();
|
|
12775
|
-
return /* @__PURE__ */
|
|
13286
|
+
return /* @__PURE__ */ jsx154(
|
|
12776
13287
|
"div",
|
|
12777
13288
|
{
|
|
12778
13289
|
ref: scrollRef,
|
|
12779
13290
|
className: cn("overflow-y-auto", menuClassName),
|
|
12780
13291
|
style: { height: `${height}px` },
|
|
12781
|
-
children: /* @__PURE__ */
|
|
13292
|
+
children: /* @__PURE__ */ jsx154(
|
|
12782
13293
|
"div",
|
|
12783
13294
|
{
|
|
12784
13295
|
id: listboxId,
|
|
@@ -12795,7 +13306,7 @@ function InfiniteScrollList({
|
|
|
12795
13306
|
const isSelected = !isLoaderRow && option ? option.value === value?.value : false;
|
|
12796
13307
|
const isHighlighted = virtualItem.index === highlightedIndex;
|
|
12797
13308
|
const isOptionDisabled = Boolean(isBlocked || option?.isDisabled);
|
|
12798
|
-
return /* @__PURE__ */
|
|
13309
|
+
return /* @__PURE__ */ jsx154(
|
|
12799
13310
|
"div",
|
|
12800
13311
|
{
|
|
12801
13312
|
"data-index": virtualItem.index,
|
|
@@ -12804,10 +13315,10 @@ function InfiniteScrollList({
|
|
|
12804
13315
|
height: `${virtualItem.size}px`,
|
|
12805
13316
|
transform: `translateY(${virtualItem.start}px)`
|
|
12806
13317
|
},
|
|
12807
|
-
children: isLoaderRow ? /* @__PURE__ */
|
|
12808
|
-
/* @__PURE__ */
|
|
12809
|
-
/* @__PURE__ */
|
|
12810
|
-
] }) : /* @__PURE__ */
|
|
13318
|
+
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: [
|
|
13319
|
+
/* @__PURE__ */ jsx154(ThreeDotsLoader, { height: 36, width: 36 }),
|
|
13320
|
+
/* @__PURE__ */ jsx154("span", { children: loadingMoreText })
|
|
13321
|
+
] }) : /* @__PURE__ */ jsxs99(
|
|
12811
13322
|
"button",
|
|
12812
13323
|
{
|
|
12813
13324
|
id: getOptionId2(virtualItem.index),
|
|
@@ -12826,8 +13337,8 @@ function InfiniteScrollList({
|
|
|
12826
13337
|
isOptionDisabled && "cursor-default opacity-30"
|
|
12827
13338
|
),
|
|
12828
13339
|
children: [
|
|
12829
|
-
/* @__PURE__ */
|
|
12830
|
-
option?.description && /* @__PURE__ */
|
|
13340
|
+
/* @__PURE__ */ jsx154("span", { className: "block break-words", children: option?.label }),
|
|
13341
|
+
option?.description && /* @__PURE__ */ jsx154("span", { className: "ml-2 mt-[3px] shrink-0 text-[12px] font-bold italic text-[#777e91]", children: option.description })
|
|
12831
13342
|
]
|
|
12832
13343
|
}
|
|
12833
13344
|
)
|
|
@@ -12842,7 +13353,7 @@ function InfiniteScrollList({
|
|
|
12842
13353
|
}
|
|
12843
13354
|
|
|
12844
13355
|
// src/dashboard/infinite-scroll-select/InfiniteScrollSelect.tsx
|
|
12845
|
-
import { jsx as
|
|
13356
|
+
import { jsx as jsx155, jsxs as jsxs100 } from "react/jsx-runtime";
|
|
12846
13357
|
var DEFAULT_ITEM_HEIGHT = 60;
|
|
12847
13358
|
var DEFAULT_LIST_HEIGHT = 322;
|
|
12848
13359
|
var DEFAULT_OVERSCAN = 5;
|
|
@@ -12890,8 +13401,8 @@ function DashboardInfiniteScrollSelectInternal({
|
|
|
12890
13401
|
const previousHighlightedIndexRef = React51.useRef(-1);
|
|
12891
13402
|
const lastLoadMoreOptionsLengthRef = React51.useRef(null);
|
|
12892
13403
|
const [highlightedIndex, setHighlightedIndex] = React51.useState(-1);
|
|
12893
|
-
const
|
|
12894
|
-
const { t } =
|
|
13404
|
+
const isMobile3 = useIsMobile();
|
|
13405
|
+
const { t } = useTranslation33();
|
|
12895
13406
|
const resolvedSearchPlaceholder = searchPlaceholder ?? t("search_placeholder");
|
|
12896
13407
|
const resolvedLoadingMoreText = loadingMoreText ?? t("loading_more");
|
|
12897
13408
|
const hasValue = Boolean(value);
|
|
@@ -12902,7 +13413,7 @@ function DashboardInfiniteScrollSelectInternal({
|
|
|
12902
13413
|
const valueLabel = value ? getValueLabel?.(value) ?? String(value.label) : void 0;
|
|
12903
13414
|
const { containerRef, isOpen, closeMenu, toggleMenu, setIsOpen } = useSelectMenuState({
|
|
12904
13415
|
isBlocked,
|
|
12905
|
-
isMobile:
|
|
13416
|
+
isMobile: isMobile3
|
|
12906
13417
|
});
|
|
12907
13418
|
const { triggerId, labelId, valueId, listboxId, describedErrorId, errorId, getOptionId: getOptionId2 } = useSelectIds({ name, hasValue, error, hideErrorMessage });
|
|
12908
13419
|
const { searchValue, setSearchValue, filteredOptions } = useSelectSearch({
|
|
@@ -13015,7 +13526,7 @@ function DashboardInfiniteScrollSelectInternal({
|
|
|
13015
13526
|
const totalSize = virtualizer.getTotalSize();
|
|
13016
13527
|
const measuredListHeight = Math.min(listHeight, Math.max(totalSize, itemHeight));
|
|
13017
13528
|
const activeOptionId = highlightedIndex >= 0 ? getOptionId2(highlightedIndex) : void 0;
|
|
13018
|
-
return /* @__PURE__ */
|
|
13529
|
+
return /* @__PURE__ */ jsxs100(
|
|
13019
13530
|
SelectFieldShell,
|
|
13020
13531
|
{
|
|
13021
13532
|
containerRef,
|
|
@@ -13033,7 +13544,7 @@ function DashboardInfiniteScrollSelectInternal({
|
|
|
13033
13544
|
name,
|
|
13034
13545
|
hiddenValue: value ? String(value.value) : "",
|
|
13035
13546
|
children: [
|
|
13036
|
-
/* @__PURE__ */
|
|
13547
|
+
/* @__PURE__ */ jsx155(
|
|
13037
13548
|
SelectTrigger,
|
|
13038
13549
|
{
|
|
13039
13550
|
triggerRef,
|
|
@@ -13055,7 +13566,7 @@ function DashboardInfiniteScrollSelectInternal({
|
|
|
13055
13566
|
onBlur
|
|
13056
13567
|
}
|
|
13057
13568
|
),
|
|
13058
|
-
/* @__PURE__ */
|
|
13569
|
+
/* @__PURE__ */ jsx155(
|
|
13059
13570
|
Fieldset,
|
|
13060
13571
|
{
|
|
13061
13572
|
isFocused: isOpen,
|
|
@@ -13072,17 +13583,17 @@ function DashboardInfiniteScrollSelectInternal({
|
|
|
13072
13583
|
onClick: !isBlocked ? toggleMenu : void 0
|
|
13073
13584
|
}
|
|
13074
13585
|
),
|
|
13075
|
-
/* @__PURE__ */
|
|
13586
|
+
/* @__PURE__ */ jsxs100(
|
|
13076
13587
|
SelectMenuPanel,
|
|
13077
13588
|
{
|
|
13078
13589
|
isOpen,
|
|
13079
|
-
isMobile:
|
|
13590
|
+
isMobile: isMobile3,
|
|
13080
13591
|
onClose: closeMenu,
|
|
13081
13592
|
title: typeof label === "string" ? label : void 0,
|
|
13082
13593
|
className: dropdownClassName,
|
|
13083
13594
|
drawerClassName,
|
|
13084
13595
|
children: [
|
|
13085
|
-
searchable && /* @__PURE__ */
|
|
13596
|
+
searchable && /* @__PURE__ */ jsx155(
|
|
13086
13597
|
SelectSearchInput,
|
|
13087
13598
|
{
|
|
13088
13599
|
inputRef: searchInputRef,
|
|
@@ -13094,10 +13605,10 @@ function DashboardInfiniteScrollSelectInternal({
|
|
|
13094
13605
|
onKeyDown: handleSearchKeyDown
|
|
13095
13606
|
}
|
|
13096
13607
|
),
|
|
13097
|
-
filteredOptions.length === 0 && isLoadingMore ? /* @__PURE__ */
|
|
13098
|
-
/* @__PURE__ */
|
|
13099
|
-
/* @__PURE__ */
|
|
13100
|
-
] }) : filteredOptions.length === 0 ? /* @__PURE__ */
|
|
13608
|
+
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: [
|
|
13609
|
+
/* @__PURE__ */ jsx155(ThreeDotsLoader, { height: 18, width: 18 }),
|
|
13610
|
+
/* @__PURE__ */ jsx155("span", { children: resolvedLoadingMoreText })
|
|
13611
|
+
] }) : 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
13612
|
InfiniteScrollList,
|
|
13102
13613
|
{
|
|
13103
13614
|
scrollRef,
|
|
@@ -13132,8 +13643,8 @@ var DashboardInfiniteScrollSelect = React51.forwardRef(
|
|
|
13132
13643
|
|
|
13133
13644
|
// src/dashboard/textarea/Textarea.tsx
|
|
13134
13645
|
import * as React52 from "react";
|
|
13135
|
-
import { useTranslation as
|
|
13136
|
-
import { jsx as
|
|
13646
|
+
import { useTranslation as useTranslation34 } from "react-i18next";
|
|
13647
|
+
import { jsx as jsx156, jsxs as jsxs101 } from "react/jsx-runtime";
|
|
13137
13648
|
var LINE_HEIGHT = 20;
|
|
13138
13649
|
var VERTICAL_PADDING = 32;
|
|
13139
13650
|
function getEmptyState(empty, value, defaultValue) {
|
|
@@ -13169,7 +13680,7 @@ var DashboardTextarea = React52.forwardRef(
|
|
|
13169
13680
|
const combinedRef = useCombinedRef(ref, innerRef);
|
|
13170
13681
|
const reactId = React52.useId();
|
|
13171
13682
|
const textareaId = id ?? name ?? `dash-textarea-${reactId}`;
|
|
13172
|
-
const { t } =
|
|
13683
|
+
const { t } = useTranslation34();
|
|
13173
13684
|
const isInvalid = Boolean(invalid || error);
|
|
13174
13685
|
const isEmpty = getEmptyState(empty, value, defaultValue);
|
|
13175
13686
|
const isBlocked = Boolean(disabled);
|
|
@@ -13190,7 +13701,7 @@ var DashboardTextarea = React52.forwardRef(
|
|
|
13190
13701
|
resize();
|
|
13191
13702
|
onInput?.(event);
|
|
13192
13703
|
};
|
|
13193
|
-
return /* @__PURE__ */
|
|
13704
|
+
return /* @__PURE__ */ jsxs101(
|
|
13194
13705
|
"div",
|
|
13195
13706
|
{
|
|
13196
13707
|
className: cn(
|
|
@@ -13200,18 +13711,18 @@ var DashboardTextarea = React52.forwardRef(
|
|
|
13200
13711
|
className
|
|
13201
13712
|
),
|
|
13202
13713
|
children: [
|
|
13203
|
-
label && /* @__PURE__ */
|
|
13714
|
+
label && /* @__PURE__ */ jsxs101(
|
|
13204
13715
|
"label",
|
|
13205
13716
|
{
|
|
13206
13717
|
htmlFor: textareaId,
|
|
13207
13718
|
className: "mb-2 flex select-none items-center text-[16px] font-medium text-[var(--chekin-color-brand-navy)]",
|
|
13208
13719
|
children: [
|
|
13209
13720
|
label,
|
|
13210
|
-
tooltip && /* @__PURE__ */
|
|
13721
|
+
tooltip && /* @__PURE__ */ jsx156("span", { className: "ml-1 inline-flex", children: /* @__PURE__ */ jsx156(HelpTooltip, { content: tooltip, size: 16 }) })
|
|
13211
13722
|
]
|
|
13212
13723
|
}
|
|
13213
13724
|
),
|
|
13214
|
-
/* @__PURE__ */
|
|
13725
|
+
/* @__PURE__ */ jsx156(
|
|
13215
13726
|
"textarea",
|
|
13216
13727
|
{
|
|
13217
13728
|
ref: combinedRef,
|
|
@@ -13240,7 +13751,7 @@ var DashboardTextarea = React52.forwardRef(
|
|
|
13240
13751
|
...textareaProps
|
|
13241
13752
|
}
|
|
13242
13753
|
),
|
|
13243
|
-
error && /* @__PURE__ */
|
|
13754
|
+
error && /* @__PURE__ */ jsx156(
|
|
13244
13755
|
FieldErrorMessage,
|
|
13245
13756
|
{
|
|
13246
13757
|
id: `${textareaId}-error`,
|
|
@@ -13248,8 +13759,8 @@ var DashboardTextarea = React52.forwardRef(
|
|
|
13248
13759
|
className: "mt-[1px] text-[14px]"
|
|
13249
13760
|
}
|
|
13250
13761
|
),
|
|
13251
|
-
!error && optional && /* @__PURE__ */
|
|
13252
|
-
!error && helperText && /* @__PURE__ */
|
|
13762
|
+
!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") }),
|
|
13763
|
+
!error && helperText && /* @__PURE__ */ jsx156("span", { className: "mt-[1px] block text-[12px] font-normal text-[var(--chekin-color-gray-1)]", children: helperText })
|
|
13253
13764
|
]
|
|
13254
13765
|
}
|
|
13255
13766
|
);
|
|
@@ -13259,7 +13770,7 @@ var DashboardTextarea = React52.forwardRef(
|
|
|
13259
13770
|
// src/dashboard/datepicker/Datepicker.tsx
|
|
13260
13771
|
import * as React54 from "react";
|
|
13261
13772
|
import { ChevronDown as ChevronDown3 } from "lucide-react";
|
|
13262
|
-
import { useTranslation as
|
|
13773
|
+
import { useTranslation as useTranslation35 } from "react-i18next";
|
|
13263
13774
|
|
|
13264
13775
|
// src/airbnb-fields/datepicker/useDatePickerWheel.ts
|
|
13265
13776
|
import * as React53 from "react";
|
|
@@ -13683,7 +14194,7 @@ function useDatePickerWheel({
|
|
|
13683
14194
|
}
|
|
13684
14195
|
|
|
13685
14196
|
// src/airbnb-fields/datepicker/DatePickerWheelColumn.tsx
|
|
13686
|
-
import { jsx as
|
|
14197
|
+
import { jsx as jsx157, jsxs as jsxs102 } from "react/jsx-runtime";
|
|
13687
14198
|
var spacerHeight = DATE_PICKER_OPTION_HEIGHT * DATE_PICKER_WHEEL_BUFFER_OPTIONS;
|
|
13688
14199
|
function AirbnbDatePickerWheelColumn({
|
|
13689
14200
|
id,
|
|
@@ -13697,7 +14208,7 @@ function AirbnbDatePickerWheelColumn({
|
|
|
13697
14208
|
onOptionSelect,
|
|
13698
14209
|
column
|
|
13699
14210
|
}) {
|
|
13700
|
-
return /* @__PURE__ */
|
|
14211
|
+
return /* @__PURE__ */ jsx157("div", { className: "relative z-10 min-w-0", children: /* @__PURE__ */ jsxs102(
|
|
13701
14212
|
"div",
|
|
13702
14213
|
{
|
|
13703
14214
|
id,
|
|
@@ -13714,14 +14225,14 @@ function AirbnbDatePickerWheelColumn({
|
|
|
13714
14225
|
WebkitOverflowScrolling: "touch"
|
|
13715
14226
|
},
|
|
13716
14227
|
children: [
|
|
13717
|
-
/* @__PURE__ */
|
|
14228
|
+
/* @__PURE__ */ jsx157("div", { style: { height: `${spacerHeight}px` } }),
|
|
13718
14229
|
items.map((item, index) => {
|
|
13719
14230
|
const { style } = getWheelOptionStyles(
|
|
13720
14231
|
index,
|
|
13721
14232
|
scrollTop,
|
|
13722
14233
|
DATE_PICKER_OPTION_HEIGHT
|
|
13723
14234
|
);
|
|
13724
|
-
return /* @__PURE__ */
|
|
14235
|
+
return /* @__PURE__ */ jsx157(
|
|
13725
14236
|
"button",
|
|
13726
14237
|
{
|
|
13727
14238
|
id: `${id}-option-${index}`,
|
|
@@ -13737,14 +14248,14 @@ function AirbnbDatePickerWheelColumn({
|
|
|
13737
14248
|
`${column}-${item}-${index}`
|
|
13738
14249
|
);
|
|
13739
14250
|
}),
|
|
13740
|
-
/* @__PURE__ */
|
|
14251
|
+
/* @__PURE__ */ jsx157("div", { style: { height: `${spacerHeight}px` } })
|
|
13741
14252
|
]
|
|
13742
14253
|
}
|
|
13743
14254
|
) });
|
|
13744
14255
|
}
|
|
13745
14256
|
|
|
13746
14257
|
// src/airbnb-fields/datepicker/DatePickerContent.tsx
|
|
13747
|
-
import { jsx as
|
|
14258
|
+
import { jsx as jsx158, jsxs as jsxs103 } from "react/jsx-runtime";
|
|
13748
14259
|
function AirbnbDatePickerBody({
|
|
13749
14260
|
baseId,
|
|
13750
14261
|
label,
|
|
@@ -13766,19 +14277,19 @@ function AirbnbDatePickerBody({
|
|
|
13766
14277
|
onOptionSelect,
|
|
13767
14278
|
onDone
|
|
13768
14279
|
}) {
|
|
13769
|
-
return /* @__PURE__ */
|
|
13770
|
-
/* @__PURE__ */
|
|
13771
|
-
/* @__PURE__ */
|
|
13772
|
-
/* @__PURE__ */
|
|
13773
|
-
/* @__PURE__ */
|
|
14280
|
+
return /* @__PURE__ */ jsxs103("div", { className: "px-6 pb-4 pt-1 bg-white", children: [
|
|
14281
|
+
/* @__PURE__ */ jsxs103("div", { className: "relative overflow-hidden rounded-[24px]", children: [
|
|
14282
|
+
/* @__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" }),
|
|
14283
|
+
/* @__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" }),
|
|
14284
|
+
/* @__PURE__ */ jsx158(
|
|
13774
14285
|
"div",
|
|
13775
14286
|
{
|
|
13776
14287
|
"aria-hidden": true,
|
|
13777
14288
|
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
14289
|
}
|
|
13779
14290
|
),
|
|
13780
|
-
/* @__PURE__ */
|
|
13781
|
-
/* @__PURE__ */
|
|
14291
|
+
/* @__PURE__ */ jsxs103("div", { className: "relative grid grid-cols-[1.35fr_0.7fr_1fr] gap-1", children: [
|
|
14292
|
+
/* @__PURE__ */ jsx158(
|
|
13782
14293
|
AirbnbDatePickerWheelColumn,
|
|
13783
14294
|
{
|
|
13784
14295
|
id: `${baseId}-month`,
|
|
@@ -13793,7 +14304,7 @@ function AirbnbDatePickerBody({
|
|
|
13793
14304
|
onOptionSelect
|
|
13794
14305
|
}
|
|
13795
14306
|
),
|
|
13796
|
-
/* @__PURE__ */
|
|
14307
|
+
/* @__PURE__ */ jsx158(
|
|
13797
14308
|
AirbnbDatePickerWheelColumn,
|
|
13798
14309
|
{
|
|
13799
14310
|
id: `${baseId}-day`,
|
|
@@ -13808,7 +14319,7 @@ function AirbnbDatePickerBody({
|
|
|
13808
14319
|
onOptionSelect
|
|
13809
14320
|
}
|
|
13810
14321
|
),
|
|
13811
|
-
/* @__PURE__ */
|
|
14322
|
+
/* @__PURE__ */ jsx158(
|
|
13812
14323
|
AirbnbDatePickerWheelColumn,
|
|
13813
14324
|
{
|
|
13814
14325
|
id: `${baseId}-year`,
|
|
@@ -13825,13 +14336,13 @@ function AirbnbDatePickerBody({
|
|
|
13825
14336
|
)
|
|
13826
14337
|
] })
|
|
13827
14338
|
] }),
|
|
13828
|
-
/* @__PURE__ */
|
|
14339
|
+
/* @__PURE__ */ jsx158(Button, { type: "button", onClick: onDone, className: "mt-4 h-12 mb-8 w-full", children: doneLabel })
|
|
13829
14340
|
] });
|
|
13830
14341
|
}
|
|
13831
14342
|
function AirbnbDatePickerContent({
|
|
13832
14343
|
baseId,
|
|
13833
14344
|
open,
|
|
13834
|
-
isMobile:
|
|
14345
|
+
isMobile: isMobile3,
|
|
13835
14346
|
label,
|
|
13836
14347
|
title,
|
|
13837
14348
|
doneLabel,
|
|
@@ -13853,7 +14364,7 @@ function AirbnbDatePickerContent({
|
|
|
13853
14364
|
onColumnKeyDown,
|
|
13854
14365
|
onOptionSelect
|
|
13855
14366
|
}) {
|
|
13856
|
-
const body = /* @__PURE__ */
|
|
14367
|
+
const body = /* @__PURE__ */ jsx158(
|
|
13857
14368
|
AirbnbDatePickerBody,
|
|
13858
14369
|
{
|
|
13859
14370
|
baseId,
|
|
@@ -13877,28 +14388,28 @@ function AirbnbDatePickerContent({
|
|
|
13877
14388
|
onDone
|
|
13878
14389
|
}
|
|
13879
14390
|
);
|
|
13880
|
-
if (
|
|
13881
|
-
return /* @__PURE__ */
|
|
14391
|
+
if (isMobile3) {
|
|
14392
|
+
return /* @__PURE__ */ jsx158(Drawer, { open, onOpenChange, children: /* @__PURE__ */ jsxs103(
|
|
13882
14393
|
DrawerContent,
|
|
13883
14394
|
{
|
|
13884
14395
|
onClose: () => onOpenChange(false),
|
|
13885
14396
|
className: "rounded-none rounded-t-[32px] border-0 p-0",
|
|
13886
14397
|
children: [
|
|
13887
|
-
/* @__PURE__ */
|
|
13888
|
-
/* @__PURE__ */
|
|
14398
|
+
/* @__PURE__ */ jsx158(DrawerTitle, { className: "sr-only", children: title }),
|
|
14399
|
+
/* @__PURE__ */ jsx158(DrawerDescription, { className: "sr-only", children: label }),
|
|
13889
14400
|
body
|
|
13890
14401
|
]
|
|
13891
14402
|
}
|
|
13892
14403
|
) });
|
|
13893
14404
|
}
|
|
13894
|
-
return /* @__PURE__ */
|
|
14405
|
+
return /* @__PURE__ */ jsx158(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs103(
|
|
13895
14406
|
DialogContent,
|
|
13896
14407
|
{
|
|
13897
14408
|
className: "max-w-[520px] rounded-[28px] border-0 p-0 shadow-xl",
|
|
13898
14409
|
showCloseButton: false,
|
|
13899
14410
|
children: [
|
|
13900
|
-
/* @__PURE__ */
|
|
13901
|
-
/* @__PURE__ */
|
|
14411
|
+
/* @__PURE__ */ jsx158(DialogTitle, { className: "sr-only", children: title }),
|
|
14412
|
+
/* @__PURE__ */ jsx158(DialogDescription, { className: "sr-only", children: label }),
|
|
13902
14413
|
body
|
|
13903
14414
|
]
|
|
13904
14415
|
}
|
|
@@ -13906,7 +14417,7 @@ function AirbnbDatePickerContent({
|
|
|
13906
14417
|
}
|
|
13907
14418
|
|
|
13908
14419
|
// src/dashboard/datepicker/Datepicker.tsx
|
|
13909
|
-
import { jsx as
|
|
14420
|
+
import { jsx as jsx159, jsxs as jsxs104 } from "react/jsx-runtime";
|
|
13910
14421
|
var MONTHS_IN_YEAR2 = 12;
|
|
13911
14422
|
function getMonthLabels2(locale) {
|
|
13912
14423
|
const formatter = new Intl.DateTimeFormat(locale, { month: "long" });
|
|
@@ -13983,7 +14494,7 @@ var DashboardDatepicker = React54.forwardRef(
|
|
|
13983
14494
|
const yearId = `${baseId}-year`;
|
|
13984
14495
|
const labelId = `${baseId}-label`;
|
|
13985
14496
|
const errorId = `${baseId}-error`;
|
|
13986
|
-
const { t } =
|
|
14497
|
+
const { t } = useTranslation35();
|
|
13987
14498
|
const resolvedMonthLabels = React54.useMemo(
|
|
13988
14499
|
() => monthLabels ?? getMonthLabels2(locale),
|
|
13989
14500
|
[locale, monthLabels]
|
|
@@ -14006,7 +14517,7 @@ var DashboardDatepicker = React54.forwardRef(
|
|
|
14006
14517
|
const [focusedField, setFocusedField] = React54.useState(null);
|
|
14007
14518
|
const [monthInputValue, setMonthInputValue] = React54.useState("");
|
|
14008
14519
|
const [monthHighlightIndex, setMonthHighlightIndex] = React54.useState(-1);
|
|
14009
|
-
const
|
|
14520
|
+
const isMobile3 = useIsMobile();
|
|
14010
14521
|
React54.useImperativeHandle(ref, () => dayInputRef.current, []);
|
|
14011
14522
|
React54.useEffect(() => {
|
|
14012
14523
|
if (!isControlled) return;
|
|
@@ -14056,7 +14567,7 @@ var DashboardDatepicker = React54.forwardRef(
|
|
|
14056
14567
|
useOutsideClick({
|
|
14057
14568
|
elementRef: containerRef,
|
|
14058
14569
|
onOutsideClick: () => setIsMonthOpen(false),
|
|
14059
|
-
isDisabled: !isMonthOpen ||
|
|
14570
|
+
isDisabled: !isMonthOpen || isMobile3
|
|
14060
14571
|
});
|
|
14061
14572
|
const emitChange = React54.useCallback(
|
|
14062
14573
|
(nextDay, nextMonth, nextYear) => {
|
|
@@ -14165,7 +14676,7 @@ var DashboardDatepicker = React54.forwardRef(
|
|
|
14165
14676
|
setIsWheelOpen(false);
|
|
14166
14677
|
mobileTriggerRef.current?.focus();
|
|
14167
14678
|
}, []);
|
|
14168
|
-
const showCoverage = isEmpty && !isFocused && !
|
|
14679
|
+
const showCoverage = isEmpty && !isFocused && !isMobile3;
|
|
14169
14680
|
const wheel = useDatePickerWheel({
|
|
14170
14681
|
isOpen: isWheelOpen,
|
|
14171
14682
|
value: currentDate,
|
|
@@ -14189,7 +14700,7 @@ var DashboardDatepicker = React54.forwardRef(
|
|
|
14189
14700
|
const triggerText = currentDate ? (formatValue ?? defaultFormatValue)(currentDate) : void 0;
|
|
14190
14701
|
const monthListboxId = `${monthId}-listbox`;
|
|
14191
14702
|
const getMonthOptionId = (index) => `${monthId}-option-${index}`;
|
|
14192
|
-
const monthPanelContent = filteredMonths.length === 0 ? /* @__PURE__ */
|
|
14703
|
+
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
14704
|
"ul",
|
|
14194
14705
|
{
|
|
14195
14706
|
ref: monthListRef,
|
|
@@ -14200,7 +14711,7 @@ var DashboardDatepicker = React54.forwardRef(
|
|
|
14200
14711
|
children: filteredMonths.map((option, position) => {
|
|
14201
14712
|
const isSelected = option.index === monthIndex;
|
|
14202
14713
|
const isHighlighted = position === monthHighlightIndex;
|
|
14203
|
-
return /* @__PURE__ */
|
|
14714
|
+
return /* @__PURE__ */ jsx159("li", { role: "presentation", children: /* @__PURE__ */ jsx159(
|
|
14204
14715
|
"button",
|
|
14205
14716
|
{
|
|
14206
14717
|
id: getMonthOptionId(option.index),
|
|
@@ -14227,7 +14738,7 @@ var DashboardDatepicker = React54.forwardRef(
|
|
|
14227
14738
|
isBlocked && "cursor-not-allowed",
|
|
14228
14739
|
loading && "cursor-progress"
|
|
14229
14740
|
);
|
|
14230
|
-
return /* @__PURE__ */
|
|
14741
|
+
return /* @__PURE__ */ jsx159(
|
|
14231
14742
|
"div",
|
|
14232
14743
|
{
|
|
14233
14744
|
ref: containerRef,
|
|
@@ -14238,9 +14749,9 @@ var DashboardDatepicker = React54.forwardRef(
|
|
|
14238
14749
|
className
|
|
14239
14750
|
),
|
|
14240
14751
|
style: wrapperWidth ? { width: wrapperWidth } : void 0,
|
|
14241
|
-
children: /* @__PURE__ */
|
|
14242
|
-
/* @__PURE__ */
|
|
14243
|
-
|
|
14752
|
+
children: /* @__PURE__ */ jsxs104("div", { className: "relative min-h-[68px] w-full", children: [
|
|
14753
|
+
/* @__PURE__ */ jsxs104("div", { className: "relative w-full", children: [
|
|
14754
|
+
isMobile3 ? /* @__PURE__ */ jsxs104(
|
|
14244
14755
|
"button",
|
|
14245
14756
|
{
|
|
14246
14757
|
ref: mobileTriggerRef,
|
|
@@ -14259,10 +14770,10 @@ var DashboardDatepicker = React54.forwardRef(
|
|
|
14259
14770
|
(isBlocked || readOnly) && "cursor-not-allowed"
|
|
14260
14771
|
),
|
|
14261
14772
|
children: [
|
|
14262
|
-
/* @__PURE__ */
|
|
14263
|
-
/* @__PURE__ */
|
|
14264
|
-
loading && /* @__PURE__ */
|
|
14265
|
-
/* @__PURE__ */
|
|
14773
|
+
/* @__PURE__ */ jsx159("span", { className: "block min-w-0 flex-1 truncate text-left", children: triggerText ?? (isWheelOpen ? mobilePlaceholder : null) }),
|
|
14774
|
+
/* @__PURE__ */ jsxs104("span", { className: "pointer-events-none flex items-center gap-2 text-[var(--chekin-color-gray-2)]", children: [
|
|
14775
|
+
loading && /* @__PURE__ */ jsx159(ThreeDotsLoader, { height: 18, width: 18 }),
|
|
14776
|
+
/* @__PURE__ */ jsx159(
|
|
14266
14777
|
ChevronDown3,
|
|
14267
14778
|
{
|
|
14268
14779
|
size: 16,
|
|
@@ -14275,14 +14786,14 @@ var DashboardDatepicker = React54.forwardRef(
|
|
|
14275
14786
|
] })
|
|
14276
14787
|
]
|
|
14277
14788
|
}
|
|
14278
|
-
) : /* @__PURE__ */
|
|
14789
|
+
) : /* @__PURE__ */ jsxs104(
|
|
14279
14790
|
"div",
|
|
14280
14791
|
{
|
|
14281
14792
|
className: cn(
|
|
14282
14793
|
"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
14794
|
),
|
|
14284
14795
|
children: [
|
|
14285
|
-
/* @__PURE__ */
|
|
14796
|
+
/* @__PURE__ */ jsx159("div", { className: "flex h-full min-w-0 items-center px-2 sm:px-4", children: /* @__PURE__ */ jsx159(
|
|
14286
14797
|
"input",
|
|
14287
14798
|
{
|
|
14288
14799
|
ref: dayInputRef,
|
|
@@ -14304,8 +14815,8 @@ var DashboardDatepicker = React54.forwardRef(
|
|
|
14304
14815
|
className: subInputClass
|
|
14305
14816
|
}
|
|
14306
14817
|
) }),
|
|
14307
|
-
/* @__PURE__ */
|
|
14308
|
-
/* @__PURE__ */
|
|
14818
|
+
/* @__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: [
|
|
14819
|
+
/* @__PURE__ */ jsx159(
|
|
14309
14820
|
"input",
|
|
14310
14821
|
{
|
|
14311
14822
|
ref: monthInputRef,
|
|
@@ -14348,7 +14859,7 @@ var DashboardDatepicker = React54.forwardRef(
|
|
|
14348
14859
|
)
|
|
14349
14860
|
}
|
|
14350
14861
|
),
|
|
14351
|
-
/* @__PURE__ */
|
|
14862
|
+
/* @__PURE__ */ jsx159(
|
|
14352
14863
|
ChevronDown3,
|
|
14353
14864
|
{
|
|
14354
14865
|
size: 14,
|
|
@@ -14365,8 +14876,8 @@ var DashboardDatepicker = React54.forwardRef(
|
|
|
14365
14876
|
}
|
|
14366
14877
|
)
|
|
14367
14878
|
] }),
|
|
14368
|
-
/* @__PURE__ */
|
|
14369
|
-
/* @__PURE__ */
|
|
14879
|
+
/* @__PURE__ */ jsxs104("div", { className: "flex h-full min-w-0 items-center px-2 sm:px-4", children: [
|
|
14880
|
+
/* @__PURE__ */ jsx159(
|
|
14370
14881
|
"input",
|
|
14371
14882
|
{
|
|
14372
14883
|
ref: yearInputRef,
|
|
@@ -14388,7 +14899,7 @@ var DashboardDatepicker = React54.forwardRef(
|
|
|
14388
14899
|
className: subInputClass
|
|
14389
14900
|
}
|
|
14390
14901
|
),
|
|
14391
|
-
loading && /* @__PURE__ */
|
|
14902
|
+
loading && /* @__PURE__ */ jsx159(
|
|
14392
14903
|
ThreeDotsLoader,
|
|
14393
14904
|
{
|
|
14394
14905
|
height: 18,
|
|
@@ -14400,7 +14911,7 @@ var DashboardDatepicker = React54.forwardRef(
|
|
|
14400
14911
|
]
|
|
14401
14912
|
}
|
|
14402
14913
|
),
|
|
14403
|
-
showCoverage && /* @__PURE__ */
|
|
14914
|
+
showCoverage && /* @__PURE__ */ jsx159(
|
|
14404
14915
|
"div",
|
|
14405
14916
|
{
|
|
14406
14917
|
className: "absolute inset-0 cursor-text rounded-[6px] bg-[var(--chekin-color-surface-input-empty)]",
|
|
@@ -14408,7 +14919,7 @@ var DashboardDatepicker = React54.forwardRef(
|
|
|
14408
14919
|
"aria-hidden": "true"
|
|
14409
14920
|
}
|
|
14410
14921
|
),
|
|
14411
|
-
/* @__PURE__ */
|
|
14922
|
+
/* @__PURE__ */ jsx159(
|
|
14412
14923
|
Fieldset,
|
|
14413
14924
|
{
|
|
14414
14925
|
isFocused,
|
|
@@ -14423,12 +14934,12 @@ var DashboardDatepicker = React54.forwardRef(
|
|
|
14423
14934
|
legend: label,
|
|
14424
14935
|
label,
|
|
14425
14936
|
tooltip,
|
|
14426
|
-
onClick:
|
|
14937
|
+
onClick: isMobile3 ? openWheel : showCoverage ? focusDayInput : void 0
|
|
14427
14938
|
}
|
|
14428
14939
|
),
|
|
14429
|
-
isMonthOpen && !
|
|
14940
|
+
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
14941
|
] }),
|
|
14431
|
-
|
|
14942
|
+
isMobile3 && /* @__PURE__ */ jsx159(
|
|
14432
14943
|
AirbnbDatePickerContent,
|
|
14433
14944
|
{
|
|
14434
14945
|
baseId: wheelBaseId,
|
|
@@ -14456,9 +14967,9 @@ var DashboardDatepicker = React54.forwardRef(
|
|
|
14456
14967
|
onOptionSelect: wheel.handleOptionSelect
|
|
14457
14968
|
}
|
|
14458
14969
|
),
|
|
14459
|
-
!error && optional && /* @__PURE__ */
|
|
14460
|
-
!error && helperText && /* @__PURE__ */
|
|
14461
|
-
error && !hideErrorMessage && /* @__PURE__ */
|
|
14970
|
+
!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") }),
|
|
14971
|
+
!error && helperText && /* @__PURE__ */ jsx159("span", { className: "mt-[1px] block text-[12px] font-normal text-[var(--chekin-color-gray-1)]", children: helperText }),
|
|
14972
|
+
error && !hideErrorMessage && /* @__PURE__ */ jsx159(
|
|
14462
14973
|
FieldErrorMessage,
|
|
14463
14974
|
{
|
|
14464
14975
|
id: errorId,
|
|
@@ -14474,7 +14985,7 @@ var DashboardDatepicker = React54.forwardRef(
|
|
|
14474
14985
|
|
|
14475
14986
|
// src/dashboard/date-range-picker/DateRangePicker.tsx
|
|
14476
14987
|
import * as React58 from "react";
|
|
14477
|
-
import { useTranslation as
|
|
14988
|
+
import { useTranslation as useTranslation36 } from "react-i18next";
|
|
14478
14989
|
|
|
14479
14990
|
// src/dashboard/date-range-picker/isDayBlocked.ts
|
|
14480
14991
|
import { differenceInDays, isAfter, isBefore, isSameDay } from "date-fns";
|
|
@@ -14685,7 +15196,7 @@ function resolveRangeSelection({
|
|
|
14685
15196
|
|
|
14686
15197
|
// src/dashboard/date-range-picker/components/DateRangeInputs.tsx
|
|
14687
15198
|
import { CalendarDays, SquareX as SquareX4 } from "lucide-react";
|
|
14688
|
-
import { jsx as
|
|
15199
|
+
import { jsx as jsx160, jsxs as jsxs105 } from "react/jsx-runtime";
|
|
14689
15200
|
var DEFAULT_PLACEHOLDER = "00-00-0000";
|
|
14690
15201
|
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
15202
|
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 +15238,7 @@ function DateRangeInputs({
|
|
|
14727
15238
|
isBlocked && "cursor-not-allowed",
|
|
14728
15239
|
loading && "cursor-progress"
|
|
14729
15240
|
);
|
|
14730
|
-
return /* @__PURE__ */
|
|
15241
|
+
return /* @__PURE__ */ jsxs105(
|
|
14731
15242
|
"div",
|
|
14732
15243
|
{
|
|
14733
15244
|
className: cn(
|
|
@@ -14736,7 +15247,7 @@ function DateRangeInputs({
|
|
|
14736
15247
|
),
|
|
14737
15248
|
onClick: onRowClick,
|
|
14738
15249
|
children: [
|
|
14739
|
-
/* @__PURE__ */
|
|
15250
|
+
/* @__PURE__ */ jsx160(
|
|
14740
15251
|
"input",
|
|
14741
15252
|
{
|
|
14742
15253
|
ref: fromInputRef,
|
|
@@ -14760,7 +15271,7 @@ function DateRangeInputs({
|
|
|
14760
15271
|
)
|
|
14761
15272
|
}
|
|
14762
15273
|
),
|
|
14763
|
-
/* @__PURE__ */
|
|
15274
|
+
/* @__PURE__ */ jsx160(
|
|
14764
15275
|
"span",
|
|
14765
15276
|
{
|
|
14766
15277
|
"aria-hidden": "true",
|
|
@@ -14771,7 +15282,7 @@ function DateRangeInputs({
|
|
|
14771
15282
|
children: "\u2192"
|
|
14772
15283
|
}
|
|
14773
15284
|
),
|
|
14774
|
-
/* @__PURE__ */
|
|
15285
|
+
/* @__PURE__ */ jsx160(
|
|
14775
15286
|
"input",
|
|
14776
15287
|
{
|
|
14777
15288
|
ref: toInputRef,
|
|
@@ -14795,9 +15306,9 @@ function DateRangeInputs({
|
|
|
14795
15306
|
)
|
|
14796
15307
|
}
|
|
14797
15308
|
),
|
|
14798
|
-
/* @__PURE__ */
|
|
14799
|
-
loading && /* @__PURE__ */
|
|
14800
|
-
!readOnly && !hideClearDates && !isEmpty && /* @__PURE__ */
|
|
15309
|
+
/* @__PURE__ */ jsxs105("span", { className: "ml-auto flex shrink-0 items-center gap-2 pl-2 text-[var(--chekin-color-gray-2)]", children: [
|
|
15310
|
+
loading && /* @__PURE__ */ jsx160(ThreeDotsLoader, { height: 18, width: 18 }),
|
|
15311
|
+
!readOnly && !hideClearDates && !isEmpty && /* @__PURE__ */ jsx160(
|
|
14801
15312
|
"button",
|
|
14802
15313
|
{
|
|
14803
15314
|
type: "button",
|
|
@@ -14805,10 +15316,10 @@ function DateRangeInputs({
|
|
|
14805
15316
|
onClick: onReset,
|
|
14806
15317
|
className: iconButtonClass,
|
|
14807
15318
|
"aria-label": clearLabel,
|
|
14808
|
-
children: /* @__PURE__ */
|
|
15319
|
+
children: /* @__PURE__ */ jsx160(SquareX4, { size: 16, fill: "#9696b9", color: "#f8f8f8", strokeWidth: 1.8 })
|
|
14809
15320
|
}
|
|
14810
15321
|
),
|
|
14811
|
-
!readOnly && !hideCalendarIcon && /* @__PURE__ */
|
|
15322
|
+
!readOnly && !hideCalendarIcon && /* @__PURE__ */ jsx160(
|
|
14812
15323
|
"button",
|
|
14813
15324
|
{
|
|
14814
15325
|
type: "button",
|
|
@@ -14820,7 +15331,7 @@ function DateRangeInputs({
|
|
|
14820
15331
|
focusedInput !== null || isOpen ? "text-[var(--chekin-color-brand-blue)]" : "text-[var(--chekin-color-gray-2)]"
|
|
14821
15332
|
),
|
|
14822
15333
|
"aria-label": openCalendarLabel,
|
|
14823
|
-
children: /* @__PURE__ */
|
|
15334
|
+
children: /* @__PURE__ */ jsx160(CalendarDays, { size: 18 })
|
|
14824
15335
|
}
|
|
14825
15336
|
)
|
|
14826
15337
|
] })
|
|
@@ -14830,7 +15341,7 @@ function DateRangeInputs({
|
|
|
14830
15341
|
}
|
|
14831
15342
|
|
|
14832
15343
|
// src/dashboard/date-range-picker/components/DateRangeCalendar.tsx
|
|
14833
|
-
import { jsx as
|
|
15344
|
+
import { jsx as jsx161 } from "react/jsx-runtime";
|
|
14834
15345
|
function DateRangeCalendar({
|
|
14835
15346
|
value,
|
|
14836
15347
|
month,
|
|
@@ -14846,7 +15357,7 @@ function DateRangeCalendar({
|
|
|
14846
15357
|
components,
|
|
14847
15358
|
...dayPickerProps
|
|
14848
15359
|
}) {
|
|
14849
|
-
return /* @__PURE__ */
|
|
15360
|
+
return /* @__PURE__ */ jsx161(
|
|
14850
15361
|
Calendar,
|
|
14851
15362
|
{
|
|
14852
15363
|
mode: "range",
|
|
@@ -14869,10 +15380,10 @@ function DateRangeCalendar({
|
|
|
14869
15380
|
}
|
|
14870
15381
|
|
|
14871
15382
|
// src/dashboard/date-range-picker/components/DateRangePopover.tsx
|
|
14872
|
-
import { jsx as
|
|
15383
|
+
import { jsx as jsx162, jsxs as jsxs106 } from "react/jsx-runtime";
|
|
14873
15384
|
function DateRangePopover({
|
|
14874
15385
|
isOpen,
|
|
14875
|
-
isMobile:
|
|
15386
|
+
isMobile: isMobile3,
|
|
14876
15387
|
openDirection,
|
|
14877
15388
|
drawerTitle,
|
|
14878
15389
|
drawerDescription,
|
|
@@ -14880,31 +15391,31 @@ function DateRangePopover({
|
|
|
14880
15391
|
children
|
|
14881
15392
|
}) {
|
|
14882
15393
|
if (!isOpen) return null;
|
|
14883
|
-
if (
|
|
14884
|
-
return /* @__PURE__ */
|
|
15394
|
+
if (isMobile3) {
|
|
15395
|
+
return /* @__PURE__ */ jsx162(
|
|
14885
15396
|
Drawer,
|
|
14886
15397
|
{
|
|
14887
15398
|
open: isOpen,
|
|
14888
15399
|
onOpenChange: (next) => {
|
|
14889
15400
|
if (!next) onClose();
|
|
14890
15401
|
},
|
|
14891
|
-
children: /* @__PURE__ */
|
|
15402
|
+
children: /* @__PURE__ */ jsxs106(
|
|
14892
15403
|
DrawerContent,
|
|
14893
15404
|
{
|
|
14894
15405
|
onClose,
|
|
14895
15406
|
lockScroll: false,
|
|
14896
15407
|
className: "max-h-[calc(100vh-1rem)]",
|
|
14897
15408
|
children: [
|
|
14898
|
-
/* @__PURE__ */
|
|
14899
|
-
/* @__PURE__ */
|
|
14900
|
-
/* @__PURE__ */
|
|
15409
|
+
/* @__PURE__ */ jsx162(DrawerTitle, { className: "sr-only", children: drawerTitle }),
|
|
15410
|
+
/* @__PURE__ */ jsx162(DrawerDescription, { className: "sr-only", children: drawerDescription }),
|
|
15411
|
+
/* @__PURE__ */ jsx162("div", { className: "flex items-start justify-center overflow-x-auto px-2 pb-4 pt-1", children })
|
|
14901
15412
|
]
|
|
14902
15413
|
}
|
|
14903
15414
|
)
|
|
14904
15415
|
}
|
|
14905
15416
|
);
|
|
14906
15417
|
}
|
|
14907
|
-
return /* @__PURE__ */
|
|
15418
|
+
return /* @__PURE__ */ jsx162(
|
|
14908
15419
|
"div",
|
|
14909
15420
|
{
|
|
14910
15421
|
className: cn(
|
|
@@ -14917,7 +15428,7 @@ function DateRangePopover({
|
|
|
14917
15428
|
}
|
|
14918
15429
|
|
|
14919
15430
|
// src/dashboard/date-range-picker/DateRangePicker.tsx
|
|
14920
|
-
import { jsx as
|
|
15431
|
+
import { jsx as jsx163, jsxs as jsxs107 } from "react/jsx-runtime";
|
|
14921
15432
|
var DashboardDateRangePicker = React58.forwardRef(function DashboardDateRangePicker2({
|
|
14922
15433
|
label,
|
|
14923
15434
|
value: externalValue,
|
|
@@ -14990,8 +15501,8 @@ var DashboardDateRangePicker = React58.forwardRef(function DashboardDateRangePic
|
|
|
14990
15501
|
const [isOpen, setIsOpen] = React58.useState(false);
|
|
14991
15502
|
const [focusedInput, setFocusedInput] = React58.useState(null);
|
|
14992
15503
|
const [autoFocus, setAutoFocus] = React58.useState(false);
|
|
14993
|
-
const
|
|
14994
|
-
const { t } =
|
|
15504
|
+
const isMobile3 = useIsMobile();
|
|
15505
|
+
const { t } = useTranslation36();
|
|
14995
15506
|
const drawerTitle = label ?? t("select_dates");
|
|
14996
15507
|
const drawerDescription = label ?? t("pick_date_range");
|
|
14997
15508
|
const isEmpty = !value?.from && !value?.to;
|
|
@@ -14999,7 +15510,7 @@ var DashboardDateRangePicker = React58.forwardRef(function DashboardDateRangePic
|
|
|
14999
15510
|
const isInvalid = Boolean(invalid || error);
|
|
15000
15511
|
const isFocused = focusedInput !== null || isOpen;
|
|
15001
15512
|
const wrapperWidth = toCssSize(width);
|
|
15002
|
-
const monthsToShow = numberOfMonths ?? (
|
|
15513
|
+
const monthsToShow = numberOfMonths ?? (isMobile3 ? 1 : 2);
|
|
15003
15514
|
const closeCalendar = React58.useCallback(() => {
|
|
15004
15515
|
setIsOpen(false);
|
|
15005
15516
|
setFocusedInput(null);
|
|
@@ -15013,7 +15524,7 @@ var DashboardDateRangePicker = React58.forwardRef(function DashboardDateRangePic
|
|
|
15013
15524
|
useOutsideClick({
|
|
15014
15525
|
elementRef: containerRef,
|
|
15015
15526
|
onOutsideClick: closeCalendar,
|
|
15016
|
-
isDisabled: !isOpen ||
|
|
15527
|
+
isDisabled: !isOpen || isMobile3
|
|
15017
15528
|
});
|
|
15018
15529
|
const handlePickerChange = React58.useCallback(
|
|
15019
15530
|
(range, pickedDate) => {
|
|
@@ -15078,7 +15589,7 @@ var DashboardDateRangePicker = React58.forwardRef(function DashboardDateRangePic
|
|
|
15078
15589
|
syncMonthToValue
|
|
15079
15590
|
]
|
|
15080
15591
|
);
|
|
15081
|
-
return /* @__PURE__ */
|
|
15592
|
+
return /* @__PURE__ */ jsx163(
|
|
15082
15593
|
"div",
|
|
15083
15594
|
{
|
|
15084
15595
|
ref: containerRef,
|
|
@@ -15089,9 +15600,9 @@ var DashboardDateRangePicker = React58.forwardRef(function DashboardDateRangePic
|
|
|
15089
15600
|
className
|
|
15090
15601
|
),
|
|
15091
15602
|
style: wrapperWidth ? { width: wrapperWidth } : void 0,
|
|
15092
|
-
children: /* @__PURE__ */
|
|
15093
|
-
/* @__PURE__ */
|
|
15094
|
-
/* @__PURE__ */
|
|
15603
|
+
children: /* @__PURE__ */ jsxs107("div", { className: "relative min-h-[68px] w-full", children: [
|
|
15604
|
+
/* @__PURE__ */ jsxs107("div", { className: "relative w-full", children: [
|
|
15605
|
+
/* @__PURE__ */ jsx163(
|
|
15095
15606
|
DateRangeInputs,
|
|
15096
15607
|
{
|
|
15097
15608
|
fromId,
|
|
@@ -15142,7 +15653,7 @@ var DashboardDateRangePicker = React58.forwardRef(function DashboardDateRangePic
|
|
|
15142
15653
|
onToggleCalendar: toggleCalendar
|
|
15143
15654
|
}
|
|
15144
15655
|
),
|
|
15145
|
-
/* @__PURE__ */
|
|
15656
|
+
/* @__PURE__ */ jsx163(
|
|
15146
15657
|
Fieldset,
|
|
15147
15658
|
{
|
|
15148
15659
|
isFocused,
|
|
@@ -15159,16 +15670,16 @@ var DashboardDateRangePicker = React58.forwardRef(function DashboardDateRangePic
|
|
|
15159
15670
|
tooltip
|
|
15160
15671
|
}
|
|
15161
15672
|
),
|
|
15162
|
-
/* @__PURE__ */
|
|
15673
|
+
/* @__PURE__ */ jsx163(
|
|
15163
15674
|
DateRangePopover,
|
|
15164
15675
|
{
|
|
15165
|
-
isOpen: isOpen && !
|
|
15676
|
+
isOpen: isOpen && !isMobile3,
|
|
15166
15677
|
isMobile: false,
|
|
15167
15678
|
openDirection,
|
|
15168
15679
|
drawerTitle,
|
|
15169
15680
|
drawerDescription,
|
|
15170
15681
|
onClose: closeCalendar,
|
|
15171
|
-
children: /* @__PURE__ */
|
|
15682
|
+
children: /* @__PURE__ */ jsx163(
|
|
15172
15683
|
DateRangeCalendar,
|
|
15173
15684
|
{
|
|
15174
15685
|
value,
|
|
@@ -15189,16 +15700,16 @@ var DashboardDateRangePicker = React58.forwardRef(function DashboardDateRangePic
|
|
|
15189
15700
|
}
|
|
15190
15701
|
)
|
|
15191
15702
|
] }),
|
|
15192
|
-
/* @__PURE__ */
|
|
15703
|
+
/* @__PURE__ */ jsx163(
|
|
15193
15704
|
DateRangePopover,
|
|
15194
15705
|
{
|
|
15195
|
-
isOpen: isOpen &&
|
|
15706
|
+
isOpen: isOpen && isMobile3,
|
|
15196
15707
|
isMobile: true,
|
|
15197
15708
|
openDirection,
|
|
15198
15709
|
drawerTitle,
|
|
15199
15710
|
drawerDescription,
|
|
15200
15711
|
onClose: closeCalendar,
|
|
15201
|
-
children: /* @__PURE__ */
|
|
15712
|
+
children: /* @__PURE__ */ jsx163(
|
|
15202
15713
|
DateRangeCalendar,
|
|
15203
15714
|
{
|
|
15204
15715
|
value,
|
|
@@ -15218,9 +15729,9 @@ var DashboardDateRangePicker = React58.forwardRef(function DashboardDateRangePic
|
|
|
15218
15729
|
)
|
|
15219
15730
|
}
|
|
15220
15731
|
),
|
|
15221
|
-
!error && optional && /* @__PURE__ */
|
|
15222
|
-
!error && helperText && /* @__PURE__ */
|
|
15223
|
-
error && !hideErrorMessage && /* @__PURE__ */
|
|
15732
|
+
!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") }),
|
|
15733
|
+
!error && helperText && /* @__PURE__ */ jsx163("span", { className: "mt-[1px] block text-[12px] font-normal text-[var(--chekin-color-gray-1)]", children: helperText }),
|
|
15734
|
+
error && !hideErrorMessage && /* @__PURE__ */ jsx163(
|
|
15224
15735
|
FieldErrorMessage,
|
|
15225
15736
|
{
|
|
15226
15737
|
id: errorId,
|
|
@@ -15235,7 +15746,7 @@ var DashboardDateRangePicker = React58.forwardRef(function DashboardDateRangePic
|
|
|
15235
15746
|
|
|
15236
15747
|
// src/dashboard/date-range-picker/useValidateDates.ts
|
|
15237
15748
|
import * as React59 from "react";
|
|
15238
|
-
import { useTranslation as
|
|
15749
|
+
import { useTranslation as useTranslation37 } from "react-i18next";
|
|
15239
15750
|
import { differenceInDays as differenceInDays2, isAfter as isAfter2, isBefore as isBefore3 } from "date-fns";
|
|
15240
15751
|
import {
|
|
15241
15752
|
dateMatchModifiers,
|
|
@@ -15257,7 +15768,7 @@ function useValidateDates({
|
|
|
15257
15768
|
onSuccess,
|
|
15258
15769
|
displayFormat
|
|
15259
15770
|
}) {
|
|
15260
|
-
const { t } =
|
|
15771
|
+
const { t } = useTranslation37();
|
|
15261
15772
|
const handleError = useEvent(onError);
|
|
15262
15773
|
const handleSuccess = useEvent(onSuccess);
|
|
15263
15774
|
const errorFormatter = React59.useMemo(
|
|
@@ -15316,7 +15827,7 @@ function useValidateDates({
|
|
|
15316
15827
|
// src/dashboard/time-picker/TimePicker.tsx
|
|
15317
15828
|
import * as React60 from "react";
|
|
15318
15829
|
import { addDays, addHours, addMinutes, format, parse as parse2 } from "date-fns";
|
|
15319
|
-
import { jsx as
|
|
15830
|
+
import { jsx as jsx164 } from "react/jsx-runtime";
|
|
15320
15831
|
var SHORT_TIME_FORMAT = "HH:mm";
|
|
15321
15832
|
function parseTime(value) {
|
|
15322
15833
|
return parse2(value, SHORT_TIME_FORMAT, /* @__PURE__ */ new Date());
|
|
@@ -15365,15 +15876,15 @@ var DashboardTimePicker = React60.forwardRef(
|
|
|
15365
15876
|
const settings = timeSettings ?? FORMAT_SETTINGS[formatName];
|
|
15366
15877
|
return buildOptions(settings);
|
|
15367
15878
|
}, [formatName, options, timeSettings]);
|
|
15368
|
-
return /* @__PURE__ */
|
|
15879
|
+
return /* @__PURE__ */ jsx164(DashboardSelect, { ref, ...selectProps, options: resolvedOptions });
|
|
15369
15880
|
}
|
|
15370
15881
|
);
|
|
15371
15882
|
|
|
15372
15883
|
// src/dashboard/file-input/FileInput.tsx
|
|
15373
15884
|
import * as React61 from "react";
|
|
15374
15885
|
import { Download, Paperclip, SquareX as SquareX5 } from "lucide-react";
|
|
15375
|
-
import { useTranslation as
|
|
15376
|
-
import { jsx as
|
|
15886
|
+
import { useTranslation as useTranslation38 } from "react-i18next";
|
|
15887
|
+
import { jsx as jsx165, jsxs as jsxs108 } from "react/jsx-runtime";
|
|
15377
15888
|
function defaultDownload(url) {
|
|
15378
15889
|
window.open(url, "_blank", "noopener,noreferrer");
|
|
15379
15890
|
}
|
|
@@ -15402,7 +15913,7 @@ var DashboardFileInput = React61.forwardRef(
|
|
|
15402
15913
|
}, ref) {
|
|
15403
15914
|
const internalRef = React61.useRef(null);
|
|
15404
15915
|
const inputRef = useCombinedRef(ref, internalRef);
|
|
15405
|
-
const { t } =
|
|
15916
|
+
const { t } = useTranslation38();
|
|
15406
15917
|
const resolvedLabel = label ?? t("upload_file");
|
|
15407
15918
|
const resolvedDownloadLabel = downloadLabel ?? t("download_attachment");
|
|
15408
15919
|
const reactId = React61.useId();
|
|
@@ -15431,7 +15942,7 @@ var DashboardFileInput = React61.forwardRef(
|
|
|
15431
15942
|
event.stopPropagation();
|
|
15432
15943
|
if (isUrl) onDownload(value);
|
|
15433
15944
|
};
|
|
15434
|
-
return /* @__PURE__ */
|
|
15945
|
+
return /* @__PURE__ */ jsxs108(
|
|
15435
15946
|
"label",
|
|
15436
15947
|
{
|
|
15437
15948
|
htmlFor: inputId,
|
|
@@ -15444,7 +15955,7 @@ var DashboardFileInput = React61.forwardRef(
|
|
|
15444
15955
|
),
|
|
15445
15956
|
style: wrapperWidth ? { width: wrapperWidth } : void 0,
|
|
15446
15957
|
children: [
|
|
15447
|
-
/* @__PURE__ */
|
|
15958
|
+
/* @__PURE__ */ jsx165(
|
|
15448
15959
|
"input",
|
|
15449
15960
|
{
|
|
15450
15961
|
ref: inputRef,
|
|
@@ -15460,9 +15971,9 @@ var DashboardFileInput = React61.forwardRef(
|
|
|
15460
15971
|
"aria-invalid": isInvalid
|
|
15461
15972
|
}
|
|
15462
15973
|
),
|
|
15463
|
-
/* @__PURE__ */
|
|
15464
|
-
/* @__PURE__ */
|
|
15465
|
-
/* @__PURE__ */
|
|
15974
|
+
/* @__PURE__ */ jsxs108("div", { className: "relative min-h-[68px] w-full", children: [
|
|
15975
|
+
/* @__PURE__ */ jsxs108("div", { className: "relative w-full", children: [
|
|
15976
|
+
/* @__PURE__ */ jsxs108(
|
|
15466
15977
|
"div",
|
|
15467
15978
|
{
|
|
15468
15979
|
className: cn(
|
|
@@ -15470,25 +15981,25 @@ var DashboardFileInput = React61.forwardRef(
|
|
|
15470
15981
|
isEmpty && "bg-[var(--chekin-color-surface-input-empty)]"
|
|
15471
15982
|
),
|
|
15472
15983
|
children: [
|
|
15473
|
-
hasFileChip ? /* @__PURE__ */
|
|
15984
|
+
hasFileChip ? /* @__PURE__ */ jsxs108(
|
|
15474
15985
|
"div",
|
|
15475
15986
|
{
|
|
15476
15987
|
className: "inline-flex h-6 max-w-[85%] items-center rounded-[4px] border border-[#acacd5] bg-[#f0f0f8] pl-[10px] pr-1",
|
|
15477
15988
|
onClick: (event) => event.preventDefault(),
|
|
15478
15989
|
children: [
|
|
15479
|
-
isUrl ? /* @__PURE__ */
|
|
15990
|
+
isUrl ? /* @__PURE__ */ jsxs108(
|
|
15480
15991
|
"button",
|
|
15481
15992
|
{
|
|
15482
15993
|
type: "button",
|
|
15483
15994
|
onClick: handleDownload,
|
|
15484
15995
|
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
15996
|
children: [
|
|
15486
|
-
/* @__PURE__ */
|
|
15487
|
-
/* @__PURE__ */
|
|
15997
|
+
/* @__PURE__ */ jsx165("span", { className: "truncate", children: resolvedDownloadLabel }),
|
|
15998
|
+
/* @__PURE__ */ jsx165(Download, { size: 15 })
|
|
15488
15999
|
]
|
|
15489
16000
|
}
|
|
15490
|
-
) : /* @__PURE__ */
|
|
15491
|
-
/* @__PURE__ */
|
|
16001
|
+
) : /* @__PURE__ */ jsx165("span", { className: "truncate text-[14px] font-medium text-[var(--chekin-color-brand-navy)]", children: value.name }),
|
|
16002
|
+
/* @__PURE__ */ jsx165(
|
|
15492
16003
|
"button",
|
|
15493
16004
|
{
|
|
15494
16005
|
type: "button",
|
|
@@ -15496,20 +16007,20 @@ var DashboardFileInput = React61.forwardRef(
|
|
|
15496
16007
|
onClick: handleClear,
|
|
15497
16008
|
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
16009
|
"aria-label": t("remove_file"),
|
|
15499
|
-
children: /* @__PURE__ */
|
|
16010
|
+
children: /* @__PURE__ */ jsx165(SquareX5, { size: 15, fill: "#9696b9", color: "#f8f8f8", strokeWidth: 1.8 })
|
|
15500
16011
|
}
|
|
15501
16012
|
)
|
|
15502
16013
|
]
|
|
15503
16014
|
}
|
|
15504
|
-
) : /* @__PURE__ */
|
|
15505
|
-
/* @__PURE__ */
|
|
15506
|
-
loading && /* @__PURE__ */
|
|
15507
|
-
/* @__PURE__ */
|
|
16015
|
+
) : /* @__PURE__ */ jsx165("span", { className: "block min-w-0 flex-1 truncate text-left text-[var(--chekin-color-gray-1)]", children: placeholder ?? "" }),
|
|
16016
|
+
/* @__PURE__ */ jsxs108("span", { className: "ml-auto flex items-center gap-2 text-[var(--chekin-color-gray-2)]", children: [
|
|
16017
|
+
loading && /* @__PURE__ */ jsx165(ThreeDotsLoader, { height: 18, width: 18 }),
|
|
16018
|
+
/* @__PURE__ */ jsx165(Paperclip, { size: 20 })
|
|
15508
16019
|
] })
|
|
15509
16020
|
]
|
|
15510
16021
|
}
|
|
15511
16022
|
),
|
|
15512
|
-
/* @__PURE__ */
|
|
16023
|
+
/* @__PURE__ */ jsx165(
|
|
15513
16024
|
Fieldset,
|
|
15514
16025
|
{
|
|
15515
16026
|
isFocused: false,
|
|
@@ -15527,9 +16038,9 @@ var DashboardFileInput = React61.forwardRef(
|
|
|
15527
16038
|
}
|
|
15528
16039
|
)
|
|
15529
16040
|
] }),
|
|
15530
|
-
!error && optional && /* @__PURE__ */
|
|
15531
|
-
!error && helperText && /* @__PURE__ */
|
|
15532
|
-
error && !hideErrorMessage && /* @__PURE__ */
|
|
16041
|
+
!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") }),
|
|
16042
|
+
!error && helperText && /* @__PURE__ */ jsx165("span", { className: "mt-[1px] block text-[12px] font-normal text-[var(--chekin-color-gray-1)]", children: helperText }),
|
|
16043
|
+
error && !hideErrorMessage && /* @__PURE__ */ jsx165(
|
|
15533
16044
|
FieldErrorMessage,
|
|
15534
16045
|
{
|
|
15535
16046
|
id: errorId,
|
|
@@ -15546,7 +16057,7 @@ var DashboardFileInput = React61.forwardRef(
|
|
|
15546
16057
|
|
|
15547
16058
|
// src/dashboard/select-icons-box/SelectIconsBox.tsx
|
|
15548
16059
|
import * as React62 from "react";
|
|
15549
|
-
import { jsx as
|
|
16060
|
+
import { jsx as jsx166, jsxs as jsxs109 } from "react/jsx-runtime";
|
|
15550
16061
|
function DashboardSelectIconsBox({
|
|
15551
16062
|
children,
|
|
15552
16063
|
icons,
|
|
@@ -15582,7 +16093,7 @@ function DashboardSelectIconsBox({
|
|
|
15582
16093
|
onSelect(iconName);
|
|
15583
16094
|
setOpen(false);
|
|
15584
16095
|
};
|
|
15585
|
-
return /* @__PURE__ */
|
|
16096
|
+
return /* @__PURE__ */ jsxs109(
|
|
15586
16097
|
"div",
|
|
15587
16098
|
{
|
|
15588
16099
|
ref: containerRef,
|
|
@@ -15590,7 +16101,7 @@ function DashboardSelectIconsBox({
|
|
|
15590
16101
|
className: cn("relative inline-block", className),
|
|
15591
16102
|
children: [
|
|
15592
16103
|
children,
|
|
15593
|
-
isOpen && /* @__PURE__ */
|
|
16104
|
+
isOpen && /* @__PURE__ */ jsx166(
|
|
15594
16105
|
"div",
|
|
15595
16106
|
{
|
|
15596
16107
|
className: cn(
|
|
@@ -15601,7 +16112,7 @@ function DashboardSelectIconsBox({
|
|
|
15601
16112
|
boxClassName
|
|
15602
16113
|
),
|
|
15603
16114
|
style: { gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))` },
|
|
15604
|
-
children: icons.map((iconName) => /* @__PURE__ */
|
|
16115
|
+
children: icons.map((iconName) => /* @__PURE__ */ jsx166(
|
|
15605
16116
|
"button",
|
|
15606
16117
|
{
|
|
15607
16118
|
type: "button",
|
|
@@ -15682,14 +16193,14 @@ function getErrorMessage(error) {
|
|
|
15682
16193
|
|
|
15683
16194
|
// src/lib/toastResponseError.tsx
|
|
15684
16195
|
import i18next from "i18next";
|
|
15685
|
-
import { jsx as
|
|
16196
|
+
import { jsx as jsx167, jsxs as jsxs110 } from "react/jsx-runtime";
|
|
15686
16197
|
function addSupportEmailToMessage(message, prefixText) {
|
|
15687
16198
|
if (typeof message !== "string") {
|
|
15688
16199
|
return message;
|
|
15689
16200
|
}
|
|
15690
16201
|
const builtMessage = `${prefixText ? `${prefixText} ` : ""}${message}`;
|
|
15691
|
-
return /* @__PURE__ */
|
|
15692
|
-
/* @__PURE__ */
|
|
16202
|
+
return /* @__PURE__ */ jsxs110("div", { children: [
|
|
16203
|
+
/* @__PURE__ */ jsx167("div", { children: builtMessage }),
|
|
15693
16204
|
i18next.t("reach_us_at_email")
|
|
15694
16205
|
] });
|
|
15695
16206
|
}
|
|
@@ -15704,13 +16215,13 @@ function toastResponseError(error, options = {}) {
|
|
|
15704
16215
|
}
|
|
15705
16216
|
|
|
15706
16217
|
// src/legacy-fields/textarea/Textarea.tsx
|
|
15707
|
-
import { forwardRef as
|
|
15708
|
-
import { jsx as
|
|
15709
|
-
var LegacyTextarea =
|
|
16218
|
+
import { forwardRef as forwardRef68, useId as useId15 } from "react";
|
|
16219
|
+
import { jsx as jsx168, jsxs as jsxs111 } from "react/jsx-runtime";
|
|
16220
|
+
var LegacyTextarea = forwardRef68(
|
|
15710
16221
|
({ className, textareaClassName, label, disabled, name, invalid, ...textareaProps }, ref) => {
|
|
15711
16222
|
const inputId = useId15();
|
|
15712
|
-
return /* @__PURE__ */
|
|
15713
|
-
/* @__PURE__ */
|
|
16223
|
+
return /* @__PURE__ */ jsxs111("div", { className: cn("relative", className), children: [
|
|
16224
|
+
/* @__PURE__ */ jsx168(
|
|
15714
16225
|
"textarea",
|
|
15715
16226
|
{
|
|
15716
16227
|
ref,
|
|
@@ -15726,7 +16237,7 @@ var LegacyTextarea = forwardRef67(
|
|
|
15726
16237
|
...textareaProps
|
|
15727
16238
|
}
|
|
15728
16239
|
),
|
|
15729
|
-
label && /* @__PURE__ */
|
|
16240
|
+
label && /* @__PURE__ */ jsx168(
|
|
15730
16241
|
"label",
|
|
15731
16242
|
{
|
|
15732
16243
|
htmlFor: inputId,
|
|
@@ -15750,8 +16261,8 @@ import { Calendar as Calendar2 } from "lucide-react";
|
|
|
15750
16261
|
// src/airbnb-fields/field-trigger/FieldTrigger.tsx
|
|
15751
16262
|
import * as React63 from "react";
|
|
15752
16263
|
import { Loader2 as Loader24 } from "lucide-react";
|
|
15753
|
-
import { useTranslation as
|
|
15754
|
-
import { Fragment as Fragment17, jsx as
|
|
16264
|
+
import { useTranslation as useTranslation39 } from "react-i18next";
|
|
16265
|
+
import { Fragment as Fragment17, jsx as jsx169, jsxs as jsxs112 } from "react/jsx-runtime";
|
|
15755
16266
|
var AirbnbFieldTrigger = React63.forwardRef(
|
|
15756
16267
|
({
|
|
15757
16268
|
as = "button",
|
|
@@ -15783,20 +16294,20 @@ var AirbnbFieldTrigger = React63.forwardRef(
|
|
|
15783
16294
|
onKeyDown,
|
|
15784
16295
|
...props
|
|
15785
16296
|
}, ref) => {
|
|
15786
|
-
const { t } =
|
|
16297
|
+
const { t } = useTranslation39();
|
|
15787
16298
|
const hasValue = Boolean(valueText);
|
|
15788
16299
|
const isRaised = hasValue || forceFloatingLabel;
|
|
15789
16300
|
const optionalLabel = optional ? typeof optional === "string" ? optional : t("optional") : void 0;
|
|
15790
16301
|
const visibleLabelText = labelText ?? label;
|
|
15791
16302
|
const hasLabelMeta = Boolean(optionalLabel) || Boolean(tooltip);
|
|
15792
|
-
const resolvedLabelText = visibleLabelText && hasLabelMeta ? /* @__PURE__ */
|
|
15793
|
-
/* @__PURE__ */
|
|
15794
|
-
optionalLabel && /* @__PURE__ */
|
|
16303
|
+
const resolvedLabelText = visibleLabelText && hasLabelMeta ? /* @__PURE__ */ jsxs112("span", { className: "inline-flex max-w-full items-center gap-1.5 align-middle", children: [
|
|
16304
|
+
/* @__PURE__ */ jsx169("span", { className: "min-w-0 truncate", children: visibleLabelText }),
|
|
16305
|
+
optionalLabel && /* @__PURE__ */ jsxs112("span", { className: "shrink-0 text-[12px] relative top-[1px] font-normal leading-4 text-current opacity-70", children: [
|
|
15795
16306
|
"(",
|
|
15796
16307
|
optionalLabel,
|
|
15797
16308
|
")"
|
|
15798
16309
|
] }),
|
|
15799
|
-
tooltip && /* @__PURE__ */
|
|
16310
|
+
tooltip && /* @__PURE__ */ jsx169(
|
|
15800
16311
|
HelpTooltip,
|
|
15801
16312
|
{
|
|
15802
16313
|
content: tooltip,
|
|
@@ -15812,9 +16323,9 @@ var AirbnbFieldTrigger = React63.forwardRef(
|
|
|
15812
16323
|
const hasInvalidState = Boolean(error);
|
|
15813
16324
|
const errorMessage = typeof error === "string" ? error : void 0;
|
|
15814
16325
|
const isBlocked = Boolean(disabled) || Boolean(loading);
|
|
15815
|
-
const resolvedTrailingAdornment = loading || trailingAdornment ? /* @__PURE__ */
|
|
16326
|
+
const resolvedTrailingAdornment = loading || trailingAdornment ? /* @__PURE__ */ jsxs112("span", { className: "flex items-center gap-2", children: [
|
|
15816
16327
|
trailingAdornment,
|
|
15817
|
-
loading && /* @__PURE__ */
|
|
16328
|
+
loading && /* @__PURE__ */ jsx169(
|
|
15818
16329
|
Loader24,
|
|
15819
16330
|
{
|
|
15820
16331
|
"aria-hidden": "true",
|
|
@@ -15830,8 +16341,8 @@ var AirbnbFieldTrigger = React63.forwardRef(
|
|
|
15830
16341
|
disabled ? "cursor-not-allowed opacity-50" : loading ? "cursor-progress" : isAirbnbVariant ? "cursor-pointer" : "cursor-text",
|
|
15831
16342
|
className
|
|
15832
16343
|
);
|
|
15833
|
-
const sharedContent = /* @__PURE__ */
|
|
15834
|
-
/* @__PURE__ */
|
|
16344
|
+
const sharedContent = /* @__PURE__ */ jsxs112(Fragment17, { children: [
|
|
16345
|
+
/* @__PURE__ */ jsxs112(
|
|
15835
16346
|
"span",
|
|
15836
16347
|
{
|
|
15837
16348
|
className: cn(
|
|
@@ -15840,7 +16351,7 @@ var AirbnbFieldTrigger = React63.forwardRef(
|
|
|
15840
16351
|
contentClassName
|
|
15841
16352
|
),
|
|
15842
16353
|
children: [
|
|
15843
|
-
/* @__PURE__ */
|
|
16354
|
+
/* @__PURE__ */ jsx169(
|
|
15844
16355
|
"span",
|
|
15845
16356
|
{
|
|
15846
16357
|
id: labelId,
|
|
@@ -15853,7 +16364,7 @@ var AirbnbFieldTrigger = React63.forwardRef(
|
|
|
15853
16364
|
children: animatedLabel
|
|
15854
16365
|
}
|
|
15855
16366
|
),
|
|
15856
|
-
children ? children : hasValue ? /* @__PURE__ */
|
|
16367
|
+
children ? children : hasValue ? /* @__PURE__ */ jsx169(
|
|
15857
16368
|
"span",
|
|
15858
16369
|
{
|
|
15859
16370
|
id: valueId,
|
|
@@ -15864,11 +16375,11 @@ var AirbnbFieldTrigger = React63.forwardRef(
|
|
|
15864
16375
|
),
|
|
15865
16376
|
children: valueText
|
|
15866
16377
|
}
|
|
15867
|
-
) : /* @__PURE__ */
|
|
16378
|
+
) : /* @__PURE__ */ jsx169("span", { id: helperTextId, className: "sr-only", children: placeholder ?? label })
|
|
15868
16379
|
]
|
|
15869
16380
|
}
|
|
15870
16381
|
),
|
|
15871
|
-
resolvedTrailingAdornment && /* @__PURE__ */
|
|
16382
|
+
resolvedTrailingAdornment && /* @__PURE__ */ jsx169(
|
|
15872
16383
|
"span",
|
|
15873
16384
|
{
|
|
15874
16385
|
"aria-hidden": "true",
|
|
@@ -15880,9 +16391,9 @@ var AirbnbFieldTrigger = React63.forwardRef(
|
|
|
15880
16391
|
}
|
|
15881
16392
|
)
|
|
15882
16393
|
] });
|
|
15883
|
-
return /* @__PURE__ */
|
|
15884
|
-
topLabel && /* @__PURE__ */
|
|
15885
|
-
as === "button" ? /* @__PURE__ */
|
|
16394
|
+
return /* @__PURE__ */ jsxs112("div", { className: "w-full", children: [
|
|
16395
|
+
topLabel && /* @__PURE__ */ jsx169("p", { className: "mb-3 text-[16px] font-semibold leading-5 text-[#222222]", children: topLabel }),
|
|
16396
|
+
as === "button" ? /* @__PURE__ */ jsx169(
|
|
15886
16397
|
"button",
|
|
15887
16398
|
{
|
|
15888
16399
|
id,
|
|
@@ -15899,7 +16410,7 @@ var AirbnbFieldTrigger = React63.forwardRef(
|
|
|
15899
16410
|
...props,
|
|
15900
16411
|
children: sharedContent
|
|
15901
16412
|
}
|
|
15902
|
-
) : /* @__PURE__ */
|
|
16413
|
+
) : /* @__PURE__ */ jsx169(
|
|
15903
16414
|
"div",
|
|
15904
16415
|
{
|
|
15905
16416
|
id,
|
|
@@ -15916,14 +16427,14 @@ var AirbnbFieldTrigger = React63.forwardRef(
|
|
|
15916
16427
|
children: sharedContent
|
|
15917
16428
|
}
|
|
15918
16429
|
),
|
|
15919
|
-
errorMessage && !hideErrorMessage && /* @__PURE__ */
|
|
16430
|
+
errorMessage && !hideErrorMessage && /* @__PURE__ */ jsx169(FieldErrorMessage, { id: errorId, message: errorMessage })
|
|
15920
16431
|
] });
|
|
15921
16432
|
}
|
|
15922
16433
|
);
|
|
15923
16434
|
AirbnbFieldTrigger.displayName = "AirbnbFieldTrigger";
|
|
15924
16435
|
|
|
15925
16436
|
// src/airbnb-fields/datepicker/DatePicker.tsx
|
|
15926
|
-
import { jsx as
|
|
16437
|
+
import { jsx as jsx170, jsxs as jsxs113 } from "react/jsx-runtime";
|
|
15927
16438
|
var DEFAULT_MIN_DATE = new Date(1920, 0, 1);
|
|
15928
16439
|
var AirbnbDatePicker = React64.forwardRef(
|
|
15929
16440
|
({
|
|
@@ -15950,7 +16461,7 @@ var AirbnbDatePicker = React64.forwardRef(
|
|
|
15950
16461
|
doneLabel = "Done",
|
|
15951
16462
|
formatValue = formatDateValue
|
|
15952
16463
|
}, ref) => {
|
|
15953
|
-
const { isMatch:
|
|
16464
|
+
const { isMatch: isMobile3 } = useScreenResize(DEVICE.mobileXL);
|
|
15954
16465
|
const [isOpen, setIsOpen] = React64.useState(false);
|
|
15955
16466
|
const triggerId = React64.useId();
|
|
15956
16467
|
const pickerId = React64.useId();
|
|
@@ -16040,8 +16551,8 @@ var AirbnbDatePicker = React64.forwardRef(
|
|
|
16040
16551
|
setIsOpen(false);
|
|
16041
16552
|
}
|
|
16042
16553
|
}, [isBlocked]);
|
|
16043
|
-
return /* @__PURE__ */
|
|
16044
|
-
name && /* @__PURE__ */
|
|
16554
|
+
return /* @__PURE__ */ jsxs113("div", { className: cn("relative w-full max-w-[var(--max-field-width)]", className), children: [
|
|
16555
|
+
name && /* @__PURE__ */ jsx170(
|
|
16045
16556
|
"input",
|
|
16046
16557
|
{
|
|
16047
16558
|
type: "hidden",
|
|
@@ -16049,7 +16560,7 @@ var AirbnbDatePicker = React64.forwardRef(
|
|
|
16049
16560
|
value: resolvedValue ? formatDateInputValue(resolvedValue) : ""
|
|
16050
16561
|
}
|
|
16051
16562
|
),
|
|
16052
|
-
/* @__PURE__ */
|
|
16563
|
+
/* @__PURE__ */ jsx170(
|
|
16053
16564
|
AirbnbFieldTrigger,
|
|
16054
16565
|
{
|
|
16055
16566
|
id: triggerId,
|
|
@@ -16076,15 +16587,15 @@ var AirbnbDatePicker = React64.forwardRef(
|
|
|
16076
16587
|
onClick: handleTriggerClick,
|
|
16077
16588
|
onKeyDown: handleTriggerKeyDown,
|
|
16078
16589
|
onBlur,
|
|
16079
|
-
trailingAdornment: /* @__PURE__ */
|
|
16590
|
+
trailingAdornment: /* @__PURE__ */ jsx170(Calendar2, { className: "h-5 w-5 text-[#1F1F1B]", strokeWidth: 2 })
|
|
16080
16591
|
}
|
|
16081
16592
|
),
|
|
16082
|
-
/* @__PURE__ */
|
|
16593
|
+
/* @__PURE__ */ jsx170(
|
|
16083
16594
|
AirbnbDatePickerContent,
|
|
16084
16595
|
{
|
|
16085
16596
|
baseId: pickerId,
|
|
16086
16597
|
open: isOpen,
|
|
16087
|
-
isMobile:
|
|
16598
|
+
isMobile: isMobile3,
|
|
16088
16599
|
label,
|
|
16089
16600
|
title: mobileTitle ?? label,
|
|
16090
16601
|
doneLabel,
|
|
@@ -16114,7 +16625,7 @@ AirbnbDatePicker.displayName = "AirbnbDatePicker";
|
|
|
16114
16625
|
|
|
16115
16626
|
// src/airbnb-fields/input/Input.tsx
|
|
16116
16627
|
import * as React65 from "react";
|
|
16117
|
-
import { jsx as
|
|
16628
|
+
import { jsx as jsx171 } from "react/jsx-runtime";
|
|
16118
16629
|
var getInputValue = (value) => value != null ? String(value) : "";
|
|
16119
16630
|
var AirbnbInput = React65.forwardRef(
|
|
16120
16631
|
({
|
|
@@ -16197,7 +16708,7 @@ var AirbnbInput = React65.forwardRef(
|
|
|
16197
16708
|
setIsFocused(false);
|
|
16198
16709
|
onBlur?.(event);
|
|
16199
16710
|
};
|
|
16200
|
-
return /* @__PURE__ */
|
|
16711
|
+
return /* @__PURE__ */ jsx171("div", { className: cn("w-full max-w-[var(--max-field-width)]", wrapperClassName), children: /* @__PURE__ */ jsx171(
|
|
16201
16712
|
AirbnbFieldTrigger,
|
|
16202
16713
|
{
|
|
16203
16714
|
as: "div",
|
|
@@ -16229,7 +16740,7 @@ var AirbnbInput = React65.forwardRef(
|
|
|
16229
16740
|
forceFloatingLabel: shouldShowLabel,
|
|
16230
16741
|
forceLabelText: hasLabelMeta,
|
|
16231
16742
|
hideErrorMessage: !renderErrorMessage,
|
|
16232
|
-
children: /* @__PURE__ */
|
|
16743
|
+
children: /* @__PURE__ */ jsx171(
|
|
16233
16744
|
"input",
|
|
16234
16745
|
{
|
|
16235
16746
|
...props,
|
|
@@ -16272,7 +16783,7 @@ import { ChevronDown as ChevronDown5 } from "lucide-react";
|
|
|
16272
16783
|
import * as React70 from "react";
|
|
16273
16784
|
|
|
16274
16785
|
// src/airbnb-fields/select/SelectDesktopMenu.tsx
|
|
16275
|
-
import { jsx as
|
|
16786
|
+
import { jsx as jsx172, jsxs as jsxs114 } from "react/jsx-runtime";
|
|
16276
16787
|
function AirbnbSelectDesktopMenu({
|
|
16277
16788
|
id,
|
|
16278
16789
|
options,
|
|
@@ -16291,7 +16802,7 @@ function AirbnbSelectDesktopMenu({
|
|
|
16291
16802
|
noOptionsMessage
|
|
16292
16803
|
}) {
|
|
16293
16804
|
const emptyMessage = noOptionsMessage?.();
|
|
16294
|
-
return /* @__PURE__ */
|
|
16805
|
+
return /* @__PURE__ */ jsxs114(
|
|
16295
16806
|
"div",
|
|
16296
16807
|
{
|
|
16297
16808
|
id,
|
|
@@ -16304,12 +16815,12 @@ function AirbnbSelectDesktopMenu({
|
|
|
16304
16815
|
onKeyDown,
|
|
16305
16816
|
className: cn("max-h-[280px] overflow-y-auto p-2 outline-none", menuClassName),
|
|
16306
16817
|
children: [
|
|
16307
|
-
options.length === 0 && emptyMessage ? /* @__PURE__ */
|
|
16818
|
+
options.length === 0 && emptyMessage ? /* @__PURE__ */ jsx172("div", { className: "px-4 py-3 text-base leading-6 text-[#6C6C6C]", children: emptyMessage }) : null,
|
|
16308
16819
|
options.map((option, index) => {
|
|
16309
16820
|
const isSelected = selectedValue?.value === option.value;
|
|
16310
16821
|
const isHighlighted = index === highlightedIndex;
|
|
16311
16822
|
const optionKey = `${String(option.value)}-${index}`;
|
|
16312
|
-
return /* @__PURE__ */
|
|
16823
|
+
return /* @__PURE__ */ jsx172(
|
|
16313
16824
|
"button",
|
|
16314
16825
|
{
|
|
16315
16826
|
id: getOptionId2(index),
|
|
@@ -16341,7 +16852,7 @@ function AirbnbSelectDesktopMenu({
|
|
|
16341
16852
|
}
|
|
16342
16853
|
|
|
16343
16854
|
// src/airbnb-fields/select/SelectDesktopContent.tsx
|
|
16344
|
-
import { jsx as
|
|
16855
|
+
import { jsx as jsx173 } from "react/jsx-runtime";
|
|
16345
16856
|
function AirbnbSelectDesktopContent({
|
|
16346
16857
|
isOpen,
|
|
16347
16858
|
listboxId,
|
|
@@ -16362,14 +16873,14 @@ function AirbnbSelectDesktopContent({
|
|
|
16362
16873
|
noOptionsMessage
|
|
16363
16874
|
}) {
|
|
16364
16875
|
if (!isOpen) return null;
|
|
16365
|
-
return /* @__PURE__ */
|
|
16876
|
+
return /* @__PURE__ */ jsx173(
|
|
16366
16877
|
"div",
|
|
16367
16878
|
{
|
|
16368
16879
|
className: cn(
|
|
16369
16880
|
"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
16881
|
dropdownClassName
|
|
16371
16882
|
),
|
|
16372
|
-
children: /* @__PURE__ */
|
|
16883
|
+
children: /* @__PURE__ */ jsx173(
|
|
16373
16884
|
AirbnbSelectDesktopMenu,
|
|
16374
16885
|
{
|
|
16375
16886
|
id: listboxId,
|
|
@@ -16467,7 +16978,7 @@ function getMobileOptionStyles(index, scrollTop) {
|
|
|
16467
16978
|
}
|
|
16468
16979
|
|
|
16469
16980
|
// src/airbnb-fields/select/SelectMobileWheel.tsx
|
|
16470
|
-
import { jsx as
|
|
16981
|
+
import { jsx as jsx174, jsxs as jsxs115 } from "react/jsx-runtime";
|
|
16471
16982
|
function AirbnbSelectMobileWheel({
|
|
16472
16983
|
id,
|
|
16473
16984
|
options,
|
|
@@ -16486,7 +16997,7 @@ function AirbnbSelectMobileWheel({
|
|
|
16486
16997
|
}) {
|
|
16487
16998
|
const spacerHeight2 = getWheelSpacerHeight();
|
|
16488
16999
|
const emptyMessage = noOptionsMessage?.();
|
|
16489
|
-
return /* @__PURE__ */
|
|
17000
|
+
return /* @__PURE__ */ jsxs115(
|
|
16490
17001
|
"div",
|
|
16491
17002
|
{
|
|
16492
17003
|
id,
|
|
@@ -16498,10 +17009,10 @@ function AirbnbSelectMobileWheel({
|
|
|
16498
17009
|
onKeyDown,
|
|
16499
17010
|
className: cn("relative overflow-hidden outline-none", menuClassName),
|
|
16500
17011
|
children: [
|
|
16501
|
-
options.length === 0 && emptyMessage ? /* @__PURE__ */
|
|
16502
|
-
/* @__PURE__ */
|
|
16503
|
-
/* @__PURE__ */
|
|
16504
|
-
/* @__PURE__ */
|
|
17012
|
+
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,
|
|
17013
|
+
/* @__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" }),
|
|
17014
|
+
/* @__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" }),
|
|
17015
|
+
/* @__PURE__ */ jsx174(
|
|
16505
17016
|
"div",
|
|
16506
17017
|
{
|
|
16507
17018
|
"aria-hidden": true,
|
|
@@ -16511,7 +17022,7 @@ function AirbnbSelectMobileWheel({
|
|
|
16511
17022
|
)
|
|
16512
17023
|
}
|
|
16513
17024
|
),
|
|
16514
|
-
/* @__PURE__ */
|
|
17025
|
+
/* @__PURE__ */ jsxs115(
|
|
16515
17026
|
"div",
|
|
16516
17027
|
{
|
|
16517
17028
|
ref: listRef,
|
|
@@ -16526,11 +17037,11 @@ function AirbnbSelectMobileWheel({
|
|
|
16526
17037
|
WebkitOverflowScrolling: "touch"
|
|
16527
17038
|
},
|
|
16528
17039
|
children: [
|
|
16529
|
-
/* @__PURE__ */
|
|
17040
|
+
/* @__PURE__ */ jsx174("div", { style: { height: `${spacerHeight2}px` } }),
|
|
16530
17041
|
options.map((option, index) => {
|
|
16531
17042
|
const { distance, style } = getMobileOptionStyles(index, scrollTop);
|
|
16532
17043
|
const optionKey = `${String(option.value)}-${index}`;
|
|
16533
|
-
return /* @__PURE__ */
|
|
17044
|
+
return /* @__PURE__ */ jsx174(
|
|
16534
17045
|
"button",
|
|
16535
17046
|
{
|
|
16536
17047
|
id: getOptionId2(index),
|
|
@@ -16551,7 +17062,7 @@ function AirbnbSelectMobileWheel({
|
|
|
16551
17062
|
optionKey
|
|
16552
17063
|
);
|
|
16553
17064
|
}),
|
|
16554
|
-
/* @__PURE__ */
|
|
17065
|
+
/* @__PURE__ */ jsx174("div", { style: { height: `${spacerHeight2}px` } })
|
|
16555
17066
|
]
|
|
16556
17067
|
}
|
|
16557
17068
|
)
|
|
@@ -16561,7 +17072,7 @@ function AirbnbSelectMobileWheel({
|
|
|
16561
17072
|
}
|
|
16562
17073
|
|
|
16563
17074
|
// src/airbnb-fields/select/SelectMobileContent.tsx
|
|
16564
|
-
import { jsx as
|
|
17075
|
+
import { jsx as jsx175, jsxs as jsxs116 } from "react/jsx-runtime";
|
|
16565
17076
|
function AirbnbSelectMobileContent({
|
|
16566
17077
|
open,
|
|
16567
17078
|
onOpenChange,
|
|
@@ -16585,11 +17096,11 @@ function AirbnbSelectMobileContent({
|
|
|
16585
17096
|
getOptionId: getOptionId2,
|
|
16586
17097
|
noOptionsMessage
|
|
16587
17098
|
}) {
|
|
16588
|
-
return /* @__PURE__ */
|
|
16589
|
-
/* @__PURE__ */
|
|
16590
|
-
/* @__PURE__ */
|
|
16591
|
-
/* @__PURE__ */
|
|
16592
|
-
/* @__PURE__ */
|
|
17099
|
+
return /* @__PURE__ */ jsx175(Drawer, { open, onOpenChange, children: /* @__PURE__ */ jsxs116(DrawerContent, { onClose, lockScroll: false, children: [
|
|
17100
|
+
/* @__PURE__ */ jsx175(DrawerTitle, { className: "sr-only", children: mobileTitle ?? label }),
|
|
17101
|
+
/* @__PURE__ */ jsx175(DrawerDescription, { className: "sr-only", children: label }),
|
|
17102
|
+
/* @__PURE__ */ jsxs116("div", { className: "px-6 pb-4 pt-1", children: [
|
|
17103
|
+
/* @__PURE__ */ jsx175(
|
|
16593
17104
|
AirbnbSelectMobileWheel,
|
|
16594
17105
|
{
|
|
16595
17106
|
id: listboxId,
|
|
@@ -16608,7 +17119,7 @@ function AirbnbSelectMobileContent({
|
|
|
16608
17119
|
noOptionsMessage
|
|
16609
17120
|
}
|
|
16610
17121
|
),
|
|
16611
|
-
/* @__PURE__ */
|
|
17122
|
+
/* @__PURE__ */ jsx175(Button, { type: "button", onClick: onDone, className: "mt-4 h-12 mb-8 w-full", children: doneLabel })
|
|
16612
17123
|
] })
|
|
16613
17124
|
] }) });
|
|
16614
17125
|
}
|
|
@@ -16616,7 +17127,7 @@ function AirbnbSelectMobileContent({
|
|
|
16616
17127
|
// src/airbnb-fields/select/SelectTrigger.tsx
|
|
16617
17128
|
import * as React66 from "react";
|
|
16618
17129
|
import { ChevronDown as ChevronDown4 } from "lucide-react";
|
|
16619
|
-
import { jsx as
|
|
17130
|
+
import { jsx as jsx176 } from "react/jsx-runtime";
|
|
16620
17131
|
var AirbnbSelectTrigger = React66.forwardRef(
|
|
16621
17132
|
({
|
|
16622
17133
|
id,
|
|
@@ -16642,7 +17153,7 @@ var AirbnbSelectTrigger = React66.forwardRef(
|
|
|
16642
17153
|
onKeyDown,
|
|
16643
17154
|
onBlur
|
|
16644
17155
|
}, ref) => {
|
|
16645
|
-
return /* @__PURE__ */
|
|
17156
|
+
return /* @__PURE__ */ jsx176(
|
|
16646
17157
|
AirbnbFieldTrigger,
|
|
16647
17158
|
{
|
|
16648
17159
|
id,
|
|
@@ -16671,7 +17182,7 @@ var AirbnbSelectTrigger = React66.forwardRef(
|
|
|
16671
17182
|
onClick,
|
|
16672
17183
|
onKeyDown,
|
|
16673
17184
|
onBlur,
|
|
16674
|
-
trailingAdornment: /* @__PURE__ */
|
|
17185
|
+
trailingAdornment: /* @__PURE__ */ jsx176(
|
|
16675
17186
|
ChevronDown4,
|
|
16676
17187
|
{
|
|
16677
17188
|
className: open ? "h-6 w-6 rotate-180 text-[#1F1F1B] transition-transform" : "h-6 w-6 text-[#1F1F1B] transition-transform"
|
|
@@ -16686,7 +17197,7 @@ AirbnbSelectTrigger.displayName = "AirbnbSelectTrigger";
|
|
|
16686
17197
|
// src/airbnb-fields/select/useDesktopSelect.ts
|
|
16687
17198
|
import * as React67 from "react";
|
|
16688
17199
|
function useDesktopSelect({
|
|
16689
|
-
isMobile:
|
|
17200
|
+
isMobile: isMobile3,
|
|
16690
17201
|
isOpen,
|
|
16691
17202
|
options,
|
|
16692
17203
|
value,
|
|
@@ -16699,7 +17210,7 @@ function useDesktopSelect({
|
|
|
16699
17210
|
const optionRefs = React67.useRef([]);
|
|
16700
17211
|
const selectedIndex = getOptionIndex2(options, value);
|
|
16701
17212
|
React67.useEffect(() => {
|
|
16702
|
-
if (!isOpen ||
|
|
17213
|
+
if (!isOpen || isMobile3) return;
|
|
16703
17214
|
setHighlightedIndex((currentIndex) => {
|
|
16704
17215
|
if (currentIndex >= 0) {
|
|
16705
17216
|
return currentIndex;
|
|
@@ -16712,13 +17223,13 @@ function useDesktopSelect({
|
|
|
16712
17223
|
return () => {
|
|
16713
17224
|
window.cancelAnimationFrame(frameId);
|
|
16714
17225
|
};
|
|
16715
|
-
}, [
|
|
17226
|
+
}, [isMobile3, isOpen, options, selectedIndex]);
|
|
16716
17227
|
React67.useEffect(() => {
|
|
16717
|
-
if (!isOpen ||
|
|
17228
|
+
if (!isOpen || isMobile3 || highlightedIndex < 0) return;
|
|
16718
17229
|
optionRefs.current[highlightedIndex]?.scrollIntoView({
|
|
16719
17230
|
block: "nearest"
|
|
16720
17231
|
});
|
|
16721
|
-
}, [highlightedIndex,
|
|
17232
|
+
}, [highlightedIndex, isMobile3, isOpen]);
|
|
16722
17233
|
React67.useEffect(() => {
|
|
16723
17234
|
if (isOpen) return;
|
|
16724
17235
|
setHighlightedIndex(-1);
|
|
@@ -16836,7 +17347,7 @@ function useDesktopSelect({
|
|
|
16836
17347
|
|
|
16837
17348
|
// src/airbnb-fields/select/useMobileSelectWheel.ts
|
|
16838
17349
|
import * as React68 from "react";
|
|
16839
|
-
function useMobileSelectWheel({ isMobile:
|
|
17350
|
+
function useMobileSelectWheel({ isMobile: isMobile3, isOpen, options, value, disabled }) {
|
|
16840
17351
|
const [pendingValue, setPendingValue] = React68.useState(
|
|
16841
17352
|
value ?? null
|
|
16842
17353
|
);
|
|
@@ -16891,14 +17402,14 @@ function useMobileSelectWheel({ isMobile: isMobile2, isOpen, options, value, dis
|
|
|
16891
17402
|
setPendingValue(value ?? null);
|
|
16892
17403
|
}, [value]);
|
|
16893
17404
|
React68.useLayoutEffect(() => {
|
|
16894
|
-
if (!
|
|
17405
|
+
if (!isMobile3 || !isOpen) return;
|
|
16895
17406
|
const frameId = window.requestAnimationFrame(() => {
|
|
16896
17407
|
syncScrollPosition(value ?? null, "instant");
|
|
16897
17408
|
});
|
|
16898
17409
|
return () => {
|
|
16899
17410
|
window.cancelAnimationFrame(frameId);
|
|
16900
17411
|
};
|
|
16901
|
-
}, [
|
|
17412
|
+
}, [isMobile3, isOpen, syncScrollPosition, value]);
|
|
16902
17413
|
const settleScroll = React68.useCallback(() => {
|
|
16903
17414
|
if (!mobileListRef.current) return;
|
|
16904
17415
|
const nextIndex = Math.round(mobileListRef.current.scrollTop / MOBILE_OPTION_HEIGHT);
|
|
@@ -17033,7 +17544,7 @@ function useSelectIds2({ name, hasValue, error, hideErrorMessage }) {
|
|
|
17033
17544
|
}
|
|
17034
17545
|
|
|
17035
17546
|
// src/airbnb-fields/select/Select.tsx
|
|
17036
|
-
import { jsx as
|
|
17547
|
+
import { jsx as jsx177, jsxs as jsxs117 } from "react/jsx-runtime";
|
|
17037
17548
|
var AirbnbSelect = React70.forwardRef(function AirbnbSelect2({
|
|
17038
17549
|
options = [],
|
|
17039
17550
|
value,
|
|
@@ -17060,7 +17571,7 @@ var AirbnbSelect = React70.forwardRef(function AirbnbSelect2({
|
|
|
17060
17571
|
name,
|
|
17061
17572
|
noOptionsMessage
|
|
17062
17573
|
}, ref) {
|
|
17063
|
-
const { isMatch:
|
|
17574
|
+
const { isMatch: isMobile3 } = useScreenResize(DEVICE.mobileXL);
|
|
17064
17575
|
const [isOpen, setIsOpen] = React70.useState(false);
|
|
17065
17576
|
const containerRef = React70.useRef(null);
|
|
17066
17577
|
const hasValue = Boolean(value);
|
|
@@ -17091,7 +17602,7 @@ var AirbnbSelect = React70.forwardRef(function AirbnbSelect2({
|
|
|
17091
17602
|
moveByStep,
|
|
17092
17603
|
moveToBoundary
|
|
17093
17604
|
} = useMobileSelectWheel({
|
|
17094
|
-
isMobile:
|
|
17605
|
+
isMobile: isMobile3,
|
|
17095
17606
|
isOpen,
|
|
17096
17607
|
options,
|
|
17097
17608
|
value,
|
|
@@ -17108,7 +17619,7 @@ var AirbnbSelect = React70.forwardRef(function AirbnbSelect2({
|
|
|
17108
17619
|
handleMenuKeyDown,
|
|
17109
17620
|
handleTriggerKeyDown
|
|
17110
17621
|
} = useDesktopSelect({
|
|
17111
|
-
isMobile:
|
|
17622
|
+
isMobile: isMobile3,
|
|
17112
17623
|
isOpen,
|
|
17113
17624
|
options,
|
|
17114
17625
|
value,
|
|
@@ -17121,7 +17632,7 @@ var AirbnbSelect = React70.forwardRef(function AirbnbSelect2({
|
|
|
17121
17632
|
useOutsideClick({
|
|
17122
17633
|
elementRef: containerRef,
|
|
17123
17634
|
onOutsideClick: () => setIsOpen(false),
|
|
17124
|
-
isDisabled: !isOpen ||
|
|
17635
|
+
isDisabled: !isOpen || isMobile3
|
|
17125
17636
|
});
|
|
17126
17637
|
React70.useEffect(() => {
|
|
17127
17638
|
if (isBlocked) {
|
|
@@ -17164,14 +17675,14 @@ var AirbnbSelect = React70.forwardRef(function AirbnbSelect2({
|
|
|
17164
17675
|
if (isBlocked) return;
|
|
17165
17676
|
setIsOpen((prev) => {
|
|
17166
17677
|
const nextOpen = !prev;
|
|
17167
|
-
if (
|
|
17678
|
+
if (isMobile3) {
|
|
17168
17679
|
syncPendingValue(value ?? null);
|
|
17169
17680
|
}
|
|
17170
17681
|
return nextOpen;
|
|
17171
17682
|
});
|
|
17172
|
-
}, [isBlocked,
|
|
17683
|
+
}, [isBlocked, isMobile3, syncPendingValue, value]);
|
|
17173
17684
|
const handleRootTriggerKeyDown = (event) => {
|
|
17174
|
-
if (
|
|
17685
|
+
if (isMobile3) {
|
|
17175
17686
|
if (isBlocked) return;
|
|
17176
17687
|
if (event.key === "ArrowDown" || event.key === "ArrowUp" || event.key === "Enter" || event.key === " ") {
|
|
17177
17688
|
event.preventDefault();
|
|
@@ -17213,13 +17724,13 @@ var AirbnbSelect = React70.forwardRef(function AirbnbSelect2({
|
|
|
17213
17724
|
handleMobileOpenChange(false);
|
|
17214
17725
|
}
|
|
17215
17726
|
};
|
|
17216
|
-
return /* @__PURE__ */
|
|
17727
|
+
return /* @__PURE__ */ jsxs117(
|
|
17217
17728
|
"div",
|
|
17218
17729
|
{
|
|
17219
17730
|
ref: containerRef,
|
|
17220
17731
|
className: cn("relative w-full max-w-[var(--max-field-width)]", className),
|
|
17221
17732
|
children: [
|
|
17222
|
-
name && /* @__PURE__ */
|
|
17733
|
+
name && /* @__PURE__ */ jsx177("input", { type: "hidden", name, value: value ? String(value.value) : "" }),
|
|
17223
17734
|
renderTrigger ? renderTrigger({
|
|
17224
17735
|
id: triggerId,
|
|
17225
17736
|
open: isOpen,
|
|
@@ -17241,7 +17752,7 @@ var AirbnbSelect = React70.forwardRef(function AirbnbSelect2({
|
|
|
17241
17752
|
onClick: handleTriggerClick,
|
|
17242
17753
|
onKeyDown: handleRootTriggerKeyDown,
|
|
17243
17754
|
onBlur
|
|
17244
|
-
}) : /* @__PURE__ */
|
|
17755
|
+
}) : /* @__PURE__ */ jsx177(
|
|
17245
17756
|
AirbnbSelectTrigger,
|
|
17246
17757
|
{
|
|
17247
17758
|
id: triggerId,
|
|
@@ -17269,7 +17780,7 @@ var AirbnbSelect = React70.forwardRef(function AirbnbSelect2({
|
|
|
17269
17780
|
onBlur
|
|
17270
17781
|
}
|
|
17271
17782
|
),
|
|
17272
|
-
|
|
17783
|
+
isMobile3 ? /* @__PURE__ */ jsx177(
|
|
17273
17784
|
AirbnbSelectMobileContent,
|
|
17274
17785
|
{
|
|
17275
17786
|
open: isOpen,
|
|
@@ -17294,7 +17805,7 @@ var AirbnbSelect = React70.forwardRef(function AirbnbSelect2({
|
|
|
17294
17805
|
getOptionId: getOptionId2,
|
|
17295
17806
|
noOptionsMessage
|
|
17296
17807
|
}
|
|
17297
|
-
) : /* @__PURE__ */
|
|
17808
|
+
) : /* @__PURE__ */ jsx177(
|
|
17298
17809
|
AirbnbSelectDesktopContent,
|
|
17299
17810
|
{
|
|
17300
17811
|
isOpen,
|
|
@@ -17328,7 +17839,7 @@ var AirbnbSelect = React70.forwardRef(function AirbnbSelect2({
|
|
|
17328
17839
|
});
|
|
17329
17840
|
|
|
17330
17841
|
// src/airbnb-fields/phone-field/PhoneField.tsx
|
|
17331
|
-
import { jsx as
|
|
17842
|
+
import { jsx as jsx178, jsxs as jsxs118 } from "react/jsx-runtime";
|
|
17332
17843
|
function formatPhoneCodeOptionLabel(option) {
|
|
17333
17844
|
const label = String(option.label);
|
|
17334
17845
|
const value = String(option.value);
|
|
@@ -17375,9 +17886,9 @@ var AirbnbPhoneField = React71.forwardRef(
|
|
|
17375
17886
|
const hasInvalidState = Boolean(error) || Boolean(invalid);
|
|
17376
17887
|
const isBlocked = Boolean(disabled) || Boolean(loading);
|
|
17377
17888
|
const isCodeBlocked = isBlocked || Boolean(codeReadOnly);
|
|
17378
|
-
return /* @__PURE__ */
|
|
17379
|
-
name && /* @__PURE__ */
|
|
17380
|
-
codeName && /* @__PURE__ */
|
|
17889
|
+
return /* @__PURE__ */ jsxs118("div", { className: cn("w-full max-w-[var(--max-field-width)]", className), children: [
|
|
17890
|
+
name && /* @__PURE__ */ jsx178("input", { type: "hidden", name, value: combinedValue, disabled }),
|
|
17891
|
+
codeName && /* @__PURE__ */ jsx178(
|
|
17381
17892
|
"input",
|
|
17382
17893
|
{
|
|
17383
17894
|
type: "hidden",
|
|
@@ -17386,7 +17897,7 @@ var AirbnbPhoneField = React71.forwardRef(
|
|
|
17386
17897
|
disabled
|
|
17387
17898
|
}
|
|
17388
17899
|
),
|
|
17389
|
-
numberName && /* @__PURE__ */
|
|
17900
|
+
numberName && /* @__PURE__ */ jsx178(
|
|
17390
17901
|
"input",
|
|
17391
17902
|
{
|
|
17392
17903
|
type: "hidden",
|
|
@@ -17395,7 +17906,7 @@ var AirbnbPhoneField = React71.forwardRef(
|
|
|
17395
17906
|
disabled
|
|
17396
17907
|
}
|
|
17397
17908
|
),
|
|
17398
|
-
topLabel && /* @__PURE__ */
|
|
17909
|
+
topLabel && /* @__PURE__ */ jsx178(
|
|
17399
17910
|
"label",
|
|
17400
17911
|
{
|
|
17401
17912
|
htmlFor: inputId,
|
|
@@ -17403,8 +17914,8 @@ var AirbnbPhoneField = React71.forwardRef(
|
|
|
17403
17914
|
children: topLabel
|
|
17404
17915
|
}
|
|
17405
17916
|
),
|
|
17406
|
-
/* @__PURE__ */
|
|
17407
|
-
/* @__PURE__ */
|
|
17917
|
+
/* @__PURE__ */ jsxs118("div", { className: "flex items-stretch", children: [
|
|
17918
|
+
/* @__PURE__ */ jsx178(
|
|
17408
17919
|
AirbnbSelect,
|
|
17409
17920
|
{
|
|
17410
17921
|
ref,
|
|
@@ -17435,7 +17946,7 @@ var AirbnbPhoneField = React71.forwardRef(
|
|
|
17435
17946
|
onClick,
|
|
17436
17947
|
onKeyDown,
|
|
17437
17948
|
valueLabel
|
|
17438
|
-
}) => /* @__PURE__ */
|
|
17949
|
+
}) => /* @__PURE__ */ jsxs118(
|
|
17439
17950
|
"button",
|
|
17440
17951
|
{
|
|
17441
17952
|
id,
|
|
@@ -17457,8 +17968,8 @@ var AirbnbPhoneField = React71.forwardRef(
|
|
|
17457
17968
|
triggerDisabled ? "cursor-not-allowed opacity-50" : triggerLoading ? "cursor-progress" : "cursor-pointer"
|
|
17458
17969
|
),
|
|
17459
17970
|
children: [
|
|
17460
|
-
/* @__PURE__ */
|
|
17461
|
-
/* @__PURE__ */
|
|
17971
|
+
/* @__PURE__ */ jsx178("span", { children: valueLabel ?? codePlaceholder }),
|
|
17972
|
+
/* @__PURE__ */ jsx178(
|
|
17462
17973
|
ChevronDown5,
|
|
17463
17974
|
{
|
|
17464
17975
|
className: cn("h-5 w-5 transition-transform", open ? "rotate-180" : ""),
|
|
@@ -17470,7 +17981,7 @@ var AirbnbPhoneField = React71.forwardRef(
|
|
|
17470
17981
|
)
|
|
17471
17982
|
}
|
|
17472
17983
|
),
|
|
17473
|
-
/* @__PURE__ */
|
|
17984
|
+
/* @__PURE__ */ jsx178(
|
|
17474
17985
|
AirbnbInput,
|
|
17475
17986
|
{
|
|
17476
17987
|
id: inputId,
|
|
@@ -17502,7 +18013,7 @@ var AirbnbPhoneField = React71.forwardRef(
|
|
|
17502
18013
|
}
|
|
17503
18014
|
)
|
|
17504
18015
|
] }),
|
|
17505
|
-
error && /* @__PURE__ */
|
|
18016
|
+
error && /* @__PURE__ */ jsx178(FieldErrorMessage, { message: error })
|
|
17506
18017
|
] });
|
|
17507
18018
|
}
|
|
17508
18019
|
);
|
|
@@ -17512,8 +18023,8 @@ AirbnbPhoneField.displayName = "AirbnbPhoneField";
|
|
|
17512
18023
|
import * as React72 from "react";
|
|
17513
18024
|
import { ChevronDown as ChevronDown6, Search as Search3 } from "lucide-react";
|
|
17514
18025
|
import { useVirtualizer as useVirtualizer3 } from "@tanstack/react-virtual";
|
|
17515
|
-
import { useCallback as
|
|
17516
|
-
import { jsx as
|
|
18026
|
+
import { useCallback as useCallback49 } from "react";
|
|
18027
|
+
import { jsx as jsx179, jsxs as jsxs119 } from "react/jsx-runtime";
|
|
17517
18028
|
var ROW_HEIGHT = 48;
|
|
17518
18029
|
var DESKTOP_LIST_HEIGHT = 280;
|
|
17519
18030
|
var MOBILE_LIST_HEIGHT = 420;
|
|
@@ -17553,7 +18064,7 @@ var AirbnbSearchableSelectInternal = ({
|
|
|
17553
18064
|
noOptionsMessage,
|
|
17554
18065
|
loadingMessage
|
|
17555
18066
|
}, ref) => {
|
|
17556
|
-
const { isMatch:
|
|
18067
|
+
const { isMatch: isMobile3 } = useScreenResize(DEVICE.mobileXL);
|
|
17557
18068
|
const reactId = React72.useId();
|
|
17558
18069
|
const [open, setOpen] = React72.useState(false);
|
|
17559
18070
|
const [internalSearchValue, setInternalSearchValue] = React72.useState("");
|
|
@@ -17588,10 +18099,10 @@ var AirbnbSearchableSelectInternal = ({
|
|
|
17588
18099
|
useOutsideClick({
|
|
17589
18100
|
elementRef: containerRef,
|
|
17590
18101
|
onOutsideClick: () => closeSelect(),
|
|
17591
|
-
isDisabled: !open ||
|
|
18102
|
+
isDisabled: !open || isMobile3
|
|
17592
18103
|
});
|
|
17593
18104
|
const handleOnOpenChange = useEvent(onOpenChange);
|
|
17594
|
-
const setSelectOpen =
|
|
18105
|
+
const setSelectOpen = useCallback49(
|
|
17595
18106
|
(nextOpen, options2) => {
|
|
17596
18107
|
setOpen(nextOpen);
|
|
17597
18108
|
handleOnOpenChange?.(nextOpen);
|
|
@@ -17682,7 +18193,7 @@ var AirbnbSearchableSelectInternal = ({
|
|
|
17682
18193
|
}
|
|
17683
18194
|
}
|
|
17684
18195
|
}
|
|
17685
|
-
const content = /* @__PURE__ */
|
|
18196
|
+
const content = /* @__PURE__ */ jsx179(
|
|
17686
18197
|
AirbnbSearchableSelectContent,
|
|
17687
18198
|
{
|
|
17688
18199
|
inputId: searchInputId,
|
|
@@ -17701,7 +18212,7 @@ var AirbnbSearchableSelectInternal = ({
|
|
|
17701
18212
|
menuClassName,
|
|
17702
18213
|
noOptionsMessage,
|
|
17703
18214
|
loadingMessage,
|
|
17704
|
-
height:
|
|
18215
|
+
height: isMobile3 ? MOBILE_LIST_HEIGHT : DESKTOP_LIST_HEIGHT,
|
|
17705
18216
|
idPrefix: reactId,
|
|
17706
18217
|
onSearchChange: handleSearchChange,
|
|
17707
18218
|
onSearchKeyDown: handleSearchKeyDown,
|
|
@@ -17710,9 +18221,9 @@ var AirbnbSearchableSelectInternal = ({
|
|
|
17710
18221
|
}
|
|
17711
18222
|
);
|
|
17712
18223
|
React72.useImperativeHandle(ref, () => triggerRef.current, []);
|
|
17713
|
-
return /* @__PURE__ */
|
|
17714
|
-
name && /* @__PURE__ */
|
|
17715
|
-
/* @__PURE__ */
|
|
18224
|
+
return /* @__PURE__ */ jsxs119("div", { ref: containerRef, className: cn("relative w-full max-w-[425px]", className), children: [
|
|
18225
|
+
name && /* @__PURE__ */ jsx179("input", { type: "hidden", name, value: value ? String(value.value) : "" }),
|
|
18226
|
+
/* @__PURE__ */ jsx179(
|
|
17716
18227
|
AirbnbFieldTrigger,
|
|
17717
18228
|
{
|
|
17718
18229
|
id: `${reactId}-trigger`,
|
|
@@ -17747,7 +18258,7 @@ var AirbnbSearchableSelectInternal = ({
|
|
|
17747
18258
|
},
|
|
17748
18259
|
onKeyDown: handleTriggerKeyDown,
|
|
17749
18260
|
onBlur,
|
|
17750
|
-
trailingAdornment: /* @__PURE__ */
|
|
18261
|
+
trailingAdornment: /* @__PURE__ */ jsx179(
|
|
17751
18262
|
ChevronDown6,
|
|
17752
18263
|
{
|
|
17753
18264
|
className: cn(
|
|
@@ -17758,7 +18269,7 @@ var AirbnbSearchableSelectInternal = ({
|
|
|
17758
18269
|
)
|
|
17759
18270
|
}
|
|
17760
18271
|
),
|
|
17761
|
-
|
|
18272
|
+
isMobile3 ? /* @__PURE__ */ jsx179(
|
|
17762
18273
|
Drawer,
|
|
17763
18274
|
{
|
|
17764
18275
|
open,
|
|
@@ -17770,13 +18281,13 @@ var AirbnbSearchableSelectInternal = ({
|
|
|
17770
18281
|
}
|
|
17771
18282
|
closeSelect();
|
|
17772
18283
|
},
|
|
17773
|
-
children: /* @__PURE__ */
|
|
17774
|
-
/* @__PURE__ */
|
|
17775
|
-
/* @__PURE__ */
|
|
17776
|
-
/* @__PURE__ */
|
|
18284
|
+
children: /* @__PURE__ */ jsxs119(DrawerContent, { onClose: closeSelect, lockScroll: false, children: [
|
|
18285
|
+
/* @__PURE__ */ jsx179(DrawerTitle, { className: "sr-only", children: mobileTitle ?? label }),
|
|
18286
|
+
/* @__PURE__ */ jsx179(DrawerDescription, { className: "sr-only", children: label }),
|
|
18287
|
+
/* @__PURE__ */ jsx179("div", { className: "px-5 pb-5 pt-1", children: content })
|
|
17777
18288
|
] })
|
|
17778
18289
|
}
|
|
17779
|
-
) : open ? /* @__PURE__ */
|
|
18290
|
+
) : open ? /* @__PURE__ */ jsx179(
|
|
17780
18291
|
"div",
|
|
17781
18292
|
{
|
|
17782
18293
|
className: cn(
|
|
@@ -17843,16 +18354,16 @@ function AirbnbSearchableSelectContent({
|
|
|
17843
18354
|
virtualizer.scrollToIndex(highlightedIndex, { align: "auto" });
|
|
17844
18355
|
}
|
|
17845
18356
|
}, [highlightedIndex, virtualizer]);
|
|
17846
|
-
return /* @__PURE__ */
|
|
17847
|
-
/* @__PURE__ */
|
|
17848
|
-
/* @__PURE__ */
|
|
18357
|
+
return /* @__PURE__ */ jsxs119("div", { className: "p-2", children: [
|
|
18358
|
+
/* @__PURE__ */ jsxs119("div", { className: "relative mb-2", children: [
|
|
18359
|
+
/* @__PURE__ */ jsx179(
|
|
17849
18360
|
Search3,
|
|
17850
18361
|
{
|
|
17851
18362
|
"aria-hidden": "true",
|
|
17852
18363
|
className: "absolute left-4 top-1/2 h-5 w-5 -translate-y-1/2 text-[#9696B9]"
|
|
17853
18364
|
}
|
|
17854
18365
|
),
|
|
17855
|
-
/* @__PURE__ */
|
|
18366
|
+
/* @__PURE__ */ jsx179(
|
|
17856
18367
|
"input",
|
|
17857
18368
|
{
|
|
17858
18369
|
id: inputId,
|
|
@@ -17871,7 +18382,7 @@ function AirbnbSearchableSelectContent({
|
|
|
17871
18382
|
}
|
|
17872
18383
|
)
|
|
17873
18384
|
] }),
|
|
17874
|
-
loading && options.length === 0 ? /* @__PURE__ */
|
|
18385
|
+
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
18386
|
"div",
|
|
17876
18387
|
{
|
|
17877
18388
|
id: listboxId,
|
|
@@ -17880,7 +18391,7 @@ function AirbnbSearchableSelectContent({
|
|
|
17880
18391
|
"aria-labelledby": labelId,
|
|
17881
18392
|
className: cn("overflow-y-auto outline-none", menuClassName),
|
|
17882
18393
|
style: { height: Math.min(height, rowCount * ROW_HEIGHT) },
|
|
17883
|
-
children: /* @__PURE__ */
|
|
18394
|
+
children: /* @__PURE__ */ jsx179(
|
|
17884
18395
|
"div",
|
|
17885
18396
|
{
|
|
17886
18397
|
className: "relative w-full",
|
|
@@ -17888,7 +18399,7 @@ function AirbnbSearchableSelectContent({
|
|
|
17888
18399
|
children: virtualItems.map((virtualItem) => {
|
|
17889
18400
|
const option = options[virtualItem.index];
|
|
17890
18401
|
if (!option) {
|
|
17891
|
-
return /* @__PURE__ */
|
|
18402
|
+
return /* @__PURE__ */ jsx179(
|
|
17892
18403
|
"div",
|
|
17893
18404
|
{
|
|
17894
18405
|
className: "absolute left-0 top-0 flex w-full items-center px-4 text-base leading-6 text-[#6C6C6C]",
|
|
@@ -17903,7 +18414,7 @@ function AirbnbSearchableSelectContent({
|
|
|
17903
18414
|
}
|
|
17904
18415
|
const isSelected = value?.value === option.value;
|
|
17905
18416
|
const isHighlighted = virtualItem.index === highlightedIndex;
|
|
17906
|
-
return /* @__PURE__ */
|
|
18417
|
+
return /* @__PURE__ */ jsx179(
|
|
17907
18418
|
"button",
|
|
17908
18419
|
{
|
|
17909
18420
|
id: getOptionId(idPrefix, virtualItem.index),
|
|
@@ -17925,7 +18436,7 @@ function AirbnbSearchableSelectContent({
|
|
|
17925
18436
|
height: `${virtualItem.size}px`,
|
|
17926
18437
|
transform: `translateY(${virtualItem.start}px)`
|
|
17927
18438
|
},
|
|
17928
|
-
children: /* @__PURE__ */
|
|
18439
|
+
children: /* @__PURE__ */ jsx179("span", { className: "truncate text-center", children: String(option.label) })
|
|
17929
18440
|
},
|
|
17930
18441
|
`${String(option.value)}-${virtualItem.index}`
|
|
17931
18442
|
);
|
|
@@ -17955,15 +18466,15 @@ function getNextEnabledIndex(options, startIndex, step) {
|
|
|
17955
18466
|
|
|
17956
18467
|
// src/airbnb-fields/search-input/SearchInput.tsx
|
|
17957
18468
|
import * as React73 from "react";
|
|
17958
|
-
import { useTranslation as
|
|
18469
|
+
import { useTranslation as useTranslation40 } from "react-i18next";
|
|
17959
18470
|
import { Search as Search4, X as X10 } from "lucide-react";
|
|
17960
|
-
import { jsx as
|
|
18471
|
+
import { jsx as jsx180, jsxs as jsxs120 } from "react/jsx-runtime";
|
|
17961
18472
|
var AirbnbSearchInput = React73.forwardRef(({ onReset, placeholder, wrapperClassName, ...props }, ref) => {
|
|
17962
|
-
const { t } =
|
|
18473
|
+
const { t } = useTranslation40();
|
|
17963
18474
|
const placeholderText = placeholder || t("search_property") + "...";
|
|
17964
|
-
return /* @__PURE__ */
|
|
17965
|
-
/* @__PURE__ */
|
|
17966
|
-
/* @__PURE__ */
|
|
18475
|
+
return /* @__PURE__ */ jsxs120("div", { className: cn("input-wrapper relative", wrapperClassName), children: [
|
|
18476
|
+
/* @__PURE__ */ jsx180(Search4, { className: "absolute left-4 top-1/2 h-5 w-5 -translate-y-1/2 transform text-[#9696B9]" }),
|
|
18477
|
+
/* @__PURE__ */ jsx180(
|
|
17967
18478
|
"input",
|
|
17968
18479
|
{
|
|
17969
18480
|
...props,
|
|
@@ -17982,13 +18493,13 @@ var AirbnbSearchInput = React73.forwardRef(({ onReset, placeholder, wrapperClass
|
|
|
17982
18493
|
)
|
|
17983
18494
|
}
|
|
17984
18495
|
),
|
|
17985
|
-
onReset && /* @__PURE__ */
|
|
18496
|
+
onReset && /* @__PURE__ */ jsx180(
|
|
17986
18497
|
Button,
|
|
17987
18498
|
{
|
|
17988
18499
|
variant: "ghost",
|
|
17989
18500
|
onClick: onReset,
|
|
17990
18501
|
className: "absolute right-0 top-1/2 h-5 w-5 -translate-y-1/2 transform text-[#9696B9]",
|
|
17991
|
-
children: /* @__PURE__ */
|
|
18502
|
+
children: /* @__PURE__ */ jsx180(X10, { className: "h-5 w-5" })
|
|
17992
18503
|
}
|
|
17993
18504
|
)
|
|
17994
18505
|
] });
|
|
@@ -18168,6 +18679,7 @@ export {
|
|
|
18168
18679
|
LegacyTextarea,
|
|
18169
18680
|
Link,
|
|
18170
18681
|
LoadingBar,
|
|
18682
|
+
MobileWebcam,
|
|
18171
18683
|
Modal,
|
|
18172
18684
|
ModalButton,
|
|
18173
18685
|
ModalLoader,
|
|
@@ -18298,11 +18810,14 @@ export {
|
|
|
18298
18810
|
buttonVariants,
|
|
18299
18811
|
calendarClassNames,
|
|
18300
18812
|
cn,
|
|
18813
|
+
compressFile,
|
|
18814
|
+
compressImage,
|
|
18301
18815
|
copyToClipboard,
|
|
18302
18816
|
createDisabledMatchers,
|
|
18303
18817
|
emptyMediaVariants,
|
|
18304
18818
|
formatDate,
|
|
18305
18819
|
getErrorMessage,
|
|
18820
|
+
getFileSizeMB,
|
|
18306
18821
|
getScrollableAreaState,
|
|
18307
18822
|
getSidebarState,
|
|
18308
18823
|
isDayBlocked,
|