@chekinapp/ui 0.0.113 → 0.0.114
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 +212 -138
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +190 -116
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
|
-
import React__default, { ReactNode, ElementType, HTMLAttributes, ComponentProps, ReactElement, InputHTMLAttributes, PropsWithChildren, MouseEvent, SVGProps, ComponentType, ImgHTMLAttributes, AnchorHTMLAttributes, FC, ButtonHTMLAttributes, TdHTMLAttributes, ThHTMLAttributes, MouseEventHandler, ComponentPropsWithoutRef, ForwardedRef, Ref, ChangeEventHandler, FocusEventHandler, KeyboardEventHandler, RefObject, RefCallback, ChangeEvent, TextareaHTMLAttributes } from 'react';
|
|
2
|
+
import React__default, { ReactNode, ElementType, HTMLAttributes, ComponentProps, ReactElement, InputHTMLAttributes, PropsWithChildren, MouseEvent, SVGProps, ComponentType, ImgHTMLAttributes, AnchorHTMLAttributes, FC, ButtonHTMLAttributes, TdHTMLAttributes, ThHTMLAttributes, MouseEventHandler, ComponentPropsWithoutRef, ForwardedRef, Ref, ChangeEventHandler, FocusEventHandler, KeyboardEventHandler, RefObject, UIEvent, RefCallback, ChangeEvent, TextareaHTMLAttributes } from 'react';
|
|
3
3
|
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
4
4
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
5
5
|
import { VariantProps } from 'class-variance-authority';
|
|
@@ -2991,6 +2991,7 @@ type MenuListProps<T, V extends SelectValue$1, L extends ReactNode> = {
|
|
|
2991
2991
|
inputValue?: string;
|
|
2992
2992
|
formatOptionLabel?: SelectFormatOptionLabel<T, V, L>;
|
|
2993
2993
|
isOptionSelected?: SelectIsOptionSelected<T, V, L>;
|
|
2994
|
+
onMenuScrollToBottom?: (event: UIEvent<HTMLDivElement>) => void;
|
|
2994
2995
|
components: SelectComponents<T, V, L>;
|
|
2995
2996
|
};
|
|
2996
2997
|
type OptionProps<T, V extends SelectValue$1, L extends ReactNode> = {
|
|
@@ -3068,6 +3069,7 @@ type BaseSelectProps<T, V extends SelectValue$1, L extends ReactNode> = {
|
|
|
3068
3069
|
onInputChange?: (value: string) => void;
|
|
3069
3070
|
searchPosition?: 'trigger' | 'dropdown';
|
|
3070
3071
|
menuHeader?: React$1.ReactNode;
|
|
3072
|
+
onMenuScrollToBottom?: (event: React$1.UIEvent<HTMLDivElement>) => void;
|
|
3071
3073
|
};
|
|
3072
3074
|
type SingleSelectProps<T, V extends SelectValue$1, L extends ReactNode> = BaseSelectProps<T, V, L> & {
|
|
3073
3075
|
isMulti?: false;
|
|
@@ -3436,7 +3438,7 @@ type SelectIconsBoxProps = {
|
|
|
3436
3438
|
className?: string;
|
|
3437
3439
|
boxClassName?: string;
|
|
3438
3440
|
};
|
|
3439
|
-
declare
|
|
3441
|
+
declare const SelectIconsBox: React$1.ForwardRefExoticComponent<SelectIconsBoxProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
3440
3442
|
|
|
3441
3443
|
declare function copyToClipboard(value: string | number): void;
|
|
3442
3444
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
|
-
import React__default, { ReactNode, ElementType, HTMLAttributes, ComponentProps, ReactElement, InputHTMLAttributes, PropsWithChildren, MouseEvent, SVGProps, ComponentType, ImgHTMLAttributes, AnchorHTMLAttributes, FC, ButtonHTMLAttributes, TdHTMLAttributes, ThHTMLAttributes, MouseEventHandler, ComponentPropsWithoutRef, ForwardedRef, Ref, ChangeEventHandler, FocusEventHandler, KeyboardEventHandler, RefObject, RefCallback, ChangeEvent, TextareaHTMLAttributes } from 'react';
|
|
2
|
+
import React__default, { ReactNode, ElementType, HTMLAttributes, ComponentProps, ReactElement, InputHTMLAttributes, PropsWithChildren, MouseEvent, SVGProps, ComponentType, ImgHTMLAttributes, AnchorHTMLAttributes, FC, ButtonHTMLAttributes, TdHTMLAttributes, ThHTMLAttributes, MouseEventHandler, ComponentPropsWithoutRef, ForwardedRef, Ref, ChangeEventHandler, FocusEventHandler, KeyboardEventHandler, RefObject, UIEvent, RefCallback, ChangeEvent, TextareaHTMLAttributes } from 'react';
|
|
3
3
|
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
4
4
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
5
5
|
import { VariantProps } from 'class-variance-authority';
|
|
@@ -2991,6 +2991,7 @@ type MenuListProps<T, V extends SelectValue$1, L extends ReactNode> = {
|
|
|
2991
2991
|
inputValue?: string;
|
|
2992
2992
|
formatOptionLabel?: SelectFormatOptionLabel<T, V, L>;
|
|
2993
2993
|
isOptionSelected?: SelectIsOptionSelected<T, V, L>;
|
|
2994
|
+
onMenuScrollToBottom?: (event: UIEvent<HTMLDivElement>) => void;
|
|
2994
2995
|
components: SelectComponents<T, V, L>;
|
|
2995
2996
|
};
|
|
2996
2997
|
type OptionProps<T, V extends SelectValue$1, L extends ReactNode> = {
|
|
@@ -3068,6 +3069,7 @@ type BaseSelectProps<T, V extends SelectValue$1, L extends ReactNode> = {
|
|
|
3068
3069
|
onInputChange?: (value: string) => void;
|
|
3069
3070
|
searchPosition?: 'trigger' | 'dropdown';
|
|
3070
3071
|
menuHeader?: React$1.ReactNode;
|
|
3072
|
+
onMenuScrollToBottom?: (event: React$1.UIEvent<HTMLDivElement>) => void;
|
|
3071
3073
|
};
|
|
3072
3074
|
type SingleSelectProps<T, V extends SelectValue$1, L extends ReactNode> = BaseSelectProps<T, V, L> & {
|
|
3073
3075
|
isMulti?: false;
|
|
@@ -3436,7 +3438,7 @@ type SelectIconsBoxProps = {
|
|
|
3436
3438
|
className?: string;
|
|
3437
3439
|
boxClassName?: string;
|
|
3438
3440
|
};
|
|
3439
|
-
declare
|
|
3441
|
+
declare const SelectIconsBox: React$1.ForwardRefExoticComponent<SelectIconsBoxProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
3440
3442
|
|
|
3441
3443
|
declare function copyToClipboard(value: string | number): void;
|
|
3442
3444
|
|
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
|
] }) });
|
|
@@ -13403,7 +13441,7 @@ function useSelectState(params) {
|
|
|
13403
13441
|
}
|
|
13404
13442
|
|
|
13405
13443
|
// src/dashboard/_select-internals/slots/DefaultMultiValueChip.tsx
|
|
13406
|
-
import {
|
|
13444
|
+
import { X as X10 } from "lucide-react";
|
|
13407
13445
|
import { useTranslation as useTranslation31 } from "react-i18next";
|
|
13408
13446
|
import { jsx as jsx151, jsxs as jsxs98 } from "react/jsx-runtime";
|
|
13409
13447
|
function DefaultMultiValueChip({
|
|
@@ -13413,8 +13451,8 @@ function DefaultMultiValueChip({
|
|
|
13413
13451
|
}) {
|
|
13414
13452
|
const { t } = useTranslation31();
|
|
13415
13453
|
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 }),
|
|
13454
|
+
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: [
|
|
13455
|
+
/* @__PURE__ */ jsx151("span", { className: "whitespace-nowrap leading-5", children: option.label }),
|
|
13418
13456
|
!readOnly && /* @__PURE__ */ jsx151(
|
|
13419
13457
|
"button",
|
|
13420
13458
|
{
|
|
@@ -13423,9 +13461,9 @@ function DefaultMultiValueChip({
|
|
|
13423
13461
|
event.stopPropagation();
|
|
13424
13462
|
onRemove();
|
|
13425
13463
|
},
|
|
13426
|
-
className: "flex h-
|
|
13464
|
+
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
13465
|
"aria-label": t("remove_item", { label: labelText }),
|
|
13428
|
-
children: /* @__PURE__ */ jsx151(
|
|
13466
|
+
children: /* @__PURE__ */ jsx151(X10, { size: 12, strokeWidth: 2.5 })
|
|
13429
13467
|
}
|
|
13430
13468
|
)
|
|
13431
13469
|
] });
|
|
@@ -13582,7 +13620,8 @@ function DefaultMenuList(props) {
|
|
|
13582
13620
|
components,
|
|
13583
13621
|
inputValue,
|
|
13584
13622
|
formatOptionLabel,
|
|
13585
|
-
isOptionSelected: isOptionSelected2
|
|
13623
|
+
isOptionSelected: isOptionSelected2,
|
|
13624
|
+
onMenuScrollToBottom
|
|
13586
13625
|
} = props;
|
|
13587
13626
|
return /* @__PURE__ */ jsx154(
|
|
13588
13627
|
SelectMenu,
|
|
@@ -13609,7 +13648,8 @@ function DefaultMenuList(props) {
|
|
|
13609
13648
|
components,
|
|
13610
13649
|
inputValue,
|
|
13611
13650
|
formatOptionLabel,
|
|
13612
|
-
isOptionSelected: isOptionSelected2
|
|
13651
|
+
isOptionSelected: isOptionSelected2,
|
|
13652
|
+
onMenuScrollToBottom
|
|
13613
13653
|
}
|
|
13614
13654
|
);
|
|
13615
13655
|
}
|
|
@@ -13699,7 +13739,8 @@ function SelectInternal(props, ref) {
|
|
|
13699
13739
|
components: userComponents,
|
|
13700
13740
|
onInputChange,
|
|
13701
13741
|
searchPosition = "trigger",
|
|
13702
|
-
menuHeader
|
|
13742
|
+
menuHeader,
|
|
13743
|
+
onMenuScrollToBottom
|
|
13703
13744
|
} = props;
|
|
13704
13745
|
const isSearchInDropdown = searchPosition === "dropdown";
|
|
13705
13746
|
const isMulti = props.isMulti === true;
|
|
@@ -13890,7 +13931,8 @@ function SelectInternal(props, ref) {
|
|
|
13890
13931
|
components,
|
|
13891
13932
|
inputValue: state.inputValue,
|
|
13892
13933
|
formatOptionLabel,
|
|
13893
|
-
isOptionSelected: isOptionSelected2
|
|
13934
|
+
isOptionSelected: isOptionSelected2,
|
|
13935
|
+
onMenuScrollToBottom
|
|
13894
13936
|
}
|
|
13895
13937
|
),
|
|
13896
13938
|
state.canCreateNewOption && /* @__PURE__ */ jsx156(
|
|
@@ -13954,7 +13996,8 @@ function VirtualMenuList(props) {
|
|
|
13954
13996
|
components,
|
|
13955
13997
|
inputValue = "",
|
|
13956
13998
|
formatOptionLabel,
|
|
13957
|
-
isOptionSelected: isOptionSelectedProp
|
|
13999
|
+
isOptionSelected: isOptionSelectedProp,
|
|
14000
|
+
onMenuScrollToBottom
|
|
13958
14001
|
} = props;
|
|
13959
14002
|
const {
|
|
13960
14003
|
canLoadMore,
|
|
@@ -14002,6 +14045,19 @@ function VirtualMenuList(props) {
|
|
|
14002
14045
|
const lastOptionIndex = options.length - 1;
|
|
14003
14046
|
const emptyMessage = noOptionsMessage?.() ?? t("no_options");
|
|
14004
14047
|
const isOptionSelected2 = (option) => isOptionSelectedProp ? isOptionSelectedProp(option, selectedOptions) : selectedOptions.some((s) => s.value === option.value);
|
|
14048
|
+
const wasAtBottomRef = React51.useRef(false);
|
|
14049
|
+
const handleScroll = React51.useCallback(
|
|
14050
|
+
(event) => {
|
|
14051
|
+
if (!onMenuScrollToBottom) return;
|
|
14052
|
+
const target = event.currentTarget;
|
|
14053
|
+
const atBottom = target.scrollHeight - target.scrollTop - target.clientHeight <= 1;
|
|
14054
|
+
if (atBottom && !wasAtBottomRef.current) {
|
|
14055
|
+
onMenuScrollToBottom(event);
|
|
14056
|
+
}
|
|
14057
|
+
wasAtBottomRef.current = atBottom;
|
|
14058
|
+
},
|
|
14059
|
+
[onMenuScrollToBottom]
|
|
14060
|
+
);
|
|
14005
14061
|
if (options.length === 0) {
|
|
14006
14062
|
return /* @__PURE__ */ jsx157("div", { className: "min-h-[75px] px-4 pb-[19px] pt-[17px]", children: isLoadingMore ? /* @__PURE__ */ jsxs100(
|
|
14007
14063
|
"div",
|
|
@@ -14030,6 +14086,7 @@ function VirtualMenuList(props) {
|
|
|
14030
14086
|
ref: scrollRef,
|
|
14031
14087
|
className: cn("overflow-y-auto", menuClassName),
|
|
14032
14088
|
style: { height: `${measuredListHeight}px` },
|
|
14089
|
+
onScroll: onMenuScrollToBottom ? handleScroll : void 0,
|
|
14033
14090
|
children: /* @__PURE__ */ jsx157(
|
|
14034
14091
|
"div",
|
|
14035
14092
|
{
|
|
@@ -14511,7 +14568,6 @@ function SelectCheckboxOption(props) {
|
|
|
14511
14568
|
isSelected,
|
|
14512
14569
|
isHighlighted,
|
|
14513
14570
|
isDisabled,
|
|
14514
|
-
isLast,
|
|
14515
14571
|
id,
|
|
14516
14572
|
onClick,
|
|
14517
14573
|
onHover,
|
|
@@ -14531,11 +14587,11 @@ function SelectCheckboxOption(props) {
|
|
|
14531
14587
|
onClick: () => onClick(option),
|
|
14532
14588
|
onMouseMove: () => onHover(index),
|
|
14533
14589
|
className: cn(
|
|
14534
|
-
"flex w-full items-center gap-3
|
|
14535
|
-
|
|
14590
|
+
"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",
|
|
14591
|
+
!isDisabled && "cursor-pointer hover:bg-[var(--chekin-color-surface-pressed)]",
|
|
14536
14592
|
isHighlighted && !isDisabled && "bg-[var(--chekin-color-surface-pressed)]",
|
|
14537
|
-
isSelected && "font-
|
|
14538
|
-
isDisabled && "cursor-
|
|
14593
|
+
isSelected && "bg-[var(--chekin-color-surface-autocomplete)] font-semibold text-[var(--chekin-color-brand-blue)]",
|
|
14594
|
+
isDisabled && "cursor-not-allowed text-[var(--chekin-color-gray-2)]"
|
|
14539
14595
|
),
|
|
14540
14596
|
children: [
|
|
14541
14597
|
/* @__PURE__ */ jsx165(
|
|
@@ -14548,9 +14604,9 @@ function SelectCheckboxOption(props) {
|
|
|
14548
14604
|
className: "pointer-events-none shrink-0"
|
|
14549
14605
|
}
|
|
14550
14606
|
),
|
|
14551
|
-
/* @__PURE__ */ jsxs102("span", { className: "flex min-w-0 flex-1 items-
|
|
14607
|
+
/* @__PURE__ */ jsxs102("span", { className: "flex min-w-0 flex-1 items-center justify-between gap-2", children: [
|
|
14552
14608
|
/* @__PURE__ */ jsx165("span", { className: "block break-words", children: option.label }),
|
|
14553
|
-
option.description && /* @__PURE__ */ jsx165("span", { className: "shrink-0 text-[12px] font-
|
|
14609
|
+
option.description && /* @__PURE__ */ jsx165("span", { className: "shrink-0 text-[12px] font-medium italic text-[var(--chekin-color-gray-1)]", children: option.description })
|
|
14554
14610
|
] })
|
|
14555
14611
|
]
|
|
14556
14612
|
}
|
|
@@ -15744,7 +15800,11 @@ var Datepicker = React63.forwardRef(
|
|
|
15744
15800
|
const [monthInputValue, setMonthInputValue] = React63.useState("");
|
|
15745
15801
|
const [monthHighlightIndex, setMonthHighlightIndex] = React63.useState(-1);
|
|
15746
15802
|
const isMobile3 = useIsMobile();
|
|
15747
|
-
React63.useImperativeHandle(
|
|
15803
|
+
React63.useImperativeHandle(
|
|
15804
|
+
ref,
|
|
15805
|
+
() => dayInputRef.current ?? mobileTriggerRef.current,
|
|
15806
|
+
[isMobile3]
|
|
15807
|
+
);
|
|
15748
15808
|
React63.useEffect(() => {
|
|
15749
15809
|
if (!isControlled) return;
|
|
15750
15810
|
const next = partsFromDate(value ?? null);
|
|
@@ -16408,7 +16468,7 @@ function resolveRangeSelection({
|
|
|
16408
16468
|
}
|
|
16409
16469
|
|
|
16410
16470
|
// src/dashboard/date-range-picker/components/DateRangeInputs.tsx
|
|
16411
|
-
import { CalendarDays, SquareX as
|
|
16471
|
+
import { CalendarDays, SquareX as SquareX3 } from "lucide-react";
|
|
16412
16472
|
import { jsx as jsx173, jsxs as jsxs109 } from "react/jsx-runtime";
|
|
16413
16473
|
var DEFAULT_PLACEHOLDER = "00-00-0000";
|
|
16414
16474
|
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 +16588,7 @@ function DateRangeInputs({
|
|
|
16528
16588
|
onClick: onReset,
|
|
16529
16589
|
className: iconButtonClass,
|
|
16530
16590
|
"aria-label": clearLabel,
|
|
16531
|
-
children: /* @__PURE__ */ jsx173(
|
|
16591
|
+
children: /* @__PURE__ */ jsx173(SquareX3, { size: 16, fill: "#9696b9", color: "#f8f8f8", strokeWidth: 1.8 })
|
|
16532
16592
|
}
|
|
16533
16593
|
),
|
|
16534
16594
|
!readOnly && !hideCalendarIcon && /* @__PURE__ */ jsx173(
|
|
@@ -17092,7 +17152,7 @@ var TimePicker = React69.forwardRef(function TimePicker2({ format: formatName =
|
|
|
17092
17152
|
|
|
17093
17153
|
// src/dashboard/file-input/FileInput.tsx
|
|
17094
17154
|
import * as React70 from "react";
|
|
17095
|
-
import { Download, Paperclip, SquareX as
|
|
17155
|
+
import { Download, Paperclip, SquareX as SquareX4 } from "lucide-react";
|
|
17096
17156
|
import { useTranslation as useTranslation42 } from "react-i18next";
|
|
17097
17157
|
import { jsx as jsx178, jsxs as jsxs112 } from "react/jsx-runtime";
|
|
17098
17158
|
function defaultDownload(url) {
|
|
@@ -17216,7 +17276,7 @@ var FileInput = React70.forwardRef(function FileInput2({
|
|
|
17216
17276
|
onClick: handleClear,
|
|
17217
17277
|
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
17278
|
"aria-label": t("remove_file"),
|
|
17219
|
-
children: /* @__PURE__ */ jsx178(
|
|
17279
|
+
children: /* @__PURE__ */ jsx178(SquareX4, { size: 15, fill: "#9696b9", color: "#f8f8f8", strokeWidth: 1.8 })
|
|
17220
17280
|
}
|
|
17221
17281
|
)
|
|
17222
17282
|
]
|
|
@@ -17263,78 +17323,92 @@ var FileInput = React70.forwardRef(function FileInput2({
|
|
|
17263
17323
|
// src/dashboard/select-icons-box/SelectIconsBox.tsx
|
|
17264
17324
|
import * as React71 from "react";
|
|
17265
17325
|
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
|
-
|
|
17326
|
+
var FOCUSABLE_TRIGGER_SELECTOR2 = 'input:not([type="hidden"]):not([disabled]):not([readonly]), button:not([disabled])';
|
|
17327
|
+
var SelectIconsBox = React71.forwardRef(
|
|
17328
|
+
function SelectIconsBox2({
|
|
17329
|
+
children,
|
|
17330
|
+
icons,
|
|
17331
|
+
renderIcon,
|
|
17332
|
+
onSelect,
|
|
17333
|
+
columns = 4,
|
|
17334
|
+
iconsColor = "#6B6B95",
|
|
17335
|
+
isOpen: controlledOpen,
|
|
17336
|
+
defaultOpen = false,
|
|
17337
|
+
onOpenChange,
|
|
17338
|
+
position = "left",
|
|
17339
|
+
className,
|
|
17340
|
+
boxClassName
|
|
17341
|
+
}, ref) {
|
|
17342
|
+
const containerRef = React71.useRef(null);
|
|
17343
|
+
const combinedContainerRef = useCombinedRef(containerRef, ref);
|
|
17344
|
+
const isControlled = controlledOpen !== void 0;
|
|
17345
|
+
const [internalOpen, setInternalOpen] = React71.useState(defaultOpen);
|
|
17346
|
+
const isOpen = isControlled ? controlledOpen : internalOpen;
|
|
17347
|
+
const setOpen = (next) => {
|
|
17348
|
+
if (!isControlled) setInternalOpen(next);
|
|
17349
|
+
onOpenChange?.(next);
|
|
17350
|
+
};
|
|
17351
|
+
const handleToggle = (event) => {
|
|
17352
|
+
if (event.target.closest("[data-icon-box-item]")) return;
|
|
17353
|
+
setOpen(!isOpen);
|
|
17354
|
+
};
|
|
17355
|
+
useOutsideClick({
|
|
17356
|
+
elementRef: containerRef,
|
|
17357
|
+
onOutsideClick: () => setOpen(false),
|
|
17358
|
+
isDisabled: !isOpen
|
|
17359
|
+
});
|
|
17360
|
+
const handlePick = (iconName) => {
|
|
17361
|
+
onSelect(iconName);
|
|
17362
|
+
setOpen(false);
|
|
17363
|
+
};
|
|
17364
|
+
const handleContainerFocus = (event) => {
|
|
17365
|
+
if (event.target !== event.currentTarget) return;
|
|
17366
|
+
const focusable = event.currentTarget.querySelector(
|
|
17367
|
+
FOCUSABLE_TRIGGER_SELECTOR2
|
|
17368
|
+
);
|
|
17369
|
+
focusable?.focus();
|
|
17370
|
+
};
|
|
17371
|
+
return /* @__PURE__ */ jsxs113(
|
|
17372
|
+
"div",
|
|
17373
|
+
{
|
|
17374
|
+
ref: combinedContainerRef,
|
|
17375
|
+
tabIndex: -1,
|
|
17376
|
+
onFocus: handleContainerFocus,
|
|
17377
|
+
onClick: handleToggle,
|
|
17378
|
+
className: cn("relative inline-block outline-none", className),
|
|
17379
|
+
children: [
|
|
17380
|
+
children,
|
|
17381
|
+
isOpen && /* @__PURE__ */ jsx179(
|
|
17382
|
+
"div",
|
|
17383
|
+
{
|
|
17384
|
+
className: cn(
|
|
17385
|
+
"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)]",
|
|
17386
|
+
position === "left" && "left-0",
|
|
17387
|
+
position === "right" && "right-0",
|
|
17388
|
+
position === "center" && "left-1/2 -translate-x-1/2",
|
|
17389
|
+
boxClassName
|
|
17390
|
+
),
|
|
17391
|
+
style: { gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))` },
|
|
17392
|
+
children: icons.map((iconName) => /* @__PURE__ */ jsx179(
|
|
17393
|
+
"button",
|
|
17394
|
+
{
|
|
17395
|
+
type: "button",
|
|
17396
|
+
"data-icon-box-item": true,
|
|
17397
|
+
onClick: () => handlePick(iconName),
|
|
17398
|
+
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]",
|
|
17399
|
+
"aria-label": iconName,
|
|
17400
|
+
children: renderIcon(iconName, iconsColor)
|
|
17401
|
+
},
|
|
17402
|
+
iconName
|
|
17403
|
+
))
|
|
17404
|
+
}
|
|
17405
|
+
)
|
|
17406
|
+
]
|
|
17407
|
+
}
|
|
17408
|
+
);
|
|
17409
|
+
}
|
|
17410
|
+
);
|
|
17411
|
+
SelectIconsBox.displayName = "SelectIconsBox";
|
|
17338
17412
|
|
|
17339
17413
|
// src/lib/breakpoints.ts
|
|
17340
17414
|
var DEVICE_BREAKPOINTS = {
|
|
@@ -17420,9 +17494,9 @@ function toastResponseError(error, options = {}) {
|
|
|
17420
17494
|
}
|
|
17421
17495
|
|
|
17422
17496
|
// src/legacy-fields/textarea/Textarea.tsx
|
|
17423
|
-
import { forwardRef as
|
|
17497
|
+
import { forwardRef as forwardRef74, useId as useId15 } from "react";
|
|
17424
17498
|
import { jsx as jsx181, jsxs as jsxs115 } from "react/jsx-runtime";
|
|
17425
|
-
var LegacyTextarea =
|
|
17499
|
+
var LegacyTextarea = forwardRef74(
|
|
17426
17500
|
({ className, textareaClassName, label, disabled, name, invalid, ...textareaProps }, ref) => {
|
|
17427
17501
|
const inputId = useId15();
|
|
17428
17502
|
return /* @__PURE__ */ jsxs115("div", { className: cn("relative", className), children: [
|
|
@@ -19228,7 +19302,7 @@ AirbnbPhoneField.displayName = "AirbnbPhoneField";
|
|
|
19228
19302
|
import * as React81 from "react";
|
|
19229
19303
|
import { ChevronDown as ChevronDown7, Search as Search4 } from "lucide-react";
|
|
19230
19304
|
import { useVirtualizer as useVirtualizer3 } from "@tanstack/react-virtual";
|
|
19231
|
-
import { useCallback as
|
|
19305
|
+
import { useCallback as useCallback57 } from "react";
|
|
19232
19306
|
import { jsx as jsx192, jsxs as jsxs123 } from "react/jsx-runtime";
|
|
19233
19307
|
var ROW_HEIGHT = 48;
|
|
19234
19308
|
var DESKTOP_LIST_HEIGHT = 280;
|
|
@@ -19307,7 +19381,7 @@ var AirbnbSearchableSelectInternal = ({
|
|
|
19307
19381
|
isDisabled: !open || isMobile3
|
|
19308
19382
|
});
|
|
19309
19383
|
const handleOnOpenChange = useEvent(onOpenChange);
|
|
19310
|
-
const setSelectOpen =
|
|
19384
|
+
const setSelectOpen = useCallback57(
|
|
19311
19385
|
(nextOpen, options2) => {
|
|
19312
19386
|
setOpen(nextOpen);
|
|
19313
19387
|
handleOnOpenChange?.(nextOpen);
|
|
@@ -19672,7 +19746,7 @@ function getNextEnabledIndex(options, startIndex, step) {
|
|
|
19672
19746
|
// src/airbnb-fields/search-input/SearchInput.tsx
|
|
19673
19747
|
import * as React82 from "react";
|
|
19674
19748
|
import { useTranslation as useTranslation44 } from "react-i18next";
|
|
19675
|
-
import { Search as Search5, X as
|
|
19749
|
+
import { Search as Search5, X as X11 } from "lucide-react";
|
|
19676
19750
|
import { jsx as jsx193, jsxs as jsxs124 } from "react/jsx-runtime";
|
|
19677
19751
|
var AirbnbSearchInput = React82.forwardRef(({ onReset, placeholder, wrapperClassName, ...props }, ref) => {
|
|
19678
19752
|
const { t } = useTranslation44();
|
|
@@ -19704,7 +19778,7 @@ var AirbnbSearchInput = React82.forwardRef(({ onReset, placeholder, wrapperClass
|
|
|
19704
19778
|
variant: "ghost",
|
|
19705
19779
|
onClick: onReset,
|
|
19706
19780
|
className: "absolute right-0 top-1/2 h-5 w-5 -translate-y-1/2 transform text-[#9696B9]",
|
|
19707
|
-
children: /* @__PURE__ */ jsx193(
|
|
19781
|
+
children: /* @__PURE__ */ jsx193(X11, { className: "h-5 w-5" })
|
|
19708
19782
|
}
|
|
19709
19783
|
)
|
|
19710
19784
|
] });
|