@chekinapp/ui 0.0.126 → 0.0.127
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 +214 -105
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -8
- package/dist/index.d.ts +13 -8
- package/dist/index.js +277 -169
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -12122,7 +12122,7 @@ function Fieldset({
|
|
|
12122
12122
|
{
|
|
12123
12123
|
"aria-hidden": "true",
|
|
12124
12124
|
className: cn(
|
|
12125
|
-
"pointer-events-none absolute -top-[5px] bottom-0 left-0 right-0 m-0 min-w-0 rounded-[6px] border px-[13px] transition-colors duration-75",
|
|
12125
|
+
"pointer-events-none absolute -top-[5px] bottom-0 left-0 right-0 m-0 min-w-0 rounded-[6px] border px-[13px] text-left transition-colors duration-75",
|
|
12126
12126
|
"border-[var(--chekin-color-gray-3)]",
|
|
12127
12127
|
isActivated && "border-[var(--chekin-color-gray-2)]",
|
|
12128
12128
|
isFocused && "border-[var(--chekin-color-brand-blue)]",
|
|
@@ -12426,10 +12426,6 @@ Input.displayName = "Input";
|
|
|
12426
12426
|
import * as React50 from "react";
|
|
12427
12427
|
import { useTranslation as useTranslation34 } from "react-i18next";
|
|
12428
12428
|
|
|
12429
|
-
// src/dashboard/select/Select.tsx
|
|
12430
|
-
import * as React49 from "react";
|
|
12431
|
-
import { useTranslation as useTranslation33 } from "react-i18next";
|
|
12432
|
-
|
|
12433
12429
|
// src/dashboard/_select-internals/SelectFieldShell.tsx
|
|
12434
12430
|
import { useTranslation as useTranslation27 } from "react-i18next";
|
|
12435
12431
|
import { jsx as jsx144, jsxs as jsxs91 } from "react/jsx-runtime";
|
|
@@ -12557,6 +12553,46 @@ function isOptionSelected(option, selectedValue, selectedValues) {
|
|
|
12557
12553
|
function defaultIsOptionSelected(option, selectValue) {
|
|
12558
12554
|
return selectValue.some((item) => item.value === option.value);
|
|
12559
12555
|
}
|
|
12556
|
+
var COUNTRY_ALIASES = [["T\xFCrkiye", ["Turkey", "Turkiye"]]];
|
|
12557
|
+
function normalizeSearchText(value) {
|
|
12558
|
+
return value.normalize("NFD").replace(/[̀-ͯ]/g, "").toLowerCase();
|
|
12559
|
+
}
|
|
12560
|
+
var ALIAS_LOOKUP = COUNTRY_ALIASES.reduce(
|
|
12561
|
+
(acc, [officialName, aliases]) => {
|
|
12562
|
+
const officialLower = normalizeSearchText(officialName);
|
|
12563
|
+
aliases.forEach((alias) => {
|
|
12564
|
+
acc[normalizeSearchText(alias)] = officialLower;
|
|
12565
|
+
});
|
|
12566
|
+
return acc;
|
|
12567
|
+
},
|
|
12568
|
+
{}
|
|
12569
|
+
);
|
|
12570
|
+
function getOptionSearchText(option) {
|
|
12571
|
+
if (typeof option.label === "string" || typeof option.label === "number") {
|
|
12572
|
+
return String(option.label);
|
|
12573
|
+
}
|
|
12574
|
+
return String(option.value);
|
|
12575
|
+
}
|
|
12576
|
+
function countriesFilter(option, inputValue) {
|
|
12577
|
+
const input = normalizeSearchText(inputValue.trim());
|
|
12578
|
+
if (!input) {
|
|
12579
|
+
return true;
|
|
12580
|
+
}
|
|
12581
|
+
const label = normalizeSearchText(getOptionSearchText(option));
|
|
12582
|
+
if (label.includes(input)) {
|
|
12583
|
+
return true;
|
|
12584
|
+
}
|
|
12585
|
+
const officialName = ALIAS_LOOKUP[input];
|
|
12586
|
+
if (officialName && label.includes(officialName)) {
|
|
12587
|
+
return true;
|
|
12588
|
+
}
|
|
12589
|
+
for (const [alias, official] of Object.entries(ALIAS_LOOKUP)) {
|
|
12590
|
+
if (alias.includes(input) && label.includes(official)) {
|
|
12591
|
+
return true;
|
|
12592
|
+
}
|
|
12593
|
+
}
|
|
12594
|
+
return false;
|
|
12595
|
+
}
|
|
12560
12596
|
|
|
12561
12597
|
// src/dashboard/_select-internals/slots/DefaultOption.tsx
|
|
12562
12598
|
import { Check as Check6 } from "lucide-react";
|
|
@@ -12906,15 +12942,19 @@ function SelectTrigger({
|
|
|
12906
12942
|
labelId,
|
|
12907
12943
|
valueId,
|
|
12908
12944
|
describedErrorId,
|
|
12945
|
+
accessibleLabel,
|
|
12909
12946
|
hasValue,
|
|
12910
12947
|
isOpen,
|
|
12911
12948
|
isBlocked,
|
|
12912
12949
|
disabled,
|
|
12950
|
+
readOnly,
|
|
12913
12951
|
loading,
|
|
12914
12952
|
invalid,
|
|
12915
12953
|
placeholder,
|
|
12954
|
+
showPlaceholderWhenIdle,
|
|
12916
12955
|
valueLabel,
|
|
12917
12956
|
leftIcon,
|
|
12957
|
+
hideIndicator,
|
|
12918
12958
|
onClick,
|
|
12919
12959
|
onKeyDown,
|
|
12920
12960
|
onBlur
|
|
@@ -12929,7 +12969,8 @@ function SelectTrigger({
|
|
|
12929
12969
|
"aria-haspopup": "listbox",
|
|
12930
12970
|
"aria-expanded": isOpen,
|
|
12931
12971
|
"aria-controls": listboxId,
|
|
12932
|
-
"aria-
|
|
12972
|
+
"aria-label": accessibleLabel,
|
|
12973
|
+
"aria-labelledby": accessibleLabel ? void 0 : hasValue && valueId ? `${labelId} ${valueId}` : labelId,
|
|
12933
12974
|
"aria-describedby": describedErrorId,
|
|
12934
12975
|
"aria-invalid": invalid,
|
|
12935
12976
|
"aria-busy": loading,
|
|
@@ -12941,18 +12982,19 @@ function SelectTrigger({
|
|
|
12941
12982
|
"relative m-0 box-border flex h-12 w-full cursor-pointer items-center justify-between gap-2 rounded-[6px] border-0 pr-4 text-left text-[16px] font-medium leading-5 outline-none transition-colors duration-200",
|
|
12942
12983
|
leftIcon ? "pl-10" : "pl-4",
|
|
12943
12984
|
isEmpty ? "bg-[var(--empty-field-background)] text-[var(--chekin-color-gray-1)]" : "bg-transparent text-[var(--chekin-color-brand-navy)]",
|
|
12985
|
+
readOnly && !disabled && !loading && "cursor-default",
|
|
12944
12986
|
disabled && !loading && "cursor-not-allowed opacity-50",
|
|
12945
12987
|
loading && "!cursor-progress"
|
|
12946
12988
|
),
|
|
12947
12989
|
children: [
|
|
12948
12990
|
leftIcon && /* @__PURE__ */ jsx149("span", { className: "pointer-events-none absolute left-0 top-0 flex h-full max-w-10 items-center justify-center text-[var(--chekin-color-gray-2)]", children: /* @__PURE__ */ jsx149("span", { className: "flex h-full w-10 items-center justify-center", children: leftIcon }) }),
|
|
12949
|
-
/* @__PURE__ */ jsx149("span", { id: valueId, className: "block min-w-0 flex-1 truncate text-left", children: valueLabel
|
|
12950
|
-
/* @__PURE__ */ jsx149("span", { className: "
|
|
12991
|
+
/* @__PURE__ */ jsx149("span", { id: valueId, className: "block min-w-0 flex-1 truncate text-left", children: hasValue ? valueLabel : showPlaceholderWhenIdle || isOpen ? placeholder : null }),
|
|
12992
|
+
/* @__PURE__ */ jsx149("span", { className: "flex items-center gap-2 text-[var(--chekin-color-gray-2)]", children: !hideIndicator && /* @__PURE__ */ jsx149(
|
|
12951
12993
|
ChevronDown2,
|
|
12952
12994
|
{
|
|
12953
12995
|
size: 16,
|
|
12954
12996
|
className: cn(
|
|
12955
|
-
"transition-transform duration-200",
|
|
12997
|
+
"pointer-events-none transition-transform duration-200",
|
|
12956
12998
|
isOpen && "rotate-180 text-[var(--chekin-color-brand-blue)]"
|
|
12957
12999
|
)
|
|
12958
13000
|
}
|
|
@@ -12972,6 +13014,7 @@ function ComboboxTrigger({
|
|
|
12972
13014
|
labelId,
|
|
12973
13015
|
valueId,
|
|
12974
13016
|
describedErrorId,
|
|
13017
|
+
accessibleLabel,
|
|
12975
13018
|
isOpen,
|
|
12976
13019
|
isFocused,
|
|
12977
13020
|
isBlocked,
|
|
@@ -12985,6 +13028,7 @@ function ComboboxTrigger({
|
|
|
12985
13028
|
inputRef,
|
|
12986
13029
|
inputValue,
|
|
12987
13030
|
placeholder,
|
|
13031
|
+
showPlaceholderWhenIdle,
|
|
12988
13032
|
highlightedIndex,
|
|
12989
13033
|
getOptionId: getOptionId2,
|
|
12990
13034
|
onInputChange,
|
|
@@ -12999,7 +13043,8 @@ function ComboboxTrigger({
|
|
|
12999
13043
|
containerClassName,
|
|
13000
13044
|
inputClassName,
|
|
13001
13045
|
hideIndicator,
|
|
13002
|
-
autoFocus
|
|
13046
|
+
autoFocus,
|
|
13047
|
+
searchable = true
|
|
13003
13048
|
}) {
|
|
13004
13049
|
const { t } = useTranslation30();
|
|
13005
13050
|
const resolvedPlaceholder = placeholder ?? t("type_to_search");
|
|
@@ -13011,7 +13056,8 @@ function ComboboxTrigger({
|
|
|
13011
13056
|
"aria-haspopup": "listbox",
|
|
13012
13057
|
"aria-expanded": isOpen,
|
|
13013
13058
|
"aria-controls": listboxId,
|
|
13014
|
-
"aria-
|
|
13059
|
+
"aria-label": accessibleLabel,
|
|
13060
|
+
"aria-labelledby": accessibleLabel ? void 0 : hasValue && valueId ? `${labelId} ${valueId}` : labelId,
|
|
13015
13061
|
"aria-describedby": describedErrorId,
|
|
13016
13062
|
"aria-invalid": invalid,
|
|
13017
13063
|
"aria-busy": loading,
|
|
@@ -13021,6 +13067,7 @@ function ComboboxTrigger({
|
|
|
13021
13067
|
"relative box-border flex w-full cursor-text rounded-[6px] border-0 text-left text-[16px] font-medium leading-5 outline-none transition-colors duration-200",
|
|
13022
13068
|
"min-h-12",
|
|
13023
13069
|
isEmpty && !isFocused ? "bg-[var(--empty-field-background)]" : "bg-transparent",
|
|
13070
|
+
readOnly && !disabled && !loading && "cursor-default",
|
|
13024
13071
|
disabled && !loading && "cursor-not-allowed",
|
|
13025
13072
|
loading && "!cursor-progress",
|
|
13026
13073
|
containerClassName
|
|
@@ -13048,8 +13095,8 @@ function ComboboxTrigger({
|
|
|
13048
13095
|
onFocus: onInputFocus,
|
|
13049
13096
|
onKeyDown: onInputKeyDown,
|
|
13050
13097
|
disabled: isBlocked,
|
|
13051
|
-
readOnly,
|
|
13052
|
-
placeholder: isFocused || isOpen ? resolvedPlaceholder : "",
|
|
13098
|
+
readOnly: readOnly || !searchable,
|
|
13099
|
+
placeholder: searchable && (showPlaceholderWhenIdle || isFocused || isOpen) ? resolvedPlaceholder : "",
|
|
13053
13100
|
autoComplete: "off",
|
|
13054
13101
|
autoFocus,
|
|
13055
13102
|
"aria-autocomplete": "list",
|
|
@@ -13058,7 +13105,9 @@ function ComboboxTrigger({
|
|
|
13058
13105
|
className: cn(
|
|
13059
13106
|
"m-0 box-border min-w-0 flex-1 border-0 bg-transparent p-0 text-[16px] font-medium leading-5 text-[var(--chekin-color-brand-navy)] outline-none placeholder:text-[var(--chekin-color-gray-1)]",
|
|
13060
13107
|
isMulti && "min-w-[40px]",
|
|
13061
|
-
|
|
13108
|
+
!searchable && "sr-only",
|
|
13109
|
+
readOnly && !disabled && !loading && "cursor-default",
|
|
13110
|
+
disabled && !loading && "cursor-not-allowed",
|
|
13062
13111
|
loading && "!cursor-progress",
|
|
13063
13112
|
inputClassName
|
|
13064
13113
|
)
|
|
@@ -13205,7 +13254,9 @@ function useSelectState(params) {
|
|
|
13205
13254
|
onKeyDown,
|
|
13206
13255
|
onFocus,
|
|
13207
13256
|
onBlur,
|
|
13208
|
-
|
|
13257
|
+
onInputChange,
|
|
13258
|
+
isSearchInDropdown,
|
|
13259
|
+
searchable = true
|
|
13209
13260
|
} = params;
|
|
13210
13261
|
const inputRef = React48.useRef(null);
|
|
13211
13262
|
const mobileSearchInputRef = React48.useRef(null);
|
|
@@ -13219,8 +13270,10 @@ function useSelectState(params) {
|
|
|
13219
13270
|
() => resolveValueLabel(singleSelected, getValueLabel),
|
|
13220
13271
|
[singleSelected, getValueLabel]
|
|
13221
13272
|
);
|
|
13222
|
-
const isSearchOnlyInput = isMulti || Boolean(isSearchInDropdown);
|
|
13223
|
-
const [inputValue, setInputValue] = React48.useState(
|
|
13273
|
+
const isSearchOnlyInput = searchable && (isMulti || Boolean(isSearchInDropdown));
|
|
13274
|
+
const [inputValue, setInputValue] = React48.useState(
|
|
13275
|
+
searchable && !isSearchOnlyInput ? valueLabel : ""
|
|
13276
|
+
);
|
|
13224
13277
|
const hasValue = selectedOptions.length > 0;
|
|
13225
13278
|
const isBlocked = Boolean(disabled) || Boolean(loading) || Boolean(readOnly);
|
|
13226
13279
|
const hasInvalidState = Boolean(error);
|
|
@@ -13235,9 +13288,10 @@ function useSelectState(params) {
|
|
|
13235
13288
|
const ids = useSelectIds({ name, hasValue, error, hideErrorMessage });
|
|
13236
13289
|
const { listboxId, getOptionId: getOptionId2 } = ids;
|
|
13237
13290
|
React48.useEffect(() => {
|
|
13291
|
+
if (!searchable) return;
|
|
13238
13292
|
if (isSearchOnlyInput) return;
|
|
13239
13293
|
if (!isFocused) setInputValue(valueLabel);
|
|
13240
|
-
}, [valueLabel, isFocused, isSearchOnlyInput]);
|
|
13294
|
+
}, [valueLabel, isFocused, isSearchOnlyInput, searchable]);
|
|
13241
13295
|
React48.useEffect(() => {
|
|
13242
13296
|
if (!isSearchOnlyInput) return;
|
|
13243
13297
|
if (!isOpen) {
|
|
@@ -13246,7 +13300,7 @@ function useSelectState(params) {
|
|
|
13246
13300
|
}
|
|
13247
13301
|
}, [isOpen, isSearchOnlyInput]);
|
|
13248
13302
|
const trimmedInput = inputValue.trim();
|
|
13249
|
-
const isFiltering = isSearchOnlyInput ? trimmedInput.length > 0 : trimmedInput.length > 0 && trimmedInput.toLowerCase() !== valueLabel.toLowerCase();
|
|
13303
|
+
const isFiltering = searchable && (isSearchOnlyInput ? trimmedInput.length > 0 : trimmedInput.length > 0 && trimmedInput.toLowerCase() !== valueLabel.toLowerCase());
|
|
13250
13304
|
const filteredOptions = React48.useMemo(() => {
|
|
13251
13305
|
if (!isFiltering) return options;
|
|
13252
13306
|
return options.filter((option) => filterOption(option, trimmedInput));
|
|
@@ -13277,9 +13331,9 @@ function useSelectState(params) {
|
|
|
13277
13331
|
}, [isOpen, filteredOptions, isOptionDisabled]);
|
|
13278
13332
|
React48.useEffect(() => {
|
|
13279
13333
|
if (!isOpen || highlightedIndex < 0) return;
|
|
13280
|
-
optionRefs.current[highlightedIndex]?.scrollIntoView({ block: "nearest" });
|
|
13334
|
+
optionRefs.current[highlightedIndex]?.scrollIntoView?.({ block: "nearest" });
|
|
13281
13335
|
}, [highlightedIndex, isOpen]);
|
|
13282
|
-
const inMenuSearchVisible = isMobile3 || Boolean(isSearchInDropdown);
|
|
13336
|
+
const inMenuSearchVisible = searchable && (isMobile3 || Boolean(isSearchInDropdown));
|
|
13283
13337
|
React48.useEffect(() => {
|
|
13284
13338
|
if (!isOpen || !inMenuSearchVisible) return;
|
|
13285
13339
|
const frame = window.requestAnimationFrame(
|
|
@@ -13307,7 +13361,9 @@ function useSelectState(params) {
|
|
|
13307
13361
|
return;
|
|
13308
13362
|
}
|
|
13309
13363
|
onSelectionChange([option], { action: "select" });
|
|
13310
|
-
setInputValue(
|
|
13364
|
+
setInputValue(
|
|
13365
|
+
searchable && !isSearchInDropdown ? resolveValueLabel(option, getValueLabel) : ""
|
|
13366
|
+
);
|
|
13311
13367
|
setIsOpen(false);
|
|
13312
13368
|
setIsFocused(false);
|
|
13313
13369
|
inputRef.current?.blur();
|
|
@@ -13321,7 +13377,8 @@ function useSelectState(params) {
|
|
|
13321
13377
|
closeMenuOnSelect,
|
|
13322
13378
|
setIsOpen,
|
|
13323
13379
|
getValueLabel,
|
|
13324
|
-
isSearchInDropdown
|
|
13380
|
+
isSearchInDropdown,
|
|
13381
|
+
searchable
|
|
13325
13382
|
]
|
|
13326
13383
|
);
|
|
13327
13384
|
const removeOption = React48.useCallback(
|
|
@@ -13356,7 +13413,9 @@ function useSelectState(params) {
|
|
|
13356
13413
|
return;
|
|
13357
13414
|
}
|
|
13358
13415
|
onSelectionChange([newOption], { action: "create" });
|
|
13359
|
-
setInputValue(
|
|
13416
|
+
setInputValue(
|
|
13417
|
+
searchable && !isSearchInDropdown ? resolveValueLabel(newOption, getValueLabel) : ""
|
|
13418
|
+
);
|
|
13360
13419
|
setIsOpen(false);
|
|
13361
13420
|
setIsFocused(false);
|
|
13362
13421
|
inputRef.current?.blur();
|
|
@@ -13370,14 +13429,18 @@ function useSelectState(params) {
|
|
|
13370
13429
|
closeMenuOnSelect,
|
|
13371
13430
|
setIsOpen,
|
|
13372
13431
|
getValueLabel,
|
|
13373
|
-
isSearchInDropdown
|
|
13432
|
+
isSearchInDropdown,
|
|
13433
|
+
searchable
|
|
13374
13434
|
]);
|
|
13375
13435
|
const handleInputChange = React48.useCallback(
|
|
13376
13436
|
(event) => {
|
|
13377
|
-
|
|
13437
|
+
if (!searchable) return;
|
|
13438
|
+
const nextValue = event.target.value;
|
|
13439
|
+
setInputValue(nextValue);
|
|
13440
|
+
onInputChange?.(nextValue);
|
|
13378
13441
|
if (!isOpen) setIsOpen(true);
|
|
13379
13442
|
},
|
|
13380
|
-
[isOpen, setIsOpen]
|
|
13443
|
+
[isOpen, onInputChange, searchable, setIsOpen]
|
|
13381
13444
|
);
|
|
13382
13445
|
const handleInputFocus = React48.useCallback(
|
|
13383
13446
|
(event) => {
|
|
@@ -13385,11 +13448,11 @@ function useSelectState(params) {
|
|
|
13385
13448
|
onFocus?.(event);
|
|
13386
13449
|
setIsFocused(true);
|
|
13387
13450
|
if (openMenuOnFocus) setIsOpen(true);
|
|
13388
|
-
if (!isMulti) {
|
|
13451
|
+
if (searchable && !isMulti) {
|
|
13389
13452
|
requestAnimationFrame(() => inputRef.current?.select());
|
|
13390
13453
|
}
|
|
13391
13454
|
},
|
|
13392
|
-
[isBlocked, onFocus, openMenuOnFocus, setIsOpen, isMulti]
|
|
13455
|
+
[isBlocked, onFocus, openMenuOnFocus, setIsOpen, searchable, isMulti]
|
|
13393
13456
|
);
|
|
13394
13457
|
const handleContainerClick = React48.useCallback(() => {
|
|
13395
13458
|
if (isBlocked) return;
|
|
@@ -13400,10 +13463,10 @@ function useSelectState(params) {
|
|
|
13400
13463
|
(event) => {
|
|
13401
13464
|
if (containerRef.current?.contains(event.relatedTarget)) return;
|
|
13402
13465
|
setIsFocused(false);
|
|
13403
|
-
if (!isSearchOnlyInput) setInputValue(valueLabel);
|
|
13466
|
+
if (searchable && !isSearchOnlyInput) setInputValue(valueLabel);
|
|
13404
13467
|
onBlur?.(event);
|
|
13405
13468
|
},
|
|
13406
|
-
[containerRef, isSearchOnlyInput, valueLabel, onBlur]
|
|
13469
|
+
[containerRef, isSearchOnlyInput, searchable, valueLabel, onBlur]
|
|
13407
13470
|
);
|
|
13408
13471
|
const handleInputKeyDown = React48.useCallback(
|
|
13409
13472
|
(event) => {
|
|
@@ -13457,7 +13520,7 @@ function useSelectState(params) {
|
|
|
13457
13520
|
}
|
|
13458
13521
|
if (event.key === "Escape") {
|
|
13459
13522
|
event.preventDefault();
|
|
13460
|
-
if (!isSearchOnlyInput) setInputValue(valueLabel);
|
|
13523
|
+
if (searchable && !isSearchOnlyInput) setInputValue(valueLabel);
|
|
13461
13524
|
setIsOpen(false);
|
|
13462
13525
|
inputRef.current?.blur();
|
|
13463
13526
|
}
|
|
@@ -13477,7 +13540,8 @@ function useSelectState(params) {
|
|
|
13477
13540
|
selectOption,
|
|
13478
13541
|
canCreateNewOption,
|
|
13479
13542
|
createOption,
|
|
13480
|
-
valueLabel
|
|
13543
|
+
valueLabel,
|
|
13544
|
+
searchable
|
|
13481
13545
|
]
|
|
13482
13546
|
);
|
|
13483
13547
|
const isEmpty = !hasValue && !inputValue;
|
|
@@ -13577,10 +13641,12 @@ function DefaultControl(props) {
|
|
|
13577
13641
|
labelId,
|
|
13578
13642
|
valueId,
|
|
13579
13643
|
describedErrorId,
|
|
13644
|
+
accessibleLabel,
|
|
13580
13645
|
getOptionId: getOptionId2,
|
|
13581
13646
|
inputRef,
|
|
13582
13647
|
inputValue,
|
|
13583
13648
|
placeholder,
|
|
13649
|
+
showPlaceholderWhenIdle,
|
|
13584
13650
|
isMulti,
|
|
13585
13651
|
isOpen,
|
|
13586
13652
|
isFocused,
|
|
@@ -13604,6 +13670,7 @@ function DefaultControl(props) {
|
|
|
13604
13670
|
hideIndicator,
|
|
13605
13671
|
autoFocus,
|
|
13606
13672
|
leftIcon,
|
|
13673
|
+
searchable,
|
|
13607
13674
|
components
|
|
13608
13675
|
} = props;
|
|
13609
13676
|
const Chip = components.MultiValueChip ?? DefaultMultiValueChip;
|
|
@@ -13617,6 +13684,7 @@ function DefaultControl(props) {
|
|
|
13617
13684
|
labelId,
|
|
13618
13685
|
valueId,
|
|
13619
13686
|
describedErrorId,
|
|
13687
|
+
accessibleLabel,
|
|
13620
13688
|
isOpen,
|
|
13621
13689
|
isFocused,
|
|
13622
13690
|
isBlocked,
|
|
@@ -13630,6 +13698,7 @@ function DefaultControl(props) {
|
|
|
13630
13698
|
inputRef,
|
|
13631
13699
|
inputValue,
|
|
13632
13700
|
placeholder: placeholderText,
|
|
13701
|
+
showPlaceholderWhenIdle,
|
|
13633
13702
|
highlightedIndex,
|
|
13634
13703
|
getOptionId: getOptionId2,
|
|
13635
13704
|
onInputChange,
|
|
@@ -13642,6 +13711,7 @@ function DefaultControl(props) {
|
|
|
13642
13711
|
hideIndicator,
|
|
13643
13712
|
autoFocus,
|
|
13644
13713
|
leftIcon,
|
|
13714
|
+
searchable,
|
|
13645
13715
|
leadingContent: isMulti ? selectedOptions.map((option) => /* @__PURE__ */ jsx152(
|
|
13646
13716
|
Chip,
|
|
13647
13717
|
{
|
|
@@ -13656,7 +13726,8 @@ function DefaultControl(props) {
|
|
|
13656
13726
|
}
|
|
13657
13727
|
|
|
13658
13728
|
// src/dashboard/_select-internals/slots/StaticControl.tsx
|
|
13659
|
-
import {
|
|
13729
|
+
import { SquareX as SquareX3 } from "lucide-react";
|
|
13730
|
+
import { jsx as jsx153, jsxs as jsxs99 } from "react/jsx-runtime";
|
|
13660
13731
|
function StaticControl(props) {
|
|
13661
13732
|
const {
|
|
13662
13733
|
triggerId,
|
|
@@ -13664,6 +13735,7 @@ function StaticControl(props) {
|
|
|
13664
13735
|
labelId,
|
|
13665
13736
|
valueId,
|
|
13666
13737
|
describedErrorId,
|
|
13738
|
+
accessibleLabel,
|
|
13667
13739
|
isOpen,
|
|
13668
13740
|
isBlocked,
|
|
13669
13741
|
hasValue,
|
|
@@ -13672,30 +13744,53 @@ function StaticControl(props) {
|
|
|
13672
13744
|
disabled,
|
|
13673
13745
|
valueLabel,
|
|
13674
13746
|
placeholder,
|
|
13747
|
+
showPlaceholderWhenIdle,
|
|
13675
13748
|
onContainerClick,
|
|
13749
|
+
onClear,
|
|
13750
|
+
clearable,
|
|
13751
|
+
clearLabel,
|
|
13752
|
+
hideIndicator,
|
|
13753
|
+
readOnly,
|
|
13676
13754
|
leftIcon
|
|
13677
13755
|
} = props;
|
|
13678
|
-
|
|
13679
|
-
|
|
13680
|
-
|
|
13681
|
-
|
|
13682
|
-
|
|
13683
|
-
|
|
13684
|
-
|
|
13685
|
-
|
|
13686
|
-
|
|
13687
|
-
|
|
13688
|
-
|
|
13689
|
-
|
|
13690
|
-
|
|
13691
|
-
|
|
13692
|
-
|
|
13693
|
-
|
|
13694
|
-
|
|
13695
|
-
|
|
13696
|
-
|
|
13697
|
-
|
|
13698
|
-
|
|
13756
|
+
const showClear = Boolean(clearable) && hasValue && !readOnly && !disabled;
|
|
13757
|
+
return /* @__PURE__ */ jsxs99("div", { className: "relative", children: [
|
|
13758
|
+
/* @__PURE__ */ jsx153(
|
|
13759
|
+
SelectTrigger,
|
|
13760
|
+
{
|
|
13761
|
+
triggerId,
|
|
13762
|
+
listboxId,
|
|
13763
|
+
labelId,
|
|
13764
|
+
valueId,
|
|
13765
|
+
describedErrorId,
|
|
13766
|
+
accessibleLabel,
|
|
13767
|
+
hasValue,
|
|
13768
|
+
isOpen,
|
|
13769
|
+
isBlocked,
|
|
13770
|
+
disabled,
|
|
13771
|
+
readOnly,
|
|
13772
|
+
loading,
|
|
13773
|
+
invalid,
|
|
13774
|
+
placeholder,
|
|
13775
|
+
showPlaceholderWhenIdle,
|
|
13776
|
+
valueLabel,
|
|
13777
|
+
leftIcon,
|
|
13778
|
+
hideIndicator,
|
|
13779
|
+
onClick: onContainerClick,
|
|
13780
|
+
onKeyDown: () => void 0
|
|
13781
|
+
}
|
|
13782
|
+
),
|
|
13783
|
+
showClear && /* @__PURE__ */ jsx153(
|
|
13784
|
+
"button",
|
|
13785
|
+
{
|
|
13786
|
+
type: "button",
|
|
13787
|
+
onClick: onClear,
|
|
13788
|
+
className: "absolute right-9 top-1/2 flex h-5 w-5 -translate-y-1/2 items-center justify-center rounded-[3px] border-0 bg-transparent p-0 text-[#9696b9] hover:shadow-[0_3px_3px_#0f477734]",
|
|
13789
|
+
"aria-label": clearLabel,
|
|
13790
|
+
children: /* @__PURE__ */ jsx153(SquareX3, { size: 15, fill: "#9696b9", color: "#f8f8f8", strokeWidth: 1.8 })
|
|
13791
|
+
}
|
|
13792
|
+
)
|
|
13793
|
+
] });
|
|
13699
13794
|
}
|
|
13700
13795
|
|
|
13701
13796
|
// src/dashboard/_select-internals/slots/DefaultMenuList.tsx
|
|
@@ -13803,6 +13898,10 @@ function mergeComponents(overrides) {
|
|
|
13803
13898
|
};
|
|
13804
13899
|
}
|
|
13805
13900
|
|
|
13901
|
+
// src/dashboard/select/Select.tsx
|
|
13902
|
+
import * as React49 from "react";
|
|
13903
|
+
import { useTranslation as useTranslation33 } from "react-i18next";
|
|
13904
|
+
|
|
13806
13905
|
// src/dashboard/select/useSetCorrectOptionIfThereIsOnlyValue.ts
|
|
13807
13906
|
import { useEffect as useEffect39 } from "react";
|
|
13808
13907
|
function useSetCorrectOptionIfThereIsOnlyValue({ value, options, onChange, enabled = true }) {
|
|
@@ -13819,7 +13918,7 @@ function useSetCorrectOptionIfThereIsOnlyValue({ value, options, onChange, enabl
|
|
|
13819
13918
|
}
|
|
13820
13919
|
|
|
13821
13920
|
// src/dashboard/select/Select.tsx
|
|
13822
|
-
import { jsx as jsx156, jsxs as
|
|
13921
|
+
import { jsx as jsx156, jsxs as jsxs100 } from "react/jsx-runtime";
|
|
13823
13922
|
function SelectInternal(props, ref) {
|
|
13824
13923
|
const {
|
|
13825
13924
|
options = [],
|
|
@@ -13862,6 +13961,7 @@ function SelectInternal(props, ref) {
|
|
|
13862
13961
|
openMenuOnFocus,
|
|
13863
13962
|
components: userComponents,
|
|
13864
13963
|
onInputChange,
|
|
13964
|
+
searchable = true,
|
|
13865
13965
|
searchPosition = "trigger",
|
|
13866
13966
|
menuHeader,
|
|
13867
13967
|
onMenuScrollToBottom,
|
|
@@ -13869,8 +13969,8 @@ function SelectInternal(props, ref) {
|
|
|
13869
13969
|
formatGroupLabel,
|
|
13870
13970
|
onReset
|
|
13871
13971
|
} = props;
|
|
13872
|
-
const isSearchInDropdown = searchPosition === "dropdown";
|
|
13873
13972
|
const isMulti = props.isMulti === true;
|
|
13973
|
+
const isSearchInDropdown = searchable && searchPosition === "dropdown";
|
|
13874
13974
|
const clearable = !isMulti ? props.clearable ?? true : true;
|
|
13875
13975
|
const closeMenuOnSelect = isMulti ? props.closeMenuOnSelect ?? false : void 0;
|
|
13876
13976
|
const { t } = useTranslation33();
|
|
@@ -13929,25 +14029,24 @@ function SelectInternal(props, ref) {
|
|
|
13929
14029
|
onKeyDown,
|
|
13930
14030
|
onFocus,
|
|
13931
14031
|
onBlur,
|
|
13932
|
-
|
|
14032
|
+
onInputChange,
|
|
14033
|
+
isSearchInDropdown,
|
|
14034
|
+
searchable
|
|
13933
14035
|
});
|
|
13934
14036
|
const components = React49.useMemo(() => {
|
|
13935
14037
|
const merged = mergeComponents(userComponents);
|
|
13936
|
-
if (isSearchInDropdown && !userComponents?.Control) {
|
|
14038
|
+
if ((isSearchInDropdown || !searchable && !isMulti) && !userComponents?.Control) {
|
|
13937
14039
|
return { ...merged, Control: StaticControl };
|
|
13938
14040
|
}
|
|
13939
14041
|
return merged;
|
|
13940
|
-
}, [userComponents, isSearchInDropdown]);
|
|
14042
|
+
}, [userComponents, isSearchInDropdown, searchable, isMulti]);
|
|
13941
14043
|
React49.useImperativeHandle(
|
|
13942
14044
|
ref,
|
|
13943
14045
|
() => state.containerRef.current
|
|
13944
14046
|
);
|
|
13945
|
-
const
|
|
13946
|
-
|
|
13947
|
-
|
|
13948
|
-
onInputChangeRef.current?.(state.inputValue);
|
|
13949
|
-
}, [state.inputValue]);
|
|
13950
|
-
const resolvedLabel = label ?? placeholder;
|
|
14047
|
+
const hasLabel = Boolean(label);
|
|
14048
|
+
const resolvedTitle = label ?? placeholder;
|
|
14049
|
+
const accessibleLabel = !hasLabel && typeof placeholder === "string" ? placeholder : void 0;
|
|
13951
14050
|
const hasInvalidState = state.hasInvalidState || Boolean(invalid);
|
|
13952
14051
|
const hiddenValue = isMulti ? selectedOptions.map((item) => String(item.value)).join(",") : selectedOptions[0] ? String(selectedOptions[0].value) : "";
|
|
13953
14052
|
const handleClear = (event) => {
|
|
@@ -13955,7 +14054,7 @@ function SelectInternal(props, ref) {
|
|
|
13955
14054
|
onReset?.();
|
|
13956
14055
|
};
|
|
13957
14056
|
const { Control, MenuList, CreateOption } = components;
|
|
13958
|
-
return /* @__PURE__ */
|
|
14057
|
+
return /* @__PURE__ */ jsxs100(
|
|
13959
14058
|
SelectFieldShell,
|
|
13960
14059
|
{
|
|
13961
14060
|
containerRef: state.containerRef,
|
|
@@ -13982,10 +14081,12 @@ function SelectInternal(props, ref) {
|
|
|
13982
14081
|
labelId: state.ids.labelId,
|
|
13983
14082
|
valueId: state.ids.valueId,
|
|
13984
14083
|
describedErrorId: state.ids.describedErrorId,
|
|
14084
|
+
accessibleLabel,
|
|
13985
14085
|
getOptionId: state.ids.getOptionId,
|
|
13986
14086
|
inputRef: state.inputRef,
|
|
13987
14087
|
inputValue: state.inputValue,
|
|
13988
14088
|
placeholder,
|
|
14089
|
+
showPlaceholderWhenIdle: !hasLabel,
|
|
13989
14090
|
isMulti,
|
|
13990
14091
|
isOpen: state.isOpen,
|
|
13991
14092
|
isFocused: state.isFocused,
|
|
@@ -14010,6 +14111,7 @@ function SelectInternal(props, ref) {
|
|
|
14010
14111
|
hideIndicator,
|
|
14011
14112
|
autoFocus,
|
|
14012
14113
|
leftIcon,
|
|
14114
|
+
searchable,
|
|
14013
14115
|
components
|
|
14014
14116
|
}
|
|
14015
14117
|
),
|
|
@@ -14025,15 +14127,15 @@ function SelectInternal(props, ref) {
|
|
|
14025
14127
|
readOnly,
|
|
14026
14128
|
htmlFor: state.ids.triggerId,
|
|
14027
14129
|
labelId: state.ids.labelId,
|
|
14028
|
-
legend:
|
|
14029
|
-
label
|
|
14130
|
+
legend: label,
|
|
14131
|
+
label,
|
|
14030
14132
|
tooltip,
|
|
14031
14133
|
onClick: state.handleContainerClick,
|
|
14032
14134
|
labelClassName: leftIcon ? "pl-[28px]" : void 0,
|
|
14033
14135
|
className: fieldsetClassName
|
|
14034
14136
|
}
|
|
14035
14137
|
),
|
|
14036
|
-
/* @__PURE__ */
|
|
14138
|
+
/* @__PURE__ */ jsxs100(
|
|
14037
14139
|
SelectMenuPanel,
|
|
14038
14140
|
{
|
|
14039
14141
|
isOpen: state.isOpen,
|
|
@@ -14042,7 +14144,7 @@ function SelectInternal(props, ref) {
|
|
|
14042
14144
|
state.closeMenu();
|
|
14043
14145
|
state.setIsFocused(false);
|
|
14044
14146
|
},
|
|
14045
|
-
title:
|
|
14147
|
+
title: resolvedTitle,
|
|
14046
14148
|
className: dropdownClassName,
|
|
14047
14149
|
drawerClassName,
|
|
14048
14150
|
children: [
|
|
@@ -14148,7 +14250,7 @@ function formatPhoneCodeOptionLabel(option) {
|
|
|
14148
14250
|
}
|
|
14149
14251
|
|
|
14150
14252
|
// src/dashboard/phone-input/PhoneInput.tsx
|
|
14151
|
-
import { jsx as jsx157, jsxs as
|
|
14253
|
+
import { jsx as jsx157, jsxs as jsxs101 } from "react/jsx-runtime";
|
|
14152
14254
|
var EMPTY_VALUE = { code: "", number: "" };
|
|
14153
14255
|
var PhoneInput = React50.forwardRef(
|
|
14154
14256
|
function PhoneInput2({
|
|
@@ -14182,9 +14284,6 @@ var PhoneInput = React50.forwardRef(
|
|
|
14182
14284
|
const safeValue = value ?? EMPTY_VALUE;
|
|
14183
14285
|
const effectiveCode = safeValue.code || defaultCode || "";
|
|
14184
14286
|
const resolvedLabel = label ?? "";
|
|
14185
|
-
const resolvedPrefixLabel = prefixLabel ?? t("prefix");
|
|
14186
|
-
const isBlocked = Boolean(disabled) || Boolean(loading);
|
|
14187
|
-
const isCodeBlocked = isBlocked || Boolean(readOnly) || Boolean(codeReadOnly);
|
|
14188
14287
|
const hasExternalError = Boolean(error);
|
|
14189
14288
|
const isPrefixRequired = autoDetectCode && Boolean(safeValue.number) && !effectiveCode;
|
|
14190
14289
|
const hasInvalidState = hasExternalError || Boolean(invalid) || isPrefixRequired;
|
|
@@ -14229,7 +14328,7 @@ var PhoneInput = React50.forwardRef(
|
|
|
14229
14328
|
}
|
|
14230
14329
|
emitChange({ code: effectiveCode, number: cleanedNumber });
|
|
14231
14330
|
};
|
|
14232
|
-
return /* @__PURE__ */
|
|
14331
|
+
return /* @__PURE__ */ jsxs101(
|
|
14233
14332
|
"div",
|
|
14234
14333
|
{
|
|
14235
14334
|
className: cn(
|
|
@@ -14259,20 +14358,24 @@ var PhoneInput = React50.forwardRef(
|
|
|
14259
14358
|
}
|
|
14260
14359
|
),
|
|
14261
14360
|
topLabel && /* @__PURE__ */ jsx157("label", { className: "mb-2 block text-[14px] font-medium text-[var(--chekin-color-brand-navy)]", children: topLabel }),
|
|
14262
|
-
/* @__PURE__ */
|
|
14361
|
+
/* @__PURE__ */ jsxs101("div", { className: "grid grid-cols-[96px_minmax(0,1fr)] gap-2", children: [
|
|
14263
14362
|
/* @__PURE__ */ jsx157(
|
|
14264
14363
|
Select,
|
|
14265
14364
|
{
|
|
14266
14365
|
options: codeOptions,
|
|
14267
14366
|
value: selectedCodeOption,
|
|
14268
14367
|
onChange: handleCodeChange,
|
|
14269
|
-
label:
|
|
14368
|
+
label: prefixLabel,
|
|
14270
14369
|
placeholder: codePlaceholder,
|
|
14271
|
-
disabled
|
|
14370
|
+
disabled,
|
|
14371
|
+
readOnly: Boolean(readOnly) || Boolean(codeReadOnly),
|
|
14272
14372
|
loading,
|
|
14273
14373
|
invalid: hasInvalidState,
|
|
14274
14374
|
hideErrorMessage: true,
|
|
14275
14375
|
searchPosition: searchable ? "dropdown" : "trigger",
|
|
14376
|
+
searchable,
|
|
14377
|
+
filterOption: countriesFilter,
|
|
14378
|
+
clearable: false,
|
|
14276
14379
|
getValueLabel: (option) => option.value,
|
|
14277
14380
|
className: "!max-w-none",
|
|
14278
14381
|
dropdownClassName: "right-auto w-[280px]"
|
|
@@ -14298,7 +14401,9 @@ var PhoneInput = React50.forwardRef(
|
|
|
14298
14401
|
onFocus,
|
|
14299
14402
|
onBlur,
|
|
14300
14403
|
renderErrorMessage: false,
|
|
14301
|
-
wrapperClassName: "!max-w-none"
|
|
14404
|
+
wrapperClassName: "!max-w-none",
|
|
14405
|
+
contentClassName: readOnly ? "!cursor-default" : void 0,
|
|
14406
|
+
inputClassName: readOnly ? "!cursor-default" : void 0
|
|
14302
14407
|
}
|
|
14303
14408
|
)
|
|
14304
14409
|
] }),
|
|
@@ -14363,7 +14468,7 @@ function useInfiniteScrollContext() {
|
|
|
14363
14468
|
}
|
|
14364
14469
|
|
|
14365
14470
|
// src/dashboard/infinite-scroll-select/VirtualMenuList.tsx
|
|
14366
|
-
import { jsx as jsx161, jsxs as
|
|
14471
|
+
import { jsx as jsx161, jsxs as jsxs102 } from "react/jsx-runtime";
|
|
14367
14472
|
function VirtualMenuList(props) {
|
|
14368
14473
|
const {
|
|
14369
14474
|
id,
|
|
@@ -14453,7 +14558,7 @@ function VirtualMenuList(props) {
|
|
|
14453
14558
|
[onMenuScrollToBottom]
|
|
14454
14559
|
);
|
|
14455
14560
|
if (options.length === 0) {
|
|
14456
|
-
return /* @__PURE__ */ jsx161("div", { className: "min-h-[75px] px-4 pb-[19px] pt-[17px]", children: isLoadingMore ? /* @__PURE__ */
|
|
14561
|
+
return /* @__PURE__ */ jsx161("div", { className: "min-h-[75px] px-4 pb-[19px] pt-[17px]", children: isLoadingMore ? /* @__PURE__ */ jsxs102(
|
|
14457
14562
|
"div",
|
|
14458
14563
|
{
|
|
14459
14564
|
role: "status",
|
|
@@ -14510,7 +14615,7 @@ function VirtualMenuList(props) {
|
|
|
14510
14615
|
height: `${virtualItem.size}px`,
|
|
14511
14616
|
transform: `translateY(${virtualItem.start}px)`
|
|
14512
14617
|
},
|
|
14513
|
-
children: isLoaderRow ? /* @__PURE__ */
|
|
14618
|
+
children: isLoaderRow ? /* @__PURE__ */ jsxs102(
|
|
14514
14619
|
"div",
|
|
14515
14620
|
{
|
|
14516
14621
|
role: "status",
|
|
@@ -14577,13 +14682,14 @@ function InfiniteScrollSelectInternal(props, ref) {
|
|
|
14577
14682
|
listHeight = DEFAULT_LIST_HEIGHT,
|
|
14578
14683
|
overscan = DEFAULT_OVERSCAN,
|
|
14579
14684
|
loadMoreThreshold = DEFAULT_LOAD_MORE_THRESHOLD,
|
|
14580
|
-
getFullSearchOption,
|
|
14685
|
+
getFullSearchOption: getFullSearchOptionProp,
|
|
14581
14686
|
filterOption: userFilterOption,
|
|
14582
14687
|
components: userComponents,
|
|
14583
14688
|
onInputChange: userOnInputChange,
|
|
14584
14689
|
isMulti = false,
|
|
14585
14690
|
...rest
|
|
14586
14691
|
} = props;
|
|
14692
|
+
const getFullSearchOption = isMulti ? void 0 : getFullSearchOptionProp;
|
|
14587
14693
|
const isPaginated = canLoadMore !== void 0 || isLoadingMore !== void 0 || loadMoreItems !== void 0 || onSearchChange !== void 0 || getFullSearchOption !== void 0;
|
|
14588
14694
|
const filterOption = userFilterOption ?? (isPaginated ? passthroughFilter : defaultFilterOption);
|
|
14589
14695
|
const [inputValue, setInputValue] = React56.useState("");
|
|
@@ -14681,7 +14787,7 @@ import * as React58 from "react";
|
|
|
14681
14787
|
import { useTranslation as useTranslation37 } from "react-i18next";
|
|
14682
14788
|
|
|
14683
14789
|
// src/dashboard/select-checkboxes/SelectCheckboxOption.tsx
|
|
14684
|
-
import { jsx as jsx164, jsxs as
|
|
14790
|
+
import { jsx as jsx164, jsxs as jsxs103 } from "react/jsx-runtime";
|
|
14685
14791
|
function SelectCheckboxOption(props) {
|
|
14686
14792
|
const {
|
|
14687
14793
|
option,
|
|
@@ -14694,7 +14800,7 @@ function SelectCheckboxOption(props) {
|
|
|
14694
14800
|
onHover,
|
|
14695
14801
|
innerRef
|
|
14696
14802
|
} = props;
|
|
14697
|
-
return /* @__PURE__ */
|
|
14803
|
+
return /* @__PURE__ */ jsxs103(
|
|
14698
14804
|
"button",
|
|
14699
14805
|
{
|
|
14700
14806
|
id,
|
|
@@ -14725,7 +14831,7 @@ function SelectCheckboxOption(props) {
|
|
|
14725
14831
|
className: "pointer-events-none shrink-0"
|
|
14726
14832
|
}
|
|
14727
14833
|
),
|
|
14728
|
-
/* @__PURE__ */
|
|
14834
|
+
/* @__PURE__ */ jsxs103("span", { className: "flex min-w-0 flex-1 items-center justify-between gap-2", children: [
|
|
14729
14835
|
/* @__PURE__ */ jsx164("span", { className: "block break-words", children: option.label }),
|
|
14730
14836
|
option.description && /* @__PURE__ */ jsx164("span", { className: "shrink-0 text-[12px] font-medium italic text-[var(--chekin-color-gray-1)]", children: option.description })
|
|
14731
14837
|
] })
|
|
@@ -14737,7 +14843,7 @@ function SelectCheckboxOption(props) {
|
|
|
14737
14843
|
// src/dashboard/select-checkboxes/CountTrigger.tsx
|
|
14738
14844
|
import { ChevronDown as ChevronDown3 } from "lucide-react";
|
|
14739
14845
|
import { useTranslation as useTranslation36 } from "react-i18next";
|
|
14740
|
-
import { jsx as jsx165, jsxs as
|
|
14846
|
+
import { jsx as jsx165, jsxs as jsxs104 } from "react/jsx-runtime";
|
|
14741
14847
|
function createCountTrigger(opts) {
|
|
14742
14848
|
const { valueText, totalCount } = opts;
|
|
14743
14849
|
function CountTrigger(props) {
|
|
@@ -14764,7 +14870,7 @@ function createCountTrigger(opts) {
|
|
|
14764
14870
|
const computedText = typeof valueText === "function" ? valueText(count, total) : valueText ?? (count > 0 ? t("n_selected", { count, defaultValue: `${count} selected` }) : "");
|
|
14765
14871
|
const display = hasValue ? computedText : isOpen ? placeholder ?? null : null;
|
|
14766
14872
|
const isEmpty = !hasValue;
|
|
14767
|
-
return /* @__PURE__ */
|
|
14873
|
+
return /* @__PURE__ */ jsxs104(
|
|
14768
14874
|
"button",
|
|
14769
14875
|
{
|
|
14770
14876
|
id: triggerId,
|
|
@@ -14806,9 +14912,9 @@ function createCountTrigger(opts) {
|
|
|
14806
14912
|
}
|
|
14807
14913
|
|
|
14808
14914
|
// src/dashboard/select-checkboxes/SelectAllRow.tsx
|
|
14809
|
-
import { jsx as jsx166, jsxs as
|
|
14915
|
+
import { jsx as jsx166, jsxs as jsxs105 } from "react/jsx-runtime";
|
|
14810
14916
|
function SelectAllRow({ label, checked, disabled, onToggle }) {
|
|
14811
|
-
return /* @__PURE__ */
|
|
14917
|
+
return /* @__PURE__ */ jsxs105(
|
|
14812
14918
|
"button",
|
|
14813
14919
|
{
|
|
14814
14920
|
type: "button",
|
|
@@ -14838,7 +14944,7 @@ function SelectAllRow({ label, checked, disabled, onToggle }) {
|
|
|
14838
14944
|
// src/dashboard/select-checkboxes/SelectCheckboxes.tsx
|
|
14839
14945
|
import { Fragment as Fragment16, jsx as jsx167 } from "react/jsx-runtime";
|
|
14840
14946
|
function hasPaginationProps(props) {
|
|
14841
|
-
return props.canLoadMore !== void 0 || props.isLoadingMore !== void 0 || props.loadMoreItems !== void 0 || props.onSearchChange !== void 0
|
|
14947
|
+
return props.canLoadMore !== void 0 || props.isLoadingMore !== void 0 || props.loadMoreItems !== void 0 || props.onSearchChange !== void 0;
|
|
14842
14948
|
}
|
|
14843
14949
|
function makeTriggerSlot(render) {
|
|
14844
14950
|
function CustomTrigger(props) {
|
|
@@ -14958,6 +15064,7 @@ function SelectCheckboxesInternal(props, ref) {
|
|
|
14958
15064
|
components,
|
|
14959
15065
|
closeMenuOnSelect,
|
|
14960
15066
|
searchPosition: searchable ? "dropdown" : "trigger",
|
|
15067
|
+
searchable,
|
|
14961
15068
|
menuHeader,
|
|
14962
15069
|
onInputChange: handleInputChange,
|
|
14963
15070
|
isMulti: true
|
|
@@ -15059,7 +15166,7 @@ function useTextareaValueState({
|
|
|
15059
15166
|
}
|
|
15060
15167
|
|
|
15061
15168
|
// src/dashboard/textarea/Textarea.tsx
|
|
15062
|
-
import { jsx as jsx168, jsxs as
|
|
15169
|
+
import { jsx as jsx168, jsxs as jsxs106 } from "react/jsx-runtime";
|
|
15063
15170
|
var LINE_HEIGHT = 20;
|
|
15064
15171
|
var VERTICAL_PADDING = 32;
|
|
15065
15172
|
var Textarea = React60.forwardRef(function Textarea2({
|
|
@@ -15128,7 +15235,7 @@ var Textarea = React60.forwardRef(function Textarea2({
|
|
|
15128
15235
|
onBlur?.(event);
|
|
15129
15236
|
syncValueState();
|
|
15130
15237
|
};
|
|
15131
|
-
return /* @__PURE__ */
|
|
15238
|
+
return /* @__PURE__ */ jsxs106(
|
|
15132
15239
|
"div",
|
|
15133
15240
|
{
|
|
15134
15241
|
className: cn(
|
|
@@ -15138,7 +15245,7 @@ var Textarea = React60.forwardRef(function Textarea2({
|
|
|
15138
15245
|
className
|
|
15139
15246
|
),
|
|
15140
15247
|
children: [
|
|
15141
|
-
label && /* @__PURE__ */
|
|
15248
|
+
label && /* @__PURE__ */ jsxs106(
|
|
15142
15249
|
"label",
|
|
15143
15250
|
{
|
|
15144
15251
|
htmlFor: textareaId,
|
|
@@ -15623,7 +15730,7 @@ function useDatePickerWheel({
|
|
|
15623
15730
|
}
|
|
15624
15731
|
|
|
15625
15732
|
// src/airbnb-fields/datepicker/DatePickerWheelColumn.tsx
|
|
15626
|
-
import { jsx as jsx169, jsxs as
|
|
15733
|
+
import { jsx as jsx169, jsxs as jsxs107 } from "react/jsx-runtime";
|
|
15627
15734
|
var spacerHeight = DATE_PICKER_OPTION_HEIGHT * DATE_PICKER_WHEEL_BUFFER_OPTIONS;
|
|
15628
15735
|
function AirbnbDatePickerWheelColumn({
|
|
15629
15736
|
id,
|
|
@@ -15637,7 +15744,7 @@ function AirbnbDatePickerWheelColumn({
|
|
|
15637
15744
|
onOptionSelect,
|
|
15638
15745
|
column
|
|
15639
15746
|
}) {
|
|
15640
|
-
return /* @__PURE__ */ jsx169("div", { className: "relative z-10 min-w-0", children: /* @__PURE__ */
|
|
15747
|
+
return /* @__PURE__ */ jsx169("div", { className: "relative z-10 min-w-0", children: /* @__PURE__ */ jsxs107(
|
|
15641
15748
|
"div",
|
|
15642
15749
|
{
|
|
15643
15750
|
id,
|
|
@@ -15684,7 +15791,7 @@ function AirbnbDatePickerWheelColumn({
|
|
|
15684
15791
|
}
|
|
15685
15792
|
|
|
15686
15793
|
// src/airbnb-fields/datepicker/DatePickerContent.tsx
|
|
15687
|
-
import { jsx as jsx170, jsxs as
|
|
15794
|
+
import { jsx as jsx170, jsxs as jsxs108 } from "react/jsx-runtime";
|
|
15688
15795
|
function AirbnbDatePickerBody({
|
|
15689
15796
|
baseId,
|
|
15690
15797
|
label,
|
|
@@ -15706,8 +15813,8 @@ function AirbnbDatePickerBody({
|
|
|
15706
15813
|
onOptionSelect,
|
|
15707
15814
|
onDone
|
|
15708
15815
|
}) {
|
|
15709
|
-
return /* @__PURE__ */
|
|
15710
|
-
/* @__PURE__ */
|
|
15816
|
+
return /* @__PURE__ */ jsxs108("div", { className: "px-6 pb-4 pt-1 bg-white", children: [
|
|
15817
|
+
/* @__PURE__ */ jsxs108("div", { className: "relative overflow-hidden rounded-[24px]", children: [
|
|
15711
15818
|
/* @__PURE__ */ jsx170("div", { className: "pointer-events-none absolute inset-x-0 top-0 z-20 h-16 bg-gradient-to-b from-white via-white/80 to-transparent" }),
|
|
15712
15819
|
/* @__PURE__ */ jsx170("div", { className: "pointer-events-none absolute inset-x-0 bottom-0 z-20 h-16 bg-gradient-to-t from-white via-white/80 to-transparent" }),
|
|
15713
15820
|
/* @__PURE__ */ jsx170(
|
|
@@ -15717,7 +15824,7 @@ function AirbnbDatePickerBody({
|
|
|
15717
15824
|
className: "pointer-events-none absolute inset-x-0 top-1/2 z-0 h-8 -translate-y-1/2 rounded-[12px] bg-black/[0.04]"
|
|
15718
15825
|
}
|
|
15719
15826
|
),
|
|
15720
|
-
/* @__PURE__ */
|
|
15827
|
+
/* @__PURE__ */ jsxs108("div", { className: "relative grid grid-cols-[1.35fr_0.7fr_1fr] gap-1", children: [
|
|
15721
15828
|
/* @__PURE__ */ jsx170(
|
|
15722
15829
|
AirbnbDatePickerWheelColumn,
|
|
15723
15830
|
{
|
|
@@ -15818,7 +15925,7 @@ function AirbnbDatePickerContent({
|
|
|
15818
15925
|
}
|
|
15819
15926
|
);
|
|
15820
15927
|
if (isMobile3) {
|
|
15821
|
-
return /* @__PURE__ */ jsx170(Drawer, { open, onOpenChange, children: /* @__PURE__ */
|
|
15928
|
+
return /* @__PURE__ */ jsx170(Drawer, { open, onOpenChange, children: /* @__PURE__ */ jsxs108(
|
|
15822
15929
|
DrawerContent,
|
|
15823
15930
|
{
|
|
15824
15931
|
onClose: () => onOpenChange(false),
|
|
@@ -15831,7 +15938,7 @@ function AirbnbDatePickerContent({
|
|
|
15831
15938
|
}
|
|
15832
15939
|
) });
|
|
15833
15940
|
}
|
|
15834
|
-
return /* @__PURE__ */ jsx170(Dialog, { open, onOpenChange, children: /* @__PURE__ */
|
|
15941
|
+
return /* @__PURE__ */ jsx170(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs108(
|
|
15835
15942
|
DialogContent,
|
|
15836
15943
|
{
|
|
15837
15944
|
className: "max-w-[520px] rounded-[28px] border-0 p-0 shadow-xl",
|
|
@@ -15846,7 +15953,7 @@ function AirbnbDatePickerContent({
|
|
|
15846
15953
|
}
|
|
15847
15954
|
|
|
15848
15955
|
// src/dashboard/datepicker/Datepicker.tsx
|
|
15849
|
-
import { jsx as jsx171, jsxs as
|
|
15956
|
+
import { jsx as jsx171, jsxs as jsxs109 } from "react/jsx-runtime";
|
|
15850
15957
|
var MONTHS_IN_YEAR2 = 12;
|
|
15851
15958
|
function getMonthLabels2(locale) {
|
|
15852
15959
|
const formatter = new Intl.DateTimeFormat(locale, { month: "long" });
|
|
@@ -16208,9 +16315,9 @@ var Datepicker = React62.forwardRef(
|
|
|
16208
16315
|
className
|
|
16209
16316
|
),
|
|
16210
16317
|
style: wrapperWidth ? { width: wrapperWidth } : void 0,
|
|
16211
|
-
children: /* @__PURE__ */
|
|
16212
|
-
/* @__PURE__ */
|
|
16213
|
-
isMobile3 ? /* @__PURE__ */
|
|
16318
|
+
children: /* @__PURE__ */ jsxs109("div", { className: "relative min-h-[var(--field-min-height,48px)] w-full", children: [
|
|
16319
|
+
/* @__PURE__ */ jsxs109("div", { className: "relative w-full", children: [
|
|
16320
|
+
isMobile3 ? /* @__PURE__ */ jsxs109(
|
|
16214
16321
|
"button",
|
|
16215
16322
|
{
|
|
16216
16323
|
ref: mobileTriggerRef,
|
|
@@ -16243,7 +16350,7 @@ var Datepicker = React62.forwardRef(
|
|
|
16243
16350
|
) })
|
|
16244
16351
|
]
|
|
16245
16352
|
}
|
|
16246
|
-
) : /* @__PURE__ */
|
|
16353
|
+
) : /* @__PURE__ */ jsxs109(
|
|
16247
16354
|
"div",
|
|
16248
16355
|
{
|
|
16249
16356
|
className: cn(
|
|
@@ -16279,7 +16386,7 @@ var Datepicker = React62.forwardRef(
|
|
|
16279
16386
|
className: subInputClass
|
|
16280
16387
|
}
|
|
16281
16388
|
) }),
|
|
16282
|
-
/* @__PURE__ */
|
|
16389
|
+
/* @__PURE__ */ jsxs109("div", { className: "relative flex h-full min-w-0 items-center gap-1 px-2 before:absolute before:inset-y-3 before:left-0 before:w-px before:bg-[var(--chekin-color-gray-3)] before:content-[''] after:absolute after:inset-y-3 after:right-0 after:w-px after:bg-[var(--chekin-color-gray-3)] after:content-[''] sm:px-3", children: [
|
|
16283
16390
|
/* @__PURE__ */ jsx171(
|
|
16284
16391
|
"input",
|
|
16285
16392
|
{
|
|
@@ -16659,8 +16766,8 @@ function resolveRangeSelection({
|
|
|
16659
16766
|
}
|
|
16660
16767
|
|
|
16661
16768
|
// src/dashboard/date-range-picker/components/DateRangeInputs.tsx
|
|
16662
|
-
import { CalendarDays, SquareX as
|
|
16663
|
-
import { jsx as jsx172, jsxs as
|
|
16769
|
+
import { CalendarDays, SquareX as SquareX4 } from "lucide-react";
|
|
16770
|
+
import { jsx as jsx172, jsxs as jsxs110 } from "react/jsx-runtime";
|
|
16664
16771
|
var DEFAULT_PLACEHOLDER = "00-00-0000";
|
|
16665
16772
|
var inputBaseClass = "m-0 box-border h-full w-full min-w-0 border-0 bg-transparent text-[16px] font-medium leading-5 text-[var(--chekin-color-brand-navy)] outline-none placeholder:text-[var(--chekin-color-gray-1)]";
|
|
16666
16773
|
var iconButtonClass = "flex h-5 w-5 items-center justify-center rounded-[3px] border-0 bg-transparent p-0 text-[#9696b9] outline-none hover:shadow-[0_3px_3px_#0f477734] disabled:cursor-not-allowed";
|
|
@@ -16702,7 +16809,7 @@ function DateRangeInputs({
|
|
|
16702
16809
|
isBlocked && "cursor-not-allowed",
|
|
16703
16810
|
loading && "cursor-progress"
|
|
16704
16811
|
);
|
|
16705
|
-
return /* @__PURE__ */
|
|
16812
|
+
return /* @__PURE__ */ jsxs110(
|
|
16706
16813
|
"div",
|
|
16707
16814
|
{
|
|
16708
16815
|
className: cn(
|
|
@@ -16770,7 +16877,7 @@ function DateRangeInputs({
|
|
|
16770
16877
|
)
|
|
16771
16878
|
}
|
|
16772
16879
|
),
|
|
16773
|
-
/* @__PURE__ */
|
|
16880
|
+
/* @__PURE__ */ jsxs110("span", { className: "ml-auto flex shrink-0 items-center gap-2 pl-2 text-[var(--chekin-color-gray-2)]", children: [
|
|
16774
16881
|
!readOnly && !hideClearDates && !isEmpty && /* @__PURE__ */ jsx172(
|
|
16775
16882
|
"button",
|
|
16776
16883
|
{
|
|
@@ -16779,7 +16886,7 @@ function DateRangeInputs({
|
|
|
16779
16886
|
onClick: onReset,
|
|
16780
16887
|
className: iconButtonClass,
|
|
16781
16888
|
"aria-label": clearLabel,
|
|
16782
|
-
children: /* @__PURE__ */ jsx172(
|
|
16889
|
+
children: /* @__PURE__ */ jsx172(SquareX4, { size: 16, fill: "#9696b9", color: "#f8f8f8", strokeWidth: 1.8 })
|
|
16783
16890
|
}
|
|
16784
16891
|
),
|
|
16785
16892
|
!readOnly && !hideCalendarIcon && /* @__PURE__ */ jsx172(
|
|
@@ -16843,7 +16950,7 @@ function DateRangeCalendar({
|
|
|
16843
16950
|
}
|
|
16844
16951
|
|
|
16845
16952
|
// src/dashboard/date-range-picker/components/DateRangePopover.tsx
|
|
16846
|
-
import { jsx as jsx174, jsxs as
|
|
16953
|
+
import { jsx as jsx174, jsxs as jsxs111 } from "react/jsx-runtime";
|
|
16847
16954
|
function DateRangePopover({
|
|
16848
16955
|
isOpen,
|
|
16849
16956
|
isMobile: isMobile3,
|
|
@@ -16862,7 +16969,7 @@ function DateRangePopover({
|
|
|
16862
16969
|
onOpenChange: (next) => {
|
|
16863
16970
|
if (!next) onClose();
|
|
16864
16971
|
},
|
|
16865
|
-
children: /* @__PURE__ */
|
|
16972
|
+
children: /* @__PURE__ */ jsxs111(
|
|
16866
16973
|
DrawerContent,
|
|
16867
16974
|
{
|
|
16868
16975
|
onClose,
|
|
@@ -16891,7 +16998,7 @@ function DateRangePopover({
|
|
|
16891
16998
|
}
|
|
16892
16999
|
|
|
16893
17000
|
// src/dashboard/date-range-picker/DateRangePicker.tsx
|
|
16894
|
-
import { jsx as jsx175, jsxs as
|
|
17001
|
+
import { jsx as jsx175, jsxs as jsxs112 } from "react/jsx-runtime";
|
|
16895
17002
|
var DateRangePicker = React66.forwardRef(function DateRangePicker2({
|
|
16896
17003
|
label,
|
|
16897
17004
|
value: externalValue,
|
|
@@ -17064,8 +17171,8 @@ var DateRangePicker = React66.forwardRef(function DateRangePicker2({
|
|
|
17064
17171
|
className
|
|
17065
17172
|
),
|
|
17066
17173
|
style: wrapperWidth ? { width: wrapperWidth } : void 0,
|
|
17067
|
-
children: /* @__PURE__ */
|
|
17068
|
-
/* @__PURE__ */
|
|
17174
|
+
children: /* @__PURE__ */ jsxs112("div", { className: "relative min-h-[var(--field-min-height,48px)] w-full", children: [
|
|
17175
|
+
/* @__PURE__ */ jsxs112("div", { className: "relative w-full", children: [
|
|
17069
17176
|
/* @__PURE__ */ jsx175(
|
|
17070
17177
|
DateRangeInputs,
|
|
17071
17178
|
{
|
|
@@ -17346,9 +17453,9 @@ var TimePicker = React68.forwardRef(function TimePicker2({ format: formatName =
|
|
|
17346
17453
|
|
|
17347
17454
|
// src/dashboard/file-input/FileInput.tsx
|
|
17348
17455
|
import * as React69 from "react";
|
|
17349
|
-
import { Download, Paperclip, SquareX as
|
|
17456
|
+
import { Download, Paperclip, SquareX as SquareX5 } from "lucide-react";
|
|
17350
17457
|
import { useTranslation as useTranslation42 } from "react-i18next";
|
|
17351
|
-
import { jsx as jsx177, jsxs as
|
|
17458
|
+
import { jsx as jsx177, jsxs as jsxs113 } from "react/jsx-runtime";
|
|
17352
17459
|
function defaultDownload(url) {
|
|
17353
17460
|
window.open(url, "_blank", "noopener,noreferrer");
|
|
17354
17461
|
}
|
|
@@ -17406,7 +17513,7 @@ var FileInput = React69.forwardRef(function FileInput2({
|
|
|
17406
17513
|
event.stopPropagation();
|
|
17407
17514
|
if (isUrl) onDownload(value);
|
|
17408
17515
|
};
|
|
17409
|
-
return /* @__PURE__ */
|
|
17516
|
+
return /* @__PURE__ */ jsxs113(
|
|
17410
17517
|
"label",
|
|
17411
17518
|
{
|
|
17412
17519
|
htmlFor: inputId,
|
|
@@ -17436,9 +17543,9 @@ var FileInput = React69.forwardRef(function FileInput2({
|
|
|
17436
17543
|
"aria-invalid": isInvalid
|
|
17437
17544
|
}
|
|
17438
17545
|
),
|
|
17439
|
-
/* @__PURE__ */
|
|
17440
|
-
/* @__PURE__ */
|
|
17441
|
-
/* @__PURE__ */
|
|
17546
|
+
/* @__PURE__ */ jsxs113("div", { className: "relative w-full", children: [
|
|
17547
|
+
/* @__PURE__ */ jsxs113("div", { className: "relative w-full", children: [
|
|
17548
|
+
/* @__PURE__ */ jsxs113(
|
|
17442
17549
|
"div",
|
|
17443
17550
|
{
|
|
17444
17551
|
className: cn(
|
|
@@ -17446,13 +17553,13 @@ var FileInput = React69.forwardRef(function FileInput2({
|
|
|
17446
17553
|
isEmpty && "bg-[var(--empty-field-background)]"
|
|
17447
17554
|
),
|
|
17448
17555
|
children: [
|
|
17449
|
-
hasFileChip ? /* @__PURE__ */
|
|
17556
|
+
hasFileChip ? /* @__PURE__ */ jsxs113(
|
|
17450
17557
|
"div",
|
|
17451
17558
|
{
|
|
17452
17559
|
className: "inline-flex h-6 max-w-[85%] items-center rounded-[4px] border border-[#acacd5] bg-[#f0f0f8] pl-[10px] pr-1",
|
|
17453
17560
|
onClick: (event) => event.preventDefault(),
|
|
17454
17561
|
children: [
|
|
17455
|
-
isUrl ? /* @__PURE__ */
|
|
17562
|
+
isUrl ? /* @__PURE__ */ jsxs113(
|
|
17456
17563
|
"button",
|
|
17457
17564
|
{
|
|
17458
17565
|
type: "button",
|
|
@@ -17472,7 +17579,7 @@ var FileInput = React69.forwardRef(function FileInput2({
|
|
|
17472
17579
|
onClick: handleClear,
|
|
17473
17580
|
className: "ml-2 flex h-[15px] w-[15px] items-center justify-center rounded-[3px] border-0 bg-transparent p-0 text-[#9696b9] outline-none hover:shadow-[0_3px_3px_#0f477734]",
|
|
17474
17581
|
"aria-label": t("remove_file"),
|
|
17475
|
-
children: /* @__PURE__ */ jsx177(
|
|
17582
|
+
children: /* @__PURE__ */ jsx177(SquareX5, { size: 15, fill: "#9696b9", color: "#f8f8f8", strokeWidth: 1.8 })
|
|
17476
17583
|
}
|
|
17477
17584
|
)
|
|
17478
17585
|
]
|
|
@@ -17518,7 +17625,7 @@ var FileInput = React69.forwardRef(function FileInput2({
|
|
|
17518
17625
|
|
|
17519
17626
|
// src/dashboard/select-icons-box/SelectIconsBox.tsx
|
|
17520
17627
|
import * as React70 from "react";
|
|
17521
|
-
import { jsx as jsx178, jsxs as
|
|
17628
|
+
import { jsx as jsx178, jsxs as jsxs114 } from "react/jsx-runtime";
|
|
17522
17629
|
var FOCUSABLE_TRIGGER_SELECTOR2 = 'input:not([type="hidden"]):not([disabled]):not([readonly]), button:not([disabled])';
|
|
17523
17630
|
var SelectIconsBox = React70.forwardRef(
|
|
17524
17631
|
function SelectIconsBox2({
|
|
@@ -17566,7 +17673,7 @@ var SelectIconsBox = React70.forwardRef(
|
|
|
17566
17673
|
);
|
|
17567
17674
|
focusable?.focus();
|
|
17568
17675
|
};
|
|
17569
|
-
return /* @__PURE__ */
|
|
17676
|
+
return /* @__PURE__ */ jsxs114(
|
|
17570
17677
|
"div",
|
|
17571
17678
|
{
|
|
17572
17679
|
ref: combinedContainerRef,
|
|
@@ -17670,13 +17777,13 @@ function getErrorMessage(error) {
|
|
|
17670
17777
|
|
|
17671
17778
|
// src/lib/toastResponseError.tsx
|
|
17672
17779
|
import i18next from "i18next";
|
|
17673
|
-
import { jsx as jsx179, jsxs as
|
|
17780
|
+
import { jsx as jsx179, jsxs as jsxs115 } from "react/jsx-runtime";
|
|
17674
17781
|
function addSupportEmailToMessage(message, prefixText) {
|
|
17675
17782
|
if (typeof message !== "string") {
|
|
17676
17783
|
return message;
|
|
17677
17784
|
}
|
|
17678
17785
|
const builtMessage = `${prefixText ? `${prefixText} ` : ""}${message}`;
|
|
17679
|
-
return /* @__PURE__ */
|
|
17786
|
+
return /* @__PURE__ */ jsxs115("div", { children: [
|
|
17680
17787
|
/* @__PURE__ */ jsx179("div", { children: builtMessage }),
|
|
17681
17788
|
i18next.t("reach_us_at_email")
|
|
17682
17789
|
] });
|
|
@@ -17693,11 +17800,11 @@ function toastResponseError(error, options = {}) {
|
|
|
17693
17800
|
|
|
17694
17801
|
// src/legacy-fields/textarea/Textarea.tsx
|
|
17695
17802
|
import { forwardRef as forwardRef73, useId as useId15 } from "react";
|
|
17696
|
-
import { jsx as jsx180, jsxs as
|
|
17803
|
+
import { jsx as jsx180, jsxs as jsxs116 } from "react/jsx-runtime";
|
|
17697
17804
|
var LegacyTextarea = forwardRef73(
|
|
17698
17805
|
({ className, textareaClassName, label, disabled, name, invalid, ...textareaProps }, ref) => {
|
|
17699
17806
|
const inputId = useId15();
|
|
17700
|
-
return /* @__PURE__ */
|
|
17807
|
+
return /* @__PURE__ */ jsxs116("div", { className: cn("relative", className), children: [
|
|
17701
17808
|
/* @__PURE__ */ jsx180(
|
|
17702
17809
|
"textarea",
|
|
17703
17810
|
{
|
|
@@ -17739,7 +17846,7 @@ import { Calendar as Calendar2 } from "lucide-react";
|
|
|
17739
17846
|
import * as React71 from "react";
|
|
17740
17847
|
import { Loader2 as Loader24 } from "lucide-react";
|
|
17741
17848
|
import { useTranslation as useTranslation43 } from "react-i18next";
|
|
17742
|
-
import { Fragment as Fragment17, jsx as jsx181, jsxs as
|
|
17849
|
+
import { Fragment as Fragment17, jsx as jsx181, jsxs as jsxs117 } from "react/jsx-runtime";
|
|
17743
17850
|
var AirbnbFieldTrigger = React71.forwardRef(
|
|
17744
17851
|
({
|
|
17745
17852
|
as = "button",
|
|
@@ -17776,9 +17883,9 @@ var AirbnbFieldTrigger = React71.forwardRef(
|
|
|
17776
17883
|
const optionalLabel = optional ? typeof optional === "string" ? optional : t("optional") : void 0;
|
|
17777
17884
|
const visibleLabelText = labelText ?? label;
|
|
17778
17885
|
const hasLabelMeta = Boolean(optionalLabel) || Boolean(tooltip);
|
|
17779
|
-
const resolvedLabelText = visibleLabelText && hasLabelMeta ? /* @__PURE__ */
|
|
17886
|
+
const resolvedLabelText = visibleLabelText && hasLabelMeta ? /* @__PURE__ */ jsxs117("span", { className: "inline-flex max-w-full items-center gap-1.5 align-middle", children: [
|
|
17780
17887
|
/* @__PURE__ */ jsx181("span", { className: "min-w-0 truncate", children: visibleLabelText }),
|
|
17781
|
-
optionalLabel && /* @__PURE__ */
|
|
17888
|
+
optionalLabel && /* @__PURE__ */ jsxs117("span", { className: "text-current opacity-70 lowercase", children: [
|
|
17782
17889
|
"(",
|
|
17783
17890
|
optionalLabel,
|
|
17784
17891
|
")"
|
|
@@ -17798,7 +17905,7 @@ var AirbnbFieldTrigger = React71.forwardRef(
|
|
|
17798
17905
|
const hasInvalidState = Boolean(error);
|
|
17799
17906
|
const errorMessage = typeof error === "string" ? error : void 0;
|
|
17800
17907
|
const isBlocked = Boolean(disabled) || Boolean(loading);
|
|
17801
|
-
const resolvedTrailingAdornment = loading || trailingAdornment ? /* @__PURE__ */
|
|
17908
|
+
const resolvedTrailingAdornment = loading || trailingAdornment ? /* @__PURE__ */ jsxs117("span", { className: "flex items-center gap-2", children: [
|
|
17802
17909
|
trailingAdornment,
|
|
17803
17910
|
loading && /* @__PURE__ */ jsx181(
|
|
17804
17911
|
Loader24,
|
|
@@ -17816,8 +17923,8 @@ var AirbnbFieldTrigger = React71.forwardRef(
|
|
|
17816
17923
|
disabled ? "cursor-not-allowed opacity-50" : loading ? "cursor-progress" : "cursor-pointer",
|
|
17817
17924
|
className
|
|
17818
17925
|
);
|
|
17819
|
-
const sharedContent = /* @__PURE__ */
|
|
17820
|
-
/* @__PURE__ */
|
|
17926
|
+
const sharedContent = /* @__PURE__ */ jsxs117(Fragment17, { children: [
|
|
17927
|
+
/* @__PURE__ */ jsxs117(
|
|
17821
17928
|
"span",
|
|
17822
17929
|
{
|
|
17823
17930
|
className: cn(
|
|
@@ -17863,7 +17970,7 @@ var AirbnbFieldTrigger = React71.forwardRef(
|
|
|
17863
17970
|
}
|
|
17864
17971
|
)
|
|
17865
17972
|
] });
|
|
17866
|
-
return /* @__PURE__ */
|
|
17973
|
+
return /* @__PURE__ */ jsxs117("div", { className: "w-full", children: [
|
|
17867
17974
|
topLabel && /* @__PURE__ */ jsx181("p", { className: "mb-3 text-[16px] font-semibold leading-5 text-[#222222]", children: topLabel }),
|
|
17868
17975
|
as === "button" ? /* @__PURE__ */ jsx181(
|
|
17869
17976
|
"button",
|
|
@@ -17906,7 +18013,7 @@ var AirbnbFieldTrigger = React71.forwardRef(
|
|
|
17906
18013
|
AirbnbFieldTrigger.displayName = "AirbnbFieldTrigger";
|
|
17907
18014
|
|
|
17908
18015
|
// src/airbnb-fields/datepicker/DatePicker.tsx
|
|
17909
|
-
import { jsx as jsx182, jsxs as
|
|
18016
|
+
import { jsx as jsx182, jsxs as jsxs118 } from "react/jsx-runtime";
|
|
17910
18017
|
var DEFAULT_MIN_DATE = new Date(1920, 0, 1);
|
|
17911
18018
|
var AirbnbDatePicker = React72.forwardRef(
|
|
17912
18019
|
({
|
|
@@ -18022,7 +18129,7 @@ var AirbnbDatePicker = React72.forwardRef(
|
|
|
18022
18129
|
setIsOpen(false);
|
|
18023
18130
|
}
|
|
18024
18131
|
}, [isBlocked]);
|
|
18025
|
-
return /* @__PURE__ */
|
|
18132
|
+
return /* @__PURE__ */ jsxs118("div", { className: cn("relative w-full max-w-[var(--max-field-width)]", className), children: [
|
|
18026
18133
|
name && /* @__PURE__ */ jsx182(
|
|
18027
18134
|
"input",
|
|
18028
18135
|
{
|
|
@@ -18097,7 +18204,7 @@ AirbnbDatePicker.displayName = "AirbnbDatePicker";
|
|
|
18097
18204
|
import * as React73 from "react";
|
|
18098
18205
|
import { Eye as Eye2 } from "lucide-react";
|
|
18099
18206
|
import { useTranslation as useTranslation44 } from "react-i18next";
|
|
18100
|
-
import { jsx as jsx183, jsxs as
|
|
18207
|
+
import { jsx as jsx183, jsxs as jsxs119 } from "react/jsx-runtime";
|
|
18101
18208
|
var getInputValue = (value) => value != null ? String(value) : "";
|
|
18102
18209
|
var AirbnbInput = React73.forwardRef(
|
|
18103
18210
|
({
|
|
@@ -18192,7 +18299,7 @@ var AirbnbInput = React73.forwardRef(
|
|
|
18192
18299
|
const togglePasswordReveal = () => {
|
|
18193
18300
|
setIsPasswordRevealed((isRevealed) => !isRevealed);
|
|
18194
18301
|
};
|
|
18195
|
-
return /* @__PURE__ */ jsx183("div", { className: cn("w-full max-w-[var(--max-field-width)]", wrapperClassName), children: /* @__PURE__ */
|
|
18302
|
+
return /* @__PURE__ */ jsx183("div", { className: cn("w-full max-w-[var(--max-field-width)]", wrapperClassName), children: /* @__PURE__ */ jsxs119(
|
|
18196
18303
|
AirbnbFieldTrigger,
|
|
18197
18304
|
{
|
|
18198
18305
|
as: "div",
|
|
@@ -18284,7 +18391,7 @@ import { ChevronDown as ChevronDown6 } from "lucide-react";
|
|
|
18284
18391
|
import * as React78 from "react";
|
|
18285
18392
|
|
|
18286
18393
|
// src/airbnb-fields/select/SelectDesktopMenu.tsx
|
|
18287
|
-
import { jsx as jsx184, jsxs as
|
|
18394
|
+
import { jsx as jsx184, jsxs as jsxs120 } from "react/jsx-runtime";
|
|
18288
18395
|
function AirbnbSelectDesktopMenu({
|
|
18289
18396
|
id,
|
|
18290
18397
|
options,
|
|
@@ -18303,7 +18410,7 @@ function AirbnbSelectDesktopMenu({
|
|
|
18303
18410
|
noOptionsMessage
|
|
18304
18411
|
}) {
|
|
18305
18412
|
const emptyMessage = noOptionsMessage?.();
|
|
18306
|
-
return /* @__PURE__ */
|
|
18413
|
+
return /* @__PURE__ */ jsxs120(
|
|
18307
18414
|
"div",
|
|
18308
18415
|
{
|
|
18309
18416
|
id,
|
|
@@ -18479,7 +18586,7 @@ function getMobileOptionStyles(index, scrollTop) {
|
|
|
18479
18586
|
}
|
|
18480
18587
|
|
|
18481
18588
|
// src/airbnb-fields/select/SelectMobileWheel.tsx
|
|
18482
|
-
import { jsx as jsx186, jsxs as
|
|
18589
|
+
import { jsx as jsx186, jsxs as jsxs121 } from "react/jsx-runtime";
|
|
18483
18590
|
function AirbnbSelectMobileWheel({
|
|
18484
18591
|
id,
|
|
18485
18592
|
options,
|
|
@@ -18498,7 +18605,7 @@ function AirbnbSelectMobileWheel({
|
|
|
18498
18605
|
}) {
|
|
18499
18606
|
const spacerHeight2 = getWheelSpacerHeight();
|
|
18500
18607
|
const emptyMessage = noOptionsMessage?.();
|
|
18501
|
-
return /* @__PURE__ */
|
|
18608
|
+
return /* @__PURE__ */ jsxs121(
|
|
18502
18609
|
"div",
|
|
18503
18610
|
{
|
|
18504
18611
|
id,
|
|
@@ -18523,7 +18630,7 @@ function AirbnbSelectMobileWheel({
|
|
|
18523
18630
|
)
|
|
18524
18631
|
}
|
|
18525
18632
|
),
|
|
18526
|
-
/* @__PURE__ */
|
|
18633
|
+
/* @__PURE__ */ jsxs121(
|
|
18527
18634
|
"div",
|
|
18528
18635
|
{
|
|
18529
18636
|
ref: listRef,
|
|
@@ -18573,7 +18680,7 @@ function AirbnbSelectMobileWheel({
|
|
|
18573
18680
|
}
|
|
18574
18681
|
|
|
18575
18682
|
// src/airbnb-fields/select/SelectMobileContent.tsx
|
|
18576
|
-
import { jsx as jsx187, jsxs as
|
|
18683
|
+
import { jsx as jsx187, jsxs as jsxs122 } from "react/jsx-runtime";
|
|
18577
18684
|
function AirbnbSelectMobileContent({
|
|
18578
18685
|
open,
|
|
18579
18686
|
onOpenChange,
|
|
@@ -18597,10 +18704,10 @@ function AirbnbSelectMobileContent({
|
|
|
18597
18704
|
getOptionId: getOptionId2,
|
|
18598
18705
|
noOptionsMessage
|
|
18599
18706
|
}) {
|
|
18600
|
-
return /* @__PURE__ */ jsx187(Drawer, { open, onOpenChange, children: /* @__PURE__ */
|
|
18707
|
+
return /* @__PURE__ */ jsx187(Drawer, { open, onOpenChange, children: /* @__PURE__ */ jsxs122(DrawerContent, { onClose, lockScroll: false, children: [
|
|
18601
18708
|
/* @__PURE__ */ jsx187(DrawerTitle, { className: "sr-only", children: mobileTitle ?? label }),
|
|
18602
18709
|
/* @__PURE__ */ jsx187(DrawerDescription, { className: "sr-only", children: label }),
|
|
18603
|
-
/* @__PURE__ */
|
|
18710
|
+
/* @__PURE__ */ jsxs122("div", { className: "px-6 pb-4 pt-1", children: [
|
|
18604
18711
|
/* @__PURE__ */ jsx187(
|
|
18605
18712
|
AirbnbSelectMobileWheel,
|
|
18606
18713
|
{
|
|
@@ -19043,7 +19150,7 @@ function useSelectIds2({ name, hasValue, error, hideErrorMessage }) {
|
|
|
19043
19150
|
}
|
|
19044
19151
|
|
|
19045
19152
|
// src/airbnb-fields/select/Select.tsx
|
|
19046
|
-
import { jsx as jsx189, jsxs as
|
|
19153
|
+
import { jsx as jsx189, jsxs as jsxs123 } from "react/jsx-runtime";
|
|
19047
19154
|
var AirbnbSelect = React78.forwardRef(function AirbnbSelect2({
|
|
19048
19155
|
options = [],
|
|
19049
19156
|
value,
|
|
@@ -19224,7 +19331,7 @@ var AirbnbSelect = React78.forwardRef(function AirbnbSelect2({
|
|
|
19224
19331
|
handleMobileOpenChange(false);
|
|
19225
19332
|
}
|
|
19226
19333
|
};
|
|
19227
|
-
return /* @__PURE__ */
|
|
19334
|
+
return /* @__PURE__ */ jsxs123(
|
|
19228
19335
|
"div",
|
|
19229
19336
|
{
|
|
19230
19337
|
ref: containerRef,
|
|
@@ -19337,7 +19444,7 @@ var AirbnbSelect = React78.forwardRef(function AirbnbSelect2({
|
|
|
19337
19444
|
});
|
|
19338
19445
|
|
|
19339
19446
|
// src/airbnb-fields/phone-field/PhoneField.tsx
|
|
19340
|
-
import { jsx as jsx190, jsxs as
|
|
19447
|
+
import { jsx as jsx190, jsxs as jsxs124 } from "react/jsx-runtime";
|
|
19341
19448
|
function formatPhoneCodeOptionLabel2(option) {
|
|
19342
19449
|
const label = String(option.label);
|
|
19343
19450
|
const value = String(option.value);
|
|
@@ -19385,7 +19492,7 @@ var AirbnbPhoneField = React79.forwardRef(
|
|
|
19385
19492
|
const hasInvalidState = Boolean(error) || Boolean(invalid);
|
|
19386
19493
|
const isBlocked = Boolean(disabled) || Boolean(loading);
|
|
19387
19494
|
const isCodeBlocked = isBlocked || Boolean(codeReadOnly);
|
|
19388
|
-
return /* @__PURE__ */
|
|
19495
|
+
return /* @__PURE__ */ jsxs124("div", { className: cn("w-full max-w-[var(--max-field-width)]", className), children: [
|
|
19389
19496
|
name && /* @__PURE__ */ jsx190("input", { type: "hidden", name, value: combinedValue, disabled }),
|
|
19390
19497
|
codeName && /* @__PURE__ */ jsx190(
|
|
19391
19498
|
"input",
|
|
@@ -19413,7 +19520,7 @@ var AirbnbPhoneField = React79.forwardRef(
|
|
|
19413
19520
|
children: topLabel
|
|
19414
19521
|
}
|
|
19415
19522
|
),
|
|
19416
|
-
/* @__PURE__ */
|
|
19523
|
+
/* @__PURE__ */ jsxs124("div", { className: "flex items-stretch", children: [
|
|
19417
19524
|
/* @__PURE__ */ jsx190(
|
|
19418
19525
|
AirbnbSelect,
|
|
19419
19526
|
{
|
|
@@ -19443,7 +19550,7 @@ var AirbnbPhoneField = React79.forwardRef(
|
|
|
19443
19550
|
onClick,
|
|
19444
19551
|
onKeyDown,
|
|
19445
19552
|
valueLabel
|
|
19446
|
-
}) => /* @__PURE__ */
|
|
19553
|
+
}) => /* @__PURE__ */ jsxs124(
|
|
19447
19554
|
"button",
|
|
19448
19555
|
{
|
|
19449
19556
|
id,
|
|
@@ -19517,7 +19624,7 @@ import * as React80 from "react";
|
|
|
19517
19624
|
import { ChevronDown as ChevronDown7, Search as Search4 } from "lucide-react";
|
|
19518
19625
|
import { useVirtualizer as useVirtualizer3 } from "@tanstack/react-virtual";
|
|
19519
19626
|
import { useCallback as useCallback57 } from "react";
|
|
19520
|
-
import { jsx as jsx191, jsxs as
|
|
19627
|
+
import { jsx as jsx191, jsxs as jsxs125 } from "react/jsx-runtime";
|
|
19521
19628
|
var ROW_HEIGHT = 48;
|
|
19522
19629
|
var DESKTOP_LIST_HEIGHT = 280;
|
|
19523
19630
|
var MOBILE_LIST_HEIGHT = 420;
|
|
@@ -19713,7 +19820,7 @@ var AirbnbSearchableSelectInternal = ({
|
|
|
19713
19820
|
}
|
|
19714
19821
|
);
|
|
19715
19822
|
React80.useImperativeHandle(ref, () => triggerRef.current, []);
|
|
19716
|
-
return /* @__PURE__ */
|
|
19823
|
+
return /* @__PURE__ */ jsxs125("div", { ref: containerRef, className: cn("relative w-full max-w-[425px]", className), children: [
|
|
19717
19824
|
name && /* @__PURE__ */ jsx191("input", { type: "hidden", name, value: value ? String(value.value) : "" }),
|
|
19718
19825
|
/* @__PURE__ */ jsx191(
|
|
19719
19826
|
AirbnbFieldTrigger,
|
|
@@ -19772,7 +19879,7 @@ var AirbnbSearchableSelectInternal = ({
|
|
|
19772
19879
|
}
|
|
19773
19880
|
closeSelect();
|
|
19774
19881
|
},
|
|
19775
|
-
children: /* @__PURE__ */
|
|
19882
|
+
children: /* @__PURE__ */ jsxs125(DrawerContent, { onClose: closeSelect, lockScroll: false, children: [
|
|
19776
19883
|
/* @__PURE__ */ jsx191(DrawerTitle, { className: "sr-only", children: mobileTitle ?? label }),
|
|
19777
19884
|
/* @__PURE__ */ jsx191(DrawerDescription, { className: "sr-only", children: label }),
|
|
19778
19885
|
/* @__PURE__ */ jsx191("div", { className: "px-5 pb-5 pt-1", children: content })
|
|
@@ -19845,8 +19952,8 @@ function AirbnbSearchableSelectContent({
|
|
|
19845
19952
|
virtualizer.scrollToIndex(highlightedIndex, { align: "auto" });
|
|
19846
19953
|
}
|
|
19847
19954
|
}, [highlightedIndex, virtualizer]);
|
|
19848
|
-
return /* @__PURE__ */
|
|
19849
|
-
/* @__PURE__ */
|
|
19955
|
+
return /* @__PURE__ */ jsxs125("div", { className: "p-2", children: [
|
|
19956
|
+
/* @__PURE__ */ jsxs125("div", { className: "relative mb-2", children: [
|
|
19850
19957
|
/* @__PURE__ */ jsx191(
|
|
19851
19958
|
Search4,
|
|
19852
19959
|
{
|
|
@@ -19959,11 +20066,11 @@ function getNextEnabledIndex(options, startIndex, step) {
|
|
|
19959
20066
|
import * as React81 from "react";
|
|
19960
20067
|
import { useTranslation as useTranslation45 } from "react-i18next";
|
|
19961
20068
|
import { Search as Search5, X as X11 } from "lucide-react";
|
|
19962
|
-
import { jsx as jsx192, jsxs as
|
|
20069
|
+
import { jsx as jsx192, jsxs as jsxs126 } from "react/jsx-runtime";
|
|
19963
20070
|
var AirbnbSearchInput = React81.forwardRef(({ onReset, placeholder, wrapperClassName, ...props }, ref) => {
|
|
19964
20071
|
const { t } = useTranslation45();
|
|
19965
20072
|
const placeholderText = placeholder || t("search_property") + "...";
|
|
19966
|
-
return /* @__PURE__ */
|
|
20073
|
+
return /* @__PURE__ */ jsxs126("div", { className: cn("input-wrapper relative", wrapperClassName), children: [
|
|
19967
20074
|
/* @__PURE__ */ jsx192(Search5, { className: "absolute left-4 top-1/2 h-5 w-5 -translate-y-1/2 transform text-[#9696B9]" }),
|
|
19968
20075
|
/* @__PURE__ */ jsx192(
|
|
19969
20076
|
"input",
|
|
@@ -20001,7 +20108,7 @@ AirbnbSearchInput.displayName = "AirbnbSearchInput";
|
|
|
20001
20108
|
import * as React82 from "react";
|
|
20002
20109
|
import * as SwitchPrimitives2 from "@radix-ui/react-switch";
|
|
20003
20110
|
import { Check as Check7 } from "lucide-react";
|
|
20004
|
-
import { Fragment as Fragment18, jsx as jsx193, jsxs as
|
|
20111
|
+
import { Fragment as Fragment18, jsx as jsx193, jsxs as jsxs127 } from "react/jsx-runtime";
|
|
20005
20112
|
var AirbnbSwitch = React82.forwardRef(
|
|
20006
20113
|
({
|
|
20007
20114
|
className,
|
|
@@ -20060,8 +20167,8 @@ var AirbnbSwitch = React82.forwardRef(
|
|
|
20060
20167
|
if (!label && !error) {
|
|
20061
20168
|
return switchElement;
|
|
20062
20169
|
}
|
|
20063
|
-
return /* @__PURE__ */
|
|
20064
|
-
/* @__PURE__ */
|
|
20170
|
+
return /* @__PURE__ */ jsxs127(Fragment18, { children: [
|
|
20171
|
+
/* @__PURE__ */ jsxs127("div", { className: cn("flex items-center gap-x-3 gap-y-1.5", wrapperClassName), children: [
|
|
20065
20172
|
switchElement,
|
|
20066
20173
|
label && /* @__PURE__ */ jsx193(
|
|
20067
20174
|
Label,
|
|
@@ -20396,6 +20503,7 @@ export {
|
|
|
20396
20503
|
compressFile,
|
|
20397
20504
|
compressImage,
|
|
20398
20505
|
copyToClipboard,
|
|
20506
|
+
countriesFilter,
|
|
20399
20507
|
createDisabledMatchers,
|
|
20400
20508
|
emptyMediaVariants,
|
|
20401
20509
|
findPhoneCode,
|