@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/.turbo/turbo-build.log +8 -8
- package/CHANGELOG.md +18 -0
- package/dist/index.cjs +40 -26
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +40 -26
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
- package/src/components/molecules/SelectField/SelectField.stories.tsx +13 -0
- package/src/components/molecules/SelectField/SelectField.test.tsx +41 -0
- package/src/components/molecules/SelectField/SelectField.tsx +37 -21
package/.turbo/turbo-build.log
CHANGED
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
[34mCJS[39m Build start
|
|
8
8
|
[34mESM[39m Build start
|
|
9
9
|
[34mDTS[39m Build start
|
|
10
|
-
[32mCJS[39m [1mdist/index.cjs [22m[32m576.
|
|
11
|
-
[32mCJS[39m [1mdist/index.cjs.map [22m[32m1.
|
|
12
|
-
[32mCJS[39m ⚡️ Build success in
|
|
13
|
-
[32mESM[39m [1mdist/index.js [22m[32m544.
|
|
10
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m576.63 KB[39m
|
|
11
|
+
[32mCJS[39m [1mdist/index.cjs.map [22m[32m1.13 MB[39m
|
|
12
|
+
[32mCJS[39m ⚡️ Build success in 7532ms
|
|
13
|
+
[32mESM[39m [1mdist/index.js [22m[32m544.91 KB[39m
|
|
14
14
|
[32mESM[39m [1mdist/index.js.map [22m[32m1.12 MB[39m
|
|
15
|
-
[32mESM[39m ⚡️ Build success in
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
17
|
-
[32mDTS[39m [1mdist/index.d.cts [22m[32m113.
|
|
18
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[32m113.
|
|
15
|
+
[32mESM[39m ⚡️ Build success in 7532ms
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 20401ms
|
|
17
|
+
[32mDTS[39m [1mdist/index.d.cts [22m[32m113.87 KB[39m
|
|
18
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m113.87 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
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
|
+
|
|
12
|
+
## 2.0.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- 93d8c4f: Patch release of all packages to verify npm Trusted Publishing (OIDC) end to end.
|
|
17
|
+
- Updated dependencies [93d8c4f]
|
|
18
|
+
- @butternutbox/pawprint-fonts@2.0.2
|
|
19
|
+
- @butternutbox/pawprint-tokens@0.6.1
|
|
20
|
+
|
|
3
21
|
## 2.0.0
|
|
4
22
|
|
|
5
23
|
### Major 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.
|
|
9243
|
-
|
|
9244
|
-
|
|
9245
|
-
|
|
9246
|
-
|
|
9247
|
-
|
|
9248
|
-
|
|
9249
|
-
|
|
9250
|
-
|
|
9251
|
-
|
|
9252
|
-
|
|
9253
|
-
|
|
9254
|
-
|
|
9255
|
-
|
|
9256
|
-
|
|
9257
|
-
|
|
9258
|
-
|
|
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,
|