@chekinapp/ui 0.0.115 → 0.0.116

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
@@ -4747,7 +4747,7 @@ function Header2({ children, className, ...props }) {
4747
4747
  "h2",
4748
4748
  {
4749
4749
  className: cn(
4750
- "m-0 flex items-center gap-2 self-stretch p-0 text-2xl font-semibold leading-normal text-[var(--chekin-color-brand-navy)]",
4750
+ "m-0 flex items-center gap-2 self-stretch p-0 text-2xl font-semibold leading-normal text-[var(--form-box-title-color)]",
4751
4751
  className
4752
4752
  ),
4753
4753
  ...props,
@@ -4763,7 +4763,7 @@ function Root11({ children, nested, className, ...props }) {
4763
4763
  "div",
4764
4764
  {
4765
4765
  className: cn(
4766
- "flex max-w-[1400px] flex-col items-start gap-6 self-stretch rounded-[10px] border border-[var(--chekin-color-gray-separator)] p-6 [container-type:inline-size]",
4766
+ "flex max-w-[1400px] flex-col items-start gap-6 self-stretch rounded-[var(--form-box-radius)] border border-[var(--form-box-border)] p-6 [container-type:inline-size]",
4767
4767
  nested && "border-0 p-0",
4768
4768
  className
4769
4769
  ),
@@ -4780,7 +4780,7 @@ function SubHeader({ children, className, ...props }) {
4780
4780
  "h4",
4781
4781
  {
4782
4782
  className: cn(
4783
- "m-0 flex items-center gap-2 self-stretch border-b border-[var(--chekin-color-gray-separator)] px-0 py-2 text-base font-semibold leading-normal text-[var(--chekin-color-brand-navy)]",
4783
+ "m-0 flex items-center gap-2 self-stretch border-b border-[var(--form-box-subtitle-border)] px-0 py-2 text-base font-semibold leading-normal text-[var(--form-box-subtitle-color)]",
4784
4784
  className
4785
4785
  ),
4786
4786
  ...props,
@@ -12511,6 +12511,23 @@ import * as React45 from "react";
12511
12511
  import { useTranslation as useTranslation28 } from "react-i18next";
12512
12512
 
12513
12513
  // src/dashboard/_select-internals/utils.ts
12514
+ function isOptionGroup(item) {
12515
+ return Boolean(
12516
+ item && Array.isArray(item.options)
12517
+ );
12518
+ }
12519
+ function flattenGroupedOptions(items) {
12520
+ if (!items) return [];
12521
+ const result = [];
12522
+ for (const item of items) {
12523
+ if (isOptionGroup(item)) {
12524
+ for (const option of item.options) result.push(option);
12525
+ } else {
12526
+ result.push(item);
12527
+ }
12528
+ }
12529
+ return result;
12530
+ }
12514
12531
  function isOptionEnabled(option, isOptionDisabled) {
12515
12532
  if (!option) return false;
12516
12533
  if (option.isDisabled) return false;
@@ -12608,6 +12625,51 @@ function DefaultOption(props) {
12608
12625
 
12609
12626
  // src/dashboard/_select-internals/SelectMenu.tsx
12610
12627
  import { jsx as jsx146, jsxs as jsxs93 } from "react/jsx-runtime";
12628
+ function buildMenuEntries(groupedOptions, options, formatGroupLabel) {
12629
+ if (!groupedOptions || !groupedOptions.some((item) => isOptionGroup(item))) {
12630
+ return options.map((option, index) => ({
12631
+ kind: "option",
12632
+ key: `${String(option.value)}-${index}`,
12633
+ option,
12634
+ flatIndex: index
12635
+ }));
12636
+ }
12637
+ const indexByOption = /* @__PURE__ */ new Map();
12638
+ options.forEach((option, index) => indexByOption.set(option, index));
12639
+ const entries = [];
12640
+ let groupCount = 0;
12641
+ for (const item of groupedOptions) {
12642
+ if (isOptionGroup(item)) {
12643
+ const visible = item.options.filter((option) => indexByOption.has(option));
12644
+ if (visible.length === 0) continue;
12645
+ const label = formatGroupLabel ? formatGroupLabel(item) : item.label;
12646
+ entries.push({
12647
+ kind: "group-label",
12648
+ key: `__group-${groupCount}`,
12649
+ label
12650
+ });
12651
+ groupCount += 1;
12652
+ for (const option of visible) {
12653
+ const flatIndex = indexByOption.get(option);
12654
+ entries.push({
12655
+ kind: "option",
12656
+ key: `${String(option.value)}-${flatIndex}`,
12657
+ option,
12658
+ flatIndex
12659
+ });
12660
+ }
12661
+ } else if (indexByOption.has(item)) {
12662
+ const flatIndex = indexByOption.get(item);
12663
+ entries.push({
12664
+ kind: "option",
12665
+ key: `${String(item.value)}-${flatIndex}`,
12666
+ option: item,
12667
+ flatIndex
12668
+ });
12669
+ }
12670
+ }
12671
+ return entries;
12672
+ }
12611
12673
  function SelectMenu({
12612
12674
  id,
12613
12675
  options,
@@ -12633,7 +12695,9 @@ function SelectMenu({
12633
12695
  inputValue = "",
12634
12696
  formatOptionLabel,
12635
12697
  isOptionSelected: isOptionSelected2,
12636
- onMenuScrollToBottom
12698
+ onMenuScrollToBottom,
12699
+ groupedOptions,
12700
+ formatGroupLabel
12637
12701
  }) {
12638
12702
  const { t } = useTranslation28();
12639
12703
  const emptyMessage = noOptionsMessage?.() ?? t("no_options");
@@ -12644,6 +12708,10 @@ function SelectMenu({
12644
12708
  () => selectedValues ?? (selectedValue ? [selectedValue] : []),
12645
12709
  [selectedValues, selectedValue]
12646
12710
  );
12711
+ const entries = React45.useMemo(
12712
+ () => buildMenuEntries(groupedOptions, options, formatGroupLabel),
12713
+ [groupedOptions, options, formatGroupLabel]
12714
+ );
12647
12715
  const wasAtBottomRef = React45.useRef(false);
12648
12716
  const handleScroll = React45.useCallback(
12649
12717
  (event) => {
@@ -12677,31 +12745,43 @@ function SelectMenu({
12677
12745
  ),
12678
12746
  children: [
12679
12747
  !hasOptions && (emptyContent ?? /* @__PURE__ */ jsx146("div", { className: "px-3 py-3 text-left text-[14px] font-medium text-[var(--chekin-color-gray-1)]", children: emptyMessage })),
12680
- options.map((option, index) => {
12748
+ entries.map((entry) => {
12749
+ if (entry.kind === "group-label") {
12750
+ return /* @__PURE__ */ jsx146(
12751
+ "div",
12752
+ {
12753
+ role: "presentation",
12754
+ className: "px-3 pb-1 pt-2 text-[11px] font-semibold uppercase tracking-wide text-[var(--chekin-color-gray-1)]",
12755
+ children: entry.label
12756
+ },
12757
+ entry.key
12758
+ );
12759
+ }
12760
+ const { option, flatIndex } = entry;
12681
12761
  const isSelected = isOptionSelected2 ? isOptionSelected2(option, selectedList) : isOptionSelected(option, selectedValue, selectedValues);
12682
- const isHighlighted = index === highlightedIndex;
12762
+ const isHighlighted = flatIndex === highlightedIndex;
12683
12763
  const optionDisabled = Boolean(
12684
12764
  disabled || option.isDisabled || isOptionDisabled?.(option)
12685
12765
  );
12686
12766
  return /* @__PURE__ */ jsx146(
12687
12767
  Option,
12688
12768
  {
12689
- id: getOptionId2(index),
12769
+ id: getOptionId2(flatIndex),
12690
12770
  option,
12691
- index,
12771
+ index: flatIndex,
12692
12772
  isSelected,
12693
12773
  isHighlighted,
12694
12774
  isDisabled: optionDisabled,
12695
- isLast: index === lastIndex,
12775
+ isLast: flatIndex === lastIndex,
12696
12776
  isMulti: Boolean(isMulti),
12697
12777
  onClick: onOptionClick,
12698
12778
  onHover: onOptionHover ?? (() => void 0),
12699
- innerRef: (node) => selectedOptionRef?.(index, node),
12779
+ innerRef: (node) => selectedOptionRef?.(flatIndex, node),
12700
12780
  inputValue,
12701
12781
  selectedOptions: selectedList,
12702
12782
  formatOptionLabel
12703
12783
  },
12704
- `${String(option.value)}-${index}`
12784
+ entry.key
12705
12785
  );
12706
12786
  }),
12707
12787
  footer
@@ -13631,7 +13711,9 @@ function DefaultMenuList(props) {
13631
13711
  inputValue,
13632
13712
  formatOptionLabel,
13633
13713
  isOptionSelected: isOptionSelected2,
13634
- onMenuScrollToBottom
13714
+ onMenuScrollToBottom,
13715
+ groupedOptions,
13716
+ formatGroupLabel
13635
13717
  } = props;
13636
13718
  return /* @__PURE__ */ jsx154(
13637
13719
  SelectMenu,
@@ -13659,7 +13741,9 @@ function DefaultMenuList(props) {
13659
13741
  inputValue,
13660
13742
  formatOptionLabel,
13661
13743
  isOptionSelected: isOptionSelected2,
13662
- onMenuScrollToBottom
13744
+ onMenuScrollToBottom,
13745
+ groupedOptions,
13746
+ formatGroupLabel
13663
13747
  }
13664
13748
  );
13665
13749
  }
@@ -13751,7 +13835,8 @@ function SelectInternal(props, ref) {
13751
13835
  searchPosition = "trigger",
13752
13836
  menuHeader,
13753
13837
  onMenuScrollToBottom,
13754
- leftIcon
13838
+ leftIcon,
13839
+ formatGroupLabel
13755
13840
  } = props;
13756
13841
  const isSearchInDropdown = searchPosition === "dropdown";
13757
13842
  const isMulti = props.isMulti === true;
@@ -13772,9 +13857,10 @@ function SelectInternal(props, ref) {
13772
13857
  },
13773
13858
  [isMulti, props.onChange]
13774
13859
  );
13860
+ const flatOptions = React49.useMemo(() => flattenGroupedOptions(options), [options]);
13775
13861
  const state = useSelectState({
13776
13862
  isMulti,
13777
- options,
13863
+ options: flatOptions,
13778
13864
  selectedOptions,
13779
13865
  onSelectionChange,
13780
13866
  filterOption,
@@ -13945,7 +14031,9 @@ function SelectInternal(props, ref) {
13945
14031
  inputValue: state.inputValue,
13946
14032
  formatOptionLabel,
13947
14033
  isOptionSelected: isOptionSelected2,
13948
- onMenuScrollToBottom
14034
+ onMenuScrollToBottom,
14035
+ groupedOptions: options,
14036
+ formatGroupLabel
13949
14037
  }
13950
14038
  ),
13951
14039
  state.canCreateNewOption && /* @__PURE__ */ jsx156(
@@ -14768,19 +14856,33 @@ function SelectCheckboxesInternal(props, ref) {
14768
14856
  );
14769
14857
  const [inputValue, setInputValue] = React59.useState("");
14770
14858
  const selected = value ?? [];
14771
- const filteredOptions = React59.useMemo(() => {
14859
+ const flatRawOptions = React59.useMemo(
14860
+ () => flattenGroupedOptions(rawOptions),
14861
+ [rawOptions]
14862
+ );
14863
+ const filteredGrouped = React59.useMemo(() => {
14772
14864
  const trimmed = inputValue.trim();
14773
14865
  if (!trimmed) return rawOptions;
14774
- return rawOptions.filter((option) => filterOption(option, trimmed));
14866
+ return rawOptions.map((item) => {
14867
+ if (isOptionGroup(item)) {
14868
+ const opts = item.options.filter((o) => filterOption(o, trimmed));
14869
+ return opts.length > 0 ? { ...item, options: opts } : null;
14870
+ }
14871
+ return filterOption(item, trimmed) ? item : null;
14872
+ }).filter((item) => item !== null);
14775
14873
  }, [rawOptions, inputValue, filterOption]);
14776
- const visibleSelectedCount = filteredOptions.reduce((acc, option) => {
14874
+ const filteredFlat = React59.useMemo(
14875
+ () => flattenGroupedOptions(filteredGrouped),
14876
+ [filteredGrouped]
14877
+ );
14878
+ const visibleSelectedCount = filteredFlat.reduce((acc, option) => {
14777
14879
  return acc + (selected.some((s) => s.value === option.value) ? 1 : 0);
14778
14880
  }, 0);
14779
- const allVisibleSelected = filteredOptions.length > 0 && visibleSelectedCount === filteredOptions.length;
14780
- const someVisibleSelected = visibleSelectedCount > 0 && visibleSelectedCount < filteredOptions.length;
14881
+ const allVisibleSelected = filteredFlat.length > 0 && visibleSelectedCount === filteredFlat.length;
14882
+ const someVisibleSelected = visibleSelectedCount > 0 && visibleSelectedCount < filteredFlat.length;
14781
14883
  const handleToggleAll = React59.useCallback(() => {
14782
14884
  if (allVisibleSelected) {
14783
- const visibleValues = new Set(filteredOptions.map((option) => option.value));
14885
+ const visibleValues = new Set(filteredFlat.map((option) => option.value));
14784
14886
  onChange(
14785
14887
  selected.filter((s) => !visibleValues.has(s.value)),
14786
14888
  { action: "deselect" }
@@ -14788,18 +14890,18 @@ function SelectCheckboxesInternal(props, ref) {
14788
14890
  return;
14789
14891
  }
14790
14892
  const merged = [...selected];
14791
- for (const option of filteredOptions) {
14893
+ for (const option of filteredFlat) {
14792
14894
  if (!merged.some((s) => s.value === option.value)) merged.push(option);
14793
14895
  }
14794
14896
  onChange(merged, { action: "select" });
14795
- }, [allVisibleSelected, filteredOptions, onChange, selected]);
14897
+ }, [allVisibleSelected, filteredFlat, onChange, selected]);
14796
14898
  const Control = React59.useMemo(() => {
14797
14899
  if (trigger) return makeTriggerSlot2(trigger);
14798
14900
  return createCountTrigger({
14799
14901
  valueText,
14800
- totalCount: rawOptions.length
14902
+ totalCount: flatRawOptions.length
14801
14903
  });
14802
- }, [trigger, valueText, rawOptions.length]);
14904
+ }, [trigger, valueText, flatRawOptions.length]);
14803
14905
  const components = React59.useMemo(
14804
14906
  () => ({
14805
14907
  ...userComponents,
@@ -14824,11 +14926,10 @@ function SelectCheckboxesInternal(props, ref) {
14824
14926
  },
14825
14927
  [onSearchChange]
14826
14928
  );
14827
- const sharedProps = {
14929
+ const baseSharedProps = {
14828
14930
  ...paginationAndRest,
14829
14931
  value,
14830
14932
  onChange,
14831
- options: filteredOptions,
14832
14933
  filterOption: passthroughFilter2,
14833
14934
  components,
14834
14935
  closeMenuOnSelect,
@@ -14842,7 +14943,10 @@ function SelectCheckboxesInternal(props, ref) {
14842
14943
  InfiniteScrollSelect,
14843
14944
  {
14844
14945
  ref,
14845
- ...sharedProps
14946
+ ...{
14947
+ ...baseSharedProps,
14948
+ options: filteredFlat
14949
+ }
14846
14950
  }
14847
14951
  );
14848
14952
  }
@@ -14850,7 +14954,10 @@ function SelectCheckboxesInternal(props, ref) {
14850
14954
  Select,
14851
14955
  {
14852
14956
  ref,
14853
- ...sharedProps
14957
+ ...{
14958
+ ...baseSharedProps,
14959
+ options: filteredGrouped
14960
+ }
14854
14961
  }
14855
14962
  );
14856
14963
  }
@@ -15773,7 +15880,7 @@ var Datepicker = React63.forwardRef(
15773
15880
  hideErrorMessage,
15774
15881
  helperText,
15775
15882
  width,
15776
- locale = "en-US",
15883
+ locale,
15777
15884
  minDate,
15778
15885
  maxDate,
15779
15886
  formatValue
@@ -15792,10 +15899,11 @@ var Datepicker = React63.forwardRef(
15792
15899
  const yearId = `${baseId}-year`;
15793
15900
  const labelId = `${baseId}-label`;
15794
15901
  const errorId = `${baseId}-error`;
15795
- const { t } = useTranslation39();
15902
+ const { t, i18n } = useTranslation39();
15903
+ const resolvedLocale = locale ?? i18n.resolvedLanguage ?? i18n.language ?? "en-US";
15796
15904
  const resolvedMonthLabels = React63.useMemo(
15797
- () => monthLabels ?? getMonthLabels2(locale),
15798
- [locale, monthLabels]
15905
+ () => monthLabels ?? getMonthLabels2(resolvedLocale),
15906
+ [resolvedLocale, monthLabels]
15799
15907
  );
15800
15908
  const resolvedMonthPlaceholder = monthPlaceholder ?? t("month");
15801
15909
  const resolvedDoneLabel = doneLabel ?? t("done");
@@ -17597,7 +17705,7 @@ var AirbnbFieldTrigger = React72.forwardRef(
17597
17705
  const hasLabelMeta = Boolean(optionalLabel) || Boolean(tooltip);
17598
17706
  const resolvedLabelText = visibleLabelText && hasLabelMeta ? /* @__PURE__ */ jsxs116("span", { className: "inline-flex max-w-full items-center gap-1.5 align-middle", children: [
17599
17707
  /* @__PURE__ */ jsx182("span", { className: "min-w-0 truncate", children: visibleLabelText }),
17600
- optionalLabel && /* @__PURE__ */ jsxs116("span", { className: "shrink-0 text-[12px] relative top-[1px] font-normal leading-4 text-current opacity-70", children: [
17708
+ optionalLabel && /* @__PURE__ */ jsxs116("span", { className: "text-current opacity-70 lowercase", children: [
17601
17709
  "(",
17602
17710
  optionalLabel,
17603
17711
  ")"
@@ -17651,8 +17759,8 @@ var AirbnbFieldTrigger = React72.forwardRef(
17651
17759
  {
17652
17760
  id: labelId,
17653
17761
  className: cn(
17654
- "absolute left-0 origin-left truncate transition-all duration-200 ease-out",
17655
- hasLabelMeta ? "" : "pointer-events-none",
17762
+ "absolute left-0 origin-left transition-all duration-200 ease-out",
17763
+ hasLabelMeta ? "max-w-full" : "pointer-events-none truncate",
17656
17764
  isAirbnbVariant ? isRaised ? "top-[-1px] translate-y-0 text-xs leading-5" : "top-1/2 -translate-y-1/2 text-[16px] leading-7" : isRaised ? "-top-2 translate-y-0 bg-white px-1 text-[12px] font-medium leading-4" : "top-1/2 -translate-y-1/2 text-[16px] leading-6",
17657
17765
  hasInvalidState ? "text-[var(--error-message-color)]" : isAirbnbVariant ? "text-[#6c6c6c]" : "text-[#7A8399]"
17658
17766
  ),
@@ -17920,7 +18028,9 @@ AirbnbDatePicker.displayName = "AirbnbDatePicker";
17920
18028
 
17921
18029
  // src/airbnb-fields/input/Input.tsx
17922
18030
  import * as React74 from "react";
17923
- import { jsx as jsx184 } from "react/jsx-runtime";
18031
+ import { Eye as Eye2 } from "lucide-react";
18032
+ import { useTranslation as useTranslation44 } from "react-i18next";
18033
+ import { jsx as jsx184, jsxs as jsxs118 } from "react/jsx-runtime";
17924
18034
  var getInputValue = (value) => value != null ? String(value) : "";
17925
18035
  var AirbnbInput = React74.forwardRef(
17926
18036
  ({
@@ -17951,6 +18061,7 @@ var AirbnbInput = React74.forwardRef(
17951
18061
  placeholder,
17952
18062
  ...props
17953
18063
  }, ref) => {
18064
+ const { t } = useTranslation44();
17954
18065
  const generatedId = React74.useId();
17955
18066
  const inputRef = React74.useRef(null);
17956
18067
  const inputId = id ?? generatedId;
@@ -17959,11 +18070,15 @@ var AirbnbInput = React74.forwardRef(
17959
18070
  const errorId = `${inputId}-error`;
17960
18071
  const accessibleLabel = placeholder ?? label;
17961
18072
  const [isFocused, setIsFocused] = React74.useState(false);
18073
+ const [isPasswordRevealed, setIsPasswordRevealed] = React74.useState(false);
17962
18074
  const [currentValue, setCurrentValue] = React74.useState(
17963
18075
  () => value != null ? getInputValue(value) : getInputValue(defaultValue)
17964
18076
  );
17965
18077
  const resolvedValue = value != null ? getInputValue(value) : currentValue;
17966
18078
  const hasValue = resolvedValue.length > 0;
18079
+ const isPasswordInput = type === "password";
18080
+ const inputType = isPasswordInput && isPasswordRevealed ? "text" : type;
18081
+ const shouldShowPasswordReveal = isPasswordInput && hasValue && !loading;
17967
18082
  const shouldShowLabel = hasValue || isFocused;
17968
18083
  const hasInvalidState = Boolean(error) || Boolean(invalid);
17969
18084
  const triggerError = error ?? invalid;
@@ -17973,6 +18088,11 @@ var AirbnbInput = React74.forwardRef(
17973
18088
  const nextValue = value != null ? getInputValue(value) : getInputValue(inputRef.current?.value);
17974
18089
  setCurrentValue((prevValue) => prevValue === nextValue ? prevValue : nextValue);
17975
18090
  }, [value]);
18091
+ React74.useEffect(() => {
18092
+ if (!isPasswordInput) {
18093
+ setIsPasswordRevealed(false);
18094
+ }
18095
+ }, [isPasswordInput]);
17976
18096
  const setRefs = React74.useCallback(
17977
18097
  (node) => {
17978
18098
  inputRef.current = node;
@@ -18003,7 +18123,10 @@ var AirbnbInput = React74.forwardRef(
18003
18123
  setIsFocused(false);
18004
18124
  onBlur?.(event);
18005
18125
  };
18006
- return /* @__PURE__ */ jsx184("div", { className: cn("w-full max-w-[var(--max-field-width)]", wrapperClassName), children: /* @__PURE__ */ jsx184(
18126
+ const togglePasswordReveal = () => {
18127
+ setIsPasswordRevealed((isRevealed) => !isRevealed);
18128
+ };
18129
+ return /* @__PURE__ */ jsx184("div", { className: cn("w-full max-w-[var(--max-field-width)]", wrapperClassName), children: /* @__PURE__ */ jsxs118(
18007
18130
  AirbnbFieldTrigger,
18008
18131
  {
18009
18132
  as: "div",
@@ -18031,39 +18154,63 @@ var AirbnbInput = React74.forwardRef(
18031
18154
  variant === "airbnb" ? "h-[42px]" : "h-[48px]",
18032
18155
  contentClassName
18033
18156
  ),
18034
- trailingAdornment,
18157
+ trailingAdornment: shouldShowPasswordReveal ? void 0 : trailingAdornment,
18035
18158
  forceFloatingLabel: shouldShowLabel,
18036
18159
  forceLabelText: hasLabelMeta,
18037
18160
  hideErrorMessage: !renderErrorMessage,
18038
- children: /* @__PURE__ */ jsx184(
18039
- "input",
18040
- {
18041
- ...props,
18042
- id: inputId,
18043
- ref: setRefs,
18044
- type,
18045
- disabled: isBlocked,
18046
- value,
18047
- defaultValue,
18048
- onChange: handleChange,
18049
- onFocus: handleFocus,
18050
- onBlur: handleBlur,
18051
- placeholder: "",
18052
- "aria-invalid": hasInvalidState,
18053
- "aria-busy": loading,
18054
- "aria-describedby": error && renderErrorMessage ? errorId : void 0,
18055
- "aria-label": accessibleLabel && hasLabelMeta ? accessibleLabel : void 0,
18056
- "aria-labelledby": accessibleLabel && !hasLabelMeta ? labelId : void 0,
18057
- className: cn(
18058
- "absolute left-0 h-6 w-full border-0 bg-transparent p-0 text-[16px] leading-6 text-[#1F1F1B] outline-none placeholder:text-[#7A8399]",
18059
- variant === "airbnb" ? "bottom-0" : "bottom-[12px]",
18060
- hasInvalidState ? "text-[var(--status-danger)] placeholder:text-[var(--status-danger)]" : "",
18061
- disabled ? "cursor-not-allowed" : loading ? "cursor-progress" : "",
18062
- inputClassName,
18063
- className
18064
- )
18065
- }
18066
- )
18161
+ children: [
18162
+ /* @__PURE__ */ jsx184(
18163
+ "input",
18164
+ {
18165
+ ...props,
18166
+ id: inputId,
18167
+ ref: setRefs,
18168
+ type: inputType,
18169
+ disabled: isBlocked,
18170
+ value,
18171
+ defaultValue,
18172
+ onChange: handleChange,
18173
+ onFocus: handleFocus,
18174
+ onBlur: handleBlur,
18175
+ placeholder: "",
18176
+ "aria-invalid": hasInvalidState,
18177
+ "aria-busy": loading,
18178
+ "aria-describedby": error && renderErrorMessage ? errorId : void 0,
18179
+ "aria-label": accessibleLabel && hasLabelMeta ? accessibleLabel : void 0,
18180
+ "aria-labelledby": accessibleLabel && !hasLabelMeta ? labelId : void 0,
18181
+ className: cn(
18182
+ "absolute left-0 h-6 w-full border-0 bg-transparent p-0 text-[16px] leading-6 text-[#1F1F1B] outline-none placeholder:text-[#7A8399]",
18183
+ variant === "airbnb" ? "bottom-0" : "bottom-[12px]",
18184
+ hasInvalidState ? "text-[var(--status-danger)] placeholder:text-[var(--status-danger)]" : "",
18185
+ disabled ? "cursor-not-allowed" : loading ? "cursor-progress" : "",
18186
+ shouldShowPasswordReveal ? "pr-8" : "",
18187
+ inputClassName,
18188
+ className
18189
+ )
18190
+ }
18191
+ ),
18192
+ shouldShowPasswordReveal && /* @__PURE__ */ jsx184(
18193
+ "button",
18194
+ {
18195
+ type: "button",
18196
+ onClick: togglePasswordReveal,
18197
+ disabled: isBlocked,
18198
+ className: cn(
18199
+ "absolute right-0 flex h-6 w-6 items-center justify-center border-0 bg-transparent p-0 text-[#7A8399] hover:text-[#1F1F1B] hover:opacity-85 disabled:cursor-not-allowed disabled:opacity-50",
18200
+ variant === "airbnb" ? "bottom-0" : "bottom-[12px]"
18201
+ ),
18202
+ "aria-label": isPasswordRevealed ? t("hide_password") : t("show_password"),
18203
+ children: /* @__PURE__ */ jsx184(
18204
+ Eye2,
18205
+ {
18206
+ size: 18,
18207
+ "aria-hidden": "true",
18208
+ className: cn(isPasswordRevealed ? "text-[#fc98dd]" : "")
18209
+ }
18210
+ )
18211
+ }
18212
+ )
18213
+ ]
18067
18214
  }
18068
18215
  ) });
18069
18216
  }
@@ -18078,7 +18225,7 @@ import { ChevronDown as ChevronDown6 } from "lucide-react";
18078
18225
  import * as React79 from "react";
18079
18226
 
18080
18227
  // src/airbnb-fields/select/SelectDesktopMenu.tsx
18081
- import { jsx as jsx185, jsxs as jsxs118 } from "react/jsx-runtime";
18228
+ import { jsx as jsx185, jsxs as jsxs119 } from "react/jsx-runtime";
18082
18229
  function AirbnbSelectDesktopMenu({
18083
18230
  id,
18084
18231
  options,
@@ -18097,7 +18244,7 @@ function AirbnbSelectDesktopMenu({
18097
18244
  noOptionsMessage
18098
18245
  }) {
18099
18246
  const emptyMessage = noOptionsMessage?.();
18100
- return /* @__PURE__ */ jsxs118(
18247
+ return /* @__PURE__ */ jsxs119(
18101
18248
  "div",
18102
18249
  {
18103
18250
  id,
@@ -18273,7 +18420,7 @@ function getMobileOptionStyles(index, scrollTop) {
18273
18420
  }
18274
18421
 
18275
18422
  // src/airbnb-fields/select/SelectMobileWheel.tsx
18276
- import { jsx as jsx187, jsxs as jsxs119 } from "react/jsx-runtime";
18423
+ import { jsx as jsx187, jsxs as jsxs120 } from "react/jsx-runtime";
18277
18424
  function AirbnbSelectMobileWheel({
18278
18425
  id,
18279
18426
  options,
@@ -18292,7 +18439,7 @@ function AirbnbSelectMobileWheel({
18292
18439
  }) {
18293
18440
  const spacerHeight2 = getWheelSpacerHeight();
18294
18441
  const emptyMessage = noOptionsMessage?.();
18295
- return /* @__PURE__ */ jsxs119(
18442
+ return /* @__PURE__ */ jsxs120(
18296
18443
  "div",
18297
18444
  {
18298
18445
  id,
@@ -18317,7 +18464,7 @@ function AirbnbSelectMobileWheel({
18317
18464
  )
18318
18465
  }
18319
18466
  ),
18320
- /* @__PURE__ */ jsxs119(
18467
+ /* @__PURE__ */ jsxs120(
18321
18468
  "div",
18322
18469
  {
18323
18470
  ref: listRef,
@@ -18367,7 +18514,7 @@ function AirbnbSelectMobileWheel({
18367
18514
  }
18368
18515
 
18369
18516
  // src/airbnb-fields/select/SelectMobileContent.tsx
18370
- import { jsx as jsx188, jsxs as jsxs120 } from "react/jsx-runtime";
18517
+ import { jsx as jsx188, jsxs as jsxs121 } from "react/jsx-runtime";
18371
18518
  function AirbnbSelectMobileContent({
18372
18519
  open,
18373
18520
  onOpenChange,
@@ -18391,10 +18538,10 @@ function AirbnbSelectMobileContent({
18391
18538
  getOptionId: getOptionId2,
18392
18539
  noOptionsMessage
18393
18540
  }) {
18394
- return /* @__PURE__ */ jsx188(Drawer, { open, onOpenChange, children: /* @__PURE__ */ jsxs120(DrawerContent, { onClose, lockScroll: false, children: [
18541
+ return /* @__PURE__ */ jsx188(Drawer, { open, onOpenChange, children: /* @__PURE__ */ jsxs121(DrawerContent, { onClose, lockScroll: false, children: [
18395
18542
  /* @__PURE__ */ jsx188(DrawerTitle, { className: "sr-only", children: mobileTitle ?? label }),
18396
18543
  /* @__PURE__ */ jsx188(DrawerDescription, { className: "sr-only", children: label }),
18397
- /* @__PURE__ */ jsxs120("div", { className: "px-6 pb-4 pt-1", children: [
18544
+ /* @__PURE__ */ jsxs121("div", { className: "px-6 pb-4 pt-1", children: [
18398
18545
  /* @__PURE__ */ jsx188(
18399
18546
  AirbnbSelectMobileWheel,
18400
18547
  {
@@ -18839,7 +18986,7 @@ function useSelectIds2({ name, hasValue, error, hideErrorMessage }) {
18839
18986
  }
18840
18987
 
18841
18988
  // src/airbnb-fields/select/Select.tsx
18842
- import { jsx as jsx190, jsxs as jsxs121 } from "react/jsx-runtime";
18989
+ import { jsx as jsx190, jsxs as jsxs122 } from "react/jsx-runtime";
18843
18990
  var AirbnbSelect = React79.forwardRef(function AirbnbSelect2({
18844
18991
  options = [],
18845
18992
  value,
@@ -19019,7 +19166,7 @@ var AirbnbSelect = React79.forwardRef(function AirbnbSelect2({
19019
19166
  handleMobileOpenChange(false);
19020
19167
  }
19021
19168
  };
19022
- return /* @__PURE__ */ jsxs121(
19169
+ return /* @__PURE__ */ jsxs122(
19023
19170
  "div",
19024
19171
  {
19025
19172
  ref: containerRef,
@@ -19134,7 +19281,7 @@ var AirbnbSelect = React79.forwardRef(function AirbnbSelect2({
19134
19281
  });
19135
19282
 
19136
19283
  // src/airbnb-fields/phone-field/PhoneField.tsx
19137
- import { jsx as jsx191, jsxs as jsxs122 } from "react/jsx-runtime";
19284
+ import { jsx as jsx191, jsxs as jsxs123 } from "react/jsx-runtime";
19138
19285
  function formatPhoneCodeOptionLabel2(option) {
19139
19286
  const label = String(option.label);
19140
19287
  const value = String(option.value);
@@ -19181,7 +19328,7 @@ var AirbnbPhoneField = React80.forwardRef(
19181
19328
  const hasInvalidState = Boolean(error) || Boolean(invalid);
19182
19329
  const isBlocked = Boolean(disabled) || Boolean(loading);
19183
19330
  const isCodeBlocked = isBlocked || Boolean(codeReadOnly);
19184
- return /* @__PURE__ */ jsxs122("div", { className: cn("w-full max-w-[var(--max-field-width)]", className), children: [
19331
+ return /* @__PURE__ */ jsxs123("div", { className: cn("w-full max-w-[var(--max-field-width)]", className), children: [
19185
19332
  name && /* @__PURE__ */ jsx191("input", { type: "hidden", name, value: combinedValue, disabled }),
19186
19333
  codeName && /* @__PURE__ */ jsx191(
19187
19334
  "input",
@@ -19209,7 +19356,7 @@ var AirbnbPhoneField = React80.forwardRef(
19209
19356
  children: topLabel
19210
19357
  }
19211
19358
  ),
19212
- /* @__PURE__ */ jsxs122("div", { className: "flex items-stretch", children: [
19359
+ /* @__PURE__ */ jsxs123("div", { className: "flex items-stretch", children: [
19213
19360
  /* @__PURE__ */ jsx191(
19214
19361
  AirbnbSelect,
19215
19362
  {
@@ -19241,7 +19388,7 @@ var AirbnbPhoneField = React80.forwardRef(
19241
19388
  onClick,
19242
19389
  onKeyDown,
19243
19390
  valueLabel
19244
- }) => /* @__PURE__ */ jsxs122(
19391
+ }) => /* @__PURE__ */ jsxs123(
19245
19392
  "button",
19246
19393
  {
19247
19394
  id,
@@ -19319,7 +19466,7 @@ import * as React81 from "react";
19319
19466
  import { ChevronDown as ChevronDown7, Search as Search4 } from "lucide-react";
19320
19467
  import { useVirtualizer as useVirtualizer3 } from "@tanstack/react-virtual";
19321
19468
  import { useCallback as useCallback57 } from "react";
19322
- import { jsx as jsx192, jsxs as jsxs123 } from "react/jsx-runtime";
19469
+ import { jsx as jsx192, jsxs as jsxs124 } from "react/jsx-runtime";
19323
19470
  var ROW_HEIGHT = 48;
19324
19471
  var DESKTOP_LIST_HEIGHT = 280;
19325
19472
  var MOBILE_LIST_HEIGHT = 420;
@@ -19516,7 +19663,7 @@ var AirbnbSearchableSelectInternal = ({
19516
19663
  }
19517
19664
  );
19518
19665
  React81.useImperativeHandle(ref, () => triggerRef.current, []);
19519
- return /* @__PURE__ */ jsxs123("div", { ref: containerRef, className: cn("relative w-full max-w-[425px]", className), children: [
19666
+ return /* @__PURE__ */ jsxs124("div", { ref: containerRef, className: cn("relative w-full max-w-[425px]", className), children: [
19520
19667
  name && /* @__PURE__ */ jsx192("input", { type: "hidden", name, value: value ? String(value.value) : "" }),
19521
19668
  /* @__PURE__ */ jsx192(
19522
19669
  AirbnbFieldTrigger,
@@ -19576,7 +19723,7 @@ var AirbnbSearchableSelectInternal = ({
19576
19723
  }
19577
19724
  closeSelect();
19578
19725
  },
19579
- children: /* @__PURE__ */ jsxs123(DrawerContent, { onClose: closeSelect, lockScroll: false, children: [
19726
+ children: /* @__PURE__ */ jsxs124(DrawerContent, { onClose: closeSelect, lockScroll: false, children: [
19580
19727
  /* @__PURE__ */ jsx192(DrawerTitle, { className: "sr-only", children: mobileTitle ?? label }),
19581
19728
  /* @__PURE__ */ jsx192(DrawerDescription, { className: "sr-only", children: label }),
19582
19729
  /* @__PURE__ */ jsx192("div", { className: "px-5 pb-5 pt-1", children: content })
@@ -19649,8 +19796,8 @@ function AirbnbSearchableSelectContent({
19649
19796
  virtualizer.scrollToIndex(highlightedIndex, { align: "auto" });
19650
19797
  }
19651
19798
  }, [highlightedIndex, virtualizer]);
19652
- return /* @__PURE__ */ jsxs123("div", { className: "p-2", children: [
19653
- /* @__PURE__ */ jsxs123("div", { className: "relative mb-2", children: [
19799
+ return /* @__PURE__ */ jsxs124("div", { className: "p-2", children: [
19800
+ /* @__PURE__ */ jsxs124("div", { className: "relative mb-2", children: [
19654
19801
  /* @__PURE__ */ jsx192(
19655
19802
  Search4,
19656
19803
  {
@@ -19761,13 +19908,13 @@ function getNextEnabledIndex(options, startIndex, step) {
19761
19908
 
19762
19909
  // src/airbnb-fields/search-input/SearchInput.tsx
19763
19910
  import * as React82 from "react";
19764
- import { useTranslation as useTranslation44 } from "react-i18next";
19911
+ import { useTranslation as useTranslation45 } from "react-i18next";
19765
19912
  import { Search as Search5, X as X11 } from "lucide-react";
19766
- import { jsx as jsx193, jsxs as jsxs124 } from "react/jsx-runtime";
19913
+ import { jsx as jsx193, jsxs as jsxs125 } from "react/jsx-runtime";
19767
19914
  var AirbnbSearchInput = React82.forwardRef(({ onReset, placeholder, wrapperClassName, ...props }, ref) => {
19768
- const { t } = useTranslation44();
19915
+ const { t } = useTranslation45();
19769
19916
  const placeholderText = placeholder || t("search_property") + "...";
19770
- return /* @__PURE__ */ jsxs124("div", { className: cn("input-wrapper relative", wrapperClassName), children: [
19917
+ return /* @__PURE__ */ jsxs125("div", { className: cn("input-wrapper relative", wrapperClassName), children: [
19771
19918
  /* @__PURE__ */ jsx193(Search5, { className: "absolute left-4 top-1/2 h-5 w-5 -translate-y-1/2 transform text-[#9696B9]" }),
19772
19919
  /* @__PURE__ */ jsx193(
19773
19920
  "input",
@@ -19800,6 +19947,51 @@ var AirbnbSearchInput = React82.forwardRef(({ onReset, placeholder, wrapperClass
19800
19947
  ] });
19801
19948
  });
19802
19949
  AirbnbSearchInput.displayName = "AirbnbSearchInput";
19950
+
19951
+ // src/airbnb-fields/switch/Switch.tsx
19952
+ import * as React83 from "react";
19953
+ import * as SwitchPrimitives2 from "@radix-ui/react-switch";
19954
+ import { Check as Check7 } from "lucide-react";
19955
+ import { jsx as jsx194 } from "react/jsx-runtime";
19956
+ var AirbnbSwitch = React83.forwardRef(({ className, value, onChange, disabled, loading, readOnly, ...props }, ref) => /* @__PURE__ */ jsx194(
19957
+ SwitchPrimitives2.Root,
19958
+ {
19959
+ ref,
19960
+ className: cn(
19961
+ "group inline-flex h-[24px] w-[36px] shrink-0 cursor-pointer items-center rounded-full border border-solid border-transparent p-[2px] transition-colors duration-200",
19962
+ "focus-visible:outline-none focus-visible:shadow-[var(--chekin-shadow-focus)]",
19963
+ "disabled:cursor-not-allowed disabled:opacity-50 aria-busy:cursor-wait aria-busy:opacity-50",
19964
+ "aria-readonly:cursor-default aria-readonly:opacity-100",
19965
+ "data-[state=checked]:bg-[#222222] data-[state=unchecked]:bg-[#E7E7E4]",
19966
+ className
19967
+ ),
19968
+ disabled,
19969
+ checked: value,
19970
+ value: String(value),
19971
+ onCheckedChange: !disabled && !readOnly ? onChange : void 0,
19972
+ "aria-busy": loading,
19973
+ "aria-readonly": readOnly,
19974
+ ...props,
19975
+ children: /* @__PURE__ */ jsx194(
19976
+ SwitchPrimitives2.Thumb,
19977
+ {
19978
+ className: cn(
19979
+ "flex h-[20px] w-[20px] items-center justify-center rounded-full bg-white shadow-[0_1px_3px_rgba(0,0,0,0.22)] transition-transform duration-200",
19980
+ "data-[state=checked]:translate-x-[12px] data-[state=unchecked]:translate-x-0"
19981
+ ),
19982
+ children: /* @__PURE__ */ jsx194(
19983
+ Check7,
19984
+ {
19985
+ "aria-hidden": "true",
19986
+ className: "h-3 w-3 text-[#222222] opacity-0 transition-opacity duration-150 group-data-[state=checked]:opacity-100",
19987
+ strokeWidth: 3
19988
+ }
19989
+ )
19990
+ }
19991
+ )
19992
+ }
19993
+ ));
19994
+ AirbnbSwitch.displayName = "AirbnbSwitch";
19803
19995
  export {
19804
19996
  ALERT_BOX_VARIANTS,
19805
19997
  Accordion,
@@ -19813,6 +20005,7 @@ export {
19813
20005
  AirbnbSearchInput,
19814
20006
  AirbnbSearchableSelect,
19815
20007
  AirbnbSelect,
20008
+ AirbnbSwitch,
19816
20009
  Alert,
19817
20010
  AlertBox,
19818
20011
  AlertDescription,