@agimon-ai/po-native-components 0.0.0-alpha.2 → 0.0.0-alpha.200

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.
Files changed (197) hide show
  1. package/LICENSE +1 -2
  2. package/README.md +9 -51
  3. package/dist/components/AgentAvatar.d.mts +19 -0
  4. package/dist/components/AgentAvatar.d.mts.map +1 -0
  5. package/dist/components/AgentAvatar.mjs +88 -0
  6. package/dist/components/AgentAvatar.mjs.map +1 -0
  7. package/dist/components/AnnotationSurface.d.mts +69 -0
  8. package/dist/components/AnnotationSurface.d.mts.map +1 -0
  9. package/dist/components/AnnotationSurface.mjs +431 -0
  10. package/dist/components/AnnotationSurface.mjs.map +1 -0
  11. package/dist/components/Badge.d.mts +1 -1
  12. package/dist/components/Badge.mjs +2 -2
  13. package/dist/components/Badge.mjs.map +1 -1
  14. package/dist/components/Button.mjs +4 -4
  15. package/dist/components/Button.mjs.map +1 -1
  16. package/dist/components/CodeBlock.d.mts +3 -1
  17. package/dist/components/CodeBlock.d.mts.map +1 -1
  18. package/dist/components/CodeBlock.mjs +42 -47
  19. package/dist/components/CodeBlock.mjs.map +1 -1
  20. package/dist/components/ComputerRow.d.mts +15 -0
  21. package/dist/components/ComputerRow.d.mts.map +1 -0
  22. package/dist/components/ComputerRow.mjs +107 -0
  23. package/dist/components/ComputerRow.mjs.map +1 -0
  24. package/dist/components/CopyButton.d.mts +13 -0
  25. package/dist/components/CopyButton.d.mts.map +1 -0
  26. package/dist/components/CopyButton.mjs +49 -0
  27. package/dist/components/CopyButton.mjs.map +1 -0
  28. package/dist/components/CountBadge.d.mts +15 -0
  29. package/dist/components/CountBadge.d.mts.map +1 -0
  30. package/dist/components/CountBadge.mjs +49 -0
  31. package/dist/components/CountBadge.mjs.map +1 -0
  32. package/dist/components/CtaCard.d.mts +19 -0
  33. package/dist/components/CtaCard.d.mts.map +1 -0
  34. package/dist/components/CtaCard.mjs +92 -0
  35. package/dist/components/CtaCard.mjs.map +1 -0
  36. package/dist/components/Dialog.d.mts +2 -2
  37. package/dist/components/Dialog.d.mts.map +1 -1
  38. package/dist/components/Dialog.mjs +18 -12
  39. package/dist/components/Dialog.mjs.map +1 -1
  40. package/dist/components/Dot.d.mts +1 -1
  41. package/dist/components/Dot.mjs +3 -3
  42. package/dist/components/Dot.mjs.map +1 -1
  43. package/dist/components/DropdownMenu.d.mts +3 -1
  44. package/dist/components/DropdownMenu.d.mts.map +1 -1
  45. package/dist/components/DropdownMenu.mjs +21 -14
  46. package/dist/components/DropdownMenu.mjs.map +1 -1
  47. package/dist/components/EmptyState.d.mts +31 -3
  48. package/dist/components/EmptyState.d.mts.map +1 -1
  49. package/dist/components/EmptyState.mjs +303 -29
  50. package/dist/components/EmptyState.mjs.map +1 -1
  51. package/dist/components/FileList.d.mts +46 -0
  52. package/dist/components/FileList.d.mts.map +1 -0
  53. package/dist/components/FileList.mjs +727 -0
  54. package/dist/components/FileList.mjs.map +1 -0
  55. package/dist/components/FilePreview.d.mts +33 -0
  56. package/dist/components/FilePreview.d.mts.map +1 -0
  57. package/dist/components/FilePreview.mjs +102 -0
  58. package/dist/components/FilePreview.mjs.map +1 -0
  59. package/dist/components/FileViewer.d.mts +57 -0
  60. package/dist/components/FileViewer.d.mts.map +1 -0
  61. package/dist/components/FileViewer.mjs +335 -0
  62. package/dist/components/FileViewer.mjs.map +1 -0
  63. package/dist/components/HashlineLines.d.mts +13 -0
  64. package/dist/components/HashlineLines.d.mts.map +1 -0
  65. package/dist/components/HashlineLines.mjs +153 -0
  66. package/dist/components/HashlineLines.mjs.map +1 -0
  67. package/dist/components/HostFilter.d.mts +17 -0
  68. package/dist/components/HostFilter.d.mts.map +1 -0
  69. package/dist/components/HostFilter.mjs +68 -0
  70. package/dist/components/HostFilter.mjs.map +1 -0
  71. package/dist/components/HostTag.d.mts +7 -0
  72. package/dist/components/HostTag.d.mts.map +1 -0
  73. package/dist/components/HostTag.mjs +48 -0
  74. package/dist/components/HostTag.mjs.map +1 -0
  75. package/dist/components/InfoStrip.d.mts +9 -0
  76. package/dist/components/InfoStrip.d.mts.map +1 -0
  77. package/dist/components/InfoStrip.mjs +53 -0
  78. package/dist/components/InfoStrip.mjs.map +1 -0
  79. package/dist/components/Input.d.mts +3 -1
  80. package/dist/components/Input.d.mts.map +1 -1
  81. package/dist/components/Input.mjs +5 -4
  82. package/dist/components/Input.mjs.map +1 -1
  83. package/dist/components/Label.mjs +1 -1
  84. package/dist/components/LinkText.d.mts +13 -0
  85. package/dist/components/LinkText.d.mts.map +1 -0
  86. package/dist/components/LinkText.mjs +32 -0
  87. package/dist/components/LinkText.mjs.map +1 -0
  88. package/dist/components/List.d.mts.map +1 -1
  89. package/dist/components/List.mjs +50 -11
  90. package/dist/components/List.mjs.map +1 -1
  91. package/dist/components/LiveDuration.d.mts +30 -0
  92. package/dist/components/LiveDuration.d.mts.map +1 -0
  93. package/dist/components/LiveDuration.mjs +67 -0
  94. package/dist/components/LiveDuration.mjs.map +1 -0
  95. package/dist/components/LoadingState.d.mts +17 -0
  96. package/dist/components/LoadingState.d.mts.map +1 -0
  97. package/dist/components/LoadingState.mjs +90 -0
  98. package/dist/components/LoadingState.mjs.map +1 -0
  99. package/dist/components/Markdown.d.mts +24 -2
  100. package/dist/components/Markdown.d.mts.map +1 -1
  101. package/dist/components/Markdown.mjs +356 -27
  102. package/dist/components/Markdown.mjs.map +1 -1
  103. package/dist/components/MessageItem.d.mts +10 -15
  104. package/dist/components/MessageItem.d.mts.map +1 -1
  105. package/dist/components/MessageItem.mjs +94 -68
  106. package/dist/components/MessageItem.mjs.map +1 -1
  107. package/dist/components/NativeShellState.d.mts +30 -0
  108. package/dist/components/NativeShellState.d.mts.map +1 -0
  109. package/dist/components/NativeShellState.mjs +61 -0
  110. package/dist/components/NativeShellState.mjs.map +1 -0
  111. package/dist/components/RailItem.d.mts +13 -0
  112. package/dist/components/RailItem.d.mts.map +1 -0
  113. package/dist/components/RailItem.mjs +61 -0
  114. package/dist/components/RailItem.mjs.map +1 -0
  115. package/dist/components/ReferenceChip.d.mts +18 -0
  116. package/dist/components/ReferenceChip.d.mts.map +1 -0
  117. package/dist/components/ReferenceChip.mjs +38 -0
  118. package/dist/components/ReferenceChip.mjs.map +1 -0
  119. package/dist/components/SectionLabel.mjs +1 -1
  120. package/dist/components/SeekBar.d.mts +17 -0
  121. package/dist/components/SeekBar.d.mts.map +1 -0
  122. package/dist/components/SeekBar.mjs +97 -0
  123. package/dist/components/SeekBar.mjs.map +1 -0
  124. package/dist/components/SegmentedControl.d.mts.map +1 -1
  125. package/dist/components/SegmentedControl.mjs.map +1 -1
  126. package/dist/components/Select.d.mts +39 -0
  127. package/dist/components/Select.d.mts.map +1 -0
  128. package/dist/components/Select.mjs +288 -0
  129. package/dist/components/Select.mjs.map +1 -0
  130. package/dist/components/Sheet.d.mts +17 -2
  131. package/dist/components/Sheet.d.mts.map +1 -1
  132. package/dist/components/Sheet.mjs +34 -11
  133. package/dist/components/Sheet.mjs.map +1 -1
  134. package/dist/components/SheetFrame.mjs +150 -29
  135. package/dist/components/SheetFrame.mjs.map +1 -1
  136. package/dist/components/SheetList.d.mts +14 -0
  137. package/dist/components/SheetList.d.mts.map +1 -0
  138. package/dist/components/SheetList.mjs +34 -0
  139. package/dist/components/SheetList.mjs.map +1 -0
  140. package/dist/components/ShowMore.d.mts +10 -0
  141. package/dist/components/ShowMore.d.mts.map +1 -0
  142. package/dist/components/ShowMore.mjs +44 -0
  143. package/dist/components/ShowMore.mjs.map +1 -0
  144. package/dist/components/Spinner.d.mts +1 -1
  145. package/dist/components/StatusBadge.d.mts +1 -1
  146. package/dist/components/Switch.d.mts +14 -0
  147. package/dist/components/Switch.d.mts.map +1 -0
  148. package/dist/components/Switch.mjs +37 -0
  149. package/dist/components/Switch.mjs.map +1 -0
  150. package/dist/components/SyntaxLine.d.mts +19 -0
  151. package/dist/components/SyntaxLine.d.mts.map +1 -0
  152. package/dist/components/SyntaxLine.mjs +134 -0
  153. package/dist/components/SyntaxLine.mjs.map +1 -0
  154. package/dist/components/Tabs.d.mts.map +1 -1
  155. package/dist/components/Tabs.mjs +8 -7
  156. package/dist/components/Tabs.mjs.map +1 -1
  157. package/dist/components/ToolPathLink.d.mts +10 -0
  158. package/dist/components/ToolPathLink.d.mts.map +1 -0
  159. package/dist/components/ToolPathLink.mjs +42 -0
  160. package/dist/components/ToolPathLink.mjs.map +1 -0
  161. package/dist/components/ToolResultImage.d.mts +21 -0
  162. package/dist/components/ToolResultImage.d.mts.map +1 -0
  163. package/dist/components/ToolResultImage.mjs +60 -0
  164. package/dist/components/ToolResultImage.mjs.map +1 -0
  165. package/dist/icons/IconColorContext.d.mts +2 -1
  166. package/dist/icons/IconColorContext.d.mts.map +1 -1
  167. package/dist/icons/IconColorContext.mjs.map +1 -1
  168. package/dist/icons/iconGlyphs.d.mts +206 -54
  169. package/dist/icons/iconGlyphs.d.mts.map +1 -1
  170. package/dist/icons/iconGlyphs.mjs +152 -0
  171. package/dist/icons/iconGlyphs.mjs.map +1 -1
  172. package/dist/icons/icons.d.mts +153 -1
  173. package/dist/icons/icons.d.mts.map +1 -1
  174. package/dist/icons/icons.mjs +40 -2
  175. package/dist/icons/icons.mjs.map +1 -1
  176. package/dist/index.d.mts +31 -7
  177. package/dist/index.mjs +36 -12
  178. package/dist/lib/fileKindLabel.mjs +17 -0
  179. package/dist/lib/fileKindLabel.mjs.map +1 -0
  180. package/dist/lib/fonts.d.mts +3 -1
  181. package/dist/lib/fonts.d.mts.map +1 -1
  182. package/dist/lib/fonts.mjs +4 -2
  183. package/dist/lib/fonts.mjs.map +1 -1
  184. package/dist/lib/insideSheet.d.mts +10 -0
  185. package/dist/lib/insideSheet.d.mts.map +1 -0
  186. package/dist/lib/markdown.mjs +310 -23
  187. package/dist/lib/markdown.mjs.map +1 -1
  188. package/dist/lib/reading.mjs +60 -0
  189. package/dist/lib/reading.mjs.map +1 -0
  190. package/dist/lib/useControllable.mjs +14 -6
  191. package/dist/lib/useControllable.mjs.map +1 -1
  192. package/dist/lib/useReadingPage.mjs +33 -0
  193. package/dist/lib/useReadingPage.mjs.map +1 -0
  194. package/dist/po-runtime-identity.json +1 -0
  195. package/dist/shell.d.mts +6 -0
  196. package/dist/shell.mjs +7 -0
  197. package/package.json +41 -31
@@ -0,0 +1,92 @@
1
+ import { fontOf } from "../lib/fonts.mjs";
2
+ import { Button } from "./Button.mjs";
3
+ import { Panel } from "./Panel.mjs";
4
+ import { View } from "react-native-unistyles/components/native/View";
5
+ import { Text } from "react-native-unistyles/components/native/Text";
6
+ import { StyleSheet } from "react-native-unistyles";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ import { Image } from "react-native-unistyles/components/native/Image";
9
+
10
+ //#region src/components/CtaCard.tsx
11
+ /** A card asking the person to do one thing: heading, a line of why, one primary action, optional art. */
12
+ function CtaCard({ title, description, action, onAction, artwork, loading = false, notice, style }) {
13
+ return /* @__PURE__ */ jsxs(Panel, {
14
+ style: [styles.card, style],
15
+ children: [
16
+ /* @__PURE__ */ jsxs(View, {
17
+ style: styles.top,
18
+ children: [/* @__PURE__ */ jsxs(View, {
19
+ style: styles.copy,
20
+ children: [/* @__PURE__ */ jsx(Text, {
21
+ accessibilityRole: "header",
22
+ style: styles.title,
23
+ children: title
24
+ }), /* @__PURE__ */ jsx(Text, {
25
+ style: styles.description,
26
+ children: description
27
+ })]
28
+ }), artwork ? /* @__PURE__ */ jsx(Image, {
29
+ source: artwork,
30
+ resizeMode: "contain",
31
+ accessible: false,
32
+ style: styles.artwork
33
+ }) : null]
34
+ }),
35
+ notice ? /* @__PURE__ */ jsx(Text, {
36
+ accessibilityLiveRegion: "polite",
37
+ style: styles.description,
38
+ children: notice
39
+ }) : null,
40
+ /* @__PURE__ */ jsx(Button, {
41
+ variant: "primary",
42
+ size: "lg",
43
+ loading,
44
+ onPress: onAction,
45
+ children: action
46
+ })
47
+ ]
48
+ });
49
+ }
50
+ const styles = StyleSheet.create((theme) => ({
51
+ card: {
52
+ padding: theme.spacing(5),
53
+ gap: theme.spacing(4),
54
+ uni__dependencies: [0]
55
+ },
56
+ top: {
57
+ flexDirection: "row",
58
+ alignItems: "center",
59
+ gap: theme.spacing(3),
60
+ uni__dependencies: [0]
61
+ },
62
+ copy: {
63
+ flex: 1,
64
+ minWidth: 0,
65
+ gap: theme.spacing(1),
66
+ uni__dependencies: [0]
67
+ },
68
+ title: {
69
+ color: theme.colors.hi,
70
+ fontFamily: fontOf(theme.fontFamily.sans),
71
+ fontSize: theme.fontSize.lg,
72
+ lineHeight: theme.lineHeight.lg,
73
+ fontWeight: theme.fontWeight.semibold,
74
+ uni__dependencies: [0]
75
+ },
76
+ description: {
77
+ color: theme.colors.dim,
78
+ fontFamily: fontOf(theme.fontFamily.sans),
79
+ fontSize: theme.fontSize.base,
80
+ lineHeight: theme.lineHeight.base,
81
+ uni__dependencies: [0]
82
+ },
83
+ artwork: {
84
+ width: theme.spacing(18),
85
+ height: theme.spacing(18),
86
+ uni__dependencies: [0]
87
+ }
88
+ }));
89
+
90
+ //#endregion
91
+ export { CtaCard };
92
+ //# sourceMappingURL=CtaCard.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CtaCard.mjs","names":["ImageSourcePropType","StyleProp","ViewStyle","StyleSheet","fontOf","Button","Panel","CtaCardProps","title","description","action","onAction","artwork","loading","notice","style","CtaCard","styles","card","top","copy","create","theme","padding","spacing","gap","uni__dependencies","flexDirection","alignItems","flex","minWidth","color","colors","hi","fontFamily","sans","fontSize","lg","lineHeight","fontWeight","semibold","dim","base","width","height"],"sources":["../../src/components/CtaCard.tsx"],"sourcesContent":["import { Image, type ImageSourcePropType, type StyleProp, Text, View, type ViewStyle } from 'react-native';\nimport { StyleSheet } from 'react-native-unistyles';\n\nimport { fontOf } from '../lib/fonts';\nimport { Button } from './Button';\nimport { Panel } from './Panel';\n\nexport interface CtaCardProps {\n title: string;\n description: string;\n /** The one action's label. */\n action: string;\n onAction: () => void;\n /** Decorative art beside the heading, such as Po doing the card's job. */\n artwork?: ImageSourcePropType;\n loading?: boolean;\n /** The outcome of the last action, announced politely. */\n notice?: string;\n style?: StyleProp<ViewStyle>;\n}\n\n/** A card asking the person to do one thing: heading, a line of why, one primary action, optional art. */\nexport function CtaCard({\n title,\n description,\n action,\n onAction,\n artwork,\n loading = false,\n notice,\n style,\n}: CtaCardProps) {\n return (\n <Panel style={[styles.card, style]}>\n <View style={styles.top}>\n <View style={styles.copy}>\n <Text accessibilityRole=\"header\" style={styles.title}>\n {title}\n </Text>\n <Text style={styles.description}>{description}</Text>\n </View>\n {artwork ? <Image source={artwork} resizeMode=\"contain\" accessible={false} style={styles.artwork} /> : null}\n </View>\n {notice ? (\n <Text accessibilityLiveRegion=\"polite\" style={styles.description}>\n {notice}\n </Text>\n ) : null}\n <Button variant=\"primary\" size=\"lg\" loading={loading} onPress={onAction}>\n {action}\n </Button>\n </Panel>\n );\n}\n\nconst styles = StyleSheet.create((theme) => ({\n card: { padding: theme.spacing(5), gap: theme.spacing(4) },\n top: { flexDirection: 'row', alignItems: 'center', gap: theme.spacing(3) },\n copy: { flex: 1, minWidth: 0, gap: theme.spacing(1) },\n title: {\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.base,\n lineHeight: theme.lineHeight.base,\n },\n artwork: { width: theme.spacing(18), height: theme.spacing(18) },\n}));\n"],"mappings":";;;;;;;;;;;AAsBA,SAAgBgB,QAAQ,EACtBR,OACAC,aACAC,QACAC,UACAC,SACAC,UAAU,OACVC,QACAC,SACe;CACf,OACE,qBAAC,OAAD;EAAO,OAAO,CAACE,OAAOC,MAAMH,KAAK;YAAjC;GACE,qBAAC,MAAD;IAAM,OAAOE,OAAOE;cAApB,CACE,qBAAC,MAAD;KAAM,OAAOF,OA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AME,QAAQ,EAAE;EAACE,mBAAA,CAAA,CAAA;CAAC;AACjE,EAAE"}
@@ -24,7 +24,7 @@ export interface DialogContentProps {
24
24
  closeLabel?: string;
25
25
  children?: ReactNode;
26
26
  }
27
- export declare function DialogContent({ width, style, closeLabel, children }: DialogContentProps): import("react").JSX.Element;
27
+ export declare function DialogContent({ width, style, closeLabel: closeLabelProp, children }: DialogContentProps): import("react").JSX.Element;
28
28
  export interface DialogPartProps extends Omit<ViewProps, 'children' | 'style'> {
29
29
  children?: ReactNode;
30
30
  style?: StyleProp<ViewStyle>;
@@ -38,7 +38,7 @@ export interface DialogHeaderProps extends DialogPartProps {
38
38
  /** What the close control announces. */
39
39
  closeLabel?: string;
40
40
  }
41
- export declare function DialogHeader({ dismissible, closeLabel, style, children, ...props }: DialogHeaderProps): import("react").JSX.Element;
41
+ export declare function DialogHeader({ dismissible, closeLabel: closeLabelProp, style, children, ...props }: DialogHeaderProps): import("react").JSX.Element;
42
42
  export declare function DialogTitle({ style, ...props }: TextProps): import("react").JSX.Element;
43
43
  export declare function DialogDescription({ style, ...props }: TextProps): import("react").JSX.Element;
44
44
  export declare function DialogBody({ style, children, ...props }: DialogPartProps): import("react").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog.d.mts","names":[],"sources":["../../src/components/Dialog.tsx"],"mappings":";;;;YAoCY;iBASK;;EAEf;EACA;EACA,gBAAgB;EAChB,WAAW;;wBAGG,SAAS,MAAM,aAAqB,cAAc,YAAY,8BAAW,IAAA;;wBAMzE,gBAAgB,YAAY,SAAS,8BAAW,IAAA;;wBAchD,cAAc,YAAY,SAAS,8BAAW,IAAA;iBAa7C;;EAEf,QAAQ;;EAER,QAAQ,UAAU;;EAElB;EACA,WAAW;;wBAGG,gBAAgB,OAAc,OAAO,YAAsB,YAAY,qCAAkB,IAAA;iBA6CxF,wBAAwB,KAAK;EAC5C,WAAW;EACX,QAAQ,UAAU;;iBAGH,0BAA0B;;;;;EAKzC;;EAEA;;wBAGc,eACd,aACA,YACA,OACA,aACG,SACF,oCAAiB,IAAA;wBAcJ,cAAc,UAAU,SAAS,4BAAS,IAAA;wBAI1C,oBAAoB,UAAU,SAAS,4BAAS,IAAA;wBAIhD,aAAa,OAAO,aAAa,SAAS,kCAAe,IAAA;YAQ7D;iBAEK,0BAA0B;;EAEzC,UAAU;;wBAGI,eAAe,SAAmB,OAAO,aAAa,SAAS,oCAAiB,IAAA"}
1
+ {"version":3,"file":"Dialog.d.mts","names":[],"sources":["../../src/components/Dialog.tsx"],"mappings":";;;;YAqCY;iBASK;;EAEf;EACA;EACA,gBAAgB;EAChB,WAAW;;wBAGG,SAAS,MAAM,aAAqB,cAAc,YAAY,8BAAW,IAAA;;wBAOzE,gBAAgB,YAAY,SAAS,8BAAW,IAAA;;wBAchD,cAAc,YAAY,SAAS,8BAAW,IAAA;iBAa7C;;EAEf,QAAQ;;EAER,QAAQ,UAAU;;EAElB;EACA,WAAW;;wBAGG,gBAAgB,OAAc,OAAO,YAAY,gBAAgB,YAAY,qCAAkB,IAAA;iBA+C9F,wBAAwB,KAAK;EAC5C,WAAW;EACX,QAAQ,UAAU;;iBAGH,0BAA0B;;;;;EAKzC;;EAEA;;wBAGc,eACd,aACA,YAAY,gBACZ,OACA,aACG,SACF,oCAAiB,IAAA;wBAgBJ,cAAc,UAAU,SAAS,4BAAS,IAAA;wBAI1C,oBAAoB,UAAU,SAAS,4BAAS,IAAA;wBAIhD,aAAa,OAAO,aAAa,SAAS,kCAAe,IAAA;YAQ7D;iBAEK,0BAA0B;;EAEzC,UAAU;;wBAGI,eAAe,SAAmB,OAAO,aAAa,SAAS,oCAAiB,IAAA"}
@@ -4,19 +4,20 @@ import { Button } from "./Button.mjs";
4
4
  import { CloseIcon } from "../icons/icons.mjs";
5
5
  import { useControllable } from "../lib/useControllable.mjs";
6
6
  import { View } from "react-native-unistyles/components/native/View";
7
- import { withAlpha } from "@agimon-ai/po-web-components/nativeTheme";
7
+ import { Text } from "react-native-unistyles/components/native/Text";
8
8
  import { StyleSheet, useUnistyles } from "react-native-unistyles";
9
9
  import { Easing, Modal, Platform } from "react-native";
10
- import { Text } from "react-native-unistyles/components/native/Text";
11
- import { createContext, useContext, useEffect, useRef } from "react";
10
+ import { Animated } from "react-native-unistyles/components/native/Animated";
11
+ import { withAlpha } from "@agimon-ai/po-web-components/nativeTheme";
12
+ import { createContext, useContext, useEffect, useMemo, useRef } from "react";
12
13
  import { jsx, jsxs } from "react/jsx-runtime";
13
14
  import { Pressable } from "react-native-unistyles/components/native/Pressable";
14
- import { Animated } from "react-native-unistyles/components/native/Animated";
15
+ import { useT } from "@agimon-ai/po-core/native";
15
16
 
16
17
  //#region src/components/Dialog.tsx
17
- /** `bg-doom-deep/70`. */
18
+ /** `bg-po-deep/70`. */
18
19
  const BACKDROP_ALPHA_PERCENT = 70;
19
- /** `animate-doom-pop` starts the card slightly small and grows it into place. */
20
+ /** `animate-po-pop` starts the card slightly small and grows it into place. */
20
21
  const POP_FROM_SCALE = .96;
21
22
  /** `max-w-[calc(100vw-24px)]`: 12pt clear of each screen edge. */
22
23
  const SCREEN_MARGIN = 12;
@@ -26,11 +27,12 @@ const DialogContext = createContext({
26
27
  });
27
28
  function Dialog({ open, defaultOpen = false, onOpenChange, children }) {
28
29
  const [current, setOpen] = useControllable(open, defaultOpen, onOpenChange);
30
+ const value = useMemo(() => ({
31
+ open: current,
32
+ setOpen
33
+ }), [current, setOpen]);
29
34
  return /* @__PURE__ */ jsx(DialogContext.Provider, {
30
- value: {
31
- open: current,
32
- setOpen
33
- },
35
+ value,
34
36
  children
35
37
  });
36
38
  }
@@ -56,7 +58,9 @@ function DialogClose({ onPress, ...props }) {
56
58
  ...props
57
59
  });
58
60
  }
59
- function DialogContent({ width = "md", style, closeLabel = "close", children }) {
61
+ function DialogContent({ width = "md", style, closeLabel: closeLabelProp, children }) {
62
+ const t = useT();
63
+ const closeLabel = closeLabelProp ?? t("nativeComponents.dialog.close", "close");
60
64
  const { open, setOpen } = useContext(DialogContext);
61
65
  const { theme } = useUnistyles();
62
66
  const progress = useRef(new Animated.Value(0)).current;
@@ -114,7 +118,9 @@ function DialogContent({ width = "md", style, closeLabel = "close", children })
114
118
  });
115
119
  }
116
120
  }
117
- function DialogHeader({ dismissible = false, closeLabel = "close", style, children, ...props }) {
121
+ function DialogHeader({ dismissible = false, closeLabel: closeLabelProp, style, children, ...props }) {
122
+ const t = useT();
123
+ const closeLabel = closeLabelProp ?? t("nativeComponents.dialog.close", "close");
118
124
  const { setOpen } = useContext(DialogContext);
119
125
  return /* @__PURE__ */ jsxs(View, {
120
126
  style: [styles.header, style],
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog.mjs","names":["withAlpha","createContext","ReactNode","useContext","useEffect","useRef","Easing","Modal","Platform","StyleProp","TextProps","ViewProps","ViewStyle","StyleSheet","useUnistyles","CloseIcon","fontOf","useControllable","wrapText","Button","ButtonProps","BACKDROP_ALPHA_PERCENT","POP_FROM_SCALE","SCREEN_MARGIN","DialogWidth","DialogState","open","setOpen","DialogContext","undefined","DialogProps","defaultOpen","onOpenChange","children","Dialog","current","DialogTrigger","onPress","props","event","DialogClose","DialogContentProps","width","style","closeLabel","DialogContent","theme","progress","Animated","Value","x1","y1","x2","y2","motion","easing","setValue","timing","toValue","duration","pop","bezier","useNativeDriver","OS","start","_styles","styles","useVariants","root","backdrop","backgroundColor","colors","deep","card","opacity","transform","scale","interpolate","inputRange","outputRange","DialogPartProps","Omit","DialogHeaderProps","dismissible","DialogHeader","header","DialogTitle","title","DialogDescription","description","DialogBody","body","DialogFooterVariant","DialogFooterProps","variant","DialogFooter","_styles2","footer","hint","create","flex","alignItems","justifyContent","padding","position","top","right","bottom","left","maxHeight","overflow","borderRadius","lg","borderWidth","borderColor","border","panel","variants","sm","maxWidth","md","uni__dependencies","flexDirection","gap","spacing","minWidth","borderBottomWidth","borderBottomColor","flexShrink","color","hi","fontFamily","sans","fontSize","xl","lineHeight","letterSpacing","fontWeight","semibold","dim","lineHeightRelaxed","plain","bar","flexWrap","minHeight","borderTopWidth","borderTopColor","paddingHorizontal","paddingVertical","faint"],"sources":["../../src/components/Dialog.tsx"],"sourcesContent":["import { withAlpha } from '@agimon-ai/po-web-components/nativeTheme';\nimport { createContext, type ReactNode, useContext, useEffect, useRef } from 'react';\nimport {\n Animated,\n Easing,\n Modal,\n Platform,\n Pressable,\n type StyleProp,\n Text,\n type TextProps,\n View,\n type ViewProps,\n type ViewStyle,\n} from 'react-native';\nimport { StyleSheet, useUnistyles } 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';\n\n/*\n * The web Dialog as a centred card in an RN Modal: the native shape for a\n * question that blocks, such as a destructive confirmation. Android back and\n * a backdrop tap close it, as Escape and an outside click do on the web.\n */\n\n/** `bg-doom-deep/70`. */\nconst BACKDROP_ALPHA_PERCENT = 70;\n/** `animate-doom-pop` starts the card slightly small and grows it into place. */\nconst POP_FROM_SCALE = 0.96;\n/** `max-w-[calc(100vw-24px)]`: 12pt clear of each screen edge. */\nconst SCREEN_MARGIN = 12;\n\nexport type DialogWidth = 'sm' | 'md' | 'lg';\n\ninterface DialogState {\n open: boolean;\n setOpen: (open: boolean) => void;\n}\n\nconst DialogContext = createContext<DialogState>({ open: false, setOpen: () => undefined });\n\nexport interface DialogProps {\n /** Controlled mode; pair with onOpenChange. Omit it and the dialog keeps its own state. */\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n children?: ReactNode;\n}\n\nexport function Dialog({ open, defaultOpen = false, onOpenChange, children }: DialogProps) {\n const [current, setOpen] = useControllable(open, defaultOpen, onOpenChange);\n return <DialogContext.Provider value={{ open: current, setOpen }}>{children}</DialogContext.Provider>;\n}\n\n/** A Button that opens the enclosing dialog. */\nexport function DialogTrigger({ onPress, ...props }: ButtonProps) {\n const { setOpen } = useContext(DialogContext);\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 dialog. */\nexport function DialogClose({ onPress, ...props }: ButtonProps) {\n const { setOpen } = useContext(DialogContext);\n return (\n <Button\n onPress={(event) => {\n onPress?.(event);\n setOpen(false);\n }}\n {...props}\n />\n );\n}\n\nexport interface DialogContentProps {\n /** Width preset; `style` may still override. */\n width?: DialogWidth;\n /** Applied to the card, after the preset. */\n style?: StyleProp<ViewStyle>;\n /** What the backdrop announces as its close action. */\n closeLabel?: string;\n children?: ReactNode;\n}\n\nexport function DialogContent({ width = 'md', style, closeLabel = 'close', children }: DialogContentProps) {\n const { open, setOpen } = useContext(DialogContext);\n const { theme } = useUnistyles();\n const progress = useRef(new Animated.Value(0)).current;\n const [x1, y1, x2, y2] = theme.motion.easing;\n useEffect(() => {\n if (!open) return;\n progress.setValue(0);\n Animated.timing(progress, {\n toValue: 1,\n duration: theme.motion.pop,\n easing: Easing.bezier(x1, y1, x2, y2),\n useNativeDriver: Platform.OS !== 'web',\n }).start();\n }, [open, progress, theme.motion.pop, x1, y1, x2, y2]);\n styles.useVariants({ width });\n return (\n <Modal visible={open} transparent animationType=\"fade\" statusBarTranslucent onRequestClose={() => setOpen(false)}>\n <View style={styles.root}>\n <Pressable\n accessibilityRole=\"button\"\n accessibilityLabel={closeLabel}\n onPress={() => setOpen(false)}\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 style={[styles.backdrop, { backgroundColor: withAlpha(theme.colors.deep, BACKDROP_ALPHA_PERCENT) }]}\n />\n <Animated.View\n accessibilityViewIsModal\n style={[\n styles.card,\n style,\n {\n opacity: progress,\n transform: [{ scale: progress.interpolate({ inputRange: [0, 1], outputRange: [POP_FROM_SCALE, 1] }) }],\n },\n ]}\n >\n {children}\n </Animated.View>\n </View>\n </Modal>\n );\n}\n\nexport interface DialogPartProps extends Omit<ViewProps, 'children' | 'style'> {\n children?: ReactNode;\n style?: StyleProp<ViewStyle>;\n}\n\nexport interface DialogHeaderProps extends DialogPartProps {\n /**\n * Show the close control at the right of the strip. Off by default, as on\n * the web: Android back and a backdrop tap already close every dialog.\n */\n dismissible?: boolean;\n /** What the close control announces. */\n closeLabel?: string;\n}\n\nexport function DialogHeader({\n dismissible = false,\n closeLabel = 'close',\n style,\n children,\n ...props\n}: DialogHeaderProps) {\n const { setOpen } = useContext(DialogContext);\n return (\n <View style={[styles.header, style]} {...props}>\n {children}\n {dismissible ? (\n <Button variant=\"ghost\" size=\"icon\" accessibilityLabel={closeLabel} onPress={() => setOpen(false)}>\n <CloseIcon size={12} color=\"faint\" />\n </Button>\n ) : null}\n </View>\n );\n}\n\nexport function DialogTitle({ style, ...props }: TextProps) {\n return <Text accessibilityRole=\"header\" style={[styles.title, style]} {...props} />;\n}\n\nexport function DialogDescription({ style, ...props }: TextProps) {\n return <Text style={[styles.description, style]} {...props} />;\n}\n\nexport function DialogBody({ style, children, ...props }: DialogPartProps) {\n return (\n <View style={[styles.body, style]} {...props}>\n {wrapText(children, styles.description)}\n </View>\n );\n}\n\nexport type DialogFooterVariant = 'plain' | 'bar';\n\nexport interface DialogFooterProps extends DialogPartProps {\n /** `plain`: buttons alone, inside the body's padding. `bar`: the recessed full-width strip with a hint at the left. */\n variant?: DialogFooterVariant;\n}\n\nexport function DialogFooter({ variant = 'plain', style, children, ...props }: DialogFooterProps) {\n styles.useVariants({ footer: variant });\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 root: { flex: 1, alignItems: 'center', justifyContent: 'center', padding: SCREEN_MARGIN },\n backdrop: { position: 'absolute', top: 0, right: 0, bottom: 0, left: 0 },\n card: {\n width: '100%',\n maxHeight: '100%',\n overflow: 'hidden',\n borderRadius: theme.borderRadius.lg,\n borderWidth: 1,\n borderColor: theme.colors.border,\n backgroundColor: theme.colors.panel,\n variants: {\n width: {\n sm: { maxWidth: 360 },\n md: { maxWidth: 480 },\n lg: { maxWidth: 620 },\n },\n },\n },\n header: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n gap: theme.spacing(3),\n minWidth: 0,\n borderBottomWidth: 1,\n borderBottomColor: theme.colors.border,\n padding: theme.spacing(3),\n },\n title: {\n flexShrink: 1,\n color: theme.colors.hi,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.xl,\n lineHeight: theme.lineHeight.xl,\n letterSpacing: theme.letterSpacing.xl,\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: { gap: theme.spacing(3), padding: theme.spacing(3) },\n footer: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: theme.spacing(2),\n variants: {\n footer: {\n plain: { justifyContent: 'flex-end' },\n bar: {\n flexWrap: 'wrap',\n justifyContent: 'space-between',\n minHeight: 34,\n borderTopWidth: 1,\n borderTopColor: theme.colors['border-soft'],\n backgroundColor: theme.colors.deep,\n paddingHorizontal: theme.spacing(3),\n paddingVertical: theme.spacing(1.5),\n },\n },\n },\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":";;;;;;;;;;;;;;;;;AA8BA,MAAMqB,yBAAyB;;AAE/B,MAAMC,iBAAiB;;AAEvB,MAAMC,gBAAgB;AAStB,MAAMK,gBAAgB3B,cAA2B;CAAEyB,MAAM;CAAOC,eAAeE;AAAU,CAAC;AAU1F,SAAgBK,OAAO,EAAER,MAAMK,cAAc,OAAOC,cAAcC,YAAyB;CACzF,MAAM,CAACE,SAASR,WAAWV,gBAAgBS,MAAMK,aAAaC,YAAY;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AA,CAAA,CAAA;CACrC;AACF,EAAE"}
1
+ {"version":3,"file":"Dialog.mjs","names":["useT","withAlpha","createContext","ReactNode","useContext","useEffect","useMemo","useRef","Easing","Modal","Platform","StyleProp","TextProps","ViewProps","ViewStyle","StyleSheet","useUnistyles","CloseIcon","fontOf","useControllable","wrapText","Button","ButtonProps","BACKDROP_ALPHA_PERCENT","POP_FROM_SCALE","SCREEN_MARGIN","DialogWidth","DialogState","open","setOpen","DialogContext","undefined","DialogProps","defaultOpen","onOpenChange","children","Dialog","current","value","DialogTrigger","onPress","props","event","DialogClose","DialogContentProps","width","style","closeLabel","DialogContent","closeLabelProp","t","theme","progress","Animated","Value","x1","y1","x2","y2","motion","easing","setValue","timing","toValue","duration","pop","bezier","useNativeDriver","OS","start","_styles","styles","useVariants","root","backdrop","backgroundColor","colors","deep","card","opacity","transform","scale","interpolate","inputRange","outputRange","DialogPartProps","Omit","DialogHeaderProps","dismissible","DialogHeader","header","DialogTitle","title","DialogDescription","description","DialogBody","body","DialogFooterVariant","DialogFooterProps","variant","DialogFooter","_styles2","footer","hint","create","flex","alignItems","justifyContent","padding","position","top","right","bottom","left","maxHeight","overflow","borderRadius","lg","borderWidth","borderColor","border","panel","variants","sm","maxWidth","md","uni__dependencies","flexDirection","gap","spacing","minWidth","borderBottomWidth","borderBottomColor","flexShrink","color","hi","fontFamily","sans","fontSize","xl","lineHeight","letterSpacing","fontWeight","semibold","dim","lineHeightRelaxed","plain","bar","flexWrap","minHeight","borderTopWidth","borderTopColor","paddingHorizontal","paddingVertical","faint"],"sources":["../../src/components/Dialog.tsx"],"sourcesContent":["import { useT } from '@agimon-ai/po-core/native';\nimport { withAlpha } from '@agimon-ai/po-web-components/nativeTheme';\nimport { createContext, type ReactNode, useContext, useEffect, useMemo, useRef } from 'react';\nimport {\n Animated,\n Easing,\n Modal,\n Platform,\n Pressable,\n type StyleProp,\n Text,\n type TextProps,\n View,\n type ViewProps,\n type ViewStyle,\n} from 'react-native';\nimport { StyleSheet, useUnistyles } 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';\n\n/*\n * The web Dialog as a centred card in an RN Modal: the native shape for a\n * question that blocks, such as a destructive confirmation. Android back and\n * a backdrop tap close it, as Escape and an outside click do on the web.\n */\n\n/** `bg-po-deep/70`. */\nconst BACKDROP_ALPHA_PERCENT = 70;\n/** `animate-po-pop` starts the card slightly small and grows it into place. */\nconst POP_FROM_SCALE = 0.96;\n/** `max-w-[calc(100vw-24px)]`: 12pt clear of each screen edge. */\nconst SCREEN_MARGIN = 12;\n\nexport type DialogWidth = 'sm' | 'md' | 'lg';\n\ninterface DialogState {\n open: boolean;\n setOpen: (open: boolean) => void;\n}\n\nconst DialogContext = createContext<DialogState>({ open: false, setOpen: () => undefined });\n\nexport interface DialogProps {\n /** Controlled mode; pair with onOpenChange. Omit it and the dialog keeps its own state. */\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n children?: ReactNode;\n}\n\nexport function Dialog({ open, defaultOpen = false, onOpenChange, children }: DialogProps) {\n const [current, setOpen] = useControllable(open, defaultOpen, onOpenChange);\n const value = useMemo(() => ({ open: current, setOpen }), [current, setOpen]);\n return <DialogContext.Provider value={value}>{children}</DialogContext.Provider>;\n}\n\n/** A Button that opens the enclosing dialog. */\nexport function DialogTrigger({ onPress, ...props }: ButtonProps) {\n const { setOpen } = useContext(DialogContext);\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 dialog. */\nexport function DialogClose({ onPress, ...props }: ButtonProps) {\n const { setOpen } = useContext(DialogContext);\n return (\n <Button\n onPress={(event) => {\n onPress?.(event);\n setOpen(false);\n }}\n {...props}\n />\n );\n}\n\nexport interface DialogContentProps {\n /** Width preset; `style` may still override. */\n width?: DialogWidth;\n /** Applied to the card, after the preset. */\n style?: StyleProp<ViewStyle>;\n /** What the backdrop announces as its close action. */\n closeLabel?: string;\n children?: ReactNode;\n}\n\nexport function DialogContent({ width = 'md', style, closeLabel: closeLabelProp, children }: DialogContentProps) {\n const t = useT();\n const closeLabel = closeLabelProp ?? t('nativeComponents.dialog.close', 'close');\n const { open, setOpen } = useContext(DialogContext);\n const { theme } = useUnistyles();\n const progress = useRef(new Animated.Value(0)).current;\n const [x1, y1, x2, y2] = theme.motion.easing;\n useEffect(() => {\n if (!open) return;\n progress.setValue(0);\n Animated.timing(progress, {\n toValue: 1,\n duration: theme.motion.pop,\n easing: Easing.bezier(x1, y1, x2, y2),\n useNativeDriver: Platform.OS !== 'web',\n }).start();\n }, [open, progress, theme.motion.pop, x1, y1, x2, y2]);\n styles.useVariants({ width });\n return (\n <Modal visible={open} transparent animationType=\"fade\" statusBarTranslucent onRequestClose={() => setOpen(false)}>\n <View style={styles.root}>\n <Pressable\n accessibilityRole=\"button\"\n accessibilityLabel={closeLabel}\n onPress={() => setOpen(false)}\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 style={[styles.backdrop, { backgroundColor: withAlpha(theme.colors.deep, BACKDROP_ALPHA_PERCENT) }]}\n />\n <Animated.View\n accessibilityViewIsModal\n style={[\n styles.card,\n style,\n {\n opacity: progress,\n transform: [{ scale: progress.interpolate({ inputRange: [0, 1], outputRange: [POP_FROM_SCALE, 1] }) }],\n },\n ]}\n >\n {children}\n </Animated.View>\n </View>\n </Modal>\n );\n}\n\nexport interface DialogPartProps extends Omit<ViewProps, 'children' | 'style'> {\n children?: ReactNode;\n style?: StyleProp<ViewStyle>;\n}\n\nexport interface DialogHeaderProps extends DialogPartProps {\n /**\n * Show the close control at the right of the strip. Off by default, as on\n * the web: Android back and a backdrop tap already close every dialog.\n */\n dismissible?: boolean;\n /** What the close control announces. */\n closeLabel?: string;\n}\n\nexport function DialogHeader({\n dismissible = false,\n closeLabel: closeLabelProp,\n style,\n children,\n ...props\n}: DialogHeaderProps) {\n const t = useT();\n const closeLabel = closeLabelProp ?? t('nativeComponents.dialog.close', 'close');\n const { setOpen } = useContext(DialogContext);\n return (\n <View style={[styles.header, style]} {...props}>\n {children}\n {dismissible ? (\n <Button variant=\"ghost\" size=\"icon\" accessibilityLabel={closeLabel} onPress={() => setOpen(false)}>\n <CloseIcon size={12} color=\"faint\" />\n </Button>\n ) : null}\n </View>\n );\n}\n\nexport function DialogTitle({ style, ...props }: TextProps) {\n return <Text accessibilityRole=\"header\" style={[styles.title, style]} {...props} />;\n}\n\nexport function DialogDescription({ style, ...props }: TextProps) {\n return <Text style={[styles.description, style]} {...props} />;\n}\n\nexport function DialogBody({ style, children, ...props }: DialogPartProps) {\n return (\n <View style={[styles.body, style]} {...props}>\n {wrapText(children, styles.description)}\n </View>\n );\n}\n\nexport type DialogFooterVariant = 'plain' | 'bar';\n\nexport interface DialogFooterProps extends DialogPartProps {\n /** `plain`: buttons alone, inside the body's padding. `bar`: the recessed full-width strip with a hint at the left. */\n variant?: DialogFooterVariant;\n}\n\nexport function DialogFooter({ variant = 'plain', style, children, ...props }: DialogFooterProps) {\n styles.useVariants({ footer: variant });\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 root: { flex: 1, alignItems: 'center', justifyContent: 'center', padding: SCREEN_MARGIN },\n backdrop: { position: 'absolute', top: 0, right: 0, bottom: 0, left: 0 },\n card: {\n width: '100%',\n maxHeight: '100%',\n overflow: 'hidden',\n borderRadius: theme.borderRadius.lg,\n borderWidth: 1,\n borderColor: theme.colors.border,\n backgroundColor: theme.colors.panel,\n variants: {\n width: {\n sm: { maxWidth: 360 },\n md: { maxWidth: 480 },\n lg: { maxWidth: 620 },\n },\n },\n },\n header: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n gap: theme.spacing(3),\n minWidth: 0,\n borderBottomWidth: 1,\n borderBottomColor: theme.colors.border,\n padding: theme.spacing(3),\n },\n title: {\n flexShrink: 1,\n color: theme.colors.hi,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.xl,\n lineHeight: theme.lineHeight.xl,\n letterSpacing: theme.letterSpacing.xl,\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: { gap: theme.spacing(3), padding: theme.spacing(3) },\n footer: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: theme.spacing(2),\n variants: {\n footer: {\n plain: { justifyContent: 'flex-end' },\n bar: {\n flexWrap: 'wrap',\n justifyContent: 'space-between',\n minHeight: 34,\n borderTopWidth: 1,\n borderTopColor: theme.colors['border-soft'],\n backgroundColor: theme.colors.deep,\n paddingHorizontal: theme.spacing(3),\n paddingVertical: theme.spacing(1.5),\n },\n },\n },\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":";;;;;;;;;;;;;;;;;;AA+BA,MAAMuB,yBAAyB;;AAE/B,MAAMC,iBAAiB;;AAEvB,MAAMC,gBAAgB;AAStB,MAAMK,gBAAgB5B,cAA2B;CAAE0B,MAAM;CAAOC,eAAeE;AAAU,CAAC;AAU1F,SAAgBK,OAAO,EAAER,MAAMK,cAAc,OAAOC,cAAcC,YAAyB;CACzF,MAAM,CAACE,SAASR,WAAWV,gBAAgBS,MAAMK,aAAaC,YAAY;CAC1E,MAAMI,QAAQhC,eAAe;EAAEsB,MAAMS;EAASR;CAAQ,IAAI,CAACQ,SAASR,OAAO,CAAC;CAC5E,OAAO,oBAAC,cAAc,UAAf;EAA+BS;EAAQH;CAAiC;AACjF;;AAGA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;EACxCC,UAAUvF,MAAMuF,SAAS;EACzBE,YAAYzF,MAAMyF,WAAW;EAAMd,mBAAA,CAAA,CAAA;CACrC;AACF,EAAE"}
@@ -1,5 +1,5 @@
1
- import { DotTone } from "@agimon-ai/po-web-components/nativeTheme";
2
1
  import { StyleProp, ViewStyle } from "react-native";
2
+ import { DotTone } from "@agimon-ai/po-web-components/nativeTheme";
3
3
  //#region src/components/Dot.d.ts
4
4
  type DotTone$1 = DotTone;
5
5
  export type DotSize = 'xs' | 'sm' | 'md' | 'lg';
@@ -1,11 +1,11 @@
1
- import { withAlpha } from "@agimon-ai/po-web-components/nativeTheme";
2
1
  import { StyleSheet, useUnistyles } from "react-native-unistyles";
2
+ import { Animated } from "react-native-unistyles/components/native/Animated";
3
+ import { withAlpha } from "@agimon-ai/po-web-components/nativeTheme";
3
4
  import { useEffect, useRef } from "react";
4
5
  import { jsx } from "react/jsx-runtime";
5
- import { Animated } from "react-native-unistyles/components/native/Animated";
6
6
 
7
7
  //#region src/components/Dot.tsx
8
- /** `bg-doom-faint/40`: a thing that exists but is not live. */
8
+ /** `bg-po-faint/40`: a thing that exists but is not live. */
9
9
  const MUTED_ALPHA_PERCENT = 40;
10
10
  /** Tailwind's `animate-pulse`: a 2s cycle down to half opacity and back. */
11
11
  const PULSE_HALF_CYCLE_MS = 1e3;
@@ -1 +1 @@
1
- {"version":3,"file":"Dot.mjs","names":["DotTone","Tone","withAlpha","useEffect","useRef","StyleProp","ViewStyle","StyleSheet","useUnistyles","DotSize","MUTED_ALPHA_PERCENT","PULSE_HALF_CYCLE_MS","PULSE_LOW_OPACITY","DotProps","tone","size","pulse","style","Dot","theme","_styles","styles","useVariants","opacity","Animated","Value","current","setValue","undefined","loop","sequence","timing","toValue","duration","useNativeDriver","start","stop","dot","backgroundColor","colors","faint","create","flexShrink","borderRadius","full","variants","neutral","muted","blue","green","yellow","red","magenta","violet","cyan","orange","teal","xs","width","spacing","height","sm","md","lg","uni__dependencies"],"sources":["../../src/components/Dot.tsx"],"sourcesContent":["import { type DotTone as Tone, withAlpha } from '@agimon-ai/po-web-components/nativeTheme';\nimport { useEffect, useRef } from 'react';\nimport { Animated, type StyleProp, type ViewStyle } from 'react-native';\nimport { StyleSheet, useUnistyles } from 'react-native-unistyles';\n\nexport type DotTone = Tone;\nexport type DotSize = 'xs' | 'sm' | 'md' | 'lg';\n\n/** `bg-doom-faint/40`: a thing that exists but is not live. */\nconst MUTED_ALPHA_PERCENT = 40;\n/** Tailwind's `animate-pulse`: a 2s cycle down to half opacity and back. */\nconst PULSE_HALF_CYCLE_MS = 1000;\nconst PULSE_LOW_OPACITY = 0.5;\n\nexport interface DotProps {\n tone?: DotTone;\n size?: DotSize;\n /** Something is live: the dot breathes. */\n pulse?: boolean;\n style?: StyleProp<ViewStyle>;\n}\n\n/** The status dot: a colour and, while something is live, a pulse. Hidden from screen readers. */\nexport function Dot({ tone = 'neutral', size = 'sm', pulse = false, style }: DotProps) {\n const { theme } = useUnistyles();\n styles.useVariants({ tone, size });\n const opacity = useRef(new Animated.Value(1)).current;\n useEffect(() => {\n if (!pulse) {\n opacity.setValue(1);\n return undefined;\n }\n const loop = Animated.loop(\n Animated.sequence([\n Animated.timing(opacity, { toValue: PULSE_LOW_OPACITY, duration: PULSE_HALF_CYCLE_MS, useNativeDriver: true }),\n Animated.timing(opacity, { toValue: 1, duration: PULSE_HALF_CYCLE_MS, useNativeDriver: true }),\n ]),\n );\n loop.start();\n return () => loop.stop();\n }, [pulse, opacity]);\n return (\n <Animated.View\n accessible={false}\n importantForAccessibility=\"no-hide-descendants\"\n accessibilityElementsHidden\n style={[\n styles.dot,\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 tone === 'muted' && { backgroundColor: withAlpha(theme.colors.faint, MUTED_ALPHA_PERCENT) },\n { opacity },\n style,\n ]}\n />\n );\n}\n\nconst styles = StyleSheet.create((theme) => ({\n dot: {\n flexShrink: 0,\n borderRadius: theme.borderRadius.full,\n variants: {\n tone: {\n neutral: { backgroundColor: theme.colors.faint },\n muted: {},\n blue: { backgroundColor: theme.colors.blue },\n green: { backgroundColor: theme.colors.green },\n yellow: { backgroundColor: theme.colors.yellow },\n red: { backgroundColor: theme.colors.red },\n magenta: { backgroundColor: theme.colors.magenta },\n violet: { backgroundColor: theme.colors.violet },\n cyan: { backgroundColor: theme.colors.cyan },\n orange: { backgroundColor: theme.colors.orange },\n teal: { backgroundColor: theme.colors.teal },\n },\n size: {\n xs: { width: theme.spacing(1), height: theme.spacing(1) },\n sm: { width: theme.spacing(1.5), height: theme.spacing(1.5) },\n md: { width: theme.spacing(2), height: theme.spacing(2) },\n lg: { width: theme.spacing(2.5), height: theme.spacing(2.5) },\n },\n },\n },\n}));\n"],"mappings":";;;;;;;;AASA,MAAMU,sBAAsB;;AAE5B,MAAMC,sBAAsB;AAC5B,MAAMC,oBAAoB;;AAW1B,SAAgBM,IAAI,EAAEJ,OAAO,WAAWC,OAAO,MAAMC,QAAQ,OAAOC,SAAmB;CACrF,MAAM,EAAEE,UAAUX,aAAa;CAAE,MAAAY,UAAAC;CAAA;EAAA,MAAAA,SAAAD,QAAAE,YACd;GAAER;GAAMC;EAAK,CAAC;EACjC,MAAMQ,UAAUnB,OAAO,IAAIoB,SAASC,MAAM,CAAC,CAAC,CAAC,CAACC;EAC9CvB,gBAAgB;GACd,IAAI,CAACa,OAAO;IACVO,QAAQI,SAAS,CAAC;IAClB;GACF;GACA,MAAME,OAAOL,SAASK,KACpBL,SAASM,SAAS,CAChBN,SAASO,OAAOR,SAAS;IAAES,SAASpB;IAAmBqB,UAAUtB;IAAqBuB,iBAAiB;GAAK,CAAC,GAC7GV,SAASO,OAAOR,SAAS;IAAES,SAAS;IAAGC,UAAUtB;IAAqBuB,iBAAiB;GAAK,CAAC,CAAC,CAC/F,CACH;GACAL,KAAKM,MAAM;GACX,aAAaN,KAAKO,KAAK;EACzB,GAAG,CAACpB,OAAOO,OAA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GACxDI,IAAI;IAAEL,OAAOvC,MAAMwC,QAAQ,GAAG;IAAGC,QAAQzC,MAAMwC,QAAQ,GAAG;GAAE;EAC9D;CACF;CAACK,mBAAA,CAAA,GAAA,CAAA;AACH,EACF,EAAE"}
1
+ {"version":3,"file":"Dot.mjs","names":["DotTone","Tone","withAlpha","useEffect","useRef","StyleProp","ViewStyle","StyleSheet","useUnistyles","DotSize","MUTED_ALPHA_PERCENT","PULSE_HALF_CYCLE_MS","PULSE_LOW_OPACITY","DotProps","tone","size","pulse","style","Dot","theme","_styles","styles","useVariants","opacity","Animated","Value","current","setValue","undefined","loop","sequence","timing","toValue","duration","useNativeDriver","start","stop","dot","backgroundColor","colors","faint","create","flexShrink","borderRadius","full","variants","neutral","muted","blue","green","yellow","red","magenta","violet","cyan","orange","teal","xs","width","spacing","height","sm","md","lg","uni__dependencies"],"sources":["../../src/components/Dot.tsx"],"sourcesContent":["import { type DotTone as Tone, withAlpha } from '@agimon-ai/po-web-components/nativeTheme';\nimport { useEffect, useRef } from 'react';\nimport { Animated, type StyleProp, type ViewStyle } from 'react-native';\nimport { StyleSheet, useUnistyles } from 'react-native-unistyles';\n\nexport type DotTone = Tone;\nexport type DotSize = 'xs' | 'sm' | 'md' | 'lg';\n\n/** `bg-po-faint/40`: a thing that exists but is not live. */\nconst MUTED_ALPHA_PERCENT = 40;\n/** Tailwind's `animate-pulse`: a 2s cycle down to half opacity and back. */\nconst PULSE_HALF_CYCLE_MS = 1000;\nconst PULSE_LOW_OPACITY = 0.5;\n\nexport interface DotProps {\n tone?: DotTone;\n size?: DotSize;\n /** Something is live: the dot breathes. */\n pulse?: boolean;\n style?: StyleProp<ViewStyle>;\n}\n\n/** The status dot: a colour and, while something is live, a pulse. Hidden from screen readers. */\nexport function Dot({ tone = 'neutral', size = 'sm', pulse = false, style }: DotProps) {\n const { theme } = useUnistyles();\n styles.useVariants({ tone, size });\n const opacity = useRef(new Animated.Value(1)).current;\n useEffect(() => {\n if (!pulse) {\n opacity.setValue(1);\n return undefined;\n }\n const loop = Animated.loop(\n Animated.sequence([\n Animated.timing(opacity, { toValue: PULSE_LOW_OPACITY, duration: PULSE_HALF_CYCLE_MS, useNativeDriver: true }),\n Animated.timing(opacity, { toValue: 1, duration: PULSE_HALF_CYCLE_MS, useNativeDriver: true }),\n ]),\n );\n loop.start();\n return () => loop.stop();\n }, [pulse, opacity]);\n return (\n <Animated.View\n accessible={false}\n importantForAccessibility=\"no-hide-descendants\"\n accessibilityElementsHidden\n style={[\n styles.dot,\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 tone === 'muted' && { backgroundColor: withAlpha(theme.colors.faint, MUTED_ALPHA_PERCENT) },\n { opacity },\n style,\n ]}\n />\n );\n}\n\nconst styles = StyleSheet.create((theme) => ({\n dot: {\n flexShrink: 0,\n borderRadius: theme.borderRadius.full,\n variants: {\n tone: {\n neutral: { backgroundColor: theme.colors.faint },\n muted: {},\n blue: { backgroundColor: theme.colors.blue },\n green: { backgroundColor: theme.colors.green },\n yellow: { backgroundColor: theme.colors.yellow },\n red: { backgroundColor: theme.colors.red },\n magenta: { backgroundColor: theme.colors.magenta },\n violet: { backgroundColor: theme.colors.violet },\n cyan: { backgroundColor: theme.colors.cyan },\n orange: { backgroundColor: theme.colors.orange },\n teal: { backgroundColor: theme.colors.teal },\n },\n size: {\n xs: { width: theme.spacing(1), height: theme.spacing(1) },\n sm: { width: theme.spacing(1.5), height: theme.spacing(1.5) },\n md: { width: theme.spacing(2), height: theme.spacing(2) },\n lg: { width: theme.spacing(2.5), height: theme.spacing(2.5) },\n },\n },\n },\n}));\n"],"mappings":";;;;;;;;AASA,MAAMU,sBAAsB;;AAE5B,MAAMC,sBAAsB;AAC5B,MAAMC,oBAAoB;;AAW1B,SAAgBM,IAAI,EAAEJ,OAAO,WAAWC,OAAO,MAAMC,QAAQ,OAAOC,SAAmB;CACrF,MAAM,EAAEE,UAAUX,aA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MoB,OAAOa,QAAQ;GACjDC,QAAQ,EAAEf,iBAAiBnB,MAAMoB,OAAOc,OAAO;GAC/CC,MAAM,EAAEhB,iBAAiBnB,MAAMoB,OAAOe,KAAK;GAC3CC,QAAQ,EAAEjB,iBAAiBnB,MAAMoB,OAAOgB,OAAO;GAC/CC,MAAM,EAAElB,iBAAiBnB,MAAMoB,OAAOiB,KAAK;EAC7C;EACAzC,MAAM;GACJ0C,IAAI;IAAEC,OAAOvC,MAAMwC,QAAQ,CAAC;IAAGC,QAAQzC,MAAMwC,QAAQ,CAAC;GAAE;GACxDE,IAAI;IAAEH,OAAOvC,MAAMwC,QAAQ,GAAG;IAAGC,QAAQzC,MAAMwC,QAAQ,GAAG;GAAE;GAC5DG,IAAI;IAAEJ,OAAOvC,MAAMwC,QAAQ,CAAC;IAAGC,QAAQzC,MAAMwC,QAAQ,CAAC;GAAE;GACxDI,IAAI;IAAEL,OAAOvC,MAAMwC,QAAQ,GAAG;IAAGC,QAAQzC,MAAMwC,QAAQ,GAAG;GAAE;EAC9D;CACF;CAACK,mBAAA,CAAA,GAAA,CAAA;AACH,EACF,EAAE"}
@@ -14,9 +14,11 @@ export declare function DropdownMenu({ open, defaultOpen, onOpenChange, children
14
14
  export declare function DropdownMenuTrigger({ onPress, accessibilityState, ...props }: ButtonProps): import("react").JSX.Element;
15
15
  export interface DropdownMenuContentProps {
16
16
  children?: ReactNode;
17
+ /** The native sheet has finished dismissing, including its closing animation. */
18
+ onDismiss?: () => void;
17
19
  }
18
20
  /** The action list, in a bottom sheet. */
19
- export declare function DropdownMenuContent({ children }: DropdownMenuContentProps): import("react").JSX.Element;
21
+ export declare function DropdownMenuContent({ children, onDismiss }: DropdownMenuContentProps): import("react").JSX.Element;
20
22
  export interface DropdownMenuPartProps extends Omit<ViewProps, 'children' | 'style'> {
21
23
  children?: ReactNode;
22
24
  style?: StyleProp<ViewStyle>;
@@ -1 +1 @@
1
- {"version":3,"file":"DropdownMenu.d.mts","names":[],"sources":["../../src/components/DropdownMenu.tsx"],"mappings":";;;;iBAyCiB;;EAEf;EACA;EACA,gBAAgB;EAChB,WAAW;;wBAGG,eAAe,MAAM,aAAqB,cAAc,YAAY,oCAAiB,IAAA;;wBAMrF,sBAAsB,SAAS,uBAAuB,SAAS,8BAAW,IAAA;iBAczE;EACf,WAAW;;;wBAIG,sBAAsB,YAAY,2CAAwB,IAAA;iBAWzD,8BAA8B,KAAK;EAClD,WAAW;EACX,QAAQ,UAAU;;;wBAIJ,oBAAoB,aAAa,SAAS,wCAAqB,IAAA;YAInE;iBAEK;EACf,UAAU;;EAEV;EACA;;EAEA;;EAEA,WAAW;EACX,QAAQ,UAAU;;wBA8CJ,iBAAiB,OAAO,wCAAqB,IAAA;iBAI5C,sCAAsC,KAAK;EAC1D;EACA,mBAAmB;;;wBAIL,2BACd,SACA,iBACA,aACG,SACF,gDAA6B,IAAA;iBAef,oCAAoC;EACnD;EACA,iBAAiB;;;wBAIH,yBAAyB,OAAO,eAAe,aAAa,SAAS,8CAA2B,IAAA;iBAU/F,mCAAmC,KAAK;EACvD;;wBAGc,wBAAwB,OAAO,aAAa,SAAS,6CAA0B,IAAA;;wBAkB/E,oBAAoB,OAAO,aAAa,SAAS,4BAAS,IAAA;;wBAU1D,uBAAuB,UAAU,SAAS,4BAAS,IAAA;wBAInD,wBAAwB;EAAW,QAAQ,UAAU;oBAAY,IAAA"}
1
+ {"version":3,"file":"DropdownMenu.d.mts","names":[],"sources":["../../src/components/DropdownMenu.tsx"],"mappings":";;;;iBAyCiB;;EAEf;EACA;EACA,gBAAgB;EAChB,WAAW;;wBAGG,eAAe,MAAM,aAAqB,cAAc,YAAY,oCAAiB,IAAA;;wBAOrF,sBAAsB,SAAS,uBAAuB,SAAS,8BAAW,IAAA;iBAczE;EACf,WAAW;;EAEX;;;wBAIc,sBAAsB,UAAU,aAAa,2CAAwB,IAAA;iBAepE,8BAA8B,KAAK;EAClD,WAAW;EACX,QAAQ,UAAU;;;wBAIJ,oBAAoB,aAAa,SAAS,wCAAqB,IAAA;YAInE;iBAEK;EACf,UAAU;;EAEV;EACA;;EAEA;;EAEA,WAAW;EACX,QAAQ,UAAU;;wBA8CJ,iBAAiB,OAAO,wCAAqB,IAAA;iBAI5C,sCAAsC,KAAK;EAC1D;EACA,mBAAmB;;;wBAIL,2BACd,SACA,iBACA,aACG,SACF,gDAA6B,IAAA;iBAef,oCAAoC;EACnD;EACA,iBAAiB;;;wBAIH,yBAAyB,OAAO,eAAe,aAAa,SAAS,8CAA2B,IAAA;iBAU/F,mCAAmC,KAAK;EACvD;;wBAGc,wBAAwB,OAAO,aAAa,SAAS,6CAA0B,IAAA;;wBAkB/E,oBAAoB,OAAO,aAAa,SAAS,4BAAS,IAAA;;wBAU1D,uBAAuB,UAAU,SAAS,4BAAS,IAAA;wBAInD,wBAAwB;EAAW,QAAQ,UAAU;oBAAY,IAAA"}
@@ -1,14 +1,14 @@
1
1
  import { fontOf } from "../lib/fonts.mjs";
2
- import { wrapText } from "../lib/wrapText.mjs";
3
2
  import { selectionTick } from "../lib/haptics.mjs";
3
+ import { wrapText } from "../lib/wrapText.mjs";
4
4
  import { Button } from "./Button.mjs";
5
5
  import { CheckIcon } from "../icons/icons.mjs";
6
6
  import { useControllable } from "../lib/useControllable.mjs";
7
7
  import { SheetFrame } from "./SheetFrame.mjs";
8
8
  import { View } from "react-native-unistyles/components/native/View";
9
- import { StyleSheet } from "react-native-unistyles";
10
9
  import { Text } from "react-native-unistyles/components/native/Text";
11
- import { createContext, useContext } from "react";
10
+ import { StyleSheet } from "react-native-unistyles";
11
+ import { createContext, useCallback, useContext, useMemo } from "react";
12
12
  import { jsx, jsxs } from "react/jsx-runtime";
13
13
  import { Pressable } from "react-native-unistyles/components/native/Pressable";
14
14
 
@@ -28,11 +28,12 @@ const RadioContext = createContext({
28
28
  });
29
29
  function DropdownMenu({ open, defaultOpen = false, onOpenChange, children }) {
30
30
  const [current, setOpen] = useControllable(open, defaultOpen, onOpenChange);
31
+ const value = useMemo(() => ({
32
+ open: current,
33
+ setOpen
34
+ }), [current, setOpen]);
31
35
  return /* @__PURE__ */ jsx(MenuContext.Provider, {
32
- value: {
33
- open: current,
34
- setOpen
35
- },
36
+ value,
36
37
  children
37
38
  });
38
39
  }
@@ -52,15 +53,21 @@ function DropdownMenuTrigger({ onPress, accessibilityState, ...props }) {
52
53
  });
53
54
  }
54
55
  /** The action list, in a bottom sheet. */
55
- function DropdownMenuContent({ children }) {
56
- const { open, setOpen } = useContext(MenuContext);
56
+ function DropdownMenuContent({ children, onDismiss }) {
57
+ const menu = useContext(MenuContext);
58
+ const { open, setOpen } = menu;
59
+ const close = useCallback(() => setOpen(false), [setOpen]);
57
60
  return /* @__PURE__ */ jsx(SheetFrame, {
58
61
  open,
59
- onClose: () => setOpen(false),
60
- children: /* @__PURE__ */ jsx(View, {
61
- accessibilityRole: "menu",
62
- style: styles.content,
63
- children
62
+ onClose: close,
63
+ onDismiss,
64
+ children: /* @__PURE__ */ jsx(MenuContext.Provider, {
65
+ value: menu,
66
+ children: /* @__PURE__ */ jsx(View, {
67
+ accessibilityRole: "menu",
68
+ style: styles.content,
69
+ children
70
+ })
64
71
  })
65
72
  });
66
73
  }
@@ -1 +1 @@
1
- {"version":3,"file":"DropdownMenu.mjs","names":["createContext","ReactNode","useContext","StyleProp","TextProps","ViewProps","ViewStyle","StyleSheet","CheckIcon","fontOf","selectionTick","useControllable","wrapText","Button","ButtonProps","SheetFrame","INDICATOR_GUTTER","MIN_ROW_HEIGHT","DISABLED_OPACITY","RADIO_DOT","MenuState","open","setOpen","MenuContext","undefined","RadioState","value","onValueChange","RadioContext","DropdownMenuProps","defaultOpen","onOpenChange","children","DropdownMenu","current","DropdownMenuTrigger","onPress","accessibilityState","props","expanded","event","DropdownMenuContentProps","DropdownMenuContent","styles","content","DropdownMenuPartProps","Omit","style","DropdownMenuGroup","DropdownMenuItemVariant","DropdownMenuItemProps","variant","indented","disabled","onSelect","ItemRowProps","role","checked","indicator","ItemRow","_styles","useVariants","pressed","item","label","DropdownMenuItem","DropdownMenuCheckboxItemProps","onCheckedChange","DropdownMenuCheckboxItem","DropdownMenuRadioGroupProps","DropdownMenuRadioGroup","DropdownMenuRadioItemProps","DropdownMenuRadioItem","radio","radioDot","DropdownMenuLabel","charAt","toUpperCase","slice","menuLabel","DropdownMenuShortcut","shortcut","DropdownMenuSeparator","separator","create","theme","paddingVertical","spacing","uni__dependencies","flexDirection","alignItems","gap","minHeight","paddingHorizontal","paddingLeft","position","left","width","height","justifyContent","borderRadius","full","backgroundColor","colors","blue","deep","opacity","flexShrink","fontFamily","sans","fontSize","base","lineHeight","variants","default","color","hi","destructive","red","dim","sm","fontWeight","semibold","marginLeft","marginVertical"],"sources":["../../src/components/DropdownMenu.tsx"],"sourcesContent":["import { createContext, type ReactNode, useContext } from 'react';\nimport { Pressable, type StyleProp, Text, type TextProps, View, type ViewProps, type ViewStyle } from 'react-native';\nimport { StyleSheet } from 'react-native-unistyles';\n\nimport { CheckIcon } from '../icons/icons';\nimport { fontOf } from '../lib/fonts';\nimport { selectionTick } from '../lib/haptics';\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 DropdownMenu as an action sheet: the same items rise in a bottom\n * sheet, each a full-width 44pt row, choosing one ticks once and closes the\n * menu, and destructive rows are red.\n *\n * ponytail: submenus are not ported; a native action list nests by opening a\n * second menu from an item.\n */\n\n/** A row that carries a check or bullet keeps a gutter for it, so labels line up whether or not one is set. */\nconst INDICATOR_GUTTER = 28;\nconst MIN_ROW_HEIGHT = 44;\nconst DISABLED_OPACITY = 0.4;\nconst RADIO_DOT = 6;\n\ninterface MenuState {\n open: boolean;\n setOpen: (open: boolean) => void;\n}\n\nconst MenuContext = createContext<MenuState>({ open: false, setOpen: () => undefined });\n\ninterface RadioState {\n value: string | undefined;\n onValueChange: ((value: string) => void) | undefined;\n}\n\nconst RadioContext = createContext<RadioState>({ value: undefined, onValueChange: undefined });\n\nexport interface DropdownMenuProps {\n /** Controlled mode; pair with onOpenChange. Omit it and the menu keeps its own state. */\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n children?: ReactNode;\n}\n\nexport function DropdownMenu({ open, defaultOpen = false, onOpenChange, children }: DropdownMenuProps) {\n const [current, setOpen] = useControllable(open, defaultOpen, onOpenChange);\n return <MenuContext.Provider value={{ open: current, setOpen }}>{children}</MenuContext.Provider>;\n}\n\n/** A Button that opens the menu; announces that it opens a menu. */\nexport function DropdownMenuTrigger({ onPress, accessibilityState, ...props }: ButtonProps) {\n const { open, setOpen } = useContext(MenuContext);\n return (\n <Button\n accessibilityState={{ ...accessibilityState, expanded: open }}\n onPress={(event) => {\n onPress?.(event);\n setOpen(true);\n }}\n {...props}\n />\n );\n}\n\nexport interface DropdownMenuContentProps {\n children?: ReactNode;\n}\n\n/** The action list, in a bottom sheet. */\nexport function DropdownMenuContent({ children }: DropdownMenuContentProps) {\n const { open, setOpen } = useContext(MenuContext);\n return (\n <SheetFrame open={open} onClose={() => setOpen(false)}>\n <View accessibilityRole=\"menu\" style={styles.content}>\n {children}\n </View>\n </SheetFrame>\n );\n}\n\nexport interface DropdownMenuPartProps extends Omit<ViewProps, 'children' | 'style'> {\n children?: ReactNode;\n style?: StyleProp<ViewStyle>;\n}\n\n/** A run of items under one label, so the separator between groups is structural. */\nexport function DropdownMenuGroup({ children, ...props }: DropdownMenuPartProps) {\n return <View {...props}>{children}</View>;\n}\n\nexport type DropdownMenuItemVariant = 'default' | 'destructive';\n\nexport interface DropdownMenuItemProps {\n variant?: DropdownMenuItemVariant;\n /** Keep the indicator gutter, so the label lines up with checkbox and radio rows. */\n indented?: boolean;\n disabled?: boolean;\n /** Chosen: the menu ticks, runs this, then closes. */\n onSelect?: () => void;\n /** The label, optionally followed by a DropdownMenuShortcut. */\n children?: ReactNode;\n style?: StyleProp<ViewStyle>;\n}\n\ninterface ItemRowProps extends DropdownMenuItemProps {\n role: 'menuitem' | 'checkbox' | 'radio';\n checked?: boolean;\n indicator?: ReactNode;\n}\n\nfunction ItemRow({\n variant = 'default',\n indented = false,\n disabled = false,\n onSelect,\n role,\n checked,\n indicator,\n children,\n style,\n}: ItemRowProps) {\n const { setOpen } = useContext(MenuContext);\n styles.useVariants({ variant: variant === 'destructive' ? 'destructive' : undefined });\n return (\n <Pressable\n accessibilityRole={role}\n accessibilityState={{ disabled, checked }}\n disabled={disabled}\n onPress={() => {\n selectionTick();\n onSelect?.();\n setOpen(false);\n }}\n style={({ pressed }) => [\n styles.item,\n (indented || indicator !== undefined) && styles.indented,\n pressed && styles.pressed,\n disabled && styles.disabled,\n style,\n ]}\n >\n {indicator !== undefined ? <View style={styles.indicator}>{indicator}</View> : null}\n {wrapText(children, styles.label)}\n </Pressable>\n );\n}\n\nexport function DropdownMenuItem(props: DropdownMenuItemProps) {\n return <ItemRow role=\"menuitem\" {...props} />;\n}\n\nexport interface DropdownMenuCheckboxItemProps extends Omit<DropdownMenuItemProps, 'indented'> {\n checked?: boolean;\n onCheckedChange?: (checked: boolean) => void;\n}\n\n/** A row that toggles: the check lives in the gutter so the label never shifts. */\nexport function DropdownMenuCheckboxItem({\n checked = false,\n onCheckedChange,\n onSelect,\n ...props\n}: DropdownMenuCheckboxItemProps) {\n return (\n <ItemRow\n role=\"checkbox\"\n checked={checked}\n indicator={checked ? <CheckIcon size={12} color=\"blue\" /> : null}\n onSelect={() => {\n onCheckedChange?.(!checked);\n onSelect?.();\n }}\n {...props}\n />\n );\n}\n\nexport interface DropdownMenuRadioGroupProps extends DropdownMenuPartProps {\n value?: string;\n onValueChange?: (value: string) => void;\n}\n\n/** The exclusive-choice group; pair it with DropdownMenuRadioItem. */\nexport function DropdownMenuRadioGroup({ value, onValueChange, children, ...props }: DropdownMenuRadioGroupProps) {\n return (\n <RadioContext.Provider value={{ value, onValueChange }}>\n <View accessibilityRole=\"radiogroup\" {...props}>\n {children}\n </View>\n </RadioContext.Provider>\n );\n}\n\nexport interface DropdownMenuRadioItemProps extends Omit<DropdownMenuItemProps, 'indented'> {\n value: string;\n}\n\nexport function DropdownMenuRadioItem({ value, onSelect, ...props }: DropdownMenuRadioItemProps) {\n const radio = useContext(RadioContext);\n const checked = radio.value === value;\n return (\n <ItemRow\n role=\"radio\"\n checked={checked}\n indicator={checked ? <View style={styles.radioDot} /> : null}\n onSelect={() => {\n radio.onValueChange?.(value);\n onSelect?.();\n }}\n {...props}\n />\n );\n}\n\n/** The heading over a run of items, raised to sentence case as the web's `first-letter:uppercase`. */\nexport function DropdownMenuLabel({ style, children, ...props }: TextProps) {\n const label = typeof children === 'string' ? children.charAt(0).toUpperCase() + children.slice(1) : children;\n return (\n <Text accessibilityRole=\"header\" style={[styles.menuLabel, style]} {...props}>\n {label}\n </Text>\n );\n}\n\n/** The keystroke printed at the right of a row; the row supplies the gap. */\nexport function DropdownMenuShortcut({ style, ...props }: TextProps) {\n return <Text style={[styles.shortcut, style]} {...props} />;\n}\n\nexport function DropdownMenuSeparator({ style }: { style?: StyleProp<ViewStyle> }) {\n return <View accessible={false} style={[styles.separator, style]} />;\n}\n\nconst styles = StyleSheet.create((theme) => ({\n content: { paddingVertical: theme.spacing(1) },\n item: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: theme.spacing(2),\n minHeight: MIN_ROW_HEIGHT,\n paddingHorizontal: theme.spacing(4),\n },\n indented: { paddingLeft: theme.spacing(4) + INDICATOR_GUTTER },\n indicator: {\n position: 'absolute',\n left: theme.spacing(4),\n width: theme.spacing(3),\n height: theme.spacing(3),\n alignItems: 'center',\n justifyContent: 'center',\n },\n radioDot: {\n width: RADIO_DOT,\n height: RADIO_DOT,\n borderRadius: theme.borderRadius.full,\n backgroundColor: theme.colors.blue,\n },\n pressed: { backgroundColor: theme.colors.deep },\n disabled: { opacity: DISABLED_OPACITY },\n label: {\n flexShrink: 1,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.base,\n lineHeight: theme.lineHeight.base,\n variants: {\n variant: {\n default: { color: theme.colors.hi },\n destructive: { color: theme.colors.red },\n },\n },\n },\n menuLabel: {\n paddingHorizontal: theme.spacing(4),\n paddingVertical: theme.spacing(1),\n color: theme.colors.dim,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeight.sm,\n fontWeight: theme.fontWeight.semibold,\n },\n shortcut: {\n marginLeft: 'auto',\n flexShrink: 0,\n color: theme.colors.dim,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeight.sm,\n },\n separator: { height: 1, marginVertical: theme.spacing(1), backgroundColor: theme.colors['border-soft'] },\n}));\n"],"mappings":";;;;;;;;;;;;;;;;AAsBA,MAAMgB,mBAAmB;AACzB,MAAMC,iBAAiB;AACvB,MAAMC,mBAAmB;AACzB,MAAMC,YAAY;AAOlB,MAAMI,cAAcvB,cAAyB;CAAEqB,MAAM;CAAOC,eAAeE;AAAU,CAAC;AAOtF,MAAMI,eAAe5B,cAA0B;CAAE0B,OAAOF;CAAWG,eAAeH;AAAU,CAAC;AAU7F,SAAgBS,aAAa,EAAEZ,MAAMS,cAAc,OAAOC,cAAcC,YAA+B;CACrG,MAAM,CAACE,SAASZ,WAAWX,gBAAgBU,MAAMS,aAAaC,YAAY;CAC1E,OAAO,oBAAC,YAAY,UAAb;EAAsB,OAAO;GAAEV,MAAMa;GAASZ;EAAQ;EAAIU;CAA+B;AAClG;;AAGA,SAAgBG,oBAAoB,EAAEC,SAASC,oBAAoB,GAAGC,SAAsB;CAC1F,MAAM,EAAEjB,MAAMC,YAAYpB,WAAWqB,WAAW;CAChD,OACE,oBAAC,QAAD;EACE,oBAAoB;GAAE,GAAGc;GAAoBE,UAAUlB;EAAK;EAC5D,UAAUmB,UAAU;GAClBJ,UAAUI,KAAK;GACflB,QAAQ,IAAI;EACd;EACA,GAAIgB;CAAM;AAGhB;;AAOA,SAAgBI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,MAAME,QAAQ,CAAC;EAChC4B,OAAO9B,MAAMkB,OAAOgB;EACpBX,YAAYnG,OAAO4E,MAAMuB,WAAWC,IAAI;EACxCC,UAAUzB,MAAMyB,SAASU;EACzBR,YAAY3B,MAAM2B,WAAWQ;EAC7BC,YAAYpC,MAAMoC,WAAWC;EAAQlC,mBAAA,CAAA,CAAA;CACvC;CACAP,UAAU;EACR0C,YAAY;EACZhB,YAAY;EACZQ,OAAO9B,MAAMkB,OAAOgB;EACpBX,YAAYnG,OAAO4E,MAAMuB,WAAWC,IAAI;EACxCC,UAAUzB,MAAMyB,SAASU;EACzBR,YAAY3B,MAAM2B,WAAWQ;EAAEhC,mBAAA,CAAA,CAAA;CACjC;CACAL,WAAW;EAAEe,QAAQ;EAAG0B,gBAAgBvC,MAAME,QAAQ,CAAC;EAAGe,iBAAiBjB,MAAMkB,OAAO;EAAcf,mBAAA,CAAA,CAAA;CAAC;AACzG,EAAE"}
1
+ {"version":3,"file":"DropdownMenu.mjs","names":["createContext","ReactNode","useCallback","useContext","useMemo","StyleProp","TextProps","ViewProps","ViewStyle","StyleSheet","CheckIcon","fontOf","selectionTick","useControllable","wrapText","Button","ButtonProps","SheetFrame","INDICATOR_GUTTER","MIN_ROW_HEIGHT","DISABLED_OPACITY","RADIO_DOT","MenuState","open","setOpen","MenuContext","undefined","RadioState","value","onValueChange","RadioContext","DropdownMenuProps","defaultOpen","onOpenChange","children","DropdownMenu","current","DropdownMenuTrigger","onPress","accessibilityState","props","expanded","event","DropdownMenuContentProps","onDismiss","DropdownMenuContent","menu","close","styles","content","DropdownMenuPartProps","Omit","style","DropdownMenuGroup","DropdownMenuItemVariant","DropdownMenuItemProps","variant","indented","disabled","onSelect","ItemRowProps","role","checked","indicator","ItemRow","_styles","useVariants","pressed","item","label","DropdownMenuItem","DropdownMenuCheckboxItemProps","onCheckedChange","DropdownMenuCheckboxItem","DropdownMenuRadioGroupProps","DropdownMenuRadioGroup","DropdownMenuRadioItemProps","DropdownMenuRadioItem","radio","radioDot","DropdownMenuLabel","charAt","toUpperCase","slice","menuLabel","DropdownMenuShortcut","shortcut","DropdownMenuSeparator","separator","create","theme","paddingVertical","spacing","uni__dependencies","flexDirection","alignItems","gap","minHeight","paddingHorizontal","paddingLeft","position","left","width","height","justifyContent","borderRadius","full","backgroundColor","colors","blue","deep","opacity","flexShrink","fontFamily","sans","fontSize","base","lineHeight","variants","default","color","hi","destructive","red","dim","sm","fontWeight","semibold","marginLeft","marginVertical"],"sources":["../../src/components/DropdownMenu.tsx"],"sourcesContent":["import { createContext, type ReactNode, useCallback, useContext, useMemo } from 'react';\nimport { Pressable, type StyleProp, Text, type TextProps, View, type ViewProps, type ViewStyle } from 'react-native';\nimport { StyleSheet } from 'react-native-unistyles';\n\nimport { CheckIcon } from '../icons/icons';\nimport { fontOf } from '../lib/fonts';\nimport { selectionTick } from '../lib/haptics';\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 DropdownMenu as an action sheet: the same items rise in a bottom\n * sheet, each a full-width 44pt row, choosing one ticks once and closes the\n * menu, and destructive rows are red.\n *\n * ponytail: submenus are not ported; a native action list nests by opening a\n * second menu from an item.\n */\n\n/** A row that carries a check or bullet keeps a gutter for it, so labels line up whether or not one is set. */\nconst INDICATOR_GUTTER = 28;\nconst MIN_ROW_HEIGHT = 44;\nconst DISABLED_OPACITY = 0.4;\nconst RADIO_DOT = 6;\n\ninterface MenuState {\n open: boolean;\n setOpen: (open: boolean) => void;\n}\n\nconst MenuContext = createContext<MenuState>({ open: false, setOpen: () => undefined });\n\ninterface RadioState {\n value: string | undefined;\n onValueChange: ((value: string) => void) | undefined;\n}\n\nconst RadioContext = createContext<RadioState>({ value: undefined, onValueChange: undefined });\n\nexport interface DropdownMenuProps {\n /** Controlled mode; pair with onOpenChange. Omit it and the menu keeps its own state. */\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n children?: ReactNode;\n}\n\nexport function DropdownMenu({ open, defaultOpen = false, onOpenChange, children }: DropdownMenuProps) {\n const [current, setOpen] = useControllable(open, defaultOpen, onOpenChange);\n const value = useMemo(() => ({ open: current, setOpen }), [current, setOpen]);\n return <MenuContext.Provider value={value}>{children}</MenuContext.Provider>;\n}\n\n/** A Button that opens the menu; announces that it opens a menu. */\nexport function DropdownMenuTrigger({ onPress, accessibilityState, ...props }: ButtonProps) {\n const { open, setOpen } = useContext(MenuContext);\n return (\n <Button\n accessibilityState={{ ...accessibilityState, expanded: open }}\n onPress={(event) => {\n onPress?.(event);\n setOpen(true);\n }}\n {...props}\n />\n );\n}\n\nexport interface DropdownMenuContentProps {\n children?: ReactNode;\n /** The native sheet has finished dismissing, including its closing animation. */\n onDismiss?: () => void;\n}\n\n/** The action list, in a bottom sheet. */\nexport function DropdownMenuContent({ children, onDismiss }: DropdownMenuContentProps) {\n const menu = useContext(MenuContext);\n const { open, setOpen } = menu;\n const close = useCallback(() => setOpen(false), [setOpen]);\n return (\n <SheetFrame open={open} onClose={close} onDismiss={onDismiss}>\n <MenuContext.Provider value={menu}>\n <View accessibilityRole=\"menu\" style={styles.content}>\n {children}\n </View>\n </MenuContext.Provider>\n </SheetFrame>\n );\n}\n\nexport interface DropdownMenuPartProps extends Omit<ViewProps, 'children' | 'style'> {\n children?: ReactNode;\n style?: StyleProp<ViewStyle>;\n}\n\n/** A run of items under one label, so the separator between groups is structural. */\nexport function DropdownMenuGroup({ children, ...props }: DropdownMenuPartProps) {\n return <View {...props}>{children}</View>;\n}\n\nexport type DropdownMenuItemVariant = 'default' | 'destructive';\n\nexport interface DropdownMenuItemProps {\n variant?: DropdownMenuItemVariant;\n /** Keep the indicator gutter, so the label lines up with checkbox and radio rows. */\n indented?: boolean;\n disabled?: boolean;\n /** Chosen: the menu ticks, runs this, then closes. */\n onSelect?: () => void;\n /** The label, optionally followed by a DropdownMenuShortcut. */\n children?: ReactNode;\n style?: StyleProp<ViewStyle>;\n}\n\ninterface ItemRowProps extends DropdownMenuItemProps {\n role: 'menuitem' | 'checkbox' | 'radio';\n checked?: boolean;\n indicator?: ReactNode;\n}\n\nfunction ItemRow({\n variant = 'default',\n indented = false,\n disabled = false,\n onSelect,\n role,\n checked,\n indicator,\n children,\n style,\n}: ItemRowProps) {\n const { setOpen } = useContext(MenuContext);\n styles.useVariants({ variant: variant === 'destructive' ? 'destructive' : undefined });\n return (\n <Pressable\n accessibilityRole={role}\n accessibilityState={{ disabled, checked }}\n disabled={disabled}\n onPress={() => {\n selectionTick();\n onSelect?.();\n setOpen(false);\n }}\n style={({ pressed }) => [\n styles.item,\n (indented || indicator !== undefined) && styles.indented,\n pressed && styles.pressed,\n disabled && styles.disabled,\n style,\n ]}\n >\n {indicator !== undefined ? <View style={styles.indicator}>{indicator}</View> : null}\n {wrapText(children, styles.label)}\n </Pressable>\n );\n}\n\nexport function DropdownMenuItem(props: DropdownMenuItemProps) {\n return <ItemRow role=\"menuitem\" {...props} />;\n}\n\nexport interface DropdownMenuCheckboxItemProps extends Omit<DropdownMenuItemProps, 'indented'> {\n checked?: boolean;\n onCheckedChange?: (checked: boolean) => void;\n}\n\n/** A row that toggles: the check lives in the gutter so the label never shifts. */\nexport function DropdownMenuCheckboxItem({\n checked = false,\n onCheckedChange,\n onSelect,\n ...props\n}: DropdownMenuCheckboxItemProps) {\n return (\n <ItemRow\n role=\"checkbox\"\n checked={checked}\n indicator={checked ? <CheckIcon size={12} color=\"blue\" /> : null}\n onSelect={() => {\n onCheckedChange?.(!checked);\n onSelect?.();\n }}\n {...props}\n />\n );\n}\n\nexport interface DropdownMenuRadioGroupProps extends DropdownMenuPartProps {\n value?: string;\n onValueChange?: (value: string) => void;\n}\n\n/** The exclusive-choice group; pair it with DropdownMenuRadioItem. */\nexport function DropdownMenuRadioGroup({ value, onValueChange, children, ...props }: DropdownMenuRadioGroupProps) {\n return (\n <RadioContext.Provider value={{ value, onValueChange }}>\n <View accessibilityRole=\"radiogroup\" {...props}>\n {children}\n </View>\n </RadioContext.Provider>\n );\n}\n\nexport interface DropdownMenuRadioItemProps extends Omit<DropdownMenuItemProps, 'indented'> {\n value: string;\n}\n\nexport function DropdownMenuRadioItem({ value, onSelect, ...props }: DropdownMenuRadioItemProps) {\n const radio = useContext(RadioContext);\n const checked = radio.value === value;\n return (\n <ItemRow\n role=\"radio\"\n checked={checked}\n indicator={checked ? <View style={styles.radioDot} /> : null}\n onSelect={() => {\n radio.onValueChange?.(value);\n onSelect?.();\n }}\n {...props}\n />\n );\n}\n\n/** The heading over a run of items, raised to sentence case as the web's `first-letter:uppercase`. */\nexport function DropdownMenuLabel({ style, children, ...props }: TextProps) {\n const label = typeof children === 'string' ? children.charAt(0).toUpperCase() + children.slice(1) : children;\n return (\n <Text accessibilityRole=\"header\" style={[styles.menuLabel, style]} {...props}>\n {label}\n </Text>\n );\n}\n\n/** The keystroke printed at the right of a row; the row supplies the gap. */\nexport function DropdownMenuShortcut({ style, ...props }: TextProps) {\n return <Text style={[styles.shortcut, style]} {...props} />;\n}\n\nexport function DropdownMenuSeparator({ style }: { style?: StyleProp<ViewStyle> }) {\n return <View accessible={false} style={[styles.separator, style]} />;\n}\n\nconst styles = StyleSheet.create((theme) => ({\n content: { paddingVertical: theme.spacing(1) },\n item: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: theme.spacing(2),\n minHeight: MIN_ROW_HEIGHT,\n paddingHorizontal: theme.spacing(4),\n },\n indented: { paddingLeft: theme.spacing(4) + INDICATOR_GUTTER },\n indicator: {\n position: 'absolute',\n left: theme.spacing(4),\n width: theme.spacing(3),\n height: theme.spacing(3),\n alignItems: 'center',\n justifyContent: 'center',\n },\n radioDot: {\n width: RADIO_DOT,\n height: RADIO_DOT,\n borderRadius: theme.borderRadius.full,\n backgroundColor: theme.colors.blue,\n },\n pressed: { backgroundColor: theme.colors.deep },\n disabled: { opacity: DISABLED_OPACITY },\n label: {\n flexShrink: 1,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.base,\n lineHeight: theme.lineHeight.base,\n variants: {\n variant: {\n default: { color: theme.colors.hi },\n destructive: { color: theme.colors.red },\n },\n },\n },\n menuLabel: {\n paddingHorizontal: theme.spacing(4),\n paddingVertical: theme.spacing(1),\n color: theme.colors.dim,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeight.sm,\n fontWeight: theme.fontWeight.semibold,\n },\n shortcut: {\n marginLeft: 'auto',\n flexShrink: 0,\n color: theme.colors.dim,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeight.sm,\n },\n separator: { height: 1, marginVertical: theme.spacing(1), backgroundColor: theme.colors['border-soft'] },\n}));\n"],"mappings":";;;;;;;;;;;;;;;;AAsBA,MAAMkB,mBAAmB;AACzB,MAAMC,iBAAiB;AACvB,MAAMC,mBAAmB;AACzB,MAAMC,YAAY;AAOlB,MAAMI,cAAczB,cAAyB;CAAEuB,MAAM;CAAOC,eAAeE;AAAU,CAAC;AAOtF,MAAMI,eAAe9B,cAA0B;CAAE4B,OAAOF;CAAWG,eAAeH;AAAU,CAAC;AAU7F,SAAgBS,aAAa,EAAEZ,MAAMS,cAAc,OAAOC,cAAcC,YAA+B;CACrG,MAAM,CAACE,SAASZ,WAAWX,gBAAgBU,MAAMS,aAAaC,YAAY;CAC1E,MAAML,QAAQxB,eAAe;EAAEmB,MAAMa;EAASZ;CAAQ,IAAI,CAACY,SAASZ,OAAO,CAAC;CAC5E,OAAO,oBAAC,YAAY,UAAb;EAA6BI;EAAQM;CAA+B;AAC7E;;AAGA,SAAgBG,oBAAoB,EAAEC,SAASC,oBAAoB,GAAGC,SAAsB;CAC1F,MAAM,EAAEjB,MAAMC,YAAYrB,WAAWsB,WAAW;CAChD,OACE,oBAAC,QAAD;EACE,oBAAoB;GAAE,GAAGc;GAAoBE,UAAUlB;EAAK;EAC5D,UAAUmB,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AC7BE,UAAU,EACR9D,SAAS;GACP+D,SAAS,EAAEC,OAAO9B,MAAMkB,OAAOa,GAAG;GAClCC,aAAa,EAAEF,OAAO9B,MAAMkB,OAAOe,IAAI;EACzC,EACF;EAAC9B,mBAAA,CAAA,GAAA,CAAA;CACH;CACAT,WAAW;EACTc,mBAAmBR,MAAME,QAAQ,CAAC;EAClCD,iBAAiBD,MAAME,QAAQ,CAAC;EAChC4B,OAAO9B,MAAMkB,OAAOgB;EACpBX,YAAYtG,OAAO+E,MAAMuB,WAAWC,IAAI;EACxCC,UAAUzB,MAAMyB,SAASU;EACzBR,YAAY3B,MAAM2B,WAAWQ;EAC7BC,YAAYpC,MAAMoC,WAAWC;EAAQlC,mBAAA,CAAA,CAAA;CACvC;CACAP,UAAU;EACR0C,YAAY;EACZhB,YAAY;EACZQ,OAAO9B,MAAMkB,OAAOgB;EACpBX,YAAYtG,OAAO+E,MAAMuB,WAAWC,IAAI;EACxCC,UAAUzB,MAAMyB,SAASU;EACzBR,YAAY3B,MAAM2B,WAAWQ;EAAEhC,mBAAA,CAAA,CAAA;CACjC;CACAL,WAAW;EAAEe,QAAQ;EAAG0B,gBAAgBvC,MAAME,QAAQ,CAAC;EAAGe,iBAAiBjB,MAAMkB,OAAO;EAAcf,mBAAA,CAAA,CAAA;CAAC;AACzG,EAAE"}
@@ -1,14 +1,42 @@
1
1
  import { StyleProp, ViewStyle } from "react-native";
2
2
  import { ReactNode } from "react";
3
3
  //#region src/components/EmptyState.d.ts
4
+ /** One button an empty state offers: the next step that fills the surface. */
5
+ export interface EmptyStateAction {
6
+ label: string;
7
+ onAction: () => void;
8
+ loading?: boolean;
9
+ disabled?: boolean;
10
+ testId?: string;
11
+ }
12
+ export type EmptyStateSize = 'page' | 'panel' | 'compact' | 'inline';
4
13
  export interface EmptyStateProps {
5
14
  title: ReactNode;
15
+ /** Guidance: why the surface is empty and what fills it. */
6
16
  description?: ReactNode;
7
- /** Optional calls to action under the copy. */
17
+ /** A glyph from the icon set, drawn in a quiet badge above the title (beside it when compact). Defaults to an alert glyph when `tone` is `error`. */
18
+ icon?: ReactNode;
19
+ /** The one primary step. Filled jade on page and panel, outline when compact. */
20
+ action?: EmptyStateAction;
21
+ /** A quieter second step, such as clearing a filter or retrying. */
22
+ secondaryAction?: EmptyStateAction;
23
+ /**
24
+ * page: a whole screen. panel: a dock or tab (the default).
25
+ * compact: a list row; left-aligned and never takes `flex: 1`.
26
+ * inline: one quiet line under a header that already names the surface, such as an activity card.
27
+ * Drops the icon and frame; `surface` does not apply.
28
+ */
29
+ size?: EmptyStateSize;
30
+ /** `plain` drops the card border when the empty state already sits inside a card. */
31
+ surface?: 'card' | 'plain';
32
+ /** `error` announces the state as an alert and tints only the icon red. */
33
+ tone?: 'neutral' | 'error';
34
+ /** Anything under the actions: a hint, a status line. */
8
35
  children?: ReactNode;
9
36
  style?: StyleProp<ViewStyle>;
37
+ testID?: string;
10
38
  }
11
- /** The centred "nothing here yet" block every empty screen and panel shares. */
12
- export declare function EmptyState({ title, description, children, style }: EmptyStateProps): import("react").JSX.Element;
39
+ /** The card every empty screen and panel shares: icon, title, guidance and, when the person can act, the next step. */
40
+ export declare function EmptyState({ title, description, icon, action, secondaryAction, size, surface, tone, children, style, testID }: EmptyStateProps): import("react").JSX.Element;
13
41
  //#endregion
14
42
  //# sourceMappingURL=EmptyState.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EmptyState.d.mts","names":[],"sources":["../../src/components/EmptyState.tsx"],"mappings":";;;iBAOiB;EACf,OAAO;EACP,cAAc;;EAEd,WAAW;EACX,QAAQ,UAAU;;;wBAIJ,aAAa,OAAO,aAAa,UAAU,SAAS,kCAAe,IAAA"}
1
+ {"version":3,"file":"EmptyState.d.mts","names":[],"sources":["../../src/components/EmptyState.tsx"],"mappings":";;;;iBAWiB;EACf;EACA;EACA;EACA;EACA;;YAGU;iBAEK;EACf,OAAO;;EAEP,cAAc;;EAEd,OAAO;;EAEP,SAAS;;EAET,kBAAkB;;;;;;;EAOlB,OAAO;;EAEP;;EAEA;;EAEA,WAAW;EACX,QAAQ,UAAU;EAClB;;;wBAIc,aACd,OACA,aACA,MACA,QACA,iBACA,MACA,SACA,MACA,UACA,OACA,UACC,kCAAe,IAAA"}