@chekinapp/ui 0.0.2 → 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 +190 -76
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +20 -1
- package/dist/index.d.ts +20 -1
- package/dist/index.js +189 -76
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -172,6 +172,7 @@ __export(index_exports, {
|
|
|
172
172
|
RatingRadioGroup: () => RatingRadioGroup,
|
|
173
173
|
RatingStars: () => RatingStars,
|
|
174
174
|
RegistryIcon: () => RegistryIcon,
|
|
175
|
+
ResponsiveSheet: () => ResponsiveSheet,
|
|
175
176
|
RotateIcon: () => RotateIcon,
|
|
176
177
|
ScrollArea: () => ScrollArea,
|
|
177
178
|
ScrollBar: () => ScrollBar,
|
|
@@ -4982,6 +4983,10 @@ var import_react25 = require("react");
|
|
|
4982
4983
|
function getChekinRuntimeSettings() {
|
|
4983
4984
|
return window.ChekinProSettings || window.ChekinHousingsSDKSettings || {};
|
|
4984
4985
|
}
|
|
4986
|
+
function isMobileModalModeAvailable() {
|
|
4987
|
+
const settings = getChekinRuntimeSettings();
|
|
4988
|
+
return !settings.autoHeight;
|
|
4989
|
+
}
|
|
4985
4990
|
|
|
4986
4991
|
// src/lib/use-scroll-frame-into-view.ts
|
|
4987
4992
|
function useScrollFrameIntoView(active, options = {}) {
|
|
@@ -9252,9 +9257,117 @@ function DatePicker({
|
|
|
9252
9257
|
] });
|
|
9253
9258
|
}
|
|
9254
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
|
+
|
|
9255
9368
|
// src/airbnb/input/Input.tsx
|
|
9256
9369
|
var React31 = __toESM(require("react"), 1);
|
|
9257
|
-
var
|
|
9370
|
+
var import_jsx_runtime125 = require("react/jsx-runtime");
|
|
9258
9371
|
var getInputValue = (value) => value != null ? String(value) : "";
|
|
9259
9372
|
var AirbnbInput = React31.forwardRef(
|
|
9260
9373
|
({
|
|
@@ -9329,7 +9442,7 @@ var AirbnbInput = React31.forwardRef(
|
|
|
9329
9442
|
setIsFocused(false);
|
|
9330
9443
|
onBlur?.(event);
|
|
9331
9444
|
};
|
|
9332
|
-
return /* @__PURE__ */ (0,
|
|
9445
|
+
return /* @__PURE__ */ (0, import_jsx_runtime125.jsx)("div", { className: cn("w-full", wrapperClassName), children: /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
9333
9446
|
FieldTrigger,
|
|
9334
9447
|
{
|
|
9335
9448
|
as: "div",
|
|
@@ -9357,7 +9470,7 @@ var AirbnbInput = React31.forwardRef(
|
|
|
9357
9470
|
trailingAdornment,
|
|
9358
9471
|
forceFloatingLabel: shouldShowLabel,
|
|
9359
9472
|
hideErrorMessage: !renderErrorMessage,
|
|
9360
|
-
children: /* @__PURE__ */ (0,
|
|
9473
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
9361
9474
|
"input",
|
|
9362
9475
|
{
|
|
9363
9476
|
...props,
|
|
@@ -9398,7 +9511,7 @@ var import_lucide_react43 = require("lucide-react");
|
|
|
9398
9511
|
var React36 = __toESM(require("react"), 1);
|
|
9399
9512
|
|
|
9400
9513
|
// src/airbnb/select/SelectDesktopMenu.tsx
|
|
9401
|
-
var
|
|
9514
|
+
var import_jsx_runtime126 = require("react/jsx-runtime");
|
|
9402
9515
|
function SelectDesktopMenu({
|
|
9403
9516
|
id,
|
|
9404
9517
|
options,
|
|
@@ -9417,7 +9530,7 @@ function SelectDesktopMenu({
|
|
|
9417
9530
|
noOptionsMessage
|
|
9418
9531
|
}) {
|
|
9419
9532
|
const emptyMessage = noOptionsMessage?.();
|
|
9420
|
-
return /* @__PURE__ */ (0,
|
|
9533
|
+
return /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)(
|
|
9421
9534
|
"div",
|
|
9422
9535
|
{
|
|
9423
9536
|
id,
|
|
@@ -9430,12 +9543,12 @@ function SelectDesktopMenu({
|
|
|
9430
9543
|
onKeyDown,
|
|
9431
9544
|
className: cn("max-h-[280px] overflow-y-auto p-2 outline-none", menuClassName),
|
|
9432
9545
|
children: [
|
|
9433
|
-
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,
|
|
9434
9547
|
options.map((option, index) => {
|
|
9435
9548
|
const isSelected = selectedValue?.value === option.value;
|
|
9436
9549
|
const isHighlighted = index === highlightedIndex;
|
|
9437
9550
|
const optionKey = `${String(option.value)}-${index}`;
|
|
9438
|
-
return /* @__PURE__ */ (0,
|
|
9551
|
+
return /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
9439
9552
|
"button",
|
|
9440
9553
|
{
|
|
9441
9554
|
id: getOptionId2(index),
|
|
@@ -9467,7 +9580,7 @@ function SelectDesktopMenu({
|
|
|
9467
9580
|
}
|
|
9468
9581
|
|
|
9469
9582
|
// src/airbnb/select/SelectDesktopContent.tsx
|
|
9470
|
-
var
|
|
9583
|
+
var import_jsx_runtime127 = require("react/jsx-runtime");
|
|
9471
9584
|
function SelectDesktopContent({
|
|
9472
9585
|
isOpen,
|
|
9473
9586
|
listboxId,
|
|
@@ -9488,14 +9601,14 @@ function SelectDesktopContent({
|
|
|
9488
9601
|
noOptionsMessage
|
|
9489
9602
|
}) {
|
|
9490
9603
|
if (!isOpen) return null;
|
|
9491
|
-
return /* @__PURE__ */ (0,
|
|
9604
|
+
return /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
9492
9605
|
"div",
|
|
9493
9606
|
{
|
|
9494
9607
|
className: cn(
|
|
9495
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)]",
|
|
9496
9609
|
dropdownClassName
|
|
9497
9610
|
),
|
|
9498
|
-
children: /* @__PURE__ */ (0,
|
|
9611
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
|
|
9499
9612
|
SelectDesktopMenu,
|
|
9500
9613
|
{
|
|
9501
9614
|
id: listboxId,
|
|
@@ -9593,7 +9706,7 @@ function getMobileOptionStyles(index, scrollTop) {
|
|
|
9593
9706
|
}
|
|
9594
9707
|
|
|
9595
9708
|
// src/airbnb/select/SelectMobileWheel.tsx
|
|
9596
|
-
var
|
|
9709
|
+
var import_jsx_runtime128 = require("react/jsx-runtime");
|
|
9597
9710
|
function SelectMobileWheel({
|
|
9598
9711
|
id,
|
|
9599
9712
|
options,
|
|
@@ -9612,7 +9725,7 @@ function SelectMobileWheel({
|
|
|
9612
9725
|
}) {
|
|
9613
9726
|
const spacerHeight2 = getWheelSpacerHeight();
|
|
9614
9727
|
const emptyMessage = noOptionsMessage?.();
|
|
9615
|
-
return /* @__PURE__ */ (0,
|
|
9728
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(
|
|
9616
9729
|
"div",
|
|
9617
9730
|
{
|
|
9618
9731
|
id,
|
|
@@ -9624,10 +9737,10 @@ function SelectMobileWheel({
|
|
|
9624
9737
|
onKeyDown,
|
|
9625
9738
|
className: cn("relative overflow-hidden outline-none", menuClassName),
|
|
9626
9739
|
children: [
|
|
9627
|
-
options.length === 0 && emptyMessage ? /* @__PURE__ */ (0,
|
|
9628
|
-
/* @__PURE__ */ (0,
|
|
9629
|
-
/* @__PURE__ */ (0,
|
|
9630
|
-
/* @__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)(
|
|
9631
9744
|
"div",
|
|
9632
9745
|
{
|
|
9633
9746
|
"aria-hidden": true,
|
|
@@ -9637,7 +9750,7 @@ function SelectMobileWheel({
|
|
|
9637
9750
|
)
|
|
9638
9751
|
}
|
|
9639
9752
|
),
|
|
9640
|
-
/* @__PURE__ */ (0,
|
|
9753
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(
|
|
9641
9754
|
"div",
|
|
9642
9755
|
{
|
|
9643
9756
|
ref: listRef,
|
|
@@ -9652,11 +9765,11 @@ function SelectMobileWheel({
|
|
|
9652
9765
|
WebkitOverflowScrolling: "touch"
|
|
9653
9766
|
},
|
|
9654
9767
|
children: [
|
|
9655
|
-
/* @__PURE__ */ (0,
|
|
9768
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)("div", { style: { height: `${spacerHeight2}px` } }),
|
|
9656
9769
|
options.map((option, index) => {
|
|
9657
9770
|
const { distance, style } = getMobileOptionStyles(index, scrollTop);
|
|
9658
9771
|
const optionKey = `${String(option.value)}-${index}`;
|
|
9659
|
-
return /* @__PURE__ */ (0,
|
|
9772
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
9660
9773
|
"button",
|
|
9661
9774
|
{
|
|
9662
9775
|
id: getOptionId2(index),
|
|
@@ -9677,7 +9790,7 @@ function SelectMobileWheel({
|
|
|
9677
9790
|
optionKey
|
|
9678
9791
|
);
|
|
9679
9792
|
}),
|
|
9680
|
-
/* @__PURE__ */ (0,
|
|
9793
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)("div", { style: { height: `${spacerHeight2}px` } })
|
|
9681
9794
|
]
|
|
9682
9795
|
}
|
|
9683
9796
|
)
|
|
@@ -9687,7 +9800,7 @@ function SelectMobileWheel({
|
|
|
9687
9800
|
}
|
|
9688
9801
|
|
|
9689
9802
|
// src/airbnb/select/SelectMobileContent.tsx
|
|
9690
|
-
var
|
|
9803
|
+
var import_jsx_runtime129 = require("react/jsx-runtime");
|
|
9691
9804
|
function SelectMobileContent({
|
|
9692
9805
|
open,
|
|
9693
9806
|
onOpenChange,
|
|
@@ -9711,11 +9824,11 @@ function SelectMobileContent({
|
|
|
9711
9824
|
getOptionId: getOptionId2,
|
|
9712
9825
|
noOptionsMessage
|
|
9713
9826
|
}) {
|
|
9714
|
-
return /* @__PURE__ */ (0,
|
|
9715
|
-
/* @__PURE__ */ (0,
|
|
9716
|
-
/* @__PURE__ */ (0,
|
|
9717
|
-
/* @__PURE__ */ (0,
|
|
9718
|
-
/* @__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)(
|
|
9719
9832
|
SelectMobileWheel,
|
|
9720
9833
|
{
|
|
9721
9834
|
id: listboxId,
|
|
@@ -9734,7 +9847,7 @@ function SelectMobileContent({
|
|
|
9734
9847
|
noOptionsMessage
|
|
9735
9848
|
}
|
|
9736
9849
|
),
|
|
9737
|
-
/* @__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 })
|
|
9738
9851
|
] })
|
|
9739
9852
|
] }) });
|
|
9740
9853
|
}
|
|
@@ -9742,7 +9855,7 @@ function SelectMobileContent({
|
|
|
9742
9855
|
// src/airbnb/select/SelectTrigger.tsx
|
|
9743
9856
|
var React32 = __toESM(require("react"), 1);
|
|
9744
9857
|
var import_lucide_react42 = require("lucide-react");
|
|
9745
|
-
var
|
|
9858
|
+
var import_jsx_runtime130 = require("react/jsx-runtime");
|
|
9746
9859
|
var SelectTrigger2 = React32.forwardRef(
|
|
9747
9860
|
({
|
|
9748
9861
|
id,
|
|
@@ -9764,7 +9877,7 @@ var SelectTrigger2 = React32.forwardRef(
|
|
|
9764
9877
|
onClick,
|
|
9765
9878
|
onKeyDown
|
|
9766
9879
|
}, ref) => {
|
|
9767
|
-
return /* @__PURE__ */ (0,
|
|
9880
|
+
return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
9768
9881
|
FieldTrigger,
|
|
9769
9882
|
{
|
|
9770
9883
|
id,
|
|
@@ -9788,7 +9901,7 @@ var SelectTrigger2 = React32.forwardRef(
|
|
|
9788
9901
|
disabled,
|
|
9789
9902
|
onClick,
|
|
9790
9903
|
onKeyDown,
|
|
9791
|
-
trailingAdornment: /* @__PURE__ */ (0,
|
|
9904
|
+
trailingAdornment: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
9792
9905
|
import_lucide_react42.ChevronDown,
|
|
9793
9906
|
{
|
|
9794
9907
|
className: open ? "h-6 w-6 rotate-180 text-[#1F1F1B] transition-transform" : "h-6 w-6 text-[#1F1F1B] transition-transform"
|
|
@@ -10202,7 +10315,7 @@ function useOutsideClick(elementRef, onOutsideClick, nested) {
|
|
|
10202
10315
|
}
|
|
10203
10316
|
|
|
10204
10317
|
// src/airbnb/select/Select.tsx
|
|
10205
|
-
var
|
|
10318
|
+
var import_jsx_runtime131 = require("react/jsx-runtime");
|
|
10206
10319
|
function AirbnbSelect({
|
|
10207
10320
|
options,
|
|
10208
10321
|
value,
|
|
@@ -10360,8 +10473,8 @@ function AirbnbSelect({
|
|
|
10360
10473
|
handleMobileOpenChange(false);
|
|
10361
10474
|
}
|
|
10362
10475
|
};
|
|
10363
|
-
return /* @__PURE__ */ (0,
|
|
10364
|
-
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) : "" }),
|
|
10365
10478
|
renderTrigger ? renderTrigger({
|
|
10366
10479
|
id: triggerId,
|
|
10367
10480
|
open: isOpen,
|
|
@@ -10378,7 +10491,7 @@ function AirbnbSelect({
|
|
|
10378
10491
|
triggerRef,
|
|
10379
10492
|
onClick: handleTriggerClick,
|
|
10380
10493
|
onKeyDown: handleRootTriggerKeyDown
|
|
10381
|
-
}) : /* @__PURE__ */ (0,
|
|
10494
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
10382
10495
|
SelectTrigger2,
|
|
10383
10496
|
{
|
|
10384
10497
|
id: triggerId,
|
|
@@ -10402,7 +10515,7 @@ function AirbnbSelect({
|
|
|
10402
10515
|
onKeyDown: handleRootTriggerKeyDown
|
|
10403
10516
|
}
|
|
10404
10517
|
),
|
|
10405
|
-
isMobile ? /* @__PURE__ */ (0,
|
|
10518
|
+
isMobile ? /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
10406
10519
|
SelectMobileContent,
|
|
10407
10520
|
{
|
|
10408
10521
|
open: isOpen,
|
|
@@ -10427,7 +10540,7 @@ function AirbnbSelect({
|
|
|
10427
10540
|
getOptionId: getOptionId2,
|
|
10428
10541
|
noOptionsMessage
|
|
10429
10542
|
}
|
|
10430
|
-
) : /* @__PURE__ */ (0,
|
|
10543
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
|
|
10431
10544
|
SelectDesktopContent,
|
|
10432
10545
|
{
|
|
10433
10546
|
isOpen,
|
|
@@ -10459,7 +10572,7 @@ function AirbnbSelect({
|
|
|
10459
10572
|
}
|
|
10460
10573
|
|
|
10461
10574
|
// src/airbnb/phone-field/PhoneField.tsx
|
|
10462
|
-
var
|
|
10575
|
+
var import_jsx_runtime132 = require("react/jsx-runtime");
|
|
10463
10576
|
function PhoneField({
|
|
10464
10577
|
variant = "default",
|
|
10465
10578
|
label,
|
|
@@ -10491,9 +10604,9 @@ function PhoneField({
|
|
|
10491
10604
|
[codeOptions, value?.code]
|
|
10492
10605
|
);
|
|
10493
10606
|
const combinedValue = value?.code || value?.number ? `${value?.code ?? ""}${value?.number ?? ""}` : "";
|
|
10494
|
-
return /* @__PURE__ */ (0,
|
|
10495
|
-
name && /* @__PURE__ */ (0,
|
|
10496
|
-
codeName && /* @__PURE__ */ (0,
|
|
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)(
|
|
10497
10610
|
"input",
|
|
10498
10611
|
{
|
|
10499
10612
|
type: "hidden",
|
|
@@ -10502,7 +10615,7 @@ function PhoneField({
|
|
|
10502
10615
|
disabled
|
|
10503
10616
|
}
|
|
10504
10617
|
),
|
|
10505
|
-
numberName && /* @__PURE__ */ (0,
|
|
10618
|
+
numberName && /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
10506
10619
|
"input",
|
|
10507
10620
|
{
|
|
10508
10621
|
type: "hidden",
|
|
@@ -10511,7 +10624,7 @@ function PhoneField({
|
|
|
10511
10624
|
disabled
|
|
10512
10625
|
}
|
|
10513
10626
|
),
|
|
10514
|
-
topLabel && /* @__PURE__ */ (0,
|
|
10627
|
+
topLabel && /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
10515
10628
|
"label",
|
|
10516
10629
|
{
|
|
10517
10630
|
htmlFor: inputId,
|
|
@@ -10519,8 +10632,8 @@ function PhoneField({
|
|
|
10519
10632
|
children: topLabel
|
|
10520
10633
|
}
|
|
10521
10634
|
),
|
|
10522
|
-
/* @__PURE__ */ (0,
|
|
10523
|
-
/* @__PURE__ */ (0,
|
|
10635
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: "flex items-stretch", children: [
|
|
10636
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
10524
10637
|
AirbnbSelect,
|
|
10525
10638
|
{
|
|
10526
10639
|
variant,
|
|
@@ -10547,7 +10660,7 @@ function PhoneField({
|
|
|
10547
10660
|
onClick,
|
|
10548
10661
|
onKeyDown,
|
|
10549
10662
|
valueLabel
|
|
10550
|
-
}) => /* @__PURE__ */ (0,
|
|
10663
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)(
|
|
10551
10664
|
"button",
|
|
10552
10665
|
{
|
|
10553
10666
|
id,
|
|
@@ -10567,8 +10680,8 @@ function PhoneField({
|
|
|
10567
10680
|
triggerDisabled ? "cursor-not-allowed opacity-50" : "cursor-pointer"
|
|
10568
10681
|
),
|
|
10569
10682
|
children: [
|
|
10570
|
-
/* @__PURE__ */ (0,
|
|
10571
|
-
/* @__PURE__ */ (0,
|
|
10683
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)("span", { children: valueLabel ?? codePlaceholder }),
|
|
10684
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
10572
10685
|
import_lucide_react43.ChevronDown,
|
|
10573
10686
|
{
|
|
10574
10687
|
className: cn("h-5 w-5 transition-transform", open ? "rotate-180" : ""),
|
|
@@ -10580,7 +10693,7 @@ function PhoneField({
|
|
|
10580
10693
|
)
|
|
10581
10694
|
}
|
|
10582
10695
|
),
|
|
10583
|
-
/* @__PURE__ */ (0,
|
|
10696
|
+
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
|
|
10584
10697
|
AirbnbInput,
|
|
10585
10698
|
{
|
|
10586
10699
|
id: inputId,
|
|
@@ -10607,7 +10720,7 @@ function PhoneField({
|
|
|
10607
10720
|
}
|
|
10608
10721
|
)
|
|
10609
10722
|
] }),
|
|
10610
|
-
error && /* @__PURE__ */ (0,
|
|
10723
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(FieldErrorMessage, { message: error })
|
|
10611
10724
|
] });
|
|
10612
10725
|
}
|
|
10613
10726
|
|
|
@@ -10615,13 +10728,13 @@ function PhoneField({
|
|
|
10615
10728
|
var React38 = __toESM(require("react"), 1);
|
|
10616
10729
|
var import_react_i18next22 = require("react-i18next");
|
|
10617
10730
|
var import_lucide_react44 = require("lucide-react");
|
|
10618
|
-
var
|
|
10731
|
+
var import_jsx_runtime133 = require("react/jsx-runtime");
|
|
10619
10732
|
var AirbnbSearchInput = React38.forwardRef(({ onReset, placeholder, wrapperClassName, ...props }, ref) => {
|
|
10620
10733
|
const { t } = (0, import_react_i18next22.useTranslation)();
|
|
10621
10734
|
const placeholderText = placeholder || t("search_property") + "...";
|
|
10622
|
-
return /* @__PURE__ */ (0,
|
|
10623
|
-
/* @__PURE__ */ (0,
|
|
10624
|
-
/* @__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)(
|
|
10625
10738
|
"input",
|
|
10626
10739
|
{
|
|
10627
10740
|
...props,
|
|
@@ -10640,13 +10753,13 @@ var AirbnbSearchInput = React38.forwardRef(({ onReset, placeholder, wrapperClass
|
|
|
10640
10753
|
)
|
|
10641
10754
|
}
|
|
10642
10755
|
),
|
|
10643
|
-
onReset && /* @__PURE__ */ (0,
|
|
10756
|
+
onReset && /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
10644
10757
|
Button,
|
|
10645
10758
|
{
|
|
10646
10759
|
variant: "ghost",
|
|
10647
10760
|
onClick: onReset,
|
|
10648
10761
|
className: "absolute right-0 top-1/2 h-5 w-5 -translate-y-1/2 transform text-[#9696B9]",
|
|
10649
|
-
children: /* @__PURE__ */ (0,
|
|
10762
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_lucide_react44.X, { className: "h-5 w-5" })
|
|
10650
10763
|
}
|
|
10651
10764
|
)
|
|
10652
10765
|
] });
|
|
@@ -10657,7 +10770,7 @@ AirbnbSearchInput.displayName = "SearchInput";
|
|
|
10657
10770
|
var React39 = __toESM(require("react"), 1);
|
|
10658
10771
|
var import_lucide_react45 = require("lucide-react");
|
|
10659
10772
|
var import_react_virtual = require("@tanstack/react-virtual");
|
|
10660
|
-
var
|
|
10773
|
+
var import_jsx_runtime134 = require("react/jsx-runtime");
|
|
10661
10774
|
var ROW_HEIGHT = 48;
|
|
10662
10775
|
var DESKTOP_LIST_HEIGHT = 280;
|
|
10663
10776
|
var MOBILE_LIST_HEIGHT = 420;
|
|
@@ -10808,7 +10921,7 @@ var SearchableSelectInternal = ({
|
|
|
10808
10921
|
}
|
|
10809
10922
|
}
|
|
10810
10923
|
}
|
|
10811
|
-
const content = /* @__PURE__ */ (0,
|
|
10924
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
10812
10925
|
SearchableSelectContent,
|
|
10813
10926
|
{
|
|
10814
10927
|
inputId: searchInputId,
|
|
@@ -10836,9 +10949,9 @@ var SearchableSelectInternal = ({
|
|
|
10836
10949
|
}
|
|
10837
10950
|
);
|
|
10838
10951
|
React39.useImperativeHandle(ref, () => triggerRef.current, []);
|
|
10839
|
-
return /* @__PURE__ */ (0,
|
|
10840
|
-
name && /* @__PURE__ */ (0,
|
|
10841
|
-
/* @__PURE__ */ (0,
|
|
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)(
|
|
10842
10955
|
FieldTrigger,
|
|
10843
10956
|
{
|
|
10844
10957
|
id: `${reactId}-trigger`,
|
|
@@ -10868,7 +10981,7 @@ var SearchableSelectInternal = ({
|
|
|
10868
10981
|
openSelect();
|
|
10869
10982
|
},
|
|
10870
10983
|
onKeyDown: handleTriggerKeyDown,
|
|
10871
|
-
trailingAdornment: /* @__PURE__ */ (0,
|
|
10984
|
+
trailingAdornment: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
10872
10985
|
import_lucide_react45.ChevronDown,
|
|
10873
10986
|
{
|
|
10874
10987
|
className: cn(
|
|
@@ -10879,7 +10992,7 @@ var SearchableSelectInternal = ({
|
|
|
10879
10992
|
)
|
|
10880
10993
|
}
|
|
10881
10994
|
),
|
|
10882
|
-
isMobile ? /* @__PURE__ */ (0,
|
|
10995
|
+
isMobile ? /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
10883
10996
|
Drawer,
|
|
10884
10997
|
{
|
|
10885
10998
|
open,
|
|
@@ -10890,13 +11003,13 @@ var SearchableSelectInternal = ({
|
|
|
10890
11003
|
}
|
|
10891
11004
|
closeSelect();
|
|
10892
11005
|
},
|
|
10893
|
-
children: /* @__PURE__ */ (0,
|
|
10894
|
-
/* @__PURE__ */ (0,
|
|
10895
|
-
/* @__PURE__ */ (0,
|
|
10896
|
-
/* @__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 })
|
|
10897
11010
|
] })
|
|
10898
11011
|
}
|
|
10899
|
-
) : open ? /* @__PURE__ */ (0,
|
|
11012
|
+
) : open ? /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
10900
11013
|
"div",
|
|
10901
11014
|
{
|
|
10902
11015
|
className: cn(
|
|
@@ -10963,16 +11076,16 @@ function SearchableSelectContent({
|
|
|
10963
11076
|
virtualizer.scrollToIndex(highlightedIndex, { align: "auto" });
|
|
10964
11077
|
}
|
|
10965
11078
|
}, [highlightedIndex, virtualizer]);
|
|
10966
|
-
return /* @__PURE__ */ (0,
|
|
10967
|
-
/* @__PURE__ */ (0,
|
|
10968
|
-
/* @__PURE__ */ (0,
|
|
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)(
|
|
10969
11082
|
import_lucide_react45.Search,
|
|
10970
11083
|
{
|
|
10971
11084
|
"aria-hidden": "true",
|
|
10972
11085
|
className: "absolute left-4 top-1/2 h-5 w-5 -translate-y-1/2 text-[#9696B9]"
|
|
10973
11086
|
}
|
|
10974
11087
|
),
|
|
10975
|
-
/* @__PURE__ */ (0,
|
|
11088
|
+
/* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
10976
11089
|
"input",
|
|
10977
11090
|
{
|
|
10978
11091
|
id: inputId,
|
|
@@ -10991,7 +11104,7 @@ function SearchableSelectContent({
|
|
|
10991
11104
|
}
|
|
10992
11105
|
)
|
|
10993
11106
|
] }),
|
|
10994
|
-
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)(
|
|
10995
11108
|
"div",
|
|
10996
11109
|
{
|
|
10997
11110
|
id: listboxId,
|
|
@@ -11000,7 +11113,7 @@ function SearchableSelectContent({
|
|
|
11000
11113
|
"aria-labelledby": labelId,
|
|
11001
11114
|
className: cn("overflow-y-auto outline-none", menuClassName),
|
|
11002
11115
|
style: { height: Math.min(height, rowCount * ROW_HEIGHT) },
|
|
11003
|
-
children: /* @__PURE__ */ (0,
|
|
11116
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
11004
11117
|
"div",
|
|
11005
11118
|
{
|
|
11006
11119
|
className: "relative w-full",
|
|
@@ -11008,7 +11121,7 @@ function SearchableSelectContent({
|
|
|
11008
11121
|
children: virtualItems.map((virtualItem) => {
|
|
11009
11122
|
const option = options[virtualItem.index];
|
|
11010
11123
|
if (!option) {
|
|
11011
|
-
return /* @__PURE__ */ (0,
|
|
11124
|
+
return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
11012
11125
|
"div",
|
|
11013
11126
|
{
|
|
11014
11127
|
className: "absolute left-0 top-0 flex w-full items-center px-4 text-base leading-6 text-[#6C6C6C]",
|
|
@@ -11023,7 +11136,7 @@ function SearchableSelectContent({
|
|
|
11023
11136
|
}
|
|
11024
11137
|
const isSelected = value?.value === option.value;
|
|
11025
11138
|
const isHighlighted = virtualItem.index === highlightedIndex;
|
|
11026
|
-
return /* @__PURE__ */ (0,
|
|
11139
|
+
return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
11027
11140
|
"button",
|
|
11028
11141
|
{
|
|
11029
11142
|
id: getOptionId(idPrefix, virtualItem.index),
|
|
@@ -11045,7 +11158,7 @@ function SearchableSelectContent({
|
|
|
11045
11158
|
height: `${virtualItem.size}px`,
|
|
11046
11159
|
transform: `translateY(${virtualItem.start}px)`
|
|
11047
11160
|
},
|
|
11048
|
-
children: /* @__PURE__ */ (0,
|
|
11161
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)("span", { className: "truncate text-center", children: String(option.label) })
|
|
11049
11162
|
},
|
|
11050
11163
|
`${String(option.value)}-${virtualItem.index}`
|
|
11051
11164
|
);
|
|
@@ -11216,6 +11329,7 @@ function getNextEnabledIndex(options, startIndex, step) {
|
|
|
11216
11329
|
RatingRadioGroup,
|
|
11217
11330
|
RatingStars,
|
|
11218
11331
|
RegistryIcon,
|
|
11332
|
+
ResponsiveSheet,
|
|
11219
11333
|
RotateIcon,
|
|
11220
11334
|
ScrollArea,
|
|
11221
11335
|
ScrollBar,
|