@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.js CHANGED
@@ -9405,19 +9405,6 @@ var getValueArray = (value) => {
9405
9405
  }
9406
9406
  return [];
9407
9407
  };
9408
- var convertStringToValue = (stringValue, option) => {
9409
- console.log(stringValue, option);
9410
- if (option) {
9411
- return option.value;
9412
- }
9413
- if (stringValue === "true") return true;
9414
- if (stringValue === "false") return false;
9415
- const numValue = Number(stringValue);
9416
- if (!isNaN(numValue) && stringValue !== "") {
9417
- return numValue;
9418
- }
9419
- return stringValue;
9420
- };
9421
9408
  function getToggleContent(label, disabled, readOnly, active) {
9422
9409
  if (isValidElement2(label)) {
9423
9410
  return cloneElement2(label, {
@@ -9454,7 +9441,7 @@ function TogglesInternal({
9454
9441
  const newValueArray = Array.isArray(newValue) ? newValue : [newValue];
9455
9442
  const typedValues = newValueArray.map((item) => {
9456
9443
  const option2 = options.find((opt) => String(opt.value) === item);
9457
- return convertStringToValue(item, option2);
9444
+ return option2 ? option2.value : item;
9458
9445
  });
9459
9446
  onChange?.(
9460
9447
  typedValues,
@@ -9464,10 +9451,7 @@ function TogglesInternal({
9464
9451
  }
9465
9452
  const singleValue = Array.isArray(newValue) ? newValue[0] : newValue;
9466
9453
  const option = options.find((opt) => String(opt.value) === singleValue);
9467
- const typedValue = convertStringToValue(singleValue, option);
9468
- {
9469
- console.log("typedValues", typedValue);
9470
- }
9454
+ const typedValue = option ? option.value : singleValue;
9471
9455
  onChange?.(
9472
9456
  typedValue,
9473
9457
  {}
@@ -13801,6 +13785,52 @@ function SelectMenu({
13801
13785
  );
13802
13786
  }
13803
13787
 
13788
+ // src/dashboard/_select-internals/SelectMenuPanel.tsx
13789
+ import { jsx as jsx155, jsxs as jsxs99 } from "react/jsx-runtime";
13790
+ function SelectMenuPanel({
13791
+ isOpen,
13792
+ isMobile: isMobile2,
13793
+ onClose,
13794
+ title,
13795
+ className,
13796
+ drawerClassName,
13797
+ children
13798
+ }) {
13799
+ if (!isOpen) return null;
13800
+ if (isMobile2) {
13801
+ return /* @__PURE__ */ jsx155(
13802
+ Drawer,
13803
+ {
13804
+ open: isOpen,
13805
+ onOpenChange: (next) => {
13806
+ if (!next) onClose();
13807
+ },
13808
+ children: /* @__PURE__ */ jsxs99(
13809
+ DrawerContent,
13810
+ {
13811
+ onClose,
13812
+ className: cn("max-h-[calc(100vh-1rem)]", drawerClassName),
13813
+ children: [
13814
+ title ? /* @__PURE__ */ jsx155(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__ */ jsx155(DrawerTitle, { className: "sr-only", children: "Select option" }),
13815
+ /* @__PURE__ */ jsx155("div", { className: "flex min-h-0 flex-1 flex-col", children })
13816
+ ]
13817
+ }
13818
+ )
13819
+ }
13820
+ );
13821
+ }
13822
+ return /* @__PURE__ */ jsx155(
13823
+ "div",
13824
+ {
13825
+ className: cn(
13826
+ "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)]",
13827
+ className
13828
+ ),
13829
+ children
13830
+ }
13831
+ );
13832
+ }
13833
+
13804
13834
  // src/dashboard/_select-internals/useSelectIds.ts
13805
13835
  import * as React54 from "react";
13806
13836
  function useSelectIds2({
@@ -13837,7 +13867,7 @@ function useSelectIds2({
13837
13867
  }
13838
13868
 
13839
13869
  // src/dashboard/select/Select.tsx
13840
- import { jsx as jsx155, jsxs as jsxs99 } from "react/jsx-runtime";
13870
+ import { jsx as jsx156, jsxs as jsxs100 } from "react/jsx-runtime";
13841
13871
  function DashboardSelectInternal({
13842
13872
  options = [],
13843
13873
  value,
@@ -13857,6 +13887,7 @@ function DashboardSelectInternal({
13857
13887
  className,
13858
13888
  menuClassName,
13859
13889
  dropdownClassName,
13890
+ drawerClassName,
13860
13891
  name,
13861
13892
  width,
13862
13893
  noOptionsMessage,
@@ -13873,6 +13904,7 @@ function DashboardSelectInternal({
13873
13904
  const [isOpen, setIsOpen] = React55.useState(false);
13874
13905
  const [searchValue, setSearchValue] = React55.useState("");
13875
13906
  const [highlightedIndex, setHighlightedIndex] = React55.useState(-1);
13907
+ const isMobile2 = useIsMobile();
13876
13908
  const hasValue = Boolean(value);
13877
13909
  const isEmpty = !hasValue;
13878
13910
  const isBlocked = Boolean(disabled) || Boolean(loading);
@@ -13890,7 +13922,7 @@ function DashboardSelectInternal({
13890
13922
  useOutsideClick({
13891
13923
  elementRef: containerRef,
13892
13924
  onOutsideClick: () => setIsOpen(false),
13893
- isDisabled: !isOpen
13925
+ isDisabled: !isOpen || isMobile2
13894
13926
  });
13895
13927
  React55.useEffect(() => {
13896
13928
  if (isBlocked) setIsOpen(false);
@@ -13969,7 +14001,7 @@ function DashboardSelectInternal({
13969
14001
  setIsOpen(false);
13970
14002
  }
13971
14003
  };
13972
- return /* @__PURE__ */ jsxs99(
14004
+ return /* @__PURE__ */ jsxs100(
13973
14005
  "div",
13974
14006
  {
13975
14007
  ref: containerRef,
@@ -13981,9 +14013,9 @@ function DashboardSelectInternal({
13981
14013
  ),
13982
14014
  style: wrapperWidth ? { width: wrapperWidth } : void 0,
13983
14015
  children: [
13984
- name && /* @__PURE__ */ jsx155("input", { type: "hidden", name, value: value ? String(value.value) : "" }),
13985
- /* @__PURE__ */ jsxs99("div", { className: "relative w-full min-h-[68px]", children: [
13986
- topLabel && /* @__PURE__ */ jsx155(
14016
+ name && /* @__PURE__ */ jsx156("input", { type: "hidden", name, value: value ? String(value.value) : "" }),
14017
+ /* @__PURE__ */ jsxs100("div", { className: "relative w-full min-h-[68px]", children: [
14018
+ topLabel && /* @__PURE__ */ jsx156(
13987
14019
  "label",
13988
14020
  {
13989
14021
  htmlFor: triggerId,
@@ -13991,8 +14023,8 @@ function DashboardSelectInternal({
13991
14023
  children: topLabel
13992
14024
  }
13993
14025
  ),
13994
- /* @__PURE__ */ jsxs99("div", { className: "relative w-full", children: [
13995
- /* @__PURE__ */ jsxs99(
14026
+ /* @__PURE__ */ jsxs100("div", { className: "relative w-full", children: [
14027
+ /* @__PURE__ */ jsxs100(
13996
14028
  "button",
13997
14029
  {
13998
14030
  id: triggerId,
@@ -14016,10 +14048,10 @@ function DashboardSelectInternal({
14016
14048
  loading && "cursor-progress"
14017
14049
  ),
14018
14050
  children: [
14019
- /* @__PURE__ */ jsx155("span", { id: valueId, className: "block min-w-0 flex-1 truncate text-left", children: valueLabel ?? placeholder ?? label }),
14020
- /* @__PURE__ */ jsxs99("span", { className: "pointer-events-none flex items-center gap-2 text-[var(--chekin-color-gray-2)]", children: [
14021
- loading && /* @__PURE__ */ jsx155(ThreeDotsLoader, { height: 18, width: 18 }),
14022
- /* @__PURE__ */ jsx155(
14051
+ /* @__PURE__ */ jsx156("span", { id: valueId, className: "block min-w-0 flex-1 truncate text-left", children: valueLabel ?? placeholder ?? label }),
14052
+ /* @__PURE__ */ jsxs100("span", { className: "pointer-events-none flex items-center gap-2 text-[var(--chekin-color-gray-2)]", children: [
14053
+ loading && /* @__PURE__ */ jsx156(ThreeDotsLoader, { height: 18, width: 18 }),
14054
+ /* @__PURE__ */ jsx156(
14023
14055
  ChevronDown4,
14024
14056
  {
14025
14057
  size: 16,
@@ -14033,7 +14065,7 @@ function DashboardSelectInternal({
14033
14065
  ]
14034
14066
  }
14035
14067
  ),
14036
- /* @__PURE__ */ jsx155(
14068
+ /* @__PURE__ */ jsx156(
14037
14069
  Fieldset,
14038
14070
  {
14039
14071
  isFocused: isOpen,
@@ -14050,15 +14082,17 @@ function DashboardSelectInternal({
14050
14082
  onClick: !isBlocked ? toggleMenu : void 0
14051
14083
  }
14052
14084
  ),
14053
- isOpen && /* @__PURE__ */ jsxs99(
14054
- "div",
14085
+ /* @__PURE__ */ jsxs100(
14086
+ SelectMenuPanel,
14055
14087
  {
14056
- className: cn(
14057
- "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)]",
14058
- dropdownClassName
14059
- ),
14088
+ isOpen,
14089
+ isMobile: isMobile2,
14090
+ onClose: () => setIsOpen(false),
14091
+ title: typeof label === "string" ? label : void 0,
14092
+ className: dropdownClassName,
14093
+ drawerClassName,
14060
14094
  children: [
14061
- searchable && /* @__PURE__ */ jsx155("div", { className: "border-b border-[#f2f4f8] px-4 pb-2 pt-3", children: /* @__PURE__ */ jsx155(
14095
+ searchable && /* @__PURE__ */ jsx156("div", { className: "border-b border-[#f2f4f8] px-4 pb-2 pt-3", children: /* @__PURE__ */ jsx156(
14062
14096
  "input",
14063
14097
  {
14064
14098
  ref: searchInputRef,
@@ -14073,7 +14107,7 @@ function DashboardSelectInternal({
14073
14107
  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)]"
14074
14108
  }
14075
14109
  ) }),
14076
- /* @__PURE__ */ jsx155(
14110
+ /* @__PURE__ */ jsx156(
14077
14111
  SelectMenu,
14078
14112
  {
14079
14113
  id: listboxId,
@@ -14098,9 +14132,9 @@ function DashboardSelectInternal({
14098
14132
  }
14099
14133
  )
14100
14134
  ] }),
14101
- !errorMessage && optional && /* @__PURE__ */ jsx155("span", { className: "mt-[1px] block text-left text-[14px] font-medium text-[var(--chekin-color-gray-1)]", children: typeof optional === "string" ? optional : "optional" }),
14102
- !errorMessage && helperText && /* @__PURE__ */ jsx155("span", { className: "mt-[1px] block text-[12px] font-normal text-[var(--chekin-color-gray-1)]", children: helperText }),
14103
- errorMessage && !hideErrorMessage && /* @__PURE__ */ jsx155(
14135
+ !errorMessage && optional && /* @__PURE__ */ jsx156("span", { className: "mt-[1px] block text-left text-[14px] font-medium text-[var(--chekin-color-gray-1)]", children: typeof optional === "string" ? optional : "optional" }),
14136
+ !errorMessage && helperText && /* @__PURE__ */ jsx156("span", { className: "mt-[1px] block text-[12px] font-normal text-[var(--chekin-color-gray-1)]", children: helperText }),
14137
+ errorMessage && !hideErrorMessage && /* @__PURE__ */ jsx156(
14104
14138
  FieldErrorMessage,
14105
14139
  {
14106
14140
  id: errorId,
@@ -14120,7 +14154,7 @@ var DashboardSelect = React55.forwardRef(
14120
14154
  // src/dashboard/multi-select/MultiSelect.tsx
14121
14155
  import * as React56 from "react";
14122
14156
  import { SquareX as SquareX2 } from "lucide-react";
14123
- import { jsx as jsx156, jsxs as jsxs100 } from "react/jsx-runtime";
14157
+ import { jsx as jsx157, jsxs as jsxs101 } from "react/jsx-runtime";
14124
14158
  var isValueSelected = (selected, option) => selected.some((item) => item.value === option.value);
14125
14159
  function DashboardMultiSelectInternal({
14126
14160
  options = [],
@@ -14141,6 +14175,7 @@ function DashboardMultiSelectInternal({
14141
14175
  className,
14142
14176
  menuClassName,
14143
14177
  dropdownClassName,
14178
+ drawerClassName,
14144
14179
  name,
14145
14180
  width,
14146
14181
  noOptionsMessage,
@@ -14155,12 +14190,14 @@ function DashboardMultiSelectInternal({
14155
14190
  }, ref) {
14156
14191
  const containerRef = React56.useRef(null);
14157
14192
  const inputRef = React56.useRef(null);
14193
+ const mobileSearchInputRef = React56.useRef(null);
14158
14194
  const listRef = React56.useRef(null);
14159
14195
  const optionRefs = React56.useRef([]);
14160
14196
  const [isOpen, setIsOpen] = React56.useState(false);
14161
14197
  const [searchValue, setSearchValue] = React56.useState("");
14162
14198
  const [isFocused, setIsFocused] = React56.useState(false);
14163
14199
  const [highlightedIndex, setHighlightedIndex] = React56.useState(-1);
14200
+ const isMobile2 = useIsMobile();
14164
14201
  const selectedValues = React56.useMemo(() => value ?? [], [value]);
14165
14202
  const hasValue = selectedValues.length > 0;
14166
14203
  const isEmpty = !hasValue;
@@ -14197,7 +14234,7 @@ function DashboardMultiSelectInternal({
14197
14234
  setIsOpen(false);
14198
14235
  setIsFocused(false);
14199
14236
  },
14200
- isDisabled: !isOpen
14237
+ isDisabled: !isOpen || isMobile2
14201
14238
  });
14202
14239
  React56.useEffect(() => {
14203
14240
  if (isBlocked) setIsOpen(false);
@@ -14218,6 +14255,11 @@ function DashboardMultiSelectInternal({
14218
14255
  return getFirstEnabledOptionIndex2(filteredOptions);
14219
14256
  });
14220
14257
  }, [isOpen, filteredOptions]);
14258
+ React56.useEffect(() => {
14259
+ if (!isOpen || !isMobile2) return;
14260
+ const frame = window.requestAnimationFrame(() => mobileSearchInputRef.current?.focus());
14261
+ return () => window.cancelAnimationFrame(frame);
14262
+ }, [isOpen, isMobile2]);
14221
14263
  const openMenu = () => {
14222
14264
  if (isBlocked) return;
14223
14265
  setIsOpen(true);
@@ -14312,7 +14354,7 @@ function DashboardMultiSelectInternal({
14312
14354
  setIsFocused(false);
14313
14355
  onBlur?.(event);
14314
14356
  };
14315
- return /* @__PURE__ */ jsxs100(
14357
+ return /* @__PURE__ */ jsxs101(
14316
14358
  "div",
14317
14359
  {
14318
14360
  ref: containerRef,
@@ -14325,7 +14367,7 @@ function DashboardMultiSelectInternal({
14325
14367
  ),
14326
14368
  style: wrapperWidth ? { width: wrapperWidth } : void 0,
14327
14369
  children: [
14328
- topLabel && /* @__PURE__ */ jsx156(
14370
+ topLabel && /* @__PURE__ */ jsx157(
14329
14371
  "label",
14330
14372
  {
14331
14373
  htmlFor: triggerId,
@@ -14333,7 +14375,7 @@ function DashboardMultiSelectInternal({
14333
14375
  children: topLabel
14334
14376
  }
14335
14377
  ),
14336
- name && /* @__PURE__ */ jsx156(
14378
+ name && /* @__PURE__ */ jsx157(
14337
14379
  "input",
14338
14380
  {
14339
14381
  type: "hidden",
@@ -14341,8 +14383,8 @@ function DashboardMultiSelectInternal({
14341
14383
  value: selectedValues.map((item) => String(item.value)).join(",")
14342
14384
  }
14343
14385
  ),
14344
- /* @__PURE__ */ jsxs100("div", { className: "relative w-full", children: [
14345
- /* @__PURE__ */ jsxs100(
14386
+ /* @__PURE__ */ jsxs101("div", { className: "relative w-full", children: [
14387
+ /* @__PURE__ */ jsxs101(
14346
14388
  "div",
14347
14389
  {
14348
14390
  id: triggerId,
@@ -14365,13 +14407,13 @@ function DashboardMultiSelectInternal({
14365
14407
  ),
14366
14408
  children: [
14367
14409
  selectedValues.map(
14368
- (option) => renderChip ? /* @__PURE__ */ jsx156(React56.Fragment, { children: renderChip(option, () => removeOption(option)) }, String(option.value)) : /* @__PURE__ */ jsxs100(
14410
+ (option) => renderChip ? /* @__PURE__ */ jsx157(React56.Fragment, { children: renderChip(option, () => removeOption(option)) }, String(option.value)) : /* @__PURE__ */ jsxs101(
14369
14411
  "span",
14370
14412
  {
14371
14413
  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)]",
14372
14414
  children: [
14373
- /* @__PURE__ */ jsx156("span", { className: "whitespace-nowrap", children: option.label }),
14374
- !readOnly && /* @__PURE__ */ jsx156(
14415
+ /* @__PURE__ */ jsx157("span", { className: "whitespace-nowrap", children: option.label }),
14416
+ !readOnly && /* @__PURE__ */ jsx157(
14375
14417
  "button",
14376
14418
  {
14377
14419
  type: "button",
@@ -14381,7 +14423,7 @@ function DashboardMultiSelectInternal({
14381
14423
  },
14382
14424
  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]",
14383
14425
  "aria-label": `Remove ${typeof option.label === "string" ? option.label : String(option.value)}`,
14384
- children: /* @__PURE__ */ jsx156(SquareX2, { size: 15, fill: "#9696b9", color: "#f8f8f8", strokeWidth: 1.8 })
14426
+ children: /* @__PURE__ */ jsx157(SquareX2, { size: 15, fill: "#9696b9", color: "#f8f8f8", strokeWidth: 1.8 })
14385
14427
  }
14386
14428
  )
14387
14429
  ]
@@ -14389,7 +14431,7 @@ function DashboardMultiSelectInternal({
14389
14431
  String(option.value)
14390
14432
  )
14391
14433
  ),
14392
- /* @__PURE__ */ jsx156(
14434
+ /* @__PURE__ */ jsx157(
14393
14435
  "input",
14394
14436
  {
14395
14437
  ref: inputRef,
@@ -14418,9 +14460,9 @@ function DashboardMultiSelectInternal({
14418
14460
  "aria-activedescendant": isOpen && highlightedIndex >= 0 ? getOptionId2(highlightedIndex) : void 0
14419
14461
  }
14420
14462
  ),
14421
- /* @__PURE__ */ jsxs100("span", { className: "ml-auto flex items-center gap-2 pl-2 text-[var(--chekin-color-gray-2)]", children: [
14422
- loading && /* @__PURE__ */ jsx156(ThreeDotsLoader, { height: 18, width: 18 }),
14423
- hasValue && !readOnly && /* @__PURE__ */ jsx156(
14463
+ /* @__PURE__ */ jsxs101("span", { className: "ml-auto flex items-center gap-2 pl-2 text-[var(--chekin-color-gray-2)]", children: [
14464
+ loading && /* @__PURE__ */ jsx157(ThreeDotsLoader, { height: 18, width: 18 }),
14465
+ hasValue && !readOnly && /* @__PURE__ */ jsx157(
14424
14466
  "button",
14425
14467
  {
14426
14468
  type: "button",
@@ -14430,10 +14472,10 @@ function DashboardMultiSelectInternal({
14430
14472
  },
14431
14473
  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]",
14432
14474
  "aria-label": "Clear all",
14433
- children: /* @__PURE__ */ jsx156(SquareX2, { size: 15, fill: "#9696b9", color: "#f8f8f8", strokeWidth: 1.8 })
14475
+ children: /* @__PURE__ */ jsx157(SquareX2, { size: 15, fill: "#9696b9", color: "#f8f8f8", strokeWidth: 1.8 })
14434
14476
  }
14435
14477
  ),
14436
- /* @__PURE__ */ jsx156(
14478
+ /* @__PURE__ */ jsx157(
14437
14479
  RotateArrow,
14438
14480
  {
14439
14481
  shouldRotate: isOpen,
@@ -14446,7 +14488,7 @@ function DashboardMultiSelectInternal({
14446
14488
  ]
14447
14489
  }
14448
14490
  ),
14449
- /* @__PURE__ */ jsx156(
14491
+ /* @__PURE__ */ jsx157(
14450
14492
  Fieldset,
14451
14493
  {
14452
14494
  isFocused: isFocused || isOpen,
@@ -14464,15 +14506,35 @@ function DashboardMultiSelectInternal({
14464
14506
  onClick: handleContainerClick
14465
14507
  }
14466
14508
  ),
14467
- isOpen && /* @__PURE__ */ jsxs100(
14468
- "div",
14509
+ /* @__PURE__ */ jsxs101(
14510
+ SelectMenuPanel,
14469
14511
  {
14470
- className: cn(
14471
- "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)]",
14472
- dropdownClassName
14473
- ),
14512
+ isOpen,
14513
+ isMobile: isMobile2,
14514
+ onClose: () => {
14515
+ setIsOpen(false);
14516
+ setIsFocused(false);
14517
+ },
14518
+ title: typeof label === "string" ? label : void 0,
14519
+ className: dropdownClassName,
14520
+ drawerClassName,
14474
14521
  children: [
14475
- /* @__PURE__ */ jsx156(
14522
+ isMobile2 && /* @__PURE__ */ jsx157("div", { className: "border-b border-[#f2f4f8] px-4 pb-2 pt-3", children: /* @__PURE__ */ jsx157(
14523
+ "input",
14524
+ {
14525
+ ref: mobileSearchInputRef,
14526
+ type: "text",
14527
+ value: searchValue,
14528
+ placeholder: placeholder ?? "",
14529
+ onChange: (event) => setSearchValue(event.target.value),
14530
+ onKeyDown: handleInputKeyDown,
14531
+ autoComplete: "off",
14532
+ "aria-controls": listboxId,
14533
+ "aria-activedescendant": highlightedIndex >= 0 ? getOptionId2(highlightedIndex) : void 0,
14534
+ 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)]"
14535
+ }
14536
+ ) }),
14537
+ /* @__PURE__ */ jsx157(
14476
14538
  SelectMenu,
14477
14539
  {
14478
14540
  id: listboxId,
@@ -14494,7 +14556,7 @@ function DashboardMultiSelectInternal({
14494
14556
  isMulti: true
14495
14557
  }
14496
14558
  ),
14497
- canCreateNewOption && /* @__PURE__ */ jsx156(
14559
+ canCreateNewOption && /* @__PURE__ */ jsx157(
14498
14560
  "button",
14499
14561
  {
14500
14562
  type: "button",
@@ -14507,9 +14569,9 @@ function DashboardMultiSelectInternal({
14507
14569
  }
14508
14570
  )
14509
14571
  ] }),
14510
- !errorMessage && optional && /* @__PURE__ */ jsx156("span", { className: "mt-[1px] block text-left text-[14px] font-medium text-[var(--chekin-color-gray-1)]", children: typeof optional === "string" ? optional : "optional" }),
14511
- !errorMessage && helperText && /* @__PURE__ */ jsx156("span", { className: "mt-[1px] block text-[12px] font-normal text-[var(--chekin-color-gray-1)]", children: helperText }),
14512
- errorMessage && !hideErrorMessage && /* @__PURE__ */ jsx156(
14572
+ !errorMessage && optional && /* @__PURE__ */ jsx157("span", { className: "mt-[1px] block text-left text-[14px] font-medium text-[var(--chekin-color-gray-1)]", children: typeof optional === "string" ? optional : "optional" }),
14573
+ !errorMessage && helperText && /* @__PURE__ */ jsx157("span", { className: "mt-[1px] block text-[12px] font-normal text-[var(--chekin-color-gray-1)]", children: helperText }),
14574
+ errorMessage && !hideErrorMessage && /* @__PURE__ */ jsx157(
14513
14575
  FieldErrorMessage,
14514
14576
  {
14515
14577
  id: errorId,
@@ -14527,10 +14589,10 @@ var DashboardMultiSelect = React56.forwardRef(
14527
14589
 
14528
14590
  // src/dashboard/creatable-multi-select/CreatableMultiSelect.tsx
14529
14591
  import * as React57 from "react";
14530
- import { jsx as jsx157 } from "react/jsx-runtime";
14592
+ import { jsx as jsx158 } from "react/jsx-runtime";
14531
14593
  var DashboardCreatableMultiSelect = React57.forwardRef(
14532
14594
  function DashboardCreatableMultiSelect2(props, ref) {
14533
- return /* @__PURE__ */ jsx157(DashboardMultiSelect, { ref, ...props, isCreatable: true });
14595
+ return /* @__PURE__ */ jsx158(DashboardMultiSelect, { ref, ...props, isCreatable: true });
14534
14596
  }
14535
14597
  );
14536
14598
 
@@ -14538,7 +14600,7 @@ var DashboardCreatableMultiSelect = React57.forwardRef(
14538
14600
  import * as React58 from "react";
14539
14601
  import { ChevronDown as ChevronDown5 } from "lucide-react";
14540
14602
  import { useVirtualizer as useVirtualizer2 } from "@tanstack/react-virtual";
14541
- import { jsx as jsx158, jsxs as jsxs101 } from "react/jsx-runtime";
14603
+ import { jsx as jsx159, jsxs as jsxs102 } from "react/jsx-runtime";
14542
14604
  var DEFAULT_ITEM_HEIGHT = 60;
14543
14605
  var DEFAULT_LIST_HEIGHT = 322;
14544
14606
  var DEFAULT_OVERSCAN = 5;
@@ -14562,6 +14624,7 @@ function DashboardInfiniteScrollSelectInternal({
14562
14624
  className,
14563
14625
  menuClassName,
14564
14626
  dropdownClassName,
14627
+ drawerClassName,
14565
14628
  name,
14566
14629
  width,
14567
14630
  noOptionsMessage,
@@ -14586,6 +14649,7 @@ function DashboardInfiniteScrollSelectInternal({
14586
14649
  const [isOpen, setIsOpen] = React58.useState(false);
14587
14650
  const [searchValue, setSearchValue] = React58.useState("");
14588
14651
  const [highlightedIndex, setHighlightedIndex] = React58.useState(-1);
14652
+ const isMobile2 = useIsMobile();
14589
14653
  const hasValue = Boolean(value);
14590
14654
  const isEmpty = !hasValue;
14591
14655
  const isBlocked = Boolean(disabled) || Boolean(loading);
@@ -14610,7 +14674,7 @@ function DashboardInfiniteScrollSelectInternal({
14610
14674
  useOutsideClick({
14611
14675
  elementRef: containerRef,
14612
14676
  onOutsideClick: () => setIsOpen(false),
14613
- isDisabled: !isOpen
14677
+ isDisabled: !isOpen || isMobile2
14614
14678
  });
14615
14679
  React58.useEffect(() => {
14616
14680
  if (isBlocked) setIsOpen(false);
@@ -14705,7 +14769,7 @@ function DashboardInfiniteScrollSelectInternal({
14705
14769
  const emptyMessage = noOptionsMessage?.();
14706
14770
  const totalSize = virtualizer.getTotalSize();
14707
14771
  const measuredListHeight = Math.min(listHeight, Math.max(totalSize, itemHeight));
14708
- return /* @__PURE__ */ jsxs101(
14772
+ return /* @__PURE__ */ jsxs102(
14709
14773
  "div",
14710
14774
  {
14711
14775
  ref: containerRef,
@@ -14717,9 +14781,9 @@ function DashboardInfiniteScrollSelectInternal({
14717
14781
  ),
14718
14782
  style: wrapperWidth ? { width: wrapperWidth } : void 0,
14719
14783
  children: [
14720
- name && /* @__PURE__ */ jsx158("input", { type: "hidden", name, value: value ? String(value.value) : "" }),
14721
- /* @__PURE__ */ jsxs101("div", { className: "relative min-h-[68px] w-full", children: [
14722
- topLabel && /* @__PURE__ */ jsx158(
14784
+ name && /* @__PURE__ */ jsx159("input", { type: "hidden", name, value: value ? String(value.value) : "" }),
14785
+ /* @__PURE__ */ jsxs102("div", { className: "relative min-h-[68px] w-full", children: [
14786
+ topLabel && /* @__PURE__ */ jsx159(
14723
14787
  "label",
14724
14788
  {
14725
14789
  htmlFor: triggerId,
@@ -14727,8 +14791,8 @@ function DashboardInfiniteScrollSelectInternal({
14727
14791
  children: topLabel
14728
14792
  }
14729
14793
  ),
14730
- /* @__PURE__ */ jsxs101("div", { className: "relative w-full", children: [
14731
- /* @__PURE__ */ jsxs101(
14794
+ /* @__PURE__ */ jsxs102("div", { className: "relative w-full", children: [
14795
+ /* @__PURE__ */ jsxs102(
14732
14796
  "button",
14733
14797
  {
14734
14798
  id: triggerId,
@@ -14752,10 +14816,10 @@ function DashboardInfiniteScrollSelectInternal({
14752
14816
  loading && "cursor-progress"
14753
14817
  ),
14754
14818
  children: [
14755
- /* @__PURE__ */ jsx158("span", { id: valueId, className: "block min-w-0 flex-1 truncate text-left", children: valueLabel ?? placeholder ?? label }),
14756
- /* @__PURE__ */ jsxs101("span", { className: "pointer-events-none flex items-center gap-2 text-[var(--chekin-color-gray-2)]", children: [
14757
- loading && /* @__PURE__ */ jsx158(ThreeDotsLoader, { height: 18, width: 18 }),
14758
- /* @__PURE__ */ jsx158(
14819
+ /* @__PURE__ */ jsx159("span", { id: valueId, className: "block min-w-0 flex-1 truncate text-left", children: valueLabel ?? placeholder ?? label }),
14820
+ /* @__PURE__ */ jsxs102("span", { className: "pointer-events-none flex items-center gap-2 text-[var(--chekin-color-gray-2)]", children: [
14821
+ loading && /* @__PURE__ */ jsx159(ThreeDotsLoader, { height: 18, width: 18 }),
14822
+ /* @__PURE__ */ jsx159(
14759
14823
  ChevronDown5,
14760
14824
  {
14761
14825
  size: 16,
@@ -14769,7 +14833,7 @@ function DashboardInfiniteScrollSelectInternal({
14769
14833
  ]
14770
14834
  }
14771
14835
  ),
14772
- /* @__PURE__ */ jsx158(
14836
+ /* @__PURE__ */ jsx159(
14773
14837
  Fieldset,
14774
14838
  {
14775
14839
  isFocused: isOpen,
@@ -14786,15 +14850,17 @@ function DashboardInfiniteScrollSelectInternal({
14786
14850
  onClick: !isBlocked ? toggleMenu : void 0
14787
14851
  }
14788
14852
  ),
14789
- isOpen && /* @__PURE__ */ jsxs101(
14790
- "div",
14853
+ /* @__PURE__ */ jsxs102(
14854
+ SelectMenuPanel,
14791
14855
  {
14792
- className: cn(
14793
- "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)]",
14794
- dropdownClassName
14795
- ),
14856
+ isOpen,
14857
+ isMobile: isMobile2,
14858
+ onClose: () => setIsOpen(false),
14859
+ title: typeof label === "string" ? label : void 0,
14860
+ className: dropdownClassName,
14861
+ drawerClassName,
14796
14862
  children: [
14797
- searchable && /* @__PURE__ */ jsx158("div", { className: "border-b border-[#f2f4f8] px-4 pb-2 pt-3", children: /* @__PURE__ */ jsx158(
14863
+ searchable && /* @__PURE__ */ jsx159("div", { className: "border-b border-[#f2f4f8] px-4 pb-2 pt-3", children: /* @__PURE__ */ jsx159(
14798
14864
  "input",
14799
14865
  {
14800
14866
  ref: searchInputRef,
@@ -14809,13 +14875,13 @@ function DashboardInfiniteScrollSelectInternal({
14809
14875
  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)]"
14810
14876
  }
14811
14877
  ) }),
14812
- itemCount === 0 ? /* @__PURE__ */ jsx158("div", { className: "px-4 py-[20px] text-left text-[16px] text-[var(--chekin-color-brand-navy)]", children: emptyMessage ?? "No options" }) : /* @__PURE__ */ jsx158(
14878
+ itemCount === 0 ? /* @__PURE__ */ jsx159("div", { className: "px-4 py-[20px] text-left text-[16px] text-[var(--chekin-color-brand-navy)]", children: emptyMessage ?? "No options" }) : /* @__PURE__ */ jsx159(
14813
14879
  "div",
14814
14880
  {
14815
14881
  ref: scrollRef,
14816
14882
  className: cn("overflow-y-auto", menuClassName),
14817
14883
  style: { height: `${measuredListHeight}px` },
14818
- children: /* @__PURE__ */ jsx158(
14884
+ children: /* @__PURE__ */ jsx159(
14819
14885
  "div",
14820
14886
  {
14821
14887
  id: listboxId,
@@ -14832,7 +14898,7 @@ function DashboardInfiniteScrollSelectInternal({
14832
14898
  const isSelected = !isLoaderRow && option ? option.value === value?.value : false;
14833
14899
  const isHighlighted = virtualItem.index === highlightedIndex;
14834
14900
  const isOptionDisabled = Boolean(isBlocked || option?.isDisabled);
14835
- return /* @__PURE__ */ jsx158(
14901
+ return /* @__PURE__ */ jsx159(
14836
14902
  "div",
14837
14903
  {
14838
14904
  "data-index": virtualItem.index,
@@ -14841,10 +14907,10 @@ function DashboardInfiniteScrollSelectInternal({
14841
14907
  height: `${virtualItem.size}px`,
14842
14908
  transform: `translateY(${virtualItem.start}px)`
14843
14909
  },
14844
- children: isLoaderRow ? /* @__PURE__ */ jsxs101("div", { className: "flex h-full items-center justify-center gap-2 px-4 text-[14px] font-medium text-[var(--chekin-color-gray-1)]", children: [
14845
- /* @__PURE__ */ jsx158(ThreeDotsLoader, { height: 18, width: 18 }),
14846
- /* @__PURE__ */ jsx158("span", { children: loadingMoreText })
14847
- ] }) : /* @__PURE__ */ jsxs101(
14910
+ children: isLoaderRow ? /* @__PURE__ */ jsxs102("div", { className: "flex h-full items-center justify-center gap-2 px-4 text-[14px] font-medium text-[var(--chekin-color-gray-1)]", children: [
14911
+ /* @__PURE__ */ jsx159(ThreeDotsLoader, { height: 18, width: 18 }),
14912
+ /* @__PURE__ */ jsx159("span", { children: loadingMoreText })
14913
+ ] }) : /* @__PURE__ */ jsxs102(
14848
14914
  "button",
14849
14915
  {
14850
14916
  id: getOptionId2(virtualItem.index),
@@ -14863,8 +14929,8 @@ function DashboardInfiniteScrollSelectInternal({
14863
14929
  isOptionDisabled && "cursor-default opacity-30"
14864
14930
  ),
14865
14931
  children: [
14866
- /* @__PURE__ */ jsx158("span", { className: "block break-words", children: option?.label }),
14867
- option?.description && /* @__PURE__ */ jsx158("span", { className: "ml-2 mt-[3px] shrink-0 text-[12px] font-bold italic text-[#777e91]", children: option.description })
14932
+ /* @__PURE__ */ jsx159("span", { className: "block break-words", children: option?.label }),
14933
+ option?.description && /* @__PURE__ */ jsx159("span", { className: "ml-2 mt-[3px] shrink-0 text-[12px] font-bold italic text-[#777e91]", children: option.description })
14868
14934
  ]
14869
14935
  }
14870
14936
  )
@@ -14880,9 +14946,9 @@ function DashboardInfiniteScrollSelectInternal({
14880
14946
  }
14881
14947
  )
14882
14948
  ] }),
14883
- !errorMessage && optional && /* @__PURE__ */ jsx158("span", { className: "mt-[1px] block text-left text-[14px] font-medium text-[var(--chekin-color-gray-1)]", children: typeof optional === "string" ? optional : "optional" }),
14884
- !errorMessage && helperText && /* @__PURE__ */ jsx158("span", { className: "mt-[1px] block text-[12px] font-normal text-[var(--chekin-color-gray-1)]", children: helperText }),
14885
- errorMessage && !hideErrorMessage && /* @__PURE__ */ jsx158(
14949
+ !errorMessage && optional && /* @__PURE__ */ jsx159("span", { className: "mt-[1px] block text-left text-[14px] font-medium text-[var(--chekin-color-gray-1)]", children: typeof optional === "string" ? optional : "optional" }),
14950
+ !errorMessage && helperText && /* @__PURE__ */ jsx159("span", { className: "mt-[1px] block text-[12px] font-normal text-[var(--chekin-color-gray-1)]", children: helperText }),
14951
+ errorMessage && !hideErrorMessage && /* @__PURE__ */ jsx159(
14886
14952
  FieldErrorMessage,
14887
14953
  {
14888
14954
  id: errorId,
@@ -14904,7 +14970,7 @@ import * as React59 from "react";
14904
14970
  import { ChevronDown as ChevronDown6, Search as Search4 } from "lucide-react";
14905
14971
  import { useVirtualizer as useVirtualizer3 } from "@tanstack/react-virtual";
14906
14972
  import { useCallback as useCallback35 } from "react";
14907
- import { jsx as jsx159, jsxs as jsxs102 } from "react/jsx-runtime";
14973
+ import { jsx as jsx160, jsxs as jsxs103 } from "react/jsx-runtime";
14908
14974
  var ROW_HEIGHT = 48;
14909
14975
  var DESKTOP_LIST_HEIGHT = 280;
14910
14976
  var MOBILE_LIST_HEIGHT = 420;
@@ -15073,7 +15139,7 @@ var SearchableSelectInternal = ({
15073
15139
  }
15074
15140
  }
15075
15141
  }
15076
- const content = /* @__PURE__ */ jsx159(
15142
+ const content = /* @__PURE__ */ jsx160(
15077
15143
  SearchableSelectContent,
15078
15144
  {
15079
15145
  inputId: searchInputId,
@@ -15101,9 +15167,9 @@ var SearchableSelectInternal = ({
15101
15167
  }
15102
15168
  );
15103
15169
  React59.useImperativeHandle(ref, () => triggerRef.current, []);
15104
- return /* @__PURE__ */ jsxs102("div", { ref: containerRef, className: cn("relative w-full max-w-[425px]", className), children: [
15105
- name && /* @__PURE__ */ jsx159("input", { type: "hidden", name, value: value ? String(value.value) : "" }),
15106
- /* @__PURE__ */ jsx159(
15170
+ return /* @__PURE__ */ jsxs103("div", { ref: containerRef, className: cn("relative w-full max-w-[425px]", className), children: [
15171
+ name && /* @__PURE__ */ jsx160("input", { type: "hidden", name, value: value ? String(value.value) : "" }),
15172
+ /* @__PURE__ */ jsx160(
15107
15173
  FieldTrigger,
15108
15174
  {
15109
15175
  id: `${reactId}-trigger`,
@@ -15138,7 +15204,7 @@ var SearchableSelectInternal = ({
15138
15204
  },
15139
15205
  onKeyDown: handleTriggerKeyDown,
15140
15206
  onBlur,
15141
- trailingAdornment: /* @__PURE__ */ jsx159(
15207
+ trailingAdornment: /* @__PURE__ */ jsx160(
15142
15208
  ChevronDown6,
15143
15209
  {
15144
15210
  className: cn(
@@ -15149,7 +15215,7 @@ var SearchableSelectInternal = ({
15149
15215
  )
15150
15216
  }
15151
15217
  ),
15152
- isMobile2 ? /* @__PURE__ */ jsx159(
15218
+ isMobile2 ? /* @__PURE__ */ jsx160(
15153
15219
  Drawer,
15154
15220
  {
15155
15221
  open,
@@ -15161,13 +15227,13 @@ var SearchableSelectInternal = ({
15161
15227
  }
15162
15228
  closeSelect();
15163
15229
  },
15164
- children: /* @__PURE__ */ jsxs102(DrawerContent, { onClose: closeSelect, lockScroll: false, children: [
15165
- /* @__PURE__ */ jsx159(DrawerTitle, { className: "sr-only", children: mobileTitle ?? label }),
15166
- /* @__PURE__ */ jsx159(DrawerDescription, { className: "sr-only", children: label }),
15167
- /* @__PURE__ */ jsx159("div", { className: "px-5 pb-5 pt-1", children: content })
15230
+ children: /* @__PURE__ */ jsxs103(DrawerContent, { onClose: closeSelect, lockScroll: false, children: [
15231
+ /* @__PURE__ */ jsx160(DrawerTitle, { className: "sr-only", children: mobileTitle ?? label }),
15232
+ /* @__PURE__ */ jsx160(DrawerDescription, { className: "sr-only", children: label }),
15233
+ /* @__PURE__ */ jsx160("div", { className: "px-5 pb-5 pt-1", children: content })
15168
15234
  ] })
15169
15235
  }
15170
- ) : open ? /* @__PURE__ */ jsx159(
15236
+ ) : open ? /* @__PURE__ */ jsx160(
15171
15237
  "div",
15172
15238
  {
15173
15239
  className: cn(
@@ -15234,16 +15300,16 @@ function SearchableSelectContent({
15234
15300
  virtualizer.scrollToIndex(highlightedIndex, { align: "auto" });
15235
15301
  }
15236
15302
  }, [highlightedIndex, virtualizer]);
15237
- return /* @__PURE__ */ jsxs102("div", { className: "p-2", children: [
15238
- /* @__PURE__ */ jsxs102("div", { className: "relative mb-2", children: [
15239
- /* @__PURE__ */ jsx159(
15303
+ return /* @__PURE__ */ jsxs103("div", { className: "p-2", children: [
15304
+ /* @__PURE__ */ jsxs103("div", { className: "relative mb-2", children: [
15305
+ /* @__PURE__ */ jsx160(
15240
15306
  Search4,
15241
15307
  {
15242
15308
  "aria-hidden": "true",
15243
15309
  className: "absolute left-4 top-1/2 h-5 w-5 -translate-y-1/2 text-[#9696B9]"
15244
15310
  }
15245
15311
  ),
15246
- /* @__PURE__ */ jsx159(
15312
+ /* @__PURE__ */ jsx160(
15247
15313
  "input",
15248
15314
  {
15249
15315
  id: inputId,
@@ -15262,7 +15328,7 @@ function SearchableSelectContent({
15262
15328
  }
15263
15329
  )
15264
15330
  ] }),
15265
- loading && options.length === 0 ? /* @__PURE__ */ jsx159("div", { className: "px-4 py-5 text-center text-base leading-6 text-[#6C6C6C]", children: loadingText }) : options.length === 0 ? /* @__PURE__ */ jsx159("div", { className: "px-4 py-5 text-center text-base leading-6 text-[#6C6C6C]", children: emptyMessage }) : /* @__PURE__ */ jsx159(
15331
+ loading && options.length === 0 ? /* @__PURE__ */ jsx160("div", { className: "px-4 py-5 text-center text-base leading-6 text-[#6C6C6C]", children: loadingText }) : options.length === 0 ? /* @__PURE__ */ jsx160("div", { className: "px-4 py-5 text-center text-base leading-6 text-[#6C6C6C]", children: emptyMessage }) : /* @__PURE__ */ jsx160(
15266
15332
  "div",
15267
15333
  {
15268
15334
  id: listboxId,
@@ -15271,7 +15337,7 @@ function SearchableSelectContent({
15271
15337
  "aria-labelledby": labelId,
15272
15338
  className: cn("overflow-y-auto outline-none", menuClassName),
15273
15339
  style: { height: Math.min(height, rowCount * ROW_HEIGHT) },
15274
- children: /* @__PURE__ */ jsx159(
15340
+ children: /* @__PURE__ */ jsx160(
15275
15341
  "div",
15276
15342
  {
15277
15343
  className: "relative w-full",
@@ -15279,7 +15345,7 @@ function SearchableSelectContent({
15279
15345
  children: virtualItems.map((virtualItem) => {
15280
15346
  const option = options[virtualItem.index];
15281
15347
  if (!option) {
15282
- return /* @__PURE__ */ jsx159(
15348
+ return /* @__PURE__ */ jsx160(
15283
15349
  "div",
15284
15350
  {
15285
15351
  className: "absolute left-0 top-0 flex w-full items-center px-4 text-base leading-6 text-[#6C6C6C]",
@@ -15294,7 +15360,7 @@ function SearchableSelectContent({
15294
15360
  }
15295
15361
  const isSelected = value?.value === option.value;
15296
15362
  const isHighlighted = virtualItem.index === highlightedIndex;
15297
- return /* @__PURE__ */ jsx159(
15363
+ return /* @__PURE__ */ jsx160(
15298
15364
  "button",
15299
15365
  {
15300
15366
  id: getOptionId(idPrefix, virtualItem.index),
@@ -15316,7 +15382,7 @@ function SearchableSelectContent({
15316
15382
  height: `${virtualItem.size}px`,
15317
15383
  transform: `translateY(${virtualItem.start}px)`
15318
15384
  },
15319
- children: /* @__PURE__ */ jsx159("span", { className: "truncate text-center", children: String(option.label) })
15385
+ children: /* @__PURE__ */ jsx160("span", { className: "truncate text-center", children: String(option.label) })
15320
15386
  },
15321
15387
  `${String(option.value)}-${virtualItem.index}`
15322
15388
  );
@@ -15402,14 +15468,14 @@ function getErrorMessage(error) {
15402
15468
 
15403
15469
  // src/lib/toastResponseError.tsx
15404
15470
  import i18next from "i18next";
15405
- import { jsx as jsx160, jsxs as jsxs103 } from "react/jsx-runtime";
15471
+ import { jsx as jsx161, jsxs as jsxs104 } from "react/jsx-runtime";
15406
15472
  function addSupportEmailToMessage(message, prefixText) {
15407
15473
  if (typeof message !== "string") {
15408
15474
  return message;
15409
15475
  }
15410
15476
  const builtMessage = `${prefixText ? `${prefixText} ` : ""}${message}`;
15411
- return /* @__PURE__ */ jsxs103("div", { children: [
15412
- /* @__PURE__ */ jsx160("div", { children: builtMessage }),
15477
+ return /* @__PURE__ */ jsxs104("div", { children: [
15478
+ /* @__PURE__ */ jsx161("div", { children: builtMessage }),
15413
15479
  i18next.t("reach_us_at_email")
15414
15480
  ] });
15415
15481
  }