@agimon-ai/po-native-components 0.0.0-alpha.21 → 0.0.0-alpha.210

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 (195) hide show
  1. package/LICENSE +21 -149
  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 +1 -1
  13. package/dist/components/Button.mjs +3 -3
  14. package/dist/components/Button.mjs.map +1 -1
  15. package/dist/components/CodeBlock.d.mts +3 -1
  16. package/dist/components/CodeBlock.d.mts.map +1 -1
  17. package/dist/components/CodeBlock.mjs +42 -47
  18. package/dist/components/CodeBlock.mjs.map +1 -1
  19. package/dist/components/ComputerRow.d.mts +15 -0
  20. package/dist/components/ComputerRow.d.mts.map +1 -0
  21. package/dist/components/ComputerRow.mjs +107 -0
  22. package/dist/components/ComputerRow.mjs.map +1 -0
  23. package/dist/components/CopyButton.d.mts +13 -0
  24. package/dist/components/CopyButton.d.mts.map +1 -0
  25. package/dist/components/CopyButton.mjs +49 -0
  26. package/dist/components/CopyButton.mjs.map +1 -0
  27. package/dist/components/CountBadge.d.mts +15 -0
  28. package/dist/components/CountBadge.d.mts.map +1 -0
  29. package/dist/components/CountBadge.mjs +49 -0
  30. package/dist/components/CountBadge.mjs.map +1 -0
  31. package/dist/components/CtaCard.d.mts +19 -0
  32. package/dist/components/CtaCard.d.mts.map +1 -0
  33. package/dist/components/CtaCard.mjs +92 -0
  34. package/dist/components/CtaCard.mjs.map +1 -0
  35. package/dist/components/Dialog.d.mts +2 -2
  36. package/dist/components/Dialog.d.mts.map +1 -1
  37. package/dist/components/Dialog.mjs +16 -10
  38. package/dist/components/Dialog.mjs.map +1 -1
  39. package/dist/components/Dot.d.mts +1 -1
  40. package/dist/components/Dot.mjs +2 -2
  41. package/dist/components/DropdownMenu.d.mts +3 -1
  42. package/dist/components/DropdownMenu.d.mts.map +1 -1
  43. package/dist/components/DropdownMenu.mjs +21 -14
  44. package/dist/components/DropdownMenu.mjs.map +1 -1
  45. package/dist/components/EmptyState.d.mts +31 -3
  46. package/dist/components/EmptyState.d.mts.map +1 -1
  47. package/dist/components/EmptyState.mjs +303 -29
  48. package/dist/components/EmptyState.mjs.map +1 -1
  49. package/dist/components/FileList.d.mts +48 -0
  50. package/dist/components/FileList.d.mts.map +1 -0
  51. package/dist/components/FileList.mjs +737 -0
  52. package/dist/components/FileList.mjs.map +1 -0
  53. package/dist/components/FilePreview.d.mts +33 -0
  54. package/dist/components/FilePreview.d.mts.map +1 -0
  55. package/dist/components/FilePreview.mjs +102 -0
  56. package/dist/components/FilePreview.mjs.map +1 -0
  57. package/dist/components/FileViewer.d.mts +57 -0
  58. package/dist/components/FileViewer.d.mts.map +1 -0
  59. package/dist/components/FileViewer.mjs +345 -0
  60. package/dist/components/FileViewer.mjs.map +1 -0
  61. package/dist/components/HashlineLines.d.mts +13 -0
  62. package/dist/components/HashlineLines.d.mts.map +1 -0
  63. package/dist/components/HashlineLines.mjs +153 -0
  64. package/dist/components/HashlineLines.mjs.map +1 -0
  65. package/dist/components/HostFilter.d.mts +17 -0
  66. package/dist/components/HostFilter.d.mts.map +1 -0
  67. package/dist/components/HostFilter.mjs +68 -0
  68. package/dist/components/HostFilter.mjs.map +1 -0
  69. package/dist/components/HostTag.d.mts +7 -0
  70. package/dist/components/HostTag.d.mts.map +1 -0
  71. package/dist/components/HostTag.mjs +48 -0
  72. package/dist/components/HostTag.mjs.map +1 -0
  73. package/dist/components/InfoStrip.d.mts +9 -0
  74. package/dist/components/InfoStrip.d.mts.map +1 -0
  75. package/dist/components/InfoStrip.mjs +53 -0
  76. package/dist/components/InfoStrip.mjs.map +1 -0
  77. package/dist/components/Input.d.mts +3 -1
  78. package/dist/components/Input.d.mts.map +1 -1
  79. package/dist/components/Input.mjs +4 -3
  80. package/dist/components/Input.mjs.map +1 -1
  81. package/dist/components/Label.mjs +1 -1
  82. package/dist/components/LinkText.d.mts +13 -0
  83. package/dist/components/LinkText.d.mts.map +1 -0
  84. package/dist/components/LinkText.mjs +32 -0
  85. package/dist/components/LinkText.mjs.map +1 -0
  86. package/dist/components/List.d.mts.map +1 -1
  87. package/dist/components/List.mjs +50 -11
  88. package/dist/components/List.mjs.map +1 -1
  89. package/dist/components/LiveDuration.d.mts +30 -0
  90. package/dist/components/LiveDuration.d.mts.map +1 -0
  91. package/dist/components/LiveDuration.mjs +67 -0
  92. package/dist/components/LiveDuration.mjs.map +1 -0
  93. package/dist/components/LoadingState.d.mts +17 -0
  94. package/dist/components/LoadingState.d.mts.map +1 -0
  95. package/dist/components/LoadingState.mjs +90 -0
  96. package/dist/components/LoadingState.mjs.map +1 -0
  97. package/dist/components/Markdown.d.mts +24 -2
  98. package/dist/components/Markdown.d.mts.map +1 -1
  99. package/dist/components/Markdown.mjs +356 -27
  100. package/dist/components/Markdown.mjs.map +1 -1
  101. package/dist/components/MessageItem.d.mts +10 -15
  102. package/dist/components/MessageItem.d.mts.map +1 -1
  103. package/dist/components/MessageItem.mjs +94 -68
  104. package/dist/components/MessageItem.mjs.map +1 -1
  105. package/dist/components/NativeShellState.d.mts +30 -0
  106. package/dist/components/NativeShellState.d.mts.map +1 -0
  107. package/dist/components/NativeShellState.mjs +61 -0
  108. package/dist/components/NativeShellState.mjs.map +1 -0
  109. package/dist/components/RailItem.d.mts +13 -0
  110. package/dist/components/RailItem.d.mts.map +1 -0
  111. package/dist/components/RailItem.mjs +61 -0
  112. package/dist/components/RailItem.mjs.map +1 -0
  113. package/dist/components/ReferenceChip.d.mts +18 -0
  114. package/dist/components/ReferenceChip.d.mts.map +1 -0
  115. package/dist/components/ReferenceChip.mjs +38 -0
  116. package/dist/components/ReferenceChip.mjs.map +1 -0
  117. package/dist/components/SectionLabel.mjs +1 -1
  118. package/dist/components/SeekBar.d.mts +17 -0
  119. package/dist/components/SeekBar.d.mts.map +1 -0
  120. package/dist/components/SeekBar.mjs +97 -0
  121. package/dist/components/SeekBar.mjs.map +1 -0
  122. package/dist/components/Select.d.mts +39 -0
  123. package/dist/components/Select.d.mts.map +1 -0
  124. package/dist/components/Select.mjs +288 -0
  125. package/dist/components/Select.mjs.map +1 -0
  126. package/dist/components/Sheet.d.mts +17 -2
  127. package/dist/components/Sheet.d.mts.map +1 -1
  128. package/dist/components/Sheet.mjs +34 -11
  129. package/dist/components/Sheet.mjs.map +1 -1
  130. package/dist/components/SheetFrame.mjs +149 -28
  131. package/dist/components/SheetFrame.mjs.map +1 -1
  132. package/dist/components/SheetList.d.mts +14 -0
  133. package/dist/components/SheetList.d.mts.map +1 -0
  134. package/dist/components/SheetList.mjs +34 -0
  135. package/dist/components/SheetList.mjs.map +1 -0
  136. package/dist/components/ShowMore.d.mts +10 -0
  137. package/dist/components/ShowMore.d.mts.map +1 -0
  138. package/dist/components/ShowMore.mjs +44 -0
  139. package/dist/components/ShowMore.mjs.map +1 -0
  140. package/dist/components/Spinner.d.mts +1 -1
  141. package/dist/components/StatusBadge.d.mts +1 -1
  142. package/dist/components/Switch.d.mts +14 -0
  143. package/dist/components/Switch.d.mts.map +1 -0
  144. package/dist/components/Switch.mjs +37 -0
  145. package/dist/components/Switch.mjs.map +1 -0
  146. package/dist/components/SyntaxLine.d.mts +19 -0
  147. package/dist/components/SyntaxLine.d.mts.map +1 -0
  148. package/dist/components/SyntaxLine.mjs +134 -0
  149. package/dist/components/SyntaxLine.mjs.map +1 -0
  150. package/dist/components/Tabs.d.mts.map +1 -1
  151. package/dist/components/Tabs.mjs +8 -7
  152. package/dist/components/Tabs.mjs.map +1 -1
  153. package/dist/components/ToolPathLink.d.mts +10 -0
  154. package/dist/components/ToolPathLink.d.mts.map +1 -0
  155. package/dist/components/ToolPathLink.mjs +42 -0
  156. package/dist/components/ToolPathLink.mjs.map +1 -0
  157. package/dist/components/ToolResultImage.d.mts +21 -0
  158. package/dist/components/ToolResultImage.d.mts.map +1 -0
  159. package/dist/components/ToolResultImage.mjs +60 -0
  160. package/dist/components/ToolResultImage.mjs.map +1 -0
  161. package/dist/icons/IconColorContext.d.mts +2 -1
  162. package/dist/icons/IconColorContext.d.mts.map +1 -1
  163. package/dist/icons/IconColorContext.mjs.map +1 -1
  164. package/dist/icons/iconGlyphs.d.mts +132 -0
  165. package/dist/icons/iconGlyphs.d.mts.map +1 -1
  166. package/dist/icons/iconGlyphs.mjs +132 -0
  167. package/dist/icons/iconGlyphs.mjs.map +1 -1
  168. package/dist/icons/icons.d.mts +133 -1
  169. package/dist/icons/icons.d.mts.map +1 -1
  170. package/dist/icons/icons.mjs +35 -2
  171. package/dist/icons/icons.mjs.map +1 -1
  172. package/dist/index.d.mts +31 -7
  173. package/dist/index.mjs +36 -12
  174. package/dist/lib/fileKindLabel.mjs +17 -0
  175. package/dist/lib/fileKindLabel.mjs.map +1 -0
  176. package/dist/lib/fonts.d.mts +3 -1
  177. package/dist/lib/fonts.d.mts.map +1 -1
  178. package/dist/lib/fonts.mjs +4 -2
  179. package/dist/lib/fonts.mjs.map +1 -1
  180. package/dist/lib/insideSheet.d.mts +10 -0
  181. package/dist/lib/insideSheet.d.mts.map +1 -0
  182. package/dist/lib/markdown.mjs +310 -23
  183. package/dist/lib/markdown.mjs.map +1 -1
  184. package/dist/lib/reading.mjs +60 -0
  185. package/dist/lib/reading.mjs.map +1 -0
  186. package/dist/lib/useControllable.mjs +14 -6
  187. package/dist/lib/useControllable.mjs.map +1 -1
  188. package/dist/lib/useReadingPage.mjs +33 -0
  189. package/dist/lib/useReadingPage.mjs.map +1 -0
  190. package/dist/po-runtime-identity.json +1 -0
  191. package/dist/shell.d.mts +6 -0
  192. package/dist/shell.mjs +7 -0
  193. package/locales/vi.json +112 -0
  194. package/locales/zh-CN.json +112 -0
  195. package/package.json +43 -30
@@ -1,61 +1,335 @@
1
1
  import { fontOf } from "../lib/fonts.mjs";
2
2
  import { wrapText } from "../lib/wrapText.mjs";
3
+ import { Button } from "./Button.mjs";
4
+ import { AlertIcon } from "../icons/icons.mjs";
3
5
  import { View } from "react-native-unistyles/components/native/View";
6
+ import { Text } from "react-native-unistyles/components/native/Text";
4
7
  import { StyleSheet } from "react-native-unistyles";
5
- import { jsx, jsxs } from "react/jsx-runtime";
8
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
9
+ import { IconColorContext } from "@agimon-ai/po-native-components/shell";
6
10
 
7
11
  //#region src/components/EmptyState.tsx
8
- /** The centred "nothing here yet" block every empty screen and panel shares. */
9
- function EmptyState({ title, description, children, style }) {
10
- return /* @__PURE__ */ jsx(View, {
11
- style: [styles.frame, style],
12
- children: /* @__PURE__ */ jsxs(View, {
13
- style: styles.column,
12
+ /** The card every empty screen and panel shares: icon, title, guidance and, when the person can act, the next step. */
13
+ function EmptyState({ title, description, icon, action, secondaryAction, size = "panel", surface = "card", tone = "neutral", children, style, testID }) {
14
+ const _styles = styles;
15
+ {
16
+ const styles = _styles.useVariants({ size: size === "inline" ? "compact" : size });
17
+ const compact = size === "compact";
18
+ const error = tone === "error";
19
+ if (size === "inline") return /* @__PURE__ */ jsxs(View, {
20
+ testID,
21
+ accessibilityRole: error ? "alert" : void 0,
22
+ accessibilityLiveRegion: error ? "polite" : void 0,
23
+ style: [styles.inline, style],
14
24
  children: [
15
- /* @__PURE__ */ jsx(View, {
16
- accessibilityRole: "header",
17
- children: wrapText(title, styles.title)
25
+ /* @__PURE__ */ jsxs(View, {
26
+ style: styles.inlineRow,
27
+ children: [error ? /* @__PURE__ */ jsx(AlertIcon, {
28
+ size: 14,
29
+ color: "red"
30
+ }) : null, /* @__PURE__ */ jsxs(Text, {
31
+ style: styles.inlineText,
32
+ children: [/* @__PURE__ */ jsx(Text, {
33
+ style: styles.inlineTitle,
34
+ children: title
35
+ }), description ? /* @__PURE__ */ jsxs(Fragment, { children: [" · ", description] }) : null]
36
+ })]
18
37
  }),
19
- description ? wrapText(description, styles.description) : null,
38
+ action || secondaryAction ? /* @__PURE__ */ jsxs(View, {
39
+ style: styles.actions,
40
+ children: [action ? /* @__PURE__ */ jsx(Button, {
41
+ variant: "outline",
42
+ size: "sm",
43
+ loading: action.loading,
44
+ disabled: action.disabled,
45
+ testID: action.testId,
46
+ onPress: action.onAction,
47
+ children: action.label
48
+ }) : null, secondaryAction ? /* @__PURE__ */ jsx(Button, {
49
+ variant: "ghost",
50
+ size: "sm",
51
+ loading: secondaryAction.loading,
52
+ disabled: secondaryAction.disabled,
53
+ testID: secondaryAction.testId,
54
+ onPress: secondaryAction.onAction,
55
+ children: secondaryAction.label
56
+ }) : null]
57
+ }) : null,
20
58
  children
21
59
  ]
22
- })
23
- });
60
+ });
61
+ const glyph = icon ?? (error ? /* @__PURE__ */ jsx(AlertIcon, { size: ICON_SIZE[size] }) : null);
62
+ return /* @__PURE__ */ jsx(View, {
63
+ testID,
64
+ accessibilityRole: error ? "alert" : void 0,
65
+ accessibilityLiveRegion: error ? "polite" : void 0,
66
+ style: [styles.frame, style],
67
+ children: /* @__PURE__ */ jsxs(View, {
68
+ style: [styles.card, surface === "card" && styles.surface],
69
+ children: [glyph ? /* @__PURE__ */ jsx(View, {
70
+ accessible: false,
71
+ importantForAccessibility: "no-hide-descendants",
72
+ style: [styles.icon, !compact && (error ? styles.iconEdgeError : styles.iconEdge)],
73
+ children: /* @__PURE__ */ jsx(IconColorContext.Provider, {
74
+ value: error ? "red" : "dim",
75
+ children: glyph
76
+ })
77
+ }) : null, /* @__PURE__ */ jsxs(View, {
78
+ style: styles.content,
79
+ children: [
80
+ /* @__PURE__ */ jsxs(View, {
81
+ style: styles.copy,
82
+ children: [/* @__PURE__ */ jsx(View, {
83
+ accessibilityRole: "header",
84
+ children: wrapText(title, styles.title)
85
+ }), description ? wrapText(description, styles.description) : null]
86
+ }),
87
+ action || secondaryAction ? /* @__PURE__ */ jsxs(View, {
88
+ style: styles.actions,
89
+ children: [action ? /* @__PURE__ */ jsx(Button, {
90
+ variant: compact ? "outline" : "primary",
91
+ size: BUTTON_SIZE[size],
92
+ loading: action.loading,
93
+ disabled: action.disabled,
94
+ testID: action.testId,
95
+ onPress: action.onAction,
96
+ children: action.label
97
+ }) : null, secondaryAction ? /* @__PURE__ */ jsx(Button, {
98
+ variant: compact ? "ghost" : "outline",
99
+ size: BUTTON_SIZE[size],
100
+ loading: secondaryAction.loading,
101
+ disabled: secondaryAction.disabled,
102
+ testID: secondaryAction.testId,
103
+ onPress: secondaryAction.onAction,
104
+ children: secondaryAction.label
105
+ }) : null]
106
+ }) : null,
107
+ children
108
+ ]
109
+ })]
110
+ })
111
+ });
112
+ }
24
113
  }
114
+ const BUTTON_SIZE = {
115
+ page: "lg",
116
+ panel: "md",
117
+ compact: "sm"
118
+ };
119
+ const ICON_SIZE = {
120
+ page: 24,
121
+ panel: 20,
122
+ compact: 16
123
+ };
25
124
  const styles = StyleSheet.create((theme) => ({
26
- frame: {
27
- flex: 1,
125
+ inline: {
126
+ alignSelf: "stretch",
28
127
  minWidth: 0,
128
+ alignItems: "flex-start",
129
+ gap: theme.spacing(2),
130
+ uni__dependencies: [0]
131
+ },
132
+ inlineText: {
133
+ flexShrink: 1,
134
+ color: theme.colors.dim,
135
+ fontFamily: fontOf(theme.fontFamily.sans),
136
+ fontSize: theme.fontSize.sm,
137
+ lineHeight: theme.lineHeight.sm,
138
+ uni__dependencies: [0]
139
+ },
140
+ inlineTitle: {
141
+ fontWeight: theme.fontWeight.medium,
142
+ uni__dependencies: [0]
143
+ },
144
+ inlineRow: {
145
+ flexDirection: "row",
29
146
  alignItems: "center",
30
- justifyContent: "center",
31
- paddingHorizontal: theme.spacing(3),
32
- paddingVertical: theme.spacing(4),
147
+ gap: theme.spacing(1),
148
+ minWidth: 0,
33
149
  uni__dependencies: [0]
34
150
  },
35
- column: {
151
+ frame: {
152
+ minWidth: 0,
153
+ variants: { size: {
154
+ page: {
155
+ flex: 1,
156
+ alignItems: "center",
157
+ justifyContent: "center",
158
+ paddingHorizontal: theme.spacing(3),
159
+ paddingVertical: theme.spacing(6)
160
+ },
161
+ panel: {
162
+ flex: 1,
163
+ alignItems: "center",
164
+ justifyContent: "center",
165
+ paddingHorizontal: theme.spacing(3),
166
+ paddingVertical: theme.spacing(4)
167
+ },
168
+ compact: { alignSelf: "stretch" }
169
+ } },
170
+ uni__dependencies: [0, 4]
171
+ },
172
+ card: {
36
173
  width: "100%",
37
- maxWidth: 520,
38
174
  minWidth: 0,
175
+ variants: { size: {
176
+ page: {
177
+ maxWidth: 520,
178
+ alignItems: "center",
179
+ gap: theme.spacing(3),
180
+ padding: theme.spacing(6)
181
+ },
182
+ panel: {
183
+ maxWidth: 520,
184
+ alignItems: "center",
185
+ gap: theme.spacing(3),
186
+ padding: theme.spacing(5)
187
+ },
188
+ compact: {
189
+ flexDirection: "row",
190
+ alignItems: "flex-start",
191
+ gap: theme.spacing(2.5),
192
+ padding: theme.spacing(3)
193
+ }
194
+ } },
195
+ uni__dependencies: [0, 4]
196
+ },
197
+ surface: {
198
+ borderRadius: theme.borderRadius.md,
199
+ borderWidth: 1,
200
+ borderStyle: "dashed",
201
+ borderColor: theme.colors.border,
202
+ uni__dependencies: [0]
203
+ },
204
+ icon: {
39
205
  alignItems: "center",
40
- gap: theme.spacing(3),
206
+ justifyContent: "center",
207
+ variants: { size: {
208
+ page: {
209
+ width: 48,
210
+ height: 48,
211
+ borderRadius: 24,
212
+ backgroundColor: theme.colors.deep
213
+ },
214
+ panel: {
215
+ width: 40,
216
+ height: 40,
217
+ borderRadius: 20,
218
+ backgroundColor: theme.colors.deep
219
+ },
220
+ compact: {
221
+ width: 20,
222
+ height: theme.lineHeight.base
223
+ }
224
+ } },
225
+ uni__dependencies: [0, 4]
226
+ },
227
+ iconEdge: {
228
+ borderWidth: 1,
229
+ borderColor: theme.colors["border-soft"],
230
+ uni__dependencies: [0]
231
+ },
232
+ iconEdgeError: {
233
+ borderWidth: 1,
234
+ borderColor: theme.colors["edge-red"],
41
235
  uni__dependencies: [0]
42
236
  },
237
+ content: {
238
+ minWidth: 0,
239
+ variants: { size: {
240
+ page: {
241
+ alignSelf: "stretch",
242
+ alignItems: "center",
243
+ gap: theme.spacing(4)
244
+ },
245
+ panel: {
246
+ alignSelf: "stretch",
247
+ alignItems: "center",
248
+ gap: theme.spacing(4)
249
+ },
250
+ compact: {
251
+ flex: 1,
252
+ alignItems: "flex-start",
253
+ gap: theme.spacing(2)
254
+ }
255
+ } },
256
+ uni__dependencies: [0, 4]
257
+ },
258
+ copy: {
259
+ minWidth: 0,
260
+ variants: { size: {
261
+ page: {
262
+ alignItems: "center",
263
+ gap: theme.spacing(1.5)
264
+ },
265
+ panel: {
266
+ alignItems: "center",
267
+ gap: theme.spacing(1.5)
268
+ },
269
+ compact: {
270
+ alignSelf: "stretch",
271
+ gap: theme.spacing(.5)
272
+ }
273
+ } },
274
+ uni__dependencies: [0, 4]
275
+ },
276
+ actions: {
277
+ flexDirection: "row",
278
+ flexWrap: "wrap",
279
+ alignItems: "center",
280
+ gap: theme.spacing(2),
281
+ variants: { size: {
282
+ page: { justifyContent: "center" },
283
+ panel: { justifyContent: "center" },
284
+ compact: { justifyContent: "flex-start" }
285
+ } },
286
+ uni__dependencies: [0, 4]
287
+ },
43
288
  title: {
44
289
  color: theme.colors.hi,
45
290
  fontFamily: fontOf(theme.fontFamily.sans),
46
- fontSize: theme.fontSize.lg,
47
- lineHeight: theme.lineHeight.lg,
48
291
  fontWeight: theme.fontWeight.semibold,
49
- textAlign: "center",
50
- uni__dependencies: [0]
292
+ variants: { size: {
293
+ page: {
294
+ fontSize: theme.fontSize.xl,
295
+ lineHeight: theme.lineHeight.xl,
296
+ letterSpacing: theme.letterSpacing.xl,
297
+ textAlign: "center"
298
+ },
299
+ panel: {
300
+ fontSize: theme.fontSize.lg,
301
+ lineHeight: theme.lineHeight.lg,
302
+ textAlign: "center"
303
+ },
304
+ compact: {
305
+ fontSize: theme.fontSize.base,
306
+ lineHeight: theme.lineHeight.base
307
+ }
308
+ } },
309
+ uni__dependencies: [0, 4]
51
310
  },
52
311
  description: {
53
312
  color: theme.colors.dim,
54
313
  fontFamily: fontOf(theme.fontFamily.sans),
55
- fontSize: theme.fontSize.base,
56
- lineHeight: theme.lineHeightRelaxed.base,
57
- textAlign: "center",
58
- uni__dependencies: [0]
314
+ variants: { size: {
315
+ page: {
316
+ maxWidth: 360,
317
+ fontSize: theme.fontSize.base,
318
+ lineHeight: theme.lineHeightRelaxed.base,
319
+ textAlign: "center"
320
+ },
321
+ panel: {
322
+ maxWidth: 360,
323
+ fontSize: theme.fontSize.base,
324
+ lineHeight: theme.lineHeightRelaxed.base,
325
+ textAlign: "center"
326
+ },
327
+ compact: {
328
+ fontSize: theme.fontSize.sm,
329
+ lineHeight: theme.lineHeight.sm
330
+ }
331
+ } },
332
+ uni__dependencies: [0, 4]
59
333
  }
60
334
  }));
61
335
 
@@ -1 +1 @@
1
- {"version":3,"file":"EmptyState.mjs","names":["ReactNode","StyleProp","ViewStyle","StyleSheet","fontOf","wrapText","EmptyStateProps","title","description","children","style","EmptyState","styles","frame","column","create","theme","flex","minWidth","alignItems","justifyContent","paddingHorizontal","spacing","paddingVertical","uni__dependencies","width","maxWidth","gap","color","colors","hi","fontFamily","sans","fontSize","lg","lineHeight","fontWeight","semibold","textAlign","dim","base","lineHeightRelaxed"],"sources":["../../src/components/EmptyState.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport { type StyleProp, View, type ViewStyle } from 'react-native';\nimport { StyleSheet } from 'react-native-unistyles';\n\nimport { fontOf } from '../lib/fonts';\nimport { wrapText } from '../lib/wrapText';\n\nexport interface EmptyStateProps {\n title: ReactNode;\n description?: ReactNode;\n /** Optional calls to action under the copy. */\n children?: ReactNode;\n style?: StyleProp<ViewStyle>;\n}\n\n/** The centred \"nothing here yet\" block every empty screen and panel shares. */\nexport function EmptyState({ title, description, children, style }: EmptyStateProps) {\n return (\n <View style={[styles.frame, style]}>\n <View style={styles.column}>\n <View accessibilityRole=\"header\">{wrapText(title, styles.title)}</View>\n {description ? wrapText(description, styles.description) : null}\n {children}\n </View>\n </View>\n );\n}\n\nconst styles = StyleSheet.create((theme) => ({\n frame: {\n flex: 1,\n minWidth: 0,\n alignItems: 'center',\n justifyContent: 'center',\n paddingHorizontal: theme.spacing(3),\n paddingVertical: theme.spacing(4),\n },\n column: {\n width: '100%',\n maxWidth: 520,\n minWidth: 0,\n alignItems: 'center',\n gap: theme.spacing(3),\n },\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 textAlign: 'center',\n },\n description: {\n color: theme.colors.dim,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.base,\n lineHeight: theme.lineHeightRelaxed.base,\n textAlign: 'center',\n },\n}));\n"],"mappings":";;;;;;;;AAgBA,SAAgBW,WAAW,EAAEJ,OAAOC,aAAaC,UAAUC,SAA0B;CACnF,OACE,oBAAC,MAAD;EAAM,OAAO,CAACE,OAAOC,OAAOH,KAAK;YAC/B,qBAAC,MAAD;GAAM,OAAOE,OAAOE;aAApB;IACE,oBAAC,MAAD;KAAM,mBAAkB;eAAUT,SAASE,OAAOK,OAAOL,KAAK;IAAQ;IACrEC,cAAcH,SAASG,aAAaI,OAAOJ,WAAW,IAAI;IAC1DC;GACG;;CACF;AAEV;AAEA,MAAMG,SAAST,WAAWY,QAAQC,WAAW;CAC3CH,OAAO;EACLI,MAAM;EACNC,UAAU;EACVC,YAAY;EACZC,gBAAgB;EAChBC,mBAAmBL,MAAMM,QAAQ,CAAC;EAClCC,iBAAiBP,MAAMM,QAAQ,CAAC;EAACE,mBAAA,CAAA,CAAA;CACnC;CACAV,QAAQ;EACNW,OAAO;EACPC,UAAU;EACVR,UAAU;EACVC,YAAY;EACZQ,KAAKX,MAAMM,QAAQ,CAAC;EAACE,mBAAA,CAAA,CAAA;CACvB;CACAjB,OAAO;EACLqB,OAAOZ,MAAMa,OAAOC;EACpBC,YAAY3B,OAAOY,MAAMe,WAAWC,IAAI;EACxCC,UAAUjB,MAAMiB,SAASC;EACzBC,YAAYnB,MAAMmB,WAAWD;EAC7BE,YAAYpB,MAAMoB,WAAWC;EAC7BC,WAAW;EAAQd,mBAAA,CAAA,CAAA;CACrB;CACAhB,aAAa;EACXoB,OAAOZ,MAAMa,OAAOU;EACpBR,YAAY3B,OAAOY,MAAMe,WAAWC,IAAI;EACxCC,UAAUjB,MAAMiB,SAASO;EACzBL,YAAYnB,MAAMyB,kBAAkBD;EACpCF,WAAW;EAAQd,mBAAA,CAAA,CAAA;CACrB;AACF,EAAE"}
1
+ {"version":3,"file":"EmptyState.mjs","names":["IconColorContext","ReactNode","StyleProp","ViewStyle","StyleSheet","AlertIcon","fontOf","wrapText","Button","EmptyStateAction","label","onAction","loading","disabled","testId","EmptyStateSize","EmptyStateProps","title","description","icon","action","secondaryAction","size","surface","tone","children","style","testID","EmptyState","_styles","styles","useVariants","compact","error","undefined","inline","inlineRow","inlineText","inlineTitle","actions","glyph","ICON_SIZE","frame","card","iconEdgeError","iconEdge","content","copy","BUTTON_SIZE","page","panel","const","create","theme","alignSelf","minWidth","alignItems","gap","spacing","uni__dependencies","flexShrink","color","colors","dim","fontFamily","sans","fontSize","sm","lineHeight","fontWeight","medium","flexDirection","variants","flex","justifyContent","paddingHorizontal","paddingVertical","width","maxWidth","padding","borderRadius","md","borderWidth","borderStyle","borderColor","border","height","backgroundColor","deep","base","flexWrap","hi","semibold","xl","letterSpacing","textAlign","lg","lineHeightRelaxed"],"sources":["../../src/components/EmptyState.tsx"],"sourcesContent":["import { IconColorContext } from '@agimon-ai/po-native-components/shell';\nimport type { ReactNode } from 'react';\nimport { type StyleProp, Text, View, type ViewStyle } from 'react-native';\nimport { StyleSheet } from 'react-native-unistyles';\n\nimport { AlertIcon } from '../icons/icons';\nimport { fontOf } from '../lib/fonts';\nimport { wrapText } from '../lib/wrapText';\nimport { Button } from './Button';\n\n/** One button an empty state offers: the next step that fills the surface. */\nexport interface EmptyStateAction {\n label: string;\n onAction: () => void;\n loading?: boolean;\n disabled?: boolean;\n testId?: string;\n}\n\nexport type EmptyStateSize = 'page' | 'panel' | 'compact' | 'inline';\n\nexport interface EmptyStateProps {\n title: ReactNode;\n /** Guidance: why the surface is empty and what fills it. */\n description?: ReactNode;\n /** 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`. */\n icon?: ReactNode;\n /** The one primary step. Filled jade on page and panel, outline when compact. */\n action?: EmptyStateAction;\n /** A quieter second step, such as clearing a filter or retrying. */\n secondaryAction?: EmptyStateAction;\n /**\n * page: a whole screen. panel: a dock or tab (the default).\n * compact: a list row; left-aligned and never takes `flex: 1`.\n * inline: one quiet line under a header that already names the surface, such as an activity card.\n * Drops the icon and frame; `surface` does not apply.\n */\n size?: EmptyStateSize;\n /** `plain` drops the card border when the empty state already sits inside a card. */\n surface?: 'card' | 'plain';\n /** `error` announces the state as an alert and tints only the icon red. */\n tone?: 'neutral' | 'error';\n /** Anything under the actions: a hint, a status line. */\n children?: ReactNode;\n style?: StyleProp<ViewStyle>;\n testID?: string;\n}\n\n/** The card every empty screen and panel shares: icon, title, guidance and, when the person can act, the next step. */\nexport function EmptyState({\n title,\n description,\n icon,\n action,\n secondaryAction,\n size = 'panel',\n surface = 'card',\n tone = 'neutral',\n children,\n style,\n testID,\n}: EmptyStateProps) {\n // Inline has no variant styles of its own; hooks still run on every render.\n styles.useVariants({ size: size === 'inline' ? 'compact' : size });\n const compact = size === 'compact';\n const error = tone === 'error';\n if (size === 'inline') {\n return (\n <View\n testID={testID}\n accessibilityRole={error ? 'alert' : undefined}\n accessibilityLiveRegion={error ? 'polite' : undefined}\n style={[styles.inline, style]}\n >\n {/* As at every other size, only the icon is red; the words stay readable. */}\n <View style={styles.inlineRow}>\n {error ? <AlertIcon size={14} color=\"red\" /> : null}\n <Text style={styles.inlineText}>\n <Text style={styles.inlineTitle}>{title}</Text>\n {description ? <> · {description}</> : null}\n </Text>\n </View>\n {action || secondaryAction ? (\n <View style={styles.actions}>\n {action ? (\n <Button\n variant=\"outline\"\n size=\"sm\"\n loading={action.loading}\n disabled={action.disabled}\n testID={action.testId}\n onPress={action.onAction}\n >\n {action.label}\n </Button>\n ) : null}\n {secondaryAction ? (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n loading={secondaryAction.loading}\n disabled={secondaryAction.disabled}\n testID={secondaryAction.testId}\n onPress={secondaryAction.onAction}\n >\n {secondaryAction.label}\n </Button>\n ) : null}\n </View>\n ) : null}\n {children}\n </View>\n );\n }\n const glyph = icon ?? (error ? <AlertIcon size={ICON_SIZE[size]} /> : null);\n return (\n <View\n testID={testID}\n accessibilityRole={error ? 'alert' : undefined}\n accessibilityLiveRegion={error ? 'polite' : undefined}\n style={[styles.frame, style]}\n >\n <View style={[styles.card, surface === 'card' && styles.surface]}>\n {glyph ? (\n <View\n accessible={false}\n importantForAccessibility=\"no-hide-descendants\"\n style={[styles.icon, !compact && (error ? styles.iconEdgeError : styles.iconEdge)]}\n >\n <IconColorContext.Provider value={error ? 'red' : 'dim'}>{glyph}</IconColorContext.Provider>\n </View>\n ) : null}\n <View style={styles.content}>\n <View style={styles.copy}>\n <View accessibilityRole=\"header\">{wrapText(title, styles.title)}</View>\n {description ? wrapText(description, styles.description) : null}\n </View>\n {action || secondaryAction ? (\n <View style={styles.actions}>\n {action ? (\n <Button\n variant={compact ? 'outline' : 'primary'}\n size={BUTTON_SIZE[size]}\n loading={action.loading}\n disabled={action.disabled}\n testID={action.testId}\n onPress={action.onAction}\n >\n {action.label}\n </Button>\n ) : null}\n {secondaryAction ? (\n <Button\n variant={compact ? 'ghost' : 'outline'}\n size={BUTTON_SIZE[size]}\n loading={secondaryAction.loading}\n disabled={secondaryAction.disabled}\n testID={secondaryAction.testId}\n onPress={secondaryAction.onAction}\n >\n {secondaryAction.label}\n </Button>\n ) : null}\n </View>\n ) : null}\n {children}\n </View>\n </View>\n </View>\n );\n}\n\nconst BUTTON_SIZE = { page: 'lg', panel: 'md', compact: 'sm' } as const;\nconst ICON_SIZE = { page: 24, panel: 20, compact: 16 } as const;\nconst styles = StyleSheet.create((theme) => ({\n inline: { alignSelf: 'stretch', minWidth: 0, alignItems: 'flex-start', gap: theme.spacing(2) },\n inlineText: {\n flexShrink: 1,\n color: theme.colors.dim,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontSize: theme.fontSize.sm,\n lineHeight: theme.lineHeight.sm,\n },\n inlineTitle: { fontWeight: theme.fontWeight.medium },\n inlineRow: { flexDirection: 'row', alignItems: 'center', gap: theme.spacing(1), minWidth: 0 },\n frame: {\n minWidth: 0,\n variants: {\n size: {\n page: {\n flex: 1,\n alignItems: 'center',\n justifyContent: 'center',\n paddingHorizontal: theme.spacing(3),\n paddingVertical: theme.spacing(6),\n },\n panel: {\n flex: 1,\n alignItems: 'center',\n justifyContent: 'center',\n paddingHorizontal: theme.spacing(3),\n paddingVertical: theme.spacing(4),\n },\n compact: { alignSelf: 'stretch' },\n },\n },\n },\n card: {\n width: '100%',\n minWidth: 0,\n variants: {\n size: {\n page: { maxWidth: 520, alignItems: 'center', gap: theme.spacing(3), padding: theme.spacing(6) },\n panel: { maxWidth: 520, alignItems: 'center', gap: theme.spacing(3), padding: theme.spacing(5) },\n compact: { flexDirection: 'row', alignItems: 'flex-start', gap: theme.spacing(2.5), padding: theme.spacing(3) },\n },\n },\n },\n // A quiet dashed outline with no fill, as on the web.\n surface: {\n borderRadius: theme.borderRadius.md,\n borderWidth: 1,\n borderStyle: 'dashed',\n borderColor: theme.colors.border,\n },\n icon: {\n alignItems: 'center',\n justifyContent: 'center',\n variants: {\n size: {\n page: { width: 48, height: 48, borderRadius: 24, backgroundColor: theme.colors.deep },\n panel: { width: 40, height: 40, borderRadius: 20, backgroundColor: theme.colors.deep },\n compact: { width: 20, height: theme.lineHeight.base },\n },\n },\n },\n iconEdge: { borderWidth: 1, borderColor: theme.colors['border-soft'] },\n iconEdgeError: { borderWidth: 1, borderColor: theme.colors['edge-red'] },\n content: {\n minWidth: 0,\n variants: {\n size: {\n page: { alignSelf: 'stretch', alignItems: 'center', gap: theme.spacing(4) },\n panel: { alignSelf: 'stretch', alignItems: 'center', gap: theme.spacing(4) },\n compact: { flex: 1, alignItems: 'flex-start', gap: theme.spacing(2) },\n },\n },\n },\n copy: {\n minWidth: 0,\n variants: {\n size: {\n page: { alignItems: 'center', gap: theme.spacing(1.5) },\n panel: { alignItems: 'center', gap: theme.spacing(1.5) },\n compact: { alignSelf: 'stretch', gap: theme.spacing(0.5) },\n },\n },\n },\n actions: {\n flexDirection: 'row',\n flexWrap: 'wrap',\n alignItems: 'center',\n gap: theme.spacing(2),\n variants: {\n size: {\n page: { justifyContent: 'center' },\n panel: { justifyContent: 'center' },\n compact: { justifyContent: 'flex-start' },\n },\n },\n },\n title: {\n color: theme.colors.hi,\n fontFamily: fontOf(theme.fontFamily.sans),\n fontWeight: theme.fontWeight.semibold,\n variants: {\n size: {\n page: {\n fontSize: theme.fontSize.xl,\n lineHeight: theme.lineHeight.xl,\n letterSpacing: theme.letterSpacing.xl,\n textAlign: 'center',\n },\n panel: { fontSize: theme.fontSize.lg, lineHeight: theme.lineHeight.lg, textAlign: 'center' },\n compact: { fontSize: theme.fontSize.base, lineHeight: theme.lineHeight.base },\n },\n },\n },\n description: {\n color: theme.colors.dim,\n fontFamily: fontOf(theme.fontFamily.sans),\n variants: {\n size: {\n page: {\n maxWidth: 360,\n fontSize: theme.fontSize.base,\n lineHeight: theme.lineHeightRelaxed.base,\n textAlign: 'center',\n },\n panel: {\n maxWidth: 360,\n fontSize: theme.fontSize.base,\n lineHeight: theme.lineHeightRelaxed.base,\n textAlign: 'center',\n },\n compact: { fontSize: theme.fontSize.sm, lineHeight: theme.lineHeight.sm },\n },\n },\n },\n}));\n"],"mappings":";;;;;;;;;;;;AAiDA,SAAgB4B,WAAW,EACzBX,OACAC,aACAC,MACAC,QACAC,iBACAC,OAAO,SACPC,UAAU,QACVC,OAAO,WACPC,UACAC,OACAC,UACkB;CAAA,MAAAE,UAAAC;CAAA;EAAA,MAAAA,SAAAD,QAAAE,YAEC,EAAET,MAAMA,SAAS,WAAW,YAAYA,KAAK,CAAC;EACjE,MAAMU,UAAUV,SAAS;EACzB,MAAMW,QAAQT,SAAS;EACvB,IAAIF,SAAS,UACX,OACE,qBAAC,MAAD;GACUK;GACR,mBAAmBM,QAAQ,UAAUC;GACrC,yBAAyBD,QAAQ,WAAWC;GAC5C,OAAO,CAACJ,OAAOK,QAAQT,KAAK;aAJ9B;IAOE,qBAAC,MAAD;KAAM,OAAOI,OAAOM;eAApB,CACGH,QAAQ,oBAAC,WAAD;MAAW,MAAM;MAAI,OAAM;KAAK,KAAM,MAC/C,qBAAC,MAAD;MAAM,OAAOH,OAAOO;gBAApB,CACE,oBAAC,MAAD;OAAM,OAAOP,OAAOQ;iBAAcrB;MAAY,IAC7CC,cAAc,4CAAE,OAAIA,WAAY,OAAM,IACnC;OACF;;IACLE,UAAUC,kBACT,qBAAC,MAAD;KAAM,OAAOS,OAAOS;eAApB,CACGnB,SACC,oBAAC,QAAD;MACE,SAAQ;MACR,MAAK;MACL,SAASA,OAAOR;MAChB,UAAUQ,OAAOP;MACjB,QAAQO,OAAON;MACf,SAASM,OAAOT;gBAEfS,OAAOV;KACF,KACN,MACHW,kBACC,oBAAC,QAAD;MACE,SAAQ;MACR,MAAK;MACL,SAASA,gBAAgBT;MACzB,UAAUS,gBAAgBR;MAC1B,QAAQQ,gBAAgBP;MACxB,SAASO,gBAAgBV;gBAExBU,gBAAgBX;KACX,KACN,IACA;SACJ;IACHe;GACG;;EAGV,MAAMe,QAAQrB,SAASc,QAAQ,oBAAC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;EACpBC,YAAY1D,OAAO+C,MAAMW,WAAWC,IAAI;EACxCO,UAAU,EACRlD,MAAM;GACJ2B,MAAM;IACJ6B,UAAU;IACVZ,UAAUb,MAAMa,SAASuB;IACzBrB,YAAYf,MAAM4C,kBAAkBR;IACpCM,WAAW;GACb;GACA7C,OAAO;IACL4B,UAAU;IACVZ,UAAUb,MAAMa,SAASuB;IACzBrB,YAAYf,MAAM4C,kBAAkBR;IACpCM,WAAW;GACb;GACA/D,SAAS;IAAEkC,UAAUb,MAAMa,SAASC;IAAIC,YAAYf,MAAMe,WAAWD;GAAG;EAC1E,EACF;EAACR,mBAAA,CAAA,GAAA,CAAA;CACH;AACF,EAAE"}
@@ -0,0 +1,48 @@
1
+ import { FileItem, FileKind, FileLayout, FileModified, FileSort, FileSortDirection, FileTreeRow } from "@agimon-ai/po-web-components/text";
2
+ import { ReactNode } from "react";
3
+ //#region src/components/FileList.d.ts
4
+ export interface FileBrowserControls {
5
+ layout: FileLayout;
6
+ onLayoutChange: (layout: FileLayout) => void;
7
+ query: string;
8
+ onQueryChange: (query: string) => void;
9
+ type: FileKind | 'any';
10
+ onTypeChange: (type: FileKind | 'any') => void;
11
+ modified: FileModified;
12
+ onModifiedChange: (modified: FileModified) => void;
13
+ sort: FileSort;
14
+ onSortChange: (sort: FileSort) => void;
15
+ direction: FileSortDirection;
16
+ onDirectionChange: (direction: FileSortDirection) => void;
17
+ rows: readonly FileTreeRow[];
18
+ onToggleDirectory: (path: string) => void;
19
+ selected?: FileItem;
20
+ onSelect: (item: FileItem) => void;
21
+ onCloseSelection: () => void;
22
+ totalCount: number;
23
+ onViewableImagesChange?: (paths: readonly string[]) => void;
24
+ /** A loaded thumbnail or a placeholder for an image file; `compact` is a list row's small square. */
25
+ renderImage?: (item: FileItem, compact: boolean) => ReactNode;
26
+ /** Drawn first in the list, above the controls, such as the native dock's tab strip. */
27
+ header?: ReactNode;
28
+ /** Inside a bottom sheet with no scroll view of its own: the list is the sheet's only scroll owner. */
29
+ sheet?: boolean;
30
+ }
31
+ export interface FileListProps {
32
+ items: readonly FileItem[];
33
+ onOpen: (path: string) => void;
34
+ loading?: boolean;
35
+ error?: string;
36
+ /** Offered beside a failed read as Try again. */
37
+ onRetry?: () => void;
38
+ /** Names the list for search and layout, such as "artifacts" or "Personal". */
39
+ label: string;
40
+ /** Guidance under the empty card's title: why the list is empty and what fills it. */
41
+ emptyText: string;
42
+ grid?: boolean;
43
+ browser?: FileBrowserControls;
44
+ }
45
+ /** A folder of files on the phone: recent rows, or a browser with layouts, filters and a swipeable selection. Presentation only. */
46
+ export declare function FileList({ items, onOpen, loading, error, onRetry, grid, browser, label, emptyText }: FileListProps): import("react").JSX.Element;
47
+ //#endregion
48
+ //# sourceMappingURL=FileList.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileList.d.mts","names":[],"sources":["../../src/components/FileList.tsx"],"mappings":";;;iBA4CiB;EACf,QAAQ;EACR,iBAAiB,QAAQ;EACzB;EACA,gBAAgB;EAChB,MAAM;EACN,eAAe,MAAM;EACrB,UAAU;EACV,mBAAmB,UAAU;EAC7B,MAAM;EACN,eAAe,MAAM;EACrB,WAAW;EACX,oBAAoB,WAAW;EAC/B,eAAe;EACf,oBAAoB;EACpB,WAAW;EACX,WAAW,MAAM;EACjB;EACA;EACA,0BAA0B;;EAE1B,eAAe,MAAM,UAAU,qBAAqB;;EAEpD,SAAS;;EAET;;iBAGe;EACf,gBAAgB;EAChB,SAAS;EACT;EACA;;EAEA;;EAEA;;EAEA;EACA;EACA,UAAU;;;wBAII,WACd,OACA,QACA,SACA,OACA,SACA,MACA,SACA,OACA,aACC,gCAAa,IAAA"}