@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.js CHANGED
@@ -4713,6 +4713,10 @@ import { useEffect as useEffect8 } from "react";
4713
4713
  function getChekinRuntimeSettings() {
4714
4714
  return window.ChekinProSettings || window.ChekinHousingsSDKSettings || {};
4715
4715
  }
4716
+ function isMobileModalModeAvailable() {
4717
+ const settings = getChekinRuntimeSettings();
4718
+ return !settings.autoHeight;
4719
+ }
4716
4720
 
4717
4721
  // src/lib/use-scroll-frame-into-view.ts
4718
4722
  function useScrollFrameIntoView(active, options = {}) {
@@ -8988,9 +8992,117 @@ function DatePicker({
8988
8992
  ] });
8989
8993
  }
8990
8994
 
8995
+ // src/responsive-sheet/ResponsiveSheet.tsx
8996
+ import { jsx as jsx122, jsxs as jsxs79 } from "react/jsx-runtime";
8997
+ function ResponsiveSheet({
8998
+ open,
8999
+ onClose,
9000
+ title,
9001
+ description,
9002
+ children,
9003
+ className,
9004
+ contentClassName,
9005
+ dialogClassName,
9006
+ drawerClassName,
9007
+ titleClassName,
9008
+ descriptionClassName,
9009
+ showCloseButton = true,
9010
+ showDrawerHandle = true,
9011
+ closeOnOverlayClick = true,
9012
+ closeOnEscape = true
9013
+ }) {
9014
+ const { isMatch: isMobile } = useScreenResize(DEVICE.laptop);
9015
+ const isMobileMode = isMobile && isMobileModalModeAvailable();
9016
+ const handleOpenChange = (nextOpen) => {
9017
+ if (!nextOpen) {
9018
+ onClose();
9019
+ }
9020
+ };
9021
+ const handleInteractOutside = (event) => {
9022
+ if (!closeOnOverlayClick) {
9023
+ event.preventDefault();
9024
+ }
9025
+ };
9026
+ const handleEscapeKeyDown = (event) => {
9027
+ if (!closeOnEscape) {
9028
+ event.preventDefault();
9029
+ }
9030
+ };
9031
+ const content = /* @__PURE__ */ jsxs79(
9032
+ "div",
9033
+ {
9034
+ className: cn(
9035
+ "flex w-full flex-col px-6 pb-6 pt-4 sm:px-8 sm:pb-8 sm:pt-8",
9036
+ contentClassName
9037
+ ),
9038
+ children: [
9039
+ title ? /* @__PURE__ */ jsx122(
9040
+ "div",
9041
+ {
9042
+ className: cn(
9043
+ "text-center text-[20px] font-semibold leading-7",
9044
+ titleClassName
9045
+ ),
9046
+ children: title
9047
+ }
9048
+ ) : null,
9049
+ description ? /* @__PURE__ */ jsx122(
9050
+ "p",
9051
+ {
9052
+ className: cn(
9053
+ "mt-3 text-center text-[14px] leading-6 text-[var(--primary)]/70",
9054
+ descriptionClassName
9055
+ ),
9056
+ children: description
9057
+ }
9058
+ ) : null,
9059
+ children
9060
+ ]
9061
+ }
9062
+ );
9063
+ if (isMobileMode) {
9064
+ return /* @__PURE__ */ jsx122(Drawer, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxs79(
9065
+ DrawerContent,
9066
+ {
9067
+ onClose,
9068
+ showHandle: showDrawerHandle,
9069
+ closeOnOverlayClick,
9070
+ lockScroll: false,
9071
+ onEscapeKeyDown: handleEscapeKeyDown,
9072
+ className: cn(className, drawerClassName),
9073
+ children: [
9074
+ title ? /* @__PURE__ */ jsx122(DrawerTitle, { className: "sr-only", children: title }) : null,
9075
+ description ? /* @__PURE__ */ jsx122(DrawerDescription, { className: "sr-only", children: description }) : null,
9076
+ content
9077
+ ]
9078
+ }
9079
+ ) });
9080
+ }
9081
+ return /* @__PURE__ */ jsx122(Dialog, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxs79(
9082
+ DialogContent,
9083
+ {
9084
+ showCloseButton,
9085
+ onPointerDownOutside: handleInteractOutside,
9086
+ onInteractOutside: handleInteractOutside,
9087
+ onEscapeKeyDown: handleEscapeKeyDown,
9088
+ className: cn(
9089
+ "max-w-[560px] rounded-[28px] border-0 p-0 shadow-xl",
9090
+ className,
9091
+ dialogClassName
9092
+ ),
9093
+ lockScroll: false,
9094
+ children: [
9095
+ title ? /* @__PURE__ */ jsx122(DialogTitle, { className: "sr-only", children: title }) : null,
9096
+ description ? /* @__PURE__ */ jsx122(DialogDescription, { className: "sr-only", children: description }) : null,
9097
+ content
9098
+ ]
9099
+ }
9100
+ ) });
9101
+ }
9102
+
8991
9103
  // src/airbnb/input/Input.tsx
8992
9104
  import * as React31 from "react";
8993
- import { jsx as jsx122 } from "react/jsx-runtime";
9105
+ import { jsx as jsx123 } from "react/jsx-runtime";
8994
9106
  var getInputValue = (value) => value != null ? String(value) : "";
8995
9107
  var AirbnbInput = React31.forwardRef(
8996
9108
  ({
@@ -9065,7 +9177,7 @@ var AirbnbInput = React31.forwardRef(
9065
9177
  setIsFocused(false);
9066
9178
  onBlur?.(event);
9067
9179
  };
9068
- return /* @__PURE__ */ jsx122("div", { className: cn("w-full", wrapperClassName), children: /* @__PURE__ */ jsx122(
9180
+ return /* @__PURE__ */ jsx123("div", { className: cn("w-full", wrapperClassName), children: /* @__PURE__ */ jsx123(
9069
9181
  FieldTrigger,
9070
9182
  {
9071
9183
  as: "div",
@@ -9093,7 +9205,7 @@ var AirbnbInput = React31.forwardRef(
9093
9205
  trailingAdornment,
9094
9206
  forceFloatingLabel: shouldShowLabel,
9095
9207
  hideErrorMessage: !renderErrorMessage,
9096
- children: /* @__PURE__ */ jsx122(
9208
+ children: /* @__PURE__ */ jsx123(
9097
9209
  "input",
9098
9210
  {
9099
9211
  ...props,
@@ -9126,11 +9238,15 @@ var AirbnbInput = React31.forwardRef(
9126
9238
  );
9127
9239
  AirbnbInput.displayName = "Input";
9128
9240
 
9241
+ // src/airbnb/phone-field/PhoneField.tsx
9242
+ import * as React37 from "react";
9243
+ import { ChevronDown as ChevronDown2 } from "lucide-react";
9244
+
9129
9245
  // src/airbnb/select/Select.tsx
9130
9246
  import * as React36 from "react";
9131
9247
 
9132
9248
  // src/airbnb/select/SelectDesktopMenu.tsx
9133
- import { jsx as jsx123, jsxs as jsxs79 } from "react/jsx-runtime";
9249
+ import { jsx as jsx124, jsxs as jsxs80 } from "react/jsx-runtime";
9134
9250
  function SelectDesktopMenu({
9135
9251
  id,
9136
9252
  options,
@@ -9149,7 +9265,7 @@ function SelectDesktopMenu({
9149
9265
  noOptionsMessage
9150
9266
  }) {
9151
9267
  const emptyMessage = noOptionsMessage?.();
9152
- return /* @__PURE__ */ jsxs79(
9268
+ return /* @__PURE__ */ jsxs80(
9153
9269
  "div",
9154
9270
  {
9155
9271
  id,
@@ -9162,12 +9278,12 @@ function SelectDesktopMenu({
9162
9278
  onKeyDown,
9163
9279
  className: cn("max-h-[280px] overflow-y-auto p-2 outline-none", menuClassName),
9164
9280
  children: [
9165
- options.length === 0 && emptyMessage ? /* @__PURE__ */ jsx123("div", { className: "px-4 py-3 text-base leading-6 text-[#6C6C6C]", children: emptyMessage }) : null,
9281
+ options.length === 0 && emptyMessage ? /* @__PURE__ */ jsx124("div", { className: "px-4 py-3 text-base leading-6 text-[#6C6C6C]", children: emptyMessage }) : null,
9166
9282
  options.map((option, index) => {
9167
9283
  const isSelected = selectedValue?.value === option.value;
9168
9284
  const isHighlighted = index === highlightedIndex;
9169
9285
  const optionKey = `${String(option.value)}-${index}`;
9170
- return /* @__PURE__ */ jsx123(
9286
+ return /* @__PURE__ */ jsx124(
9171
9287
  "button",
9172
9288
  {
9173
9289
  id: getOptionId2(index),
@@ -9199,7 +9315,7 @@ function SelectDesktopMenu({
9199
9315
  }
9200
9316
 
9201
9317
  // src/airbnb/select/SelectDesktopContent.tsx
9202
- import { jsx as jsx124 } from "react/jsx-runtime";
9318
+ import { jsx as jsx125 } from "react/jsx-runtime";
9203
9319
  function SelectDesktopContent({
9204
9320
  isOpen,
9205
9321
  listboxId,
@@ -9220,14 +9336,14 @@ function SelectDesktopContent({
9220
9336
  noOptionsMessage
9221
9337
  }) {
9222
9338
  if (!isOpen) return null;
9223
- return /* @__PURE__ */ jsx124(
9339
+ return /* @__PURE__ */ jsx125(
9224
9340
  "div",
9225
9341
  {
9226
9342
  className: cn(
9227
9343
  "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)]",
9228
9344
  dropdownClassName
9229
9345
  ),
9230
- children: /* @__PURE__ */ jsx124(
9346
+ children: /* @__PURE__ */ jsx125(
9231
9347
  SelectDesktopMenu,
9232
9348
  {
9233
9349
  id: listboxId,
@@ -9325,7 +9441,7 @@ function getMobileOptionStyles(index, scrollTop) {
9325
9441
  }
9326
9442
 
9327
9443
  // src/airbnb/select/SelectMobileWheel.tsx
9328
- import { jsx as jsx125, jsxs as jsxs80 } from "react/jsx-runtime";
9444
+ import { jsx as jsx126, jsxs as jsxs81 } from "react/jsx-runtime";
9329
9445
  function SelectMobileWheel({
9330
9446
  id,
9331
9447
  options,
@@ -9344,7 +9460,7 @@ function SelectMobileWheel({
9344
9460
  }) {
9345
9461
  const spacerHeight2 = getWheelSpacerHeight();
9346
9462
  const emptyMessage = noOptionsMessage?.();
9347
- return /* @__PURE__ */ jsxs80(
9463
+ return /* @__PURE__ */ jsxs81(
9348
9464
  "div",
9349
9465
  {
9350
9466
  id,
@@ -9356,10 +9472,10 @@ function SelectMobileWheel({
9356
9472
  onKeyDown,
9357
9473
  className: cn("relative overflow-hidden outline-none", menuClassName),
9358
9474
  children: [
9359
- options.length === 0 && emptyMessage ? /* @__PURE__ */ jsx125("div", { className: "flex min-h-[160px] items-center justify-center px-4 text-center text-base leading-6 text-[#6C6C6C]", children: emptyMessage }) : null,
9360
- /* @__PURE__ */ jsx125("div", { className: "pointer-events-none absolute inset-x-0 top-0 h-16 bg-gradient-to-b from-white via-white/80 to-transparent" }),
9361
- /* @__PURE__ */ jsx125("div", { className: "pointer-events-none absolute inset-x-0 bottom-0 h-16 bg-gradient-to-t from-white via-white/80 to-transparent" }),
9362
- /* @__PURE__ */ jsx125(
9475
+ options.length === 0 && emptyMessage ? /* @__PURE__ */ jsx126("div", { className: "flex min-h-[160px] items-center justify-center px-4 text-center text-base leading-6 text-[#6C6C6C]", children: emptyMessage }) : null,
9476
+ /* @__PURE__ */ jsx126("div", { className: "pointer-events-none absolute inset-x-0 top-0 h-16 bg-gradient-to-b from-white via-white/80 to-transparent" }),
9477
+ /* @__PURE__ */ jsx126("div", { className: "pointer-events-none absolute inset-x-0 bottom-0 h-16 bg-gradient-to-t from-white via-white/80 to-transparent" }),
9478
+ /* @__PURE__ */ jsx126(
9363
9479
  "div",
9364
9480
  {
9365
9481
  "aria-hidden": true,
@@ -9369,7 +9485,7 @@ function SelectMobileWheel({
9369
9485
  )
9370
9486
  }
9371
9487
  ),
9372
- /* @__PURE__ */ jsxs80(
9488
+ /* @__PURE__ */ jsxs81(
9373
9489
  "div",
9374
9490
  {
9375
9491
  ref: listRef,
@@ -9384,11 +9500,11 @@ function SelectMobileWheel({
9384
9500
  WebkitOverflowScrolling: "touch"
9385
9501
  },
9386
9502
  children: [
9387
- /* @__PURE__ */ jsx125("div", { style: { height: `${spacerHeight2}px` } }),
9503
+ /* @__PURE__ */ jsx126("div", { style: { height: `${spacerHeight2}px` } }),
9388
9504
  options.map((option, index) => {
9389
9505
  const { distance, style } = getMobileOptionStyles(index, scrollTop);
9390
9506
  const optionKey = `${String(option.value)}-${index}`;
9391
- return /* @__PURE__ */ jsx125(
9507
+ return /* @__PURE__ */ jsx126(
9392
9508
  "button",
9393
9509
  {
9394
9510
  id: getOptionId2(index),
@@ -9409,7 +9525,7 @@ function SelectMobileWheel({
9409
9525
  optionKey
9410
9526
  );
9411
9527
  }),
9412
- /* @__PURE__ */ jsx125("div", { style: { height: `${spacerHeight2}px` } })
9528
+ /* @__PURE__ */ jsx126("div", { style: { height: `${spacerHeight2}px` } })
9413
9529
  ]
9414
9530
  }
9415
9531
  )
@@ -9419,7 +9535,7 @@ function SelectMobileWheel({
9419
9535
  }
9420
9536
 
9421
9537
  // src/airbnb/select/SelectMobileContent.tsx
9422
- import { jsx as jsx126, jsxs as jsxs81 } from "react/jsx-runtime";
9538
+ import { jsx as jsx127, jsxs as jsxs82 } from "react/jsx-runtime";
9423
9539
  function SelectMobileContent({
9424
9540
  open,
9425
9541
  onOpenChange,
@@ -9443,11 +9559,11 @@ function SelectMobileContent({
9443
9559
  getOptionId: getOptionId2,
9444
9560
  noOptionsMessage
9445
9561
  }) {
9446
- return /* @__PURE__ */ jsx126(Drawer, { open, onOpenChange, children: /* @__PURE__ */ jsxs81(DrawerContent, { onClose, lockScroll: false, children: [
9447
- /* @__PURE__ */ jsx126(DrawerTitle, { className: "sr-only", children: mobileTitle ?? label }),
9448
- /* @__PURE__ */ jsx126(DrawerDescription, { className: "sr-only", children: label }),
9449
- /* @__PURE__ */ jsxs81("div", { className: "px-6 pb-4 pt-1", children: [
9450
- /* @__PURE__ */ jsx126(
9562
+ return /* @__PURE__ */ jsx127(Drawer, { open, onOpenChange, children: /* @__PURE__ */ jsxs82(DrawerContent, { onClose, lockScroll: false, children: [
9563
+ /* @__PURE__ */ jsx127(DrawerTitle, { className: "sr-only", children: mobileTitle ?? label }),
9564
+ /* @__PURE__ */ jsx127(DrawerDescription, { className: "sr-only", children: label }),
9565
+ /* @__PURE__ */ jsxs82("div", { className: "px-6 pb-4 pt-1", children: [
9566
+ /* @__PURE__ */ jsx127(
9451
9567
  SelectMobileWheel,
9452
9568
  {
9453
9569
  id: listboxId,
@@ -9466,7 +9582,7 @@ function SelectMobileContent({
9466
9582
  noOptionsMessage
9467
9583
  }
9468
9584
  ),
9469
- /* @__PURE__ */ jsx126(Button, { type: "button", onClick: onDone, className: "mt-4 h-12 mb-8 w-full", children: doneLabel })
9585
+ /* @__PURE__ */ jsx127(Button, { type: "button", onClick: onDone, className: "mt-4 h-12 mb-8 w-full", children: doneLabel })
9470
9586
  ] })
9471
9587
  ] }) });
9472
9588
  }
@@ -9474,7 +9590,7 @@ function SelectMobileContent({
9474
9590
  // src/airbnb/select/SelectTrigger.tsx
9475
9591
  import * as React32 from "react";
9476
9592
  import { ChevronDown } from "lucide-react";
9477
- import { jsx as jsx127 } from "react/jsx-runtime";
9593
+ import { jsx as jsx128 } from "react/jsx-runtime";
9478
9594
  var SelectTrigger2 = React32.forwardRef(
9479
9595
  ({
9480
9596
  id,
@@ -9496,7 +9612,7 @@ var SelectTrigger2 = React32.forwardRef(
9496
9612
  onClick,
9497
9613
  onKeyDown
9498
9614
  }, ref) => {
9499
- return /* @__PURE__ */ jsx127(
9615
+ return /* @__PURE__ */ jsx128(
9500
9616
  FieldTrigger,
9501
9617
  {
9502
9618
  id,
@@ -9520,7 +9636,7 @@ var SelectTrigger2 = React32.forwardRef(
9520
9636
  disabled,
9521
9637
  onClick,
9522
9638
  onKeyDown,
9523
- trailingAdornment: /* @__PURE__ */ jsx127(
9639
+ trailingAdornment: /* @__PURE__ */ jsx128(
9524
9640
  ChevronDown,
9525
9641
  {
9526
9642
  className: open ? "h-6 w-6 rotate-180 text-[#1F1F1B] transition-transform" : "h-6 w-6 text-[#1F1F1B] transition-transform"
@@ -9934,7 +10050,7 @@ function useOutsideClick(elementRef, onOutsideClick, nested) {
9934
10050
  }
9935
10051
 
9936
10052
  // src/airbnb/select/Select.tsx
9937
- import { jsx as jsx128, jsxs as jsxs82 } from "react/jsx-runtime";
10053
+ import { jsx as jsx129, jsxs as jsxs83 } from "react/jsx-runtime";
9938
10054
  function AirbnbSelect({
9939
10055
  options,
9940
10056
  value,
@@ -10092,8 +10208,8 @@ function AirbnbSelect({
10092
10208
  handleMobileOpenChange(false);
10093
10209
  }
10094
10210
  };
10095
- return /* @__PURE__ */ jsxs82("div", { ref: containerRef, className: cn("relative w-full max-w-[480px]", className), children: [
10096
- name && /* @__PURE__ */ jsx128("input", { type: "hidden", name, value: value ? String(value.value) : "" }),
10211
+ return /* @__PURE__ */ jsxs83("div", { ref: containerRef, className: cn("relative w-full max-w-[480px]", className), children: [
10212
+ name && /* @__PURE__ */ jsx129("input", { type: "hidden", name, value: value ? String(value.value) : "" }),
10097
10213
  renderTrigger ? renderTrigger({
10098
10214
  id: triggerId,
10099
10215
  open: isOpen,
@@ -10110,7 +10226,7 @@ function AirbnbSelect({
10110
10226
  triggerRef,
10111
10227
  onClick: handleTriggerClick,
10112
10228
  onKeyDown: handleRootTriggerKeyDown
10113
- }) : /* @__PURE__ */ jsx128(
10229
+ }) : /* @__PURE__ */ jsx129(
10114
10230
  SelectTrigger2,
10115
10231
  {
10116
10232
  id: triggerId,
@@ -10134,7 +10250,7 @@ function AirbnbSelect({
10134
10250
  onKeyDown: handleRootTriggerKeyDown
10135
10251
  }
10136
10252
  ),
10137
- isMobile ? /* @__PURE__ */ jsx128(
10253
+ isMobile ? /* @__PURE__ */ jsx129(
10138
10254
  SelectMobileContent,
10139
10255
  {
10140
10256
  open: isOpen,
@@ -10159,7 +10275,7 @@ function AirbnbSelect({
10159
10275
  getOptionId: getOptionId2,
10160
10276
  noOptionsMessage
10161
10277
  }
10162
- ) : /* @__PURE__ */ jsx128(
10278
+ ) : /* @__PURE__ */ jsx129(
10163
10279
  SelectDesktopContent,
10164
10280
  {
10165
10281
  isOpen,
@@ -10190,17 +10306,170 @@ function AirbnbSelect({
10190
10306
  ] });
10191
10307
  }
10192
10308
 
10309
+ // src/airbnb/phone-field/PhoneField.tsx
10310
+ import { jsx as jsx130, jsxs as jsxs84 } from "react/jsx-runtime";
10311
+ function PhoneField({
10312
+ variant = "default",
10313
+ label,
10314
+ topLabel,
10315
+ value,
10316
+ onChange,
10317
+ options,
10318
+ placeholder = "Phone number",
10319
+ disabled,
10320
+ error,
10321
+ className,
10322
+ name,
10323
+ codeName,
10324
+ numberName,
10325
+ mobileTitle,
10326
+ codePlaceholder = "+00"
10327
+ }) {
10328
+ const inputId = React37.useId();
10329
+ const codeOptions = React37.useMemo(
10330
+ () => options.map((option) => ({
10331
+ value: option.value,
10332
+ label: option.label,
10333
+ disabled: option.disabled
10334
+ })),
10335
+ [options]
10336
+ );
10337
+ const selectedCodeOption = React37.useMemo(
10338
+ () => codeOptions.find((option) => option.value === value?.code) ?? null,
10339
+ [codeOptions, value?.code]
10340
+ );
10341
+ const combinedValue = value?.code || value?.number ? `${value?.code ?? ""}${value?.number ?? ""}` : "";
10342
+ return /* @__PURE__ */ jsxs84("div", { className: cn("w-full max-w-[480px]", className), children: [
10343
+ name && /* @__PURE__ */ jsx130("input", { type: "hidden", name, value: combinedValue, disabled }),
10344
+ codeName && /* @__PURE__ */ jsx130(
10345
+ "input",
10346
+ {
10347
+ type: "hidden",
10348
+ name: codeName,
10349
+ value: value?.code ?? "",
10350
+ disabled
10351
+ }
10352
+ ),
10353
+ numberName && /* @__PURE__ */ jsx130(
10354
+ "input",
10355
+ {
10356
+ type: "hidden",
10357
+ name: numberName,
10358
+ value: value?.number ?? "",
10359
+ disabled
10360
+ }
10361
+ ),
10362
+ topLabel && /* @__PURE__ */ jsx130(
10363
+ "label",
10364
+ {
10365
+ htmlFor: inputId,
10366
+ className: "mb-3 block text-[16px] font-medium leading-5 text-[#1F1F1B]",
10367
+ children: topLabel
10368
+ }
10369
+ ),
10370
+ /* @__PURE__ */ jsxs84("div", { className: "flex items-stretch", children: [
10371
+ /* @__PURE__ */ jsx130(
10372
+ AirbnbSelect,
10373
+ {
10374
+ variant,
10375
+ options: codeOptions,
10376
+ value: selectedCodeOption,
10377
+ onChange: (option) => onChange({
10378
+ code: String(option.value),
10379
+ number: value?.number ?? ""
10380
+ }),
10381
+ label: `${label} country code`,
10382
+ placeholder: codePlaceholder,
10383
+ disabled,
10384
+ className: "max-w-none shrink-0 basis-[96px]",
10385
+ mobileTitle: mobileTitle ?? "Select country code",
10386
+ dropdownClassName: "right-auto w-[280px]",
10387
+ getValueLabel: (option) => String(option.value),
10388
+ renderTrigger: ({
10389
+ id,
10390
+ open,
10391
+ variant: selectVariant,
10392
+ disabled: triggerDisabled,
10393
+ listboxId,
10394
+ triggerRef,
10395
+ onClick,
10396
+ onKeyDown,
10397
+ valueLabel
10398
+ }) => /* @__PURE__ */ jsxs84(
10399
+ "button",
10400
+ {
10401
+ id,
10402
+ ref: triggerRef,
10403
+ type: "button",
10404
+ "aria-label": `${label} country code`,
10405
+ "aria-haspopup": "listbox",
10406
+ "aria-expanded": open,
10407
+ "aria-controls": listboxId,
10408
+ disabled: triggerDisabled,
10409
+ onClick,
10410
+ onKeyDown,
10411
+ className: cn(
10412
+ "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",
10413
+ 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]",
10414
+ 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]",
10415
+ triggerDisabled ? "cursor-not-allowed opacity-50" : "cursor-pointer"
10416
+ ),
10417
+ children: [
10418
+ /* @__PURE__ */ jsx130("span", { children: valueLabel ?? codePlaceholder }),
10419
+ /* @__PURE__ */ jsx130(
10420
+ ChevronDown2,
10421
+ {
10422
+ className: cn("h-5 w-5 transition-transform", open ? "rotate-180" : ""),
10423
+ strokeWidth: 2
10424
+ }
10425
+ )
10426
+ ]
10427
+ }
10428
+ )
10429
+ }
10430
+ ),
10431
+ /* @__PURE__ */ jsx130(
10432
+ AirbnbInput,
10433
+ {
10434
+ id: inputId,
10435
+ variant,
10436
+ type: "tel",
10437
+ inputMode: "tel",
10438
+ label,
10439
+ helperText: placeholder,
10440
+ value: value?.number ?? "",
10441
+ placeholder,
10442
+ disabled,
10443
+ error,
10444
+ renderErrorMessage: false,
10445
+ wrapperClassName: "min-w-0 flex-1",
10446
+ fieldClassName: cn(
10447
+ variant === "airbnb" ? "min-h-[60px] rounded-l-none rounded-r-[16px] border-l-0" : "rounded-l-none rounded-r-[10px] border-l-0"
10448
+ ),
10449
+ contentClassName: cn(variant === "airbnb" ? "h-[40px] py-2" : "h-[48px]"),
10450
+ inputClassName: "text-[16px] leading-7",
10451
+ onChange: (event) => onChange({
10452
+ code: value?.code ?? "",
10453
+ number: event.target.value
10454
+ })
10455
+ }
10456
+ )
10457
+ ] }),
10458
+ error && /* @__PURE__ */ jsx130(FieldErrorMessage, { message: error })
10459
+ ] });
10460
+ }
10461
+
10193
10462
  // src/airbnb/search-input/SearchInput.tsx
10194
- import * as React37 from "react";
10463
+ import * as React38 from "react";
10195
10464
  import { useTranslation as useTranslation22 } from "react-i18next";
10196
10465
  import { Search as Search3, X as X8 } from "lucide-react";
10197
- import { jsx as jsx129, jsxs as jsxs83 } from "react/jsx-runtime";
10198
- var AirbnbSearchInput = React37.forwardRef(({ onReset, placeholder, wrapperClassName, ...props }, ref) => {
10466
+ import { jsx as jsx131, jsxs as jsxs85 } from "react/jsx-runtime";
10467
+ var AirbnbSearchInput = React38.forwardRef(({ onReset, placeholder, wrapperClassName, ...props }, ref) => {
10199
10468
  const { t } = useTranslation22();
10200
10469
  const placeholderText = placeholder || t("search_property") + "...";
10201
- return /* @__PURE__ */ jsxs83("div", { className: cn("input-wrapper relative", wrapperClassName), children: [
10202
- /* @__PURE__ */ jsx129(Search3, { className: "absolute left-4 top-1/2 h-5 w-5 -translate-y-1/2 transform text-[#9696B9]" }),
10203
- /* @__PURE__ */ jsx129(
10470
+ return /* @__PURE__ */ jsxs85("div", { className: cn("input-wrapper relative", wrapperClassName), children: [
10471
+ /* @__PURE__ */ jsx131(Search3, { className: "absolute left-4 top-1/2 h-5 w-5 -translate-y-1/2 transform text-[#9696B9]" }),
10472
+ /* @__PURE__ */ jsx131(
10204
10473
  "input",
10205
10474
  {
10206
10475
  ...props,
@@ -10219,13 +10488,13 @@ var AirbnbSearchInput = React37.forwardRef(({ onReset, placeholder, wrapperClass
10219
10488
  )
10220
10489
  }
10221
10490
  ),
10222
- onReset && /* @__PURE__ */ jsx129(
10491
+ onReset && /* @__PURE__ */ jsx131(
10223
10492
  Button,
10224
10493
  {
10225
10494
  variant: "ghost",
10226
10495
  onClick: onReset,
10227
10496
  className: "absolute right-0 top-1/2 h-5 w-5 -translate-y-1/2 transform text-[#9696B9]",
10228
- children: /* @__PURE__ */ jsx129(X8, { className: "h-5 w-5" })
10497
+ children: /* @__PURE__ */ jsx131(X8, { className: "h-5 w-5" })
10229
10498
  }
10230
10499
  )
10231
10500
  ] });
@@ -10233,10 +10502,10 @@ var AirbnbSearchInput = React37.forwardRef(({ onReset, placeholder, wrapperClass
10233
10502
  AirbnbSearchInput.displayName = "SearchInput";
10234
10503
 
10235
10504
  // src/searchable-select/SearchableSelect.tsx
10236
- import * as React38 from "react";
10237
- import { ChevronDown as ChevronDown2, Search as Search4 } from "lucide-react";
10505
+ import * as React39 from "react";
10506
+ import { ChevronDown as ChevronDown3, Search as Search4 } from "lucide-react";
10238
10507
  import { useVirtualizer } from "@tanstack/react-virtual";
10239
- import { jsx as jsx130, jsxs as jsxs84 } from "react/jsx-runtime";
10508
+ import { jsx as jsx132, jsxs as jsxs86 } from "react/jsx-runtime";
10240
10509
  var ROW_HEIGHT = 48;
10241
10510
  var DESKTOP_LIST_HEIGHT = 280;
10242
10511
  var MOBILE_LIST_HEIGHT = 420;
@@ -10273,13 +10542,13 @@ var SearchableSelectInternal = ({
10273
10542
  loadingMessage
10274
10543
  }, ref) => {
10275
10544
  const { isMatch: isMobile } = useScreenResize(DEVICE.mobileXL);
10276
- const reactId = React38.useId();
10277
- const [open, setOpen] = React38.useState(false);
10278
- const [internalSearchValue, setInternalSearchValue] = React38.useState("");
10279
- const [highlightedIndex, setHighlightedIndex] = React38.useState(-1);
10280
- const containerRef = React38.useRef(null);
10281
- const triggerRef = React38.useRef(null);
10282
- const inputRef = React38.useRef(null);
10545
+ const reactId = React39.useId();
10546
+ const [open, setOpen] = React39.useState(false);
10547
+ const [internalSearchValue, setInternalSearchValue] = React39.useState("");
10548
+ const [highlightedIndex, setHighlightedIndex] = React39.useState(-1);
10549
+ const containerRef = React39.useRef(null);
10550
+ const triggerRef = React39.useRef(null);
10551
+ const inputRef = React39.useRef(null);
10283
10552
  const listboxId = `${reactId}-listbox`;
10284
10553
  const labelId = `${reactId}-label`;
10285
10554
  const valueId = `${reactId}-value`;
@@ -10288,13 +10557,13 @@ var SearchableSelectInternal = ({
10288
10557
  const searchInputId = `${reactId}-search`;
10289
10558
  const effectiveSearchValue = searchValue ?? internalSearchValue;
10290
10559
  const shouldFilterLocally = !onSearchChange && filterOption !== null;
10291
- const visibleOptions = React38.useMemo(() => {
10560
+ const visibleOptions = React39.useMemo(() => {
10292
10561
  if (!shouldFilterLocally || !effectiveSearchValue) {
10293
10562
  return options;
10294
10563
  }
10295
10564
  return options.filter((option) => filterOption(option, effectiveSearchValue));
10296
10565
  }, [effectiveSearchValue, filterOption, options, shouldFilterLocally]);
10297
- const selectedIndex = React38.useMemo(
10566
+ const selectedIndex = React39.useMemo(
10298
10567
  () => visibleOptions.findIndex((option) => option.value === value?.value),
10299
10568
  [value?.value, visibleOptions]
10300
10569
  );
@@ -10303,7 +10572,7 @@ var SearchableSelectInternal = ({
10303
10572
  const describedBy = error && !hideErrorMessage ? errorId : void 0;
10304
10573
  const activeOptionId = highlightedIndex >= 0 ? getOptionId(reactId, highlightedIndex) : void 0;
10305
10574
  useOutsideClick(containerRef, open && !isMobile ? () => closeSelect() : null);
10306
- React38.useEffect(() => {
10575
+ React39.useEffect(() => {
10307
10576
  if (!open) return;
10308
10577
  const frameId = window.requestAnimationFrame(() => {
10309
10578
  inputRef.current?.focus();
@@ -10312,7 +10581,7 @@ var SearchableSelectInternal = ({
10312
10581
  window.cancelAnimationFrame(frameId);
10313
10582
  };
10314
10583
  }, [open]);
10315
- React38.useEffect(() => {
10584
+ React39.useEffect(() => {
10316
10585
  if (!open) {
10317
10586
  setHighlightedIndex(-1);
10318
10587
  return;
@@ -10387,7 +10656,7 @@ var SearchableSelectInternal = ({
10387
10656
  }
10388
10657
  }
10389
10658
  }
10390
- const content = /* @__PURE__ */ jsx130(
10659
+ const content = /* @__PURE__ */ jsx132(
10391
10660
  SearchableSelectContent,
10392
10661
  {
10393
10662
  inputId: searchInputId,
@@ -10414,10 +10683,10 @@ var SearchableSelectInternal = ({
10414
10683
  onOptionHover: setHighlightedIndex
10415
10684
  }
10416
10685
  );
10417
- React38.useImperativeHandle(ref, () => triggerRef.current, []);
10418
- return /* @__PURE__ */ jsxs84("div", { ref: containerRef, className: cn("relative w-full max-w-[480px]", className), children: [
10419
- name && /* @__PURE__ */ jsx130("input", { type: "hidden", name, value: value ? String(value.value) : "" }),
10420
- /* @__PURE__ */ jsx130(
10686
+ React39.useImperativeHandle(ref, () => triggerRef.current, []);
10687
+ return /* @__PURE__ */ jsxs86("div", { ref: containerRef, className: cn("relative w-full max-w-[480px]", className), children: [
10688
+ name && /* @__PURE__ */ jsx132("input", { type: "hidden", name, value: value ? String(value.value) : "" }),
10689
+ /* @__PURE__ */ jsx132(
10421
10690
  FieldTrigger,
10422
10691
  {
10423
10692
  id: `${reactId}-trigger`,
@@ -10447,8 +10716,8 @@ var SearchableSelectInternal = ({
10447
10716
  openSelect();
10448
10717
  },
10449
10718
  onKeyDown: handleTriggerKeyDown,
10450
- trailingAdornment: /* @__PURE__ */ jsx130(
10451
- ChevronDown2,
10719
+ trailingAdornment: /* @__PURE__ */ jsx132(
10720
+ ChevronDown3,
10452
10721
  {
10453
10722
  className: cn(
10454
10723
  "h-6 w-6 text-[#1F1F1B] transition-transform",
@@ -10458,7 +10727,7 @@ var SearchableSelectInternal = ({
10458
10727
  )
10459
10728
  }
10460
10729
  ),
10461
- isMobile ? /* @__PURE__ */ jsx130(
10730
+ isMobile ? /* @__PURE__ */ jsx132(
10462
10731
  Drawer,
10463
10732
  {
10464
10733
  open,
@@ -10469,13 +10738,13 @@ var SearchableSelectInternal = ({
10469
10738
  }
10470
10739
  closeSelect();
10471
10740
  },
10472
- children: /* @__PURE__ */ jsxs84(DrawerContent, { onClose: closeSelect, lockScroll: false, children: [
10473
- /* @__PURE__ */ jsx130(DrawerTitle, { className: "sr-only", children: mobileTitle ?? label }),
10474
- /* @__PURE__ */ jsx130(DrawerDescription, { className: "sr-only", children: label }),
10475
- /* @__PURE__ */ jsx130("div", { className: "px-5 pb-5 pt-1", children: content })
10741
+ children: /* @__PURE__ */ jsxs86(DrawerContent, { onClose: closeSelect, lockScroll: false, children: [
10742
+ /* @__PURE__ */ jsx132(DrawerTitle, { className: "sr-only", children: mobileTitle ?? label }),
10743
+ /* @__PURE__ */ jsx132(DrawerDescription, { className: "sr-only", children: label }),
10744
+ /* @__PURE__ */ jsx132("div", { className: "px-5 pb-5 pt-1", children: content })
10476
10745
  ] })
10477
10746
  }
10478
- ) : open ? /* @__PURE__ */ jsx130(
10747
+ ) : open ? /* @__PURE__ */ jsx132(
10479
10748
  "div",
10480
10749
  {
10481
10750
  className: cn(
@@ -10487,7 +10756,7 @@ var SearchableSelectInternal = ({
10487
10756
  ) : null
10488
10757
  ] });
10489
10758
  };
10490
- var SearchableSelect = React38.forwardRef(
10759
+ var SearchableSelect = React39.forwardRef(
10491
10760
  SearchableSelectInternal
10492
10761
  );
10493
10762
  function SearchableSelectContent({
@@ -10514,9 +10783,9 @@ function SearchableSelectContent({
10514
10783
  onOptionClick,
10515
10784
  onOptionHover
10516
10785
  }) {
10517
- const listRef = React38.useRef(null);
10518
- const lastLoadMoreOptionsLengthRef = React38.useRef(null);
10519
- const previousHighlightedIndexRef = React38.useRef(highlightedIndex);
10786
+ const listRef = React39.useRef(null);
10787
+ const lastLoadMoreOptionsLengthRef = React39.useRef(null);
10788
+ const previousHighlightedIndexRef = React39.useRef(highlightedIndex);
10520
10789
  const rowCount = options.length + (loading && options.length > 0 ? 1 : 0);
10521
10790
  const virtualizer = useVirtualizer({
10522
10791
  count: rowCount,
@@ -10527,7 +10796,7 @@ function SearchableSelectContent({
10527
10796
  const virtualItems = virtualizer.getVirtualItems();
10528
10797
  const emptyMessage = noOptionsMessage?.() ?? "No matches found";
10529
10798
  const loadingText = loadingMessage?.() ?? "Loading...";
10530
- React38.useEffect(() => {
10799
+ React39.useEffect(() => {
10531
10800
  const lastItem = virtualItems[virtualItems.length - 1];
10532
10801
  const shouldLoadMore = !!lastItem && hasNextPage && !loading && lastItem.index >= options.length - LOAD_MORE_THRESHOLD;
10533
10802
  if (shouldLoadMore && lastLoadMoreOptionsLengthRef.current !== options.length) {
@@ -10535,23 +10804,23 @@ function SearchableSelectContent({
10535
10804
  onLoadMore?.();
10536
10805
  }
10537
10806
  }, [hasNextPage, loading, onLoadMore, options.length, virtualItems]);
10538
- React38.useEffect(() => {
10807
+ React39.useEffect(() => {
10539
10808
  const hasHighlightedIndexChanged = previousHighlightedIndexRef.current !== highlightedIndex;
10540
10809
  previousHighlightedIndexRef.current = highlightedIndex;
10541
10810
  if (highlightedIndex >= 0 && hasHighlightedIndexChanged) {
10542
10811
  virtualizer.scrollToIndex(highlightedIndex, { align: "auto" });
10543
10812
  }
10544
10813
  }, [highlightedIndex, virtualizer]);
10545
- return /* @__PURE__ */ jsxs84("div", { className: "p-2", children: [
10546
- /* @__PURE__ */ jsxs84("div", { className: "relative mb-2", children: [
10547
- /* @__PURE__ */ jsx130(
10814
+ return /* @__PURE__ */ jsxs86("div", { className: "p-2", children: [
10815
+ /* @__PURE__ */ jsxs86("div", { className: "relative mb-2", children: [
10816
+ /* @__PURE__ */ jsx132(
10548
10817
  Search4,
10549
10818
  {
10550
10819
  "aria-hidden": "true",
10551
10820
  className: "absolute left-4 top-1/2 h-5 w-5 -translate-y-1/2 text-[#9696B9]"
10552
10821
  }
10553
10822
  ),
10554
- /* @__PURE__ */ jsx130(
10823
+ /* @__PURE__ */ jsx132(
10555
10824
  "input",
10556
10825
  {
10557
10826
  id: inputId,
@@ -10570,7 +10839,7 @@ function SearchableSelectContent({
10570
10839
  }
10571
10840
  )
10572
10841
  ] }),
10573
- loading && options.length === 0 ? /* @__PURE__ */ jsx130("div", { className: "px-4 py-5 text-center text-base leading-6 text-[#6C6C6C]", children: loadingText }) : options.length === 0 ? /* @__PURE__ */ jsx130("div", { className: "px-4 py-5 text-center text-base leading-6 text-[#6C6C6C]", children: emptyMessage }) : /* @__PURE__ */ jsx130(
10842
+ loading && options.length === 0 ? /* @__PURE__ */ jsx132("div", { className: "px-4 py-5 text-center text-base leading-6 text-[#6C6C6C]", children: loadingText }) : options.length === 0 ? /* @__PURE__ */ jsx132("div", { className: "px-4 py-5 text-center text-base leading-6 text-[#6C6C6C]", children: emptyMessage }) : /* @__PURE__ */ jsx132(
10574
10843
  "div",
10575
10844
  {
10576
10845
  id: listboxId,
@@ -10579,7 +10848,7 @@ function SearchableSelectContent({
10579
10848
  "aria-labelledby": labelId,
10580
10849
  className: cn("overflow-y-auto outline-none", menuClassName),
10581
10850
  style: { height: Math.min(height, rowCount * ROW_HEIGHT) },
10582
- children: /* @__PURE__ */ jsx130(
10851
+ children: /* @__PURE__ */ jsx132(
10583
10852
  "div",
10584
10853
  {
10585
10854
  className: "relative w-full",
@@ -10587,7 +10856,7 @@ function SearchableSelectContent({
10587
10856
  children: virtualItems.map((virtualItem) => {
10588
10857
  const option = options[virtualItem.index];
10589
10858
  if (!option) {
10590
- return /* @__PURE__ */ jsx130(
10859
+ return /* @__PURE__ */ jsx132(
10591
10860
  "div",
10592
10861
  {
10593
10862
  className: "absolute left-0 top-0 flex w-full items-center px-4 text-base leading-6 text-[#6C6C6C]",
@@ -10602,7 +10871,7 @@ function SearchableSelectContent({
10602
10871
  }
10603
10872
  const isSelected = value?.value === option.value;
10604
10873
  const isHighlighted = virtualItem.index === highlightedIndex;
10605
- return /* @__PURE__ */ jsx130(
10874
+ return /* @__PURE__ */ jsx132(
10606
10875
  "button",
10607
10876
  {
10608
10877
  id: getOptionId(idPrefix, virtualItem.index),
@@ -10624,7 +10893,7 @@ function SearchableSelectContent({
10624
10893
  height: `${virtualItem.size}px`,
10625
10894
  transform: `translateY(${virtualItem.start}px)`
10626
10895
  },
10627
- children: /* @__PURE__ */ jsx130("span", { className: "truncate text-center", children: String(option.label) })
10896
+ children: /* @__PURE__ */ jsx132("span", { className: "truncate text-center", children: String(option.label) })
10628
10897
  },
10629
10898
  `${String(option.value)}-${virtualItem.index}`
10630
10899
  );
@@ -10779,6 +11048,7 @@ export {
10779
11048
  OverlayLoader,
10780
11049
  PageLoader,
10781
11050
  Pagination,
11051
+ PhoneField,
10782
11052
  Popover,
10783
11053
  PopoverAnchor,
10784
11054
  PopoverClose,
@@ -10793,6 +11063,7 @@ export {
10793
11063
  RatingRadioGroup,
10794
11064
  RatingStars,
10795
11065
  RegistryIcon,
11066
+ ResponsiveSheet,
10796
11067
  RotateIcon,
10797
11068
  ScrollArea,
10798
11069
  ScrollBar,