@chekinapp/ui 0.0.1 → 0.0.3
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 +361 -88
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +48 -1
- package/dist/index.d.ts +48 -1
- package/dist/index.js +357 -86
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -157,6 +157,7 @@ __export(index_exports, {
|
|
|
157
157
|
OverlayLoader: () => OverlayLoader,
|
|
158
158
|
PageLoader: () => PageLoader,
|
|
159
159
|
Pagination: () => Pagination,
|
|
160
|
+
PhoneField: () => PhoneField,
|
|
160
161
|
Popover: () => Popover,
|
|
161
162
|
PopoverAnchor: () => PopoverAnchor,
|
|
162
163
|
PopoverClose: () => PopoverClose,
|
|
@@ -171,6 +172,7 @@ __export(index_exports, {
|
|
|
171
172
|
RatingRadioGroup: () => RatingRadioGroup,
|
|
172
173
|
RatingStars: () => RatingStars,
|
|
173
174
|
RegistryIcon: () => RegistryIcon,
|
|
175
|
+
ResponsiveSheet: () => ResponsiveSheet,
|
|
174
176
|
RotateIcon: () => RotateIcon,
|
|
175
177
|
ScrollArea: () => ScrollArea,
|
|
176
178
|
ScrollBar: () => ScrollBar,
|
|
@@ -4981,6 +4983,10 @@ var import_react25 = require("react");
|
|
|
4981
4983
|
function getChekinRuntimeSettings() {
|
|
4982
4984
|
return window.ChekinProSettings || window.ChekinHousingsSDKSettings || {};
|
|
4983
4985
|
}
|
|
4986
|
+
function isMobileModalModeAvailable() {
|
|
4987
|
+
const settings = getChekinRuntimeSettings();
|
|
4988
|
+
return !settings.autoHeight;
|
|
4989
|
+
}
|
|
4984
4990
|
|
|
4985
4991
|
// src/lib/use-scroll-frame-into-view.ts
|
|
4986
4992
|
function useScrollFrameIntoView(active, options = {}) {
|
|
@@ -9251,9 +9257,117 @@ function DatePicker({
|
|
|
9251
9257
|
] });
|
|
9252
9258
|
}
|
|
9253
9259
|
|
|
9260
|
+
// src/responsive-sheet/ResponsiveSheet.tsx
|
|
9261
|
+
var import_jsx_runtime124 = require("react/jsx-runtime");
|
|
9262
|
+
function ResponsiveSheet({
|
|
9263
|
+
open,
|
|
9264
|
+
onClose,
|
|
9265
|
+
title,
|
|
9266
|
+
description,
|
|
9267
|
+
children,
|
|
9268
|
+
className,
|
|
9269
|
+
contentClassName,
|
|
9270
|
+
dialogClassName,
|
|
9271
|
+
drawerClassName,
|
|
9272
|
+
titleClassName,
|
|
9273
|
+
descriptionClassName,
|
|
9274
|
+
showCloseButton = true,
|
|
9275
|
+
showDrawerHandle = true,
|
|
9276
|
+
closeOnOverlayClick = true,
|
|
9277
|
+
closeOnEscape = true
|
|
9278
|
+
}) {
|
|
9279
|
+
const { isMatch: isMobile } = useScreenResize(DEVICE.laptop);
|
|
9280
|
+
const isMobileMode = isMobile && isMobileModalModeAvailable();
|
|
9281
|
+
const handleOpenChange = (nextOpen) => {
|
|
9282
|
+
if (!nextOpen) {
|
|
9283
|
+
onClose();
|
|
9284
|
+
}
|
|
9285
|
+
};
|
|
9286
|
+
const handleInteractOutside = (event) => {
|
|
9287
|
+
if (!closeOnOverlayClick) {
|
|
9288
|
+
event.preventDefault();
|
|
9289
|
+
}
|
|
9290
|
+
};
|
|
9291
|
+
const handleEscapeKeyDown = (event) => {
|
|
9292
|
+
if (!closeOnEscape) {
|
|
9293
|
+
event.preventDefault();
|
|
9294
|
+
}
|
|
9295
|
+
};
|
|
9296
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(
|
|
9297
|
+
"div",
|
|
9298
|
+
{
|
|
9299
|
+
className: cn(
|
|
9300
|
+
"flex w-full flex-col px-6 pb-6 pt-4 sm:px-8 sm:pb-8 sm:pt-8",
|
|
9301
|
+
contentClassName
|
|
9302
|
+
),
|
|
9303
|
+
children: [
|
|
9304
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
9305
|
+
"div",
|
|
9306
|
+
{
|
|
9307
|
+
className: cn(
|
|
9308
|
+
"text-center text-[20px] font-semibold leading-7",
|
|
9309
|
+
titleClassName
|
|
9310
|
+
),
|
|
9311
|
+
children: title
|
|
9312
|
+
}
|
|
9313
|
+
) : null,
|
|
9314
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
9315
|
+
"p",
|
|
9316
|
+
{
|
|
9317
|
+
className: cn(
|
|
9318
|
+
"mt-3 text-center text-[14px] leading-6 text-[var(--primary)]/70",
|
|
9319
|
+
descriptionClassName
|
|
9320
|
+
),
|
|
9321
|
+
children: description
|
|
9322
|
+
}
|
|
9323
|
+
) : null,
|
|
9324
|
+
children
|
|
9325
|
+
]
|
|
9326
|
+
}
|
|
9327
|
+
);
|
|
9328
|
+
if (isMobileMode) {
|
|
9329
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(Drawer, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(
|
|
9330
|
+
DrawerContent,
|
|
9331
|
+
{
|
|
9332
|
+
onClose,
|
|
9333
|
+
showHandle: showDrawerHandle,
|
|
9334
|
+
closeOnOverlayClick,
|
|
9335
|
+
lockScroll: false,
|
|
9336
|
+
onEscapeKeyDown: handleEscapeKeyDown,
|
|
9337
|
+
className: cn(className, drawerClassName),
|
|
9338
|
+
children: [
|
|
9339
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(DrawerTitle, { className: "sr-only", children: title }) : null,
|
|
9340
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(DrawerDescription, { className: "sr-only", children: description }) : null,
|
|
9341
|
+
content
|
|
9342
|
+
]
|
|
9343
|
+
}
|
|
9344
|
+
) });
|
|
9345
|
+
}
|
|
9346
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(Dialog, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(
|
|
9347
|
+
DialogContent,
|
|
9348
|
+
{
|
|
9349
|
+
showCloseButton,
|
|
9350
|
+
onPointerDownOutside: handleInteractOutside,
|
|
9351
|
+
onInteractOutside: handleInteractOutside,
|
|
9352
|
+
onEscapeKeyDown: handleEscapeKeyDown,
|
|
9353
|
+
className: cn(
|
|
9354
|
+
"max-w-[560px] rounded-[28px] border-0 p-0 shadow-xl",
|
|
9355
|
+
className,
|
|
9356
|
+
dialogClassName
|
|
9357
|
+
),
|
|
9358
|
+
lockScroll: false,
|
|
9359
|
+
children: [
|
|
9360
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(DialogTitle, { className: "sr-only", children: title }) : null,
|
|
9361
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(DialogDescription, { className: "sr-only", children: description }) : null,
|
|
9362
|
+
content
|
|
9363
|
+
]
|
|
9364
|
+
}
|
|
9365
|
+
) });
|
|
9366
|
+
}
|
|
9367
|
+
|
|
9254
9368
|
// src/airbnb/input/Input.tsx
|
|
9255
9369
|
var React31 = __toESM(require("react"), 1);
|
|
9256
|
-
var
|
|
9370
|
+
var import_jsx_runtime125 = require("react/jsx-runtime");
|
|
9257
9371
|
var getInputValue = (value) => value != null ? String(value) : "";
|
|
9258
9372
|
var AirbnbInput = React31.forwardRef(
|
|
9259
9373
|
({
|
|
@@ -9328,7 +9442,7 @@ var AirbnbInput = React31.forwardRef(
|
|
|
9328
9442
|
setIsFocused(false);
|
|
9329
9443
|
onBlur?.(event);
|
|
9330
9444
|
};
|
|
9331
|
-
return /* @__PURE__ */ (0,
|
|
9445
|
+
return /* @__PURE__ */ (0, import_jsx_runtime125.jsx)("div", { className: cn("w-full", wrapperClassName), children: /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
9332
9446
|
FieldTrigger,
|
|
9333
9447
|
{
|
|
9334
9448
|
as: "div",
|
|
@@ -9356,7 +9470,7 @@ var AirbnbInput = React31.forwardRef(
|
|
|
9356
9470
|
trailingAdornment,
|
|
9357
9471
|
forceFloatingLabel: shouldShowLabel,
|
|
9358
9472
|
hideErrorMessage: !renderErrorMessage,
|
|
9359
|
-
children: /* @__PURE__ */ (0,
|
|
9473
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
9360
9474
|
"input",
|
|
9361
9475
|
{
|
|
9362
9476
|
...props,
|
|
@@ -9389,11 +9503,15 @@ var AirbnbInput = React31.forwardRef(
|
|
|
9389
9503
|
);
|
|
9390
9504
|
AirbnbInput.displayName = "Input";
|
|
9391
9505
|
|
|
9506
|
+
// src/airbnb/phone-field/PhoneField.tsx
|
|
9507
|
+
var React37 = __toESM(require("react"), 1);
|
|
9508
|
+
var import_lucide_react43 = require("lucide-react");
|
|
9509
|
+
|
|
9392
9510
|
// src/airbnb/select/Select.tsx
|
|
9393
9511
|
var React36 = __toESM(require("react"), 1);
|
|
9394
9512
|
|
|
9395
9513
|
// src/airbnb/select/SelectDesktopMenu.tsx
|
|
9396
|
-
var
|
|
9514
|
+
var import_jsx_runtime126 = require("react/jsx-runtime");
|
|
9397
9515
|
function SelectDesktopMenu({
|
|
9398
9516
|
id,
|
|
9399
9517
|
options,
|
|
@@ -9412,7 +9530,7 @@ function SelectDesktopMenu({
|
|
|
9412
9530
|
noOptionsMessage
|
|
9413
9531
|
}) {
|
|
9414
9532
|
const emptyMessage = noOptionsMessage?.();
|
|
9415
|
-
return /* @__PURE__ */ (0,
|
|
9533
|
+
return /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)(
|
|
9416
9534
|
"div",
|
|
9417
9535
|
{
|
|
9418
9536
|
id,
|
|
@@ -9425,12 +9543,12 @@ function SelectDesktopMenu({
|
|
|
9425
9543
|
onKeyDown,
|
|
9426
9544
|
className: cn("max-h-[280px] overflow-y-auto p-2 outline-none", menuClassName),
|
|
9427
9545
|
children: [
|
|
9428
|
-
options.length === 0 && emptyMessage ? /* @__PURE__ */ (0,
|
|
9546
|
+
options.length === 0 && emptyMessage ? /* @__PURE__ */ (0, import_jsx_runtime126.jsx)("div", { className: "px-4 py-3 text-base leading-6 text-[#6C6C6C]", children: emptyMessage }) : null,
|
|
9429
9547
|
options.map((option, index) => {
|
|
9430
9548
|
const isSelected = selectedValue?.value === option.value;
|
|
9431
9549
|
const isHighlighted = index === highlightedIndex;
|
|
9432
9550
|
const optionKey = `${String(option.value)}-${index}`;
|
|
9433
|
-
return /* @__PURE__ */ (0,
|
|
9551
|
+
return /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
9434
9552
|
"button",
|
|
9435
9553
|
{
|
|
9436
9554
|
id: getOptionId2(index),
|
|
@@ -9462,7 +9580,7 @@ function SelectDesktopMenu({
|
|
|
9462
9580
|
}
|
|
9463
9581
|
|
|
9464
9582
|
// src/airbnb/select/SelectDesktopContent.tsx
|
|
9465
|
-
var
|
|
9583
|
+
var import_jsx_runtime127 = require("react/jsx-runtime");
|
|
9466
9584
|
function SelectDesktopContent({
|
|
9467
9585
|
isOpen,
|
|
9468
9586
|
listboxId,
|
|
@@ -9483,14 +9601,14 @@ function SelectDesktopContent({
|
|
|
9483
9601
|
noOptionsMessage
|
|
9484
9602
|
}) {
|
|
9485
9603
|
if (!isOpen) return null;
|
|
9486
|
-
return /* @__PURE__ */ (0,
|
|
9604
|
+
return /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
9487
9605
|
"div",
|
|
9488
9606
|
{
|
|
9489
9607
|
className: cn(
|
|
9490
9608
|
"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)]",
|
|
9491
9609
|
dropdownClassName
|
|
9492
9610
|
),
|
|
9493
|
-
children: /* @__PURE__ */ (0,
|
|
9611
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
9494
9612
|
SelectDesktopMenu,
|
|
9495
9613
|
{
|
|
9496
9614
|
id: listboxId,
|
|
@@ -9588,7 +9706,7 @@ function getMobileOptionStyles(index, scrollTop) {
|
|
|
9588
9706
|
}
|
|
9589
9707
|
|
|
9590
9708
|
// src/airbnb/select/SelectMobileWheel.tsx
|
|
9591
|
-
var
|
|
9709
|
+
var import_jsx_runtime128 = require("react/jsx-runtime");
|
|
9592
9710
|
function SelectMobileWheel({
|
|
9593
9711
|
id,
|
|
9594
9712
|
options,
|
|
@@ -9607,7 +9725,7 @@ function SelectMobileWheel({
|
|
|
9607
9725
|
}) {
|
|
9608
9726
|
const spacerHeight2 = getWheelSpacerHeight();
|
|
9609
9727
|
const emptyMessage = noOptionsMessage?.();
|
|
9610
|
-
return /* @__PURE__ */ (0,
|
|
9728
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(
|
|
9611
9729
|
"div",
|
|
9612
9730
|
{
|
|
9613
9731
|
id,
|
|
@@ -9619,10 +9737,10 @@ function SelectMobileWheel({
|
|
|
9619
9737
|
onKeyDown,
|
|
9620
9738
|
className: cn("relative overflow-hidden outline-none", menuClassName),
|
|
9621
9739
|
children: [
|
|
9622
|
-
options.length === 0 && emptyMessage ? /* @__PURE__ */ (0,
|
|
9623
|
-
/* @__PURE__ */ (0,
|
|
9624
|
-
/* @__PURE__ */ (0,
|
|
9625
|
-
/* @__PURE__ */ (0,
|
|
9740
|
+
options.length === 0 && emptyMessage ? /* @__PURE__ */ (0, import_jsx_runtime128.jsx)("div", { className: "flex min-h-[160px] items-center justify-center px-4 text-center text-base leading-6 text-[#6C6C6C]", children: emptyMessage }) : null,
|
|
9741
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)("div", { className: "pointer-events-none absolute inset-x-0 top-0 h-16 bg-gradient-to-b from-white via-white/80 to-transparent" }),
|
|
9742
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)("div", { className: "pointer-events-none absolute inset-x-0 bottom-0 h-16 bg-gradient-to-t from-white via-white/80 to-transparent" }),
|
|
9743
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
9626
9744
|
"div",
|
|
9627
9745
|
{
|
|
9628
9746
|
"aria-hidden": true,
|
|
@@ -9632,7 +9750,7 @@ function SelectMobileWheel({
|
|
|
9632
9750
|
)
|
|
9633
9751
|
}
|
|
9634
9752
|
),
|
|
9635
|
-
/* @__PURE__ */ (0,
|
|
9753
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(
|
|
9636
9754
|
"div",
|
|
9637
9755
|
{
|
|
9638
9756
|
ref: listRef,
|
|
@@ -9647,11 +9765,11 @@ function SelectMobileWheel({
|
|
|
9647
9765
|
WebkitOverflowScrolling: "touch"
|
|
9648
9766
|
},
|
|
9649
9767
|
children: [
|
|
9650
|
-
/* @__PURE__ */ (0,
|
|
9768
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)("div", { style: { height: `${spacerHeight2}px` } }),
|
|
9651
9769
|
options.map((option, index) => {
|
|
9652
9770
|
const { distance, style } = getMobileOptionStyles(index, scrollTop);
|
|
9653
9771
|
const optionKey = `${String(option.value)}-${index}`;
|
|
9654
|
-
return /* @__PURE__ */ (0,
|
|
9772
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
9655
9773
|
"button",
|
|
9656
9774
|
{
|
|
9657
9775
|
id: getOptionId2(index),
|
|
@@ -9672,7 +9790,7 @@ function SelectMobileWheel({
|
|
|
9672
9790
|
optionKey
|
|
9673
9791
|
);
|
|
9674
9792
|
}),
|
|
9675
|
-
/* @__PURE__ */ (0,
|
|
9793
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)("div", { style: { height: `${spacerHeight2}px` } })
|
|
9676
9794
|
]
|
|
9677
9795
|
}
|
|
9678
9796
|
)
|
|
@@ -9682,7 +9800,7 @@ function SelectMobileWheel({
|
|
|
9682
9800
|
}
|
|
9683
9801
|
|
|
9684
9802
|
// src/airbnb/select/SelectMobileContent.tsx
|
|
9685
|
-
var
|
|
9803
|
+
var import_jsx_runtime129 = require("react/jsx-runtime");
|
|
9686
9804
|
function SelectMobileContent({
|
|
9687
9805
|
open,
|
|
9688
9806
|
onOpenChange,
|
|
@@ -9706,11 +9824,11 @@ function SelectMobileContent({
|
|
|
9706
9824
|
getOptionId: getOptionId2,
|
|
9707
9825
|
noOptionsMessage
|
|
9708
9826
|
}) {
|
|
9709
|
-
return /* @__PURE__ */ (0,
|
|
9710
|
-
/* @__PURE__ */ (0,
|
|
9711
|
-
/* @__PURE__ */ (0,
|
|
9712
|
-
/* @__PURE__ */ (0,
|
|
9713
|
-
/* @__PURE__ */ (0,
|
|
9827
|
+
return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(Drawer, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(DrawerContent, { onClose, lockScroll: false, children: [
|
|
9828
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(DrawerTitle, { className: "sr-only", children: mobileTitle ?? label }),
|
|
9829
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(DrawerDescription, { className: "sr-only", children: label }),
|
|
9830
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: "px-6 pb-4 pt-1", children: [
|
|
9831
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
|
|
9714
9832
|
SelectMobileWheel,
|
|
9715
9833
|
{
|
|
9716
9834
|
id: listboxId,
|
|
@@ -9729,7 +9847,7 @@ function SelectMobileContent({
|
|
|
9729
9847
|
noOptionsMessage
|
|
9730
9848
|
}
|
|
9731
9849
|
),
|
|
9732
|
-
/* @__PURE__ */ (0,
|
|
9850
|
+
/* @__PURE__ */ (0, import_jsx_runtime129.jsx)(Button, { type: "button", onClick: onDone, className: "mt-4 h-12 mb-8 w-full", children: doneLabel })
|
|
9733
9851
|
] })
|
|
9734
9852
|
] }) });
|
|
9735
9853
|
}
|
|
@@ -9737,7 +9855,7 @@ function SelectMobileContent({
|
|
|
9737
9855
|
// src/airbnb/select/SelectTrigger.tsx
|
|
9738
9856
|
var React32 = __toESM(require("react"), 1);
|
|
9739
9857
|
var import_lucide_react42 = require("lucide-react");
|
|
9740
|
-
var
|
|
9858
|
+
var import_jsx_runtime130 = require("react/jsx-runtime");
|
|
9741
9859
|
var SelectTrigger2 = React32.forwardRef(
|
|
9742
9860
|
({
|
|
9743
9861
|
id,
|
|
@@ -9759,7 +9877,7 @@ var SelectTrigger2 = React32.forwardRef(
|
|
|
9759
9877
|
onClick,
|
|
9760
9878
|
onKeyDown
|
|
9761
9879
|
}, ref) => {
|
|
9762
|
-
return /* @__PURE__ */ (0,
|
|
9880
|
+
return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
9763
9881
|
FieldTrigger,
|
|
9764
9882
|
{
|
|
9765
9883
|
id,
|
|
@@ -9783,7 +9901,7 @@ var SelectTrigger2 = React32.forwardRef(
|
|
|
9783
9901
|
disabled,
|
|
9784
9902
|
onClick,
|
|
9785
9903
|
onKeyDown,
|
|
9786
|
-
trailingAdornment: /* @__PURE__ */ (0,
|
|
9904
|
+
trailingAdornment: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
9787
9905
|
import_lucide_react42.ChevronDown,
|
|
9788
9906
|
{
|
|
9789
9907
|
className: open ? "h-6 w-6 rotate-180 text-[#1F1F1B] transition-transform" : "h-6 w-6 text-[#1F1F1B] transition-transform"
|
|
@@ -10197,7 +10315,7 @@ function useOutsideClick(elementRef, onOutsideClick, nested) {
|
|
|
10197
10315
|
}
|
|
10198
10316
|
|
|
10199
10317
|
// src/airbnb/select/Select.tsx
|
|
10200
|
-
var
|
|
10318
|
+
var import_jsx_runtime131 = require("react/jsx-runtime");
|
|
10201
10319
|
function AirbnbSelect({
|
|
10202
10320
|
options,
|
|
10203
10321
|
value,
|
|
@@ -10355,8 +10473,8 @@ function AirbnbSelect({
|
|
|
10355
10473
|
handleMobileOpenChange(false);
|
|
10356
10474
|
}
|
|
10357
10475
|
};
|
|
10358
|
-
return /* @__PURE__ */ (0,
|
|
10359
|
-
name && /* @__PURE__ */ (0,
|
|
10476
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("div", { ref: containerRef, className: cn("relative w-full max-w-[480px]", className), children: [
|
|
10477
|
+
name && /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("input", { type: "hidden", name, value: value ? String(value.value) : "" }),
|
|
10360
10478
|
renderTrigger ? renderTrigger({
|
|
10361
10479
|
id: triggerId,
|
|
10362
10480
|
open: isOpen,
|
|
@@ -10373,7 +10491,7 @@ function AirbnbSelect({
|
|
|
10373
10491
|
triggerRef,
|
|
10374
10492
|
onClick: handleTriggerClick,
|
|
10375
10493
|
onKeyDown: handleRootTriggerKeyDown
|
|
10376
|
-
}) : /* @__PURE__ */ (0,
|
|
10494
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
10377
10495
|
SelectTrigger2,
|
|
10378
10496
|
{
|
|
10379
10497
|
id: triggerId,
|
|
@@ -10397,7 +10515,7 @@ function AirbnbSelect({
|
|
|
10397
10515
|
onKeyDown: handleRootTriggerKeyDown
|
|
10398
10516
|
}
|
|
10399
10517
|
),
|
|
10400
|
-
isMobile ? /* @__PURE__ */ (0,
|
|
10518
|
+
isMobile ? /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
10401
10519
|
SelectMobileContent,
|
|
10402
10520
|
{
|
|
10403
10521
|
open: isOpen,
|
|
@@ -10422,7 +10540,7 @@ function AirbnbSelect({
|
|
|
10422
10540
|
getOptionId: getOptionId2,
|
|
10423
10541
|
noOptionsMessage
|
|
10424
10542
|
}
|
|
10425
|
-
) : /* @__PURE__ */ (0,
|
|
10543
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
10426
10544
|
SelectDesktopContent,
|
|
10427
10545
|
{
|
|
10428
10546
|
isOpen,
|
|
@@ -10453,17 +10571,170 @@ function AirbnbSelect({
|
|
|
10453
10571
|
] });
|
|
10454
10572
|
}
|
|
10455
10573
|
|
|
10574
|
+
// src/airbnb/phone-field/PhoneField.tsx
|
|
10575
|
+
var import_jsx_runtime132 = require("react/jsx-runtime");
|
|
10576
|
+
function PhoneField({
|
|
10577
|
+
variant = "default",
|
|
10578
|
+
label,
|
|
10579
|
+
topLabel,
|
|
10580
|
+
value,
|
|
10581
|
+
onChange,
|
|
10582
|
+
options,
|
|
10583
|
+
placeholder = "Phone number",
|
|
10584
|
+
disabled,
|
|
10585
|
+
error,
|
|
10586
|
+
className,
|
|
10587
|
+
name,
|
|
10588
|
+
codeName,
|
|
10589
|
+
numberName,
|
|
10590
|
+
mobileTitle,
|
|
10591
|
+
codePlaceholder = "+00"
|
|
10592
|
+
}) {
|
|
10593
|
+
const inputId = React37.useId();
|
|
10594
|
+
const codeOptions = React37.useMemo(
|
|
10595
|
+
() => options.map((option) => ({
|
|
10596
|
+
value: option.value,
|
|
10597
|
+
label: option.label,
|
|
10598
|
+
disabled: option.disabled
|
|
10599
|
+
})),
|
|
10600
|
+
[options]
|
|
10601
|
+
);
|
|
10602
|
+
const selectedCodeOption = React37.useMemo(
|
|
10603
|
+
() => codeOptions.find((option) => option.value === value?.code) ?? null,
|
|
10604
|
+
[codeOptions, value?.code]
|
|
10605
|
+
);
|
|
10606
|
+
const combinedValue = value?.code || value?.number ? `${value?.code ?? ""}${value?.number ?? ""}` : "";
|
|
10607
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: cn("w-full max-w-[480px]", className), children: [
|
|
10608
|
+
name && /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("input", { type: "hidden", name, value: combinedValue, disabled }),
|
|
10609
|
+
codeName && /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
10610
|
+
"input",
|
|
10611
|
+
{
|
|
10612
|
+
type: "hidden",
|
|
10613
|
+
name: codeName,
|
|
10614
|
+
value: value?.code ?? "",
|
|
10615
|
+
disabled
|
|
10616
|
+
}
|
|
10617
|
+
),
|
|
10618
|
+
numberName && /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
10619
|
+
"input",
|
|
10620
|
+
{
|
|
10621
|
+
type: "hidden",
|
|
10622
|
+
name: numberName,
|
|
10623
|
+
value: value?.number ?? "",
|
|
10624
|
+
disabled
|
|
10625
|
+
}
|
|
10626
|
+
),
|
|
10627
|
+
topLabel && /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
10628
|
+
"label",
|
|
10629
|
+
{
|
|
10630
|
+
htmlFor: inputId,
|
|
10631
|
+
className: "mb-3 block text-[16px] font-medium leading-5 text-[#1F1F1B]",
|
|
10632
|
+
children: topLabel
|
|
10633
|
+
}
|
|
10634
|
+
),
|
|
10635
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: "flex items-stretch", children: [
|
|
10636
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
10637
|
+
AirbnbSelect,
|
|
10638
|
+
{
|
|
10639
|
+
variant,
|
|
10640
|
+
options: codeOptions,
|
|
10641
|
+
value: selectedCodeOption,
|
|
10642
|
+
onChange: (option) => onChange({
|
|
10643
|
+
code: String(option.value),
|
|
10644
|
+
number: value?.number ?? ""
|
|
10645
|
+
}),
|
|
10646
|
+
label: `${label} country code`,
|
|
10647
|
+
placeholder: codePlaceholder,
|
|
10648
|
+
disabled,
|
|
10649
|
+
className: "max-w-none shrink-0 basis-[96px]",
|
|
10650
|
+
mobileTitle: mobileTitle ?? "Select country code",
|
|
10651
|
+
dropdownClassName: "right-auto w-[280px]",
|
|
10652
|
+
getValueLabel: (option) => String(option.value),
|
|
10653
|
+
renderTrigger: ({
|
|
10654
|
+
id,
|
|
10655
|
+
open,
|
|
10656
|
+
variant: selectVariant,
|
|
10657
|
+
disabled: triggerDisabled,
|
|
10658
|
+
listboxId,
|
|
10659
|
+
triggerRef,
|
|
10660
|
+
onClick,
|
|
10661
|
+
onKeyDown,
|
|
10662
|
+
valueLabel
|
|
10663
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)(
|
|
10664
|
+
"button",
|
|
10665
|
+
{
|
|
10666
|
+
id,
|
|
10667
|
+
ref: triggerRef,
|
|
10668
|
+
type: "button",
|
|
10669
|
+
"aria-label": `${label} country code`,
|
|
10670
|
+
"aria-haspopup": "listbox",
|
|
10671
|
+
"aria-expanded": open,
|
|
10672
|
+
"aria-controls": listboxId,
|
|
10673
|
+
disabled: triggerDisabled,
|
|
10674
|
+
onClick,
|
|
10675
|
+
onKeyDown,
|
|
10676
|
+
className: cn(
|
|
10677
|
+
"flex w-full items-center justify-center gap-2 border border-r-0 text-[16px] font-medium leading-6 transition-colors focus-visible:outline-none",
|
|
10678
|
+
selectVariant === "airbnb" ? "h-full min-h-[60px] rounded-l-[16px] rounded-r-none px-4 focus-visible:ring-2 focus-visible:ring-[#1F1F1B] focus-visible:ring-offset-2" : "min-h-[48px] rounded-l-[10px] rounded-r-none px-3.5 focus-visible:border-[#315EFB]",
|
|
10679
|
+
error ? "border-[var(--status-danger)] bg-[#F2F2F2] text-[var(--status-danger)]" : selectVariant === "airbnb" ? "border-[#8C8C8C] bg-[#F4F4F2] text-[#1F1F1B]" : "border-[#A8A8A4] bg-white text-[#1F1F1B]",
|
|
10680
|
+
triggerDisabled ? "cursor-not-allowed opacity-50" : "cursor-pointer"
|
|
10681
|
+
),
|
|
10682
|
+
children: [
|
|
10683
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("span", { children: valueLabel ?? codePlaceholder }),
|
|
10684
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
10685
|
+
import_lucide_react43.ChevronDown,
|
|
10686
|
+
{
|
|
10687
|
+
className: cn("h-5 w-5 transition-transform", open ? "rotate-180" : ""),
|
|
10688
|
+
strokeWidth: 2
|
|
10689
|
+
}
|
|
10690
|
+
)
|
|
10691
|
+
]
|
|
10692
|
+
}
|
|
10693
|
+
)
|
|
10694
|
+
}
|
|
10695
|
+
),
|
|
10696
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
10697
|
+
AirbnbInput,
|
|
10698
|
+
{
|
|
10699
|
+
id: inputId,
|
|
10700
|
+
variant,
|
|
10701
|
+
type: "tel",
|
|
10702
|
+
inputMode: "tel",
|
|
10703
|
+
label,
|
|
10704
|
+
helperText: placeholder,
|
|
10705
|
+
value: value?.number ?? "",
|
|
10706
|
+
placeholder,
|
|
10707
|
+
disabled,
|
|
10708
|
+
error,
|
|
10709
|
+
renderErrorMessage: false,
|
|
10710
|
+
wrapperClassName: "min-w-0 flex-1",
|
|
10711
|
+
fieldClassName: cn(
|
|
10712
|
+
variant === "airbnb" ? "min-h-[60px] rounded-l-none rounded-r-[16px] border-l-0" : "rounded-l-none rounded-r-[10px] border-l-0"
|
|
10713
|
+
),
|
|
10714
|
+
contentClassName: cn(variant === "airbnb" ? "h-[40px] py-2" : "h-[48px]"),
|
|
10715
|
+
inputClassName: "text-[16px] leading-7",
|
|
10716
|
+
onChange: (event) => onChange({
|
|
10717
|
+
code: value?.code ?? "",
|
|
10718
|
+
number: event.target.value
|
|
10719
|
+
})
|
|
10720
|
+
}
|
|
10721
|
+
)
|
|
10722
|
+
] }),
|
|
10723
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(FieldErrorMessage, { message: error })
|
|
10724
|
+
] });
|
|
10725
|
+
}
|
|
10726
|
+
|
|
10456
10727
|
// src/airbnb/search-input/SearchInput.tsx
|
|
10457
|
-
var
|
|
10728
|
+
var React38 = __toESM(require("react"), 1);
|
|
10458
10729
|
var import_react_i18next22 = require("react-i18next");
|
|
10459
|
-
var
|
|
10460
|
-
var
|
|
10461
|
-
var AirbnbSearchInput =
|
|
10730
|
+
var import_lucide_react44 = require("lucide-react");
|
|
10731
|
+
var import_jsx_runtime133 = require("react/jsx-runtime");
|
|
10732
|
+
var AirbnbSearchInput = React38.forwardRef(({ onReset, placeholder, wrapperClassName, ...props }, ref) => {
|
|
10462
10733
|
const { t } = (0, import_react_i18next22.useTranslation)();
|
|
10463
10734
|
const placeholderText = placeholder || t("search_property") + "...";
|
|
10464
|
-
return /* @__PURE__ */ (0,
|
|
10465
|
-
/* @__PURE__ */ (0,
|
|
10466
|
-
/* @__PURE__ */ (0,
|
|
10735
|
+
return /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("div", { className: cn("input-wrapper relative", wrapperClassName), children: [
|
|
10736
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_lucide_react44.Search, { className: "absolute left-4 top-1/2 h-5 w-5 -translate-y-1/2 transform text-[#9696B9]" }),
|
|
10737
|
+
/* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
10467
10738
|
"input",
|
|
10468
10739
|
{
|
|
10469
10740
|
...props,
|
|
@@ -10482,13 +10753,13 @@ var AirbnbSearchInput = React37.forwardRef(({ onReset, placeholder, wrapperClass
|
|
|
10482
10753
|
)
|
|
10483
10754
|
}
|
|
10484
10755
|
),
|
|
10485
|
-
onReset && /* @__PURE__ */ (0,
|
|
10756
|
+
onReset && /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
10486
10757
|
Button,
|
|
10487
10758
|
{
|
|
10488
10759
|
variant: "ghost",
|
|
10489
10760
|
onClick: onReset,
|
|
10490
10761
|
className: "absolute right-0 top-1/2 h-5 w-5 -translate-y-1/2 transform text-[#9696B9]",
|
|
10491
|
-
children: /* @__PURE__ */ (0,
|
|
10762
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_lucide_react44.X, { className: "h-5 w-5" })
|
|
10492
10763
|
}
|
|
10493
10764
|
)
|
|
10494
10765
|
] });
|
|
@@ -10496,10 +10767,10 @@ var AirbnbSearchInput = React37.forwardRef(({ onReset, placeholder, wrapperClass
|
|
|
10496
10767
|
AirbnbSearchInput.displayName = "SearchInput";
|
|
10497
10768
|
|
|
10498
10769
|
// src/searchable-select/SearchableSelect.tsx
|
|
10499
|
-
var
|
|
10500
|
-
var
|
|
10770
|
+
var React39 = __toESM(require("react"), 1);
|
|
10771
|
+
var import_lucide_react45 = require("lucide-react");
|
|
10501
10772
|
var import_react_virtual = require("@tanstack/react-virtual");
|
|
10502
|
-
var
|
|
10773
|
+
var import_jsx_runtime134 = require("react/jsx-runtime");
|
|
10503
10774
|
var ROW_HEIGHT = 48;
|
|
10504
10775
|
var DESKTOP_LIST_HEIGHT = 280;
|
|
10505
10776
|
var MOBILE_LIST_HEIGHT = 420;
|
|
@@ -10536,13 +10807,13 @@ var SearchableSelectInternal = ({
|
|
|
10536
10807
|
loadingMessage
|
|
10537
10808
|
}, ref) => {
|
|
10538
10809
|
const { isMatch: isMobile } = useScreenResize(DEVICE.mobileXL);
|
|
10539
|
-
const reactId =
|
|
10540
|
-
const [open, setOpen] =
|
|
10541
|
-
const [internalSearchValue, setInternalSearchValue] =
|
|
10542
|
-
const [highlightedIndex, setHighlightedIndex] =
|
|
10543
|
-
const containerRef =
|
|
10544
|
-
const triggerRef =
|
|
10545
|
-
const inputRef =
|
|
10810
|
+
const reactId = React39.useId();
|
|
10811
|
+
const [open, setOpen] = React39.useState(false);
|
|
10812
|
+
const [internalSearchValue, setInternalSearchValue] = React39.useState("");
|
|
10813
|
+
const [highlightedIndex, setHighlightedIndex] = React39.useState(-1);
|
|
10814
|
+
const containerRef = React39.useRef(null);
|
|
10815
|
+
const triggerRef = React39.useRef(null);
|
|
10816
|
+
const inputRef = React39.useRef(null);
|
|
10546
10817
|
const listboxId = `${reactId}-listbox`;
|
|
10547
10818
|
const labelId = `${reactId}-label`;
|
|
10548
10819
|
const valueId = `${reactId}-value`;
|
|
@@ -10551,13 +10822,13 @@ var SearchableSelectInternal = ({
|
|
|
10551
10822
|
const searchInputId = `${reactId}-search`;
|
|
10552
10823
|
const effectiveSearchValue = searchValue ?? internalSearchValue;
|
|
10553
10824
|
const shouldFilterLocally = !onSearchChange && filterOption !== null;
|
|
10554
|
-
const visibleOptions =
|
|
10825
|
+
const visibleOptions = React39.useMemo(() => {
|
|
10555
10826
|
if (!shouldFilterLocally || !effectiveSearchValue) {
|
|
10556
10827
|
return options;
|
|
10557
10828
|
}
|
|
10558
10829
|
return options.filter((option) => filterOption(option, effectiveSearchValue));
|
|
10559
10830
|
}, [effectiveSearchValue, filterOption, options, shouldFilterLocally]);
|
|
10560
|
-
const selectedIndex =
|
|
10831
|
+
const selectedIndex = React39.useMemo(
|
|
10561
10832
|
() => visibleOptions.findIndex((option) => option.value === value?.value),
|
|
10562
10833
|
[value?.value, visibleOptions]
|
|
10563
10834
|
);
|
|
@@ -10566,7 +10837,7 @@ var SearchableSelectInternal = ({
|
|
|
10566
10837
|
const describedBy = error && !hideErrorMessage ? errorId : void 0;
|
|
10567
10838
|
const activeOptionId = highlightedIndex >= 0 ? getOptionId(reactId, highlightedIndex) : void 0;
|
|
10568
10839
|
useOutsideClick(containerRef, open && !isMobile ? () => closeSelect() : null);
|
|
10569
|
-
|
|
10840
|
+
React39.useEffect(() => {
|
|
10570
10841
|
if (!open) return;
|
|
10571
10842
|
const frameId = window.requestAnimationFrame(() => {
|
|
10572
10843
|
inputRef.current?.focus();
|
|
@@ -10575,7 +10846,7 @@ var SearchableSelectInternal = ({
|
|
|
10575
10846
|
window.cancelAnimationFrame(frameId);
|
|
10576
10847
|
};
|
|
10577
10848
|
}, [open]);
|
|
10578
|
-
|
|
10849
|
+
React39.useEffect(() => {
|
|
10579
10850
|
if (!open) {
|
|
10580
10851
|
setHighlightedIndex(-1);
|
|
10581
10852
|
return;
|
|
@@ -10650,7 +10921,7 @@ var SearchableSelectInternal = ({
|
|
|
10650
10921
|
}
|
|
10651
10922
|
}
|
|
10652
10923
|
}
|
|
10653
|
-
const content = /* @__PURE__ */ (0,
|
|
10924
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
10654
10925
|
SearchableSelectContent,
|
|
10655
10926
|
{
|
|
10656
10927
|
inputId: searchInputId,
|
|
@@ -10677,10 +10948,10 @@ var SearchableSelectInternal = ({
|
|
|
10677
10948
|
onOptionHover: setHighlightedIndex
|
|
10678
10949
|
}
|
|
10679
10950
|
);
|
|
10680
|
-
|
|
10681
|
-
return /* @__PURE__ */ (0,
|
|
10682
|
-
name && /* @__PURE__ */ (0,
|
|
10683
|
-
/* @__PURE__ */ (0,
|
|
10951
|
+
React39.useImperativeHandle(ref, () => triggerRef.current, []);
|
|
10952
|
+
return /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { ref: containerRef, className: cn("relative w-full max-w-[480px]", className), children: [
|
|
10953
|
+
name && /* @__PURE__ */ (0, import_jsx_runtime134.jsx)("input", { type: "hidden", name, value: value ? String(value.value) : "" }),
|
|
10954
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
10684
10955
|
FieldTrigger,
|
|
10685
10956
|
{
|
|
10686
10957
|
id: `${reactId}-trigger`,
|
|
@@ -10710,8 +10981,8 @@ var SearchableSelectInternal = ({
|
|
|
10710
10981
|
openSelect();
|
|
10711
10982
|
},
|
|
10712
10983
|
onKeyDown: handleTriggerKeyDown,
|
|
10713
|
-
trailingAdornment: /* @__PURE__ */ (0,
|
|
10714
|
-
|
|
10984
|
+
trailingAdornment: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
10985
|
+
import_lucide_react45.ChevronDown,
|
|
10715
10986
|
{
|
|
10716
10987
|
className: cn(
|
|
10717
10988
|
"h-6 w-6 text-[#1F1F1B] transition-transform",
|
|
@@ -10721,7 +10992,7 @@ var SearchableSelectInternal = ({
|
|
|
10721
10992
|
)
|
|
10722
10993
|
}
|
|
10723
10994
|
),
|
|
10724
|
-
isMobile ? /* @__PURE__ */ (0,
|
|
10995
|
+
isMobile ? /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
10725
10996
|
Drawer,
|
|
10726
10997
|
{
|
|
10727
10998
|
open,
|
|
@@ -10732,13 +11003,13 @@ var SearchableSelectInternal = ({
|
|
|
10732
11003
|
}
|
|
10733
11004
|
closeSelect();
|
|
10734
11005
|
},
|
|
10735
|
-
children: /* @__PURE__ */ (0,
|
|
10736
|
-
/* @__PURE__ */ (0,
|
|
10737
|
-
/* @__PURE__ */ (0,
|
|
10738
|
-
/* @__PURE__ */ (0,
|
|
11006
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(DrawerContent, { onClose: closeSelect, lockScroll: false, children: [
|
|
11007
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(DrawerTitle, { className: "sr-only", children: mobileTitle ?? label }),
|
|
11008
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(DrawerDescription, { className: "sr-only", children: label }),
|
|
11009
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)("div", { className: "px-5 pb-5 pt-1", children: content })
|
|
10739
11010
|
] })
|
|
10740
11011
|
}
|
|
10741
|
-
) : open ? /* @__PURE__ */ (0,
|
|
11012
|
+
) : open ? /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
10742
11013
|
"div",
|
|
10743
11014
|
{
|
|
10744
11015
|
className: cn(
|
|
@@ -10750,7 +11021,7 @@ var SearchableSelectInternal = ({
|
|
|
10750
11021
|
) : null
|
|
10751
11022
|
] });
|
|
10752
11023
|
};
|
|
10753
|
-
var SearchableSelect =
|
|
11024
|
+
var SearchableSelect = React39.forwardRef(
|
|
10754
11025
|
SearchableSelectInternal
|
|
10755
11026
|
);
|
|
10756
11027
|
function SearchableSelectContent({
|
|
@@ -10777,9 +11048,9 @@ function SearchableSelectContent({
|
|
|
10777
11048
|
onOptionClick,
|
|
10778
11049
|
onOptionHover
|
|
10779
11050
|
}) {
|
|
10780
|
-
const listRef =
|
|
10781
|
-
const lastLoadMoreOptionsLengthRef =
|
|
10782
|
-
const previousHighlightedIndexRef =
|
|
11051
|
+
const listRef = React39.useRef(null);
|
|
11052
|
+
const lastLoadMoreOptionsLengthRef = React39.useRef(null);
|
|
11053
|
+
const previousHighlightedIndexRef = React39.useRef(highlightedIndex);
|
|
10783
11054
|
const rowCount = options.length + (loading && options.length > 0 ? 1 : 0);
|
|
10784
11055
|
const virtualizer = (0, import_react_virtual.useVirtualizer)({
|
|
10785
11056
|
count: rowCount,
|
|
@@ -10790,7 +11061,7 @@ function SearchableSelectContent({
|
|
|
10790
11061
|
const virtualItems = virtualizer.getVirtualItems();
|
|
10791
11062
|
const emptyMessage = noOptionsMessage?.() ?? "No matches found";
|
|
10792
11063
|
const loadingText = loadingMessage?.() ?? "Loading...";
|
|
10793
|
-
|
|
11064
|
+
React39.useEffect(() => {
|
|
10794
11065
|
const lastItem = virtualItems[virtualItems.length - 1];
|
|
10795
11066
|
const shouldLoadMore = !!lastItem && hasNextPage && !loading && lastItem.index >= options.length - LOAD_MORE_THRESHOLD;
|
|
10796
11067
|
if (shouldLoadMore && lastLoadMoreOptionsLengthRef.current !== options.length) {
|
|
@@ -10798,23 +11069,23 @@ function SearchableSelectContent({
|
|
|
10798
11069
|
onLoadMore?.();
|
|
10799
11070
|
}
|
|
10800
11071
|
}, [hasNextPage, loading, onLoadMore, options.length, virtualItems]);
|
|
10801
|
-
|
|
11072
|
+
React39.useEffect(() => {
|
|
10802
11073
|
const hasHighlightedIndexChanged = previousHighlightedIndexRef.current !== highlightedIndex;
|
|
10803
11074
|
previousHighlightedIndexRef.current = highlightedIndex;
|
|
10804
11075
|
if (highlightedIndex >= 0 && hasHighlightedIndexChanged) {
|
|
10805
11076
|
virtualizer.scrollToIndex(highlightedIndex, { align: "auto" });
|
|
10806
11077
|
}
|
|
10807
11078
|
}, [highlightedIndex, virtualizer]);
|
|
10808
|
-
return /* @__PURE__ */ (0,
|
|
10809
|
-
/* @__PURE__ */ (0,
|
|
10810
|
-
/* @__PURE__ */ (0,
|
|
10811
|
-
|
|
11079
|
+
return /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "p-2", children: [
|
|
11080
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "relative mb-2", children: [
|
|
11081
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
11082
|
+
import_lucide_react45.Search,
|
|
10812
11083
|
{
|
|
10813
11084
|
"aria-hidden": "true",
|
|
10814
11085
|
className: "absolute left-4 top-1/2 h-5 w-5 -translate-y-1/2 text-[#9696B9]"
|
|
10815
11086
|
}
|
|
10816
11087
|
),
|
|
10817
|
-
/* @__PURE__ */ (0,
|
|
11088
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
10818
11089
|
"input",
|
|
10819
11090
|
{
|
|
10820
11091
|
id: inputId,
|
|
@@ -10833,7 +11104,7 @@ function SearchableSelectContent({
|
|
|
10833
11104
|
}
|
|
10834
11105
|
)
|
|
10835
11106
|
] }),
|
|
10836
|
-
loading && options.length === 0 ? /* @__PURE__ */ (0,
|
|
11107
|
+
loading && options.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime134.jsx)("div", { className: "px-4 py-5 text-center text-base leading-6 text-[#6C6C6C]", children: loadingText }) : options.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime134.jsx)("div", { className: "px-4 py-5 text-center text-base leading-6 text-[#6C6C6C]", children: emptyMessage }) : /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
10837
11108
|
"div",
|
|
10838
11109
|
{
|
|
10839
11110
|
id: listboxId,
|
|
@@ -10842,7 +11113,7 @@ function SearchableSelectContent({
|
|
|
10842
11113
|
"aria-labelledby": labelId,
|
|
10843
11114
|
className: cn("overflow-y-auto outline-none", menuClassName),
|
|
10844
11115
|
style: { height: Math.min(height, rowCount * ROW_HEIGHT) },
|
|
10845
|
-
children: /* @__PURE__ */ (0,
|
|
11116
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
10846
11117
|
"div",
|
|
10847
11118
|
{
|
|
10848
11119
|
className: "relative w-full",
|
|
@@ -10850,7 +11121,7 @@ function SearchableSelectContent({
|
|
|
10850
11121
|
children: virtualItems.map((virtualItem) => {
|
|
10851
11122
|
const option = options[virtualItem.index];
|
|
10852
11123
|
if (!option) {
|
|
10853
|
-
return /* @__PURE__ */ (0,
|
|
11124
|
+
return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
10854
11125
|
"div",
|
|
10855
11126
|
{
|
|
10856
11127
|
className: "absolute left-0 top-0 flex w-full items-center px-4 text-base leading-6 text-[#6C6C6C]",
|
|
@@ -10865,7 +11136,7 @@ function SearchableSelectContent({
|
|
|
10865
11136
|
}
|
|
10866
11137
|
const isSelected = value?.value === option.value;
|
|
10867
11138
|
const isHighlighted = virtualItem.index === highlightedIndex;
|
|
10868
|
-
return /* @__PURE__ */ (0,
|
|
11139
|
+
return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
10869
11140
|
"button",
|
|
10870
11141
|
{
|
|
10871
11142
|
id: getOptionId(idPrefix, virtualItem.index),
|
|
@@ -10887,7 +11158,7 @@ function SearchableSelectContent({
|
|
|
10887
11158
|
height: `${virtualItem.size}px`,
|
|
10888
11159
|
transform: `translateY(${virtualItem.start}px)`
|
|
10889
11160
|
},
|
|
10890
|
-
children: /* @__PURE__ */ (0,
|
|
11161
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)("span", { className: "truncate text-center", children: String(option.label) })
|
|
10891
11162
|
},
|
|
10892
11163
|
`${String(option.value)}-${virtualItem.index}`
|
|
10893
11164
|
);
|
|
@@ -11043,6 +11314,7 @@ function getNextEnabledIndex(options, startIndex, step) {
|
|
|
11043
11314
|
OverlayLoader,
|
|
11044
11315
|
PageLoader,
|
|
11045
11316
|
Pagination,
|
|
11317
|
+
PhoneField,
|
|
11046
11318
|
Popover,
|
|
11047
11319
|
PopoverAnchor,
|
|
11048
11320
|
PopoverClose,
|
|
@@ -11057,6 +11329,7 @@ function getNextEnabledIndex(options, startIndex, step) {
|
|
|
11057
11329
|
RatingRadioGroup,
|
|
11058
11330
|
RatingStars,
|
|
11059
11331
|
RegistryIcon,
|
|
11332
|
+
ResponsiveSheet,
|
|
11060
11333
|
RotateIcon,
|
|
11061
11334
|
ScrollArea,
|
|
11062
11335
|
ScrollBar,
|