@agimon-ai/po-native-components 0.0.0-alpha.165 → 0.0.0-alpha.167
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/components/List.d.mts.map +1 -1
- package/dist/components/List.mjs +5 -0
- package/dist/components/List.mjs.map +1 -1
- package/dist/components/Sheet.d.mts +8 -1
- package/dist/components/Sheet.d.mts.map +1 -1
- package/dist/components/Sheet.mjs +4 -1
- package/dist/components/Sheet.mjs.map +1 -1
- package/dist/components/SheetFrame.mjs +11 -6
- package/dist/components/SheetFrame.mjs.map +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.d.mts","names":[],"sources":["../../src/components/List.tsx"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"List.d.mts","names":[],"sources":["../../src/components/List.tsx"],"mappings":";;;iBAiCiB,UAAU;EACzB,eAAe;EACf,aAAa,MAAM,GAAG,kBAAkB;;EAExC,eAAe,MAAM,GAAG;;;;;EAKxB;;EAEA;;EAEA,QAAQ;EACR,SAAS;EACT,SAAS;EACT;EACA;;EAEA,QAAQ,UAAU;;EAElB;;wBAOc,KAAK,KACnB,MACA,YACA,cACA,eACA,YACA,OACA,QACA,QACA,cACA,oBACA,OACA,kBACC,UAAU,qBAAE,IAAA;iBAsDE;EACf,OAAO;;EAEP,cAAc;;EAEd,UAAU;;EAEV,WAAW;;EAEX;EACA;EACA;;EAEA;EACA;EACA,QAAQ,UAAU;;;wBAIJ,UACd,OACA,aACA,SACA,UACA,UACA,UACA,SACA,YACA,oBACA,SACC,+BAAY,IAAA"}
|
package/dist/components/List.mjs
CHANGED
|
@@ -8,6 +8,8 @@ import { Platform } from "react-native";
|
|
|
8
8
|
import { useCallback, useRef, useState } from "react";
|
|
9
9
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
import { Pressable } from "react-native-unistyles/components/native/Pressable";
|
|
11
|
+
import { useInsideSheet } from "@agimon-ai/po-native-components/shell";
|
|
12
|
+
import { useBottomSheetScrollableCreator } from "@gorhom/bottom-sheet";
|
|
11
13
|
import { FlashList } from "@shopify/flash-list";
|
|
12
14
|
|
|
13
15
|
//#region src/components/List.tsx
|
|
@@ -24,6 +26,8 @@ function List({ data, renderItem, keyExtractor, startAtBottom = false, separator
|
|
|
24
26
|
const renderRow = useCallback(({ item, index }) => renderItem(item, index), [renderItem]);
|
|
25
27
|
const listRef = useRef(null);
|
|
26
28
|
const [awayFromBottom, setAwayFromBottom] = useState(false);
|
|
29
|
+
const sheetScroll = useBottomSheetScrollableCreator();
|
|
30
|
+
const insideSheet = useInsideSheet();
|
|
27
31
|
const onScroll = useCallback(({ nativeEvent }) => {
|
|
28
32
|
const { contentOffset, contentSize, layoutMeasurement } = nativeEvent;
|
|
29
33
|
const distance = contentSize.height - layoutMeasurement.height - contentOffset.y;
|
|
@@ -34,6 +38,7 @@ function List({ data, renderItem, keyExtractor, startAtBottom = false, separator
|
|
|
34
38
|
accessibilityLabel,
|
|
35
39
|
children: [/* @__PURE__ */ jsx(FlashList, {
|
|
36
40
|
ref: listRef,
|
|
41
|
+
renderScrollComponent: insideSheet ? sheetScroll : void 0,
|
|
37
42
|
onScroll: startAtBottom ? onScroll : void 0,
|
|
38
43
|
scrollEventThrottle: startAtBottom ? 100 : void 0,
|
|
39
44
|
data,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.mjs","names":["FlashList","FlashListRef","ReactElement","ReactNode","useCallback","useRef","useState","NativeScrollEvent","NativeSyntheticEvent","Platform","StyleProp","ViewStyle","StyleSheet","ChevronDownIcon","ChevronRightIcon","fontOf","Button","MIN_ROW_HEIGHT","DISABLED_OPACITY","PIN_THRESHOLD","JUMP_THRESHOLD","ListProps","data","T","renderItem","item","index","keyExtractor","startAtBottom","separators","empty","header","footer","onEndReached","accessibilityLabel","style","contentPadding","Separator","styles","separator","List","renderRow","listRef","awayFromBottom","setAwayFromBottom","onScroll","nativeEvent","contentOffset","contentSize","layoutMeasurement","distance","height","y","frame","undefined","OS","padding","startRenderingFromBottom","autoscrollToBottomThreshold","current","scrollToEnd","animated","jump","ListRowProps","title","description","leading","trailing","selected","disabled","onPress","disclosure","ListRow","chevron","content","text","titleSelected","row","pressed","create","theme","flex","minHeight","position","bottom","spacing","alignSelf","borderRadius","full","borderColor","colors","border","uni__dependencies","hairlineWidth","marginLeft","backgroundColor","flexDirection","alignItems","gap","paddingHorizontal","paddingVertical","panel","opacity","minWidth","color","hi","fontFamily","sans","fontSize","base","lineHeight","fontWeight","medium","green","semibold","faint","sm"],"sources":["../../src/components/List.tsx"],"sourcesContent":["import { FlashList, type FlashListRef } from '@shopify/flash-list';\nimport { type ReactElement, type ReactNode, useCallback, useRef, useState } from 'react';\nimport {\n type NativeScrollEvent,\n type NativeSyntheticEvent,\n Platform,\n Pressable,\n type StyleProp,\n Text,\n View,\n type ViewStyle,\n} from 'react-native';\nimport { StyleSheet } from 'react-native-unistyles';\n\nimport { ChevronDownIcon, ChevronRightIcon } from '../icons/icons';\nimport { fontOf } from '../lib/fonts';\nimport { Button } from './Button';\n/*\n * A virtualised list on FlashList: sessions, devices, a transcript. Rows\n * recycle, separators are hairlines, and a chat list can start at the bottom\n * and stay pinned there as rows arrive. The public props are this package's\n * own, so FlashList's types never reach a caller.\n */\n\nconst MIN_ROW_HEIGHT = 44;\nconst DISABLED_OPACITY = 0.4;\n/** How close to the bottom a reader must be for a new row to keep the list pinned, as a fraction of the visible height. */\nconst PIN_THRESHOLD = 0.1;\n/** How far above the bottom, in visible heights, a chat reader must scroll before the jump-to-latest button shows. */\nconst JUMP_THRESHOLD = 1;\n\nexport interface ListProps<T> {\n data: readonly T[];\n renderItem: (item: T, index: number) => ReactElement | null;\n /** A stable key per row; FlashList recycles views by it. */\n keyExtractor: (item: T, index: number) => string;\n /**\n * A chat list: render from the bottom and keep the newest row in view as\n * rows arrive, while the reader is near the bottom.\n */\n startAtBottom?: boolean;\n /** Hairline separators between rows. On by default. */\n separators?: boolean;\n /** Shown when `data` is empty. */\n empty?: ReactNode;\n header?: ReactNode;\n footer?: ReactNode;\n onEndReached?: () => void;\n accessibilityLabel?: string;\n /** The list's frame; give it a height or a flex parent, since a virtualised list needs bounds. */\n style?: StyleProp<ViewStyle>;\n /** Padding around the rows. */\n contentPadding?: number;\n}\n\nfunction Separator() {\n return <View style={styles.separator} />;\n}\n\nexport function List<T>({\n data,\n renderItem,\n keyExtractor,\n startAtBottom = false,\n separators = true,\n empty,\n header,\n footer,\n onEndReached,\n accessibilityLabel,\n style,\n contentPadding,\n}: ListProps<T>) {\n const renderRow = useCallback(({ item, index }: { item: T; index: number }) => renderItem(item, index), [renderItem]);\n const listRef = useRef<FlashListRef<T>>(null);\n const [awayFromBottom, setAwayFromBottom] = useState(false);\n const onScroll = useCallback(({ nativeEvent }: NativeSyntheticEvent<NativeScrollEvent>) => {\n const { contentOffset, contentSize, layoutMeasurement } = nativeEvent;\n const distance = contentSize.height - layoutMeasurement.height - contentOffset.y;\n setAwayFromBottom(distance > layoutMeasurement.height * JUMP_THRESHOLD);\n }, []);\n return (\n <View style={[styles.frame, style]} accessibilityLabel={accessibilityLabel}>\n <FlashList\n ref={listRef}\n onScroll={startAtBottom ? onScroll : undefined}\n scrollEventThrottle={startAtBottom ? 100 : undefined}\n data={data}\n renderItem={renderRow}\n keyExtractor={keyExtractor}\n ItemSeparatorComponent={separators ? Separator : null}\n ListEmptyComponent={empty === undefined ? null : <>{empty}</>}\n ListHeaderComponent={header === undefined ? null : <>{header}</>}\n ListFooterComponent={footer === undefined ? null : <>{footer}</>}\n onEndReached={onEndReached}\n // Dragging the rows pulls the keyboard down with the finger, as in Messages.\n keyboardDismissMode={Platform.OS === 'ios' ? 'interactive' : 'on-drag'}\n // A chat's rows are mostly pressable (long-press bubbles, tool groups), so any tap there hides the keyboard\n // first, as in Messages; other lists let a tap on a row land.\n keyboardShouldPersistTaps={startAtBottom ? 'never' : 'handled'}\n // Lets UIKit inset the rows under a translucent or large-title header instead of drawing beneath it.\n contentInsetAdjustmentBehavior=\"automatic\"\n contentContainerStyle={contentPadding === undefined ? undefined : { padding: contentPadding }}\n maintainVisibleContentPosition={\n startAtBottom ? { startRenderingFromBottom: true, autoscrollToBottomThreshold: PIN_THRESHOLD } : undefined\n }\n />\n {startAtBottom && awayFromBottom ? (\n <Button\n variant=\"subtle\"\n size=\"icon-md\"\n accessibilityLabel=\"Jump to latest\"\n onPress={() => listRef.current?.scrollToEnd({ animated: true })}\n style={styles.jump}\n >\n <ChevronDownIcon size={18} />\n </Button>\n ) : null}\n </View>\n );\n}\n\nexport interface ListRowProps {\n title: ReactNode;\n /** A second, quieter line under the title. */\n description?: ReactNode;\n /** Before the text: a Dot, an icon. */\n leading?: ReactNode;\n /** After the text: a Badge, a ghost button, a count. */\n trailing?: ReactNode;\n /** Selected rows sit on a green tint. */\n selected?: boolean;\n disabled?: boolean;\n onPress?: () => void;\n /** The iOS disclosure chevron. Defaults to on for a pressable row on iOS, where rows that navigate wear one. */\n disclosure?: boolean;\n accessibilityLabel?: string;\n style?: StyleProp<ViewStyle>;\n}\n\n/** One list row: 44pt tall, optional leading and trailing slots, pressable when it navigates. */\nexport function ListRow({\n title,\n description,\n leading,\n trailing,\n selected = false,\n disabled = false,\n onPress,\n disclosure,\n accessibilityLabel,\n style,\n}: ListRowProps) {\n const chevron = disclosure ?? (onPress !== undefined && Platform.OS === 'ios');\n const content = (\n <>\n {leading}\n <View style={styles.text}>\n {typeof title === 'string' ? (\n <Text numberOfLines={1} style={[styles.title, selected && styles.titleSelected]}>\n {title}\n </Text>\n ) : (\n title\n )}\n {typeof description === 'string' ? (\n <Text numberOfLines={2} style={styles.description}>\n {description}\n </Text>\n ) : (\n description\n )}\n </View>\n {trailing}\n {chevron ? <ChevronRightIcon size={14} color=\"faint\" /> : null}\n </>\n );\n if (onPress === undefined) {\n return (\n <View\n accessibilityLabel={accessibilityLabel}\n accessibilityState={{ selected, disabled }}\n style={[styles.row, selected && styles.selected, disabled && styles.disabled, style]}\n >\n {content}\n </View>\n );\n }\n return (\n <Pressable\n accessibilityRole=\"button\"\n accessibilityLabel={accessibilityLabel}\n accessibilityState={{ selected, disabled }}\n disabled={disabled}\n onPress={onPress}\n style={({ pressed }) => [\n styles.row,\n selected && styles.selected,\n pressed && styles.pressed,\n disabled && styles.disabled,\n style,\n ]}\n >\n {content}\n </Pressable>\n );\n}\n\nconst styles = StyleSheet.create((theme) => ({\n frame: { flex: 1, minHeight: 0 },\n jump: {\n position: 'absolute',\n bottom: theme.spacing(3),\n alignSelf: 'center',\n borderRadius: theme.borderRadius.full,\n borderColor: theme.colors.border,\n },\n separator: {\n height: StyleSheet.hairlineWidth,\n marginLeft: theme.spacing(4),\n backgroundColor: theme.colors['border-soft'],\n },\n row: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: theme.spacing(3),\n minHeight: MIN_ROW_HEIGHT,\n paddingHorizontal: theme.spacing(4),\n paddingVertical: theme.spacing(2),\n },\n selected: { backgroundColor: theme.colors['tint-green'] },\n pressed: { backgroundColor: theme.colors.panel },\n disabled: { opacity: DISABLED_OPACITY },\n text: { flex: 1, minWidth: 0, gap: theme.spacing(0.5) },\n title: {\n color: theme.colors.hi,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.base,\n lineHeight: theme.lineHeight.base,\n fontWeight: theme.fontWeight.medium,\n },\n titleSelected: { color: theme.colors.green, fontWeight: theme.fontWeight.semibold },\n description: {\n color: theme.colors.faint,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeight.sm,\n },\n}));\n"],"mappings":";;;;;;;;;;;;;AAwBA,MAAMiB,iBAAiB;AACvB,MAAMC,mBAAmB;;AAEzB,MAAMC,gBAAgB;;AAEtB,MAAMC,iBAAiB;AA0BvB,SAASiB,YAAY;CACnB,OAAO,oBAAC,MAAD,EAAM,OAAOC,OAAOC,UAAU;AACvC;AAEA,SAAgBC,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9B,MAAM8B,WAAWM;EAAExB,mBAAA,CAAA,CAAA;CACjC;AACF,EAAE"}
|
|
1
|
+
{"version":3,"file":"List.mjs","names":["useInsideSheet","useBottomSheetScrollableCreator","FlashList","FlashListRef","ReactElement","ReactNode","useCallback","useRef","useState","NativeScrollEvent","NativeSyntheticEvent","Platform","StyleProp","ViewStyle","StyleSheet","ChevronDownIcon","ChevronRightIcon","fontOf","Button","MIN_ROW_HEIGHT","DISABLED_OPACITY","PIN_THRESHOLD","JUMP_THRESHOLD","ListProps","data","T","renderItem","item","index","keyExtractor","startAtBottom","separators","empty","header","footer","onEndReached","accessibilityLabel","style","contentPadding","Separator","styles","separator","List","renderRow","listRef","awayFromBottom","setAwayFromBottom","sheetScroll","insideSheet","onScroll","nativeEvent","contentOffset","contentSize","layoutMeasurement","distance","height","y","frame","undefined","OS","padding","startRenderingFromBottom","autoscrollToBottomThreshold","current","scrollToEnd","animated","jump","ListRowProps","title","description","leading","trailing","selected","disabled","onPress","disclosure","ListRow","chevron","content","text","titleSelected","row","pressed","create","theme","flex","minHeight","position","bottom","spacing","alignSelf","borderRadius","full","borderColor","colors","border","uni__dependencies","hairlineWidth","marginLeft","backgroundColor","flexDirection","alignItems","gap","paddingHorizontal","paddingVertical","panel","opacity","minWidth","color","hi","fontFamily","sans","fontSize","base","lineHeight","fontWeight","medium","green","semibold","faint","sm"],"sources":["../../src/components/List.tsx"],"sourcesContent":["import { useInsideSheet } from '@agimon-ai/po-native-components/shell';\nimport { useBottomSheetScrollableCreator } from '@gorhom/bottom-sheet';\nimport { FlashList, type FlashListRef } from '@shopify/flash-list';\nimport { type ReactElement, type ReactNode, useCallback, useRef, useState } from 'react';\nimport {\n type NativeScrollEvent,\n type NativeSyntheticEvent,\n Platform,\n Pressable,\n type StyleProp,\n Text,\n View,\n type ViewStyle,\n} from 'react-native';\nimport { StyleSheet } from 'react-native-unistyles';\n\nimport { ChevronDownIcon, ChevronRightIcon } from '../icons/icons';\nimport { fontOf } from '../lib/fonts';\nimport { Button } from './Button';\n/*\n * A virtualised list on FlashList: sessions, devices, a transcript. Rows\n * recycle, separators are hairlines, and a chat list can start at the bottom\n * and stay pinned there as rows arrive. The public props are this package's\n * own, so FlashList's types never reach a caller.\n */\n\nconst MIN_ROW_HEIGHT = 44;\nconst DISABLED_OPACITY = 0.4;\n/** How close to the bottom a reader must be for a new row to keep the list pinned, as a fraction of the visible height. */\nconst PIN_THRESHOLD = 0.1;\n/** How far above the bottom, in visible heights, a chat reader must scroll before the jump-to-latest button shows. */\nconst JUMP_THRESHOLD = 1;\n\nexport interface ListProps<T> {\n data: readonly T[];\n renderItem: (item: T, index: number) => ReactElement | null;\n /** A stable key per row; FlashList recycles views by it. */\n keyExtractor: (item: T, index: number) => string;\n /**\n * A chat list: render from the bottom and keep the newest row in view as\n * rows arrive, while the reader is near the bottom.\n */\n startAtBottom?: boolean;\n /** Hairline separators between rows. On by default. */\n separators?: boolean;\n /** Shown when `data` is empty. */\n empty?: ReactNode;\n header?: ReactNode;\n footer?: ReactNode;\n onEndReached?: () => void;\n accessibilityLabel?: string;\n /** The list's frame; give it a height or a flex parent, since a virtualised list needs bounds. */\n style?: StyleProp<ViewStyle>;\n /** Padding around the rows. */\n contentPadding?: number;\n}\n\nfunction Separator() {\n return <View style={styles.separator} />;\n}\n\nexport function List<T>({\n data,\n renderItem,\n keyExtractor,\n startAtBottom = false,\n separators = true,\n empty,\n header,\n footer,\n onEndReached,\n accessibilityLabel,\n style,\n contentPadding,\n}: ListProps<T>) {\n const renderRow = useCallback(({ item, index }: { item: T; index: number }) => renderItem(item, index), [renderItem]);\n const listRef = useRef<FlashListRef<T>>(null);\n const [awayFromBottom, setAwayFromBottom] = useState(false);\n // Inside a sheet the rows scroll through Gorhom, so a drag on them scrolls instead of moving the sheet.\n const sheetScroll = useBottomSheetScrollableCreator();\n const insideSheet = useInsideSheet();\n const onScroll = useCallback(({ nativeEvent }: NativeSyntheticEvent<NativeScrollEvent>) => {\n const { contentOffset, contentSize, layoutMeasurement } = nativeEvent;\n const distance = contentSize.height - layoutMeasurement.height - contentOffset.y;\n setAwayFromBottom(distance > layoutMeasurement.height * JUMP_THRESHOLD);\n }, []);\n return (\n <View style={[styles.frame, style]} accessibilityLabel={accessibilityLabel}>\n <FlashList\n ref={listRef}\n renderScrollComponent={insideSheet ? sheetScroll : undefined}\n onScroll={startAtBottom ? onScroll : undefined}\n scrollEventThrottle={startAtBottom ? 100 : undefined}\n data={data}\n renderItem={renderRow}\n keyExtractor={keyExtractor}\n ItemSeparatorComponent={separators ? Separator : null}\n ListEmptyComponent={empty === undefined ? null : <>{empty}</>}\n ListHeaderComponent={header === undefined ? null : <>{header}</>}\n ListFooterComponent={footer === undefined ? null : <>{footer}</>}\n onEndReached={onEndReached}\n // Dragging the rows pulls the keyboard down with the finger, as in Messages.\n keyboardDismissMode={Platform.OS === 'ios' ? 'interactive' : 'on-drag'}\n // A chat's rows are mostly pressable (long-press bubbles, tool groups), so any tap there hides the keyboard\n // first, as in Messages; other lists let a tap on a row land.\n keyboardShouldPersistTaps={startAtBottom ? 'never' : 'handled'}\n // Lets UIKit inset the rows under a translucent or large-title header instead of drawing beneath it.\n contentInsetAdjustmentBehavior=\"automatic\"\n contentContainerStyle={contentPadding === undefined ? undefined : { padding: contentPadding }}\n maintainVisibleContentPosition={\n startAtBottom ? { startRenderingFromBottom: true, autoscrollToBottomThreshold: PIN_THRESHOLD } : undefined\n }\n />\n {startAtBottom && awayFromBottom ? (\n <Button\n variant=\"subtle\"\n size=\"icon-md\"\n accessibilityLabel=\"Jump to latest\"\n onPress={() => listRef.current?.scrollToEnd({ animated: true })}\n style={styles.jump}\n >\n <ChevronDownIcon size={18} />\n </Button>\n ) : null}\n </View>\n );\n}\n\nexport interface ListRowProps {\n title: ReactNode;\n /** A second, quieter line under the title. */\n description?: ReactNode;\n /** Before the text: a Dot, an icon. */\n leading?: ReactNode;\n /** After the text: a Badge, a ghost button, a count. */\n trailing?: ReactNode;\n /** Selected rows sit on a green tint. */\n selected?: boolean;\n disabled?: boolean;\n onPress?: () => void;\n /** The iOS disclosure chevron. Defaults to on for a pressable row on iOS, where rows that navigate wear one. */\n disclosure?: boolean;\n accessibilityLabel?: string;\n style?: StyleProp<ViewStyle>;\n}\n\n/** One list row: 44pt tall, optional leading and trailing slots, pressable when it navigates. */\nexport function ListRow({\n title,\n description,\n leading,\n trailing,\n selected = false,\n disabled = false,\n onPress,\n disclosure,\n accessibilityLabel,\n style,\n}: ListRowProps) {\n const chevron = disclosure ?? (onPress !== undefined && Platform.OS === 'ios');\n const content = (\n <>\n {leading}\n <View style={styles.text}>\n {typeof title === 'string' ? (\n <Text numberOfLines={1} style={[styles.title, selected && styles.titleSelected]}>\n {title}\n </Text>\n ) : (\n title\n )}\n {typeof description === 'string' ? (\n <Text numberOfLines={2} style={styles.description}>\n {description}\n </Text>\n ) : (\n description\n )}\n </View>\n {trailing}\n {chevron ? <ChevronRightIcon size={14} color=\"faint\" /> : null}\n </>\n );\n if (onPress === undefined) {\n return (\n <View\n accessibilityLabel={accessibilityLabel}\n accessibilityState={{ selected, disabled }}\n style={[styles.row, selected && styles.selected, disabled && styles.disabled, style]}\n >\n {content}\n </View>\n );\n }\n return (\n <Pressable\n accessibilityRole=\"button\"\n accessibilityLabel={accessibilityLabel}\n accessibilityState={{ selected, disabled }}\n disabled={disabled}\n onPress={onPress}\n style={({ pressed }) => [\n styles.row,\n selected && styles.selected,\n pressed && styles.pressed,\n disabled && styles.disabled,\n style,\n ]}\n >\n {content}\n </Pressable>\n );\n}\n\nconst styles = StyleSheet.create((theme) => ({\n frame: { flex: 1, minHeight: 0 },\n jump: {\n position: 'absolute',\n bottom: theme.spacing(3),\n alignSelf: 'center',\n borderRadius: theme.borderRadius.full,\n borderColor: theme.colors.border,\n },\n separator: {\n height: StyleSheet.hairlineWidth,\n marginLeft: theme.spacing(4),\n backgroundColor: theme.colors['border-soft'],\n },\n row: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: theme.spacing(3),\n minHeight: MIN_ROW_HEIGHT,\n paddingHorizontal: theme.spacing(4),\n paddingVertical: theme.spacing(2),\n },\n selected: { backgroundColor: theme.colors['tint-green'] },\n pressed: { backgroundColor: theme.colors.panel },\n disabled: { opacity: DISABLED_OPACITY },\n text: { flex: 1, minWidth: 0, gap: theme.spacing(0.5) },\n title: {\n color: theme.colors.hi,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.base,\n lineHeight: theme.lineHeight.base,\n fontWeight: theme.fontWeight.medium,\n },\n titleSelected: { color: theme.colors.green, fontWeight: theme.fontWeight.semibold },\n description: {\n color: theme.colors.faint,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeight.sm,\n },\n}));\n"],"mappings":";;;;;;;;;;;;;;;AA0BA,MAAMmB,iBAAiB;AACvB,MAAMC,mBAAmB;;AAEzB,MAAMC,gBAAgB;;AAEtB,MAAMC,iBAAiB;AA0BvB,SAASiB,YAAY;CACnB,OAAO,oBAAC,MAAD,EAAM,OAAOC,OAAOC,UAAU;AACvC;AAEA,SAAgBC,KAAQ,EACtBlB,MACAE,YACAG,cACAC,gBAAgB,OAChBC,aAAa,MACbC,OACAC,QACAC,QACAC,cACAC,oBACAC,OACAC,kBACe;CACf,MAAMK,YAAYrC,aAAa,EAAEqB,MAAMC,YAAwCF,WAAWC,MAAMC,KAAK,GAAG,CAACF,UAAU,CAAC;CACpH,MAAMkB,UAAUrC,OAAwB,IAAI;CAC5C,MAAM,CAACsC,gBAAgBC,qBAAqBtC,SAAS,KAAK;CAE1D,MAAMuC,cAAc9C,gCAAgC;CACpD,MAAM+C,cAAchD,eAAe;CACnC,MAAMiD,WAAW3C,aAAa,EAAE4C,kBAA2D;EACzF,MAAM,EAAEC,eAAeC,aAAaC,sBAAsBH;EAC1D,MAAMI,WAAWF,YAAYG,SAASF,kBAAkBE,SAASJ,cAAcK;EAC/EV,kBAAkBQ,WAAWD,kBAAkBE,SAASjC,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AAA,CAAA;CACnC;CACAxB,UAAU;EAAE2B,iBAAiBf,MAAMU,OAAO;EAAaE,mBAAA,CAAA,CAAA;CAAC;CACxDd,SAAS;EAAEiB,iBAAiBf,MAAMU,OAAOW;EAAKT,mBAAA,CAAA,CAAA;CAAC;CAC/CvB,UAAU,EAAEiC,SAAStF,iBAAiB;CACtC2D,MAAM;EAAEM,MAAM;EAAGsB,UAAU;EAAGL,KAAKlB,MAAMK,QAAQ,EAAG;EAACO,mBAAA,CAAA,CAAA;CAAC;CACtD5B,OAAO;EACLwC,OAAOxB,MAAMU,OAAOe;EACpBC,YAAY7F,OAAOmE,MAAM0B,WAAWC,IAAI;EACxCC,UAAU5B,MAAM4B,SAASC;EACzBC,YAAY9B,MAAM8B,WAAWD;EAC7BE,YAAY/B,MAAM+B,WAAWC;EAAMpB,mBAAA,CAAA,CAAA;CACrC;CACAhB,eAAe;EAAE4B,OAAOxB,MAAMU,OAAOuB;EAAOF,YAAY/B,MAAM+B,WAAWG;EAAQtB,mBAAA,CAAA,CAAA;CAAC;CAClF3B,aAAa;EACXuC,OAAOxB,MAAMU,OAAOyB;EACpBT,YAAY7F,OAAOmE,MAAM0B,WAAWC,IAAI;EACxCC,UAAU5B,MAAM4B,SAASQ;EACzBN,YAAY9B,MAAM8B,WAAWM;EAAExB,mBAAA,CAAA,CAAA;CACjC;AACF,EAAE"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ButtonProps } from "./Button.mjs";
|
|
2
2
|
import { StyleProp, TextProps, ViewProps, ViewStyle } from "react-native";
|
|
3
|
+
import { NativeColorToken } from "@agimon-ai/po-web-components/nativeTheme";
|
|
3
4
|
import { ReactNode } from "react";
|
|
4
5
|
//#region src/components/Sheet.d.ts
|
|
5
6
|
export interface SheetProps {
|
|
@@ -24,9 +25,15 @@ export interface SheetContentProps {
|
|
|
24
25
|
keep?: boolean;
|
|
25
26
|
/** Runs after the native modal is dismissed, including a caller-initiated close. */
|
|
26
27
|
onDismiss?: () => void;
|
|
28
|
+
/** Fixed heights such as `['58%']`; given, the sheet stops sizing itself to its content. */
|
|
29
|
+
snapPoints?: (string | number)[];
|
|
30
|
+
/** The dimmed overlay that closes the sheet on tap. Off leaves what is behind visible and usable. */
|
|
31
|
+
backdrop?: boolean;
|
|
32
|
+
/** The sheet and footer surface colour. */
|
|
33
|
+
background?: NativeColorToken;
|
|
27
34
|
}
|
|
28
35
|
/** The sheet surface. Fields inside it switch to the sheet's own input so the keyboard lifts the sheet. */
|
|
29
|
-
export declare function SheetContent({ children, scrollable, footer, keep, onDismiss }: SheetContentProps): import("react").JSX.Element;
|
|
36
|
+
export declare function SheetContent({ children, scrollable, footer, keep, onDismiss, snapPoints, backdrop, background }: SheetContentProps): import("react").JSX.Element;
|
|
30
37
|
export interface SheetPartProps extends Omit<ViewProps, 'children' | 'style'> {
|
|
31
38
|
children?: ReactNode;
|
|
32
39
|
style?: StyleProp<ViewStyle>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sheet.d.mts","names":[],"sources":["../../src/components/Sheet.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Sheet.d.mts","names":[],"sources":["../../src/components/Sheet.tsx"],"mappings":";;;;;iBAyBiB;;EAEf;EACA;EACA,gBAAgB;EAChB,WAAW;;wBAGG,QAAQ,MAAM,aAAqB,cAAc,YAAY,6BAAU,IAAA;;wBAOvE,eAAe,YAAY,SAAS,8BAAW,IAAA;;wBAc/C,aAAa,YAAY,SAAS,8BAAW,IAAA;iBAa5C;EACf,WAAW;;EAEX,SAAS;;EAET;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA,aAAa;;;wBAIC,eACd,UACA,YACA,QACA,MACA,WACA,YACA,UACA,cACC,oCAAiB,IAAA;iBAyBH,uBAAuB,KAAK;EAC3C,WAAW;EACX,QAAQ,UAAU;;iBAGH,yBAAyB;;EAExC;;EAEA;;wBAGc,cAAc,aAAoB,YAAsB,OAAO,aAAa,SAAS,mCAAgB,IAAA;wBAoBrG,aAAa,UAAU,SAAS,4BAAS,IAAA;wBAIzC,mBAAmB,UAAU,SAAS,4BAAS,IAAA;;wBAK/C,YAAY,OAAO,aAAa,SAAS,iCAAc,IAAA;wBAQvD,cAAc,OAAO,aAAa,SAAS,iCAAc,IAAA"}
|
|
@@ -49,7 +49,7 @@ function SheetClose({ onPress, ...props }) {
|
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
/** The sheet surface. Fields inside it switch to the sheet's own input so the keyboard lifts the sheet. */
|
|
52
|
-
function SheetContent({ children, scrollable = true, footer, keep, onDismiss }) {
|
|
52
|
+
function SheetContent({ children, scrollable = true, footer, keep, onDismiss, snapPoints, backdrop, background }) {
|
|
53
53
|
const { open, setOpen } = useContext(SheetContext);
|
|
54
54
|
const value = useMemo(() => ({
|
|
55
55
|
open,
|
|
@@ -66,6 +66,9 @@ function SheetContent({ children, scrollable = true, footer, keep, onDismiss })
|
|
|
66
66
|
scrollable,
|
|
67
67
|
keep,
|
|
68
68
|
onDismiss,
|
|
69
|
+
snapPoints,
|
|
70
|
+
backdrop,
|
|
71
|
+
background,
|
|
69
72
|
...pinned === void 0 ? {} : { footer: pinned },
|
|
70
73
|
children: /* @__PURE__ */ jsx(SheetContext.Provider, {
|
|
71
74
|
value,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sheet.mjs","names":["createContext","ReactNode","useCallback","useContext","useMemo","StyleProp","TextProps","ViewProps","ViewStyle","StyleSheet","CloseIcon","fontOf","useControllable","wrapText","Button","ButtonProps","SheetFrame","SheetState","open","setOpen","SheetContext","undefined","SheetProps","defaultOpen","onOpenChange","children","Sheet","current","value","SheetTrigger","onPress","props","event","SheetClose","SheetContentProps","footer","scrollable","keep","onDismiss","SheetContent","close","pinned","SheetPartProps","Omit","style","SheetHeaderProps","dismissible","closeLabel","SheetHeader","styles","header","SheetTitle","title","SheetDescription","description","SheetBody","body","SheetFooter","hint","create","theme","flexDirection","alignItems","gap","spacing","minWidth","height","borderBottomWidth","borderBottomColor","colors","border","paddingHorizontal","uni__dependencies","marginLeft","flexShrink","color","hi","fontFamily","sans","fontSize","lg","lineHeight","fontWeight","semibold","dim","sm","lineHeightRelaxed","paddingVertical","flexWrap","justifyContent","minHeight","borderTopWidth","borderTopColor","backgroundColor","deep","faint"],"sources":["../../src/components/Sheet.tsx"],"sourcesContent":["import { createContext, type ReactNode, useCallback, useContext, useMemo } from 'react';\nimport { type StyleProp, Text, type TextProps, View, type ViewProps, type ViewStyle } from 'react-native';\nimport { StyleSheet } from 'react-native-unistyles';\n\nimport { CloseIcon } from '../icons/icons';\nimport { fontOf } from '../lib/fonts';\nimport { useControllable } from '../lib/useControllable';\nimport { wrapText } from '../lib/wrapText';\nimport { Button, type ButtonProps } from './Button';\nimport { SheetFrame } from './SheetFrame';\n\n/*\n * The web Sheet as a bottom sheet: the native shape for a detail view or a\n * short form over what the reader was looking at. `side` and `width` are\n * dropped; a phone sheet rises from the bottom edge and takes the width.\n */\n\ninterface SheetState {\n open: boolean;\n setOpen: (open: boolean) => void;\n}\n\nexport const SheetContext = createContext<SheetState>({ open: false, setOpen: () => undefined });\n\nexport interface SheetProps {\n /** Controlled mode; pair with onOpenChange. Omit it and the sheet keeps its own state. */\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n children?: ReactNode;\n}\n\nexport function Sheet({ open, defaultOpen = false, onOpenChange, children }: SheetProps) {\n const [current, setOpen] = useControllable(open, defaultOpen, onOpenChange);\n const value = useMemo(() => ({ open: current, setOpen }), [current, setOpen]);\n return <SheetContext.Provider value={value}>{children}</SheetContext.Provider>;\n}\n\n/** A Button that opens the enclosing sheet. */\nexport function SheetTrigger({ onPress, ...props }: ButtonProps) {\n const { setOpen } = useContext(SheetContext);\n return (\n <Button\n onPress={(event) => {\n onPress?.(event);\n setOpen(true);\n }}\n {...props}\n />\n );\n}\n\n/** A Button that closes the enclosing sheet. */\nexport function SheetClose({ onPress, ...props }: ButtonProps) {\n const { setOpen } = useContext(SheetContext);\n return (\n <Button\n onPress={(event) => {\n onPress?.(event);\n setOpen(false);\n }}\n {...props}\n />\n );\n}\n\nexport interface SheetContentProps {\n children?: ReactNode;\n /** Pinned actions outside the scrolling body. The footer carries the bottom safe area. */\n footer?: ReactNode;\n /** False when an embedded SheetList owns vertical scrolling. */\n scrollable?: boolean;\n /** The sheet holds unsaved work: a prompt arriving in the conversation leaves it open with a note. */\n keep?: boolean;\n /** Runs after the native modal is dismissed, including a caller-initiated close. */\n onDismiss?: () => void;\n}\n\n/** The sheet surface. Fields inside it switch to the sheet's own input so the keyboard lifts the sheet. */\nexport function SheetContent({ children, scrollable = true, footer, keep, onDismiss }: SheetContentProps) {\n const { open, setOpen } = useContext(SheetContext);\n const value = useMemo(() => ({ open, setOpen }), [open, setOpen]);\n const close = useCallback(() => setOpen(false), [setOpen]);\n const pinned = useMemo(\n () => (footer === undefined ? undefined : <SheetContext.Provider value={value}>{footer}</SheetContext.Provider>),\n [footer, value],\n );\n return (\n <SheetFrame\n open={open}\n onClose={close}\n scrollable={scrollable}\n keep={keep}\n onDismiss={onDismiss}\n {...(pinned === undefined ? {} : { footer: pinned })}\n >\n <SheetContext.Provider value={value}>{children}</SheetContext.Provider>\n </SheetFrame>\n );\n}\n\nexport interface SheetPartProps extends Omit<ViewProps, 'children' | 'style'> {\n children?: ReactNode;\n style?: StyleProp<ViewStyle>;\n}\n\nexport interface SheetHeaderProps extends SheetPartProps {\n /** Show the close control at the right of the strip. On by default: a sheet is dismissed, not answered. */\n dismissible?: boolean;\n /** What the close control announces. */\n closeLabel?: string;\n}\n\nexport function SheetHeader({ dismissible = true, closeLabel = 'close', style, children, ...props }: SheetHeaderProps) {\n const { setOpen } = useContext(SheetContext);\n return (\n <View style={[styles.header, style]} {...props}>\n {children}\n {dismissible ? (\n <Button\n variant=\"ghost\"\n size=\"icon\"\n accessibilityLabel={closeLabel}\n onPress={() => setOpen(false)}\n style={styles.close}\n >\n <CloseIcon size={12} color=\"faint\" />\n </Button>\n ) : null}\n </View>\n );\n}\n\nexport function SheetTitle({ style, ...props }: TextProps) {\n return <Text accessibilityRole=\"header\" numberOfLines={1} style={[styles.title, style]} {...props} />;\n}\n\nexport function SheetDescription({ style, ...props }: TextProps) {\n return <Text style={[styles.description, style]} {...props} />;\n}\n\n/** The scrolling middle; the sheet itself scrolls, so this only spaces its children. */\nexport function SheetBody({ style, children, ...props }: SheetPartProps) {\n return (\n <View style={[styles.body, style]} {...props}>\n {wrapText(children, styles.description)}\n </View>\n );\n}\n\nexport function SheetFooter({ style, children, ...props }: SheetPartProps) {\n return (\n <View style={[styles.footer, style]} {...props}>\n {wrapText(children, styles.hint)}\n </View>\n );\n}\n\nconst styles = StyleSheet.create((theme) => ({\n header: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: theme.spacing(2.5),\n minWidth: 0,\n height: theme.spacing(11),\n borderBottomWidth: 1,\n borderBottomColor: theme.colors.border,\n paddingHorizontal: theme.spacing(4),\n },\n close: { marginLeft: 'auto' },\n title: {\n flexShrink: 1,\n color: theme.colors.hi,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.lg,\n lineHeight: theme.lineHeight.lg,\n fontWeight: theme.fontWeight.semibold,\n },\n description: {\n color: theme.colors.dim,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeightRelaxed.sm,\n },\n body: {\n gap: theme.spacing(3),\n paddingHorizontal: theme.spacing(4),\n paddingVertical: theme.spacing(3),\n },\n footer: {\n flexDirection: 'row',\n flexWrap: 'wrap',\n alignItems: 'center',\n justifyContent: 'space-between',\n gap: theme.spacing(2),\n minHeight: 34,\n borderTopWidth: 1,\n borderTopColor: theme.colors['border-soft'],\n backgroundColor: theme.colors.deep,\n paddingHorizontal: theme.spacing(4),\n paddingVertical: theme.spacing(1.5),\n },\n hint: {\n color: theme.colors.faint,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontS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AM;EACJiB,OAAOf,MAAMS,OAAO0B;EACpBlB,YAAYlE,OAAOiD,MAAMiB,WAAWC,IAAI;EACxCC,UAAUnB,MAAMmB,SAAS;EACzBE,YAAYrB,MAAMqB,WAAW;EAAMT,mBAAA,CAAA,CAAA;CACrC;AACF,EAAE"}
|
|
1
|
+
{"version":3,"file":"Sheet.mjs","names":["NativeColorToken","createContext","ReactNode","useCallback","useContext","useMemo","StyleProp","TextProps","ViewProps","ViewStyle","StyleSheet","CloseIcon","fontOf","useControllable","wrapText","Button","ButtonProps","SheetFrame","SheetState","open","setOpen","SheetContext","undefined","SheetProps","defaultOpen","onOpenChange","children","Sheet","current","value","SheetTrigger","onPress","props","event","SheetClose","SheetContentProps","footer","scrollable","keep","onDismiss","snapPoints","backdrop","background","SheetContent","close","pinned","SheetPartProps","Omit","style","SheetHeaderProps","dismissible","closeLabel","SheetHeader","styles","header","SheetTitle","title","SheetDescription","description","SheetBody","body","SheetFooter","hint","create","theme","flexDirection","alignItems","gap","spacing","minWidth","height","borderBottomWidth","borderBottomColor","colors","border","paddingHorizontal","uni__dependencies","marginLeft","flexShrink","color","hi","fontFamily","sans","fontSize","lg","lineHeight","fontWeight","semibold","dim","sm","lineHeightRelaxed","paddingVertical","flexWrap","justifyContent","minHeight","borderTopWidth","borderTopColor","backgroundColor","deep","faint"],"sources":["../../src/components/Sheet.tsx"],"sourcesContent":["import type { NativeColorToken } from '@agimon-ai/po-web-components/nativeTheme';\nimport { createContext, type ReactNode, useCallback, useContext, useMemo } from 'react';\nimport { type StyleProp, Text, type TextProps, View, type ViewProps, type ViewStyle } from 'react-native';\nimport { StyleSheet } from 'react-native-unistyles';\n\nimport { CloseIcon } from '../icons/icons';\nimport { fontOf } from '../lib/fonts';\nimport { useControllable } from '../lib/useControllable';\nimport { wrapText } from '../lib/wrapText';\nimport { Button, type ButtonProps } from './Button';\nimport { SheetFrame } from './SheetFrame';\n\n/*\n * The web Sheet as a bottom sheet: the native shape for a detail view or a\n * short form over what the reader was looking at. `side` and `width` are\n * dropped; a phone sheet rises from the bottom edge and takes the width.\n */\n\ninterface SheetState {\n open: boolean;\n setOpen: (open: boolean) => void;\n}\n\nexport const SheetContext = createContext<SheetState>({ open: false, setOpen: () => undefined });\n\nexport interface SheetProps {\n /** Controlled mode; pair with onOpenChange. Omit it and the sheet keeps its own state. */\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n children?: ReactNode;\n}\n\nexport function Sheet({ open, defaultOpen = false, onOpenChange, children }: SheetProps) {\n const [current, setOpen] = useControllable(open, defaultOpen, onOpenChange);\n const value = useMemo(() => ({ open: current, setOpen }), [current, setOpen]);\n return <SheetContext.Provider value={value}>{children}</SheetContext.Provider>;\n}\n\n/** A Button that opens the enclosing sheet. */\nexport function SheetTrigger({ onPress, ...props }: ButtonProps) {\n const { setOpen } = useContext(SheetContext);\n return (\n <Button\n onPress={(event) => {\n onPress?.(event);\n setOpen(true);\n }}\n {...props}\n />\n );\n}\n\n/** A Button that closes the enclosing sheet. */\nexport function SheetClose({ onPress, ...props }: ButtonProps) {\n const { setOpen } = useContext(SheetContext);\n return (\n <Button\n onPress={(event) => {\n onPress?.(event);\n setOpen(false);\n }}\n {...props}\n />\n );\n}\n\nexport interface SheetContentProps {\n children?: ReactNode;\n /** Pinned actions outside the scrolling body. The footer carries the bottom safe area. */\n footer?: ReactNode;\n /** False when an embedded SheetList owns vertical scrolling. */\n scrollable?: boolean;\n /** The sheet holds unsaved work: a prompt arriving in the conversation leaves it open with a note. */\n keep?: boolean;\n /** Runs after the native modal is dismissed, including a caller-initiated close. */\n onDismiss?: () => void;\n /** Fixed heights such as `['58%']`; given, the sheet stops sizing itself to its content. */\n snapPoints?: (string | number)[];\n /** The dimmed overlay that closes the sheet on tap. Off leaves what is behind visible and usable. */\n backdrop?: boolean;\n /** The sheet and footer surface colour. */\n background?: NativeColorToken;\n}\n\n/** The sheet surface. Fields inside it switch to the sheet's own input so the keyboard lifts the sheet. */\nexport function SheetContent({\n children,\n scrollable = true,\n footer,\n keep,\n onDismiss,\n snapPoints,\n backdrop,\n background,\n}: SheetContentProps) {\n const { open, setOpen } = useContext(SheetContext);\n const value = useMemo(() => ({ open, setOpen }), [open, setOpen]);\n const close = useCallback(() => setOpen(false), [setOpen]);\n const pinned = useMemo(\n () => (footer === undefined ? undefined : <SheetContext.Provider value={value}>{footer}</SheetContext.Provider>),\n [footer, value],\n );\n return (\n <SheetFrame\n open={open}\n onClose={close}\n scrollable={scrollable}\n keep={keep}\n onDismiss={onDismiss}\n snapPoints={snapPoints}\n backdrop={backdrop}\n background={background}\n {...(pinned === undefined ? {} : { footer: pinned })}\n >\n <SheetContext.Provider value={value}>{children}</SheetContext.Provider>\n </SheetFrame>\n );\n}\n\nexport interface SheetPartProps extends Omit<ViewProps, 'children' | 'style'> {\n children?: ReactNode;\n style?: StyleProp<ViewStyle>;\n}\n\nexport interface SheetHeaderProps extends SheetPartProps {\n /** Show the close control at the right of the strip. On by default: a sheet is dismissed, not answered. */\n dismissible?: boolean;\n /** What the close control announces. */\n closeLabel?: string;\n}\n\nexport function SheetHeader({ dismissible = true, closeLabel = 'close', style, children, ...props }: SheetHeaderProps) {\n const { setOpen } = useContext(SheetContext);\n return (\n <View style={[styles.header, style]} {...props}>\n {children}\n {dismissible ? (\n <Button\n variant=\"ghost\"\n size=\"icon\"\n accessibilityLabel={closeLabel}\n onPress={() => setOpen(false)}\n style={styles.close}\n >\n <CloseIcon size={12} color=\"faint\" />\n </Button>\n ) : null}\n </View>\n );\n}\n\nexport function SheetTitle({ style, ...props }: TextProps) {\n return <Text accessibilityRole=\"header\" numberOfLines={1} style={[styles.title, style]} {...props} />;\n}\n\nexport function SheetDescription({ style, ...props }: TextProps) {\n return <Text style={[styles.description, style]} {...props} />;\n}\n\n/** The scrolling middle; the sheet itself scrolls, so this only spaces its children. */\nexport function SheetBody({ style, children, ...props }: SheetPartProps) {\n return (\n <View style={[styles.body, style]} {...props}>\n {wrapText(children, styles.description)}\n </View>\n );\n}\n\nexport function SheetFooter({ style, children, ...props }: SheetPartProps) {\n return (\n <View style={[styles.footer, style]} {...props}>\n {wrapText(children, styles.hint)}\n </View>\n );\n}\n\nconst styles = StyleSheet.create((theme) => ({\n header: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: theme.spacing(2.5),\n minWidth: 0,\n height: theme.spacing(11),\n borderBottomWidth: 1,\n borderBottomColor: theme.colors.border,\n paddingHorizontal: theme.spacing(4),\n },\n close: { marginLeft: 'auto' },\n title: {\n flexShrink: 1,\n color: theme.colors.hi,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.lg,\n lineHeight: theme.lineHeight.lg,\n fontWeight: theme.fontWeight.semibold,\n },\n description: {\n color: theme.colors.dim,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeightRelaxed.sm,\n },\n body: {\n gap: theme.spacing(3),\n paddingHorizontal: theme.spacing(4),\n paddingVertical: theme.spacing(3),\n },\n footer: {\n flexDirection: 'row',\n flexWrap: 'wrap',\n alignItems: 'center',\n justifyContent: 'space-between',\n gap: theme.spacing(2),\n minHeight: 34,\n borderTopWidth: 1,\n borderTopColor: theme.colors['border-soft'],\n backgroundColor: theme.colors.deep,\n paddingHorizontal: theme.spacing(4),\n paddingVertical: theme.spacing(1.5),\n },\n hint: {\n color: theme.colors.faint,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize['2xs'],\n lineHeight: theme.lineHeight['2xs'],\n },\n}));\n"],"mappings":";;;;;;;;;;;;;AAuBA,MAAaqB,eAAepB,cAA0B;CAAEkB,MAAM;CAAOC,eAAeE;AAAU,CAAC;AAU/F,SAAgBK,MAAM,EAAER,MAAMK,cAAc,OAAOC,cAAcC,YAAwB;CACvF,MAAM,CAACE,SAASR,WAAWP,gBAAgBM,MAAMK,aAAaC,YAAY;CAC1E,MAAMI,QAAQxB,eAAe;EAAEc,MAAMS;EAASR;CAAQ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,mBAAA,CAAA,CAAA;CACrC;CACAhC,OAAO,EAAEiC,YAAY,OAAO;CAC5BrB,OAAO;EACLsB,YAAY;EACZC,OAAOf,MAAMS,OAAOO;EACpBC,YAAYrE,OAAOoD,MAAMiB,WAAWC,IAAI;EACxCC,UAAUnB,MAAMmB,SAASC;EACzBC,YAAYrB,MAAMqB,WAAWD;EAC7BE,YAAYtB,MAAMsB,WAAWC;EAAQX,mBAAA,CAAA,CAAA;CACvC;CACAlB,aAAa;EACXqB,OAAOf,MAAMS,OAAOe;EACpBP,YAAYrE,OAAOoD,MAAMiB,WAAWC,IAAI;EACxCC,UAAUnB,MAAMmB,SAASM;EACzBJ,YAAYrB,MAAM0B,kBAAkBD;EAAEb,mBAAA,CAAA,CAAA;CACxC;CACAhB,MAAM;EACJO,KAAKH,MAAMI,QAAQ,CAAC;EACpBO,mBAAmBX,MAAMI,QAAQ,CAAC;EAClCuB,iBAAiB3B,MAAMI,QAAQ,CAAC;EAACQ,mBAAA,CAAA,CAAA;CACnC;CACAxC,QAAQ;EACN6B,eAAe;EACf2B,UAAU;EACV1B,YAAY;EACZ2B,gBAAgB;EAChB1B,KAAKH,MAAMI,QAAQ,CAAC;EACpB0B,WAAW;EACXC,gBAAgB;EAChBC,gBAAgBhC,MAAMS,OAAO;EAC7BwB,iBAAiBjC,MAAMS,OAAOyB;EAC9BvB,mBAAmBX,MAAMI,QAAQ,CAAC;EAClCuB,iBAAiB3B,MAAMI,QAAQ,GAAG;EAACQ,mBAAA,CAAA,CAAA;CACrC;CACAd,MAAM;EACJiB,OAAOf,MAAMS,OAAO0B;EACpBlB,YAAYrE,OAAOoD,MAAMiB,WAAWC,IAAI;EACxCC,UAAUnB,MAAMmB,SAAS;EACzBE,YAAYrB,MAAMqB,WAAW;EAAMT,mBAAA,CAAA,CAAA;CACrC;AACF,EAAE"}
|
|
@@ -42,7 +42,7 @@ function FooterBody({ holder }) {
|
|
|
42
42
|
* back, clear of the safe area and lifted by the keyboard. Private: the public
|
|
43
43
|
* parts keep bottom-sheet types out of the package API.
|
|
44
44
|
*/
|
|
45
|
-
function SheetFrame({ open, onClose, onDismiss, children, scrollable = true, footer, keep = false }) {
|
|
45
|
+
function SheetFrame({ open, onClose, onDismiss, children, scrollable = true, footer, keep = false, snapPoints, backdrop = true, background = "rail" }) {
|
|
46
46
|
const { theme } = useUnistyles();
|
|
47
47
|
const insets = useContext(SafeAreaInsetsContext);
|
|
48
48
|
const sheet = useRef(null);
|
|
@@ -109,25 +109,26 @@ function SheetFrame({ open, onClose, onDismiss, children, scrollable = true, foo
|
|
|
109
109
|
style: [props.style, { backgroundColor: backdropColor }]
|
|
110
110
|
}), [backdropColor]);
|
|
111
111
|
const footerInset = insets?.bottom ?? 0;
|
|
112
|
+
const surface = theme.colors[background];
|
|
112
113
|
const renderFooter = useCallback((props) => /* @__PURE__ */ jsx(BottomSheetFooter, {
|
|
113
114
|
...props,
|
|
114
115
|
children: /* @__PURE__ */ jsx(View, {
|
|
115
116
|
onLayout: (event) => setFooterHeight(event.nativeEvent.layout.height),
|
|
116
117
|
style: {
|
|
117
118
|
paddingBottom: footerInset,
|
|
118
|
-
backgroundColor:
|
|
119
|
+
backgroundColor: surface
|
|
119
120
|
},
|
|
120
121
|
children: /* @__PURE__ */ jsx(FooterBody, { holder })
|
|
121
122
|
})
|
|
122
123
|
}), [
|
|
123
124
|
holder,
|
|
124
125
|
footerInset,
|
|
125
|
-
|
|
126
|
+
surface
|
|
126
127
|
]);
|
|
127
128
|
const backgroundStyle = useMemo(() => ({
|
|
128
|
-
backgroundColor:
|
|
129
|
+
backgroundColor: surface,
|
|
129
130
|
borderRadius: theme.borderRadius.lg
|
|
130
|
-
}), [
|
|
131
|
+
}), [surface, theme.borderRadius.lg]);
|
|
131
132
|
const handleIndicatorStyle = useMemo(() => ({ backgroundColor: theme.colors.border }), [theme.colors.border]);
|
|
132
133
|
const onChange = useCallback((index) => {
|
|
133
134
|
if (index >= 0 && dismissing.current) sheet.current?.dismiss();
|
|
@@ -155,7 +156,11 @@ function SheetFrame({ open, onClose, onDismiss, children, scrollable = true, foo
|
|
|
155
156
|
keyboardBehavior: "interactive",
|
|
156
157
|
keyboardBlurBehavior: "restore",
|
|
157
158
|
android_keyboardInputMode: "adjustResize",
|
|
158
|
-
backdropComponent: renderBackdrop,
|
|
159
|
+
...backdrop ? { backdropComponent: renderBackdrop } : {},
|
|
160
|
+
...snapPoints === void 0 ? {} : {
|
|
161
|
+
snapPoints,
|
|
162
|
+
enableDynamicSizing: false
|
|
163
|
+
},
|
|
159
164
|
...footer === void 0 ? {} : { footerComponent: renderFooter },
|
|
160
165
|
backgroundStyle,
|
|
161
166
|
handleIndicatorStyle,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SheetFrame.mjs","names":["dismissSheet","InsideSheetContext","OpenSheet","registerSheet","unregisterSheet","withAlpha","BottomSheetBackdrop","BottomSheetBackdropProps","BottomSheetModal","BottomSheetFooter","BottomSheetFooterProps","BottomSheetScrollView","ReactNode","useCallback","useContext","useEffect","useLayoutEffect","useMemo","useRef","useState","useSyncExternalStore","BackHandler","Keyboard","SafeAreaInsetsContext","StyleSheet","useUnistyles","fontOf","BACKDROP_ALPHA_PERCENT","SheetFrameProps","open","onClose","onDismiss","children","footer","scrollable","keep","sheetsYielded","yieldSheets","FooterHolder","get","set","subscribe","listener","footerHolder","initial","listeners","Set","next","add","delete","FooterBody","holder","SheetFrame","theme","insets","sheet","openRef","presented","dismissing","footerHeight","setFooterHeight","note","setNote","latest","current","entry","close","footers","undefined","dismiss","present","subscription","addEventListener","remove","backdropColor","colors","deep","renderBackdrop","props","style","backgroundColor","footerInset","bottom","renderFooter","event","nativeEvent","layout","height","paddingBottom","rail","backgroundStyle","borderRadius","lg","handleIndicatorStyle","border","onChange","index","onSheetDismiss","reopen","top","footerComponent","styles","content","SheetNote","create","flexGrow","marginHorizontal","spacing","marginBottom","color","magenta","fontFamily","sans","fontSize","sm","lineHeight","uni__dependencies"],"sources":["../../src/components/SheetFrame.tsx"],"sourcesContent":["import {\n dismissSheet,\n InsideSheetContext,\n type OpenSheet,\n registerSheet,\n unregisterSheet,\n} from '@agimon-ai/po-native-components/shell';\nimport { withAlpha } from '@agimon-ai/po-web-components/nativeTheme';\nimport {\n BottomSheetBackdrop,\n type BottomSheetBackdropProps,\n BottomSheetModal,\n BottomSheetFooter,\n type BottomSheetFooterProps,\n BottomSheetScrollView,\n} from '@gorhom/bottom-sheet';\nimport {\n type ReactNode,\n useCallback,\n useContext,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n useSyncExternalStore,\n} from 'react';\nimport { BackHandler, Keyboard, Text, View } from 'react-native';\nimport { SafeAreaInsetsContext } from 'react-native-safe-area-context';\nimport { StyleSheet, useUnistyles } from 'react-native-unistyles';\n\nimport { fontOf } from '../lib/fonts';\n\n/** `bg-po-deep/70`, the overlay every web sheet and dialog draws. */\nconst BACKDROP_ALPHA_PERCENT = 70;\n\nexport interface SheetFrameProps {\n open: boolean;\n /** The sheet asked to close: a drag down, a backdrop tap or Android back. */\n onClose: () => void;\n onDismiss?: () => void;\n children?: ReactNode;\n footer?: ReactNode;\n /** False when the content supplies its own Gorhom virtualized scroll owner. */\n scrollable?: boolean;\n /** The sheet holds work not yet saved, so a prompt arriving leaves it open with a note instead of closing it. */\n keep?: boolean;\n}\n\nexport { sheetsYielded, yieldSheets } from '@agimon-ai/po-native-components/shell';\n\n/** The latest footer, read by a footer component whose identity never changes while the sheet lives. */\ninterface FooterHolder {\n get: () => ReactNode;\n set: (footer: ReactNode) => void;\n subscribe: (listener: () => void) => () => void;\n}\n\nfunction footerHolder(initial: ReactNode): FooterHolder {\n let footer = initial;\n const listeners = new Set<() => void>();\n return {\n get: () => footer,\n set: (next) => {\n if (next === footer) return;\n footer = next;\n for (const listener of listeners) listener();\n },\n subscribe: (listener) => {\n listeners.add(listener);\n return () => listeners.delete(listener);\n },\n };\n}\n\nfunction FooterBody({ holder }: { holder: FooterHolder }) {\n const footer = useSyncExternalStore(holder.subscribe, holder.get);\n return <InsideSheetContext.Provider value>{footer}</InsideSheetContext.Provider>;\n}\n\n/**\n * The bottom sheet both Sheet and DropdownMenu sit in: a drag handle, sized\n * to its content, closed by dragging down, tapping the backdrop or Android\n * back, clear of the safe area and lifted by the keyboard. Private: the public\n * parts keep bottom-sheet types out of the package API.\n */\nexport function SheetFrame({\n open,\n onClose,\n onDismiss,\n children,\n scrollable = true,\n footer,\n keep = false,\n}: SheetFrameProps) {\n const { theme } = useUnistyles();\n const insets = useContext(SafeAreaInsetsContext);\n const sheet = useRef<BottomSheetModal>(null);\n const openRef = useRef(open);\n const presented = useRef(false);\n const dismissing = useRef(false);\n const [footerHeight, setFooterHeight] = useState(0);\n const [note, setNote] = useState<string>();\n const latest = useRef({ keep, onClose, onDismiss });\n latest.current = { keep, onClose, onDismiss };\n const entry = useRef<OpenSheet>({\n keep: () => latest.current.keep,\n close: () => latest.current.onClose(),\n setNote,\n });\n // Gorhom takes the footer as a component; a new one each render would remount its fields mid-typing.\n const footers = useRef<FooterHolder>(undefined);\n footers.current ??= footerHolder(footer);\n const holder = footers.current;\n useLayoutEffect(() => holder.set(footer), [holder, footer]);\n\n useEffect(() => {\n openRef.current = open;\n if (open && !dismissing.current) {\n presented.current = true;\n registerSheet(entry.current);\n // The keyboard of the field behind would cover the sheet; a field inside it focuses after this.\n Keyboard.dismiss();\n sheet.current?.present();\n } else if (!open) {\n unregisterSheet(entry.current);\n setNote(undefined);\n if (presented.current && !dismissing.current) {\n // A new open waits for native dismissal, otherwise its callback closes the new request.\n dismissing.current = true;\n sheet.current?.dismiss();\n }\n }\n }, [open]);\n\n useEffect(\n () => () => {\n openRef.current = false;\n unregisterSheet(entry.current);\n dismissSheet?.(entry.current);\n },\n [],\n );\n\n useEffect(() => {\n if (!open) return undefined;\n const subscription = BackHandler.addEventListener('hardwareBackPress', () => {\n latest.current.onClose();\n return true;\n });\n return () => subscription.remove();\n }, [open]);\n\n const backdropColor = withAlpha(theme.colors.deep, BACKDROP_ALPHA_PERCENT);\n const renderBackdrop = useCallback(\n (props: BottomSheetBackdropProps) => (\n <BottomSheetBackdrop\n {...props}\n appearsOnIndex={0}\n disappearsOnIndex={-1}\n opacity={1}\n pressBehavior=\"close\"\n style={[props.style, { backgroundColor: backdropColor }]}\n />\n ),\n [backdropColor],\n );\n\n const footerInset = insets?.bottom ?? 0;\n const renderFooter = useCallback(\n (props: BottomSheetFooterProps) => (\n <BottomSheetFooter {...props}>\n <View\n onLayout={(event) => setFooterHeight(event.nativeEvent.layout.height)}\n style={{ paddingBottom: footerInset, backgroundColor: theme.colors.rail }}\n >\n <FooterBody holder={holder} />\n </View>\n </BottomSheetFooter>\n ),\n [holder, footerInset, theme.colors.rail],\n );\n const backgroundStyle = useMemo(\n () => ({ backgroundColor: theme.colors.rail, borderRadius: theme.borderRadius.lg }),\n [theme.colors.rail, theme.borderRadius.lg],\n );\n const handleIndicatorStyle = useMemo(() => ({ backgroundColor: theme.colors.border }), [theme.colors.border]);\n const onChange = useCallback((index: number) => {\n // present() mounts on the next frame, so an earlier dismiss() may have had nothing to close.\n if (index >= 0 && dismissing.current) sheet.current?.dismiss();\n }, []);\n // A sheet the caller closed is already shut; only a close the sheet started is reported.\n const onSheetDismiss = useCallback(() => {\n const reopen = dismissing.current && openRef.current;\n dismissing.current = false;\n presented.current = false;\n dismissSheet?.(entry.current);\n if (reopen) {\n presented.current = true;\n registerSheet(entry.current);\n sheet.current?.present();\n return;\n }\n if (openRef.current) latest.current.onClose();\n latest.current.onDismiss?.();\n }, []);\n\n return (\n <BottomSheetModal\n ref={sheet}\n // The library marks the whole sheet as one accessible element, which hides its fields and buttons on iOS.\n accessible={false}\n stackBehavior=\"push\"\n enablePanDownToClose\n topInset={insets?.top ?? 0}\n keyboardBehavior=\"interactive\"\n keyboardBlurBehavior=\"restore\"\n android_keyboardInputMode=\"adjustResize\"\n backdropComponent={renderBackdrop}\n {...(footer === undefined ? {} : { footerComponent: renderFooter })}\n backgroundStyle={backgroundStyle}\n handleIndicatorStyle={handleIndicatorStyle}\n onChange={onChange}\n onDismiss={onSheetDismiss}\n >\n {scrollable ? (\n <BottomSheetScrollView\n keyboardShouldPersistTaps=\"handled\"\n contentContainerStyle={[\n styles.content,\n { paddingBottom: footer === undefined ? (insets?.bottom ?? 0) : footerHeight },\n ]}\n >\n {note ? <SheetNote note={note} /> : null}\n <InsideSheetContext.Provider value>{children}</InsideSheetContext.Provider>\n </BottomSheetScrollView>\n ) : (\n <>\n {note ? <SheetNote note={note} /> : null}\n <InsideSheetContext.Provider value>{children}</InsideSheetContext.Provider>\n </>\n )}\n </BottomSheetModal>\n );\n}\n\n/** A gentle rose line: the person is asked something below, never told to hurry. */\nfunction SheetNote({ note }: { note: string }) {\n return (\n <Text style={styles.note} accessibilityRole=\"alert\">\n {note}\n </Text>\n );\n}\n\nconst styles = StyleSheet.create((theme) => ({\n content: { flexGrow: 1 },\n note: {\n marginHorizontal: theme.spacing(4),\n marginBottom: theme.spacing(2),\n color: theme.colors.magenta,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeight.sm,\n },\n}));\n"],"mappings":";;;;;;;;;;;;;;AAkCA,MAAM2B,yBAAyB;AAwB/B,SAASgB,aAAaC,SAAkC;CACtD,IAAIX,SAASW;CACb,MAAMC,4BAAY,IAAIC,IAAgB;CACtC,OAAO;EACLP,WAAWN;EACXO,MAAMO,SAAS;GACb,IAAIA,SAASd,QAAQ;GACrBA,SAASc;GACT,KAAK,MAAML,YAAYG,WAAWH,SAAS;EAC7C;EACAD,YAAYC,aAAa;GACvBG,UAAUG,IAAIN,QAAQ;GACtB,aAAaG,UAAUI,OAAOP,QAAQ;EACxC;CACF;AACF;AAEA,SAASQ,WAAW,EAAEC,UAAoC;CACxD,MAAMlB,SAASb,qBAAqB+B,OAAOV,WAAWU,OAAOZ,GAAG;CAChE,OAAO,oBAAC,mBAAmB,UAApB;EAA6B;YAAON;CAA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EV;AAEA,MAAMwC,SAAS7E,WAAWgF,QAAQnD,WAAW;CAC3CiD,SAAS,EAAEG,UAAU,EAAE;CACvB5C,MAAM;EACJ6C,kBAAkBrD,MAAMsD,QAAQ,CAAC;EACjCC,cAAcvD,MAAMsD,QAAQ,CAAC;EAC7BE,OAAOxD,MAAMsB,OAAOmC;EACpBC,YAAYrF,OAAO2B,MAAM0D,WAAWC,IAAI;EACxCC,UAAU5D,MAAM4D,SAASC;EACzBC,YAAY9D,MAAM8D,WAAWD;EAAEE,mBAAA,CAAA,CAAA;CACjC;AACF,EAAE"}
|
|
1
|
+
{"version":3,"file":"SheetFrame.mjs","names":["dismissSheet","InsideSheetContext","OpenSheet","registerSheet","unregisterSheet","NativeColorToken","withAlpha","BottomSheetBackdrop","BottomSheetBackdropProps","BottomSheetModal","BottomSheetFooter","BottomSheetFooterProps","BottomSheetScrollView","ReactNode","useCallback","useContext","useEffect","useLayoutEffect","useMemo","useRef","useState","useSyncExternalStore","BackHandler","Keyboard","SafeAreaInsetsContext","StyleSheet","useUnistyles","fontOf","BACKDROP_ALPHA_PERCENT","SheetFrameProps","open","onClose","onDismiss","children","footer","scrollable","keep","snapPoints","backdrop","background","sheetsYielded","yieldSheets","FooterHolder","get","set","subscribe","listener","footerHolder","initial","listeners","Set","next","add","delete","FooterBody","holder","SheetFrame","theme","insets","sheet","openRef","presented","dismissing","footerHeight","setFooterHeight","note","setNote","latest","current","entry","close","footers","undefined","dismiss","present","subscription","addEventListener","remove","backdropColor","colors","deep","renderBackdrop","props","style","backgroundColor","footerInset","bottom","surface","renderFooter","event","nativeEvent","layout","height","paddingBottom","backgroundStyle","borderRadius","lg","handleIndicatorStyle","border","onChange","index","onSheetDismiss","reopen","top","backdropComponent","enableDynamicSizing","footerComponent","styles","content","SheetNote","create","flexGrow","marginHorizontal","spacing","marginBottom","color","magenta","fontFamily","sans","fontSize","sm","lineHeight","uni__dependencies"],"sources":["../../src/components/SheetFrame.tsx"],"sourcesContent":["import {\n dismissSheet,\n InsideSheetContext,\n type OpenSheet,\n registerSheet,\n unregisterSheet,\n} from '@agimon-ai/po-native-components/shell';\nimport { type NativeColorToken, withAlpha } from '@agimon-ai/po-web-components/nativeTheme';\nimport {\n BottomSheetBackdrop,\n type BottomSheetBackdropProps,\n BottomSheetModal,\n BottomSheetFooter,\n type BottomSheetFooterProps,\n BottomSheetScrollView,\n} from '@gorhom/bottom-sheet';\nimport {\n type ReactNode,\n useCallback,\n useContext,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n useSyncExternalStore,\n} from 'react';\nimport { BackHandler, Keyboard, Text, View } from 'react-native';\nimport { SafeAreaInsetsContext } from 'react-native-safe-area-context';\nimport { StyleSheet, useUnistyles } from 'react-native-unistyles';\n\nimport { fontOf } from '../lib/fonts';\n\n/** `bg-po-deep/70`, the overlay every web sheet and dialog draws. */\nconst BACKDROP_ALPHA_PERCENT = 70;\n\nexport interface SheetFrameProps {\n open: boolean;\n /** The sheet asked to close: a drag down, a backdrop tap or Android back. */\n onClose: () => void;\n onDismiss?: () => void;\n children?: ReactNode;\n footer?: ReactNode;\n /** False when the content supplies its own Gorhom virtualized scroll owner. */\n scrollable?: boolean;\n /** The sheet holds work not yet saved, so a prompt arriving leaves it open with a note instead of closing it. */\n keep?: boolean;\n /** Fixed heights such as `['58%']`; given, the sheet stops sizing itself to its content. */\n snapPoints?: (string | number)[];\n /** The dimmed overlay that closes the sheet on tap. Off leaves what is behind visible and usable. */\n backdrop?: boolean;\n /** The sheet and footer surface colour. */\n background?: NativeColorToken;\n}\n\nexport { sheetsYielded, yieldSheets } from '@agimon-ai/po-native-components/shell';\n\n/** The latest footer, read by a footer component whose identity never changes while the sheet lives. */\ninterface FooterHolder {\n get: () => ReactNode;\n set: (footer: ReactNode) => void;\n subscribe: (listener: () => void) => () => void;\n}\n\nfunction footerHolder(initial: ReactNode): FooterHolder {\n let footer = initial;\n const listeners = new Set<() => void>();\n return {\n get: () => footer,\n set: (next) => {\n if (next === footer) return;\n footer = next;\n for (const listener of listeners) listener();\n },\n subscribe: (listener) => {\n listeners.add(listener);\n return () => listeners.delete(listener);\n },\n };\n}\n\nfunction FooterBody({ holder }: { holder: FooterHolder }) {\n const footer = useSyncExternalStore(holder.subscribe, holder.get);\n return <InsideSheetContext.Provider value>{footer}</InsideSheetContext.Provider>;\n}\n\n/**\n * The bottom sheet both Sheet and DropdownMenu sit in: a drag handle, sized\n * to its content, closed by dragging down, tapping the backdrop or Android\n * back, clear of the safe area and lifted by the keyboard. Private: the public\n * parts keep bottom-sheet types out of the package API.\n */\nexport function SheetFrame({\n open,\n onClose,\n onDismiss,\n children,\n scrollable = true,\n footer,\n keep = false,\n snapPoints,\n backdrop = true,\n background = 'rail',\n}: SheetFrameProps) {\n const { theme } = useUnistyles();\n const insets = useContext(SafeAreaInsetsContext);\n const sheet = useRef<BottomSheetModal>(null);\n const openRef = useRef(open);\n const presented = useRef(false);\n const dismissing = useRef(false);\n const [footerHeight, setFooterHeight] = useState(0);\n const [note, setNote] = useState<string>();\n const latest = useRef({ keep, onClose, onDismiss });\n latest.current = { keep, onClose, onDismiss };\n const entry = useRef<OpenSheet>({\n keep: () => latest.current.keep,\n close: () => latest.current.onClose(),\n setNote,\n });\n // Gorhom takes the footer as a component; a new one each render would remount its fields mid-typing.\n const footers = useRef<FooterHolder>(undefined);\n footers.current ??= footerHolder(footer);\n const holder = footers.current;\n useLayoutEffect(() => holder.set(footer), [holder, footer]);\n\n useEffect(() => {\n openRef.current = open;\n if (open && !dismissing.current) {\n presented.current = true;\n registerSheet(entry.current);\n // The keyboard of the field behind would cover the sheet; a field inside it focuses after this.\n Keyboard.dismiss();\n sheet.current?.present();\n } else if (!open) {\n unregisterSheet(entry.current);\n setNote(undefined);\n if (presented.current && !dismissing.current) {\n // A new open waits for native dismissal, otherwise its callback closes the new request.\n dismissing.current = true;\n sheet.current?.dismiss();\n }\n }\n }, [open]);\n\n useEffect(\n () => () => {\n openRef.current = false;\n unregisterSheet(entry.current);\n dismissSheet?.(entry.current);\n },\n [],\n );\n\n useEffect(() => {\n if (!open) return undefined;\n const subscription = BackHandler.addEventListener('hardwareBackPress', () => {\n latest.current.onClose();\n return true;\n });\n return () => subscription.remove();\n }, [open]);\n\n const backdropColor = withAlpha(theme.colors.deep, BACKDROP_ALPHA_PERCENT);\n const renderBackdrop = useCallback(\n (props: BottomSheetBackdropProps) => (\n <BottomSheetBackdrop\n {...props}\n appearsOnIndex={0}\n disappearsOnIndex={-1}\n opacity={1}\n pressBehavior=\"close\"\n style={[props.style, { backgroundColor: backdropColor }]}\n />\n ),\n [backdropColor],\n );\n\n const footerInset = insets?.bottom ?? 0;\n const surface = theme.colors[background];\n const renderFooter = useCallback(\n (props: BottomSheetFooterProps) => (\n <BottomSheetFooter {...props}>\n <View\n onLayout={(event) => setFooterHeight(event.nativeEvent.layout.height)}\n style={{ paddingBottom: footerInset, backgroundColor: surface }}\n >\n <FooterBody holder={holder} />\n </View>\n </BottomSheetFooter>\n ),\n [holder, footerInset, surface],\n );\n const backgroundStyle = useMemo(\n () => ({ backgroundColor: surface, borderRadius: theme.borderRadius.lg }),\n [surface, theme.borderRadius.lg],\n );\n const handleIndicatorStyle = useMemo(() => ({ backgroundColor: theme.colors.border }), [theme.colors.border]);\n const onChange = useCallback((index: number) => {\n // present() mounts on the next frame, so an earlier dismiss() may have had nothing to close.\n if (index >= 0 && dismissing.current) sheet.current?.dismiss();\n }, []);\n // A sheet the caller closed is already shut; only a close the sheet started is reported.\n const onSheetDismiss = useCallback(() => {\n const reopen = dismissing.current && openRef.current;\n dismissing.current = false;\n presented.current = false;\n dismissSheet?.(entry.current);\n if (reopen) {\n presented.current = true;\n registerSheet(entry.current);\n sheet.current?.present();\n return;\n }\n if (openRef.current) latest.current.onClose();\n latest.current.onDismiss?.();\n }, []);\n\n return (\n <BottomSheetModal\n ref={sheet}\n // The library marks the whole sheet as one accessible element, which hides its fields and buttons on iOS.\n accessible={false}\n stackBehavior=\"push\"\n enablePanDownToClose\n topInset={insets?.top ?? 0}\n keyboardBehavior=\"interactive\"\n keyboardBlurBehavior=\"restore\"\n android_keyboardInputMode=\"adjustResize\"\n {...(backdrop ? { backdropComponent: renderBackdrop } : {})}\n {...(snapPoints === undefined ? {} : { snapPoints, enableDynamicSizing: false })}\n {...(footer === undefined ? {} : { footerComponent: renderFooter })}\n backgroundStyle={backgroundStyle}\n handleIndicatorStyle={handleIndicatorStyle}\n onChange={onChange}\n onDismiss={onSheetDismiss}\n >\n {scrollable ? (\n <BottomSheetScrollView\n keyboardShouldPersistTaps=\"handled\"\n contentContainerStyle={[\n styles.content,\n { paddingBottom: footer === undefined ? (insets?.bottom ?? 0) : footerHeight },\n ]}\n >\n {note ? <SheetNote note={note} /> : null}\n <InsideSheetContext.Provider value>{children}</InsideSheetContext.Provider>\n </BottomSheetScrollView>\n ) : (\n <>\n {note ? <SheetNote note={note} /> : null}\n <InsideSheetContext.Provider value>{children}</InsideSheetContext.Provider>\n </>\n )}\n </BottomSheetModal>\n );\n}\n\n/** A gentle rose line: the person is asked something below, never told to hurry. */\nfunction SheetNote({ note }: { note: string }) {\n return (\n <Text style={styles.note} accessibilityRole=\"alert\">\n {note}\n </Text>\n );\n}\n\nconst styles = StyleSheet.create((theme) => ({\n content: { flexGrow: 1 },\n note: {\n marginHorizontal: theme.spacing(4),\n marginBottom: theme.spacing(2),\n color: theme.colors.magenta,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeight.sm,\n },\n}));\n"],"mappings":";;;;;;;;;;;;;;AAkCA,MAAM4B,yBAAyB;AA8B/B,SAASmB,aAAaC,SAAkC;CACtD,IAAId,SAASc;CACb,MAAMC,4BAAY,IAAIC,IAAgB;CACtC,OAAO;EACLP,WAAWT;EACXU,MAAMO,SAAS;GACb,IAAIA,SAASjB,QAAQ;GACrBA,SAASiB;GACT,KAAK,MAAML,YAAYG,WAAWH,SAAS;EAC7C;EACAD,YAAYC,aAAa;GACvB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,OAAO,oBAAC,WAAD,EAAiBA,KAAK,KAAM,MACpC,oBAAC,mBAAmB,UAApB;IAA6B;IAAOhC;GAAsC,EACrD;OAEvB,4CACGgC,OAAO,oBAAC,WAAD,EAAiBA,KAAK,KAAM,MACpC,oBAAC,mBAAmB,UAApB;GAA6B;GAAOhC;EAAsC,EAC5E;CAEc;AAEtB;;AAGA,SAAS4E,UAAU,EAAE5C,QAA0B;CAC7C,OACE,oBAAC,MAAD;EAAM,OAAO0C,OAAO1C;EAAM,mBAAkB;YACzCA;CACG;AAEV;AAEA,MAAM0C,SAASlF,WAAWqF,QAAQrD,WAAW;CAC3CmD,SAAS,EAAEG,UAAU,EAAE;CACvB9C,MAAM;EACJ+C,kBAAkBvD,MAAMwD,QAAQ,CAAC;EACjCC,cAAczD,MAAMwD,QAAQ,CAAC;EAC7BE,OAAO1D,MAAMsB,OAAOqC;EACpBC,YAAY1F,OAAO8B,MAAM4D,WAAWC,IAAI;EACxCC,UAAU9D,MAAM8D,SAASC;EACzBC,YAAYhE,MAAMgE,WAAWD;EAAEE,mBAAA,CAAA,CAAA;CACjC;AACF,EAAE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agimon-ai/po-native-components",
|
|
3
|
-
"version": "0.0.0-alpha.
|
|
3
|
+
"version": "0.0.0-alpha.167",
|
|
4
4
|
"description": "Shared React Native components for Po and its native plugins: the web component library's look and API on native parts, tuned to the Po palette.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -49,12 +49,12 @@
|
|
|
49
49
|
"access": "public"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@agimon-ai/po-web-components": "0.0.0-alpha.
|
|
52
|
+
"@agimon-ai/po-web-components": "0.0.0-alpha.167"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@agimon-ai/po-build": "0.0.0-alpha.
|
|
56
|
-
"@agimon-ai/po-core": "0.0.0-alpha.
|
|
57
|
-
"@agimon-ai/vibe-lint-plugin-po-web": "0.0.0-alpha.
|
|
55
|
+
"@agimon-ai/po-build": "0.0.0-alpha.167",
|
|
56
|
+
"@agimon-ai/po-core": "0.0.0-alpha.167",
|
|
57
|
+
"@agimon-ai/vibe-lint-plugin-po-web": "0.0.0-alpha.167",
|
|
58
58
|
"@babel/core": "7.29.7",
|
|
59
59
|
"@expo/vector-icons": "15.1.1",
|
|
60
60
|
"@fontsource-variable/ibm-plex-sans": "5.3.0",
|