@chekinapp/ui 0.0.113 → 0.0.115
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 +234 -144
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.js +212 -122
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -12436,6 +12436,7 @@ import { useTranslation as useTranslation33 } from "react-i18next";
|
|
|
12436
12436
|
// src/dashboard/_select-internals/SelectFieldShell.tsx
|
|
12437
12437
|
import { useTranslation as useTranslation27 } from "react-i18next";
|
|
12438
12438
|
import { jsx as jsx144, jsxs as jsxs91 } from "react/jsx-runtime";
|
|
12439
|
+
var FOCUSABLE_TRIGGER_SELECTOR = 'input:not([type="hidden"]):not([disabled]):not([readonly]), button:not([disabled])';
|
|
12439
12440
|
function SelectFieldShell({
|
|
12440
12441
|
containerRef,
|
|
12441
12442
|
className,
|
|
@@ -12456,13 +12457,22 @@ function SelectFieldShell({
|
|
|
12456
12457
|
}) {
|
|
12457
12458
|
const { t } = useTranslation27();
|
|
12458
12459
|
const wrapperWidth = toCssSize(width);
|
|
12460
|
+
const handleContainerFocus = (event) => {
|
|
12461
|
+
if (event.target !== event.currentTarget) return;
|
|
12462
|
+
const focusable = event.currentTarget.querySelector(
|
|
12463
|
+
FOCUSABLE_TRIGGER_SELECTOR
|
|
12464
|
+
);
|
|
12465
|
+
focusable?.focus();
|
|
12466
|
+
};
|
|
12459
12467
|
return /* @__PURE__ */ jsxs91(
|
|
12460
12468
|
"div",
|
|
12461
12469
|
{
|
|
12462
12470
|
ref: containerRef,
|
|
12471
|
+
tabIndex: -1,
|
|
12463
12472
|
onBlur,
|
|
12473
|
+
onFocus: handleContainerFocus,
|
|
12464
12474
|
className: cn(
|
|
12465
|
-
"relative w-full max-w-[var(--field-max-width,296px)]",
|
|
12475
|
+
"relative w-full max-w-[var(--field-max-width,296px)] outline-none",
|
|
12466
12476
|
disabled && !loading && "cursor-not-allowed opacity-50",
|
|
12467
12477
|
loading && "cursor-progress opacity-50",
|
|
12468
12478
|
className
|
|
@@ -12534,6 +12544,7 @@ function defaultIsOptionSelected(option, selectValue) {
|
|
|
12534
12544
|
}
|
|
12535
12545
|
|
|
12536
12546
|
// src/dashboard/_select-internals/slots/DefaultOption.tsx
|
|
12547
|
+
import { Check as Check6 } from "lucide-react";
|
|
12537
12548
|
import { jsx as jsx145, jsxs as jsxs92 } from "react/jsx-runtime";
|
|
12538
12549
|
function DefaultOption(props) {
|
|
12539
12550
|
const {
|
|
@@ -12542,7 +12553,7 @@ function DefaultOption(props) {
|
|
|
12542
12553
|
isSelected,
|
|
12543
12554
|
isHighlighted,
|
|
12544
12555
|
isDisabled,
|
|
12545
|
-
|
|
12556
|
+
isMulti,
|
|
12546
12557
|
id,
|
|
12547
12558
|
onClick,
|
|
12548
12559
|
onHover,
|
|
@@ -12570,15 +12581,26 @@ function DefaultOption(props) {
|
|
|
12570
12581
|
onClick: () => onClick(option),
|
|
12571
12582
|
onMouseMove: () => onHover(index),
|
|
12572
12583
|
className: cn(
|
|
12573
|
-
"flex w-full items-start justify-between
|
|
12574
|
-
|
|
12575
|
-
isHighlighted && !
|
|
12576
|
-
isSelected && "
|
|
12577
|
-
isDisabled && "cursor-
|
|
12584
|
+
"group relative flex w-full items-start justify-between gap-2 rounded-md border-0 bg-transparent px-3 py-2.5 text-left text-[15px] font-medium leading-5 text-[var(--chekin-color-brand-navy)] outline-none transition-colors duration-100",
|
|
12585
|
+
!isDisabled && "cursor-pointer hover:bg-[var(--chekin-color-surface-pressed)]",
|
|
12586
|
+
isHighlighted && !isDisabled && "bg-[var(--chekin-color-surface-pressed)]",
|
|
12587
|
+
isSelected && "bg-[var(--chekin-color-surface-autocomplete)] font-semibold text-[var(--chekin-color-brand-blue)]",
|
|
12588
|
+
isDisabled && "cursor-not-allowed text-[var(--chekin-color-gray-2)]"
|
|
12578
12589
|
),
|
|
12579
12590
|
children: [
|
|
12580
|
-
/* @__PURE__ */ jsx145("span", { className: "block break-words", children: labelContent }),
|
|
12581
|
-
option.description && /* @__PURE__ */ jsx145("span", { className: "ml-
|
|
12591
|
+
/* @__PURE__ */ jsx145("span", { className: "block min-w-0 break-words", children: labelContent }),
|
|
12592
|
+
option.description && /* @__PURE__ */ jsx145("span", { className: "ml-auto shrink-0 self-center text-[12px] font-medium italic text-[var(--chekin-color-gray-1)]", children: option.description }),
|
|
12593
|
+
isSelected && /* @__PURE__ */ jsx145(
|
|
12594
|
+
Check6,
|
|
12595
|
+
{
|
|
12596
|
+
"aria-hidden": "true",
|
|
12597
|
+
className: cn(
|
|
12598
|
+
"shrink-0 text-[var(--chekin-color-brand-blue)]",
|
|
12599
|
+
isMulti ? "ml-1 mt-0.5 h-3.5 w-3.5" : "ml-2 mt-0.5 h-4 w-4"
|
|
12600
|
+
),
|
|
12601
|
+
strokeWidth: 2.5
|
|
12602
|
+
}
|
|
12603
|
+
)
|
|
12582
12604
|
]
|
|
12583
12605
|
}
|
|
12584
12606
|
);
|
|
@@ -12610,7 +12632,8 @@ function SelectMenu({
|
|
|
12610
12632
|
components,
|
|
12611
12633
|
inputValue = "",
|
|
12612
12634
|
formatOptionLabel,
|
|
12613
|
-
isOptionSelected: isOptionSelected2
|
|
12635
|
+
isOptionSelected: isOptionSelected2,
|
|
12636
|
+
onMenuScrollToBottom
|
|
12614
12637
|
}) {
|
|
12615
12638
|
const { t } = useTranslation28();
|
|
12616
12639
|
const emptyMessage = noOptionsMessage?.() ?? t("no_options");
|
|
@@ -12621,6 +12644,19 @@ function SelectMenu({
|
|
|
12621
12644
|
() => selectedValues ?? (selectedValue ? [selectedValue] : []),
|
|
12622
12645
|
[selectedValues, selectedValue]
|
|
12623
12646
|
);
|
|
12647
|
+
const wasAtBottomRef = React45.useRef(false);
|
|
12648
|
+
const handleScroll = React45.useCallback(
|
|
12649
|
+
(event) => {
|
|
12650
|
+
if (!onMenuScrollToBottom) return;
|
|
12651
|
+
const target = event.currentTarget;
|
|
12652
|
+
const atBottom = target.scrollHeight - target.scrollTop - target.clientHeight <= 1;
|
|
12653
|
+
if (atBottom && !wasAtBottomRef.current) {
|
|
12654
|
+
onMenuScrollToBottom(event);
|
|
12655
|
+
}
|
|
12656
|
+
wasAtBottomRef.current = atBottom;
|
|
12657
|
+
},
|
|
12658
|
+
[onMenuScrollToBottom]
|
|
12659
|
+
);
|
|
12624
12660
|
return /* @__PURE__ */ jsxs93(
|
|
12625
12661
|
"div",
|
|
12626
12662
|
{
|
|
@@ -12633,12 +12669,14 @@ function SelectMenu({
|
|
|
12633
12669
|
"aria-multiselectable": isMulti,
|
|
12634
12670
|
"aria-activedescendant": highlightedIndex !== void 0 && highlightedIndex >= 0 ? getOptionId2(highlightedIndex) : void 0,
|
|
12635
12671
|
onKeyDown,
|
|
12672
|
+
onScroll: onMenuScrollToBottom ? handleScroll : void 0,
|
|
12636
12673
|
className: cn(
|
|
12637
|
-
"
|
|
12674
|
+
"max-h-[300px] overflow-y-auto overscroll-contain p-1.5 outline-none",
|
|
12675
|
+
"[scrollbar-color:var(--chekin-color-gray-3)_transparent] [scrollbar-width:thin] [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-[var(--chekin-color-gray-3)] [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar]:w-1.5",
|
|
12638
12676
|
menuClassName
|
|
12639
12677
|
),
|
|
12640
12678
|
children: [
|
|
12641
|
-
!hasOptions && (emptyContent ?? /* @__PURE__ */ jsx146("div", { className: "
|
|
12679
|
+
!hasOptions && (emptyContent ?? /* @__PURE__ */ jsx146("div", { className: "px-3 py-3 text-left text-[14px] font-medium text-[var(--chekin-color-gray-1)]", children: emptyMessage })),
|
|
12642
12680
|
options.map((option, index) => {
|
|
12643
12681
|
const isSelected = isOptionSelected2 ? isOptionSelected2(option, selectedList) : isOptionSelected(option, selectedValue, selectedValues);
|
|
12644
12682
|
const isHighlighted = index === highlightedIndex;
|
|
@@ -12728,7 +12766,7 @@ function SelectMenuPanel({
|
|
|
12728
12766
|
"div",
|
|
12729
12767
|
{
|
|
12730
12768
|
className: cn(
|
|
12731
|
-
"absolute left-0 right-0 top-full z-
|
|
12769
|
+
"absolute left-0 right-0 top-full z-50 mt-1.5 overflow-hidden rounded-lg border border-[var(--chekin-color-gray-3)] bg-white shadow-[0_4px_8px_-2px_rgba(22,22,67,0.06),0_16px_32px_-12px_rgba(33,72,255,0.18)] ring-1 ring-black/[0.02] animate-in fade-in-0 zoom-in-95 slide-in-from-top-1 duration-150",
|
|
12732
12770
|
className
|
|
12733
12771
|
),
|
|
12734
12772
|
children
|
|
@@ -12748,12 +12786,12 @@ function SelectSearchInput({
|
|
|
12748
12786
|
onChange,
|
|
12749
12787
|
onKeyDown
|
|
12750
12788
|
}) {
|
|
12751
|
-
return /* @__PURE__ */ jsx148("div", { className: "border-b border-[
|
|
12789
|
+
return /* @__PURE__ */ jsx148("div", { className: "border-b border-[var(--chekin-color-gray-3)] bg-white p-2", children: /* @__PURE__ */ jsxs95("div", { className: "relative", children: [
|
|
12752
12790
|
/* @__PURE__ */ jsx148(
|
|
12753
12791
|
Search3,
|
|
12754
12792
|
{
|
|
12755
12793
|
"aria-hidden": "true",
|
|
12756
|
-
className: "pointer-events-none absolute left-
|
|
12794
|
+
className: "pointer-events-none absolute left-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-[var(--chekin-color-gray-2)]"
|
|
12757
12795
|
}
|
|
12758
12796
|
),
|
|
12759
12797
|
/* @__PURE__ */ jsx148(
|
|
@@ -12768,7 +12806,7 @@ function SelectSearchInput({
|
|
|
12768
12806
|
autoComplete: "off",
|
|
12769
12807
|
"aria-controls": listboxId,
|
|
12770
12808
|
"aria-activedescendant": activeOptionId,
|
|
12771
|
-
className: "m-0 box-border h-9 w-full rounded-md border border-[var(--chekin-color-gray-3)] bg-white
|
|
12809
|
+
className: "m-0 box-border h-9 w-full rounded-md border border-[var(--chekin-color-gray-3)] bg-white pl-8 pr-3 text-[14px] font-medium text-[var(--chekin-color-brand-navy)] outline-none transition-colors placeholder:text-[var(--chekin-color-gray-2)] hover:border-[var(--chekin-color-gray-2)] focus:border-[var(--chekin-color-brand-blue)] focus:ring-2 focus:ring-[var(--chekin-color-brand-blue)]/15"
|
|
12772
12810
|
}
|
|
12773
12811
|
)
|
|
12774
12812
|
] }) });
|
|
@@ -12792,6 +12830,7 @@ function SelectTrigger({
|
|
|
12792
12830
|
invalid,
|
|
12793
12831
|
placeholder,
|
|
12794
12832
|
valueLabel,
|
|
12833
|
+
leftIcon,
|
|
12795
12834
|
onClick,
|
|
12796
12835
|
onKeyDown,
|
|
12797
12836
|
onBlur
|
|
@@ -12815,12 +12854,14 @@ function SelectTrigger({
|
|
|
12815
12854
|
onKeyDown,
|
|
12816
12855
|
onBlur,
|
|
12817
12856
|
className: cn(
|
|
12818
|
-
"relative m-0 box-border flex h-12 w-full cursor-pointer items-center justify-between gap-2 rounded-[6px] border-0
|
|
12857
|
+
"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",
|
|
12858
|
+
leftIcon ? "pl-10" : "pl-4",
|
|
12819
12859
|
isEmpty ? "bg-[var(--empty-field-background)] text-[var(--chekin-color-gray-1)]" : "bg-transparent text-[var(--chekin-color-brand-navy)]",
|
|
12820
12860
|
disabled && !loading && "cursor-not-allowed opacity-50",
|
|
12821
12861
|
loading && "!cursor-progress"
|
|
12822
12862
|
),
|
|
12823
12863
|
children: [
|
|
12864
|
+
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 }) }),
|
|
12824
12865
|
/* @__PURE__ */ jsx149("span", { id: valueId, className: "block min-w-0 flex-1 truncate text-left", children: valueLabel ?? (isOpen ? placeholder : null) }),
|
|
12825
12866
|
/* @__PURE__ */ jsx149("span", { className: "pointer-events-none flex items-center gap-2 text-[var(--chekin-color-gray-2)]", children: /* @__PURE__ */ jsx149(
|
|
12826
12867
|
ChevronDown2,
|
|
@@ -12870,6 +12911,7 @@ function ComboboxTrigger({
|
|
|
12870
12911
|
onClear,
|
|
12871
12912
|
clearLabel,
|
|
12872
12913
|
leadingContent,
|
|
12914
|
+
leftIcon,
|
|
12873
12915
|
containerClassName,
|
|
12874
12916
|
inputClassName,
|
|
12875
12917
|
hideIndicator,
|
|
@@ -12900,11 +12942,13 @@ function ComboboxTrigger({
|
|
|
12900
12942
|
containerClassName
|
|
12901
12943
|
),
|
|
12902
12944
|
children: [
|
|
12945
|
+
leftIcon && /* @__PURE__ */ jsx150("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__ */ jsx150("span", { className: "flex h-full w-10 items-center justify-center", children: leftIcon }) }),
|
|
12903
12946
|
/* @__PURE__ */ jsxs97(
|
|
12904
12947
|
"div",
|
|
12905
12948
|
{
|
|
12906
12949
|
className: cn(
|
|
12907
|
-
"flex min-w-0 flex-1 items-center gap-2 py-[10px]
|
|
12950
|
+
"flex min-w-0 flex-1 items-center gap-2 py-[10px]",
|
|
12951
|
+
leftIcon ? "pl-10" : "pl-4",
|
|
12908
12952
|
isMulti && "flex-wrap"
|
|
12909
12953
|
),
|
|
12910
12954
|
children: [
|
|
@@ -13403,7 +13447,7 @@ function useSelectState(params) {
|
|
|
13403
13447
|
}
|
|
13404
13448
|
|
|
13405
13449
|
// src/dashboard/_select-internals/slots/DefaultMultiValueChip.tsx
|
|
13406
|
-
import {
|
|
13450
|
+
import { X as X10 } from "lucide-react";
|
|
13407
13451
|
import { useTranslation as useTranslation31 } from "react-i18next";
|
|
13408
13452
|
import { jsx as jsx151, jsxs as jsxs98 } from "react/jsx-runtime";
|
|
13409
13453
|
function DefaultMultiValueChip({
|
|
@@ -13413,8 +13457,8 @@ function DefaultMultiValueChip({
|
|
|
13413
13457
|
}) {
|
|
13414
13458
|
const { t } = useTranslation31();
|
|
13415
13459
|
const labelText = typeof option.label === "string" ? option.label : String(option.value);
|
|
13416
|
-
return /* @__PURE__ */ jsxs98("span", { className: "inline-flex items-center gap-
|
|
13417
|
-
/* @__PURE__ */ jsx151("span", { className: "whitespace-nowrap", children: option.label }),
|
|
13460
|
+
return /* @__PURE__ */ jsxs98("span", { className: "inline-flex items-center gap-1 rounded-md border border-[var(--chekin-color-gray-3)] bg-[var(--chekin-color-surface-pressed)] py-0.5 pl-2 pr-1 text-[13px] font-medium text-[var(--chekin-color-brand-navy)] transition-colors", children: [
|
|
13461
|
+
/* @__PURE__ */ jsx151("span", { className: "whitespace-nowrap leading-5", children: option.label }),
|
|
13418
13462
|
!readOnly && /* @__PURE__ */ jsx151(
|
|
13419
13463
|
"button",
|
|
13420
13464
|
{
|
|
@@ -13423,9 +13467,9 @@ function DefaultMultiValueChip({
|
|
|
13423
13467
|
event.stopPropagation();
|
|
13424
13468
|
onRemove();
|
|
13425
13469
|
},
|
|
13426
|
-
className: "flex h-
|
|
13470
|
+
className: "flex h-4 w-4 items-center justify-center rounded-sm border-0 bg-transparent p-0 text-[var(--chekin-color-gray-1)] outline-none transition-colors hover:bg-white/70 hover:text-[var(--chekin-color-brand-navy)] focus-visible:ring-2 focus-visible:ring-[var(--chekin-color-brand-blue)]/30",
|
|
13427
13471
|
"aria-label": t("remove_item", { label: labelText }),
|
|
13428
|
-
children: /* @__PURE__ */ jsx151(
|
|
13472
|
+
children: /* @__PURE__ */ jsx151(X10, { size: 12, strokeWidth: 2.5 })
|
|
13429
13473
|
}
|
|
13430
13474
|
)
|
|
13431
13475
|
] });
|
|
@@ -13466,6 +13510,7 @@ function DefaultControl(props) {
|
|
|
13466
13510
|
clearLabel,
|
|
13467
13511
|
hideIndicator,
|
|
13468
13512
|
autoFocus,
|
|
13513
|
+
leftIcon,
|
|
13469
13514
|
components
|
|
13470
13515
|
} = props;
|
|
13471
13516
|
const Chip = components.MultiValueChip ?? DefaultMultiValueChip;
|
|
@@ -13503,6 +13548,7 @@ function DefaultControl(props) {
|
|
|
13503
13548
|
clearLabel,
|
|
13504
13549
|
hideIndicator,
|
|
13505
13550
|
autoFocus,
|
|
13551
|
+
leftIcon,
|
|
13506
13552
|
leadingContent: isMulti ? selectedOptions.map((option) => /* @__PURE__ */ jsx152(
|
|
13507
13553
|
Chip,
|
|
13508
13554
|
{
|
|
@@ -13533,7 +13579,8 @@ function StaticControl(props) {
|
|
|
13533
13579
|
disabled,
|
|
13534
13580
|
valueLabel,
|
|
13535
13581
|
placeholder,
|
|
13536
|
-
onContainerClick
|
|
13582
|
+
onContainerClick,
|
|
13583
|
+
leftIcon
|
|
13537
13584
|
} = props;
|
|
13538
13585
|
return /* @__PURE__ */ jsx153(
|
|
13539
13586
|
SelectTrigger,
|
|
@@ -13551,6 +13598,7 @@ function StaticControl(props) {
|
|
|
13551
13598
|
invalid,
|
|
13552
13599
|
placeholder,
|
|
13553
13600
|
valueLabel,
|
|
13601
|
+
leftIcon,
|
|
13554
13602
|
onClick: onContainerClick,
|
|
13555
13603
|
onKeyDown: () => void 0
|
|
13556
13604
|
}
|
|
@@ -13582,7 +13630,8 @@ function DefaultMenuList(props) {
|
|
|
13582
13630
|
components,
|
|
13583
13631
|
inputValue,
|
|
13584
13632
|
formatOptionLabel,
|
|
13585
|
-
isOptionSelected: isOptionSelected2
|
|
13633
|
+
isOptionSelected: isOptionSelected2,
|
|
13634
|
+
onMenuScrollToBottom
|
|
13586
13635
|
} = props;
|
|
13587
13636
|
return /* @__PURE__ */ jsx154(
|
|
13588
13637
|
SelectMenu,
|
|
@@ -13609,7 +13658,8 @@ function DefaultMenuList(props) {
|
|
|
13609
13658
|
components,
|
|
13610
13659
|
inputValue,
|
|
13611
13660
|
formatOptionLabel,
|
|
13612
|
-
isOptionSelected: isOptionSelected2
|
|
13661
|
+
isOptionSelected: isOptionSelected2,
|
|
13662
|
+
onMenuScrollToBottom
|
|
13613
13663
|
}
|
|
13614
13664
|
);
|
|
13615
13665
|
}
|
|
@@ -13699,7 +13749,9 @@ function SelectInternal(props, ref) {
|
|
|
13699
13749
|
components: userComponents,
|
|
13700
13750
|
onInputChange,
|
|
13701
13751
|
searchPosition = "trigger",
|
|
13702
|
-
menuHeader
|
|
13752
|
+
menuHeader,
|
|
13753
|
+
onMenuScrollToBottom,
|
|
13754
|
+
leftIcon
|
|
13703
13755
|
} = props;
|
|
13704
13756
|
const isSearchInDropdown = searchPosition === "dropdown";
|
|
13705
13757
|
const isMulti = props.isMulti === true;
|
|
@@ -13821,6 +13873,7 @@ function SelectInternal(props, ref) {
|
|
|
13821
13873
|
clearLabel: isMulti ? t("clear_all") : t("clear"),
|
|
13822
13874
|
hideIndicator,
|
|
13823
13875
|
autoFocus,
|
|
13876
|
+
leftIcon,
|
|
13824
13877
|
components
|
|
13825
13878
|
}
|
|
13826
13879
|
),
|
|
@@ -13839,7 +13892,8 @@ function SelectInternal(props, ref) {
|
|
|
13839
13892
|
legend: resolvedLabel,
|
|
13840
13893
|
label: resolvedLabel,
|
|
13841
13894
|
tooltip,
|
|
13842
|
-
onClick: state.handleContainerClick
|
|
13895
|
+
onClick: state.handleContainerClick,
|
|
13896
|
+
labelClassName: leftIcon ? "pl-[28px]" : void 0
|
|
13843
13897
|
}
|
|
13844
13898
|
),
|
|
13845
13899
|
/* @__PURE__ */ jsxs99(
|
|
@@ -13890,7 +13944,8 @@ function SelectInternal(props, ref) {
|
|
|
13890
13944
|
components,
|
|
13891
13945
|
inputValue: state.inputValue,
|
|
13892
13946
|
formatOptionLabel,
|
|
13893
|
-
isOptionSelected: isOptionSelected2
|
|
13947
|
+
isOptionSelected: isOptionSelected2,
|
|
13948
|
+
onMenuScrollToBottom
|
|
13894
13949
|
}
|
|
13895
13950
|
),
|
|
13896
13951
|
state.canCreateNewOption && /* @__PURE__ */ jsx156(
|
|
@@ -13954,7 +14009,8 @@ function VirtualMenuList(props) {
|
|
|
13954
14009
|
components,
|
|
13955
14010
|
inputValue = "",
|
|
13956
14011
|
formatOptionLabel,
|
|
13957
|
-
isOptionSelected: isOptionSelectedProp
|
|
14012
|
+
isOptionSelected: isOptionSelectedProp,
|
|
14013
|
+
onMenuScrollToBottom
|
|
13958
14014
|
} = props;
|
|
13959
14015
|
const {
|
|
13960
14016
|
canLoadMore,
|
|
@@ -14002,6 +14058,19 @@ function VirtualMenuList(props) {
|
|
|
14002
14058
|
const lastOptionIndex = options.length - 1;
|
|
14003
14059
|
const emptyMessage = noOptionsMessage?.() ?? t("no_options");
|
|
14004
14060
|
const isOptionSelected2 = (option) => isOptionSelectedProp ? isOptionSelectedProp(option, selectedOptions) : selectedOptions.some((s) => s.value === option.value);
|
|
14061
|
+
const wasAtBottomRef = React51.useRef(false);
|
|
14062
|
+
const handleScroll = React51.useCallback(
|
|
14063
|
+
(event) => {
|
|
14064
|
+
if (!onMenuScrollToBottom) return;
|
|
14065
|
+
const target = event.currentTarget;
|
|
14066
|
+
const atBottom = target.scrollHeight - target.scrollTop - target.clientHeight <= 1;
|
|
14067
|
+
if (atBottom && !wasAtBottomRef.current) {
|
|
14068
|
+
onMenuScrollToBottom(event);
|
|
14069
|
+
}
|
|
14070
|
+
wasAtBottomRef.current = atBottom;
|
|
14071
|
+
},
|
|
14072
|
+
[onMenuScrollToBottom]
|
|
14073
|
+
);
|
|
14005
14074
|
if (options.length === 0) {
|
|
14006
14075
|
return /* @__PURE__ */ jsx157("div", { className: "min-h-[75px] px-4 pb-[19px] pt-[17px]", children: isLoadingMore ? /* @__PURE__ */ jsxs100(
|
|
14007
14076
|
"div",
|
|
@@ -14030,6 +14099,7 @@ function VirtualMenuList(props) {
|
|
|
14030
14099
|
ref: scrollRef,
|
|
14031
14100
|
className: cn("overflow-y-auto", menuClassName),
|
|
14032
14101
|
style: { height: `${measuredListHeight}px` },
|
|
14102
|
+
onScroll: onMenuScrollToBottom ? handleScroll : void 0,
|
|
14033
14103
|
children: /* @__PURE__ */ jsx157(
|
|
14034
14104
|
"div",
|
|
14035
14105
|
{
|
|
@@ -14511,7 +14581,6 @@ function SelectCheckboxOption(props) {
|
|
|
14511
14581
|
isSelected,
|
|
14512
14582
|
isHighlighted,
|
|
14513
14583
|
isDisabled,
|
|
14514
|
-
isLast,
|
|
14515
14584
|
id,
|
|
14516
14585
|
onClick,
|
|
14517
14586
|
onHover,
|
|
@@ -14531,11 +14600,11 @@ function SelectCheckboxOption(props) {
|
|
|
14531
14600
|
onClick: () => onClick(option),
|
|
14532
14601
|
onMouseMove: () => onHover(index),
|
|
14533
14602
|
className: cn(
|
|
14534
|
-
"flex w-full items-center gap-3
|
|
14535
|
-
|
|
14603
|
+
"flex w-full items-center gap-3 rounded-md border-0 bg-transparent px-3 py-2 text-left text-[15px] font-medium leading-5 text-[var(--chekin-color-brand-navy)] outline-none transition-colors duration-100",
|
|
14604
|
+
!isDisabled && "cursor-pointer hover:bg-[var(--chekin-color-surface-pressed)]",
|
|
14536
14605
|
isHighlighted && !isDisabled && "bg-[var(--chekin-color-surface-pressed)]",
|
|
14537
|
-
isSelected && "font-
|
|
14538
|
-
isDisabled && "cursor-
|
|
14606
|
+
isSelected && "bg-[var(--chekin-color-surface-autocomplete)] font-semibold text-[var(--chekin-color-brand-blue)]",
|
|
14607
|
+
isDisabled && "cursor-not-allowed text-[var(--chekin-color-gray-2)]"
|
|
14539
14608
|
),
|
|
14540
14609
|
children: [
|
|
14541
14610
|
/* @__PURE__ */ jsx165(
|
|
@@ -14548,9 +14617,9 @@ function SelectCheckboxOption(props) {
|
|
|
14548
14617
|
className: "pointer-events-none shrink-0"
|
|
14549
14618
|
}
|
|
14550
14619
|
),
|
|
14551
|
-
/* @__PURE__ */ jsxs102("span", { className: "flex min-w-0 flex-1 items-
|
|
14620
|
+
/* @__PURE__ */ jsxs102("span", { className: "flex min-w-0 flex-1 items-center justify-between gap-2", children: [
|
|
14552
14621
|
/* @__PURE__ */ jsx165("span", { className: "block break-words", children: option.label }),
|
|
14553
|
-
option.description && /* @__PURE__ */ jsx165("span", { className: "shrink-0 text-[12px] font-
|
|
14622
|
+
option.description && /* @__PURE__ */ jsx165("span", { className: "shrink-0 text-[12px] font-medium italic text-[var(--chekin-color-gray-1)]", children: option.description })
|
|
14554
14623
|
] })
|
|
14555
14624
|
]
|
|
14556
14625
|
}
|
|
@@ -14579,7 +14648,8 @@ function createCountTrigger(opts) {
|
|
|
14579
14648
|
disabled,
|
|
14580
14649
|
placeholder,
|
|
14581
14650
|
selectedOptions,
|
|
14582
|
-
onContainerClick
|
|
14651
|
+
onContainerClick,
|
|
14652
|
+
leftIcon
|
|
14583
14653
|
} = props;
|
|
14584
14654
|
const count = selectedOptions.length;
|
|
14585
14655
|
const total = totalCount ?? count;
|
|
@@ -14601,12 +14671,14 @@ function createCountTrigger(opts) {
|
|
|
14601
14671
|
disabled: isBlocked,
|
|
14602
14672
|
onClick: onContainerClick,
|
|
14603
14673
|
className: cn(
|
|
14604
|
-
"relative m-0 box-border flex h-12 w-full cursor-pointer items-center justify-between gap-2 rounded-[6px] border-0
|
|
14674
|
+
"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",
|
|
14675
|
+
leftIcon ? "pl-10" : "pl-4",
|
|
14605
14676
|
isEmpty ? "bg-[var(--empty-field-background)] text-[var(--chekin-color-gray-1)]" : "bg-transparent text-[var(--chekin-color-brand-navy)]",
|
|
14606
14677
|
disabled && !loading && "cursor-not-allowed opacity-50",
|
|
14607
14678
|
loading && "!cursor-progress"
|
|
14608
14679
|
),
|
|
14609
14680
|
children: [
|
|
14681
|
+
leftIcon && /* @__PURE__ */ jsx166("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__ */ jsx166("span", { className: "flex h-full w-10 items-center justify-center", children: leftIcon }) }),
|
|
14610
14682
|
/* @__PURE__ */ jsx166("span", { id: valueId, className: "block min-w-0 flex-1 truncate text-left", children: display }),
|
|
14611
14683
|
/* @__PURE__ */ jsx166("span", { className: "pointer-events-none flex items-center gap-2 text-[var(--chekin-color-gray-2)]", children: /* @__PURE__ */ jsx166(
|
|
14612
14684
|
ChevronDown3,
|
|
@@ -15744,7 +15816,11 @@ var Datepicker = React63.forwardRef(
|
|
|
15744
15816
|
const [monthInputValue, setMonthInputValue] = React63.useState("");
|
|
15745
15817
|
const [monthHighlightIndex, setMonthHighlightIndex] = React63.useState(-1);
|
|
15746
15818
|
const isMobile3 = useIsMobile();
|
|
15747
|
-
React63.useImperativeHandle(
|
|
15819
|
+
React63.useImperativeHandle(
|
|
15820
|
+
ref,
|
|
15821
|
+
() => dayInputRef.current ?? mobileTriggerRef.current,
|
|
15822
|
+
[isMobile3]
|
|
15823
|
+
);
|
|
15748
15824
|
React63.useEffect(() => {
|
|
15749
15825
|
if (!isControlled) return;
|
|
15750
15826
|
const next = partsFromDate(value ?? null);
|
|
@@ -16408,7 +16484,7 @@ function resolveRangeSelection({
|
|
|
16408
16484
|
}
|
|
16409
16485
|
|
|
16410
16486
|
// src/dashboard/date-range-picker/components/DateRangeInputs.tsx
|
|
16411
|
-
import { CalendarDays, SquareX as
|
|
16487
|
+
import { CalendarDays, SquareX as SquareX3 } from "lucide-react";
|
|
16412
16488
|
import { jsx as jsx173, jsxs as jsxs109 } from "react/jsx-runtime";
|
|
16413
16489
|
var DEFAULT_PLACEHOLDER = "00-00-0000";
|
|
16414
16490
|
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)]";
|
|
@@ -16528,7 +16604,7 @@ function DateRangeInputs({
|
|
|
16528
16604
|
onClick: onReset,
|
|
16529
16605
|
className: iconButtonClass,
|
|
16530
16606
|
"aria-label": clearLabel,
|
|
16531
|
-
children: /* @__PURE__ */ jsx173(
|
|
16607
|
+
children: /* @__PURE__ */ jsx173(SquareX3, { size: 16, fill: "#9696b9", color: "#f8f8f8", strokeWidth: 1.8 })
|
|
16532
16608
|
}
|
|
16533
16609
|
),
|
|
16534
16610
|
!readOnly && !hideCalendarIcon && /* @__PURE__ */ jsx173(
|
|
@@ -17092,7 +17168,7 @@ var TimePicker = React69.forwardRef(function TimePicker2({ format: formatName =
|
|
|
17092
17168
|
|
|
17093
17169
|
// src/dashboard/file-input/FileInput.tsx
|
|
17094
17170
|
import * as React70 from "react";
|
|
17095
|
-
import { Download, Paperclip, SquareX as
|
|
17171
|
+
import { Download, Paperclip, SquareX as SquareX4 } from "lucide-react";
|
|
17096
17172
|
import { useTranslation as useTranslation42 } from "react-i18next";
|
|
17097
17173
|
import { jsx as jsx178, jsxs as jsxs112 } from "react/jsx-runtime";
|
|
17098
17174
|
function defaultDownload(url) {
|
|
@@ -17216,7 +17292,7 @@ var FileInput = React70.forwardRef(function FileInput2({
|
|
|
17216
17292
|
onClick: handleClear,
|
|
17217
17293
|
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]",
|
|
17218
17294
|
"aria-label": t("remove_file"),
|
|
17219
|
-
children: /* @__PURE__ */ jsx178(
|
|
17295
|
+
children: /* @__PURE__ */ jsx178(SquareX4, { size: 15, fill: "#9696b9", color: "#f8f8f8", strokeWidth: 1.8 })
|
|
17220
17296
|
}
|
|
17221
17297
|
)
|
|
17222
17298
|
]
|
|
@@ -17263,78 +17339,92 @@ var FileInput = React70.forwardRef(function FileInput2({
|
|
|
17263
17339
|
// src/dashboard/select-icons-box/SelectIconsBox.tsx
|
|
17264
17340
|
import * as React71 from "react";
|
|
17265
17341
|
import { jsx as jsx179, jsxs as jsxs113 } from "react/jsx-runtime";
|
|
17266
|
-
|
|
17267
|
-
|
|
17268
|
-
|
|
17269
|
-
|
|
17270
|
-
|
|
17271
|
-
|
|
17272
|
-
|
|
17273
|
-
|
|
17274
|
-
|
|
17275
|
-
|
|
17276
|
-
|
|
17277
|
-
|
|
17278
|
-
|
|
17279
|
-
|
|
17280
|
-
|
|
17281
|
-
|
|
17282
|
-
|
|
17283
|
-
|
|
17284
|
-
|
|
17285
|
-
|
|
17286
|
-
|
|
17287
|
-
|
|
17288
|
-
|
|
17289
|
-
|
|
17290
|
-
|
|
17291
|
-
|
|
17292
|
-
|
|
17293
|
-
|
|
17294
|
-
|
|
17295
|
-
|
|
17296
|
-
|
|
17297
|
-
|
|
17298
|
-
|
|
17299
|
-
|
|
17300
|
-
|
|
17301
|
-
|
|
17302
|
-
|
|
17303
|
-
|
|
17304
|
-
|
|
17305
|
-
|
|
17306
|
-
|
|
17307
|
-
|
|
17308
|
-
|
|
17309
|
-
|
|
17310
|
-
|
|
17311
|
-
|
|
17312
|
-
|
|
17313
|
-
|
|
17314
|
-
|
|
17315
|
-
|
|
17316
|
-
|
|
17317
|
-
|
|
17318
|
-
|
|
17319
|
-
|
|
17320
|
-
|
|
17321
|
-
|
|
17322
|
-
|
|
17323
|
-
|
|
17324
|
-
|
|
17325
|
-
|
|
17326
|
-
|
|
17327
|
-
"
|
|
17328
|
-
|
|
17329
|
-
|
|
17330
|
-
|
|
17331
|
-
|
|
17332
|
-
|
|
17333
|
-
|
|
17334
|
-
|
|
17335
|
-
|
|
17336
|
-
|
|
17337
|
-
|
|
17342
|
+
var FOCUSABLE_TRIGGER_SELECTOR2 = 'input:not([type="hidden"]):not([disabled]):not([readonly]), button:not([disabled])';
|
|
17343
|
+
var SelectIconsBox = React71.forwardRef(
|
|
17344
|
+
function SelectIconsBox2({
|
|
17345
|
+
children,
|
|
17346
|
+
icons,
|
|
17347
|
+
renderIcon,
|
|
17348
|
+
onSelect,
|
|
17349
|
+
columns = 4,
|
|
17350
|
+
iconsColor = "#6B6B95",
|
|
17351
|
+
isOpen: controlledOpen,
|
|
17352
|
+
defaultOpen = false,
|
|
17353
|
+
onOpenChange,
|
|
17354
|
+
position = "left",
|
|
17355
|
+
className,
|
|
17356
|
+
boxClassName
|
|
17357
|
+
}, ref) {
|
|
17358
|
+
const containerRef = React71.useRef(null);
|
|
17359
|
+
const combinedContainerRef = useCombinedRef(containerRef, ref);
|
|
17360
|
+
const isControlled = controlledOpen !== void 0;
|
|
17361
|
+
const [internalOpen, setInternalOpen] = React71.useState(defaultOpen);
|
|
17362
|
+
const isOpen = isControlled ? controlledOpen : internalOpen;
|
|
17363
|
+
const setOpen = (next) => {
|
|
17364
|
+
if (!isControlled) setInternalOpen(next);
|
|
17365
|
+
onOpenChange?.(next);
|
|
17366
|
+
};
|
|
17367
|
+
const handleToggle = (event) => {
|
|
17368
|
+
if (event.target.closest("[data-icon-box-item]")) return;
|
|
17369
|
+
setOpen(!isOpen);
|
|
17370
|
+
};
|
|
17371
|
+
useOutsideClick({
|
|
17372
|
+
elementRef: containerRef,
|
|
17373
|
+
onOutsideClick: () => setOpen(false),
|
|
17374
|
+
isDisabled: !isOpen
|
|
17375
|
+
});
|
|
17376
|
+
const handlePick = (iconName) => {
|
|
17377
|
+
onSelect(iconName);
|
|
17378
|
+
setOpen(false);
|
|
17379
|
+
};
|
|
17380
|
+
const handleContainerFocus = (event) => {
|
|
17381
|
+
if (event.target !== event.currentTarget) return;
|
|
17382
|
+
const focusable = event.currentTarget.querySelector(
|
|
17383
|
+
FOCUSABLE_TRIGGER_SELECTOR2
|
|
17384
|
+
);
|
|
17385
|
+
focusable?.focus();
|
|
17386
|
+
};
|
|
17387
|
+
return /* @__PURE__ */ jsxs113(
|
|
17388
|
+
"div",
|
|
17389
|
+
{
|
|
17390
|
+
ref: combinedContainerRef,
|
|
17391
|
+
tabIndex: -1,
|
|
17392
|
+
onFocus: handleContainerFocus,
|
|
17393
|
+
onClick: handleToggle,
|
|
17394
|
+
className: cn("relative inline-block outline-none", className),
|
|
17395
|
+
children: [
|
|
17396
|
+
children,
|
|
17397
|
+
isOpen && /* @__PURE__ */ jsx179(
|
|
17398
|
+
"div",
|
|
17399
|
+
{
|
|
17400
|
+
className: cn(
|
|
17401
|
+
"absolute top-full z-30 mt-1 grid max-h-[192px] overflow-y-auto rounded-[6px] bg-white p-6 shadow-[0_15px_15px_0_rgba(33,72,255,0.2)]",
|
|
17402
|
+
position === "left" && "left-0",
|
|
17403
|
+
position === "right" && "right-0",
|
|
17404
|
+
position === "center" && "left-1/2 -translate-x-1/2",
|
|
17405
|
+
boxClassName
|
|
17406
|
+
),
|
|
17407
|
+
style: { gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))` },
|
|
17408
|
+
children: icons.map((iconName) => /* @__PURE__ */ jsx179(
|
|
17409
|
+
"button",
|
|
17410
|
+
{
|
|
17411
|
+
type: "button",
|
|
17412
|
+
"data-icon-box-item": true,
|
|
17413
|
+
onClick: () => handlePick(iconName),
|
|
17414
|
+
className: "relative flex h-10 w-10 cursor-pointer items-center justify-center rounded-full border-0 bg-transparent p-0 outline-none hover:bg-[#f4f6f8]",
|
|
17415
|
+
"aria-label": iconName,
|
|
17416
|
+
children: renderIcon(iconName, iconsColor)
|
|
17417
|
+
},
|
|
17418
|
+
iconName
|
|
17419
|
+
))
|
|
17420
|
+
}
|
|
17421
|
+
)
|
|
17422
|
+
]
|
|
17423
|
+
}
|
|
17424
|
+
);
|
|
17425
|
+
}
|
|
17426
|
+
);
|
|
17427
|
+
SelectIconsBox.displayName = "SelectIconsBox";
|
|
17338
17428
|
|
|
17339
17429
|
// src/lib/breakpoints.ts
|
|
17340
17430
|
var DEVICE_BREAKPOINTS = {
|
|
@@ -17420,9 +17510,9 @@ function toastResponseError(error, options = {}) {
|
|
|
17420
17510
|
}
|
|
17421
17511
|
|
|
17422
17512
|
// src/legacy-fields/textarea/Textarea.tsx
|
|
17423
|
-
import { forwardRef as
|
|
17513
|
+
import { forwardRef as forwardRef74, useId as useId15 } from "react";
|
|
17424
17514
|
import { jsx as jsx181, jsxs as jsxs115 } from "react/jsx-runtime";
|
|
17425
|
-
var LegacyTextarea =
|
|
17515
|
+
var LegacyTextarea = forwardRef74(
|
|
17426
17516
|
({ className, textareaClassName, label, disabled, name, invalid, ...textareaProps }, ref) => {
|
|
17427
17517
|
const inputId = useId15();
|
|
17428
17518
|
return /* @__PURE__ */ jsxs115("div", { className: cn("relative", className), children: [
|
|
@@ -19228,7 +19318,7 @@ AirbnbPhoneField.displayName = "AirbnbPhoneField";
|
|
|
19228
19318
|
import * as React81 from "react";
|
|
19229
19319
|
import { ChevronDown as ChevronDown7, Search as Search4 } from "lucide-react";
|
|
19230
19320
|
import { useVirtualizer as useVirtualizer3 } from "@tanstack/react-virtual";
|
|
19231
|
-
import { useCallback as
|
|
19321
|
+
import { useCallback as useCallback57 } from "react";
|
|
19232
19322
|
import { jsx as jsx192, jsxs as jsxs123 } from "react/jsx-runtime";
|
|
19233
19323
|
var ROW_HEIGHT = 48;
|
|
19234
19324
|
var DESKTOP_LIST_HEIGHT = 280;
|
|
@@ -19307,7 +19397,7 @@ var AirbnbSearchableSelectInternal = ({
|
|
|
19307
19397
|
isDisabled: !open || isMobile3
|
|
19308
19398
|
});
|
|
19309
19399
|
const handleOnOpenChange = useEvent(onOpenChange);
|
|
19310
|
-
const setSelectOpen =
|
|
19400
|
+
const setSelectOpen = useCallback57(
|
|
19311
19401
|
(nextOpen, options2) => {
|
|
19312
19402
|
setOpen(nextOpen);
|
|
19313
19403
|
handleOnOpenChange?.(nextOpen);
|
|
@@ -19672,7 +19762,7 @@ function getNextEnabledIndex(options, startIndex, step) {
|
|
|
19672
19762
|
// src/airbnb-fields/search-input/SearchInput.tsx
|
|
19673
19763
|
import * as React82 from "react";
|
|
19674
19764
|
import { useTranslation as useTranslation44 } from "react-i18next";
|
|
19675
|
-
import { Search as Search5, X as
|
|
19765
|
+
import { Search as Search5, X as X11 } from "lucide-react";
|
|
19676
19766
|
import { jsx as jsx193, jsxs as jsxs124 } from "react/jsx-runtime";
|
|
19677
19767
|
var AirbnbSearchInput = React82.forwardRef(({ onReset, placeholder, wrapperClassName, ...props }, ref) => {
|
|
19678
19768
|
const { t } = useTranslation44();
|
|
@@ -19704,7 +19794,7 @@ var AirbnbSearchInput = React82.forwardRef(({ onReset, placeholder, wrapperClass
|
|
|
19704
19794
|
variant: "ghost",
|
|
19705
19795
|
onClick: onReset,
|
|
19706
19796
|
className: "absolute right-0 top-1/2 h-5 w-5 -translate-y-1/2 transform text-[#9696B9]",
|
|
19707
|
-
children: /* @__PURE__ */ jsx193(
|
|
19797
|
+
children: /* @__PURE__ */ jsx193(X11, { className: "h-5 w-5" })
|
|
19708
19798
|
}
|
|
19709
19799
|
)
|
|
19710
19800
|
] });
|