@marktiderman/genesis-ui-native 3.4.0 → 3.5.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/README.md CHANGED
@@ -82,6 +82,30 @@ A route whose only screen is a full-screen `NativeLoadingState` (a redirect or l
82
82
  optionally with `Stack.Screen` options) counts as a screen for `native-screen-layout`; one that
83
83
  also renders other content, imports it, or uses `fullScreen={false}` still needs a layout.
84
84
 
85
+ ## Pull to refresh: `ScreenContainer onRefresh`
86
+
87
+ A screen that isn't a list (a dashboard, a profile) gets pull to refresh from its container, as
88
+ `InboxPage` and `NotificationsPage` have it. `onRefresh` puts a theme-tinted `NativeRefreshControl`
89
+ on the body; `refreshing` shows the spinner. Pulling needs a scroll view, so `onRefresh` makes the
90
+ body scroll (as `scroll` does). Without `onRefresh` nothing changes.
91
+
92
+ ```tsx
93
+ import { ScreenContainer } from "@marktiderman/genesis-ui-native";
94
+
95
+ <ScreenContainer onRefresh={() => refetch()} refreshing={isRefetching}>{body}</ScreenContainer>;
96
+ ```
97
+
98
+ Never use it around a list (`FlatList`, `SectionList`, `NativeResourceView`, `InboxPage`): a list
99
+ inside a ScrollView stops virtualizing and React Native warns. Those lists have their own pull to
100
+ refresh (`refreshControl`, or built in).
101
+
102
+ ## Lists as cards: `NativeResourceView mode="grid"` and `renderCard`
103
+
104
+ `NativeResourceView` draws a view as cards with `mode="grid"` (`numColumns`, default 2), and an
105
+ app's own row or card with `renderCard(row, index, card)`; spread `card.pressableProps` on its
106
+ Pressable for the built-in press, long press and accessibility. Sections, paging, refresh, the
107
+ empty state and swipe actions stay. See docs/RESOURCE-VIEW.md, "Cards and custom rows".
108
+
85
109
  ## Keyboard toolbar
86
110
 
87
111
  `KeyboardScrollProvider` (from `/layouts`) takes an optional `toolbar`: react-native-keyboard-controller's
@@ -1,4 +1,4 @@
1
- import { composeHeaderOptions, ScreenContainer, NavBarSaveButton } from './chunk-ZHVQTMNV.js';
1
+ import { composeHeaderOptions, ScreenContainer, NavBarSaveButton } from './chunk-ONH2PCGH.js';
2
2
  import { NativeText, NativeListItem, NativeButton, useGenesisModules, NativeSectionListHeader, NativeEmptyState, NativeInput } from './chunk-6KWEAGRD.js';
3
3
  import { useThemeRoles, useThemeMode } from './chunk-Z3AQYVUA.js';
4
4
  import { cn } from './chunk-OHZD7KRO.js';
@@ -1119,5 +1119,5 @@ function googleProvider({ onPress, label = "Continue with Google", icon, disable
1119
1119
  }
1120
1120
 
1121
1121
  export { AppleSignInButton, AuthBranding, AuthForm, AuthScreen, ForgotPasswordLink, KEYBOARD_TOOLBAR_HEIGHT, KeyboardScrollProvider, NotificationsPage, SettingsPage, SettingsSubPage, SocialAuthRow, ThreadPage, appleProvider, confirmDiscardChanges, defaultStickyHeaderOffset, getNotificationsPageStackOptions, getSettingsPageStackOptions, getSettingsSubPageStackOptions, getThreadPageStackOptions, googleProvider, iosCompactNavigationBarHeight, readReceiptFor, useKeyboardScroll, useKeyboardToolbar };
1122
- //# sourceMappingURL=chunk-VZ3PQLZ4.js.map
1123
- //# sourceMappingURL=chunk-VZ3PQLZ4.js.map
1122
+ //# sourceMappingURL=chunk-ABVSSJNT.js.map
1123
+ //# sourceMappingURL=chunk-ABVSSJNT.js.map