@chekinapp/ui 0.0.70 → 0.0.72
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 +195 -129
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +195 -129
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -9758,19 +9758,6 @@ var getValueArray = (value) => {
|
|
|
9758
9758
|
}
|
|
9759
9759
|
return [];
|
|
9760
9760
|
};
|
|
9761
|
-
var convertStringToValue = (stringValue, option) => {
|
|
9762
|
-
console.log(stringValue, option);
|
|
9763
|
-
if (option) {
|
|
9764
|
-
return option.value;
|
|
9765
|
-
}
|
|
9766
|
-
if (stringValue === "true") return true;
|
|
9767
|
-
if (stringValue === "false") return false;
|
|
9768
|
-
const numValue = Number(stringValue);
|
|
9769
|
-
if (!isNaN(numValue) && stringValue !== "") {
|
|
9770
|
-
return numValue;
|
|
9771
|
-
}
|
|
9772
|
-
return stringValue;
|
|
9773
|
-
};
|
|
9774
9761
|
function getToggleContent(label, disabled, readOnly, active) {
|
|
9775
9762
|
if ((0, import_react76.isValidElement)(label)) {
|
|
9776
9763
|
return (0, import_react76.cloneElement)(label, {
|
|
@@ -9807,7 +9794,7 @@ function TogglesInternal({
|
|
|
9807
9794
|
const newValueArray = Array.isArray(newValue) ? newValue : [newValue];
|
|
9808
9795
|
const typedValues = newValueArray.map((item) => {
|
|
9809
9796
|
const option2 = options.find((opt) => String(opt.value) === item);
|
|
9810
|
-
return
|
|
9797
|
+
return option2 ? option2.value : item;
|
|
9811
9798
|
});
|
|
9812
9799
|
onChange?.(
|
|
9813
9800
|
typedValues,
|
|
@@ -9817,10 +9804,7 @@ function TogglesInternal({
|
|
|
9817
9804
|
}
|
|
9818
9805
|
const singleValue = Array.isArray(newValue) ? newValue[0] : newValue;
|
|
9819
9806
|
const option = options.find((opt) => String(opt.value) === singleValue);
|
|
9820
|
-
const typedValue =
|
|
9821
|
-
{
|
|
9822
|
-
console.log("typedValues", typedValue);
|
|
9823
|
-
}
|
|
9807
|
+
const typedValue = option ? option.value : singleValue;
|
|
9824
9808
|
onChange?.(
|
|
9825
9809
|
typedValue,
|
|
9826
9810
|
{}
|
|
@@ -14143,6 +14127,52 @@ function SelectMenu({
|
|
|
14143
14127
|
);
|
|
14144
14128
|
}
|
|
14145
14129
|
|
|
14130
|
+
// src/dashboard/_select-internals/SelectMenuPanel.tsx
|
|
14131
|
+
var import_jsx_runtime157 = require("react/jsx-runtime");
|
|
14132
|
+
function SelectMenuPanel({
|
|
14133
|
+
isOpen,
|
|
14134
|
+
isMobile: isMobile2,
|
|
14135
|
+
onClose,
|
|
14136
|
+
title,
|
|
14137
|
+
className,
|
|
14138
|
+
drawerClassName,
|
|
14139
|
+
children
|
|
14140
|
+
}) {
|
|
14141
|
+
if (!isOpen) return null;
|
|
14142
|
+
if (isMobile2) {
|
|
14143
|
+
return /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
|
|
14144
|
+
Drawer,
|
|
14145
|
+
{
|
|
14146
|
+
open: isOpen,
|
|
14147
|
+
onOpenChange: (next) => {
|
|
14148
|
+
if (!next) onClose();
|
|
14149
|
+
},
|
|
14150
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)(
|
|
14151
|
+
DrawerContent,
|
|
14152
|
+
{
|
|
14153
|
+
onClose,
|
|
14154
|
+
className: cn("max-h-[calc(100vh-1rem)]", drawerClassName),
|
|
14155
|
+
children: [
|
|
14156
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(DrawerTitle, { className: "px-5 pb-3 pt-1 text-left text-[16px] font-semibold leading-6 text-[var(--chekin-color-brand-navy)]", children: title }) : /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(DrawerTitle, { className: "sr-only", children: "Select option" }),
|
|
14157
|
+
/* @__PURE__ */ (0, import_jsx_runtime157.jsx)("div", { className: "flex min-h-0 flex-1 flex-col", children })
|
|
14158
|
+
]
|
|
14159
|
+
}
|
|
14160
|
+
)
|
|
14161
|
+
}
|
|
14162
|
+
);
|
|
14163
|
+
}
|
|
14164
|
+
return /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
|
|
14165
|
+
"div",
|
|
14166
|
+
{
|
|
14167
|
+
className: cn(
|
|
14168
|
+
"absolute left-0 right-0 top-full z-20 overflow-hidden rounded-b-lg bg-white shadow-[0_30px_30px_0_rgba(33,72,255,0.2)]",
|
|
14169
|
+
className
|
|
14170
|
+
),
|
|
14171
|
+
children
|
|
14172
|
+
}
|
|
14173
|
+
);
|
|
14174
|
+
}
|
|
14175
|
+
|
|
14146
14176
|
// src/dashboard/_select-internals/useSelectIds.ts
|
|
14147
14177
|
var React54 = __toESM(require("react"), 1);
|
|
14148
14178
|
function useSelectIds2({
|
|
@@ -14179,7 +14209,7 @@ function useSelectIds2({
|
|
|
14179
14209
|
}
|
|
14180
14210
|
|
|
14181
14211
|
// src/dashboard/select/Select.tsx
|
|
14182
|
-
var
|
|
14212
|
+
var import_jsx_runtime158 = require("react/jsx-runtime");
|
|
14183
14213
|
function DashboardSelectInternal({
|
|
14184
14214
|
options = [],
|
|
14185
14215
|
value,
|
|
@@ -14199,6 +14229,7 @@ function DashboardSelectInternal({
|
|
|
14199
14229
|
className,
|
|
14200
14230
|
menuClassName,
|
|
14201
14231
|
dropdownClassName,
|
|
14232
|
+
drawerClassName,
|
|
14202
14233
|
name,
|
|
14203
14234
|
width,
|
|
14204
14235
|
noOptionsMessage,
|
|
@@ -14215,6 +14246,7 @@ function DashboardSelectInternal({
|
|
|
14215
14246
|
const [isOpen, setIsOpen] = React55.useState(false);
|
|
14216
14247
|
const [searchValue, setSearchValue] = React55.useState("");
|
|
14217
14248
|
const [highlightedIndex, setHighlightedIndex] = React55.useState(-1);
|
|
14249
|
+
const isMobile2 = useIsMobile();
|
|
14218
14250
|
const hasValue = Boolean(value);
|
|
14219
14251
|
const isEmpty = !hasValue;
|
|
14220
14252
|
const isBlocked = Boolean(disabled) || Boolean(loading);
|
|
@@ -14232,7 +14264,7 @@ function DashboardSelectInternal({
|
|
|
14232
14264
|
useOutsideClick({
|
|
14233
14265
|
elementRef: containerRef,
|
|
14234
14266
|
onOutsideClick: () => setIsOpen(false),
|
|
14235
|
-
isDisabled: !isOpen
|
|
14267
|
+
isDisabled: !isOpen || isMobile2
|
|
14236
14268
|
});
|
|
14237
14269
|
React55.useEffect(() => {
|
|
14238
14270
|
if (isBlocked) setIsOpen(false);
|
|
@@ -14311,7 +14343,7 @@ function DashboardSelectInternal({
|
|
|
14311
14343
|
setIsOpen(false);
|
|
14312
14344
|
}
|
|
14313
14345
|
};
|
|
14314
|
-
return /* @__PURE__ */ (0,
|
|
14346
|
+
return /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)(
|
|
14315
14347
|
"div",
|
|
14316
14348
|
{
|
|
14317
14349
|
ref: containerRef,
|
|
@@ -14323,9 +14355,9 @@ function DashboardSelectInternal({
|
|
|
14323
14355
|
),
|
|
14324
14356
|
style: wrapperWidth ? { width: wrapperWidth } : void 0,
|
|
14325
14357
|
children: [
|
|
14326
|
-
name && /* @__PURE__ */ (0,
|
|
14327
|
-
/* @__PURE__ */ (0,
|
|
14328
|
-
topLabel && /* @__PURE__ */ (0,
|
|
14358
|
+
name && /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("input", { type: "hidden", name, value: value ? String(value.value) : "" }),
|
|
14359
|
+
/* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "relative w-full min-h-[68px]", children: [
|
|
14360
|
+
topLabel && /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
|
|
14329
14361
|
"label",
|
|
14330
14362
|
{
|
|
14331
14363
|
htmlFor: triggerId,
|
|
@@ -14333,8 +14365,8 @@ function DashboardSelectInternal({
|
|
|
14333
14365
|
children: topLabel
|
|
14334
14366
|
}
|
|
14335
14367
|
),
|
|
14336
|
-
/* @__PURE__ */ (0,
|
|
14337
|
-
/* @__PURE__ */ (0,
|
|
14368
|
+
/* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "relative w-full", children: [
|
|
14369
|
+
/* @__PURE__ */ (0, import_jsx_runtime158.jsxs)(
|
|
14338
14370
|
"button",
|
|
14339
14371
|
{
|
|
14340
14372
|
id: triggerId,
|
|
@@ -14358,10 +14390,10 @@ function DashboardSelectInternal({
|
|
|
14358
14390
|
loading && "cursor-progress"
|
|
14359
14391
|
),
|
|
14360
14392
|
children: [
|
|
14361
|
-
/* @__PURE__ */ (0,
|
|
14362
|
-
/* @__PURE__ */ (0,
|
|
14363
|
-
loading && /* @__PURE__ */ (0,
|
|
14364
|
-
/* @__PURE__ */ (0,
|
|
14393
|
+
/* @__PURE__ */ (0, import_jsx_runtime158.jsx)("span", { id: valueId, className: "block min-w-0 flex-1 truncate text-left", children: valueLabel ?? placeholder ?? label }),
|
|
14394
|
+
/* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("span", { className: "pointer-events-none flex items-center gap-2 text-[var(--chekin-color-gray-2)]", children: [
|
|
14395
|
+
loading && /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(ThreeDotsLoader, { height: 18, width: 18 }),
|
|
14396
|
+
/* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
|
|
14365
14397
|
import_lucide_react47.ChevronDown,
|
|
14366
14398
|
{
|
|
14367
14399
|
size: 16,
|
|
@@ -14375,7 +14407,7 @@ function DashboardSelectInternal({
|
|
|
14375
14407
|
]
|
|
14376
14408
|
}
|
|
14377
14409
|
),
|
|
14378
|
-
/* @__PURE__ */ (0,
|
|
14410
|
+
/* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
|
|
14379
14411
|
Fieldset,
|
|
14380
14412
|
{
|
|
14381
14413
|
isFocused: isOpen,
|
|
@@ -14392,15 +14424,17 @@ function DashboardSelectInternal({
|
|
|
14392
14424
|
onClick: !isBlocked ? toggleMenu : void 0
|
|
14393
14425
|
}
|
|
14394
14426
|
),
|
|
14395
|
-
|
|
14396
|
-
|
|
14427
|
+
/* @__PURE__ */ (0, import_jsx_runtime158.jsxs)(
|
|
14428
|
+
SelectMenuPanel,
|
|
14397
14429
|
{
|
|
14398
|
-
|
|
14399
|
-
|
|
14400
|
-
|
|
14401
|
-
|
|
14430
|
+
isOpen,
|
|
14431
|
+
isMobile: isMobile2,
|
|
14432
|
+
onClose: () => setIsOpen(false),
|
|
14433
|
+
title: typeof label === "string" ? label : void 0,
|
|
14434
|
+
className: dropdownClassName,
|
|
14435
|
+
drawerClassName,
|
|
14402
14436
|
children: [
|
|
14403
|
-
searchable && /* @__PURE__ */ (0,
|
|
14437
|
+
searchable && /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("div", { className: "border-b border-[#f2f4f8] px-4 pb-2 pt-3", children: /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
|
|
14404
14438
|
"input",
|
|
14405
14439
|
{
|
|
14406
14440
|
ref: searchInputRef,
|
|
@@ -14415,7 +14449,7 @@ function DashboardSelectInternal({
|
|
|
14415
14449
|
className: "m-0 box-border h-9 w-full rounded-md border border-[var(--chekin-color-gray-3)] bg-white px-3 text-[16px] font-medium text-[var(--chekin-color-brand-navy)] outline-none transition-colors placeholder:text-[var(--chekin-color-gray-1)] focus:border-[var(--chekin-color-brand-blue)]"
|
|
14416
14450
|
}
|
|
14417
14451
|
) }),
|
|
14418
|
-
/* @__PURE__ */ (0,
|
|
14452
|
+
/* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
|
|
14419
14453
|
SelectMenu,
|
|
14420
14454
|
{
|
|
14421
14455
|
id: listboxId,
|
|
@@ -14440,9 +14474,9 @@ function DashboardSelectInternal({
|
|
|
14440
14474
|
}
|
|
14441
14475
|
)
|
|
14442
14476
|
] }),
|
|
14443
|
-
!errorMessage && optional && /* @__PURE__ */ (0,
|
|
14444
|
-
!errorMessage && helperText && /* @__PURE__ */ (0,
|
|
14445
|
-
errorMessage && !hideErrorMessage && /* @__PURE__ */ (0,
|
|
14477
|
+
!errorMessage && optional && /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("span", { className: "mt-[1px] block text-left text-[14px] font-medium text-[var(--chekin-color-gray-1)]", children: typeof optional === "string" ? optional : "optional" }),
|
|
14478
|
+
!errorMessage && helperText && /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("span", { className: "mt-[1px] block text-[12px] font-normal text-[var(--chekin-color-gray-1)]", children: helperText }),
|
|
14479
|
+
errorMessage && !hideErrorMessage && /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
|
|
14446
14480
|
FieldErrorMessage,
|
|
14447
14481
|
{
|
|
14448
14482
|
id: errorId,
|
|
@@ -14462,7 +14496,7 @@ var DashboardSelect = React55.forwardRef(
|
|
|
14462
14496
|
// src/dashboard/multi-select/MultiSelect.tsx
|
|
14463
14497
|
var React56 = __toESM(require("react"), 1);
|
|
14464
14498
|
var import_lucide_react48 = require("lucide-react");
|
|
14465
|
-
var
|
|
14499
|
+
var import_jsx_runtime159 = require("react/jsx-runtime");
|
|
14466
14500
|
var isValueSelected = (selected, option) => selected.some((item) => item.value === option.value);
|
|
14467
14501
|
function DashboardMultiSelectInternal({
|
|
14468
14502
|
options = [],
|
|
@@ -14483,6 +14517,7 @@ function DashboardMultiSelectInternal({
|
|
|
14483
14517
|
className,
|
|
14484
14518
|
menuClassName,
|
|
14485
14519
|
dropdownClassName,
|
|
14520
|
+
drawerClassName,
|
|
14486
14521
|
name,
|
|
14487
14522
|
width,
|
|
14488
14523
|
noOptionsMessage,
|
|
@@ -14497,12 +14532,14 @@ function DashboardMultiSelectInternal({
|
|
|
14497
14532
|
}, ref) {
|
|
14498
14533
|
const containerRef = React56.useRef(null);
|
|
14499
14534
|
const inputRef = React56.useRef(null);
|
|
14535
|
+
const mobileSearchInputRef = React56.useRef(null);
|
|
14500
14536
|
const listRef = React56.useRef(null);
|
|
14501
14537
|
const optionRefs = React56.useRef([]);
|
|
14502
14538
|
const [isOpen, setIsOpen] = React56.useState(false);
|
|
14503
14539
|
const [searchValue, setSearchValue] = React56.useState("");
|
|
14504
14540
|
const [isFocused, setIsFocused] = React56.useState(false);
|
|
14505
14541
|
const [highlightedIndex, setHighlightedIndex] = React56.useState(-1);
|
|
14542
|
+
const isMobile2 = useIsMobile();
|
|
14506
14543
|
const selectedValues = React56.useMemo(() => value ?? [], [value]);
|
|
14507
14544
|
const hasValue = selectedValues.length > 0;
|
|
14508
14545
|
const isEmpty = !hasValue;
|
|
@@ -14539,7 +14576,7 @@ function DashboardMultiSelectInternal({
|
|
|
14539
14576
|
setIsOpen(false);
|
|
14540
14577
|
setIsFocused(false);
|
|
14541
14578
|
},
|
|
14542
|
-
isDisabled: !isOpen
|
|
14579
|
+
isDisabled: !isOpen || isMobile2
|
|
14543
14580
|
});
|
|
14544
14581
|
React56.useEffect(() => {
|
|
14545
14582
|
if (isBlocked) setIsOpen(false);
|
|
@@ -14560,6 +14597,11 @@ function DashboardMultiSelectInternal({
|
|
|
14560
14597
|
return getFirstEnabledOptionIndex2(filteredOptions);
|
|
14561
14598
|
});
|
|
14562
14599
|
}, [isOpen, filteredOptions]);
|
|
14600
|
+
React56.useEffect(() => {
|
|
14601
|
+
if (!isOpen || !isMobile2) return;
|
|
14602
|
+
const frame = window.requestAnimationFrame(() => mobileSearchInputRef.current?.focus());
|
|
14603
|
+
return () => window.cancelAnimationFrame(frame);
|
|
14604
|
+
}, [isOpen, isMobile2]);
|
|
14563
14605
|
const openMenu = () => {
|
|
14564
14606
|
if (isBlocked) return;
|
|
14565
14607
|
setIsOpen(true);
|
|
@@ -14654,7 +14696,7 @@ function DashboardMultiSelectInternal({
|
|
|
14654
14696
|
setIsFocused(false);
|
|
14655
14697
|
onBlur?.(event);
|
|
14656
14698
|
};
|
|
14657
|
-
return /* @__PURE__ */ (0,
|
|
14699
|
+
return /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(
|
|
14658
14700
|
"div",
|
|
14659
14701
|
{
|
|
14660
14702
|
ref: containerRef,
|
|
@@ -14667,7 +14709,7 @@ function DashboardMultiSelectInternal({
|
|
|
14667
14709
|
),
|
|
14668
14710
|
style: wrapperWidth ? { width: wrapperWidth } : void 0,
|
|
14669
14711
|
children: [
|
|
14670
|
-
topLabel && /* @__PURE__ */ (0,
|
|
14712
|
+
topLabel && /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
|
|
14671
14713
|
"label",
|
|
14672
14714
|
{
|
|
14673
14715
|
htmlFor: triggerId,
|
|
@@ -14675,7 +14717,7 @@ function DashboardMultiSelectInternal({
|
|
|
14675
14717
|
children: topLabel
|
|
14676
14718
|
}
|
|
14677
14719
|
),
|
|
14678
|
-
name && /* @__PURE__ */ (0,
|
|
14720
|
+
name && /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
|
|
14679
14721
|
"input",
|
|
14680
14722
|
{
|
|
14681
14723
|
type: "hidden",
|
|
@@ -14683,8 +14725,8 @@ function DashboardMultiSelectInternal({
|
|
|
14683
14725
|
value: selectedValues.map((item) => String(item.value)).join(",")
|
|
14684
14726
|
}
|
|
14685
14727
|
),
|
|
14686
|
-
/* @__PURE__ */ (0,
|
|
14687
|
-
/* @__PURE__ */ (0,
|
|
14728
|
+
/* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("div", { className: "relative w-full", children: [
|
|
14729
|
+
/* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(
|
|
14688
14730
|
"div",
|
|
14689
14731
|
{
|
|
14690
14732
|
id: triggerId,
|
|
@@ -14707,13 +14749,13 @@ function DashboardMultiSelectInternal({
|
|
|
14707
14749
|
),
|
|
14708
14750
|
children: [
|
|
14709
14751
|
selectedValues.map(
|
|
14710
|
-
(option) => renderChip ? /* @__PURE__ */ (0,
|
|
14752
|
+
(option) => renderChip ? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(React56.Fragment, { children: renderChip(option, () => removeOption(option)) }, String(option.value)) : /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(
|
|
14711
14753
|
"span",
|
|
14712
14754
|
{
|
|
14713
14755
|
className: "inline-flex items-center gap-2 rounded-[4px] border border-[#acacd5] bg-[#f0f0f8] py-[2px] pl-[10px] pr-1 text-[12px] font-medium text-[var(--chekin-color-brand-navy)]",
|
|
14714
14756
|
children: [
|
|
14715
|
-
/* @__PURE__ */ (0,
|
|
14716
|
-
!readOnly && /* @__PURE__ */ (0,
|
|
14757
|
+
/* @__PURE__ */ (0, import_jsx_runtime159.jsx)("span", { className: "whitespace-nowrap", children: option.label }),
|
|
14758
|
+
!readOnly && /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
|
|
14717
14759
|
"button",
|
|
14718
14760
|
{
|
|
14719
14761
|
type: "button",
|
|
@@ -14723,7 +14765,7 @@ function DashboardMultiSelectInternal({
|
|
|
14723
14765
|
},
|
|
14724
14766
|
className: "flex h-[15px] w-[15px] items-center justify-center rounded-[3px] border-0 bg-transparent p-0 text-[#9696b9] hover:shadow-[0_3px_3px_#0f477734]",
|
|
14725
14767
|
"aria-label": `Remove ${typeof option.label === "string" ? option.label : String(option.value)}`,
|
|
14726
|
-
children: /* @__PURE__ */ (0,
|
|
14768
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(import_lucide_react48.SquareX, { size: 15, fill: "#9696b9", color: "#f8f8f8", strokeWidth: 1.8 })
|
|
14727
14769
|
}
|
|
14728
14770
|
)
|
|
14729
14771
|
]
|
|
@@ -14731,7 +14773,7 @@ function DashboardMultiSelectInternal({
|
|
|
14731
14773
|
String(option.value)
|
|
14732
14774
|
)
|
|
14733
14775
|
),
|
|
14734
|
-
/* @__PURE__ */ (0,
|
|
14776
|
+
/* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
|
|
14735
14777
|
"input",
|
|
14736
14778
|
{
|
|
14737
14779
|
ref: inputRef,
|
|
@@ -14760,9 +14802,9 @@ function DashboardMultiSelectInternal({
|
|
|
14760
14802
|
"aria-activedescendant": isOpen && highlightedIndex >= 0 ? getOptionId2(highlightedIndex) : void 0
|
|
14761
14803
|
}
|
|
14762
14804
|
),
|
|
14763
|
-
/* @__PURE__ */ (0,
|
|
14764
|
-
loading && /* @__PURE__ */ (0,
|
|
14765
|
-
hasValue && !readOnly && /* @__PURE__ */ (0,
|
|
14805
|
+
/* @__PURE__ */ (0, import_jsx_runtime159.jsxs)("span", { className: "ml-auto flex items-center gap-2 pl-2 text-[var(--chekin-color-gray-2)]", children: [
|
|
14806
|
+
loading && /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(ThreeDotsLoader, { height: 18, width: 18 }),
|
|
14807
|
+
hasValue && !readOnly && /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
|
|
14766
14808
|
"button",
|
|
14767
14809
|
{
|
|
14768
14810
|
type: "button",
|
|
@@ -14772,10 +14814,10 @@ function DashboardMultiSelectInternal({
|
|
|
14772
14814
|
},
|
|
14773
14815
|
className: "flex h-5 w-5 items-center justify-center rounded-[3px] border-0 bg-transparent p-0 text-[#9696b9] hover:shadow-[0_3px_3px_#0f477734]",
|
|
14774
14816
|
"aria-label": "Clear all",
|
|
14775
|
-
children: /* @__PURE__ */ (0,
|
|
14817
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(import_lucide_react48.SquareX, { size: 15, fill: "#9696b9", color: "#f8f8f8", strokeWidth: 1.8 })
|
|
14776
14818
|
}
|
|
14777
14819
|
),
|
|
14778
|
-
/* @__PURE__ */ (0,
|
|
14820
|
+
/* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
|
|
14779
14821
|
RotateArrow,
|
|
14780
14822
|
{
|
|
14781
14823
|
shouldRotate: isOpen,
|
|
@@ -14788,7 +14830,7 @@ function DashboardMultiSelectInternal({
|
|
|
14788
14830
|
]
|
|
14789
14831
|
}
|
|
14790
14832
|
),
|
|
14791
|
-
/* @__PURE__ */ (0,
|
|
14833
|
+
/* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
|
|
14792
14834
|
Fieldset,
|
|
14793
14835
|
{
|
|
14794
14836
|
isFocused: isFocused || isOpen,
|
|
@@ -14806,15 +14848,35 @@ function DashboardMultiSelectInternal({
|
|
|
14806
14848
|
onClick: handleContainerClick
|
|
14807
14849
|
}
|
|
14808
14850
|
),
|
|
14809
|
-
|
|
14810
|
-
|
|
14851
|
+
/* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(
|
|
14852
|
+
SelectMenuPanel,
|
|
14811
14853
|
{
|
|
14812
|
-
|
|
14813
|
-
|
|
14814
|
-
|
|
14815
|
-
|
|
14854
|
+
isOpen,
|
|
14855
|
+
isMobile: isMobile2,
|
|
14856
|
+
onClose: () => {
|
|
14857
|
+
setIsOpen(false);
|
|
14858
|
+
setIsFocused(false);
|
|
14859
|
+
},
|
|
14860
|
+
title: typeof label === "string" ? label : void 0,
|
|
14861
|
+
className: dropdownClassName,
|
|
14862
|
+
drawerClassName,
|
|
14816
14863
|
children: [
|
|
14817
|
-
/* @__PURE__ */ (0,
|
|
14864
|
+
isMobile2 && /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("div", { className: "border-b border-[#f2f4f8] px-4 pb-2 pt-3", children: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
|
|
14865
|
+
"input",
|
|
14866
|
+
{
|
|
14867
|
+
ref: mobileSearchInputRef,
|
|
14868
|
+
type: "text",
|
|
14869
|
+
value: searchValue,
|
|
14870
|
+
placeholder: placeholder ?? "",
|
|
14871
|
+
onChange: (event) => setSearchValue(event.target.value),
|
|
14872
|
+
onKeyDown: handleInputKeyDown,
|
|
14873
|
+
autoComplete: "off",
|
|
14874
|
+
"aria-controls": listboxId,
|
|
14875
|
+
"aria-activedescendant": highlightedIndex >= 0 ? getOptionId2(highlightedIndex) : void 0,
|
|
14876
|
+
className: "m-0 box-border h-9 w-full rounded-md border border-[var(--chekin-color-gray-3)] bg-white px-3 text-[16px] font-medium text-[var(--chekin-color-brand-navy)] outline-none transition-colors placeholder:text-[var(--chekin-color-gray-1)] focus:border-[var(--chekin-color-brand-blue)]"
|
|
14877
|
+
}
|
|
14878
|
+
) }),
|
|
14879
|
+
/* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
|
|
14818
14880
|
SelectMenu,
|
|
14819
14881
|
{
|
|
14820
14882
|
id: listboxId,
|
|
@@ -14836,7 +14898,7 @@ function DashboardMultiSelectInternal({
|
|
|
14836
14898
|
isMulti: true
|
|
14837
14899
|
}
|
|
14838
14900
|
),
|
|
14839
|
-
canCreateNewOption && /* @__PURE__ */ (0,
|
|
14901
|
+
canCreateNewOption && /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
|
|
14840
14902
|
"button",
|
|
14841
14903
|
{
|
|
14842
14904
|
type: "button",
|
|
@@ -14849,9 +14911,9 @@ function DashboardMultiSelectInternal({
|
|
|
14849
14911
|
}
|
|
14850
14912
|
)
|
|
14851
14913
|
] }),
|
|
14852
|
-
!errorMessage && optional && /* @__PURE__ */ (0,
|
|
14853
|
-
!errorMessage && helperText && /* @__PURE__ */ (0,
|
|
14854
|
-
errorMessage && !hideErrorMessage && /* @__PURE__ */ (0,
|
|
14914
|
+
!errorMessage && optional && /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("span", { className: "mt-[1px] block text-left text-[14px] font-medium text-[var(--chekin-color-gray-1)]", children: typeof optional === "string" ? optional : "optional" }),
|
|
14915
|
+
!errorMessage && helperText && /* @__PURE__ */ (0, import_jsx_runtime159.jsx)("span", { className: "mt-[1px] block text-[12px] font-normal text-[var(--chekin-color-gray-1)]", children: helperText }),
|
|
14916
|
+
errorMessage && !hideErrorMessage && /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
|
|
14855
14917
|
FieldErrorMessage,
|
|
14856
14918
|
{
|
|
14857
14919
|
id: errorId,
|
|
@@ -14869,10 +14931,10 @@ var DashboardMultiSelect = React56.forwardRef(
|
|
|
14869
14931
|
|
|
14870
14932
|
// src/dashboard/creatable-multi-select/CreatableMultiSelect.tsx
|
|
14871
14933
|
var React57 = __toESM(require("react"), 1);
|
|
14872
|
-
var
|
|
14934
|
+
var import_jsx_runtime160 = require("react/jsx-runtime");
|
|
14873
14935
|
var DashboardCreatableMultiSelect = React57.forwardRef(
|
|
14874
14936
|
function DashboardCreatableMultiSelect2(props, ref) {
|
|
14875
|
-
return /* @__PURE__ */ (0,
|
|
14937
|
+
return /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(DashboardMultiSelect, { ref, ...props, isCreatable: true });
|
|
14876
14938
|
}
|
|
14877
14939
|
);
|
|
14878
14940
|
|
|
@@ -14880,7 +14942,7 @@ var DashboardCreatableMultiSelect = React57.forwardRef(
|
|
|
14880
14942
|
var React58 = __toESM(require("react"), 1);
|
|
14881
14943
|
var import_lucide_react49 = require("lucide-react");
|
|
14882
14944
|
var import_react_virtual2 = require("@tanstack/react-virtual");
|
|
14883
|
-
var
|
|
14945
|
+
var import_jsx_runtime161 = require("react/jsx-runtime");
|
|
14884
14946
|
var DEFAULT_ITEM_HEIGHT = 60;
|
|
14885
14947
|
var DEFAULT_LIST_HEIGHT = 322;
|
|
14886
14948
|
var DEFAULT_OVERSCAN = 5;
|
|
@@ -14904,6 +14966,7 @@ function DashboardInfiniteScrollSelectInternal({
|
|
|
14904
14966
|
className,
|
|
14905
14967
|
menuClassName,
|
|
14906
14968
|
dropdownClassName,
|
|
14969
|
+
drawerClassName,
|
|
14907
14970
|
name,
|
|
14908
14971
|
width,
|
|
14909
14972
|
noOptionsMessage,
|
|
@@ -14928,6 +14991,7 @@ function DashboardInfiniteScrollSelectInternal({
|
|
|
14928
14991
|
const [isOpen, setIsOpen] = React58.useState(false);
|
|
14929
14992
|
const [searchValue, setSearchValue] = React58.useState("");
|
|
14930
14993
|
const [highlightedIndex, setHighlightedIndex] = React58.useState(-1);
|
|
14994
|
+
const isMobile2 = useIsMobile();
|
|
14931
14995
|
const hasValue = Boolean(value);
|
|
14932
14996
|
const isEmpty = !hasValue;
|
|
14933
14997
|
const isBlocked = Boolean(disabled) || Boolean(loading);
|
|
@@ -14952,7 +15016,7 @@ function DashboardInfiniteScrollSelectInternal({
|
|
|
14952
15016
|
useOutsideClick({
|
|
14953
15017
|
elementRef: containerRef,
|
|
14954
15018
|
onOutsideClick: () => setIsOpen(false),
|
|
14955
|
-
isDisabled: !isOpen
|
|
15019
|
+
isDisabled: !isOpen || isMobile2
|
|
14956
15020
|
});
|
|
14957
15021
|
React58.useEffect(() => {
|
|
14958
15022
|
if (isBlocked) setIsOpen(false);
|
|
@@ -15047,7 +15111,7 @@ function DashboardInfiniteScrollSelectInternal({
|
|
|
15047
15111
|
const emptyMessage = noOptionsMessage?.();
|
|
15048
15112
|
const totalSize = virtualizer.getTotalSize();
|
|
15049
15113
|
const measuredListHeight = Math.min(listHeight, Math.max(totalSize, itemHeight));
|
|
15050
|
-
return /* @__PURE__ */ (0,
|
|
15114
|
+
return /* @__PURE__ */ (0, import_jsx_runtime161.jsxs)(
|
|
15051
15115
|
"div",
|
|
15052
15116
|
{
|
|
15053
15117
|
ref: containerRef,
|
|
@@ -15059,9 +15123,9 @@ function DashboardInfiniteScrollSelectInternal({
|
|
|
15059
15123
|
),
|
|
15060
15124
|
style: wrapperWidth ? { width: wrapperWidth } : void 0,
|
|
15061
15125
|
children: [
|
|
15062
|
-
name && /* @__PURE__ */ (0,
|
|
15063
|
-
/* @__PURE__ */ (0,
|
|
15064
|
-
topLabel && /* @__PURE__ */ (0,
|
|
15126
|
+
name && /* @__PURE__ */ (0, import_jsx_runtime161.jsx)("input", { type: "hidden", name, value: value ? String(value.value) : "" }),
|
|
15127
|
+
/* @__PURE__ */ (0, import_jsx_runtime161.jsxs)("div", { className: "relative min-h-[68px] w-full", children: [
|
|
15128
|
+
topLabel && /* @__PURE__ */ (0, import_jsx_runtime161.jsx)(
|
|
15065
15129
|
"label",
|
|
15066
15130
|
{
|
|
15067
15131
|
htmlFor: triggerId,
|
|
@@ -15069,8 +15133,8 @@ function DashboardInfiniteScrollSelectInternal({
|
|
|
15069
15133
|
children: topLabel
|
|
15070
15134
|
}
|
|
15071
15135
|
),
|
|
15072
|
-
/* @__PURE__ */ (0,
|
|
15073
|
-
/* @__PURE__ */ (0,
|
|
15136
|
+
/* @__PURE__ */ (0, import_jsx_runtime161.jsxs)("div", { className: "relative w-full", children: [
|
|
15137
|
+
/* @__PURE__ */ (0, import_jsx_runtime161.jsxs)(
|
|
15074
15138
|
"button",
|
|
15075
15139
|
{
|
|
15076
15140
|
id: triggerId,
|
|
@@ -15094,10 +15158,10 @@ function DashboardInfiniteScrollSelectInternal({
|
|
|
15094
15158
|
loading && "cursor-progress"
|
|
15095
15159
|
),
|
|
15096
15160
|
children: [
|
|
15097
|
-
/* @__PURE__ */ (0,
|
|
15098
|
-
/* @__PURE__ */ (0,
|
|
15099
|
-
loading && /* @__PURE__ */ (0,
|
|
15100
|
-
/* @__PURE__ */ (0,
|
|
15161
|
+
/* @__PURE__ */ (0, import_jsx_runtime161.jsx)("span", { id: valueId, className: "block min-w-0 flex-1 truncate text-left", children: valueLabel ?? placeholder ?? label }),
|
|
15162
|
+
/* @__PURE__ */ (0, import_jsx_runtime161.jsxs)("span", { className: "pointer-events-none flex items-center gap-2 text-[var(--chekin-color-gray-2)]", children: [
|
|
15163
|
+
loading && /* @__PURE__ */ (0, import_jsx_runtime161.jsx)(ThreeDotsLoader, { height: 18, width: 18 }),
|
|
15164
|
+
/* @__PURE__ */ (0, import_jsx_runtime161.jsx)(
|
|
15101
15165
|
import_lucide_react49.ChevronDown,
|
|
15102
15166
|
{
|
|
15103
15167
|
size: 16,
|
|
@@ -15111,7 +15175,7 @@ function DashboardInfiniteScrollSelectInternal({
|
|
|
15111
15175
|
]
|
|
15112
15176
|
}
|
|
15113
15177
|
),
|
|
15114
|
-
/* @__PURE__ */ (0,
|
|
15178
|
+
/* @__PURE__ */ (0, import_jsx_runtime161.jsx)(
|
|
15115
15179
|
Fieldset,
|
|
15116
15180
|
{
|
|
15117
15181
|
isFocused: isOpen,
|
|
@@ -15128,15 +15192,17 @@ function DashboardInfiniteScrollSelectInternal({
|
|
|
15128
15192
|
onClick: !isBlocked ? toggleMenu : void 0
|
|
15129
15193
|
}
|
|
15130
15194
|
),
|
|
15131
|
-
|
|
15132
|
-
|
|
15195
|
+
/* @__PURE__ */ (0, import_jsx_runtime161.jsxs)(
|
|
15196
|
+
SelectMenuPanel,
|
|
15133
15197
|
{
|
|
15134
|
-
|
|
15135
|
-
|
|
15136
|
-
|
|
15137
|
-
|
|
15198
|
+
isOpen,
|
|
15199
|
+
isMobile: isMobile2,
|
|
15200
|
+
onClose: () => setIsOpen(false),
|
|
15201
|
+
title: typeof label === "string" ? label : void 0,
|
|
15202
|
+
className: dropdownClassName,
|
|
15203
|
+
drawerClassName,
|
|
15138
15204
|
children: [
|
|
15139
|
-
searchable && /* @__PURE__ */ (0,
|
|
15205
|
+
searchable && /* @__PURE__ */ (0, import_jsx_runtime161.jsx)("div", { className: "border-b border-[#f2f4f8] px-4 pb-2 pt-3", children: /* @__PURE__ */ (0, import_jsx_runtime161.jsx)(
|
|
15140
15206
|
"input",
|
|
15141
15207
|
{
|
|
15142
15208
|
ref: searchInputRef,
|
|
@@ -15151,13 +15217,13 @@ function DashboardInfiniteScrollSelectInternal({
|
|
|
15151
15217
|
className: "m-0 box-border h-9 w-full rounded-md border border-[var(--chekin-color-gray-3)] bg-white px-3 text-[16px] font-medium text-[var(--chekin-color-brand-navy)] outline-none transition-colors placeholder:text-[var(--chekin-color-gray-1)] focus:border-[var(--chekin-color-brand-blue)]"
|
|
15152
15218
|
}
|
|
15153
15219
|
) }),
|
|
15154
|
-
itemCount === 0 ? /* @__PURE__ */ (0,
|
|
15220
|
+
itemCount === 0 ? /* @__PURE__ */ (0, import_jsx_runtime161.jsx)("div", { className: "px-4 py-[20px] text-left text-[16px] text-[var(--chekin-color-brand-navy)]", children: emptyMessage ?? "No options" }) : /* @__PURE__ */ (0, import_jsx_runtime161.jsx)(
|
|
15155
15221
|
"div",
|
|
15156
15222
|
{
|
|
15157
15223
|
ref: scrollRef,
|
|
15158
15224
|
className: cn("overflow-y-auto", menuClassName),
|
|
15159
15225
|
style: { height: `${measuredListHeight}px` },
|
|
15160
|
-
children: /* @__PURE__ */ (0,
|
|
15226
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime161.jsx)(
|
|
15161
15227
|
"div",
|
|
15162
15228
|
{
|
|
15163
15229
|
id: listboxId,
|
|
@@ -15174,7 +15240,7 @@ function DashboardInfiniteScrollSelectInternal({
|
|
|
15174
15240
|
const isSelected = !isLoaderRow && option ? option.value === value?.value : false;
|
|
15175
15241
|
const isHighlighted = virtualItem.index === highlightedIndex;
|
|
15176
15242
|
const isOptionDisabled = Boolean(isBlocked || option?.isDisabled);
|
|
15177
|
-
return /* @__PURE__ */ (0,
|
|
15243
|
+
return /* @__PURE__ */ (0, import_jsx_runtime161.jsx)(
|
|
15178
15244
|
"div",
|
|
15179
15245
|
{
|
|
15180
15246
|
"data-index": virtualItem.index,
|
|
@@ -15183,10 +15249,10 @@ function DashboardInfiniteScrollSelectInternal({
|
|
|
15183
15249
|
height: `${virtualItem.size}px`,
|
|
15184
15250
|
transform: `translateY(${virtualItem.start}px)`
|
|
15185
15251
|
},
|
|
15186
|
-
children: isLoaderRow ? /* @__PURE__ */ (0,
|
|
15187
|
-
/* @__PURE__ */ (0,
|
|
15188
|
-
/* @__PURE__ */ (0,
|
|
15189
|
-
] }) : /* @__PURE__ */ (0,
|
|
15252
|
+
children: isLoaderRow ? /* @__PURE__ */ (0, import_jsx_runtime161.jsxs)("div", { className: "flex h-full items-center justify-center gap-2 px-4 text-[14px] font-medium text-[var(--chekin-color-gray-1)]", children: [
|
|
15253
|
+
/* @__PURE__ */ (0, import_jsx_runtime161.jsx)(ThreeDotsLoader, { height: 18, width: 18 }),
|
|
15254
|
+
/* @__PURE__ */ (0, import_jsx_runtime161.jsx)("span", { children: loadingMoreText })
|
|
15255
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime161.jsxs)(
|
|
15190
15256
|
"button",
|
|
15191
15257
|
{
|
|
15192
15258
|
id: getOptionId2(virtualItem.index),
|
|
@@ -15205,8 +15271,8 @@ function DashboardInfiniteScrollSelectInternal({
|
|
|
15205
15271
|
isOptionDisabled && "cursor-default opacity-30"
|
|
15206
15272
|
),
|
|
15207
15273
|
children: [
|
|
15208
|
-
/* @__PURE__ */ (0,
|
|
15209
|
-
option?.description && /* @__PURE__ */ (0,
|
|
15274
|
+
/* @__PURE__ */ (0, import_jsx_runtime161.jsx)("span", { className: "block break-words", children: option?.label }),
|
|
15275
|
+
option?.description && /* @__PURE__ */ (0, import_jsx_runtime161.jsx)("span", { className: "ml-2 mt-[3px] shrink-0 text-[12px] font-bold italic text-[#777e91]", children: option.description })
|
|
15210
15276
|
]
|
|
15211
15277
|
}
|
|
15212
15278
|
)
|
|
@@ -15222,9 +15288,9 @@ function DashboardInfiniteScrollSelectInternal({
|
|
|
15222
15288
|
}
|
|
15223
15289
|
)
|
|
15224
15290
|
] }),
|
|
15225
|
-
!errorMessage && optional && /* @__PURE__ */ (0,
|
|
15226
|
-
!errorMessage && helperText && /* @__PURE__ */ (0,
|
|
15227
|
-
errorMessage && !hideErrorMessage && /* @__PURE__ */ (0,
|
|
15291
|
+
!errorMessage && optional && /* @__PURE__ */ (0, import_jsx_runtime161.jsx)("span", { className: "mt-[1px] block text-left text-[14px] font-medium text-[var(--chekin-color-gray-1)]", children: typeof optional === "string" ? optional : "optional" }),
|
|
15292
|
+
!errorMessage && helperText && /* @__PURE__ */ (0, import_jsx_runtime161.jsx)("span", { className: "mt-[1px] block text-[12px] font-normal text-[var(--chekin-color-gray-1)]", children: helperText }),
|
|
15293
|
+
errorMessage && !hideErrorMessage && /* @__PURE__ */ (0, import_jsx_runtime161.jsx)(
|
|
15228
15294
|
FieldErrorMessage,
|
|
15229
15295
|
{
|
|
15230
15296
|
id: errorId,
|
|
@@ -15246,7 +15312,7 @@ var React59 = __toESM(require("react"), 1);
|
|
|
15246
15312
|
var import_lucide_react50 = require("lucide-react");
|
|
15247
15313
|
var import_react_virtual3 = require("@tanstack/react-virtual");
|
|
15248
15314
|
var import_react82 = require("react");
|
|
15249
|
-
var
|
|
15315
|
+
var import_jsx_runtime162 = require("react/jsx-runtime");
|
|
15250
15316
|
var ROW_HEIGHT = 48;
|
|
15251
15317
|
var DESKTOP_LIST_HEIGHT = 280;
|
|
15252
15318
|
var MOBILE_LIST_HEIGHT = 420;
|
|
@@ -15415,7 +15481,7 @@ var SearchableSelectInternal = ({
|
|
|
15415
15481
|
}
|
|
15416
15482
|
}
|
|
15417
15483
|
}
|
|
15418
|
-
const content = /* @__PURE__ */ (0,
|
|
15484
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
|
|
15419
15485
|
SearchableSelectContent,
|
|
15420
15486
|
{
|
|
15421
15487
|
inputId: searchInputId,
|
|
@@ -15443,9 +15509,9 @@ var SearchableSelectInternal = ({
|
|
|
15443
15509
|
}
|
|
15444
15510
|
);
|
|
15445
15511
|
React59.useImperativeHandle(ref, () => triggerRef.current, []);
|
|
15446
|
-
return /* @__PURE__ */ (0,
|
|
15447
|
-
name && /* @__PURE__ */ (0,
|
|
15448
|
-
/* @__PURE__ */ (0,
|
|
15512
|
+
return /* @__PURE__ */ (0, import_jsx_runtime162.jsxs)("div", { ref: containerRef, className: cn("relative w-full max-w-[425px]", className), children: [
|
|
15513
|
+
name && /* @__PURE__ */ (0, import_jsx_runtime162.jsx)("input", { type: "hidden", name, value: value ? String(value.value) : "" }),
|
|
15514
|
+
/* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
|
|
15449
15515
|
FieldTrigger,
|
|
15450
15516
|
{
|
|
15451
15517
|
id: `${reactId}-trigger`,
|
|
@@ -15480,7 +15546,7 @@ var SearchableSelectInternal = ({
|
|
|
15480
15546
|
},
|
|
15481
15547
|
onKeyDown: handleTriggerKeyDown,
|
|
15482
15548
|
onBlur,
|
|
15483
|
-
trailingAdornment: /* @__PURE__ */ (0,
|
|
15549
|
+
trailingAdornment: /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
|
|
15484
15550
|
import_lucide_react50.ChevronDown,
|
|
15485
15551
|
{
|
|
15486
15552
|
className: cn(
|
|
@@ -15491,7 +15557,7 @@ var SearchableSelectInternal = ({
|
|
|
15491
15557
|
)
|
|
15492
15558
|
}
|
|
15493
15559
|
),
|
|
15494
|
-
isMobile2 ? /* @__PURE__ */ (0,
|
|
15560
|
+
isMobile2 ? /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
|
|
15495
15561
|
Drawer,
|
|
15496
15562
|
{
|
|
15497
15563
|
open,
|
|
@@ -15503,13 +15569,13 @@ var SearchableSelectInternal = ({
|
|
|
15503
15569
|
}
|
|
15504
15570
|
closeSelect();
|
|
15505
15571
|
},
|
|
15506
|
-
children: /* @__PURE__ */ (0,
|
|
15507
|
-
/* @__PURE__ */ (0,
|
|
15508
|
-
/* @__PURE__ */ (0,
|
|
15509
|
-
/* @__PURE__ */ (0,
|
|
15572
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime162.jsxs)(DrawerContent, { onClose: closeSelect, lockScroll: false, children: [
|
|
15573
|
+
/* @__PURE__ */ (0, import_jsx_runtime162.jsx)(DrawerTitle, { className: "sr-only", children: mobileTitle ?? label }),
|
|
15574
|
+
/* @__PURE__ */ (0, import_jsx_runtime162.jsx)(DrawerDescription, { className: "sr-only", children: label }),
|
|
15575
|
+
/* @__PURE__ */ (0, import_jsx_runtime162.jsx)("div", { className: "px-5 pb-5 pt-1", children: content })
|
|
15510
15576
|
] })
|
|
15511
15577
|
}
|
|
15512
|
-
) : open ? /* @__PURE__ */ (0,
|
|
15578
|
+
) : open ? /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
|
|
15513
15579
|
"div",
|
|
15514
15580
|
{
|
|
15515
15581
|
className: cn(
|
|
@@ -15576,16 +15642,16 @@ function SearchableSelectContent({
|
|
|
15576
15642
|
virtualizer.scrollToIndex(highlightedIndex, { align: "auto" });
|
|
15577
15643
|
}
|
|
15578
15644
|
}, [highlightedIndex, virtualizer]);
|
|
15579
|
-
return /* @__PURE__ */ (0,
|
|
15580
|
-
/* @__PURE__ */ (0,
|
|
15581
|
-
/* @__PURE__ */ (0,
|
|
15645
|
+
return /* @__PURE__ */ (0, import_jsx_runtime162.jsxs)("div", { className: "p-2", children: [
|
|
15646
|
+
/* @__PURE__ */ (0, import_jsx_runtime162.jsxs)("div", { className: "relative mb-2", children: [
|
|
15647
|
+
/* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
|
|
15582
15648
|
import_lucide_react50.Search,
|
|
15583
15649
|
{
|
|
15584
15650
|
"aria-hidden": "true",
|
|
15585
15651
|
className: "absolute left-4 top-1/2 h-5 w-5 -translate-y-1/2 text-[#9696B9]"
|
|
15586
15652
|
}
|
|
15587
15653
|
),
|
|
15588
|
-
/* @__PURE__ */ (0,
|
|
15654
|
+
/* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
|
|
15589
15655
|
"input",
|
|
15590
15656
|
{
|
|
15591
15657
|
id: inputId,
|
|
@@ -15604,7 +15670,7 @@ function SearchableSelectContent({
|
|
|
15604
15670
|
}
|
|
15605
15671
|
)
|
|
15606
15672
|
] }),
|
|
15607
|
-
loading && options.length === 0 ? /* @__PURE__ */ (0,
|
|
15673
|
+
loading && options.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime162.jsx)("div", { className: "px-4 py-5 text-center text-base leading-6 text-[#6C6C6C]", children: loadingText }) : options.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime162.jsx)("div", { className: "px-4 py-5 text-center text-base leading-6 text-[#6C6C6C]", children: emptyMessage }) : /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
|
|
15608
15674
|
"div",
|
|
15609
15675
|
{
|
|
15610
15676
|
id: listboxId,
|
|
@@ -15613,7 +15679,7 @@ function SearchableSelectContent({
|
|
|
15613
15679
|
"aria-labelledby": labelId,
|
|
15614
15680
|
className: cn("overflow-y-auto outline-none", menuClassName),
|
|
15615
15681
|
style: { height: Math.min(height, rowCount * ROW_HEIGHT) },
|
|
15616
|
-
children: /* @__PURE__ */ (0,
|
|
15682
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
|
|
15617
15683
|
"div",
|
|
15618
15684
|
{
|
|
15619
15685
|
className: "relative w-full",
|
|
@@ -15621,7 +15687,7 @@ function SearchableSelectContent({
|
|
|
15621
15687
|
children: virtualItems.map((virtualItem) => {
|
|
15622
15688
|
const option = options[virtualItem.index];
|
|
15623
15689
|
if (!option) {
|
|
15624
|
-
return /* @__PURE__ */ (0,
|
|
15690
|
+
return /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
|
|
15625
15691
|
"div",
|
|
15626
15692
|
{
|
|
15627
15693
|
className: "absolute left-0 top-0 flex w-full items-center px-4 text-base leading-6 text-[#6C6C6C]",
|
|
@@ -15636,7 +15702,7 @@ function SearchableSelectContent({
|
|
|
15636
15702
|
}
|
|
15637
15703
|
const isSelected = value?.value === option.value;
|
|
15638
15704
|
const isHighlighted = virtualItem.index === highlightedIndex;
|
|
15639
|
-
return /* @__PURE__ */ (0,
|
|
15705
|
+
return /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
|
|
15640
15706
|
"button",
|
|
15641
15707
|
{
|
|
15642
15708
|
id: getOptionId(idPrefix, virtualItem.index),
|
|
@@ -15658,7 +15724,7 @@ function SearchableSelectContent({
|
|
|
15658
15724
|
height: `${virtualItem.size}px`,
|
|
15659
15725
|
transform: `translateY(${virtualItem.start}px)`
|
|
15660
15726
|
},
|
|
15661
|
-
children: /* @__PURE__ */ (0,
|
|
15727
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime162.jsx)("span", { className: "truncate text-center", children: String(option.label) })
|
|
15662
15728
|
},
|
|
15663
15729
|
`${String(option.value)}-${virtualItem.index}`
|
|
15664
15730
|
);
|
|
@@ -15744,14 +15810,14 @@ function getErrorMessage(error) {
|
|
|
15744
15810
|
|
|
15745
15811
|
// src/lib/toastResponseError.tsx
|
|
15746
15812
|
var import_i18next = __toESM(require("i18next"), 1);
|
|
15747
|
-
var
|
|
15813
|
+
var import_jsx_runtime163 = require("react/jsx-runtime");
|
|
15748
15814
|
function addSupportEmailToMessage(message, prefixText) {
|
|
15749
15815
|
if (typeof message !== "string") {
|
|
15750
15816
|
return message;
|
|
15751
15817
|
}
|
|
15752
15818
|
const builtMessage = `${prefixText ? `${prefixText} ` : ""}${message}`;
|
|
15753
|
-
return /* @__PURE__ */ (0,
|
|
15754
|
-
/* @__PURE__ */ (0,
|
|
15819
|
+
return /* @__PURE__ */ (0, import_jsx_runtime163.jsxs)("div", { children: [
|
|
15820
|
+
/* @__PURE__ */ (0, import_jsx_runtime163.jsx)("div", { children: builtMessage }),
|
|
15755
15821
|
import_i18next.default.t("reach_us_at_email")
|
|
15756
15822
|
] });
|
|
15757
15823
|
}
|