@chekinapp/ui 0.0.5 → 0.0.7

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 CHANGED
@@ -115,6 +115,7 @@ __export(index_exports, {
115
115
  ErrorMessage: () => ErrorMessage,
116
116
  ExternalLink: () => ExternalLink,
117
117
  FeatureCard: () => FeatureCard,
118
+ FieldErrorMessage: () => FieldErrorMessage,
118
119
  FieldTrigger: () => FieldTrigger,
119
120
  FileInputButton: () => FileInputButton,
120
121
  FormBox: () => FormBox,
@@ -9308,7 +9309,7 @@ var DatePicker = React30.forwardRef(
9308
9309
  setIsOpen(false);
9309
9310
  }
9310
9311
  }, [isBlocked]);
9311
- return /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)("div", { className: cn("relative w-full max-w-[425px]", className), children: [
9312
+ return /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)("div", { className: cn("relative w-full max-w-[var(--max-field-width)]", className), children: [
9312
9313
  name && /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
9313
9314
  "input",
9314
9315
  {
@@ -9572,7 +9573,7 @@ var AirbnbInput = React31.forwardRef(
9572
9573
  setIsFocused(false);
9573
9574
  onBlur?.(event);
9574
9575
  };
9575
- return /* @__PURE__ */ (0, import_jsx_runtime125.jsx)("div", { className: cn("w-full", wrapperClassName), children: /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
9576
+ return /* @__PURE__ */ (0, import_jsx_runtime125.jsx)("div", { className: cn("w-full max-w-[var(--max-field-width)]", wrapperClassName), children: /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
9576
9577
  FieldTrigger,
9577
9578
  {
9578
9579
  as: "div",
@@ -10630,109 +10631,116 @@ var AirbnbSelect = React36.forwardRef(function AirbnbSelect2({
10630
10631
  handleMobileOpenChange(false);
10631
10632
  }
10632
10633
  };
10633
- return /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("div", { ref: containerRef, className: cn("relative w-full max-w-[425px]", className), children: [
10634
- name && /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("input", { type: "hidden", name, value: value ? String(value.value) : "" }),
10635
- renderTrigger ? renderTrigger({
10636
- id: triggerId,
10637
- open: isOpen,
10638
- variant,
10639
- label,
10640
- topLabel,
10641
- helperText,
10642
- value,
10643
- valueLabel,
10644
- disabled: isBlocked,
10645
- loading,
10646
- optional,
10647
- tooltip,
10648
- error,
10649
- invalid,
10650
- listboxId,
10651
- describedBy,
10652
- triggerRef: combinedRef,
10653
- onClick: handleTriggerClick,
10654
- onKeyDown: handleRootTriggerKeyDown
10655
- }) : /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
10656
- SelectTrigger2,
10657
- {
10658
- id: triggerId,
10659
- ref: combinedRef,
10660
- open: isOpen,
10661
- variant,
10662
- label,
10663
- topLabel,
10664
- helperText,
10665
- valueLabel,
10666
- disabled,
10667
- loading,
10668
- optional,
10669
- tooltip,
10670
- error: triggerError,
10671
- hideErrorMessage,
10672
- labelId,
10673
- valueId,
10674
- helperTextId,
10675
- errorId: error ? errorId : void 0,
10676
- listboxId,
10677
- describedBy,
10678
- onClick: handleTriggerClick,
10679
- onKeyDown: handleRootTriggerKeyDown
10680
- }
10681
- ),
10682
- isMobile ? /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
10683
- SelectMobileContent,
10684
- {
10685
- open: isOpen,
10686
- onOpenChange: handleMobileOpenChange,
10687
- onClose: () => handleMobileOpenChange(false),
10688
- listboxId,
10689
- labelId,
10690
- label,
10691
- mobileTitle,
10692
- doneLabel,
10693
- errorId: describedErrorId,
10694
- options,
10695
- disabled: isBlocked,
10696
- menuClassName,
10697
- scrollTop: mobileScrollTop,
10698
- activeIndex: activeMobileIndex,
10699
- listRef: mobileListRef,
10700
- onScroll: handleScroll,
10701
- onOptionClick: handleOptionClick,
10702
- onKeyDown: handleMobileWheelKeyDown,
10703
- onDone: handleMobileDone,
10704
- getOptionId: getOptionId2,
10705
- noOptionsMessage
10706
- }
10707
- ) : /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
10708
- SelectDesktopContent,
10709
- {
10710
- isOpen,
10711
- listboxId,
10712
- labelId,
10713
- errorId: describedErrorId,
10714
- options,
10715
- value,
10716
- highlightedIndex,
10717
- onOptionClick: (option) => {
10718
- handleDesktopSelect(option);
10719
- setIsOpen(false);
10720
- focusTrigger();
10721
- },
10722
- onOptionHover: setHighlightedIndex,
10723
- onKeyDown: (event) => {
10724
- handleMenuKeyDown(event, () => setIsOpen(false));
10725
- },
10726
- disabled: isBlocked,
10727
- menuClassName,
10728
- dropdownClassName,
10729
- listRef: desktopListRef,
10730
- setOptionRef,
10731
- getOptionId: getOptionId2,
10732
- noOptionsMessage
10733
- }
10734
- )
10735
- ] });
10634
+ return /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(
10635
+ "div",
10636
+ {
10637
+ ref: containerRef,
10638
+ className: cn("relative w-full max-w-[var(--max-field-width)]", className),
10639
+ children: [
10640
+ name && /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("input", { type: "hidden", name, value: value ? String(value.value) : "" }),
10641
+ renderTrigger ? renderTrigger({
10642
+ id: triggerId,
10643
+ open: isOpen,
10644
+ variant,
10645
+ label,
10646
+ topLabel,
10647
+ helperText,
10648
+ value,
10649
+ valueLabel,
10650
+ disabled: isBlocked,
10651
+ loading,
10652
+ optional,
10653
+ tooltip,
10654
+ error,
10655
+ invalid,
10656
+ listboxId,
10657
+ describedBy,
10658
+ triggerRef: combinedRef,
10659
+ onClick: handleTriggerClick,
10660
+ onKeyDown: handleRootTriggerKeyDown
10661
+ }) : /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
10662
+ SelectTrigger2,
10663
+ {
10664
+ id: triggerId,
10665
+ ref: combinedRef,
10666
+ open: isOpen,
10667
+ variant,
10668
+ label,
10669
+ topLabel,
10670
+ helperText,
10671
+ valueLabel,
10672
+ disabled,
10673
+ loading,
10674
+ optional,
10675
+ tooltip,
10676
+ error: triggerError,
10677
+ hideErrorMessage,
10678
+ labelId,
10679
+ valueId,
10680
+ helperTextId,
10681
+ errorId: error ? errorId : void 0,
10682
+ listboxId,
10683
+ describedBy,
10684
+ onClick: handleTriggerClick,
10685
+ onKeyDown: handleRootTriggerKeyDown
10686
+ }
10687
+ ),
10688
+ isMobile ? /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
10689
+ SelectMobileContent,
10690
+ {
10691
+ open: isOpen,
10692
+ onOpenChange: handleMobileOpenChange,
10693
+ onClose: () => handleMobileOpenChange(false),
10694
+ listboxId,
10695
+ labelId,
10696
+ label,
10697
+ mobileTitle,
10698
+ doneLabel,
10699
+ errorId: describedErrorId,
10700
+ options,
10701
+ disabled: isBlocked,
10702
+ menuClassName,
10703
+ scrollTop: mobileScrollTop,
10704
+ activeIndex: activeMobileIndex,
10705
+ listRef: mobileListRef,
10706
+ onScroll: handleScroll,
10707
+ onOptionClick: handleOptionClick,
10708
+ onKeyDown: handleMobileWheelKeyDown,
10709
+ onDone: handleMobileDone,
10710
+ getOptionId: getOptionId2,
10711
+ noOptionsMessage
10712
+ }
10713
+ ) : /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
10714
+ SelectDesktopContent,
10715
+ {
10716
+ isOpen,
10717
+ listboxId,
10718
+ labelId,
10719
+ errorId: describedErrorId,
10720
+ options,
10721
+ value,
10722
+ highlightedIndex,
10723
+ onOptionClick: (option) => {
10724
+ handleDesktopSelect(option);
10725
+ setIsOpen(false);
10726
+ focusTrigger();
10727
+ },
10728
+ onOptionHover: setHighlightedIndex,
10729
+ onKeyDown: (event) => {
10730
+ handleMenuKeyDown(event, () => setIsOpen(false));
10731
+ },
10732
+ disabled: isBlocked,
10733
+ menuClassName,
10734
+ dropdownClassName,
10735
+ listRef: desktopListRef,
10736
+ setOptionRef,
10737
+ getOptionId: getOptionId2,
10738
+ noOptionsMessage
10739
+ }
10740
+ )
10741
+ ]
10742
+ }
10743
+ );
10736
10744
  });
10737
10745
 
10738
10746
  // src/airbnb/phone-field/PhoneField.tsx
@@ -10777,7 +10785,7 @@ var PhoneField = React37.forwardRef(
10777
10785
  const hasInvalidState = Boolean(error) || Boolean(invalid);
10778
10786
  const isBlocked = Boolean(disabled) || Boolean(loading);
10779
10787
  const isCodeBlocked = isBlocked || Boolean(codeReadOnly);
10780
- return /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: cn("w-full max-w-[425px]", className), children: [
10788
+ return /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { className: cn("w-full max-w-[var(--max-field-width)]", className), children: [
10781
10789
  name && /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("input", { type: "hidden", name, value: combinedValue, disabled }),
10782
10790
  codeName && /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
10783
10791
  "input",
@@ -11143,82 +11151,89 @@ var SearchableSelectInternal = ({
11143
11151
  }
11144
11152
  );
11145
11153
  React39.useImperativeHandle(ref, () => triggerRef.current, []);
11146
- return /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { ref: containerRef, className: cn("relative w-full max-w-[425px]", className), children: [
11147
- name && /* @__PURE__ */ (0, import_jsx_runtime134.jsx)("input", { type: "hidden", name, value: value ? String(value.value) : "" }),
11148
- /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
11149
- FieldTrigger,
11150
- {
11151
- id: `${reactId}-trigger`,
11152
- ref: triggerRef,
11153
- variant,
11154
- "aria-haspopup": "listbox",
11155
- "aria-expanded": open,
11156
- "aria-controls": listboxId,
11157
- label,
11158
- topLabel,
11159
- labelId,
11160
- valueId,
11161
- helperTextId,
11162
- errorId: error ? errorId : void 0,
11163
- labelText: topLabel ? helperText : void 0,
11164
- valueText: valueLabel,
11165
- placeholder: helperText,
11166
- describedBy,
11167
- error: triggerError,
11168
- loading,
11169
- optional,
11170
- tooltip,
11171
- forceLabelText: Boolean(optional) || Boolean(tooltip),
11172
- hideErrorMessage,
11173
- disabled,
11174
- onClick: () => {
11175
- if (open) {
11176
- closeSelect();
11177
- return;
11178
- }
11179
- openSelect();
11180
- },
11181
- onKeyDown: handleTriggerKeyDown,
11182
- trailingAdornment: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
11183
- import_lucide_react46.ChevronDown,
11154
+ return /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(
11155
+ "div",
11156
+ {
11157
+ ref: containerRef,
11158
+ className: cn("relative w-full max-w-[var(--max-field-width)]", className),
11159
+ children: [
11160
+ name && /* @__PURE__ */ (0, import_jsx_runtime134.jsx)("input", { type: "hidden", name, value: value ? String(value.value) : "" }),
11161
+ /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
11162
+ FieldTrigger,
11184
11163
  {
11185
- className: cn(
11186
- "h-6 w-6 text-[#1F1F1B] transition-transform",
11187
- open && "rotate-180"
11164
+ id: `${reactId}-trigger`,
11165
+ ref: triggerRef,
11166
+ variant,
11167
+ "aria-haspopup": "listbox",
11168
+ "aria-expanded": open,
11169
+ "aria-controls": listboxId,
11170
+ label,
11171
+ topLabel,
11172
+ labelId,
11173
+ valueId,
11174
+ helperTextId,
11175
+ errorId: error ? errorId : void 0,
11176
+ labelText: topLabel ? helperText : void 0,
11177
+ valueText: valueLabel,
11178
+ placeholder: helperText,
11179
+ describedBy,
11180
+ error: triggerError,
11181
+ loading,
11182
+ optional,
11183
+ tooltip,
11184
+ forceLabelText: Boolean(optional) || Boolean(tooltip),
11185
+ hideErrorMessage,
11186
+ disabled,
11187
+ onClick: () => {
11188
+ if (open) {
11189
+ closeSelect();
11190
+ return;
11191
+ }
11192
+ openSelect();
11193
+ },
11194
+ onKeyDown: handleTriggerKeyDown,
11195
+ trailingAdornment: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
11196
+ import_lucide_react46.ChevronDown,
11197
+ {
11198
+ className: cn(
11199
+ "h-6 w-6 text-[#1F1F1B] transition-transform",
11200
+ open && "rotate-180"
11201
+ )
11202
+ }
11188
11203
  )
11189
11204
  }
11190
- )
11191
- }
11192
- ),
11193
- isMobile ? /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
11194
- Drawer,
11195
- {
11196
- open,
11197
- onOpenChange: (nextOpen) => {
11198
- if (isBlocked && nextOpen) return;
11199
- if (nextOpen) {
11200
- setSelectOpen(true);
11201
- return;
11202
- }
11203
- closeSelect();
11204
- },
11205
- children: /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(DrawerContent, { onClose: closeSelect, lockScroll: false, children: [
11206
- /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(DrawerTitle, { className: "sr-only", children: mobileTitle ?? label }),
11207
- /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(DrawerDescription, { className: "sr-only", children: label }),
11208
- /* @__PURE__ */ (0, import_jsx_runtime134.jsx)("div", { className: "px-5 pb-5 pt-1", children: content })
11209
- ] })
11210
- }
11211
- ) : open ? /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
11212
- "div",
11213
- {
11214
- className: cn(
11215
- "absolute left-0 right-0 top-[calc(100%+8px)] z-20 overflow-hidden rounded-[20px] border border-[#DEDAD2] bg-white shadow-[0_14px_30px_rgba(18,18,18,0.08)]",
11216
- dropdownClassName
11217
11205
  ),
11218
- children: content
11219
- }
11220
- ) : null
11221
- ] });
11206
+ isMobile ? /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
11207
+ Drawer,
11208
+ {
11209
+ open,
11210
+ onOpenChange: (nextOpen) => {
11211
+ if (isBlocked && nextOpen) return;
11212
+ if (nextOpen) {
11213
+ setSelectOpen(true);
11214
+ return;
11215
+ }
11216
+ closeSelect();
11217
+ },
11218
+ children: /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(DrawerContent, { onClose: closeSelect, lockScroll: false, children: [
11219
+ /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(DrawerTitle, { className: "sr-only", children: mobileTitle ?? label }),
11220
+ /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(DrawerDescription, { className: "sr-only", children: label }),
11221
+ /* @__PURE__ */ (0, import_jsx_runtime134.jsx)("div", { className: "px-5 pb-5 pt-1", children: content })
11222
+ ] })
11223
+ }
11224
+ ) : open ? /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
11225
+ "div",
11226
+ {
11227
+ className: cn(
11228
+ "absolute left-0 right-0 top-[calc(100%+8px)] z-20 overflow-hidden rounded-[20px] border border-[#DEDAD2] bg-white shadow-[0_14px_30px_rgba(18,18,18,0.08)]",
11229
+ dropdownClassName
11230
+ ),
11231
+ children: content
11232
+ }
11233
+ ) : null
11234
+ ]
11235
+ }
11236
+ );
11222
11237
  };
11223
11238
  var SearchableSelect = React39.forwardRef(
11224
11239
  SearchableSelectInternal
@@ -11471,6 +11486,7 @@ function getNextEnabledIndex(options, startIndex, step) {
11471
11486
  ErrorMessage,
11472
11487
  ExternalLink,
11473
11488
  FeatureCard,
11489
+ FieldErrorMessage,
11474
11490
  FieldTrigger,
11475
11491
  FileInputButton,
11476
11492
  FormBox,