@chekinapp/ui 0.2.3 → 0.2.5
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 +178 -117
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +48 -29
- package/dist/index.d.ts +48 -29
- package/dist/index.js +157 -97
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -9555,7 +9555,7 @@ function TooltipInfo({ content, className }) {
|
|
|
9555
9555
|
side: "right",
|
|
9556
9556
|
content,
|
|
9557
9557
|
contentClassName: "max-w-64",
|
|
9558
|
-
className: cn("text-[var(--
|
|
9558
|
+
className: cn("text-[var(--section-tooltip-color)]", className),
|
|
9559
9559
|
onClick: (event) => event.stopPropagation(),
|
|
9560
9560
|
label: typeof content === "string" ? content : "More information"
|
|
9561
9561
|
}
|
|
@@ -9595,19 +9595,19 @@ var Section = forwardRef38(
|
|
|
9595
9595
|
"div",
|
|
9596
9596
|
{
|
|
9597
9597
|
className: cn(
|
|
9598
|
-
"flex max-w-[85%] items-center text-lg font-bold text-[var(--
|
|
9598
|
+
"flex max-w-[85%] items-center text-lg font-bold text-[var(--section-title-color)] md:max-w-full",
|
|
9599
9599
|
size !== 0 /* L */ && "subsection-title",
|
|
9600
9600
|
titleClassName
|
|
9601
9601
|
),
|
|
9602
9602
|
children: [
|
|
9603
9603
|
title,
|
|
9604
9604
|
titleTooltip && /* @__PURE__ */ jsx98("div", { className: "ml-2.5", children: /* @__PURE__ */ jsx98(TooltipInfo, { content: titleTooltip }) }),
|
|
9605
|
-
linkContent && /* @__PURE__ */ jsx98("div", { className: "ml-6 text-sm font-semibold text-[var(--
|
|
9605
|
+
linkContent && /* @__PURE__ */ jsx98("div", { className: "ml-6 text-sm font-semibold text-[var(--section-link-color)] no-underline hover:opacity-70 active:opacity-100", children: linkContent })
|
|
9606
9606
|
]
|
|
9607
9607
|
}
|
|
9608
9608
|
),
|
|
9609
9609
|
subtitle && /* @__PURE__ */ jsxs60("div", { className: "w-full max-w-[720px] md:max-w-full", children: [
|
|
9610
|
-
/* @__PURE__ */ jsx98("div", { className: "inline text-base font-normal text-[var(--
|
|
9610
|
+
/* @__PURE__ */ jsx98("div", { className: "inline text-base font-normal text-[var(--section-subtitle-color)]", children: subtitle }),
|
|
9611
9611
|
subtitleTooltip && /* @__PURE__ */ jsx98("div", { className: "ml-1.5 inline-block align-text-top", children: /* @__PURE__ */ jsx98(TooltipInfo, { content: subtitleTooltip }) })
|
|
9612
9612
|
] })
|
|
9613
9613
|
] }),
|
|
@@ -19945,7 +19945,32 @@ import { Calendar as Calendar2 } from "lucide-react";
|
|
|
19945
19945
|
import * as React73 from "react";
|
|
19946
19946
|
import { Loader2 as Loader24 } from "lucide-react";
|
|
19947
19947
|
import { useTranslation as useTranslation42 } from "react-i18next";
|
|
19948
|
-
|
|
19948
|
+
|
|
19949
|
+
// src/airbnb-fields/field-helper-text/FieldHelperText.tsx
|
|
19950
|
+
import { jsx as jsx182 } from "react/jsx-runtime";
|
|
19951
|
+
function AirbnbFieldHelperText({
|
|
19952
|
+
id,
|
|
19953
|
+
helper,
|
|
19954
|
+
disabled,
|
|
19955
|
+
className
|
|
19956
|
+
}) {
|
|
19957
|
+
if (!helper) return null;
|
|
19958
|
+
return /* @__PURE__ */ jsx182(
|
|
19959
|
+
"p",
|
|
19960
|
+
{
|
|
19961
|
+
id,
|
|
19962
|
+
className: cn(
|
|
19963
|
+
"mt-2 text-[12px] font-normal leading-5 text-[var(--chekin-airbnb-gray-text)]",
|
|
19964
|
+
disabled && "opacity-50",
|
|
19965
|
+
className
|
|
19966
|
+
),
|
|
19967
|
+
children: helper
|
|
19968
|
+
}
|
|
19969
|
+
);
|
|
19970
|
+
}
|
|
19971
|
+
|
|
19972
|
+
// src/airbnb-fields/field-trigger/FieldTrigger.tsx
|
|
19973
|
+
import { Fragment as Fragment17, jsx as jsx183, jsxs as jsxs116 } from "react/jsx-runtime";
|
|
19949
19974
|
var AirbnbFieldTrigger = React73.forwardRef(
|
|
19950
19975
|
({
|
|
19951
19976
|
as = "button",
|
|
@@ -19959,6 +19984,7 @@ var AirbnbFieldTrigger = React73.forwardRef(
|
|
|
19959
19984
|
labelText,
|
|
19960
19985
|
valueText,
|
|
19961
19986
|
placeholder,
|
|
19987
|
+
helper,
|
|
19962
19988
|
disabled,
|
|
19963
19989
|
error,
|
|
19964
19990
|
loading,
|
|
@@ -19977,19 +20003,20 @@ var AirbnbFieldTrigger = React73.forwardRef(
|
|
|
19977
20003
|
...props
|
|
19978
20004
|
}, ref) => {
|
|
19979
20005
|
const { t } = useTranslation42();
|
|
20006
|
+
const generatedHelperId = React73.useId();
|
|
19980
20007
|
const hasValue = Boolean(valueText);
|
|
19981
20008
|
const isRaised = hasValue || forceFloatingLabel;
|
|
19982
20009
|
const optionalLabel = optional ? typeof optional === "string" ? optional : t("optional") : void 0;
|
|
19983
20010
|
const visibleLabelText = labelText ?? label;
|
|
19984
20011
|
const hasLabelMeta = Boolean(optionalLabel) || Boolean(tooltip);
|
|
19985
20012
|
const resolvedLabelText = visibleLabelText && hasLabelMeta ? /* @__PURE__ */ jsxs116("span", { className: "inline-flex max-w-full items-center gap-1.5 align-middle", children: [
|
|
19986
|
-
/* @__PURE__ */
|
|
20013
|
+
/* @__PURE__ */ jsx183("span", { className: "min-w-0 truncate", children: visibleLabelText }),
|
|
19987
20014
|
optionalLabel && /* @__PURE__ */ jsxs116("span", { className: "text-current opacity-70 lowercase", children: [
|
|
19988
20015
|
"(",
|
|
19989
20016
|
optionalLabel,
|
|
19990
20017
|
")"
|
|
19991
20018
|
] }),
|
|
19992
|
-
tooltip && /* @__PURE__ */
|
|
20019
|
+
tooltip && /* @__PURE__ */ jsx183(
|
|
19993
20020
|
HelpTooltip,
|
|
19994
20021
|
{
|
|
19995
20022
|
content: tooltip,
|
|
@@ -20003,10 +20030,14 @@ var AirbnbFieldTrigger = React73.forwardRef(
|
|
|
20003
20030
|
const animatedLabel = forceLabelText ? resolvedLabelText ?? placeholder : isRaised ? resolvedLabelText : label ?? placeholder;
|
|
20004
20031
|
const hasInvalidState = Boolean(error);
|
|
20005
20032
|
const errorMessage = typeof error === "string" ? error : void 0;
|
|
20033
|
+
const showErrorMessage = Boolean(errorMessage) && !hideErrorMessage;
|
|
20034
|
+
const showHelper = Boolean(helper) && !showErrorMessage;
|
|
20035
|
+
const helperId = helper ? generatedHelperId : void 0;
|
|
20036
|
+
const describedByValue = [describedBy, showHelper ? helperId : void 0].filter(Boolean).join(" ") || void 0;
|
|
20006
20037
|
const isBlocked = Boolean(disabled) || Boolean(loading);
|
|
20007
20038
|
const resolvedTrailingAdornment = loading || trailingAdornment ? /* @__PURE__ */ jsxs116("span", { className: "flex items-center gap-2", children: [
|
|
20008
20039
|
trailingAdornment,
|
|
20009
|
-
loading && /* @__PURE__ */
|
|
20040
|
+
loading && /* @__PURE__ */ jsx183(
|
|
20010
20041
|
Loader24,
|
|
20011
20042
|
{
|
|
20012
20043
|
"aria-hidden": "true",
|
|
@@ -20032,7 +20063,7 @@ var AirbnbFieldTrigger = React73.forwardRef(
|
|
|
20032
20063
|
contentClassName
|
|
20033
20064
|
),
|
|
20034
20065
|
children: [
|
|
20035
|
-
/* @__PURE__ */
|
|
20066
|
+
/* @__PURE__ */ jsx183(
|
|
20036
20067
|
"span",
|
|
20037
20068
|
{
|
|
20038
20069
|
id: labelId,
|
|
@@ -20045,7 +20076,7 @@ var AirbnbFieldTrigger = React73.forwardRef(
|
|
|
20045
20076
|
children: animatedLabel
|
|
20046
20077
|
}
|
|
20047
20078
|
),
|
|
20048
|
-
children ? children : hasValue ? /* @__PURE__ */
|
|
20079
|
+
children ? children : hasValue ? /* @__PURE__ */ jsx183(
|
|
20049
20080
|
"span",
|
|
20050
20081
|
{
|
|
20051
20082
|
id: valueId,
|
|
@@ -20056,11 +20087,11 @@ var AirbnbFieldTrigger = React73.forwardRef(
|
|
|
20056
20087
|
),
|
|
20057
20088
|
children: valueText
|
|
20058
20089
|
}
|
|
20059
|
-
) : /* @__PURE__ */
|
|
20090
|
+
) : /* @__PURE__ */ jsx183("span", { id: helperTextId, className: "sr-only", children: placeholder ?? label })
|
|
20060
20091
|
]
|
|
20061
20092
|
}
|
|
20062
20093
|
),
|
|
20063
|
-
resolvedTrailingAdornment && /* @__PURE__ */
|
|
20094
|
+
resolvedTrailingAdornment && /* @__PURE__ */ jsx183(
|
|
20064
20095
|
"span",
|
|
20065
20096
|
{
|
|
20066
20097
|
"aria-hidden": "true",
|
|
@@ -20070,15 +20101,15 @@ var AirbnbFieldTrigger = React73.forwardRef(
|
|
|
20070
20101
|
)
|
|
20071
20102
|
] });
|
|
20072
20103
|
return /* @__PURE__ */ jsxs116("div", { className: "w-full", children: [
|
|
20073
|
-
topLabel && /* @__PURE__ */
|
|
20074
|
-
as === "button" ? /* @__PURE__ */
|
|
20104
|
+
topLabel && /* @__PURE__ */ jsx183("p", { className: "mb-3 text-[16px] font-semibold leading-5 text-[var(--chekin-airbnb-ink-strong)]", children: topLabel }),
|
|
20105
|
+
as === "button" ? /* @__PURE__ */ jsx183(
|
|
20075
20106
|
"button",
|
|
20076
20107
|
{
|
|
20077
20108
|
id,
|
|
20078
20109
|
ref,
|
|
20079
20110
|
type: "button",
|
|
20080
20111
|
"aria-labelledby": hasValue && valueId ? `${labelId} ${valueId}` : labelId,
|
|
20081
|
-
"aria-describedby":
|
|
20112
|
+
"aria-describedby": describedByValue,
|
|
20082
20113
|
"aria-invalid": hasInvalidState,
|
|
20083
20114
|
"aria-busy": loading,
|
|
20084
20115
|
disabled: isBlocked,
|
|
@@ -20088,13 +20119,13 @@ var AirbnbFieldTrigger = React73.forwardRef(
|
|
|
20088
20119
|
...props,
|
|
20089
20120
|
children: sharedContent
|
|
20090
20121
|
}
|
|
20091
|
-
) : /* @__PURE__ */
|
|
20122
|
+
) : /* @__PURE__ */ jsx183(
|
|
20092
20123
|
"div",
|
|
20093
20124
|
{
|
|
20094
20125
|
id,
|
|
20095
20126
|
ref,
|
|
20096
20127
|
"aria-labelledby": hasValue && valueId ? `${labelId} ${valueId}` : labelId,
|
|
20097
|
-
"aria-describedby":
|
|
20128
|
+
"aria-describedby": describedByValue,
|
|
20098
20129
|
"aria-invalid": hasInvalidState,
|
|
20099
20130
|
"aria-busy": loading,
|
|
20100
20131
|
"aria-disabled": isBlocked,
|
|
@@ -20105,14 +20136,15 @@ var AirbnbFieldTrigger = React73.forwardRef(
|
|
|
20105
20136
|
children: sharedContent
|
|
20106
20137
|
}
|
|
20107
20138
|
),
|
|
20108
|
-
|
|
20139
|
+
showErrorMessage && /* @__PURE__ */ jsx183(FieldErrorMessage, { id: errorId, message: errorMessage }),
|
|
20140
|
+
showHelper && /* @__PURE__ */ jsx183(AirbnbFieldHelperText, { id: helperId, helper, disabled })
|
|
20109
20141
|
] });
|
|
20110
20142
|
}
|
|
20111
20143
|
);
|
|
20112
20144
|
AirbnbFieldTrigger.displayName = "AirbnbFieldTrigger";
|
|
20113
20145
|
|
|
20114
20146
|
// src/airbnb-fields/datepicker/DatePicker.tsx
|
|
20115
|
-
import { jsx as
|
|
20147
|
+
import { jsx as jsx184, jsxs as jsxs117 } from "react/jsx-runtime";
|
|
20116
20148
|
var DEFAULT_MIN_DATE = new Date(1920, 0, 1);
|
|
20117
20149
|
var AirbnbDatePicker = React74.forwardRef(
|
|
20118
20150
|
({
|
|
@@ -20129,6 +20161,7 @@ var AirbnbDatePicker = React74.forwardRef(
|
|
|
20129
20161
|
loading,
|
|
20130
20162
|
optional,
|
|
20131
20163
|
tooltip,
|
|
20164
|
+
helper,
|
|
20132
20165
|
className,
|
|
20133
20166
|
name,
|
|
20134
20167
|
minDate,
|
|
@@ -20229,7 +20262,7 @@ var AirbnbDatePicker = React74.forwardRef(
|
|
|
20229
20262
|
}
|
|
20230
20263
|
}, [isBlocked]);
|
|
20231
20264
|
return /* @__PURE__ */ jsxs117("div", { className: cn("relative w-full max-w-[var(--max-field-width)]", className), children: [
|
|
20232
|
-
name && /* @__PURE__ */
|
|
20265
|
+
name && /* @__PURE__ */ jsx184(
|
|
20233
20266
|
"input",
|
|
20234
20267
|
{
|
|
20235
20268
|
type: "hidden",
|
|
@@ -20237,7 +20270,7 @@ var AirbnbDatePicker = React74.forwardRef(
|
|
|
20237
20270
|
value: resolvedValue ? formatDateInputValue(resolvedValue) : ""
|
|
20238
20271
|
}
|
|
20239
20272
|
),
|
|
20240
|
-
/* @__PURE__ */
|
|
20273
|
+
/* @__PURE__ */ jsx184(
|
|
20241
20274
|
AirbnbFieldTrigger,
|
|
20242
20275
|
{
|
|
20243
20276
|
id: triggerId,
|
|
@@ -20257,13 +20290,14 @@ var AirbnbDatePicker = React74.forwardRef(
|
|
|
20257
20290
|
loading,
|
|
20258
20291
|
optional,
|
|
20259
20292
|
tooltip,
|
|
20293
|
+
helper,
|
|
20260
20294
|
forceLabelText: Boolean(optional) || Boolean(tooltip),
|
|
20261
20295
|
"aria-haspopup": "dialog",
|
|
20262
20296
|
"aria-expanded": isOpen,
|
|
20263
20297
|
onClick: handleTriggerClick,
|
|
20264
20298
|
onKeyDown: handleTriggerKeyDown,
|
|
20265
20299
|
onBlur,
|
|
20266
|
-
trailingAdornment: /* @__PURE__ */
|
|
20300
|
+
trailingAdornment: /* @__PURE__ */ jsx184(
|
|
20267
20301
|
Calendar2,
|
|
20268
20302
|
{
|
|
20269
20303
|
className: "h-5 w-5 text-[var(--chekin-airbnb-ink)]",
|
|
@@ -20272,7 +20306,7 @@ var AirbnbDatePicker = React74.forwardRef(
|
|
|
20272
20306
|
)
|
|
20273
20307
|
}
|
|
20274
20308
|
),
|
|
20275
|
-
/* @__PURE__ */
|
|
20309
|
+
/* @__PURE__ */ jsx184(
|
|
20276
20310
|
AirbnbDatePickerContent,
|
|
20277
20311
|
{
|
|
20278
20312
|
baseId: pickerId,
|
|
@@ -20309,13 +20343,14 @@ AirbnbDatePicker.displayName = "AirbnbDatePicker";
|
|
|
20309
20343
|
import * as React75 from "react";
|
|
20310
20344
|
import { Eye as Eye2 } from "lucide-react";
|
|
20311
20345
|
import { useTranslation as useTranslation43 } from "react-i18next";
|
|
20312
|
-
import { jsx as
|
|
20346
|
+
import { jsx as jsx185, jsxs as jsxs118 } from "react/jsx-runtime";
|
|
20313
20347
|
var getInputValue = (value) => value != null ? String(value) : "";
|
|
20314
20348
|
var AirbnbInput = React75.forwardRef(
|
|
20315
20349
|
({
|
|
20316
20350
|
label,
|
|
20317
20351
|
topLabel,
|
|
20318
20352
|
helperText,
|
|
20353
|
+
helper,
|
|
20319
20354
|
error,
|
|
20320
20355
|
invalid,
|
|
20321
20356
|
loading,
|
|
@@ -20410,7 +20445,7 @@ var AirbnbInput = React75.forwardRef(
|
|
|
20410
20445
|
}
|
|
20411
20446
|
inputRef.current?.focus();
|
|
20412
20447
|
};
|
|
20413
|
-
return /* @__PURE__ */
|
|
20448
|
+
return /* @__PURE__ */ jsx185("div", { className: cn("w-full max-w-[var(--max-field-width)]", wrapperClassName), children: /* @__PURE__ */ jsxs118(
|
|
20414
20449
|
AirbnbFieldTrigger,
|
|
20415
20450
|
{
|
|
20416
20451
|
as: "div",
|
|
@@ -20422,6 +20457,7 @@ var AirbnbInput = React75.forwardRef(
|
|
|
20422
20457
|
errorId: error ? errorId : void 0,
|
|
20423
20458
|
labelText: helperText ?? label,
|
|
20424
20459
|
placeholder: placeholder ?? label,
|
|
20460
|
+
helper,
|
|
20425
20461
|
disabled,
|
|
20426
20462
|
error: triggerError,
|
|
20427
20463
|
loading,
|
|
@@ -20440,7 +20476,7 @@ var AirbnbInput = React75.forwardRef(
|
|
|
20440
20476
|
forceLabelText: hasLabelMeta,
|
|
20441
20477
|
hideErrorMessage: !renderErrorMessage,
|
|
20442
20478
|
children: [
|
|
20443
|
-
/* @__PURE__ */
|
|
20479
|
+
/* @__PURE__ */ jsx185(
|
|
20444
20480
|
"input",
|
|
20445
20481
|
{
|
|
20446
20482
|
...props,
|
|
@@ -20470,7 +20506,7 @@ var AirbnbInput = React75.forwardRef(
|
|
|
20470
20506
|
)
|
|
20471
20507
|
}
|
|
20472
20508
|
),
|
|
20473
|
-
shouldShowPasswordReveal && /* @__PURE__ */
|
|
20509
|
+
shouldShowPasswordReveal && /* @__PURE__ */ jsx185(
|
|
20474
20510
|
"button",
|
|
20475
20511
|
{
|
|
20476
20512
|
type: "button",
|
|
@@ -20478,7 +20514,7 @@ var AirbnbInput = React75.forwardRef(
|
|
|
20478
20514
|
disabled: isBlocked,
|
|
20479
20515
|
className: "absolute bottom-0 right-0 flex h-6 w-6 items-center justify-center border-0 bg-transparent p-0 text-[var(--chekin-airbnb-gray-cool)] hover:text-[var(--chekin-airbnb-ink)] hover:opacity-85 disabled:cursor-not-allowed disabled:opacity-50",
|
|
20480
20516
|
"aria-label": isPasswordRevealed ? t("hide_password") : t("show_password"),
|
|
20481
|
-
children: /* @__PURE__ */
|
|
20517
|
+
children: /* @__PURE__ */ jsx185(
|
|
20482
20518
|
Eye2,
|
|
20483
20519
|
{
|
|
20484
20520
|
size: 18,
|
|
@@ -20505,7 +20541,7 @@ import { ChevronDown as ChevronDown6 } from "lucide-react";
|
|
|
20505
20541
|
import * as React80 from "react";
|
|
20506
20542
|
|
|
20507
20543
|
// src/airbnb-fields/select/SelectDesktopMenu.tsx
|
|
20508
|
-
import { jsx as
|
|
20544
|
+
import { jsx as jsx186, jsxs as jsxs119 } from "react/jsx-runtime";
|
|
20509
20545
|
function AirbnbSelectDesktopMenu({
|
|
20510
20546
|
id,
|
|
20511
20547
|
options,
|
|
@@ -20537,12 +20573,12 @@ function AirbnbSelectDesktopMenu({
|
|
|
20537
20573
|
onKeyDown,
|
|
20538
20574
|
className: cn("max-h-[280px] overflow-y-auto p-2 outline-none", menuClassName),
|
|
20539
20575
|
children: [
|
|
20540
|
-
options.length === 0 && emptyMessage ? /* @__PURE__ */
|
|
20576
|
+
options.length === 0 && emptyMessage ? /* @__PURE__ */ jsx186("div", { className: "px-4 py-3 text-base leading-6 text-[var(--chekin-airbnb-gray-text)]", children: emptyMessage }) : null,
|
|
20541
20577
|
options.map((option, index) => {
|
|
20542
20578
|
const isSelected = selectedValue?.value === option.value;
|
|
20543
20579
|
const isHighlighted = index === highlightedIndex;
|
|
20544
20580
|
const optionKey = `${String(option.value)}-${index}`;
|
|
20545
|
-
return /* @__PURE__ */
|
|
20581
|
+
return /* @__PURE__ */ jsx186(
|
|
20546
20582
|
"button",
|
|
20547
20583
|
{
|
|
20548
20584
|
id: getOptionId2(index),
|
|
@@ -20574,7 +20610,7 @@ function AirbnbSelectDesktopMenu({
|
|
|
20574
20610
|
}
|
|
20575
20611
|
|
|
20576
20612
|
// src/airbnb-fields/select/SelectDesktopContent.tsx
|
|
20577
|
-
import { jsx as
|
|
20613
|
+
import { jsx as jsx187 } from "react/jsx-runtime";
|
|
20578
20614
|
function AirbnbSelectDesktopContent({
|
|
20579
20615
|
isOpen,
|
|
20580
20616
|
listboxId,
|
|
@@ -20595,14 +20631,14 @@ function AirbnbSelectDesktopContent({
|
|
|
20595
20631
|
noOptionsMessage
|
|
20596
20632
|
}) {
|
|
20597
20633
|
if (!isOpen) return null;
|
|
20598
|
-
return /* @__PURE__ */
|
|
20634
|
+
return /* @__PURE__ */ jsx187(
|
|
20599
20635
|
"div",
|
|
20600
20636
|
{
|
|
20601
20637
|
className: cn(
|
|
20602
20638
|
"absolute left-0 right-0 top-[calc(100%+8px)] z-20 overflow-hidden rounded-[20px] border border-[var(--chekin-airbnb-border)] bg-white shadow-[0_14px_30px_rgba(18,18,18,0.08)]",
|
|
20603
20639
|
dropdownClassName
|
|
20604
20640
|
),
|
|
20605
|
-
children: /* @__PURE__ */
|
|
20641
|
+
children: /* @__PURE__ */ jsx187(
|
|
20606
20642
|
AirbnbSelectDesktopMenu,
|
|
20607
20643
|
{
|
|
20608
20644
|
id: listboxId,
|
|
@@ -20700,7 +20736,7 @@ function getMobileOptionStyles(index, scrollTop) {
|
|
|
20700
20736
|
}
|
|
20701
20737
|
|
|
20702
20738
|
// src/airbnb-fields/select/SelectMobileWheel.tsx
|
|
20703
|
-
import { jsx as
|
|
20739
|
+
import { jsx as jsx188, jsxs as jsxs120 } from "react/jsx-runtime";
|
|
20704
20740
|
function AirbnbSelectMobileWheel({
|
|
20705
20741
|
id,
|
|
20706
20742
|
options,
|
|
@@ -20731,10 +20767,10 @@ function AirbnbSelectMobileWheel({
|
|
|
20731
20767
|
onKeyDown,
|
|
20732
20768
|
className: cn("relative overflow-hidden outline-none", menuClassName),
|
|
20733
20769
|
children: [
|
|
20734
|
-
options.length === 0 && emptyMessage ? /* @__PURE__ */
|
|
20735
|
-
/* @__PURE__ */
|
|
20736
|
-
/* @__PURE__ */
|
|
20737
|
-
/* @__PURE__ */
|
|
20770
|
+
options.length === 0 && emptyMessage ? /* @__PURE__ */ jsx188("div", { className: "flex min-h-[160px] items-center justify-center px-4 text-center text-base leading-6 text-[var(--chekin-airbnb-gray-text)]", children: emptyMessage }) : null,
|
|
20771
|
+
/* @__PURE__ */ jsx188("div", { className: "pointer-events-none absolute inset-x-0 top-0 h-16 bg-gradient-to-b from-white via-white/80 to-transparent" }),
|
|
20772
|
+
/* @__PURE__ */ jsx188("div", { className: "pointer-events-none absolute inset-x-0 bottom-0 h-16 bg-gradient-to-t from-white via-white/80 to-transparent" }),
|
|
20773
|
+
/* @__PURE__ */ jsx188(
|
|
20738
20774
|
"div",
|
|
20739
20775
|
{
|
|
20740
20776
|
"aria-hidden": true,
|
|
@@ -20759,11 +20795,11 @@ function AirbnbSelectMobileWheel({
|
|
|
20759
20795
|
WebkitOverflowScrolling: "touch"
|
|
20760
20796
|
},
|
|
20761
20797
|
children: [
|
|
20762
|
-
/* @__PURE__ */
|
|
20798
|
+
/* @__PURE__ */ jsx188("div", { style: { height: `${spacerHeight2}px` } }),
|
|
20763
20799
|
options.map((option, index) => {
|
|
20764
20800
|
const { distance, style } = getMobileOptionStyles(index, scrollTop);
|
|
20765
20801
|
const optionKey = `${String(option.value)}-${index}`;
|
|
20766
|
-
return /* @__PURE__ */
|
|
20802
|
+
return /* @__PURE__ */ jsx188(
|
|
20767
20803
|
"button",
|
|
20768
20804
|
{
|
|
20769
20805
|
id: getOptionId2(index),
|
|
@@ -20784,7 +20820,7 @@ function AirbnbSelectMobileWheel({
|
|
|
20784
20820
|
optionKey
|
|
20785
20821
|
);
|
|
20786
20822
|
}),
|
|
20787
|
-
/* @__PURE__ */
|
|
20823
|
+
/* @__PURE__ */ jsx188("div", { style: { height: `${spacerHeight2}px` } })
|
|
20788
20824
|
]
|
|
20789
20825
|
}
|
|
20790
20826
|
)
|
|
@@ -20794,7 +20830,7 @@ function AirbnbSelectMobileWheel({
|
|
|
20794
20830
|
}
|
|
20795
20831
|
|
|
20796
20832
|
// src/airbnb-fields/select/SelectMobileContent.tsx
|
|
20797
|
-
import { jsx as
|
|
20833
|
+
import { jsx as jsx189, jsxs as jsxs121 } from "react/jsx-runtime";
|
|
20798
20834
|
function AirbnbSelectMobileContent({
|
|
20799
20835
|
open,
|
|
20800
20836
|
onOpenChange,
|
|
@@ -20818,11 +20854,11 @@ function AirbnbSelectMobileContent({
|
|
|
20818
20854
|
getOptionId: getOptionId2,
|
|
20819
20855
|
noOptionsMessage
|
|
20820
20856
|
}) {
|
|
20821
|
-
return /* @__PURE__ */
|
|
20822
|
-
/* @__PURE__ */
|
|
20823
|
-
/* @__PURE__ */
|
|
20857
|
+
return /* @__PURE__ */ jsx189(Drawer, { open, onOpenChange, children: /* @__PURE__ */ jsxs121(DrawerContent, { onClose, lockScroll: false, children: [
|
|
20858
|
+
/* @__PURE__ */ jsx189(DrawerTitle, { className: "sr-only", children: mobileTitle ?? label }),
|
|
20859
|
+
/* @__PURE__ */ jsx189(DrawerDescription, { className: "sr-only", children: label }),
|
|
20824
20860
|
/* @__PURE__ */ jsxs121("div", { className: "px-6 pb-4 pt-1", children: [
|
|
20825
|
-
/* @__PURE__ */
|
|
20861
|
+
/* @__PURE__ */ jsx189(
|
|
20826
20862
|
AirbnbSelectMobileWheel,
|
|
20827
20863
|
{
|
|
20828
20864
|
id: listboxId,
|
|
@@ -20841,7 +20877,7 @@ function AirbnbSelectMobileContent({
|
|
|
20841
20877
|
noOptionsMessage
|
|
20842
20878
|
}
|
|
20843
20879
|
),
|
|
20844
|
-
/* @__PURE__ */
|
|
20880
|
+
/* @__PURE__ */ jsx189(Button, { type: "button", onClick: onDone, className: "mt-4 h-12 mb-8 w-full", children: doneLabel })
|
|
20845
20881
|
] })
|
|
20846
20882
|
] }) });
|
|
20847
20883
|
}
|
|
@@ -20849,7 +20885,7 @@ function AirbnbSelectMobileContent({
|
|
|
20849
20885
|
// src/airbnb-fields/select/SelectTrigger.tsx
|
|
20850
20886
|
import * as React76 from "react";
|
|
20851
20887
|
import { ChevronDown as ChevronDown5 } from "lucide-react";
|
|
20852
|
-
import { jsx as
|
|
20888
|
+
import { jsx as jsx190 } from "react/jsx-runtime";
|
|
20853
20889
|
var AirbnbSelectTrigger = React76.forwardRef(
|
|
20854
20890
|
({
|
|
20855
20891
|
id,
|
|
@@ -20862,6 +20898,7 @@ var AirbnbSelectTrigger = React76.forwardRef(
|
|
|
20862
20898
|
loading,
|
|
20863
20899
|
optional,
|
|
20864
20900
|
tooltip,
|
|
20901
|
+
helper,
|
|
20865
20902
|
error,
|
|
20866
20903
|
hideErrorMessage,
|
|
20867
20904
|
labelId,
|
|
@@ -20874,7 +20911,7 @@ var AirbnbSelectTrigger = React76.forwardRef(
|
|
|
20874
20911
|
onKeyDown,
|
|
20875
20912
|
onBlur
|
|
20876
20913
|
}, ref) => {
|
|
20877
|
-
return /* @__PURE__ */
|
|
20914
|
+
return /* @__PURE__ */ jsx190(
|
|
20878
20915
|
AirbnbFieldTrigger,
|
|
20879
20916
|
{
|
|
20880
20917
|
id,
|
|
@@ -20896,13 +20933,14 @@ var AirbnbSelectTrigger = React76.forwardRef(
|
|
|
20896
20933
|
loading,
|
|
20897
20934
|
optional,
|
|
20898
20935
|
tooltip,
|
|
20936
|
+
helper,
|
|
20899
20937
|
forceLabelText: Boolean(optional) || Boolean(tooltip),
|
|
20900
20938
|
hideErrorMessage,
|
|
20901
20939
|
disabled,
|
|
20902
20940
|
onClick,
|
|
20903
20941
|
onKeyDown,
|
|
20904
20942
|
onBlur,
|
|
20905
|
-
trailingAdornment: /* @__PURE__ */
|
|
20943
|
+
trailingAdornment: /* @__PURE__ */ jsx190(
|
|
20906
20944
|
ChevronDown5,
|
|
20907
20945
|
{
|
|
20908
20946
|
strokeWidth: "1.5",
|
|
@@ -21265,7 +21303,7 @@ function useSelectIds2({ name, hasValue, error, hideErrorMessage }) {
|
|
|
21265
21303
|
}
|
|
21266
21304
|
|
|
21267
21305
|
// src/airbnb-fields/select/Select.tsx
|
|
21268
|
-
import { jsx as
|
|
21306
|
+
import { jsx as jsx191, jsxs as jsxs122 } from "react/jsx-runtime";
|
|
21269
21307
|
var AirbnbSelect = React80.forwardRef(function AirbnbSelect2({
|
|
21270
21308
|
options = [],
|
|
21271
21309
|
value,
|
|
@@ -21280,6 +21318,7 @@ var AirbnbSelect = React80.forwardRef(function AirbnbSelect2({
|
|
|
21280
21318
|
loading,
|
|
21281
21319
|
optional,
|
|
21282
21320
|
tooltip,
|
|
21321
|
+
helper,
|
|
21283
21322
|
error,
|
|
21284
21323
|
invalid,
|
|
21285
21324
|
hideErrorMessage,
|
|
@@ -21452,7 +21491,7 @@ var AirbnbSelect = React80.forwardRef(function AirbnbSelect2({
|
|
|
21452
21491
|
ref: containerRef,
|
|
21453
21492
|
className: cn("relative w-full max-w-[var(--max-field-width)]", className),
|
|
21454
21493
|
children: [
|
|
21455
|
-
name && /* @__PURE__ */
|
|
21494
|
+
name && /* @__PURE__ */ jsx191("input", { type: "hidden", name, value: value ? String(value.value) : "" }),
|
|
21456
21495
|
renderTrigger ? renderTrigger({
|
|
21457
21496
|
id: triggerId,
|
|
21458
21497
|
open: isOpen,
|
|
@@ -21465,6 +21504,7 @@ var AirbnbSelect = React80.forwardRef(function AirbnbSelect2({
|
|
|
21465
21504
|
loading,
|
|
21466
21505
|
optional,
|
|
21467
21506
|
tooltip,
|
|
21507
|
+
helper,
|
|
21468
21508
|
error,
|
|
21469
21509
|
invalid,
|
|
21470
21510
|
listboxId,
|
|
@@ -21473,7 +21513,7 @@ var AirbnbSelect = React80.forwardRef(function AirbnbSelect2({
|
|
|
21473
21513
|
onClick: handleTriggerClick,
|
|
21474
21514
|
onKeyDown: handleRootTriggerKeyDown,
|
|
21475
21515
|
onBlur
|
|
21476
|
-
}) : /* @__PURE__ */
|
|
21516
|
+
}) : /* @__PURE__ */ jsx191(
|
|
21477
21517
|
AirbnbSelectTrigger,
|
|
21478
21518
|
{
|
|
21479
21519
|
id: triggerId,
|
|
@@ -21487,6 +21527,7 @@ var AirbnbSelect = React80.forwardRef(function AirbnbSelect2({
|
|
|
21487
21527
|
loading,
|
|
21488
21528
|
optional,
|
|
21489
21529
|
tooltip,
|
|
21530
|
+
helper,
|
|
21490
21531
|
error: triggerError,
|
|
21491
21532
|
hideErrorMessage,
|
|
21492
21533
|
labelId,
|
|
@@ -21500,7 +21541,7 @@ var AirbnbSelect = React80.forwardRef(function AirbnbSelect2({
|
|
|
21500
21541
|
onBlur
|
|
21501
21542
|
}
|
|
21502
21543
|
),
|
|
21503
|
-
isMobile3 ? /* @__PURE__ */
|
|
21544
|
+
isMobile3 ? /* @__PURE__ */ jsx191(
|
|
21504
21545
|
AirbnbSelectMobileContent,
|
|
21505
21546
|
{
|
|
21506
21547
|
open: isOpen,
|
|
@@ -21525,7 +21566,7 @@ var AirbnbSelect = React80.forwardRef(function AirbnbSelect2({
|
|
|
21525
21566
|
getOptionId: getOptionId2,
|
|
21526
21567
|
noOptionsMessage
|
|
21527
21568
|
}
|
|
21528
|
-
) : /* @__PURE__ */
|
|
21569
|
+
) : /* @__PURE__ */ jsx191(
|
|
21529
21570
|
AirbnbSelectDesktopContent,
|
|
21530
21571
|
{
|
|
21531
21572
|
isOpen,
|
|
@@ -21559,7 +21600,7 @@ var AirbnbSelect = React80.forwardRef(function AirbnbSelect2({
|
|
|
21559
21600
|
});
|
|
21560
21601
|
|
|
21561
21602
|
// src/airbnb-fields/phone-field/PhoneField.tsx
|
|
21562
|
-
import { jsx as
|
|
21603
|
+
import { jsx as jsx192, jsxs as jsxs123 } from "react/jsx-runtime";
|
|
21563
21604
|
function formatPhoneCodeOptionLabel2(option) {
|
|
21564
21605
|
const label = String(option.label);
|
|
21565
21606
|
const value = String(option.value);
|
|
@@ -21581,6 +21622,7 @@ var AirbnbPhoneField = React81.forwardRef(
|
|
|
21581
21622
|
loading,
|
|
21582
21623
|
optional,
|
|
21583
21624
|
tooltip,
|
|
21625
|
+
helper,
|
|
21584
21626
|
className,
|
|
21585
21627
|
name,
|
|
21586
21628
|
codeName,
|
|
@@ -21608,8 +21650,8 @@ var AirbnbPhoneField = React81.forwardRef(
|
|
|
21608
21650
|
const isBlocked = Boolean(disabled) || Boolean(loading);
|
|
21609
21651
|
const isCodeBlocked = isBlocked || Boolean(codeReadOnly);
|
|
21610
21652
|
return /* @__PURE__ */ jsxs123("div", { className: cn("w-full max-w-[var(--max-field-width)]", className), children: [
|
|
21611
|
-
name && /* @__PURE__ */
|
|
21612
|
-
codeName && /* @__PURE__ */
|
|
21653
|
+
name && /* @__PURE__ */ jsx192("input", { type: "hidden", name, value: combinedValue, disabled }),
|
|
21654
|
+
codeName && /* @__PURE__ */ jsx192(
|
|
21613
21655
|
"input",
|
|
21614
21656
|
{
|
|
21615
21657
|
type: "hidden",
|
|
@@ -21618,7 +21660,7 @@ var AirbnbPhoneField = React81.forwardRef(
|
|
|
21618
21660
|
disabled
|
|
21619
21661
|
}
|
|
21620
21662
|
),
|
|
21621
|
-
numberName && /* @__PURE__ */
|
|
21663
|
+
numberName && /* @__PURE__ */ jsx192(
|
|
21622
21664
|
"input",
|
|
21623
21665
|
{
|
|
21624
21666
|
type: "hidden",
|
|
@@ -21627,7 +21669,7 @@ var AirbnbPhoneField = React81.forwardRef(
|
|
|
21627
21669
|
disabled
|
|
21628
21670
|
}
|
|
21629
21671
|
),
|
|
21630
|
-
topLabel && /* @__PURE__ */
|
|
21672
|
+
topLabel && /* @__PURE__ */ jsx192(
|
|
21631
21673
|
"label",
|
|
21632
21674
|
{
|
|
21633
21675
|
htmlFor: inputId,
|
|
@@ -21636,7 +21678,7 @@ var AirbnbPhoneField = React81.forwardRef(
|
|
|
21636
21678
|
}
|
|
21637
21679
|
),
|
|
21638
21680
|
/* @__PURE__ */ jsxs123("div", { className: "flex items-stretch", children: [
|
|
21639
|
-
/* @__PURE__ */
|
|
21681
|
+
/* @__PURE__ */ jsx192(
|
|
21640
21682
|
AirbnbSelect,
|
|
21641
21683
|
{
|
|
21642
21684
|
ref,
|
|
@@ -21686,8 +21728,8 @@ var AirbnbPhoneField = React81.forwardRef(
|
|
|
21686
21728
|
triggerDisabled ? "cursor-not-allowed opacity-50" : triggerLoading ? "cursor-progress" : "cursor-pointer"
|
|
21687
21729
|
),
|
|
21688
21730
|
children: [
|
|
21689
|
-
/* @__PURE__ */
|
|
21690
|
-
/* @__PURE__ */
|
|
21731
|
+
/* @__PURE__ */ jsx192("span", { children: valueLabel ?? codePlaceholder }),
|
|
21732
|
+
/* @__PURE__ */ jsx192(
|
|
21691
21733
|
ChevronDown6,
|
|
21692
21734
|
{
|
|
21693
21735
|
className: cn("h-5 w-5 transition-transform", open ? "rotate-180" : ""),
|
|
@@ -21699,7 +21741,7 @@ var AirbnbPhoneField = React81.forwardRef(
|
|
|
21699
21741
|
)
|
|
21700
21742
|
}
|
|
21701
21743
|
),
|
|
21702
|
-
/* @__PURE__ */
|
|
21744
|
+
/* @__PURE__ */ jsx192(
|
|
21703
21745
|
AirbnbInput,
|
|
21704
21746
|
{
|
|
21705
21747
|
id: inputId,
|
|
@@ -21728,7 +21770,8 @@ var AirbnbPhoneField = React81.forwardRef(
|
|
|
21728
21770
|
}
|
|
21729
21771
|
)
|
|
21730
21772
|
] }),
|
|
21731
|
-
error && /* @__PURE__ */
|
|
21773
|
+
error && /* @__PURE__ */ jsx192(FieldErrorMessage, { message: error }),
|
|
21774
|
+
!error && /* @__PURE__ */ jsx192(AirbnbFieldHelperText, { helper, disabled })
|
|
21732
21775
|
] });
|
|
21733
21776
|
}
|
|
21734
21777
|
);
|
|
@@ -21739,7 +21782,7 @@ import * as React82 from "react";
|
|
|
21739
21782
|
import { ChevronDown as ChevronDown7, Search as Search5 } from "lucide-react";
|
|
21740
21783
|
import { useVirtualizer as useVirtualizer3 } from "@tanstack/react-virtual";
|
|
21741
21784
|
import { useCallback as useCallback58 } from "react";
|
|
21742
|
-
import { jsx as
|
|
21785
|
+
import { jsx as jsx193, jsxs as jsxs124 } from "react/jsx-runtime";
|
|
21743
21786
|
var ROW_HEIGHT = 48;
|
|
21744
21787
|
var DESKTOP_LIST_HEIGHT = 280;
|
|
21745
21788
|
var MOBILE_LIST_HEIGHT = 420;
|
|
@@ -21770,6 +21813,7 @@ var AirbnbSearchableSelectInternal = ({
|
|
|
21770
21813
|
invalid,
|
|
21771
21814
|
optional,
|
|
21772
21815
|
tooltip,
|
|
21816
|
+
helper,
|
|
21773
21817
|
hideErrorMessage,
|
|
21774
21818
|
name,
|
|
21775
21819
|
className,
|
|
@@ -21907,7 +21951,7 @@ var AirbnbSearchableSelectInternal = ({
|
|
|
21907
21951
|
}
|
|
21908
21952
|
}
|
|
21909
21953
|
}
|
|
21910
|
-
const content = /* @__PURE__ */
|
|
21954
|
+
const content = /* @__PURE__ */ jsx193(
|
|
21911
21955
|
AirbnbSearchableSelectContent,
|
|
21912
21956
|
{
|
|
21913
21957
|
inputId: searchInputId,
|
|
@@ -21936,8 +21980,8 @@ var AirbnbSearchableSelectInternal = ({
|
|
|
21936
21980
|
);
|
|
21937
21981
|
React82.useImperativeHandle(ref, () => triggerRef.current, []);
|
|
21938
21982
|
return /* @__PURE__ */ jsxs124("div", { ref: containerRef, className: cn("relative w-full max-w-[425px]", className), children: [
|
|
21939
|
-
name && /* @__PURE__ */
|
|
21940
|
-
/* @__PURE__ */
|
|
21983
|
+
name && /* @__PURE__ */ jsx193("input", { type: "hidden", name, value: value ? String(value.value) : "" }),
|
|
21984
|
+
/* @__PURE__ */ jsx193(
|
|
21941
21985
|
AirbnbFieldTrigger,
|
|
21942
21986
|
{
|
|
21943
21987
|
id: `${reactId}-trigger`,
|
|
@@ -21959,6 +22003,7 @@ var AirbnbSearchableSelectInternal = ({
|
|
|
21959
22003
|
loading,
|
|
21960
22004
|
optional,
|
|
21961
22005
|
tooltip,
|
|
22006
|
+
helper,
|
|
21962
22007
|
forceLabelText: Boolean(optional) || Boolean(tooltip),
|
|
21963
22008
|
hideErrorMessage,
|
|
21964
22009
|
disabled,
|
|
@@ -21971,7 +22016,7 @@ var AirbnbSearchableSelectInternal = ({
|
|
|
21971
22016
|
},
|
|
21972
22017
|
onKeyDown: handleTriggerKeyDown,
|
|
21973
22018
|
onBlur,
|
|
21974
|
-
trailingAdornment: /* @__PURE__ */
|
|
22019
|
+
trailingAdornment: /* @__PURE__ */ jsx193(
|
|
21975
22020
|
ChevronDown7,
|
|
21976
22021
|
{
|
|
21977
22022
|
className: cn(
|
|
@@ -21982,7 +22027,7 @@ var AirbnbSearchableSelectInternal = ({
|
|
|
21982
22027
|
)
|
|
21983
22028
|
}
|
|
21984
22029
|
),
|
|
21985
|
-
isMobile3 ? /* @__PURE__ */
|
|
22030
|
+
isMobile3 ? /* @__PURE__ */ jsx193(
|
|
21986
22031
|
Drawer,
|
|
21987
22032
|
{
|
|
21988
22033
|
open,
|
|
@@ -21995,12 +22040,12 @@ var AirbnbSearchableSelectInternal = ({
|
|
|
21995
22040
|
closeSelect();
|
|
21996
22041
|
},
|
|
21997
22042
|
children: /* @__PURE__ */ jsxs124(DrawerContent, { onClose: closeSelect, lockScroll: false, children: [
|
|
21998
|
-
/* @__PURE__ */
|
|
21999
|
-
/* @__PURE__ */
|
|
22000
|
-
/* @__PURE__ */
|
|
22043
|
+
/* @__PURE__ */ jsx193(DrawerTitle, { className: "sr-only", children: mobileTitle ?? label }),
|
|
22044
|
+
/* @__PURE__ */ jsx193(DrawerDescription, { className: "sr-only", children: label }),
|
|
22045
|
+
/* @__PURE__ */ jsx193("div", { className: "px-5 pb-5 pt-1", children: content })
|
|
22001
22046
|
] })
|
|
22002
22047
|
}
|
|
22003
|
-
) : open ? /* @__PURE__ */
|
|
22048
|
+
) : open ? /* @__PURE__ */ jsx193(
|
|
22004
22049
|
"div",
|
|
22005
22050
|
{
|
|
22006
22051
|
className: cn(
|
|
@@ -22069,14 +22114,14 @@ function AirbnbSearchableSelectContent({
|
|
|
22069
22114
|
}, [highlightedIndex, virtualizer]);
|
|
22070
22115
|
return /* @__PURE__ */ jsxs124("div", { className: "p-2", children: [
|
|
22071
22116
|
/* @__PURE__ */ jsxs124("div", { className: "relative mb-2", children: [
|
|
22072
|
-
/* @__PURE__ */
|
|
22117
|
+
/* @__PURE__ */ jsx193(
|
|
22073
22118
|
Search5,
|
|
22074
22119
|
{
|
|
22075
22120
|
"aria-hidden": "true",
|
|
22076
22121
|
className: "absolute left-4 top-1/2 h-5 w-5 -translate-y-1/2 text-[var(--chekin-neutral-500)]"
|
|
22077
22122
|
}
|
|
22078
22123
|
),
|
|
22079
|
-
/* @__PURE__ */
|
|
22124
|
+
/* @__PURE__ */ jsx193(
|
|
22080
22125
|
"input",
|
|
22081
22126
|
{
|
|
22082
22127
|
id: inputId,
|
|
@@ -22095,7 +22140,7 @@ function AirbnbSearchableSelectContent({
|
|
|
22095
22140
|
}
|
|
22096
22141
|
)
|
|
22097
22142
|
] }),
|
|
22098
|
-
loading && options.length === 0 ? /* @__PURE__ */
|
|
22143
|
+
loading && options.length === 0 ? /* @__PURE__ */ jsx193("div", { className: "px-4 py-5 text-center text-base leading-6 text-[var(--chekin-airbnb-gray-text)]", children: loadingText }) : options.length === 0 ? /* @__PURE__ */ jsx193("div", { className: "px-4 py-5 text-center text-base leading-6 text-[var(--chekin-airbnb-gray-text)]", children: emptyMessage }) : /* @__PURE__ */ jsx193(
|
|
22099
22144
|
"div",
|
|
22100
22145
|
{
|
|
22101
22146
|
id: listboxId,
|
|
@@ -22104,7 +22149,7 @@ function AirbnbSearchableSelectContent({
|
|
|
22104
22149
|
"aria-labelledby": labelId,
|
|
22105
22150
|
className: cn("overflow-y-auto outline-none", menuClassName),
|
|
22106
22151
|
style: { height: Math.min(height, rowCount * ROW_HEIGHT) },
|
|
22107
|
-
children: /* @__PURE__ */
|
|
22152
|
+
children: /* @__PURE__ */ jsx193(
|
|
22108
22153
|
"div",
|
|
22109
22154
|
{
|
|
22110
22155
|
className: "relative w-full",
|
|
@@ -22112,7 +22157,7 @@ function AirbnbSearchableSelectContent({
|
|
|
22112
22157
|
children: virtualItems.map((virtualItem) => {
|
|
22113
22158
|
const option = options[virtualItem.index];
|
|
22114
22159
|
if (!option) {
|
|
22115
|
-
return /* @__PURE__ */
|
|
22160
|
+
return /* @__PURE__ */ jsx193(
|
|
22116
22161
|
"div",
|
|
22117
22162
|
{
|
|
22118
22163
|
className: "absolute left-0 top-0 flex w-full items-center px-4 text-base leading-6 text-[var(--chekin-airbnb-gray-text)]",
|
|
@@ -22127,7 +22172,7 @@ function AirbnbSearchableSelectContent({
|
|
|
22127
22172
|
}
|
|
22128
22173
|
const isSelected = value?.value === option.value;
|
|
22129
22174
|
const isHighlighted = virtualItem.index === highlightedIndex;
|
|
22130
|
-
return /* @__PURE__ */
|
|
22175
|
+
return /* @__PURE__ */ jsx193(
|
|
22131
22176
|
"button",
|
|
22132
22177
|
{
|
|
22133
22178
|
id: getOptionId(idPrefix, virtualItem.index),
|
|
@@ -22149,7 +22194,7 @@ function AirbnbSearchableSelectContent({
|
|
|
22149
22194
|
height: `${virtualItem.size}px`,
|
|
22150
22195
|
transform: `translateY(${virtualItem.start}px)`
|
|
22151
22196
|
},
|
|
22152
|
-
children: /* @__PURE__ */
|
|
22197
|
+
children: /* @__PURE__ */ jsx193("span", { className: "truncate text-center", children: String(option.label) })
|
|
22153
22198
|
},
|
|
22154
22199
|
`${String(option.value)}-${virtualItem.index}`
|
|
22155
22200
|
);
|
|
@@ -22181,13 +22226,15 @@ function getNextEnabledIndex(options, startIndex, step) {
|
|
|
22181
22226
|
import * as React83 from "react";
|
|
22182
22227
|
import { useTranslation as useTranslation44 } from "react-i18next";
|
|
22183
22228
|
import { Search as Search6, X as X11 } from "lucide-react";
|
|
22184
|
-
import { jsx as
|
|
22185
|
-
var AirbnbSearchInput = React83.forwardRef(({ onReset, placeholder, wrapperClassName, ...props }, ref) => {
|
|
22229
|
+
import { jsx as jsx194, jsxs as jsxs125 } from "react/jsx-runtime";
|
|
22230
|
+
var AirbnbSearchInput = React83.forwardRef(({ onReset, placeholder, helper, wrapperClassName, ...props }, ref) => {
|
|
22186
22231
|
const { t } = useTranslation44();
|
|
22232
|
+
const generatedId = React83.useId();
|
|
22233
|
+
const helperId = helper ? `${props.id ?? generatedId}-helper` : void 0;
|
|
22187
22234
|
const placeholderText = placeholder || t("search_property") + "...";
|
|
22188
|
-
|
|
22189
|
-
/* @__PURE__ */
|
|
22190
|
-
/* @__PURE__ */
|
|
22235
|
+
const field = /* @__PURE__ */ jsxs125("div", { className: cn("input-wrapper relative", wrapperClassName), children: [
|
|
22236
|
+
/* @__PURE__ */ jsx194(Search6, { className: "absolute left-4 top-1/2 h-5 w-5 -translate-y-1/2 transform text-[var(--chekin-neutral-500)]" }),
|
|
22237
|
+
/* @__PURE__ */ jsx194(
|
|
22191
22238
|
"input",
|
|
22192
22239
|
{
|
|
22193
22240
|
...props,
|
|
@@ -22200,22 +22247,30 @@ var AirbnbSearchInput = React83.forwardRef(({ onReset, placeholder, wrapperClass
|
|
|
22200
22247
|
onFocus: props.onFocus,
|
|
22201
22248
|
onBlur: props.onBlur,
|
|
22202
22249
|
placeholder: placeholderText,
|
|
22250
|
+
"aria-describedby": helperId ?? props["aria-describedby"],
|
|
22203
22251
|
className: cn(
|
|
22204
22252
|
"placeholder-shown:bg-accent flex h-10 w-full rounded-md border border-input bg-background py-3 pl-12 pr-4 text-base text-[#2d3748] ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-base placeholder:font-medium placeholder:text-[var(--chekin-neutral-500)] focus:border-gray-300 focus:outline-none focus:ring-0 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
22205
22253
|
props.className
|
|
22206
22254
|
)
|
|
22207
22255
|
}
|
|
22208
22256
|
),
|
|
22209
|
-
onReset && /* @__PURE__ */
|
|
22257
|
+
onReset && /* @__PURE__ */ jsx194(
|
|
22210
22258
|
Button,
|
|
22211
22259
|
{
|
|
22212
22260
|
variant: "ghost",
|
|
22213
22261
|
onClick: onReset,
|
|
22214
22262
|
className: "absolute right-0 top-1/2 h-5 w-5 -translate-y-1/2 transform text-[var(--chekin-neutral-500)]",
|
|
22215
|
-
children: /* @__PURE__ */
|
|
22263
|
+
children: /* @__PURE__ */ jsx194(X11, { className: "h-5 w-5" })
|
|
22216
22264
|
}
|
|
22217
22265
|
)
|
|
22218
22266
|
] });
|
|
22267
|
+
if (!helper) {
|
|
22268
|
+
return field;
|
|
22269
|
+
}
|
|
22270
|
+
return /* @__PURE__ */ jsxs125("div", { className: "w-full", children: [
|
|
22271
|
+
field,
|
|
22272
|
+
/* @__PURE__ */ jsx194(AirbnbFieldHelperText, { id: helperId, helper, disabled: props.disabled })
|
|
22273
|
+
] });
|
|
22219
22274
|
});
|
|
22220
22275
|
AirbnbSearchInput.displayName = "AirbnbSearchInput";
|
|
22221
22276
|
|
|
@@ -22223,7 +22278,7 @@ AirbnbSearchInput.displayName = "AirbnbSearchInput";
|
|
|
22223
22278
|
import * as React84 from "react";
|
|
22224
22279
|
import * as SwitchPrimitives2 from "@radix-ui/react-switch";
|
|
22225
22280
|
import { Check as Check8 } from "lucide-react";
|
|
22226
|
-
import { Fragment as Fragment18, jsx as
|
|
22281
|
+
import { Fragment as Fragment18, jsx as jsx195, jsxs as jsxs126 } from "react/jsx-runtime";
|
|
22227
22282
|
var AirbnbSwitch = React84.forwardRef(
|
|
22228
22283
|
({
|
|
22229
22284
|
className,
|
|
@@ -22235,15 +22290,18 @@ var AirbnbSwitch = React84.forwardRef(
|
|
|
22235
22290
|
id,
|
|
22236
22291
|
label,
|
|
22237
22292
|
error,
|
|
22293
|
+
helper,
|
|
22238
22294
|
wrapperClassName,
|
|
22239
22295
|
...props
|
|
22240
22296
|
}, ref) => {
|
|
22241
22297
|
const generatedId = React84.useId();
|
|
22242
22298
|
const fieldId = id || generatedId;
|
|
22243
|
-
const
|
|
22299
|
+
const helperId = `${fieldId}-helper`;
|
|
22300
|
+
const switchElement = /* @__PURE__ */ jsx195(
|
|
22244
22301
|
SwitchPrimitives2.Root,
|
|
22245
22302
|
{
|
|
22246
22303
|
ref,
|
|
22304
|
+
"aria-describedby": helper ? helperId : void 0,
|
|
22247
22305
|
className: cn(
|
|
22248
22306
|
"group inline-flex h-[24px] w-[36px] shrink-0 cursor-pointer items-center rounded-full border border-solid border-transparent p-[2px] transition-colors duration-200",
|
|
22249
22307
|
"focus-visible:outline-none focus-visible:shadow-[var(--chekin-shadow-focus)]",
|
|
@@ -22260,14 +22318,14 @@ var AirbnbSwitch = React84.forwardRef(
|
|
|
22260
22318
|
"aria-busy": loading,
|
|
22261
22319
|
"aria-readonly": readOnly,
|
|
22262
22320
|
...props,
|
|
22263
|
-
children: /* @__PURE__ */
|
|
22321
|
+
children: /* @__PURE__ */ jsx195(
|
|
22264
22322
|
SwitchPrimitives2.Thumb,
|
|
22265
22323
|
{
|
|
22266
22324
|
className: cn(
|
|
22267
22325
|
"flex h-[20px] w-[20px] items-center justify-center rounded-full bg-white shadow-[0_1px_3px_rgba(0,0,0,0.22)] transition-transform duration-200",
|
|
22268
22326
|
"data-[state=checked]:translate-x-[12px] data-[state=unchecked]:translate-x-0"
|
|
22269
22327
|
),
|
|
22270
|
-
children: /* @__PURE__ */
|
|
22328
|
+
children: /* @__PURE__ */ jsx195(
|
|
22271
22329
|
Check8,
|
|
22272
22330
|
{
|
|
22273
22331
|
"aria-hidden": "true",
|
|
@@ -22279,13 +22337,13 @@ var AirbnbSwitch = React84.forwardRef(
|
|
|
22279
22337
|
)
|
|
22280
22338
|
}
|
|
22281
22339
|
);
|
|
22282
|
-
if (!label && !error) {
|
|
22340
|
+
if (!label && !error && !helper) {
|
|
22283
22341
|
return switchElement;
|
|
22284
22342
|
}
|
|
22285
22343
|
return /* @__PURE__ */ jsxs126(Fragment18, { children: [
|
|
22286
22344
|
/* @__PURE__ */ jsxs126("div", { className: cn("flex items-center gap-x-3 gap-y-1.5", wrapperClassName), children: [
|
|
22287
22345
|
switchElement,
|
|
22288
|
-
label && /* @__PURE__ */
|
|
22346
|
+
label && /* @__PURE__ */ jsx195(
|
|
22289
22347
|
Label,
|
|
22290
22348
|
{
|
|
22291
22349
|
htmlFor: fieldId,
|
|
@@ -22297,7 +22355,8 @@ var AirbnbSwitch = React84.forwardRef(
|
|
|
22297
22355
|
}
|
|
22298
22356
|
)
|
|
22299
22357
|
] }),
|
|
22300
|
-
error && /* @__PURE__ */
|
|
22358
|
+
error && /* @__PURE__ */ jsx195(ErrorMessage, { disabled, children: error }),
|
|
22359
|
+
!error && /* @__PURE__ */ jsx195(AirbnbFieldHelperText, { id: helperId, helper, disabled })
|
|
22301
22360
|
] });
|
|
22302
22361
|
}
|
|
22303
22362
|
);
|
|
@@ -22309,6 +22368,7 @@ export {
|
|
|
22309
22368
|
AccordionItem,
|
|
22310
22369
|
AccordionTrigger,
|
|
22311
22370
|
AirbnbDatePicker,
|
|
22371
|
+
AirbnbFieldHelperText,
|
|
22312
22372
|
AirbnbFieldTrigger,
|
|
22313
22373
|
AirbnbInput,
|
|
22314
22374
|
AirbnbPhoneField,
|