@butternutbox/pawprint-native 2.0.1 → 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.
@@ -7,12 +7,12 @@
7
7
  CJS Build start
8
8
  ESM Build start
9
9
  DTS Build start
10
- CJS dist/index.cjs 576.02 KB
11
- CJS dist/index.cjs.map 1.12 MB
12
- CJS ⚡️ Build success in 5883ms
13
- ESM dist/index.js 544.36 KB
10
+ CJS dist/index.cjs 576.63 KB
11
+ CJS dist/index.cjs.map 1.13 MB
12
+ CJS ⚡️ Build success in 7532ms
13
+ ESM dist/index.js 544.91 KB
14
14
  ESM dist/index.js.map 1.12 MB
15
- ESM ⚡️ Build success in 5884ms
16
- DTS ⚡️ Build success in 16031ms
17
- DTS dist/index.d.cts 113.84 KB
18
- DTS dist/index.d.ts 113.84 KB
15
+ ESM ⚡️ Build success in 7532ms
16
+ DTS ⚡️ Build success in 20401ms
17
+ DTS dist/index.d.cts 113.87 KB
18
+ DTS dist/index.d.ts 113.87 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @butternutbox/pawprint-native
2
2
 
3
+ ## 2.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 2504fe2: Add `searchable` to `SelectField`, matching `SelectDrawerField`. It defaults to
8
+ `true`, so existing fields still filter as you type. With `searchable={false}`
9
+ the field can't be typed into: pressing it opens the full list, and tapping
10
+ outside the list closes it.
11
+
3
12
  ## 2.0.1
4
13
 
5
14
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -9062,6 +9062,7 @@ var SelectField = React65__default.default.forwardRef(
9062
9062
  optionalText,
9063
9063
  placeholder,
9064
9064
  leadingIcon,
9065
+ searchable = true,
9065
9066
  noResultsText = "No results found",
9066
9067
  errorText = "Something went wrong",
9067
9068
  onSearchQuery,
@@ -9082,6 +9083,7 @@ var SelectField = React65__default.default.forwardRef(
9082
9083
  "optionalText",
9083
9084
  "placeholder",
9084
9085
  "leadingIcon",
9086
+ "searchable",
9085
9087
  "noResultsText",
9086
9088
  "errorText",
9087
9089
  "onSearchQuery",
@@ -9217,7 +9219,7 @@ var SelectField = React65__default.default.forwardRef(
9217
9219
  setInputText("");
9218
9220
  setFilterQuery("");
9219
9221
  commitValue(null);
9220
- (_a2 = inputRef.current) == null ? void 0 : _a2.focus();
9222
+ if (searchable) (_a2 = inputRef.current) == null ? void 0 : _a2.focus();
9221
9223
  };
9222
9224
  const fieldState = error ? "error" : state;
9223
9225
  const isOpen = isFocused && !disabled;
@@ -9239,28 +9241,39 @@ var SelectField = React65__default.default.forwardRef(
9239
9241
  );
9240
9242
  const dropdown = React65__default.default.useMemo(() => {
9241
9243
  if (!isOpen || !anchorRect) return null;
9242
- return /* @__PURE__ */ jsxRuntime.jsx(
9243
- SelectFieldDropdown,
9244
- {
9245
- anchor: anchorRect,
9246
- placement: placement.direction,
9247
- maxHeight: placement.maxHeight,
9248
- screenHeight: windowHeight,
9249
- accessibilityLiveRegion: "polite",
9250
- children: /* @__PURE__ */ jsxRuntime.jsx(
9251
- SelectFieldList,
9252
- {
9253
- state: optionsState,
9254
- selectedValue,
9255
- onSelect: onOptionPress,
9256
- noResultsText,
9257
- errorText,
9258
- searchHintText
9259
- }
9260
- )
9261
- }
9262
- );
9244
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
9245
+ !searchable && /* @__PURE__ */ jsxRuntime.jsx(
9246
+ reactNative.Pressable,
9247
+ {
9248
+ style: reactNative.StyleSheet.absoluteFill,
9249
+ onPress: () => setIsFocused(false),
9250
+ accessible: false
9251
+ }
9252
+ ),
9253
+ /* @__PURE__ */ jsxRuntime.jsx(
9254
+ SelectFieldDropdown,
9255
+ {
9256
+ anchor: anchorRect,
9257
+ placement: placement.direction,
9258
+ maxHeight: placement.maxHeight,
9259
+ screenHeight: windowHeight,
9260
+ accessibilityLiveRegion: "polite",
9261
+ children: /* @__PURE__ */ jsxRuntime.jsx(
9262
+ SelectFieldList,
9263
+ {
9264
+ state: optionsState,
9265
+ selectedValue,
9266
+ onSelect: onOptionPress,
9267
+ noResultsText,
9268
+ errorText,
9269
+ searchHintText
9270
+ }
9271
+ )
9272
+ }
9273
+ )
9274
+ ] });
9263
9275
  }, [
9276
+ searchable,
9264
9277
  isOpen,
9265
9278
  anchorRect,
9266
9279
  placement,
@@ -9279,11 +9292,12 @@ var SelectField = React65__default.default.forwardRef(
9279
9292
  {
9280
9293
  ref: inputRef,
9281
9294
  value: inputText,
9282
- onChangeText: handleChangeText,
9283
- onFocus: handleFocus,
9284
- onBlur: handleBlur,
9295
+ onChangeText: searchable ? handleChangeText : void 0,
9296
+ onFocus: searchable ? handleFocus : void 0,
9297
+ onBlur: searchable ? handleBlur : void 0,
9298
+ onPress: !searchable && !disabled ? () => setIsFocused(true) : void 0,
9285
9299
  placeholder,
9286
- editable: !disabled,
9300
+ editable: searchable && !disabled,
9287
9301
  state: fieldState,
9288
9302
  hideStateIcons: Boolean(clearAction),
9289
9303
  leadingIcon,