@butternutbox/pawprint-native 2.1.0 → 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.
@@ -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.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
10
+ ESM dist/index.js 544.81 KB
14
11
  ESM dist/index.js.map 1.12 MB
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
12
+ ESM ⚡️ Build success in 8378ms
13
+ CJS dist/index.cjs 576.54 KB
14
+ CJS dist/index.cjs.map 1.13 MB
15
+ CJS ⚡️ Build success in 8378ms
16
+ DTS ⚡️ Build success in 22238ms
17
+ DTS dist/index.d.cts 114.18 KB
18
+ DTS dist/index.d.ts 114.18 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
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
+
3
26
  ## 2.1.0
4
27
 
5
28
  ### Minor 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
- accessible: true,
6037
- accessibilityRole: "none",
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 }),
@@ -11334,6 +11333,7 @@ var DatePicker = React65__default.default.forwardRef(
11334
11333
  getMonthLabel,
11335
11334
  weekDayLabels = DEFAULT_WEEK_LABELS,
11336
11335
  getDateState,
11336
+ getDateAccessibilityLabel,
11337
11337
  isDateDisabled,
11338
11338
  minDate,
11339
11339
  maxDate
@@ -11354,6 +11354,7 @@ var DatePicker = React65__default.default.forwardRef(
11354
11354
  "getMonthLabel",
11355
11355
  "weekDayLabels",
11356
11356
  "getDateState",
11357
+ "getDateAccessibilityLabel",
11357
11358
  "isDateDisabled",
11358
11359
  "minDate",
11359
11360
  "maxDate"
@@ -11530,6 +11531,7 @@ var DatePicker = React65__default.default.forwardRef(
11530
11531
  token: datePicker.month.typography,
11531
11532
  align: "center",
11532
11533
  color: datePicker.month.colour.text.default,
11534
+ accessibilityRole: "header",
11533
11535
  children: resolvedMonthLabel
11534
11536
  }
11535
11537
  ) }),
@@ -11551,82 +11553,79 @@ var DatePicker = React65__default.default.forwardRef(
11551
11553
  {
11552
11554
  entering: MONTH_SLIDE_ENTERING[slideDir],
11553
11555
  exiting: MONTH_SLIDE_EXITING[slideDir],
11554
- children: /* @__PURE__ */ jsxRuntime.jsx(
11555
- StyledDatesGrid,
11556
- {
11557
- rowGap,
11558
- accessible: true,
11559
- accessibilityLabel: resolvedMonthLabel,
11560
- children: calendarRows.map((row, rowIdx) => /* @__PURE__ */ jsxRuntime.jsx(StyledDateRow, { children: row.map(
11561
- (date, colIdx) => !date ? /* @__PURE__ */ jsxRuntime.jsx(
11562
- StyledDateCell,
11563
- {
11564
- cellHeight,
11565
- accessibilityElementsHidden: true
11566
- },
11567
- `empty-${rowIdx}-${colIdx}`
11568
- ) : /* @__PURE__ */ jsxRuntime.jsx(
11569
- StyledDateCell,
11570
- {
11571
- cellHeight,
11572
- children: (() => {
11573
- const isDisabled = resolvedIsDateDisabled(date);
11574
- const {
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,
11575
11593
  state,
11576
- indicatorBg,
11577
- indicatorBorderColor,
11578
- textColor,
11579
- typography,
11580
- textDecoration,
11581
- isSelected
11582
- } = resolveDateCellConfig(date);
11583
- const isUndeliverable = isDisabled && state === "default";
11584
- const cellOpacity = isDisabled && !isUndeliverable ? disabledOpacity : 1;
11585
- const cellTextDecoration = isUndeliverable ? "line-through" : textDecoration;
11586
- const cellTextColor = isUndeliverable ? dt.colour.text.previous : textColor;
11587
- return /* @__PURE__ */ jsxRuntime.jsx(
11588
- 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,
11589
11604
  {
11590
- onPress: !isDisabled ? () => onDateSelect == null ? void 0 : onDateSelect(date) : void 0,
11591
- disabled: isDisabled,
11592
- accessible: true,
11593
- accessibilityRole: "button",
11594
- accessibilityLabel: `${date.getDate()} ${resolvedMonthLabel}`,
11595
- accessibilityState: {
11596
- selected: isSelected,
11597
- disabled: isDisabled
11598
- },
11599
- accessibilityHint: state === "current" ? "Today" : void 0,
11600
- style: { opacity: cellOpacity },
11605
+ indicatorSize,
11606
+ indicatorBorderRadius,
11607
+ indicatorBg,
11608
+ indicatorBorderWidth: indicatorBorderColor !== "transparent" ? selectedBorderWidth : 0,
11609
+ indicatorBorderColor,
11610
+ indicatorBorderStyle: indicatorBorderColor !== "transparent" ? "dashed" : "solid",
11601
11611
  children: /* @__PURE__ */ jsxRuntime.jsx(
11602
- StyledIndicator3,
11612
+ Typography,
11603
11613
  {
11604
- indicatorSize,
11605
- indicatorBorderRadius,
11606
- indicatorBg,
11607
- indicatorBorderWidth: indicatorBorderColor !== "transparent" ? selectedBorderWidth : 0,
11608
- indicatorBorderColor,
11609
- indicatorBorderStyle: indicatorBorderColor !== "transparent" ? "dashed" : "solid",
11610
- children: /* @__PURE__ */ jsxRuntime.jsx(
11611
- Typography,
11612
- {
11613
- color: cellTextColor,
11614
- token: typography,
11615
- textDecoration: cellTextDecoration,
11616
- children: date.getDate().toString()
11617
- }
11618
- )
11614
+ color: cellTextColor,
11615
+ token: typography,
11616
+ textDecoration: cellTextDecoration,
11617
+ children: date.getDate().toString()
11619
11618
  }
11620
11619
  )
11621
11620
  }
11622
- );
11623
- })()
11624
- },
11625
- toDateKey(date)
11626
- )
11627
- ) }, rowIdx))
11628
- }
11629
- )
11621
+ )
11622
+ }
11623
+ );
11624
+ })()
11625
+ },
11626
+ toDateKey(date)
11627
+ )
11628
+ ) }, rowIdx)) })
11630
11629
  },
11631
11630
  `${year}-${month}`
11632
11631
  )