@butternutbox/pawprint-native 2.0.0 → 2.1.0

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.d.cts CHANGED
@@ -1602,6 +1602,7 @@ type SelectFieldOwnProps = {
1602
1602
  optionalText?: string;
1603
1603
  placeholder?: string;
1604
1604
  leadingIcon?: React__default.ReactNode;
1605
+ searchable?: boolean;
1605
1606
  noResultsText?: string;
1606
1607
  errorText?: string;
1607
1608
  onSearchQuery?: SelectOptionsResolver;
package/dist/index.d.ts CHANGED
@@ -1602,6 +1602,7 @@ type SelectFieldOwnProps = {
1602
1602
  optionalText?: string;
1603
1603
  placeholder?: string;
1604
1604
  leadingIcon?: React__default.ReactNode;
1605
+ searchable?: boolean;
1605
1606
  noResultsText?: string;
1606
1607
  errorText?: string;
1607
1608
  onSearchQuery?: SelectOptionsResolver;
package/dist/index.js CHANGED
@@ -9032,6 +9032,7 @@ var SelectField = React65.forwardRef(
9032
9032
  optionalText,
9033
9033
  placeholder,
9034
9034
  leadingIcon,
9035
+ searchable = true,
9035
9036
  noResultsText = "No results found",
9036
9037
  errorText = "Something went wrong",
9037
9038
  onSearchQuery,
@@ -9052,6 +9053,7 @@ var SelectField = React65.forwardRef(
9052
9053
  "optionalText",
9053
9054
  "placeholder",
9054
9055
  "leadingIcon",
9056
+ "searchable",
9055
9057
  "noResultsText",
9056
9058
  "errorText",
9057
9059
  "onSearchQuery",
@@ -9187,7 +9189,7 @@ var SelectField = React65.forwardRef(
9187
9189
  setInputText("");
9188
9190
  setFilterQuery("");
9189
9191
  commitValue(null);
9190
- (_a2 = inputRef.current) == null ? void 0 : _a2.focus();
9192
+ if (searchable) (_a2 = inputRef.current) == null ? void 0 : _a2.focus();
9191
9193
  };
9192
9194
  const fieldState = error ? "error" : state;
9193
9195
  const isOpen = isFocused && !disabled;
@@ -9209,28 +9211,39 @@ var SelectField = React65.forwardRef(
9209
9211
  );
9210
9212
  const dropdown = React65.useMemo(() => {
9211
9213
  if (!isOpen || !anchorRect) return null;
9212
- return /* @__PURE__ */ jsx(
9213
- SelectFieldDropdown,
9214
- {
9215
- anchor: anchorRect,
9216
- placement: placement.direction,
9217
- maxHeight: placement.maxHeight,
9218
- screenHeight: windowHeight,
9219
- accessibilityLiveRegion: "polite",
9220
- children: /* @__PURE__ */ jsx(
9221
- SelectFieldList,
9222
- {
9223
- state: optionsState,
9224
- selectedValue,
9225
- onSelect: onOptionPress,
9226
- noResultsText,
9227
- errorText,
9228
- searchHintText
9229
- }
9230
- )
9231
- }
9232
- );
9214
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
9215
+ !searchable && /* @__PURE__ */ jsx(
9216
+ Pressable,
9217
+ {
9218
+ style: StyleSheet.absoluteFill,
9219
+ onPress: () => setIsFocused(false),
9220
+ accessible: false
9221
+ }
9222
+ ),
9223
+ /* @__PURE__ */ jsx(
9224
+ SelectFieldDropdown,
9225
+ {
9226
+ anchor: anchorRect,
9227
+ placement: placement.direction,
9228
+ maxHeight: placement.maxHeight,
9229
+ screenHeight: windowHeight,
9230
+ accessibilityLiveRegion: "polite",
9231
+ children: /* @__PURE__ */ jsx(
9232
+ SelectFieldList,
9233
+ {
9234
+ state: optionsState,
9235
+ selectedValue,
9236
+ onSelect: onOptionPress,
9237
+ noResultsText,
9238
+ errorText,
9239
+ searchHintText
9240
+ }
9241
+ )
9242
+ }
9243
+ )
9244
+ ] });
9233
9245
  }, [
9246
+ searchable,
9234
9247
  isOpen,
9235
9248
  anchorRect,
9236
9249
  placement,
@@ -9249,11 +9262,12 @@ var SelectField = React65.forwardRef(
9249
9262
  {
9250
9263
  ref: inputRef,
9251
9264
  value: inputText,
9252
- onChangeText: handleChangeText,
9253
- onFocus: handleFocus,
9254
- onBlur: handleBlur,
9265
+ onChangeText: searchable ? handleChangeText : void 0,
9266
+ onFocus: searchable ? handleFocus : void 0,
9267
+ onBlur: searchable ? handleBlur : void 0,
9268
+ onPress: !searchable && !disabled ? () => setIsFocused(true) : void 0,
9255
9269
  placeholder,
9256
- editable: !disabled,
9270
+ editable: searchable && !disabled,
9257
9271
  state: fieldState,
9258
9272
  hideStateIcons: Boolean(clearAction),
9259
9273
  leadingIcon,