@hjmds/react-native 1.28.0 → 1.29.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/dist/auth-screen.d.ts +19 -2
- package/dist/auth-screen.d.ts.map +1 -1
- package/dist/auth-screen.js +41 -24
- package/dist/auth-screen.js.map +1 -1
- package/dist/collection-rail.d.ts +7 -1
- package/dist/collection-rail.d.ts.map +1 -1
- package/dist/collection-rail.js +12 -5
- package/dist/collection-rail.js.map +1 -1
- package/dist/evidence.d.ts +316 -1
- package/dist/evidence.d.ts.map +1 -1
- package/dist/evidence.js +52 -2
- package/dist/evidence.js.map +1 -1
- package/dist/feedback.d.ts +7 -1
- package/dist/feedback.d.ts.map +1 -1
- package/dist/feedback.js +4 -2
- package/dist/feedback.js.map +1 -1
- package/dist/inputs.d.ts +9 -0
- package/dist/inputs.d.ts.map +1 -1
- package/dist/inputs.js +4 -1
- package/dist/inputs.js.map +1 -1
- package/dist/internal/initial-focus.d.ts +44 -0
- package/dist/internal/initial-focus.d.ts.map +1 -0
- package/dist/internal/initial-focus.js +136 -0
- package/dist/internal/initial-focus.js.map +1 -0
- package/dist/internal/list-row-scroll-room.d.ts +2 -1
- package/dist/internal/list-row-scroll-room.d.ts.map +1 -1
- package/dist/internal/list-row-scroll-room.js +2 -1
- package/dist/internal/list-row-scroll-room.js.map +1 -1
- package/dist/internal/screen-body-inset.d.ts +9 -0
- package/dist/internal/screen-body-inset.d.ts.map +1 -0
- package/dist/internal/screen-body-inset.js +10 -0
- package/dist/internal/screen-body-inset.js.map +1 -0
- package/dist/keyboard.d.ts +1 -1
- package/dist/keyboard.d.ts.map +1 -1
- package/dist/keyboard.js.map +1 -1
- package/dist/overlays.d.ts +10 -2
- package/dist/overlays.d.ts.map +1 -1
- package/dist/overlays.js +255 -210
- package/dist/overlays.js.map +1 -1
- package/dist/screen-flows.d.ts +9 -4
- package/dist/screen-flows.d.ts.map +1 -1
- package/dist/screen-flows.js +12 -9
- package/dist/screen-flows.js.map +1 -1
- package/dist/screens.d.ts +26 -2
- package/dist/screens.d.ts.map +1 -1
- package/dist/screens.js +22 -6
- package/dist/screens.js.map +1 -1
- package/package.json +3 -3
package/dist/auth-screen.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { authScreenRecipe, type AuthScreenDescriptor, type AuthScreenHeroDescriptor, type AuthScreenPolicyLinkDescriptor } from "@hjmds/design-contracts/components/auth-screen";
|
|
2
|
+
import { type ScreenInitialFocus } from "@hjmds/design-contracts/screen-patterns";
|
|
2
3
|
import { type ReactNode } from "react";
|
|
3
4
|
import type { HjmCompositionStyleProp } from "./composition-style.js";
|
|
4
5
|
export type AuthScreenLayoutProps = AuthScreenDescriptor & Readonly<{
|
|
@@ -12,6 +13,19 @@ export type AuthScreenLayoutProps = AuthScreenDescriptor & Readonly<{
|
|
|
12
13
|
mainCard?: boolean;
|
|
13
14
|
/** Consent notice and policy links. Omit with `hasFooter: false`. */
|
|
14
15
|
footer?: ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* Bottom safe-area inset of the window edge this screen reaches (`useSafeAreaInsets().bottom`; 0 inside a host that
|
|
18
|
+
* already insets the bottom). The layout's bottom padding becomes max(paddingBlock, inset) — the ScreenLayout rule,
|
|
19
|
+
* never their sum — so policy links clear the home indicator / Android gesture bar without a product wrapper
|
|
20
|
+
* (2026-10-17 1.28 adoption: diairy, utilverse and spint each wrapped this layout in their own bottom inset).
|
|
21
|
+
* Pass it instead of a bottom SafeAreaView edge, never both.
|
|
22
|
+
*/
|
|
23
|
+
safeAreaBottom?: number;
|
|
24
|
+
/**
|
|
25
|
+
* Entry focus, same rules as ScreenLayout `initialFocus`. Off by default because auth screens lead with provider
|
|
26
|
+
* buttons; a signup nickname step opts in with `first-input` (2026-10-18 adoption: spint and utilverse signup).
|
|
27
|
+
*/
|
|
28
|
+
initialFocus?: ScreenInitialFocus;
|
|
15
29
|
testID?: string;
|
|
16
30
|
layoutStyle?: HjmCompositionStyleProp;
|
|
17
31
|
}>;
|
|
@@ -20,10 +34,13 @@ export type AuthScreenLayoutProps = AuthScreenDescriptor & Readonly<{
|
|
|
20
34
|
* the bottom. Content taller than the viewport scrolls instead of pushing the
|
|
21
35
|
* footer off screen — that is why the outer element is a ScrollView whose content
|
|
22
36
|
* container grows.
|
|
23
|
-
* Review forms must accept submit taps while focused; iOS owns the scroll inset
|
|
37
|
+
* Review forms must accept submit taps while focused; iOS owns the keyboard scroll inset
|
|
24
38
|
* so a product does not have to wrap this in another keyboard-avoiding view.
|
|
39
|
+
* Safe areas follow ScreenLayout: the host owns the top edge and `safeAreaBottom` the bottom. iOS automatic content
|
|
40
|
+
* inset adjustment is off because it added the home-indicator inset on iOS only, on top of paddingBlock, which made
|
|
41
|
+
* every product add its own Android inset (spint) or wrap the layout (diairy, utilverse) — 2026-10-17.
|
|
25
42
|
*/
|
|
26
|
-
export declare function AuthScreenLayout({ hero, main, footer, density, hasFooter, pendingLabel, mainCard, layoutStyle, testID, }: AuthScreenLayoutProps): import("react").JSX.Element;
|
|
43
|
+
export declare function AuthScreenLayout({ hero, main, footer, density, hasFooter, pendingLabel, mainCard, safeAreaBottom, layoutStyle, testID, initialFocus, }: AuthScreenLayoutProps): import("react").JSX.Element;
|
|
27
44
|
export type AuthScreenHeroProps = AuthScreenHeroDescriptor & Readonly<{
|
|
28
45
|
/** Product mark asset. HJM never ships product marks. */
|
|
29
46
|
mark?: ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-screen.d.ts","sourceRoot":"","sources":["../src/auth-screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAKhB,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,8BAA8B,EACpC,MAAM,gDAAgD,CAAC;AACxD,OAAO,
|
|
1
|
+
{"version":3,"file":"auth-screen.d.ts","sourceRoot":"","sources":["../src/auth-screen.tsx"],"names":[],"mappings":"AAAA,OAAO,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,mBAAmB,+BAmB1G;AAED,MAAM,MAAM,oBAAoB,GAAG,8BAA8B,GAC/D,QAAQ,CAAC;IAAE,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,CAAC,CAAC;AAEpC,MAAM,MAAM,qBAAqB,GAAG,QAAQ,CAAC;IAC3C,uCAAuC;IACvC,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,iEAAiE;IACjE,KAAK,EAAE,SAAS,oBAAoB,EAAE,CAAC;IACvC,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC,CAAC;AAEH;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,qBAAqB,+BAuBlF;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
package/dist/auth-screen.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { authScreenRecipe, resolveAuthScreenDescriptor, validateAuthScreenHeroDescriptor, validateAuthScreenPolicyLinks, } from "@hjmds/design-contracts/components/auth-screen";
|
|
3
|
-
import {
|
|
3
|
+
import { initialFocusDefaults } from "@hjmds/design-contracts/screen-patterns";
|
|
4
|
+
import { createContext, Fragment, useContext, useMemo, useRef } from "react";
|
|
5
|
+
import { InitialFocusProvider, useInitialFocusScope } from "./internal/initial-focus.js";
|
|
4
6
|
import { InheritedTextAlignContext } from "./internal/text-align.js";
|
|
7
|
+
import { resolveScreenBottomPadding } from "./internal/screen-footer.js";
|
|
8
|
+
import { useKeyboardOverlap } from "./keyboard.js";
|
|
5
9
|
import { Text } from "./primitives.js";
|
|
6
10
|
import { ActivityIndicator, Platform, Pressable, ScrollView, View, } from "react-native";
|
|
7
11
|
import { useHjmNativeTheme } from "./provider.js";
|
|
@@ -20,10 +24,13 @@ function AuthActionCard({ children, style }) {
|
|
|
20
24
|
* the bottom. Content taller than the viewport scrolls instead of pushing the
|
|
21
25
|
* footer off screen — that is why the outer element is a ScrollView whose content
|
|
22
26
|
* container grows.
|
|
23
|
-
* Review forms must accept submit taps while focused; iOS owns the scroll inset
|
|
27
|
+
* Review forms must accept submit taps while focused; iOS owns the keyboard scroll inset
|
|
24
28
|
* so a product does not have to wrap this in another keyboard-avoiding view.
|
|
29
|
+
* Safe areas follow ScreenLayout: the host owns the top edge and `safeAreaBottom` the bottom. iOS automatic content
|
|
30
|
+
* inset adjustment is off because it added the home-indicator inset on iOS only, on top of paddingBlock, which made
|
|
31
|
+
* every product add its own Android inset (spint) or wrap the layout (diairy, utilverse) — 2026-10-17.
|
|
25
32
|
*/
|
|
26
|
-
export function AuthScreenLayout({ hero, main, footer, density, hasFooter, pendingLabel, mainCard = false, layoutStyle, testID, }) {
|
|
33
|
+
export function AuthScreenLayout({ hero, main, footer, density, hasFooter, pendingLabel, mainCard = false, safeAreaBottom = 0, layoutStyle, testID, initialFocus = initialFocusDefaults.auth, }) {
|
|
27
34
|
const MainContainer = mainCard ? AuthActionCard : View;
|
|
28
35
|
const resolved = resolveAuthScreenDescriptor({
|
|
29
36
|
...(density === undefined ? {} : { density }),
|
|
@@ -33,26 +40,36 @@ export function AuthScreenLayout({ hero, main, footer, density, hasFooter, pendi
|
|
|
33
40
|
const pending = pendingLabel !== undefined;
|
|
34
41
|
if (pending && !pendingLabel.trim())
|
|
35
42
|
throw new TypeError("AuthScreen pendingLabel must not be empty");
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
43
|
+
if (!Number.isFinite(safeAreaBottom) || safeAreaBottom < 0)
|
|
44
|
+
throw new RangeError("AuthScreenLayout safeAreaBottom must be non-negative");
|
|
45
|
+
const scrollRef = useRef(null);
|
|
46
|
+
// Only a keyboard flag: automaticallyAdjustKeyboardInsets already pads the overlap, which clears the home indicator.
|
|
47
|
+
// The ScrollView class exposes its host view (with measureInWindow) through getNativeScrollRef.
|
|
48
|
+
const keyboardHost = useMemo(() => ({ get current() { return scrollRef.current?.getNativeScrollRef?.() ?? null; } }), []);
|
|
49
|
+
const keyboardOpen = useKeyboardOverlap(keyboardHost) > 0;
|
|
50
|
+
const paddingBottom = resolveScreenBottomPadding(resolved.paddingBlock, safeAreaBottom, keyboardOpen);
|
|
51
|
+
const focusScope = useInitialFocusScope({ mode: initialFocus });
|
|
52
|
+
return (_jsx(InitialFocusProvider, { scope: focusScope, children: _jsxs(ScrollView, { ref: scrollRef, onTouchStart: focusScope.onTouchStart, style: [{ flex: 1 }, layoutStyle], testID: testID, keyboardShouldPersistTaps: "handled", keyboardDismissMode: Platform.OS === "ios" ? "interactive" : "on-drag", automaticallyAdjustKeyboardInsets: true, contentContainerStyle: {
|
|
53
|
+
flexGrow: 1,
|
|
54
|
+
paddingHorizontal: resolved.paddingInline,
|
|
55
|
+
paddingTop: resolved.paddingBlock,
|
|
56
|
+
paddingBottom,
|
|
57
|
+
}, children: [_jsxs(View, { style: {
|
|
58
|
+
flexGrow: 1,
|
|
59
|
+
flexShrink: 0,
|
|
60
|
+
width: "100%",
|
|
61
|
+
maxWidth: resolved.maxWidth,
|
|
62
|
+
alignSelf: "center",
|
|
63
|
+
alignItems: "center",
|
|
64
|
+
justifyContent: "center",
|
|
65
|
+
gap: resolved.mainGap,
|
|
66
|
+
}, children: [_jsx(AuthScreenDensityContext.Provider, { value: resolved.density, children: _jsx(InheritedTextAlignContext.Provider, { value: "center", children: _jsx(View, { style: { width: "100%", alignItems: "center", gap: resolved.heroGap }, children: hero }) }) }), _jsxs(MainContainer, { style: { width: "100%" }, children: [_jsx(View, { pointerEvents: pending ? "none" : "auto", accessibilityElementsHidden: pending, importantForAccessibility: pending ? "no-hide-descendants" : "auto", style: pending ? { opacity: 0 } : undefined, children: main }), pending ? _jsx(View, { accessible: true, accessibilityLabel: pendingLabel, accessibilityRole: "progressbar", accessibilityLiveRegion: "polite", accessibilityState: { busy: true }, style: { position: "absolute", top: 0, right: 0, bottom: 0, left: 0, alignItems: "center", justifyContent: "center" }, children: _jsx(ActivityIndicator, { accessible: false }) }) : null] })] }), showFooter ? (_jsx(View, { style: {
|
|
67
|
+
width: "100%",
|
|
68
|
+
maxWidth: resolved.maxWidth,
|
|
69
|
+
alignSelf: "center",
|
|
70
|
+
alignItems: "center",
|
|
71
|
+
marginTop: resolved.footerGap,
|
|
72
|
+
}, children: footer })) : null] }) }));
|
|
56
73
|
}
|
|
57
74
|
/**
|
|
58
75
|
* The `hero` slot content: mark, eyebrow, tagline and one description line. Type
|
|
@@ -78,7 +95,7 @@ export function AuthScreenFooter({ notice, links, children }) {
|
|
|
78
95
|
// Height comes from a background-less minHeight (Android ignores hitSlop outside the parent row);
|
|
79
96
|
// only the inline extension up to the separator uses hitSlop.
|
|
80
97
|
const hitSlop = { left: recipe.linkGap, right: recipe.linkGap };
|
|
81
|
-
return (_jsxs(View, { style: { width: "100%", alignItems: "center", gap: recipe.noticeGap }, children: [notice ? _jsx(Text, { variant: recipe.notice.textVariant, tone: recipe.notice.tone, children: notice }) : null, _jsx(View, { style: { flexDirection: "row", flexWrap: "wrap", justifyContent: "center", alignItems: "center", columnGap: recipe.linkGap }, children: links.map((link, index) => (_jsxs(Fragment, { children: [index > 0 ? _jsx(Text, { variant: recipe.link.textVariant, tone: recipe.notice.tone, accessible: false, importantForAccessibility: "no", children: recipe.separator }) : null, _jsx(Pressable, { accessibilityRole: "link", accessibilityLabel: link.label, hitSlop: hitSlop, onPress: link.onPress, style: { minHeight: authScreenRecipe.footerMinTouchTarget, justifyContent: "center" }, children: _jsx(Text, { variant: recipe.link.textVariant, tone: recipe.link.tone, style: { textDecorationLine: recipe.link.underline ? "underline" : "none" }, children: link.label }) })] }, `${index}:${link.label}`))) }), children] }));
|
|
98
|
+
return (_jsxs(View, { style: { width: "100%", alignItems: "center", gap: recipe.noticeGap }, children: [notice ? _jsx(Text, { variant: recipe.notice.textVariant, tone: recipe.notice.tone, children: notice }) : null, _jsx(View, { style: { flexDirection: "row", flexWrap: "wrap", justifyContent: "center", alignItems: "center", columnGap: recipe.linkGap }, children: links.map((link, index) => (_jsxs(Fragment, { children: [index > 0 ? _jsx(Text, { variant: recipe.link.textVariant, tone: recipe.notice.tone, accessible: false, importantForAccessibility: "no", children: recipe.separator }) : null, _jsx(Pressable, { accessibilityRole: "link", accessibilityLabel: link.label, ...(link.accessibilityHint === undefined ? {} : { accessibilityHint: link.accessibilityHint }), hitSlop: hitSlop, onPress: link.onPress, style: { minHeight: authScreenRecipe.footerMinTouchTarget, justifyContent: "center" }, children: _jsx(Text, { variant: recipe.link.textVariant, tone: recipe.link.tone, style: { textDecorationLine: recipe.link.underline ? "underline" : "none" }, children: link.label }) })] }, `${index}:${link.label}`))) }), children] }));
|
|
82
99
|
}
|
|
83
100
|
export { authScreenRecipe };
|
|
84
101
|
//# sourceMappingURL=auth-screen.js.map
|
package/dist/auth-screen.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-screen.js","sourceRoot":"","sources":["../src/auth-screen.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,gBAAgB,EAChB,2BAA2B,EAC3B,gCAAgC,EAChC,6BAA6B,GAK9B,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,UAAU,EAAkB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"auth-screen.js","sourceRoot":"","sources":["../src/auth-screen.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,gBAAgB,EAChB,2BAA2B,EAC3B,gCAAgC,EAChC,6BAA6B,GAK9B,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAA2B,MA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,EAAE,EAAE,CAAC,CAC1B,MAAC,QAAQ,eACN,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,KAAC,IAAI,IAAC,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,yBAAyB,EAAC,IAAI,YAAE,MAAM,CAAC,SAAS,GAAQ,CAAC,CAAC,CAAC,IAAI,EACjK,KAAC,SAAS,IAAC,iBAAiB,EAAC,MAAM,EAAC,kBAAkB,EAAE,IAAI,CAAC,KAAK,KAAM,CAAC,IAAI,CAAC,iBAAiB,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,EAAE,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAC1M,KAAK,EAAE,EAAE,SAAS,EAAE,gBAAgB,CAAC,oBAAoB,EAAE,cAAc,EAAE,QAAQ,EAAE,YACrF,KAAC,IAAI,IAAC,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,kBAAkB,EAAE,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,EAAE,YAAG,IAAI,CAAC,KAAK,GAAQ,GACtJ,KALC,GAAG,KAAK,IAAI,IAAI,CAAC,KAAK,EAAE,CAM5B,CACZ,CAAC,GACG,EACN,QAAQ,IACJ,CACR,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -16,8 +16,14 @@ export type CollectionRailProps = Readonly<{
|
|
|
16
16
|
/** Initial scroll anchor, not a selected item or an open detail target. */
|
|
17
17
|
defaultStartKey?: string;
|
|
18
18
|
onStartKeyChange?: (key: string | null) => void;
|
|
19
|
+
/**
|
|
20
|
+
* Scroll to the screen edges from inside the default inset ScreenLayout body: the viewport reaches past the body
|
|
21
|
+
* gutter and pads it back, so the first and last items rest on the gutter (no `body-edge` + per-section gutter).
|
|
22
|
+
* Place the rail directly in the body; inside overlays or `body-edge`/`none` bodies there is no gutter to cross.
|
|
23
|
+
*/
|
|
24
|
+
bleed?: boolean;
|
|
19
25
|
layoutStyle?: HjmCompositionStyleProp;
|
|
20
26
|
testID?: string;
|
|
21
27
|
}>;
|
|
22
|
-
export declare function CollectionRail({ label, items, renderItem, labels, density, emptyContent, defaultStartKey, onStartKeyChange, layoutStyle, testID }: CollectionRailProps): import("react").JSX.Element;
|
|
28
|
+
export declare function CollectionRail({ label, items, renderItem, labels, density, emptyContent, defaultStartKey, onStartKeyChange, bleed, layoutStyle, testID }: CollectionRailProps): import("react").JSX.Element;
|
|
23
29
|
//# sourceMappingURL=collection-rail.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection-rail.d.ts","sourceRoot":"","sources":["../src/collection-rail.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"collection-rail.d.ts","sourceRoot":"","sources":["../src/collection-rail.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiD,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtF,OAAO,EAGL,KAAK,kBAAkB,EAAE,KAAK,qBAAqB,EACpD,MAAM,yCAAyC,CAAC;AAQjD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEtE,MAAM,MAAM,oBAAoB,GAAG,QAAQ,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AACpG,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC;IACzC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,SAAS,kBAAkB,EAAE,CAAC;IAAC,UAAU,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,SAAS,CAAC;IACzG,MAAM,EAAE,oBAAoB,CAAC;IAAC,OAAO,CAAC,EAAE,qBAAqB,CAAC;IAAC,YAAY,CAAC,EAAE,SAAS,CAAC;IACxF,2EAA2E;IAC3E,eAAe,CAAC,EAAE,MAAM,CAAC;IAAC,gBAAgB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC1E;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,WAAW,CAAC,EAAE,uBAAuB,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CACxD,CAAC,CAAC;AAEH,wBAAgB,cAAc,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,OAA+C,EAChH,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,KAAa,EAAE,WAAW,EAAE,MAAM,EAAE,EAAE,mBAAmB,+BAmF3G"}
|
package/dist/collection-rail.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useLayoutEffect, useRef, useState } from "react";
|
|
2
|
+
import { useContext, useLayoutEffect, useRef, useState } from "react";
|
|
3
3
|
import { ScrollView, View } from "react-native";
|
|
4
4
|
import { collectionRailRecipe, validateCollectionRail, resolveCollectionRailLayout, resolveCollectionRailViewport, getCollectionRailTargetOffset, getCollectionRailItemOffset, getCollectionRailRevealOffset, getCollectionRailPhysicalOffset, } from "@hjmds/design-contracts/collection-rail";
|
|
5
5
|
import { IconButton } from "./actions.js";
|
|
@@ -7,13 +7,20 @@ import { glyph } from "@hjmds/design-contracts/foundations";
|
|
|
7
7
|
import { resolveIconButtonPresentation } from "@hjmds/design-contracts/recipes";
|
|
8
8
|
import { DrawnChevron } from "./internal/drawn-glyphs.js";
|
|
9
9
|
import { useHjmNativeTheme } from "./provider.js";
|
|
10
|
-
|
|
10
|
+
import { ScreenBodyInsetContext } from "./internal/screen-body-inset.js";
|
|
11
|
+
import { listRowScrollRoom } from "./internal/list-row-scroll-room.js";
|
|
12
|
+
export function CollectionRail({ label, items, renderItem, labels, density = collectionRailRecipe.defaults.density, emptyContent, defaultStartKey, onStartKeyChange, bleed = false, layoutStyle, testID }) {
|
|
11
13
|
validateCollectionRail(items);
|
|
12
14
|
if (!label.trim() || Object.values(labels).some(value => !value.trim()))
|
|
13
15
|
throw new TypeError("CollectionRail labels must not be empty");
|
|
14
16
|
const { environment, palette, tokens } = useHjmNativeTheme(), direction = environment.direction;
|
|
15
17
|
const chevronColor = resolveIconButtonPresentation("ghost", palette, false).content;
|
|
16
18
|
const scroll = useRef(null);
|
|
19
|
+
// Same viewport/content room rule as the ListRow bleed, with the screen gutter as the outset. Item geometry keeps
|
|
20
|
+
// using the gutter-aligned width, so offsets and item widths are unchanged by the bleed.
|
|
21
|
+
const bodyInset = useContext(ScreenBodyInsetContext);
|
|
22
|
+
const room = listRowScrollRoom(bleed ? bodyInset : 0);
|
|
23
|
+
const outset = room.content.paddingHorizontal;
|
|
17
24
|
const [width, setWidth] = useState(0), [offset, setOffset] = useState(0);
|
|
18
25
|
const layout = resolveCollectionRailLayout(items.length, width, density, tokens.spacing.md);
|
|
19
26
|
const geometry = useRef(layout);
|
|
@@ -65,7 +72,7 @@ export function CollectionRail({ label, items, renderItem, labels, density = col
|
|
|
65
72
|
// Use one physical coordinate system on iOS/Android. Reverse only row
|
|
66
73
|
// placement in RTL; keep data, reading order and child state keyed by ID.
|
|
67
74
|
const contentWidth = useRef(0);
|
|
68
|
-
return _jsxs(View, { testID: testID, style: [{ direction, minWidth: 0 }, layoutStyle], children: [_jsxs(ScrollView, { ref: scroll, horizontal: true, accessibilityRole: "list", accessibilityLabel: label, onLayout: event => setWidth(event.nativeEvent.layout.width), onContentSizeChange: nextWidth => {
|
|
75
|
+
return _jsxs(View, { testID: testID, style: [{ direction, minWidth: 0 }, layoutStyle], children: [_jsxs(ScrollView, { ref: scroll, horizontal: true, accessibilityRole: "list", accessibilityLabel: label, onLayout: event => setWidth(Math.max(0, event.nativeEvent.layout.width - outset * 2)), onContentSizeChange: nextWidth => {
|
|
69
76
|
// The physical scroll range exists after content layout. Re-align only
|
|
70
77
|
// for width changes; an edited card's height must not reset touch scroll.
|
|
71
78
|
if (nextWidth !== contentWidth.current) {
|
|
@@ -77,8 +84,8 @@ export function CollectionRail({ label, items, renderItem, labels, density = col
|
|
|
77
84
|
if (pendingOffset.current !== null && Math.abs(next - pendingOffset.current) <= 0.5)
|
|
78
85
|
pendingOffset.current = null;
|
|
79
86
|
publish(next);
|
|
80
|
-
}, scrollEventThrottle: 16, keyboardShouldPersistTaps: "handled", removeClippedSubviews: false, style: { direction: "ltr" }, contentContainerStyle: { direction: "ltr", flexDirection: direction === "rtl" ? "row-reverse" : "row",
|
|
81
|
-
gap: tokens.spacing.md, width: Math.max(layout.contentWidth, width), paddingVertical: tokens.spacing.xs }, children: [items.map((item, index) => _jsx(View, { style: { width: layout.itemWidth, direction }, onFocus: () => { focusedKey.current = item.id; scrollToOffset(getCollectionRailRevealOffset(geometry.current, logicalOffset.current, index), false); }, onBlur: () => { if (focusedKey.current === item.id)
|
|
87
|
+
}, scrollEventThrottle: 16, keyboardShouldPersistTaps: "handled", removeClippedSubviews: false, style: { direction: "ltr", ...room.viewport }, contentContainerStyle: { direction: "ltr", flexDirection: direction === "rtl" ? "row-reverse" : "row",
|
|
88
|
+
gap: tokens.spacing.md, width: Math.max(layout.contentWidth, width) + outset * 2, paddingVertical: tokens.spacing.xs, ...room.content }, children: [items.map((item, index) => _jsx(View, { style: { width: layout.itemWidth, direction }, onFocus: () => { focusedKey.current = item.id; scrollToOffset(getCollectionRailRevealOffset(geometry.current, logicalOffset.current, index), false); }, onBlur: () => { if (focusedKey.current === item.id)
|
|
82
89
|
focusedKey.current = null; }, children: renderItem(item) }, item.id)), items.length === 0 ? emptyContent : null] }), _jsxs(View, { accessibilityLabel: labels.navigation, style: { flexDirection: "row", flexWrap: "wrap", justifyContent: "flex-end", gap: tokens.spacing.sm, marginTop: tokens.spacing.sm }, children: [_jsx(IconButton, { label: labels.previous, tone: "ghost", disabled: state.atStart, onPress: () => navigate("previous"), children: _jsx(DrawnChevron, { direction: "start", size: glyph.sm, color: chevronColor }) }), _jsx(IconButton, { label: labels.next, tone: "ghost", disabled: state.atEnd, onPress: () => navigate("next"), children: _jsx(DrawnChevron, { direction: "end", size: glyph.sm, color: chevronColor }) })] })] });
|
|
83
90
|
}
|
|
84
91
|
//# sourceMappingURL=collection-rail.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection-rail.js","sourceRoot":"","sources":["../src/collection-rail.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"collection-rail.js","sourceRoot":"","sources":["../src/collection-rail.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AACtF,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EACL,oBAAoB,EAAE,sBAAsB,EAAE,2BAA2B,EAAE,6BAA6B,EACxG,6BAA6B,EAAE,2BAA2B,EAAE,6BAA6B,EAAE,+BAA+B,GAE3H,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,qCAAqC,CAAC;AAC5D,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,iBAAiB,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