@chekinapp/ui 0.0.2 → 0.0.4

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 = {}) {
@@ -5029,37 +5033,42 @@ var SelectLabel = React19.forwardRef(({ className, ...props }, ref) => /* @__PUR
5029
5033
  }
5030
5034
  ));
5031
5035
  SelectLabel.displayName = "SelectLabel";
5032
- var Select = ({
5033
- placeholder,
5034
- label,
5035
- supportingText,
5036
- errorText,
5037
- containerClassName,
5038
- triggerClassName,
5039
- children,
5040
- ...props
5041
- }) => {
5042
- const reactId = React19.useId();
5043
- const triggerId = props.name ?? reactId;
5044
- return /* @__PURE__ */ jsxs46("div", { className: cn("flex flex-col gap-chekin-1 w-[300px]", containerClassName), children: [
5045
- label && /* @__PURE__ */ jsx74(
5046
- "label",
5047
- {
5048
- htmlFor: triggerId,
5049
- className: "text-chekin-navy font-sans font-medium text-[14px] leading-5",
5050
- children: label
5051
- }
5052
- ),
5053
- /* @__PURE__ */ jsxs46(SelectRoot, { ...props, children: [
5054
- /* @__PURE__ */ jsx74(SelectTrigger, { id: triggerId, className: triggerClassName, children: /* @__PURE__ */ jsx74(RadixSelect.Value, { placeholder }) }),
5055
- /* @__PURE__ */ jsx74(SelectContent, { children })
5056
- ] }),
5057
- /* @__PURE__ */ jsxs46("div", { className: "flex justify-between min-h-[15px]", children: [
5058
- supportingText && !errorText && /* @__PURE__ */ jsx74("span", { className: "text-chekin-gray-2 font-sans italic text-[12px] leading-[15px]", children: supportingText }),
5059
- errorText && /* @__PURE__ */ jsx74("span", { className: "ml-auto text-chekin-red font-sans font-medium text-[12px] leading-4 text-right", children: errorText })
5060
- ] })
5061
- ] });
5062
- };
5036
+ var Select = React19.forwardRef(
5037
+ ({
5038
+ placeholder,
5039
+ label,
5040
+ supportingText,
5041
+ errorText,
5042
+ containerClassName,
5043
+ triggerClassName,
5044
+ children,
5045
+ ...props
5046
+ }, ref) => {
5047
+ const reactId = React19.useId();
5048
+ const triggerId = props.name ?? reactId;
5049
+ const internalRef = React19.useRef(null);
5050
+ const combinedRef = useCombinedRef(ref, internalRef);
5051
+ return /* @__PURE__ */ jsxs46("div", { className: cn("flex flex-col gap-chekin-1 w-[300px]", containerClassName), children: [
5052
+ label && /* @__PURE__ */ jsx74(
5053
+ "label",
5054
+ {
5055
+ htmlFor: triggerId,
5056
+ className: "text-chekin-navy font-sans font-medium text-[14px] leading-5",
5057
+ children: label
5058
+ }
5059
+ ),
5060
+ /* @__PURE__ */ jsxs46(SelectRoot, { ...props, children: [
5061
+ /* @__PURE__ */ jsx74(SelectTrigger, { ref: combinedRef, id: triggerId, className: triggerClassName, children: /* @__PURE__ */ jsx74(RadixSelect.Value, { placeholder }) }),
5062
+ /* @__PURE__ */ jsx74(SelectContent, { children })
5063
+ ] }),
5064
+ /* @__PURE__ */ jsxs46("div", { className: "flex justify-between min-h-[15px]", children: [
5065
+ supportingText && !errorText && /* @__PURE__ */ jsx74("span", { className: "text-chekin-gray-2 font-sans italic text-[12px] leading-[15px]", children: supportingText }),
5066
+ errorText && /* @__PURE__ */ jsx74("span", { className: "ml-auto text-chekin-red font-sans font-medium text-[12px] leading-4 text-right", children: errorText })
5067
+ ] })
5068
+ ] });
5069
+ }
5070
+ );
5071
+ Select.displayName = "Select";
5063
5072
 
5064
5073
  // src/pagination/Pagination.tsx
5065
5074
  import { jsx as jsx75, jsxs as jsxs47 } from "react/jsx-runtime";
@@ -7245,10 +7254,10 @@ var TASK_VARIANTS = {
7245
7254
  import { Toaster, toast as toast2 } from "sonner";
7246
7255
 
7247
7256
  // src/toaster/useUpdateToast.ts
7248
- import { useCallback as useCallback9, useRef as useRef8 } from "react";
7257
+ import { useCallback as useCallback9, useRef as useRef9 } from "react";
7249
7258
  import { toast } from "sonner";
7250
7259
  function useUpdateToast({ id }) {
7251
- const toastIdRef = useRef8("");
7260
+ const toastIdRef = useRef9("");
7252
7261
  const getToastOptions = useCallback9(
7253
7262
  (options) => ({
7254
7263
  id: toastIdRef.current,
@@ -8839,158 +8848,270 @@ FieldTrigger.displayName = "FieldTrigger";
8839
8848
  // src/datepicker/DatePicker.tsx
8840
8849
  import { jsx as jsx121, jsxs as jsxs78 } from "react/jsx-runtime";
8841
8850
  var DEFAULT_MIN_DATE = new Date(1920, 0, 1);
8842
- function DatePicker({
8843
- variant = "default",
8844
- label,
8845
- topLabel,
8846
- value,
8847
- defaultValue,
8848
- onChange,
8849
- placeholder = "Select a date",
8850
- disabled,
8851
- error,
8851
+ var DatePicker = React30.forwardRef(
8852
+ ({
8853
+ variant = "default",
8854
+ label,
8855
+ topLabel,
8856
+ value,
8857
+ defaultValue,
8858
+ onChange,
8859
+ placeholder = "Select a date",
8860
+ disabled,
8861
+ error,
8862
+ className,
8863
+ name,
8864
+ minDate,
8865
+ maxDate,
8866
+ locale = "en-US",
8867
+ mobileTitle,
8868
+ doneLabel = "Done",
8869
+ formatValue = formatDateValue
8870
+ }, ref) => {
8871
+ const { isMatch: isMobile } = useScreenResize(DEVICE.mobileXL);
8872
+ const [isOpen, setIsOpen] = React30.useState(false);
8873
+ const triggerId = React30.useId();
8874
+ const pickerId = React30.useId();
8875
+ const labelId = React30.useId();
8876
+ const valueId = React30.useId();
8877
+ const helperTextId = React30.useId();
8878
+ const errorId = React30.useId();
8879
+ const internalRef = React30.useRef(null);
8880
+ const combinedRef = useCombinedRef(ref, internalRef);
8881
+ const monthLabels = React30.useMemo(() => getMonthLabels(locale), [locale]);
8882
+ const resolvedMinDate = React30.useMemo(() => minDate ?? DEFAULT_MIN_DATE, [minDate]);
8883
+ const resolvedMaxDate = React30.useMemo(() => maxDate ?? /* @__PURE__ */ new Date(), [maxDate]);
8884
+ const resolvedValue = React30.useMemo(
8885
+ () => value ? clampDate(value, resolvedMinDate, resolvedMaxDate) : null,
8886
+ [resolvedMaxDate, resolvedMinDate, value]
8887
+ );
8888
+ const hasValue = Boolean(resolvedValue);
8889
+ const {
8890
+ dayIndex,
8891
+ dayListRef,
8892
+ dayScrollTop,
8893
+ days,
8894
+ draftDate,
8895
+ handleColumnKeyDown,
8896
+ handleColumnScroll,
8897
+ handleOptionSelect,
8898
+ monthIndex,
8899
+ monthListRef,
8900
+ months,
8901
+ monthScrollTop,
8902
+ yearIndex,
8903
+ yearListRef,
8904
+ yearScrollTop,
8905
+ years
8906
+ } = useDatePickerWheel({
8907
+ isOpen,
8908
+ value: resolvedValue,
8909
+ defaultValue,
8910
+ minDate: resolvedMinDate,
8911
+ maxDate: resolvedMaxDate
8912
+ });
8913
+ const handleOpenChange = React30.useCallback((nextOpen) => {
8914
+ setIsOpen(nextOpen);
8915
+ if (!nextOpen) {
8916
+ internalRef.current?.focus();
8917
+ }
8918
+ }, []);
8919
+ const handleDone = React30.useCallback(() => {
8920
+ onChange(clampDate(draftDate, resolvedMinDate, resolvedMaxDate));
8921
+ handleOpenChange(false);
8922
+ }, [draftDate, handleOpenChange, onChange, resolvedMaxDate, resolvedMinDate]);
8923
+ const handleTriggerClick = React30.useCallback(() => {
8924
+ if (disabled) return;
8925
+ setIsOpen(true);
8926
+ }, [disabled]);
8927
+ const handleTriggerKeyDown = React30.useCallback(
8928
+ (event) => {
8929
+ if (disabled) return;
8930
+ if (event.key === "ArrowDown" || event.key === "ArrowUp" || event.key === "Enter" || event.key === " ") {
8931
+ event.preventDefault();
8932
+ setIsOpen(true);
8933
+ }
8934
+ },
8935
+ [disabled]
8936
+ );
8937
+ return /* @__PURE__ */ jsxs78("div", { className: cn("relative w-full max-w-[425px]", className), children: [
8938
+ name && /* @__PURE__ */ jsx121(
8939
+ "input",
8940
+ {
8941
+ type: "hidden",
8942
+ name,
8943
+ value: resolvedValue ? formatDateInputValue(resolvedValue) : ""
8944
+ }
8945
+ ),
8946
+ /* @__PURE__ */ jsx121(
8947
+ FieldTrigger,
8948
+ {
8949
+ id: triggerId,
8950
+ ref: combinedRef,
8951
+ variant,
8952
+ label,
8953
+ topLabel,
8954
+ labelId,
8955
+ valueId: hasValue ? valueId : void 0,
8956
+ helperTextId: !hasValue ? helperTextId : void 0,
8957
+ errorId: error ? errorId : void 0,
8958
+ describedBy: error ? errorId : void 0,
8959
+ labelText: topLabel ? placeholder : void 0,
8960
+ valueText: resolvedValue ? formatValue(resolvedValue) : void 0,
8961
+ placeholder,
8962
+ disabled,
8963
+ error,
8964
+ "aria-haspopup": "dialog",
8965
+ "aria-expanded": isOpen,
8966
+ onClick: handleTriggerClick,
8967
+ onKeyDown: handleTriggerKeyDown,
8968
+ trailingAdornment: /* @__PURE__ */ jsx121(Calendar2, { className: "h-5 w-5 text-[#1F1F1B]", strokeWidth: 2 })
8969
+ }
8970
+ ),
8971
+ /* @__PURE__ */ jsx121(
8972
+ DatePickerContent,
8973
+ {
8974
+ baseId: pickerId,
8975
+ open: isOpen,
8976
+ isMobile,
8977
+ label,
8978
+ title: mobileTitle ?? label,
8979
+ doneLabel,
8980
+ monthLabels: months.map((month) => monthLabels[month] ?? ""),
8981
+ days,
8982
+ years,
8983
+ monthIndex,
8984
+ dayIndex,
8985
+ yearIndex,
8986
+ monthScrollTop,
8987
+ dayScrollTop,
8988
+ yearScrollTop,
8989
+ monthListRef,
8990
+ dayListRef,
8991
+ yearListRef,
8992
+ onOpenChange: handleOpenChange,
8993
+ onDone: handleDone,
8994
+ onColumnScroll: handleColumnScroll,
8995
+ onColumnKeyDown: handleColumnKeyDown,
8996
+ onOptionSelect: handleOptionSelect
8997
+ }
8998
+ )
8999
+ ] });
9000
+ }
9001
+ );
9002
+ DatePicker.displayName = "DatePicker";
9003
+
9004
+ // src/responsive-sheet/ResponsiveSheet.tsx
9005
+ import { jsx as jsx122, jsxs as jsxs79 } from "react/jsx-runtime";
9006
+ function ResponsiveSheet({
9007
+ open,
9008
+ onClose,
9009
+ title,
9010
+ description,
9011
+ children,
8852
9012
  className,
8853
- name,
8854
- minDate,
8855
- maxDate,
8856
- locale = "en-US",
8857
- mobileTitle,
8858
- doneLabel = "Done",
8859
- formatValue = formatDateValue
9013
+ contentClassName,
9014
+ dialogClassName,
9015
+ drawerClassName,
9016
+ titleClassName,
9017
+ descriptionClassName,
9018
+ showCloseButton = true,
9019
+ showDrawerHandle = true,
9020
+ closeOnOverlayClick = true,
9021
+ closeOnEscape = true
8860
9022
  }) {
8861
- const { isMatch: isMobile } = useScreenResize(DEVICE.mobileXL);
8862
- const [isOpen, setIsOpen] = React30.useState(false);
8863
- const triggerId = React30.useId();
8864
- const pickerId = React30.useId();
8865
- const labelId = React30.useId();
8866
- const valueId = React30.useId();
8867
- const helperTextId = React30.useId();
8868
- const errorId = React30.useId();
8869
- const triggerRef = React30.useRef(null);
8870
- const monthLabels = React30.useMemo(() => getMonthLabels(locale), [locale]);
8871
- const resolvedMinDate = React30.useMemo(() => minDate ?? DEFAULT_MIN_DATE, [minDate]);
8872
- const resolvedMaxDate = React30.useMemo(() => maxDate ?? /* @__PURE__ */ new Date(), [maxDate]);
8873
- const resolvedValue = React30.useMemo(
8874
- () => value ? clampDate(value, resolvedMinDate, resolvedMaxDate) : null,
8875
- [resolvedMaxDate, resolvedMinDate, value]
8876
- );
8877
- const hasValue = Boolean(resolvedValue);
8878
- const {
8879
- dayIndex,
8880
- dayListRef,
8881
- dayScrollTop,
8882
- days,
8883
- draftDate,
8884
- handleColumnKeyDown,
8885
- handleColumnScroll,
8886
- handleOptionSelect,
8887
- monthIndex,
8888
- monthListRef,
8889
- months,
8890
- monthScrollTop,
8891
- yearIndex,
8892
- yearListRef,
8893
- yearScrollTop,
8894
- years
8895
- } = useDatePickerWheel({
8896
- isOpen,
8897
- value: resolvedValue,
8898
- defaultValue,
8899
- minDate: resolvedMinDate,
8900
- maxDate: resolvedMaxDate
8901
- });
8902
- const handleOpenChange = React30.useCallback((nextOpen) => {
8903
- setIsOpen(nextOpen);
9023
+ const { isMatch: isMobile } = useScreenResize(DEVICE.laptop);
9024
+ const isMobileMode = isMobile && isMobileModalModeAvailable();
9025
+ const handleOpenChange = (nextOpen) => {
8904
9026
  if (!nextOpen) {
8905
- triggerRef.current?.focus();
9027
+ onClose();
9028
+ }
9029
+ };
9030
+ const handleInteractOutside = (event) => {
9031
+ if (!closeOnOverlayClick) {
9032
+ event.preventDefault();
9033
+ }
9034
+ };
9035
+ const handleEscapeKeyDown = (event) => {
9036
+ if (!closeOnEscape) {
9037
+ event.preventDefault();
9038
+ }
9039
+ };
9040
+ const content = /* @__PURE__ */ jsxs79(
9041
+ "div",
9042
+ {
9043
+ className: cn(
9044
+ "flex w-full flex-col px-6 pb-6 pt-4 sm:px-8 sm:pb-8 sm:pt-8",
9045
+ contentClassName
9046
+ ),
9047
+ children: [
9048
+ title ? /* @__PURE__ */ jsx122(
9049
+ "div",
9050
+ {
9051
+ className: cn(
9052
+ "text-center text-[20px] font-semibold leading-7",
9053
+ titleClassName
9054
+ ),
9055
+ children: title
9056
+ }
9057
+ ) : null,
9058
+ description ? /* @__PURE__ */ jsx122(
9059
+ "p",
9060
+ {
9061
+ className: cn(
9062
+ "mt-3 text-center text-[14px] leading-6 text-[var(--primary)]/70",
9063
+ descriptionClassName
9064
+ ),
9065
+ children: description
9066
+ }
9067
+ ) : null,
9068
+ children
9069
+ ]
8906
9070
  }
8907
- }, []);
8908
- const handleDone = React30.useCallback(() => {
8909
- onChange(clampDate(draftDate, resolvedMinDate, resolvedMaxDate));
8910
- handleOpenChange(false);
8911
- }, [draftDate, handleOpenChange, onChange, resolvedMaxDate, resolvedMinDate]);
8912
- const handleTriggerClick = React30.useCallback(() => {
8913
- if (disabled) return;
8914
- setIsOpen(true);
8915
- }, [disabled]);
8916
- const handleTriggerKeyDown = React30.useCallback(
8917
- (event) => {
8918
- if (disabled) return;
8919
- if (event.key === "ArrowDown" || event.key === "ArrowUp" || event.key === "Enter" || event.key === " ") {
8920
- event.preventDefault();
8921
- setIsOpen(true);
8922
- }
8923
- },
8924
- [disabled]
8925
9071
  );
8926
- return /* @__PURE__ */ jsxs78("div", { className: cn("relative w-full max-w-[480px]", className), children: [
8927
- name && /* @__PURE__ */ jsx121(
8928
- "input",
8929
- {
8930
- type: "hidden",
8931
- name,
8932
- value: resolvedValue ? formatDateInputValue(resolvedValue) : ""
8933
- }
8934
- ),
8935
- /* @__PURE__ */ jsx121(
8936
- FieldTrigger,
8937
- {
8938
- id: triggerId,
8939
- ref: triggerRef,
8940
- variant,
8941
- label,
8942
- topLabel,
8943
- labelId,
8944
- valueId: hasValue ? valueId : void 0,
8945
- helperTextId: !hasValue ? helperTextId : void 0,
8946
- errorId: error ? errorId : void 0,
8947
- describedBy: error ? errorId : void 0,
8948
- labelText: topLabel ? placeholder : void 0,
8949
- valueText: resolvedValue ? formatValue(resolvedValue) : void 0,
8950
- placeholder,
8951
- disabled,
8952
- error,
8953
- "aria-haspopup": "dialog",
8954
- "aria-expanded": isOpen,
8955
- onClick: handleTriggerClick,
8956
- onKeyDown: handleTriggerKeyDown,
8957
- trailingAdornment: /* @__PURE__ */ jsx121(Calendar2, { className: "h-5 w-5 text-[#1F1F1B]", strokeWidth: 2 })
8958
- }
8959
- ),
8960
- /* @__PURE__ */ jsx121(
8961
- DatePickerContent,
9072
+ if (isMobileMode) {
9073
+ return /* @__PURE__ */ jsx122(Drawer, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxs79(
9074
+ DrawerContent,
8962
9075
  {
8963
- baseId: pickerId,
8964
- open: isOpen,
8965
- isMobile,
8966
- label,
8967
- title: mobileTitle ?? label,
8968
- doneLabel,
8969
- monthLabels: months.map((month) => monthLabels[month] ?? ""),
8970
- days,
8971
- years,
8972
- monthIndex,
8973
- dayIndex,
8974
- yearIndex,
8975
- monthScrollTop,
8976
- dayScrollTop,
8977
- yearScrollTop,
8978
- monthListRef,
8979
- dayListRef,
8980
- yearListRef,
8981
- onOpenChange: handleOpenChange,
8982
- onDone: handleDone,
8983
- onColumnScroll: handleColumnScroll,
8984
- onColumnKeyDown: handleColumnKeyDown,
8985
- onOptionSelect: handleOptionSelect
9076
+ onClose,
9077
+ showHandle: showDrawerHandle,
9078
+ closeOnOverlayClick,
9079
+ lockScroll: false,
9080
+ onEscapeKeyDown: handleEscapeKeyDown,
9081
+ className: cn(className, drawerClassName),
9082
+ children: [
9083
+ title ? /* @__PURE__ */ jsx122(DrawerTitle, { className: "sr-only", children: title }) : null,
9084
+ description ? /* @__PURE__ */ jsx122(DrawerDescription, { className: "sr-only", children: description }) : null,
9085
+ content
9086
+ ]
8986
9087
  }
8987
- )
8988
- ] });
9088
+ ) });
9089
+ }
9090
+ return /* @__PURE__ */ jsx122(Dialog, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxs79(
9091
+ DialogContent,
9092
+ {
9093
+ showCloseButton,
9094
+ onPointerDownOutside: handleInteractOutside,
9095
+ onInteractOutside: handleInteractOutside,
9096
+ onEscapeKeyDown: handleEscapeKeyDown,
9097
+ className: cn(
9098
+ "max-w-[560px] rounded-[28px] border-0 p-0 shadow-xl",
9099
+ className,
9100
+ dialogClassName
9101
+ ),
9102
+ lockScroll: false,
9103
+ children: [
9104
+ title ? /* @__PURE__ */ jsx122(DialogTitle, { className: "sr-only", children: title }) : null,
9105
+ description ? /* @__PURE__ */ jsx122(DialogDescription, { className: "sr-only", children: description }) : null,
9106
+ content
9107
+ ]
9108
+ }
9109
+ ) });
8989
9110
  }
8990
9111
 
8991
9112
  // src/airbnb/input/Input.tsx
8992
9113
  import * as React31 from "react";
8993
- import { jsx as jsx122 } from "react/jsx-runtime";
9114
+ import { jsx as jsx123 } from "react/jsx-runtime";
8994
9115
  var getInputValue = (value) => value != null ? String(value) : "";
8995
9116
  var AirbnbInput = React31.forwardRef(
8996
9117
  ({
@@ -9065,7 +9186,7 @@ var AirbnbInput = React31.forwardRef(
9065
9186
  setIsFocused(false);
9066
9187
  onBlur?.(event);
9067
9188
  };
9068
- return /* @__PURE__ */ jsx122("div", { className: cn("w-full", wrapperClassName), children: /* @__PURE__ */ jsx122(
9189
+ return /* @__PURE__ */ jsx123("div", { className: cn("w-full", wrapperClassName), children: /* @__PURE__ */ jsx123(
9069
9190
  FieldTrigger,
9070
9191
  {
9071
9192
  as: "div",
@@ -9093,7 +9214,7 @@ var AirbnbInput = React31.forwardRef(
9093
9214
  trailingAdornment,
9094
9215
  forceFloatingLabel: shouldShowLabel,
9095
9216
  hideErrorMessage: !renderErrorMessage,
9096
- children: /* @__PURE__ */ jsx122(
9217
+ children: /* @__PURE__ */ jsx123(
9097
9218
  "input",
9098
9219
  {
9099
9220
  ...props,
@@ -9134,7 +9255,7 @@ import { ChevronDown as ChevronDown2 } from "lucide-react";
9134
9255
  import * as React36 from "react";
9135
9256
 
9136
9257
  // src/airbnb/select/SelectDesktopMenu.tsx
9137
- import { jsx as jsx123, jsxs as jsxs79 } from "react/jsx-runtime";
9258
+ import { jsx as jsx124, jsxs as jsxs80 } from "react/jsx-runtime";
9138
9259
  function SelectDesktopMenu({
9139
9260
  id,
9140
9261
  options,
@@ -9153,7 +9274,7 @@ function SelectDesktopMenu({
9153
9274
  noOptionsMessage
9154
9275
  }) {
9155
9276
  const emptyMessage = noOptionsMessage?.();
9156
- return /* @__PURE__ */ jsxs79(
9277
+ return /* @__PURE__ */ jsxs80(
9157
9278
  "div",
9158
9279
  {
9159
9280
  id,
@@ -9166,12 +9287,12 @@ function SelectDesktopMenu({
9166
9287
  onKeyDown,
9167
9288
  className: cn("max-h-[280px] overflow-y-auto p-2 outline-none", menuClassName),
9168
9289
  children: [
9169
- options.length === 0 && emptyMessage ? /* @__PURE__ */ jsx123("div", { className: "px-4 py-3 text-base leading-6 text-[#6C6C6C]", children: emptyMessage }) : null,
9290
+ options.length === 0 && emptyMessage ? /* @__PURE__ */ jsx124("div", { className: "px-4 py-3 text-base leading-6 text-[#6C6C6C]", children: emptyMessage }) : null,
9170
9291
  options.map((option, index) => {
9171
9292
  const isSelected = selectedValue?.value === option.value;
9172
9293
  const isHighlighted = index === highlightedIndex;
9173
9294
  const optionKey = `${String(option.value)}-${index}`;
9174
- return /* @__PURE__ */ jsx123(
9295
+ return /* @__PURE__ */ jsx124(
9175
9296
  "button",
9176
9297
  {
9177
9298
  id: getOptionId2(index),
@@ -9203,7 +9324,7 @@ function SelectDesktopMenu({
9203
9324
  }
9204
9325
 
9205
9326
  // src/airbnb/select/SelectDesktopContent.tsx
9206
- import { jsx as jsx124 } from "react/jsx-runtime";
9327
+ import { jsx as jsx125 } from "react/jsx-runtime";
9207
9328
  function SelectDesktopContent({
9208
9329
  isOpen,
9209
9330
  listboxId,
@@ -9224,14 +9345,14 @@ function SelectDesktopContent({
9224
9345
  noOptionsMessage
9225
9346
  }) {
9226
9347
  if (!isOpen) return null;
9227
- return /* @__PURE__ */ jsx124(
9348
+ return /* @__PURE__ */ jsx125(
9228
9349
  "div",
9229
9350
  {
9230
9351
  className: cn(
9231
9352
  "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)]",
9232
9353
  dropdownClassName
9233
9354
  ),
9234
- children: /* @__PURE__ */ jsx124(
9355
+ children: /* @__PURE__ */ jsx125(
9235
9356
  SelectDesktopMenu,
9236
9357
  {
9237
9358
  id: listboxId,
@@ -9329,7 +9450,7 @@ function getMobileOptionStyles(index, scrollTop) {
9329
9450
  }
9330
9451
 
9331
9452
  // src/airbnb/select/SelectMobileWheel.tsx
9332
- import { jsx as jsx125, jsxs as jsxs80 } from "react/jsx-runtime";
9453
+ import { jsx as jsx126, jsxs as jsxs81 } from "react/jsx-runtime";
9333
9454
  function SelectMobileWheel({
9334
9455
  id,
9335
9456
  options,
@@ -9348,7 +9469,7 @@ function SelectMobileWheel({
9348
9469
  }) {
9349
9470
  const spacerHeight2 = getWheelSpacerHeight();
9350
9471
  const emptyMessage = noOptionsMessage?.();
9351
- return /* @__PURE__ */ jsxs80(
9472
+ return /* @__PURE__ */ jsxs81(
9352
9473
  "div",
9353
9474
  {
9354
9475
  id,
@@ -9360,10 +9481,10 @@ function SelectMobileWheel({
9360
9481
  onKeyDown,
9361
9482
  className: cn("relative overflow-hidden outline-none", menuClassName),
9362
9483
  children: [
9363
- 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,
9364
- /* @__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" }),
9365
- /* @__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" }),
9366
- /* @__PURE__ */ jsx125(
9484
+ 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,
9485
+ /* @__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" }),
9486
+ /* @__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" }),
9487
+ /* @__PURE__ */ jsx126(
9367
9488
  "div",
9368
9489
  {
9369
9490
  "aria-hidden": true,
@@ -9373,7 +9494,7 @@ function SelectMobileWheel({
9373
9494
  )
9374
9495
  }
9375
9496
  ),
9376
- /* @__PURE__ */ jsxs80(
9497
+ /* @__PURE__ */ jsxs81(
9377
9498
  "div",
9378
9499
  {
9379
9500
  ref: listRef,
@@ -9388,11 +9509,11 @@ function SelectMobileWheel({
9388
9509
  WebkitOverflowScrolling: "touch"
9389
9510
  },
9390
9511
  children: [
9391
- /* @__PURE__ */ jsx125("div", { style: { height: `${spacerHeight2}px` } }),
9512
+ /* @__PURE__ */ jsx126("div", { style: { height: `${spacerHeight2}px` } }),
9392
9513
  options.map((option, index) => {
9393
9514
  const { distance, style } = getMobileOptionStyles(index, scrollTop);
9394
9515
  const optionKey = `${String(option.value)}-${index}`;
9395
- return /* @__PURE__ */ jsx125(
9516
+ return /* @__PURE__ */ jsx126(
9396
9517
  "button",
9397
9518
  {
9398
9519
  id: getOptionId2(index),
@@ -9413,7 +9534,7 @@ function SelectMobileWheel({
9413
9534
  optionKey
9414
9535
  );
9415
9536
  }),
9416
- /* @__PURE__ */ jsx125("div", { style: { height: `${spacerHeight2}px` } })
9537
+ /* @__PURE__ */ jsx126("div", { style: { height: `${spacerHeight2}px` } })
9417
9538
  ]
9418
9539
  }
9419
9540
  )
@@ -9423,7 +9544,7 @@ function SelectMobileWheel({
9423
9544
  }
9424
9545
 
9425
9546
  // src/airbnb/select/SelectMobileContent.tsx
9426
- import { jsx as jsx126, jsxs as jsxs81 } from "react/jsx-runtime";
9547
+ import { jsx as jsx127, jsxs as jsxs82 } from "react/jsx-runtime";
9427
9548
  function SelectMobileContent({
9428
9549
  open,
9429
9550
  onOpenChange,
@@ -9447,11 +9568,11 @@ function SelectMobileContent({
9447
9568
  getOptionId: getOptionId2,
9448
9569
  noOptionsMessage
9449
9570
  }) {
9450
- return /* @__PURE__ */ jsx126(Drawer, { open, onOpenChange, children: /* @__PURE__ */ jsxs81(DrawerContent, { onClose, lockScroll: false, children: [
9451
- /* @__PURE__ */ jsx126(DrawerTitle, { className: "sr-only", children: mobileTitle ?? label }),
9452
- /* @__PURE__ */ jsx126(DrawerDescription, { className: "sr-only", children: label }),
9453
- /* @__PURE__ */ jsxs81("div", { className: "px-6 pb-4 pt-1", children: [
9454
- /* @__PURE__ */ jsx126(
9571
+ return /* @__PURE__ */ jsx127(Drawer, { open, onOpenChange, children: /* @__PURE__ */ jsxs82(DrawerContent, { onClose, lockScroll: false, children: [
9572
+ /* @__PURE__ */ jsx127(DrawerTitle, { className: "sr-only", children: mobileTitle ?? label }),
9573
+ /* @__PURE__ */ jsx127(DrawerDescription, { className: "sr-only", children: label }),
9574
+ /* @__PURE__ */ jsxs82("div", { className: "px-6 pb-4 pt-1", children: [
9575
+ /* @__PURE__ */ jsx127(
9455
9576
  SelectMobileWheel,
9456
9577
  {
9457
9578
  id: listboxId,
@@ -9470,7 +9591,7 @@ function SelectMobileContent({
9470
9591
  noOptionsMessage
9471
9592
  }
9472
9593
  ),
9473
- /* @__PURE__ */ jsx126(Button, { type: "button", onClick: onDone, className: "mt-4 h-12 mb-8 w-full", children: doneLabel })
9594
+ /* @__PURE__ */ jsx127(Button, { type: "button", onClick: onDone, className: "mt-4 h-12 mb-8 w-full", children: doneLabel })
9474
9595
  ] })
9475
9596
  ] }) });
9476
9597
  }
@@ -9478,7 +9599,7 @@ function SelectMobileContent({
9478
9599
  // src/airbnb/select/SelectTrigger.tsx
9479
9600
  import * as React32 from "react";
9480
9601
  import { ChevronDown } from "lucide-react";
9481
- import { jsx as jsx127 } from "react/jsx-runtime";
9602
+ import { jsx as jsx128 } from "react/jsx-runtime";
9482
9603
  var SelectTrigger2 = React32.forwardRef(
9483
9604
  ({
9484
9605
  id,
@@ -9500,7 +9621,7 @@ var SelectTrigger2 = React32.forwardRef(
9500
9621
  onClick,
9501
9622
  onKeyDown
9502
9623
  }, ref) => {
9503
- return /* @__PURE__ */ jsx127(
9624
+ return /* @__PURE__ */ jsx128(
9504
9625
  FieldTrigger,
9505
9626
  {
9506
9627
  id,
@@ -9524,7 +9645,7 @@ var SelectTrigger2 = React32.forwardRef(
9524
9645
  disabled,
9525
9646
  onClick,
9526
9647
  onKeyDown,
9527
- trailingAdornment: /* @__PURE__ */ jsx127(
9648
+ trailingAdornment: /* @__PURE__ */ jsx128(
9528
9649
  ChevronDown,
9529
9650
  {
9530
9651
  className: open ? "h-6 w-6 rotate-180 text-[#1F1F1B] transition-transform" : "h-6 w-6 text-[#1F1F1B] transition-transform"
@@ -9886,9 +10007,9 @@ function useSelectIds({ name, hasValue, error, hideErrorMessage }) {
9886
10007
  }
9887
10008
 
9888
10009
  // src/lib/use-outside-click.ts
9889
- import { useCallback as useCallback18, useEffect as useEffect16, useRef as useRef15 } from "react";
10010
+ import { useCallback as useCallback18, useEffect as useEffect16, useRef as useRef16 } from "react";
9890
10011
  function useOutsideClick(elementRef, onOutsideClick, nested) {
9891
- const handleOutsideClick = useRef15(onOutsideClick);
10012
+ const handleOutsideClick = useRef16(onOutsideClick);
9892
10013
  handleOutsideClick.current = onOutsideClick;
9893
10014
  const checkNestedElements = useCallback18(
9894
10015
  (event) => {
@@ -9938,8 +10059,8 @@ function useOutsideClick(elementRef, onOutsideClick, nested) {
9938
10059
  }
9939
10060
 
9940
10061
  // src/airbnb/select/Select.tsx
9941
- import { jsx as jsx128, jsxs as jsxs82 } from "react/jsx-runtime";
9942
- function AirbnbSelect({
10062
+ import { jsx as jsx129, jsxs as jsxs83 } from "react/jsx-runtime";
10063
+ var AirbnbSelect = React36.forwardRef(function AirbnbSelect2({
9943
10064
  options,
9944
10065
  value,
9945
10066
  onChange,
@@ -9959,7 +10080,7 @@ function AirbnbSelect({
9959
10080
  mobileTitle,
9960
10081
  name,
9961
10082
  noOptionsMessage
9962
- }) {
10083
+ }, ref) {
9963
10084
  const { isMatch: isMobile } = useScreenResize(DEVICE.mobileXL);
9964
10085
  const [isOpen, setIsOpen] = React36.useState(false);
9965
10086
  const containerRef = React36.useRef(null);
@@ -9997,7 +10118,7 @@ function AirbnbSelect({
9997
10118
  listRef: desktopListRef,
9998
10119
  setHighlightedIndex,
9999
10120
  setOptionRef,
10000
- triggerRef,
10121
+ triggerRef: desktopTriggerRef,
10001
10122
  focusTrigger,
10002
10123
  handleSelect: handleDesktopSelect,
10003
10124
  handleMenuKeyDown,
@@ -10010,6 +10131,7 @@ function AirbnbSelect({
10010
10131
  disabled,
10011
10132
  onChange
10012
10133
  });
10134
+ const combinedRef = useCombinedRef(ref, desktopTriggerRef);
10013
10135
  const activeMobileIndex = getOptionIndex(options, pendingValue);
10014
10136
  const valueLabel = value ? getValueLabel?.(value) ?? String(value.label) : void 0;
10015
10137
  useOutsideClick(containerRef, isOpen && !isMobile ? () => setIsOpen(false) : null);
@@ -10096,8 +10218,8 @@ function AirbnbSelect({
10096
10218
  handleMobileOpenChange(false);
10097
10219
  }
10098
10220
  };
10099
- return /* @__PURE__ */ jsxs82("div", { ref: containerRef, className: cn("relative w-full max-w-[480px]", className), children: [
10100
- name && /* @__PURE__ */ jsx128("input", { type: "hidden", name, value: value ? String(value.value) : "" }),
10221
+ return /* @__PURE__ */ jsxs83("div", { ref: containerRef, className: cn("relative w-full max-w-[425px]", className), children: [
10222
+ name && /* @__PURE__ */ jsx129("input", { type: "hidden", name, value: value ? String(value.value) : "" }),
10101
10223
  renderTrigger ? renderTrigger({
10102
10224
  id: triggerId,
10103
10225
  open: isOpen,
@@ -10111,14 +10233,14 @@ function AirbnbSelect({
10111
10233
  error,
10112
10234
  listboxId,
10113
10235
  describedBy,
10114
- triggerRef,
10236
+ triggerRef: combinedRef,
10115
10237
  onClick: handleTriggerClick,
10116
10238
  onKeyDown: handleRootTriggerKeyDown
10117
- }) : /* @__PURE__ */ jsx128(
10239
+ }) : /* @__PURE__ */ jsx129(
10118
10240
  SelectTrigger2,
10119
10241
  {
10120
10242
  id: triggerId,
10121
- ref: triggerRef,
10243
+ ref: combinedRef,
10122
10244
  open: isOpen,
10123
10245
  variant,
10124
10246
  label,
@@ -10138,7 +10260,7 @@ function AirbnbSelect({
10138
10260
  onKeyDown: handleRootTriggerKeyDown
10139
10261
  }
10140
10262
  ),
10141
- isMobile ? /* @__PURE__ */ jsx128(
10263
+ isMobile ? /* @__PURE__ */ jsx129(
10142
10264
  SelectMobileContent,
10143
10265
  {
10144
10266
  open: isOpen,
@@ -10163,7 +10285,7 @@ function AirbnbSelect({
10163
10285
  getOptionId: getOptionId2,
10164
10286
  noOptionsMessage
10165
10287
  }
10166
- ) : /* @__PURE__ */ jsx128(
10288
+ ) : /* @__PURE__ */ jsx129(
10167
10289
  SelectDesktopContent,
10168
10290
  {
10169
10291
  isOpen,
@@ -10192,172 +10314,176 @@ function AirbnbSelect({
10192
10314
  }
10193
10315
  )
10194
10316
  ] });
10195
- }
10317
+ });
10196
10318
 
10197
10319
  // src/airbnb/phone-field/PhoneField.tsx
10198
- import { jsx as jsx129, jsxs as jsxs83 } from "react/jsx-runtime";
10199
- function PhoneField({
10200
- variant = "default",
10201
- label,
10202
- topLabel,
10203
- value,
10204
- onChange,
10205
- options,
10206
- placeholder = "Phone number",
10207
- disabled,
10208
- error,
10209
- className,
10210
- name,
10211
- codeName,
10212
- numberName,
10213
- mobileTitle,
10214
- codePlaceholder = "+00"
10215
- }) {
10216
- const inputId = React37.useId();
10217
- const codeOptions = React37.useMemo(
10218
- () => options.map((option) => ({
10219
- value: option.value,
10220
- label: option.label,
10221
- disabled: option.disabled
10222
- })),
10223
- [options]
10224
- );
10225
- const selectedCodeOption = React37.useMemo(
10226
- () => codeOptions.find((option) => option.value === value?.code) ?? null,
10227
- [codeOptions, value?.code]
10228
- );
10229
- const combinedValue = value?.code || value?.number ? `${value?.code ?? ""}${value?.number ?? ""}` : "";
10230
- return /* @__PURE__ */ jsxs83("div", { className: cn("w-full max-w-[480px]", className), children: [
10231
- name && /* @__PURE__ */ jsx129("input", { type: "hidden", name, value: combinedValue, disabled }),
10232
- codeName && /* @__PURE__ */ jsx129(
10233
- "input",
10234
- {
10235
- type: "hidden",
10236
- name: codeName,
10237
- value: value?.code ?? "",
10238
- disabled
10239
- }
10240
- ),
10241
- numberName && /* @__PURE__ */ jsx129(
10242
- "input",
10243
- {
10244
- type: "hidden",
10245
- name: numberName,
10246
- value: value?.number ?? "",
10247
- disabled
10248
- }
10249
- ),
10250
- topLabel && /* @__PURE__ */ jsx129(
10251
- "label",
10252
- {
10253
- htmlFor: inputId,
10254
- className: "mb-3 block text-[16px] font-medium leading-5 text-[#1F1F1B]",
10255
- children: topLabel
10256
- }
10257
- ),
10258
- /* @__PURE__ */ jsxs83("div", { className: "flex items-stretch", children: [
10259
- /* @__PURE__ */ jsx129(
10260
- AirbnbSelect,
10320
+ import { jsx as jsx130, jsxs as jsxs84 } from "react/jsx-runtime";
10321
+ var PhoneField = React37.forwardRef(
10322
+ ({
10323
+ variant = "default",
10324
+ label,
10325
+ topLabel,
10326
+ value,
10327
+ onChange,
10328
+ options,
10329
+ placeholder = "Phone number",
10330
+ disabled,
10331
+ error,
10332
+ className,
10333
+ name,
10334
+ codeName,
10335
+ numberName,
10336
+ mobileTitle,
10337
+ codePlaceholder = "+00"
10338
+ }, ref) => {
10339
+ const inputId = React37.useId();
10340
+ const codeOptions = React37.useMemo(
10341
+ () => options.map((option) => ({
10342
+ value: option.value,
10343
+ label: option.label,
10344
+ disabled: option.disabled
10345
+ })),
10346
+ [options]
10347
+ );
10348
+ const selectedCodeOption = React37.useMemo(
10349
+ () => codeOptions.find((option) => option.value === value?.code) ?? null,
10350
+ [codeOptions, value?.code]
10351
+ );
10352
+ const combinedValue = value?.code || value?.number ? `${value?.code ?? ""}${value?.number ?? ""}` : "";
10353
+ return /* @__PURE__ */ jsxs84("div", { className: cn("w-full max-w-[425px]", className), children: [
10354
+ name && /* @__PURE__ */ jsx130("input", { type: "hidden", name, value: combinedValue, disabled }),
10355
+ codeName && /* @__PURE__ */ jsx130(
10356
+ "input",
10261
10357
  {
10262
- variant,
10263
- options: codeOptions,
10264
- value: selectedCodeOption,
10265
- onChange: (option) => onChange({
10266
- code: String(option.value),
10267
- number: value?.number ?? ""
10268
- }),
10269
- label: `${label} country code`,
10270
- placeholder: codePlaceholder,
10271
- disabled,
10272
- className: "max-w-none shrink-0 basis-[96px]",
10273
- mobileTitle: mobileTitle ?? "Select country code",
10274
- dropdownClassName: "right-auto w-[280px]",
10275
- getValueLabel: (option) => String(option.value),
10276
- renderTrigger: ({
10277
- id,
10278
- open,
10279
- variant: selectVariant,
10280
- disabled: triggerDisabled,
10281
- listboxId,
10282
- triggerRef,
10283
- onClick,
10284
- onKeyDown,
10285
- valueLabel
10286
- }) => /* @__PURE__ */ jsxs83(
10287
- "button",
10288
- {
10289
- id,
10290
- ref: triggerRef,
10291
- type: "button",
10292
- "aria-label": `${label} country code`,
10293
- "aria-haspopup": "listbox",
10294
- "aria-expanded": open,
10295
- "aria-controls": listboxId,
10296
- disabled: triggerDisabled,
10297
- onClick,
10298
- onKeyDown,
10299
- className: cn(
10300
- "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",
10301
- 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]",
10302
- 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]",
10303
- triggerDisabled ? "cursor-not-allowed opacity-50" : "cursor-pointer"
10304
- ),
10305
- children: [
10306
- /* @__PURE__ */ jsx129("span", { children: valueLabel ?? codePlaceholder }),
10307
- /* @__PURE__ */ jsx129(
10308
- ChevronDown2,
10309
- {
10310
- className: cn("h-5 w-5 transition-transform", open ? "rotate-180" : ""),
10311
- strokeWidth: 2
10312
- }
10313
- )
10314
- ]
10315
- }
10316
- )
10358
+ type: "hidden",
10359
+ name: codeName,
10360
+ value: value?.code ?? "",
10361
+ disabled
10317
10362
  }
10318
10363
  ),
10319
- /* @__PURE__ */ jsx129(
10320
- AirbnbInput,
10364
+ numberName && /* @__PURE__ */ jsx130(
10365
+ "input",
10321
10366
  {
10322
- id: inputId,
10323
- variant,
10324
- type: "tel",
10325
- inputMode: "tel",
10326
- label,
10327
- helperText: placeholder,
10367
+ type: "hidden",
10368
+ name: numberName,
10328
10369
  value: value?.number ?? "",
10329
- placeholder,
10330
- disabled,
10331
- error,
10332
- renderErrorMessage: false,
10333
- wrapperClassName: "min-w-0 flex-1",
10334
- fieldClassName: cn(
10335
- variant === "airbnb" ? "min-h-[60px] rounded-l-none rounded-r-[16px] border-l-0" : "rounded-l-none rounded-r-[10px] border-l-0"
10336
- ),
10337
- contentClassName: cn(variant === "airbnb" ? "h-[40px] py-2" : "h-[48px]"),
10338
- inputClassName: "text-[16px] leading-7",
10339
- onChange: (event) => onChange({
10340
- code: value?.code ?? "",
10341
- number: event.target.value
10342
- })
10370
+ disabled
10343
10371
  }
10344
- )
10345
- ] }),
10346
- error && /* @__PURE__ */ jsx129(FieldErrorMessage, { message: error })
10347
- ] });
10348
- }
10372
+ ),
10373
+ topLabel && /* @__PURE__ */ jsx130(
10374
+ "label",
10375
+ {
10376
+ htmlFor: inputId,
10377
+ className: "mb-3 block text-[16px] font-medium leading-5 text-[#1F1F1B]",
10378
+ children: topLabel
10379
+ }
10380
+ ),
10381
+ /* @__PURE__ */ jsxs84("div", { className: "flex items-stretch", children: [
10382
+ /* @__PURE__ */ jsx130(
10383
+ AirbnbSelect,
10384
+ {
10385
+ ref,
10386
+ variant,
10387
+ options: codeOptions,
10388
+ value: selectedCodeOption,
10389
+ onChange: (option) => onChange({
10390
+ code: String(option.value),
10391
+ number: value?.number ?? ""
10392
+ }),
10393
+ label: `${label} country code`,
10394
+ placeholder: codePlaceholder,
10395
+ disabled,
10396
+ className: "max-w-none shrink-0 basis-[96px]",
10397
+ mobileTitle: mobileTitle ?? "Select country code",
10398
+ dropdownClassName: "right-auto w-[280px]",
10399
+ getValueLabel: (option) => String(option.value),
10400
+ renderTrigger: ({
10401
+ id,
10402
+ open,
10403
+ variant: selectVariant,
10404
+ disabled: triggerDisabled,
10405
+ listboxId,
10406
+ triggerRef,
10407
+ onClick,
10408
+ onKeyDown,
10409
+ valueLabel
10410
+ }) => /* @__PURE__ */ jsxs84(
10411
+ "button",
10412
+ {
10413
+ id,
10414
+ ref: triggerRef,
10415
+ type: "button",
10416
+ "aria-label": `${label} country code`,
10417
+ "aria-haspopup": "listbox",
10418
+ "aria-expanded": open,
10419
+ "aria-controls": listboxId,
10420
+ disabled: triggerDisabled,
10421
+ onClick,
10422
+ onKeyDown,
10423
+ className: cn(
10424
+ "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",
10425
+ 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]",
10426
+ 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]",
10427
+ triggerDisabled ? "cursor-not-allowed opacity-50" : "cursor-pointer"
10428
+ ),
10429
+ children: [
10430
+ /* @__PURE__ */ jsx130("span", { children: valueLabel ?? codePlaceholder }),
10431
+ /* @__PURE__ */ jsx130(
10432
+ ChevronDown2,
10433
+ {
10434
+ className: cn("h-5 w-5 transition-transform", open ? "rotate-180" : ""),
10435
+ strokeWidth: 2
10436
+ }
10437
+ )
10438
+ ]
10439
+ }
10440
+ )
10441
+ }
10442
+ ),
10443
+ /* @__PURE__ */ jsx130(
10444
+ AirbnbInput,
10445
+ {
10446
+ id: inputId,
10447
+ variant,
10448
+ type: "tel",
10449
+ inputMode: "tel",
10450
+ label,
10451
+ helperText: placeholder,
10452
+ value: value?.number ?? "",
10453
+ placeholder,
10454
+ disabled,
10455
+ error,
10456
+ renderErrorMessage: false,
10457
+ wrapperClassName: "min-w-0 flex-1",
10458
+ fieldClassName: cn(
10459
+ variant === "airbnb" ? "min-h-[60px] rounded-l-none rounded-r-[16px] border-l-0" : "rounded-l-none rounded-r-[10px] border-l-0"
10460
+ ),
10461
+ contentClassName: cn(variant === "airbnb" ? "h-[40px] py-2" : "h-[48px]"),
10462
+ inputClassName: "text-[16px] leading-7",
10463
+ onChange: (event) => onChange({
10464
+ code: value?.code ?? "",
10465
+ number: event.target.value
10466
+ })
10467
+ }
10468
+ )
10469
+ ] }),
10470
+ error && /* @__PURE__ */ jsx130(FieldErrorMessage, { message: error })
10471
+ ] });
10472
+ }
10473
+ );
10474
+ PhoneField.displayName = "PhoneField";
10349
10475
 
10350
10476
  // src/airbnb/search-input/SearchInput.tsx
10351
10477
  import * as React38 from "react";
10352
10478
  import { useTranslation as useTranslation22 } from "react-i18next";
10353
10479
  import { Search as Search3, X as X8 } from "lucide-react";
10354
- import { jsx as jsx130, jsxs as jsxs84 } from "react/jsx-runtime";
10480
+ import { jsx as jsx131, jsxs as jsxs85 } from "react/jsx-runtime";
10355
10481
  var AirbnbSearchInput = React38.forwardRef(({ onReset, placeholder, wrapperClassName, ...props }, ref) => {
10356
10482
  const { t } = useTranslation22();
10357
10483
  const placeholderText = placeholder || t("search_property") + "...";
10358
- return /* @__PURE__ */ jsxs84("div", { className: cn("input-wrapper relative", wrapperClassName), children: [
10359
- /* @__PURE__ */ jsx130(Search3, { className: "absolute left-4 top-1/2 h-5 w-5 -translate-y-1/2 transform text-[#9696B9]" }),
10360
- /* @__PURE__ */ jsx130(
10484
+ return /* @__PURE__ */ jsxs85("div", { className: cn("input-wrapper relative", wrapperClassName), children: [
10485
+ /* @__PURE__ */ jsx131(Search3, { className: "absolute left-4 top-1/2 h-5 w-5 -translate-y-1/2 transform text-[#9696B9]" }),
10486
+ /* @__PURE__ */ jsx131(
10361
10487
  "input",
10362
10488
  {
10363
10489
  ...props,
@@ -10376,13 +10502,13 @@ var AirbnbSearchInput = React38.forwardRef(({ onReset, placeholder, wrapperClass
10376
10502
  )
10377
10503
  }
10378
10504
  ),
10379
- onReset && /* @__PURE__ */ jsx130(
10505
+ onReset && /* @__PURE__ */ jsx131(
10380
10506
  Button,
10381
10507
  {
10382
10508
  variant: "ghost",
10383
10509
  onClick: onReset,
10384
10510
  className: "absolute right-0 top-1/2 h-5 w-5 -translate-y-1/2 transform text-[#9696B9]",
10385
- children: /* @__PURE__ */ jsx130(X8, { className: "h-5 w-5" })
10511
+ children: /* @__PURE__ */ jsx131(X8, { className: "h-5 w-5" })
10386
10512
  }
10387
10513
  )
10388
10514
  ] });
@@ -10393,7 +10519,7 @@ AirbnbSearchInput.displayName = "SearchInput";
10393
10519
  import * as React39 from "react";
10394
10520
  import { ChevronDown as ChevronDown3, Search as Search4 } from "lucide-react";
10395
10521
  import { useVirtualizer } from "@tanstack/react-virtual";
10396
- import { jsx as jsx131, jsxs as jsxs85 } from "react/jsx-runtime";
10522
+ import { jsx as jsx132, jsxs as jsxs86 } from "react/jsx-runtime";
10397
10523
  var ROW_HEIGHT = 48;
10398
10524
  var DESKTOP_LIST_HEIGHT = 280;
10399
10525
  var MOBILE_LIST_HEIGHT = 420;
@@ -10544,7 +10670,7 @@ var SearchableSelectInternal = ({
10544
10670
  }
10545
10671
  }
10546
10672
  }
10547
- const content = /* @__PURE__ */ jsx131(
10673
+ const content = /* @__PURE__ */ jsx132(
10548
10674
  SearchableSelectContent,
10549
10675
  {
10550
10676
  inputId: searchInputId,
@@ -10572,9 +10698,9 @@ var SearchableSelectInternal = ({
10572
10698
  }
10573
10699
  );
10574
10700
  React39.useImperativeHandle(ref, () => triggerRef.current, []);
10575
- return /* @__PURE__ */ jsxs85("div", { ref: containerRef, className: cn("relative w-full max-w-[480px]", className), children: [
10576
- name && /* @__PURE__ */ jsx131("input", { type: "hidden", name, value: value ? String(value.value) : "" }),
10577
- /* @__PURE__ */ jsx131(
10701
+ return /* @__PURE__ */ jsxs86("div", { ref: containerRef, className: cn("relative w-full max-w-[425px]", className), children: [
10702
+ name && /* @__PURE__ */ jsx132("input", { type: "hidden", name, value: value ? String(value.value) : "" }),
10703
+ /* @__PURE__ */ jsx132(
10578
10704
  FieldTrigger,
10579
10705
  {
10580
10706
  id: `${reactId}-trigger`,
@@ -10604,7 +10730,7 @@ var SearchableSelectInternal = ({
10604
10730
  openSelect();
10605
10731
  },
10606
10732
  onKeyDown: handleTriggerKeyDown,
10607
- trailingAdornment: /* @__PURE__ */ jsx131(
10733
+ trailingAdornment: /* @__PURE__ */ jsx132(
10608
10734
  ChevronDown3,
10609
10735
  {
10610
10736
  className: cn(
@@ -10615,7 +10741,7 @@ var SearchableSelectInternal = ({
10615
10741
  )
10616
10742
  }
10617
10743
  ),
10618
- isMobile ? /* @__PURE__ */ jsx131(
10744
+ isMobile ? /* @__PURE__ */ jsx132(
10619
10745
  Drawer,
10620
10746
  {
10621
10747
  open,
@@ -10626,13 +10752,13 @@ var SearchableSelectInternal = ({
10626
10752
  }
10627
10753
  closeSelect();
10628
10754
  },
10629
- children: /* @__PURE__ */ jsxs85(DrawerContent, { onClose: closeSelect, lockScroll: false, children: [
10630
- /* @__PURE__ */ jsx131(DrawerTitle, { className: "sr-only", children: mobileTitle ?? label }),
10631
- /* @__PURE__ */ jsx131(DrawerDescription, { className: "sr-only", children: label }),
10632
- /* @__PURE__ */ jsx131("div", { className: "px-5 pb-5 pt-1", children: content })
10755
+ children: /* @__PURE__ */ jsxs86(DrawerContent, { onClose: closeSelect, lockScroll: false, children: [
10756
+ /* @__PURE__ */ jsx132(DrawerTitle, { className: "sr-only", children: mobileTitle ?? label }),
10757
+ /* @__PURE__ */ jsx132(DrawerDescription, { className: "sr-only", children: label }),
10758
+ /* @__PURE__ */ jsx132("div", { className: "px-5 pb-5 pt-1", children: content })
10633
10759
  ] })
10634
10760
  }
10635
- ) : open ? /* @__PURE__ */ jsx131(
10761
+ ) : open ? /* @__PURE__ */ jsx132(
10636
10762
  "div",
10637
10763
  {
10638
10764
  className: cn(
@@ -10699,16 +10825,16 @@ function SearchableSelectContent({
10699
10825
  virtualizer.scrollToIndex(highlightedIndex, { align: "auto" });
10700
10826
  }
10701
10827
  }, [highlightedIndex, virtualizer]);
10702
- return /* @__PURE__ */ jsxs85("div", { className: "p-2", children: [
10703
- /* @__PURE__ */ jsxs85("div", { className: "relative mb-2", children: [
10704
- /* @__PURE__ */ jsx131(
10828
+ return /* @__PURE__ */ jsxs86("div", { className: "p-2", children: [
10829
+ /* @__PURE__ */ jsxs86("div", { className: "relative mb-2", children: [
10830
+ /* @__PURE__ */ jsx132(
10705
10831
  Search4,
10706
10832
  {
10707
10833
  "aria-hidden": "true",
10708
10834
  className: "absolute left-4 top-1/2 h-5 w-5 -translate-y-1/2 text-[#9696B9]"
10709
10835
  }
10710
10836
  ),
10711
- /* @__PURE__ */ jsx131(
10837
+ /* @__PURE__ */ jsx132(
10712
10838
  "input",
10713
10839
  {
10714
10840
  id: inputId,
@@ -10727,7 +10853,7 @@ function SearchableSelectContent({
10727
10853
  }
10728
10854
  )
10729
10855
  ] }),
10730
- loading && options.length === 0 ? /* @__PURE__ */ jsx131("div", { className: "px-4 py-5 text-center text-base leading-6 text-[#6C6C6C]", children: loadingText }) : options.length === 0 ? /* @__PURE__ */ jsx131("div", { className: "px-4 py-5 text-center text-base leading-6 text-[#6C6C6C]", children: emptyMessage }) : /* @__PURE__ */ jsx131(
10856
+ 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(
10731
10857
  "div",
10732
10858
  {
10733
10859
  id: listboxId,
@@ -10736,7 +10862,7 @@ function SearchableSelectContent({
10736
10862
  "aria-labelledby": labelId,
10737
10863
  className: cn("overflow-y-auto outline-none", menuClassName),
10738
10864
  style: { height: Math.min(height, rowCount * ROW_HEIGHT) },
10739
- children: /* @__PURE__ */ jsx131(
10865
+ children: /* @__PURE__ */ jsx132(
10740
10866
  "div",
10741
10867
  {
10742
10868
  className: "relative w-full",
@@ -10744,7 +10870,7 @@ function SearchableSelectContent({
10744
10870
  children: virtualItems.map((virtualItem) => {
10745
10871
  const option = options[virtualItem.index];
10746
10872
  if (!option) {
10747
- return /* @__PURE__ */ jsx131(
10873
+ return /* @__PURE__ */ jsx132(
10748
10874
  "div",
10749
10875
  {
10750
10876
  className: "absolute left-0 top-0 flex w-full items-center px-4 text-base leading-6 text-[#6C6C6C]",
@@ -10759,7 +10885,7 @@ function SearchableSelectContent({
10759
10885
  }
10760
10886
  const isSelected = value?.value === option.value;
10761
10887
  const isHighlighted = virtualItem.index === highlightedIndex;
10762
- return /* @__PURE__ */ jsx131(
10888
+ return /* @__PURE__ */ jsx132(
10763
10889
  "button",
10764
10890
  {
10765
10891
  id: getOptionId(idPrefix, virtualItem.index),
@@ -10781,7 +10907,7 @@ function SearchableSelectContent({
10781
10907
  height: `${virtualItem.size}px`,
10782
10908
  transform: `translateY(${virtualItem.start}px)`
10783
10909
  },
10784
- children: /* @__PURE__ */ jsx131("span", { className: "truncate text-center", children: String(option.label) })
10910
+ children: /* @__PURE__ */ jsx132("span", { className: "truncate text-center", children: String(option.label) })
10785
10911
  },
10786
10912
  `${String(option.value)}-${virtualItem.index}`
10787
10913
  );
@@ -10951,6 +11077,7 @@ export {
10951
11077
  RatingRadioGroup,
10952
11078
  RatingStars,
10953
11079
  RegistryIcon,
11080
+ ResponsiveSheet,
10954
11081
  RotateIcon,
10955
11082
  ScrollArea,
10956
11083
  ScrollBar,