@butternutbox/pawprint-native 2.0.1 → 2.2.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 +32 -0
- package/dist/index.cjs +111 -98
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +111 -98
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
- package/src/components/molecules/DatePicker/DatePicker.tsx +17 -6
- package/src/components/molecules/Drawer/DrawerContent.tsx +1 -2
- 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
|
-
[
|
|
11
|
-
[32mCJS[39m [1mdist/index.cjs.map [22m[32m1.12 MB[39m
|
|
12
|
-
[32mCJS[39m ⚡️ Build success in 5883ms
|
|
13
|
-
[32mESM[39m [1mdist/index.js [22m[32m544.36 KB[39m
|
|
10
|
+
[32mESM[39m [1mdist/index.js [22m[32m544.81 KB[39m
|
|
14
11
|
[32mESM[39m [1mdist/index.js.map [22m[32m1.12 MB[39m
|
|
15
|
-
[32mESM[39m ⚡️ Build success in
|
|
16
|
-
[
|
|
17
|
-
[
|
|
18
|
-
[
|
|
12
|
+
[32mESM[39m ⚡️ Build success in 8378ms
|
|
13
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m576.54 KB[39m
|
|
14
|
+
[32mCJS[39m [1mdist/index.cjs.map [22m[32m1.13 MB[39m
|
|
15
|
+
[32mCJS[39m ⚡️ Build success in 8378ms
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 22238ms
|
|
17
|
+
[32mDTS[39m [1mdist/index.d.cts [22m[32m114.18 KB[39m
|
|
18
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m114.18 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# @butternutbox/pawprint-native
|
|
2
2
|
|
|
3
|
+
## 2.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 55577eb: Make `DatePicker` days reachable with VoiceOver. The dates grid was a single
|
|
8
|
+
accessible element, so iOS only announced the month name and none of the day
|
|
9
|
+
buttons could be focused or selected. The grid is no longer grouped, and the
|
|
10
|
+
month label is now a header so screen-reader users can still jump between
|
|
11
|
+
months.
|
|
12
|
+
|
|
13
|
+
Add `getDateAccessibilityLabel(date, state, monthLabel)` so consumers can
|
|
14
|
+
announce delivery states such as the next box or future boxes. It defaults to
|
|
15
|
+
the existing "{day} {monthLabel}" label.
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- 7d7caa7: Make `Drawer` usable with VoiceOver. The panel was a single accessible
|
|
20
|
+
element, so iOS hid everything inside it, including the close button and any
|
|
21
|
+
footer actions, and a drawer couldn't be closed or acted on. The panel is no
|
|
22
|
+
longer grouped, so its contents are reachable, and it stays modal to keep
|
|
23
|
+
focus inside. The VoiceOver escape gesture (two-finger scrub) now closes the
|
|
24
|
+
drawer, as Android back already does.
|
|
25
|
+
|
|
26
|
+
## 2.1.0
|
|
27
|
+
|
|
28
|
+
### Minor Changes
|
|
29
|
+
|
|
30
|
+
- 2504fe2: Add `searchable` to `SelectField`, matching `SelectDrawerField`. It defaults to
|
|
31
|
+
`true`, so existing fields still filter as you type. With `searchable={false}`
|
|
32
|
+
the field can't be typed into: pressing it opens the full list, and tapping
|
|
33
|
+
outside the list closes it.
|
|
34
|
+
|
|
3
35
|
## 2.0.1
|
|
4
36
|
|
|
5
37
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -6033,9 +6033,8 @@ var DrawerContent = React65__default.default.forwardRef(
|
|
|
6033
6033
|
panelShadowColor: modal.shadow.color,
|
|
6034
6034
|
panelShadowOffsetY: parseTokenValue23(modal.shadow.offsetY),
|
|
6035
6035
|
panelShadowBlur: parseTokenValue23(modal.shadow.blur),
|
|
6036
|
-
|
|
6037
|
-
|
|
6038
|
-
accessibilityViewIsModal: true
|
|
6036
|
+
accessibilityViewIsModal: true,
|
|
6037
|
+
onAccessibilityEscape: closeDrawer
|
|
6039
6038
|
}, props), {
|
|
6040
6039
|
children: [
|
|
6041
6040
|
/* @__PURE__ */ jsxRuntime.jsx(DrawerBodyMaxContext.Provider, { value: bodyMax, children }),
|
|
@@ -9062,6 +9061,7 @@ var SelectField = React65__default.default.forwardRef(
|
|
|
9062
9061
|
optionalText,
|
|
9063
9062
|
placeholder,
|
|
9064
9063
|
leadingIcon,
|
|
9064
|
+
searchable = true,
|
|
9065
9065
|
noResultsText = "No results found",
|
|
9066
9066
|
errorText = "Something went wrong",
|
|
9067
9067
|
onSearchQuery,
|
|
@@ -9082,6 +9082,7 @@ var SelectField = React65__default.default.forwardRef(
|
|
|
9082
9082
|
"optionalText",
|
|
9083
9083
|
"placeholder",
|
|
9084
9084
|
"leadingIcon",
|
|
9085
|
+
"searchable",
|
|
9085
9086
|
"noResultsText",
|
|
9086
9087
|
"errorText",
|
|
9087
9088
|
"onSearchQuery",
|
|
@@ -9217,7 +9218,7 @@ var SelectField = React65__default.default.forwardRef(
|
|
|
9217
9218
|
setInputText("");
|
|
9218
9219
|
setFilterQuery("");
|
|
9219
9220
|
commitValue(null);
|
|
9220
|
-
(_a2 = inputRef.current) == null ? void 0 : _a2.focus();
|
|
9221
|
+
if (searchable) (_a2 = inputRef.current) == null ? void 0 : _a2.focus();
|
|
9221
9222
|
};
|
|
9222
9223
|
const fieldState = error ? "error" : state;
|
|
9223
9224
|
const isOpen = isFocused && !disabled;
|
|
@@ -9239,28 +9240,39 @@ var SelectField = React65__default.default.forwardRef(
|
|
|
9239
9240
|
);
|
|
9240
9241
|
const dropdown = React65__default.default.useMemo(() => {
|
|
9241
9242
|
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
|
-
|
|
9243
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
9244
|
+
!searchable && /* @__PURE__ */ jsxRuntime.jsx(
|
|
9245
|
+
reactNative.Pressable,
|
|
9246
|
+
{
|
|
9247
|
+
style: reactNative.StyleSheet.absoluteFill,
|
|
9248
|
+
onPress: () => setIsFocused(false),
|
|
9249
|
+
accessible: false
|
|
9250
|
+
}
|
|
9251
|
+
),
|
|
9252
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9253
|
+
SelectFieldDropdown,
|
|
9254
|
+
{
|
|
9255
|
+
anchor: anchorRect,
|
|
9256
|
+
placement: placement.direction,
|
|
9257
|
+
maxHeight: placement.maxHeight,
|
|
9258
|
+
screenHeight: windowHeight,
|
|
9259
|
+
accessibilityLiveRegion: "polite",
|
|
9260
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9261
|
+
SelectFieldList,
|
|
9262
|
+
{
|
|
9263
|
+
state: optionsState,
|
|
9264
|
+
selectedValue,
|
|
9265
|
+
onSelect: onOptionPress,
|
|
9266
|
+
noResultsText,
|
|
9267
|
+
errorText,
|
|
9268
|
+
searchHintText
|
|
9269
|
+
}
|
|
9270
|
+
)
|
|
9271
|
+
}
|
|
9272
|
+
)
|
|
9273
|
+
] });
|
|
9263
9274
|
}, [
|
|
9275
|
+
searchable,
|
|
9264
9276
|
isOpen,
|
|
9265
9277
|
anchorRect,
|
|
9266
9278
|
placement,
|
|
@@ -9279,11 +9291,12 @@ var SelectField = React65__default.default.forwardRef(
|
|
|
9279
9291
|
{
|
|
9280
9292
|
ref: inputRef,
|
|
9281
9293
|
value: inputText,
|
|
9282
|
-
onChangeText: handleChangeText,
|
|
9283
|
-
onFocus: handleFocus,
|
|
9284
|
-
onBlur: handleBlur,
|
|
9294
|
+
onChangeText: searchable ? handleChangeText : void 0,
|
|
9295
|
+
onFocus: searchable ? handleFocus : void 0,
|
|
9296
|
+
onBlur: searchable ? handleBlur : void 0,
|
|
9297
|
+
onPress: !searchable && !disabled ? () => setIsFocused(true) : void 0,
|
|
9285
9298
|
placeholder,
|
|
9286
|
-
editable: !disabled,
|
|
9299
|
+
editable: searchable && !disabled,
|
|
9287
9300
|
state: fieldState,
|
|
9288
9301
|
hideStateIcons: Boolean(clearAction),
|
|
9289
9302
|
leadingIcon,
|
|
@@ -11320,6 +11333,7 @@ var DatePicker = React65__default.default.forwardRef(
|
|
|
11320
11333
|
getMonthLabel,
|
|
11321
11334
|
weekDayLabels = DEFAULT_WEEK_LABELS,
|
|
11322
11335
|
getDateState,
|
|
11336
|
+
getDateAccessibilityLabel,
|
|
11323
11337
|
isDateDisabled,
|
|
11324
11338
|
minDate,
|
|
11325
11339
|
maxDate
|
|
@@ -11340,6 +11354,7 @@ var DatePicker = React65__default.default.forwardRef(
|
|
|
11340
11354
|
"getMonthLabel",
|
|
11341
11355
|
"weekDayLabels",
|
|
11342
11356
|
"getDateState",
|
|
11357
|
+
"getDateAccessibilityLabel",
|
|
11343
11358
|
"isDateDisabled",
|
|
11344
11359
|
"minDate",
|
|
11345
11360
|
"maxDate"
|
|
@@ -11516,6 +11531,7 @@ var DatePicker = React65__default.default.forwardRef(
|
|
|
11516
11531
|
token: datePicker.month.typography,
|
|
11517
11532
|
align: "center",
|
|
11518
11533
|
color: datePicker.month.colour.text.default,
|
|
11534
|
+
accessibilityRole: "header",
|
|
11519
11535
|
children: resolvedMonthLabel
|
|
11520
11536
|
}
|
|
11521
11537
|
) }),
|
|
@@ -11537,82 +11553,79 @@ var DatePicker = React65__default.default.forwardRef(
|
|
|
11537
11553
|
{
|
|
11538
11554
|
entering: MONTH_SLIDE_ENTERING[slideDir],
|
|
11539
11555
|
exiting: MONTH_SLIDE_EXITING[slideDir],
|
|
11540
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11541
|
-
|
|
11542
|
-
|
|
11543
|
-
|
|
11544
|
-
|
|
11545
|
-
|
|
11546
|
-
|
|
11547
|
-
|
|
11548
|
-
|
|
11549
|
-
|
|
11550
|
-
|
|
11551
|
-
|
|
11552
|
-
|
|
11553
|
-
|
|
11554
|
-
|
|
11555
|
-
|
|
11556
|
-
|
|
11557
|
-
|
|
11558
|
-
|
|
11559
|
-
|
|
11560
|
-
|
|
11556
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(StyledDatesGrid, { rowGap, children: calendarRows.map((row, rowIdx) => /* @__PURE__ */ jsxRuntime.jsx(StyledDateRow, { children: row.map(
|
|
11557
|
+
(date, colIdx) => !date ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
11558
|
+
StyledDateCell,
|
|
11559
|
+
{
|
|
11560
|
+
cellHeight,
|
|
11561
|
+
accessibilityElementsHidden: true
|
|
11562
|
+
},
|
|
11563
|
+
`empty-${rowIdx}-${colIdx}`
|
|
11564
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
11565
|
+
StyledDateCell,
|
|
11566
|
+
{
|
|
11567
|
+
cellHeight,
|
|
11568
|
+
children: (() => {
|
|
11569
|
+
var _a3;
|
|
11570
|
+
const isDisabled = resolvedIsDateDisabled(date);
|
|
11571
|
+
const {
|
|
11572
|
+
state,
|
|
11573
|
+
indicatorBg,
|
|
11574
|
+
indicatorBorderColor,
|
|
11575
|
+
textColor,
|
|
11576
|
+
typography,
|
|
11577
|
+
textDecoration,
|
|
11578
|
+
isSelected
|
|
11579
|
+
} = resolveDateCellConfig(date);
|
|
11580
|
+
const isUndeliverable = isDisabled && state === "default";
|
|
11581
|
+
const cellOpacity = isDisabled && !isUndeliverable ? disabledOpacity : 1;
|
|
11582
|
+
const cellTextDecoration = isUndeliverable ? "line-through" : textDecoration;
|
|
11583
|
+
const cellTextColor = isUndeliverable ? dt.colour.text.previous : textColor;
|
|
11584
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11585
|
+
reactNative.Pressable,
|
|
11586
|
+
{
|
|
11587
|
+
onPress: !isDisabled ? () => onDateSelect == null ? void 0 : onDateSelect(date) : void 0,
|
|
11588
|
+
disabled: isDisabled,
|
|
11589
|
+
accessible: true,
|
|
11590
|
+
accessibilityRole: "button",
|
|
11591
|
+
accessibilityLabel: (_a3 = getDateAccessibilityLabel == null ? void 0 : getDateAccessibilityLabel(
|
|
11592
|
+
date,
|
|
11561
11593
|
state,
|
|
11562
|
-
|
|
11563
|
-
|
|
11564
|
-
|
|
11565
|
-
|
|
11566
|
-
|
|
11567
|
-
|
|
11568
|
-
|
|
11569
|
-
|
|
11570
|
-
|
|
11571
|
-
|
|
11572
|
-
const cellTextColor = isUndeliverable ? dt.colour.text.previous : textColor;
|
|
11573
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11574
|
-
reactNative.Pressable,
|
|
11594
|
+
resolvedMonthLabel
|
|
11595
|
+
)) != null ? _a3 : `${date.getDate()} ${resolvedMonthLabel}`,
|
|
11596
|
+
accessibilityState: {
|
|
11597
|
+
selected: isSelected,
|
|
11598
|
+
disabled: isDisabled
|
|
11599
|
+
},
|
|
11600
|
+
accessibilityHint: state === "current" ? "Today" : void 0,
|
|
11601
|
+
style: { opacity: cellOpacity },
|
|
11602
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11603
|
+
StyledIndicator3,
|
|
11575
11604
|
{
|
|
11576
|
-
|
|
11577
|
-
|
|
11578
|
-
|
|
11579
|
-
|
|
11580
|
-
|
|
11581
|
-
|
|
11582
|
-
selected: isSelected,
|
|
11583
|
-
disabled: isDisabled
|
|
11584
|
-
},
|
|
11585
|
-
accessibilityHint: state === "current" ? "Today" : void 0,
|
|
11586
|
-
style: { opacity: cellOpacity },
|
|
11605
|
+
indicatorSize,
|
|
11606
|
+
indicatorBorderRadius,
|
|
11607
|
+
indicatorBg,
|
|
11608
|
+
indicatorBorderWidth: indicatorBorderColor !== "transparent" ? selectedBorderWidth : 0,
|
|
11609
|
+
indicatorBorderColor,
|
|
11610
|
+
indicatorBorderStyle: indicatorBorderColor !== "transparent" ? "dashed" : "solid",
|
|
11587
11611
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11588
|
-
|
|
11612
|
+
Typography,
|
|
11589
11613
|
{
|
|
11590
|
-
|
|
11591
|
-
|
|
11592
|
-
|
|
11593
|
-
|
|
11594
|
-
indicatorBorderColor,
|
|
11595
|
-
indicatorBorderStyle: indicatorBorderColor !== "transparent" ? "dashed" : "solid",
|
|
11596
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11597
|
-
Typography,
|
|
11598
|
-
{
|
|
11599
|
-
color: cellTextColor,
|
|
11600
|
-
token: typography,
|
|
11601
|
-
textDecoration: cellTextDecoration,
|
|
11602
|
-
children: date.getDate().toString()
|
|
11603
|
-
}
|
|
11604
|
-
)
|
|
11614
|
+
color: cellTextColor,
|
|
11615
|
+
token: typography,
|
|
11616
|
+
textDecoration: cellTextDecoration,
|
|
11617
|
+
children: date.getDate().toString()
|
|
11605
11618
|
}
|
|
11606
11619
|
)
|
|
11607
11620
|
}
|
|
11608
|
-
)
|
|
11609
|
-
}
|
|
11610
|
-
|
|
11611
|
-
|
|
11612
|
-
|
|
11613
|
-
)
|
|
11614
|
-
|
|
11615
|
-
)
|
|
11621
|
+
)
|
|
11622
|
+
}
|
|
11623
|
+
);
|
|
11624
|
+
})()
|
|
11625
|
+
},
|
|
11626
|
+
toDateKey(date)
|
|
11627
|
+
)
|
|
11628
|
+
) }, rowIdx)) })
|
|
11616
11629
|
},
|
|
11617
11630
|
`${year}-${month}`
|
|
11618
11631
|
)
|