@agimon-ai/po-native-components 0.0.0-alpha.218 → 0.0.0-alpha.219

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.
@@ -16,7 +16,7 @@ const PRESSED_FILL_OPACITY = .85;
16
16
  const RIPPLE_ALPHA_PERCENT = 20;
17
17
  /** `hover:border-po-green/50`. */
18
18
  const PRESSED_EDGE_ALPHA_PERCENT = 50;
19
- /** The visual height of each size, from which hitSlop pads the tap target to 44pt. */
19
+ /** The visual height of each size, from which hitSlop pads the tap target to 44pt. Text sizes grow past it with large type. */
20
20
  const SIZE_HEIGHT = {
21
21
  xs: 24,
22
22
  sm: 28,
@@ -153,21 +153,25 @@ const styles = StyleSheet.create((theme) => ({
153
153
  },
154
154
  size: {
155
155
  xs: {
156
- height: SIZE_HEIGHT.xs,
156
+ minHeight: SIZE_HEIGHT.xs,
157
157
  paddingHorizontal: theme.spacing(1.5),
158
+ paddingVertical: theme.spacing(.5),
158
159
  borderRadius: theme.borderRadius.DEFAULT
159
160
  },
160
161
  sm: {
161
- height: SIZE_HEIGHT.sm,
162
- paddingHorizontal: theme.spacing(2.5)
162
+ minHeight: SIZE_HEIGHT.sm,
163
+ paddingHorizontal: theme.spacing(2.5),
164
+ paddingVertical: theme.spacing(.5)
163
165
  },
164
166
  md: {
165
- height: SIZE_HEIGHT.md,
166
- paddingHorizontal: theme.spacing(3)
167
+ minHeight: SIZE_HEIGHT.md,
168
+ paddingHorizontal: theme.spacing(3),
169
+ paddingVertical: theme.spacing(.5)
167
170
  },
168
171
  lg: {
169
- height: SIZE_HEIGHT.lg,
170
- paddingHorizontal: theme.spacing(3.5)
172
+ minHeight: SIZE_HEIGHT.lg,
173
+ paddingHorizontal: theme.spacing(3.5),
174
+ paddingVertical: theme.spacing(.5)
171
175
  },
172
176
  icon: {
173
177
  width: SIZE_HEIGHT.icon,
@@ -1 +1 @@
1
- {"version":3,"file":"Button.mjs","names":["IconColorContext","NativeColorToken","withAlpha","ReactNode","PressableProps","StyleProp","ViewStyle","StyleSheet","useUnistyles","fontOf","impactLight","wrapText","Spinner","ButtonVariant","ButtonSize","MIN_TAP_TARGET","DISABLED_OPACITY","PRESSED_FILL_OPACITY","RIPPLE_ALPHA_PERCENT","PRESSED_EDGE_ALPHA_PERCENT","SIZE_HEIGHT","Readonly","Record","xs","sm","md","lg","icon","card","INK","rest","pressed","primary","secondary","outline","ghost","subtle","danger","success","link","HAPTIC_VARIANTS","ReadonlySet","Set","ButtonProps","Omit","variant","size","loading","loadingLabel","children","style","Button","disabled","onPress","hitSlop","accessibilityState","props","theme","_styles","styles","useVariants","inactive","slop","Math","max","ink","busy","undefined","text","color","colors","borderless","event","has","button","borderColor","green","token","label","labelPressed","create","flexDirection","alignItems","justifyContent","gap","spacing","borderRadius","borderWidth","overflow","variants","backgroundColor","selected","border","panel","red","height","paddingHorizontal","DEFAULT","width","padding","alignSelf","minHeight","paddingVertical","uni__dependencies","opacity","deep","fontFamily","sans","fontWeight","medium","semibold","fontSize","lineHeight","base","textDecorationLine"],"sources":["../../src/components/Button.tsx"],"sourcesContent":["import { IconColorContext } from '@agimon-ai/po-native-components/shell';\nimport { type NativeColorToken, withAlpha } from '@agimon-ai/po-web-components/nativeTheme';\nimport type { ReactNode } from 'react';\nimport { Pressable, type PressableProps, type StyleProp, type ViewStyle } from 'react-native';\nimport { StyleSheet, useUnistyles } from 'react-native-unistyles';\n\nimport { fontOf } from '../lib/fonts';\nimport { impactLight } from '../lib/haptics';\nimport { wrapText } from '../lib/wrapText';\nimport { Spinner } from './Spinner';\n\nexport type ButtonVariant =\n | 'primary'\n | 'secondary'\n | 'outline'\n | 'ghost'\n | 'subtle'\n | 'danger'\n | 'danger-outline'\n | 'success'\n | 'link';\nexport type ButtonSize = 'xs' | 'sm' | 'md' | 'lg' | 'icon' | 'icon-md' | 'card';\n\n/** Apple's and Google's minimum tap target; a smaller visual box makes up the rest with hitSlop. */\nconst MIN_TAP_TARGET = 44;\nconst DISABLED_OPACITY = 0.4;\nconst PRESSED_FILL_OPACITY = 0.85;\nconst RIPPLE_ALPHA_PERCENT = 20;\n/** `hover:border-po-green/50`. */\nconst PRESSED_EDGE_ALPHA_PERCENT = 50;\n\n/** The visual height of each size, from which hitSlop pads the tap target to 44pt. */\nconst SIZE_HEIGHT: Readonly<Record<ButtonSize, number>> = {\n xs: 24,\n sm: 28,\n md: 32,\n lg: 36,\n icon: 24,\n 'icon-md': 32,\n card: MIN_TAP_TARGET,\n};\n\n/** The label ink of each variant, and the ink it lifts to while pressed (the web hover). */\nconst INK: Readonly<Record<ButtonVariant, { rest: NativeColorToken; pressed: NativeColorToken }>> = {\n primary: { rest: 'on-selected', pressed: 'on-selected' },\n secondary: { rest: 'magenta', pressed: 'magenta' },\n outline: { rest: 'dim', pressed: 'hi' },\n ghost: { rest: 'dim', pressed: 'hi' },\n subtle: { rest: 'dim', pressed: 'hi' },\n danger: { rest: 'rail', pressed: 'rail' },\n 'danger-outline': { rest: 'red', pressed: 'red' },\n success: { rest: 'rail', pressed: 'rail' },\n link: { rest: 'blue', pressed: 'blue' },\n};\n\n/** Presses that commit something get a light impact; the rest stay quiet. */\nconst HAPTIC_VARIANTS: ReadonlySet<ButtonVariant> = new Set(['primary', 'danger', 'success']);\n\nexport interface ButtonProps extends Omit<PressableProps, 'children' | 'style'> {\n variant?: ButtonVariant;\n size?: ButtonSize;\n /** Work is in flight: the button shows a spinner and stops accepting presses. */\n loading?: boolean;\n /** What the spinner announces while loading; omit it and the wait is silent. */\n loadingLabel?: string;\n /** A bare string is drawn as the label; elements (an icon, a card's lines) render as given. */\n children?: ReactNode;\n style?: StyleProp<ViewStyle>;\n}\n\n/** The one button: every variant is a theme token, a press dims or lifts it, and committing presses buzz once. */\nexport function Button({\n variant = 'outline',\n size = 'md',\n loading = false,\n loadingLabel,\n disabled,\n onPress,\n children,\n style,\n hitSlop,\n accessibilityState,\n ...props\n}: ButtonProps) {\n const { theme } = useUnistyles();\n styles.useVariants({ variant, size });\n const inactive = (disabled ?? false) || loading;\n const slop = Math.max(0, (MIN_TAP_TARGET - SIZE_HEIGHT[size]) / 2);\n const ink = INK[variant];\n return (\n <Pressable\n accessibilityRole={variant === 'link' ? 'link' : 'button'}\n accessibilityState={{ ...accessibilityState, disabled: inactive, busy: loading }}\n accessibilityValue={loading && loadingLabel !== undefined ? { text: loadingLabel } : undefined}\n disabled={inactive}\n hitSlop={hitSlop ?? slop}\n android_ripple={{ color: withAlpha(theme.colors[ink.pressed], RIPPLE_ALPHA_PERCENT), borderless: false }}\n onPress={(event) => {\n if (HAPTIC_VARIANTS.has(variant)) impactLight();\n onPress?.(event);\n }}\n style={({ pressed }) => [\n styles.button,\n pressed && styles.pressed,\n // Alpha mixes are computed in render from useUnistyles(), not in StyleSheet.create: on web Unistyles hands\n // the stylesheet CSS variables, which withAlpha cannot read.\n pressed && variant === 'outline' && { borderColor: withAlpha(theme.colors.green, PRESSED_EDGE_ALPHA_PERCENT) },\n inactive && styles.disabled,\n style,\n ]}\n {...props}\n >\n {({ pressed }) => {\n const token = pressed ? ink.pressed : ink.rest;\n return (\n <IconColorContext.Provider value={token}>\n {loading ? <Spinner color={token} /> : null}\n {wrapText(children, [styles.label, pressed && styles.labelPressed, { color: theme.colors[token] }])}\n </IconColorContext.Provider>\n );\n }}\n </Pressable>\n );\n}\n\nconst styles = StyleSheet.create((theme) => ({\n button: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n gap: theme.spacing(1.5),\n borderRadius: theme.borderRadius.md,\n borderWidth: 1,\n borderColor: 'transparent',\n overflow: 'hidden',\n variants: {\n variant: {\n primary: { backgroundColor: theme.colors.selected },\n secondary: { borderColor: theme.colors['edge-magenta'], backgroundColor: theme.colors['tint-magenta'] },\n outline: { borderColor: theme.colors.border },\n ghost: {},\n subtle: { backgroundColor: theme.colors.panel },\n danger: { backgroundColor: theme.colors.red },\n 'danger-outline': { borderColor: theme.colors['edge-red'], backgroundColor: theme.colors['tint-red'] },\n success: { backgroundColor: theme.colors.green },\n link: {},\n },\n size: {\n xs: { height: SIZE_HEIGHT.xs, paddingHorizontal: theme.spacing(1.5), borderRadius: theme.borderRadius.DEFAULT },\n sm: { height: SIZE_HEIGHT.sm, paddingHorizontal: theme.spacing(2.5) },\n md: { height: SIZE_HEIGHT.md, paddingHorizontal: theme.spacing(3) },\n lg: { height: SIZE_HEIGHT.lg, paddingHorizontal: theme.spacing(3.5) },\n icon: {\n width: SIZE_HEIGHT.icon,\n height: SIZE_HEIGHT.icon,\n padding: 0,\n borderRadius: theme.borderRadius.DEFAULT,\n },\n 'icon-md': { width: SIZE_HEIGHT['icon-md'], height: SIZE_HEIGHT['icon-md'], padding: 0 },\n card: {\n alignSelf: 'stretch',\n flexDirection: 'column',\n alignItems: 'stretch',\n justifyContent: 'flex-start',\n gap: theme.spacing(1),\n minHeight: SIZE_HEIGHT.card,\n paddingHorizontal: 11,\n paddingVertical: theme.spacing(2.5),\n },\n },\n },\n },\n pressed: {\n variants: {\n variant: {\n primary: { opacity: PRESSED_FILL_OPACITY },\n secondary: { opacity: PRESSED_FILL_OPACITY },\n outline: {},\n ghost: { backgroundColor: theme.colors.panel },\n subtle: { backgroundColor: theme.colors.deep },\n danger: { opacity: PRESSED_FILL_OPACITY },\n 'danger-outline': { opacity: PRESSED_FILL_OPACITY },\n success: { opacity: PRESSED_FILL_OPACITY },\n link: {},\n },\n },\n },\n disabled: { opacity: DISABLED_OPACITY },\n label: {\n fontFamily: fontOf(theme.fontFamily.sans),\n fontWeight: theme.fontWeight.medium,\n variants: {\n variant: {\n primary: { fontWeight: theme.fontWeight.semibold },\n secondary: { fontWeight: theme.fontWeight.semibold },\n outline: {},\n ghost: {},\n subtle: {},\n danger: { fontWeight: theme.fontWeight.semibold },\n 'danger-outline': { fontWeight: theme.fontWeight.semibold },\n success: { fontWeight: theme.fontWeight.semibold },\n link: {},\n },\n size: {\n xs: { fontSize: theme.fontSize.sm, lineHeight: theme.lineHeight.sm },\n sm: { fontSize: theme.fontSize.sm, lineHeight: theme.lineHeight.sm },\n md: { fontSize: theme.fontSize.base, lineHeight: theme.lineHeight.base },\n lg: { fontSize: theme.fontSize.base, lineHeight: theme.lineHeight.base },\n icon: { fontSize: theme.fontSize.base, lineHeight: theme.lineHeight.base },\n 'icon-md': { fontSize: theme.fontSize.base, lineHeight: theme.lineHeight.base },\n card: { fontSize: theme.fontSize.base, lineHeight: theme.lineHeight.base },\n },\n },\n },\n labelPressed: {\n variants: {\n variant: {\n primary: {},\n secondary: {},\n outline: {},\n ghost: {},\n subtle: {},\n danger: {},\n 'danger-outline': {},\n success: {},\n link: { textDecorationLine: 'underline' },\n },\n },\n },\n}));\n"],"mappings":";;;;;;;;;;;;AAwBA,MAAMe,iBAAiB;AACvB,MAAMC,mBAAmB;AACzB,MAAMC,uBAAuB;AAC7B,MAAMC,uBAAuB;;AAE7B,MAAMC,6BAA6B;;AAGnC,MAAMC,cAAoD;CACxDG,IAAI;CACJC,IAAI;CACJC,IAAI;CACJC,IAAI;CACJC,MAAM;CACN,WAAW;CACXC,MAAMb;AACR;;AAGA,MAAMc,MAA8F;CAClGG,SAAS;EAAEF,MAAM;EAAeC,SAAS;CAAc;CACvDE,WAAW;EAAEH,MAAM;EAAWC,SAAS;CAAU;CACjDG,SAAS;EAAEJ,MAAM;EAAOC,SAAS;CAAK;CACtCI,OAAO;EAAEL,MAAM;EAAOC,SAAS;CAAK;CACpCK,QAAQ;EAAEN,MAAM;EAAOC,SAAS;CAAK;CACrCM,QAAQ;EAAEP,MAAM;EAAQC,SAAS;CAAO;CACxC,kBAAkB;EAAED,MAAM;EAAOC,SAAS;CAAM;CAChDO,SAAS;EAAER,MAAM;EAAQC,SAAS;CAAO;CACzCQ,MAAM;EAAET,MAAM;EAAQC,SAAS;CAAO;AACxC;;AAGA,MAAMS,kCAA8C,IAAIE,IAAI;CAAC;CAAW;CAAU;AAAS,CAAC;;AAe5F,SAAgBS,OAAO,EACrBN,UAAU,WACVC,OAAO,MACP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S,EAAEsE,YAAYnD,MAAMmD,WAAWE,SAAS;IACjDvE,MAAM,CAAC;GACT;GACAO,MAAM;IACJvB,IAAI;KAAEwF,UAAUtD,MAAMsD,SAASvF;KAAIwF,YAAYvD,MAAMuD,WAAWxF;IAAG;IACnEA,IAAI;KAAEuF,UAAUtD,MAAMsD,SAASvF;KAAIwF,YAAYvD,MAAMuD,WAAWxF;IAAG;IACnEC,IAAI;KAAEsF,UAAUtD,MAAMsD,SAASE;KAAMD,YAAYvD,MAAMuD,WAAWC;IAAK;IACvEvF,IAAI;KAAEqF,UAAUtD,MAAMsD,SAASE;KAAMD,YAAYvD,MAAMuD,WAAWC;IAAK;IACvEtF,MAAM;KAAEoF,UAAUtD,MAAMsD,SAASE;KAAMD,YAAYvD,MAAMuD,WAAWC;IAAK;IACzE,WAAW;KAAEF,UAAUtD,MAAMsD,SAASE;KAAMD,YAAYvD,MAAMuD,WAAWC;IAAK;IAC9ErF,MAAM;KAAEmF,UAAUtD,MAAMsD,SAASE;KAAMD,YAAYvD,MAAMuD,WAAWC;IAAK;GAC3E;EACF;EAACV,mBAAA,CAAA,GAAA,CAAA;CACH;CACAxB,cAAc;EACZU,UAAU,EACR5C,SAAS;GACPb,SAAS,CAAC;GACVC,WAAW,CAAC;GACZC,SAAS,CAAC;GACVC,OAAO,CAAC;GACRC,QAAQ,CAAC;GACTC,QAAQ,CAAC;GACT,kBAAkB,CAAC;GACnBC,SAAS,CAAC;GACVC,MAAM,EAAE2E,oBAAoB,YAAY;EAC1C,EACF;EAACX,mBAAA,CAAA,CAAA;CACH;AACF,EAAE"}
1
+ {"version":3,"file":"Button.mjs","names":["IconColorContext","NativeColorToken","withAlpha","ReactNode","PressableProps","StyleProp","ViewStyle","StyleSheet","useUnistyles","fontOf","impactLight","wrapText","Spinner","ButtonVariant","ButtonSize","MIN_TAP_TARGET","DISABLED_OPACITY","PRESSED_FILL_OPACITY","RIPPLE_ALPHA_PERCENT","PRESSED_EDGE_ALPHA_PERCENT","SIZE_HEIGHT","Readonly","Record","xs","sm","md","lg","icon","card","INK","rest","pressed","primary","secondary","outline","ghost","subtle","danger","success","link","HAPTIC_VARIANTS","ReadonlySet","Set","ButtonProps","Omit","variant","size","loading","loadingLabel","children","style","Button","disabled","onPress","hitSlop","accessibilityState","props","theme","_styles","styles","useVariants","inactive","slop","Math","max","ink","busy","undefined","text","color","colors","borderless","event","has","button","borderColor","green","token","label","labelPressed","create","flexDirection","alignItems","justifyContent","gap","spacing","borderRadius","borderWidth","overflow","variants","backgroundColor","selected","border","panel","red","minHeight","paddingHorizontal","paddingVertical","DEFAULT","width","height","padding","alignSelf","uni__dependencies","opacity","deep","fontFamily","sans","fontWeight","medium","semibold","fontSize","lineHeight","base","textDecorationLine"],"sources":["../../src/components/Button.tsx"],"sourcesContent":["import { IconColorContext } from '@agimon-ai/po-native-components/shell';\nimport { type NativeColorToken, withAlpha } from '@agimon-ai/po-web-components/nativeTheme';\nimport type { ReactNode } from 'react';\nimport { Pressable, type PressableProps, type StyleProp, type ViewStyle } from 'react-native';\nimport { StyleSheet, useUnistyles } from 'react-native-unistyles';\n\nimport { fontOf } from '../lib/fonts';\nimport { impactLight } from '../lib/haptics';\nimport { wrapText } from '../lib/wrapText';\nimport { Spinner } from './Spinner';\n\nexport type ButtonVariant =\n | 'primary'\n | 'secondary'\n | 'outline'\n | 'ghost'\n | 'subtle'\n | 'danger'\n | 'danger-outline'\n | 'success'\n | 'link';\nexport type ButtonSize = 'xs' | 'sm' | 'md' | 'lg' | 'icon' | 'icon-md' | 'card';\n\n/** Apple's and Google's minimum tap target; a smaller visual box makes up the rest with hitSlop. */\nconst MIN_TAP_TARGET = 44;\nconst DISABLED_OPACITY = 0.4;\nconst PRESSED_FILL_OPACITY = 0.85;\nconst RIPPLE_ALPHA_PERCENT = 20;\n/** `hover:border-po-green/50`. */\nconst PRESSED_EDGE_ALPHA_PERCENT = 50;\n\n/** The visual height of each size, from which hitSlop pads the tap target to 44pt. Text sizes grow past it with large type. */\nconst SIZE_HEIGHT: Readonly<Record<ButtonSize, number>> = {\n xs: 24,\n sm: 28,\n md: 32,\n lg: 36,\n icon: 24,\n 'icon-md': 32,\n card: MIN_TAP_TARGET,\n};\n\n/** The label ink of each variant, and the ink it lifts to while pressed (the web hover). */\nconst INK: Readonly<Record<ButtonVariant, { rest: NativeColorToken; pressed: NativeColorToken }>> = {\n primary: { rest: 'on-selected', pressed: 'on-selected' },\n secondary: { rest: 'magenta', pressed: 'magenta' },\n outline: { rest: 'dim', pressed: 'hi' },\n ghost: { rest: 'dim', pressed: 'hi' },\n subtle: { rest: 'dim', pressed: 'hi' },\n danger: { rest: 'rail', pressed: 'rail' },\n 'danger-outline': { rest: 'red', pressed: 'red' },\n success: { rest: 'rail', pressed: 'rail' },\n link: { rest: 'blue', pressed: 'blue' },\n};\n\n/** Presses that commit something get a light impact; the rest stay quiet. */\nconst HAPTIC_VARIANTS: ReadonlySet<ButtonVariant> = new Set(['primary', 'danger', 'success']);\n\nexport interface ButtonProps extends Omit<PressableProps, 'children' | 'style'> {\n variant?: ButtonVariant;\n size?: ButtonSize;\n /** Work is in flight: the button shows a spinner and stops accepting presses. */\n loading?: boolean;\n /** What the spinner announces while loading; omit it and the wait is silent. */\n loadingLabel?: string;\n /** A bare string is drawn as the label; elements (an icon, a card's lines) render as given. */\n children?: ReactNode;\n style?: StyleProp<ViewStyle>;\n}\n\n/** The one button: every variant is a theme token, a press dims or lifts it, and committing presses buzz once. */\nexport function Button({\n variant = 'outline',\n size = 'md',\n loading = false,\n loadingLabel,\n disabled,\n onPress,\n children,\n style,\n hitSlop,\n accessibilityState,\n ...props\n}: ButtonProps) {\n const { theme } = useUnistyles();\n styles.useVariants({ variant, size });\n const inactive = (disabled ?? false) || loading;\n const slop = Math.max(0, (MIN_TAP_TARGET - SIZE_HEIGHT[size]) / 2);\n const ink = INK[variant];\n return (\n <Pressable\n accessibilityRole={variant === 'link' ? 'link' : 'button'}\n accessibilityState={{ ...accessibilityState, disabled: inactive, busy: loading }}\n accessibilityValue={loading && loadingLabel !== undefined ? { text: loadingLabel } : undefined}\n disabled={inactive}\n hitSlop={hitSlop ?? slop}\n android_ripple={{ color: withAlpha(theme.colors[ink.pressed], RIPPLE_ALPHA_PERCENT), borderless: false }}\n onPress={(event) => {\n if (HAPTIC_VARIANTS.has(variant)) impactLight();\n onPress?.(event);\n }}\n style={({ pressed }) => [\n styles.button,\n pressed && styles.pressed,\n // Alpha mixes are computed in render from useUnistyles(), not in StyleSheet.create: on web Unistyles hands\n // the stylesheet CSS variables, which withAlpha cannot read.\n pressed && variant === 'outline' && { borderColor: withAlpha(theme.colors.green, PRESSED_EDGE_ALPHA_PERCENT) },\n inactive && styles.disabled,\n style,\n ]}\n {...props}\n >\n {({ pressed }) => {\n const token = pressed ? ink.pressed : ink.rest;\n return (\n <IconColorContext.Provider value={token}>\n {loading ? <Spinner color={token} /> : null}\n {wrapText(children, [styles.label, pressed && styles.labelPressed, { color: theme.colors[token] }])}\n </IconColorContext.Provider>\n );\n }}\n </Pressable>\n );\n}\n\nconst styles = StyleSheet.create((theme) => ({\n button: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n gap: theme.spacing(1.5),\n borderRadius: theme.borderRadius.md,\n borderWidth: 1,\n borderColor: 'transparent',\n overflow: 'hidden',\n variants: {\n variant: {\n primary: { backgroundColor: theme.colors.selected },\n secondary: { borderColor: theme.colors['edge-magenta'], backgroundColor: theme.colors['tint-magenta'] },\n outline: { borderColor: theme.colors.border },\n ghost: {},\n subtle: { backgroundColor: theme.colors.panel },\n danger: { backgroundColor: theme.colors.red },\n 'danger-outline': { borderColor: theme.colors['edge-red'], backgroundColor: theme.colors['tint-red'] },\n success: { backgroundColor: theme.colors.green },\n link: {},\n },\n size: {\n // minHeight, not height: a label at a large Dynamic Type size wraps and grows instead of clipping.\n xs: {\n minHeight: SIZE_HEIGHT.xs,\n paddingHorizontal: theme.spacing(1.5),\n paddingVertical: theme.spacing(0.5),\n borderRadius: theme.borderRadius.DEFAULT,\n },\n sm: { minHeight: SIZE_HEIGHT.sm, paddingHorizontal: theme.spacing(2.5), paddingVertical: theme.spacing(0.5) },\n md: { minHeight: SIZE_HEIGHT.md, paddingHorizontal: theme.spacing(3), paddingVertical: theme.spacing(0.5) },\n lg: { minHeight: SIZE_HEIGHT.lg, paddingHorizontal: theme.spacing(3.5), paddingVertical: theme.spacing(0.5) },\n icon: {\n width: SIZE_HEIGHT.icon,\n height: SIZE_HEIGHT.icon,\n padding: 0,\n borderRadius: theme.borderRadius.DEFAULT,\n },\n 'icon-md': { width: SIZE_HEIGHT['icon-md'], height: SIZE_HEIGHT['icon-md'], padding: 0 },\n card: {\n alignSelf: 'stretch',\n flexDirection: 'column',\n alignItems: 'stretch',\n justifyContent: 'flex-start',\n gap: theme.spacing(1),\n minHeight: SIZE_HEIGHT.card,\n paddingHorizontal: 11,\n paddingVertical: theme.spacing(2.5),\n },\n },\n },\n },\n pressed: {\n variants: {\n variant: {\n primary: { opacity: PRESSED_FILL_OPACITY },\n secondary: { opacity: PRESSED_FILL_OPACITY },\n outline: {},\n ghost: { backgroundColor: theme.colors.panel },\n subtle: { backgroundColor: theme.colors.deep },\n danger: { opacity: PRESSED_FILL_OPACITY },\n 'danger-outline': { opacity: PRESSED_FILL_OPACITY },\n success: { opacity: PRESSED_FILL_OPACITY },\n link: {},\n },\n },\n },\n disabled: { opacity: DISABLED_OPACITY },\n label: {\n fontFamily: fontOf(theme.fontFamily.sans),\n fontWeight: theme.fontWeight.medium,\n variants: {\n variant: {\n primary: { fontWeight: theme.fontWeight.semibold },\n secondary: { fontWeight: theme.fontWeight.semibold },\n outline: {},\n ghost: {},\n subtle: {},\n danger: { fontWeight: theme.fontWeight.semibold },\n 'danger-outline': { fontWeight: theme.fontWeight.semibold },\n success: { fontWeight: theme.fontWeight.semibold },\n link: {},\n },\n size: {\n xs: { fontSize: theme.fontSize.sm, lineHeight: theme.lineHeight.sm },\n sm: { fontSize: theme.fontSize.sm, lineHeight: theme.lineHeight.sm },\n md: { fontSize: theme.fontSize.base, lineHeight: theme.lineHeight.base },\n lg: { fontSize: theme.fontSize.base, lineHeight: theme.lineHeight.base },\n icon: { fontSize: theme.fontSize.base, lineHeight: theme.lineHeight.base },\n 'icon-md': { fontSize: theme.fontSize.base, lineHeight: theme.lineHeight.base },\n card: { fontSize: theme.fontSize.base, lineHeight: theme.lineHeight.base },\n },\n },\n },\n labelPressed: {\n variants: {\n variant: {\n primary: {},\n secondary: {},\n outline: {},\n ghost: {},\n subtle: {},\n danger: {},\n 'danger-outline': {},\n success: {},\n link: { textDecorationLine: 'underline' },\n },\n },\n },\n}));\n"],"mappings":";;;;;;;;;;;;AAwBA,MAAMe,iBAAiB;AACvB,MAAMC,mBAAmB;AACzB,MAAMC,uBAAuB;AAC7B,MAAMC,uBAAuB;;AAE7B,MAAMC,6BAA6B;;AAGnC,MAAMC,cAAoD;CACxDG,IAAI;CACJC,IAAI;CACJC,IAAI;CACJC,IAAI;CACJC,MAAM;CACN,WAAW;CACXC,MAAMb;AACR;;AAGA,MAAMc,MAA8F;CAClGG,SAAS;EAAEF,MAAM;EAAeC,SAAS;CAAc;CACvDE,WAAW;EAAEH,MAAM;EAAWC,SAAS;CAAU;CACjDG,SAAS;EAAEJ,MAAM;EAAOC,SAAS;CAAK;CACtCI,OAAO;EAAEL,MAAM;EAAOC,SAAS;CAAK;CACpCK,QAAQ;EAAEN,MAAM;EAAOC,SAAS;CAAK;CACrCM,QAAQ;EAAEP,MAAM;EAAQC,SAAS;CAAO;CACxC,kBAAkB;EAAED,MAAM;EAAOC,SAAS;CAAM;CAChDO,SAAS;EAAER,MAAM;EAAQC,SAAS;CAAO;CACzCQ,MAAM;EAAET,MAAM;EAAQC,SAAS;CAAO;AACxC;;AAGA,MAAMS,kCAA8C,IAAIE,IAAI;CAAC;CAAW;CAAU;AAAS,CAAC;;AAe5F,SAAgBS,OAAO,EACrBN,UAAU,WACVC,OAAO,MACPC,UAAU,OACVC,cACAI,UACA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,CAAC;IACTC,QAAQ,EAAEuE,YAAYnD,MAAMmD,WAAWE,SAAS;IAChD,kBAAkB,EAAEF,YAAYnD,MAAMmD,WAAWE,SAAS;IAC1DxE,SAAS,EAAEsE,YAAYnD,MAAMmD,WAAWE,SAAS;IACjDvE,MAAM,CAAC;GACT;GACAO,MAAM;IACJvB,IAAI;KAAEwF,UAAUtD,MAAMsD,SAASvF;KAAIwF,YAAYvD,MAAMuD,WAAWxF;IAAG;IACnEA,IAAI;KAAEuF,UAAUtD,MAAMsD,SAASvF;KAAIwF,YAAYvD,MAAMuD,WAAWxF;IAAG;IACnEC,IAAI;KAAEsF,UAAUtD,MAAMsD,SAASE;KAAMD,YAAYvD,MAAMuD,WAAWC;IAAK;IACvEvF,IAAI;KAAEqF,UAAUtD,MAAMsD,SAASE;KAAMD,YAAYvD,MAAMuD,WAAWC;IAAK;IACvEtF,MAAM;KAAEoF,UAAUtD,MAAMsD,SAASE;KAAMD,YAAYvD,MAAMuD,WAAWC;IAAK;IACzE,WAAW;KAAEF,UAAUtD,MAAMsD,SAASE;KAAMD,YAAYvD,MAAMuD,WAAWC;IAAK;IAC9ErF,MAAM;KAAEmF,UAAUtD,MAAMsD,SAASE;KAAMD,YAAYvD,MAAMuD,WAAWC;IAAK;GAC3E;EACF;EAACV,mBAAA,CAAA,GAAA,CAAA;CACH;CACAxB,cAAc;EACZU,UAAU,EACR5C,SAAS;GACPb,SAAS,CAAC;GACVC,WAAW,CAAC;GACZC,SAAS,CAAC;GACVC,OAAO,CAAC;GACRC,QAAQ,CAAC;GACTC,QAAQ,CAAC;GACT,kBAAkB,CAAC;GACnBC,SAAS,CAAC;GACVC,MAAM,EAAE2E,oBAAoB,YAAY;EAC1C,EACF;EAACX,mBAAA,CAAA,CAAA;CACH;AACF,EAAE"}
@@ -14,7 +14,7 @@ import { Text } from "react-native-unistyles/components/native/Text";
14
14
  import { StyleSheet } from "react-native-unistyles";
15
15
  import { createElement, useCallback, useEffect, useRef, useState } from "react";
16
16
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
17
- import { currentLocale, useT } from "@agimon-ai/po-core/native";
17
+ import { useT } from "@agimon-ai/po-core/native";
18
18
  import { ScrollView } from "react-native-unistyles/components/native/ScrollView";
19
19
  import { FlatList } from "react-native-unistyles/components/native/FlatList";
20
20
 
@@ -77,7 +77,7 @@ function FileList({ items, onOpen, loading, error, onRetry, grid = false, browse
77
77
  }) : null,
78
78
  grid ? /* @__PURE__ */ jsx(Text, {
79
79
  style: styles.meta,
80
- children: t("nativeComponents.fileList.bytes", "{size} bytes", { size: item.size.toLocaleString(currentLocale()) })
80
+ children: sizeLabel(item.size)
81
81
  }) : null
82
82
  ]
83
83
  })]
@@ -1 +1 @@
1
- {"version":3,"file":"FileList.mjs","names":["currentLocale","useT","fileKind","isFileLayout","sizeLabel","FileItem","FileKind","FileLayout","FileModified","FileSort","FileSortDirection","FileTreeRow","ComponentRef","ReactNode","useCallback","useEffect","useRef","useState","ListViewToken","StyleSheet","ChevronDownIcon","ChevronRightIcon","CloseIcon","FileIcon","FolderIcon","ImageIcon","SearchIcon","SlidersIcon","fileKindLabel","fontOf","Button","DropdownMenu","DropdownMenuCheckboxItem","DropdownMenuContent","DropdownMenuLabel","DropdownMenuSeparator","DropdownMenuTrigger","EmptyState","Input","SegmentedControl","Sheet","SheetContent","SheetList","FileBrowserControls","layout","onLayoutChange","query","onQueryChange","type","onTypeChange","modified","onModifiedChange","sort","onSortChange","direction","onDirectionChange","rows","onToggleDirectory","path","selected","onSelect","item","onCloseSelection","totalCount","onViewableImagesChange","paths","renderImage","compact","header","sheet","FileListProps","items","onOpen","loading","error","onRetry","label","emptyText","grid","browser","FileList","t","styles","list","length","meta","map","name","size","toLocaleString","Translate","ReturnType","layoutOptions","value","TYPES","const","modifiedOptions","sortOptions","ROW_HEIGHT","IMAGE_VIEWABILITY","itemVisiblePercentThreshold","MAX_DOTS","PREVIEW_HEIGHT","ListFailure","retained","onAction","undefined","FileBrowserList","b","LAYOUTS","MODIFIED","SORTS","onViewableItemsChanged","viewableItems","Omit","flatMap","isViewable","kind","depth","files","row","at","findIndex","file","List","FlatList","embedded","columns","head","toolbar","search","searchInput","chips","find","option","inset","indent","open","expanded","count","image","tile","chevronGutter","thumbnail","rowThumbnail","foot","shown","total","selection","titleRow","index","Math","max","actions","SelectionSlides","width","setWidth","scroller","ScrollView","placed","current","scrollTo","x","animated","step","by","next","event","nativeEvent","round","contentOffset","preview","page","abs","arrow","previous","flip","dots","dot","dotActive","create","theme","gap","spacing","padding","paddingBottom","uni__dependencies","paddingTop","paddingHorizontal","flexDirection","alignItems","flex","minWidth","borderWidth","borderColor","colors","border","borderRadius","DEFAULT","backgroundColor","deep","flexWrap","marginHorizontal","marginBottom","minHeight","justifyContent","paddingVertical","paddingRight","paddingLeft","maxWidth","height","overflow","sm","flexShrink","panel","position","top","left","right","transform","rotate","faint","green","fontFamily","sans","fontWeight","fontSize","base","color","text","mono","dim"],"sources":["../../src/components/FileList.tsx"],"sourcesContent":["import { currentLocale, useT } from '@agimon-ai/po-core/native';\nimport {\n fileKind,\n isFileLayout,\n sizeLabel,\n type FileItem,\n type FileKind,\n type FileLayout,\n type FileModified,\n type FileSort,\n type FileSortDirection,\n type FileTreeRow,\n} from '@agimon-ai/po-web-components/text';\nimport { type ComponentRef, type ReactNode, useCallback, useEffect, useRef, useState } from 'react';\nimport { FlatList, ScrollView, Text, View, type ListViewToken } from 'react-native';\nimport { StyleSheet } from 'react-native-unistyles';\n\nimport {\n ChevronDownIcon,\n ChevronRightIcon,\n CloseIcon,\n FileIcon,\n FolderIcon,\n ImageIcon,\n SearchIcon,\n SlidersIcon,\n} from '../icons/icons';\nimport { fileKindLabel } from '../lib/fileKindLabel';\nimport { fontOf } from '../lib/fonts';\nimport { Button } from './Button';\nimport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from './DropdownMenu';\nimport { EmptyState } from './EmptyState';\nimport { Input } from './Input';\nimport { SegmentedControl } from './SegmentedControl';\nimport { Sheet, SheetContent } from './Sheet';\nimport { SheetList } from './SheetList';\n\nexport interface FileBrowserControls {\n layout: FileLayout;\n onLayoutChange: (layout: FileLayout) => void;\n query: string;\n onQueryChange: (query: string) => void;\n type: FileKind | 'any';\n onTypeChange: (type: FileKind | 'any') => void;\n modified: FileModified;\n onModifiedChange: (modified: FileModified) => void;\n sort: FileSort;\n onSortChange: (sort: FileSort) => void;\n direction: FileSortDirection;\n onDirectionChange: (direction: FileSortDirection) => void;\n rows: readonly FileTreeRow[];\n onToggleDirectory: (path: string) => void;\n selected?: FileItem;\n onSelect: (item: FileItem) => void;\n onCloseSelection: () => void;\n totalCount: number;\n onViewableImagesChange?: (paths: readonly string[]) => void;\n /** A loaded thumbnail or a placeholder for an image file; `compact` is a list row's small square. */\n renderImage?: (item: FileItem, compact: boolean) => ReactNode;\n /** Drawn first in the list, above the controls, such as the native dock's tab strip. */\n header?: ReactNode;\n /** Inside a bottom sheet with no scroll view of its own: the list is the sheet's only scroll owner. */\n sheet?: boolean;\n}\n\nexport interface FileListProps {\n items: readonly FileItem[];\n onOpen: (path: string) => void;\n loading?: boolean;\n error?: string;\n /** Offered beside a failed read as Try again. */\n onRetry?: () => void;\n /** Names the list for search and layout, such as \"artifacts\" or \"Personal\". */\n label: string;\n /** Guidance under the empty card's title: why the list is empty and what fills it. */\n emptyText: string;\n grid?: boolean;\n browser?: FileBrowserControls;\n}\n\n/** A folder of files on the phone: recent rows, or a browser with layouts, filters and a swipeable selection. Presentation only. */\nexport function FileList({\n items,\n onOpen,\n loading,\n error,\n onRetry,\n grid = false,\n browser,\n label,\n emptyText,\n}: FileListProps) {\n const t = useT();\n if (browser)\n return (\n <FileBrowserList\n label={label}\n emptyText={emptyText}\n items={items}\n onOpen={onOpen}\n loading={loading}\n error={error}\n onRetry={onRetry}\n browser={browser}\n />\n );\n return (\n <View testID={grid ? 'file-list-grid' : 'file-list-recent'} style={styles.list}>\n {error ? <ListFailure error={error} retained={items.length > 0} onRetry={onRetry} /> : null}\n {loading ? <Text style={styles.meta}>{t('nativeComponents.fileList.loading', 'Loading files...')}</Text> : null}\n {!loading && !error && items.length === 0 ? (\n <EmptyState\n size=\"compact\"\n surface=\"plain\"\n icon={<FolderIcon size={16} />}\n title={t('nativeComponents.fileList.emptyTitle', 'Nothing here yet')}\n description={emptyText}\n />\n ) : null}\n {items.map((item) => (\n <Button\n key={item.path}\n variant={grid ? 'outline' : 'ghost'}\n size=\"card\"\n accessibilityLabel={t('nativeComponents.fileList.open', 'Open {path}', { path: item.path })}\n testID={`file-${item.path}`}\n onPress={() => onOpen(item.path)}\n style={styles.item}\n >\n <FileIcon size={18} color=\"dim\" />\n <View style={styles.label}>\n <Text numberOfLines={1} style={styles.name}>\n {item.name}\n </Text>\n {grid || item.path !== item.name ? (\n <Text numberOfLines={1} style={styles.path}>\n {item.path}\n </Text>\n ) : null}\n {grid ? (\n <Text style={styles.meta}>\n {t('nativeComponents.fileList.bytes', '{size} bytes', {\n size: item.size.toLocaleString(currentLocale()),\n })}\n </Text>\n ) : null}\n </View>\n </Button>\n ))}\n </View>\n );\n}\n\ntype Translate = ReturnType<typeof useT>;\nconst layoutOptions = (t: Translate) => [\n { value: 'tree', label: t('nativeComponents.fileList.layout.tree', 'Tree') },\n { value: 'list', label: t('nativeComponents.fileList.layout.list', 'List') },\n { value: 'grid', label: t('nativeComponents.fileList.layout.grid', 'Grid') },\n];\nconst TYPES = ['any', 'Markdown', 'Image', 'Code', 'Data', 'Document', 'Other'] as const;\nconst modifiedOptions = (t: Translate) =>\n [\n { value: 'any', label: t('nativeComponents.fileList.modified.any', 'Any time') },\n { value: 'today', label: t('nativeComponents.fileList.modified.today', 'Today') },\n { value: '7days', label: t('nativeComponents.fileList.modified.7days', 'Last 7 days') },\n { value: '30days', label: t('nativeComponents.fileList.modified.30days', 'Last 30 days') },\n ] as const;\nconst sortOptions = (t: Translate) =>\n [\n { value: 'name', label: t('nativeComponents.fileList.sort.name', 'Name') },\n { value: 'modified', label: t('nativeComponents.fileList.sort.modified', 'Modified') },\n { value: 'size', label: t('nativeComponents.fileList.sort.size', 'Size') },\n ] as const;\nconst ROW_HEIGHT = 48;\nconst IMAGE_VIEWABILITY = { itemVisiblePercentThreshold: 1 };\n/** Past this the dots stop reading as positions; the counter beside the name still does. */\nconst MAX_DOTS = 7;\nconst PREVIEW_HEIGHT = 320;\n\n/** A failed read: kept files stay listed under it, as the approved RetainedContent target shows. */\nfunction ListFailure({ error, retained, onRetry }: { error: string; retained: boolean; onRetry?: () => void }) {\n const t = useT();\n return (\n <EmptyState\n size=\"compact\"\n surface=\"plain\"\n tone=\"error\"\n title={\n retained\n ? t('nativeComponents.fileList.refreshFailed', \"Couldn't refresh the file list\")\n : t('nativeComponents.fileList.loadFailed', \"Couldn't load the file list\")\n }\n description={retained ? t('nativeComponents.fileList.lastSeen', 'These are the files Po saw last.') : error}\n action={onRetry ? { label: t('nativeComponents.fileList.retry', 'Try again'), onAction: onRetry } : undefined}\n />\n );\n}\n\nfunction FileBrowserList({\n items,\n onOpen,\n loading,\n error,\n onRetry,\n browser: b,\n label,\n emptyText,\n}: FileListProps & { browser: FileBrowserControls }) {\n const t = useT();\n const LAYOUTS = layoutOptions(t);\n const MODIFIED = modifiedOptions(t);\n const SORTS = sortOptions(t);\n const grid = b.layout === 'grid';\n const onViewableImagesChange = b.onViewableImagesChange;\n const onViewableItemsChanged = useCallback(\n ({ viewableItems }: { viewableItems: (Omit<ListViewToken, 'item'> & { item: FileTreeRow })[] }) => {\n onViewableImagesChange?.(\n viewableItems.flatMap(({ item, isViewable }) =>\n isViewable && item.kind === 'file' && fileKind(item.item.path) === 'Image' ? [item.item.path] : [],\n ),\n );\n },\n [onViewableImagesChange],\n );\n const rows: readonly FileTreeRow[] =\n b.layout === 'tree' ? b.rows : items.map((item) => ({ kind: 'file', item, depth: 0 }));\n // Prev and next step through the files the person can see, in the order they see them.\n const files = rows.flatMap((row) => (row.kind === 'file' ? [row.item] : []));\n const at = b.selected ? files.findIndex((file) => file.path === b.selected?.path) : -1;\n const List = b.sheet ? SheetList<FileTreeRow> : FlatList<FileTreeRow>;\n const list = (\n <List\n {...(b.sheet ? { embedded: true } : {})}\n key={b.layout}\n testID=\"file-list-browser\"\n onViewableItemsChanged={onViewableItemsChanged}\n viewabilityConfig={IMAGE_VIEWABILITY}\n data={loading ? [] : rows}\n numColumns={grid ? 2 : 1}\n columnWrapperStyle={grid ? styles.columns : undefined}\n keyExtractor={(row) => (row.kind === 'dir' ? `dir:${row.path}` : row.item.path)}\n keyboardShouldPersistTaps=\"handled\"\n ListHeaderComponent={\n <>\n {b.header}\n <View style={styles.head}>\n <SegmentedControl\n accessibilityLabel={t('nativeComponents.fileList.layoutLabel', '{label} layout', { label })}\n options={LAYOUTS}\n value={b.layout}\n onValueChange={(value) => {\n if (isFileLayout(value)) b.onLayoutChange(value);\n }}\n />\n <View style={styles.toolbar}>\n <View style={styles.search}>\n <SearchIcon size={18} />\n <Input\n variant=\"bare\"\n accessibilityLabel={t('nativeComponents.fileList.search', 'Search {label}', { label })}\n placeholder={t('nativeComponents.fileList.search', 'Search {label}', { label })}\n value={b.query}\n onChangeText={b.onQueryChange}\n style={styles.searchInput}\n autoCapitalize=\"none\"\n />\n </View>\n <DropdownMenu>\n <DropdownMenuTrigger\n variant=\"outline\"\n accessibilityLabel={t('nativeComponents.fileList.filters', 'Filters')}\n >\n <SlidersIcon />\n {t('nativeComponents.fileList.filters', 'Filters')}\n </DropdownMenuTrigger>\n <DropdownMenuContent>\n <DropdownMenuLabel>{t('nativeComponents.fileList.typeHeading', 'Type')}</DropdownMenuLabel>\n {TYPES.map((type) => (\n <DropdownMenuCheckboxItem\n key={type}\n checked={b.type === type}\n onCheckedChange={() => b.onTypeChange(type)}\n >\n {type === 'any' ? t('nativeComponents.fileList.allTypes', 'All types') : fileKindLabel(type, t)}\n </DropdownMenuCheckboxItem>\n ))}\n <DropdownMenuSeparator />\n <DropdownMenuLabel>{t('nativeComponents.fileList.sort.modified', 'Modified')}</DropdownMenuLabel>\n {MODIFIED.map(({ value, label }) => (\n <DropdownMenuCheckboxItem\n key={value}\n checked={b.modified === value}\n onCheckedChange={() => b.onModifiedChange(value)}\n >\n {label}\n </DropdownMenuCheckboxItem>\n ))}\n <DropdownMenuSeparator />\n <DropdownMenuLabel>{t('nativeComponents.fileList.sortHeading', 'Sort')}</DropdownMenuLabel>\n {SORTS.map(({ value, label }) => (\n <DropdownMenuCheckboxItem\n key={value}\n checked={b.sort === value}\n onCheckedChange={() => b.onSortChange(value)}\n >\n {label}\n </DropdownMenuCheckboxItem>\n ))}\n <DropdownMenuCheckboxItem\n checked={b.direction === 'asc'}\n onCheckedChange={() => b.onDirectionChange('asc')}\n >\n {t('nativeComponents.fileList.ascending', 'Ascending')}\n </DropdownMenuCheckboxItem>\n <DropdownMenuCheckboxItem\n checked={b.direction === 'desc'}\n onCheckedChange={() => b.onDirectionChange('desc')}\n >\n {t('nativeComponents.fileList.descending', 'Descending')}\n </DropdownMenuCheckboxItem>\n </DropdownMenuContent>\n </DropdownMenu>\n </View>\n <View style={styles.chips}>\n {b.query ? (\n <Button\n variant=\"outline\"\n accessibilityLabel={t('nativeComponents.fileList.removeSearch', 'Remove search filter')}\n onPress={() => b.onQueryChange('')}\n >\n {t('nativeComponents.fileList.searchChip', 'Search: {query}', { query: b.query })}\n <CloseIcon />\n </Button>\n ) : null}\n {b.type !== 'any' ? (\n <Button\n variant=\"outline\"\n accessibilityLabel={t('nativeComponents.fileList.removeType', 'Remove type filter')}\n onPress={() => b.onTypeChange('any')}\n >\n {fileKindLabel(b.type, t)}\n <CloseIcon />\n </Button>\n ) : null}\n {b.modified !== 'any' ? (\n <Button\n variant=\"outline\"\n accessibilityLabel={t('nativeComponents.fileList.removeModified', 'Remove modified filter')}\n onPress={() => b.onModifiedChange('any')}\n >\n {MODIFIED.find((option) => option.value === b.modified)?.label}\n <CloseIcon />\n </Button>\n ) : null}\n </View>\n {error ? <ListFailure error={error} retained={items.length > 0} onRetry={onRetry} /> : null}\n {loading ? (\n <Text style={styles.meta}>{t('nativeComponents.fileList.loading', 'Loading files...')}</Text>\n ) : null}\n </View>\n </>\n }\n ListEmptyComponent={\n loading || error ? undefined : b.totalCount ? (\n <EmptyState\n size=\"compact\"\n surface=\"plain\"\n icon={<SearchIcon size={16} />}\n title={t('nativeComponents.fileList.noMatch', 'No files match')}\n secondaryAction={{\n label: t('nativeComponents.fileList.clearFilters', 'Clear filters'),\n onAction: () => {\n b.onQueryChange('');\n b.onTypeChange('any');\n b.onModifiedChange('any');\n },\n }}\n style={styles.inset}\n />\n ) : (\n <EmptyState\n size=\"compact\"\n surface=\"plain\"\n icon={<FolderIcon size={16} />}\n title={t('nativeComponents.fileList.emptyTitle', 'Nothing here yet')}\n description={emptyText}\n style={styles.inset}\n />\n )\n }\n renderItem={({ item: row }) => {\n if (row.kind === 'dir')\n return (\n <Button\n variant=\"ghost\"\n style={[styles.row, styles.indent(row.depth)]}\n accessibilityLabel={\n row.open\n ? t('nativeComponents.fileList.collapse', 'Collapse {path}', { path: row.path })\n : t('nativeComponents.fileList.expand', 'Expand {path}', { path: row.path })\n }\n accessibilityState={{ expanded: row.open }}\n onPress={() => b.onToggleDirectory(row.path)}\n >\n {row.open ? <ChevronDownIcon /> : <ChevronRightIcon />}\n <FolderIcon />\n <Text numberOfLines={1} style={[styles.name, styles.label]}>\n {row.name}\n </Text>\n <Text style={styles.meta}>{row.count}</Text>\n </Button>\n );\n const item = row.item;\n const image = fileKind(item.path) === 'Image';\n const selected = b.selected?.path === item.path;\n return (\n <Button\n variant=\"ghost\"\n size=\"card\"\n testID={`file-${item.path}`}\n accessibilityLabel={t('nativeComponents.fileList.select', 'Select {path}', { path: item.path })}\n accessibilityState={{ selected }}\n onPress={() => b.onSelect(item)}\n style={[grid ? styles.tile : styles.row, selected && styles.selected, !grid && styles.indent(row.depth)]}\n >\n {b.layout === 'tree' ? <View accessible={false} style={styles.chevronGutter} /> : null}\n {grid ? (\n <View style={styles.thumbnail}>\n {image && b.renderImage ? (\n b.renderImage(item, false)\n ) : image ? (\n <ImageIcon size={28} />\n ) : (\n <FileIcon size={28} />\n )}\n </View>\n ) : (\n // Every file row keeps the same slot, so names line up whether or not a picture loaded.\n <View style={styles.rowThumbnail}>\n {image && b.renderImage ? (\n b.renderImage(item, true)\n ) : image ? (\n <ImageIcon size={18} />\n ) : (\n <FileIcon size={18} />\n )}\n </View>\n )}\n <View style={styles.label}>\n <Text numberOfLines={1} style={styles.name}>\n {item.name}\n </Text>\n <Text numberOfLines={1} style={styles.path}>\n {item.path}\n </Text>\n </View>\n <Text style={styles.meta}>{sizeLabel(item.size)}</Text>\n </Button>\n );\n }}\n ListFooterComponent={\n <View style={styles.foot}>\n <Text style={styles.meta}>\n {t('nativeComponents.fileList.count', '{shown} of {total} files', {\n shown: items.length,\n total: b.totalCount,\n })}\n </Text>\n </View>\n }\n />\n );\n return (\n <>\n {list}\n <Sheet\n open={b.selected !== undefined}\n onOpenChange={(open) => {\n if (!open) b.onCloseSelection();\n }}\n >\n <SheetContent>\n {b.selected ? (\n <View style={styles.foot}>\n <View style={styles.selection} testID=\"file-selection\">\n <View style={styles.titleRow}>\n <Text accessibilityRole=\"header\" numberOfLines={1} style={[styles.name, styles.label]}>\n {b.selected.name}\n </Text>\n {files.length > 1 ? (\n <Text accessibilityLiveRegion=\"polite\" style={styles.meta}>\n {t('nativeComponents.fileList.position', '{index} of {total}', {\n index: Math.max(0, at) + 1,\n total: files.length,\n })}\n </Text>\n ) : null}\n </View>\n <SelectionSlides\n files={at < 0 ? [b.selected] : files}\n selected={b.selected}\n onSelect={b.onSelect}\n renderImage={b.renderImage}\n />\n <Text numberOfLines={2} style={styles.path}>\n {b.selected.path}\n </Text>\n <Text style={styles.meta}>\n {fileKindLabel(fileKind(b.selected.path), t)} · {sizeLabel(b.selected.size)}\n </Text>\n <View style={styles.actions}>\n <Button variant=\"outline\" onPress={b.onCloseSelection}>\n {t('nativeComponents.fileList.close', 'Close')}\n </Button>\n <Button\n variant=\"primary\"\n onPress={() => {\n if (b.selected) {\n b.onCloseSelection();\n onOpen(b.selected.path);\n }\n }}\n >\n {t('nativeComponents.fileList.openAction', 'Open')}\n </Button>\n </View>\n </View>\n </View>\n ) : null}\n </SheetContent>\n </Sheet>\n </>\n );\n}\n\n/** The selected file large; swiping and the arrows select its neighbours in the list. */\nfunction SelectionSlides({\n files,\n selected,\n onSelect,\n renderImage,\n}: {\n files: readonly FileItem[];\n selected: FileItem;\n onSelect: (item: FileItem) => void;\n renderImage?: FileBrowserControls['renderImage'];\n}) {\n const t = useT();\n const index = Math.max(\n 0,\n files.findIndex((file) => file.path === selected.path),\n );\n // A horizontal scroller does not stretch its pages, so each page takes the measured width.\n const [width, setWidth] = useState(0);\n const scroller = useRef<ComponentRef<typeof ScrollView>>(null);\n const placed = useRef(false);\n useEffect(() => {\n if (width === 0) return;\n // Opening lands on the tapped file; later steps glide.\n scroller.current?.scrollTo({ x: index * width, animated: placed.current });\n placed.current = true;\n }, [index, width]);\n const step = (by: number) => {\n const next = files[index + by];\n if (next) onSelect(next);\n };\n return (\n <View>\n <ScrollView\n ref={scroller}\n horizontal\n pagingEnabled\n showsHorizontalScrollIndicator={false}\n onLayout={(event) => setWidth(event.nativeEvent.layout.width)}\n onMomentumScrollEnd={(event) => {\n if (width > 0) step(Math.round(event.nativeEvent.contentOffset.x / width) - index);\n }}\n style={styles.preview}\n >\n {files.map((file, page) => (\n <View\n key={file.path}\n accessibilityElementsHidden={page !== index}\n importantForAccessibility={page === index ? 'auto' : 'no-hide-descendants'}\n style={[styles.page, { width }]}\n >\n {/* ponytail: only the open page and its neighbours mount; a long list never reads every picture. */}\n {Math.abs(page - index) > 1 ? null : fileKind(file.path) !== 'Image' ? (\n <FileIcon size={28} />\n ) : renderImage ? (\n renderImage(file, false)\n ) : (\n <ImageIcon size={28} />\n )}\n </View>\n ))}\n </ScrollView>\n {files.length > 1 ? (\n <>\n <Button\n variant=\"ghost\"\n size=\"icon-md\"\n accessibilityLabel={t('nativeComponents.fileList.previous', 'Previous file')}\n disabled={index === 0}\n onPress={() => step(-1)}\n style={[styles.arrow, styles.previous]}\n >\n <View style={styles.flip}>\n <ChevronRightIcon size={18} color=\"hi\" />\n </View>\n </Button>\n <Button\n variant=\"ghost\"\n size=\"icon-md\"\n accessibilityLabel={t('nativeComponents.fileList.next', 'Next file')}\n disabled={index === files.length - 1}\n onPress={() => step(1)}\n style={[styles.arrow, styles.next]}\n >\n <ChevronRightIcon size={18} color=\"hi\" />\n </Button>\n </>\n ) : null}\n {files.length > 1 && files.length <= MAX_DOTS ? (\n <View accessible={false} style={styles.dots}>\n {files.map((file, page) => (\n <View key={file.path} style={[styles.dot, page === index && styles.dotActive]} />\n ))}\n </View>\n ) : null}\n </View>\n );\n}\n\nconst styles = StyleSheet.create((theme) => ({\n head: { gap: theme.spacing(3), padding: theme.spacing(4), paddingBottom: theme.spacing(3) },\n foot: { gap: theme.spacing(3), padding: theme.spacing(4), paddingTop: theme.spacing(3) },\n inset: { paddingHorizontal: theme.spacing(4) },\n toolbar: { flexDirection: 'row', alignItems: 'center', gap: theme.spacing(2) },\n search: {\n flex: 1,\n minWidth: 0,\n flexDirection: 'row',\n alignItems: 'center',\n gap: theme.spacing(2),\n paddingHorizontal: theme.spacing(2),\n borderWidth: 1,\n borderColor: theme.colors.border,\n borderRadius: theme.borderRadius.DEFAULT,\n backgroundColor: theme.colors.deep,\n },\n searchInput: { flex: 1 },\n chips: { flexDirection: 'row', flexWrap: 'wrap', gap: theme.spacing(2) },\n row: {\n marginHorizontal: theme.spacing(4),\n marginBottom: theme.spacing(2),\n // A file row holds two lines; a fixed height pressed them against the border.\n minHeight: ROW_HEIGHT,\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'flex-start',\n gap: theme.spacing(2),\n borderWidth: 1,\n borderColor: theme.colors['border-soft'],\n borderRadius: theme.borderRadius.DEFAULT,\n paddingVertical: theme.spacing(2),\n paddingRight: theme.spacing(3),\n },\n // Tree depth adds to the row's own inset; replacing it put the icon against the border.\n indent: (depth: number) => ({ paddingLeft: theme.spacing(3) + depth * 16 }),\n chevronGutter: { width: 16 },\n columns: { gap: theme.spacing(2), paddingHorizontal: theme.spacing(4) },\n tile: {\n flex: 1,\n maxWidth: '50%',\n flexDirection: 'column',\n alignItems: 'stretch',\n gap: theme.spacing(2),\n borderWidth: 1,\n borderColor: theme.colors['border-soft'],\n marginBottom: theme.spacing(2),\n },\n thumbnail: {\n height: 96,\n backgroundColor: theme.colors.deep,\n borderRadius: theme.borderRadius.DEFAULT,\n overflow: 'hidden',\n alignItems: 'center',\n justifyContent: 'center',\n },\n rowThumbnail: {\n width: 40,\n height: 40,\n borderRadius: theme.borderRadius.sm,\n overflow: 'hidden',\n alignItems: 'center',\n justifyContent: 'center',\n },\n selected: { backgroundColor: theme.colors['tint-green'], borderColor: theme.colors['edge-green'] },\n selection: {\n flexShrink: 0,\n padding: theme.spacing(3),\n gap: theme.spacing(2),\n borderWidth: 1,\n borderColor: theme.colors.border,\n borderRadius: theme.borderRadius.DEFAULT,\n backgroundColor: theme.colors.panel,\n },\n actions: { flexDirection: 'row', justifyContent: 'flex-end', gap: theme.spacing(2) },\n titleRow: { flexDirection: 'row', alignItems: 'center', gap: theme.spacing(2) },\n preview: {\n height: PREVIEW_HEIGHT,\n backgroundColor: theme.colors.deep,\n borderRadius: theme.borderRadius.DEFAULT,\n },\n page: { height: PREVIEW_HEIGHT, alignItems: 'center', justifyContent: 'center' },\n arrow: {\n position: 'absolute',\n top: PREVIEW_HEIGHT / 2 - 22,\n width: 44,\n height: 44,\n borderRadius: 22,\n backgroundColor: theme.colors.panel,\n },\n previous: { left: theme.spacing(2) },\n next: { right: theme.spacing(2) },\n flip: { transform: [{ rotate: '180deg' }] },\n dots: { flexDirection: 'row', justifyContent: 'center', gap: theme.spacing(2), paddingTop: theme.spacing(2) },\n dot: { width: 6, height: 6, borderRadius: 3, backgroundColor: theme.colors.faint },\n dotActive: { backgroundColor: theme.colors.green },\n list: { gap: theme.spacing(2) },\n // The card size stacks its children; a recent row reads like the browser's list row instead.\n item: {\n minHeight: 44,\n flexDirection: 'row',\n justifyContent: 'flex-start',\n alignItems: 'center',\n gap: theme.spacing(3),\n },\n label: { flex: 1, gap: theme.spacing(1), minWidth: 0 },\n name: {\n fontFamily: fontOf(theme.fontFamily.sans),\n fontWeight: '600',\n fontSize: theme.fontSize.base,\n color: theme.colors.text,\n },\n path: { fontFamily: fontOf(theme.fontFamily.mono), fontSize: theme.fontSize.sm, color: theme.colors.dim },\n meta: { fontFamily: fontOf(theme.fontFamily.sans), fontSize: theme.fontSize.sm, color: theme.colors.dim },\n}));\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAwFA,SAAgBgF,SAAS,EACvBT,OACAC,QACAC,SACAC,OACAC,SACAG,OAAO,OACPC,SACAH,OACAC,aACgB;CAChB,MAAMI,IAAIhF,KAAK;CACf,IAAI8E,SACF,OACE,oBAAC,iBAAD;EACSH;EACIC;EACJN;EACCC;EACCC;EACFC;EACEC;EACAI;CAAQ;CAGvB,OACE,qBAAC,MAAD;EAAM,QAAQD,OAAO,mBAAmB;EAAoB,OAAOI,OAAOC;YAA1E;GACGT,QAAQ,oBAAC,aAAD;IAAoBA;IAAO,UAAUH,MAAMa,SAAS;IAAYT;GAAQ,KAAM;GACtFF,UAAU,oBAAC,MAAD;IAAM,OAAOS,OAAOG;cAAOJ,EAAE,qCAAqC,kBAAkB;GAAQ,KAAI;GAC1G,CAACR,WAAW,CAACC,SAASH,MAAMa,WAAW,IACtC,oBAAC,YAAD;IACE,MAAK;IACL,SAAQ;IACR,MAAM,oBAAC,YAAD,EAAY,MAAM,GAAG;IAC3B,OAAOH,EAAE,wCAAwC,kBAAkB;IACnE,aAAaJ;GAAU,KAEvB;GACHN,MAAMe,KAAKzB,SACV,qBAAC,QAAD;IAEE,SAASiB,OAAO,YAAY;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,MAAME,QAAQ,CAAC;EAAGS,UAAU;EAACN,mBAAA,CAAA,CAAA;CAAC;CACrDnG,MAAM;EACJwI,YAAYlM,OAAOwJ,MAAM0C,WAAWC,IAAI;EACxCC,YAAY;EACZC,UAAU7C,MAAM6C,SAASC;EACzBC,OAAO/C,MAAMc,OAAOkC;EAAI3C,mBAAA,CAAA,CAAA;CAC1B;CACAhI,MAAM;EAAEqK,YAAYlM,OAAOwJ,MAAM0C,WAAWO,IAAI;EAAGJ,UAAU7C,MAAM6C,SAASd;EAAIgB,OAAO/C,MAAMc,OAAOoC;EAAG7C,mBAAA,CAAA,CAAA;CAAC;CACxGrG,MAAM;EAAE0I,YAAYlM,OAAOwJ,MAAM0C,WAAWC,IAAI;EAAGE,UAAU7C,MAAM6C,SAASd;EAAIgB,OAAO/C,MAAMc,OAAOoC;EAAG7C,mBAAA,CAAA,CAAA;CAAC;AAC1G,EAAE"}
1
+ {"version":3,"file":"FileList.mjs","names":["useT","fileKind","isFileLayout","sizeLabel","FileItem","FileKind","FileLayout","FileModified","FileSort","FileSortDirection","FileTreeRow","ComponentRef","ReactNode","useCallback","useEffect","useRef","useState","ListViewToken","StyleSheet","ChevronDownIcon","ChevronRightIcon","CloseIcon","FileIcon","FolderIcon","ImageIcon","SearchIcon","SlidersIcon","fileKindLabel","fontOf","Button","DropdownMenu","DropdownMenuCheckboxItem","DropdownMenuContent","DropdownMenuLabel","DropdownMenuSeparator","DropdownMenuTrigger","EmptyState","Input","SegmentedControl","Sheet","SheetContent","SheetList","FileBrowserControls","layout","onLayoutChange","query","onQueryChange","type","onTypeChange","modified","onModifiedChange","sort","onSortChange","direction","onDirectionChange","rows","onToggleDirectory","path","selected","onSelect","item","onCloseSelection","totalCount","onViewableImagesChange","paths","renderImage","compact","header","sheet","FileListProps","items","onOpen","loading","error","onRetry","label","emptyText","grid","browser","FileList","t","styles","list","length","meta","map","name","size","Translate","ReturnType","layoutOptions","value","TYPES","const","modifiedOptions","sortOptions","ROW_HEIGHT","IMAGE_VIEWABILITY","itemVisiblePercentThreshold","MAX_DOTS","PREVIEW_HEIGHT","ListFailure","retained","onAction","undefined","FileBrowserList","b","LAYOUTS","MODIFIED","SORTS","onViewableItemsChanged","viewableItems","Omit","flatMap","isViewable","kind","depth","files","row","at","findIndex","file","List","FlatList","embedded","columns","head","toolbar","search","searchInput","chips","find","option","inset","indent","open","expanded","count","image","tile","chevronGutter","thumbnail","rowThumbnail","foot","shown","total","selection","titleRow","index","Math","max","actions","SelectionSlides","width","setWidth","scroller","ScrollView","placed","current","scrollTo","x","animated","step","by","next","event","nativeEvent","round","contentOffset","preview","page","abs","arrow","previous","flip","dots","dot","dotActive","create","theme","gap","spacing","padding","paddingBottom","uni__dependencies","paddingTop","paddingHorizontal","flexDirection","alignItems","flex","minWidth","borderWidth","borderColor","colors","border","borderRadius","DEFAULT","backgroundColor","deep","flexWrap","marginHorizontal","marginBottom","minHeight","justifyContent","paddingVertical","paddingRight","paddingLeft","maxWidth","height","overflow","sm","flexShrink","panel","position","top","left","right","transform","rotate","faint","green","fontFamily","sans","fontWeight","fontSize","base","color","text","mono","dim"],"sources":["../../src/components/FileList.tsx"],"sourcesContent":["import { useT } from '@agimon-ai/po-core/native';\nimport {\n fileKind,\n isFileLayout,\n sizeLabel,\n type FileItem,\n type FileKind,\n type FileLayout,\n type FileModified,\n type FileSort,\n type FileSortDirection,\n type FileTreeRow,\n} from '@agimon-ai/po-web-components/text';\nimport { type ComponentRef, type ReactNode, useCallback, useEffect, useRef, useState } from 'react';\nimport { FlatList, ScrollView, Text, View, type ListViewToken } from 'react-native';\nimport { StyleSheet } from 'react-native-unistyles';\n\nimport {\n ChevronDownIcon,\n ChevronRightIcon,\n CloseIcon,\n FileIcon,\n FolderIcon,\n ImageIcon,\n SearchIcon,\n SlidersIcon,\n} from '../icons/icons';\nimport { fileKindLabel } from '../lib/fileKindLabel';\nimport { fontOf } from '../lib/fonts';\nimport { Button } from './Button';\nimport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from './DropdownMenu';\nimport { EmptyState } from './EmptyState';\nimport { Input } from './Input';\nimport { SegmentedControl } from './SegmentedControl';\nimport { Sheet, SheetContent } from './Sheet';\nimport { SheetList } from './SheetList';\n\nexport interface FileBrowserControls {\n layout: FileLayout;\n onLayoutChange: (layout: FileLayout) => void;\n query: string;\n onQueryChange: (query: string) => void;\n type: FileKind | 'any';\n onTypeChange: (type: FileKind | 'any') => void;\n modified: FileModified;\n onModifiedChange: (modified: FileModified) => void;\n sort: FileSort;\n onSortChange: (sort: FileSort) => void;\n direction: FileSortDirection;\n onDirectionChange: (direction: FileSortDirection) => void;\n rows: readonly FileTreeRow[];\n onToggleDirectory: (path: string) => void;\n selected?: FileItem;\n onSelect: (item: FileItem) => void;\n onCloseSelection: () => void;\n totalCount: number;\n onViewableImagesChange?: (paths: readonly string[]) => void;\n /** A loaded thumbnail or a placeholder for an image file; `compact` is a list row's small square. */\n renderImage?: (item: FileItem, compact: boolean) => ReactNode;\n /** Drawn first in the list, above the controls, such as the native dock's tab strip. */\n header?: ReactNode;\n /** Inside a bottom sheet with no scroll view of its own: the list is the sheet's only scroll owner. */\n sheet?: boolean;\n}\n\nexport interface FileListProps {\n items: readonly FileItem[];\n onOpen: (path: string) => void;\n loading?: boolean;\n error?: string;\n /** Offered beside a failed read as Try again. */\n onRetry?: () => void;\n /** Names the list for search and layout, such as \"artifacts\" or \"Personal\". */\n label: string;\n /** Guidance under the empty card's title: why the list is empty and what fills it. */\n emptyText: string;\n grid?: boolean;\n browser?: FileBrowserControls;\n}\n\n/** A folder of files on the phone: recent rows, or a browser with layouts, filters and a swipeable selection. Presentation only. */\nexport function FileList({\n items,\n onOpen,\n loading,\n error,\n onRetry,\n grid = false,\n browser,\n label,\n emptyText,\n}: FileListProps) {\n const t = useT();\n if (browser)\n return (\n <FileBrowserList\n label={label}\n emptyText={emptyText}\n items={items}\n onOpen={onOpen}\n loading={loading}\n error={error}\n onRetry={onRetry}\n browser={browser}\n />\n );\n return (\n <View testID={grid ? 'file-list-grid' : 'file-list-recent'} style={styles.list}>\n {error ? <ListFailure error={error} retained={items.length > 0} onRetry={onRetry} /> : null}\n {loading ? <Text style={styles.meta}>{t('nativeComponents.fileList.loading', 'Loading files...')}</Text> : null}\n {!loading && !error && items.length === 0 ? (\n <EmptyState\n size=\"compact\"\n surface=\"plain\"\n icon={<FolderIcon size={16} />}\n title={t('nativeComponents.fileList.emptyTitle', 'Nothing here yet')}\n description={emptyText}\n />\n ) : null}\n {items.map((item) => (\n <Button\n key={item.path}\n variant={grid ? 'outline' : 'ghost'}\n size=\"card\"\n accessibilityLabel={t('nativeComponents.fileList.open', 'Open {path}', { path: item.path })}\n testID={`file-${item.path}`}\n onPress={() => onOpen(item.path)}\n style={styles.item}\n >\n <FileIcon size={18} color=\"dim\" />\n <View style={styles.label}>\n <Text numberOfLines={1} style={styles.name}>\n {item.name}\n </Text>\n {grid || item.path !== item.name ? (\n <Text numberOfLines={1} style={styles.path}>\n {item.path}\n </Text>\n ) : null}\n {grid ? <Text style={styles.meta}>{sizeLabel(item.size)}</Text> : null}\n </View>\n </Button>\n ))}\n </View>\n );\n}\n\ntype Translate = ReturnType<typeof useT>;\nconst layoutOptions = (t: Translate) => [\n { value: 'tree', label: t('nativeComponents.fileList.layout.tree', 'Tree') },\n { value: 'list', label: t('nativeComponents.fileList.layout.list', 'List') },\n { value: 'grid', label: t('nativeComponents.fileList.layout.grid', 'Grid') },\n];\nconst TYPES = ['any', 'Markdown', 'Image', 'Code', 'Data', 'Document', 'Other'] as const;\nconst modifiedOptions = (t: Translate) =>\n [\n { value: 'any', label: t('nativeComponents.fileList.modified.any', 'Any time') },\n { value: 'today', label: t('nativeComponents.fileList.modified.today', 'Today') },\n { value: '7days', label: t('nativeComponents.fileList.modified.7days', 'Last 7 days') },\n { value: '30days', label: t('nativeComponents.fileList.modified.30days', 'Last 30 days') },\n ] as const;\nconst sortOptions = (t: Translate) =>\n [\n { value: 'name', label: t('nativeComponents.fileList.sort.name', 'Name') },\n { value: 'modified', label: t('nativeComponents.fileList.sort.modified', 'Modified') },\n { value: 'size', label: t('nativeComponents.fileList.sort.size', 'Size') },\n ] as const;\nconst ROW_HEIGHT = 48;\nconst IMAGE_VIEWABILITY = { itemVisiblePercentThreshold: 1 };\n/** Past this the dots stop reading as positions; the counter beside the name still does. */\nconst MAX_DOTS = 7;\nconst PREVIEW_HEIGHT = 320;\n\n/** A failed read: kept files stay listed under it, as the approved RetainedContent target shows. */\nfunction ListFailure({ error, retained, onRetry }: { error: string; retained: boolean; onRetry?: () => void }) {\n const t = useT();\n return (\n <EmptyState\n size=\"compact\"\n surface=\"plain\"\n tone=\"error\"\n title={\n retained\n ? t('nativeComponents.fileList.refreshFailed', \"Couldn't refresh the file list\")\n : t('nativeComponents.fileList.loadFailed', \"Couldn't load the file list\")\n }\n description={retained ? t('nativeComponents.fileList.lastSeen', 'These are the files Po saw last.') : error}\n action={onRetry ? { label: t('nativeComponents.fileList.retry', 'Try again'), onAction: onRetry } : undefined}\n />\n );\n}\n\nfunction FileBrowserList({\n items,\n onOpen,\n loading,\n error,\n onRetry,\n browser: b,\n label,\n emptyText,\n}: FileListProps & { browser: FileBrowserControls }) {\n const t = useT();\n const LAYOUTS = layoutOptions(t);\n const MODIFIED = modifiedOptions(t);\n const SORTS = sortOptions(t);\n const grid = b.layout === 'grid';\n const onViewableImagesChange = b.onViewableImagesChange;\n const onViewableItemsChanged = useCallback(\n ({ viewableItems }: { viewableItems: (Omit<ListViewToken, 'item'> & { item: FileTreeRow })[] }) => {\n onViewableImagesChange?.(\n viewableItems.flatMap(({ item, isViewable }) =>\n isViewable && item.kind === 'file' && fileKind(item.item.path) === 'Image' ? [item.item.path] : [],\n ),\n );\n },\n [onViewableImagesChange],\n );\n const rows: readonly FileTreeRow[] =\n b.layout === 'tree' ? b.rows : items.map((item) => ({ kind: 'file', item, depth: 0 }));\n // Prev and next step through the files the person can see, in the order they see them.\n const files = rows.flatMap((row) => (row.kind === 'file' ? [row.item] : []));\n const at = b.selected ? files.findIndex((file) => file.path === b.selected?.path) : -1;\n const List = b.sheet ? SheetList<FileTreeRow> : FlatList<FileTreeRow>;\n const list = (\n <List\n {...(b.sheet ? { embedded: true } : {})}\n key={b.layout}\n testID=\"file-list-browser\"\n onViewableItemsChanged={onViewableItemsChanged}\n viewabilityConfig={IMAGE_VIEWABILITY}\n data={loading ? [] : rows}\n numColumns={grid ? 2 : 1}\n columnWrapperStyle={grid ? styles.columns : undefined}\n keyExtractor={(row) => (row.kind === 'dir' ? `dir:${row.path}` : row.item.path)}\n keyboardShouldPersistTaps=\"handled\"\n ListHeaderComponent={\n <>\n {b.header}\n <View style={styles.head}>\n <SegmentedControl\n accessibilityLabel={t('nativeComponents.fileList.layoutLabel', '{label} layout', { label })}\n options={LAYOUTS}\n value={b.layout}\n onValueChange={(value) => {\n if (isFileLayout(value)) b.onLayoutChange(value);\n }}\n />\n <View style={styles.toolbar}>\n <View style={styles.search}>\n <SearchIcon size={18} />\n <Input\n variant=\"bare\"\n accessibilityLabel={t('nativeComponents.fileList.search', 'Search {label}', { label })}\n placeholder={t('nativeComponents.fileList.search', 'Search {label}', { label })}\n value={b.query}\n onChangeText={b.onQueryChange}\n style={styles.searchInput}\n autoCapitalize=\"none\"\n />\n </View>\n <DropdownMenu>\n <DropdownMenuTrigger\n variant=\"outline\"\n accessibilityLabel={t('nativeComponents.fileList.filters', 'Filters')}\n >\n <SlidersIcon />\n {t('nativeComponents.fileList.filters', 'Filters')}\n </DropdownMenuTrigger>\n <DropdownMenuContent>\n <DropdownMenuLabel>{t('nativeComponents.fileList.typeHeading', 'Type')}</DropdownMenuLabel>\n {TYPES.map((type) => (\n <DropdownMenuCheckboxItem\n key={type}\n checked={b.type === type}\n onCheckedChange={() => b.onTypeChange(type)}\n >\n {type === 'any' ? t('nativeComponents.fileList.allTypes', 'All types') : fileKindLabel(type, t)}\n </DropdownMenuCheckboxItem>\n ))}\n <DropdownMenuSeparator />\n <DropdownMenuLabel>{t('nativeComponents.fileList.sort.modified', 'Modified')}</DropdownMenuLabel>\n {MODIFIED.map(({ value, label }) => (\n <DropdownMenuCheckboxItem\n key={value}\n checked={b.modified === value}\n onCheckedChange={() => b.onModifiedChange(value)}\n >\n {label}\n </DropdownMenuCheckboxItem>\n ))}\n <DropdownMenuSeparator />\n <DropdownMenuLabel>{t('nativeComponents.fileList.sortHeading', 'Sort')}</DropdownMenuLabel>\n {SORTS.map(({ value, label }) => (\n <DropdownMenuCheckboxItem\n key={value}\n checked={b.sort === value}\n onCheckedChange={() => b.onSortChange(value)}\n >\n {label}\n </DropdownMenuCheckboxItem>\n ))}\n <DropdownMenuCheckboxItem\n checked={b.direction === 'asc'}\n onCheckedChange={() => b.onDirectionChange('asc')}\n >\n {t('nativeComponents.fileList.ascending', 'Ascending')}\n </DropdownMenuCheckboxItem>\n <DropdownMenuCheckboxItem\n checked={b.direction === 'desc'}\n onCheckedChange={() => b.onDirectionChange('desc')}\n >\n {t('nativeComponents.fileList.descending', 'Descending')}\n </DropdownMenuCheckboxItem>\n </DropdownMenuContent>\n </DropdownMenu>\n </View>\n <View style={styles.chips}>\n {b.query ? (\n <Button\n variant=\"outline\"\n accessibilityLabel={t('nativeComponents.fileList.removeSearch', 'Remove search filter')}\n onPress={() => b.onQueryChange('')}\n >\n {t('nativeComponents.fileList.searchChip', 'Search: {query}', { query: b.query })}\n <CloseIcon />\n </Button>\n ) : null}\n {b.type !== 'any' ? (\n <Button\n variant=\"outline\"\n accessibilityLabel={t('nativeComponents.fileList.removeType', 'Remove type filter')}\n onPress={() => b.onTypeChange('any')}\n >\n {fileKindLabel(b.type, t)}\n <CloseIcon />\n </Button>\n ) : null}\n {b.modified !== 'any' ? (\n <Button\n variant=\"outline\"\n accessibilityLabel={t('nativeComponents.fileList.removeModified', 'Remove modified filter')}\n onPress={() => b.onModifiedChange('any')}\n >\n {MODIFIED.find((option) => option.value === b.modified)?.label}\n <CloseIcon />\n </Button>\n ) : null}\n </View>\n {error ? <ListFailure error={error} retained={items.length > 0} onRetry={onRetry} /> : null}\n {loading ? (\n <Text style={styles.meta}>{t('nativeComponents.fileList.loading', 'Loading files...')}</Text>\n ) : null}\n </View>\n </>\n }\n ListEmptyComponent={\n loading || error ? undefined : b.totalCount ? (\n <EmptyState\n size=\"compact\"\n surface=\"plain\"\n icon={<SearchIcon size={16} />}\n title={t('nativeComponents.fileList.noMatch', 'No files match')}\n secondaryAction={{\n label: t('nativeComponents.fileList.clearFilters', 'Clear filters'),\n onAction: () => {\n b.onQueryChange('');\n b.onTypeChange('any');\n b.onModifiedChange('any');\n },\n }}\n style={styles.inset}\n />\n ) : (\n <EmptyState\n size=\"compact\"\n surface=\"plain\"\n icon={<FolderIcon size={16} />}\n title={t('nativeComponents.fileList.emptyTitle', 'Nothing here yet')}\n description={emptyText}\n style={styles.inset}\n />\n )\n }\n renderItem={({ item: row }) => {\n if (row.kind === 'dir')\n return (\n <Button\n variant=\"ghost\"\n style={[styles.row, styles.indent(row.depth)]}\n accessibilityLabel={\n row.open\n ? t('nativeComponents.fileList.collapse', 'Collapse {path}', { path: row.path })\n : t('nativeComponents.fileList.expand', 'Expand {path}', { path: row.path })\n }\n accessibilityState={{ expanded: row.open }}\n onPress={() => b.onToggleDirectory(row.path)}\n >\n {row.open ? <ChevronDownIcon /> : <ChevronRightIcon />}\n <FolderIcon />\n <Text numberOfLines={1} style={[styles.name, styles.label]}>\n {row.name}\n </Text>\n <Text style={styles.meta}>{row.count}</Text>\n </Button>\n );\n const item = row.item;\n const image = fileKind(item.path) === 'Image';\n const selected = b.selected?.path === item.path;\n return (\n <Button\n variant=\"ghost\"\n size=\"card\"\n testID={`file-${item.path}`}\n accessibilityLabel={t('nativeComponents.fileList.select', 'Select {path}', { path: item.path })}\n accessibilityState={{ selected }}\n onPress={() => b.onSelect(item)}\n style={[grid ? styles.tile : styles.row, selected && styles.selected, !grid && styles.indent(row.depth)]}\n >\n {b.layout === 'tree' ? <View accessible={false} style={styles.chevronGutter} /> : null}\n {grid ? (\n <View style={styles.thumbnail}>\n {image && b.renderImage ? (\n b.renderImage(item, false)\n ) : image ? (\n <ImageIcon size={28} />\n ) : (\n <FileIcon size={28} />\n )}\n </View>\n ) : (\n // Every file row keeps the same slot, so names line up whether or not a picture loaded.\n <View style={styles.rowThumbnail}>\n {image && b.renderImage ? (\n b.renderImage(item, true)\n ) : image ? (\n <ImageIcon size={18} />\n ) : (\n <FileIcon size={18} />\n )}\n </View>\n )}\n <View style={styles.label}>\n <Text numberOfLines={1} style={styles.name}>\n {item.name}\n </Text>\n <Text numberOfLines={1} style={styles.path}>\n {item.path}\n </Text>\n </View>\n <Text style={styles.meta}>{sizeLabel(item.size)}</Text>\n </Button>\n );\n }}\n ListFooterComponent={\n <View style={styles.foot}>\n <Text style={styles.meta}>\n {t('nativeComponents.fileList.count', '{shown} of {total} files', {\n shown: items.length,\n total: b.totalCount,\n })}\n </Text>\n </View>\n }\n />\n );\n return (\n <>\n {list}\n <Sheet\n open={b.selected !== undefined}\n onOpenChange={(open) => {\n if (!open) b.onCloseSelection();\n }}\n >\n <SheetContent>\n {b.selected ? (\n <View style={styles.foot}>\n <View style={styles.selection} testID=\"file-selection\">\n <View style={styles.titleRow}>\n <Text accessibilityRole=\"header\" numberOfLines={1} style={[styles.name, styles.label]}>\n {b.selected.name}\n </Text>\n {files.length > 1 ? (\n <Text accessibilityLiveRegion=\"polite\" style={styles.meta}>\n {t('nativeComponents.fileList.position', '{index} of {total}', {\n index: Math.max(0, at) + 1,\n total: files.length,\n })}\n </Text>\n ) : null}\n </View>\n <SelectionSlides\n files={at < 0 ? [b.selected] : files}\n selected={b.selected}\n onSelect={b.onSelect}\n renderImage={b.renderImage}\n />\n <Text numberOfLines={2} style={styles.path}>\n {b.selected.path}\n </Text>\n <Text style={styles.meta}>\n {fileKindLabel(fileKind(b.selected.path), t)} · {sizeLabel(b.selected.size)}\n </Text>\n <View style={styles.actions}>\n <Button variant=\"outline\" onPress={b.onCloseSelection}>\n {t('nativeComponents.fileList.close', 'Close')}\n </Button>\n <Button\n variant=\"primary\"\n onPress={() => {\n if (b.selected) {\n b.onCloseSelection();\n onOpen(b.selected.path);\n }\n }}\n >\n {t('nativeComponents.fileList.openAction', 'Open')}\n </Button>\n </View>\n </View>\n </View>\n ) : null}\n </SheetContent>\n </Sheet>\n </>\n );\n}\n\n/** The selected file large; swiping and the arrows select its neighbours in the list. */\nfunction SelectionSlides({\n files,\n selected,\n onSelect,\n renderImage,\n}: {\n files: readonly FileItem[];\n selected: FileItem;\n onSelect: (item: FileItem) => void;\n renderImage?: FileBrowserControls['renderImage'];\n}) {\n const t = useT();\n const index = Math.max(\n 0,\n files.findIndex((file) => file.path === selected.path),\n );\n // A horizontal scroller does not stretch its pages, so each page takes the measured width.\n const [width, setWidth] = useState(0);\n const scroller = useRef<ComponentRef<typeof ScrollView>>(null);\n const placed = useRef(false);\n useEffect(() => {\n if (width === 0) return;\n // Opening lands on the tapped file; later steps glide.\n scroller.current?.scrollTo({ x: index * width, animated: placed.current });\n placed.current = true;\n }, [index, width]);\n const step = (by: number) => {\n const next = files[index + by];\n if (next) onSelect(next);\n };\n return (\n <View>\n <ScrollView\n ref={scroller}\n horizontal\n pagingEnabled\n showsHorizontalScrollIndicator={false}\n onLayout={(event) => setWidth(event.nativeEvent.layout.width)}\n onMomentumScrollEnd={(event) => {\n if (width > 0) step(Math.round(event.nativeEvent.contentOffset.x / width) - index);\n }}\n style={styles.preview}\n >\n {files.map((file, page) => (\n <View\n key={file.path}\n accessibilityElementsHidden={page !== index}\n importantForAccessibility={page === index ? 'auto' : 'no-hide-descendants'}\n style={[styles.page, { width }]}\n >\n {/* ponytail: only the open page and its neighbours mount; a long list never reads every picture. */}\n {Math.abs(page - index) > 1 ? null : fileKind(file.path) !== 'Image' ? (\n <FileIcon size={28} />\n ) : renderImage ? (\n renderImage(file, false)\n ) : (\n <ImageIcon size={28} />\n )}\n </View>\n ))}\n </ScrollView>\n {files.length > 1 ? (\n <>\n <Button\n variant=\"ghost\"\n size=\"icon-md\"\n accessibilityLabel={t('nativeComponents.fileList.previous', 'Previous file')}\n disabled={index === 0}\n onPress={() => step(-1)}\n style={[styles.arrow, styles.previous]}\n >\n <View style={styles.flip}>\n <ChevronRightIcon size={18} color=\"hi\" />\n </View>\n </Button>\n <Button\n variant=\"ghost\"\n size=\"icon-md\"\n accessibilityLabel={t('nativeComponents.fileList.next', 'Next file')}\n disabled={index === files.length - 1}\n onPress={() => step(1)}\n style={[styles.arrow, styles.next]}\n >\n <ChevronRightIcon size={18} color=\"hi\" />\n </Button>\n </>\n ) : null}\n {files.length > 1 && files.length <= MAX_DOTS ? (\n <View accessible={false} style={styles.dots}>\n {files.map((file, page) => (\n <View key={file.path} style={[styles.dot, page === index && styles.dotActive]} />\n ))}\n </View>\n ) : null}\n </View>\n );\n}\n\nconst styles = StyleSheet.create((theme) => ({\n head: { gap: theme.spacing(3), padding: theme.spacing(4), paddingBottom: theme.spacing(3) },\n foot: { gap: theme.spacing(3), padding: theme.spacing(4), paddingTop: theme.spacing(3) },\n inset: { paddingHorizontal: theme.spacing(4) },\n toolbar: { flexDirection: 'row', alignItems: 'center', gap: theme.spacing(2) },\n search: {\n flex: 1,\n minWidth: 0,\n flexDirection: 'row',\n alignItems: 'center',\n gap: theme.spacing(2),\n paddingHorizontal: theme.spacing(2),\n borderWidth: 1,\n borderColor: theme.colors.border,\n borderRadius: theme.borderRadius.DEFAULT,\n backgroundColor: theme.colors.deep,\n },\n searchInput: { flex: 1 },\n chips: { flexDirection: 'row', flexWrap: 'wrap', gap: theme.spacing(2) },\n row: {\n marginHorizontal: theme.spacing(4),\n marginBottom: theme.spacing(2),\n // A file row holds two lines; a fixed height pressed them against the border.\n minHeight: ROW_HEIGHT,\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'flex-start',\n gap: theme.spacing(2),\n borderWidth: 1,\n borderColor: theme.colors['border-soft'],\n borderRadius: theme.borderRadius.DEFAULT,\n paddingVertical: theme.spacing(2),\n paddingRight: theme.spacing(3),\n },\n // Tree depth adds to the row's own inset; replacing it put the icon against the border.\n indent: (depth: number) => ({ paddingLeft: theme.spacing(3) + depth * 16 }),\n chevronGutter: { width: 16 },\n columns: { gap: theme.spacing(2), paddingHorizontal: theme.spacing(4) },\n tile: {\n flex: 1,\n maxWidth: '50%',\n flexDirection: 'column',\n alignItems: 'stretch',\n gap: theme.spacing(2),\n borderWidth: 1,\n borderColor: theme.colors['border-soft'],\n marginBottom: theme.spacing(2),\n },\n thumbnail: {\n height: 96,\n backgroundColor: theme.colors.deep,\n borderRadius: theme.borderRadius.DEFAULT,\n overflow: 'hidden',\n alignItems: 'center',\n justifyContent: 'center',\n },\n rowThumbnail: {\n width: 40,\n height: 40,\n borderRadius: theme.borderRadius.sm,\n overflow: 'hidden',\n alignItems: 'center',\n justifyContent: 'center',\n },\n selected: { backgroundColor: theme.colors['tint-green'], borderColor: theme.colors['edge-green'] },\n selection: {\n flexShrink: 0,\n padding: theme.spacing(3),\n gap: theme.spacing(2),\n borderWidth: 1,\n borderColor: theme.colors.border,\n borderRadius: theme.borderRadius.DEFAULT,\n backgroundColor: theme.colors.panel,\n },\n actions: { flexDirection: 'row', justifyContent: 'flex-end', gap: theme.spacing(2) },\n titleRow: { flexDirection: 'row', alignItems: 'center', gap: theme.spacing(2) },\n preview: {\n height: PREVIEW_HEIGHT,\n backgroundColor: theme.colors.deep,\n borderRadius: theme.borderRadius.DEFAULT,\n },\n page: { height: PREVIEW_HEIGHT, alignItems: 'center', justifyContent: 'center' },\n arrow: {\n position: 'absolute',\n top: PREVIEW_HEIGHT / 2 - 22,\n width: 44,\n height: 44,\n borderRadius: 22,\n backgroundColor: theme.colors.panel,\n },\n previous: { left: theme.spacing(2) },\n next: { right: theme.spacing(2) },\n flip: { transform: [{ rotate: '180deg' }] },\n dots: { flexDirection: 'row', justifyContent: 'center', gap: theme.spacing(2), paddingTop: theme.spacing(2) },\n dot: { width: 6, height: 6, borderRadius: 3, backgroundColor: theme.colors.faint },\n dotActive: { backgroundColor: theme.colors.green },\n list: { gap: theme.spacing(2) },\n // The card size stacks its children; a recent row reads like the browser's list row instead.\n item: {\n minHeight: 44,\n flexDirection: 'row',\n justifyContent: 'flex-start',\n alignItems: 'center',\n gap: theme.spacing(3),\n },\n label: { flex: 1, gap: theme.spacing(1), minWidth: 0 },\n name: {\n fontFamily: fontOf(theme.fontFamily.sans),\n fontWeight: '600',\n fontSize: theme.fontSize.base,\n color: theme.colors.text,\n },\n path: { fontFamily: fontOf(theme.fontFamily.mono), fontSize: theme.fontSize.sm, color: theme.colors.dim },\n meta: { fontFamily: fontOf(theme.fontFamily.sans), fontSize: theme.fontSize.sm, color: theme.colors.dim },\n}));\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAwFA,SAAgB+E,SAAS,EACvBT,OACAC,QACAC,SACAC,OACAC,SACAG,OAAO,OACPC,SACAH,OACAC,aACgB;CAChB,MAAMI,IAAIhF,KAAK;CACf,IAAI8E,SACF,OACE,oBAAC,iBAAD;EACSH;EACIC;EACJN;EACCC;EACCC;EACFC;EACEC;EACAI;CAAQ;CAGvB,OACE,qBAAC,MAAD;EAAM,QAAQD,OAAO,mBAAmB;EAAoB,OAAOI,OAAOC;YAA1E;GACGT,QAAQ,oBAAC,aAAD;IAAoBA;IAAO,UAAUH,MAAMa,SAAS;IAAYT;GAAQ,KAAM;GACtFF,UAAU,oBAAC,MAAD;IAAM,OAAOS,OAAOG;cAAOJ,EAAE,qCAAqC,kBAAkB;GAAQ,KAAI;GAC1G,CAACR,WAAW,CAACC,SAASH,MAAMa,WAAW,IACtC,oBAAC,YAAD;IACE,MAAK;IACL,SAAQ;IACR,MAAM,oBAAC,YAAD,EAAY,MAAM,GAAG;IAC3B,OAAOH,EAAE,wCAAwC,kBAAkB;IACnE,aAAaJ;GAAU,KAEvB;GACHN,MAAMe,KAAKzB,SACV,qBAAC,QAAD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AO,aAAa,SAAS,iCAAc,IAAA"}
1
+ {"version":3,"file":"Sheet.d.mts","names":[],"sources":["../../src/components/Sheet.tsx"],"mappings":";;;;;iBA0BiB;;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,cACd,aACA,YAAY,gBACZ,OACA,aACG,SACF,mCAAgB,IAAA;wBAsBH,aAAa,UAAU,SAAS,4BAAS,IAAA;wBAKzC,mBAAmB,UAAU,SAAS,4BAAS,IAAA;;wBAK/C,YAAY,OAAO,aAAa,SAAS,iCAAc,IAAA;wBAQvD,cAAc,OAAO,aAAa,SAAS,iCAAc,IAAA"}
@@ -100,7 +100,6 @@ function SheetHeader({ dismissible = true, closeLabel: closeLabelProp, style, ch
100
100
  function SheetTitle({ style, ...props }) {
101
101
  return /* @__PURE__ */ jsx(Text, {
102
102
  accessibilityRole: "header",
103
- numberOfLines: 1,
104
103
  style: [styles.title, style],
105
104
  ...props
106
105
  });
@@ -132,7 +131,8 @@ const styles = StyleSheet.create((theme) => ({
132
131
  alignItems: "center",
133
132
  gap: theme.spacing(2.5),
134
133
  minWidth: 0,
135
- height: theme.spacing(11),
134
+ minHeight: theme.spacing(11),
135
+ paddingVertical: theme.spacing(1.5),
136
136
  borderBottomWidth: 1,
137
137
  borderBottomColor: theme.colors.border,
138
138
  paddingHorizontal: theme.spacing(4),
@@ -1 +1 @@
1
- {"version":3,"file":"Sheet.mjs","names":["useT","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","closeLabelProp","t","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 { useT } from '@agimon-ai/po-core/native';\nimport 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({\n dismissible = true,\n closeLabel: closeLabelProp,\n style,\n children,\n ...props\n}: SheetHeaderProps) {\n const t = useT();\n const closeLabel = closeLabelProp ?? t('nativeComponents.dialog.close', 'close');\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":";;;;;;;;;;;;;;AAwBA,MAAasB,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,IAAI,CAACQ,SAASR,OAAO,CAAC;CAC5E,OAAO,oBAAC,aAAa,UAAd;EAA8BS;EAAQH;CAAgC;AAC/E;;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AA;CACrC;CACAlC,OAAO,EAAEmC,YAAY,OAAO;CAC5BrB,OAAO;EACLsB,YAAY;EACZC,OAAOf,MAAMS,OAAOO;EACpBC,YAAYvE,OAAOsD,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,YAAYvE,OAAOsD,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;CACA1C,QAAQ;EACN+B,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,YAAYvE,OAAOsD,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":["useT","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","closeLabelProp","t","styles","header","SheetTitle","title","SheetDescription","description","SheetBody","body","SheetFooter","hint","create","theme","flexDirection","alignItems","gap","spacing","minWidth","minHeight","paddingVertical","borderBottomWidth","borderBottomColor","colors","border","paddingHorizontal","uni__dependencies","marginLeft","flexShrink","color","hi","fontFamily","sans","fontSize","lg","lineHeight","fontWeight","semibold","dim","sm","lineHeightRelaxed","flexWrap","justifyContent","borderTopWidth","borderTopColor","backgroundColor","deep","faint"],"sources":["../../src/components/Sheet.tsx"],"sourcesContent":["import { useT } from '@agimon-ai/po-core/native';\nimport 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({\n dismissible = true,\n closeLabel: closeLabelProp,\n style,\n children,\n ...props\n}: SheetHeaderProps) {\n const t = useT();\n const closeLabel = closeLabelProp ?? t('nativeComponents.dialog.close', 'close');\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 // No line cap: a title at a large Dynamic Type size wraps instead of truncating.\n return <Text accessibilityRole=\"header\" 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 // minHeight, not height: a title and description at a large Dynamic Type size push the strip taller.\n minHeight: theme.spacing(11),\n paddingVertical: theme.spacing(1.5),\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":";;;;;;;;;;;;;;AAwBA,MAAasB,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,IAAI,CAACQ,SAASR,OAAO,CAAC;CAC5E,OAAO,oBAAC,aAAa,UAAd;EAA8BS;EAAQH;CAAgC;AAC/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
  justifyContent: "center",
173
- height: BADGE_SIZE,
173
+ minHeight: BADGE_SIZE,
174
174
  minWidth: BADGE_SIZE,
175
175
  borderRadius: theme.borderRadius.full,
176
176
  paddingHorizontal: theme.spacing(1),
@@ -1 +1 @@
1
- {"version":3,"file":"Tabs.mjs","names":["createContext","ReactNode","useContext","useMemo","StyleProp","ViewProps","ViewStyle","StyleSheet","fontOf","selectionTick","useControllable","wrapText","TAB_HEIGHT","MIN_TAP_TARGET","DISABLED_OPACITY","BADGE_SIZE","TabsState","value","setValue","TabsContext","undefined","TabActiveContext","TabsProps","Omit","defaultValue","onValueChange","children","style","Tabs","props","current","next","context","styles","tabs","TabsListProps","TabsList","listScroll","list","TabsTriggerProps","disabled","accessibilityLabel","TabsTrigger","active","_styles","useVariants","selected","pressed","tab","label","labelPressed","TabsContentProps","TabsContent","content","contentText","TabBadgeProps","TabBadge","inherited","_styles2","badge","badgeText","create","theme","gap","spacing","uni__dependencies","flexGrow","flexDirection","alignItems","minHeight","minWidth","borderRadius","DEFAULT","paddingHorizontal","paddingVertical","variants","true","backgroundColor","colors","false","panel","opacity","fontFamily","sans","fontSize","base","lineHeight","color","green","fontWeight","semibold","dim","medium","hi","sm","justifyContent","height","full","idle","rail"],"sources":["../../src/components/Tabs.tsx"],"sourcesContent":["import { createContext, type ReactNode, useContext, useMemo } from 'react';\nimport { Pressable, ScrollView, type StyleProp, Text, View, type ViewProps, type ViewStyle } from 'react-native';\nimport { StyleSheet } from 'react-native-unistyles';\n\nimport { fontOf } from '../lib/fonts';\nimport { selectionTick } from '../lib/haptics';\nimport { useControllable } from '../lib/useControllable';\nimport { wrapText } from '../lib/wrapText';\n\n/*\n * The web Tabs on a horizontal ScrollView: a strip that scrolls when the tabs\n * outgrow the screen, the active tab in a green tint, and a selection tick on\n * each change. The panels swap in place.\n */\n\n/** `min-h-6`, padded to Apple's 44pt tap target by hitSlop. */\nconst TAB_HEIGHT = 24;\nconst MIN_TAP_TARGET = 44;\nconst DISABLED_OPACITY = 0.4;\nconst BADGE_SIZE = 15;\n\ninterface TabsState {\n value: string | undefined;\n setValue: (value: string) => void;\n}\n\nconst TabsContext = createContext<TabsState>({ value: undefined, setValue: () => undefined });\n/** Whether the enclosing trigger is active, so a TabBadge inverts without being told. */\nconst TabActiveContext = createContext(false);\n\nexport interface TabsProps extends Omit<ViewProps, 'children' | 'style'> {\n /** Controlled mode; pair with onValueChange. Omit it and the tabs keep their own state. */\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n children?: ReactNode;\n style?: StyleProp<ViewStyle>;\n}\n\nexport function Tabs({ value, defaultValue, onValueChange, children, style, ...props }: TabsProps) {\n const [current, setValue] = useControllable<string | undefined>(\n value,\n defaultValue,\n onValueChange as ((next: string | undefined) => void) | undefined,\n );\n const context = useMemo(() => ({ value: current, setValue }), [current, setValue]);\n return (\n <TabsContext.Provider value={context}>\n <View style={[styles.tabs, style]} {...props}>\n {children}\n </View>\n </TabsContext.Provider>\n );\n}\n\nexport interface TabsListProps {\n children?: ReactNode;\n style?: StyleProp<ViewStyle>;\n}\n\n/** The tab strip; it scrolls sideways when the tabs outgrow it. */\nexport function TabsList({ children, style }: TabsListProps) {\n return (\n <ScrollView\n horizontal\n showsHorizontalScrollIndicator={false}\n accessibilityRole=\"tablist\"\n style={styles.listScroll}\n contentContainerStyle={[styles.list, style]}\n >\n {children}\n </ScrollView>\n );\n}\n\nexport interface TabsTriggerProps {\n value: string;\n disabled?: boolean;\n /** The label; a bare string is drawn in the tab's type, and a TabBadge may follow it. */\n children?: ReactNode;\n accessibilityLabel?: string;\n style?: StyleProp<ViewStyle>;\n}\n\nexport function TabsTrigger({ value, disabled = false, children, accessibilityLabel, style }: TabsTriggerProps) {\n const tabs = useContext(TabsContext);\n const active = tabs.value === value;\n styles.useVariants({ active });\n return (\n <Pressable\n accessibilityRole=\"tab\"\n accessibilityLabel={accessibilityLabel}\n accessibilityState={{ selected: active, disabled }}\n disabled={disabled}\n hitSlop={(MIN_TAP_TARGET - TAB_HEIGHT) / 2}\n onPress={() => {\n if (active) return;\n selectionTick();\n tabs.setValue(value);\n }}\n style={({ pressed }) => [styles.tab, pressed && !active && styles.pressed, disabled && styles.disabled, style]}\n >\n {({ pressed }) => (\n <TabActiveContext.Provider value={active}>\n {wrapText(children, [styles.label, pressed && !active && styles.labelPressed])}\n </TabActiveContext.Provider>\n )}\n </Pressable>\n );\n}\n\nexport interface TabsContentProps extends Omit<ViewProps, 'children' | 'style'> {\n value: string;\n children?: ReactNode;\n style?: StyleProp<ViewStyle>;\n}\n\n/** The panel for one tab; only the active one renders. */\nexport function TabsContent({ value, children, style, ...props }: TabsContentProps) {\n const tabs = useContext(TabsContext);\n if (tabs.value !== value) return null;\n return (\n <View style={[styles.content, style]} {...props}>\n {wrapText(children, styles.contentText)}\n </View>\n );\n}\n\nexport interface TabBadgeProps {\n /** Defaults to the enclosing tab's state: it inverts on the active tab so it stays readable on the tint. */\n active?: boolean;\n children?: ReactNode;\n style?: StyleProp<ViewStyle>;\n}\n\n/** The count beside a tab's label. */\nexport function TabBadge({ active, children, style }: TabBadgeProps) {\n const inherited = useContext(TabActiveContext);\n styles.useVariants({ badge: (active ?? inherited) ? 'active' : 'idle' });\n return (\n <View style={[styles.badge, style]}>\n <Text style={styles.badgeText}>{children}</Text>\n </View>\n );\n}\n\nconst styles = StyleSheet.create((theme) => ({\n tabs: { gap: theme.spacing(2) },\n listScroll: { flexGrow: 0 },\n list: { flexDirection: 'row', alignItems: 'center', gap: theme.spacing(1) },\n tab: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: theme.spacing(1.5),\n minHeight: TAB_HEIGHT,\n minWidth: TAB_HEIGHT,\n borderRadius: theme.borderRadius.DEFAULT,\n paddingHorizontal: theme.spacing(2),\n paddingVertical: theme.spacing(1),\n variants: {\n active: {\n true: { backgroundColor: theme.colors['tint-green'] },\n false: {},\n },\n },\n },\n pressed: { backgroundColor: theme.colors.panel },\n disabled: { opacity: DISABLED_OPACITY },\n label: {\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.base,\n lineHeight: theme.lineHeight.base,\n variants: {\n active: {\n true: { color: theme.colors.green, fontWeight: theme.fontWeight.semibold },\n false: { color: theme.colors.dim, fontWeight: theme.fontWeight.medium },\n },\n },\n },\n labelPressed: { color: theme.colors.hi },\n content: { flexGrow: 1, minHeight: 0 },\n contentText: {\n color: theme.colors.dim,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeight.sm,\n },\n badge: {\n alignItems: 'center',\n justifyContent: 'center',\n height: BADGE_SIZE,\n minWidth: BADGE_SIZE,\n borderRadius: theme.borderRadius.full,\n paddingHorizontal: theme.spacing(1),\n variants: {\n badge: {\n active: { backgroundColor: theme.colors.green },\n idle: { backgroundColor: theme.colors.panel },\n },\n },\n },\n badgeText: {\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize['2xs'],\n lineHeight: theme.lineHeight['2xs'],\n fontWeight: theme.fontWeight.semibold,\n variants: {\n badge: {\n active: { color: theme.colors.rail },\n idle: { color: theme.colors.dim },\n },\n },\n },\n}));\n"],"mappings":";;;;;;;;;;;;;;AAgBA,MAAMY,aAAa;AAEnB,MAAME,mBAAmB;AACzB,MAAMC,aAAa;AAOnB,MAAMI,cAAcnB,cAAyB;CAAEiB,OAAOG;CAAWF,gBAAgBE;AAAU,CAAC;;AAE5F,MAAMC,mBAAmBrB,cAAc,KAAK;AAW5C,SAAgB4B,KAAK,EAAEX,OAAOO,cAAcC,eAAeC,UAAUC,OAAO,GAAGE,SAAoB;CACjG,MAAM,CAACC,SAASZ,YAAYR,gBAC1BO,OACAO,cACAC,aACF;CACA,MAAMO,UAAU7B,eAAe;EAAEc,OAAOa;EAASZ;CAAS,IAAI,CAACY,SAASZ,QAAQ,CAAC;CACjF,OACE,oBAAC,YAAY,UAAb;EAAsB,OAAOc;YAC3B,oBAAC,MAAD;GAAM,OAAO,CAACC,OAAOC,MA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AAM2B,WAAWC;GAAS;GACzEX,OAAO;IAAEQ,OAAOzB,MAAMgB,OAAOa;IAAKF,YAAY3B,MAAM2B,WAAWG;GAAO;EACxE,EACF;EAAC3B,mBAAA,CAAA,GAAA,CAAA;CACH;CACAf,cAAc;EAAEqC,OAAOzB,MAAMgB,OAAOe;EAAE5B,mBAAA,CAAA,CAAA;CAAC;CACvCZ,SAAS;EAAEa,UAAU;EAAGG,WAAW;CAAE;CACrCf,aAAa;EACXiC,OAAOzB,MAAMgB,OAAOa;EACpBT,YAAY1E,OAAOsD,MAAMoB,WAAWC,IAAI;EACxCC,UAAUtB,MAAMsB,SAASU;EACzBR,YAAYxB,MAAMwB,WAAWQ;EAAE7B,mBAAA,CAAA,CAAA;CACjC;CACAN,OAAO;EACLS,YAAY;EACZ2B,gBAAgB;EAChBC,QAAQjF;EACRuD,UAAUvD;EACVwD,cAAcT,MAAMS,aAAa0B;EACjCxB,mBAAmBX,MAAME,QAAQ,CAAC;EAClCW,UAAU,EACRhB,OAAO;GACLhB,QAAQ,EAAEkC,iBAAiBf,MAAMgB,OAAOU,MAAM;GAC9CU,MAAM,EAAErB,iBAAiBf,MAAMgB,OAAOE,MAAM;EAC9C,EACF;EAACf,mBAAA,CAAA,GAAA,CAAA;CACH;CACAL,WAAW;EACTsB,YAAY1E,OAAOsD,MAAMoB,WAAWC,IAAI;EACxCC,UAAUtB,MAAMsB,SAAS;EACzBE,YAAYxB,MAAMwB,WAAW;EAC7BG,YAAY3B,MAAM2B,WAAWC;EAC7Bf,UAAU,EACRhB,OAAO;GACLhB,QAAQ,EAAE4C,OAAOzB,MAAMgB,OAAOqB,KAAK;GACnCD,MAAM,EAAEX,OAAOzB,MAAMgB,OAAOa,IAAI;EAClC,EACF;EAAC1B,mBAAA,CAAA,GAAA,CAAA;CACH;AACF,EAAE"}
1
+ {"version":3,"file":"Tabs.mjs","names":["createContext","ReactNode","useContext","useMemo","StyleProp","ViewProps","ViewStyle","StyleSheet","fontOf","selectionTick","useControllable","wrapText","TAB_HEIGHT","MIN_TAP_TARGET","DISABLED_OPACITY","BADGE_SIZE","TabsState","value","setValue","TabsContext","undefined","TabActiveContext","TabsProps","Omit","defaultValue","onValueChange","children","style","Tabs","props","current","next","context","styles","tabs","TabsListProps","TabsList","listScroll","list","TabsTriggerProps","disabled","accessibilityLabel","TabsTrigger","active","_styles","useVariants","selected","pressed","tab","label","labelPressed","TabsContentProps","TabsContent","content","contentText","TabBadgeProps","TabBadge","inherited","_styles2","badge","badgeText","create","theme","gap","spacing","uni__dependencies","flexGrow","flexDirection","alignItems","minHeight","minWidth","borderRadius","DEFAULT","paddingHorizontal","paddingVertical","variants","true","backgroundColor","colors","false","panel","opacity","fontFamily","sans","fontSize","base","lineHeight","color","green","fontWeight","semibold","dim","medium","hi","sm","justifyContent","full","idle","rail"],"sources":["../../src/components/Tabs.tsx"],"sourcesContent":["import { createContext, type ReactNode, useContext, useMemo } from 'react';\nimport { Pressable, ScrollView, type StyleProp, Text, View, type ViewProps, type ViewStyle } from 'react-native';\nimport { StyleSheet } from 'react-native-unistyles';\n\nimport { fontOf } from '../lib/fonts';\nimport { selectionTick } from '../lib/haptics';\nimport { useControllable } from '../lib/useControllable';\nimport { wrapText } from '../lib/wrapText';\n\n/*\n * The web Tabs on a horizontal ScrollView: a strip that scrolls when the tabs\n * outgrow the screen, the active tab in a green tint, and a selection tick on\n * each change. The panels swap in place.\n */\n\n/** `min-h-6`, padded to Apple's 44pt tap target by hitSlop. */\nconst TAB_HEIGHT = 24;\nconst MIN_TAP_TARGET = 44;\nconst DISABLED_OPACITY = 0.4;\nconst BADGE_SIZE = 15;\n\ninterface TabsState {\n value: string | undefined;\n setValue: (value: string) => void;\n}\n\nconst TabsContext = createContext<TabsState>({ value: undefined, setValue: () => undefined });\n/** Whether the enclosing trigger is active, so a TabBadge inverts without being told. */\nconst TabActiveContext = createContext(false);\n\nexport interface TabsProps extends Omit<ViewProps, 'children' | 'style'> {\n /** Controlled mode; pair with onValueChange. Omit it and the tabs keep their own state. */\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n children?: ReactNode;\n style?: StyleProp<ViewStyle>;\n}\n\nexport function Tabs({ value, defaultValue, onValueChange, children, style, ...props }: TabsProps) {\n const [current, setValue] = useControllable<string | undefined>(\n value,\n defaultValue,\n onValueChange as ((next: string | undefined) => void) | undefined,\n );\n const context = useMemo(() => ({ value: current, setValue }), [current, setValue]);\n return (\n <TabsContext.Provider value={context}>\n <View style={[styles.tabs, style]} {...props}>\n {children}\n </View>\n </TabsContext.Provider>\n );\n}\n\nexport interface TabsListProps {\n children?: ReactNode;\n style?: StyleProp<ViewStyle>;\n}\n\n/** The tab strip; it scrolls sideways when the tabs outgrow it. */\nexport function TabsList({ children, style }: TabsListProps) {\n return (\n <ScrollView\n horizontal\n showsHorizontalScrollIndicator={false}\n accessibilityRole=\"tablist\"\n style={styles.listScroll}\n contentContainerStyle={[styles.list, style]}\n >\n {children}\n </ScrollView>\n );\n}\n\nexport interface TabsTriggerProps {\n value: string;\n disabled?: boolean;\n /** The label; a bare string is drawn in the tab's type, and a TabBadge may follow it. */\n children?: ReactNode;\n accessibilityLabel?: string;\n style?: StyleProp<ViewStyle>;\n}\n\nexport function TabsTrigger({ value, disabled = false, children, accessibilityLabel, style }: TabsTriggerProps) {\n const tabs = useContext(TabsContext);\n const active = tabs.value === value;\n styles.useVariants({ active });\n return (\n <Pressable\n accessibilityRole=\"tab\"\n accessibilityLabel={accessibilityLabel}\n accessibilityState={{ selected: active, disabled }}\n disabled={disabled}\n hitSlop={(MIN_TAP_TARGET - TAB_HEIGHT) / 2}\n onPress={() => {\n if (active) return;\n selectionTick();\n tabs.setValue(value);\n }}\n style={({ pressed }) => [styles.tab, pressed && !active && styles.pressed, disabled && styles.disabled, style]}\n >\n {({ pressed }) => (\n <TabActiveContext.Provider value={active}>\n {wrapText(children, [styles.label, pressed && !active && styles.labelPressed])}\n </TabActiveContext.Provider>\n )}\n </Pressable>\n );\n}\n\nexport interface TabsContentProps extends Omit<ViewProps, 'children' | 'style'> {\n value: string;\n children?: ReactNode;\n style?: StyleProp<ViewStyle>;\n}\n\n/** The panel for one tab; only the active one renders. */\nexport function TabsContent({ value, children, style, ...props }: TabsContentProps) {\n const tabs = useContext(TabsContext);\n if (tabs.value !== value) return null;\n return (\n <View style={[styles.content, style]} {...props}>\n {wrapText(children, styles.contentText)}\n </View>\n );\n}\n\nexport interface TabBadgeProps {\n /** Defaults to the enclosing tab's state: it inverts on the active tab so it stays readable on the tint. */\n active?: boolean;\n children?: ReactNode;\n style?: StyleProp<ViewStyle>;\n}\n\n/** The count beside a tab's label. */\nexport function TabBadge({ active, children, style }: TabBadgeProps) {\n const inherited = useContext(TabActiveContext);\n styles.useVariants({ badge: (active ?? inherited) ? 'active' : 'idle' });\n return (\n <View style={[styles.badge, style]}>\n <Text style={styles.badgeText}>{children}</Text>\n </View>\n );\n}\n\nconst styles = StyleSheet.create((theme) => ({\n tabs: { gap: theme.spacing(2) },\n listScroll: { flexGrow: 0 },\n list: { flexDirection: 'row', alignItems: 'center', gap: theme.spacing(1) },\n tab: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: theme.spacing(1.5),\n minHeight: TAB_HEIGHT,\n minWidth: TAB_HEIGHT,\n borderRadius: theme.borderRadius.DEFAULT,\n paddingHorizontal: theme.spacing(2),\n paddingVertical: theme.spacing(1),\n variants: {\n active: {\n true: { backgroundColor: theme.colors['tint-green'] },\n false: {},\n },\n },\n },\n pressed: { backgroundColor: theme.colors.panel },\n disabled: { opacity: DISABLED_OPACITY },\n label: {\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.base,\n lineHeight: theme.lineHeight.base,\n variants: {\n active: {\n true: { color: theme.colors.green, fontWeight: theme.fontWeight.semibold },\n false: { color: theme.colors.dim, fontWeight: theme.fontWeight.medium },\n },\n },\n },\n labelPressed: { color: theme.colors.hi },\n content: { flexGrow: 1, minHeight: 0 },\n contentText: {\n color: theme.colors.dim,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeight.sm,\n },\n badge: {\n alignItems: 'center',\n justifyContent: 'center',\n minHeight: BADGE_SIZE,\n minWidth: BADGE_SIZE,\n borderRadius: theme.borderRadius.full,\n paddingHorizontal: theme.spacing(1),\n variants: {\n badge: {\n active: { backgroundColor: theme.colors.green },\n idle: { backgroundColor: theme.colors.panel },\n },\n },\n },\n badgeText: {\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize['2xs'],\n lineHeight: theme.lineHeight['2xs'],\n fontWeight: theme.fontWeight.semibold,\n variants: {\n badge: {\n active: { color: theme.colors.rail },\n idle: { color: theme.colors.dim },\n },\n },\n },\n}));\n"],"mappings":";;;;;;;;;;;;;;AAgBA,MAAMY,aAAa;AAEnB,MAAME,mBAAmB;AACzB,MAAMC,aAAa;AAOnB,MAAMI,cAAcnB,cAAyB;CAAEiB,OAAOG;CAAWF,gBAAgBE;AAAU,CAAC;;AAE5F,MAAMC,mBAAmBrB,cAAc,KAAK;AAW5C,SAAgB4B,KAAK,EAAEX,OAAOO,cAAcC,eAAeC,UAAUC,OAAO,GAAGE,SAAoB;CACjG,MAAM,CAACC,SAASZ,YAAYR,gBAC1BO,OACAO,cACAC,aACF;CACA,MAAMO,UAAU7B,eAAe;EAAEc,OAAOa;EAASZ;CAAS,IAAI,CAACY,SAASZ,QAAQ,CAAC;CACjF,OACE,oBAAC,YAAY,UAAb;EAAsB,OAAOc;YAC3B,oBAAC,MAAD;GAAM,OAAO,CAACC,OAAOC,MAAMP,KAAK;GAAG,GAAIE;GACpCH;EACG;CACc;AAE1B;;AAQA,SAAgBU,SAAS,EAAEV,UAAUC,SAAwB;CAC3D,OACE,oBAAC,YAAD;EACE;EACA,gCAAgC;EAChC,mBAAkB;EAClB,OAAOM,OAAOI;EACd,uBAAuB,CAACJ,OAAOK,MAAMX,KAAK;EAEzCD;CACS;AAEhB;AAWA,SAAgBgB,YAAY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,UAAU;EAAGG,WAAW;CAAE;CACrCf,aAAa;EACXiC,OAAOzB,MAAMgB,OAAOa;EACpBT,YAAY1E,OAAOsD,MAAMoB,WAAWC,IAAI;EACxCC,UAAUtB,MAAMsB,SAASU;EACzBR,YAAYxB,MAAMwB,WAAWQ;EAAE7B,mBAAA,CAAA,CAAA;CACjC;CACAN,OAAO;EACLS,YAAY;EACZ2B,gBAAgB;EAChB1B,WAAWtD;EACXuD,UAAUvD;EACVwD,cAAcT,MAAMS,aAAayB;EACjCvB,mBAAmBX,MAAME,QAAQ,CAAC;EAClCW,UAAU,EACRhB,OAAO;GACLhB,QAAQ,EAAEkC,iBAAiBf,MAAMgB,OAAOU,MAAM;GAC9CS,MAAM,EAAEpB,iBAAiBf,MAAMgB,OAAOE,MAAM;EAC9C,EACF;EAACf,mBAAA,CAAA,GAAA,CAAA;CACH;CACAL,WAAW;EACTsB,YAAY1E,OAAOsD,MAAMoB,WAAWC,IAAI;EACxCC,UAAUtB,MAAMsB,SAAS;EACzBE,YAAYxB,MAAMwB,WAAW;EAC7BG,YAAY3B,MAAM2B,WAAWC;EAC7Bf,UAAU,EACRhB,OAAO;GACLhB,QAAQ,EAAE4C,OAAOzB,MAAMgB,OAAOoB,KAAK;GACnCD,MAAM,EAAEV,OAAOzB,MAAMgB,OAAOa,IAAI;EAClC,EACF;EAAC1B,mBAAA,CAAA,GAAA,CAAA;CACH;AACF,EAAE"}
@@ -1 +1 @@
1
- {"version":1,"platformRequirements":{},"sourceFiles":["LICENSE","README.md","llms.txt","locales/vi.json","locales/zh-CN.json","package.json","src/components/AgentAvatar.stories.tsx","src/components/AgentAvatar.tsx","src/components/AnnotationSurface.tsx","src/components/Badge.stories.tsx","src/components/Badge.tsx","src/components/Button.stories.tsx","src/components/Button.tsx","src/components/CodeBlock.stories.tsx","src/components/CodeBlock.tsx","src/components/ComputerRow.stories.tsx","src/components/ComputerRow.tsx","src/components/CopyButton.tsx","src/components/CountBadge.stories.tsx","src/components/CountBadge.tsx","src/components/CtaCard.stories.tsx","src/components/CtaCard.tsx","src/components/Dialog.stories.tsx","src/components/Dialog.tsx","src/components/Dot.stories.tsx","src/components/Dot.tsx","src/components/DropdownMenu.stories.tsx","src/components/DropdownMenu.tsx","src/components/EmptyState.stories.tsx","src/components/EmptyState.tsx","src/components/FileList.stories.tsx","src/components/FileList.tsx","src/components/FilePreview.stories.tsx","src/components/FilePreview.tsx","src/components/FileViewer.stories.tsx","src/components/FileViewer.tsx","src/components/HashlineLines.tsx","src/components/HostFilter.stories.tsx","src/components/HostFilter.tsx","src/components/HostTag.stories.tsx","src/components/HostTag.tsx","src/components/InfoStrip.stories.tsx","src/components/InfoStrip.tsx","src/components/InlineReadingDesign.stories.tsx","src/components/Input.stories.tsx","src/components/Input.tsx","src/components/Label.stories.tsx","src/components/Label.tsx","src/components/LinkText.tsx","src/components/List.stories.tsx","src/components/List.tsx","src/components/LiveDuration.tsx","src/components/LoadingState.stories.tsx","src/components/LoadingState.tsx","src/components/Markdown.stories.tsx","src/components/Markdown.tsx","src/components/MessageItem.stories.tsx","src/components/MessageItem.tsx","src/components/NativeShellState.tsx","src/components/Panel.stories.tsx","src/components/Panel.tsx","src/components/PoNativeProvider.stories.tsx","src/components/PoNativeProvider.tsx","src/components/RailItem.stories.tsx","src/components/RailItem.tsx","src/components/ReferenceChip.stories.tsx","src/components/ReferenceChip.tsx","src/components/SectionLabel.stories.tsx","src/components/SectionLabel.tsx","src/components/SeekBar.stories.tsx","src/components/SeekBar.tsx","src/components/SegmentedControl.stories.tsx","src/components/SegmentedControl.tsx","src/components/Select.stories.tsx","src/components/Select.tsx","src/components/Sheet.stories.tsx","src/components/Sheet.tsx","src/components/SheetFrame.tsx","src/components/SheetList.tsx","src/components/ShowMore.tsx","src/components/Spinner.stories.tsx","src/components/Spinner.tsx","src/components/StatusBadge.stories.tsx","src/components/StatusBadge.tsx","src/components/Switch.stories.tsx","src/components/Switch.tsx","src/components/SyntaxLine.tsx","src/components/Tabs.stories.tsx","src/components/Tabs.tsx","src/components/Textarea.stories.tsx","src/components/Textarea.tsx","src/components/ToolPathLink.tsx","src/components/ToolResultImage.tsx","src/exports/index.ts","src/exports/shell.ts","src/icons/IconColorContext.ts","src/icons/iconGlyphs.ts","src/icons/icons.stories.tsx","src/icons/icons.tsx","src/lib/fileKindLabel.ts","src/lib/fonts.ts","src/lib/haptics.ts","src/lib/insideSheet.ts","src/lib/markdown.ts","src/lib/reading.ts","src/lib/tone.ts","src/lib/useControllable.ts","src/lib/useReadingPage.ts","src/lib/wrapText.tsx","src/unistyles.ts","tsdown.config.ts"],"sourceRevision":"4900fafbdd124c7ea38360de0fef8495","manifestRevision":"9c6c37182ab3817f10318e5f4dcc4edb","outputFiles":["LICENSE","README.md","dist/components/AgentAvatar.mjs","dist/components/AnnotationSurface.mjs","dist/components/Badge.mjs","dist/components/Button.mjs","dist/components/CodeBlock.mjs","dist/components/ComputerRow.mjs","dist/components/CopyButton.mjs","dist/components/CountBadge.mjs","dist/components/CtaCard.mjs","dist/components/Dialog.mjs","dist/components/Dot.mjs","dist/components/DropdownMenu.mjs","dist/components/EmptyState.mjs","dist/components/FileList.mjs","dist/components/FilePreview.mjs","dist/components/FileViewer.mjs","dist/components/HashlineLines.mjs","dist/components/HostFilter.mjs","dist/components/HostTag.mjs","dist/components/InfoStrip.mjs","dist/components/Input.mjs","dist/components/Label.mjs","dist/components/LinkText.mjs","dist/components/List.mjs","dist/components/LiveDuration.mjs","dist/components/LoadingState.mjs","dist/components/Markdown.mjs","dist/components/MessageItem.mjs","dist/components/NativeShellState.mjs","dist/components/Panel.mjs","dist/components/PoNativeProvider.mjs","dist/components/RailItem.mjs","dist/components/ReferenceChip.mjs","dist/components/SectionLabel.mjs","dist/components/SeekBar.mjs","dist/components/SegmentedControl.mjs","dist/components/Select.mjs","dist/components/Sheet.mjs","dist/components/SheetFrame.mjs","dist/components/SheetList.mjs","dist/components/ShowMore.mjs","dist/components/Spinner.mjs","dist/components/StatusBadge.mjs","dist/components/Switch.mjs","dist/components/SyntaxLine.mjs","dist/components/Tabs.mjs","dist/components/Textarea.mjs","dist/components/ToolPathLink.mjs","dist/components/ToolResultImage.mjs","dist/icons/IconColorContext.mjs","dist/icons/iconGlyphs.mjs","dist/icons/icons.mjs","dist/index.mjs","dist/lib/fileKindLabel.mjs","dist/lib/fonts.mjs","dist/lib/haptics.mjs","dist/lib/insideSheet.mjs","dist/lib/markdown.mjs","dist/lib/reading.mjs","dist/lib/tone.mjs","dist/lib/useControllable.mjs","dist/lib/useReadingPage.mjs","dist/lib/wrapText.mjs","dist/shell.mjs","llms.txt","locales/vi.json","locales/zh-CN.json"],"outputRevision":"29ef4a082aa84df8b32d213cd9af6aca"}
1
+ {"version":1,"platformRequirements":{},"sourceFiles":["LICENSE","README.md","llms.txt","locales/vi.json","locales/zh-CN.json","package.json","src/components/AgentAvatar.stories.tsx","src/components/AgentAvatar.tsx","src/components/AnnotationSurface.tsx","src/components/Badge.stories.tsx","src/components/Badge.tsx","src/components/Button.stories.tsx","src/components/Button.tsx","src/components/CodeBlock.stories.tsx","src/components/CodeBlock.tsx","src/components/ComputerRow.stories.tsx","src/components/ComputerRow.tsx","src/components/CopyButton.tsx","src/components/CountBadge.stories.tsx","src/components/CountBadge.tsx","src/components/CtaCard.stories.tsx","src/components/CtaCard.tsx","src/components/Dialog.stories.tsx","src/components/Dialog.tsx","src/components/Dot.stories.tsx","src/components/Dot.tsx","src/components/DropdownMenu.stories.tsx","src/components/DropdownMenu.tsx","src/components/EmptyState.stories.tsx","src/components/EmptyState.tsx","src/components/FileList.stories.tsx","src/components/FileList.tsx","src/components/FilePreview.stories.tsx","src/components/FilePreview.tsx","src/components/FileViewer.stories.tsx","src/components/FileViewer.tsx","src/components/HashlineLines.tsx","src/components/HostFilter.stories.tsx","src/components/HostFilter.tsx","src/components/HostTag.stories.tsx","src/components/HostTag.tsx","src/components/InfoStrip.stories.tsx","src/components/InfoStrip.tsx","src/components/InlineReadingDesign.stories.tsx","src/components/Input.stories.tsx","src/components/Input.tsx","src/components/Label.stories.tsx","src/components/Label.tsx","src/components/LinkText.tsx","src/components/List.stories.tsx","src/components/List.tsx","src/components/LiveDuration.tsx","src/components/LoadingState.stories.tsx","src/components/LoadingState.tsx","src/components/Markdown.stories.tsx","src/components/Markdown.tsx","src/components/MessageItem.stories.tsx","src/components/MessageItem.tsx","src/components/NativeShellState.tsx","src/components/Panel.stories.tsx","src/components/Panel.tsx","src/components/PoNativeProvider.stories.tsx","src/components/PoNativeProvider.tsx","src/components/RailItem.stories.tsx","src/components/RailItem.tsx","src/components/ReferenceChip.stories.tsx","src/components/ReferenceChip.tsx","src/components/SectionLabel.stories.tsx","src/components/SectionLabel.tsx","src/components/SeekBar.stories.tsx","src/components/SeekBar.tsx","src/components/SegmentedControl.stories.tsx","src/components/SegmentedControl.tsx","src/components/Select.stories.tsx","src/components/Select.tsx","src/components/Sheet.stories.tsx","src/components/Sheet.tsx","src/components/SheetFrame.tsx","src/components/SheetList.tsx","src/components/ShowMore.tsx","src/components/Spinner.stories.tsx","src/components/Spinner.tsx","src/components/StatusBadge.stories.tsx","src/components/StatusBadge.tsx","src/components/Switch.stories.tsx","src/components/Switch.tsx","src/components/SyntaxLine.tsx","src/components/Tabs.stories.tsx","src/components/Tabs.tsx","src/components/Textarea.stories.tsx","src/components/Textarea.tsx","src/components/ToolPathLink.tsx","src/components/ToolResultImage.tsx","src/exports/index.ts","src/exports/shell.ts","src/icons/IconColorContext.ts","src/icons/iconGlyphs.ts","src/icons/icons.stories.tsx","src/icons/icons.tsx","src/lib/fileKindLabel.ts","src/lib/fonts.ts","src/lib/haptics.ts","src/lib/insideSheet.ts","src/lib/markdown.ts","src/lib/reading.ts","src/lib/tone.ts","src/lib/useControllable.ts","src/lib/useReadingPage.ts","src/lib/wrapText.tsx","src/unistyles.ts","tsdown.config.ts"],"sourceRevision":"2a12e824bb920e85940dc1ef9b4787e4","manifestRevision":"c4d0f469621ef1e76a75de20bdb61ff0","outputFiles":["LICENSE","README.md","dist/components/AgentAvatar.mjs","dist/components/AnnotationSurface.mjs","dist/components/Badge.mjs","dist/components/Button.mjs","dist/components/CodeBlock.mjs","dist/components/ComputerRow.mjs","dist/components/CopyButton.mjs","dist/components/CountBadge.mjs","dist/components/CtaCard.mjs","dist/components/Dialog.mjs","dist/components/Dot.mjs","dist/components/DropdownMenu.mjs","dist/components/EmptyState.mjs","dist/components/FileList.mjs","dist/components/FilePreview.mjs","dist/components/FileViewer.mjs","dist/components/HashlineLines.mjs","dist/components/HostFilter.mjs","dist/components/HostTag.mjs","dist/components/InfoStrip.mjs","dist/components/Input.mjs","dist/components/Label.mjs","dist/components/LinkText.mjs","dist/components/List.mjs","dist/components/LiveDuration.mjs","dist/components/LoadingState.mjs","dist/components/Markdown.mjs","dist/components/MessageItem.mjs","dist/components/NativeShellState.mjs","dist/components/Panel.mjs","dist/components/PoNativeProvider.mjs","dist/components/RailItem.mjs","dist/components/ReferenceChip.mjs","dist/components/SectionLabel.mjs","dist/components/SeekBar.mjs","dist/components/SegmentedControl.mjs","dist/components/Select.mjs","dist/components/Sheet.mjs","dist/components/SheetFrame.mjs","dist/components/SheetList.mjs","dist/components/ShowMore.mjs","dist/components/Spinner.mjs","dist/components/StatusBadge.mjs","dist/components/Switch.mjs","dist/components/SyntaxLine.mjs","dist/components/Tabs.mjs","dist/components/Textarea.mjs","dist/components/ToolPathLink.mjs","dist/components/ToolResultImage.mjs","dist/icons/IconColorContext.mjs","dist/icons/iconGlyphs.mjs","dist/icons/icons.mjs","dist/index.mjs","dist/lib/fileKindLabel.mjs","dist/lib/fonts.mjs","dist/lib/haptics.mjs","dist/lib/insideSheet.mjs","dist/lib/markdown.mjs","dist/lib/reading.mjs","dist/lib/tone.mjs","dist/lib/useControllable.mjs","dist/lib/useReadingPage.mjs","dist/lib/wrapText.mjs","dist/shell.mjs","llms.txt","locales/vi.json","locales/zh-CN.json"],"outputRevision":"5bb9b9ed1c80a70faaaf83f652a9c0f2"}
package/locales/vi.json CHANGED
@@ -23,7 +23,6 @@
23
23
  "nativeComponents.fileKind.other": "Khác",
24
24
  "nativeComponents.fileList.allTypes": "Mọi loại",
25
25
  "nativeComponents.fileList.ascending": "Tăng dần",
26
- "nativeComponents.fileList.bytes": "{size} byte",
27
26
  "nativeComponents.fileList.clearFilters": "Xóa bộ lọc",
28
27
  "nativeComponents.fileList.close": "Đóng",
29
28
  "nativeComponents.fileList.collapse": "Thu gọn {path}",
@@ -23,7 +23,6 @@
23
23
  "nativeComponents.fileKind.other": "其他",
24
24
  "nativeComponents.fileList.allTypes": "所有类型",
25
25
  "nativeComponents.fileList.ascending": "升序",
26
- "nativeComponents.fileList.bytes": "{size} 字节",
27
26
  "nativeComponents.fileList.clearFilters": "清除筛选",
28
27
  "nativeComponents.fileList.close": "关闭",
29
28
  "nativeComponents.fileList.collapse": "折叠 {path}",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agimon-ai/po-native-components",
3
- "version": "0.0.0-alpha.218",
3
+ "version": "0.0.0-alpha.219",
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",
@@ -52,12 +52,12 @@
52
52
  "access": "public"
53
53
  },
54
54
  "dependencies": {
55
- "@agimon-ai/po-web-components": "0.0.0-alpha.218"
55
+ "@agimon-ai/po-web-components": "0.0.0-alpha.219"
56
56
  },
57
57
  "devDependencies": {
58
- "@agimon-ai/po-build": "0.0.0-alpha.218",
59
- "@agimon-ai/po-core": "0.0.0-alpha.218",
60
- "@agimon-ai/vibe-lint-plugin-po-web": "0.0.0-alpha.218",
58
+ "@agimon-ai/po-build": "0.0.0-alpha.219",
59
+ "@agimon-ai/po-core": "0.0.0-alpha.219",
60
+ "@agimon-ai/vibe-lint-plugin-po-web": "0.0.0-alpha.219",
61
61
  "@babel/core": "7.29.7",
62
62
  "@expo/vector-icons": "15.1.1",
63
63
  "@fontsource-variable/ibm-plex-sans": "5.3.0",
@@ -88,7 +88,7 @@
88
88
  "vitest": "5.0.4"
89
89
  },
90
90
  "peerDependencies": {
91
- "@agimon-ai/po-core": "0.0.0-alpha.218",
91
+ "@agimon-ai/po-core": "0.0.0-alpha.219",
92
92
  "@expo/vector-icons": "^15.0.0",
93
93
  "@gorhom/bottom-sheet": "^5.2.0",
94
94
  "@react-native-segmented-control/segmented-control": "^2.5.0",